Skip to content

Instantly share code, notes, and snippets.

@grapefrukt
Created February 15, 2012 12:34
Show Gist options
  • Save grapefrukt/1835397 to your computer and use it in GitHub Desktop.
Save grapefrukt/1835397 to your computer and use it in GitHub Desktop.
Rotation från riktning
var aimX:Number = (mouseX - _player.x);
var aimY:Number = (mouseY - _player.y);
_player.rotation = Math.atan2(aimY, aimX) / Math.PI * 180 + 45;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment