Game pauses but doesn't unpause

Get help using Construct 2

Post » Fri Nov 20, 2015 1:44 am

I've been having issues with the pause menu I put in my game. It pauses fine, but doesn't unpause.
The events for it are like this:

Event: On escape pressed
Sub-Event: Timescale=0
Action: Menutext set invisible
Action: Set timescale to 1
Sub-Event: Timescale does not equal 0
Action: Menutext set visible
Action: Set timescale to 0

Any help would be appreciated.
B
5
Posts: 8
Reputation: 243

Post » Sat Nov 21, 2015 2:19 am

Hey iScream, :)

If I understand the events correctly, I think that the first sub event is unpausing the game, and the second sub event is immediately pausing it again.
Consider the following walkthrough of the events:


>>> Timescale = 0.
>>> User presses Escape.
Event: On Escape pressed >>> TRUE
__ Sub-Event: Timescale = 0 >>> TRUE - because Timescale = 0
____ Action: Menutext set invisible >>> Menutext is now invisible.
____ Action: Set timescale to 1 >>> Timescale is now 1.
__ Sub-Event: Timescale does not equal 0 >>> TRUE - because Timescale = 1
____ Action: Menutext set visible >>> Menutext is now visable.
____ Action: Set timescale to 0 >>> Timescale is now 0 again.


You'll need to make sure that only one OR the other sub event runs.
You can use an ELSE condition to achieve this. Manual page for the ELSE condition
Using the ELSE condition, would look like this:

Event: On Escape pressed
__ Sub-Event: Timescale = 0
____ Action: Menutext set invisible
____ Action: Set timescale to 1
__ Sub-Event: ELSE (This will only run if the prior event, at the same indentation level, was false.)
____ Action: Menutext set visible
____ Action: Set timescale to 0


Hope that helps out. :)
B
26
S
17
G
8
Posts: 321
Reputation: 6,015

Post » Fri Nov 27, 2015 11:58 pm

I tried this; it's working now.
thanks!
B
5
Posts: 8
Reputation: 243

Post » Sat Nov 28, 2015 10:51 am

Awesome! Glad it worked out. :)
B
26
S
17
G
8
Posts: 321
Reputation: 6,015


Return to How do I....?

Who is online

Users browsing this forum: bigcatrik, MAVERICK, oosyrag and 7 guests