PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Rotation question

Could anyone give me any suggestions on how to make a turret 'aim' at a particular point (like a player sprite for instance...I'm make a side scrolling shooter) Basically as the player flies around the little turret on the ground would aim at the player wherever he goes. Any pointers would be greatly appreciated! :)

thanks!
Trigonometry.
atan2( (y2-y1), (x2-x1) )

iirc...
atan2( (y2-y1), (x2-x1) )

iirc...