• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Pause Menu in Pong Game

I

Ibericus

Guest
Hello guys! I've made my version of Pong Game with 6 scenarios(12 at total if you count the 2Player mode), but Im having a problem with my resume game button. When I press the "resume button" (previous room action) it goes to another room, not the one I was before pausing.

How can I make it that the game always go back to the room I was before pausing the game?

This is the only thing left for the game to be complete.
 

Bingdom

Googledom
When you switch rooms, everything gets reset back to normal unless you implement a saving/loading system.

I would recommend using instance_deactive and instance_activate to pause instead. ;)
 
J

Jaqueta

Guest
Like Bingdom, I would recommend using instance_deactive and instance_activate to pause too.

Alternatively, you could make your game room persistent, but this might cause some inconsistencies, or unexpected behavior.
 
I

Ibericus

Guest
Im not very good with Game Maker and I have no idea how to do this "instance_deactive and instance_activate". Is code needed?

And, is there a way to make it with the action I have: previous room?
 
J

Jaqueta

Guest
Basically, when a instance is deactivated, it stops to do anything, it doesn't run the step, draw, or anything, like is "paused"

You can deactivate all instances with this function: https://docs.yoyogames.com/source/dadiospice/002_reference/objects and instances/instances/deactivating instances/instance_deactivate_all.html

When you need to resume, you need to activate all of them, with this function: https://docs.yoyogames.com/source/dadiospice/002_reference/objects and instances/instances/deactivating instances/instance_activate_all.html

If there's some instances that you DON'T want to deactivate when using deactivate all, you can use the instance_activate_object, just right after the deactivate_all: https://docs.yoyogames.com/source/dadiospice/002_reference/objects and instances/instances/deactivating instances/instance_activate_object.html

If you still have questions about how to proceed, I suggest taking a look into the code of some of the Marketplace assets: https://marketplace.yoyogames.com/search/results?utf8=✓&query=pause

But, long story short, you press a button, all the instances deactivate, you press it again, they activate.
 
Last edited by a moderator:
Top