Frame 1
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
copyrightNotice.separatorBefore = true;
myMenu.customItems.push(mySiteLink, copyrightNotice);
_root.menu = myMenu;
six.onPress = function () {
getURL ("http://www.playhub.com/?utm_medium=brandedgames_external&utm_campaign=argh_zombies&utm_source=domain.com&utm_content=ingame", "_blank");
};
Frame 2
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded / bytes_total;
_root.loadBar._width = getPercent * 100;
_root.loadText = Math.round(getPercent * 100) + "%";
if (bytes_loaded == bytes_total) {
_root.gotoAndPlay(5);
}
Frame 3
gotoAndPlay (2);
Frame 5
stop();
stopAllSounds();
score = 0;
db.onRelease = function () {
_root._quality = "LOW";
nextFrame();
};
zb.onRelease = function () {
_root._quality = "MEDIUM";
nextFrame();
};
kb.onRelease = function () {
_root._quality = "HIGH";
nextFrame();
};
db.onEnterFrame = function () {
if (this.hitTest(_xmouse, _ymouse, true)) {
_root._quality = "LOW";
this.gotoAndStop("over");
} else {
_root._quality = "HIGH";
this.gotoAndStop("up");
}
};
zb.onEnterFrame = function () {
if (this.hitTest(_xmouse, _ymouse, true)) {
_root._quality = "MEDIUM";
this.gotoAndStop("over");
} else {
_root._quality = "HIGH";
this.gotoAndStop("up");
}
};
kb.onEnterFrame = function () {
if (this.hitTest(_xmouse, _ymouse, true)) {
_root._quality = "HIGH";
this.gotoAndStop("over");
} else {
this.gotoAndStop("up");
}
};
Frame 6
logo.onPress = function () {
getURL ("http://www.xdgames.co.uk", "_blank");
};
sound_contr._alpha = 0;
qualityControl._alpha = 0;
Frame 7
stop();
pb.onRelease = function () {
gotoAndStop ("ints");
};
sub.onRelease = function () {
getURL ("http://www.playhub.com/?utm_medium=brandedgames_external&utm_campaign=argh_zombies&utm_source=domain.com&utm_content=ingame", "_blank");
};
Frame 8
prevFrame();
Frame 9
stop();
moveOn.onRelease = function () {
nextFrame();
};
Frame 10
stopAllSounds();
play();
Frame 13
function removeall() {
removeShot();
removeDepths();
removeDead_body();
removePounds();
removeType();
removeHypArray();
removeEnemyHealth();
removeDamagedTimer();
removeHit();
removeEnemyAttackingTimer();
removeEnemyAttacking();
removeEnemy();
}
function shotActions() {
if (shooting) {
if ((shootingTimer + reloadTime) < getTimer()) {
shootingTimer = getTimer();
shot_sound.start();
ammo--;
if (bulletType == 2) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
if (bulletType == 1) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
if (bulletType == 0) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
}
}
i = shot.length - 1;
while (i >= 0) {
j = enemy.length - 1;
while (j >= 0) {
if (shot[i].hitTest(enemy[j])) {
if (bulletType == 2) {
if (type[j] == 0) {
enemyHealth[j] = -1;
}
if (type[j] == 1) {
enemyHealth[j] = enemyHealth[j] - (bulletPower * 2);
randomNumber++;
blood_mc = _root.attachMovie("blood", "blood" + randomNumber, _root.getNextHighestDepth(), {_x:shot[i]._x, _y:shot[i]._y});
blood_mc._xscale = enemy[i]._xscale;
}
}
if (bulletType == 1) {
if (type[j] == 0) {
enemyHealth[j] = -1;
}
if (type[j] == 1) {
enemyHealth[j] = enemyHealth[j] - (bulletPower * 2);
randomNumber++;
blood_mc = _root.attachMovie("blood", "blood" + randomNumber, _root.getNextHighestDepth(), {_x:shot[i]._x, _y:shot[i]._y});
blood_mc._xscale = enemy[i]._xscale;
}
}
if (bulletType == 0) {
enemyHealth[j] = enemyHealth[j] - bulletPower;
randomNumber++;
blood_mc = _root.attachMovie("blood", "blood" + randomNumber, _root.getNextHighestDepth(), {_x:shot[i]._x, _y:shot[i]._y});
blood_mc._xscale = enemy[i]._xscale;
}
shot[i].removeMovieClip();
shot.splice(i, 1);
dir.splice(i, 1);
}
j--;
}
if ((shot[i]._x > 640) or (shot[i]._x < 0)) {
shot[i].removeMovieClip();
shot.splice(i, 1);
dir.splice(i, 1);
}
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1916.9) {
if (player._x > 410) {
shot[i]._x = shot[i]._x - 5;
}
}
}
i--;
}
}
function removeShot() {
i = shot.length - 1;
while (i >= 0) {
shot[i].removeMovieClip();
shot.splice(i, 1);
i--;
}
}
function removeDepths() {
i = depths.length - 1;
while (i >= 0) {
depths[i].removeMovieClip();
depths.splice(i, 1);
i--;
}
}
function removeDead_body() {
i = dead_body.length - 1;
while (i >= 0) {
dead_body[i].removeMovieClip();
dead_body.splice(i, 1);
i--;
}
}
function removePounds() {
i = pounds.length - 1;
while (i >= 0) {
pounds[i].removeMovieClip();
pounds.splice(i, 1);
i--;
}
}
function removeType() {
i = type.length - 1;
while (i >= 0) {
type[i].removeMovieClip();
type.splice(i, 1);
i--;
}
}
function removeHypArray() {
i = hypArray.length - 1;
while (i >= 0) {
hypArray[i].removeMovieClip();
hypArray.splice(i, 1);
i--;
}
}
function removeEnemyHealth() {
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth[i].removeMovieClip();
enemyHealth.splice(i, 1);
i--;
}
}
function removeDamagedTimer() {
i = damagedTimer.length - 1;
while (i >= 0) {
damagedTimer[i].removeMovieClip();
damagedTimer.splice(i, 1);
i--;
}
}
function removeHit() {
i = hit.length - 1;
while (i >= 0) {
hit[i].removeMovieClip();
hit.splice(i, 1);
i--;
}
}
function removeEnemyAttackingTimer() {
i = enemyAttackingTimer.length - 1;
while (i >= 0) {
enemyAttackingTimer[i].removeMovieClip();
enemyAttackingTimer.splice(i, 1);
i--;
}
}
function removeEnemyAttacking() {
i = enemyAttacking.length - 1;
while (i >= 0) {
enemyAttacking[i].removeMovieClip();
enemyAttacking.splice(i, 1);
i--;
}
}
function removeEnemy() {
i = enemy.length - 1;
while (i >= 0) {
enemy[i].removeMovieClip();
enemy.splice(i, 1);
i--;
}
}
function waveActions() {
if (distance == 4) {
if (addBoss == 0) {
addBoss = 1;
enemy_ = _root.attachMovie("boss", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:-100});
depths.push(enemy_);
enemy.push(enemy_);
type.push(1);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 50) + 0);
enemyHealth.push(80);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
}
if (distance < 6) {
if (markWave < 0) {
if (player._x < 410) {
if (yesGo == 0) {
distance++;
_root.attachMovie("gogo", "gogo", _root.getNextHighestDepth());
}
yesGo = 1;
canGo = true;
}
}
}
if (steps > 130) {
gogo.removeMovieClip();
yesGo = 0;
canGo = false;
markWave = 7;
steps = 0;
}
}
function addenemy() {
if (enemyNumber < 3) {
if ((releaseenemy + releNum) < getTimer()) {
releaseenemy = getTimer();
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("scout", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:700});
} else {
enemy_ = _root.attachMovie("scout", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(0);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(2);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
if ((pplKilled > 21) && (pplKilled < 41)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy1", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy1", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(1);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(20);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 41) && (pplKilled < 61)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(2);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(40);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 61) && (pplKilled < 81)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("nii2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("nii2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(3);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(70);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 81) && (pplKilled < 101)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy4", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy4", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(4);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(60);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
}
}
}
function collectCash() {
i = pounds.length - 1;
while (i >= 0) {
if (pounds[i].hitTest(player)) {
ammo = ammo + 10;
zombiereload_sound.start();
pounds[i].removeMovieClip();
pounds.splice(i, 1);
depths.splice(i, 1);
}
i--;
}
}
function swapdepths() {
i = depths.length - 1;
while (i >= 0) {
if (player._y < depths[i]._y) {
depths[i].swapDepths(_root.getNextHighestDepth());
}
if (player._y > depths[i]._y) {
player.swapDepths(_root.getNextHighestDepth());
}
i--;
}
}
function pushPounds() {
i = pounds.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1916.9) {
if (player._x > 410) {
pounds[i]._x = pounds[i]._x - 5;
}
}
}
i--;
}
}
function pushEnemy() {
i = enemy.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1916.9) {
if (player._x > 410) {
enemy[i]._x = enemy[i]._x - 5;
}
}
}
i--;
}
}
function pushDeadbody() {
i = dead_body.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1916.9) {
if (player._x > 410) {
dead_body[i]._x = dead_body[i]._x - 5;
}
}
}
i--;
}
}
function calculateHyp() {
i = enemy.length - 1;
while (i >= 0) {
dist_x = player._x - enemy[i]._x;
dist_y = player._y - enemy[i]._y;
hypArray[i] = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
i--;
}
}
function enemyHealthReachesZero() {
i = enemy.length - 1;
while (i >= 0) {
if (enemyHealth[i] < 1) {
score = score + 10;
randomNumber++;
_root.attachMovie("plusTen", "plusTen" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
if (bulletType == 0) {
if (ammo < 50) {
choice = Math.round(Math.random() * 5) + 0;
if (choice == 0) {
randomNumber++;
cash = _root.attachMovie("ammo_mc", "money" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
depths.push(cash);
pounds.push(cash);
}
}
}
if (hit[i] == 1) {
randomNumber++;
if (type[i] == 0) {
deadbod2 = _root.attachMovie("scoutDead", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (type[i] == 1) {
deadbod2 = _root.attachMovie("bossDead", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (hit[i] == 0) {
if (type[i] == 0) {
randomNumber++;
if (bulletType == 0) {
deadbod2 = _root.attachMovie("scoutDead", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 1) {
deadbod2 = _root.attachMovie("fireScoutDead", "fireScoutDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 2) {
deadbod2 = _root.attachMovie("boomDead", "boomDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 1) {
randomNumber++;
if (bulletType == 0) {
deadbod2 = _root.attachMovie("bossDead", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 1) {
deadbod2 = _root.attachMovie("fireScoutDead", "fireScoutDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 2) {
deadbod2 = _root.attachMovie("boomDead", "boomDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
}
if (type[i] == 2) {
randomNumber++;
deadbod2 = _root.attachMovie("e2d", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 3) {
randomNumber++;
deadbod2 = _root.attachMovie("ni2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 4) {
randomNumber++;
deadbod2 = _root.attachMovie("ed4", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
markWave--;
enemyNumber--;
randomNumber++;
death_mc = _root.attachMovie("dead4", "dead4" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
enemy[i].removeMovieClip();
enemy.splice(i, 1);
hit.splice(i, 1);
depths.splice(i, 1);
type.splice(i, 1);
damagedTimer.splice(i, 1);
enemyHealth.splice(i, 1);
enemyAttacking.splice(i, 1);
enemyAttackingTimer.splice(i, 1);
hypArray.splice(i, 1);
}
i--;
}
}
function shaker() {
if (shake == 0) {
_root._x = 0;
_root._y = 0;
} else if (shake == 1) {
shake = shake + 1;
_root._x = _root._x + 1;
_root._y = _root._y + 1;
} else if (shake == 2) {
shake = shake + 1;
_root._y = _root._y - 3;
_root._x = _root._x - 3;
} else if (shake > 2) {
shake = 0;
_root._x = _root._x + 2;
_root._y = _root._y + 2;
}
}
function enemyMovement() {
i = enemy.length - 1;
while (i >= 0) {
if (player._x < enemy[i]._x) {
enemy[i]._xscale = -100;
} else {
enemy[i]._xscale = 100;
}
if (type[i] == 0) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - enemyPower;
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 110) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
hit_sound.start();
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 1) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 4);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 50) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 110) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 50) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 50) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
hit_sound.start();
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + (((endX - enemy[i]._x) / enemySpeed) / 2);
enemy[i]._y = enemy[i]._y + (((endY - enemy[i]._y) / enemySpeed) / 2);
}
}
}
if (type[i] == 2) {
if (hypArray[i] < 250) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 2);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 107) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 3) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 4);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 107) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 4) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 5.5);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 111) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + (((endX - enemy[i]._x) / enemySpeed) * 2);
enemy[i]._y = enemy[i]._y + (((endY - enemy[i]._y) / enemySpeed) * 2);
}
}
}
i--;
}
}
function noOverLap() {
i = enemy.length - 1;
while (i >= 0) {
j = enemy.length - 1;
while (j >= 0) {
if (!invisible) {
if (!(enemy[i] === enemy[j])) {
if (enemy[j]._y < enemy[i]._y) {
enemy[i].swapDepths(_root.getNextHighestDepth());
}
if (enemy[i].hitTest(enemy[j])) {
endX = _root.enemy[j]._x;
enemy[i]._x = enemy[i]._x - ((endX - enemy[i]._x) / enemySpeed);
}
}
}
j--;
}
i--;
}
}
function canAddPoint() {
if (clicks == 0) {
canAddComboPoint = true;
} else {
canAddComboPoint = false;
}
}
function runAttackTimer() {
if (attacking) {
playerSpeed = 1;
is_attacking++;
} else {
playerSpeed = 10;
}
}
function confirmAttacking() {
if (clicks > 0) {
attacking = true;
}
}
function comboOne() {
if (!addSecondCombo) {
if (!addThirdCombo) {
if (addFirstCombo) {
if (attacking) {
player.gotoAndStop("melee1");
if (is_attacking == 7) {
addFirstCombo = false;
if (clicks == 1) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 1) {
smack = 0;
addSecondCombo = true;
}
}
}
}
}
}
}
function comboTwo() {
if (!addFirstCombo) {
if (!addThirdCombo) {
if (addSecondCombo) {
if (attacking) {
player.gotoAndStop("melee2");
if (is_attacking == 13) {
addSecondCombo = false;
if (clicks == 2) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 2) {
smack = 0;
addThirdCombo = true;
}
}
}
}
}
}
}
function comboThree() {
if (!addFirstCombo) {
if (!addSecondCombo) {
if (addThirdCombo) {
if (attacking) {
player.gotoAndStop("melee3");
if (is_attacking == 20) {
frozen = false;
addThirdCombo = false;
if (clicks == 3) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 3) {
smack = 0;
clicks = 1;
is_attacking = 0;
addFirstCombo = true;
}
}
}
}
}
}
}
function playerMovement() {
fire_bullets._x = bg._x - 500;
acid_bullets._x = bg._x + 1000;
health_mc._x = bg._x;
doors._x = bg._x;
green._x = bg._x;
wall._x = bg._x;
if (hitPlayer == 0) {
var _local1 = player.transform.colorTransform;
player.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
}
if (hitPlayer == 1) {
var _local1 = player.transform.colorTransform;
_local1.rgb = 4294967295;
player.transform.colorTransform = _local1;
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
if (green.hitTest(player._x, player._y, true)) {
player._y = player._y + ((playerSpeed * 2) + 3);
}
if (player._y > 430) {
player._y = 430;
}
if (player._x < 46) {
player._x = 46;
}
if (canGo) {
if (bg._x > -1916.9) {
if (player._x > 410) {
moved++;
bg._x = bg._x - 5;
playerFade._x = playerFade._x - 5;
steps++;
player._x = 410;
}
}
}
if (player._x > 590) {
player._x = 590;
}
if (!attacking) {
if (shooting) {
if (!running) {
player.gotoAndStop("shoot_idle");
}
if (running) {
player.gotoAndStop("shoot_run");
}
}
if (!shooting) {
if (!running) {
player.gotoAndStop("idle");
}
if (running) {
player.gotoAndStop("run");
}
}
}
if (!Key.isDown(65)) {
shooting = false;
}
if (Key.isDown(65)) {
if (ammo > 0) {
shooting = true;
}
}
if (!Key.isDown(83)) {
pressHack = 0;
}
if (Key.isDown(83)) {
if (!shooting) {
if (pressHack == 0) {
pressHack = 1;
if (canAddComboPoint) {
addFirstCombo = true;
}
clicks++;
}
}
}
if (!Key.isDown(38)) {
running = false;
}
if (!Key.isDown(40)) {
running = false;
}
if (!Key.isDown(39)) {
running = false;
}
if (!Key.isDown(37)) {
running = false;
}
if (Key.isDown(38)) {
if (shooting) {
player._y = player._y - playerSpeed;
} else {
player._y = player._y - (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(40)) {
if (shooting) {
player._y = player._y + playerSpeed;
} else {
player._y = player._y + (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(39)) {
player._xscale = 100;
if (shooting) {
player._x = player._x + playerSpeed;
} else {
player._x = player._x + (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(37)) {
player._xscale = -100;
if (shooting) {
player._x = player._x - playerSpeed;
} else {
player._x = player._x - (playerSpeed * 2);
}
running = true;
}
}
stop();
doors._alpha = 0;
health_sound = new Sound();
health_sound.attachSound("health.mp3");
zombiereload_sound = new Sound();
zombiereload_sound.attachSound("zombiereload");
shot_sound = new Sound();
shot_sound.attachSound("shot");
swing_sound = new Sound();
swing_sound.attachSound("swing");
hit_sound = new Sound();
hit_sound.attachSound("smack");
_root.attachMovie("healthBar", "healthBar", _root.getNextHighestDepth(), {_x:19.5, _y:115});
_root.attachMovie("barBoarder", "barBoarder", _root.getNextHighestDepth());
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:300, _y:422});
_root.attachMovie("health_mc", "health_mc", _root.getNextHighestDepth(), {_x:3000, _y:330});
_root.attachMovie("fire_bullets", "fire_bullets", _root.getNextHighestDepth(), {_x:1000, _y:390});
_root.attachMovie("acid_bullets", "acid_bullets", _root.getNextHighestDepth(), {_x:1000, _y:420});
bulletType = 0;
ammo = 50;
yesGo = 0;
moved = 0;
bulletPower = 2;
bulletSpeed = 25;
shootingTimer = 0;
reloadTime = 250;
choice = 0;
addRain = 0;
releNum = 500;
enemyPower = 1;
playerSpeed = 12;
playerPower = 0.3;
playerHealth = 100;
running = false;
attacking = false;
enemiesdead = 0;
hitPlayer = 0;
hitTimer = 0;
pressHack = 0;
clicks = 0;
shake = 0;
smack = 0;
canGo = false;
shooting = false;
bossOn = false;
enemyNumber = 0;
is_attacking = 0;
releaseenemy = 0;
randomNumber = 0;
enemySpeed = 60;
markWave = 7;
steps = 0;
addBoss = 0;
pplKilled = 0;
distance = 0;
var shot = new Array();
var depths = new Array();
var dead_body = new Array();
var pounds = new Array();
var type = new Array();
var hypArray = new Array();
var enemyHealth = new Array();
var damagedTimer = new Array();
var hit = new Array();
var enemyAttackingTimer = new Array();
var enemyAttacking = new Array();
var enemy = new Array();
player.onEnterFrame = function () {
if ((ammo < 0) or (ammo == 0)) {
bulletType = 0;
shooting = false;
ammo = 0;
}
if (ammo > 50) {
ammo = 50;
}
if (health_mc.hitTest(player._x, player._y, true)) {
health_sound.start();
playerHealth = 100;
health_mc.removeMovieClip();
}
if (acid_bullets.hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
bulletType = 2;
ammo = 25;
acid_bullets.removeMovieClip();
}
if (fire_bullets.hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
bulletType = 1;
ammo = 25;
fire_bullets.removeMovieClip();
}
if (playerHealth > 100) {
playerHealth = 100;
}
barBoarder.scr.text = score;
barBoarder.am.text = ammo;
healthBar._xscale = playerHealth;
if (player.hitTest(doors)) {
removeall();
fire_bullets.removeMovieClip();
acid_bullets.removeMovieClip();
health_mc.removeMovieClip();
doors.removeMovieClip();
green.removeMovieClip();
wall.removeMovieClip();
bg.removeMovieClip();
gogo.removeMovieClip();
barBoarder.removeMovieClip();
healthBar.removeMovieClip();
raintosser.removeMovieClip();
nextFrame();
}
if (playerHealth < 0) {
removeall();
raintosser.removeMovieClip();
fire_bullets.removeMovieClip();
acid_bullets.removeMovieClip();
health_mc.removeMovieClip();
doors.removeMovieClip();
green.removeMovieClip();
wall.removeMovieClip();
bg.removeMovieClip();
gogo.removeMovieClip();
barBoarder.removeMovieClip();
healthBar.removeMovieClip();
gotoAndStop ("gameOver");
}
if (addRain < 1001) {
addRain++;
}
if (addRain == 1000) {
_root.attachMovie("raintosser", "raintosser", _root.getNextHighestDepth());
}
pushDeadbody();
waveActions();
noOverLap();
swapdepths();
enemyMovement();
playerMovement();
addenemy();
calculateHyp();
enemyHealthReachesZero();
pushEnemy();
shotActions();
wall.swapDepths(_root.getNextHighestDepth());
raintosser.swapDepths(_root.getNextHighestDepth());
healthBar.swapDepths(_root.getNextHighestDepth());
barBoarder.swapDepths(_root.getNextHighestDepth());
letterbox.swapDepths(_root.getNextHighestDepth());
shaker();
pushPounds();
comboOne();
comboTwo();
comboThree();
runAttackTimer();
canAddPoint();
confirmAttacking();
collectCash();
};
Frame 14
player.removeMovieClip();
wall.removeMovieClip();
wall._alpha = 0;
stopAllSounds();
play();
Instance of Symbol 630 MovieClip in Frame 15
on (release) {
getURL ("http://www.playhub.com/?utm_medium=brandedgames_external&utm_campaign=argh_zombies&utm_source=domain.com&utm_content=ingame", "_blank");
}
Frame 16
stopAllSounds();
play();
Frame 17
function removeall() {
removeSkins();
removeShot();
removeDepths();
removeDead_body();
removePounds();
removeType();
removeHypArray();
removeEnemyHealth();
removeDamagedTimer();
removeHit();
removeEnemyAttackingTimer();
removeEnemyAttacking();
removeEnemy();
}
function shotActions() {
if (shooting) {
if ((shootingTimer + reloadTime) < getTimer()) {
shootingTimer = getTimer();
shot_sound.start();
ammo--;
if (bulletType == 2) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
if (bulletType == 1) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
if (bulletType == 0) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
}
}
i = shot.length - 1;
while (i >= 0) {
j = enemy.length - 1;
while (j >= 0) {
if (shot[i].hitTest(enemy[j])) {
if (bulletType == 2) {
enemyHealth[j] = -1;
}
if (bulletType == 1) {
enemyHealth[j] = -1;
}
if (bulletType == 0) {
enemyHealth[j] = enemyHealth[j] - bulletPower;
randomNumber++;
blood_mc = _root.attachMovie("blood", "blood" + randomNumber, _root.getNextHighestDepth(), {_x:shot[i]._x, _y:shot[i]._y});
blood_mc._xscale = enemy[i]._xscale;
}
shot[i].removeMovieClip();
shot.splice(i, 1);
dir.splice(i, 1);
}
j--;
}
if ((shot[i]._x > 640) or (shot[i]._x < 0)) {
shot[i].removeMovieClip();
shot.splice(i, 1);
dir.splice(i, 1);
}
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1203.15) {
if (player._x > 410) {
shot[i]._x = shot[i]._x - 5;
}
}
}
i--;
}
}
function removeSkins() {
i = skins.length - 1;
while (i >= 0) {
skins[i].removeMovieClip();
skins.splice(i, 1);
i--;
}
}
function removeShot() {
i = shot.length - 1;
while (i >= 0) {
shot[i].removeMovieClip();
shot.splice(i, 1);
i--;
}
}
function removeDepths() {
i = depths.length - 1;
while (i >= 0) {
depths[i].removeMovieClip();
depths.splice(i, 1);
i--;
}
}
function removeDead_body() {
i = dead_body.length - 1;
while (i >= 0) {
dead_body[i].removeMovieClip();
dead_body.splice(i, 1);
i--;
}
}
function removePounds() {
i = pounds.length - 1;
while (i >= 0) {
pounds[i].removeMovieClip();
pounds.splice(i, 1);
i--;
}
}
function removeType() {
i = type.length - 1;
while (i >= 0) {
type[i].removeMovieClip();
type.splice(i, 1);
i--;
}
}
function removeHypArray() {
i = hypArray.length - 1;
while (i >= 0) {
hypArray[i].removeMovieClip();
hypArray.splice(i, 1);
i--;
}
}
function removeEnemyHealth() {
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth[i].removeMovieClip();
enemyHealth.splice(i, 1);
i--;
}
}
function removeDamagedTimer() {
i = damagedTimer.length - 1;
while (i >= 0) {
damagedTimer[i].removeMovieClip();
damagedTimer.splice(i, 1);
i--;
}
}
function removeHit() {
i = hit.length - 1;
while (i >= 0) {
hit[i].removeMovieClip();
hit.splice(i, 1);
i--;
}
}
function removeEnemyAttackingTimer() {
i = enemyAttackingTimer.length - 1;
while (i >= 0) {
enemyAttackingTimer[i].removeMovieClip();
enemyAttackingTimer.splice(i, 1);
i--;
}
}
function removeEnemyAttacking() {
i = enemyAttacking.length - 1;
while (i >= 0) {
enemyAttacking[i].removeMovieClip();
enemyAttacking.splice(i, 1);
i--;
}
}
function removeEnemy() {
i = enemy.length - 1;
while (i >= 0) {
enemy[i].removeMovieClip();
enemy.splice(i, 1);
i--;
}
}
function waveActions() {
if (distance < 5) {
if (markWave < 0) {
if (player._x < 410) {
if (yesGo == 0) {
distance++;
_root.attachMovie("gogo", "gogo", _root.getNextHighestDepth());
}
yesGo = 1;
canGo = true;
}
}
}
if (steps > 130) {
gogo.removeMovieClip();
yesGo = 0;
canGo = false;
markWave = 10;
steps = 0;
}
}
function addenemy() {
if (enemyNumber < 3) {
if ((releaseenemy + releNum) < getTimer()) {
releaseenemy = getTimer();
enemyNumber++;
randomNumber++;
emmasGayChoice = Math.round(Math.random() * 1) + 0;
if (emmasGayChoice == 0) {
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("scout2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:700});
} else {
enemy_ = _root.attachMovie("scout2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:-100});
}
skins.push(0);
}
if (emmasGayChoice == 1) {
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("scout", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:700});
} else {
enemy_ = _root.attachMovie("scout", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:-100});
}
skins.push(1);
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(0);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(5);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
if ((pplKilled > 21) && (pplKilled < 41)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy1", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy1", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(1);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(20);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 41) && (pplKilled < 61)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(2);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(40);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 61) && (pplKilled < 81)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("nii2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("nii2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(3);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(70);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 81) && (pplKilled < 101)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy4", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy4", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(4);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(60);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
}
}
}
function collectCash() {
i = pounds.length - 1;
while (i >= 0) {
if (pounds[i].hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
ammo = ammo + 10;
pounds[i].removeMovieClip();
pounds.splice(i, 1);
depths.splice(i, 1);
}
i--;
}
}
function swapdepths() {
i = depths.length - 1;
while (i >= 0) {
if (player._y < depths[i]._y) {
depths[i].swapDepths(_root.getNextHighestDepth());
}
if (player._y > depths[i]._y) {
player.swapDepths(_root.getNextHighestDepth());
}
i--;
}
}
function pushPounds() {
i = pounds.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1203.15) {
if (player._x > 410) {
pounds[i]._x = pounds[i]._x - 5;
}
}
}
i--;
}
}
function pushEnemy() {
i = enemy.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1203.15) {
if (player._x > 410) {
enemy[i]._x = enemy[i]._x - 5;
}
}
}
i--;
}
}
function pushDeadbody() {
i = dead_body.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1203.15) {
if (player._x > 410) {
dead_body[i]._x = dead_body[i]._x - 5;
}
}
}
i--;
}
}
function calculateHyp() {
i = enemy.length - 1;
while (i >= 0) {
dist_x = player._x - enemy[i]._x;
dist_y = player._y - enemy[i]._y;
hypArray[i] = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
i--;
}
}
function enemyHealthReachesZero() {
i = enemy.length - 1;
while (i >= 0) {
if (enemyHealth[i] < 1) {
score = score + 10;
randomNumber++;
_root.attachMovie("plusTen", "plusTen" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
hit_sound.start();
if (bulletType == 0) {
if (ammo < 50) {
choice = Math.round(Math.random() * 5) + 0;
if (choice == 0) {
randomNumber++;
cash = _root.attachMovie("ammo_mc", "money" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
depths.push(cash);
pounds.push(cash);
}
}
}
if (hit[i] == 1) {
randomNumber++;
if (type[i] == 0) {
if (skins[i] == 0) {
deadbod2 = _root.attachMovie("scoutDead2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (skins[i] == 1) {
deadbod2 = _root.attachMovie("scoutDead", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (hit[i] == 0) {
if (type[i] == 0) {
randomNumber++;
if (bulletType == 0) {
if (skins[i] == 0) {
deadbod2 = _root.attachMovie("scoutDead2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (skins[i] == 1) {
deadbod2 = _root.attachMovie("scoutDead", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
}
if (bulletType == 1) {
deadbod2 = _root.attachMovie("fireScoutDead", "fireScoutDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 2) {
deadbod2 = _root.attachMovie("boomDead", "boomDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
}
if (type[i] == 1) {
randomNumber++;
if (bulletType == 0) {
deadbod2 = _root.attachMovie("slashup", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 1) {
deadbod2 = _root.attachMovie("fireScoutDead", "fireScoutDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 2) {
deadbod2 = _root.attachMovie("boomDead", "boomDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 2) {
randomNumber++;
deadbod2 = _root.attachMovie("e2d", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 3) {
randomNumber++;
deadbod2 = _root.attachMovie("ni2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 4) {
randomNumber++;
deadbod2 = _root.attachMovie("ed4", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
markWave--;
enemyNumber--;
randomNumber++;
death_mc = _root.attachMovie("dead4", "dead4" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
enemy[i].removeMovieClip();
enemy.splice(i, 1);
skins.splice(i, 1);
hit.splice(i, 1);
depths.splice(i, 1);
type.splice(i, 1);
damagedTimer.splice(i, 1);
enemyHealth.splice(i, 1);
enemyAttacking.splice(i, 1);
enemyAttackingTimer.splice(i, 1);
hypArray.splice(i, 1);
}
i--;
}
}
function shaker() {
if (shake == 0) {
_root._x = 0;
_root._y = 0;
} else if (shake == 1) {
shake = shake + 1;
_root._x = _root._x + 1;
_root._y = _root._y + 1;
} else if (shake == 2) {
shake = shake + 1;
_root._y = _root._y - 3;
_root._x = _root._x - 3;
} else if (shake > 2) {
shake = 0;
_root._x = _root._x + 2;
_root._y = _root._y + 2;
}
}
function enemyMovement() {
i = enemy.length - 1;
while (i >= 0) {
if (player._x < enemy[i]._x) {
enemy[i]._xscale = -100;
} else {
enemy[i]._xscale = 100;
}
if (type[i] == 0) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
if (goTimer < 75) {
playerHealth = playerHealth - enemyPower;
}
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 110) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
hit_sound.start();
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 1) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - enemyPower;
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 110) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 2) {
if (hypArray[i] < 250) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 2);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 107) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 3) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 4);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 107) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 4) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 5.5);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 111) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + (((endX - enemy[i]._x) / enemySpeed) * 2);
enemy[i]._y = enemy[i]._y + (((endY - enemy[i]._y) / enemySpeed) * 2);
}
}
}
i--;
}
}
function noOverLap() {
i = enemy.length - 1;
while (i >= 0) {
j = enemy.length - 1;
while (j >= 0) {
if (!(enemy[i] === enemy[j])) {
if (enemy[j]._y < enemy[i]._y) {
enemy[i].swapDepths(_root.getNextHighestDepth());
}
if (enemy[i].hitTest(enemy[j])) {
endX = _root.enemy[j]._x;
enemy[i]._x = enemy[i]._x - ((endX - enemy[i]._x) / enemySpeed);
}
}
j--;
}
i--;
}
}
function canAddPoint() {
if (clicks == 0) {
canAddComboPoint = true;
} else {
canAddComboPoint = false;
}
}
function runAttackTimer() {
if (attacking) {
playerSpeed = 1;
is_attacking++;
} else {
playerSpeed = 10;
}
}
function confirmAttacking() {
if (clicks > 0) {
attacking = true;
}
}
function comboOne() {
if (!addSecondCombo) {
if (!addThirdCombo) {
if (addFirstCombo) {
if (attacking) {
player.gotoAndStop("melee1");
if (is_attacking == 7) {
addFirstCombo = false;
if (clicks == 1) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 1) {
smack = 0;
addSecondCombo = true;
}
}
}
}
}
}
}
function comboTwo() {
if (!addFirstCombo) {
if (!addThirdCombo) {
if (addSecondCombo) {
if (attacking) {
player.gotoAndStop("melee2");
if (is_attacking == 13) {
addSecondCombo = false;
if (clicks == 2) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 2) {
smack = 0;
addThirdCombo = true;
}
}
}
}
}
}
}
function comboThree() {
if (!addFirstCombo) {
if (!addSecondCombo) {
if (addThirdCombo) {
if (attacking) {
player.gotoAndStop("melee3");
if (is_attacking == 20) {
frozen = false;
addThirdCombo = false;
if (clicks == 3) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 3) {
smack = 0;
clicks = 1;
is_attacking = 0;
addFirstCombo = true;
}
}
}
}
}
}
}
function playerMovement() {
fire_bullets._x = bg._x - 1000;
acid_bullets._x = bg._x + 500;
health_mc._x = bg._x;
exit._x = bg._x;
if (goTimer < 75) {
if (hitPlayer == 0) {
var _local1 = player.transform.colorTransform;
player.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
}
if (hitPlayer == 1) {
var _local1 = player.transform.colorTransform;
_local1.rgb = 4294967295;
player.transform.colorTransform = _local1;
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
if (player._y < 340) {
player._y = 340;
}
if (player._y > 430) {
player._y = 430;
}
if (player._x < 46) {
player._x = 46;
}
if (canGo) {
if (bg._x > -1203.15) {
if (player._x > 410) {
moved++;
bg._x = bg._x - 5;
playerFade._x = playerFade._x - 5;
steps++;
player._x = 410;
}
}
}
if (player._x > 590) {
player._x = 590;
}
if (!attacking) {
if (shooting) {
if (!running) {
player.gotoAndStop("shoot_idle");
}
if (running) {
player.gotoAndStop("shoot_run");
}
}
if (!shooting) {
if (!running) {
player.gotoAndStop("idle");
}
if (running) {
player.gotoAndStop("run");
}
}
}
if (!Key.isDown(65)) {
shooting = false;
}
if (Key.isDown(65)) {
if (ammo > 0) {
shooting = true;
}
}
if (!Key.isDown(83)) {
pressHack = 0;
}
if (Key.isDown(83)) {
if (!shooting) {
if (pressHack == 0) {
pressHack = 1;
if (canAddComboPoint) {
addFirstCombo = true;
}
clicks++;
}
}
}
if (!Key.isDown(38)) {
running = false;
}
if (!Key.isDown(40)) {
running = false;
}
if (!Key.isDown(39)) {
running = false;
}
if (!Key.isDown(37)) {
running = false;
}
if (Key.isDown(38)) {
if (shooting) {
player._y = player._y - playerSpeed;
} else {
player._y = player._y - (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(40)) {
if (shooting) {
player._y = player._y + playerSpeed;
} else {
player._y = player._y + (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(39)) {
player._xscale = 100;
if (shooting) {
player._x = player._x + playerSpeed;
} else {
player._x = player._x + (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(37)) {
player._xscale = -100;
if (shooting) {
player._x = player._x - playerSpeed;
} else {
player._x = player._x - (playerSpeed * 2);
}
running = true;
}
}
}
stop();
exit._alpha = 0;
health_sound = new Sound();
health_sound.attachSound("health.mp3");
zombiereload_sound = new Sound();
zombiereload_sound.attachSound("zombiereload");
shot_sound = new Sound();
shot_sound.attachSound("shot");
swing_sound = new Sound();
swing_sound.attachSound("swing");
hit_sound = new Sound();
hit_sound.attachSound("smack");
_root.attachMovie("healthBar", "healthBar", _root.getNextHighestDepth(), {_x:19.5, _y:115});
_root.attachMovie("barBoarder", "barBoarder", _root.getNextHighestDepth());
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:300, _y:422});
_root.attachMovie("health_mc", "health_mc", _root.getNextHighestDepth(), {_x:1500, _y:330});
_root.attachMovie("fire_bullets", "fire_bullets", _root.getNextHighestDepth(), {_x:1000, _y:390});
_root.attachMovie("acid_bullets", "acid_bullets", _root.getNextHighestDepth(), {_x:1000, _y:420});
goTime = false;
goTimer = 0;
yesGo = 0;
moved = 0;
bulletPower = 2;
bulletSpeed = 25;
shootingTimer = 0;
reloadTime = 250;
choice = 0;
addRain = 0;
releNum = 500;
enemyPower = 1.5;
playerSpeed = 12;
playerPower = 0.3;
playerHealth = 100;
running = false;
attacking = false;
enemiesdead = 0;
hitPlayer = 0;
hitTimer = 0;
pressHack = 0;
clicks = 0;
shake = 0;
smack = 0;
canGo = false;
shooting = false;
bossOn = false;
enemyNumber = 0;
is_attacking = 0;
releaseenemy = 0;
randomNumber = 0;
enemySpeed = 60;
markWave = 10;
steps = 0;
pplKilled = 0;
distance = 0;
var skins = new Array();
var shot = new Array();
var depths = new Array();
var dead_body = new Array();
var pounds = new Array();
var type = new Array();
var hypArray = new Array();
var enemyHealth = new Array();
var damagedTimer = new Array();
var hit = new Array();
var enemyAttackingTimer = new Array();
var enemyAttacking = new Array();
var enemy = new Array();
player.onEnterFrame = function () {
if ((ammo < 0) or (ammo == 0)) {
bulletType = 0;
shooting = false;
ammo = 0;
}
if (ammo > 50) {
ammo = 50;
}
if (health_mc.hitTest(player._x, player._y, true)) {
health_sound.start();
playerHealth = 100;
health_mc.removeMovieClip();
}
if (acid_bullets.hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
bulletType = 2;
ammo = 25;
acid_bullets.removeMovieClip();
}
if (fire_bullets.hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
bulletType = 1;
ammo = 25;
fire_bullets.removeMovieClip();
}
if (playerHealth > 100) {
playerHealth = 100;
}
barBoarder.scr.text = score;
barBoarder.am.text = ammo;
healthBar._xscale = playerHealth;
if (player.hitTest(exit)) {
goTime = true;
}
if (goTime) {
if (goTimer == 0) {
_root.attachMovie("train", "train", _root.getNextHighestDepth());
}
goTimer++;
if (goTimer == 75) {
player._alpha = 0;
}
if (goTimer == 270) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
removeall();
fire_bullets.removeMovieClip();
acid_bullets.removeMovieClip();
health_mc.removeMovieClip();
gogo.removeMovieClip();
barBoarder.removeMovieClip();
healthBar.removeMovieClip();
exit.removeMovieClip();
goTime = false;
nextFrame();
}
}
if (playerHealth < 0) {
removeall();
train.removeMovieClip();
fire_bullets.removeMovieClip();
acid_bullets.removeMovieClip();
health_mc.removeMovieClip();
gogo.removeMovieClip();
barBoarder.removeMovieClip();
healthBar.removeMovieClip();
exit.removeMovieClip();
gotoAndStop ("gameOver");
}
pushDeadbody();
waveActions();
noOverLap();
swapdepths();
enemyMovement();
playerMovement();
addenemy();
calculateHyp();
enemyHealthReachesZero();
pushEnemy();
shotActions();
train.swapDepths(_root.getNextHighestDepth());
healthBar.swapDepths(_root.getNextHighestDepth());
barBoarder.swapDepths(_root.getNextHighestDepth());
letterbox.swapDepths(_root.getNextHighestDepth());
shaker();
pushPounds();
comboOne();
comboTwo();
comboThree();
runAttackTimer();
canAddPoint();
confirmAttacking();
collectCash();
};
Frame 18
player.removeMovieClip();
play();
Frame 19
function removeall() {
removeSkins();
removeShot();
removeDepths();
removeDead_body();
removePounds();
removeType();
removeHypArray();
removeEnemyHealth();
removeDamagedTimer();
removeHit();
removeEnemyAttackingTimer();
removeEnemyAttacking();
removeEnemy();
}
function shotActions() {
if (shooting) {
if ((shootingTimer + reloadTime) < getTimer()) {
shootingTimer = getTimer();
shot_sound.start();
ammo--;
if (bulletType == 2) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
if (bulletType == 1) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
if (bulletType == 0) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
}
}
i = shot.length - 1;
while (i >= 0) {
j = enemy.length - 1;
while (j >= 0) {
if (shot[i].hitTest(enemy[j])) {
if (bulletType == 2) {
enemyHealth[j] = -1;
}
if (bulletType == 1) {
enemyHealth[j] = -1;
}
if (bulletType == 0) {
enemyHealth[j] = enemyHealth[j] - bulletPower;
randomNumber++;
blood_mc = _root.attachMovie("blood", "blood" + randomNumber, _root.getNextHighestDepth(), {_x:shot[i]._x, _y:shot[i]._y});
blood_mc._xscale = enemy[i]._xscale;
}
shot[i].removeMovieClip();
shot.splice(i, 1);
dir.splice(i, 1);
}
j--;
}
if ((shot[i]._x > 640) or (shot[i]._x < 0)) {
shot[i].removeMovieClip();
shot.splice(i, 1);
dir.splice(i, 1);
}
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1203.15) {
if (player._x > 410) {
shot[i]._x = shot[i]._x - 5;
}
}
}
i--;
}
}
function removeSkins() {
i = skins.length - 1;
while (i >= 0) {
skins[i].removeMovieClip();
skins.splice(i, 1);
i--;
}
}
function removeShot() {
i = shot.length - 1;
while (i >= 0) {
shot[i].removeMovieClip();
shot.splice(i, 1);
i--;
}
}
function removeDepths() {
i = depths.length - 1;
while (i >= 0) {
depths[i].removeMovieClip();
depths.splice(i, 1);
i--;
}
}
function removeDead_body() {
i = dead_body.length - 1;
while (i >= 0) {
dead_body[i].removeMovieClip();
dead_body.splice(i, 1);
i--;
}
}
function removePounds() {
i = pounds.length - 1;
while (i >= 0) {
pounds[i].removeMovieClip();
pounds.splice(i, 1);
i--;
}
}
function removeType() {
i = type.length - 1;
while (i >= 0) {
type[i].removeMovieClip();
type.splice(i, 1);
i--;
}
}
function removeHypArray() {
i = hypArray.length - 1;
while (i >= 0) {
hypArray[i].removeMovieClip();
hypArray.splice(i, 1);
i--;
}
}
function removeEnemyHealth() {
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth[i].removeMovieClip();
enemyHealth.splice(i, 1);
i--;
}
}
function removeDamagedTimer() {
i = damagedTimer.length - 1;
while (i >= 0) {
damagedTimer[i].removeMovieClip();
damagedTimer.splice(i, 1);
i--;
}
}
function removeHit() {
i = hit.length - 1;
while (i >= 0) {
hit[i].removeMovieClip();
hit.splice(i, 1);
i--;
}
}
function removeEnemyAttackingTimer() {
i = enemyAttackingTimer.length - 1;
while (i >= 0) {
enemyAttackingTimer[i].removeMovieClip();
enemyAttackingTimer.splice(i, 1);
i--;
}
}
function removeEnemyAttacking() {
i = enemyAttacking.length - 1;
while (i >= 0) {
enemyAttacking[i].removeMovieClip();
enemyAttacking.splice(i, 1);
i--;
}
}
function removeEnemy() {
i = enemy.length - 1;
while (i >= 0) {
enemy[i].removeMovieClip();
enemy.splice(i, 1);
i--;
}
}
function waveActions() {
if (distance < 5) {
if (markWave < 0) {
if (player._x < 410) {
if (yesGo == 0) {
distance++;
_root.attachMovie("gogo", "gogo", _root.getNextHighestDepth());
}
yesGo = 1;
canGo = true;
}
}
}
if (steps > 130) {
gogo.removeMovieClip();
yesGo = 0;
canGo = false;
markWave = 10;
steps = 0;
}
}
function addenemy() {
if (enemyNumber < 3) {
if ((releaseenemy + releNum) < getTimer()) {
releaseenemy = getTimer();
enemyNumber++;
randomNumber++;
emmasGayChoice = Math.round(Math.random() * 2) + 0;
if (emmasGayChoice == 0) {
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("scout", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:700});
} else {
enemy_ = _root.attachMovie("scout", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:-100});
}
skins.push(0);
}
if (emmasGayChoice == 1) {
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("scout2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:700});
} else {
enemy_ = _root.attachMovie("scout2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:-100});
}
skins.push(1);
}
if (emmasGayChoice == 2) {
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("scout3", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:700});
} else {
enemy_ = _root.attachMovie("scout3", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 62) + 400, _x:-100});
}
skins.push(2);
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(0);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(7);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
if ((pplKilled > 21) && (pplKilled < 41)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy1", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy1", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(1);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(20);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 41) && (pplKilled < 61)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(2);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(40);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 61) && (pplKilled < 81)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("nii2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("nii2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(3);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(70);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 81) && (pplKilled < 101)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy4", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy4", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(4);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(60);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
}
}
}
function collectCash() {
i = pounds.length - 1;
while (i >= 0) {
if (pounds[i].hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
ammo = ammo + 10;
pounds[i].removeMovieClip();
pounds.splice(i, 1);
depths.splice(i, 1);
}
i--;
}
}
function swapdepths() {
i = depths.length - 1;
while (i >= 0) {
if (player._y < depths[i]._y) {
depths[i].swapDepths(_root.getNextHighestDepth());
}
if (player._y > depths[i]._y) {
player.swapDepths(_root.getNextHighestDepth());
}
i--;
}
}
function pushPounds() {
i = pounds.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1203.15) {
if (player._x > 410) {
pounds[i]._x = pounds[i]._x - 5;
}
}
}
i--;
}
}
function pushEnemy() {
i = enemy.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1203.15) {
if (player._x > 410) {
enemy[i]._x = enemy[i]._x - 5;
}
}
}
i--;
}
}
function pushDeadbody() {
i = dead_body.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1203.15) {
if (player._x > 410) {
dead_body[i]._x = dead_body[i]._x - 5;
}
}
}
i--;
}
}
function calculateHyp() {
i = enemy.length - 1;
while (i >= 0) {
dist_x = player._x - enemy[i]._x;
dist_y = player._y - enemy[i]._y;
hypArray[i] = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
i--;
}
}
function enemyHealthReachesZero() {
i = enemy.length - 1;
while (i >= 0) {
if (enemyHealth[i] < 1) {
score = score + 10;
randomNumber++;
_root.attachMovie("plusTen", "plusTen" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
hit_sound.start();
if (bulletType == 0) {
if (ammo < 50) {
choice = Math.round(Math.random() * 3) + 0;
if (choice == 0) {
randomNumber++;
cash = _root.attachMovie("ammo_mc", "money" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
depths.push(cash);
pounds.push(cash);
}
}
}
if (hit[i] == 1) {
randomNumber++;
if (type[i] == 0) {
if (skins[i] == 2) {
deadbod2 = _root.attachMovie("scoutDead3", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (skins[i] == 1) {
deadbod2 = _root.attachMovie("scoutDead2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (skins[i] == 0) {
deadbod2 = _root.attachMovie("scoutDead", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (hit[i] == 0) {
if (type[i] == 0) {
randomNumber++;
if (bulletType == 0) {
if (skins[i] == 2) {
deadbod2 = _root.attachMovie("scoutDead3", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (skins[i] == 1) {
deadbod2 = _root.attachMovie("scoutDead2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (skins[i] == 0) {
deadbod2 = _root.attachMovie("scoutDead", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
}
if (bulletType == 1) {
deadbod2 = _root.attachMovie("fireScoutDead", "fireScoutDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 2) {
deadbod2 = _root.attachMovie("boomDead", "boomDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
}
if (type[i] == 1) {
randomNumber++;
if (bulletType == 0) {
deadbod2 = _root.attachMovie("slashup", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 1) {
deadbod2 = _root.attachMovie("fireScoutDead", "fireScoutDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 2) {
deadbod2 = _root.attachMovie("boomDead", "boomDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 2) {
randomNumber++;
deadbod2 = _root.attachMovie("e2d", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 3) {
randomNumber++;
deadbod2 = _root.attachMovie("ni2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 4) {
randomNumber++;
deadbod2 = _root.attachMovie("ed4", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
markWave--;
enemyNumber--;
randomNumber++;
death_mc = _root.attachMovie("dead4", "dead4" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
enemy[i].removeMovieClip();
enemy.splice(i, 1);
skins.splice(i, 1);
hit.splice(i, 1);
depths.splice(i, 1);
type.splice(i, 1);
damagedTimer.splice(i, 1);
enemyHealth.splice(i, 1);
enemyAttacking.splice(i, 1);
enemyAttackingTimer.splice(i, 1);
hypArray.splice(i, 1);
}
i--;
}
}
function shaker() {
if (shake == 0) {
_root._x = 0;
_root._y = 0;
} else if (shake == 1) {
shake = shake + 1;
_root._x = _root._x + 1;
_root._y = _root._y + 1;
} else if (shake == 2) {
shake = shake + 1;
_root._y = _root._y - 3;
_root._x = _root._x - 3;
} else if (shake > 2) {
shake = 0;
_root._x = _root._x + 2;
_root._y = _root._y + 2;
}
}
function enemyMovement() {
i = enemy.length - 1;
while (i >= 0) {
if (player._x < enemy[i]._x) {
enemy[i]._xscale = -100;
} else {
enemy[i]._xscale = 100;
}
if (type[i] == 0) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
if (goTimer < 75) {
playerHealth = playerHealth - enemyPower;
}
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 110) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
hit_sound.start();
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 1) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - enemyPower;
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 110) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 2) {
if (hypArray[i] < 250) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 2);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 107) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 3) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 4);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 107) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 4) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 5.5);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 111) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + (((endX - enemy[i]._x) / enemySpeed) * 2);
enemy[i]._y = enemy[i]._y + (((endY - enemy[i]._y) / enemySpeed) * 2);
}
}
}
i--;
}
}
function noOverLap() {
i = enemy.length - 1;
while (i >= 0) {
j = enemy.length - 1;
while (j >= 0) {
if (!(enemy[i] === enemy[j])) {
if (enemy[j]._y < enemy[i]._y) {
enemy[i].swapDepths(_root.getNextHighestDepth());
}
if (enemy[i].hitTest(enemy[j])) {
endX = _root.enemy[j]._x;
enemy[i]._x = enemy[i]._x - ((endX - enemy[i]._x) / enemySpeed);
}
}
j--;
}
i--;
}
}
function canAddPoint() {
if (clicks == 0) {
canAddComboPoint = true;
} else {
canAddComboPoint = false;
}
}
function runAttackTimer() {
if (attacking) {
playerSpeed = 1;
is_attacking++;
} else {
playerSpeed = 10;
}
}
function confirmAttacking() {
if (clicks > 0) {
attacking = true;
}
}
function comboOne() {
if (!addSecondCombo) {
if (!addThirdCombo) {
if (addFirstCombo) {
if (attacking) {
player.gotoAndStop("melee1");
if (is_attacking == 7) {
addFirstCombo = false;
if (clicks == 1) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 1) {
smack = 0;
addSecondCombo = true;
}
}
}
}
}
}
}
function comboTwo() {
if (!addFirstCombo) {
if (!addThirdCombo) {
if (addSecondCombo) {
if (attacking) {
player.gotoAndStop("melee2");
if (is_attacking == 13) {
addSecondCombo = false;
if (clicks == 2) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 2) {
smack = 0;
addThirdCombo = true;
}
}
}
}
}
}
}
function comboThree() {
if (!addFirstCombo) {
if (!addSecondCombo) {
if (addThirdCombo) {
if (attacking) {
player.gotoAndStop("melee3");
if (is_attacking == 20) {
frozen = false;
addThirdCombo = false;
if (clicks == 3) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 3) {
smack = 0;
clicks = 1;
is_attacking = 0;
addFirstCombo = true;
}
}
}
}
}
}
}
function playerMovement() {
health_mc._x = bg._x - 1000;
acid_bullets._x = bg._x - 2000;
fire_bullets._x = bg._x;
exit2._x = bg._x;
if (goTimer < 75) {
if (hitPlayer == 0) {
var _local1 = player.transform.colorTransform;
player.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
}
if (hitPlayer == 1) {
var _local1 = player.transform.colorTransform;
_local1.rgb = 4294967295;
player.transform.colorTransform = _local1;
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
if (player._y < 340) {
player._y = 340;
}
if (player._y > 430) {
player._y = 430;
}
if (player._x < 46) {
player._x = 46;
}
if (canGo) {
if (bg._x > -1203.15) {
if (player._x > 410) {
moved++;
bg._x = bg._x - 5;
playerFade._x = playerFade._x - 5;
steps++;
player._x = 410;
}
}
}
if (player._x > 590) {
player._x = 590;
}
if (!attacking) {
if (shooting) {
if (!running) {
player.gotoAndStop("shoot_idle");
}
if (running) {
player.gotoAndStop("shoot_run");
}
}
if (!shooting) {
if (!running) {
player.gotoAndStop("idle");
}
if (running) {
player.gotoAndStop("run");
}
}
}
if (!Key.isDown(65)) {
shooting = false;
}
if (Key.isDown(65)) {
if (ammo > 0) {
shooting = true;
}
}
if (!Key.isDown(83)) {
pressHack = 0;
}
if (Key.isDown(83)) {
if (!shooting) {
if (pressHack == 0) {
pressHack = 1;
if (canAddComboPoint) {
addFirstCombo = true;
}
clicks++;
}
}
}
if (!Key.isDown(38)) {
running = false;
}
if (!Key.isDown(40)) {
running = false;
}
if (!Key.isDown(39)) {
running = false;
}
if (!Key.isDown(37)) {
running = false;
}
if (Key.isDown(38)) {
if (shooting) {
player._y = player._y - playerSpeed;
} else {
player._y = player._y - (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(40)) {
if (shooting) {
player._y = player._y + playerSpeed;
} else {
player._y = player._y + (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(39)) {
player._xscale = 100;
if (shooting) {
player._x = player._x + playerSpeed;
} else {
player._x = player._x + (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(37)) {
player._xscale = -100;
if (shooting) {
player._x = player._x - playerSpeed;
} else {
player._x = player._x - (playerSpeed * 2);
}
running = true;
}
}
}
stop();
exit2._alpha = 0;
health_sound = new Sound();
health_sound.attachSound("health.mp3");
zombiereload_sound = new Sound();
zombiereload_sound.attachSound("zombiereload");
shot_sound = new Sound();
shot_sound.attachSound("shot");
swing_sound = new Sound();
swing_sound.attachSound("swing");
hit_sound = new Sound();
hit_sound.attachSound("smack");
_root.attachMovie("healthBar", "healthBar", _root.getNextHighestDepth(), {_x:19.5, _y:115});
_root.attachMovie("barBoarder", "barBoarder", _root.getNextHighestDepth());
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:300, _y:422});
_root.attachMovie("health_mc", "health_mc", _root.getNextHighestDepth(), {_x:1500, _y:330});
_root.attachMovie("fire_bullets", "fire_bullets", _root.getNextHighestDepth(), {_x:1000, _y:390});
_root.attachMovie("acid_bullets", "acid_bullets", _root.getNextHighestDepth(), {_x:1000, _y:420});
goTime = false;
goTimer = 0;
yesGo = 0;
moved = 0;
bulletPower = 4;
bulletSpeed = 25;
shootingTimer = 0;
reloadTime = 250;
choice = 0;
addRain = 0;
releNum = 500;
enemyPower = 2;
playerSpeed = 12;
playerPower = 0.3;
playerHealth = 100;
running = false;
attacking = false;
enemiesdead = 0;
hitPlayer = 0;
hitTimer = 0;
pressHack = 0;
clicks = 0;
shake = 0;
smack = 0;
canGo = false;
shooting = false;
bossOn = false;
enemyNumber = 0;
is_attacking = 0;
releaseenemy = 0;
randomNumber = 0;
enemySpeed = 60;
markWave = 10;
steps = 0;
pplKilled = 0;
distance = 0;
var skins = new Array();
var shot = new Array();
var depths = new Array();
var dead_body = new Array();
var pounds = new Array();
var type = new Array();
var hypArray = new Array();
var enemyHealth = new Array();
var damagedTimer = new Array();
var hit = new Array();
var enemyAttackingTimer = new Array();
var enemyAttacking = new Array();
var enemy = new Array();
player.onEnterFrame = function () {
if ((ammo < 0) or (ammo == 0)) {
bulletType = 0;
shooting = false;
ammo = 0;
}
if (ammo > 50) {
ammo = 50;
}
if (health_mc.hitTest(player._x, player._y, true)) {
health_sound.start();
playerHealth = 100;
health_mc.removeMovieClip();
}
if (acid_bullets.hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
bulletType = 2;
ammo = 25;
acid_bullets.removeMovieClip();
}
if (fire_bullets.hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
bulletType = 1;
ammo = 25;
fire_bullets.removeMovieClip();
}
if (playerHealth > 100) {
playerHealth = 100;
}
barBoarder.scr.text = score;
barBoarder.am.text = ammo;
healthBar._xscale = playerHealth;
if (player.hitTest(exit2)) {
trace("o");
goTime = true;
}
if (goTime) {
if (goTimer == 0) {
_root.attachMovie("fade", "fade", _root.getNextHighestDepth());
}
goTimer++;
if (goTimer == 100) {
removeall();
fire_bullets.removeMovieClip();
acid_bullets.removeMovieClip();
health_mc.removeMovieClip();
gogo.removeMovieClip();
barBoarder.removeMovieClip();
healthBar.removeMovieClip();
goTime = false;
nextFrame();
}
}
if (playerHealth < 0) {
removeall();
fire_bullets.removeMovieClip();
acid_bullets.removeMovieClip();
health_mc.removeMovieClip();
gogo.removeMovieClip();
barBoarder.removeMovieClip();
healthBar.removeMovieClip();
gotoAndStop ("gameOver");
}
pushDeadbody();
waveActions();
noOverLap();
swapdepths();
enemyMovement();
playerMovement();
addenemy();
calculateHyp();
enemyHealthReachesZero();
pushEnemy();
shotActions();
raintosser.swapDepths(_root.getNextHighestDepth());
healthBar.swapDepths(_root.getNextHighestDepth());
barBoarder.swapDepths(_root.getNextHighestDepth());
letterbox.swapDepths(_root.getNextHighestDepth());
fade.swapDepths(_root.getNextHighestDepth());
shaker();
pushPounds();
comboOne();
comboTwo();
comboThree();
runAttackTimer();
canAddPoint();
confirmAttacking();
collectCash();
};
Frame 20
stopAllSounds();
player.removeMovieClip();
play();
Instance of Symbol 630 MovieClip in Frame 21
on (release) {
getURL ("http://www.playhub.com/?utm_medium=brandedgames_external&utm_campaign=argh_zombies&utm_source=domain.com&utm_content=ingame", "_blank");
}
Frame 22
stopAllSounds();
play();
Frame 23
function removeall() {
removeShot();
removeDepths();
removeDead_body();
removePounds();
removeType();
removeHypArray();
removeEnemyHealth();
removeDamagedTimer();
removeHit();
removeEnemyAttackingTimer();
removeEnemyAttacking();
removeEnemy();
}
function shotActions() {
if (shooting) {
if ((shootingTimer + reloadTime) < getTimer()) {
shootingTimer = getTimer();
shot_sound.start();
ammo--;
if (bulletType == 2) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
if (bulletType == 1) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
if (bulletType == 0) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
}
}
i = shot.length - 1;
while (i >= 0) {
j = enemy.length - 1;
while (j >= 0) {
if (shot[i].hitTest(enemy[j])) {
if (bulletType == 2) {
if (type[j] == 0) {
enemyHealth[j] = -1;
}
if (type[j] == 1) {
if (player._y > 382) {
hit[j] = 1;
enemyHealth[j] = enemyHealth[j] - (bulletPower * 2);
}
}
}
if (bulletType == 1) {
if (type[j] == 0) {
enemyHealth[j] = -1;
}
if (type[j] == 1) {
if (player._y > 382) {
hit[j] = 1;
enemyHealth[j] = enemyHealth[j] - (bulletPower * 2);
}
}
}
if (bulletType == 0) {
if (type[j] == 1) {
if (player._y > 382) {
hit[j] = 1;
enemyHealth[j] = enemyHealth[j] - bulletPower;
}
}
if (type[j] == 0) {
enemyHealth[j] = enemyHealth[j] - bulletPower;
randomNumber++;
blood_mc = _root.attachMovie("blood", "blood" + randomNumber, _root.getNextHighestDepth(), {_x:shot[i]._x, _y:shot[i]._y});
blood_mc._xscale = enemy[i]._xscale;
}
}
shot[i].removeMovieClip();
shot.splice(i, 1);
dir.splice(i, 1);
}
j--;
}
if ((shot[i]._x > 640) or (shot[i]._x < 0)) {
shot[i].removeMovieClip();
shot.splice(i, 1);
dir.splice(i, 1);
}
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1916.9) {
if (player._x > 410) {
shot[i]._x = shot[i]._x - 5;
}
}
}
i--;
}
}
function removeShot() {
i = shot.length - 1;
while (i >= 0) {
shot[i].removeMovieClip();
shot.splice(i, 1);
i--;
}
}
function removeDepths() {
i = depths.length - 1;
while (i >= 0) {
depths[i].removeMovieClip();
depths.splice(i, 1);
i--;
}
}
function removeDead_body() {
i = dead_body.length - 1;
while (i >= 0) {
dead_body[i].removeMovieClip();
dead_body.splice(i, 1);
i--;
}
}
function removePounds() {
i = pounds.length - 1;
while (i >= 0) {
pounds[i].removeMovieClip();
pounds.splice(i, 1);
i--;
}
}
function removeType() {
i = type.length - 1;
while (i >= 0) {
type[i].removeMovieClip();
type.splice(i, 1);
i--;
}
}
function removeHypArray() {
i = hypArray.length - 1;
while (i >= 0) {
hypArray[i].removeMovieClip();
hypArray.splice(i, 1);
i--;
}
}
function removeEnemyHealth() {
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth[i].removeMovieClip();
enemyHealth.splice(i, 1);
i--;
}
}
function removeDamagedTimer() {
i = damagedTimer.length - 1;
while (i >= 0) {
damagedTimer[i].removeMovieClip();
damagedTimer.splice(i, 1);
i--;
}
}
function removeHit() {
i = hit.length - 1;
while (i >= 0) {
hit[i].removeMovieClip();
hit.splice(i, 1);
i--;
}
}
function removeEnemyAttackingTimer() {
i = enemyAttackingTimer.length - 1;
while (i >= 0) {
enemyAttackingTimer[i].removeMovieClip();
enemyAttackingTimer.splice(i, 1);
i--;
}
}
function removeEnemyAttacking() {
i = enemyAttacking.length - 1;
while (i >= 0) {
enemyAttacking[i].removeMovieClip();
enemyAttacking.splice(i, 1);
i--;
}
}
function removeEnemy() {
i = enemy.length - 1;
while (i >= 0) {
enemy[i].removeMovieClip();
enemy.splice(i, 1);
i--;
}
}
function addenemy() {
if (bnd == 0) {
if (enemyNumber < 3) {
if ((releaseenemy + releNum) < getTimer()) {
releaseenemy = getTimer();
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("scout", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 82) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("scout", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 82) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(0);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(2);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
if ((pplKilled > 21) && (pplKilled < 41)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy1", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy1", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(1);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(20);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 41) && (pplKilled < 61)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(2);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(40);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 61) && (pplKilled < 81)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("nii2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("nii2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(3);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(70);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 81) && (pplKilled < 101)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy4", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy4", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(4);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(60);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
}
}
}
}
function collectCash() {
i = pounds.length - 1;
while (i >= 0) {
if (pounds[i].hitTest(player)) {
ammo = ammo + 10;
zombiereload_sound.start();
pounds[i].removeMovieClip();
pounds.splice(i, 1);
depths.splice(i, 1);
}
i--;
}
}
function swapdepths() {
i = depths.length - 1;
while (i >= 0) {
if (player._y < depths[i]._y) {
depths[i].swapDepths(_root.getNextHighestDepth());
}
if (player._y > depths[i]._y) {
player.swapDepths(_root.getNextHighestDepth());
}
i--;
}
}
function pushPounds() {
i = pounds.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1916.9) {
if (player._x > 410) {
pounds[i]._x = pounds[i]._x - 5;
}
}
}
i--;
}
}
function pushEnemy() {
i = enemy.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1916.9) {
if (player._x > 410) {
enemy[i]._x = enemy[i]._x - 5;
}
}
}
i--;
}
}
function pushDeadbody() {
i = dead_body.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -1916.9) {
if (player._x > 410) {
dead_body[i]._x = dead_body[i]._x - 5;
}
}
}
i--;
}
}
function calculateHyp() {
i = enemy.length - 1;
while (i >= 0) {
dist_x = player._x - enemy[i]._x;
dist_y = player._y - enemy[i]._y;
hypArray[i] = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
i--;
}
}
function enemyHealthReachesZero() {
i = enemy.length - 1;
while (i >= 0) {
if (enemyHealth[i] < 1) {
if (type[i] == 1) {
bnd = 1;
goTime = true;
shake++;
bang_sound.start();
}
score = score + 10;
randomNumber++;
_root.attachMovie("plusTen", "plusTen" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
if (bulletType == 0) {
if (ammo < 50) {
choice = Math.round(Math.random() * 5) + 0;
if (choice == 0) {
randomNumber++;
cash = _root.attachMovie("ammo_mc", "money" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
depths.push(cash);
pounds.push(cash);
}
}
}
if (hit[i] == 1) {
randomNumber++;
if (type[i] == 0) {
deadbod2 = _root.attachMovie("scoutDead", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (type[i] == 1) {
truckHit.removeMovieClip();
deadbod2 = _root.attachMovie("boom", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (hit[i] == 0) {
if (type[i] == 0) {
randomNumber++;
if (bulletType == 0) {
deadbod2 = _root.attachMovie("scoutDead", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 1) {
deadbod2 = _root.attachMovie("fireScoutDead", "fireScoutDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 2) {
deadbod2 = _root.attachMovie("boomDead", "boomDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 1) {
truckHit.removeMovieClip();
randomNumber++;
deadbod2 = _root.attachMovie("boom", "boomDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
}
if (type[i] == 2) {
randomNumber++;
deadbod2 = _root.attachMovie("e2d", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 3) {
randomNumber++;
deadbod2 = _root.attachMovie("ni2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 4) {
randomNumber++;
deadbod2 = _root.attachMovie("ed4", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
markWave--;
enemyNumber--;
randomNumber++;
death_mc = _root.attachMovie("dead4", "dead4" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
enemy[i].removeMovieClip();
enemy.splice(i, 1);
hit.splice(i, 1);
depths.splice(i, 1);
type.splice(i, 1);
damagedTimer.splice(i, 1);
enemyHealth.splice(i, 1);
enemyAttacking.splice(i, 1);
enemyAttackingTimer.splice(i, 1);
hypArray.splice(i, 1);
}
i--;
}
}
function shaker() {
if (shake == 0) {
_root._x = 0;
_root._y = 0;
} else if (shake == 1) {
shake = shake + 1;
_root._x = _root._x + 1;
_root._y = _root._y + 1;
} else if (shake == 2) {
shake = shake + 1;
_root._y = _root._y - 3;
_root._x = _root._x - 3;
} else if (shake > 2) {
shake = 0;
_root._x = _root._x + 2;
_root._y = _root._y + 2;
}
}
function enemyMovement() {
i = enemy.length - 1;
while (i >= 0) {
if (type[i] == 0) {
if (player._x < enemy[i]._x) {
enemy[i]._xscale = -100;
} else {
enemy[i]._xscale = 100;
}
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - enemyPower;
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 110) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
hit_sound.start();
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 1) {
if (enemyHealth[i] < 0) {
enemyHealth[i] = 0;
}
bh = Math.round(enemyHealth[i]);
truckHit._x = enemy[i]._x;
if (enemy[i].hitTest(player)) {
if (attacking) {
if (player._y > 382) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
}
if (hit[i] == 1) {
if (smack == 0) {
hit_sound.start();
shake++;
smack = 1;
}
enemy[i].gotoAndStop("hit");
damagedTimer[i]++;
if (damagedTimer[i] == 1) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (enemyAttackingTimer[i] > 100) {
if (player.hitTest(truckHit)) {
hitPlayer = 1;
playerHealth = playerHealth - enemyPower;
}
}
enemyAttackingTimer[i]++;
if ((enemyAttackingTimer[i] > 100) && (enemyAttackingTimer[i] < 200)) {
enemy[i]._xscale = 100;
enemy[i]._x = enemy[i]._x - 25;
}
if ((enemyAttackingTimer[i] > 200) && (enemyAttackingTimer[i] < 350)) {
enemy[i]._xscale = -100;
enemy[i]._x = enemy[i]._x + 25;
}
if (enemyAttackingTimer[i] == 350) {
enemy[i]._xscale = 100;
enemy[i]._x = 1000;
}
if (enemyAttackingTimer[i] > 350) {
enemy[i]._x = enemy[i]._x - 6;
}
if (enemyAttackingTimer[i] == 400) {
enemyAttackingTimer[i] = 0;
}
}
if (type[i] == 2) {
if (hypArray[i] < 250) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 2);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 107) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 3) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 4);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 107) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 4) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 5.5);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 111) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + (((endX - enemy[i]._x) / enemySpeed) * 2);
enemy[i]._y = enemy[i]._y + (((endY - enemy[i]._y) / enemySpeed) * 2);
}
}
}
i--;
}
}
function noOverLap() {
i = enemy.length - 1;
while (i >= 0) {
j = enemy.length - 1;
while (j >= 0) {
if (!invisible) {
if (!(enemy[i] === enemy[j])) {
if (enemy[j]._y < enemy[i]._y) {
enemy[i].swapDepths(_root.getNextHighestDepth());
}
if (enemy[i].hitTest(enemy[j])) {
if ((!type[i]) == 1) {
endX = _root.enemy[j]._x;
enemy[i]._x = enemy[i]._x - ((endX - enemy[i]._x) / enemySpeed);
}
}
}
}
j--;
}
i--;
}
}
function canAddPoint() {
if (clicks == 0) {
canAddComboPoint = true;
} else {
canAddComboPoint = false;
}
}
function runAttackTimer() {
if (attacking) {
playerSpeed = 1;
is_attacking++;
} else {
playerSpeed = 10;
}
}
function confirmAttacking() {
if (clicks > 0) {
attacking = true;
}
}
function comboOne() {
if (!addSecondCombo) {
if (!addThirdCombo) {
if (addFirstCombo) {
if (attacking) {
player.gotoAndStop("melee1");
if (is_attacking == 7) {
addFirstCombo = false;
if (clicks == 1) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 1) {
smack = 0;
addSecondCombo = true;
}
}
}
}
}
}
}
function comboTwo() {
if (!addFirstCombo) {
if (!addThirdCombo) {
if (addSecondCombo) {
if (attacking) {
player.gotoAndStop("melee2");
if (is_attacking == 13) {
addSecondCombo = false;
if (clicks == 2) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 2) {
smack = 0;
addThirdCombo = true;
}
}
}
}
}
}
}
function comboThree() {
if (!addFirstCombo) {
if (!addSecondCombo) {
if (addThirdCombo) {
if (attacking) {
player.gotoAndStop("melee3");
if (is_attacking == 20) {
frozen = false;
addThirdCombo = false;
if (clicks == 3) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 3) {
smack = 0;
clicks = 1;
is_attacking = 0;
addFirstCombo = true;
}
}
}
}
}
}
}
function playerMovement() {
if (hitPlayer == 0) {
var _local1 = player.transform.colorTransform;
player.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
}
if (hitPlayer == 1) {
var _local1 = player.transform.colorTransform;
_local1.rgb = 4294967295;
player.transform.colorTransform = _local1;
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
if (player._y < 282) {
player._y = 282;
}
if (player._y > 430) {
player._y = 430;
}
if (player._x < 46) {
player._x = 46;
}
if (canGo) {
if (bg._x > -1916.9) {
if (player._x > 410) {
moved++;
bg._x = bg._x - 5;
playerFade._x = playerFade._x - 5;
steps++;
player._x = 410;
}
}
}
if (player._x > 590) {
player._x = 590;
}
if (!attacking) {
if (shooting) {
if (!running) {
player.gotoAndStop("shoot_idle");
}
if (running) {
player.gotoAndStop("shoot_run");
}
}
if (!shooting) {
if (!running) {
player.gotoAndStop("idle");
}
if (running) {
player.gotoAndStop("run");
}
}
}
if (!Key.isDown(65)) {
shooting = false;
}
if (Key.isDown(65)) {
if (ammo > 0) {
shooting = true;
}
}
if (!Key.isDown(83)) {
pressHack = 0;
}
if (Key.isDown(83)) {
if (!shooting) {
if (pressHack == 0) {
pressHack = 1;
if (canAddComboPoint) {
addFirstCombo = true;
}
clicks++;
}
}
}
if (!Key.isDown(38)) {
running = false;
}
if (!Key.isDown(40)) {
running = false;
}
if (!Key.isDown(39)) {
running = false;
}
if (!Key.isDown(37)) {
running = false;
}
if (Key.isDown(38)) {
if (shooting) {
player._y = player._y - playerSpeed;
} else {
player._y = player._y - (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(40)) {
if (shooting) {
player._y = player._y + playerSpeed;
} else {
player._y = player._y + (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(39)) {
player._xscale = 100;
if (shooting) {
player._x = player._x + playerSpeed;
} else {
player._x = player._x + (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(37)) {
player._xscale = -100;
if (shooting) {
player._x = player._x - playerSpeed;
} else {
player._x = player._x - (playerSpeed * 2);
}
running = true;
}
}
stop();
bang_sound = new Sound();
bang_sound.attachSound("bang");
health_sound = new Sound();
health_sound.attachSound("health.mp3");
zombiereload_sound = new Sound();
zombiereload_sound.attachSound("zombiereload");
shot_sound = new Sound();
shot_sound.attachSound("shot");
swing_sound = new Sound();
swing_sound.attachSound("swing");
hit_sound = new Sound();
hit_sound.attachSound("smack");
_root.attachMovie("healthBar", "healthBar", _root.getNextHighestDepth(), {_x:19.5, _y:115});
_root.attachMovie("barBoarder", "barBoarder", _root.getNextHighestDepth());
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:300, _y:422});
_root.attachMovie("health_mc", "health_mc", _root.getNextHighestDepth(), {_x:500, _y:260});
_root.attachMovie("fire_bullets", "fire_bullets", _root.getNextHighestDepth(), {_x:100, _y:390});
_root.attachMovie("acid_bullets", "acid_bullets", _root.getNextHighestDepth(), {_x:500, _y:390});
_root.attachMovie("truckHit", "truckHit", _root.getNextHighestDepth(), {_x:700, _y:390});
_root.attachMovie("ztruck", "ztruck", _root.getNextHighestDepth(), {_x:700, _y:390});
bnd = 0;
goTime = false;
goTimer = 0;
truckHit._alpha = 0;
bulletType = 0;
ammo = 50;
yesGo = 0;
moved = 0;
bulletPower = 2;
bulletSpeed = 25;
shootingTimer = 0;
reloadTime = 250;
choice = 0;
addRain = 0;
releNum = 500;
enemyPower = 1;
playerSpeed = 12;
playerPower = 0.3;
playerHealth = 100;
running = false;
attacking = false;
enemiesdead = 0;
hitPlayer = 0;
hitTimer = 0;
pressHack = 0;
clicks = 0;
shake = 0;
smack = 0;
canGo = false;
shooting = false;
bossOn = false;
enemyNumber = 0;
is_attacking = 0;
releaseenemy = 0;
randomNumber = 0;
enemySpeed = 60;
markWave = 7;
steps = 0;
addBoss = 0;
pplKilled = 0;
distance = 0;
var shot = new Array();
var depths = new Array();
var dead_body = new Array();
var pounds = new Array();
var type = new Array();
var hypArray = new Array();
var enemyHealth = new Array();
var damagedTimer = new Array();
var hit = new Array();
var enemyAttackingTimer = new Array();
var enemyAttacking = new Array();
var enemy = new Array();
depths.push(ztruck);
enemy.push(ztruck);
type.push(1);
enemyAttacking.push(false);
enemyAttackingTimer.push(0);
enemyHealth.push(200);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
player.onEnterFrame = function () {
if ((ammo < 0) or (ammo == 0)) {
bulletType = 0;
shooting = false;
ammo = 0;
}
if (ammo > 50) {
ammo = 50;
}
if (health_mc.hitTest(player._x, player._y, true)) {
health_sound.start();
playerHealth = 100;
health_mc.removeMovieClip();
}
if (acid_bullets.hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
bulletType = 2;
ammo = 25;
acid_bullets.removeMovieClip();
}
if (fire_bullets.hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
bulletType = 1;
ammo = 25;
fire_bullets.removeMovieClip();
}
if (playerHealth > 100) {
playerHealth = 100;
}
barBoarder.scr.text = score;
barBoarder.am.text = ammo;
healthBar._xscale = playerHealth;
if (goTime) {
if (goTimer == 0) {
_root.attachMovie("fade", "fade", _root.getNextHighestDepth());
}
goTimer++;
if (goTimer == 100) {
removeall();
fire_bullets.removeMovieClip();
acid_bullets.removeMovieClip();
health_mc.removeMovieClip();
greenThing.removeMovieClip();
bg.removeMovieClip();
gogo.removeMovieClip();
barBoarder.removeMovieClip();
healthBar.removeMovieClip();
raintosser.removeMovieClip();
nextFrame();
}
}
if (playerHealth < 0) {
removeall();
truckHit.removeMovieClip();
fire_bullets.removeMovieClip();
acid_bullets.removeMovieClip();
health_mc.removeMovieClip();
greenThing.removeMovieClip();
bg.removeMovieClip();
gogo.removeMovieClip();
barBoarder.removeMovieClip();
healthBar.removeMovieClip();
gotoAndStop ("gameOver");
}
pushDeadbody();
noOverLap();
swapdepths();
enemyMovement();
playerMovement();
addenemy();
calculateHyp();
enemyHealthReachesZero();
pushEnemy();
shotActions();
wall.swapDepths(_root.getNextHighestDepth());
raintosser.swapDepths(_root.getNextHighestDepth());
healthBar.swapDepths(_root.getNextHighestDepth());
barBoarder.swapDepths(_root.getNextHighestDepth());
ztruck.swapDepths(_root.getNextHighestDepth());
letterbox.swapDepths(_root.getNextHighestDepth());
fade.swapDepths(_root.getNextHighestDepth());
shaker();
pushPounds();
comboOne();
comboTwo();
comboThree();
runAttackTimer();
canAddPoint();
confirmAttacking();
collectCash();
};
Frame 24
player.removeMovieClip();
play();
Frame 25
stop();
zmm.onRelease = function () {
nextFrame();
zmm.removeMovieClip();
zmm._alpha = 0;
zmm._x = 30000000 /* 0x1C9C380 */;
};
zmm.onEnterFrame = function () {
zmm.swapDepths(_root.getNextHighestDepth());
};
Frame 26
function removeall() {
removeShot();
removeDepths();
removeDead_body();
removePounds();
removeType();
removeHypArray();
removeEnemyHealth();
removeDamagedTimer();
removeHit();
removeEnemyAttackingTimer();
removeEnemyAttacking();
removeEnemy();
}
function shotActions() {
if (shooting) {
if ((shootingTimer + reloadTime) < getTimer()) {
shootingTimer = getTimer();
shot_sound.start();
ammo--;
if (bulletType == 2) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("acid", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
if (bulletType == 1) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("fireBullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
if (bulletType == 0) {
choice++;
if (choice > 1) {
choice = 0;
}
if (player._xscale == 100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
if (player._xscale == -100) {
randomNumber++;
if (choice == 0) {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 35});
} else {
bullet_ = _root.attachMovie("bullet", "bullet" + randomNumber, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 30});
}
shot.push(bullet_);
bullet_.onEnterFrame = function () {
this._x = this._x - bulletSpeed;
};
}
}
}
}
i = shot.length - 1;
while (i >= 0) {
j = enemy.length - 1;
while (j >= 0) {
if (shot[i].hitTest(enemy[j])) {
if (bulletType == 2) {
if (type[j] == 0) {
enemyHealth[j] = -1;
}
if (type[j] == 1) {
enemyHealth[j] = enemyHealth[j] - (bulletPower * 2);
randomNumber++;
blood_mc = _root.attachMovie("blood", "blood" + randomNumber, _root.getNextHighestDepth(), {_x:shot[i]._x, _y:shot[i]._y});
blood_mc._xscale = enemy[i]._xscale;
}
}
if (bulletType == 1) {
if (type[j] == 0) {
enemyHealth[j] = -1;
}
if (type[j] == 1) {
enemyHealth[j] = enemyHealth[j] - (bulletPower * 2);
randomNumber++;
blood_mc = _root.attachMovie("blood", "blood" + randomNumber, _root.getNextHighestDepth(), {_x:shot[i]._x, _y:shot[i]._y});
blood_mc._xscale = enemy[i]._xscale;
}
}
if (bulletType == 0) {
enemyHealth[j] = enemyHealth[j] - bulletPower;
randomNumber++;
blood_mc = _root.attachMovie("blood", "blood" + randomNumber, _root.getNextHighestDepth(), {_x:shot[i]._x, _y:shot[i]._y});
blood_mc._xscale = enemy[i]._xscale;
}
shot[i].removeMovieClip();
shot.splice(i, 1);
dir.splice(i, 1);
}
j--;
}
if ((shot[i]._x > 640) or (shot[i]._x < 0)) {
shot[i].removeMovieClip();
shot.splice(i, 1);
dir.splice(i, 1);
}
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -315) {
if (player._x > 410) {
shot[i]._x = shot[i]._x - 5;
}
}
}
i--;
}
}
function removeShot() {
i = shot.length - 1;
while (i >= 0) {
shot[i].removeMovieClip();
shot.splice(i, 1);
i--;
}
}
function removeDepths() {
i = depths.length - 1;
while (i >= 0) {
depths[i].removeMovieClip();
depths.splice(i, 1);
i--;
}
}
function removeDead_body() {
i = dead_body.length - 1;
while (i >= 0) {
dead_body[i].removeMovieClip();
dead_body.splice(i, 1);
i--;
}
}
function removePounds() {
i = pounds.length - 1;
while (i >= 0) {
pounds[i].removeMovieClip();
pounds.splice(i, 1);
i--;
}
}
function removeType() {
i = type.length - 1;
while (i >= 0) {
type[i].removeMovieClip();
type.splice(i, 1);
i--;
}
}
function removeHypArray() {
i = hypArray.length - 1;
while (i >= 0) {
hypArray[i].removeMovieClip();
hypArray.splice(i, 1);
i--;
}
}
function removeEnemyHealth() {
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth[i].removeMovieClip();
enemyHealth.splice(i, 1);
i--;
}
}
function removeDamagedTimer() {
i = damagedTimer.length - 1;
while (i >= 0) {
damagedTimer[i].removeMovieClip();
damagedTimer.splice(i, 1);
i--;
}
}
function removeHit() {
i = hit.length - 1;
while (i >= 0) {
hit[i].removeMovieClip();
hit.splice(i, 1);
i--;
}
}
function removeEnemyAttackingTimer() {
i = enemyAttackingTimer.length - 1;
while (i >= 0) {
enemyAttackingTimer[i].removeMovieClip();
enemyAttackingTimer.splice(i, 1);
i--;
}
}
function removeEnemyAttacking() {
i = enemyAttacking.length - 1;
while (i >= 0) {
enemyAttacking[i].removeMovieClip();
enemyAttacking.splice(i, 1);
i--;
}
}
function removeEnemy() {
i = enemy.length - 1;
while (i >= 0) {
enemy[i].removeMovieClip();
enemy.splice(i, 1);
i--;
}
}
function addenemy() {
if (enemyNumber < 3) {
if ((releaseenemy + releNum) < getTimer()) {
releaseenemy = getTimer();
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("para", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 292) + 170, _x:700});
enemy_._xscale = -100;
} else {
enemy_ = _root.attachMovie("para", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 292) + 170, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(0);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(2);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
if ((pplKilled > 21) && (pplKilled < 41)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy1", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy1", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(1);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(20);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 41) && (pplKilled < 61)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(2);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(40);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 61) && (pplKilled < 81)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("nii2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("nii2", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(3);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(70);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
if ((pplKilled > 81) && (pplKilled < 101)) {
enemyNumber++;
randomNumber++;
choice = Math.round(Math.random() * 1) + 0;
if (choice == 0) {
enemy_ = _root.attachMovie("enemy4", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:700});
} else {
enemy_ = _root.attachMovie("enemy4", "enemy1" + randomNumber, _root.getNextHighestDepth(), {_y:Math.round(Math.random() * 162) + 300, _x:-100});
}
depths.push(enemy_);
enemy.push(enemy_);
type.push(4);
enemyAttacking.push(false);
enemyAttackingTimer.push(Math.round(Math.random() * 100) + 0);
enemyHealth.push(60);
damagedTimer.push(0);
hit.push(0);
hypArray.push(0);
}
}
}
}
function collectCash() {
i = pounds.length - 1;
while (i >= 0) {
if (pounds[i].hitTest(player)) {
ammo = ammo + 10;
zombiereload_sound.start();
pounds[i].removeMovieClip();
pounds.splice(i, 1);
depths.splice(i, 1);
}
i--;
}
}
function swapdepths() {
i = depths.length - 1;
while (i >= 0) {
if (player._y < depths[i]._y) {
depths[i].swapDepths(_root.getNextHighestDepth());
}
if (player._y > depths[i]._y) {
player.swapDepths(_root.getNextHighestDepth());
}
i--;
}
}
function pushPounds() {
i = pounds.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -315) {
if (player._x > 410) {
pounds[i]._x = pounds[i]._x - 5;
}
}
}
i--;
}
}
function pushEnemy() {
i = enemy.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -315) {
if (player._x > 410) {
enemy[i]._x = enemy[i]._x - 5;
}
}
}
i--;
}
}
function pushDeadbody() {
i = dead_body.length - 1;
while (i >= 0) {
if (canGo) {
if (bg._x < 0) {
if (player._x < 46) {
}
}
if (bg._x > -315) {
if (player._x > 410) {
dead_body[i]._x = dead_body[i]._x - 5;
}
}
}
i--;
}
}
function calculateHyp() {
i = enemy.length - 1;
while (i >= 0) {
dist_x = player._x - enemy[i]._x;
dist_y = player._y - enemy[i]._y;
hypArray[i] = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
i--;
}
}
function enemyHealthReachesZero() {
i = enemy.length - 1;
while (i >= 0) {
if ((enemy[i]._xscale == 100) && (enemy[i]._x > 800)) {
markWave--;
enemyNumber--;
enemy[i].removeMovieClip();
enemy.splice(i, 1);
hit.splice(i, 1);
depths.splice(i, 1);
type.splice(i, 1);
damagedTimer.splice(i, 1);
enemyHealth.splice(i, 1);
enemyAttacking.splice(i, 1);
enemyAttackingTimer.splice(i, 1);
hypArray.splice(i, 1);
}
if ((enemy[i]._xscale == -100) && (enemy[i]._x < -200)) {
markWave--;
enemyNumber--;
enemy[i].removeMovieClip();
enemy.splice(i, 1);
hit.splice(i, 1);
depths.splice(i, 1);
type.splice(i, 1);
damagedTimer.splice(i, 1);
enemyHealth.splice(i, 1);
enemyAttacking.splice(i, 1);
enemyAttackingTimer.splice(i, 1);
hypArray.splice(i, 1);
}
if (enemyHealth[i] < 1) {
score = score + 10;
randomNumber++;
_root.attachMovie("plusTen", "plusTen" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
if (bulletType == 0) {
if (ammo < 50) {
choice = Math.round(Math.random() * 5) + 0;
if (choice == 0) {
randomNumber++;
cash = _root.attachMovie("ammo_mc", "money" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
depths.push(cash);
pounds.push(cash);
}
}
}
if (hit[i] == 1) {
randomNumber++;
if (type[i] == 0) {
deadbod2 = _root.attachMovie("boomDead2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (type[i] == 1) {
deadbod2 = _root.attachMovie("bossDead2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (hit[i] == 0) {
if (type[i] == 0) {
randomNumber++;
if (bulletType == 0) {
deadbod2 = _root.attachMovie("boomDead2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 1) {
deadbod2 = _root.attachMovie("fireScoutDead", "fireScoutDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 2) {
deadbod2 = _root.attachMovie("boomDead", "boomDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 1) {
randomNumber++;
if (bulletType == 0) {
deadbod2 = _root.attachMovie("bossDead", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 1) {
deadbod2 = _root.attachMovie("fireScoutDead", "fireScoutDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
if (bulletType == 2) {
deadbod2 = _root.attachMovie("boomDead", "boomDead" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._xscale = enemy[i]._xscale;
}
depths.push(deadbod2);
dead_body.push(deadbod2);
}
}
if (type[i] == 2) {
randomNumber++;
deadbod2 = _root.attachMovie("e2d", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 3) {
randomNumber++;
deadbod2 = _root.attachMovie("ni2", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
if (type[i] == 4) {
randomNumber++;
deadbod2 = _root.attachMovie("ed4", "saberside2" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
deadbod2._yscale = 80;
deadbod2._xscale = enemy[i]._xscale;
depths.push(deadbod2);
dead_body.push(deadbod2);
}
death_mc = _root.attachMovie("dead4", "dead4" + randomNumber, _root.getNextHighestDepth(), {_x:enemy[i]._x, _y:enemy[i]._y});
markWave--;
enemyNumber--;
enemy[i].removeMovieClip();
enemy.splice(i, 1);
hit.splice(i, 1);
depths.splice(i, 1);
type.splice(i, 1);
damagedTimer.splice(i, 1);
enemyHealth.splice(i, 1);
enemyAttacking.splice(i, 1);
enemyAttackingTimer.splice(i, 1);
hypArray.splice(i, 1);
}
i--;
}
}
function shaker() {
if (shake == 0) {
_root._x = 0;
_root._y = 0;
} else if (shake == 1) {
shake = shake + 1;
_root._x = _root._x + 1;
_root._y = _root._y + 1;
} else if (shake == 2) {
shake = shake + 1;
_root._y = _root._y - 3;
_root._x = _root._x - 3;
} else if (shake > 2) {
shake = 0;
_root._x = _root._x + 2;
_root._y = _root._y + 2;
}
}
function enemyMovement() {
i = enemy.length - 1;
while (i >= 0) {
if (type[i] == 0) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x - 17;
} else {
enemy[i]._x = enemy[i]._x + 17;
}
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
hit_sound.start();
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
}
if (type[i] == 1) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 4);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 50) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 110) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 50) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 50) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
hit_sound.start();
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + (((endX - enemy[i]._x) / enemySpeed) / 2);
enemy[i]._y = enemy[i]._y + (((endY - enemy[i]._y) / enemySpeed) / 2);
}
}
}
if (type[i] == 2) {
if (hypArray[i] < 250) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 2);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 107) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 3) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 4);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 107) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + ((endX - enemy[i]._x) / enemySpeed);
enemy[i]._y = enemy[i]._y + ((endY - enemy[i]._y) / enemySpeed);
}
}
}
if (type[i] == 4) {
if (hypArray[i] < 200) {
if (enemyAttacking[i] == 1) {
if (enemy[i].hitTest(player)) {
hitPlayer = 1;
playerHealth = playerHealth - (enemyPower * 5.5);
}
}
enemyAttackingTimer[i]++;
} else {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
if (enemyAttackingTimer[i] > 100) {
enemy[i].gotoAndStop("attack");
enemyAttacking[i] = 1;
if (enemyAttackingTimer[i] == 111) {
enemyAttacking[i] = 0;
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
}
}
if (enemyAttacking[i] == 0) {
if (enemy[i].hitTest(player)) {
if (attacking) {
if (hypArray[i] < 150) {
hit[i] = 1;
enemyHealth[i] = enemyHealth[i] - playerPower;
}
}
}
if (hit[i] == 1) {
if (enemy[i]._xscale == -100) {
enemy[i]._x = enemy[i]._x + 0.5;
} else {
enemy[i]._x = enemy[i]._x - 0.5;
}
enemy[i].gotoAndStop("hit");
enemyAttackingTimer[i] = Math.round(Math.random() * 100) + 0;
enemyAttacking[i] = 0;
if (smack == 0) {
shake++;
smack = 1;
}
damagedTimer[i]++;
if (damagedTimer[i] == 15) {
hit[i] = 0;
damagedTimer[i] = 0;
}
}
if (hit[i] == 0) {
enemy[i].gotoAndStop("run");
endX = _root.player._x;
endY = _root.player._y;
enemy[i]._x = enemy[i]._x + (((endX - enemy[i]._x) / enemySpeed) * 2);
enemy[i]._y = enemy[i]._y + (((endY - enemy[i]._y) / enemySpeed) * 2);
}
}
}
i--;
}
}
function noOverLap() {
i = enemy.length - 1;
while (i >= 0) {
j = enemy.length - 1;
while (j >= 0) {
if (!invisible) {
if (!(enemy[i] === enemy[j])) {
if (enemy[j]._y < enemy[i]._y) {
enemy[i].swapDepths(_root.getNextHighestDepth());
}
if (enemy[i].hitTest(enemy[j])) {
endX = _root.enemy[j]._x;
enemy[i]._x = enemy[i]._x - ((endX - enemy[i]._x) / enemySpeed);
}
}
}
j--;
}
i--;
}
}
function canAddPoint() {
if (clicks == 0) {
canAddComboPoint = true;
} else {
canAddComboPoint = false;
}
}
function runAttackTimer() {
if (attacking) {
playerSpeed = 1;
is_attacking++;
} else {
playerSpeed = 10;
}
}
function confirmAttacking() {
if (clicks > 0) {
attacking = true;
}
}
function comboOne() {
if (!addSecondCombo) {
if (!addThirdCombo) {
if (addFirstCombo) {
if (attacking) {
player.gotoAndStop("melee1");
if (is_attacking == 7) {
addFirstCombo = false;
if (clicks == 1) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 1) {
smack = 0;
addSecondCombo = true;
}
}
}
}
}
}
}
function comboTwo() {
if (!addFirstCombo) {
if (!addThirdCombo) {
if (addSecondCombo) {
if (attacking) {
player.gotoAndStop("melee2");
if (is_attacking == 13) {
addSecondCombo = false;
if (clicks == 2) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 2) {
smack = 0;
addThirdCombo = true;
}
}
}
}
}
}
}
function comboThree() {
if (!addFirstCombo) {
if (!addSecondCombo) {
if (addThirdCombo) {
if (attacking) {
player.gotoAndStop("melee3");
if (is_attacking == 20) {
frozen = false;
addThirdCombo = false;
if (clicks == 3) {
smack = 0;
clicks = 0;
is_attacking = 0;
attacking = false;
}
if (clicks > 3) {
smack = 0;
clicks = 1;
is_attacking = 0;
addFirstCombo = true;
}
}
}
}
}
}
}
function playerMovement() {
fire_bullets._x = bg._x - 500;
acid_bullets._x = bg._x + 1000;
health_mc._x = bg._x;
doors._x = bg._x;
green._x = bg._x;
wall._x = bg._x;
if (hitPlayer == 0) {
var _local1 = player.transform.colorTransform;
player.transform.colorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
}
if (hitPlayer == 1) {
var _local1 = player.transform.colorTransform;
_local1.rgb = 4294967295;
player.transform.colorTransform = _local1;
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
if (player._y < 210) {
player._y = 210;
}
if (player._y > 400) {
player._y = 400;
}
if (bg._x > 0) {
if (player._x < 30) {
player._x = 30;
}
}
if (bg._x < 0) {
if (player._x < 230) {
bg._x = bg._x + 5;
player._x = 230;
}
}
if (bg._x > -315) {
if (player._x > 410) {
bg._x = bg._x - 5;
player._x = 410;
}
}
if (player._x > 610) {
player._x = 610;
}
if (!attacking) {
if (shooting) {
if (!running) {
player.gotoAndStop("shoot_idle");
}
if (running) {
player.gotoAndStop("shoot_run");
}
}
if (!shooting) {
if (!running) {
player.gotoAndStop("idle");
}
if (running) {
player.gotoAndStop("run");
}
}
}
if (!Key.isDown(65)) {
shooting = false;
}
if (Key.isDown(65)) {
if (ammo > 0) {
}
}
if (!Key.isDown(83)) {
pressHack = 0;
}
if (Key.isDown(83)) {
if (!shooting) {
if (pressHack == 0) {
pressHack = 1;
if (canAddComboPoint) {
addFirstCombo = true;
}
clicks++;
}
}
}
if (!Key.isDown(38)) {
running = false;
}
if (!Key.isDown(40)) {
running = false;
}
if (!Key.isDown(39)) {
running = false;
}
if (!Key.isDown(37)) {
running = false;
}
if (Key.isDown(38)) {
if (shooting) {
player._y = player._y - playerSpeed;
} else {
player._y = player._y - (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(40)) {
if (shooting) {
player._y = player._y + playerSpeed;
} else {
player._y = player._y + (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(39)) {
player._xscale = 100;
if (shooting) {
player._x = player._x + playerSpeed;
} else {
player._x = player._x + (playerSpeed * 2);
}
running = true;
}
if (Key.isDown(37)) {
player._xscale = -100;
if (shooting) {
player._x = player._x - playerSpeed;
} else {
player._x = player._x - (playerSpeed * 2);
}
running = true;
}
}
stop();
zmm.removeMovieClip();
health_sound = new Sound();
health_sound.attachSound("health.mp3");
zombiereload_sound = new Sound();
zombiereload_sound.attachSound("zombiereload");
shot_sound = new Sound();
shot_sound.attachSound("shot");
swing_sound = new Sound();
swing_sound.attachSound("swing");
hit_sound = new Sound();
hit_sound.attachSound("smack");
_root.attachMovie("zlols", "barBoarder", _root.getNextHighestDepth());
_root.attachMovie("zombieMan", "player", _root.getNextHighestDepth(), {_x:300, _y:422});
tictoc = 1920;
bulletType = 0;
ammo = 50;
yesGo = 0;
moved = 0;
bulletPower = 2;
bulletSpeed = 25;
shootingTimer = 0;
reloadTime = 250;
choice = 0;
addRain = 0;
releNum = 500;
enemyPower = 1;
playerSpeed = 12;
playerPower = 0.3;
playerHealth = 100;
running = false;
attacking = false;
enemiesdead = 0;
hitPlayer = 0;
hitTimer = 0;
pressHack = 0;
clicks = 0;
shake = 0;
smack = 0;
canGo = false;
shooting = false;
bossOn = false;
enemyNumber = 0;
is_attacking = 0;
releaseenemy = 0;
randomNumber = 0;
enemySpeed = 60;
markWave = 7;
steps = 0;
addBoss = 0;
pplKilled = 0;
distance = 0;
var shot = new Array();
var depths = new Array();
var dead_body = new Array();
var pounds = new Array();
var type = new Array();
var hypArray = new Array();
var enemyHealth = new Array();
var damagedTimer = new Array();
var hit = new Array();
var enemyAttackingTimer = new Array();
var enemyAttacking = new Array();
var enemy = new Array();
player.onEnterFrame = function () {
if ((ammo < 0) or (ammo == 0)) {
bulletType = 0;
shooting = false;
ammo = 0;
}
if (ammo > 50) {
ammo = 50;
}
if (health_mc.hitTest(player._x, player._y, true)) {
health_sound.start();
playerHealth = 100;
health_mc.removeMovieClip();
}
if (acid_bullets.hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
bulletType = 2;
ammo = 25;
acid_bullets.removeMovieClip();
}
if (fire_bullets.hitTest(player._x, player._y, true)) {
zombiereload_sound.start();
bulletType = 1;
ammo = 25;
fire_bullets.removeMovieClip();
}
if (playerHealth > 100) {
playerHealth = 100;
}
barBoarder.scr.text = score;
barBoarder.am.text = ammo;
healthBar._xscale = playerHealth;
trace(tictoc);
tictoc--;
if (tictoc == 100) {
_root.attachMovie("fade", "fade", _root.getNextHighestDepth());
}
if (tictoc == 0) {
removeall();
jonsTimer.removeMovieClip();
fire_bullets.removeMovieClip();
acid_bullets.removeMovieClip();
health_mc.removeMovieClip();
doors.removeMovieClip();
green.removeMovieClip();
wall.removeMovieClip();
bg.removeMovieClip();
gogo.removeMovieClip();
barBoarder.removeMovieClip();
healthBar.removeMovieClip();
raintosser.removeMovieClip();
nextFrame();
}
if (playerHealth < 0) {
removeall();
raintosser.removeMovieClip();
fire_bullets.removeMovieClip();
acid_bullets.removeMovieClip();
health_mc.removeMovieClip();
doors.removeMovieClip();
green.removeMovieClip();
wall.removeMovieClip();
bg.removeMovieClip();
gogo.removeMovieClip();
barBoarder.removeMovieClip();
healthBar.removeMovieClip();
gotoAndStop ("gameOver");
}
if (addRain < 1001) {
addRain++;
}
if (addRain == 1000) {
_root.attachMovie("raintosser", "raintosser", _root.getNextHighestDepth());
}
pushDeadbody();
noOverLap();
swapdepths();
enemyMovement();
playerMovement();
addenemy();
calculateHyp();
enemyHealthReachesZero();
pushEnemy();
shotActions();
raintosser.swapDepths(_root.getNextHighestDepth());
healthBar.swapDepths(_root.getNextHighestDepth());
barBoarder.swapDepths(_root.getNextHighestDepth());
letterbox.swapDepths(_root.getNextHighestDepth());
fade.swapDepths(_root.getNextHighestDepth());
shaker();
pushPounds();
comboOne();
comboTwo();
comboThree();
runAttackTimer();
canAddPoint();
confirmAttacking();
collectCash();
};
Frame 27
stopAllSounds();
player.removeMovieClip();
play();
Frame 28
stop();
ss2.onRelease = function () {
gotoAndStop ("moc");
};
mn2.onRelease = function () {
getURL ("http://www.playhub.com/?utm_medium=brandedgames_external&utm_campaign=argh_zombies&utm_source=domain.com&utm_content=ingame", "_blank");
};
ss2.onEnterFrame = function () {
if (this.hitTest(_xmouse, _ymouse, true)) {
this.gotoAndStop("down");
} else {
this.gotoAndStop("up");
}
};
mn2.onEnterFrame = function () {
if (this.hitTest(_xmouse, _ymouse, true)) {
this.gotoAndStop("over");
} else {
this.gotoAndStop("up");
}
};
Frame 29
player.removeMovieClip();
stopAllSounds();
ss.onRelease = function () {
nextFrame();
};
ty.onRelease = function () {
gotoAndStop ("mademen");
};
mn.onRelease = function () {
getURL ("http://www.playhub.com/?utm_medium=brandedgames_external&utm_campaign=argh_zombies&utm_source=domain.com&utm_content=ingame", "_blank");
};
ss.onEnterFrame = function () {
if (this.hitTest(_xmouse, _ymouse, true)) {
this.gotoAndStop("down");
} else {
this.gotoAndStop("up");
}
};
ty.onEnterFrame = function () {
if (this.hitTest(_xmouse, _ymouse, true)) {
this.gotoAndStop("down");
} else {
this.gotoAndStop("up");
}
};
mn.onEnterFrame = function () {
if (this.hitTest(_xmouse, _ymouse, true)) {
this.gotoAndStop("over");
} else {
this.gotoAndStop("up");
}
};
Frame 30
stop();
uname = "your name";
submitPlay4AllScore = function (uname, gname, scores, game_mode) {
var _local1 = new LoadVars();
_local1.game_id = aghzombies;
_local1.user_id = uname;
_local1.score = score;
_local1.game_mode = "";
var _local2 = "http://www.playhub.com/highscores.php?gid=2005";
_local1.sendAndLoad(_local2, _local1, "POST");
};
wwf.onRelease = function () {
submitPlay4AllScore();
getURL ("http://www.playhub.com/highscores.php?gid=2005", "_blank");
gotoAndStop ("settings");
};
Symbol 18 MovieClip Frame 1
stop();
Symbol 18 MovieClip Frame 2
stop();
Symbol 19 MovieClip Frame 1
head.gotoAndStop("attack");
Symbol 58 MovieClip Frame 1
stop();
Symbol 60 MovieClip Frame 1
_root.stop();
Symbol 60 MovieClip Frame 278
_root.play();
stop();
Symbol 172 MovieClip [player] Frame 1
stop();
Symbol 172 MovieClip [player] Frame 2
stop();
Symbol 172 MovieClip [player] Frame 3
stop();
Symbol 172 MovieClip [player] Frame 4
stop();
Symbol 172 MovieClip [player] Frame 5
stop();
Symbol 172 MovieClip [player] Frame 6
stop();
Symbol 172 MovieClip [player] Frame 7
stop();
Symbol 176 MovieClip Frame 5
stop();
Symbol 187 MovieClip [scout] Frame 1
stop();
Symbol 187 MovieClip [scout] Frame 2
stop();
Symbol 187 MovieClip [scout] Frame 3
stop();
Symbol 222 MovieClip [scoutDead] Frame 25
this.removeMovieClip();
Symbol 231 MovieClip [blood] Frame 11
this.removeMovieClip();
Symbol 237 MovieClip Frame 12
stop();
Symbol 238 MovieClip [raintosser] Frame 225
stop();
Symbol 245 MovieClip [plusTen] Frame 31
this.removeMovieClip();
Symbol 260 MovieClip Frame 5
stop();
Symbol 269 MovieClip [scout2] Frame 1
stop();
Symbol 269 MovieClip [scout2] Frame 2
stop();
Symbol 269 MovieClip [scout2] Frame 3
stop();
Symbol 292 MovieClip [scoutDead2] Frame 25
this.removeMovieClip();
Symbol 321 MovieClip [fireScoutDead] Frame 24
this.removeMovieClip();
Symbol 333 MovieClip [boomDead] Frame 15
this.removeMovieClip();
Symbol 356 MovieClip [boss] Frame 1
stop();
Symbol 356 MovieClip [boss] Frame 2
stop();
Symbol 356 MovieClip [boss] Frame 3
stop();
Symbol 357 MovieClip [bossDead] Frame 25
this.removeMovieClip();
Symbol 361 MovieClip [train] Frame 270
this.removeMovieClip();
Symbol 373 MovieClip Frame 5
stop();
Symbol 381 MovieClip [scout3] Frame 1
stop();
Symbol 381 MovieClip [scout3] Frame 2
stop();
Symbol 381 MovieClip [scout3] Frame 3
stop();
Symbol 404 MovieClip [scoutDead3] Frame 25
this.removeMovieClip();
Symbol 405 MovieClip [fade] Frame 101
this.removeMovieClip();
Symbol 447 MovieClip [ztruck] Frame 1
stop();
Symbol 447 MovieClip [ztruck] Frame 2
stop();
Symbol 450 MovieClip [boom] Frame 15
this.removeMovieClip();
Symbol 471 MovieClip Frame 5
stop();
Symbol 472 MovieClip [para] Frame 1
stop();
Symbol 472 MovieClip [para] Frame 2
stop();
Symbol 512 MovieClip [zombieMan] Frame 1
stop();
Symbol 512 MovieClip [zombieMan] Frame 2
stop();
Symbol 512 MovieClip [zombieMan] Frame 3
stop();
Symbol 512 MovieClip [zombieMan] Frame 4
stop();
Symbol 512 MovieClip [zombieMan] Frame 5
stop();
Symbol 513 MovieClip [boomDead2] Frame 15
this.removeMovieClip();
Symbol 531 MovieClip Frame 1
stop();
Symbol 531 MovieClip Frame 2
stop();
Symbol 534 MovieClip Frame 1
stop();
Symbol 534 MovieClip Frame 2
stop();
Symbol 537 MovieClip Frame 1
stop();
Symbol 537 MovieClip Frame 2
stop();
Symbol 540 MovieClip Frame 5
stop();
Symbol 545 MovieClip Frame 10
stop();
Symbol 548 MovieClip Frame 5
stop();
Symbol 557 MovieClip Frame 30
stop();
Symbol 558 MovieClip Frame 1
_root.stop();
Symbol 558 MovieClip Frame 175
_root.play();
stopAllSounds();
Symbol 565 MovieClip Frame 50
stop();
Symbol 568 MovieClip Frame 50
stop();
Symbol 570 MovieClip Frame 50
stop();
Symbol 606 MovieClip Frame 1
_root.stop();
Symbol 606 MovieClip Frame 370
_root.play();
Symbol 619 MovieClip [lift_cutscene] Frame 1
function shake() {
if (vibe == 0) {
_root._x = 0;
_root._y = 0;
vibe = vibe + 1;
} else if (vibe == 1) {
vibe = vibe + 1;
_root._x = _root._x + 2;
_root._y = _root._y + 2;
} else if (vibe == 2) {
vibe = vibe + 1;
_root._y = _root._y - 4;
_root._x = _root._x - 4;
} else if (vibe == 3) {
vibe = vibe + 1;
_root._x = _root._x + 1;
_root._y = _root._y + 1;
} else if (vibe == 4) {
vibe = vibe + 1;
_root._x = 0;
_root._y = 0;
} else if (vibe == 5) {
vibe = vibe + 1;
_root._x = 4;
_root._y = 4;
} else if (vibe == 6) {
vibe = vibe + 1;
_root._x = 2;
_root._y = 2;
} else if (vibe > 6) {
vibe = 0;
_root._x = _root._x + 1;
_root._y = _root._y + 1;
}
}
vibe = 0;
player_head_cutscene.onEnterFrame = function () {
shake();
};
Symbol 626 MovieClip Frame 75
stop();
Symbol 627 MovieClip Frame 1
_root.stop();
Symbol 627 MovieClip Frame 364
_root.play();
Symbol 630 MovieClip Frame 1
stop();
Symbol 630 MovieClip Frame 2
stop();
Symbol 645 MovieClip Frame 1
_root.stop();
Symbol 645 MovieClip Frame 150
_root.play();
Symbol 686 MovieClip Frame 1921
stop();
Symbol 691 MovieClip Frame 1
stop();
Symbol 691 MovieClip Frame 2
stop();
Symbol 696 MovieClip Frame 1
stop();
Symbol 696 MovieClip Frame 2
stop();