Score problem

ThaniThani Member Posts: 128
edited November -1 in Working with GS (Mac)
I was following TB's highscore tutorial , so when i go to the last scene it'll tell my my current and best score .
But I have a " change attribute " in my game.score ( current score ) where after 0.1s it'll add 1 point to my score .
So what happens is when i go to the last scene which will show me my best and current score , the " current " score keeps on counting , how can i stop that ?

Comments

  • osucowboy18osucowboy18 Member Posts: 1,307
    Try adding an attribute that keeps track of when the game is running. So for instance, create a boolean game attribute (game.GamePlaying), set its default value to false and use this rule.

    while game.GamePlaying is true AND any other condition you may already have

    Timer: Every 0.1 seconds
    change attribute game.Score to Game.Score + 1
    End Timer

    End Rule

    At the beginning of the actor this rule is in, be sure to set game.GamePlaying to true, then when the game is over, change game.GamePlaying to false. Once game.GamePlaying is false, display the score, which will have stopped counting at this point. Hope that makes sence.

    - Alex
  • ThaniThani Member Posts: 128
    Here is what i did
    I created a boolean attribute .
    Then created a rule , attribute = game.gameplaying = false
    then a change attribute game.gameplaying to true
    then i threw in a timer , every 0.1s
    then change attribute to game.score to game.score +1

    and in the otherwise tab :
    Rule , attribute , game.gameplaying is false .

    is that what you mean ?
Sign In or Register to comment.