Main1 Actions in GameMaker: Studio

By Michael Rohde

GameMaker: Studio’s Main1 Actions include the Objects, Sprite, Sounds, and Room Actions in your game. This figure shows all the main1 Actions, which are covered here.

The Main1 tab.
The Main1 tab.

Objects actions in GameMaker

The Objects Actions, as shown in the next figure, are all about creating, changing, and destroying Objects:

  • Create Instance: This Action is used to create Instances during the game when they aren’t already placed in the Room.

  • Create Moving: This Action enables you to set the speed and direction of a newly created Instance.

  • Create Random: GameMaker will randomly create one of four different Objects. If you have fewer than four Objects, you can use No Object.

  • Change Instance: Use this Action to change one Instance, such as a plane, into another Instance, such as an explosion.

  • Destroy Instance: Boom goes the Instance and — poof! — there it’s gone. The name of the Action says it all: Use this Action to destroy an Instance and remove it from the Room.

  • Destroy at Position: This Action is used in conjunction with a bounding box. When you select the Relative check box, the position is determined in relation to the position of the current Instance.

    The Objects Actions from the Main1 tab.
    The Objects Actions from the Main1 tab.

Sprite actions

The Sprite Actions, as shown in the next figure, are all about Sprites. There are three Sprite Actions on the Main1 tab:

  • Change Sprite: Use this Action to change the Sprite of an Instance. You can even configure which sub-image to use. This Action is useful if you want to change the appearance of a character when it changes direction.

  • Transform Sprite: This Action changes the size and orientation of the Sprite for the Instance. You can make it smaller, larger, or even rotate it.

  • Colour Sprite: Yes, the good folks at YoYo Games are from Scotland, and they spell color with a u. This Action blends in color of the current Sprite, so, if you want your Sprite to change colors, a good bit of advice is to create the Sprite in black and white, and then apply the color through this Action. You can also use transparency through this Action.

    The Sprite Actions from the Main1 tab.
    The Sprite Actions from the Main1 tab.

Sound actions

Here are the three Sound Actions, shown in the next figure:

  • Play Sound: Use this Action to play a selected audio file.

  • Stop Sound: Use this Action to stop the audio file from playing.

  • Check Sound: Use this Action when you want GameMaker to test if a particular sound is playing and, if it is, to trigger the next Action.

    The Sound Actions from the Main1 tab.
    The Sound Actions from the Main1 tab.

Room actions

The Room Actions are highlighted in this next figure and are best used when you want the player to move from one Room to the next. There are six different Room Actions:

The Room Actions from the Main1 tab.
The Room Actions from the Main1 tab.
  • Previous Room: This Action moves the player to the previous Room.

  • Next Room: This Action moves the player to the next Room.

  • Restart Room: This Action restarts the Room.

  • Different Room: With this Action, you can select a different Room that you want the player to move to from a drop-down list.

  • Check Previous: This Action checks to see if the previous Room exists; if it does, the next Action in the Action section is triggered.

  • Check Next: This Action checks to see if the next Room exists; if it does, the next Action in the Action section is triggered.

You can change the order of Rooms through the Resource tree by clicking and dragging them up and down.