Page 2 of 3

Re: 2048 for GameBuino

PostPosted: Sat Mar 14, 2015 6:40 pm
by JWinslow23
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!

Re: 2048 for GameBuino

PostPosted: Sat Mar 14, 2015 7:04 pm
by erico
Looks very polished by those menu/piece animations!

Re: 2048 for GameBuino

PostPosted: Sat Mar 14, 2015 10:22 pm
by JWinslow23
erico wrote:Looks very polished by those menu/piece animations!


Thanks!

Heheh, it'd be nice if it were simpler to make those boxes....

Re: 2048 for GameBuino

PostPosted: Thu Mar 19, 2015 6:37 pm
by Sorunome
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

Re: 2048 for GameBuino

PostPosted: Sat Mar 21, 2015 1:19 am
by JWinslow23
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?

Re: 2048 for GameBuino

PostPosted: Tue Mar 24, 2015 8:30 pm
by milk
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: Select all
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;
}

Re: 2048 for GameBuino

PostPosted: Tue Mar 24, 2015 9:58 pm
by JWinslow23
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!

Re: 2048 for GameBuino

PostPosted: Tue Mar 24, 2015 10:29 pm
by Sorunome
I can confirm that saving is working now! Yay!

Re: 2048 for GameBuino

PostPosted: Wed Mar 25, 2015 2:19 am
by JWinslow23
:)

Maybe a Tetris clone next...

Re: 2048 for GameBuino

PostPosted: Wed Mar 25, 2015 7:46 pm
by Sorunome
Suggestion: make it reset the save once you lose >:D