Combined Code
frame 1 {
punch1 = new Sound(this);
punch1.attachSound('punch1');
punch2 = new Sound(this);
punch2.attachSound('punch2');
punch3 = new Sound(this);
punch3.attachSound('punch3');
punch4 = new Sound(this);
punch4.attachSound('punch4');
whip1 = new Sound(this);
whip1.attachSound('whip1');
punch5 = new Sound(this);
punch5.attachSound('punch5');
attacking = false;
hurt = false;
scroll = false;
fullcombo = false;
score = 0;
dead = false;
}
movieClip 12 {
}
movieClip 18 {
frame 1 {
function timerHandler() {
if (!loadingComplete) {
var v4 = _root.getBytesLoaded() / _root.getBytesTotal();
bar._xscale = 100 * v4;
if (v4 == 1) {
loadingComplete = true;
if (AUTO_PLAY) {
startMovie();
} else {
gotoAndStop('loaded');
}
return undefined;
}
}
dt = getTimer() - time;
time += dt;
frameAccum += dt;
var v3 = 0;
for (;;) {
if (!(frameAccum >= FRAME_TIME && v3 < MAX_FRAME_SKIP)) break;
advanceFrame(tankLogo, true, true);
advanceFrame(loadingText, false, true);
advanceFrame(barGfx, false, true);
if (loadingComplete) {
advanceFrame(this, false, false);
}
frameAccum -= FRAME_TIME;
v3++;
}
updateAfterEvent();
}
function advanceFrame(clip, recurse, loop) {
if (!clip) {
return undefined;
}
clip.stop();
if (clip._currentframe == clip._totalframes) {
if (loop) {
clip.gotoAndStop(1);
}
} else {
clip.nextFrame();
}
if (recurse) {
for (childName in clip) {
if (typeof clip[childName] == 'movieclip') {
advanceFrame(clip[childName], recurse, loop);
}
}
}
}
function startMovie() {
clearInterval(intervalId);
_root.play();
}
_root.stop();
stop();
var FRAME_TIME = 33.33333333333334;
var AUTO_PLAY = false;
var MAX_FRAME_SKIP = 5;
var loadingComplete;
var intervalId;
var time;
var frameAccum;
loadingComplete = false;
intervalId = setInterval(this, 'timerHandler', FRAME_TIME / 2);
frameAccum = 0;
time = getTimer();
timerHandler();
}
frame 37 {
startMovie();
}
}
movieClip 20 {
}
instance of movieClip 20 {
onClipEvent (load) {
this.swapDepths(100000);
}
}
frame 2 {
stop();
attacking = false;
hurt = false;
scroll = false;
fullcombo = false;
score = 0;
dead = false;
}
movieClip 24 {
}
instance background of movieClip 24 {
onClipEvent (enterFrame) {
if (this._x < -600) {
_x = _x + 600;
}
}
}
movieClip 28 {
}
movieClip 33 {
}
movieClip 36 {
}
movieClip 38 {
}
movieClip 43 {
}
movieClip 48 {
}
movieClip 53 {
instance hit of movieClip 38 {
onClipEvent (enterFrame) {
_alpha = 0;
}
}
frame 7 {
if (Key.isDown(65) || Key.isDown(97)) {
play();
} else {
_root.attacking = false;
}
}
frame 8 {
prevFrame();
}
}
movieClip 58 {
instance hit of movieClip 38 {
onClipEvent (enterFrame) {
_alpha = 0;
}
}
frame 7 {
if (Key.isDown(83) || Key.isDown(115)) {
play();
} else {
_root.attacking = false;
}
}
frame 8 {
prevFrame();
}
}
movieClip 60 {
frame 10 {
_root.healthbar.nextFrame();
}
frame 11 {
_root.hurt = false;
}
}
movieClip 61 {
instance hit of movieClip 38 {
onClipEvent (enterFrame) {
_alpha = 0;
}
}
frame 36 {
_root.mrsound.gotoAndStop(random(6) + 2);
}
}
instance mrmongoose of movieClip 61 {
onClipEvent (load) {
this.gotoAndStop('neutral');
xspeed = 5;
dead = false;
}
onClipEvent (enterFrame) {
_root.scroll = false;
if (dead == false) {
if (_root.attacking == false && _root.hurt == false) {
if (Key.isDown(37)) {
this.gotoAndStop('walkl');
if (_x > 75) {
_x = _x - xspeed;
}
if (Key.isDown(38)) {
if (_y > 100) {
_y = _y - 3;
}
}
if (Key.isDown(40)) {
if (_y < 350) {
_y = _y + 3;
}
}
} else {
if (Key.isDown(39)) {
this.gotoAndStop('walkr');
if (_x < 300) {
_x = _x + xspeed;
} else {
_root.background._x -= xspeed;
_root.scroll = true;
}
if (Key.isDown(38)) {
if (_y > 100) {
_y = _y - 3;
}
}
if (Key.isDown(40)) {
if (_y < 350) {
_y = _y + 3;
}
}
} else {
if (Key.isDown(38)) {
this.gotoAndStop('walkr');
if (_y > 100) {
_y = _y - 3;
}
} else {
if (Key.isDown(40)) {
this.gotoAndStop('walkr');
if (_y < 350) {
_y = _y + 3;
}
} else {
this.gotoAndStop('neutral');
}
}
}
}
if (Key.isDown(65) || Key.isDown(97)) {
_root.attacking = true;
this.gotoAndStop('lpunch');
_root.lefthook._x = _x + 60;
_root.lefthook._y = _y + 15;
_root.lefthook.gotoAndPlay(1);
}
if (Key.isDown(83) || Key.isDown(115)) {
_root.attacking = true;
this.gotoAndStop('rpunch');
_root.righthook._x = _x + 25;
_root.righthook._y = _y + 30;
_root.righthook.gotoAndPlay(1);
}
}
if (_root.hurt == true) {
_root.attacking = false;
this.gotoAndStop('hurt');
if (_x > 75) {
_x = _x - 2;
}
}
this.swapDepths(this._y + 57);
} else {
this.gotoAndStop('dead');
this.swapDepths(50000);
}
}
}
movieClip 67 {
frame 6 {
stop();
}
}
instance lefthook of movieClip 67 {
onClipEvent (load) {
this.swapDepths(10000);
}
onClipEvent (enterFrame) {
if (_root.attacking == false) {
_x = 1000;
}
}
}
instance righthook of movieClip 67 {
onClipEvent (load) {
this.swapDepths(10001);
}
onClipEvent (enterFrame) {
if (_root.attacking == false) {
_x = 1000;
}
}
}
button 71 {
on (press) {
_root.hurt = true;
}
}
movieClip 76 {
}
movieClip 82 {
frame 1 {
stop();
}
frame 5 {
_parent.dead = true;
}
}
// unknown tag 88 length 91
movieClip 95 {
}
movieClip 96 {
instance of movieClip 95 {
onClipEvent (load) {
this.gotoAndStop(random(5) + 1);
}
}
instance of movieClip 38 {
onClipEvent (load) {
_alpha = 0;
if (this.hitTest(_root.mrmongoose.hit)) {
_root.hurt = true;
_root.combobar.gotoAndStop(1);
}
}
}
frame 30 {
_parent.attack = false;
}
}
movieClip 98 {
frame 1 {
_root.combobar.nextFrame();
}
frame 11 {
_parent.hurt = false;
}
}
movieClip 102 {
}
movieClip 103 {
instance hit of movieClip 38 {
onClipEvent (enterFrame) {
_alpha = 0;
}
}
frame 22 {
_root.mrsound.gotoAndStop(random(6) + 2);
}
frame 29 {
++_root.score;
}
}
instance of movieClip 103 {
onClipEvent (load) {
attack = false;
hurt = false;
dead = false;
}
onClipEvent (enterFrame) {
if (dead == false) {
if (attack == false && hurt == false) {
if (this._x - _root.mrmongoose._x > -30) {
this.gotoAndStop('runl');
_x = _x - 3;
if (this._y - _root.mrmongoose._y > 10) {
_y = _y - 1.5;
}
if (this._y - _root.mrmongoose._y < -20) {
_y = _y + 1.5;
}
} else {
if (this._x - _root.mrmongoose._x < -50) {
_x = _x + 3;
this.gotoAndStop('runr');
if (this._y - _root.mrmongoose._y > 10) {
_y = _y - 1.5;
}
if (this._y - _root.mrmongoose._y < -20) {
_y = _y + 1.5;
}
} else {
if (this._y - _root.mrmongoose._y > 10) {
_y = _y - 1.5;
this.gotoAndStop('runr');
} else {
if (this._y - _root.mrmongoose._y < -20) {
_y = _y + 1.5;
this.gotoAndStop('runr');
} else {
this.gotoAndStop('attack');
attack = true;
}
}
}
}
if (_root.attacking == true && this.hit.hitTest(_root.mrmongoose.attack.hit)) {
hurt = true;
attack = false;
this.gotoAndStop('hurt');
this.healthbar.nextFrame();
}
}
if (hurt == true) {
_x = _x + 2.5;
}
} else {
this.gotoAndStop('dead');
_x = _x - 2.5;
}
if (_root.scroll == true) {
_x = _x - _root.mrmongoose.xspeed;
}
this.swapDepths(this._y + 70);
if (this._x < -100) {
_x = random(300) + 750;
_y = random(350) + 100;
dead = false;
hurt = false;
attack = false;
}
}
}
instance of movieClip 103 {
onClipEvent (load) {
attack = false;
hurt = false;
dead = false;
}
onClipEvent (enterFrame) {
if (dead == false) {
if (attack == false && hurt == false) {
if (this._x - _root.mrmongoose._x > 10) {
this.gotoAndStop('runl');
_x = _x - 3;
if (this._y - _root.mrmongoose._y > 15) {
_y = _y - 2;
}
if (this._y - _root.mrmongoose._y < 0) {
_y = _y + 2;
}
} else {
if (this._x - _root.mrmongoose._x < -40) {
_x = _x + 3;
this.gotoAndStop('runr');
if (this._y - _root.mrmongoose._y > 15) {
_y = _y - 2;
}
if (this._y - _root.mrmongoose._y < 0) {
_y = _y + 2;
}
} else {
if (this._y - _root.mrmongoose._y > 15) {
_y = _y - 2;
this.gotoAndStop('runr');
} else {
if (this._y - _root.mrmongoose._y < 0) {
_y = _y + 2;
this.gotoAndStop('runr');
} else {
this.gotoAndStop('attack');
attack = true;
}
}
}
}
if (_root.attacking == true && this.hit.hitTest(_root.mrmongoose.attack.hit)) {
hurt = true;
attack = false;
this.gotoAndStop('hurt');
this.healthbar.nextFrame();
}
}
if (hurt == true) {
_x = _x + 2;
}
} else {
this.gotoAndStop('dead');
_x = _x - 2.5;
}
if (_root.scroll == true) {
_x = _x - _root.mrmongoose.xspeed;
}
this.swapDepths(this._y + 70);
if (this._x < -100) {
_x = random(300) + 750;
_y = random(350) + 100;
dead = false;
hurt = false;
attack = false;
}
}
}
instance of movieClip 103 {
onClipEvent (load) {
attack = false;
hurt = false;
dead = false;
}
onClipEvent (enterFrame) {
if (dead == false) {
if (attack == false && hurt == false) {
if (this._x - _root.mrmongoose._x > 20) {
this.gotoAndStop('runl');
_x = _x - 3;
if (this._y - _root.mrmongoose._y > 20) {
_y = _y - 1.5;
}
if (this._y - _root.mrmongoose._y < 0) {
_y = _y + 1.5;
}
} else {
if (this._x - _root.mrmongoose._x < 0) {
_x = _x + 2.5;
this.gotoAndStop('runr');
if (this._y - _root.mrmongoose._y > 20) {
_y = _y - 1.5;
}
if (this._y - _root.mrmongoose._y < 0) {
_y = _y + 1.5;
}
} else {
if (this._y - _root.mrmongoose._y > 20) {
_y = _y - 1.5;
this.gotoAndStop('runr');
} else {
if (this._y - _root.mrmongoose._y < 0) {
_y = _y + 1.5;
this.gotoAndStop('runr');
} else {
this.gotoAndStop('attack');
attack = true;
}
}
}
}
if (_root.attacking == true && this.hit.hitTest(_root.mrmongoose.attack.hit)) {
hurt = true;
attack = false;
this.gotoAndStop('hurt');
this.healthbar.nextFrame();
}
}
if (hurt == true) {
_x = _x + 3;
}
} else {
this.gotoAndStop('dead');
_x = _x - 2.5;
}
if (_root.scroll == true) {
_x = _x - _root.mrmongoose.xspeed;
}
this.swapDepths(this._y + 70);
if (this._x < -100) {
_x = random(300) + 750;
_y = random(350) + 100;
dead = false;
hurt = false;
attack = false;
}
}
}
instance of movieClip 103 {
onClipEvent (load) {
attack = false;
hurt = false;
dead = false;
}
onClipEvent (enterFrame) {
if (dead == false) {
if (attack == false && hurt == false) {
if (this._x - _root.mrmongoose._x > 50) {
this.gotoAndStop('runl');
_x = _x - 2.5;
if (this._y - _root.mrmongoose._y > 10) {
_y = _y - 2;
}
if (this._y - _root.mrmongoose._y < -20) {
_y = _y + 2;
}
} else {
if (this._x - _root.mrmongoose._x < 20) {
_x = _x + 2.5;
this.gotoAndStop('runr');
if (this._y - _root.mrmongoose._y > 10) {
_y = _y - 2;
}
if (this._y - _root.mrmongoose._y < -20) {
_y = _y + 2;
}
} else {
if (this._y - _root.mrmongoose._y > 10) {
_y = _y - 2;
this.gotoAndStop('runr');
} else {
if (this._y - _root.mrmongoose._y < -20) {
_y = _y + 2;
this.gotoAndStop('runr');
} else {
this.gotoAndStop('attack');
attack = true;
}
}
}
}
if (_root.attacking == true && this.hit.hitTest(_root.mrmongoose.attack.hit)) {
hurt = true;
attack = false;
this.gotoAndStop('hurt');
this.healthbar.nextFrame();
}
}
if (hurt == true) {
_x = _x + 3;
}
} else {
this.gotoAndStop('dead');
_x = _x - 2.5;
}
if (_root.scroll == true) {
_x = _x - _root.mrmongoose.xspeed;
}
this.swapDepths(this._y + 70);
if (this._x < -100) {
_x = random(300) + 750;
_y = random(350) + 100;
dead = false;
hurt = false;
attack = false;
}
}
}
instance of movieClip 103 {
onClipEvent (load) {
attack = false;
hurt = false;
dead = false;
}
onClipEvent (enterFrame) {
if (dead == false) {
if (attack == false && hurt == false) {
if (this._x - _root.mrmongoose._x > 50) {
this.gotoAndStop('runl');
_x = _x - 2.5;
if (this._y - _root.mrmongoose._y > 10) {
_y = _y - 2;
}
if (this._y - _root.mrmongoose._y < -20) {
_y = _y + 2;
}
} else {
if (this._x - _root.mrmongoose._x < 20) {
_x = _x + 2.5;
this.gotoAndStop('runr');
if (this._y - _root.mrmongoose._y > 10) {
_y = _y - 2;
}
if (this._y - _root.mrmongoose._y < -20) {
_y = _y + 2;
}
} else {
if (this._y - _root.mrmongoose._y > 10) {
_y = _y - 2;
this.gotoAndStop('runr');
} else {
if (this._y - _root.mrmongoose._y < -20) {
_y = _y + 2;
this.gotoAndStop('runr');
} else {
this.gotoAndStop('attack');
attack = true;
}
}
}
}
if (_root.attacking == true && this.hit.hitTest(_root.mrmongoose.attack.hit)) {
hurt = true;
attack = false;
this.gotoAndStop('hurt');
this.healthbar.nextFrame();
}
}
if (hurt == true) {
_x = _x + 3;
}
} else {
this.gotoAndStop('dead');
_x = _x - 2.5;
}
if (_root.scroll == true) {
_x = _x - _root.mrmongoose.xspeed;
}
this.swapDepths(this._y + 70);
if (this._x < -100) {
_x = random(300) + 750;
_y = random(350) + 100;
dead = false;
hurt = false;
attack = false;
}
}
}
// unknown tag 88 length 68
movieClip 112 {
frame 1 {
stop();
}
frame 2 {
_root.punch1.start(0, 1);
gotoAndStop(1);
}
frame 3 {
_root.punch2.start(0, 1);
gotoAndStop(1);
}
frame 4 {
_root.punch3.start(0, 1);
gotoAndStop(1);
}
frame 5 {
_root.punch4.start(0, 1);
gotoAndStop(1);
}
frame 6 {
_root.whip1.start(0, 1);
gotoAndStop(1);
}
frame 7 {
_root.punch5.start(0, 1);
gotoAndStop(1);
}
}
button 116 {
on (release, keyPress '/') {
nextFrame();
}
on (keyPress '?') {
nextFrame();
}
}
// unknown tag 88 length 107
// unknown tag 88 length 64
button 130 {
on (release, keyPress '/') {
prevFrame();
}
on (keyPress '?') {
prevFrame();
}
}
movieClip 131 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
instance of movieClip 131 {
onClipEvent (load) {
this.swapDepths(50000);
}
}
movieClip 134 {
}
instance paper of movieClip 134 {
onClipEvent (load) {
this.swapDepths(1000000);
}
}