Jump Actions in GameMaker: Studio

By Michael Rohde

GameMaker: Studio’s Jump Actions, shown in this figure, enable you to move Instances around the Room — at one moment, the Instance may be at the bottom of the Room, but in the next moment it’s at the top of the Room. Here are your options:

  • Jump to Position: GameMaker checks the position of the Instances, such as checking to see if the Object left the Room. If the Object does leave the Room, you could have it reappear at the top of the Room by jumping.

    Another example is if a player dies, and you want the player to restart in a specific position. You specify the X and Y coordinates to determine where the Instance jumps to.

  • Jump to Start: Use this Action to move an Instance back to where it was created.

    The Jump Actions from the Move tab.
    The Jump Actions from the Move tab.
  • Jump to Random: Use this Action to randomly move the Instance about the Room. Instances won’t appear where any other solid Instances are located.

  • Align to Grid: This Action enables you to snap an Instance to a position for accurate placement within the game.

  • Wrap Screen: Wrapping is when an Instance can leave one side of the screen and reappear on the other. One example of this is where the player’s ship can leave one side of the screen during the game and reappear on the other.

    This Action is typically used together with the Outside Room Event; when the Instance is outside the Room, wrap it around to the other side. You can choose only horizontal, only vertical, or both.

  • Move to Contact: Use this Action when you want an Instance to stop moving when it encounters another Instance or when it moves the maximum amount of distance that you set.

    You can enter a value of –1 for the Instance to travel for an infinite distance (no maximum). This Action also enables you to set the direction of the Instance. This Action is typically used with a Collision Event.

  • Bounce: Use this Action when you want an Instance to naturally bounce off other Instances. If you set Precise to false, you get the natural bounce effect only on straight walls; if you set Precise to true, you get the natural bounce even on slanted walls.