Combined Code
frame 1 {
stop();
}
button 5 {
on (release) {
gotoAndStop(2);
}
}
// unknown tag 88 length 148
movieClip 11 {
}
movieClip 29 {
frame 16 {
gotoAndPlay(3);
}
}
movieClip 33 {
frame 7 {
stop();
}
}
movieClip 39 {
}
movieClip 40 {
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 3 {
stop();
}
}
instance PLAYER of movieClip 40 {
onClipEvent (load) {
var grav = 0;
var speed = 10;
var jumpHeight = 13;
var slow = 0.7;
var slowspd = speed / 1.5;
var setspeed = speed;
var scale = _xscale;
var ex = 5;
this.gotoAndStop(2);
}
onClipEvent (enterFrame) {
++grav;
_y = _y + grav;
while (_root.ground.hitTest(_x, _y, true)) {
_y = _y - 1;
grav = 0;
}
if (_root.water.hitTest(_x, _y, true)) {
if (grav > 0) {
grav *= slow;
}
speed = slowspd;
} else {
speed = setspeed;
}
if (Key.isDown(68)) {
_x = _x + speed;
_xscale = scale;
if (_root.ground.hitTest(_x, _y + 3, true)) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
} else {
if (Key.isDown(65)) {
_x = _x - speed;
_xscale = -scale;
if (_root.ground.hitTest(_x, _y + 3, true)) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
} else {
if (_root.ground.hitTest(_x, _y + 3, true) && !Key.isDown(79) && !Key.isDown(73)) {
this.gotoAndStop(3);
}
}
}
if (Key.isDown(79) && !Key.isDown(87) && !Key.isDown(65) && !Key.isDown(68) && !Key.isDown(73)) {
this.gotoAndStop(5);
}
if (Key.isDown(73) && !Key.isDown(87) && !Key.isDown(65) && !Key.isDown(68) && !Key.isDown(79)) {
this.gotoAndStop(4);
}
if (Key.isDown(87) && _root.ground.hitTest(_x, _y + 3, true)) {
grav = -jumpHeight;
_y = _y - 4;
this.gotoAndStop(2);
}
if (_root.ground.hitTest(_x + _width / 2 + ex, _y - _height / 2, true) || _root.ground.hitTest(_x + _width / 2 + ex, _y - _height / 6, true) || _root.ground.hitTest(_x + _width / 2 + ex, _y - _height, true)) {
_x = _x - speed;
}
if (_root.ground.hitTest(_x - _width / 2 - ex, _y - _height / 2, true) || _root.ground.hitTest(_x - _width / 2 - ex, _y - _height / 6, true) || _root.ground.hitTest(_x - _width / 2 - ex, _y - _height, true)) {
_x = _x + speed;
}
if (_root.ground.hitTest(_x, _y - _height - 15, true)) {
grav = 1;
}
}
}
button 46 {
on (release) {
gotoAndStop(3);
}
}
frame 3 {
stop();
}
// unknown tag 88 length 214
button 53 {
on (release) {
gotoAndStop(2);
}
}