How to save high score for each new game session?

_Ghost__Ghost_ Member, PRO Posts: 22

Hi everyone, I hope you're all doing well :)

So I'm almost done making my very first game with GameSalad, for the iOS. A big thank you goes out to those who contributed to the cookbook, since it has helped a ton.

Today, while developing I've ran into a bit of a small problem. I've managed to write the rules about saving score and also a "best score" and comparing the two against each other, but seems the best score is only displayed when users play a continuos session. So for example, the player would hit the play button from the 1st scene and immediately go to the 2nd scene which is the play scene. After the player has lost, the scene changes to the last scene, the game over scene, where the current score and the best score is displayed. Then when the player clicks the "play again" button from the game over scene, the player gets to play another round, and the high scores are saved. All of this works perfectly as it should.

However, the problem occurs when I quit the preview and start it new - the best score returns to default of 0 in the game over scene, but I would like to bring the best score from the player last session into this screen.

From my understanding, in order to pull that off, I'd have to use a backend server of some kind, correct? If so, how can I do that with GameSalad, and is there any tutorial which will lead me in the right direction? I must admit I haven't set up game center yet, but I have set up GS viewer on my iPhone. Is what I'm trying to do somehow to be used together with game center, or what? So far, I've been following tutorials by tshirtbooth, and they helped a lot. I just don't know how to actually save the best score for each new session. Please help!


  • JodyMitomaJodyMitoma Member Posts: 307
    edited April 2014

    All you have to do, is put all of your highscores into a TABLE. ;) VERY simple!

    Try checking this video out to get an idea:

    Search YouTube for other examples.

    Just be sure to have a SAVE TABLE attribute.

    If you want to do it all without tables, all you have to do is make sure to use the LOAD ATTRIBUTE on your game's MAIN SCREEN, to load the highscores every time the game loads.

    So, you have two options. Good luck! :)

  • _Ghost__Ghost_ Member, PRO Posts: 22

    @JodyMitoma‌ thank you so much for your help. Quick question: As far as the second method is concerned, do you mean load attribute to the main scene, or the game over scene, since the score is ultimately always displayed in the game over scene for my game? The main scene just lists the menus: Play, Store, Settings, Rate, etc.

    Just want to clarify :)

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,914

    Put the high score display where you want it. You can pull the data from the table. See my video on tables. Tables are basically spreadsheets where different types of variables can be stored instead of using save attributes. See part to of this video on my youtube site.

  • _Ghost__Ghost_ Member, PRO Posts: 22

    Hi everyone,

    First, thank you for all the help you've given me so far. After watching all the recommended videos, I've definitely learned a tremendous amount, and for that, I really appreciate the feedback.

    Second, I finally found a video on YT which addresses my issue, and uses the save/load attribute technique to resolve it. Below is the video:

    Initially, after trying it for the first time, I thought it didn't work, because it wasn't loading the high score, but after reading a previous forum post here, I learned that save/load attribute works on GSviewer/adhoc devices. After previweing on the GSviewer on my iPhone, it worked like a charm! :)

    Thank you again to everyone who has offered me guidance.

  • macman123macman123 Member Posts: 98

    Ghost‌ i saw this video and used it for my game i was going to post it but i couldnt find it.

  • _Ghost__Ghost_ Member, PRO Posts: 22

    @macman123 said:
    Ghost‌ i saw this video and used it for my game i was going to post it but i couldnt find it.

    Haha well thank you for the effort nonetheless :)

Sign In or Register to comment.