High score isn't working

Okay so I have a score integer that keeps track of the score as I play, then I have a final score that shows what I got on that round. what I am wanting to do now is to create a high score text that is displayed on the start screen and disappears when the game begins. I have the text working, it shows and and doesnt show when it is supposed to, however the high score integer stays at 0. This is the rules I have

if game.score > game. high score,
Change attribute game.highscore to game.score
Save attribute - game.highscore

When game.playing is false
Display text "High score: ".. game.highscore

The text rule is working, but the integer stays 0 for high score and won't display the highest score achieved. How can I make this work? Thanks :)

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    From your post it seems like it should be working. Can you post a screenshot of how your code is set up?

    You may want to place the change attribute as well as the save attribute behaviors inside a 0.1 timer (run to completetion) to ensure that it fires.

  • jacob717jacob717 Member Posts: 9
    edited April 2015
  • LovejoyLovejoy Member Posts: 2,078

    You have it set to every 0.1 seconds, so its most likely changing it over and over.

  • jacob717jacob717 Member Posts: 9

    @Lovejoy I just got it to work :)

    Thankyou to both of you though!

  • blake7129blake7129 Member Posts: 1

    @jacob717 said:
    Lovejoy I just got it to work :)

    Thankyou to both of you though!

    What did you end up doing to make the highscore save even when you exit and reopen the game? I am having the same problem and would like to know what you did to end the frustration.

Sign In or Register to comment.