Skip to content

Instantly share code, notes, and snippets.

@grapefrukt
Created February 15, 2012 12:34
Show Gist options
  • Save grapefrukt/1835393 to your computer and use it in GitHub Desktop.
Save grapefrukt/1835393 to your computer and use it in GitHub Desktop.
Riktning från rotation
var spinnerDirX:Number = Math.sin(_spinner.rotation / 180 * Math.PI);
var spinnerDirY:Number = Math.cos(_spinner.rotation / 180 * Math.PI);
var bullet:Bullet = new Bullet();
bullet.x = _spinner.x;
bullet.y = _spinner.y;
bullet.velocity.x = spinnerDirX;
bullet.velocity.y = spinnerDirY;
_bullets.add(bullet);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment