reset every X seconds timer

Get help using Construct 2

Post » Sat Jan 21, 2012 7:19 pm

Hi,

I have event sheet that is included in the event sheet of multiple layouts.
In that event sheet i have a for X seconds loop that spawns an object.
Lets say the loop is for 10 seconds.
If I move from layout1 to layout2 after 5 seconds
then after another 5 seconds an object will be spawned on layout2.

How can I reset it so it will be after 10 seconds again?

thanks.


edit:

just thought about something.
does C2 create a timer for this condition?
or is there a global game counter and it uses it?
roidayan2012-01-21 19:27:24
B
20
S
5
G
5
Posts: 37
Reputation: 4,072

Post » Sat Jan 21, 2012 7:42 pm

I think it uses the global time of the game yeah.

so you would need to use a global Variable timer
and in your included event sheet
[code]Gobal number timer = 0
+System: On start of Layout
-> System: set timer to 0
+System: Every tick
-> System: add dt to timer
+System: timer >= 5
-> System: Create Sprite
-> System: set timer to 0[/code]
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346


Return to How do I....?

Who is online

Users browsing this forum: Matthew de, nexlove and 26 guests