can someone explain how to save a high score and display it on main page?

tollhousestudiotollhousestudio Member Posts: 166
edited November -1 in Working with GS (Mac)
Hey folks, exciting to have the new save feature, this changes everything I have done with gamesalad.

For now I just want to update my game "Earth Control" to have a high score.

Can someone help me out cos I'm not sure how it works.

I have a game over screen when you die that displays your high score, I thought I could put the save attribute on that and on the main menu have a load attribute but its not working and I'm not sure if this is right at all.

Comments

  • JoshKahaneJoshKahane Member Posts: 470
    Well this is just me quickly thinking about this off the top of my head, but I think it would work like this.

    You have your attribute: HighScore

    At the end of your game, so when you die, or you reach the end of a level you use the save attribute behaviour like so:

    Save:
    Attribute: HighScore.game (saving the high score attribute).
    Keyword: HighScore (Keyword being a reference to the saved attribute).

    Then when you press your button to goto the high score screen or when it loads use the load attribute behaviour like so:

    Load:
    Keyword: HighScore
    Attribute: HighScore.game

    As you can see both the attributes of the load behaviour are the same as the save behaviour you used before. Now in your high score screen you would use a Display Text behaviour to include the following.

    Display Text:
    HighScore.game

    Quite simple, now this should load your high score attribute and then display it. I think it should work but I haven't tried it. Say if you have any issues, I will do my best to help as Im sure others will as well.
  • tollhousestudiotollhousestudio Member Posts: 166
    ah I see what you're getting at, I'll try that out, i ment to mention before would it be possible to only update the highscore if it is beaten?

    Like If I score 250 and that would stay like that until its above that score.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    yea, that should be easy.

    just check to see if the current high score is higher than the saved high score. If so, overwrite the saved version.

    so, load the saved high score into an attribute
    then create a rule
    if currentHighScore is larger than savedHighScore
    save currentHighScore
    otherwise
    save savedHighScore

    something like that anyways
  • dre38wdre38w Member Posts: 79
    Hi jonmulcahy. I'm really stumped on what you mean about overriding the high score. What do you mean by save into an attribute?
  • dre38wdre38w Member Posts: 79
    Sorry I mean what do you mean by LOAD into an attribute?
  • dre38wdre38w Member Posts: 79
    Nevermind. haha I got it to work. Thanks!
Sign In or Register to comment.