Frame 1
function fade(frame) {
fader.play();
fader.frame = frame;
}
Instance of Symbol 48 MovieClip in Frame 1
onClipEvent (load) {
_root.stop();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
total = _root.getBytesTotal();
percentDisplay = ("Loading..." + Math.floor((loaded / total) * 100)) + "%";
if (loaded >= total) {
_root.fade(2);
}
}
Frame 2
nextFrame();
Frame 3
stop();
Frame 4
nextFrame();
Frame 5
stop();
switch (level) {
case 1 :
maxAsians = 2;
requiredKills = 4;
asianHealth = 75;
asianDamage = 5;
asianSpeed = 1;
kingMoney = kingMoney + 1;
break;
case 2 :
maxAsians = 2;
requiredKills = 6;
asianHealth = 90;
asianDamage = 6;
kingMoney = kingMoney + 1;
break;
case 3 :
maxAsians = 3;
requiredKills = 8;
asianHealth = 100;
asianDamage = 8;
kingMoney = kingMoney + 2;
break;
case 4 :
maxAsians = 3;
requiredKills = 10;
asianHealth = 125;
asianDamage = 10;
kingMoney = kingMoney + 2;
break;
case 5 :
maxAsians = 5;
requiredKills = 14;
asianHealth = 150;
asianDamage = 12;
kingMoney = kingMoney + 3;
break;
case 6 :
maxAsians = 5;
requiredKills = 14;
asianHealth = 150;
asianDamage = 14;
kingMoney = kingMoney + 3;
break;
case 7 :
maxAsians = 8;
requiredKills = 25;
asianHealth = 170;
asianDamage = 14;
kingMoney = kingMoney + 4;
break;
case 8 :
maxAsians = 10;
requiredKills = 32;
asianHealth = 180;
asianDamage = 16;
kingMoney = kingMoney + 5;
break;
case 9 :
maxAsians = 12;
requiredKills = 40;
asianHealth = 190;
asianDamage = 18;
kingMoney = kingMoney + 6;
break;
case 10 :
gotoAndStop ("boss");
}
killCount = 0;
damaged = 0;
soundThing = 0;
u = 2;
while (u <= maxAsians) {
if (_currentframe == 5) {
duplicateMovieClip (asian1, "asian" + u, this.getNextHighestDepth());
}
u++;
}
i = 0;
levelBugFix = 0;
onEnterFrame = function () {
status = ((((((((("Level " + level) + ": ") + Math.round((damaged / (requiredKills * asianHealth)) * 100)) + "%<br>Armor/Damage: ") + kingArmor) + "/") + kingDamage) + "<br>Zombies Remaining: ") + (requiredKills - killCount)) + "<br>Press ESC to quit.";
if (_currentframe == 5) {
if (Key.isDown(27)) {
fade("menu");
}
if ((killCount >= requiredKills) && (levelBugFix <= 0)) {
level++;
levelBugFix++;
fade("shop");
}
if (kingHealth <= 0) {
a = 1;
while (a <= maxAsians) {
_root["asian" + a].removeMovieClip();
a++;
}
fade("gameOver");
}
if (king._x < (-(king._width / 2))) {
king._x = 550 + (king._width / 2);
} else if (king._x > (550 + (king._width / 2))) {
king._x = -(king._width / 2);
}
if (king._y < (-(king._height / 2))) {
king._y = 400 + (king._height / 2);
} else if (king._y > (400 + (king._height / 2))) {
king._y = -(king._height / 2);
}
if (Key.isDown(38)) {
king._x = king._x + (Math.cos(((king._rotation - 90) * Math.PI) / 180) * kingSpeed);
king._y = king._y + (Math.sin(((king._rotation - 90) * Math.PI) / 180) * kingSpeed);
}
if (Key.isDown(40)) {
king._x = king._x - ((Math.cos(((king._rotation - 90) * Math.PI) / 180) * kingSpeed) / 2);
king._y = king._y - ((Math.sin(((king._rotation - 90) * Math.PI) / 180) * kingSpeed) / 2);
}
if (Key.isDown(37)) {
king._rotation = king._rotation - kingSpeed;
} else if (Key.isDown(39)) {
king._rotation = king._rotation + kingSpeed;
}
if (Key.isDown(32)) {
flamethrower = true;
if (soundThing <= 0) {
}
soundThing++;
i++;
newName = "f" + i;
attachMovie("fireball", newName, this.getNextHighestDepth());
_root[newName]._x = king._x + (Math.cos(((king._rotation - 90) * Math.PI) / 180) * 80);
_root[newName]._y = king._y + (Math.sin(((king._rotation - 90) * Math.PI) / 180) * 80);
_root[newName].xSpeed = Math.cos(((king._rotation - 90) * Math.PI) / 180) * (kingSpeed + 2);
_root[newName].ySpeed = Math.sin(((king._rotation - 90) * Math.PI) / 180) * (kingSpeed + 2);
_root[newName].onEnterFrame = function () {
this._x = this._x + this.xSpeed;
this._y = this._y + this.ySpeed;
this._rotation = Math.random() * 360;
this._alpha = this._alpha - kingRange;
if (((((((this._alpha < 0) || (this._x > 550)) || (this._y < 0)) || (this._x < 0)) || (this._y > 400)) || (kingHealth <= 0)) || (_root._currentframe == 6)) {
this.removeMovieClip();
}
o = 1;
while (o <= maxAsians) {
if (this.hitTest(_root["asian" + o].hitPoint)) {
_root["asian" + o].health = _root["asian" + o].health - kingDamage;
this.removeMovieClip();
damaged = damaged + kingDamage;
}
o++;
}
};
} else {
soundThing = 0;
flamethrower = false;
}
}
};
Instance of Symbol 75 MovieClip in Frame 5
onClipEvent (load) {
gotoAndStop(_root.level);
}
Instance of Symbol 44 MovieClip [asian] "asian1" in Frame 5
onClipEvent (load) {
function rand(min, max) {
return(Math.round((Math.random() * (max - min)) + min));
}
function reset() {
gotoAndStop (1);
colour.gotoAndStop(rand(1, 4));
fromDirection = rand(1, 4);
switch (fromDirection) {
case 1 :
_x = rand(0, 550);
_y = (-_height);
break;
case 2 :
_x = rand(0, 550);
_y = (400 + _height);
break;
case 3 :
_y = rand(0, 400);
_x = (-_width);
break;
case 4 :
_y = rand(0, 400);
_x = (550 + _width);
}
health = _parent.asianHealth;
damage = _parent.asianDamage;
}
reset();
}
onClipEvent (enterFrame) {
_rotation = (((Math.atan2(_parent.king._y - _y, _parent.king._x - _x) * 180) / Math.PI) + 90);
if (!hands.hitTest(_parent.king.hitPoint)) {
_x = (_x + (Math.cos(((_rotation - 90) * Math.PI) / 180) * _parent.asianSpeed));
_y = (_y + (Math.sin(((_rotation - 90) * Math.PI) / 180) * _parent.asianSpeed));
} else {
attacking.play();
}
if ((health <= 0) && (_currentframe == 1)) {
play();
}
if (_root._currentframe == 6) {
this.removeMovieClip();
_x = -1000;
}
}
Instance of Symbol 79 MovieClip in Frame 5
onClipEvent (load) {
stop();
}
onClipEvent (enterFrame) {
if (_root.flamethrower) {
play();
} else {
gotoAndStop (1);
}
}
Instance of Symbol 82 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (_root.kingHealth <= 100) {
_xscale = ((_root.kingHealth / 100) * 100);
} else if (_root.kingHealth > 100) {
_xscale = 100;
}
}
Instance of Symbol 96 MovieClip in Frame 5
onClipEvent (load) {
gotoAndStop(_root.level);
counter = 0;
}
onClipEvent (enterFrame) {
counter++;
if (counter > 40) {
_rotation = (_rotation - 5);
_y = (_y + 20);
}
}
Frame 6
onEnterFrame = function () {
moneyDisplay = "$" + (kingMoney * 10);
status = ((((((("Level " + level) + "<br>Armor/Damage: ") + kingArmor) + "/") + kingDamage) + "<br>Zombies Remaining: ") + (requiredKills - killCount)) + "<br>Press ESC to quit.";
if (Key.isDown(27) && (_currentframe == 6)) {
fade("menu");
}
};
Instance of Symbol 107 MovieClip in Frame 6
onClipEvent (enterFrame) {
if ((_root.kingHealth >= 100) || (_root.kingMoney < 1)) {
_visible = false;
}
}
on (release) {
if ((_root.kingMoney >= 1) && (_root.kingHealth < 100)) {
_root.kingHealth = _root.kingHealth + 20;
_root.kingMoney--;
}
}
on (rollOver) {
gotoAndStop (2);
}
on (rollOut) {
gotoAndStop (1);
}
onClipEvent (load) {
stop();
}
Instance of Symbol 111 MovieClip in Frame 6
onClipEvent (enterFrame) {
if (_root.kingMoney < 1) {
_visible = false;
}
}
on (release) {
if (_root.kingMoney >= 1) {
_root.kingArmor = _root.kingArmor + 1;
_root.kingMoney--;
}
}
on (rollOver) {
gotoAndStop (2);
}
on (rollOut) {
gotoAndStop (1);
}
onClipEvent (load) {
stop();
}
Instance of Symbol 115 MovieClip in Frame 6
onClipEvent (enterFrame) {
if (_root.kingMoney < 1) {
_visible = false;
}
}
on (release) {
if (_root.kingMoney >= 1) {
_root.kingDamage = _root.kingDamage + 0.5;
_root.kingMoney--;
}
}
on (rollOver) {
gotoAndStop (2);
}
on (rollOut) {
gotoAndStop (1);
}
onClipEvent (load) {
stop();
}
Instance of Symbol 119 MovieClip in Frame 6
onClipEvent (enterFrame) {
if ((_root.kingMoney < 1) || (_root.kingRange < 0)) {
_visible = false;
}
}
on (release) {
if ((_root.kingMoney >= 1) && (_root.kingRange > 0)) {
_root.kingRange = _root.kingRange - 1;
_root.kingMoney--;
}
}
on (rollOver) {
gotoAndStop (2);
}
on (rollOut) {
gotoAndStop (1);
}
onClipEvent (load) {
stop();
}
Frame 7
stop();
asianDamage = 6;
asianHealth = 75;
maxAsians = 2;
asianSpeed = 1;
killCount = 0;
i = 0;
levelBugFix = 0;
onEnterFrame = function () {
status = ((((("BOSS: " + Math.round((boss.health / 5500) * 100)) + "%<br>Armor/Damage: ") + kingArmor) + "/") + kingDamage) + "<br>Press ESC to quit.";
if (_currentframe == 7) {
if (Key.isDown(27)) {
fade("menu");
}
if (kingHealth <= 0) {
a = 1;
while (a <= maxAsians) {
_root["asian" + a].removeMovieClip();
a++;
}
fade("gameOver");
}
if (king._x < (-(king._width / 2))) {
king._x = 550 + (king._width / 2);
} else if (king._x > (550 + (king._width / 2))) {
king._x = -(king._width / 2);
}
if (king._y < (-(king._height / 2))) {
king._y = 400 + (king._height / 2);
} else if (king._y > (400 + (king._height / 2))) {
king._y = -(king._height / 2);
}
if (Key.isDown(38)) {
king._x = king._x + (Math.cos(((king._rotation - 90) * Math.PI) / 180) * kingSpeed);
king._y = king._y + (Math.sin(((king._rotation - 90) * Math.PI) / 180) * kingSpeed);
}
if (Key.isDown(40)) {
king._x = king._x - ((Math.cos(((king._rotation - 90) * Math.PI) / 180) * kingSpeed) / 2);
king._y = king._y - ((Math.sin(((king._rotation - 90) * Math.PI) / 180) * kingSpeed) / 2);
}
if (Key.isDown(37)) {
king._rotation = king._rotation - kingSpeed;
} else if (Key.isDown(39)) {
king._rotation = king._rotation + kingSpeed;
}
if (Key.isDown(32)) {
flamethrower = true;
i++;
newName = "f" + i;
attachMovie("fireball", newName, this.getNextHighestDepth());
_root[newName]._x = king._x + (Math.cos(((king._rotation - 90) * Math.PI) / 180) * 80);
_root[newName]._y = king._y + (Math.sin(((king._rotation - 90) * Math.PI) / 180) * 80);
_root[newName].xSpeed = Math.cos(((king._rotation - 90) * Math.PI) / 180) * (kingSpeed + 2);
_root[newName].ySpeed = Math.sin(((king._rotation - 90) * Math.PI) / 180) * (kingSpeed + 2);
_root[newName].onEnterFrame = function () {
this._x = this._x + this.xSpeed;
this._y = this._y + this.ySpeed;
this._rotation = Math.random() * 360;
this._alpha = this._alpha - kingRange;
if (((((((this._alpha < 0) || (this._x > 550)) || (this._y < 0)) || (this._x < 0)) || (this._y > 400)) || (kingHealth <= 0)) || (_root._currentframe == 6)) {
this.removeMovieClip();
}
o = 1;
while (o <= maxAsians) {
if (this.hitTest(_root["asian" + o].hitPoint)) {
_root["asian" + o].health = _root["asian" + o].health - kingDamage;
this.removeMovieClip();
}
if (this.hitTest(_root.boss.hitPoint)) {
_root.boss.health = _root.boss.health - kingDamage;
this.removeMovieClip();
}
o++;
}
};
} else {
flamethrower = false;
}
}
};
Instance of Symbol 122 MovieClip "boss" in Frame 7
onClipEvent (load) {
stop();
colour.gotoAndStop(5);
timer = 0;
health = 5500;
damage = 5;
i = 0;
timerthing = 0;
dead = false;
specialHitTimer = 0;
}
onClipEvent (enterFrame) {
timer++;
specialHitTimer++;
_rotation = (((Math.atan2(_parent.king._y - _y, _parent.king._x - _x) * 180) / Math.PI) + 90);
if (!dead) {
if (specialHitTimer > 150) {
attacking.play();
_root.attachMovie("bossFlame", "bossFlame", _root.getNextHighestDepth());
specialHitTimer = 0;
}
if (timer < 300) {
if (!hands.hitTest(_root.king.hitPoint)) {
_x = (_x + (Math.cos(((_rotation - 90) * Math.PI) / 180) * 0.5));
_y = (_y + (Math.sin(((_rotation - 90) * Math.PI) / 180) * 0.5));
} else {
attacking.play();
}
} else {
i++;
_root.attachMovie("bossMissile", "bossMissile" + i, _root.getNextHighestDepth());
timer = 0;
}
}
if (health <= 0) {
_xscale = (_xscale + 10);
_yscale = (_yscale + 10);
timerthing++;
dead = true;
if (timerthing > 100) {
_root.fade("gameClear");
}
}
}
Instance of Symbol 44 MovieClip [asian] "asian1" in Frame 7
onClipEvent (load) {
function rand(min, max) {
return(Math.round((Math.random() * (max - min)) + min));
}
function reset() {
gotoAndStop (1);
colour.gotoAndStop(rand(1, 4));
fromDirection = rand(1, 4);
switch (fromDirection) {
case 1 :
_x = rand(0, 550);
_y = (-_height);
break;
case 2 :
_x = rand(0, 550);
_y = (400 + _height);
break;
case 3 :
_y = rand(0, 400);
_x = (-_width);
break;
case 4 :
_y = rand(0, 400);
_x = (550 + _width);
}
health = _parent.asianHealth;
damage = _parent.asianDamage;
}
reset();
}
onClipEvent (enterFrame) {
_rotation = (((Math.atan2(_parent.king._y - _y, _parent.king._x - _x) * 180) / Math.PI) + 90);
if (!hands.hitTest(_parent.king.hitPoint)) {
_x = (_x + (Math.cos(((_rotation - 90) * Math.PI) / 180) * _parent.asianSpeed));
_y = (_y + (Math.sin(((_rotation - 90) * Math.PI) / 180) * _parent.asianSpeed));
} else {
attacking.play();
}
if ((health <= 0) && (_currentframe == 1)) {
play();
}
if (_root._currentframe == 6) {
this.removeMovieClip();
_x = -1000;
}
if (_root.boss.dead) {
_x = -1000;
}
}
Instance of Symbol 44 MovieClip [asian] "asian2" in Frame 7
onClipEvent (load) {
function rand(min, max) {
return(Math.round((Math.random() * (max - min)) + min));
}
function reset() {
gotoAndStop (1);
colour.gotoAndStop(rand(1, 4));
fromDirection = rand(1, 4);
switch (fromDirection) {
case 1 :
_x = rand(0, 550);
_y = (-_height);
break;
case 2 :
_x = rand(0, 550);
_y = (400 + _height);
break;
case 3 :
_y = rand(0, 400);
_x = (-_width);
break;
case 4 :
_y = rand(0, 400);
_x = (550 + _width);
}
health = _parent.asianHealth;
damage = _parent.asianDamage;
}
reset();
}
onClipEvent (enterFrame) {
_rotation = (((Math.atan2(_parent.king._y - _y, _parent.king._x - _x) * 180) / Math.PI) + 90);
if (!hands.hitTest(_parent.king.hitPoint)) {
_x = (_x + (Math.cos(((_rotation - 90) * Math.PI) / 180) * _parent.asianSpeed));
_y = (_y + (Math.sin(((_rotation - 90) * Math.PI) / 180) * _parent.asianSpeed));
} else {
attacking.play();
}
if ((health <= 0) && (_currentframe == 1)) {
play();
}
if (_root._currentframe == 6) {
this.removeMovieClip();
_x = -1000;
}
if (_root.boss.dead) {
_x = -1000;
}
}
Instance of Symbol 79 MovieClip in Frame 7
onClipEvent (load) {
stop();
}
onClipEvent (enterFrame) {
if (_root.flamethrower) {
play();
} else {
gotoAndStop (1);
}
}
Instance of Symbol 96 MovieClip in Frame 7
onClipEvent (load) {
gotoAndStop (10);
counter = 0;
}
onClipEvent (enterFrame) {
counter++;
if (counter > 40) {
_rotation = (_rotation - 5);
_y = (_y + 20);
}
}
Instance of Symbol 137 MovieClip in Frame 11
onClipEvent (enterFrame) {
if (Key.isDown(27)) {
_root.fade("menu");
}
}
Symbol 20 MovieClip [bossMissile] Frame 1
_rotation = _root.boss._rotation;
stop();
_x = (_root.boss._x + (Math.cos(((_root.boss._rotation - 90) * Math.PI) / 180) * 100));
_y = (_root.boss._y + (Math.sin(((_root.boss._rotation - 90) * Math.PI) / 180) * 100));
active = true;
onEnterFrame = function () {
_x = (_x + (Math.cos(((_rotation - 90) * Math.PI) / 180) * 2));
_y = (_y + (Math.sin(((_rotation - 90) * Math.PI) / 180) * 2));
if (hitTest(_root.king.hitPoint)) {
if (active) {
_root.kingHealth = _root.kingHealth - 50;
active = false;
play();
}
}
if (((((_x < (-_width)) || (_x > (550 + _width))) || (_y < (-_height))) || (_y > (400 + _height))) || (_root._currentframe != 7)) {
this.removeMovieClip();
}
};
Symbol 20 MovieClip [bossMissile] Frame 7
this.removeMovieClip();
Symbol 25 MovieClip [bossFlame] Frame 1
onEnterFrame = function () {
_x = _root.king._x;
_y = _root.king._y;
if (_root._currentframe != 7) {
this.removeMovieClip();
}
};
Symbol 25 MovieClip [bossFlame] Frame 9
this.removeMovieClip();
Symbol 35 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 6
_root.kingHealth = _root.kingHealth - (_parent.damage - _root.kingArmor);
Symbol 37 MovieClip Frame 1
_visible = false;
Symbol 44 MovieClip [asian] Frame 29
reset();
_root.killCount++;
Symbol 54 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 2
mx.behaviors.DepthControl.bringToFront(this);
Symbol 54 MovieClip Frame 6
_root.gotoAndStop(frame);
Symbol 138 MovieClip [__Packages.mx.behaviors.DepthControl] Frame 0
class mx.behaviors.DepthControl extends Object
{
function DepthControl () {
super();
}
static function sendToBack(target) {
var _local2 = false;
while (_local2 == false) {
sendBackward(target);
_local2 = target == getInstanceAtLowest(target._parent);
}
}
static function bringToFront(target) {
var _local2 = false;
while (_local2 == false) {
bringForward(target);
_local2 = target == getInstanceAtHighest(target._parent);
}
}
static function sendBackward(target) {
var _local2 = trackDepths(target._parent);
if (target != getInstanceAtLowest(target._parent)) {
target.swapDepths(getInstanceLowerThan(target));
}
}
static function bringForward(target) {
if (target != getInstanceAtHighest(target._parent)) {
target.swapDepths(getInstanceHigherThan(target));
}
}
static function trackDepths(mcParent) {
var _local4 = [];
for (var _local5 in mcParent) {
if (typeof(mcParent[_local5]) == "movieclip") {
_local4.push({mc:mcParent[_local5], depth:mcParent[_local5].getDepth()});
}
}
_local4.sort(orderFunc);
return(_local4);
}
static function orderFunc(a, b) {
var _local2 = Number(a.depth);
var _local1 = Number(b.depth);
if (_local2 > _local1) {
return(-1);
}
if (_local1 > _local2) {
return(1);
}
return(0);
}
static function getInstanceAtLowest(targetParent) {
var _local1 = trackDepths(targetParent);
return(_local1[_local1.length - 1].mc);
}
static function getInstanceAtHighest(targetParent) {
var _local1 = trackDepths(targetParent);
return(_local1[0].mc);
}
static function getInstanceLowerThan(target) {
var _local2 = trackDepths(target._parent);
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1].mc == target) {
break;
}
_local1++;
}
return(_local2[_local1 + 1].mc);
}
static function getInstanceHigherThan(target) {
var _local2 = trackDepths(target._parent);
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1].mc == target) {
break;
}
_local1++;
}
return(_local2[_local1 - 1].mc);
}
}
Symbol 61 Button
on (release) {
level = 1;
kingSpeed = 10;
kingDamage = 1;
kingArmor = 0;
kingRange = 5;
kingHealth = 100;
kingMoney = 0;
fade("intro");
}
Symbol 64 Button
on (release) {
fade("credits");
}
Symbol 102 Button
on (release) {
fade("game");
}
Symbol 128 Button
on (press) {
fade("menu");
}
Symbol 137 MovieClip Frame 557
_root.fade("menu");