Saving a timer

8BitMichael8BitMichael Member, PRO Posts: 125
edited November -1 in Working with GS (Mac)
I'm using a self-timer as for the score in my game. I have an actor displaying the time, and then when my other actor (the player) is destroyed I want the timer to stop and then I want to be able to display the stopped time on the "Game Over" screen. Is there an easy way to do this?

Comments

  • BeyondtheTechBeyondtheTech Member Posts: 809
    Create a integer Game Attribute called GameMode, and set initial value to 1.

    Then enclose your current timer in a rule that will test if GameMode=1, then let the timer count down.

    In another actor (call it Splash), you can create another rule that if GameMode=0, it will display "Get Ready!" (and obviously, the timer won't be running yet), then set a timer that will change GameMode=1 after 5 seconds.

    In the same actor, you can create another rule that if GameMode=2, it will change the image to "Game Over!", then set a timer that will exit the scene after 5 seconds.

    Lastly, you can add rules to your player and enemies that it will only fire or move if GameMode=1, so that neither you or them can kill each other even before the timer starts.

    Hope that helps.
Sign In or Register to comment.