Problems with High Score Saving
I'm having problems trying to figure out what I'm doing wrong with saving high scores. I have watched all the youtube videos and looks pretty easy. I have an attribute the has a integer value and I save attribute value to a key name. On my menu screen I have a controller that loads the key value into the attribute name when game is first started. My problem is that when the game is restarted the attribute doesn't have the saved key value. Does this only work when you are actually playing it on device or should it still work when running it in GameSalad? My code looks like this:
attribute "highscore" has integer value
Save Attribute
attribute: highscore key: highscoresave
On my menu screen
Load Attribute
key: highscoresave attribute: highscore
attribute "highscore" has integer value
Save Attribute
attribute: highscore key: highscoresave
On my menu screen
Load Attribute
key: highscoresave attribute: highscore
Comments
do yourself a favor and test adhoc, it's the only way to truly test performance
The difference is that any time you test your app, the highscore will start as "Zero", on the device, will keep the last value saved.
Your code looks normal, test it on the device, maybe you can see something that will help you identify the problem... but also agree with zoope, give a look to the tables for saving information, like score /stars etc.. is must better..
Usually in a game you are likely setting the score back to zero before a new game is played....or if a new hiscore has not been achieved. This is where a conflict could be occurring. Are you resetting your score to zero somewhere in the rules of the menu or when the game ends?
I think I have everything coded right. I'm tracking a lot of variables and the high score attribute was giving me problems between different scenes. I spent a couple hours trying to figuring that out. I plan on testing this on my ipad and iphone in the next day or two. I also have seen some strange things happening when testing on my mac book verse my mac mini at home. They are running the same version of GameSalad but slightly different operating system versions. Things are good for now.