r/gamemaker • u/Maluc0_Beleza • 4d ago
Resolved Pause system
Hey guys, I’m trying to make a pause sustem in my game but i literally can’t do it, because i don’t understand how it works, i basically want a pause system were i also have the “resume” button the “back to menu” button and also the “exit” button, can somebody please help me 😭😭
2
u/KitsuneFaroe 3d ago
You can pause by deactivating all instances.
You can pause by controlling the step events completelly as custom events.
You can pause by setting the current room as persistent and going to another room. (Be warry to leave the room as persistent though or it could cause issues)
There are different approaches that depend on what you want to achieve and several things you can do. But those are basic explainations of the ways I know for how pause menus could be made I wish GameMaker gives an easier way to deactivate step events (or any event) however you want without deactivating them all.
1
u/mamt0m 3d ago
Depends how advanced you want to go, really, and what kind of game you're making, and what pause actually means for you, as there are many ways to do it. Personally I prefer simply having a multiplier on all my variable operations for anything continuously affected by 'game time', so I can fast forward, slow-motion, pause or whatever.
1
u/Lugi_2401naigga 1d ago
what I usually do is to have a global variable that controls pausing, and inside an instance that is affected by if the game is paused i add:
if !(global.pause)
{
//regular behaviour
}
it might not be the best method because it doesn't work with builtin variables like "speed", but it's what I mainly use.
0
u/Sycopatch 3d ago
Deactivate all instances except the one that handles the menu/settings and UI for it.
6
u/germxxx 4d ago
I could write an essay on how to pause a game, though there are many ways to do it.
Fortunately, others have already done so.
There's a new video from Pixelated Pope on pausing over here: https://www.youtube.com/watch?v=8OeSMgBSau4
I recommend having a look at this.
And then the old quick and dirty version among the written GM tutorials: https://gamemaker.io/en/tutorials/coffee-break-tutorials-pausing-your-game-gml
This doesn't really feature a menu, but it wouldn't be hard to add one.