chriskdon / Spots

Summer Android Game
0 stars 0 forks source link

Fix end game bug #55

Closed kubasub closed 9 years ago

kubasub commented 9 years ago

Issue: When the game ends, going to the high score screen and then back to the game called onGameOver() again which set the same high score again.

Fix: Added a boolean that indicates that a game is "stale" and should be only used for display purposes. This way, no logic in the game thread is ran once onGameOver() is called and the game is set to be stale.

Now that I got this bug out of the way..I think we're ready to submit it!

chriskdon commented 9 years ago

@kubasub looks good. For future reference for things like booleans you can use the volatile keyword for atomicity I believe. I think it may be slightly more performant I'm not sure. But beware of its use on integers. http://stackoverflow.com/questions/19744508/volatile-vs-atomic