Help with scores

AppChogieAppChogie Member Posts: 503
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 Member Posts: 2,599
    if current score > high score
    1) change high score to current score

    2) save high score
    hope that helps
  • VoidedSkyVoidedSky Member Posts: 1,095
    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 Member Posts: 503
    @ CowTechMan

    Hi mate I have sent all the email I'll check again and resend vie been. Having trouble with email lately
  • VoidedSkyVoidedSky Member Posts: 1,095
    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 Member Posts: 503
    What do I put in key when saving attribute for current score?
  • Rob2Rob2 Member Posts: 2,402
    I think you can put whatever you want, that becomes the name of your attribute for saving and loading
  • Rob2Rob2 Member Posts: 2,402
    almost like a filename really to store your highscore or whatever in
  • AppChogieAppChogie Member Posts: 503
    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 Member, PRO Posts: 914
    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 Member Posts: 503
    done that doesn't work
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    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 Member Posts: 1,095
    --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 Member Posts: 503
    this isnt working i am going mad!
  • AppChogieAppChogie Member Posts: 503
    the current score shows correctly but when change scene to high score it displays nothing??
  • AppChogieAppChogie Member Posts: 503
    got it, working now! thanks ill send the email to you all now again :-) thanks for the help
  • VoidedSkyVoidedSky Member Posts: 1,095
    I got the email! Thanks a ton! Where in the code should I start looking at it.
Sign In or Register to comment.