Actio Scriptnya

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

onClipEvent (load) {

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;
}

You might also like