Created
February 15, 2012 12:34
-
-
Save grapefrukt/1835393 to your computer and use it in GitHub Desktop.
Riktning från rotation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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