help with high score please!

SAMmanSAMman Member Posts: 228
edited November -1 in Working with GS (Mac)
So, I have this game, go figure, and I want to save the high scores. So far it work except for one small flaw. I basically copied the advanced scores II demo, and so it saves the score when I stop playing, by losing or hitting the pause and then home button. As long as I hit the home button, which only goes back to the main screen and has no other attributes, the scores are saved and show up in the highscores screen. I keep the 5 highest. The problem is when I lose at the game, and hit the try again button that I made, it doesn't keep track of the highest score. What I want is to be able to hit the retry level button and have it reset the score to 0, but if you did get the high score, I want it save that as the high rather than saving just the most recent score as the highscore. Could anyone please help me with this? I think it is my last major bug! Thanks.
SM

Comments

  • SAMmanSAMman Member Posts: 228
    anyone?
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    You need to do a check like this:

    If game.CurrentScore is > game.HighScore,
    - Change Attribute game.HighScore to game.CurrentScore
    - Save Attribute game.HighScore to HighScore key

    - Jeff
  • SAMmanSAMman Member Posts: 228
    thanks I will give that a try.
Sign In or Register to comment.