Why isn't my timer working?

Get help using Construct 2

Post » Wed Sep 03, 2014 3:24 pm

Hi I have this for a 10 second timer but my player doesn't go invincible for 10 seconds.

Any ideas on how to rectify this?
You do not have the required permissions to view the files attached to this post.
Image
B
24
S
4
Posts: 72
Reputation: 1,529

Post » Wed Sep 03, 2014 4:21 pm

imho, you can use a global variable,

- add global variable (value = 0)
- you can still use action 1 until line 6
- system >>> every 1 second,,, system >>> add 1 to (global variable)
- system >>> (global variable) = 10,,, use your action line 8 - end

try it :)

mochiz
B
5
Posts: 17
Reputation: 261

Post » Wed Sep 03, 2014 4:24 pm

This isn't a timer, but a wait action..

Could be better to use the timer behaviour for something like this though
give the player timer behaviour
instead of the wait action use start timer for 10 seconds
and on timer - setthe actions now below the wait action..

I would actually choose to put all events concerning collision with enemies in a group and de-activate that group during the "invincible" period..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Sep 03, 2014 5:17 pm

@mochiz did you mean like this, I did it but it only lasts one second
You do not have the required permissions to view the files attached to this post.
Image
B
24
S
4
Posts: 72
Reputation: 1,529

Post » Wed Sep 03, 2014 5:29 pm

right after adding 1 to GOD, you are setting GOD to 10, so the adding 1 action is useless..

Also this happens every second no matter what..
I guess you only want to add 1 while the powerup is working, so you should add a condition for that

instead of the set god to ten action, create a system compare variable GOD = 10 event and add the actions to that..
This event should only trigger once while true, so you should add that condition..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Sep 03, 2014 5:37 pm

Thanks guys @LittleStain I decided to try your method which worked well many thanks
You do not have the required permissions to view the files attached to this post.
Image
B
24
S
4
Posts: 72
Reputation: 1,529


Return to How do I....?

Who is online

Users browsing this forum: Animate, Cha0tiXGamer, ezgaming420 and 6 guests