How to save high score? file provided
ohtukrw
Sir dogeMember Posts: 106
When my hero loses all lives, the score points reset to 0.
There is no problem saving the highscore before the score points are reset, however after that, the highscore doesn't update.
Please help.
Comments
On your second scene, you're changing the score back to 0 when lives reach 0. On your first scene, you're checking to see if the score is greater than the high score. Do you see the problem now? The score is already 0 before you change back to the first scene. You need to check the high score immediately after you change the score each time on the second scene.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Is it possible to update the high score, every time the score value changes? Unless I would need to reset my games points somehow else? I am lost in this one. I am creating a normal game, this was just logic behind it.
How are you guys saving your highscores? Or are you just showing the leaderboards? Wouldn't be any sense of achievement without them.
Yes:
When touch is pressed
Change Attribute game.score to game.score + 100
When attribute game.score > game.highScore
Change attribute game.highScore to game.score
Save Attribute game.highScore [key]
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Nice one
I after every time I die in my games, I just do:
If score is greater than high score (saved in table X)-
-Change table value (high score in table x) to score
-Save table
Tables are easy because they save and load very simply