OK
I'm not happy at all with how this works, I might delete it all and start fresh. The code is pretty sloppy because I have just been experimenting with changing different numbers and variables as I go.
The "planeRelease" variable is a number between 1 and 10, from the scene before, 10 being the best start position, and 1 the worst.
onClipEvent (load) {
angle = _global.planeRelease-10
speed = 10+_global.planeRelease
fall = 12-_global.planeRelease
rotation = 0
gravity = 1
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
rotation += 10;
}
if (Key.isDown(Key.LEFT)) {
rotation -= 10;
}
if (speed <= 0) {
speed = 0.1
}
}
onClipEvent (enterFrame) {
this._x += speed*1.2/10
this._y += rotation+gravity+fall/10
this._rotation = rotation
}
onClipEvent (enterFrame) {
if (rotation > 0) {
speed += .3;
fall += 1
}
if (rotation < 0) {
speed -= .3;
rotation -= .3
}
if (speed <= .5) {
fall += 3
}
}
onClipEvent (enterFrame) {
if (rotation >= 20) {
rotation = 20
}
if (rotation <= -20) {
rotation = -20
}
}