Professional Documents
Culture Documents
Actio Scriptnya
Actio Scriptnya
Actio Scriptnya
acceleration = 0.5;
yspeed = 0;
xspeed = 0;
friction = 0.95;
gravity = 0.3
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
xspeed -= acceleration;
}
if (Key.isDown(Key.RIGHT)) {
xspeed += acceleration;
}
if (Key.isDown(Key.UP)) {
yspeed -= acceleration;
}
if (Key.isDown(Key.DOWN)) {
yspeed += acceleration;
}
xspeed *= friction;
yspeed += gravity;
_y += yspeed;
_x += xspeed;
}