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

Get help using Construct 2

Post » 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

Post » 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
------>Add from Timer (dt)

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
66
S
22
G
90
Posts: 1,125
Reputation: 60,011

Post » Sat Aug 13, 2016 12:54 am

@chadorireborn

Actually,
Var Timer = 60
Var Switch = 0

Every 1 Second
> If Switch = 0
> Substract ...

> If Switch = 1
> Add ...

> 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
42
S
17
G
17
Posts: 2,247
Reputation: 17,481

Post » Fri Aug 19, 2016 7:36 pm

Whiteclaws wrote:@chadorireborn

Actually,
Var Timer = 60
Var Switch = 0

Every 1 Second
> If Switch = 0
> Substract ...

> If Switch = 1
> Add ...

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


Return to How do I....?

Who is online

Users browsing this forum: draiza and 6 guests