move_follow

Downloadmove_follow(object,speed)   Place in Step Event to makes the calling instance move to follow an object or instance at a given speed.
/*
**  Usage:
**      move_follow(object,speed)
**
**  Arguments:
**      object      object or instance to follow
**      speed       speed to follow at
**
**  Returns:
**      Nothing. Makes the calling instance move to follow
**      the given object or instance at the given speed
**
**  GMLscripts.com
*/

{
    if (point_distance(x,y,argument0.x,argument0.y) > 0) {
        direction = point_direction(x,y,argument0.x,argument0.y);
        speed = argument1;
    }
}

Click if you've used this script[Please Login]
Projects: 4

 Contributor: Purple_Flamingo

 History:
Oct 19, 2007 - Purple_Flamingo submits original script
Feb 15, 2008 - Amit points out an inconsistancy between description and function.


comments powered by Disqus