0 Favourites

# How do I make a timer that count down and then count up

• 4 posts
• Hello

i'm doing a game with a timer that must start from 60 to 0 and then count up now i have.

that do the first part of going from 60 to 0 but how i do the other half?.

• I think you need a switch boolean.

1)Create a Global Number Variable called Switch with a value of 0. And also Create your Global Number Variable called Timer with a value of 60.

2) Apply this event:

*Timer <= 0

----> Set Global Number Variable (Switch) to 1.

*Switch = 0

----->Subtract from Timer (dt)

*Switch = 1

3) Tip: It's a good practice to add this event for accuracy:

*Timer < 0

-----> Set Timer to 0

• Actually,

Var Timer = 60

Var Switch = 0

Every 1 Second

If Switch = 0

Substract ...

If Switch = 1

if Timer = 0 or if Timer = 60

Set Switch to abs(Switch - 1)

-- Sub-Event of Event

This way. it will also switch from 60 to 0 to 60 accordingly, And will also substract or add before chaning switch and thus you won't need your good practice event

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

Construct 3 users don't see these ads
• Actually,

Var Timer = 60

Var Switch = 0

Every 1 Second

> If Switch = 0

> Substract ...

> If Switch = 1

> if Timer = 0 or if Timer = 60

> Set Switch to abs(Switch - 1)

> -- Sub-Event of Event

This way. it will also switch from 60 to 0 to 60 accordingly, And will also substract or add before chaning switch and thus you won't need your good practice event

TY a lot it works perfectly as i want =)

• 4 posts