Movement (Game Maker)

Game Maker has a few variables dedicated to helping you move instances around and keep track of where they currently are. This page lists these variables for you.

Keeping Track of An Instance's Location, and Teleporting

Actions

GML

  • x - the horizontal location of an instance
  • y - the vertical location of an instance.
  • xstart - the starting x location of an instance.
  • ystart - the starting y location of an instance.

Indirectly Moving an Instance

Speed and Direction

Actions
GML
  • direction - the current direction an instance is moving (if it is moving, see speed.
  • hspeed - the horizontal speed of an instance.
  • speed - the overall speed of an instance.
  • vspeed - the vertical speed of an instance.

Gravity

  • gravity - the acceleration of gravity on a game object.
  • gravity direction - the direction of gravity on a game object.

Movement Checking / Planning

Collisions

Distance

Grid Movement

FAQs

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.