Saving High Score

razzsoftrazzsoft Member Posts: 38
edited November -1 in Working with GS (Mac)
Hi All,

Is there a way of saving the high score in a game so that next time the game is loaded it will display the high score list.

Regards,

cabcom

Comments

  • LordTarantorLordTarantor Member, PRO Posts: 890
    Hi cabcom.
    There is a video tutorial on youtube that might help you with this, here is the link:

    hope it does what you are looking for.
  • razzsoftrazzsoft Member Posts: 38
    Thanks LordTarantor for your reply.

    I've looked at this tutorial but cann't see that it saves the high score if the app is turned off.

    I'm trying to find a way to save the highscore so when you startup the game again it will still display it.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    On your highscore page, you would need to load the custom attribute you save to
  • razzsoftrazzsoft Member Posts: 38
    Hi,

    Thanks for your reply.

    I must be missing something here because when I shutdown the game(by pressing round button on bottom on iphone) and then opening the game up again the high score is reset to 0.

    I need to save the high score to the ram of the iphone somehow I feel.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    yes you'll have an attribute for your high score.

    So when you have your rule that is something like this;

    If game.current score > game.high score

    change attribute game.high score to game.current score

    SAVE attribute game.highscore and give it a custome name. i.e. highscore

    Then on your highscore page that displays high score, within that actor tell it to load attribute game.high score with your custom name. i.e. highscore
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    The problem is that there is no way to have GS detect that the home button has been pressed so you can do what beefy said but it will only save it when the condition is first true. So in that case it will save it right when the new high score is achieved and not after that. The only way i can think of to do what you want is to put the save behavior in a timer set to every. So do exactly what beefy said but put the save in a timer set to every and pick what ever timer interval you like. But be careful timers tend to hurt fps. You are probably better off making a quit button and put the save behavior in that. In your game instructions explain that the game is only saved when you quit properly.
  • razzsoftrazzsoft Member Posts: 38
    Thanks for all the help.

    Worked it out now, wasn't working in the GS preview but works when published and run on the iphone.
  • synthesissynthesis Member Posts: 1,693
    Yes...The previewer has no memory access...nor does the web publishing.

    You can only test saving and loading attributes on a device as a published app.
Sign In or Register to comment.