Instance of Symbol 12 MovieClip in Frame 1
onClipEvent (load) {
thrust = 1;
decay = 0.99;
maxSpeed = 15;
}
onClipEvent (enterFrame) {
if (Key.isDown(39)) {
_rotation = (_rotation + 10);
}
if (Key.isDown(37)) {
_rotation = (_rotation - 10);
}
if (Key.isDown(38)) {
xSpeed = xSpeed + (thrust * Math.sin(_rotation * (Math.PI/180)));
ySpeed = ySpeed + (thrust * Math.cos(_rotation * (Math.PI/180)));
flames._visible = 1;
} else {
xSpeed = xSpeed * decay;
ySpeed = ySpeed * decay;
flames._visible = 0;
}
speed = Math.sqrt((xSpeed * xSpeed) + (ySpeed * ySpeed));
if (speed > maxSpeed) {
xSpeed = xSpeed * (maxSpeed / speed);
ySpeed = ySpeed * (maxSpeed / speed);
}
_y = (_y - ySpeed);
_x = (_x + xSpeed);
if (_y < 0) {
_y = 400;
}
if (_y > 400) {
_y = 0;
}
if (_x < 0) {
_x = 550;
}
if (_x > 550) {
_x = 0;
}
}