How Can I Only Save Score When Higher Than Previous?

JoshKahaneJoshKahane Member Posts: 470
edited November -1 in Working with GS (Mac)
Hi

Its another one of those days where I am clueless. Hope you guys can help as you always do. I have a score which saves after each time I die but how can I get it to save only when its higher than the previously saved score? So essentially how do I save a high score?

Thanks.

Comments

  • butterbeanbutterbean Member Posts: 4,315
    create attributes game.score and game.highscore

    Create a rule if game.score is > or = game.highscore
    Constrain attribute: game.highscore to game.score

    Then create the save and load attributes as necessary and make sure in your "key" that the keyword matches the attribute EXACTLY as it is typed out including upper and lower case, and spacing if it's there
  • JoshKahaneJoshKahane Member Posts: 470
    Think I got it working, thanks Butterbean. Goodness me, I need more sleep and concentration. :) Thanks for coming to my aid yet again.
  • butterbeanbutterbean Member Posts: 4,315
    no problem! :)
  • design219design219 Member Posts: 2,273
    Crap, I was actually able to answer this one, but butterbean beat me to it. Hehe. I had to figure out how to do that and came up with the same method.
  • quantumsheepquantumsheep Member Posts: 8,188
    Butterbean - you're a star!

    My high score wasn't working properly, and now it is! Simple mistake to make, but you put me on the right track!

    'Constrain' indeed!

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • butterbeanbutterbean Member Posts: 4,315
    thank you! Glad I could help a sous chef like you! :)

    It took me a day to figure that out, it was really weird, I couldn't figure out for the life of me why it wasn't working, then poof! Constrain attribute was the answer! :)
  • quantumsheepquantumsheep Member Posts: 8,188
    Heh - that was certainly the missing ingredient - thanks again :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • butterbeanbutterbean Member Posts: 4,315
    I noticed that only "reset game" makes the game.score reset, but reset scene doesn't

    How do I reset the game.score but not the game.highscore when I want to reset the scene?
  • CrazybreadmanCrazybreadman Member Posts: 674
    You just have game.score change attribute to 0 before it resets the scene and make sure you save and load game.highscore.
Sign In or Register to comment.