Code:
onClipEvent (keyDown) {
if (Key.isDown(Key.LEFT)) {
//change the value of rotspeed to speed up the rate of turn
rotspeed -= 5;
} else if (Key.isDown(Key.RIGHT)) {
rotspeed += 5;
}
}
onClipEvent (enterFrame) {
//change the number at the end of this i.e 5 to speed up or decrease speed of forward trajectory
ychange = (math.cos((math.PI/180)*rotspeed))*5;
xchange = (math.sin((math.PI/180)*rotspeed))*5;
setProperty (this, _y, this._y - ychange);
setProperty (this, _x, this._x + xchange);
setProperty (this, _rotation, rotspeed);
}
