Frame 1
function nofunction() {
}
function getConsoleSpark() {
getURL ("http://www.consolespark.com");
}
function getNetWarriors() {
getURL ("http://www.freewebs.com/thenetwarriors");
}
stop();
var menu = new ContextMenu();
var menu1_cmi = new ContextMenuItem("Copyright (C) 2007 Adman1993 and ShirkDeio", nofunction);
var menu2_cmi = new ContextMenuItem("All Rights Reserved", nofunction);
var menu3_cmi = new ContextMenuItem("Visit our Websites!", nofunction);
menu3_cmi.separatorBefore = true;
var menu4_cmi = new ContextMenuItem("Adman's Site (ConsoleSpark)", getConsoleSpark);
var menu5_cmi = new ContextMenuItem("Shirk's Site (NetWarriors)", getNetWarriors);
menu.hideBuiltInItems();
menu.customItems.push(menu1_cmi, menu2_cmi, menu3_cmi, menu4_cmi, menu5_cmi);
this.menu = menu;
MochiAd.showPreGameAd({id:"af7c9336ba554e0d", res:"650x400"});
Frame 3
stop();
key = new Object();
key.onKeyDown = function () {
if (Key.isDown(32)) {
_root.onMouseDown = function () {
};
_root.key.onKeyDown = function () {
};
lightning.play();
_root.play();
}
};
Key.addListener(key);
_root.onMouseDown = function () {
_root.onMouseDown = function () {
};
_root.key.onKeyDown = function () {
};
_root.play();
};
if (song == undefined) {
song = new Sound();
song.attachSound("songMenu");
song.start();
song.onSoundComplete = function () {
song.start();
};
}
Frame 4
stop();
campaign_mc.onRollOver = function () {
this.gotoAndStop("over");
};
campaign_mc.onRollOut = function () {
this.gotoAndStop("up");
};
campaign_mc.onRelease = function () {
lightning.play();
_root.gotoAndStop("campaign");
};
instructions_mc.onRollOver = function () {
this.gotoAndStop("over");
};
instructions_mc.onRollOut = function () {
this.gotoAndStop("up");
};
instructions_mc.onRelease = function () {
lightning.play();
_root.gotoAndStop("instructions");
};
arcade_mc.onRollOver = function () {
this.gotoAndStop("over");
};
arcade_mc.onRollOut = function () {
this.gotoAndStop("up");
};
arcade_mc.onRelease = function () {
lightning.play();
_root.gotoAndStop("arcadeMenu");
};
credits_mc.onRollOver = function () {
this.gotoAndStop("over");
};
credits_mc.onRollOut = function () {
this.gotoAndStop("up");
};
credits_mc.onRelease = function () {
lightning.play();
_root.gotoAndStop("credits");
};
Frame 5
stop();
easy_mc.onRollOver = function () {
this.gotoAndStop("over");
};
easy_mc.onRollOut = function () {
this.gotoAndStop("up");
};
easy_mc.onRelease = function () {
song.stop();
song = undefined;
lightning.play();
_root.gotoAndStop("arcade");
difficulty = 0;
};
medium_mc.onRollOver = function () {
this.gotoAndStop("over");
};
medium_mc.onRollOut = function () {
this.gotoAndStop("up");
};
medium_mc.onRelease = function () {
song.stop();
song = undefined;
lightning.play();
_root.gotoAndStop("arcade");
difficulty = 1;
};
hard_mc.onRollOver = function () {
this.gotoAndStop("over");
};
hard_mc.onRollOut = function () {
this.gotoAndStop("up");
};
hard_mc.onRelease = function () {
song.stop();
song = undefined;
lightning.play();
_root.gotoAndStop("arcade");
difficulty = 2;
};
Frame 6
stop();
easy_mc.onRollOver = function () {
this.gotoAndStop("over");
};
easy_mc.onRollOut = function () {
this.gotoAndStop("up");
};
easy_mc.onRelease = function () {
song.stop();
song = undefined;
lightning.play();
_root.gotoAndStop("level1");
difficulty = 0;
};
medium_mc.onRollOver = function () {
this.gotoAndStop("over");
};
medium_mc.onRollOut = function () {
this.gotoAndStop("up");
};
medium_mc.onRelease = function () {
song.stop();
song = undefined;
lightning.play();
_root.gotoAndStop("level1");
difficulty = 1;
};
hard_mc.onRollOver = function () {
this.gotoAndStop("over");
};
hard_mc.onRollOut = function () {
this.gotoAndStop("up");
};
hard_mc.onRelease = function () {
song.stop();
song = undefined;
lightning.play();
_root.gotoAndStop("level1");
difficulty = 2;
};
Frame 7
stop();
continue_mc.onRelease = function () {
lightning.play();
play();
};
back_mc.onRelease = function () {
lightning.play();
gotoAndStop ("menu");
};
Frame 8
stop();
continue_mc.onRelease = function () {
lightning.play();
play();
};
back_mc.onRelease = function () {
lightning.play();
gotoAndStop(_currentframe - 1);
};
Frame 9
stop();
continue_mc.onRelease = function () {
lightning.play();
play();
};
back_mc.onRelease = function () {
lightning.play();
gotoAndStop(_currentframe - 1);
};
Frame 10
stop();
continue_mc.onRelease = function () {
lightning.play();
play();
};
back_mc.onRelease = function () {
lightning.play();
gotoAndStop(_currentframe - 1);
};
Frame 11
stop();
continue_mc.onRelease = function () {
lightning.play();
play();
};
back_mc.onRelease = function () {
lightning.play();
gotoAndStop(_currentframe - 1);
};
Frame 12
stop();
continue_mc.onRelease = function () {
lightning.play();
gotoAndStop ("menu");
};
back_mc.onRelease = function () {
lightning.play();
gotoAndStop(_currentframe - 1);
};
Frame 13
stop();
continue_mc.onRelease = function () {
lightning.play();
play();
};
back_mc.onRelease = function () {
lightning.play();
gotoAndStop ("menu");
};
Frame 14
stop();
continue_mc.onRelease = function () {
lightning.play();
gotoAndStop ("menu");
};
back_mc.onRelease = function () {
lightning.play();
gotoAndStop(_currentframe - 1);
};
Frame 20
function respawnGuy() {
guy.invinsible = true;
invinsibleBlinkInterval = setInterval(invinsibleBlink, 100, guy, 10);
guy.mc._x = Stage.width / 2;
if (guy.killsinarow > 0) {
guy.killsinarow = 0;
}
}
function newZombie() {
zombie = attachMovie("zombie", "zombie" + z, z);
z++;
zombie._x = offScreen();
zombie.width = zombie._width / 2;
zombie.height = (zombie._height / 2) - zombie.healthbar._height;
if (difficulty == 0) {
zombie.points = 5;
} else if (difficulty == 1) {
zombie.points = 10;
} else if (difficulty == 2) {
zombie.points = 20;
}
zombie.xspeed = 5;
zombie.yspeed = 0;
zombie.yaccel = 1;
if (difficulty == 0) {
zombie.health = 1;
} else if (difficulty == 1) {
zombie.health = 2;
} else if (difficulty == 2) {
zombie.health = 3;
}
zombie.invinsible = false;
zombie.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
zombie.dying = false;
zombie.attacking = false;
zombie.midAttack = false;
zombie.dir = Math.floor((Math.random() * 2) - 1);
if ((zombie.dir != 1) && (zombie.dir != -1)) {
zombie.dir = 1;
}
zombie.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["zombieInvinsibleClearInterval" + Z] = setInterval(_root["zombieInvinsibleClear" + Z], 500, this);
if (Z < 2) {
Z++;
} else {
Z = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (ground._y + ground.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if ((!this.dying) && (!this.attacking)) {
_root.zombieMove(this);
}
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if ((guy.mc.hitTest((this._x + (this.width * this.dir)) + (this.xspeed * this.dir), this._y, true) && (!this.attacking)) && (!this.dying)) {
this.gotoAndStop("attack");
this.attacking = true;
}
if ((this.midAttack && (guy.mc.pickups.hitTest(this._x + (this.width * this.dir), this._y, true))) && (!guy.invinsible)) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
}
_root.zombiePlace = function () {
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._x = _root["zombie" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function newStrongZombie() {
strongzombie = attachMovie("strongzombie", "strongzombie" + z, z);
z++;
strongzombie._x = offScreen();
strongzombie.width = strongzombie._width / 2;
strongzombie.height = (strongzombie._height / 2) - strongzombie.healthbar._height;
if (difficulty == 0) {
strongzombie.points = 25;
} else if (difficulty == 1) {
strongzombie.points = 50;
} else if (difficulty == 2) {
strongzombie.points = 100;
}
strongzombie.xspeed = 5;
strongzombie.yspeed = 0;
strongzombie.yaccel = 1;
if (difficulty == 0) {
strongzombie.health = 3;
} else if (difficulty == 1) {
strongzombie.health = 4;
} else if (difficulty == 2) {
strongzombie.health = 5;
}
strongzombie.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
strongzombie.invincible = false;
strongzombie.dying = false;
strongzombie.attacking = false;
strongzombie.midAttack = false;
strongzombie.dir = Math.floor((Math.random() * 2) - 1);
if ((strongzombie.dir != 1) && (strongzombie.dir != -1)) {
strongzombie.dir = 1;
}
strongzombie.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["strongZombieInvinsibleClearInterval" + SZ] = setInterval(_root["strongZombieInvinsibleClear" + SZ], 500, this);
if (SZ < 2) {
SZ++;
} else {
SZ = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (ground._y + ground.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if ((!this.dying) && (!this.attacking)) {
_root.strongZombieMove(this);
}
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (((guy.mc.hitTest(this._x + (this.width * this.dir), this._y, true) && (!this.attacking)) && (!this.dying)) || ((guy.mc.hitTest(this) && (!this.attacking)) && (!this.dying))) {
this.gotoAndStop("attack");
this.attacking = true;
}
if (((this.midAttack && (guy.mc.pickups.hitTest(this._x + (this.width * this.dir), this._y, true))) && (!guy.invinsible)) || ((this.midAttack && (this.hitTest(guy.mc._x + (guy.width * (-this.dir)), guy.mc._y, true))) && (!guy.invinsible))) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
}
_root.strongZombiePlace = function () {
i = 0;
while (i < z) {
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._x = _root["strongzombie" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function newFlyingHead() {
flyinghead = attachMovie("flyinghead", "flyinghead" + z, z);
z++;
flyinghead._x = offScreen();
flyinghead._y = 50;
flyinghead.width = flyinghead._width / 2;
flyinghead.height = flyinghead._height / 2;
if (difficulty == 0) {
flyinghead.points = 15;
} else if (difficulty == 1) {
flyinghead.points = 30;
} else if (difficulty == 2) {
flyinghead.points = 60;
}
flyinghead.xspeed = 5;
flyinghead.yspeed = 0;
flyinghead.yaccel = 1;
if (difficulty == 0) {
flyinghead.health = 2;
} else if (difficulty == 1) {
flyinghead.health = 3;
} else if (difficulty == 2) {
flyinghead.health = 4;
}
flyinghead.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
flyinghead.invinsible = false;
flyinghead.dying = false;
flyinghead.attacking = false;
flyinghead.dir = Math.floor((Math.random() * 2) - 1);
if ((flyinghead.dir != 1) && (flyinghead.dir != -1)) {
flyinghead.dir = 1;
}
flyinghead.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["flyingHeadInvinsibleClearInterval" + FH] = setInterval(_root["flyingHeadInvinsibleClear" + FH], 500, this);
if (FH < 2) {
FH++;
} else {
FH = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (Stage.height + this.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if (!this.dying) {
_root.flyingHeadMove(this);
}
if (!this.dying) {
if (nearAmount(this._x, guy.mc._x, 100) && (this._y < (guy.mc._y - guy.height))) {
this.attacking = true;
this._y = this._y + 5;
} else if (this.attacking && (nearAmount(this._y, guy.mc._y, 75))) {
this.gotoAndStop("attack");
this.midAttack = true;
}
if (((this.midAttack && (nearAmount(this._x, guy.mc._x, 75))) && (nearAmount(this._y, guy.mc._y, 75))) && (!guy.invinsible)) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
if (((this.attacking == false) && (this._y > 50)) || ((!nearAmount(this._x, guy.mc._x, 100)) && (this._y > 50))) {
this.attacking = false;
this.midAttack = false;
this._y = this._y - 5;
}
if ((!this.attacking) && (this._y < 100)) {
this._y = this._y + 5;
}
if (((!this.attacking) && (this._y > 100)) || ((!nearAmount(this._x, guy.mc._x, 100)) && (this._y > 100))) {
this.attacking = false;
this.midAttack = false;
this._y = this._y - 5;
}
}
}
_root.flyingHeadPlace = function () {
i = 0;
while (i < z) {
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._x = _root["flyinghead" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function zombieMove(ob) {
ob.gotoAndStop("walk");
if (ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.dir = ob.dir * -1;
}
ob._xscale = -100 * ob.dir;
ob._x = ob._x + (ob.xspeed * ob.dir);
}
function strongZombieMove(ob) {
if (!ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.gotoAndStop("walk");
} else {
ob.gotoAndStop("idle");
}
if (guy.mc._x > ob._x) {
ob.dir = 1;
} else {
ob.dir = -1;
}
ob._xscale = -100 * ob.dir;
if (!ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob._x = ob._x + (ob.xspeed * ob.dir);
}
}
function flyingHeadMove(ob) {
if (!ob.attacking) {
ob.gotoAndStop("idle");
}
if (ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.dir = ob.dir * -1;
}
if ((Math.floor(Math.random() * 100) == 0) && (!ob.attacking)) {
ob.dir = ob.dir * -1;
}
ob._xscale = -100 * ob.dir;
ob._x = ob._x + (ob.xspeed * ob.dir);
}
function zombieInvinsibleClear0(ob) {
clearInterval(zombieInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function zombieInvinsibleClear1(ob) {
clearInterval(zombieInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function zombieInvinsibleClear2(ob) {
clearInterval(zombieInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear0(ob) {
clearInterval(strongZombieInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear1(ob) {
clearInterval(strongZombieInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear2(ob) {
clearInterval(strongZombieInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear0(ob) {
clearInterval(flyingHeadInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear1(ob) {
clearInterval(flyingHeadInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear2(ob) {
clearInterval(flyingHeadInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function newHealth() {
health = attachMovie("health", "health" + h, ++hd);
health.height = health._height / 2;
health.yspeed = 0;
health.yaccel = 1;
health._x = offScreen();
health.onEnterFrame = function () {
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (this.hitTest(guy.mc.pickups)) {
this.gotoAndStop("collect");
}
_root.healthPlace = function () {
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._x = _root["health" + i]._x - guy.xspeed;
}
i++;
}
};
};
h++;
}
function newGodmode() {
godmode = attachMovie("godmodepickup", "godmode" + h, ++hd);
godmode.height = godmode._height / 2;
godmode.yspeed = 0;
godmode.yaccel = 1;
godmode._x = offScreen();
godmode.onEnterFrame = function () {
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (this.hitTest(guy.mc.pickups)) {
this.gotoAndStop("collect");
}
_root.godmodePlace = function () {
i = 0;
while (i < h) {
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._x = _root["godmode" + i]._x - guy.xspeed;
}
i++;
}
};
};
h++;
}
function addSecond() {
if (!gamePaused) {
if (timebar.seconds < 59) {
timebar.seconds++;
} else if (timebar.seconds == 59) {
timebar.seconds = 0;
timebar.minutes++;
}
}
}
function checkKeys() {
if (((Key.isDown(37) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = 80;
guy.dir = 1;
} else if (((Key.isDown(39) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = -80;
guy.dir = -1;
}
if ((((Key.isDown(37) || (Key.isDown(39))) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest((guy.mc._x - (guy.width * guy.dir)) + guy.xspeed, guy.mc._y, true))) {
if ((!guy.attacking) || (guy.attacking && (guy.jumping))) {
if (Key.isDown(37) && (guy.xspeed > (-guy.xspeedmax))) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (Key.isDown(39) && (guy.xspeed < guy.xspeedmax)) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
} else if ((guy.attacking && (!guy.jumping)) && (!guy.transforming)) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
} else {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (Key.isDown(39) && (Key.isDown(37))) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (((((Math.abs(guy.xspeed) > 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("walk");
} else if (((((Math.abs(guy.xspeed) == 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("idle");
}
if (((((ground._x - ground.width) - guy.xspeed) <= 0) && (((ground._x + ground.width) - guy.xspeed) >= Stage.width)) && (nearAmount(guy.mc._x, Stage.width / 2, 10))) {
ground._x = ground._x - guy.xspeed;
zombiePlace();
strongZombiePlace();
flyingHeadPlace();
healthPlace();
godmodePlace();
} else {
guy.mc._x = guy.mc._x + guy.xspeed;
}
if (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
guy.jumping = true;
guy.yspeed = guy.yspeed + guy.yaccel;
} else if (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
while (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true)) {
guy.mc._y = guy.mc._y + 1;
}
guy.jumping = false;
guy.jumpspeed = 0;
guy.yspeed = 0;
}
while ((!guy.jumping) && (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) - 1, true))) {
guy.mc._y = guy.mc._y - 1;
}
if ((((((Key.isDown(32) || (Key.isDown(38))) && (checkKeyDown(32).keyLength <= 1)) && (checkKeyDown(38).keyLength <= 1)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.jumping = true;
guy.jumpspeed = guy.jumpspeed + guy.jumpstart;
guy.yspeed = guy.yspeed + guy.jumpspeed;
}
if (guy.jumpspeed > 0) {
guy.jumpspeed = guy.jumpspeed - guy.yaccel;
}
guy.mc._y = guy.mc._y + guy.yspeed;
if ((((guy.jumping && (guy.yspeed < 0)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("jump");
} else if ((((guy.jumping && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true))) {
guy.mc.gotoAndStop("fall");
}
if (((Key.isDown(90) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack");
guy.attacking = true;
}
if ((((Key.isDown(88) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.jumping)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack2");
guy.attacking2 = true;
}
if (guy.finishedAttacking) {
guy.finishedAttacking = false;
guy.attacking = false;
guy.attacking2 = false;
}
if (((((Key.isDown(67) && (!guy.godmode)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (guy.godmodeCollected == 4)) {
guy.godmode = true;
guy.transforming = true;
guy.mc.gotoAndStop("godmode");
if (godmodeTimerInterval == undefined) {
godmodeTimerInterval = setInterval(godmodeTimer, 2500);
}
}
if (guy.godmode) {
guy.invinsible = true;
}
while (guy.mc._y < (Stage.height - 200)) {
guy.mc._y = guy.mc._y + 5;
ground._y = ground._y + 5;
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._y = _root["zombie" + i]._y + 5;
}
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._y = _root["strongzombie" + i]._y + 5;
}
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._y = _root["flyinghead" + i]._y + 5;
}
i++;
}
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y + 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y + 5;
}
i++;
}
}
while (guy.mc._y > (Stage.height - 150)) {
guy.mc._y = guy.mc._y - 5;
ground._y = ground._y - 5;
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._y = _root["zombie" + i]._y - 5;
}
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._y = _root["strongzombie" + i]._y - 5;
}
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._y = _root["flyinghead" + i]._y - 5;
}
i++;
}
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y - 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y - 5;
}
i++;
}
}
}
function nearAmount(amount1, amount2, near) {
if ((amount1 > (amount2 - near)) && (amount1 < (amount2 + near))) {
return(true);
}
return(false);
}
function offScreen() {
int1 = (int2 = undefined);
min1 = (ground._x - ground.width) + 100;
max1 = 0;
min2 = Stage.width;
max2 = (ground._x + ground.width) - 100;
if (min1 < max1) {
int1 = (Math.random() * (max1 - min1)) + min1;
}
if (min2 < max2) {
int2 = (Math.random() * (max2 - min2)) + min2;
}
if ((int1 != undefined) && (int2 == undefined)) {
return(int1);
}
if ((int1 == undefined) && (int2 != undefined)) {
return(int2);
}
if ((int1 != undefined) && (int2 != undefined)) {
which = Math.floor(Math.random() * 2);
if (which == 0) {
return(int1);
}
return(int2);
}
}
function invinsibleBlink(ob, length) {
if (ib < length) {
ib++;
if ((ib / 2) == Math.round(ib / 2)) {
ob.mc._alpha = 30;
} else {
ob.mc._alpha = 100;
}
} else {
clearInterval(invinsibleBlinkInterval);
ib = 0;
ob.mc._alpha = 100;
ob.invinsible = false;
}
}
function watchKeyDown(key) {
if (keyListener != undefined) {
keyListener = undefined;
}
if (key != undefined) {
_root["keyListener" + key] = new Object();
keyListener = _root["keyListener" + key];
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
if (Key.isDown(key)) {
this.keyLength++;
}
};
keyListener.onKeyUp = function () {
if (Key.getCode() == key) {
this.keyLength = 0;
}
};
Key.addListener(keyListener);
} else {
keyListener = new Object();
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
this.keyLength++;
};
keyListener.onKeyUp = function () {
this.keyLength = 0;
};
Key.addListener(keyListener);
}
}
function checkKeyDown(key) {
if (_root["keyListener" + key] == undefined) {
return(false);
}
_root["return" + key] = new Object();
_root["return" + key].key = key;
if (Key.isDown(key)) {
_root["return" + key].keyLength = _root["keyListener" + key].keyLength;
} else {
_root["return" + key].keyLength = 0;
}
return(_root["return" + key]);
}
function godmodeTimer() {
if ((guy.godmodeCollected > 0) && (!gamePaused)) {
guy.godmodeCollected--;
} else if (guy.godmodeCollected == 0) {
clearInterval(godmodeTimerInterval);
godmodeTimerInterval = undefined;
godmodeRemoveInterval = setInterval(godmodeRemove, 1);
}
}
function godmodeRemove() {
if (((guy.godmode && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.godmode = false;
guy.transforming = true;
guy.invinsible = false;
guy.mc.gotoAndStop("godmode");
clearInterval(godmodeRemoveInterval);
}
}
function clearEverythingAndMoveOn(nextLvl, nextScrn) {
i = 0;
while (i < (h + z)) {
removeMovieClip(_root["zombie" + i]);
removeMovieClip(_root["strongzombie" + i]);
removeMovieClip(_root["flyinghead" + i]);
removeMovieClip(_root["health" + i]);
removeMovieClip(_root["godmode" + i]);
i++;
}
song.stop();
song = undefined;
gamePaused = false;
removeMovieClip(pauseMenu);
recordKills = (("Kills: " + guy.kills) + " / ") + killsNeeded;
recordPoints = "Points: " + guy.points;
recordTime = timebar.time_txt.text;
level1time = (timebar.minutes * 60) + timebar.seconds;
var _local4 = {kills:guy.kills, points:guy.points, time:level1time};
_global.level1 = _local4;
level1time = undefined;
removeMovieClip(guy.mc);
guy = undefined;
removeMovieClip(healthbar);
removeMovieClip(godmodebar);
removeMovieClip(pointsbar);
removeMovieClip(killsbar);
removeMovieClip(multiplierbar);
removeMovieClip(timebar);
clearInterval(addSecondInterval);
clearInterval(invinsibleBlinkInterval);
Key.removeListener(pauseKey);
if (nextLvl == undefined) {
nextLvl = "level2";
}
nextLevel = nextLvl;
lightning.play();
if (nextScrn != undefined) {
_root.gotoAndStop(nextScrn);
} else {
_root.gotoAndStop("levelTransition");
}
}
stop();
if (difficulty == 0) {
killsNeeded = 10;
}
if (difficulty == 1) {
killsNeeded = 15;
}
if (difficulty == 2) {
killsNeeded = 20;
}
gamePaused = false;
z = 0;
ib = 0;
h = 0;
hd = 1000;
Z = 0;
SZ = 0;
FH = 0;
pauseKey = new Object();
pauseKey.onKeyDown = function () {
if (Key.isDown(80)) {
if (!gamePaused) {
gamePaused = true;
} else {
gamePaused = false;
}
}
};
Key.addListener(pauseKey);
ground.width = ground._width / 2;
ground.height = ground._height / 2;
guy = {xspeed:0, yspeed:0, xspeedmax:10, xaccel:2, yspeedmax:20, yaccel:5, dir:1, jumping:false, jumpspeed:0, jumpstart:-40, attacking:false, attacking2:false, finishedAttacking:false, godmode:false, godmodeCollected:0, transforming:false, invinsible:false, health:4, points:0, kills:0, killsinarow:0, multiplier:1};
guy.mc = attachMovie("guy", "person", 1000);
guy.mc._xscale = (guy.mc._yscale = 80);
guy.height = guy.mc._height / 2;
guy.width = guy.mc._width / 2;
respawnGuy();
if (difficulty == 0) {
newZombie();
newStrongZombie();
newFlyingHead();
}
if (difficulty == 1) {
newZombie();
newZombie();
newStrongZombie();
newFlyingHead();
}
if (difficulty == 2) {
newZombie();
newZombie();
newStrongZombie();
newStrongZombie();
newFlyingHead();
newFlyingHead();
}
attachMovie("healthbar", "healthbar", 10000);
healthbar._x = 5;
healthbar._y = 5;
healthbar.onEnterFrame = function () {
if (guy.health > 0) {
this.gotoAndStop(guy.health);
} else if (guy.health <= 0) {
this.gotoAndStop(5);
clearEverythingAndMoveOn("menu", "gameover");
}
};
if (difficulty == 0) {
newHealth();
newHealth();
} else {
newHealth();
}
attachMovie("godmodebar", "godmodebar", 10001);
godmodebar._x = 5;
godmodebar._y = healthbar._height + 10;
godmodebar.onEnterFrame = function () {
if ((guy.godmodeCollected != 0) && (guy.godmodeCollected <= 4)) {
this.gotoAndStop(guy.godmodeCollected);
} else if (guy.godmodeCollected == 0) {
this.gotoAndStop(5);
} else if (guy.godmodeCollected > 4) {
this.gotoAndStop(4);
}
};
if (difficulty == 0) {
newGodmode();
newGodmode();
} else {
newGodmode();
}
attachMovie("timebar", "timebar", 10002);
timebar._x = (Stage.width / 2) - (timebar._width / 2);
timebar._y = 5;
timebar.minutes = 0;
timebar.seconds = 0;
addSecondInterval = setInterval(addSecond, 1000);
timebar.onEnterFrame = function () {
if ((this.minutes < 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes < 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":") + this.seconds;
}
};
_root.createEmptyMovieClip("multiplierbar", 10003);
multiplierbar._x = Stage.width / 2;
multiplierbar._y = Stage.height / 2;
multiplierbar.onEnterFrame = function () {
if (((guy.killsinarow >= 16) && (!multiplier.five)) && (difficulty == 2)) {
guy.multiplier = 5;
multiplier = multiplierbar.attachMovie("multiplier5", "multiplier", 100000);
multiplier.five = true;
} else if ((((guy.killsinarow >= 8) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 4;
multiplier = multiplierbar.attachMovie("multiplier4", "multiplier", 100000);
multiplier.four = true;
} else if (((((guy.killsinarow >= 4) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 3;
multiplier = multiplierbar.attachMovie("multiplier3", "multiplier", 100000);
multiplier.three = true;
} else if (((((guy.killsinarow >= 2) && (!multiplier.two)) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) {
guy.multiplier = 2;
multiplier = multiplierbar.attachMovie("multiplier2", "multiplier", 100000);
multiplier.two = true;
} else if (guy.killsinarow < 2) {
removeMovieClip(multiplier);
guy.multiplier = 1;
}
};
attachMovie("pointsbar", "pointsbar", 10004);
pointsbar._x = (Stage.width - pointsbar._width) - 5;
pointsbar._y = 5;
pointsbar.onEnterFrame = function () {
this.points_txt.text = guy.points;
};
attachMovie("killsbar", "killsbar", 10005);
killsbar._x = (Stage.width - killsbar._width) - 5;
killsbar._y = pointsbar._height + 10;
killsbar.onEnterFrame = function () {
this.kills_txt.text = (guy.kills + " / ") + killsNeeded;
if (guy.kills >= killsNeeded) {
clearEverythingAndMoveOn();
}
};
if (song != undefined) {
song.stop();
}
songMute = false;
song = new Sound();
song.attachSound("song1");
song.start();
song.onSoundComplete = function () {
song.start();
};
watchKeyDown(32);
watchKeyDown(38);
this.onEnterFrame = function () {
if (!gamePaused) {
checkKeys();
}
if (gamePaused && (pauseMenu == undefined)) {
attachMovie("pauseMenu", "pauseMenu", 10006);
pauseMenu.resume_mc.onRelease = function () {
gamePaused = false;
};
pauseMenu.mute_mc.onRelease = function () {
if (!songMute) {
song.setVolume(0);
songMute = true;
} else {
song.setVolume(100);
songMute = false;
}
};
pauseMenu.mainmenu_mc.onRelease = function () {
clearEverythingAndMoveOn("menu", "gameover");
};
} else if ((!gamePaused) && (pauseMenu != undefined)) {
removeMovieClip(pauseMenu);
}
};
Frame 21
function respawnGuy() {
guy.invinsible = true;
invinsibleBlinkInterval = setInterval(invinsibleBlink, 100, guy, 10);
guy.mc._x = Stage.width / 2;
if (guy.killsinarow > 0) {
guy.killsinarow = 0;
}
}
function newZombie() {
zombie = attachMovie("zombie", "zombie" + z, z);
z++;
zombie._x = offScreen();
zombie.width = zombie._width / 2;
zombie.height = (zombie._height / 2) - zombie.healthbar._height;
if (difficulty == 0) {
zombie.points = 5;
} else if (difficulty == 1) {
zombie.points = 10;
} else if (difficulty == 2) {
zombie.points = 20;
}
zombie.xspeed = 5;
zombie.yspeed = 0;
zombie.yaccel = 1;
if (difficulty == 0) {
zombie.health = 1;
} else if (difficulty == 1) {
zombie.health = 2;
} else if (difficulty == 2) {
zombie.health = 3;
}
zombie.invinsible = false;
zombie.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
zombie.dying = false;
zombie.attacking = false;
zombie.midAttack = false;
zombie.dir = Math.floor((Math.random() * 2) - 1);
if ((zombie.dir != 1) && (zombie.dir != -1)) {
zombie.dir = 1;
}
zombie.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["zombieInvinsibleClearInterval" + Z] = setInterval(_root["zombieInvinsibleClear" + Z], 500, this);
if (Z < 2) {
Z++;
} else {
Z = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (ground._y + ground.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if ((!this.dying) && (!this.attacking)) {
_root.zombieMove(this);
}
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if ((guy.mc.hitTest((this._x + (this.width * this.dir)) + (this.xspeed * this.dir), this._y, true) && (!this.attacking)) && (!this.dying)) {
this.gotoAndStop("attack");
this.attacking = true;
}
if ((this.midAttack && (guy.mc.pickups.hitTest(this._x + (this.width * this.dir), this._y, true))) && (!guy.invinsible)) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
}
_root.zombiePlace = function () {
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._x = _root["zombie" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function newStrongZombie() {
strongzombie = attachMovie("strongzombie", "strongzombie" + z, z);
z++;
strongzombie._x = offScreen();
strongzombie.width = strongzombie._width / 2;
strongzombie.height = (strongzombie._height / 2) - strongzombie.healthbar._height;
if (difficulty == 0) {
strongzombie.points = 25;
} else if (difficulty == 1) {
strongzombie.points = 50;
} else if (difficulty == 2) {
strongzombie.points = 100;
}
strongzombie.xspeed = 5;
strongzombie.yspeed = 0;
strongzombie.yaccel = 1;
if (difficulty == 0) {
strongzombie.health = 3;
} else if (difficulty == 1) {
strongzombie.health = 4;
} else if (difficulty == 2) {
strongzombie.health = 5;
}
strongzombie.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
strongzombie.invincible = false;
strongzombie.dying = false;
strongzombie.attacking = false;
strongzombie.midAttack = false;
strongzombie.dir = Math.floor((Math.random() * 2) - 1);
if ((strongzombie.dir != 1) && (strongzombie.dir != -1)) {
strongzombie.dir = 1;
}
strongzombie.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["strongZombieInvinsibleClearInterval" + SZ] = setInterval(_root["strongZombieInvinsibleClear" + SZ], 500, this);
if (SZ < 2) {
SZ++;
} else {
SZ = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (ground._y + ground.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if ((!this.dying) && (!this.attacking)) {
_root.strongZombieMove(this);
}
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (((guy.mc.hitTest(this._x + (this.width * this.dir), this._y, true) && (!this.attacking)) && (!this.dying)) || ((guy.mc.hitTest(this) && (!this.attacking)) && (!this.dying))) {
this.gotoAndStop("attack");
this.attacking = true;
}
if (((this.midAttack && (guy.mc.pickups.hitTest(this._x + (this.width * this.dir), this._y, true))) && (!guy.invinsible)) || ((this.midAttack && (this.hitTest(guy.mc._x + (guy.width * (-this.dir)), guy.mc._y, true))) && (!guy.invinsible))) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
}
_root.strongZombiePlace = function () {
i = 0;
while (i < z) {
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._x = _root["strongzombie" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function newFlyingHead() {
flyinghead = attachMovie("flyinghead", "flyinghead" + z, z);
z++;
flyinghead._x = offScreen();
flyinghead._y = 50;
flyinghead.width = flyinghead._width / 2;
flyinghead.height = flyinghead._height / 2;
if (difficulty == 0) {
flyinghead.points = 15;
} else if (difficulty == 1) {
flyinghead.points = 30;
} else if (difficulty == 2) {
flyinghead.points = 60;
}
flyinghead.xspeed = 5;
flyinghead.yspeed = 0;
flyinghead.yaccel = 1;
if (difficulty == 0) {
flyinghead.health = 2;
} else if (difficulty == 1) {
flyinghead.health = 3;
} else if (difficulty == 2) {
flyinghead.health = 4;
}
flyinghead.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
flyinghead.invinsible = false;
flyinghead.dying = false;
flyinghead.attacking = false;
flyinghead.dir = Math.floor((Math.random() * 2) - 1);
if ((flyinghead.dir != 1) && (flyinghead.dir != -1)) {
flyinghead.dir = 1;
}
flyinghead.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["flyingHeadInvinsibleClearInterval" + FH] = setInterval(_root["flyingHeadInvinsibleClear" + FH], 500, this);
if (FH < 2) {
FH++;
} else {
FH = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (Stage.height + this.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if (!this.dying) {
_root.flyingHeadMove(this);
}
if (!this.dying) {
if (nearAmount(this._x, guy.mc._x, 100) && (this._y < (guy.mc._y - guy.height))) {
this.attacking = true;
this._y = this._y + 5;
} else if (this.attacking && (nearAmount(this._y, guy.mc._y, 75))) {
this.gotoAndStop("attack");
this.midAttack = true;
}
if (((this.midAttack && (nearAmount(this._x, guy.mc._x, 75))) && (nearAmount(this._y, guy.mc._y, 75))) && (!guy.invinsible)) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
if (((this.attacking == false) && (this._y > 50)) || ((!nearAmount(this._x, guy.mc._x, 100)) && (this._y > 50))) {
this.attacking = false;
this.midAttack = false;
this._y = this._y - 5;
}
if ((!this.attacking) && (this._y < 100)) {
this._y = this._y + 5;
}
if (((!this.attacking) && (this._y > 100)) || ((!nearAmount(this._x, guy.mc._x, 100)) && (this._y > 100))) {
this.attacking = false;
this.midAttack = false;
this._y = this._y - 5;
}
}
}
_root.flyingHeadPlace = function () {
i = 0;
while (i < z) {
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._x = _root["flyinghead" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function zombieMove(ob) {
ob.gotoAndStop("walk");
if (ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.dir = ob.dir * -1;
}
ob._xscale = -100 * ob.dir;
ob._x = ob._x + (ob.xspeed * ob.dir);
}
function strongZombieMove(ob) {
if (!ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.gotoAndStop("walk");
} else {
ob.gotoAndStop("idle");
}
if (guy.mc._x > ob._x) {
ob.dir = 1;
} else {
ob.dir = -1;
}
ob._xscale = -100 * ob.dir;
if (!ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob._x = ob._x + (ob.xspeed * ob.dir);
}
}
function flyingHeadMove(ob) {
if (!ob.attacking) {
ob.gotoAndStop("idle");
}
if (ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.dir = ob.dir * -1;
}
if ((Math.floor(Math.random() * 100) == 0) && (!ob.attacking)) {
ob.dir = ob.dir * -1;
}
ob._xscale = -100 * ob.dir;
ob._x = ob._x + (ob.xspeed * ob.dir);
}
function zombieInvinsibleClear0(ob) {
clearInterval(zombieInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function zombieInvinsibleClear1(ob) {
clearInterval(zombieInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function zombieInvinsibleClear2(ob) {
clearInterval(zombieInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear0(ob) {
clearInterval(strongZombieInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear1(ob) {
clearInterval(strongZombieInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear2(ob) {
clearInterval(strongZombieInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear0(ob) {
clearInterval(flyingHeadInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear1(ob) {
clearInterval(flyingHeadInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear2(ob) {
clearInterval(flyingHeadInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function newHealth() {
health = attachMovie("health", "health" + h, ++hd);
health.height = health._height / 2;
health.yspeed = 0;
health.yaccel = 1;
health._x = offScreen();
health.onEnterFrame = function () {
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (this.hitTest(guy.mc.pickups)) {
this.gotoAndStop("collect");
}
_root.healthPlace = function () {
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._x = _root["health" + i]._x - guy.xspeed;
}
i++;
}
};
};
h++;
}
function newGodmode() {
godmode = attachMovie("godmodepickup", "godmode" + h, ++hd);
godmode.height = godmode._height / 2;
godmode.yspeed = 0;
godmode.yaccel = 1;
godmode._x = offScreen();
godmode.onEnterFrame = function () {
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (this.hitTest(guy.mc.pickups)) {
this.gotoAndStop("collect");
}
_root.godmodePlace = function () {
i = 0;
while (i < h) {
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._x = _root["godmode" + i]._x - guy.xspeed;
}
i++;
}
};
};
h++;
}
function addSecond() {
if (!gamePaused) {
if (timebar.seconds < 59) {
timebar.seconds++;
} else if (timebar.seconds == 59) {
timebar.seconds = 0;
timebar.minutes++;
}
}
}
function checkKeys() {
if (((Key.isDown(37) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = 80;
guy.dir = 1;
} else if (((Key.isDown(39) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = -80;
guy.dir = -1;
}
if ((((Key.isDown(37) || (Key.isDown(39))) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest((guy.mc._x - (guy.width * guy.dir)) + guy.xspeed, guy.mc._y, true))) {
if ((!guy.attacking) || (guy.attacking && (guy.jumping))) {
if (Key.isDown(37) && (guy.xspeed > (-guy.xspeedmax))) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (Key.isDown(39) && (guy.xspeed < guy.xspeedmax)) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
} else if ((guy.attacking && (!guy.jumping)) && (!guy.transforming)) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
} else {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (Key.isDown(39) && (Key.isDown(37))) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (((((Math.abs(guy.xspeed) > 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("walk");
} else if (((((Math.abs(guy.xspeed) == 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("idle");
}
if (((((ground._x - ground.width) - guy.xspeed) <= 0) && (((ground._x + ground.width) - guy.xspeed) >= Stage.width)) && (nearAmount(guy.mc._x, Stage.width / 2, 10))) {
ground._x = ground._x - guy.xspeed;
zombiePlace();
strongZombiePlace();
flyingHeadPlace();
healthPlace();
godmodePlace();
} else {
guy.mc._x = guy.mc._x + guy.xspeed;
}
if (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
guy.jumping = true;
guy.yspeed = guy.yspeed + guy.yaccel;
} else if (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
while (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true)) {
guy.mc._y = guy.mc._y + 1;
}
guy.jumping = false;
guy.jumpspeed = 0;
guy.yspeed = 0;
}
while ((!guy.jumping) && (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) - 1, true))) {
guy.mc._y = guy.mc._y - 1;
}
if ((((((Key.isDown(32) || (Key.isDown(38))) && (checkKeyDown(32).keyLength <= 1)) && (checkKeyDown(38).keyLength <= 1)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.jumping = true;
guy.jumpspeed = guy.jumpspeed + guy.jumpstart;
guy.yspeed = guy.yspeed + guy.jumpspeed;
}
if (guy.jumpspeed > 0) {
guy.jumpspeed = guy.jumpspeed - guy.yaccel;
}
guy.mc._y = guy.mc._y + guy.yspeed;
if ((((guy.jumping && (guy.yspeed < 0)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("jump");
} else if ((((guy.jumping && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true))) {
guy.mc.gotoAndStop("fall");
}
if (((Key.isDown(90) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack");
guy.attacking = true;
}
if ((((Key.isDown(88) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.jumping)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack2");
guy.attacking2 = true;
}
if (guy.finishedAttacking) {
guy.finishedAttacking = false;
guy.attacking = false;
guy.attacking2 = false;
}
if (((((Key.isDown(67) && (!guy.godmode)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (guy.godmodeCollected == 4)) {
guy.godmode = true;
guy.transforming = true;
guy.mc.gotoAndStop("godmode");
if (godmodeTimerInterval == undefined) {
godmodeTimerInterval = setInterval(godmodeTimer, 2500);
}
}
if (guy.godmode) {
guy.invinsible = true;
}
while (guy.mc._y < (Stage.height - 200)) {
guy.mc._y = guy.mc._y + 5;
ground._y = ground._y + 5;
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._y = _root["zombie" + i]._y + 5;
}
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._y = _root["strongzombie" + i]._y + 5;
}
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._y = _root["flyinghead" + i]._y + 5;
}
i++;
}
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y + 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y + 5;
}
i++;
}
}
while (guy.mc._y > (Stage.height - 150)) {
guy.mc._y = guy.mc._y - 5;
ground._y = ground._y - 5;
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._y = _root["zombie" + i]._y - 5;
}
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._y = _root["strongzombie" + i]._y - 5;
}
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._y = _root["flyinghead" + i]._y - 5;
}
i++;
}
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y - 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y - 5;
}
i++;
}
}
}
function nearAmount(amount1, amount2, near) {
if ((amount1 > (amount2 - near)) && (amount1 < (amount2 + near))) {
return(true);
}
return(false);
}
function offScreen() {
int1 = (int2 = undefined);
min1 = (ground._x - ground.width) + 100;
max1 = 0;
min2 = Stage.width;
max2 = (ground._x + ground.width) - 100;
if (min1 < max1) {
int1 = (Math.random() * (max1 - min1)) + min1;
}
if (min2 < max2) {
int2 = (Math.random() * (max2 - min2)) + min2;
}
if ((int1 != undefined) && (int2 == undefined)) {
return(int1);
}
if ((int1 == undefined) && (int2 != undefined)) {
return(int2);
}
if ((int1 != undefined) && (int2 != undefined)) {
which = Math.floor(Math.random() * 2);
if (which == 0) {
return(int1);
}
return(int2);
}
}
function invinsibleBlink(ob, length) {
if (ib < length) {
ib++;
if ((ib / 2) == Math.round(ib / 2)) {
ob.mc._alpha = 30;
} else {
ob.mc._alpha = 100;
}
} else {
clearInterval(invinsibleBlinkInterval);
ib = 0;
ob.mc._alpha = 100;
ob.invinsible = false;
}
}
function watchKeyDown(key) {
if (keyListener != undefined) {
keyListener = undefined;
}
if (key != undefined) {
_root["keyListener" + key] = new Object();
keyListener = _root["keyListener" + key];
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
if (Key.isDown(key)) {
this.keyLength++;
}
};
keyListener.onKeyUp = function () {
if (Key.getCode() == key) {
this.keyLength = 0;
}
};
Key.addListener(keyListener);
} else {
keyListener = new Object();
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
this.keyLength++;
};
keyListener.onKeyUp = function () {
this.keyLength = 0;
};
Key.addListener(keyListener);
}
}
function checkKeyDown(key) {
if (_root["keyListener" + key] == undefined) {
return(false);
}
_root["return" + key] = new Object();
_root["return" + key].key = key;
if (Key.isDown(key)) {
_root["return" + key].keyLength = _root["keyListener" + key].keyLength;
} else {
_root["return" + key].keyLength = 0;
}
return(_root["return" + key]);
}
function godmodeTimer() {
if ((guy.godmodeCollected > 0) && (!gamePaused)) {
guy.godmodeCollected--;
} else if (guy.godmodeCollected == 0) {
clearInterval(godmodeTimerInterval);
godmodeTimerInterval = undefined;
godmodeRemoveInterval = setInterval(godmodeRemove, 1);
}
}
function godmodeRemove() {
if (((guy.godmode && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.godmode = false;
guy.transforming = true;
guy.invinsible = false;
guy.mc.gotoAndStop("godmode");
clearInterval(godmodeRemoveInterval);
}
}
function clearEverythingAndMoveOn(nextLvl, nextScrn) {
i = 0;
while (i < (h + z)) {
removeMovieClip(_root["zombie" + i]);
removeMovieClip(_root["strongzombie" + i]);
removeMovieClip(_root["flyinghead" + i]);
removeMovieClip(_root["health" + i]);
removeMovieClip(_root["godmode" + i]);
i++;
}
song.stop();
song = undefined;
gamePaused = false;
removeMovieClip(pauseMenu);
recordKills = (("Kills: " + guy.kills) + " / ") + killsNeeded;
recordPoints = "Points: " + guy.points;
recordTime = timebar.time_txt.text;
level2time = (timebar.minutes * 60) + timebar.seconds;
var _local3 = {kills:guy.kills, points:guy.points, time:level2time};
_global.level2 = _local3;
level2time = undefined;
removeMovieClip(guy.mc);
guy = undefined;
removeMovieClip(healthbar);
removeMovieClip(godmodebar);
removeMovieClip(pointsbar);
removeMovieClip(killsbar);
removeMovieClip(multiplierbar);
removeMovieClip(timebar);
clearInterval(addSecondInterval);
clearInterval(invinsibleBlinkInterval);
Key.removeListener(pauseKey);
if (nextLvl == undefined) {
nextLvl = "level3";
}
nextLevel = nextLvl;
lightning.play();
if (nextScrn != undefined) {
_root.gotoAndStop(nextScrn);
} else {
_root.gotoAndStop("levelTransition");
}
}
stop();
if (difficulty == 0) {
killsNeeded = 15;
}
if (difficulty == 1) {
killsNeeded = 20;
}
if (difficulty == 2) {
killsNeeded = 25;
}
gamePaused = false;
z = 0;
ib = 0;
h = 0;
hd = 1000;
Z = 0;
SZ = 0;
FH = 0;
pauseKey = new Object();
pauseKey.onKeyDown = function () {
if (Key.isDown(80)) {
if (!gamePaused) {
gamePaused = true;
} else {
gamePaused = false;
}
}
};
Key.addListener(pauseKey);
ground.width = ground._width / 2;
ground.height = ground._height / 2;
guy = {xspeed:0, yspeed:0, xspeedmax:10, xaccel:2, yspeedmax:20, yaccel:5, dir:1, jumping:false, jumpspeed:0, jumpstart:-40, attacking:false, attacking2:false, finishedAttacking:false, godmode:false, godmodeCollected:0, transforming:false, invinsible:false, health:4, points:0, kills:0, killsinarow:0, multiplier:1};
guy.mc = attachMovie("guy", "person", 1000);
guy.mc._xscale = (guy.mc._yscale = 80);
guy.height = guy.mc._height / 2;
guy.width = guy.mc._width / 2;
respawnGuy();
if (difficulty == 0) {
newZombie();
newStrongZombie();
newFlyingHead();
}
if (difficulty == 1) {
newZombie();
newZombie();
newStrongZombie();
newFlyingHead();
}
if (difficulty == 2) {
newZombie();
newZombie();
newStrongZombie();
newStrongZombie();
newFlyingHead();
newFlyingHead();
}
attachMovie("healthbar", "healthbar", 10000);
healthbar._x = 5;
healthbar._y = 5;
healthbar.onEnterFrame = function () {
if (guy.health > 0) {
this.gotoAndStop(guy.health);
} else if (guy.health <= 0) {
this.gotoAndStop(5);
clearEverythingAndMoveOn("menu", "gameover");
}
};
if (difficulty == 0) {
newHealth();
newHealth();
} else {
newHealth();
}
attachMovie("godmodebar", "godmodebar", 10001);
godmodebar._x = 5;
godmodebar._y = healthbar._height + 10;
godmodebar.onEnterFrame = function () {
if ((guy.godmodeCollected != 0) && (guy.godmodeCollected <= 4)) {
this.gotoAndStop(guy.godmodeCollected);
} else if (guy.godmodeCollected == 0) {
this.gotoAndStop(5);
} else if (guy.godmodeCollected > 4) {
this.gotoAndStop(4);
}
};
if (difficulty == 0) {
newGodmode();
newGodmode();
} else {
newGodmode();
}
attachMovie("timebar", "timebar", 10002);
timebar._x = (Stage.width / 2) - (timebar._width / 2);
timebar._y = 5;
timebar.minutes = 0;
timebar.seconds = 0;
addSecondInterval = setInterval(addSecond, 1000);
timebar.onEnterFrame = function () {
if ((this.minutes < 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes < 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":") + this.seconds;
}
};
_root.createEmptyMovieClip("multiplierbar", 10003);
multiplierbar._x = Stage.width / 2;
multiplierbar._y = Stage.height / 2;
multiplierbar.onEnterFrame = function () {
if (((guy.killsinarow >= 16) && (!multiplier.five)) && (difficulty == 2)) {
guy.multiplier = 5;
multiplier = multiplierbar.attachMovie("multiplier5", "multiplier", 100000);
multiplier.five = true;
} else if ((((guy.killsinarow >= 8) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 4;
multiplier = multiplierbar.attachMovie("multiplier4", "multiplier", 100000);
multiplier.four = true;
} else if (((((guy.killsinarow >= 4) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 3;
multiplier = multiplierbar.attachMovie("multiplier3", "multiplier", 100000);
multiplier.three = true;
} else if (((((guy.killsinarow >= 2) && (!multiplier.two)) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) {
guy.multiplier = 2;
multiplier = multiplierbar.attachMovie("multiplier2", "multiplier", 100000);
multiplier.two = true;
} else if (guy.killsinarow < 2) {
removeMovieClip(multiplier);
guy.multiplier = 1;
}
};
attachMovie("pointsbar", "pointsbar", 10004);
pointsbar._x = (Stage.width - pointsbar._width) - 5;
pointsbar._y = 5;
pointsbar.onEnterFrame = function () {
this.points_txt.text = guy.points;
};
attachMovie("killsbar", "killsbar", 10005);
killsbar._x = (Stage.width - killsbar._width) - 5;
killsbar._y = pointsbar._height + 10;
killsbar.onEnterFrame = function () {
this.kills_txt.text = (guy.kills + " / ") + killsNeeded;
if (guy.kills >= killsNeeded) {
clearEverythingAndMoveOn();
}
};
if (song != undefined) {
song.stop();
}
songMute = false;
song = new Sound();
song.attachSound("song1");
song.start();
song.onSoundComplete = function () {
song.start();
};
watchKeyDown(32);
watchKeyDown(38);
this.onEnterFrame = function () {
if (!gamePaused) {
checkKeys();
}
if (gamePaused && (pauseMenu == undefined)) {
attachMovie("pauseMenu", "pauseMenu", 10006);
pauseMenu.resume_mc.onRelease = function () {
gamePaused = false;
};
pauseMenu.mute_mc.onRelease = function () {
if (!songMute) {
song.setVolume(0);
songMute = true;
} else {
song.setVolume(100);
songMute = false;
}
};
pauseMenu.mainmenu_mc.onRelease = function () {
clearEverythingAndMoveOn("menu", "gameover");
};
} else if ((!gamePaused) && (pauseMenu != undefined)) {
removeMovieClip(pauseMenu);
}
};
Frame 22
function respawnGuy() {
guy.invinsible = true;
invinsibleBlinkInterval = setInterval(invinsibleBlink, 100, guy, 10);
guy.mc._x = Stage.width / 2;
if (guy.killsinarow > 0) {
guy.killsinarow = 0;
}
}
function bossInvinsibleClear(ob) {
clearInterval(bossInvinsibleClearInterval);
ob.mc._alpha = 100;
ob.invinsible = false;
}
function addSecond() {
if (!gamePaused) {
if (timebar.seconds < 59) {
timebar.seconds++;
} else if (timebar.seconds == 59) {
timebar.seconds = 0;
timebar.minutes++;
}
}
}
function checkKeys() {
if (((Key.isDown(37) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = 80;
guy.dir = 1;
} else if (((Key.isDown(39) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = -80;
guy.dir = -1;
}
if ((((Key.isDown(37) || (Key.isDown(39))) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest((guy.mc._x - (guy.width * guy.dir)) + guy.xspeed, guy.mc._y, true))) {
if ((!guy.attacking) || (guy.attacking && (guy.jumping))) {
if (Key.isDown(37) && (guy.xspeed > (-guy.xspeedmax))) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (Key.isDown(39) && (guy.xspeed < guy.xspeedmax)) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
} else if ((guy.attacking && (!guy.jumping)) && (!guy.transforming)) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
} else {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (Key.isDown(39) && (Key.isDown(37))) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (((((Math.abs(guy.xspeed) > 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("walk");
} else if (((((Math.abs(guy.xspeed) == 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("idle");
}
if (((((ground._x - ground.width) - guy.xspeed) <= 0) && (((ground._x + ground.width) - guy.xspeed) >= Stage.width)) && (nearAmount(guy.mc._x, Stage.width / 2, 10))) {
ground._x = ground._x - guy.xspeed;
healthPlace();
godmodePlace();
bossPlace();
testArea._x = testArea._x - guy.xspeed;
} else {
guy.mc._x = guy.mc._x + guy.xspeed;
}
if (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
guy.jumping = true;
guy.yspeed = guy.yspeed + guy.yaccel;
} else if (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
while (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true)) {
guy.mc._y = guy.mc._y + 1;
}
guy.jumping = false;
guy.jumpspeed = 0;
guy.yspeed = 0;
}
while ((!guy.jumping) && (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) - 1, true))) {
guy.mc._y = guy.mc._y - 1;
}
if ((((((Key.isDown(32) || (Key.isDown(38))) && (checkKeyDown(32).keyLength <= 1)) && (checkKeyDown(38).keyLength <= 1)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.jumping = true;
guy.jumpspeed = guy.jumpspeed + guy.jumpstart;
guy.yspeed = guy.yspeed + guy.jumpspeed;
}
if (guy.jumpspeed > 0) {
guy.jumpspeed = guy.jumpspeed - guy.yaccel;
}
guy.mc._y = guy.mc._y + guy.yspeed;
if ((((guy.jumping && (guy.yspeed < 0)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("jump");
} else if ((((guy.jumping && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true))) {
guy.mc.gotoAndStop("fall");
}
if (((Key.isDown(90) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack");
guy.attacking = true;
}
if ((((Key.isDown(88) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.jumping)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack2");
guy.attacking2 = true;
}
if (guy.finishedAttacking) {
guy.finishedAttacking = false;
guy.attacking = false;
guy.attacking2 = false;
}
if (((((Key.isDown(67) && (!guy.godmode)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (guy.godmodeCollected == 4)) {
guy.godmode = true;
guy.transforming = true;
guy.mc.gotoAndStop("godmode");
if (godmodeTimerInterval == undefined) {
godmodeTimerInterval = setInterval(godmodeTimer, 2500);
}
}
if (guy.godmode) {
guy.invinsible = true;
}
while (guy.mc._y < (Stage.height - 200)) {
guy.mc._y = guy.mc._y + 5;
ground._y = ground._y + 5;
testArea._y = testArea._y + 5;
boss.mc._y = boss.mc._y + 5;
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y + 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y + 5;
}
i++;
}
}
while (guy.mc._y > (Stage.height - 150)) {
guy.mc._y = guy.mc._y - 5;
ground._y = ground._y - 5;
testArea._y = testArea._y - 5;
boss.mc._y = boss.mc._y - 5;
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y - 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y - 5;
}
i++;
}
}
if (guy.mc.hitTest(testArea) && (!boss.found)) {
boss.found = true;
song.stop();
song = new Sound();
song.attachSound("song3");
song.start();
song.onSoundComplete = function () {
song.start();
};
}
}
function nearAmount(amount1, amount2, near) {
if ((amount1 > (amount2 - near)) && (amount1 < (amount2 + near))) {
return(true);
}
return(false);
}
function offScreen() {
int1 = (int2 = undefined);
min1 = (ground._x - ground.width) + 100;
max1 = 0;
min2 = Stage.width;
max2 = (ground._x + ground.width) - 100;
if (min1 < max1) {
int1 = (Math.random() * (max1 - min1)) + min1;
}
if (min2 < max2) {
int2 = (Math.random() * (max2 - min2)) + min2;
}
if ((int1 != undefined) && (int2 == undefined)) {
return(int1);
}
if ((int1 == undefined) && (int2 != undefined)) {
return(int2);
}
if ((int1 != undefined) && (int2 != undefined)) {
which = Math.floor(Math.random() * 2);
if (which == 0) {
return(int1);
}
return(int2);
}
}
function invinsibleBlink(ob, length) {
if (ib < length) {
ib++;
if ((ib / 2) == Math.round(ib / 2)) {
ob.mc._alpha = 30;
} else {
ob.mc._alpha = 100;
}
} else {
clearInterval(invinsibleBlinkInterval);
ib = 0;
ob.mc._alpha = 100;
ob.invinsible = false;
}
}
function watchKeyDown(key) {
if (keyListener != undefined) {
keyListener = undefined;
}
if (key != undefined) {
_root["keyListener" + key] = new Object();
keyListener = _root["keyListener" + key];
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
if (Key.isDown(key)) {
this.keyLength++;
}
};
keyListener.onKeyUp = function () {
if (Key.getCode() == key) {
this.keyLength = 0;
}
};
Key.addListener(keyListener);
} else {
keyListener = new Object();
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
this.keyLength++;
};
keyListener.onKeyUp = function () {
this.keyLength = 0;
};
Key.addListener(keyListener);
}
}
function checkKeyDown(key) {
if (_root["keyListener" + key] == undefined) {
return(false);
}
_root["return" + key] = new Object();
_root["return" + key].key = key;
if (Key.isDown(key)) {
_root["return" + key].keyLength = _root["keyListener" + key].keyLength;
} else {
_root["return" + key].keyLength = 0;
}
return(_root["return" + key]);
}
function godmodeTimer() {
if ((guy.godmodeCollected > 0) && (!gamePaused)) {
guy.godmodeCollected--;
} else if (guy.godmodeCollected == 0) {
clearInterval(godmodeTimerInterval);
godmodeTimerInterval = undefined;
godmodeRemoveInterval = setInterval(godmodeRemove, 1);
}
}
function godmodeRemove() {
if (((guy.godmode && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.godmode = false;
guy.transforming = true;
guy.invinsible = false;
guy.mc.gotoAndStop("godmode");
clearInterval(godmodeRemoveInterval);
}
}
function clearEverythingAndMoveOn(nextLvl, nextScrn) {
i = 0;
while (i < (h + z)) {
removeMovieClip(_root["zombie" + i]);
removeMovieClip(_root["strongzombie" + i]);
removeMovieClip(_root["flyinghead" + i]);
removeMovieClip(_root["health" + i]);
removeMovieClip(_root["godmode" + i]);
i++;
}
song.stop();
song = undefined;
gamePaused = false;
removeMovieClip(pauseMenu);
recordKills = (("Kills: " + guy.kills) + " / ") + killsNeeded;
recordPoints = "Points: " + guy.points;
recordTime = timebar.time_txt.text;
level3time = (timebar.minutes * 60) + timebar.seconds;
var _local3 = {kills:guy.kills, points:guy.points, time:level3time};
_global.level3 = _local3;
level3time = undefined;
removeMovieClip(guy.mc);
guy = undefined;
removeMovieClip(boss.mc);
boss = undefined;
removeMovieClip(healthbar);
removeMovieClip(godmodebar);
removeMovieClip(pointsbar);
removeMovieClip(killsbar);
removeMovieClip(multiplierbar);
removeMovieClip(timebar);
clearInterval(addSecondInterval);
clearInterval(invinsibleBlinkInterval);
Key.removeListener(pauseKey);
if (nextLvl == undefined) {
nextLvl = "level4";
}
nextLevel = nextLvl;
lightning.play();
if (nextScrn != undefined) {
_root.gotoAndStop(nextScrn);
} else {
_root.gotoAndStop("levelTransition");
}
}
stop();
killsNeeded = 1;
gamePaused = false;
z = 0;
ib = 0;
h = 0;
hd = 1000;
pauseKey = new Object();
pauseKey.onKeyDown = function () {
if (Key.isDown(80)) {
if (!gamePaused) {
gamePaused = true;
} else {
gamePaused = false;
}
}
};
Key.addListener(pauseKey);
ground.width = ground._width / 2;
ground.height = ground._height / 2;
guy = {xspeed:0, yspeed:0, xspeedmax:10, xaccel:2, yspeedmax:20, yaccel:5, dir:1, jumping:false, jumpspeed:0, jumpstart:-40, attacking:false, attacking2:false, finishedAttacking:false, godmode:false, godmodeCollected:0, transforming:false, invinsible:false, health:4, points:0, kills:0, killsinarow:0, multiplier:1};
guy.mc = attachMovie("guy", "person", 1000);
guy.mc._xscale = (guy.mc._yscale = 80);
guy.height = guy.mc._height / 2;
guy.width = guy.mc._width / 2;
respawnGuy();
boss = {found:false, attacking:false, attacking2:false, dying:false, invinsible:false, yspeed:0, yaccel:1, attacking:false, attacking2:false, finishedAttacking:false, attackPatternPosition:0, pattern:0, charging:false, dir:-1};
boss.attackPattern = [3, 0, 2, 0, 3, 0, 2, 2, 0];
if (difficulty == 0) {
boss.health = 5;
boss.points = 500;
} else if (difficulty == 1) {
boss.health = 6;
boss.points = 1000;
} else if (difficulty == 2) {
boss.health = 7;
boss.points = 2000;
}
boss.mc = attachMovie("rob", "enemy", ++z);
boss.height = (boss.mc._height / 2) - boss.mc.healthbar._height;
boss.width = boss.mc._width / 2;
boss.mc._x = (ground._x + ground.width) - 200;
boss.mc.healthbar.onEnterFrame = function () {
this.gotoAndStop(boss.health);
};
boss.idle = function () {
boss.midAttack = false;
boss.charging = false;
boss.mc.gotoAndStop("idle");
};
boss.attack = function () {
boss.charging = false;
boss.attacking = true;
boss.mc.gotoAndStop("attack");
};
boss.attack2 = function () {
boss.charging = false;
boss.attacking2 = true;
boss.mc.gotoAndStop("attack2");
};
boss.charge = function () {
boss.charging = true;
boss.mc.gotoAndStop("walk");
};
boss.shockwave = function () {
boss.wave = boss.mc.attachMovie("shockwave", "shockwave" + z, ++z);
boss.wave._y = boss.height - boss.mc.healthbar._height;
boss.wave.onEnterFrame = function () {
if (guy.mc.pickups.hitTest(this) && (!guy.invinsible)) {
guy.health--;
respawnGuy();
}
};
};
boss.mc.onEnterFrame = function () {
if (!gamePaused) {
if (!ground.hitTest(this._x, (this._y + boss.height) + boss.yspeed, true)) {
boss.yspeed = boss.yspeed + boss.yaccel;
} else if (ground.hitTest(this._x, (this._y + boss.height) + boss.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + boss.height) + 1, true)) {
this._y = this._y + 1;
}
boss.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + boss.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + boss.yspeed;
_root.bossPlace = function () {
boss.mc._x = boss.mc._x - guy.xspeed;
};
if (boss.found) {
boss.attackPatternPosition++;
if (((boss.attackPatternPosition / 50) == Math.round(boss.attackPatternPosition / 50)) && (!boss.dying)) {
boss.pattern = boss.attackPattern[(boss.attackPatternPosition / 50) - 1];
if (boss.pattern == 0) {
boss.idle();
}
if (boss.pattern == 1) {
boss.attack();
}
if (boss.pattern == 2) {
boss.attack2();
}
if (boss.pattern == 3) {
boss.charge();
}
if ((boss.attackPatternPosition / 50) == boss.attackPattern.length) {
boss.attackPatternPosition = 0;
}
}
if (((!boss.charging) && (!boss.attacking)) && (!boss.attacking2)) {
if (boss.mc._x > guy.mc._x) {
boss.dir = -1;
} else {
boss.dir = 1;
}
boss.mc._xscale = 100 * (-boss.dir);
}
if (boss.charging && (!ground.hitTest((boss.mc._x + (boss.width * boss.dir)) + (10 * boss.dir), boss.mc._y - (boss.height / 2), true))) {
boss.mc._x = boss.mc._x + (10 * boss.dir);
}
if (boss.finishedAttacking) {
boss.midAttack = false;
boss.finishedAttacking = false;
boss.attacking = false;
boss.attacking2 = false;
boss.charging = false;
boss.idle();
}
if ((((guy.mc.hitTest(this._x + (boss.width * boss.dir), this._y, true) && (!boss.attacking)) && (!boss.attacking2)) && (!boss.charging)) && (!boss.dying)) {
boss.attack();
boss.midAttack = true;
}
if (((boss.midAttack && (guy.mc.pickups.hitTest(this._x + (boss.width * boss.dir), this._y, true))) && (!guy.invinsible)) || ((boss.midAttack && (this.hitTest(guy.mc._x + (guy.width * (-boss.dir)), guy.mc._y, true))) && (!guy.invinsible))) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.xspeed = guy.xspeed + (20 * boss.dir);
guy.yspeed = guy.yspeed - 30;
guy.health--;
respawnGuy();
}
if (((boss.charging && (guy.mc.pickups.hitTest(this._x + (boss.width * boss.dir), this._y, true))) && (!guy.invinsible)) || ((boss.charging && (this.hitTest(guy.mc._x + (guy.width * (-boss.dir)), guy.mc._y, true))) && (!guy.invinsible))) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!boss.invinsible)) {
if (guy.godmode) {
boss.health = boss.health - 2;
} else {
boss.health--;
}
boss.invinsible = true;
this._alpha = 60;
bossInvinsibleClearInterval = setInterval(bossInvinsibleClear, 500, boss);
}
}
if (boss.health <= 0) {
this.gotoAndStop("die");
boss.attacking = false;
boss.attacking2 = false;
boss.charging = false;
boss.dying = true;
}
}
if (boss.dead) {
guy.kills++;
guy.points = guy.points + boss.points;
}
}
};
attachMovie("healthbar", "healthbar", 10000);
healthbar._x = 5;
healthbar._y = 5;
healthbar.onEnterFrame = function () {
if (guy.health > 0) {
this.gotoAndStop(guy.health);
} else if (guy.health <= 0) {
this.gotoAndStop(5);
clearEverythingAndMoveOn("menu", "gameover");
}
};
attachMovie("godmodebar", "godmodebar", 10001);
godmodebar._x = 5;
godmodebar._y = healthbar._height + 10;
godmodebar.onEnterFrame = function () {
if ((guy.godmodeCollected != 0) && (guy.godmodeCollected <= 4)) {
this.gotoAndStop(guy.godmodeCollected);
} else if (guy.godmodeCollected == 0) {
this.gotoAndStop(5);
} else if (guy.godmodeCollected > 4) {
this.gotoAndStop(4);
}
};
attachMovie("timebar", "timebar", 10002);
timebar._x = (Stage.width / 2) - (timebar._width / 2);
timebar._y = 5;
timebar.minutes = 0;
timebar.seconds = 0;
addSecondInterval = setInterval(addSecond, 1000);
timebar.onEnterFrame = function () {
if ((this.minutes < 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes < 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":") + this.seconds;
}
};
_root.createEmptyMovieClip("multiplierbar", 10003);
multiplierbar._x = Stage.width / 2;
multiplierbar._y = Stage.height / 2;
multiplierbar.onEnterFrame = function () {
if (((guy.killsinarow >= 16) && (!multiplier.five)) && (difficulty == 2)) {
guy.multiplier = 5;
multiplier = multiplierbar.attachMovie("multiplier5", "multiplier", 100000);
multiplier.five = true;
} else if ((((guy.killsinarow >= 8) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 4;
multiplier = multiplierbar.attachMovie("multiplier4", "multiplier", 100000);
multiplier.four = true;
} else if (((((guy.killsinarow >= 4) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 3;
multiplier = multiplierbar.attachMovie("multiplier3", "multiplier", 100000);
multiplier.three = true;
} else if (((((guy.killsinarow >= 2) && (!multiplier.two)) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) {
guy.multiplier = 2;
multiplier = multiplierbar.attachMovie("multiplier2", "multiplier", 100000);
multiplier.two = true;
} else if (guy.killsinarow < 2) {
removeMovieClip(multiplier);
guy.multiplier = 1;
}
};
attachMovie("pointsbar", "pointsbar", 10004);
pointsbar._x = (Stage.width - pointsbar._width) - 5;
pointsbar._y = 5;
pointsbar.onEnterFrame = function () {
this.points_txt.text = guy.points;
};
attachMovie("killsbar", "killsbar", 10005);
killsbar._x = (Stage.width - killsbar._width) - 5;
killsbar._y = pointsbar._height + 10;
killsbar.onEnterFrame = function () {
this.kills_txt.text = (guy.kills + " / ") + killsNeeded;
if (guy.kills >= killsNeeded) {
clearEverythingAndMoveOn();
}
};
if (song != undefined) {
song.stop();
}
songMute = false;
song = new Sound();
song.attachSound("song1");
song.start();
song.onSoundComplete = function () {
song.start();
};
watchKeyDown(32);
watchKeyDown(38);
this.onEnterFrame = function () {
if (!gamePaused) {
checkKeys();
}
if (gamePaused && (pauseMenu == undefined)) {
attachMovie("pauseMenu", "pauseMenu", 10006);
pauseMenu.resume_mc.onRelease = function () {
gamePaused = false;
};
pauseMenu.mute_mc.onRelease = function () {
if (!songMute) {
song.setVolume(0);
songMute = true;
} else {
song.setVolume(100);
songMute = false;
}
};
pauseMenu.mainmenu_mc.onRelease = function () {
clearEverythingAndMoveOn("menu", "gameover");
};
} else if ((!gamePaused) && (pauseMenu != undefined)) {
removeMovieClip(pauseMenu);
}
};
Frame 23
function respawnGuy() {
guy.invinsible = true;
invinsibleBlinkInterval = setInterval(invinsibleBlink, 100, guy, 10);
guy.mc._x = Stage.width / 2;
if (guy.killsinarow > 0) {
guy.killsinarow = 0;
}
}
function newZombie() {
zombie = attachMovie("zombie", "zombie" + z, z);
z++;
zombie._x = offScreen();
zombie.width = zombie._width / 2;
zombie.height = (zombie._height / 2) - zombie.healthbar._height;
if (difficulty == 0) {
zombie.points = 5;
} else if (difficulty == 1) {
zombie.points = 10;
} else if (difficulty == 2) {
zombie.points = 20;
}
zombie.xspeed = 5;
zombie.yspeed = 0;
zombie.yaccel = 1;
if (difficulty == 0) {
zombie.health = 1;
} else if (difficulty == 1) {
zombie.health = 2;
} else if (difficulty == 2) {
zombie.health = 3;
}
zombie.invinsible = false;
zombie.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
zombie.dying = false;
zombie.attacking = false;
zombie.midAttack = false;
zombie.dir = Math.floor((Math.random() * 2) - 1);
if ((zombie.dir != 1) && (zombie.dir != -1)) {
zombie.dir = 1;
}
zombie.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["zombieInvinsibleClearInterval" + Z] = setInterval(_root["zombieInvinsibleClear" + Z], 500, this);
if (Z < 2) {
Z++;
} else {
Z = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (ground._y + ground.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if ((!this.dying) && (!this.attacking)) {
_root.zombieMove(this);
}
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if ((guy.mc.hitTest((this._x + (this.width * this.dir)) + (this.xspeed * this.dir), this._y, true) && (!this.attacking)) && (!this.dying)) {
this.gotoAndStop("attack");
this.attacking = true;
}
if ((this.midAttack && (guy.mc.pickups.hitTest(this._x + (this.width * this.dir), this._y, true))) && (!guy.invinsible)) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
}
_root.zombiePlace = function () {
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._x = _root["zombie" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function newStrongZombie() {
strongzombie = attachMovie("strongzombie", "strongzombie" + z, z);
z++;
strongzombie._x = offScreen();
strongzombie.width = strongzombie._width / 2;
strongzombie.height = (strongzombie._height / 2) - strongzombie.healthbar._height;
if (difficulty == 0) {
strongzombie.points = 25;
} else if (difficulty == 1) {
strongzombie.points = 50;
} else if (difficulty == 2) {
strongzombie.points = 100;
}
strongzombie.xspeed = 5;
strongzombie.yspeed = 0;
strongzombie.yaccel = 1;
if (difficulty == 0) {
strongzombie.health = 3;
} else if (difficulty == 1) {
strongzombie.health = 4;
} else if (difficulty == 2) {
strongzombie.health = 5;
}
strongzombie.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
strongzombie.invincible = false;
strongzombie.dying = false;
strongzombie.attacking = false;
strongzombie.midAttack = false;
strongzombie.dir = Math.floor((Math.random() * 2) - 1);
if ((strongzombie.dir != 1) && (strongzombie.dir != -1)) {
strongzombie.dir = 1;
}
strongzombie.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["strongZombieInvinsibleClearInterval" + SZ] = setInterval(_root["strongZombieInvinsibleClear" + SZ], 500, this);
if (SZ < 2) {
SZ++;
} else {
SZ = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (ground._y + ground.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if ((!this.dying) && (!this.attacking)) {
_root.strongZombieMove(this);
}
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (((guy.mc.hitTest(this._x + (this.width * this.dir), this._y, true) && (!this.attacking)) && (!this.dying)) || ((guy.mc.hitTest(this) && (!this.attacking)) && (!this.dying))) {
this.gotoAndStop("attack");
this.attacking = true;
}
if (((this.midAttack && (guy.mc.pickups.hitTest(this._x + (this.width * this.dir), this._y, true))) && (!guy.invinsible)) || ((this.midAttack && (this.hitTest(guy.mc._x + (guy.width * (-this.dir)), guy.mc._y, true))) && (!guy.invinsible))) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
}
_root.strongZombiePlace = function () {
i = 0;
while (i < z) {
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._x = _root["strongzombie" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function newFlyingHead() {
flyinghead = attachMovie("flyinghead", "flyinghead" + z, z);
z++;
flyinghead._x = offScreen();
flyinghead._y = 50;
flyinghead.width = flyinghead._width / 2;
flyinghead.height = flyinghead._height / 2;
if (difficulty == 0) {
flyinghead.points = 15;
} else if (difficulty == 1) {
flyinghead.points = 30;
} else if (difficulty == 2) {
flyinghead.points = 60;
}
flyinghead.xspeed = 5;
flyinghead.yspeed = 0;
flyinghead.yaccel = 1;
if (difficulty == 0) {
flyinghead.health = 2;
} else if (difficulty == 1) {
flyinghead.health = 3;
} else if (difficulty == 2) {
flyinghead.health = 4;
}
flyinghead.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
flyinghead.invinsible = false;
flyinghead.dying = false;
flyinghead.attacking = false;
flyinghead.dir = Math.floor((Math.random() * 2) - 1);
if ((flyinghead.dir != 1) && (flyinghead.dir != -1)) {
flyinghead.dir = 1;
}
flyinghead.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["flyingHeadInvinsibleClearInterval" + FH] = setInterval(_root["flyingHeadInvinsibleClear" + FH], 500, this);
if (FH < 2) {
FH++;
} else {
FH = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (Stage.height + this.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if (!this.dying) {
_root.flyingHeadMove(this);
}
if (!this.dying) {
if (nearAmount(this._x, guy.mc._x, 100) && (this._y < (guy.mc._y - guy.height))) {
this.attacking = true;
this._y = this._y + 5;
} else if (this.attacking && (nearAmount(this._y, guy.mc._y, 75))) {
this.gotoAndStop("attack");
this.midAttack = true;
}
if (((this.midAttack && (nearAmount(this._x, guy.mc._x, 75))) && (nearAmount(this._y, guy.mc._y, 75))) && (!guy.invinsible)) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
if (((this.attacking == false) && (this._y > 50)) || ((!nearAmount(this._x, guy.mc._x, 100)) && (this._y > 50))) {
this.attacking = false;
this.midAttack = false;
this._y = this._y - 5;
}
if ((!this.attacking) && (this._y < 100)) {
this._y = this._y + 5;
}
if (((!this.attacking) && (this._y > 100)) || ((!nearAmount(this._x, guy.mc._x, 100)) && (this._y > 100))) {
this.attacking = false;
this.midAttack = false;
this._y = this._y - 5;
}
}
}
_root.flyingHeadPlace = function () {
i = 0;
while (i < z) {
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._x = _root["flyinghead" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function zombieMove(ob) {
ob.gotoAndStop("walk");
if (ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.dir = ob.dir * -1;
}
ob._xscale = -100 * ob.dir;
ob._x = ob._x + (ob.xspeed * ob.dir);
}
function strongZombieMove(ob) {
if (!ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.gotoAndStop("walk");
} else {
ob.gotoAndStop("idle");
}
if (guy.mc._x > ob._x) {
ob.dir = 1;
} else {
ob.dir = -1;
}
ob._xscale = -100 * ob.dir;
if (!ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob._x = ob._x + (ob.xspeed * ob.dir);
}
}
function flyingHeadMove(ob) {
if (!ob.attacking) {
ob.gotoAndStop("idle");
}
if (ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.dir = ob.dir * -1;
}
if ((Math.floor(Math.random() * 100) == 0) && (!ob.attacking)) {
ob.dir = ob.dir * -1;
}
ob._xscale = -100 * ob.dir;
ob._x = ob._x + (ob.xspeed * ob.dir);
}
function zombieInvinsibleClear0(ob) {
clearInterval(zombieInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function zombieInvinsibleClear1(ob) {
clearInterval(zombieInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function zombieInvinsibleClear2(ob) {
clearInterval(zombieInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear0(ob) {
clearInterval(strongZombieInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear1(ob) {
clearInterval(strongZombieInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear2(ob) {
clearInterval(strongZombieInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear0(ob) {
clearInterval(flyingHeadInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear1(ob) {
clearInterval(flyingHeadInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear2(ob) {
clearInterval(flyingHeadInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function newHealth() {
health = attachMovie("health", "health" + h, ++hd);
health.height = health._height / 2;
health.yspeed = 0;
health.yaccel = 1;
health._x = offScreen();
health.onEnterFrame = function () {
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (this.hitTest(guy.mc.pickups)) {
this.gotoAndStop("collect");
}
_root.healthPlace = function () {
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._x = _root["health" + i]._x - guy.xspeed;
}
i++;
}
};
};
h++;
}
function newGodmode() {
godmode = attachMovie("godmodepickup", "godmode" + h, ++hd);
godmode.height = godmode._height / 2;
godmode.yspeed = 0;
godmode.yaccel = 1;
godmode._x = offScreen();
godmode.onEnterFrame = function () {
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (this.hitTest(guy.mc.pickups)) {
this.gotoAndStop("collect");
}
_root.godmodePlace = function () {
i = 0;
while (i < h) {
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._x = _root["godmode" + i]._x - guy.xspeed;
}
i++;
}
};
};
h++;
}
function addSecond() {
if (!gamePaused) {
if (timebar.seconds < 59) {
timebar.seconds++;
} else if (timebar.seconds == 59) {
timebar.seconds = 0;
timebar.minutes++;
}
}
}
function checkKeys() {
if (((Key.isDown(37) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = 80;
guy.dir = 1;
} else if (((Key.isDown(39) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = -80;
guy.dir = -1;
}
if ((((Key.isDown(37) || (Key.isDown(39))) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest((guy.mc._x - (guy.width * guy.dir)) + guy.xspeed, guy.mc._y, true))) {
if ((!guy.attacking) || (guy.attacking && (guy.jumping))) {
if (Key.isDown(37) && (guy.xspeed > (-guy.xspeedmax))) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (Key.isDown(39) && (guy.xspeed < guy.xspeedmax)) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
} else if ((guy.attacking && (!guy.jumping)) && (!guy.transforming)) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
} else {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (Key.isDown(39) && (Key.isDown(37))) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (((((Math.abs(guy.xspeed) > 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("walk");
} else if (((((Math.abs(guy.xspeed) == 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("idle");
}
if (((((ground._x - ground.width) - guy.xspeed) <= 0) && (((ground._x + ground.width) - guy.xspeed) >= Stage.width)) && (nearAmount(guy.mc._x, Stage.width / 2, 10))) {
ground._x = ground._x - guy.xspeed;
zombiePlace();
strongZombiePlace();
flyingHeadPlace();
healthPlace();
godmodePlace();
} else {
guy.mc._x = guy.mc._x + guy.xspeed;
}
if (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
guy.jumping = true;
guy.yspeed = guy.yspeed + guy.yaccel;
} else if (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
while (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true)) {
guy.mc._y = guy.mc._y + 1;
}
guy.jumping = false;
guy.jumpspeed = 0;
guy.yspeed = 0;
}
while ((!guy.jumping) && (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) - 1, true))) {
guy.mc._y = guy.mc._y - 1;
}
if ((((((Key.isDown(32) || (Key.isDown(38))) && (checkKeyDown(32).keyLength <= 1)) && (checkKeyDown(38).keyLength <= 1)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.jumping = true;
guy.jumpspeed = guy.jumpspeed + guy.jumpstart;
guy.yspeed = guy.yspeed + guy.jumpspeed;
}
if (guy.jumpspeed > 0) {
guy.jumpspeed = guy.jumpspeed - guy.yaccel;
}
guy.mc._y = guy.mc._y + guy.yspeed;
if ((((guy.jumping && (guy.yspeed < 0)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("jump");
} else if ((((guy.jumping && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true))) {
guy.mc.gotoAndStop("fall");
}
if (((Key.isDown(90) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack");
guy.attacking = true;
}
if ((((Key.isDown(88) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.jumping)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack2");
guy.attacking2 = true;
}
if (guy.finishedAttacking) {
guy.finishedAttacking = false;
guy.attacking = false;
guy.attacking2 = false;
}
if (((((Key.isDown(67) && (!guy.godmode)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (guy.godmodeCollected == 4)) {
guy.godmode = true;
guy.transforming = true;
guy.mc.gotoAndStop("godmode");
if (godmodeTimerInterval == undefined) {
godmodeTimerInterval = setInterval(godmodeTimer, 2500);
}
}
if (guy.godmode) {
guy.invinsible = true;
}
while (guy.mc._y < (Stage.height - 200)) {
guy.mc._y = guy.mc._y + 5;
ground._y = ground._y + 5;
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._y = _root["zombie" + i]._y + 5;
}
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._y = _root["strongzombie" + i]._y + 5;
}
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._y = _root["flyinghead" + i]._y + 5;
}
i++;
}
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y + 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y + 5;
}
i++;
}
}
while (guy.mc._y > (Stage.height - 150)) {
guy.mc._y = guy.mc._y - 5;
ground._y = ground._y - 5;
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._y = _root["zombie" + i]._y - 5;
}
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._y = _root["strongzombie" + i]._y - 5;
}
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._y = _root["flyinghead" + i]._y - 5;
}
i++;
}
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y - 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y - 5;
}
i++;
}
}
}
function nearAmount(amount1, amount2, near) {
if ((amount1 > (amount2 - near)) && (amount1 < (amount2 + near))) {
return(true);
}
return(false);
}
function offScreen() {
int1 = (int2 = undefined);
min1 = (ground._x - ground.width) + 100;
max1 = 0;
min2 = Stage.width;
max2 = (ground._x + ground.width) - 100;
if (min1 < max1) {
int1 = (Math.random() * (max1 - min1)) + min1;
}
if (min2 < max2) {
int2 = (Math.random() * (max2 - min2)) + min2;
}
if ((int1 != undefined) && (int2 == undefined)) {
return(int1);
}
if ((int1 == undefined) && (int2 != undefined)) {
return(int2);
}
if ((int1 != undefined) && (int2 != undefined)) {
which = Math.floor(Math.random() * 2);
if (which == 0) {
return(int1);
}
return(int2);
}
}
function invinsibleBlink(ob, length) {
if (ib < length) {
ib++;
if ((ib / 2) == Math.round(ib / 2)) {
ob.mc._alpha = 30;
} else {
ob.mc._alpha = 100;
}
} else {
clearInterval(invinsibleBlinkInterval);
ib = 0;
ob.mc._alpha = 100;
ob.invinsible = false;
}
}
function watchKeyDown(key) {
if (keyListener != undefined) {
keyListener = undefined;
}
if (key != undefined) {
_root["keyListener" + key] = new Object();
keyListener = _root["keyListener" + key];
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
if (Key.isDown(key)) {
this.keyLength++;
}
};
keyListener.onKeyUp = function () {
if (Key.getCode() == key) {
this.keyLength = 0;
}
};
Key.addListener(keyListener);
} else {
keyListener = new Object();
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
this.keyLength++;
};
keyListener.onKeyUp = function () {
this.keyLength = 0;
};
Key.addListener(keyListener);
}
}
function checkKeyDown(key) {
if (_root["keyListener" + key] == undefined) {
return(false);
}
_root["return" + key] = new Object();
_root["return" + key].key = key;
if (Key.isDown(key)) {
_root["return" + key].keyLength = _root["keyListener" + key].keyLength;
} else {
_root["return" + key].keyLength = 0;
}
return(_root["return" + key]);
}
function godmodeTimer() {
if ((guy.godmodeCollected > 0) && (!gamePaused)) {
guy.godmodeCollected--;
} else if (guy.godmodeCollected == 0) {
clearInterval(godmodeTimerInterval);
godmodeTimerInterval = undefined;
godmodeRemoveInterval = setInterval(godmodeRemove, 1);
}
}
function godmodeRemove() {
if (((guy.godmode && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.godmode = false;
guy.transforming = true;
guy.invinsible = false;
guy.mc.gotoAndStop("godmode");
clearInterval(godmodeRemoveInterval);
}
}
function clearEverythingAndMoveOn(nextLvl, nextScrn) {
i = 0;
while (i < (h + z)) {
removeMovieClip(_root["zombie" + i]);
removeMovieClip(_root["strongzombie" + i]);
removeMovieClip(_root["flyinghead" + i]);
removeMovieClip(_root["health" + i]);
removeMovieClip(_root["godmode" + i]);
i++;
}
song.stop();
song = undefined;
gamePaused = false;
removeMovieClip(pauseMenu);
recordKills = (("Kills: " + guy.kills) + " / ") + killsNeeded;
recordPoints = "Points: " + guy.points;
recordTime = timebar.time_txt.text;
level4time = (timebar.minutes * 60) + timebar.seconds;
var _local3 = {kills:guy.kills, points:guy.points, time:level4time};
_global.level4 = _local3;
level4time = undefined;
removeMovieClip(guy.mc);
guy = undefined;
removeMovieClip(healthbar);
removeMovieClip(godmodebar);
removeMovieClip(pointsbar);
removeMovieClip(killsbar);
removeMovieClip(multiplierbar);
removeMovieClip(timebar);
clearInterval(addSecondInterval);
clearInterval(invinsibleBlinkInterval);
Key.removeListener(pauseKey);
if (nextLvl == undefined) {
nextLvl = "level5";
}
nextLevel = nextLvl;
lightning.play();
if (nextScrn != undefined) {
_root.gotoAndStop(nextScrn);
} else {
_root.gotoAndStop("levelTransition");
}
}
stop();
if (difficulty == 0) {
killsNeeded = 20;
}
if (difficulty == 1) {
killsNeeded = 25;
}
if (difficulty == 2) {
killsNeeded = 30;
}
gamePaused = false;
z = 0;
ib = 0;
h = 0;
hd = 1000;
Z = 0;
SZ = 0;
FH = 0;
pauseKey = new Object();
pauseKey.onKeyDown = function () {
if (Key.isDown(80)) {
if (!gamePaused) {
gamePaused = true;
} else {
gamePaused = false;
}
}
};
Key.addListener(pauseKey);
ground.width = ground._width / 2;
ground.height = ground._height / 2;
guy = {xspeed:0, yspeed:0, xspeedmax:10, xaccel:2, yspeedmax:20, yaccel:5, dir:1, jumping:false, jumpspeed:0, jumpstart:-40, attacking:false, attacking2:false, finishedAttacking:false, godmode:false, godmodeCollected:0, transforming:false, invinsible:false, health:4, points:0, kills:0, killsinarow:0, multiplier:1};
guy.mc = attachMovie("guy", "person", 1000);
guy.mc._xscale = (guy.mc._yscale = 80);
guy.height = guy.mc._height / 2;
guy.width = guy.mc._width / 2;
respawnGuy();
if (difficulty == 0) {
newZombie();
newStrongZombie();
newFlyingHead();
}
if (difficulty == 1) {
newZombie();
newZombie();
newStrongZombie();
newFlyingHead();
}
if (difficulty == 2) {
newZombie();
newZombie();
newStrongZombie();
newStrongZombie();
newFlyingHead();
newFlyingHead();
}
attachMovie("healthbar", "healthbar", 10000);
healthbar._x = 5;
healthbar._y = 5;
healthbar.onEnterFrame = function () {
if (guy.health > 0) {
this.gotoAndStop(guy.health);
} else if (guy.health <= 0) {
this.gotoAndStop(5);
clearEverythingAndMoveOn("menu", "gameover");
}
};
if (difficulty == 0) {
newHealth();
newHealth();
} else {
newHealth();
}
attachMovie("godmodebar", "godmodebar", 10001);
godmodebar._x = 5;
godmodebar._y = healthbar._height + 10;
godmodebar.onEnterFrame = function () {
if ((guy.godmodeCollected != 0) && (guy.godmodeCollected <= 4)) {
this.gotoAndStop(guy.godmodeCollected);
} else if (guy.godmodeCollected == 0) {
this.gotoAndStop(5);
} else if (guy.godmodeCollected > 4) {
this.gotoAndStop(4);
}
};
if (difficulty == 0) {
newGodmode();
newGodmode();
} else {
newGodmode();
}
attachMovie("timebar", "timebar", 10002);
timebar._x = (Stage.width / 2) - (timebar._width / 2);
timebar._y = 5;
timebar.minutes = 0;
timebar.seconds = 0;
addSecondInterval = setInterval(addSecond, 1000);
timebar.onEnterFrame = function () {
if ((this.minutes < 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes < 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":") + this.seconds;
}
};
_root.createEmptyMovieClip("multiplierbar", 10003);
multiplierbar._x = Stage.width / 2;
multiplierbar._y = Stage.height / 2;
multiplierbar.onEnterFrame = function () {
if (((guy.killsinarow >= 16) && (!multiplier.five)) && (difficulty == 2)) {
guy.multiplier = 5;
multiplier = multiplierbar.attachMovie("multiplier5", "multiplier", 100000);
multiplier.five = true;
} else if ((((guy.killsinarow >= 8) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 4;
multiplier = multiplierbar.attachMovie("multiplier4", "multiplier", 100000);
multiplier.four = true;
} else if (((((guy.killsinarow >= 4) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 3;
multiplier = multiplierbar.attachMovie("multiplier3", "multiplier", 100000);
multiplier.three = true;
} else if (((((guy.killsinarow >= 2) && (!multiplier.two)) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) {
guy.multiplier = 2;
multiplier = multiplierbar.attachMovie("multiplier2", "multiplier", 100000);
multiplier.two = true;
} else if (guy.killsinarow < 2) {
removeMovieClip(multiplier);
guy.multiplier = 1;
}
};
attachMovie("pointsbar", "pointsbar", 10004);
pointsbar._x = (Stage.width - pointsbar._width) - 5;
pointsbar._y = 5;
pointsbar.onEnterFrame = function () {
this.points_txt.text = guy.points;
};
attachMovie("killsbar", "killsbar", 10005);
killsbar._x = (Stage.width - killsbar._width) - 5;
killsbar._y = pointsbar._height + 10;
killsbar.onEnterFrame = function () {
this.kills_txt.text = (guy.kills + " / ") + killsNeeded;
if (guy.kills >= killsNeeded) {
clearEverythingAndMoveOn();
}
};
if (song != undefined) {
song.stop();
}
songMute = false;
song = new Sound();
song.attachSound("song1");
song.start();
song.onSoundComplete = function () {
song.start();
};
watchKeyDown(32);
watchKeyDown(38);
this.onEnterFrame = function () {
if (!gamePaused) {
checkKeys();
}
if (gamePaused && (pauseMenu == undefined)) {
attachMovie("pauseMenu", "pauseMenu", 10006);
pauseMenu.resume_mc.onRelease = function () {
gamePaused = false;
};
pauseMenu.mute_mc.onRelease = function () {
if (!songMute) {
song.setVolume(0);
songMute = true;
} else {
song.setVolume(100);
songMute = false;
}
};
pauseMenu.mainmenu_mc.onRelease = function () {
clearEverythingAndMoveOn("menu", "gameover");
};
} else if ((!gamePaused) && (pauseMenu != undefined)) {
removeMovieClip(pauseMenu);
}
};
Frame 24
function respawnGuy() {
guy.invinsible = true;
invinsibleBlinkInterval = setInterval(invinsibleBlink, 100, guy, 10);
guy.mc._x = Stage.width / 2;
if (guy.killsinarow > 0) {
guy.killsinarow = 0;
}
}
function newZombie() {
zombie = attachMovie("zombie", "zombie" + z, z);
z++;
zombie._x = offScreen();
zombie.width = zombie._width / 2;
zombie.height = (zombie._height / 2) - zombie.healthbar._height;
if (difficulty == 0) {
zombie.points = 5;
} else if (difficulty == 1) {
zombie.points = 10;
} else if (difficulty == 2) {
zombie.points = 20;
}
zombie.xspeed = 5;
zombie.yspeed = 0;
zombie.yaccel = 1;
if (difficulty == 0) {
zombie.health = 1;
} else if (difficulty == 1) {
zombie.health = 2;
} else if (difficulty == 2) {
zombie.health = 3;
}
zombie.invinsible = false;
zombie.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
zombie.dying = false;
zombie.attacking = false;
zombie.midAttack = false;
zombie.dir = Math.floor((Math.random() * 2) - 1);
if ((zombie.dir != 1) && (zombie.dir != -1)) {
zombie.dir = 1;
}
zombie.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["zombieInvinsibleClearInterval" + Z] = setInterval(_root["zombieInvinsibleClear" + Z], 500, this);
if (Z < 2) {
Z++;
} else {
Z = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (ground._y + ground.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if ((!this.dying) && (!this.attacking)) {
_root.zombieMove(this);
}
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if ((guy.mc.hitTest((this._x + (this.width * this.dir)) + (this.xspeed * this.dir), this._y, true) && (!this.attacking)) && (!this.dying)) {
this.gotoAndStop("attack");
this.attacking = true;
}
if ((this.midAttack && (guy.mc.pickups.hitTest(this._x + (this.width * this.dir), this._y, true))) && (!guy.invinsible)) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
}
_root.zombiePlace = function () {
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._x = _root["zombie" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function newStrongZombie() {
strongzombie = attachMovie("strongzombie", "strongzombie" + z, z);
z++;
strongzombie._x = offScreen();
strongzombie.width = strongzombie._width / 2;
strongzombie.height = (strongzombie._height / 2) - strongzombie.healthbar._height;
if (difficulty == 0) {
strongzombie.points = 25;
} else if (difficulty == 1) {
strongzombie.points = 50;
} else if (difficulty == 2) {
strongzombie.points = 100;
}
strongzombie.xspeed = 5;
strongzombie.yspeed = 0;
strongzombie.yaccel = 1;
if (difficulty == 0) {
strongzombie.health = 3;
} else if (difficulty == 1) {
strongzombie.health = 4;
} else if (difficulty == 2) {
strongzombie.health = 5;
}
strongzombie.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
strongzombie.invincible = false;
strongzombie.dying = false;
strongzombie.attacking = false;
strongzombie.midAttack = false;
strongzombie.dir = Math.floor((Math.random() * 2) - 1);
if ((strongzombie.dir != 1) && (strongzombie.dir != -1)) {
strongzombie.dir = 1;
}
strongzombie.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["strongZombieInvinsibleClearInterval" + SZ] = setInterval(_root["strongZombieInvinsibleClear" + SZ], 500, this);
if (SZ < 2) {
SZ++;
} else {
SZ = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (ground._y + ground.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if ((!this.dying) && (!this.attacking)) {
_root.strongZombieMove(this);
}
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (((guy.mc.hitTest(this._x + (this.width * this.dir), this._y, true) && (!this.attacking)) && (!this.dying)) || ((guy.mc.hitTest(this) && (!this.attacking)) && (!this.dying))) {
this.gotoAndStop("attack");
this.attacking = true;
}
if (((this.midAttack && (guy.mc.pickups.hitTest(this._x + (this.width * this.dir), this._y, true))) && (!guy.invinsible)) || ((this.midAttack && (this.hitTest(guy.mc._x + (guy.width * (-this.dir)), guy.mc._y, true))) && (!guy.invinsible))) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
}
_root.strongZombiePlace = function () {
i = 0;
while (i < z) {
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._x = _root["strongzombie" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function newFlyingHead() {
flyinghead = attachMovie("flyinghead", "flyinghead" + z, z);
z++;
flyinghead._x = offScreen();
flyinghead._y = 50;
flyinghead.width = flyinghead._width / 2;
flyinghead.height = flyinghead._height / 2;
if (difficulty == 0) {
flyinghead.points = 15;
} else if (difficulty == 1) {
flyinghead.points = 30;
} else if (difficulty == 2) {
flyinghead.points = 60;
}
flyinghead.xspeed = 5;
flyinghead.yspeed = 0;
flyinghead.yaccel = 1;
if (difficulty == 0) {
flyinghead.health = 2;
} else if (difficulty == 1) {
flyinghead.health = 3;
} else if (difficulty == 2) {
flyinghead.health = 4;
}
flyinghead.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
flyinghead.invinsible = false;
flyinghead.dying = false;
flyinghead.attacking = false;
flyinghead.dir = Math.floor((Math.random() * 2) - 1);
if ((flyinghead.dir != 1) && (flyinghead.dir != -1)) {
flyinghead.dir = 1;
}
flyinghead.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["flyingHeadInvinsibleClearInterval" + FH] = setInterval(_root["flyingHeadInvinsibleClear" + FH], 500, this);
if (FH < 2) {
FH++;
} else {
FH = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (Stage.height + this.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if (!this.dying) {
_root.flyingHeadMove(this);
}
if (!this.dying) {
if (nearAmount(this._x, guy.mc._x, 100) && (this._y < (guy.mc._y - guy.height))) {
this.attacking = true;
this._y = this._y + 5;
} else if (this.attacking && (nearAmount(this._y, guy.mc._y, 75))) {
this.gotoAndStop("attack");
this.midAttack = true;
}
if (((this.midAttack && (nearAmount(this._x, guy.mc._x, 75))) && (nearAmount(this._y, guy.mc._y, 75))) && (!guy.invinsible)) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
if (((this.attacking == false) && (this._y > 50)) || ((!nearAmount(this._x, guy.mc._x, 100)) && (this._y > 50))) {
this.attacking = false;
this.midAttack = false;
this._y = this._y - 5;
}
if ((!this.attacking) && (this._y < 100)) {
this._y = this._y + 5;
}
if (((!this.attacking) && (this._y > 100)) || ((!nearAmount(this._x, guy.mc._x, 100)) && (this._y > 100))) {
this.attacking = false;
this.midAttack = false;
this._y = this._y - 5;
}
}
}
_root.flyingHeadPlace = function () {
i = 0;
while (i < z) {
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._x = _root["flyinghead" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function zombieMove(ob) {
ob.gotoAndStop("walk");
if (ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.dir = ob.dir * -1;
}
ob._xscale = -100 * ob.dir;
ob._x = ob._x + (ob.xspeed * ob.dir);
}
function strongZombieMove(ob) {
if (!ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.gotoAndStop("walk");
} else {
ob.gotoAndStop("idle");
}
if (guy.mc._x > ob._x) {
ob.dir = 1;
} else {
ob.dir = -1;
}
ob._xscale = -100 * ob.dir;
if (!ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob._x = ob._x + (ob.xspeed * ob.dir);
}
}
function flyingHeadMove(ob) {
if (!ob.attacking) {
ob.gotoAndStop("idle");
}
if (ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.dir = ob.dir * -1;
}
if ((Math.floor(Math.random() * 100) == 0) && (!ob.attacking)) {
ob.dir = ob.dir * -1;
}
ob._xscale = -100 * ob.dir;
ob._x = ob._x + (ob.xspeed * ob.dir);
}
function zombieInvinsibleClear0(ob) {
clearInterval(zombieInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function zombieInvinsibleClear1(ob) {
clearInterval(zombieInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function zombieInvinsibleClear2(ob) {
clearInterval(zombieInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear0(ob) {
clearInterval(strongZombieInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear1(ob) {
clearInterval(strongZombieInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear2(ob) {
clearInterval(strongZombieInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear0(ob) {
clearInterval(flyingHeadInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear1(ob) {
clearInterval(flyingHeadInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear2(ob) {
clearInterval(flyingHeadInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function newHealth() {
health = attachMovie("health", "health" + h, ++hd);
health.height = health._height / 2;
health.yspeed = 0;
health.yaccel = 1;
health._x = offScreen();
health.onEnterFrame = function () {
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (this.hitTest(guy.mc.pickups)) {
this.gotoAndStop("collect");
}
_root.healthPlace = function () {
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._x = _root["health" + i]._x - guy.xspeed;
}
i++;
}
};
};
h++;
}
function newGodmode() {
godmode = attachMovie("godmodepickup", "godmode" + h, ++hd);
godmode.height = godmode._height / 2;
godmode.yspeed = 0;
godmode.yaccel = 1;
godmode._x = offScreen();
godmode.onEnterFrame = function () {
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (this.hitTest(guy.mc.pickups)) {
this.gotoAndStop("collect");
}
_root.godmodePlace = function () {
i = 0;
while (i < h) {
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._x = _root["godmode" + i]._x - guy.xspeed;
}
i++;
}
};
};
h++;
}
function addSecond() {
if (!gamePaused) {
if (timebar.seconds < 59) {
timebar.seconds++;
} else if (timebar.seconds == 59) {
timebar.seconds = 0;
timebar.minutes++;
}
}
}
function checkKeys() {
if (((Key.isDown(37) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = 80;
guy.dir = 1;
} else if (((Key.isDown(39) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = -80;
guy.dir = -1;
}
if ((((Key.isDown(37) || (Key.isDown(39))) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest((guy.mc._x - (guy.width * guy.dir)) + guy.xspeed, guy.mc._y, true))) {
if ((!guy.attacking) || (guy.attacking && (guy.jumping))) {
if (Key.isDown(37) && (guy.xspeed > (-guy.xspeedmax))) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (Key.isDown(39) && (guy.xspeed < guy.xspeedmax)) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
} else if ((guy.attacking && (!guy.jumping)) && (!guy.transforming)) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
} else {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (Key.isDown(39) && (Key.isDown(37))) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (((((Math.abs(guy.xspeed) > 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("walk");
} else if (((((Math.abs(guy.xspeed) == 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("idle");
}
if (((((ground._x - ground.width) - guy.xspeed) <= 0) && (((ground._x + ground.width) - guy.xspeed) >= Stage.width)) && (nearAmount(guy.mc._x, Stage.width / 2, 10))) {
ground._x = ground._x - guy.xspeed;
zombiePlace();
strongZombiePlace();
flyingHeadPlace();
healthPlace();
godmodePlace();
} else {
guy.mc._x = guy.mc._x + guy.xspeed;
}
if (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
guy.jumping = true;
guy.yspeed = guy.yspeed + guy.yaccel;
} else if (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
while (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true)) {
guy.mc._y = guy.mc._y + 1;
}
guy.jumping = false;
guy.jumpspeed = 0;
guy.yspeed = 0;
}
while ((!guy.jumping) && (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) - 1, true))) {
guy.mc._y = guy.mc._y - 1;
}
if ((((((Key.isDown(32) || (Key.isDown(38))) && (checkKeyDown(32).keyLength <= 1)) && (checkKeyDown(38).keyLength <= 1)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.jumping = true;
guy.jumpspeed = guy.jumpspeed + guy.jumpstart;
guy.yspeed = guy.yspeed + guy.jumpspeed;
}
if (guy.jumpspeed > 0) {
guy.jumpspeed = guy.jumpspeed - guy.yaccel;
}
guy.mc._y = guy.mc._y + guy.yspeed;
if ((((guy.jumping && (guy.yspeed < 0)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("jump");
} else if ((((guy.jumping && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true))) {
guy.mc.gotoAndStop("fall");
}
if (((Key.isDown(90) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack");
guy.attacking = true;
}
if ((((Key.isDown(88) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.jumping)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack2");
guy.attacking2 = true;
}
if (guy.finishedAttacking) {
guy.finishedAttacking = false;
guy.attacking = false;
guy.attacking2 = false;
}
if (((((Key.isDown(67) && (!guy.godmode)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (guy.godmodeCollected == 4)) {
guy.godmode = true;
guy.transforming = true;
guy.mc.gotoAndStop("godmode");
if (godmodeTimerInterval == undefined) {
godmodeTimerInterval = setInterval(godmodeTimer, 2500);
}
}
if (guy.godmode) {
guy.invinsible = true;
}
while (guy.mc._y < (Stage.height - 200)) {
guy.mc._y = guy.mc._y + 5;
ground._y = ground._y + 5;
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._y = _root["zombie" + i]._y + 5;
}
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._y = _root["strongzombie" + i]._y + 5;
}
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._y = _root["flyinghead" + i]._y + 5;
}
i++;
}
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y + 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y + 5;
}
i++;
}
}
while (guy.mc._y > (Stage.height - 150)) {
guy.mc._y = guy.mc._y - 5;
ground._y = ground._y - 5;
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._y = _root["zombie" + i]._y - 5;
}
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._y = _root["strongzombie" + i]._y - 5;
}
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._y = _root["flyinghead" + i]._y - 5;
}
i++;
}
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y - 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y - 5;
}
i++;
}
}
}
function nearAmount(amount1, amount2, near) {
if ((amount1 > (amount2 - near)) && (amount1 < (amount2 + near))) {
return(true);
}
return(false);
}
function offScreen() {
int1 = (int2 = undefined);
min1 = (ground._x - ground.width) + 100;
max1 = 0;
min2 = Stage.width;
max2 = (ground._x + ground.width) - 100;
if (min1 < max1) {
int1 = (Math.random() * (max1 - min1)) + min1;
}
if (min2 < max2) {
int2 = (Math.random() * (max2 - min2)) + min2;
}
if ((int1 != undefined) && (int2 == undefined)) {
return(int1);
}
if ((int1 == undefined) && (int2 != undefined)) {
return(int2);
}
if ((int1 != undefined) && (int2 != undefined)) {
which = Math.floor(Math.random() * 2);
if (which == 0) {
return(int1);
}
return(int2);
}
}
function invinsibleBlink(ob, length) {
if (ib < length) {
ib++;
if ((ib / 2) == Math.round(ib / 2)) {
ob.mc._alpha = 30;
} else {
ob.mc._alpha = 100;
}
} else {
clearInterval(invinsibleBlinkInterval);
ib = 0;
ob.mc._alpha = 100;
ob.invinsible = false;
}
}
function watchKeyDown(key) {
if (keyListener != undefined) {
keyListener = undefined;
}
if (key != undefined) {
_root["keyListener" + key] = new Object();
keyListener = _root["keyListener" + key];
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
if (Key.isDown(key)) {
this.keyLength++;
}
};
keyListener.onKeyUp = function () {
if (Key.getCode() == key) {
this.keyLength = 0;
}
};
Key.addListener(keyListener);
} else {
keyListener = new Object();
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
this.keyLength++;
};
keyListener.onKeyUp = function () {
this.keyLength = 0;
};
Key.addListener(keyListener);
}
}
function checkKeyDown(key) {
if (_root["keyListener" + key] == undefined) {
return(false);
}
_root["return" + key] = new Object();
_root["return" + key].key = key;
if (Key.isDown(key)) {
_root["return" + key].keyLength = _root["keyListener" + key].keyLength;
} else {
_root["return" + key].keyLength = 0;
}
return(_root["return" + key]);
}
function godmodeTimer() {
if ((guy.godmodeCollected > 0) && (!gamePaused)) {
guy.godmodeCollected--;
} else if (guy.godmodeCollected == 0) {
clearInterval(godmodeTimerInterval);
godmodeTimerInterval = undefined;
godmodeRemoveInterval = setInterval(godmodeRemove, 1);
}
}
function godmodeRemove() {
if (((guy.godmode && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.godmode = false;
guy.transforming = true;
guy.invinsible = false;
guy.mc.gotoAndStop("godmode");
clearInterval(godmodeRemoveInterval);
}
}
function clearEverythingAndMoveOn(nextLvl, nextScrn) {
i = 0;
while (i < (h + z)) {
removeMovieClip(_root["zombie" + i]);
removeMovieClip(_root["strongzombie" + i]);
removeMovieClip(_root["flyinghead" + i]);
removeMovieClip(_root["health" + i]);
removeMovieClip(_root["godmode" + i]);
i++;
}
song.stop();
song = undefined;
gamePaused = false;
removeMovieClip(pauseMenu);
recordKills = (("Kills: " + guy.kills) + " / ") + killsNeeded;
recordPoints = "Points: " + guy.points;
recordTime = timebar.time_txt.text;
level5time = (timebar.minutes * 60) + timebar.seconds;
var _local3 = {kills:guy.kills, points:guy.points, time:level5time};
_global.level5 = _local3;
level5time = undefined;
removeMovieClip(guy.mc);
guy = undefined;
removeMovieClip(healthbar);
removeMovieClip(godmodebar);
removeMovieClip(pointsbar);
removeMovieClip(killsbar);
removeMovieClip(multiplierbar);
removeMovieClip(timebar);
clearInterval(addSecondInterval);
clearInterval(invinsibleBlinkInterval);
Key.removeListener(pauseKey);
if (nextLvl == undefined) {
nextLvl = "level6";
}
nextLevel = nextLvl;
lightning.play();
if (nextScrn != undefined) {
_root.gotoAndStop(nextScrn);
} else {
_root.gotoAndStop("levelTransition");
}
}
stop();
if (difficulty == 0) {
killsNeeded = 25;
}
if (difficulty == 1) {
killsNeeded = 30;
}
if (difficulty == 2) {
killsNeeded = 35;
}
gamePaused = false;
z = 0;
ib = 0;
h = 0;
hd = 1000;
Z = 0;
SZ = 0;
FH = 0;
pauseKey = new Object();
pauseKey.onKeyDown = function () {
if (Key.isDown(80)) {
if (!gamePaused) {
gamePaused = true;
} else {
gamePaused = false;
}
}
};
Key.addListener(pauseKey);
ground.width = ground._width / 2;
ground.height = ground._height / 2;
guy = {xspeed:0, yspeed:0, xspeedmax:10, xaccel:2, yspeedmax:20, yaccel:5, dir:1, jumping:false, jumpspeed:0, jumpstart:-40, attacking:false, attacking2:false, finishedAttacking:false, godmode:false, godmodeCollected:0, transforming:false, invinsible:false, health:4, points:0, kills:0, killsinarow:0, multiplier:1};
guy.mc = attachMovie("guy", "person", 1000);
guy.mc._xscale = (guy.mc._yscale = 80);
guy.height = guy.mc._height / 2;
guy.width = guy.mc._width / 2;
respawnGuy();
if (difficulty == 0) {
newZombie();
newStrongZombie();
newFlyingHead();
}
if (difficulty == 1) {
newZombie();
newZombie();
newStrongZombie();
newFlyingHead();
}
if (difficulty == 2) {
newZombie();
newZombie();
newStrongZombie();
newStrongZombie();
newFlyingHead();
newFlyingHead();
}
attachMovie("healthbar", "healthbar", 10000);
healthbar._x = 5;
healthbar._y = 5;
healthbar.onEnterFrame = function () {
if (guy.health > 0) {
this.gotoAndStop(guy.health);
} else if (guy.health <= 0) {
this.gotoAndStop(5);
clearEverythingAndMoveOn("menu", "gameover");
}
};
if (difficulty == 0) {
newHealth();
newHealth();
} else {
newHealth();
}
attachMovie("godmodebar", "godmodebar", 10001);
godmodebar._x = 5;
godmodebar._y = healthbar._height + 10;
godmodebar.onEnterFrame = function () {
if ((guy.godmodeCollected != 0) && (guy.godmodeCollected <= 4)) {
this.gotoAndStop(guy.godmodeCollected);
} else if (guy.godmodeCollected == 0) {
this.gotoAndStop(5);
} else if (guy.godmodeCollected > 4) {
this.gotoAndStop(4);
}
};
if (difficulty == 0) {
newGodmode();
newGodmode();
} else {
newGodmode();
}
attachMovie("timebar", "timebar", 10002);
timebar._x = (Stage.width / 2) - (timebar._width / 2);
timebar._y = 5;
timebar.minutes = 0;
timebar.seconds = 0;
addSecondInterval = setInterval(addSecond, 1000);
timebar.onEnterFrame = function () {
if ((this.minutes < 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes < 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":") + this.seconds;
}
};
_root.createEmptyMovieClip("multiplierbar", 10003);
multiplierbar._x = Stage.width / 2;
multiplierbar._y = Stage.height / 2;
multiplierbar.onEnterFrame = function () {
if (((guy.killsinarow >= 16) && (!multiplier.five)) && (difficulty == 2)) {
guy.multiplier = 5;
multiplier = multiplierbar.attachMovie("multiplier5", "multiplier", 100000);
multiplier.five = true;
} else if ((((guy.killsinarow >= 8) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 4;
multiplier = multiplierbar.attachMovie("multiplier4", "multiplier", 100000);
multiplier.four = true;
} else if (((((guy.killsinarow >= 4) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 3;
multiplier = multiplierbar.attachMovie("multiplier3", "multiplier", 100000);
multiplier.three = true;
} else if (((((guy.killsinarow >= 2) && (!multiplier.two)) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) {
guy.multiplier = 2;
multiplier = multiplierbar.attachMovie("multiplier2", "multiplier", 100000);
multiplier.two = true;
} else if (guy.killsinarow < 2) {
removeMovieClip(multiplier);
guy.multiplier = 1;
}
};
attachMovie("pointsbar", "pointsbar", 10004);
pointsbar._x = (Stage.width - pointsbar._width) - 5;
pointsbar._y = 5;
pointsbar.onEnterFrame = function () {
this.points_txt.text = guy.points;
};
attachMovie("killsbar", "killsbar", 10005);
killsbar._x = (Stage.width - killsbar._width) - 5;
killsbar._y = pointsbar._height + 10;
killsbar.onEnterFrame = function () {
this.kills_txt.text = (guy.kills + " / ") + killsNeeded;
if (guy.kills >= killsNeeded) {
clearEverythingAndMoveOn();
}
};
if (song != undefined) {
song.stop();
}
songMute = false;
song = new Sound();
song.attachSound("song1");
song.start();
song.onSoundComplete = function () {
song.start();
};
watchKeyDown(32);
watchKeyDown(38);
this.onEnterFrame = function () {
if (!gamePaused) {
checkKeys();
}
if (gamePaused && (pauseMenu == undefined)) {
attachMovie("pauseMenu", "pauseMenu", 10006);
pauseMenu.resume_mc.onRelease = function () {
gamePaused = false;
};
pauseMenu.mute_mc.onRelease = function () {
if (!songMute) {
song.setVolume(0);
songMute = true;
} else {
song.setVolume(100);
songMute = false;
}
};
pauseMenu.mainmenu_mc.onRelease = function () {
clearEverythingAndMoveOn("menu", "gameover");
};
} else if ((!gamePaused) && (pauseMenu != undefined)) {
removeMovieClip(pauseMenu);
}
};
Frame 25
function respawnGuy() {
guy.invinsible = true;
invinsibleBlinkInterval = setInterval(invinsibleBlink, 100, guy, 10);
guy.mc._x = Stage.width / 2;
if (guy.killsinarow > 0) {
guy.killsinarow = 0;
}
}
function bossInvinsibleClear(ob) {
clearInterval(bossInvinsibleClearInterval);
ob.mc._alpha = 100;
ob.invinsible = false;
}
function addSecond() {
if (!gamePaused) {
if (timebar.seconds < 59) {
timebar.seconds++;
} else if (timebar.seconds == 59) {
timebar.seconds = 0;
timebar.minutes++;
}
}
}
function checkKeys() {
if (((Key.isDown(37) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = 80;
guy.dir = 1;
} else if (((Key.isDown(39) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = -80;
guy.dir = -1;
}
if ((((Key.isDown(37) || (Key.isDown(39))) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest((guy.mc._x - (guy.width * guy.dir)) + guy.xspeed, guy.mc._y, true))) {
if ((!guy.attacking) || (guy.attacking && (guy.jumping))) {
if (Key.isDown(37) && (guy.xspeed > (-guy.xspeedmax))) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (Key.isDown(39) && (guy.xspeed < guy.xspeedmax)) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
} else if ((guy.attacking && (!guy.jumping)) && (!guy.transforming)) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
} else {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (Key.isDown(39) && (Key.isDown(37))) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (((((Math.abs(guy.xspeed) > 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("walk");
} else if (((((Math.abs(guy.xspeed) == 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("idle");
}
if (((((ground._x - ground.width) - guy.xspeed) <= 0) && (((ground._x + ground.width) - guy.xspeed) >= Stage.width)) && (nearAmount(guy.mc._x, Stage.width / 2, 10))) {
ground._x = ground._x - guy.xspeed;
healthPlace();
godmodePlace();
bossPlace();
testArea._x = testArea._x - guy.xspeed;
} else {
guy.mc._x = guy.mc._x + guy.xspeed;
}
if (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
guy.jumping = true;
guy.yspeed = guy.yspeed + guy.yaccel;
} else if (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
while (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true)) {
guy.mc._y = guy.mc._y + 1;
}
guy.jumping = false;
guy.jumpspeed = 0;
guy.yspeed = 0;
}
while ((!guy.jumping) && (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) - 1, true))) {
guy.mc._y = guy.mc._y - 1;
}
if ((((((Key.isDown(32) || (Key.isDown(38))) && (checkKeyDown(32).keyLength <= 1)) && (checkKeyDown(38).keyLength <= 1)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.jumping = true;
guy.jumpspeed = guy.jumpspeed + guy.jumpstart;
guy.yspeed = guy.yspeed + guy.jumpspeed;
}
if (guy.jumpspeed > 0) {
guy.jumpspeed = guy.jumpspeed - guy.yaccel;
}
guy.mc._y = guy.mc._y + guy.yspeed;
if ((((guy.jumping && (guy.yspeed < 0)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("jump");
} else if ((((guy.jumping && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true))) {
guy.mc.gotoAndStop("fall");
}
if (((Key.isDown(90) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack");
guy.attacking = true;
}
if ((((Key.isDown(88) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.jumping)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack2");
guy.attacking2 = true;
}
if (guy.finishedAttacking) {
guy.finishedAttacking = false;
guy.attacking = false;
guy.attacking2 = false;
}
if (((((Key.isDown(67) && (!guy.godmode)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (guy.godmodeCollected == 4)) {
guy.godmode = true;
guy.transforming = true;
guy.mc.gotoAndStop("godmode");
if (godmodeTimerInterval == undefined) {
godmodeTimerInterval = setInterval(godmodeTimer, 2500);
}
}
if (guy.godmode) {
guy.invinsible = true;
}
while (guy.mc._y < (Stage.height - 200)) {
guy.mc._y = guy.mc._y + 5;
ground._y = ground._y + 5;
testArea._y = testArea._y + 5;
boss.mc._y = boss.mc._y + 5;
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y + 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y + 5;
}
i++;
}
}
while (guy.mc._y > (Stage.height - 150)) {
guy.mc._y = guy.mc._y - 5;
ground._y = ground._y - 5;
testArea._y = testArea._y - 5;
boss.mc._y = boss.mc._y - 5;
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y - 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y - 5;
}
i++;
}
}
}
function nearAmount(amount1, amount2, near) {
if ((amount1 > (amount2 - near)) && (amount1 < (amount2 + near))) {
return(true);
}
return(false);
}
function offScreen() {
int1 = (int2 = undefined);
min1 = (ground._x - ground.width) + 100;
max1 = 0;
min2 = Stage.width;
max2 = (ground._x + ground.width) - 100;
if (min1 < max1) {
int1 = (Math.random() * (max1 - min1)) + min1;
}
if (min2 < max2) {
int2 = (Math.random() * (max2 - min2)) + min2;
}
if ((int1 != undefined) && (int2 == undefined)) {
return(int1);
}
if ((int1 == undefined) && (int2 != undefined)) {
return(int2);
}
if ((int1 != undefined) && (int2 != undefined)) {
which = Math.floor(Math.random() * 2);
if (which == 0) {
return(int1);
}
return(int2);
}
}
function invinsibleBlink(ob, length) {
if (ib < length) {
ib++;
if ((ib / 2) == Math.round(ib / 2)) {
ob.mc._alpha = 30;
} else {
ob.mc._alpha = 100;
}
} else {
clearInterval(invinsibleBlinkInterval);
ib = 0;
ob.mc._alpha = 100;
ob.invinsible = false;
}
}
function watchKeyDown(key) {
if (keyListener != undefined) {
keyListener = undefined;
}
if (key != undefined) {
_root["keyListener" + key] = new Object();
keyListener = _root["keyListener" + key];
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
if (Key.isDown(key)) {
this.keyLength++;
}
};
keyListener.onKeyUp = function () {
if (Key.getCode() == key) {
this.keyLength = 0;
}
};
Key.addListener(keyListener);
} else {
keyListener = new Object();
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
this.keyLength++;
};
keyListener.onKeyUp = function () {
this.keyLength = 0;
};
Key.addListener(keyListener);
}
}
function checkKeyDown(key) {
if (_root["keyListener" + key] == undefined) {
return(false);
}
_root["return" + key] = new Object();
_root["return" + key].key = key;
if (Key.isDown(key)) {
_root["return" + key].keyLength = _root["keyListener" + key].keyLength;
} else {
_root["return" + key].keyLength = 0;
}
return(_root["return" + key]);
}
function godmodeTimer() {
if ((guy.godmodeCollected > 0) && (!gamePaused)) {
guy.godmodeCollected--;
} else if (guy.godmodeCollected == 0) {
clearInterval(godmodeTimerInterval);
godmodeTimerInterval = undefined;
godmodeRemoveInterval = setInterval(godmodeRemove, 1);
}
}
function godmodeRemove() {
if (((guy.godmode && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.godmode = false;
guy.transforming = true;
guy.invinsible = false;
guy.mc.gotoAndStop("godmode");
clearInterval(godmodeRemoveInterval);
}
}
function clearEverythingAndMoveOn(nextLvl, nextScrn) {
i = 0;
while (i < (h + z)) {
removeMovieClip(_root["zombie" + i]);
removeMovieClip(_root["strongzombie" + i]);
removeMovieClip(_root["flyinghead" + i]);
removeMovieClip(_root["health" + i]);
removeMovieClip(_root["godmode" + i]);
i++;
}
song.stop();
song = undefined;
gamePaused = false;
removeMovieClip(pauseMenu);
recordKills = (("Kills: " + guy.kills) + " / ") + killsNeeded;
recordPoints = "Points: " + guy.points;
recordTime = timebar.time_txt.text;
level6time = (timebar.minutes * 60) + timebar.seconds;
var _local3 = {kills:guy.kills, points:guy.points, time:level6time};
_global.level6 = _local3;
level6time = undefined;
removeMovieClip(guy.mc);
guy = undefined;
removeMovieClip(boss.mc);
boss = undefined;
removeMovieClip(healthbar);
removeMovieClip(godmodebar);
removeMovieClip(pointsbar);
removeMovieClip(killsbar);
removeMovieClip(multiplierbar);
removeMovieClip(timebar);
clearInterval(addSecondInterval);
clearInterval(invinsibleBlinkInterval);
Key.removeListener(pauseKey);
if (nextLvl == undefined) {
nextLvl = "sendscore";
}
nextLevel = nextLvl;
lightning.play();
if (nextScrn != undefined) {
_root.gotoAndStop(nextScrn);
} else {
_root.gotoAndStop("levelTransition");
}
}
stop();
killsNeeded = 1;
gamePaused = false;
z = 0;
ib = 0;
h = 0;
hd = 1000;
pauseKey = new Object();
pauseKey.onKeyDown = function () {
if (Key.isDown(80)) {
if (!gamePaused) {
gamePaused = true;
} else {
gamePaused = false;
}
}
};
Key.addListener(pauseKey);
ground.width = ground._width / 2;
ground.height = ground._height / 2;
guy = {xspeed:0, yspeed:0, xspeedmax:10, xaccel:2, yspeedmax:20, yaccel:5, dir:1, jumping:false, jumpspeed:0, jumpstart:-40, attacking:false, attacking2:false, finishedAttacking:false, godmode:false, godmodeCollected:0, transforming:false, invinsible:false, health:4, points:0, kills:0, killsinarow:0, multiplier:1};
guy.mc = attachMovie("guy", "person", 1000);
guy.mc._xscale = (guy.mc._yscale = 80);
guy.height = guy.mc._height / 2;
guy.width = guy.mc._width / 2;
respawnGuy();
boss = {found:true, attacking:false, attacking2:false, dying:false, invinsible:false, yspeed:0, yaccel:1, attacking:false, attacking2:false, finishedAttacking:false, attackPatternPosition:0, pattern:0, charging:false, dir:-1};
boss.attackPattern = [3, 0, 2, 0, 3, 0, 2, 2, 0];
if (difficulty == 0) {
boss.health = 5;
boss.points = 500;
} else if (difficulty == 1) {
boss.health = 6;
boss.points = 1000;
} else if (difficulty == 2) {
boss.health = 7;
boss.points = 2000;
}
boss.mc = attachMovie("rob", "enemy", ++z);
boss.height = (boss.mc._height / 2) - boss.mc.healthbar._height;
boss.width = boss.mc._width / 2;
boss.mc._x = (ground._x + ground.width) - 200;
boss.mc.healthbar.onEnterFrame = function () {
this.gotoAndStop(boss.health);
};
boss.idle = function () {
boss.midAttack = false;
boss.charging = false;
boss.mc.gotoAndStop("idle");
};
boss.attack = function () {
boss.charging = false;
boss.attacking = true;
boss.mc.gotoAndStop("attack");
};
boss.attack2 = function () {
boss.charging = false;
boss.attacking2 = true;
boss.mc.gotoAndStop("attack2");
};
boss.charge = function () {
boss.charging = true;
boss.mc.gotoAndStop("walk");
};
boss.shockwave = function () {
boss.wave = boss.mc.attachMovie("shockwave", "shockwave" + z, ++z);
boss.wave._y = boss.height - boss.mc.healthbar._height;
boss.wave.onEnterFrame = function () {
if (guy.mc.pickups.hitTest(this) && (!guy.invinsible)) {
guy.health--;
respawnGuy();
}
};
};
boss.mc.onEnterFrame = function () {
if (!gamePaused) {
if (!ground.hitTest(this._x, (this._y + boss.height) + boss.yspeed, true)) {
boss.yspeed = boss.yspeed + boss.yaccel;
} else if (ground.hitTest(this._x, (this._y + boss.height) + boss.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + boss.height) + 1, true)) {
this._y = this._y + 1;
}
boss.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + boss.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + boss.yspeed;
_root.bossPlace = function () {
boss.mc._x = boss.mc._x - guy.xspeed;
};
if (boss.found) {
boss.attackPatternPosition++;
if (((boss.attackPatternPosition / 50) == Math.round(boss.attackPatternPosition / 50)) && (!boss.dying)) {
boss.pattern = boss.attackPattern[(boss.attackPatternPosition / 50) - 1];
if (boss.pattern == 0) {
boss.idle();
}
if (boss.pattern == 1) {
boss.attack();
}
if (boss.pattern == 2) {
boss.attack2();
}
if (boss.pattern == 3) {
boss.charge();
}
if ((boss.attackPatternPosition / 50) == boss.attackPattern.length) {
boss.attackPatternPosition = 0;
}
}
if (((!boss.charging) && (!boss.attacking)) && (!boss.attacking2)) {
if (boss.mc._x > guy.mc._x) {
boss.dir = -1;
} else {
boss.dir = 1;
}
boss.mc._xscale = 100 * (-boss.dir);
}
if (boss.charging && (!ground.hitTest((boss.mc._x + (boss.width * boss.dir)) + (10 * boss.dir), boss.mc._y - boss.height, true))) {
boss.mc._x = boss.mc._x + (10 * boss.dir);
}
if (boss.finishedAttacking) {
boss.midAttack = false;
boss.finishedAttacking = false;
boss.attacking = false;
boss.attacking2 = false;
boss.charging = false;
boss.idle();
}
if ((((guy.mc.hitTest(this._x + (boss.width * boss.dir), this._y, true) && (!boss.attacking)) && (!boss.attacking2)) && (!boss.charging)) && (!boss.dying)) {
boss.attack();
boss.midAttack = true;
}
if (((boss.midAttack && (guy.mc.pickups.hitTest(this._x + (boss.width * boss.dir), this._y, true))) && (!guy.invinsible)) || ((boss.midAttack && (this.hitTest(guy.mc._x + (guy.width * (-boss.dir)), guy.mc._y, true))) && (!guy.invinsible))) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.xspeed = guy.xspeed + (20 * boss.dir);
guy.yspeed = guy.yspeed - 30;
guy.health--;
respawnGuy();
}
if (((boss.charging && (guy.mc.pickups.hitTest(this._x + (boss.width * boss.dir), this._y, true))) && (!guy.invinsible)) || ((boss.charging && (this.hitTest(guy.mc._x + (guy.width * (-boss.dir)), guy.mc._y, true))) && (!guy.invinsible))) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!boss.invinsible)) {
if (guy.godmode) {
boss.health = boss.health - 2;
} else {
boss.health--;
}
boss.invinsible = true;
this._alpha = 60;
bossInvinsibleClearInterval = setInterval(bossInvinsibleClear, 500, boss);
}
}
if (boss.health <= 0) {
this.gotoAndStop("die");
boss.attacking = false;
boss.attacking2 = false;
boss.charging = false;
boss.dying = true;
}
}
if (boss.dead) {
guy.kills++;
guy.points = guy.points + boss.points;
}
}
};
attachMovie("healthbar", "healthbar", 10000);
healthbar._x = 5;
healthbar._y = 5;
healthbar.onEnterFrame = function () {
if (guy.health > 0) {
this.gotoAndStop(guy.health);
} else if (guy.health <= 0) {
this.gotoAndStop(5);
clearEverythingAndMoveOn("menu", "gameover");
}
};
attachMovie("godmodebar", "godmodebar", 10001);
godmodebar._x = 5;
godmodebar._y = healthbar._height + 10;
godmodebar.onEnterFrame = function () {
if ((guy.godmodeCollected != 0) && (guy.godmodeCollected <= 4)) {
this.gotoAndStop(guy.godmodeCollected);
} else if (guy.godmodeCollected == 0) {
this.gotoAndStop(5);
} else if (guy.godmodeCollected > 4) {
this.gotoAndStop(4);
}
};
attachMovie("timebar", "timebar", 10002);
timebar._x = (Stage.width / 2) - (timebar._width / 2);
timebar._y = 5;
timebar.minutes = 0;
timebar.seconds = 0;
addSecondInterval = setInterval(addSecond, 1000);
timebar.onEnterFrame = function () {
if ((this.minutes < 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes < 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":") + this.seconds;
}
};
_root.createEmptyMovieClip("multiplierbar", 10003);
multiplierbar._x = Stage.width / 2;
multiplierbar._y = Stage.height / 2;
multiplierbar.onEnterFrame = function () {
if (((guy.killsinarow >= 16) && (!multiplier.five)) && (difficulty == 2)) {
guy.multiplier = 5;
multiplier = multiplierbar.attachMovie("multiplier5", "multiplier", 100000);
multiplier.five = true;
} else if ((((guy.killsinarow >= 8) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 4;
multiplier = multiplierbar.attachMovie("multiplier4", "multiplier", 100000);
multiplier.four = true;
} else if (((((guy.killsinarow >= 4) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 3;
multiplier = multiplierbar.attachMovie("multiplier3", "multiplier", 100000);
multiplier.three = true;
} else if (((((guy.killsinarow >= 2) && (!multiplier.two)) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) {
guy.multiplier = 2;
multiplier = multiplierbar.attachMovie("multiplier2", "multiplier", 100000);
multiplier.two = true;
} else if (guy.killsinarow < 2) {
removeMovieClip(multiplier);
guy.multiplier = 1;
}
};
attachMovie("pointsbar", "pointsbar", 10004);
pointsbar._x = (Stage.width - pointsbar._width) - 5;
pointsbar._y = 5;
pointsbar.onEnterFrame = function () {
this.points_txt.text = guy.points;
};
attachMovie("killsbar", "killsbar", 10005);
killsbar._x = (Stage.width - killsbar._width) - 5;
killsbar._y = pointsbar._height + 10;
killsbar.onEnterFrame = function () {
this.kills_txt.text = (guy.kills + " / ") + killsNeeded;
if (guy.kills >= killsNeeded) {
clearEverythingAndMoveOn();
}
};
if (song != undefined) {
song.stop();
}
songMute = false;
song = new Sound();
song.attachSound("song3");
song.start();
song.onSoundComplete = function () {
song.start();
};
watchKeyDown(32);
watchKeyDown(38);
this.onEnterFrame = function () {
if (!gamePaused) {
checkKeys();
}
if (gamePaused && (pauseMenu == undefined)) {
attachMovie("pauseMenu", "pauseMenu", 10006);
pauseMenu.resume_mc.onRelease = function () {
gamePaused = false;
};
pauseMenu.mute_mc.onRelease = function () {
if (!songMute) {
song.setVolume(0);
songMute = true;
} else {
song.setVolume(100);
songMute = false;
}
};
pauseMenu.mainmenu_mc.onRelease = function () {
clearEverythingAndMoveOn("menu", "gameover");
};
} else if ((!gamePaused) && (pauseMenu != undefined)) {
removeMovieClip(pauseMenu);
}
};
Frame 26
function respawnGuy() {
guy.invinsible = true;
invinsibleBlinkInterval = setInterval(invinsibleBlink, 100, guy, 10);
guy.mc._x = Stage.width / 2;
if (guy.killsinarow > 0) {
guy.killsinarow = 0;
}
}
function newZombie() {
zombie = attachMovie("zombie", "zombie" + z, z);
z++;
zombie._x = offScreen();
zombie.width = zombie._width / 2;
zombie.height = (zombie._height / 2) - zombie.healthbar._height;
if (difficulty == 0) {
zombie.points = 5;
} else if (difficulty == 1) {
zombie.points = 10;
} else if (difficulty == 2) {
zombie.points = 20;
}
zombie.xspeed = 5;
zombie.yspeed = 0;
zombie.yaccel = 1;
if (difficulty == 0) {
zombie.health = 1;
} else if (difficulty == 1) {
zombie.health = 2;
} else if (difficulty == 2) {
zombie.health = 3;
}
zombie.invinsible = false;
zombie.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
zombie.dying = false;
zombie.attacking = false;
zombie.midAttack = false;
zombie.dir = Math.floor((Math.random() * 2) - 1);
if ((zombie.dir != 1) && (zombie.dir != -1)) {
zombie.dir = 1;
}
zombie.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["zombieInvinsibleClearInterval" + Z] = setInterval(_root["zombieInvinsibleClear" + Z], 500, this);
if (Z < 2) {
Z++;
} else {
Z = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (ground._y + ground.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if ((!this.dying) && (!this.attacking)) {
_root.zombieMove(this);
}
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if ((guy.mc.hitTest((this._x + (this.width * this.dir)) + (this.xspeed * this.dir), this._y, true) && (!this.attacking)) && (!this.dying)) {
this.gotoAndStop("attack");
this.attacking = true;
}
if ((this.midAttack && (guy.mc.pickups.hitTest(this._x + (this.width * this.dir), this._y, true))) && (!guy.invinsible)) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
}
_root.zombiePlace = function () {
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._x = _root["zombie" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function newStrongZombie() {
strongzombie = attachMovie("strongzombie", "strongzombie" + z, z);
z++;
strongzombie._x = offScreen();
strongzombie.width = strongzombie._width / 2;
strongzombie.height = (strongzombie._height / 2) - strongzombie.healthbar._height;
if (difficulty == 0) {
strongzombie.points = 25;
} else if (difficulty == 1) {
strongzombie.points = 50;
} else if (difficulty == 2) {
strongzombie.points = 100;
}
strongzombie.xspeed = 5;
strongzombie.yspeed = 0;
strongzombie.yaccel = 1;
if (difficulty == 0) {
strongzombie.health = 3;
} else if (difficulty == 1) {
strongzombie.health = 4;
} else if (difficulty == 2) {
strongzombie.health = 5;
}
strongzombie.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
strongzombie.invincible = false;
strongzombie.dying = false;
strongzombie.attacking = false;
strongzombie.midAttack = false;
strongzombie.dir = Math.floor((Math.random() * 2) - 1);
if ((strongzombie.dir != 1) && (strongzombie.dir != -1)) {
strongzombie.dir = 1;
}
strongzombie.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["strongZombieInvinsibleClearInterval" + SZ] = setInterval(_root["strongZombieInvinsibleClear" + SZ], 500, this);
if (SZ < 2) {
SZ++;
} else {
SZ = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (ground._y + ground.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if ((!this.dying) && (!this.attacking)) {
_root.strongZombieMove(this);
}
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (((guy.mc.hitTest(this._x + (this.width * this.dir), this._y, true) && (!this.attacking)) && (!this.dying)) || ((guy.mc.hitTest(this) && (!this.attacking)) && (!this.dying))) {
this.gotoAndStop("attack");
this.attacking = true;
}
if (((this.midAttack && (guy.mc.pickups.hitTest(this._x + (this.width * this.dir), this._y, true))) && (!guy.invinsible)) || ((this.midAttack && (this.hitTest(guy.mc._x + (guy.width * (-this.dir)), guy.mc._y, true))) && (!guy.invinsible))) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
}
_root.strongZombiePlace = function () {
i = 0;
while (i < z) {
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._x = _root["strongzombie" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function newFlyingHead() {
flyinghead = attachMovie("flyinghead", "flyinghead" + z, z);
z++;
flyinghead._x = offScreen();
flyinghead._y = 50;
flyinghead.width = flyinghead._width / 2;
flyinghead.height = flyinghead._height / 2;
if (difficulty == 0) {
flyinghead.points = 15;
} else if (difficulty == 1) {
flyinghead.points = 30;
} else if (difficulty == 2) {
flyinghead.points = 60;
}
flyinghead.xspeed = 5;
flyinghead.yspeed = 0;
flyinghead.yaccel = 1;
if (difficulty == 0) {
flyinghead.health = 2;
} else if (difficulty == 1) {
flyinghead.health = 3;
} else if (difficulty == 2) {
flyinghead.health = 4;
}
flyinghead.healthbar.onEnterFrame = function () {
this.gotoAndStop(this._parent.health);
};
flyinghead.invinsible = false;
flyinghead.dying = false;
flyinghead.attacking = false;
flyinghead.dir = Math.floor((Math.random() * 2) - 1);
if ((flyinghead.dir != 1) && (flyinghead.dir != -1)) {
flyinghead.dir = 1;
}
flyinghead.onEnterFrame = function () {
if (!gamePaused) {
if (guy.attacking || (guy.attacking2)) {
if (this.hitTest(guy.mc.guy.guitar) && (!this.invinsible)) {
if (guy.godmode) {
this.health = this.health - 2;
} else {
this.health--;
}
this.invinsible = true;
this._alpha = 60;
_root["flyingHeadInvinsibleClearInterval" + FH] = setInterval(_root["flyingHeadInvinsibleClear" + FH], 500, this);
if (FH < 2) {
FH++;
} else {
FH = 0;
}
}
}
if (this.health <= 0) {
this.gotoAndStop("die");
this.dying = true;
}
if (this._y > (Stage.height + this.height)) {
this.gotoAndStop("die");
this.dying = true;
}
if (!this.dying) {
_root.flyingHeadMove(this);
}
if (!this.dying) {
if (nearAmount(this._x, guy.mc._x, 100) && (this._y < (guy.mc._y - guy.height))) {
this.attacking = true;
this._y = this._y + 5;
} else if (this.attacking && (nearAmount(this._y, guy.mc._y, 75))) {
this.gotoAndStop("attack");
this.midAttack = true;
}
if (((this.midAttack && (nearAmount(this._x, guy.mc._x, 75))) && (nearAmount(this._y, guy.mc._y, 75))) && (!guy.invinsible)) {
if (guy.attacking || (guy.attacking2)) {
guy.finishedAttacking = true;
}
guy.health--;
respawnGuy();
}
if (((this.attacking == false) && (this._y > 50)) || ((!nearAmount(this._x, guy.mc._x, 100)) && (this._y > 50))) {
this.attacking = false;
this.midAttack = false;
this._y = this._y - 5;
}
if ((!this.attacking) && (this._y < 100)) {
this._y = this._y + 5;
}
if (((!this.attacking) && (this._y > 100)) || ((!nearAmount(this._x, guy.mc._x, 100)) && (this._y > 100))) {
this.attacking = false;
this.midAttack = false;
this._y = this._y - 5;
}
}
}
_root.flyingHeadPlace = function () {
i = 0;
while (i < z) {
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._x = _root["flyinghead" + i]._x - guy.xspeed;
}
i++;
}
};
};
}
function zombieMove(ob) {
ob.gotoAndStop("walk");
if (ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.dir = ob.dir * -1;
}
ob._xscale = -100 * ob.dir;
ob._x = ob._x + (ob.xspeed * ob.dir);
}
function strongZombieMove(ob) {
if (!ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.gotoAndStop("walk");
} else {
ob.gotoAndStop("idle");
}
if (guy.mc._x > ob._x) {
ob.dir = 1;
} else {
ob.dir = -1;
}
ob._xscale = -100 * ob.dir;
if (!ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob._x = ob._x + (ob.xspeed * ob.dir);
}
}
function flyingHeadMove(ob) {
if (!ob.attacking) {
ob.gotoAndStop("idle");
}
if (ground.hitTest((ob._x + (ob.width * ob.dir)) + (ob.xspeed * ob.dir), ob._y, true)) {
ob.dir = ob.dir * -1;
}
if ((Math.floor(Math.random() * 100) == 0) && (!ob.attacking)) {
ob.dir = ob.dir * -1;
}
ob._xscale = -100 * ob.dir;
ob._x = ob._x + (ob.xspeed * ob.dir);
}
function zombieInvinsibleClear0(ob) {
clearInterval(zombieInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function zombieInvinsibleClear1(ob) {
clearInterval(zombieInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function zombieInvinsibleClear2(ob) {
clearInterval(zombieInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear0(ob) {
clearInterval(strongZombieInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear1(ob) {
clearInterval(strongZombieInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function strongZombieInvinsibleClear2(ob) {
clearInterval(strongZombieInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear0(ob) {
clearInterval(flyingHeadInvinsibleClearInterval0);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear1(ob) {
clearInterval(flyingHeadInvinsibleClearInterval1);
ob._alpha = 100;
ob.invinsible = false;
}
function flyingHeadInvinsibleClear2(ob) {
clearInterval(flyingHeadInvinsibleClearInterval2);
ob._alpha = 100;
ob.invinsible = false;
}
function newHealth() {
health = attachMovie("health", "health" + h, ++hd);
health.height = health._height / 2;
health.yspeed = 0;
health.yaccel = 1;
health._x = offScreen();
health.onEnterFrame = function () {
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (this.hitTest(guy.mc.pickups)) {
this.gotoAndStop("collect");
}
_root.healthPlace = function () {
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._x = _root["health" + i]._x - guy.xspeed;
}
i++;
}
};
};
h++;
}
function newGodmode() {
godmode = attachMovie("godmodepickup", "godmode" + h, ++hd);
godmode.height = godmode._height / 2;
godmode.yspeed = 0;
godmode.yaccel = 1;
godmode._x = offScreen();
godmode.onEnterFrame = function () {
if (!ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
this.yspeed = this.yspeed + this.yaccel;
} else if (ground.hitTest(this._x, (this._y + this.height) + this.yspeed, true)) {
while (!ground.hitTest(this._x, (this._y + this.height) + 1, true)) {
this._y = this._y + 1;
}
this.yspeed = 0;
}
while (ground.hitTest(this._x, (this._y + this.height) - 1, true)) {
this._y = this._y - 1;
}
this._y = this._y + this.yspeed;
if (this.hitTest(guy.mc.pickups)) {
this.gotoAndStop("collect");
}
_root.godmodePlace = function () {
i = 0;
while (i < h) {
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._x = _root["godmode" + i]._x - guy.xspeed;
}
i++;
}
};
};
h++;
}
function addSecond() {
if (!gamePaused) {
if (timebar.seconds < 59) {
timebar.seconds++;
} else if (timebar.seconds == 59) {
timebar.seconds = 0;
timebar.minutes++;
}
}
}
function checkKeys() {
if (((Key.isDown(37) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = 80;
guy.dir = 1;
} else if (((Key.isDown(39) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc._xscale = -80;
guy.dir = -1;
}
if ((((Key.isDown(37) || (Key.isDown(39))) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest((guy.mc._x - (guy.width * guy.dir)) + guy.xspeed, guy.mc._y, true))) {
if ((!guy.attacking) || (guy.attacking && (guy.jumping))) {
if (Key.isDown(37) && (guy.xspeed > (-guy.xspeedmax))) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (Key.isDown(39) && (guy.xspeed < guy.xspeedmax)) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
} else if ((guy.attacking && (!guy.jumping)) && (!guy.transforming)) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
} else {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (Key.isDown(39) && (Key.isDown(37))) {
if (guy.xspeed > 0) {
guy.xspeed = guy.xspeed - guy.xaccel;
}
if (guy.xspeed < 0) {
guy.xspeed = guy.xspeed + guy.xaccel;
}
}
if (((((Math.abs(guy.xspeed) > 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("walk");
} else if (((((Math.abs(guy.xspeed) == 0) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("idle");
}
if (((((ground._x - ground.width) - guy.xspeed) <= 0) && (((ground._x + ground.width) - guy.xspeed) >= Stage.width)) && (nearAmount(guy.mc._x, Stage.width / 2, 10))) {
ground._x = ground._x - guy.xspeed;
zombiePlace();
strongZombiePlace();
flyingHeadPlace();
healthPlace();
godmodePlace();
} else {
guy.mc._x = guy.mc._x + guy.xspeed;
}
if (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
guy.jumping = true;
guy.yspeed = guy.yspeed + guy.yaccel;
} else if (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + guy.yspeed, true)) {
while (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true)) {
guy.mc._y = guy.mc._y + 1;
}
guy.jumping = false;
guy.jumpspeed = 0;
guy.yspeed = 0;
}
while ((!guy.jumping) && (ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) - 1, true))) {
guy.mc._y = guy.mc._y - 1;
}
if ((((((Key.isDown(32) || (Key.isDown(38))) && (checkKeyDown(32).keyLength <= 1)) && (checkKeyDown(38).keyLength <= 1)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.jumping = true;
guy.jumpspeed = guy.jumpspeed + guy.jumpstart;
guy.yspeed = guy.yspeed + guy.jumpspeed;
}
if (guy.jumpspeed > 0) {
guy.jumpspeed = guy.jumpspeed - guy.yaccel;
}
guy.mc._y = guy.mc._y + guy.yspeed;
if ((((guy.jumping && (guy.yspeed < 0)) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("jump");
} else if ((((guy.jumping && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) && (!ground.hitTest(guy.mc._x, (guy.mc._y + guy.height) + 1, true))) {
guy.mc.gotoAndStop("fall");
}
if (((Key.isDown(90) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack");
guy.attacking = true;
}
if ((((Key.isDown(88) && (!guy.attacking)) && (!guy.attacking2)) && (!guy.jumping)) && (!guy.transforming)) {
guy.mc.gotoAndStop("attack2");
guy.attacking2 = true;
}
if (guy.finishedAttacking) {
guy.finishedAttacking = false;
guy.attacking = false;
guy.attacking2 = false;
}
if (((((Key.isDown(67) && (!guy.godmode)) && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) && (guy.godmodeCollected == 4)) {
guy.godmode = true;
guy.transforming = true;
guy.mc.gotoAndStop("godmode");
if (godmodeTimerInterval == undefined) {
godmodeTimerInterval = setInterval(godmodeTimer, 2500);
}
}
if (guy.godmode) {
guy.invinsible = true;
}
while (guy.mc._y < (Stage.height - 200)) {
guy.mc._y = guy.mc._y + 5;
ground._y = ground._y + 5;
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._y = _root["zombie" + i]._y + 5;
}
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._y = _root["strongzombie" + i]._y + 5;
}
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._y = _root["flyinghead" + i]._y + 5;
}
i++;
}
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y + 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y + 5;
}
i++;
}
}
while (guy.mc._y > (Stage.height - 150)) {
guy.mc._y = guy.mc._y - 5;
ground._y = ground._y - 5;
i = 0;
while (i < z) {
if (_root["zombie" + i] != undefined) {
_root["zombie" + i]._y = _root["zombie" + i]._y - 5;
}
if (_root["strongzombie" + i] != undefined) {
_root["strongzombie" + i]._y = _root["strongzombie" + i]._y - 5;
}
if (_root["flyinghead" + i] != undefined) {
_root["flyinghead" + i]._y = _root["flyinghead" + i]._y - 5;
}
i++;
}
i = 0;
while (i < h) {
if (_root["health" + i] != undefined) {
_root["health" + i]._y = _root["health" + i]._y - 5;
}
if (_root["godmode" + i] != undefined) {
_root["godmode" + i]._y = _root["godmode" + i]._y - 5;
}
i++;
}
}
}
function nearAmount(amount1, amount2, near) {
if ((amount1 > (amount2 - near)) && (amount1 < (amount2 + near))) {
return(true);
}
return(false);
}
function offScreen() {
int1 = (int2 = undefined);
min1 = (ground._x - ground.width) + 100;
max1 = 0;
min2 = Stage.width;
max2 = (ground._x + ground.width) - 100;
if (min1 < max1) {
int1 = (Math.random() * (max1 - min1)) + min1;
}
if (min2 < max2) {
int2 = (Math.random() * (max2 - min2)) + min2;
}
if ((int1 != undefined) && (int2 == undefined)) {
return(int1);
}
if ((int1 == undefined) && (int2 != undefined)) {
return(int2);
}
if ((int1 != undefined) && (int2 != undefined)) {
which = Math.floor(Math.random() * 2);
if (which == 0) {
return(int1);
}
return(int2);
}
}
function invinsibleBlink(ob, length) {
if (ib < length) {
ib++;
if ((ib / 2) == Math.round(ib / 2)) {
ob.mc._alpha = 30;
} else {
ob.mc._alpha = 100;
}
} else {
clearInterval(invinsibleBlinkInterval);
ib = 0;
ob.mc._alpha = 100;
ob.invinsible = false;
}
}
function watchKeyDown(key) {
if (keyListener != undefined) {
keyListener = undefined;
}
if (key != undefined) {
_root["keyListener" + key] = new Object();
keyListener = _root["keyListener" + key];
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
if (Key.isDown(key)) {
this.keyLength++;
}
};
keyListener.onKeyUp = function () {
if (Key.getCode() == key) {
this.keyLength = 0;
}
};
Key.addListener(keyListener);
} else {
keyListener = new Object();
keyListener.keyLength = 0;
keyListener.onKeyDown = function () {
this.keyLength++;
};
keyListener.onKeyUp = function () {
this.keyLength = 0;
};
Key.addListener(keyListener);
}
}
function checkKeyDown(key) {
if (_root["keyListener" + key] == undefined) {
return(false);
}
_root["return" + key] = new Object();
_root["return" + key].key = key;
if (Key.isDown(key)) {
_root["return" + key].keyLength = _root["keyListener" + key].keyLength;
} else {
_root["return" + key].keyLength = 0;
}
return(_root["return" + key]);
}
function godmodeTimer() {
if ((guy.godmodeCollected > 0) && (!gamePaused)) {
guy.godmodeCollected--;
} else if (guy.godmodeCollected == 0) {
clearInterval(godmodeTimerInterval);
godmodeTimerInterval = undefined;
godmodeRemoveInterval = setInterval(godmodeRemove, 1);
}
}
function godmodeRemove() {
if (((guy.godmode && (!guy.jumping)) && (!guy.attacking)) && (!guy.attacking2)) {
guy.godmode = false;
guy.transforming = true;
guy.invinsible = false;
guy.mc.gotoAndStop("godmode");
clearInterval(godmodeRemoveInterval);
}
}
function clearEverythingAndMoveOn(nextLvl, nextScrn) {
i = 0;
while (i < (h + z)) {
removeMovieClip(_root["zombie" + i]);
removeMovieClip(_root["strongzombie" + i]);
removeMovieClip(_root["flyinghead" + i]);
removeMovieClip(_root["health" + i]);
removeMovieClip(_root["godmode" + i]);
i++;
}
song.stop();
song = undefined;
gamePaused = false;
removeMovieClip(pauseMenu);
recordKills = (("Kills: " + guy.kills) + " / ") + killsNeeded;
recordPoints = "Points: " + guy.points;
recordTime = timebar.time_txt.text;
level6time = (timebar.minutes * 60) + timebar.seconds;
var _local3 = {kills:guy.kills, points:guy.points, time:level6time};
_global.level6 = _local3;
level6time = undefined;
removeMovieClip(guy.mc);
guy = undefined;
removeMovieClip(boss.mc);
boss = undefined;
removeMovieClip(healthbar);
removeMovieClip(godmodebar);
removeMovieClip(pointsbar);
removeMovieClip(killsbar);
removeMovieClip(multiplierbar);
removeMovieClip(timebar);
clearInterval(addSecondInterval);
clearInterval(invinsibleBlinkInterval);
Key.removeListener(pauseKey);
if (nextLvl == undefined) {
nextLvl = "sendscore";
}
nextLevel = nextLvl;
lightning.play();
if (nextScrn != undefined) {
_root.gotoAndStop(nextScrn);
} else {
_root.gotoAndStop("levelTransition");
}
}
stop();
gamePaused = false;
z = 0;
ib = 0;
h = 0;
hd = 1000;
Z = 0;
SZ = 0;
FH = 0;
pauseKey = new Object();
pauseKey.onKeyDown = function () {
if (Key.isDown(80)) {
if (!gamePaused) {
gamePaused = true;
} else {
gamePaused = false;
}
}
};
Key.addListener(pauseKey);
ground.width = ground._width / 2;
ground.height = ground._height / 2;
guy = {xspeed:0, yspeed:0, xspeedmax:10, xaccel:2, yspeedmax:20, yaccel:5, dir:1, jumping:false, jumpspeed:0, jumpstart:-40, attacking:false, attacking2:false, finishedAttacking:false, godmode:false, godmodeCollected:0, transforming:false, invinsible:false, health:4, points:0, kills:0, killsinarow:0, multiplier:1};
guy.mc = attachMovie("guy", "person", 1000);
guy.mc._xscale = (guy.mc._yscale = 80);
guy.height = guy.mc._height / 2;
guy.width = guy.mc._width / 2;
respawnGuy();
newZombie();
newZombie();
newStrongZombie();
newStrongZombie();
newFlyingHead();
newFlyingHead();
attachMovie("healthbar", "healthbar", 10000);
healthbar._x = 5;
healthbar._y = 5;
healthbar.onEnterFrame = function () {
if (guy.health > 0) {
this.gotoAndStop(guy.health);
} else if (guy.health <= 0) {
this.gotoAndStop(5);
clearEverythingAndMoveOn();
}
};
if (difficulty == 0) {
newHealth();
newHealth();
} else {
newHealth();
}
attachMovie("godmodebar", "godmodebar", 10001);
godmodebar._x = 5;
godmodebar._y = healthbar._height + 10;
godmodebar.onEnterFrame = function () {
if ((guy.godmodeCollected != 0) && (guy.godmodeCollected <= 4)) {
this.gotoAndStop(guy.godmodeCollected);
} else if (guy.godmodeCollected == 0) {
this.gotoAndStop(5);
} else if (guy.godmodeCollected > 4) {
this.gotoAndStop(4);
}
};
if (difficulty == 0) {
newGodmode();
newGodmode();
} else {
newGodmode();
}
attachMovie("timebar", "timebar", 10002);
timebar._x = (Stage.width / 2) - (timebar._width / 2);
timebar._y = 5;
timebar.minutes = 0;
timebar.seconds = 0;
addSecondInterval = setInterval(addSecond, 1000);
timebar.onEnterFrame = function () {
if ((this.minutes < 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes < 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: 0" + this.minutes) + ":") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds < 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":0") + this.seconds;
} else if ((this.minutes >= 10) && (this.seconds >= 10)) {
this.time_txt.text = (("Time: " + this.minutes) + ":") + this.seconds;
}
};
_root.createEmptyMovieClip("multiplierbar", 10003);
multiplierbar._x = Stage.width / 2;
multiplierbar._y = Stage.height / 2;
multiplierbar.onEnterFrame = function () {
if (((guy.killsinarow >= 16) && (!multiplier.five)) && (difficulty == 2)) {
guy.multiplier = 5;
multiplier = multiplierbar.attachMovie("multiplier5", "multiplier", 100000);
multiplier.five = true;
} else if ((((guy.killsinarow >= 8) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 4;
multiplier = multiplierbar.attachMovie("multiplier4", "multiplier", 100000);
multiplier.four = true;
} else if (((((guy.killsinarow >= 4) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) && (difficulty >= 1)) {
guy.multiplier = 3;
multiplier = multiplierbar.attachMovie("multiplier3", "multiplier", 100000);
multiplier.three = true;
} else if (((((guy.killsinarow >= 2) && (!multiplier.two)) && (!multiplier.three)) && (!multiplier.four)) && (!multiplier.five)) {
guy.multiplier = 2;
multiplier = multiplierbar.attachMovie("multiplier2", "multiplier", 100000);
multiplier.two = true;
} else if (guy.killsinarow < 2) {
removeMovieClip(multiplier);
guy.multiplier = 1;
}
};
attachMovie("pointsbar", "pointsbar", 10004);
pointsbar._x = (Stage.width - pointsbar._width) - 5;
pointsbar._y = 5;
pointsbar.onEnterFrame = function () {
this.points_txt.text = guy.points;
};
attachMovie("killsbar", "killsbar", 10005);
killsbar._x = (Stage.width - killsbar._width) - 5;
killsbar._y = pointsbar._height + 10;
killsbar.onEnterFrame = function () {
this.kills_txt.text = guy.kills;
};
if (song != undefined) {
song.stop();
}
songMute = false;
song = new Sound();
song.attachSound("song1");
song.start();
song.onSoundComplete = function () {
song.start();
};
watchKeyDown(32);
watchKeyDown(38);
this.onEnterFrame = function () {
if (!gamePaused) {
checkKeys();
}
if (gamePaused && (pauseMenu == undefined)) {
attachMovie("pauseMenu", "pauseMenu", 10006);
pauseMenu.resume_mc.onRelease = function () {
gamePaused = false;
};
pauseMenu.mute_mc.onRelease = function () {
if (!songMute) {
song.setVolume(0);
songMute = true;
} else {
song.setVolume(100);
songMute = false;
}
};
pauseMenu.mainmenu_mc.onRelease = function () {
clearEverythingAndMoveOn("menu", "gameover2");
};
} else if ((!gamePaused) && (pauseMenu != undefined)) {
removeMovieClip(pauseMenu);
}
};
Frame 27
stop();
songMute = false;
song = new Sound();
song.attachSound("songMenu");
song.start();
song.onSoundComplete = function () {
song.start();
};
kills_txt.text = recordKills;
time_txt.text = recordTime;
points_txt.text = recordPoints;
continue_mc.onRollOver = function () {
this.gotoAndStop("over");
};
continue_mc.onRollOut = function () {
this.gotoAndStop("up");
};
continue_mc.onRelease = function () {
lightning.play();
gotoAndStop(nextLevel);
};
Frame 28
stop();
kills_txt.text = recordKills;
time_txt.text = recordTime;
points_txt.text = recordPoints;
continue_mc.onRollOver = function () {
this.gotoAndStop("over");
};
continue_mc.onRollOut = function () {
this.gotoAndStop("up");
};
continue_mc.onRelease = function () {
lightning.play();
gotoAndStop(nextLevel);
};
Frame 29
stop();
kills_txt.text = "Kills: " + recordKills;
time_txt.text = "Time: " + recordTime;
points_txt.text = "Points: " + recordPoints;
continue_mc.onRollOver = function () {
this.gotoAndStop("over");
};
continue_mc.onRollOut = function () {
this.gotoAndStop("up");
};
continue_mc.onRelease = function () {
lightning.play();
gotoAndStop(nextLevel);
};
Frame 30
function __rankz_send__(par1, par2, par3, par4) {
par227 = new LoadVars();
par228 = new LoadVars();
par227.flashkey = par2;
par227.SU0249 = par1;
par227.bmFtZTE = ab3.rankz.Armor_Bot_30_En_AS1.Encode(par3);
par227.c2NvcmUx = ab3.rankz.Armor_Bot_30_En_AS1.Encode(par4 + "j%e%a%n%s");
par227.flashkey = par227.flashkey.split("=").join("");
par227.SU0249 = par227.SU0249.split("=").join("");
par228.onLoad = function (success) {
if (success) {
trace(par228.msg);
} else {
trace(par228.loaded);
}
};
par227.sendAndLoad("http://rankz.armorbot.com/submit/", par228, "POST");
}
stop();
recordKills = "Kills: " + Number(((((level1.kills + level2.kills) + level3.kills) + level4.kills) + level5.kills) + level6.kills);
points = Number(((((level1.points + level2.points) + level3.points) + level4.points) + level5.points) + level6.points);
recordPoints = "Points: " + points;
time = Number(((((level1.time + level2.time) + level3.time) + level4.time) + level5.time) + level6.time);
minutes = Math.floor(time / 60);
seconds = time - (minutes * 60);
if (minutes < 10) {
minutes = "0" + minutes;
}
if (seconds < 10) {
seconds = "0" + seconds;
}
recordTime = (("Time: " + minutes) + ":") + seconds;
time = undefined;
minutes = undefined;
seconds = undefined;
if (points == "NaN") {
trace("It's NaN");
}
kills_txt.text = recordKills;
time_txt.text = recordTime;
points_txt.text = recordPoints;
continue_mc.onRollOver = function () {
this.gotoAndStop("over");
};
continue_mc.onRollOut = function () {
this.gotoAndStop("up");
};
continue_mc.onRelease = function () {
lightning.play();
gotoAndStop ("menu");
};
sendscore_mc.onRelease = function () {
bXlnYW1lX25hbWVfdmFyaWFibGU = name_txt.text;
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = points;
__rankz_send__("MTg0OGolZSVhJW4lcw==", "bHBiQ3dZdWY=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
lightning.play();
gotoAndStop ("menu");
};
Frame 31
function __rankz_send__(par1, par2, par3, par4) {
par227 = new LoadVars();
par228 = new LoadVars();
par227.flashkey = par2;
par227.SU0249 = par1;
par227.bmFtZTE = ab3.rankz.Armor_Bot_30_En_AS1.Encode(par3);
par227.c2NvcmUx = ab3.rankz.Armor_Bot_30_En_AS1.Encode(par4 + "j%e%a%n%s");
par227.flashkey = par227.flashkey.split("=").join("");
par227.SU0249 = par227.SU0249.split("=").join("");
par228.onLoad = function (success) {
if (success) {
trace(par228.msg);
} else {
trace(par228.loaded);
}
};
par227.sendAndLoad("http://rankz.armorbot.com/submit/", par228, "POST");
}
stop();
kills = recordKills;
recordKills = "Kills: " + kills;
points = recordPoints;
recordPoints = "Points: " + points;
time = recordTime;
minutes = Math.floor(time / 60);
seconds = time - (minutes * 60);
if (minutes < 10) {
minutes = "0" + minutes;
}
if (seconds < 10) {
seconds = "0" + seconds;
}
recordTime = (("Time: " + minutes) + ":") + seconds;
time = undefined;
minutes = undefined;
seconds = undefined;
kills = undefined;
if (points == "NaN") {
trace("It's NaN");
}
kills_txt.text = recordKills;
time_txt.text = recordTime;
points_txt.text = recordPoints;
continue_mc.onRollOver = function () {
this.gotoAndStop("over");
};
continue_mc.onRollOut = function () {
this.gotoAndStop("up");
};
continue_mc.onRelease = function () {
lightning.play();
gotoAndStop ("menu");
};
sendscore_mc.onRelease = function () {
bXlnYW1lX25hbWVfdmFyaWFibGU = name_txt.text;
bXlnYW1lX3Njb3JlX3ZhcmlhYmxl = points;
__rankz_send__("MTg0OGolZSVhJW4lcw==", "bHBiQ3dZdWY=", bXlnYW1lX25hbWVfdmFyaWFibGU, bXlnYW1lX3Njb3JlX3ZhcmlhYmxl);
lightning.play();
gotoAndStop ("menu");
getURL ("http://rankz.armorbot.com/zombiekilladventure", "_blank");
};
Symbol 10 MovieClip [shockwave] Frame 10
removeMovieClip(this);
Symbol 14 MovieClip Frame 15
stop();
if (_root.guy.health < 4) {
_root.guy.health++;
}
_root.newHealth();
removeMovieClip(this);
Symbol 15 MovieClip [health] Frame 1
stop();
Symbol 19 MovieClip Frame 15
stop();
if (_root.guy.godmodeCollected < 4) {
_root.guy.godmodeCollected++;
}
_root.newGodmode();
removeMovieClip(this);
Symbol 20 MovieClip [godmodepickup] Frame 1
stop();
Symbol 24 MovieClip [multiplier5] Frame 20
stop();
Symbol 27 MovieClip [multiplier4] Frame 20
stop();
Symbol 30 MovieClip [multiplier3] Frame 20
stop();
Symbol 33 MovieClip [multiplier2] Frame 20
stop();
Symbol 516 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.gotoAndStop(3);
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 517 MovieClip [__Packages.ab3.rankz.Armor_Bot_30_En_AS1] Frame 0
class ab3.rankz.Armor_Bot_30_En_AS1 extends Object
{
static var _CharsReverseLookup;
var _Armor_Bot_30_En_AS1Str, _Armor_Bot_30_En_AS1Count;
function Armor_Bot_30_En_AS1 () {
super();
}
static function Encode(str) {
var _local1 = new ab3.rankz.Armor_Bot_30_En_AS1();
return(_local1.encodeArmor_Bot_30_En_AS1(str));
}
static function Decode(str) {
var _local1 = new ab3.rankz.Armor_Bot_30_En_AS1();
return(_local1.decodeArmor_Bot_30_En_AS1(str));
}
static function StringReplaceAll(source, find, replacement) {
return(source.split(find).join(replacement));
}
static function InitReverseChars() {
_CharsReverseLookup = new Array();
var _local1 = 0;
while (_local1 < _Chars.length) {
_CharsReverseLookup[_Chars[_local1]] = _local1;
_local1++;
}
return(true);
}
static function UrlDecode(str) {
str = StringReplaceAll(str, "\\", " ");
str = unescape(str);
return(str);
}
static function UrlEncode(str) {
str = escape(str);
str = StringReplaceAll(str, "\\", "%2B");
str = StringReplaceAll(str, "%20", "+");
return(str);
}
function setArmor_Bot_30_En_AS1Str(str) {
_Armor_Bot_30_En_AS1Str = str;
_Armor_Bot_30_En_AS1Count = 0;
}
function readArmor_Bot_30_En_AS1() {
if (!_Armor_Bot_30_En_AS1Str) {
return(_EndOfInput);
}
if (_Armor_Bot_30_En_AS1Count >= _Armor_Bot_30_En_AS1Str.length) {
return(_EndOfInput);
}
var _local2 = _Armor_Bot_30_En_AS1Str.charCodeAt(_Armor_Bot_30_En_AS1Count) & 255;
_Armor_Bot_30_En_AS1Count++;
return(_local2);
}
function encodeArmor_Bot_30_En_AS1(str) {
setArmor_Bot_30_En_AS1Str(str);
var _local3 = "";
var _local2 = new Array(3);
var _local5 = 0;
var _local4 = false;
while ((!_local4) && (((_local2[0] = readArmor_Bot_30_En_AS1())) != _EndOfInput)) {
_local2[1] = readArmor_Bot_30_En_AS1();
_local2[2] = readArmor_Bot_30_En_AS1();
_local3 = _local3 + _Chars[_local2[0] >> 2];
if (_local2[1] != _EndOfInput) {
_local3 = _local3 + _Chars[((_local2[0] << 4) & 48) | (_local2[1] >> 4)];
if (_local2[2] != _EndOfInput) {
_local3 = _local3 + _Chars[((_local2[1] << 2) & 60) | (_local2[2] >> 6)];
_local3 = _local3 + _Chars[_local2[2] & 63];
} else {
_local3 = _local3 + _Chars[(_local2[1] << 2) & 60];
_local3 = _local3 + "=";
_local4 = true;
}
} else {
_local3 = _local3 + _Chars[(_local2[0] << 4) & 48];
_local3 = _local3 + "=";
_local3 = _local3 + "=";
_local4 = true;
}
_local5 = _local5 + 4;
if (_local5 >= 76) {
_local3 = _local3 + newline;
_local5 = 0;
}
}
return(_local3);
}
function readReverseArmor_Bot_30_En_AS1() {
if (!_Armor_Bot_30_En_AS1Str) {
return(_EndOfInput);
}
while (true) {
if (_Armor_Bot_30_En_AS1Count >= _Armor_Bot_30_En_AS1Str.length) {
return(_EndOfInput);
}
var _local2 = _Armor_Bot_30_En_AS1Str.charAt(_Armor_Bot_30_En_AS1Count);
_Armor_Bot_30_En_AS1Count++;
if (_CharsReverseLookup[_local2]) {
return(_CharsReverseLookup[_local2]);
}
if (_local2 == "A") {
return(0);
}
}
}
function ntos(n) {
var _local1 = n.toString(16);
if (_local1.length == 1) {
_local1 = "0" + _local1;
}
_local1 = "%" + _local1;
return(unescape(_local1));
}
function decodeArmor_Bot_30_En_AS1(str) {
setArmor_Bot_30_En_AS1Str(str);
var _local3 = "";
var _local2 = new Array(4);
var _local4 = false;
while (((!_local4) && (((_local2[0] = readReverseArmor_Bot_30_En_AS1())) != _EndOfInput)) && (((_local2[1] = readReverseArmor_Bot_30_En_AS1())) != _EndOfInput)) {
_local2[2] = readReverseArmor_Bot_30_En_AS1();
_local2[3] = readReverseArmor_Bot_30_En_AS1();
_local3 = _local3 + ntos(((_local2[0] << 2) & 255) | (_local2[1] >> 4));
if (_local2[2] != _EndOfInput) {
_local3 = _local3 + ntos(((_local2[1] << 4) & 255) | (_local2[2] >> 2));
if (_local2[3] != _EndOfInput) {
_local3 = _local3 + ntos(((_local2[2] << 6) & 255) | _local2[3]);
} else {
_local4 = true;
}
} else {
_local4 = true;
}
}
return(_local3);
}
function toHex(n) {
var _local4 = "";
var _local3 = true;
var _local1 = 32;
while (_local1 > 0) {
_local1 = _local1 - 4;
var _local2 = (n >> _local1) & 15;
if ((!_local3) || (_local2 != 0)) {
_local3 = false;
_local4 = _local4 + _Digits[_local2];
}
}
return(((_local4 == "") ? "0" : (_local4)));
}
function pad(str, len, pad) {
var _local2 = str;
var _local1 = str.length;
while (_local1 < len) {
_local2 = pad + _local2;
_local1++;
}
return(_local2);
}
function encodeHex(str) {
var _local4 = "";
var _local2 = 0;
while (_local2 < str.length) {
_local4 = _local4 + pad(toHex(str.charCodeAt(_local2) & 255), 2, "0");
_local2++;
}
return(_local4);
}
function decodeHex(str) {
var _local5 = "";
var _local3 = "";
var _local2 = 0;
while (_local2 < str.length) {
_local3 = _local3 + str.charAt(_local2);
if (_local3.length == 2) {
_local5 = _local5 + ntos(parseInt("0x" + _local3));
_local3 = "";
}
_local2++;
}
return(_local5);
}
static var _EndOfInput = -1;
static var _Chars = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/");
static var _CharsReverseLookupInited = InitReverseChars();
static var _Digits = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
}
Symbol 46 MovieClip Frame 1
stop();
Symbol 59 MovieClip Frame 10
_root.boss.finishedAttacking = true;
Symbol 63 MovieClip Frame 12
_root.boss.shockwave();
Symbol 63 MovieClip Frame 25
_root.boss.finishedAttacking = true;
Symbol 64 MovieClip Frame 140
stop();
_root.boss.dead = true;
Symbol 65 MovieClip [rob] Frame 1
stop();
Symbol 92 MovieClip Frame 11
_parent.midAttack = true;
Symbol 92 MovieClip Frame 18
stop();
_parent.attacking = false;
_parent.midAttack = false;
Symbol 100 MovieClip Frame 7
stop();
Symbol 105 MovieClip Frame 29
stop();
this.onEnterFrame = function () {
if (this._alpha > 0) {
this._alpha = this._alpha - 5;
} else {
_root.guy.points = _root.guy.points + (this._parent.points * _root.guy.multiplier);
_root.guy.kills++;
_root.guy.killsinarow++;
_root.newStrongZombie();
removeMovieClip(this._parent);
}
};
Symbol 106 MovieClip [strongzombie] Frame 1
stop();
Symbol 129 MovieClip Frame 17
_parent.midAttack = true;
Symbol 129 MovieClip Frame 25
stop();
_parent.attacking = false;
_parent.midAttack = false;
Symbol 140 MovieClip Frame 18
stop();
this.onEnterFrame = function () {
if (this._alpha > 0) {
this._alpha = this._alpha - 5;
} else {
_root.guy.points = _root.guy.points + (this._parent.points * _root.guy.multiplier);
_root.guy.kills++;
_root.guy.killsinarow++;
_root.newZombie();
removeMovieClip(this._parent);
}
};
Symbol 141 MovieClip [zombie] Frame 1
stop();
Symbol 148 MovieClip Frame 1
stop();
Symbol 220 MovieClip Frame 5
stop();
Symbol 250 MovieClip Frame 10
_root.guy.finishedAttacking = true;
Symbol 252 MovieClip Frame 24
_root.guy.finishedAttacking = true;
Symbol 281 MovieClip Frame 15
position = _root.song.position;
_root.song.stop();
_root.song.attachSound("song2");
_root.song.start(position / 1000);
Symbol 281 MovieClip Frame 27
newX = _root.guy.mc._x;
newY = _root.guy.mc._y;
_root.guy.transforming = false;
_root.guy.godmode = true;
_root.guy.mc = _root.attachMovie("godmode", "person", 1000, {_x:newX, _y:newY, _xscale:80 * _root.guy.dir, _yscale:80});
Symbol 282 MovieClip [guy] Frame 1
stop();
Symbol 312 MovieClip Frame 10
stop();
Symbol 325 MovieClip Frame 15
_root.guy.finishedAttacking = true;
Symbol 348 MovieClip Frame 28
_root.guy.finishedAttacking = true;
Symbol 359 MovieClip Frame 4
position = _root.song.position;
_root.song.stop();
_root.song.attachSound("song1");
_root.song.start(position / 1000);
Symbol 359 MovieClip Frame 11
newX = _root.guy.mc._x;
newY = _root.guy.mc._y;
_root.guy.transforming = false;
_root.guy.mc = _root.attachMovie("guy", "person", 1000, {_x:newX, _y:newY, _xscale:80 * _root.guy.dir, _yscale:80});
Symbol 360 MovieClip [godmode] Frame 1
stop();
Symbol 381 MovieClip Frame 10
stop();
_parent.attacking = false;
Symbol 384 MovieClip Frame 10
stop();
this.onEnterFrame = function () {
if (this._alpha > 0) {
this._alpha = this._alpha - 5;
} else {
_root.guy.points = _root.guy.points + (this._parent.points * _root.guy.multiplier);
_root.guy.kills++;
_root.guy.killsinarow++;
_root.newFlyingHead();
removeMovieClip(this._parent);
}
};
Symbol 385 MovieClip [flyinghead] Frame 1
stop();
Symbol 416 MovieClip Frame 10
stop();
Symbol 421 MovieClip Frame 1
stop();
Symbol 423 MovieClip Frame 1
stop();
Symbol 425 MovieClip Frame 1
stop();
Symbol 428 MovieClip Frame 1
stop();
Symbol 432 MovieClip Frame 1
stop();
Symbol 435 MovieClip Frame 1
stop();
Symbol 438 MovieClip Frame 1
stop();
Symbol 443 MovieClip Frame 1
stop();