Movement

These functions all deal with movement and direction.

In any game, movement and position are of paramount importance and so GameMaker: Studio has a complete selection of functions to deal with every situation.

Built In Variables and Functions

The following functions are all included "built in" to every instance and can be read and modified to change different behaviours when the instance is moving:

  1. direction
  2. friction
  3. gravity
  4. gravity_direction
  5. hspeed
  6. vspeed
  7. speed

X and Y

The following sections detail the different positional variables that are built into each instance:

  1. x
  2. y
  3. xprevious
  4. yprevious
  5. xstart
  6. ystart

Movement Functions

The following functions deal with movement and interaction with other instances through movement:

  1. distance_to_object
  2. distance_to_point
  3. motion_add
  4. motion_set
  5. move_towards_point
  6. move_bounce_all
  7. move_bounce_solid
  8. move_contact_all
  9. move_contact_solid
  10. move_outside_all
  11. move_outside_solid
  12. move_random
  13. move_snap
  14. place_snapped
  15. move_wrap


Back: Movement and Collisions
Next: Motion Planning
© Copyright YoYo Games Ltd. 2018 All Rights Reserved