How do I pause?

Get help using Construct 2

Post » Wed Apr 02, 2014 1:23 pm

I have sprites spawning off screen and coming on screen at the player.

The event is basic and looks like this EveryTick >Sprite1> MoveForward -4 Pixels.
Then another event that creates them off screen Every 1 Second>Spawner>Create Object>Sprite1.

Works great every 1 second it spawns the sprite and the sprite moves through the screen.

I get into the pause function, On Key Pressed >P>Set Time Scale 0.

The spawning event stops spawning which is great, the player stops moving, but the Sprite1's that were already spawned keep on whizzing by. After looking through the forums I found a semi solution which is to put a bullet behavior on the sprites and get rid of the EveryTick event. If that is the best way to go about it I can change that. Just wondering if I'm missing something or if anyone happens to know why timescale would stop a bullet behavior, but not a system event, if that makes sense.
Image
B
46
S
17
G
2
Posts: 201
Reputation: 4,526

Post » Wed Apr 02, 2014 1:46 pm

You could use something like sprite.X-4*dt*60 or use variable if paused.
B
34
S
9
G
3
Posts: 517
Reputation: 5,226

Post » Wed Apr 02, 2014 5:28 pm

I have used compare to global variable instead of the everytick condition.
Hope the capx will help.

note: the Wait 0 seconds action is very important
You do not have the required permissions to view the files attached to this post.
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,370

Post » Wed Apr 02, 2014 9:03 pm

Thanks for the options. I ended up turning the sprites into bullets and setting their speed to 0 when I needed to pause. I wonder why the time scale doesn't work with the System events, Every Tick, Every X Seconds and so forth.
Image
B
46
S
17
G
2
Posts: 201
Reputation: 4,526


Return to How do I....?

Who is online

Users browsing this forum: ditocruz and 15 guests