How to stop everything?

Get help using Construct 2

Post » Wed Feb 05, 2014 11:35 am

Hi guys,

I added a second layer with Game Over written on it. Naturally everything else keeps going. How can I stop everything? Do I need to manually stop everything one by one?

I have a variable to determine the drop rate of enemy sprites but it's the min value for a random number generator which if I set that to 0 would result in int(random(0,5).

Thanks!
B
5
S
1
Posts: 44
Reputation: 465

Post » Wed Feb 05, 2014 12:09 pm

If you're using the built-in movement behaviours, and/or anything you move manually you are moving it considering delta time, you could use the action System: Set Time Scale to 0.
B
7
S
1
G
4
Posts: 16
Reputation: 1,332

Post » Wed Feb 05, 2014 1:40 pm

correct to K1kkoz90. And if any other sprites are still left behind that do move, use set object time scale on them
B
35
S
5
Posts: 411
Reputation: 3,406

Post » Wed Feb 05, 2014 1:43 pm

To stop adding new enemies have a global variable like GameOver set to 0. When your create enemy function runs, make it so it only runs when GameOver = 0.

Then when you actually have a game over condition, set the GameOver variable to 1 and set time to 0.
B
31
S
7
G
1
Posts: 80
Reputation: 2,550

Post » Wed Feb 05, 2014 9:28 pm

Thanks guys, this works but the problem is I would still need to destroy an instances of objects currently existing. I can just code that in.
B
5
S
1
Posts: 44
Reputation: 465


Return to How do I....?

Who is online

Users browsing this forum: jatin1726 and 27 guests