GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Help with scores

AppChogieAppChogie Posts: 503Member
Hi guys, I am trying to add scores to my game I can't remember how to do it,

After each game I have a scene that gices you current score and that works then the game goes to the title screen where I have a high score button but I can't make the score give the correct value

Ive got 2 attributes one for score and highscore both set to 0
how do i get it to save the score after a game and call it back for the highscore if the new score is higher?

I had it working before but the new update is giving me all kinds of gremlins

Comments

  • POMPOM Posts: 2,599Member
    if current score > high score
    1) change high score to current score

    2) save high score
    hope that helps
  • VoidedSkyVoidedSky Posts: 1,095Member
    Hi AppChogie, I think there is a demo of this. But if you need to, I can send you one of my games for you to look at with high-scores in it.
    Also, could you send me the xcode project that you were working on with poppi. I think I sent you an email.
  • AppChogieAppChogie Posts: 503Member
    @ CowTechMan

    Hi mate I have sent all the email I'll check again and resend vie been. Having trouble with email lately
  • VoidedSkyVoidedSky Posts: 1,095Member
    AppChogie said:
    @ CowTechMan

    Hi mate I have sent all the email I'll check again and resend vie been. Having trouble with email lately

    Thanks
  • AppChogieAppChogie Posts: 503Member
    What do I put in key when saving attribute for current score?
  • Rob2Rob2 Posts: 2,402Member
    I think you can put whatever you want, that becomes the name of your attribute for saving and loading
  • Rob2Rob2 Posts: 2,402Member
    almost like a filename really to store your highscore or whatever in
  • AppChogieAppChogie Posts: 503Member
    This isnt working,

    I have 2 attributes, 1st is current score, 2nd is high score

    after the game i have a display text with game.current score and that works then i have put save attribute current score with the key of current score.

    Then in my high score page i have load attribute and display text game.current score
  • giacomopoppigiacomopoppi Posts: 914Member, PRO
    hey mate, found internet access at airport.
    You miss me already i see! :P

    place a "load attribute" in the highscore scene with the same "key" that you gave to the save highscore :)

    i should hve internet access tomorrow. send me a mail :)
  • AppChogieAppChogie Posts: 503Member
    done that doesn't work
  • giacomopoppigiacomopoppi Posts: 914Member, PRO
    ill tke a look at project tomorrow. got to go. you will have to send methe project via email because i havnt brought it with me :)
  • VoidedSkyVoidedSky Posts: 1,095Member
    --Rule;
    ----when game.currentScore is > game.highScore change game.highScore to game.currentScore
    ----save attribute game.highScore to HighScore(This is a key)

    Have a scene controller actor on the page that does this;
    --load HighScore

    This should work.

    Still no xcode project :-(
  • AppChogieAppChogie Posts: 503Member
    this isnt working i am going mad!
  • VoidedSkyVoidedSky Posts: 1,095Member
    what part isn't working?
  • AppChogieAppChogie Posts: 503Member
    the current score shows correctly but when change scene to high score it displays nothing??
  • AppChogieAppChogie Posts: 503Member
    got it, working now! thanks ill send the email to you all now again :-) thanks for the help
  • VoidedSkyVoidedSky Posts: 1,095Member
    I got the email! Thanks a ton! Where in the code should I start looking at it.
This discussion has been closed.