Pausing/Unpausing with ESC

Get help using Construct 2

Post » Sat May 12, 2012 2:47 am

Hi, would anyone be able to tell me why this isn't working?



If for the first statement, instead of "press", I set it to "release", It will bring up my pause screen and will be doing correctly when releasing ESC, but I'm having problems to make the same pause screen disappear pressing ESC again.

Hum, don't know why you can't see the image.
Here you go http://imgur.com/0nKQ2Miyavi2012-05-12 02:50:52
B
6
Posts: 54
Reputation: 808

Post » Sat May 12, 2012 4:00 am

You wrote the exact same event for two categories. The computer reads top-down. It sees, "make items visible" before it sees "make them invisible." This means that every time you press esc, Construct 2 can't read the bottom coding. Try adding an, "if items are visible" statement. It would help a lot if you could upload a .capx of the game.
B
6
S
1
G
1
Posts: 22
Reputation: 719

Post » Sat May 12, 2012 4:29 am

@Miyavi

Might try to use pause plugin.rexrainbow2012-05-12 04:29:18
B
97
S
22
G
177
Posts: 4,113
Reputation: 103,531

Post » Sat May 12, 2012 4:34 am

Put the test on juegoPausado in subevents of the "On key pressed" event.
And for your second test, just put a "Else"

On ESC key pressed
... If JuegoPausado = 1
...... Do stuff;
... Else
...... Do other stuff;
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Sat May 12, 2012 5:04 am

[QUOTE=rexrainbow] @Miyavi

Might try to use pause plugin.[/QUOTE]
I'm using it for pausing the game actually.

[QUOTE=Kyatric] Put the test on juegoPausado in subevents of the "On key pressed" event.
And for your second test, just put a "Else"

On ESC key pressed
... If JuegoPausado = 1
...... Do stuff;
... Else
...... Do other stuff;[/QUOTE]

That's what I needed, I am actually using r84, so I wasn't aware of these new improvements yet.
B
6
Posts: 54
Reputation: 808

Post » Sat May 12, 2012 5:19 am

Hum... got it done like this,
It pauses the game when I press ESC, and the pause screen comes up, but if I press ESC again, the timer would go on, but the pause screen stays.
B
6
Posts: 54
Reputation: 808

Post » Sun May 13, 2012 7:42 pm

So.. I still haven't been able to solve this.

Here's a simplified .capx of what I'm trying to do.

As you see, the orange screen (my pause screen) pops up when I first press ESC, but it won't pop out when I press ESC again.
B
6
Posts: 54
Reputation: 808

Post » Mon May 14, 2012 12:15 am

That's probably because you don't have another layer. And then the display isn't updated.
You're layer really disappear but as there's nothing to draw nothing is erased... Makes sense? :D
Anyway the work around is to set a layer (non transparent) beneath your switchable one, and change the events acordingly (layer 1 instead of 0)
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon May 14, 2012 3:20 am

The .capx I posted isn't my actual game develpoment footage.
It's just a quick example of what I'm trying to achieve.

In my actual content, there are several layers (5 if I recall correctly), being #4 the one related to the pause screen.

In this .capx, it happens just the same as in my actual content: It will pop up, but it won't pop out.

Some enlightment on the subject will be much appreciated.
B
6
Posts: 54
Reputation: 808


Return to How do I....?

Who is online

Users browsing this forum: Mirlas, TELLES0808 and 21 guests