Reset time when restarting layout?

Get help using Construct 2

Post » Tue Nov 27, 2012 4:57 am

Am I just doing something wrong, or does the "Every X Seconds" not reset when you restart the layout? The problem is I have some enemies that fire bullets every 3 seconds, but if I restart the level in, say, 2.8 seconds, they start firing too soon when the level begins.

Is there a way around this?

Today's been a baaaad day for programming...
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Tue Nov 27, 2012 5:39 am

I think youmay need to choose Reset Global Variables.

Failing that, just have a clock function made from Every X Seconds anda variable that has 1 added to it every time.
Using R243 for all examples
B
68
S
20
G
6
Posts: 378
Reputation: 9,672

Post » Wed Nov 28, 2012 12:34 am

Cheers, will do. Should be fairly easy to just use mod on the timespan for this. Just wanted to make sure I wasn't missing something obvious.

Am I the only one who finds it a little strange that it doesn't reset to zero when the level restarts? I'm surprised people haven't run into more problems with it.
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Wed Nov 28, 2012 1:02 am

A global variable is supposed to be "Global" , It would only restart when all the system would restart , not when a layout restart ...
And adding a little event isn't too much ;)
Cheers
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436


Return to How do I....?

Who is online

Users browsing this forum: hielo777, istero and 9 guests