Frame 1
stop();
Frame 2
stopAllSounds();
gotoAndStop (3);
Frame 3
health.text = 100;
Instance of Symbol 24 MovieClip "char" in Frame 3
onClipEvent (load) {
jumping = false;
speed = 0;
healthX = _root.health._x;
scoreX = _root.score._x;
Xpos = this._x;
Ypos = this._y;
maxmove = 15;
_root.maxshoottime = 100;
}
onClipEvent (enterFrame) {
_x = (Xpos - _root._x);
_root.score._x = scoreX - _root._x;
_root.health._x = healthX - _root._x;
if ((!_root.ground.hitTest(this._x, this._y, true)) && (!jumping)) {
this._y = this._y + 6;
}
if (!_root.shooting) {
_root.timer = 0;
_root.mvsp = _xscale / 20;
}
if (_root.dead) {
this.gotoAndStop("dead");
} else {
speed = speed * 0.85;
if ((dir == "right") && (!_root.leftblock.hitTest(this._x + 20, this._y, true))) {
_root.health._x = _root.health._x + speed;
_root.score._x = _root.score._x + speed;
this._x = this._x + speed;
_root._x = _root._x - speed;
}
if (speed > 0) {
dir = "right";
} else if (speed < 0) {
dir = "left";
}
if ((dir == "left") && (!_root.rightblock.hitTest(this._x - 20, this._y, true))) {
_root.health._x = _root.health._x + speed;
_root.score._x = _root.score._x + speed;
this._x = this._x + speed;
_root._x = _root._x - speed;
}
if (Key.isDown(37)) {
if (speed > (-maxmove)) {
speed--;
}
this.gotoAndStop("run");
this._xscale = -100;
} else if (Key.isDown(39)) {
if (speed < maxmove) {
speed++;
}
this._xscale = 100;
this.gotoAndStop("run");
} else if (((speed < 1) && (speed > -1)) && (!attacking)) {
speed = 0;
this.gotoAndStop("idle");
}
if (Key.isDown(38) && (!jumping)) {
jumping = true;
}
if (jumping) {
this.gotoAndStop("jump");
this._y = this._y - jump;
jump = jump - 0.5;
if (jump < 0) {
falling = true;
}
if (jump < -15) {
jump = -15;
}
}
if (_root.ground.hitTest(this._x, this._y, true) && (falling)) {
jump = 12;
jumping = false;
falling = false;
}
}
}
Instance of Symbol 26 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.char)) {
if (_root.health.text <= 0) {
_root.dead = true;
}
if (!_root.dead) {
_root._x = 0;
_root.health.text = _root.health.text - 150;
_root.char._x = _root.char.startX;
_root.char._y = _root.char.startY + (Stage.height / 2);
_root.char.speed = 0;
}
}
}
Symbol 4 Button
on (press) {
gotoAndStop (2);
}
Symbol 19 MovieClip Frame 3
Symbol 24 MovieClip Frame 1
stop();
Symbol 24 MovieClip Frame 2
stop();
Symbol 24 MovieClip Frame 3
stop();
Symbol 24 MovieClip Frame 4
stop();