Friday, July 18, 2014

How do you make an object in game maker come towards you when you get close to it?

How do you make an object in game maker come towards you when you get close to it?
To make Enemy go towards Player when in range.

For Enemy object: On step:
Execute Code:
if(point_distance(Enemy.x,Enemy.y,Player.x,Player.y)<RANGE)

move_towards_point(Enemy.x,Enemy.y,SPEED)


(Replace RANGE with the range and SPEED with the speed)

No comments:

Post a Comment