

The other variable, screenShot, will be used to store the index (in GameMaker an index is a number that points to a resource like a sprite or object) of a sprite that we will be creating later. Its a boolean (a true/false) that we will use to trigger the pause/unpause state. Inside the Create Event, we need to initialize some variables. Create a new object, name it oGame, and add the Create Event. I prefer to keep the name of the object as short as possible, since you may be referring back to it often from other objects. No, I don’t mean an Xbox controller! I mean an object in your game that acts as the overseer for all other objects, game states, score, screen size, pausing, etc etc. The easiest way to manage pausing (and lots of other global game related things) is to do so from a Game Controller.

When we need to unpause we simply call the function instance_activate_all() to turn everything back on. The objects are not deleted, but they are no longer shown on screen when deactivated. This particular function will essentially turn off all of your game objects.

There is a very handy GameMaker function called instance_deactivate_all() that will make this easy for us to manage. The code stops running in the object when paused, and picks back up when unpaused. Pausing is simply the act of stopping, or freezing, the objects in your game. It is a fairly simple process, but it can be a bit confusing if you are unfamiliar with certain GameMaker functions. Today, I want to talk to you about how to pause your game. Hello, and welcome to another GameMaker basics tutorial.
