Pause menu not working?

Get help using Construct 2

Post » Wed May 28, 2014 3:36 pm

Can someone for the love of all things game related and sacred please try explain why my game pause menu is not working? The menu shows up when pressing Esc but when i click PauseResume (event 21) to close, it will not close! This is driving me insane >.<

pauseissue.png


This is the only part in all my event sheets where the pause menu is referenced. It is on a GUI event sheet and on a GUI layer within the project. Everything else on the event sheet and layer works fine. Except this. The family consists of 5 images - a background and 4 sprites.

Literally considering pulling out the rest of my hair on my shaved head out >:(

Many thanks in advance,
moymoymoy
You do not have the required permissions to view the files attached to this post.
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Wed May 28, 2014 5:22 pm

Hi, i would use a global variable not a instance variable to check if game is paused or not.

This is how i solved it.

pause.png


You can check the pause menu here live.

Demo - Super Mario Platformer (Scroll down and choose your demo)
You do not have the required permissions to view the files attached to this post.
Image Image iTunes: Match3 | Google Play: Match3
B
103
S
37
G
31
Posts: 1,164
Reputation: 28,918

Post » Wed May 28, 2014 6:06 pm

Hey moymoymoy, I don't get what is wrong with your project...

I did a test following your events and everything works fine. Have a look and tell me if there are any important deference that might cause the problem.

Note* I didn't use the wait 0.1 seconds and instead of number variable I used a Boolean.
You do not have the required permissions to view the files attached to this post.
Last edited by eli0s on Wed May 28, 2014 6:56 pm, edited 1 time in total.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Wed May 28, 2014 6:10 pm

Okay so i tried with a global variable instead:

pauseissue2.png


I am getting the same results. After checking on debug mode, i can see the variable is being set to 1 when "Esc" is pressed but when i clicked the "PauseResume" sprite - the variable is not changing back and the menu stays.

This is most confusing.
You do not have the required permissions to view the files attached to this post.
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Wed May 28, 2014 6:10 pm

Hey eli0s, just saw your post, will check it now :)
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Wed May 28, 2014 6:20 pm

I dont get this - i used the boolean variable on the family before and it didnt work. Perhaps the "wait 0.1 secs" was throwing off because i have taken that out now and readded the boolean and it works fine...

Im so sorry to of wasted both of you two's time >.<

Many many thanks though. Im so glad this is resolved. Was driving me nuts!
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Wed May 28, 2014 6:57 pm

Some times the wait action behaves unpredictably. I am glad that you made it work my friend, keep it up!! :)
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Thu May 29, 2014 12:11 pm

Yeah no kidding. But so am i, thank you :)

One last thing regarding this, Is there any reason why i would still be able to click the "PauseMainMenu" sprite even though the pause menu is not visible and collisions for the whole PauseMenu family are turned off?

It seems to be one problem after another with this bloody thing >.<
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Thu May 29, 2014 2:11 pm

*Update*
I have tried with family collisions disabled and individual sprite collisions disabled - both still allow me to return to the main menu if i click where the sprite is AND its invisible with collisions turned off.
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Thu May 29, 2014 3:56 pm

Try adding a is visible condition inside your event for mouse click on .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Next

Return to How do I....?

Who is online

Users browsing this forum: Cubeeo, dop2000 and 25 guests