Help saving scores

nikstaanikstaa Member Posts: 65
edited November -1 in Working with GS (Mac)
Hey guys, i need help saving scores.
I'm not sure where i should put the save and load attributes.
Can some one please help me :)

Comments

  • thomasrichardgamesthomasrichardgames Member Posts: 263
    This vid should help.

  • nikstaanikstaa Member Posts: 65
    Still nothing i'm a but confused.
    There must be something i'm doing wrong
  • thomasrichardgamesthomasrichardgames Member Posts: 263
    i had the same problem when i was doing the scores ... this tutorial is much better ... i used this one instead of the gamesalad ...

  • nikstaanikstaa Member Posts: 65
    Yea i've got all this stuff worked out but it didn't show how to show the saved high score from the game that you played before.
    I want to be able to display the HIGH score onto a high scores page, if you know what i mean?
  • thomasrichardgamesthomasrichardgames Member Posts: 263
    yep i do know what you mean ...basically you make a new actor (placed on the levels or a different screen where the scores will be displayed) .... in that actor use the load score attribute .... in the box labelled key ... you input what ever words or numbers you used for the score and then in the other box you in put the attribute you used. Hope this helps.
  • nikstaanikstaa Member Posts: 65
    Ok im using it now just waiting for the timer to finish
  • nikstaanikstaa Member Posts: 65
    Nope there must be something wrong well we shall continue this tommorow cya for now, but feel free to post now if you want
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    Here's a quick guide to loading/saving a high score:

    1) Create two game attributes, CurrentScore and HighScore. CurrentScore will be used during a game to track/display the player's current score. HighScore will be used to track/display the highest score achieved so far in any game.

    2) When the player's game is over, check if game.CurrentScore is higher than game.HighScore. If it is, change game.HighScore to game.CurrentScore and then save game.HighScore to a save key using Save Attribute (I usually use the same name for the save key as the attribute I'm saving to make it easier to remember, in this case, HighScore).

    3) In the first scene of your project, load the HighScore save key to game.HighScore using Load Attribute. I recommend putting this in some object that is always loaded and present in the first scene (e.g. the background of the Main Menu). Alternatively, if you have a High Score page that is accessible from the Main Menu, you can put the load attribute in the button on the Main Menu that accesses the High Score page. Just make the Load Attribute happens before the High Score is displayed (either on the Main Menu or on the High Score page).

    4) Wherever you have your high score, use the game.HighScore attribute (either as Display Text or as the basis for custom score font).

    Using this setup, game.HighScore will always have the highest score achieved in any game so far.

    - Jeff
  • nikstaanikstaa Member Posts: 65
    Still not working!

    I am kinda stuck
  • nikstaanikstaa Member Posts: 65
    Guys, one more question.

    I have 2 screens i want to display the high scores on.
    i need to know exactly where to put every attribute because i think i put them in the wrong place.
    plz help me :)
  • nikstaanikstaa Member Posts: 65
    some one?
  • nikstaanikstaa Member Posts: 65
    heloooo?
  • LoadingZeroLoadingZero Member Posts: 75
    nikstaa said:
    Hey guys, i need help saving scores.
    I'm not sure where i should put the save and load attributes.
    Can some one please help me :)

    You can load attribute at in a blank actor in the first scene of your game.
    You must save when-wherever you want.
    For example i save at the end of each level.
    Ps don't work with GSCreator, you must test on a device.
  • nikstaanikstaa Member Posts: 65
    I havn't tried it on the device yet maybe thats why
Sign In or Register to comment.