MoveTowardsPoint2D

From XPUB & Lens-Based wiki
Revision as of 13:10, 18 October 2011 by Jasper van Loenen (talk | contribs) (Created page with "===== Just the formula for now, no code examples (yet) ===== direction = atan2(targetY-objectY, targetX - objectX)*180/PI; objectx += cos(direction*PI/180)*movingSpeed; objecty...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Just the formula for now, no code examples (yet)

direction = atan2(targetY-objectY, targetX - objectX)*180/PI; objectx += cos(direction*PI/180)*movingSpeed; objecty += sin(direction*PI/180)*movingSpeed;