Posted By

tuffstudio on 12/30/10


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

adrianparr
liakwee


Rotation With Mouse Formulas


 / Published in: ActionScript
 

  1. dx = mouseX - sprite.x;
  2. dy = mouseY - sprite.y;
  3. sprite.rotation = Math.atan2(dy, dx) * 180 / Math.PI;

Report this snippet  

You need to login to post a comment.