Hi, I want to make a pause menu where the player can choose whether they want to resume or quit the game.
The menu can be accessed by clicking the pause button at the top of the game layout.
The problem is I don't know how to make the game continue from the last they pause it (resume game).
A very helpful answer from Popcorn:
I guess there is an extension for this. However, here is an extensionfree solution for you that should work for all runtimes:
1: Make a counter. Code your game so that when the counter is 0, the game is running, and when the counter is 1, the game is paused: every object gets a movement and animationspeed of 0.
If you have timed events, you should be careful about how you design them. The best would probably be to use a counter or alterable / global value that works as a stand-in for the timer, but only when the game is not paused.
2: Make a new layer in the same frame and put it infront of all your other layers. (Press ctrl+k to open the layer window). This will be your pause-menu-screen. Show this layer when the counter is 1, and hide it when the counter is 0.
But I have questions:
Where should I put them? The counter and the events I mean?
at the pause menu or at the game stage?
Can anybody help me?