GamebuinoClassic archive

Archive of the Gamebuino Classic forum (2014-2018), rebuilt from the pages kept by the Wayback Machine: only part of the topics and pages were captured. Read-only. Removal on request: hi@gamebuino.com.

Forum › Project Guidance & Game development

2048 for GameBuino

JWinslow23 Sat Feb 28, 2015 6:27 pm
Hello! I am JWinslow23, and I'm new to the Gamebuino community. The first game I'm attempting to make is a port of 2048 (yes, I know A2K already exists, but I wanna make mine different). Here's how it looks so far:
Image

I have attached a .zip file containing the Arduino sketch, .hex file, and a .gif of gameplay. Tell me what you all think of it so far!
(And don't laugh at my code so far...I'm a beginner :lol: )
Attachments: GameBuino2048.zip
JWinslow23 Tue Mar 03, 2015 9:16 pm
Update!

* Added scores
* Added a highscore
* Added a reset button (B)
* Cleaned up some of the code

Right now, despite what it says over to the right, A does nothing.

Todo:
* Add highscore delete button
* Add way to win
* What else do you think I should do, guys?

Screenshot:
Image

.zip attached. Tell me what you think!
Attachments: GameBuino2048v2.zip
Sorunome Tue Mar 03, 2015 10:19 pm
Looking great so far!
I wonder how your sprite for 131072 is looking like....
JWinslow23 Tue Mar 03, 2015 11:58 pm
Sorunome wrote:Looking great so far!
I wonder how your sprite for 131072 is looking like....

Oo, see, here's the thing...

Sorunome, you know that back over on Omnimaga, I made a 2048 clone in Axe? Those tile sprites were my original design. They only went up to 2048 because that's all I had room for with the size of the tiles.

2048Mockup.PNG
2048Mockup.PNG (1.31 KiB) Viewed 5985 times


As you can see, I barely even had room for 1024 and 2048...so that was the reason I had to have them changed.

The reason I chose those old graphics were because they were the only tile graphics I had that could fit on the screen (oh, Gamebuino, you and your 84x48 pixels :lol: ). However, I see a way I could make the tiles all 1 pixel wider...I'll see what I can do to redesign them. Just tinkering around with a picture editor, I already see a 131072 design.
Skyrunner65 Wed Mar 04, 2015 4:03 am
Could you have the bottom right say stuff like "Awesome!" when you make something over 16?
JWinslow23 Wed Mar 04, 2015 4:55 pm
Skyrunner65 wrote:Could you have the bottom right say stuff like "Awesome!" when you make something over 16?

...not exactly sure what you mean.

Could I maybe do a popup when you generate different numbered tiles for the first time (or surpassed a score or something)?

Also, now I have new tile graphics (that go up to the maximum tile possible, 131072):
2048GBTiles.png
2048GBTiles.png (786 Bytes) Viewed 5966 times


How do those look?

And one final note...I was told in another thread that the way this version does savegames, if played enough, could cause EEPROM to be "permanently destroyed in just a couple of months". Next update should fix it, but in the meantime, just don't play this game on real hardware. To be safe :|
Skyrunner65 Thu Mar 05, 2015 3:54 am
Both are acceptable.
Also, 131072? That's insane! (Note: if you hit that number, make it say "Insane!". Just saying.)

Boy, it's a good thing I don't have the hardware(yet...)!
Sorunome Thu Mar 05, 2015 1:09 pm
I like the look of the tiles, I will definitely try it out once I get my hardware :)
JWinslow23 Fri Mar 06, 2015 6:54 pm
Sorunome wrote:I like the look of the tiles, I will definitely try it out once I get my hardware :)


And I'll be sure to get another release out this weekend (that shouldn't destroy the ability to save, and that goes up to 131072 ;) ).

And, well...even if you play THAT much and THAT well, you still will have exactly 1/10th of a chance of getting 131072 even if you have every other tile on the board. I personally can never get past 4096 :lol:

EDIT: Well...the tile graphics I showed...I just realized there is an error in the 65535 tile...it's supposed to be 65536. :|

Trust me, next update will have a correction.
JWinslow23 Sun Mar 08, 2015 1:40 am
Update!

