Thread title pretty much speaks for itself. I have a movieclip, which is a line, and it rotates with some actionscript
this._rotation += 1;
now I am wanting to get the xspeed and yspeed for the bullet based on it’s rotation.
This is what I currently have for the bullet:
onClipEvent(load)
{
var maxSpeed:Number = 3;
var angle:Number = _root.angleClip._rotation;
var ySpeed:Number = Math.sin(angle) * this.maxSpeed;
var xSpeed:Number = Math.cos(angle) * this.maxSpeed
}
onClipEvent(enterFrame){
this._x+= this.xSpeed;
this._y+= this.ySpeed;
}
but all this does is send it off in a random direction. Think of what I’m trying to do as if it was a top down shooter where you fired towards your cursor. But instead of a moving character it’s a stationary point and instead of the mouse it’s a constantly rotating angle. Kind of like an automated turret.