
Rotating a spaceship bitmap
I'm sort of new to AS3. I'm not new to programming in general. This being said, my methods may not be the most efficient, but any help is welcomed.
So.
I'm working on an asteroids game like everybody else. This is the relevant code:
Code:
public class Ship extends Sprite
{
[Embed(source = "../../lib/test_ship.png")]
private var spaceshipClass:Class;
public var spaceship:Bitmap = new spaceshipClass();
public var angle:Number;
public function Ship()
{
this.angle = 0;
//rest of constructor
}
public function move():void
{
//adjust angle
//rest of method...
}
}
I just want to rotate the ship when i press the left and right arrows. I can get the picture to travel in circles with the left and up arrows for example but it doesn't rotate. I left out my failed attempts at rotating so as not to insult your intelligence. I apologize if there's a real simple answer or if I totally screwed something up establishing the picture.