How do I "refill" a timer?

MoikMoik Member, PRO Posts: 257

I have a countdown timer which gives the player 5 seconds to supply an input. Attached to the input, is "game.intTimerMax = game.intTimerMax + 5". My intent is to have the player constantly under a 5 second gun, and have that maximum amount of time slowly reduce over the inputs. It's much like a perpetual Quick-Time Event. However, I can't figure out a formatting or command which puts the timer count back up. It always seems to end after 5 seconds as though it's ignoring the addition from the input.

I suspect I'm formatting it wrong, like how you can't type a variable name in, you have to pick it from the list. But I'm also suspecting I need to do it in reverse with some kind of "Every 1 second add 1 to intTimeLapsed, If intTimeLasped >= TimerMax then go to Game Over Scene" but that's kludge and I'm not sure how to display the time counting down from that.

What command will insert more time into a running countdown?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Not sure why "kludge" is a problem but it sounds like you have an answer that will work.

    If you want a solution that doesn't use a timer, try this:

    Change game.timeLeft to game.Time
    DisplayText 5-(game.Time-game.timeLeft)
    When game.Time≥game.timeLeft+5
    Change Scene [Game Over]

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.