Saving High Score
I know someone posted something like this but my issue is a bit different. I'm ready to finish my game but can't seem to figure out why it won't save the high score. At the end of the game it only shows you the score of each game played. Here is what I did to set it it.
First I created an integer called High Score
Next I created a character - called it High Score
Under my character High Score I have the following rule
When all of the following are happening
if game.score is greater than game.high score
change attribute game.high score to game.score
Save attribute
game.high score as highscore
Outside of that rule I have a display text as game.high score
The main issue again is when the game is over it only displays the current game score - even if it's a lower score.
Thanks
Comments
@tjjunior21 I hope I understood your question right, it does display your attribute, but not with the "saved" highscore?
To save and load an attribute, you cant type it in in the expression editor. click on the "e" and click remove expression. close the expression editor, and type it in the black field, so don't type it in the expression editor. I was stuck on this issue for ever when I started with gamesalad.
Thanks for the reply. Yes you are correct, it does display a score but not the saved high score.
I'm trying to follow you on how to fix this. On the save attribute I clicked on attribute, game and game.high score. For the as: I just typed in highscore. Is that what you're referring too? Hopefully I'm making sense....
I tried exactly what you said. I typed in High Score into the as field but it still didn't work. Should I just do all lower case and one word?
That should't really matter, did you removed the expression in the expression editor?
I did. Over in the save attribute I have save: game.high.score as high score. I did delete what was in expression editor than just typed high score in that. For some reason it's still not working. Could it be something different?
Under that rule I also have add text. In the display text window my rule is game.high score. Should I leave that or switch it to high score? I don't seem to be able to type in that window.
@tjjunior21 remove the space in "high score", use "HighScore" instead. I don't believe you van use a space is the save behavior. Also put the save attribute all the way on the bottom of your rule, to make sure the highscore attribute is changed before it gets saved. And your text behavior is fine:)
Hi Approw... I really appreciate your help. This is really getting frustrating. I did exactly what you said, my save attribute is below the change attribute in the rule and I deleted the High Score and called it highscore (also tried HighScore). Neither one will work. Could there be a bug of some sort when using the preview?