EEPROM high score data is super high

LOL … its not a competition!

Oops … I could just as easily said PD::drawBitmap(enemy1.x, enemy1.y, ImageName); as I have been doing too much Pokitto lately. Let me fix the original entry …

1 Like

No, but I genuinely enjoy showing people the ropes and helping other people make their first games.
(More so than merely making my own games.)

You added the missing argument but forgot to change arduboy. to Sprites:: (or sprites. if you really want to add the empty Sprites variable).

1 Like

I need to make an Arduboy game to remind me of the API :slight_smile:

1 Like

Perhaps we’re in need of a game jam?..

1 Like

So in my new game, I have the eeprom set up exactly like the old one (coin rush). So I have it set so that whenever you press A, the eeprom saves the money counter with .put, and in the setup(), I have it so it retrieves the money counter with .get. In Coin Rush, my highscore was 17, which was saved onto the eeprom. Now when I turn on my new game, the money counter shows 17, which is what my saved highscore in Coin Rush was. Is this a bug, or is my new game using the same eeprom space as my old game?

It’s impossible to say for definite because your Arduboy-City-Life repository doesn’t include any EEPROM code, but I’d presume yes, you’re probably trying to use the same location.

In Coin Rush you’re using EEPROM_STORAGE_SPACE_START, which is the first address available after the Arduboy2 settings, and the first address any game is allowed to use for game data.
(Spoiler: it doesn’t get magically turned into a unique address for each game, it’s always the same address.)

Ideally you’re supposed to pick a random offset to help reduce EEPROM wear and reduce the chances of clashing with other games, but there’s only 1024 bytes of EEPROM (of which 16 bytes are reserved for Arduboy2 settings), so it’s inevitable that games will start clashing with each other.

By the way, you don’t have to explicitly include EEPROM.h.
.ino files automatically include Arduino.h, which already includes EEPROM.h.

What do you mean by a random offset?

Pick a number between 0 and (1008 - “the size of EEPROM space you’re using”). Use that number plus EEPROM_STORAGE_SPACE_START as the offset into EEPROM to store your data. Cross your fingers that no other popular game is also using the EEPROM area you chose.