* Added popup messages when you combine tiles (not sure it was the best idea, though)
* Added miscellaneous popup messages
* Added save function (press A)
* Added highscore and savegame delete function (press and hold B and tap A)

I changed the function of what A would have done (show game info and controls). Now it saves the game.
Saving should also work fine now (unless you tap A over and over again :lol: ). Remember not to save too much (it saves automatically when you exit, just so you know. Should it not do that?).

Todo:

* Add way to win
* Add way to lose
* What else do you think I should do, guys?

Screenshot:
Image

.zip attached. Tell me what you think!
Attachments: Gamebuino2048v3.zip
JWinslow23 Sat Mar 14, 2015 6:40 pm
Update!

* Added way to win
* Added way to lose
* This is pretty much a finished game right now.

Todo:

* What else do you think I should do, guys?
* Wonder what my next project will be...
* ...will do serious game making work when I get the thing by the end of the month.

Screenshot:
Image

.zip attached. Tell me what you think!
erico Sat Mar 14, 2015 7:04 pm
Looks very polished by those menu/piece animations!
JWinslow23 Sat Mar 14, 2015 10:22 pm
erico wrote:Looks very polished by those menu/piece animations!


Thanks!

Heheh, it'd be nice if it were simpler to make those boxes....
Sorunome Thu Mar 19, 2015 6:37 pm
Just tried it out on real hardware and it works well :D

Except when you flash back the sd card loader and re-flash the 2048 image the eeprom isn't saved :/ (i was at 1024 :P)

EDIT: apparently the save also gets lost if you simply turn off and back on
JWinslow23 Sat Mar 21, 2015 1:19 am
Sorunome wrote:Just tried it out on real hardware and it works well :D

Except when you flash back the sd card loader and re-flash the 2048 image the eeprom isn't saved :/ (i was at 1024 :P)

EDIT: apparently the save also gets lost if you simply turn off and back on


Hrm, so saving isn't working? :\

Can I get some help on that, someone?
milk Tue Mar 24, 2015 8:30 pm
In your setup() function, you call the function "isValidGame()" where the gameState structure is used while it was not initialised yet. You need to read the EEPROM before testing any gameState value, or test the value directly in the EEPROM.

Code:
boolean isValidGame() {
  char id[sizeof(GAME_ID)];
  for (int x = 0; x < sizeof(id); x++)
    ((uint8_t*)&id)[x] = EEPROM.read(x);
  return strcmp_P(id, GAME_ID) == 0;
}
JWinslow23 Tue Mar 24, 2015 9:58 pm
Thank you.

Update.

THIS is the final version. Probably will never continue this, unless people want more stuff or something :|

Screenie irrelevant, literally all I changed was the save-checking subroutine.

Download attached. Give me some feedback! I should get a real Gamebuino by the end of the month!
Sorunome Tue Mar 24, 2015 10:29 pm
I can confirm that saving is working now! Yay!
JWinslow23 Wed Mar 25, 2015 2:19 am
:)

Maybe a Tetris clone next...
Sorunome Wed Mar 25, 2015 7:46 pm
Suggestion: make it reset the save once you lose >:D
JWinslow23 Thu Mar 26, 2015 12:03 am
Sorunome wrote:Suggestion: make it reset the save once you lose >:D

:P

But yeah, I'll just plan out a Tetris right now. First I want to know what I should base it off of.

Should I base it off of the Nintendo NES Tetris, the Tengen NES Tetris, any modern Tetris clone, or something else (please give options)?
Quirby64 Thu Mar 26, 2015 12:26 am
Just gonna barge into this topic and say this : while I like Tetris as much as anyone else, I think you might wanna take a stab at something similar to Tetris. Like Columns or something, there's plenty to base it off of. Heck, something like Pac-Attack, or make the bricks circles, or have Tetris with GRAVITY (aka : instant win edition)
JWinslow23 Thu Mar 26, 2015 5:34 pm
How about I make a customizable gravity, rotation system, and a whole lot of other different features? I might also have a hold function (and maybe a ghost piece). There's a lot of stuff I have in my head about it.
JWinslow23 Fri Mar 27, 2015 11:12 pm
I have decided the game is too slow.

Removed all delay.

Screenie irrelevant.
Attachments: Gamebuino2048v6.zip