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

Get help using Construct 2

### » Fri Aug 12, 2016 3:49 pm

Message: alrok can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hello

i'm doing a game with a timer that must start from 60 to 0 and then count up now i have.
http://es.tinypic.com/r/2h6zsp3/9
that do the first part of going from 60 to 0 but how i do the other half?.
B
3
Posts: 8
Reputation: 193

### » Fri Aug 12, 2016 5:11 pm

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
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
81
S
29
G
94
Posts: 1,153
Reputation: 63,192

### » Sat Aug 13, 2016 12:54 am

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
B
44
S
18
G
17
Posts: 2,249
Reputation: 17,585

### » Fri Aug 19, 2016 7:36 pm

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 =)
B
3
Posts: 8
Reputation: 193