Combined Code
frame 1 {
stop();
}
button 4 {
on (release) {
gotoAndStop(2);
}
}
movieClip 9 {
}
movieClip 21 {
}
movieClip 22 {
}
movieClip 26 {
frame 1 {
stop();
}
}
instance player of movieClip 26 {
onClipEvent (load) {
_root.grav = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(37)) {
this.gotoAndStop(2);
_root.BG._x += 5;
}
if (Key.isDown(39)) {
this.gotoAndStop(1);
_root.BG._x -= 5;
}
_root.grav += 1;
this._y += _root.grav;
while (_root.ground.hitTest(_x, _y, true)) {
_y = _y - 1;
_root.grav = 0;
}
if (Key.isDown(32) && _root.ground.hitTest(_x, _y + 3, true)) {
_root.grav = -13;
}
}
}