Hello to all
I’m having a problem with the game’s pause button so that even though the stop page appears , the pause button still controls the counter object (MOVES LEFT object )… and (AimPoints object ) … and( Payer object) … What I want is all this stuff to freeze when I hit the pause button … And the game will continue after clicking on the (Play button object ) Play continues from the last stop… …
I don’t know what the specific problem is, but can you use just one play/pause variable and make it Boolean? And when ‘p’ is pressed it changes gamePaused to 1. But in the sub event you say what should happen for that scenario and also if gamePaused is 0. But you’ve already changed it to 1 so the 0 actions can’t happen? (I didn’t look at anything after that).
Okay I looked at some more. A bit further on you say when gamePaused is 0 and one of the actions for that is to change it to 1. So it’s probably going to cause some kind of conflict. And you also have a Pausenow variable? Haha, I’ll stop now and let the experts come along and sort it out.
Firstly, you are changing the scene to “PausePage”. But in the pause page you are stopping and returning to a previously paused page (which never happened; it was only changed and never paused).
You want to Pause the scene and start another instead :
You want the events that control object movement to be subevents of an event that checks if gamePaused = 1 (similarly to how gameRunning is used in a condition and its subevents)
I am also not a professional. I just followed some of the explanations and applied it, but it seems that I failed or made a mistake in the application
Thank you I will try
And tell you the results
Unfortunately after testing it didn’t work
I had a PM with the OP. Turns out the change scene wasn’t the problem - it was the pause layer.
I showed the OP how to use FSM (Finite state Machine) to segregate the playing and pause events. This resolved OP’s issue.
Thank you very much, this is exactly what I need
Thank you again for your help