Combined Code
frame 1 {
stop();
}
movieClip 3 {
}
instance of movieClip 3 {
onClipEvent (enterFrame) {
if (_root.char.hitTest(this)) {
charX = 63.25;
_root.char._x = 63.25;
charY = 25.8;
_root.char._y = 25.8;
}
}
}
// unknown tag 88 length 38
button 9 {
on (release) {
gotoAndStop(3);
}
}
button 15 {
on (release) {
gotoAndStop(2);
}
}
button 21 {
on (release) {
gotoAndStop(1);
}
}
movieClip 24 {
}
instance char of movieClip 24 {
onClipEvent (load) {
var ground = _root.ground;
var grav = 0;
var gravity = 2;
var speed = 7;
var maxJump = -14;
var touchingGround = false;
}
onClipEvent (enterFrame) {
_y = _y + grav;
grav += gravity;
while (ground.hitTest(_x, _y, true)) {
_y = _y - gravity;
grav = 0;
}
if (ground.hitTest(_x, _y + 5, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
if (Key.isDown(39)) {
_x = _x + speed;
}
if (Key.isDown(37)) {
_x = _x - speed;
}
if (Key.isDown(38) && touchingGround) {
grav = maxJump;
}
if (ground.hitTest(_x + _width / 2, _y - _height / 2, true)) {
_x = _x - speed;
}
if (ground.hitTest(_x - _width / 2, _y - _height / 2, true)) {
_x = _x + speed;
}
if (ground.hitTest(_x, _y - height, true)) {
grav = 0;
}
}
}
movieClip 26 {
}