All pastes #731562 Raw Edit

Stuff

public text v1 · immutable
·published 2007-10-10 04:49 UTC
rendered paste body
ACTIONSCRIPT: 
onClipEvent (load) {
    power = 0.65;
    yspeed = 0;
    xspeed = 0;
    friction = 0.99;
    gravity = 0.1;
    thrust = 0.75;
    wind = 0.05;
}
onClipEvent (enterFrame) {
    if (Key.isDown(Key.LEFT)) {
        xspeed -= power;
    }
    if (Key.isDown(Key.RIGHT)) {
        xspeed += power;
    }
    if (Key.isDown(Key.UP)) {
        yspeed -= power*thrust;
    }
    if (Key.isDown(Key.DOWN)) {
        yspeed += power*thrust;
    }
    xspeed += wind;
    xspeed *= friction;
    yspeed += gravity;
    _y += yspeed;
    _x += xspeed;
    _rotation += xspeed;
}