Hi, I have have two objects: one is a spaceship and the other is a ball that rotates around the spaceship (shield). I want to be able to press a button have ball move forward (while still rotating), the code I used for the ball rotation is
function moveFireAround(evt:Event) {
evt.target.x = reallyThisObject.x; //reallyThisObject is the ship
evt.target.y = reallyThisObject.y;
radian = angle * (Math.PI/180);
evt.target.x = reallyThisObject.x + radius * Math.cos(radian);
evt.target.y = reallyThisObject.y + radius * Math.sin(radian);
angle+= angleChange;
}
This works fine of course, but I’m having a hard time moving the ball forward while simultaneously rotating, any ideas?
Thanks