move_outside_all

Moves the instance in a given direction until it no longer comes into contact with any other instance.

Syntax:

move_outside_all(dir, maxdist);


Argument Description
dir The direction to move in.
maxdist The maximum distance the object can travel (-1 or 0 a default value of 1000 pixels).


Returns: N/A


Description

With this function you can tell an instance to move out of a collision in any direction and any number of pixels each step, with a value of -1 or 0 for the maxdist being a default 1000px, ie: GameMaker: Studio will move the instance continually up 1000 pixels until it is out of collision.


Example:

if place_meeting(x, y, all)
   {
   move_outside_all(90, 1);
   }

The above code will move the instance up 1 pixel each step that it is in collision with any other instance.


Back: Moving Around
Next: move_outside_solid
© Copyright YoYo Games Ltd. 2018 All Rights Reserved