Pause menu not working?

0 favourites
  • 12 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • 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 >.<

    [attachment=0:1c5mvz8x][/attachment:1c5mvz8x]

    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

  • 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.

    [attachment=0:gukhkwnh][/attachment:gukhkwnh]

    You can check the pause menu here live.

    Demo - Super Mario Platformer (Scroll down and choose your demo)

  • 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.

  • Okay so i tried with a global variable instead:

    [attachment=0:hsqwjwl7][/attachment:hsqwjwl7]

    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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey eli0s, just saw your post, will check it now

  • 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!

  • Some times the wait action behaves unpredictably. I am glad that you made it work my friend, keep it up!!

  • 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 >.<

  • *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.

  • Try adding a is visible condition inside your event for mouse click on .

  • I cannot believe it was that simple, Sometimes i really question my intelligence lol.

    Thank you so much for that, you have just saved me a tonne of grief.

  • I use a pause Array...

    I hope this helps

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)