New Button Presser Game
-
So I've recently finished a game called Button Presser, and it's finally done! The goal is to press the button and then buy stuff from the shop with your presses. It's my most complicated game yet and in I'm proud of it ☺️. But there still is an issue, around every 30 seconds, your game just crashes, and all your presses are gone 😥. (Feel free to give tips and help or give me ideas for items in the shop!
ID: SG673MND1Q -
Well done on another game!
I think I see what's causing the problem. On lines 34 to 37 you have some createSprite() and loadImage() functions which are inside the main loop. Creating or loading something inside a loop will eat up memory each frame and cause an error eventually, so I would just move those to be above the main loop. (I'd also move the next few lines, setSpriteImage/Scale, with them to keep it all together neatly.)