Posted By

necnova on 04/08/11


Tagged

mouse rotation as3


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Josueriv
burnandbass


AS3 Rotation with Mouse


 / Published in: ActionScript 3
 

  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.