Object movement

Makes an object move to a certain point and stops on the exact spot

 Create


xx = 400
yy = 304

move_towards_point(xx,yy,5)

//object will now move towards the middle of the screen as soon as it's created. (5 is the speed)
//You can also put the move code into an alarm or step event, as long as you make
//sure it's only executed once.


 Step


if point_distance(x,y,xx,yy) < speed{
	x = xx
	y = yy
	speed = 0
}

//checks every frame if the distance to the xx and yy is less pixels than the movement speed.
//If thats the case it stops moving and set's his new coordinates.