TIMER HELP

Just started using Construct 2? Post your questions here

Post » Sun Feb 22, 2015 9:05 am

HI IM UNCLEAR ON HOW TO SET UP A TIMER THAT WOULD COUNT SECONDS AND SPLIT SECONDS.
ID LIKE THE TIMER TO START AS GAME STARTS THEN COUNT HOW MANY SECONDS I SURVIVED IN GAME .
SO IF I DIE THE TIMER WOULD RESET.
THANKS HELP WOULD BE MUCH APPRECIATED.

i have got the timer to work, but it continues to count even thou i "die"
so my question is how do i get timer to stop when i die, and start when i restart game
plz help
B
4
Posts: 11
Reputation: 222

Post » Sun Feb 22, 2015 10:17 am

You say you got timer to work. I presume you storing the seconds in a variable.

So when you die
Save your time
Set variable to 0 again.
restart game

You can also add a condition called pause....
Variable "pauseTimer" = 0

so your timer counts when condition "pauseTimer" = 0
When you character dies. Set pauseTimer = 1
That'll work too
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
61
S
16
G
9
Posts: 1,429
Reputation: 12,484

Post » Sun Feb 22, 2015 10:33 am

dude im not even sure my timer correct.....
iv created a text object
iv got global variable timer = 0
system every tick timer .. set text to (int(time))

this adds time up in seconds.
how do i store that time, or set the variable to zero
B
4
Posts: 11
Reputation: 222

Post » Sun Feb 22, 2015 11:06 am

Is it useful to set "time" to integer ? Isn't it already an integer ?

By the way, you just have to do :

system | start of layout -> set timer to 0.
B
12
S
7
G
7
Posts: 447
Reputation: 4,270

Post » Sun Feb 22, 2015 11:15 am

hey coin,
i went -> system -> start of layout,
but under what would i find "set timer"
or where would i find option to set timer
B
4
Posts: 11
Reputation: 222

Post » Sun Feb 22, 2015 11:30 am

"system -> start of layout" is the condition.
The full action "path" is : "system -> global & local variables -> set value -> timer : 0"
B
12
S
7
G
7
Posts: 447
Reputation: 4,270

Post » Sun Feb 22, 2015 11:37 am

thanks
but for some reason it doesn't work, iv set it like that before.
as soon as i press play and the game(layout) continues
the seconds continue as well
B
4
Posts: 11
Reputation: 222

Post » Sun Feb 22, 2015 11:46 am

Have a look at this

I would suggest reading the manual. And learning the basics. Do a few examples, go through a few tutorials.
You have to learn how to use the software.

Here is another one to look at.

You will find many many examples on timers, in tutorials, and in forum. Search
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
61
S
16
G
9
Posts: 1,429
Reputation: 12,484

Post » Sun Feb 22, 2015 11:47 am

thanks man
B
4
Posts: 11
Reputation: 222


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests