How do I reset object spawn timers on layour restart?

Get help using Construct 2

Post » Wed Nov 25, 2015 5:17 pm

i have set my game to:
System_Every (5) seconds - System_CreateObject (Data) on layer 0 at (random(224, 640) , random(96, 348) )

The problem is, when i die, i have made a retry button, it restarts the layout, but... let's say it will take 5 more seconds untill the next data appears, i die after 2 seconds, and retry, but this time the data only takes 3 seconds to spawn.
So the timer doesnt restart, this is a big problem since i have also made it to spawn a spawner every 25 seconds, and that could fu*k up the player if it spawns instantly
B
5
S
1
Posts: 1
Reputation: 499

Post » Wed Nov 25, 2015 5:24 pm

System every x seconds starts counting from the start of the app..
As resetting the start of the app isn't possible, you could for example add a wait-period at the start of layout before activating the event..
Another way would be to use timer behaviour instead of the every x seconds, or just add 1 to a global variable (which you can reset before restarting) every second and have the actions performed when variable%5 = 0..
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


Return to How do I....?

Who is online

Users browsing this forum: FabianB, Vodakman and 12 guests