How do I create a countdown timer that speeds up over time?

0 favourites
  • 4 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hello, I am trying to create a meter that gets bigger when you collect and deposit certain items into a bowl. I'm able to make the meter bar grow when we complete certain tasks and it depletes over time. but its depleting at a fixed rate how do I make it so that as more time passes the bar depletes faster?

    Thank you in advanced. this is the formula im currently using

    (50 + (BowlProgress*5))- (time +10)

    BowlProgress is what needs to be filled in order to fill the meter and time is juts the built in timer function in construct 3.

  • I figured it out! I made a global variable called depletionRate and set it to 18 you can set it to any number you want. and then I made a sprite that was a rectangle and

    use the Compare width option and set it to this formula (100 + (BowlProgress*5))- (time * depletionRate)

    i then create an ever tick event and added the rectangle sprite and added the condition compare width and set it to (width > 0) and use the set width action and entered this formula: (100 + (BowlProgress*5))- (time * depletionRate)

    i then made an else statement that said if width was less that 0 to end the game.

    so essentially the rectangle sprite bar decreases faster every second and when the bar empties the game ends.

    i can show my even list to anyone who also needed hello with this (100 + (BowlProgress*5))- (time *( depletionRate* time))

  • in this instance time is just the time function in contruct 3

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • hi. the variable you want to play with is dt.

    So an example like:

    global number : TIME_MAX = 10

    every tick | subtract dt from TIME_MAX

    would be a countdown starting at 10 minus time passed.

    You can modify it by including a multiplier for dt like 0.5*dt is slower by a factor of 2. You get the idea

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)