How do I "Restart" the Time

Get help using Construct 2

Post » Wed Apr 16, 2014 12:35 am

First of all, sorry for my english...

I'm making an asteroids style game. The problem is: asteroids spawn.
I configured them to spawn:

every x seconds: random(4,10);

the problem is that "every x seconds" is occurring every moment.
so, when you click on the menu screen and go to the gameplay, may already be starting to spawn asteroids, since "every x seconds" was passing on the menu too.
Any tips on how to reset the 'time' when start a layout?
B
20
S
4
Posts: 387
Reputation: 2,274

Post » Wed Apr 16, 2014 12:55 am

Use the Timer behaviour rather than Every X second. You have complete control over it.
ImageImageImage
B
71
S
22
G
258
Posts: 3,791
Reputation: 143,198

Post » Wed Apr 16, 2014 3:04 am

blackhornet wrote:Use the Timer behaviour rather than Every X second. You have complete control over it.

lol I had forgotten this behavior.. anyway, I never used it.

how to solve my problem with it?
I can set a timer with a random number to my meteor spawn?

*yeah... i'm a noob. :\
B
20
S
4
Posts: 387
Reputation: 2,274

Post » Wed Apr 16, 2014 4:11 am

Just restart the timer in the 'On timer' event.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
22
G
258
Posts: 3,791
Reputation: 143,198

Post » Wed Apr 16, 2014 5:59 am

blackhornet wrote:Just restart the timer in the 'On timer' event.

Dude, you did a tutorial project for me... thank you vmuch :)
it's exactly what i need. ^^
B
20
S
4
Posts: 387
Reputation: 2,274


Return to How do I....?

Who is online

Users browsing this forum: ardhitosen, kurtbal and 10 guests