Instance of Symbol 13 MovieClip in Frame 1
onClipEvent (load) {
gravity = 10;
walkSpeed = 6;
maxJump = 4;
scale = _xscale;
}
onClipEvent (enterFrame) {
if (Key.isDown(37)) {
_xscale = (-scale);
_x = (_x - walkSpeed);
this.gotoAndStop(3);
}
if (Key.isDown(39)) {
_xscale = scale;
_x = (_x + walkSpeed);
this.gotoAndStop(3);
}
if (air == true) {
_y = (_y + gravity);
state = 3;
}
if (_root.platforms.hitTest(_x, _y, true)) {
air = false;
} else {
air = true;
}
if (Key.isDown(38) && (jump == true)) {
_y = (_y - jumpSpeed);
gotoAndStop (3);
}
if (air == false) {
jump = true;
jumpcount = 0;
jumpSpeed = 22;
}
if (Key.isDown(38)) {
jumpcount = jumpcount + 1;
this.gotoAndStop(2);
}
if ((jumpcount > maxjump) && (jumpSpeed > -7)) {
jumpSpeed = jumpSpeed - 7;
}
}
onClipEvent (keyUp) {
this.gotoAndStop(1);
walkSpeed = 8;
}
onClipEvent (enterFrame) {
if (this._x >= 550) {
this._x = 545;
}
if (this._x <= 10) {
this._x = 15;
}
}
Symbol 13 MovieClip Frame 1
stop();
Symbol 13 MovieClip Frame 2
stop();
Symbol 13 MovieClip Frame 3
stop();