MoveTowardsPoint2D
Revision as of 12:56, 18 October 2011 by Jasper van Loenen (talk | contribs)
Just the formula for now, no code examples (yet)
x1, y1 = position of object to move
x2, y2 = position to move to
direction = atan2(y2-y1, x2 - x1)*180/PI;
x1 += cos(direction*PI/180)*movingSpeed;
y1 += sin(direction*PI/180)*movingSpeed;