Countdown Timer

mercyparkmercypark Member Posts: 20
edited November -1 in Working with GS (Mac)
I'm Trying to display a countdown timer. I have created a change attribute rule that displays the text of the game:time but it doesn't reset with the game and it starts when the menu screen starts not with the actual scene that requires the 30 sec countdown.

Comments

  • harrioharrio Member Posts: 234
    what's cookin,

    can you show the rule setup for your time variable. that might help get you an answer.
  • mercyparkmercypark Member Posts: 20
    I just created a display text and set the variable to game:time. I also created a rule in the background layer that states

    when attribute game:time = 30 change scene to (the game over screen I created)

    In the game over screen I have a "Play Again" button that has a reset game rule.
  • SDMGSDMG Member Posts: 280
    i am not sure... but i think i have read about the game reset behaviour that it actually doesn't reset the game.time...
    So you could try to spawn an actor and constrain its self.time to a global variable...
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    SDMG is correct. game.time does not get reset with the Reset Game behavior. You can use the actor's Time value instead.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    what if you create your own game attribute called timer (or anything) and do a change attribute timer-1 every second with a timer. Will that be reset? It seems to be (though a bit inconsistently)
  • MillerEPMillerEP Member Posts: 22
    The best method is to create an attribute titled timer and then constrain that attribute to Self.Time and use that to keep track of things, this way if you reset anything the Game.Timer doesn't matter and Self.Timer will be reset when you need it to be.
  • Stryfe01Stryfe01 Member Posts: 146
    That's excellent. I was just going through this same issue. Thanks guys.
Sign In or Register to comment.