How do I pause game for 1 sec when object appears and resume

Get help using Construct 2

Post » Sat Sep 05, 2015 2:58 pm

So on the project I'm working on, I put a "boss spawn" trigger. After 10 enemy kills, a boss appears. What I want to do is pause the game for, say 2 secs -- without any menu popping up or anything (just to let player know that a boss appeared) and resume the game action after 2 secs. I've searched the forums, but most discussion about pause is having menu and user input on it. I just want to make it simple -- Boss appear, pause it for 2 secs, then resume action.

Please see my code. When the boss spawns, it pauses game indefinitely and it doesn't resume back to regular time scale. Thanks for the help in advance.

Image
B
28
S
11
G
15
Posts: 47
Reputation: 9,533

Post » Sat Sep 05, 2015 3:14 pm

Put the set time scale to 1.0 on its own event, that should fix it.
B
7
S
1
Posts: 54
Reputation: 527

Post » Sat Sep 05, 2015 3:23 pm

@clarke2509, Thanks for your reply. But, how do I do that? Sorry I'm still new in using Construct 2. System > add event does not have the "set time scale" option.
B
28
S
11
G
15
Posts: 47
Reputation: 9,533

Post » Sat Sep 05, 2015 5:45 pm

Make a global variable called "Paused". Write 2 conditions:

Paused = 0 》Set time scale to 1.0

Paused =1 》 Set time scale to 0.0
___________ 》System wait 1.0
___________ 》Set Paused to 0
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Sat Sep 05, 2015 5:49 pm

I just tested it and because your setting the time scale to 0, you can't wait one second because time has stopped. I'm sure I could find away around this later but for now you can have like a slow motion entry for the boss,

so set the time scale to 0.1
then wait 1 second (remember its actually going to be 10 seconds because of the time scale being 0.1)
Then set time scale back to 1.0
B
7
S
1
Posts: 54
Reputation: 527

Post » Sat Sep 05, 2015 6:25 pm

@TheDom, thank you. I actually played around with it a bit. Turns out I like it in slow-mo better (when the boss appear) instead of just "pausing" the entire action. @Clarke2509, @TheDom, Thank you both! Your help is very much appreciated.
B
28
S
11
G
15
Posts: 47
Reputation: 9,533

Post » Sun Sep 06, 2015 6:55 pm

Yes, sorry. I should have realized that. Alternatively you could put all objects into a family and use the System Time Scale Object instead.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, David181, lahbach and 27 guests