Frame 1
function check_domain() {
if (_root._url.indexOf("kongregate.com") > -1) {
_global.kongregate_site = true;
} else if (_root._url.indexOf("agame.com") > -1) {
_global.kongregate_site = true;
} else if (_root._url.indexOf("mindjolt.com") > -1) {
_global.mindjolt_site = true;
}
}
_global.mindjolt_site = false;
_global.kongregate_site = false;
check_domain();
com.mindjolt.api.as2.MindJoltSponsoredAPI.connect("FD182UV7", "359C545EBB9F89F2");
startGameCounter = 0;
var framesLoaded = this.getBytesLoaded();
var totalFrames = this.getBytesTotal();
var percentLoaded2 = int(((framesLoaded - 382031) / (totalFrames - 382031)) * 100);
loadingScreen.loadingTxt = percentLoaded2 + " %";
loadingScreen.gotoAndStop(percentLoaded2 / 2);
if (_global.kongregate_site == false) {
var CPMStarContentSpotID = "167Q13C1FA91";
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + CPMStarContentSpotID);
}
loadingScreen.stop();
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("383463ce", this, 10301, true);
Frame 3
if (framesLoaded == totalFrames) {
gotoAndPlay ("display_ad");
} else {
gotoAndPlay ("loop1");
}
Frame 5
if (startGameCounter == 100) {
if (_global.kongregate_site == false) {
gotoAndStop ("show_btn");
} else {
gotoAndStop ("show_mj_anim");
}
} else {
startGameCounter++;
gotoAndPlay ("display_ad");
}
Frame 8
stop();
sounds = new Object();
sounds.fire = new Sound(this);
sounds.fire.attachSound("pistolFx");
sounds.fireMissile = new Sound(this);
sounds.fireMissile.attachSound("bing");
sounds.musicObject = new Sound(this);
sounds.musicObject.attachSound("music");
sounds.graveYardWind = new Sound(this);
sounds.graveYardWind.attachSound("graveyardwindFx");
sounds.doh = new Sound(this);
sounds.doh.attachSound("doh");
sounds.cheer = new Sound(this);
sounds.cheer.attachSound("cheer");
sounds.popFX = new Sound(this);
sounds.popFX.attachSound("pop");
sounds.extraPoints = new Sound(this);
sounds.extraPoints.attachSound("bonusx4");
sounds.levelComplete = new Sound(this);
sounds.levelComplete.attachSound("gainlife");
sounds.Explosion = new Sound(this);
sounds.Explosion.attachSound("explosion");
sounds.GameOverRobot = new Sound(this);
sounds.GameOverRobot.attachSound("GameOverFx");
sounds.Appear = new Sound(this);
sounds.Appear.attachSound("Appear");
sounds.chainSaw = new Sound(this);
sounds.chainSaw.attachSound("chainsawFx");
sounds.moanFx = new Sound(this);
sounds.moanFx.attachSound("moanFx");
sounds.machineGunFx = new Sound(this);
sounds.machineGunFx.attachSound("machinegunFx");
sounds.batFx = new Sound(this);
sounds.batFx.attachSound("batFx");
sounds.flameThrowerFx = new Sound(this);
sounds.flameThrowerFx.attachSound("flamethrowerFx");
sounds.pickupMediPackFx = new Sound(this);
sounds.pickupMediPackFx.attachSound("pickupMediPackFx");
sounds.pickupMoneyFx = new Sound(this);
sounds.pickupMoneyFx.attachSound("pickupMoneyFx");
var buildItems = new Array("woodenFence", "brickWall", "electicFence", "mines", "radar");
var buildItemsNames = new Array("wooden fence", "brick wall", "electic fence", "mines", "radar");
var upgradeNames = new Array("Bat", "Pistol", "Shotgun", "Rifle", "Machine Gun", "Chainsaw", "Molokov", "Flame thrower", "Flak Jacket", "Silver Bullets");
var upgradePrices = new Array(5, 20, 35, 100, 95, 30, 150, 200, 10, 20);
function setupGame() {
Game = new GameGame(gameMc, this, 700, 576, 25, 20, startLives);
Presentation = new GamePresentation(this);
Presentation.setupSplashScreen(splashScreenElements);
sounds.graveYardWind.start(0, 999);
this.onEnterFrame = mainLoop;
}
function runSounds() {
if (soundFade == "out") {
soundFadeControl = soundFadeControl - 2;
setAllSounds(soundFadeControl);
if (soundFadeControl == 0) {
soundSwitch = "off";
soundFade = "done";
}
} else if (soundFade == "in") {
soundFadeControl = soundFadeControl + 2;
setAllSounds(soundFadeControl);
if (soundFadeControl >= 50) {
soundSwitch = "on";
soundFade = "done";
}
}
}
function setAllSounds(soundFadeControl) {
sounds.fire.setVolume(soundFadeControl);
sounds.fireMissile.setVolume(soundFadeControl);
sounds.musicObject.setVolume(soundFadeControl);
sounds.doh.setVolume(soundFadeControl);
sounds.cheer.setVolume(soundFadeControl);
sounds.popFX.setVolume(soundFadeControl);
sounds.extraPoints.setVolume(soundFadeControl);
sounds.levelComplete.setVolume(soundFadeControl);
sounds.Explosion.setVolume(soundFadeControl);
sounds.GameOverRobot.setVolume(soundFadeControl);
sounds.Appear.setVolume(soundFadeControl);
sounds.GotSaucer.setVolume(soundFadeControl);
}
function quitGame() {
obj.vx = 0;
obj.vy = 0;
Game.score2 = 0;
Player.myCurrentScore = 0;
obj.clip.removeMovieClip();
Game.msgMc.removeMovieClip();
Game.gameState = "game_over_restart";
}
function clearSprites() {
var _local3 = Game.missilesArray.length - 1;
var _local1 = _local3;
while (_local1 >= 0) {
Game.missilesArray[_local1].remove();
_local1--;
}
var _local2 = Game.enemyArray.length - 1;
_local1 = _local2;
while (_local1 >= 0) {
Game.enemyArray[_local1].remove();
_local1--;
}
}
function mainLoop() {
runSounds();
if (Game.gameState == "setup") {
Presentation.splashScreenMc.removeMovieClip();
clearSprites();
Game.clockDelay = 2;
Player = new GamePlayer(Game.playerMc, this, 340, 330, Key);
Game.setupGerms();
Game.msgMc = Game.inGameMsgsMc.attachMovie("getReadyMsgAnim", "getready", 1);
Game.msgMc._x = Game.movieWidth / 2;
Game.msgMc._y = (Game.movieHeight / 2) - 40;
obj.vx = 3;
obj.vy = 0;
obj.x = Game.xPlayerStart;
obj.y = Game.yPlayerStart;
Game.minutes = Game.StartTimer;
Game.sec = 0;
Game.displayTime();
Game.sizeTarget = balloonLevelSizes[Game.levelNumber - 1];
Game.lives = startLives;
Game.setLives();
Game.setTarget();
Game.setScore();
Game.setScore2();
Game.setLevel();
Player.xOrigin = _xmouse;
Player.xPos = 0;
Game.oldMouseX = _xmouse;
Game.oldMouseY = _ymouse;
Game.changeStatsColour();
if (musicPlaying == "off") {
Game.turnMusicOff();
} else {
Game.turnMusicOn();
}
Game.gameState = "pre_start";
} else if (Game.gameState == "start_new_level") {
Game.levelNumber++;
Game.newZombies();
Game.clockDelay = 10;
Game.msgMc = Game.inGameMsgsMc.attachMovie("getReadyMsgAnim", "getready", 1);
Game.msgMc._x = Game.movieWidth / 2;
Game.msgMc._y = (Game.movieHeight / 2) - 40;
Game.setLives();
Game.setTarget();
Game.setScore();
Game.setScore2();
Game.setLevel();
Game.gameState = "pre_start";
} else if (Game.gameState == "restart") {
Game.score = 0;
Game.setScore();
Game.gameState = "pre_start";
} else if (Game.gameState == "game_over_restart") {
Game.turnOffTip();
clearSprites();
Game.enemyArray.splice(0);
Game.clockDelay = 2;
Presentation.setupSplashScreen(splashScreenElements);
Game.score = 0;
Game.levelNumber = 1;
Game.bonusCountArray.splice(0);
Player.myCurrentScore = 0;
Game.gameState = "waiting_to_start";
} else if (Game.gameState == "pre_start") {
Game.mainLoop();
} else if (Game.gameState == "start_game") {
Game.mainLoop();
} else if (Game.gameState == "display_bonus") {
bonusCountDelay--;
if (bonusCountDelay == 0) {
bonusCountDelay = 1;
if (Game.timeBonus > Game.currentTimeBonus) {
Game.currentTimeBonus++;
Game.msgMc.msg.timeBonus.text = ("+" + Game.currentTimeBonus) + "x1";
Game.score = Game.score + 1;
Game.setScore();
} else {
Game.msgMc.msg.totalScore.text = Game.score;
Game.setScore();
Game.msgMc.play();
}
}
} else if (Game.gameState == "play") {
Game.mainLoop();
}
}
function setupGoodGuy(mCName, xStart, yStart, grav, rg) {
var _local3 = Game.inGameObjectsMc.attachMovie(mCName, "gg" + Game.numberOfDropped, Game.numberOfDropped);
var _local2 = Useful1.RandomNumber(5, 10);
_local2 = _local2 / 10;
Game.goodGuysArray.push(new GoodGuy(_local3, this, xStart, yStart, _local2, mCName, grav, rg));
}
function setupPickups() {
var _local3 = 0;
while (_local3 < Game.levelHeightBlocks) {
var _local1 = 0;
while (_local1 < Game.levelWidthBlocks) {
var _local2 = (_local3 * Game.levelWidthBlocks) + _local1;
if ((_local3 == 0) or (_local3 == (Game.levelHeightBlocks - 3))) {
squareNamesArray[_local2] = "edgeSquare";
} else if ((_local1 == 0) or (_local1 == (Game.levelWidthBlocks - 1))) {
squareNamesArray[_local2] = "edgeSquare";
} else {
squareNamesArray[_local2] = "square";
}
_local1++;
}
_local3++;
}
}
function setupPanel() {
ix = 0;
iy = 0;
ii = 0;
var _local2 = 0;
while (_local2 < gameObjectNames.length) {
var _local1 = Game.inGameStatsMc.ingamestatsmc;
_local1 = _local1.wg;
_local1 = _local1["w" + (_local2 + 1)];
_local1 = _local1.wb;
Game.rightPanelGameObjects[_local2] = _local1;
Game.rightPanelGameObjects[_local2].indexA = _local2;
Game.rightPanelGameObjects[_local2].gameObjectBtn.onRelease = clickRightPanelObject;
Game.rightPanelGameObjects[_local2].gameObjectBtn.onRollOver = rollOverRightPanelObject;
Game.rightPanelGameObjects[_local2].gameObjectBtn.onRollOut = rollOutRightPanelObject;
_local2++;
}
}
function clickRightPanelObject() {
Game.currentPickedUp = mousePointer.attachMovie(rightPanelGameObjectNames[this._parent.indexA], "pickedup", 1);
if (gameObjectRange[this._parent.indexA] != 0) {
rangeCircle = mousePointer.attachMovie(gameObjectRange[this._parent.indexA], "range", 0);
rangeCircle._x = rangeCircle._x + (blockSize / 2);
rangeCircle._y = rangeCircle._y + (blockSize / 2);
} else {
removeMovieClip(rangeCircle);
}
Game.currentPickedUp.indexA = this._parent.indexA;
}
function rollOverRightPanelObject() {
}
function rollOutRightPanelObject() {
}
function dropGameObject() {
var _local4 = _xmouse;
var _local3 = _ymouse;
if (Game.currentPickedUp != undefined) {
if (checkIfOverLapping() == true) {
var _local5 = 0;
var _local2 = gameObjectCost[Game.currentPickedUp.indexA];
var _local1 = Game.score;
_local1 = _local1 - _local2;
if (_local1 >= 0) {
setupGoodGuy("magnet1", _local4, _local3, 0.7, 100);
if (rt.gameObjectNames[currentPickedUp.indexA] != "magnet") {
}
Game.numberOfDropped++;
}
}
}
}
function checkIfOverLapping() {
if ((_xmouse > (736 - blockSize)) or (_xmouse < blockSize)) {
return(false);
}
return(true);
}
var gameMc = this.createEmptyMovieClip("gameMc", 0);
var CollisionDetection1 = new CollisionDetection();
var ballColour = new Array("orange", "purple", "green", "blue", "red");
var Useful1 = new Useful();
var scrollOff = 0;
var startReal = true;
var Game;
var Presentation;
var Player;
var Background;
var Wave;
var SoundClass;
var parallaxLayersNames = new Array();
obj = {x:ball._x, y:ball._y, vx:3, vy:0};
var xLevelStart = 0;
var yLevelStart = -2100;
var ballMc;
keyboard = new Object();
var PLAYER_STATUS = "";
var keypress = 0;
keyboard.onKeyDown = function () {
if (Game.gameState == "play") {
if (Key.getCode() == 49) {
Game.personSelect(0);
} else if (Key.getCode() == 50) {
Game.personSelect(1);
} else if (Key.getCode() == 51) {
Game.personSelect(2);
} else if (Key.getCode() == 52) {
Game.personSelect(3);
} else if (Key.getCode() == 53) {
Game.personSelect(4);
} else if (Key.getCode() == 54) {
Game.personSelect(5);
} else if (Key.getCode() == 55) {
Game.personSelect(6);
} else if (Key.getCode() == 56) {
Game.personSelect(7);
} else if (Key.getCode() == 57) {
Game.personSelect(8);
} else if (Key.getCode() == 48) {
Game.personSelect(9);
}
}
};
keyboard.onKeyUp = function () {
if (PLAYER_STATUS == "UP") {
if (Key.getCode() == 38) {
Player.currentColour--;
if (Player.currentColour < 0) {
Player.currentColour = 4;
}
PLAYER_STATUS = "";
}
} else if (PLAYER_STATUS == "DOWN") {
if (Key.getCode() == 40) {
Player.currentColour++;
if (Player.currentColour > 4) {
Player.currentColour = 0;
}
PLAYER_STATUS = "";
}
}
if (Key.getCode() == 80) {
if (Game.pauseSwitch == false) {
if (Game.gameState == "play") {
Game.pauseOn();
}
} else {
Game.pauseOff();
}
}
if (keypress == 1) {
if (Key.getCode() == 65) {
Player.currentColour--;
if (Player.currentColour < 0) {
Player.currentColour = 4;
}
}
} else if (keypress == 2) {
if (Key.getCode() == 83) {
Player.currentColour++;
if (Player.currentColour > 4) {
Player.currentColour = 0;
}
}
}
};
Key.addListener(keyboard);
var squareNamesArray = new Array();
var mousePointer = this.attachMovie("crosshair", "crosshair", 50);
mousePointer.yOld = 0;
var bonusCountDelay = 1;
var titleInfo = {mCName:"title", xPos:80, yPos:30};
var playInfo = {mCName:"playBtnAnim", xPos:170, yPos:120};
var instructionsInfo = {mCName:"instructionsBtnAnim", xPos:60, yPos:200};
var controlsInfo = {mCName:"controlsBtnAnim", xPos:80, yPos:240};
var highscoresInfo = {mCName:"highscoresBtnAnim", xPos:60, yPos:400};
var SplashMusicBtn = {mCName:"SplashMusicBtn", xPos:250, yPos:460};
var moreGamesBtn = {mCName:"moreGamesBtn", xPos:260, yPos:340};
if (_global.mindjolt_site == true) {
var splashScreenElements = [playInfo, instructionsInfo, controlsInfo, SplashMusicBtn, moreGamesBtn];
} else {
var splashScreenElements = [playInfo, instructionsInfo, controlsInfo, highscoresInfo, SplashMusicBtn, moreGamesBtn];
}
var startLives = 3000;
mousePointer.onEnterFrame = function () {
if (Game.pickedUpItem != "") {
var _local3 = int(_xmouse / Game.blockSize);
var _local2 = int(_ymouse / Game.blockSize);
_local3 = _local3 * Game.blockSize;
_local2 = _local2 * Game.blockSize;
this._x = _local3;
this._y = _local2;
} else {
this._x = _xmouse;
yOld = this._y;
this._y = _ymouse;
}
};
var mouseButton = false;
var mouseButtonUp = false;
this.onMouseUp = function () {
mouseButton = false;
mouseButtonUp = true;
};
this.onMouseDown = function () {
mouseButton = true;
};
var soundControl = 1;
var soundFade;
var soundFadeControl = 100;
soundMc.soundBtn.onRelease = function () {
if (soundControl == 0) {
soundControl = 1;
soundFade = "in";
soundMc.soundControlMc.gotoAndStop(1);
} else {
soundControl = 0;
soundFade = "out";
soundMc.soundControlMc.gotoAndStop(2);
}
};
var soundSwitch = "on";
var musicPlaying = "on";
var rightPanelGameObjectNames = new Array("gameObject4", "gameObject3", "gameObject1", "gameObject2", "gameObject5", "gameObject1", "gameObject1", "gameObject1", "gameObject1");
var gameObjectNames = new Array("moneyDrop", "manWithBat", "tower1", "redTurret", "blueTurret", "spaceMine", "blueForceField", "towerBase", "towerBase", "towerBase", "towerBase");
var gameObjectCost = Array(1, 10, 20, 15, 5, 4, 3, 2, 1);
var gameObjectRange = Array("shortRangeCircle", "longRangeCircle", 0, 0, 0, 0, 0, 0);
setupGame();
setupPanel();
var blockSize = 32;
stop();
Symbol 25 MovieClip [energyBar2] Frame 23
enemy.energyBarOn = 0;
this.removeMovieClip();
Symbol 26 MovieClip [explosion] Frame 1
var z = 0;
var Count = 0;
var particles = this.createEmptyMovieClip("particles", 0);
var mC = "";
var rot = 0;
var newMc;
particles.onEnterFrame = function () {
if (startExplosion == true) {
while (z < numberOfParticles) {
Count++;
mC = "s" + Count;
rot = Number(random(360)) + 1;
var _local3 = attachMovie("ExplodeBit", mC, Count);
_local3.gotoAndStop(explodeFrame);
_local3._rotation = rot;
var _local4 = _root.Useful1.getVectorFromAngle(rot);
_local3.vx = _local4.vx * speed;
_local3.vy = _local4.vy * speed;
_local3.endX = _local4.vx * explodeDistance;
_local3.endY = _local4.vy * explodeDistance;
_local3.endDistance = _root.Useful1.getDistance(_local3._x, _local3._y, _local3.endX, _local3.endY);
_local3.gravityValue = 0;
_local3.onEnterFrame = function () {
this._x = this._x + this.vx;
this._y = this._y + this.vy;
var _local3 = _root.Useful1.getDistance(this._x, this._y, this.endX, this.endY);
if (this._parent.artillary == true) {
if (_local3 > (this._parent.explodeDistance / 2)) {
this._xscale = this._xscale + 40;
this._yscale = this._xscale;
} else {
this._xscale = this._xscale - 35;
this._yscale = this._xscale;
}
}
if (this._parent.gravity == true) {
this.gravityValue = this.gravityValue + 0.2;
this.vy = this.vy + this.gravityValue;
}
if ((_local3 < 5) or (_local3 > (this._parent.explodeDistance + 10))) {
this.removeMovieClip();
}
if (_local3 < (this.endDistance / 2)) {
_root.Game.drawToBackground(this._parent, this._parent._x, this._parent._y);
}
};
z++;
}
z = 0;
if (Count > numberOfLoops) {
removeMovieClip(this);
}
}
};
Symbol 29 MovieClip [ExplodeBit] Frame 1
stop();
Symbol 30 MovieClip [towerExplodeAnim] Frame 5
if (_parent.scaleType == "death") {
_root.Game.drawToBackground(_parent, _parent._x, _parent._y);
}
Symbol 30 MovieClip [towerExplodeAnim] Frame 7
removeMovieClip("");
stop();
Symbol 41 MovieClip Frame 10
stop();
Symbol 42 MovieClip [gameItems] Frame 1
stop();
peopleChoiceBtn.onRelease = function () {
_root.Game.setupPeoplePanel(this._parent);
};
houseChoiceBtn.onRelease = function () {
_root.Game.setupHousePanel(this._parent);
};
offBtn.onRelease = function () {
_root.Game.offPanel(this._parent);
};
Symbol 67 MovieClip Frame 1
stop();
Symbol 72 MovieClip [weapons] Frame 1
deselectBtn.onRelease = function () {
_root.Game.objectSelected2.mC.selectedMc.gotoAndStop(1);
_root.Player.gun.selectedMc.gotoAndStop(1);
_root.Game.objectSelected = "";
};
Symbol 100 MovieClip [zRightArm] Frame 1
stop();
Symbol 106 MovieClip [zLeftArm] Frame 1
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 120 MovieClip [zHead] Frame 1
stop();
Symbol 121 MovieClip [enemy4b] Frame 1
this.onEnterFrame = function () {
torso.gotoAndStop(_parent.torsoFr);
head.gotoAndStop(_parent.headFr);
leftArmFr.gotoAndStop(_parent.leftArmFr);
rightArmFr.gotoAndStop(_parent.rightArmFr);
if (_parent.leftArm == 1) {
if (leftarm._visible == true) {
_root.Game.drawToBackground(leftarm, _parent._x + _root.Useful1.RandomNumber(1, 10), _parent._y + _root.Useful1.RandomNumber(1, 10));
leftarm._visible = false;
}
}
if (_parent.rightArm == 1) {
if (rightarm._visible == true) {
_root.Game.drawToBackground(rightarm, _parent._x + _root.Useful1.RandomNumber(1, 10), _parent._y + _root.Useful1.RandomNumber(1, 10));
rightarm._visible = false;
}
}
if (_parent.head == 1) {
if (head._visible == true) {
_root.Game.drawToBackground(head, _parent._x + _root.Useful1.RandomNumber(1, 10), _parent._y + _root.Useful1.RandomNumber(1, 10));
head._visible = false;
}
}
};
Symbol 121 MovieClip [enemy4b] Frame 34
gotoAndPlay (1);
Symbol 121 MovieClip [enemy4b] Frame 35
_parent.attack = false;
Symbol 121 MovieClip [enemy4b] Frame 50
_parent.attack = true;
Symbol 121 MovieClip [enemy4b] Frame 63
gotoAndPlay ("attack");
Symbol 128 MovieClip [zombie] Frame 1
stop();
leftArm = 0;
rightArm = 0;
head = 0;
attack = false;
Symbol 131 MovieClip [backgrounds] Frame 1
stop();
Symbol 143 MovieClip Frame 1
stop();
Symbol 173 MovieClip Frame 1
score.text = _parent._parent._parent._parent._parent._parent._parent.Game.score;
var score2 = _parent._parent._parent._parent._parent._parent._parent.Game.score;
submitBtn.onRelease = function () {
if ((nameTxt.text != undefined) and (nameTxt.text != "")) {
_root.MindJoltSponsoredAPI.submitScore(nameTxt.text, score2);
gotoAndStop (2);
}
};
moreGamesBtn.onRelease = function () {
_parent._parent._parent._parent._parent._parent._parent.MindJoltSponsoredAPI.openLink(5);
};
viewScoresBtn.onRelease = function () {
_root.MindJoltSponsoredAPI.openLink(4);
};
stop();
quitBtn.onRelease = function () {
_parent._parent._parent._parent._parent._parent._parent.quitGame();
};
Symbol 174 MovieClip [gameOverMsg] Frame 1
if (_root.Game.levelNumber == 10) {
msg.endTitle.gotoAndStop(2);
}
if (_global.mindjolt_site == true) {
msg.gotoAndStop(3);
ScoreAPI = new LocalConnection();
ScoreAPI.send(_root.com_mindjolt_api, "submitScore", _parent._parent._parent._parent._parent._parent.Game.score);
}
Symbol 175 MovieClip [gameOverMsgAnim2] Frame 10
stop();
Symbol 175 MovieClip [gameOverMsgAnim2] Frame 23
_parent._parent._parent._parent._parent.Game.gameState = "game_over_restart";
stop();
Symbol 184 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 10
gotoAndStop (1);
Symbol 195 MovieClip [ballCharacter] Frame 1
stop();
Symbol 200 MovieClip [M_stars1] Frame 15
this.removeMovieClip();
Symbol 201 MovieClip [starAnim] Frame 1
i = 1;
heart.onEnterFrame = function () {
if (_currentframe != 13) {
myMovie = heart.duplicateMovieClip("heart" + i, i);
myMovie._rotation = Math.random() * 360;
myMovie._xscale = scale;
myMovie._yscale = scale;
scale = (Math.random() * 80) + 20;
i++;
}
};
Symbol 201 MovieClip [starAnim] Frame 24
this.removeMovieClip();
stop();
Symbol 208 MovieClip Frame 8
_parent._parent.removeMovieClip();
Symbol 209 MovieClip Frame 1
stop();
Symbol 211 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 1
stop();
Symbol 215 MovieClip Frame 1
stop();
Symbol 217 MovieClip Frame 1
stop();
Symbol 219 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 1
stop();
Symbol 223 MovieClip Frame 1
stop();
Symbol 225 MovieClip Frame 1
stop();
Symbol 227 MovieClip Frame 1
stop();
Symbol 229 MovieClip Frame 1
stop();
Symbol 231 MovieClip Frame 1
stop();
Symbol 235 MovieClip Frame 1
stop();
Symbol 236 MovieClip [tiles] Frame 1
stop();
Symbol 240 MovieClip [badBall] Frame 1
stop();
Symbol 240 MovieClip [badBall] Frame 5
stop();
Symbol 240 MovieClip [badBall] Frame 18
this.removeMovieClip();
Symbol 241 MovieClip [gameOverMsgAnim] Frame 10
stop();
Symbol 241 MovieClip [gameOverMsgAnim] Frame 23
_parent._parent._parent._parent._parent.Game.gameState = "game_over_restart";
stop();
Symbol 247 MovieClip Frame 1
stop();
Symbol 251 MovieClip Frame 1
stop();
Symbol 253 MovieClip [loseLifeMsgAnim] Frame 48
if (_parent._parent._parent._parent._parent.Game.gameState != "restart") {
_parent._parent._parent._parent._parent.Game.gameState = "restart";
}
this.removeMovieClip();
Symbol 280 MovieClip Frame 1
stop();
Symbol 282 MovieClip [getReadyMsgAnim] Frame 1
msg.numbers.gotoAndStop(_parent._parent._parent._parent._parent.Game.levelNumber);
Symbol 282 MovieClip [getReadyMsgAnim] Frame 11
msg.numbers.gotoAndStop(_parent._parent._parent._parent._parent.Game.levelNumber);
Symbol 282 MovieClip [getReadyMsgAnim] Frame 64
msg.numbers.gotoAndStop(_parent._parent._parent._parent._parent.Game.levelNumber);
Symbol 282 MovieClip [getReadyMsgAnim] Frame 74
_parent._parent._parent._parent._parent.Game.gameState = "play";
this.removeMovieClip();
Symbol 300 MovieClip [levelCompleteMsgs] Frame 1
stop();
Symbol 302 MovieClip [levelCompleteMsgAnim] Frame 15
msg.titleMc.gotoAndStop(howWellDone);
Symbol 302 MovieClip [levelCompleteMsgAnim] Frame 31
_parent._parent._parent._parent._parent.Game.gameState = "display_bonus";
_parent._parent._parent._parent._parent.sounds.levelComplete.start(0, 1);
stop();
Symbol 302 MovieClip [levelCompleteMsgAnim] Frame 81
_parent._parent._parent._parent._parent.Game.gameState = "start_new_level";
stop();
Symbol 306 MovieClip [pausedMsgAnim] Frame 33
stop();
Symbol 306 MovieClip [pausedMsgAnim] Frame 42
this.removeMovieClip();
Symbol 311 MovieClip [square] Frame 1
stop();
Symbol 338 MovieClip Frame 1
var cs1 = (_root.Useful1.RandomNumber(2, 4) / 3);
var cs2 = (_root.Useful1.RandomNumber(2, 4) / 3);
var cs3 = (_root.Useful1.RandomNumber(2, 4) / 3);
this.onEnterFrame = function () {
this.c1._x = this.c1._x - cs1;
if (this.c1._x < (-(this.c1._width + 40))) {
this.c1._x = 700;
cs1 = _root.Useful1.RandomNumber(2, 4) / 3;
}
this.c2._x = this.c2._x - cs2;
if (this.c2._x < (-(this.c2._width + 40))) {
this.c2._x = 700;
cs2 = _root.Useful1.RandomNumber(2, 4) / 3;
}
this.c3._x = this.c3._x - cs3;
if (this.c3._x < (-(this.c3._width + 40))) {
this.c3._x = 700;
cs3 = _root.Useful1.RandomNumber(2, 4) / 3;
}
};
var i = 1;
while (i < 13) {
this["b" + i].gotoAndPlay(_root.Useful1.RandomNumber(1, 980));
i++;
}
Symbol 347 Button
on (release) {
getURL ("http://www.flashgamemaker.com", _blank);
}
Symbol 355 Button
on (release) {
_root.MindJoltSponsoredAPI.openLink(6);
}
Symbol 382 MovieClip [splashInfo] Frame 1
stop();
Symbol 382 MovieClip [splashInfo] Frame 2
stop();
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
nextBtn.onRelease = function () {
gotoAndStop (3);
};
Symbol 382 MovieClip [splashInfo] Frame 3
backBtn2.onRelease = function () {
gotoAndStop (2);
};
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
nextBtn.onRelease = function () {
gotoAndStop (4);
};
Symbol 382 MovieClip [splashInfo] Frame 4
backBtn2.onRelease = function () {
gotoAndStop (3);
};
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
Symbol 382 MovieClip [splashInfo] Frame 5
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
Symbol 382 MovieClip [splashInfo] Frame 6
function moveOn() {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
}
backBtn.onRelease = function () {
_root.mochi.MochiScores.closeLeaderboard();
moveOn();
};
var leaderBoardMc = this.createEmptyMovieClip("leaderBoard", 1);
leaderBoardMc._x = -360;
leaderBoardMc._y = -200;
mochi.MochiScores.showLeaderboard({boardID:"e55af2c20016c000", clip:leaderBoardMc, onClose:moveOn, onError:moveOn});
stop();
Symbol 390 MovieClip [points] Frame 11
this.removeMovieClip();
Symbol 391 MovieClip [ballFade] Frame 6
this.removeMovieClip();
Symbol 395 MovieClip [points50] Frame 13
this.removeMovieClip();
Symbol 401 MovieClip [previewMc] Frame 1
stop();
Symbol 420 MovieClip Frame 1
stop();
Symbol 422 MovieClip [SplashMusicBtn] Frame 1
if (_root.musicPlaying == "off") {
musicMc.gotoAndStop(2);
}
musicBtn.onRelease = function () {
if (musicMc._currentframe == 1) {
_root.soundFade = "out";
_root.musicPlaying = "off";
musicMc.gotoAndStop(2);
} else {
_root.soundFade = "in";
_root.musicPlaying = "on";
musicMc.gotoAndStop(1);
}
};
Symbol 439 MovieClip [splashscreenbuttons] Frame 1
if (_global.mindjolt_site == false) {
gotoAndStop (2);
}
stop();
Symbol 439 MovieClip [splashscreenbuttons] Frame 2
highscoresBtnAnim.onRelease = function () {
_root.MindJoltSponsoredAPI.openLink(3);
};
moreGamesBtnAnim.onRelease = function () {
_root.MindJoltSponsoredAPI.openLink(2);
};
Symbol 444 MovieClip [tipsMc] Frame 1
stop();
Symbol 456 MovieClip Frame 1
stop();
Symbol 456 MovieClip Frame 9
gotoAndStop (1);
Symbol 463 MovieClip [selectionCircle] Frame 1
stop();
Symbol 466 MovieClip [personRangeCircle] Frame 1
stop();
Symbol 482 MovieClip Frame 1
stop();
Symbol 489 MovieClip Frame 1
stop();
Symbol 496 MovieClip [personWithBat] Frame 1
stop();
Symbol 496 MovieClip [personWithBat] Frame 5
_parent.hitMonster = true;
Symbol 496 MovieClip [personWithBat] Frame 20
gotoAndPlay (2);
Symbol 505 MovieClip [personWithPistol] Frame 1
stop();
Symbol 505 MovieClip [personWithPistol] Frame 2
_parent.hitMonster = true;
Symbol 505 MovieClip [personWithPistol] Frame 12
_parent.hitMonster = true;
Symbol 505 MovieClip [personWithPistol] Frame 22
_parent.hitMonster = true;
Symbol 505 MovieClip [personWithPistol] Frame 32
_parent.hitMonster = true;
Symbol 505 MovieClip [personWithPistol] Frame 42
_parent.hitMonster = true;
Symbol 505 MovieClip [personWithPistol] Frame 77
gotoAndPlay (2);
Symbol 509 MovieClip Frame 1
stop();
Symbol 511 MovieClip [personShotgun] Frame 1
stop();
Symbol 511 MovieClip [personShotgun] Frame 2
_parent.hitMonster = true;
Symbol 511 MovieClip [personShotgun] Frame 16
_parent.hitMonster = true;
Symbol 511 MovieClip [personShotgun] Frame 57
gotoAndPlay (2);
Symbol 512 MovieClip [personRifle] Frame 2
_parent.hitMonster = true;
Symbol 512 MovieClip [personRifle] Frame 101
gotoAndPlay (2);
Symbol 521 MovieClip [personFlameThrower] Frame 1
stop();
Symbol 521 MovieClip [personFlameThrower] Frame 2
_parent.hitMonster = true;
Symbol 521 MovieClip [personFlameThrower] Frame 3
_parent.hitMonster = true;
Symbol 521 MovieClip [personFlameThrower] Frame 4
_parent.hitMonster = true;
Symbol 521 MovieClip [personFlameThrower] Frame 5
_parent.hitMonster = true;
Symbol 521 MovieClip [personFlameThrower] Frame 6
_parent.hitMonster = true;
Symbol 521 MovieClip [personFlameThrower] Frame 7
_parent.hitMonster = true;
Symbol 521 MovieClip [personFlameThrower] Frame 8
_parent.hitMonster = true;
Symbol 521 MovieClip [personFlameThrower] Frame 9
_parent.hitMonster = true;
Symbol 521 MovieClip [personFlameThrower] Frame 57
gotoAndPlay (2);
Symbol 529 MovieClip [personMolokov] Frame 1
stop();
Symbol 529 MovieClip [personMolokov] Frame 8
_parent.hitMonster = true;
Symbol 529 MovieClip [personMolokov] Frame 54
gotoAndPlay (2);
Symbol 536 MovieClip [personMachineGun] Frame 1
stop();
Symbol 536 MovieClip [personMachineGun] Frame 2
_parent.hitMonster = true;
Symbol 536 MovieClip [personMachineGun] Frame 3
_parent.hitMonster = true;
Symbol 536 MovieClip [personMachineGun] Frame 4
_parent.hitMonster = true;
Symbol 536 MovieClip [personMachineGun] Frame 5
_parent.hitMonster = true;
Symbol 536 MovieClip [personMachineGun] Frame 6
_parent.hitMonster = true;
Symbol 536 MovieClip [personMachineGun] Frame 7
_parent.hitMonster = true;
Symbol 536 MovieClip [personMachineGun] Frame 8
_parent.hitMonster = true;
Symbol 536 MovieClip [personMachineGun] Frame 9
_parent.hitMonster = true;
Symbol 536 MovieClip [personMachineGun] Frame 57
gotoAndPlay (2);
Symbol 539 MovieClip Frame 1
stop();
Symbol 539 MovieClip Frame 2
_parent.hitMonster = true;
Symbol 539 MovieClip Frame 5
_parent.hitMonster = true;
Symbol 539 MovieClip Frame 8
_parent.hitMonster = true;
Symbol 539 MovieClip Frame 20
gotoAndPlay (2);
Symbol 540 MovieClip [personMc] Frame 1
stop();
Symbol 544 MovieClip [woodenFence] Frame 1
stop();
Symbol 546 MovieClip [personIconSelect] Frame 1
stop();
Symbol 553 MovieClip Frame 1
stop();
Symbol 564 MovieClip [upgradesMc] Frame 1
stop();
Symbol 573 MovieClip [backgroundGrad] Frame 2957
stop();
Symbol 580 MovieClip Frame 1
stop();
Symbol 588 MovieClip [personEnergyBar3] Frame 24
enemy.energyBarOn = 0;
this.removeMovieClip();
Symbol 595 MovieClip Frame 11
stop();
Symbol 596 MovieClip Frame 17
stop();
Symbol 599 MovieClip Frame 15
stop();
Symbol 603 MovieClip Frame 11
stop();
Symbol 604 MovieClip [projectilesMc] Frame 1
stop();
Symbol 611 MovieClip [zombie2] Frame 1
this.onEnterFrame = function () {
torso.gotoAndStop(_parent.torsoFr);
head.gotoAndStop(_parent.headFr);
leftArmFr.gotoAndStop(_parent.leftArmFr);
rightArmFr.gotoAndStop(_parent.rightArmFr);
if (_parent.leftArm == 1) {
if (leftarm._visible == true) {
_root.Game.drawToBackground(leftarm, _parent._x + _root.Useful1.RandomNumber(1, 10), _parent._y + _root.Useful1.RandomNumber(1, 10));
leftarm._visible = false;
}
}
if (_parent.rightArm == 1) {
if (rightarm._visible == true) {
_root.Game.drawToBackground(rightarm, _parent._x + _root.Useful1.RandomNumber(1, 10), _parent._y + _root.Useful1.RandomNumber(1, 10));
rightarm._visible = false;
}
}
if (_parent.head == 1) {
if (head._visible == true) {
_root.Game.drawToBackground(head, _parent._x + _root.Useful1.RandomNumber(1, 10), _parent._y + _root.Useful1.RandomNumber(1, 10));
head._visible = false;
}
}
};
Symbol 611 MovieClip [zombie2] Frame 34
gotoAndPlay (1);
Symbol 611 MovieClip [zombie2] Frame 35
_parent.attack = false;
Symbol 611 MovieClip [zombie2] Frame 50
_parent.attack = true;
Symbol 611 MovieClip [zombie2] Frame 63
gotoAndPlay ("attack");
Symbol 621 MovieClip [pointsSmall] Frame 7
this.removeMovieClip();
Symbol 666 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if (options.clip.__mochiservicesMC != mochi.MochiServices.__get__clip()) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
if (mochi.MochiServices.__get__clip() == _root.__mochiservicesMC) {
mochi.MochiServices.__get__clip()._parent.gameOverMc.play();
} else {
mochi.MochiServices.__get__clip().gameOverMc.play();
}
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 667 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.31");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 668 MovieClip [__Packages.com.mindjolt.api.as2.MindJoltSponsoredAPI] Frame 0
class com.mindjolt.api.as2.MindJoltSponsoredAPI
{
static var flashCookie, gameId, key;
function MindJoltSponsoredAPI () {
}
static function connect(_gameId, _key) {
_root.MindJoltSponsoredAPI = com.mindjolt.api.as2.MindJoltSponsoredAPI;
if (!connected) {
flashCookie = SharedObject.getLocal("com.mindjolt", "/");
gameId = _gameId.toUpperCase();
key = _key.toUpperCase();
connected = true;
}
}
static function submitScore(name, score, mode) {
var _local4 = null;
if (flashCookie.data.userToken != null) {
_local4 = flashCookie.data.userToken;
} else {
_local4 = null;
}
var _local8 = new com.meychi.ascrypt.RC4();
var _local5 = com.meychi.ascrypt.RC4.encrypt((((("score=" + score) + "&name=") + escape(name)) + ((mode != null) ? ("&mode=" + escape(mode)) : "")) + ((_local4 != null) ? ("&userToken=" + escape(_local4)) : ""), key);
var _local3 = new LoadVars();
var _local6 = new LoadVars();
_local3.gameId = gameId;
_local3.session = _local5;
_local6.onLoad = function (success) {
if (success) {
var _local4 = this.session;
if (_local4 != null) {
var _local5 = new com.meychi.ascrypt.RC4();
var _local2 = new LoadVars();
_local2.decode(com.meychi.ascrypt.RC4.decrypt(_local4, com.mindjolt.api.as2.MindJoltSponsoredAPI.key));
var _local3 = _local2.userToken;
if (_local3 != null) {
com.mindjolt.api.as2.MindJoltSponsoredAPI.flashCookie.data.userToken = _local3;
com.mindjolt.api.as2.MindJoltSponsoredAPI.flashCookie.flush();
}
}
}
};
_local3.sendAndLoad("http://game.mindjolt.com/servlet/GameScore", _local6, "POST");
}
static function openLink(linkId, mode) {
var _local1 = ((((("http://game.mindjolt.com/servlet/GameLink?key=" + gameId) + "&link=") + linkId) + ((mode != null) ? ("&mode=" + escape(mode)) : "")) + "&httpref=") + escape(_url);
getURL (_local1, "_blank");
}
static var connected = false;
}
Symbol 669 MovieClip [__Packages.com.meychi.ascrypt.RC4] Frame 0
class com.meychi.ascrypt.RC4
{
function RC4 () {
}
static function encrypt(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToHex(_local2));
}
static function decrypt(src, key) {
var _local3 = hexToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToStr(_local2));
}
static function initialize(pwd) {
var _local2 = 0;
var _local3;
var _local4 = pwd.length;
var _local1 = 0;
while (_local1 <= 255) {
mykey[_local1] = pwd[_local1 % _local4];
sbox[_local1] = _local1;
_local1++;
}
_local1 = 0;
while (_local1 <= 255) {
_local2 = ((_local2 + sbox[_local1]) + mykey[_local1]) % 256;
_local3 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local3;
_local1++;
}
}
static function calculate(plaintxt, psw) {
initialize(psw);
var _local1 = 0;
var _local2 = 0;
var _local9 = new Array();
var _local7;
var _local5;
var _local6;
var _local3 = 0;
while (_local3 < plaintxt.length) {
_local1 = (_local1 + 1) % 256;
_local2 = (_local2 + sbox[_local1]) % 256;
_local5 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local5;
var _local4 = (sbox[_local1] + sbox[_local2]) % 256;
_local7 = sbox[_local4];
_local6 = plaintxt[_local3] ^ _local7;
_local9.push(_local6);
_local3++;
}
return(_local9);
}
static function charsToHex(chars) {
var _local4 = new String("");
var _local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local1 = 0;
while (_local1 < chars.length) {
_local4 = _local4 + (_local3[chars[_local1] >> 4] + _local3[chars[_local1] & 15]);
_local1++;
}
return(_local4);
}
static function hexToChars(hex) {
var _local3 = new Array();
var _local1 = ((hex.substr(0, 2) == "0x") ? 2 : 0);
while (_local1 < hex.length) {
_local3.push(parseInt(hex.substr(_local1, 2), 16));
_local1 = _local1 + 2;
}
return(_local3);
}
static function charsToStr(chars) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < chars.length) {
_local3 = _local3 + String.fromCharCode(chars[_local1]);
_local1++;
}
return(_local3);
}
static function strToChars(str) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < str.length) {
_local3.push(str.charCodeAt(_local1));
_local1++;
}
return(_local3);
}
static var sbox = new Array(255);
static var mykey = new Array(255);
}
Symbol 670 MovieClip [__Packages.GamePlayer] Frame 0
class GamePlayer
{
var KeyCheck, missileDistFromGun, root, currentColour, shotsFired, shotsLimit, numberOfMissiles, keypress, jumpTime, mouseButton, mC, shotStrength, gun, gravitySpeed, speed, pickupDelay, myCurrentScore;
function GamePlayer (clip, rt, xStart, yStart, k) {
KeyCheck = k;
missileDistFromGun = 40;
xOrigin = xStart;
yOrigin = yStart;
dx = 0;
root = rt;
dy = 0;
currentColour = 0;
angle = 0;
shotsFired = 0;
shotsLimit = 2;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
xVelOld = 0;
numberOfMissiles = 0;
yVelOld = 0;
keypress = 0;
jump = 0;
jumpTime = 10;
mouseButton = 0;
mC = clip;
shotStrength = 6;
gun = mC.attachMovie("houseMc", "houseMc", 1);
xOrigin = rt.Game.movieWidth / 2;
yOrigin = rt.Game.gameWindowHeight / 2;
gravitySpeed = 2;
speed = 5;
pickupDelay = 0;
myCurrentScore = 0;
updatePosition();
}
function mainLoop() {
var _local2 = root.Useful1.pointTowards(mC._x, mC._y, root._xmouse, root._ymouse);
mC._rotation = _local2.spriteRotation;
}
function updatePosition() {
var _local3 = mC._x;
var _local2 = mC._y;
xPos = xPos + xVel;
yPos = yPos + yVel;
mC._x = xOrigin + xPos;
mC._y = yOrigin + yPos;
}
var xOrigin = 0;
var yOrigin = 0;
var xPos = 0;
var yPos = 0;
var s = 0;
var playerleft = 0;
var playerright = 0;
var jump = 0;
var moveplayerup = 0;
var playerdown = 0;
var playerup = 0;
var Oldplayerup = 0;
var Oldplayerdown = 0;
var Oldplayerright = 0;
var Oldplayerleft = 0;
var xVel = 0;
var yVel = 0;
var xVelOld = 0;
var yVelOld = 0;
var santaspeed = 2;
var multidirectional = 0;
var dx = 0;
var dy = 0;
var angle = 0;
}
Symbol 671 MovieClip [__Packages.CollisionDetection] Frame 0
class CollisionDetection
{
var rect_1a, rect_1b, rect_1c, rect_2a, rect_2b, rect_2c, intersectingArea, Overlap, side, hoz, left, right, yd, spriteObject, clipBounds, clipBounds2;
function CollisionDetection () {
rect_1a = new flash.geom.Rectangle();
rect_1b = new flash.geom.Rectangle();
rect_1c = new flash.geom.Rectangle();
rect_2a = new flash.geom.Rectangle();
rect_2b = new flash.geom.Rectangle();
rect_2c = new flash.geom.Rectangle();
intersectingArea = new flash.geom.Rectangle();
Overlap = 0;
xOverlap = 0;
yOverlap = 0;
xOverlap2 = 0;
yOverlap2 = 0;
side = 0;
hoz = 0;
left = 0;
right = 0;
yd = 0;
}
function CheckMoving(sprite1, sprite2, vx, vy, origin) {
spriteObject = new Object();
spriteObject.vx = vx;
spriteObject.vy = vy;
CheckBounds(origin, sprite1, sprite2, vx, vy, 0, 0);
xOverlap2 = xOverlap;
yOverlap2 = yOverlap;
if (Overlap == 2) {
AdjustSprite(spriteObject);
spriteObject.hit = true;
return(spriteObject);
}
spriteObject.hit = false;
return(spriteObject);
}
function AdjustSprite(sprite1) {
if (intersectingArea.width > intersectingArea.height) {
if (rect_1a.y > rect_2a.y) {
sprite1.vy = int(sprite1.vy + intersectingArea.height) + 1;
sprite1.hitEdge = "bottom";
} else {
sprite1.vy = int(sprite1.vy - intersectingArea.height) - 1;
sprite1.hitEdge = "top";
}
} else if (intersectingArea.width < intersectingArea.height) {
if (rect_1a.x > rect_2a.x) {
sprite1.vx = int(sprite1.vx + intersectingArea.width) - 1;
sprite1.hitEdge = "right";
} else {
sprite1.vx = int(sprite1.vx - intersectingArea.width) - 1;
sprite1.hitEdge = "left";
}
} else {
sprite1.vx = int(sprite1.vx - intersectingArea.width) + 1;
sprite1.vy = int(sprite1.vy - intersectingArea.height) + 1;
sprite1.hitEdge = "corner";
}
}
function CheckBounds(origin, obj, obj2, xVel, yVel, xVel2, yVel2) {
Overlap = 0;
clipBounds = obj.getBounds(origin);
rect_1a.x = clipBounds.xMin;
rect_1a.y = clipBounds.yMin;
rect_1a.width = clipBounds.xMax - clipBounds.xMin;
rect_1a.height = clipBounds.yMax - clipBounds.yMin;
rect_1b.x = clipBounds.xMin;
rect_1b.y = clipBounds.yMin;
rect_1b.width = clipBounds.xMax - clipBounds.xMin;
rect_1b.height = clipBounds.yMax - clipBounds.yMin;
rect_1b.offset(xVel, yVel);
rect_1c = rect_1a.union(rect_1b);
clipBounds2 = obj2.getBounds(origin);
rect_2a.x = clipBounds2.xMin;
rect_2a.y = clipBounds2.yMin;
rect_2a.width = clipBounds2.xMax - clipBounds2.xMin;
rect_2a.height = clipBounds2.yMax - clipBounds2.yMin;
rect_2b.x = clipBounds2.xMin;
rect_2b.y = clipBounds2.yMin;
rect_2b.width = clipBounds2.xMax - clipBounds2.xMin;
rect_2b.height = clipBounds2.yMax - clipBounds2.yMin;
rect_2b.offset(xVel2, yVel2);
rect_2c = rect_2a.union(rect_2b);
intersectingArea = rect_1c.intersection(rect_2c);
if ((intersectingArea.width != 0) or (intersectingArea.height != 0)) {
Overlap = 2;
}
}
var xOverlap = 0;
var yOverlap = 0;
var xOverlap2 = 0;
var yOverlap2 = 0;
}
Symbol 672 MovieClip [__Packages.GoodGuy] Frame 0
class GoodGuy
{
var root, mC, arrayIndex, hits, delayToStart, delayToFire, gotGold, energyBarOn, xDir, homing, ringDrop, toKill, dropping, movingCloser, rotationDirection, starting, xTarget, yTarget, inHouse, standing, moving, upgradeType, upgradeType2, weaponRange, deploy, targeted, backToHouse, flakjacket, increaseEnergyD, headFr, spriteData, myIcon, distanceArray, energyMc, ringNumber, globalAngle;
function GoodGuy (clip, rt, xStart, yStart, sp, del) {
root = rt;
mC = clip;
mC.hitMonster = false;
arrayIndex = 0;
hits = 0;
xOrigin = xStart;
yOrigin = yStart;
delayToStart = del * 10;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
delayToFire = 30;
gotGold = 0;
energyBarOn = 0;
degrees = 0;
centerX = root.Game.gameWindowWidth / 2;
centerY = root.Game.movieHeight / 2;
xDir = 1;
numberOfMissiles = 0;
energyStart = 100;
energy = energyStart;
homing = 0;
ringDrop = 20;
speed = sp;
toKill = false;
dropping = false;
movingCloser = 0;
delayToFire = 50;
rotationDirection = "";
starting = true;
xTarget = root.Player.mC._x;
yTarget = root.Player.mC._y;
inHouse = false;
standing = false;
moving = false;
upgradeType = 1;
upgradeType2 = 0;
weaponRange = 0;
deploy = true;
targeted = 0;
backToHouse = false;
flakjacket = false;
increaseEnergyD = 50;
headFr = root.Useful1.RandomNumber(1, 5);
updatePosition();
}
function mainLoop() {
if (delayToStart > 0) {
delayToStart--;
} else {
mC.person.head.gotoAndStop(headFr);
if (moving == true) {
spriteData = root.Useful1.pointTowards(xTarget, yTarget, mC._x, mC._y);
xVel = spriteData.vx * speed;
yVel = spriteData.vy * speed;
mC.person._rotation = spriteData.spriteRotation + 90;
mC.gotoAndStop("run");
updatePosition();
var _local4 = root.Useful1.getDistance(xTarget, yTarget, mC._x, mC._y);
if (_local4 < 5) {
moving = false;
}
var _local2 = 0;
while (_local2 < root.Game.pickupsArray.length) {
if (mC.person.hitTest(root.Game.pickupsArray[_local2].mC.collision)) {
if (root.Game.pickupsArray[_local2].spriteType == "money") {
root.Game.increaseMoney(root.Game.pickupsArray[_local2].amount);
root.Game.setupUpgrades(myIcon._parent, myIcon);
root.sounds.pickupMoneyFx.start(0, 1);
var _local3 = root.Game.inGameScoreMc.attachMovie("pointsSmall", "msg" + root.Game.tilesNumber, root.Game.tilesNumber);
_local3._x = root.Game.pickupsArray[_local2].mC._x;
_local3._y = root.Game.pickupsArray[_local2].mC._y;
_local3.txt.txt.pointsTxt.text = root.Game.pickupsArray[_local2].amount;
root.Game.tilesNumber++;
root.Game.pickupsArray[_local2].remove();
} else if (energy < 100) {
energy = energy + root.Game.pickupsArray[_local2].amount;
if (energy > 100) {
energy = 100;
}
root.Game.personsEnergyMc.energyAnimMc.energyMc.energy.text = energy;
root.sounds.pickupMediPackFx.start(0, 1);
var _local3 = root.Game.inGameScoreMc.attachMovie("pointsSmall", "msg" + root.Game.tilesNumber, root.Game.tilesNumber);
_local3._x = root.Game.pickupsArray[_local2].mC._x;
_local3._y = root.Game.pickupsArray[_local2].mC._y;
_local3.txt.txt.pointsTxt.text = root.Game.pickupsArray[_local2].amount;
root.Game.tilesNumber++;
root.Game.pickupsArray[_local2].remove();
}
}
_local2++;
}
if (backToHouse == true) {
if (mC.hitTest(root.Player.gun.collision)) {
mC._rotation = 0;
mC.gotoAndStop(1);
mC._visible = false;
backToHouse = false;
inHouse = true;
root.Game.pickedUpItem = "personMc";
}
}
} else if (inHouse == false) {
if (starting == true) {
spriteData = root.Useful1.pointTowards(xTarget, yTarget, mC._x, mC._y);
xVel = spriteData.vx * speed;
yVel = spriteData.vy * speed;
mC._rotation = spriteData.spriteRotation + 90;
updatePosition();
if (mC.hitTest(root.Player.gun.collision)) {
inHouse = true;
root.Game.peopleInHouse++;
root.Game.peopleInHouse2++;
mC._visible = false;
starting = false;
backToHouse = false;
}
} else {
var _local5 = false;
distanceArray = new Array();
var _local2 = 0;
while (_local2 < root.Game.badGuysArray.length) {
var _local4 = root.Useful1.getDistance(root.Game.badGuysArray[_local2].mC._x, root.Game.badGuysArray[_local2].mC._y, mC._x, mC._y);
if (weaponRange != 0) {
if (_local4 < weaponRange) {
root.Game.badGuysArray[_local2].tempAngle = _local4;
distanceArray.push(root.Game.badGuysArray[_local2]);
}
}
_local2++;
}
if (distanceArray.length != 0) {
distanceArray.sortOn("tempAngle", Array.NUMERIC);
_local5 = true;
if (upgradeType == 1) {
mC.gotoAndStop("bat");
if (mC.person._currentframe == 1) {
mC.person.play();
}
if (mC.hitMonster == true) {
root.sounds.batFx.start(0, 1);
distanceArray[0].takingDamage(10);
mC.hitMonster = false;
}
} else if (upgradeType == 2) {
mC.gotoAndStop("pistol");
if (mC.person._currentframe == 1) {
mC.person.play();
}
if (mC.hitMonster == true) {
root.sounds.fire.start(0, 1);
mC.hitMonster = false;
fireMissile(1, 6, 10);
}
} else if (upgradeType == 3) {
mC.gotoAndStop("shotgun");
if (mC.person._currentframe == 1) {
mC.person.play();
}
if (mC.hitMonster == true) {
root.sounds.fire.start(0, 1);
mC.hitMonster = false;
fireMissile(2, 6, 15);
}
} else if (upgradeType == 4) {
mC.gotoAndStop("rifle");
if (mC.person._currentframe == 1) {
mC.person.play();
}
if (mC.hitMonster == true) {
mC.hitMonster = false;
fireMissile(1, 12, 35);
}
} else if (upgradeType == 5) {
mC.gotoAndStop("machinegun");
if (mC.person._currentframe == 1) {
mC.person.play();
}
if (mC.hitMonster == true) {
root.sounds.machineGunFx.start(0, 1);
mC.hitMonster = false;
fireMissile(1, 12, 2);
}
} else if (upgradeType == 6) {
mC.gotoAndStop("chainsaw");
if (mC.person._currentframe == 1) {
mC.person.play();
}
if (mC.hitMonster == true) {
root.sounds.chainSaw.start(0, 1);
distanceArray[0].takingDamage(5);
mC.hitMonster = false;
}
} else if (upgradeType == 7) {
mC.gotoAndStop("molokov");
if (mC.person._currentframe == 1) {
mC.person.play();
}
if (mC.hitMonster == true) {
mC.hitMonster = false;
fireMissile(3, 3, 15);
}
} else if (upgradeType == 8) {
mC.gotoAndStop("flamethrower");
if (mC.person._currentframe == 1) {
mC.person.play();
}
if (mC.hitMonster == true) {
root.sounds.flameThrowerFx.start(0, 1);
mC.hitMonster = false;
fireMissile(4, 12, 10);
}
}
spriteData = root.Useful1.pointTowards(mC._x + 10, mC._y + 10, distanceArray[0].mC._x, distanceArray[0].mC._y);
mC.person._rotation = spriteData.spriteRotation - 90;
}
if (_local5 == false) {
if (upgradeType == 1) {
mC.gotoAndStop("bat");
mC.person.gotoAndStop(1);
} else if (upgradeType == 2) {
mC.gotoAndStop("pistol");
mC.person.gotoAndStop(1);
} else if (upgradeType == 3) {
mC.gotoAndStop("shotgun");
mC.person.gotoAndStop(1);
} else if (upgradeType == 4) {
mC.gotoAndStop("rifle");
mC.person.gotoAndStop(1);
} else if (upgradeType == 5) {
mC.gotoAndStop("machinegun");
mC.person.gotoAndStop(1);
} else if (upgradeType == 6) {
mC.gotoAndStop("chainsaw");
mC.person.gotoAndStop(1);
} else if (upgradeType == 7) {
mC.gotoAndStop("molokov");
mC.person.gotoAndStop(1);
} else if (upgradeType == 8) {
mC.gotoAndStop("flamethrower");
mC.person.gotoAndStop(1);
}
}
}
} else if (root.Game.hittingHouse == false) {
increaseEnergyD--;
if (increaseEnergyD == 0) {
increaseEnergyD = 35;
energy++;
if (energy >= 100) {
energy = 100;
} else {
root.Player.gun.house.gotoAndPlay("recharge");
}
if (root.Game.selectedIcon == myIcon) {
root.Game.personsEnergyMc.energyAnimMc.gotoAndStop(energy);
root.Game.personsEnergyMc.energyAnimMc.energyMc.energy.text = energy;
}
}
}
}
}
function decreaseEnergy(damage) {
if (flakjacket == true) {
damage / 2;
}
energy = energy - damage;
if (root.Game.selectedIcon == myIcon) {
root.Game.personsEnergyMc.energyAnimMc.gotoAndStop(energy);
}
if (energyBarOn == 0) {
energyBarOn = 1;
energyMc = mC.attachMovie("personEnergyBar3", "energyBar" + root.scoreIndex, root.scoreIndex + 12000);
energyMc.enemy = this;
}
energyMc._x = 0;
energyMc._y = -25;
var _local3 = energy / 10;
energyMc.bar.bar._y = int(10 - _local3);
if (energy <= 0) {
myIcon.faceMc.gotoAndStop(2);
remove();
if (root.Game.selectedIcon == myIcon) {
mC.selectedMc.gotoAndStop(1);
myIcon.selectedMc.gotoAndStop(1);
var _local4 = myIcon._parent._parent;
root.Game.upgradesMc.removeMovieClip();
var _local2 = 0;
while (_local2 < root.Game.goodGuysArray.length) {
if (root.Game.goodGuysArray[_local2].toKill == false) {
root.Game.goodGuysArray[_local2].mC.selectedMc.gotoAndStop(2);
root.Game.goodGuysArray[_local2].myIcon.selectedMc.gotoAndStop(2);
root.Game.selectedIcon = root.Game.goodGuysArray[_local2].myIcon;
root.Game.setupUpgrades(root.Game.goodGuysArray[_local2].myIcon._parent, root.Game.goodGuysArray[_local2].myIcon);
_local2 = root.Game.goodGuysArray.length;
}
_local2++;
}
}
} else if (root.Game.selectedIcon == myIcon) {
root.Game.personsEnergyMc.energyAnimMc.energyMc.energy.text = energy;
}
}
function fireMissile(projectileType, bulletSpeed, bulletD) {
delayToFireMissile = 60;
if (root.Game.badGuysArray.length > 0) {
var _local3 = root.Game.inGameMissilesMc.attachMovie("projectilesMc", "missile" + root.Game.numberOfMissiles, _root.Game.numberOfMissiles);
_local3.gotoAndStop(projectileType);
var _local4 = root.Useful1.rotateXY(mC.person._x, mC.person._y, 1, mC.person._rotation);
var _local5 = _local4.xPos;
var _local6 = _local4.yPos;
root.Game.missilesArray.push(new Bullet(_local3, xOrigin + _local5, yOrigin + _local6, -spriteData.vx, -spriteData.vy, this, bulletSpeed, bulletD));
root.Game.numberOfMissiles++;
}
}
function remove() {
root.sounds.popFX.start(0, 1);
mC.gotoAndStop("death");
mC.person.gotoAndStop(root.Useful1.RandomNumber(1, 3));
root.Game.drawToBackground(mC.person, mC._x, mC._y);
var _local3 = root.Game.inGameExplosionsMc.attachMovie("explosion", "explosion" + root.Game.numberOfDropped, root.Game.numberOfDropped + 1000);
_local3._x = mC._x;
_local3._y = mC._y;
_local3.numberOfParticles = 5;
_local3.numberOfLoops = 1;
_local3.explodeDistance = 10;
_local3.gravity = false;
_local3.artillary = false;
_local3.explodeFrame = 1;
_local3.speed = 8;
_local3.startExplosion = true;
root.Game.numberOfDropped++;
mC.removeMovieClip();
root.Game.peopleInHouse2--;
if (root.Game.peopleInHouse2 < 0) {
_root.Game.peopleInHouse2 = 0;
}
toKill = true;
}
function updateRotation() {
var _local2 = root.Game.ringsAngleArray[ringNumber - 1];
globalAngle = _local2 + angle;
if (globalAngle >= 360) {
globalAngle = globalAngle - 360;
}
_local2 = (Math.PI * globalAngle) / 180;
radius = ringNumber * root.Game.ballRadius;
mC._x = centerX + (Math.cos(_local2) * radius);
mC._y = centerY + (Math.sin(_local2) * radius);
}
function updateEdgeRotation() {
var _local2 = root.Game.ringsAngleArray[ringNumber - 1];
globalAngle = angle;
if (globalAngle >= 360) {
globalAngle = globalAngle - 360;
}
_local2 = (Math.PI * globalAngle) / 180;
mC._x = centerX + (Math.cos(_local2) * radius);
mC._y = centerY + (Math.sin(_local2) * radius);
}
function updatePosition() {
xOrigin = xOrigin + xVel;
yOrigin = yOrigin + yVel;
mC._x = xOrigin;
mC._y = yOrigin;
}
var xOrigin = 0;
var yOrigin = 0;
var xPos = 0;
var yPos = 0;
var xVel = 0;
var yVel = 0;
var angle = 0;
var degrees = 0;
var centerX = 0;
var centerY = 0;
var radius = 0;
var speed = 0;
var cost = 0;
var playerleft = 0;
var playerright = 0;
var gameObjectType = "";
var energyStart = 0;
var energy = 0;
var delayToFireMissile = 60;
var numberOfMissiles = 0;
}
Symbol 673 MovieClip [__Packages.Bullet] Frame 0
class Bullet
{
var damage, firer, root, mC;
function Bullet (clip, xStart, yStart, xV, yV, parent, speed, dam) {
xOrigin = xStart;
yOrigin = yStart;
xPos = 0;
damage = dam;
yPos = 0;
xVel = xV * speed;
firer = parent;
root = parent.root;
yVel = yV * speed;
mC = clip;
updatePosition();
}
function mainLoop() {
checkCollision();
updatePosition();
checkForOffStage();
}
function removeMissile() {
mC.removeMovieClip();
var _local3 = 0;
var _local2 = 0;
while (_local2 < root.Game.missilesArray.length) {
if (this == root.Game.missilesArray[_local2]) {
_local3 = _local2;
}
_local2++;
}
root.Game.missilesArray.splice(_local3, 1);
}
function RandomNumber(x, y) {
return(Math.round(Math.random() * (y - x)) + x);
}
function checkCollision() {
if (mC._currentframe == 3) {
if (mC.m._currentframe == 15) {
var _local2 = 0;
while (_local2 < root.Game.badGuysArray.length) {
if (mC.hitTest(root.Game.badGuysArray[_local2].mC)) {
root.Game.badGuysArray[_local2].takingDamage(damage);
removeMissile();
}
_local2++;
}
}
} else {
var _local2 = 0;
while (_local2 < root.Game.badGuysArray.length) {
if (mC.hitTest(root.Game.badGuysArray[_local2].mC)) {
if (mC._currentframe == 4) {
root.Game.badGuysArray[_local2].mC.gotoAndStop(2);
}
root.Game.badGuysArray[_local2].takingDamage(damage);
removeMissile();
}
_local2++;
}
}
}
function checkForOffStage() {
if (mC._x < 0) {
removeMissile();
}
if (mC._y < 0) {
removeMissile();
}
if (mC._x > 700) {
removeMissile();
}
if (mC._y > 500) {
removeMissile();
}
}
function updatePosition() {
xPos = xPos + xVel;
yPos = yPos + yVel;
mC._x = xOrigin + xPos;
mC._y = yOrigin + yPos;
}
var xOrigin = 0;
var yOrigin = 0;
var xPos = 0;
var yPos = 0;
var s = 0;
var playerleft = 0;
var playerright = 0;
var jump = 0;
var moveplayerup = 0;
var playerdown = 0;
var playerup = 0;
var Oldplayerup = 0;
var Oldplayerdown = 0;
var Oldplayerright = 0;
var Oldplayerleft = 0;
var xVel = 0;
var yVel = 0;
var xVelOld = 0;
var yVelOld = 0;
var santaspeed = 2;
var multidirectional = 0;
var xTile = 0;
var yTile = 0;
var stopMove = 0;
var blockSize = 0;
var noCollision = 0;
var pathIndex = 0;
var delayToFireParticle = 10;
}
Symbol 674 MovieClip [__Packages.Game] Frame 0
class Game
{
var root, startGame, money, energy;
function Game (m, e, rt) {
root = rt;
startGame = 0;
money = m;
energy = e;
}
function increaseMoney(increase) {
money = money + increase;
}
function decreaseMoney(decrease) {
money = money - decrease;
}
function increaseEnergy(increase) {
energy = energy - increase;
if (energy <= 0) {
energy = 0;
}
}
function decreaseEnergy(decrease) {
energy = energy - decrease;
if (energy <= 0) {
startGame = 0;
root._parent.gotoAndStop("gameOver");
}
}
}
Symbol 675 MovieClip [__Packages.GamePresentation] Frame 0
class GamePresentation
{
var rt, mC, splashScreenMc, optionsMc, elementMc, btnType, myObject;
function GamePresentation (rt2) {
rt = rt2;
mC = rt.Game.presentationMc;
}
function setupSplashScreen(elementsPositions) {
splashScreenMc = mC.attachMovie("SplashScreen", "splashscreenmc", 1);
setupPresentationElements();
}
function setupPresentationElements() {
optionsMc = splashScreenMc.createEmptyMovieClip("options", 1);
var _local4 = optionsMc.attachMovie("splashscreenbuttons", "splashscreenbtns", 1);
_local4._x = 70;
_local4._y = 150;
var _local2 = 0;
while (_local2 < rt.splashScreenElements.length) {
var _local3 = rt.splashScreenElements;
elementMc = _local4[_local3[_local2].mCName];
elementMc.btn.btnType = _local3[_local2].mCName;
elementMc.btn.splashScreenMc = splashScreenMc;
elementMc.btn.myObject = this;
elementMc.btn.onRelease = clickRightSplashSceenBtn;
elementMc.btn.onRollOver = rollOverSplashSceenBtn;
elementMc.btn.onRollOut = rollOutSplashSceenBtn;
_local2++;
}
}
function clickRightSplashSceenBtn() {
if (btnType == "playBtnAnim") {
myObject.rt.Game.gameState = "setup";
} else if (btnType == "instructionsBtnAnim") {
splashScreenMc.screens.gotoAndStop("showinstructions");
splashScreenMc.options.removeMovieClip();
} else if (btnType == "controlsBtnAnim") {
splashScreenMc.screens.gotoAndStop("showcontrols");
splashScreenMc.options.removeMovieClip();
} else if (btnType == "highscoresBtnAnim") {
myObject.rt.MindJoltSponsoredAPI.openLink(3);
} else if (btnType == "moreGamesBtn") {
myObject.rt.MindJoltSponsoredAPI.openLink(2);
}
}
function rollOverSplashSceenBtn() {
}
function rollOutSplashSceenBtn() {
if (btnType == "playBtnAnim") {
} else if (btnType == "instructionsBtnAnim") {
} else if (btnType == "controlsBtnAnim") {
} else if (btnType == "highscoresBtnAnim") {
}
}
function RandomNumber(x, y) {
return(Math.round(Math.random() * (y - x)) + x);
}
function getArcVelocity(gravity, speed, xStart, yStart, xEnd, yEnd) {
var _local1 = new Object();
var _local3 = xEnd - xStart;
var _local4 = yEnd - yStart;
var _local6 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
var _local2 = Math.ceil(_local6 / speed);
_local1.gravity = gravity;
_local1.steps = _local2;
_local1.xStep = _local3 / _local2;
_local1.yStep = _local4 / _local2;
if (gravity > 0) {
_local1.yStep = _local1.yStep - ((_local2 * gravity) / 2);
}
return(_local1);
}
function localToGlobalXY(mc1) {
var _local3 = new Object();
_local3.newX = 0;
_local3.newY = 0;
var _local2 = mc1;
while (_local2 != _root) {
var _local6 = _local3.newX * (_local2._xscale / 100);
var _local5 = _local3.newY * (_local2._yscale / 100);
var _local4 = _local2._rotation * (Math.PI/180);
_local3.newX = (_local6 * Math.cos(_local4)) - (_local5 * Math.sin(_local4));
_local3.newY = (_local6 * Math.sin(_local4)) + (_local5 * Math.cos(_local4));
_local3.newX = _local3.newX + _local2._x;
_local3.newY = _local3.newY + _local2._y;
_local2 = _local2._parent;
}
return(_local3);
}
function radian(degree) {
return((Math.PI/180) * degree);
}
function addThrust(rot, speed) {
var _local2 = new Object();
_local2.xVel = Math.cos(radian(rot)) * speed;
_local2.yVel = Math.sin(radian(rot)) * speed;
return(_local2);
}
}
Symbol 676 MovieClip [__Packages.GameGame] Frame 0
class GameGame
{
var mC, rt, numBalls, startBallsNumber, movieWidth, gameWindowWidth, movieHeight, gameWindowHeight, blockSize, blockSizeY, ballRadius, levelWidthBlocks, levelHeightBlocks, levelWidth, levelHeight, gameState, lostGold, numberOfMissiles, inGameMc, presentationMc, inGameActionMc, inGameStatsMc, inGameContainerMc, ballMc, inGameMsgsMc, playerMc, inGameBackgroundParallaxMc, inGameBackgroundMc, inGamePeopleMc, inGameEnemyMc, inGameMissilesMc, inGameExplosionsMc, inGameScoreMc, inGameObjectsMc, missilesArray, enemyArray, goodGuysArray, targetArray, numberOfDropped, rightPanelGameObjects, gameObjects, backgroundSquaresArray, currentPickedUp, ringsAngleArray, gapAngleArray, score, score2, sizeTarget, bestScore, starAnimDelay, lives, meterLevel, meterLevelSpeed, gameStartDelay, meterLevelDir, scoreIndex, xMidway, yMidway, starTrails, cannonManFlying, ballDeleted, ballChainArray, badGuysArray, bonusCountArray, spring, friction, gravity, springLength, ballCount, saucerChance, saucerDelay, left, right, top, bottom, levelNumber, scaleSpeed, balloonPlotted, extraPointsSound, secDisplay, minDisplay, StartTimer, clockDelay, minutes, sec, fulltime, mouseButton, moveUpSpeed, gameCounter, tileLevelHeight, tilesArray, dragBalls, starAnims, levelCountdown, pauseSwitch, currentPickup, pickupType, pickupAdded, numberOfPeople, edgeBallsReleaseD, edgeBallsRelease, statsMc, msgMc, currentTimeBonus, timeBonus, zombiesKilled, myBmp, myCT, shadowAngle, shadowLength, dropShadow, backgroundgradMc, backgroundMc, money, tilesNumber, mcDepthIndex, upgradeIconsArray, holesFound, treeArray, scoreArray, ballsDropping, ballsDroppingNumber, stored, sunDelay3, sunDelay, sunDelay2, numberOfZombies, tip, peopleInHouse, peopleInHouse2, pickedUpItem, startSetupDone, objectSelected2, pickupsArray, zombieSpeed, hittingHouse, zombieEnterDelay, backgroundGradient, upgradesMc, personMcHouseIcon, personsEnergyMc, objectSelected, peopleMc, selectedIcon, someonesOut, pauseMc;
function GameGame (mc, rt2, sw, sh, levelW, levelH, startLives) {
mC = mc;
rt = rt2;
numBalls = 15;
startBallsNumber = 8;
movieWidth = sw;
gameWindowWidth = movieWidth;
movieHeight = sh;
gameWindowHeight = 500;
blockSize = 25;
blockSizeY = 25;
ballRadius = 32;
levelWidthBlocks = levelW;
levelHeightBlocks = levelH;
levelWidth = levelWidthBlocks * blockSize;
levelHeight = levelHeightBlocks * blockSizeY;
gameState = "loading";
lostGold = 0;
numberOfMissiles = 0;
inGameMc = mC.createEmptyMovieClip("inGameMc", 0);
presentationMc = mC.createEmptyMovieClip("presentationMc", 1);
inGameActionMc = inGameMc.createEmptyMovieClip("inGameActionMc", 0);
inGameStatsMc = inGameMc.createEmptyMovieClip("inGameStatsMc", 1);
inGameContainerMc = inGameActionMc.createEmptyMovieClip("inGameBackgroundMc", 9);
ballMc = inGameActionMc.createEmptyMovieClip("cannonman", 10);
inGameMsgsMc = inGameActionMc.createEmptyMovieClip("cannonman", 11);
playerMc = inGameContainerMc.createEmptyMovieClip("player", 7);
inGameBackgroundParallaxMc = inGameActionMc.createEmptyMovieClip("inGameBackgroundParallaxMc2", 0);
inGameBackgroundMc = inGameContainerMc.createEmptyMovieClip("inGameBackgroundMc", 0);
inGamePeopleMc = inGameContainerMc.createEmptyMovieClip("inGamePeopleMc", 1);
inGameEnemyMc = inGameContainerMc.createEmptyMovieClip("inGameEnemysMc", 2);
inGameMissilesMc = inGameContainerMc.createEmptyMovieClip("inGameMissilesMc", 3);
inGameExplosionsMc = inGameContainerMc.createEmptyMovieClip("inGameExplosionsMc", 4);
inGameScoreMc = inGameContainerMc.createEmptyMovieClip("inGameScoresMc", 5);
inGameObjectsMc = inGameContainerMc.createEmptyMovieClip("inGameObjectsMc", 6);
missilesArray = new Array();
enemyArray = new Array();
goodGuysArray = new Array();
targetArray = new Array();
numberOfDropped = 0;
rightPanelGameObjects = new Array();
gameObjects = new Array();
backgroundSquaresArray = new Array();
currentPickedUp = undefined;
ringsAngleArray = new Array();
gapAngleArray = new Array();
score = 0;
score2 = 0;
sizeTarget = 0;
bestScore = 0;
starAnimDelay = 4;
lives = startLives;
meterLevel = 0;
meterLevelSpeed = 20;
gameStartDelay = 20;
meterLevelDir = meterLevelSpeed;
scoreIndex = 0;
xMidway = 0;
yMidway = 0;
starTrails = 0;
cannonManFlying = 0;
ballDeleted = false;
ballChainArray = new Array();
badGuysArray = new Array();
bonusCountArray = new Array();
spring = 0.1;
friction = 0.8;
gravity = 5;
springLength = 10;
ballCount = 3;
saucerChance = 50;
saucerDelay = -1;
saucerDelay = rt.Useful1.RandomNumber(50, 400);
left = -20;
right = movieWidth - 20;
top = 0;
bottom = movieHeight;
levelNumber = 1;
scaleSpeed = 8;
balloonPlotted = false;
extraPointsSound = false;
secDisplay = "00";
minDisplay = "00";
StartTimer = 6;
clockDelay = 10;
minutes = StartTimer;
sec = 0;
fulltime = 0;
mouseButton = false;
moveUpSpeed = 180;
gameCounter = moveUpSpeed;
tileLevelHeight = 0;
tilesArray = new Array();
dragBalls = false;
starAnims = 0;
levelCountdown = 1000;
pauseSwitch = false;
currentPickup = "";
pickupType = "";
pickupAdded = false;
numberOfPeople = 10;
edgeBallsReleaseD = 100;
edgeBallsRelease = edgeBallsReleaseD;
setupPanel();
}
function setupPanel() {
statsMc = inGameStatsMc.attachMovie("weapons", "ingamestatsmc", 1);
statsMc._y = movieHeight - 74;
var _local2 = statsMc.wg;
_local2 = _local2.stats;
_local2.musicBtn.myObject = this;
_local2.musicBtn.myMc = _local2;
_local2.quitBtn.myObject = this;
if (rt.musicPlaying == "off") {
_local2.musicBtn._parent.music.gotoAndStop(2);
}
_local2.musicBtn.onRelease = function () {
if (this.myMc.music._currentframe == 1) {
this.myObject.rt.soundFade = "out";
this.myMc.music.gotoAndStop("off");
this.myObject.rt.musicPlaying = "off";
} else {
this.myObject.rt.soundFade = "in";
this.myMc.music.gotoAndStop("on");
this.myObject.rt.musicPlaying = "on";
}
};
_local2.quitBtn.onRelease = function () {
this.myObject.rt.Game.msgMc.removeMovieClip();
this.myObject.rt.Game.gameState = "game_over_restart";
};
}
function gameOver(gameOverType) {
turnOffTip();
score2 = 0;
if (gameOverType == "out_of_time") {
gameState = "game_over";
msgMc = inGameMsgsMc.attachMovie("gameOverMsgAnim", "gameover", 1);
msgMc._x = movieWidth / 2;
msgMc._y = (movieHeight / 2) - 70;
rt.sounds.doh.start(0, 1);
} else if (gameOverType == "game_complete") {
rt.sounds.cheer.start(0, 1);
gameState = "game_over";
msgMc = inGameMsgsMc.attachMovie("gameOverMsgAnim", "gameComplete", 1);
msgMc._x = movieWidth / 2;
msgMc._y = movieHeight / 2;
} else {
rt.sounds.cheer.start(0, 1);
gameState = "level_complete";
msgMc = inGameMsgsMc.attachMovie("levelCompleteMsgAnim", "levelComplete", 1);
msgMc._x = movieWidth / 2;
msgMc._y = (movieHeight / 2) - 60;
currentTimeBonus = 0;
timeBonus = zombiesKilled;
var _local3 = 3.33333333333333;
var _local4 = 5;
var _local5 = 7.69230769230769;
if (timeBonus < 5) {
msgMc.howWellDone = 1;
} else if (timeBonus < 14) {
msgMc.howWellDone = 2;
} else {
msgMc.howWellDone = 3;
}
zombiesKilled = 0;
}
}
function removeGerms() {
var _local2 = 0;
while (_local2 < badGuysArray.length) {
var _local3 = badGuysArray[_local2];
_local3.swapDepths(1);
_local3.removeMovieClip();
_local2++;
}
}
function drawToBackground(mc, xPos, yPos) {
var _local2 = new flash.geom.Matrix();
_local2.translate(xPos, yPos);
myBmp.draw(mc, _local2, myCT);
}
function setupGerms() {
pickupType = "";
shadowAngle = 45;
shadowLength = 0;
inGameEnemyMc = inGameContainerMc.createEmptyMovieClip("inGameEnemysMc", 2);
dropShadow = new flash.filters.DropShadowFilter(4, shadowAngle, 0, 0.4, 10, 10, 2, 3);
dropShadow.distance = shadowLength + 10;
dropShadow.blurX = 2;
dropShadow.blurY = 2;
inGameEnemyMc.filters = [dropShadow];
inGamePeopleMc.filters = [dropShadow];
playerMc.filters = [dropShadow];
inGamePeopleMc = inGameContainerMc.createEmptyMovieClip("inGamePeopleMc", 1);
inGameMissilesMc = inGameContainerMc.createEmptyMovieClip("inGameMissilesMc", 3);
inGameExplosionsMc = inGameContainerMc.createEmptyMovieClip("inGameExplosionsMc", 4);
inGameScoreMc = inGameContainerMc.createEmptyMovieClip("inGameScoresMc", 5);
inGameObjectsMc = inGameContainerMc.createEmptyMovieClip("inGameObjectsMc", 6);
backgroundgradMc = inGameContainerMc.createEmptyMovieClip("backgroundgradMc", 10);
backgroundMc = inGameBackgroundMc.attachMovie("backgrounds", "background", 0);
moveUpSpeed = 180;
score = 0;
money = 100;
gameCounter = moveUpSpeed;
tileLevelHeight = 0;
levelCountdown = 1000;
tilesNumber = 0;
pickupAdded = false;
removeGerms();
tilesArray.splice(0);
mcDepthIndex = 0;
var _local3 = 0;
while (_local3 < levelHeightBlocks) {
var _local2 = 0;
while (_local2 < levelWidthBlocks) {
var _local4 = (levelWidthBlocks * _local3) + _local2;
tilesArray[_local4] = 0;
_local2++;
}
_local3++;
}
badGuysArray.splice(0);
goodGuysArray.splice(0);
upgradeIconsArray = new Array();
holesFound = false;
treeArray = new Array();
gapAngleArray = new Array();
scoreArray = new Array();
ballsDropping = false;
ballsDroppingNumber = 0;
stored = false;
sunDelay3 = 80;
sunDelay = int(sunDelay3 / 9);
sunDelay2 = sunDelay3;
setupBackground();
numberOfZombies = 5;
startZombies();
edgeBallsReleaseD = 128;
edgeBallsRelease = edgeBallsReleaseD;
tip = false;
peopleInHouse = 0;
peopleInHouse2 = 0;
pickedUpItem = "";
startSetupDone = false;
objectSelected2 = new Object();
pickupsArray = new Array();
zombieSpeed = levelNumber / 4;
startPeople();
tileLevelHeight = 19;
zombiesKilled = 0;
hittingHouse = false;
zombieEnterDelay = rt.Useful1.RandomNumber(100, 600);
var _local5 = inGameStatsMc.ingamestatsmc;
_local5 = _local5.wg;
_local5 = _local5.gameItems;
_local5.gotoAndStop(1);
_local5.maskMc.gotoAndPlay(1);
_local5.peopleMc.removeMovieClip();
setLevel();
setScore();
setMoney();
}
function setupBackground() {
backgroundGradient = backgroundMc.attachMovie("backgroundGrad", "backgroundGrad", 10);
backgroundGradient._x = 0;
backgroundGradient._y = 0;
myCT = new flash.geom.ColorTransform(1, 1, 1, 1, 1, 1, 1, 1);
myBmp = new flash.display.BitmapData(movieWidth, movieHeight, true, 0);
myBmp.draw(backgroundMc);
var _local3 = backgroundMc.createEmptyMovieClip("mc2", -300);
_local3.blendMode = "layer";
var _local4 = _local3.createEmptyMovieClip("mc", 100);
_local4.attachBitmap(myBmp, 0, "never", false);
var _local2 = inGameEnemyMc.attachMovie("treeMc", "tree1", tilesNumber + 20000);
_local2._x = 100;
_local2._y = 150;
tilesNumber++;
_local2 = inGameEnemyMc.attachMovie("treeMc", "tree2", tilesNumber + 20000);
_local2._x = 200;
_local2._y = 78;
_local2._xscale = 60;
_local2._yscale = _local2._xscale;
tilesNumber++;
_local2 = inGameEnemyMc.attachMovie("treeMc", "tree3", tilesNumber + 20000);
_local2._x = 100;
_local2._y = 350;
_local2._xscale = 20;
_local2._yscale = _local2._xscale;
tilesNumber++;
_local2 = inGameEnemyMc.attachMovie("treeMc", "tree4", tilesNumber + 20000);
_local2._x = 500;
_local2._y = 350;
tilesNumber++;
_local2 = inGameEnemyMc.attachMovie("treeMc", "tree5", tilesNumber + 20000);
_local2._x = 600;
_local2._y = 250;
_local2._xscale = 70;
_local2._yscale = _local2._xscale;
tilesNumber++;
}
function clearExplosionMcs() {
var _local2 = 0;
for (_local2 in inGameExplosionsMc) {
if (typeof(inGameExplosionsMc[_local2]) == "movieclip") {
inGameExplosionsMc[_local2].swapDepths(0);
inGameExplosionsMc[_local2].removeMovieClip();
}
}
}
function runZombies() {
zombieEnterDelay--;
if (zombieEnterDelay == 0) {
zombieEnterDelay = rt.Useful1.RandomNumber(200, 600);
extraZombies(rt.Useful1.RandomNumber(1, 3));
}
}
function newZombies() {
setLevel();
clearExplosionMcs();
zombieSpeed = levelNumber / 5;
extraZombies(levelNumber * 3);
}
function extraZombies(newZombieAmount) {
var _local6 = new Array();
var _local7 = 0;
while (_local7 < newZombieAmount) {
if (badGuysArray.length < 45) {
var _local2 = inGameEnemyMc.attachMovie("zombie", "monster" + tilesNumber, tilesNumber + 1000);
var _local4 = rt.Useful1.RandomNumber(1, 360);
var _local8 = false;
var _local3 = 0;
while (_local3 < _local6.length) {
if (_local4 == _local6[_local3]) {
_local8 = true;
}
_local3++;
}
if (_local8 == false) {
_local6.push(_local4);
} else {
_local4 = rt.Useful1.RandomNumber(1, 360);
}
var _local9 = (Math.PI * _local4) / 180;
_local2._x = (movieWidth / 2) + (Math.cos(_local9) * 400);
_local2._y = 250 + (Math.sin(_local9) * 400);
_local2.zombie.gotoAndPlay(rt.Useful1.RandomNumber(1, 30));
var _local5 = rt.Useful1.RandomNumber(1, 5);
_local2.torsoFr = _local5;
_local2.headFr = _local5;
_local2.leftArmFr = _local5;
_local2.rightArmFr = _local5;
badGuysArray.push(new Enemy(_local2, rt, _local2._x, _local2._y, 2, _local7));
tilesNumber++;
}
_local7++;
}
}
function startZombies() {
badGuysArray = new Array();
var _local6 = new Array();
var _local7 = 0;
while (_local7 < numberOfZombies) {
var _local2 = inGameEnemyMc.attachMovie("zombie", "monster" + tilesNumber, tilesNumber + 1000);
var _local4 = rt.Useful1.RandomNumber(1, 360);
var _local8 = false;
var _local3 = 0;
while (_local3 < _local6.length) {
if (_local4 == _local6[_local3]) {
_local8 = true;
}
_local3++;
}
if (_local8 == false) {
_local6.push(_local4);
} else {
_local4 = rt.Useful1.RandomNumber(1, 360);
}
var _local9 = (Math.PI * _local4) / 180;
_local2._x = (movieWidth / 2) + (Math.cos(_local9) * 400);
_local2._y = 250 + (Math.sin(_local9) * 400);
_local2.zombie.gotoAndPlay(rt.Useful1.RandomNumber(1, 30));
var _local5 = rt.Useful1.RandomNumber(1, 5);
_local2.torsoFr = _local5;
_local2.headFr = _local5;
_local2.leftArmFr = _local5;
_local2.rightArmFr = _local5;
badGuysArray.push(new Enemy(_local2, rt, _local2._x, _local2._y, 2, _local7));
tilesNumber++;
_local7++;
}
}
function startPeople() {
goodGuysArray = new Array();
var _local3 = 0;
while (_local3 < numberOfPeople) {
var _local2 = inGamePeopleMc.attachMovie("personMc", "person" + tilesNumber, tilesNumber);
_local2._x = movieWidth / 2;
_local2._y = movieHeight + 20;
_local2.gotoAndStop("run");
goodGuysArray.push(new GoodGuy(_local2, rt, _local2._x, _local2._y, 2, _local3));
tilesNumber++;
_local3++;
}
}
function checkForGameOver() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < goodGuysArray.length) {
if (goodGuysArray[_local2].toKill == true) {
_local3++;
}
_local2++;
}
if (_local3 == 10) {
gameOver("out_of_time");
}
}
function anglediff(a1, a2) {
a1 = Math.abs(wrapValue((a1 + 180) - a2) - 180);
return(a1);
}
function wrapValue(val) {
if (val >= 360) {
val = val - 360;
}
return(val);
}
function runSun() {
sunDelay--;
if (sunDelay == 0) {
sunDelay = int(sunDelay3 / 9);
shadowAngle++;
if (shadowAngle > 360) {
shadowAngle = 0;
}
dropShadow.angle = shadowAngle;
}
sunDelay2--;
if (sunDelay2 == 0) {
sunDelay2 = sunDelay3;
shadowLength++;
if (shadowLength < 10) {
dropShadow.distance = 10 - shadowLength;
} else if (shadowLength < 20) {
dropShadow.distance = shadowLength - 10;
} else {
shadowLength = 0;
}
}
inGameEnemyMc.filters = [dropShadow];
inGamePeopleMc.filters = [dropShadow];
playerMc.filters = [dropShadow];
}
function buyUpgrade(upgradeName, person) {
if (upgradeName == "Flak Jacket") {
person.flakjacket = true;
} else {
var _local2 = 0;
while (_local2 < rt.upgradeNames.length) {
if (upgradeName == rt.upgradeNames[_local2]) {
person.upgradeType = _local2 + 1;
}
_local2++;
}
}
}
function setupUpgrades(panel, personMc) {
upgradesMc = panel.createEmptyMovieClip("peopleUpgradeMc", 500);
upgradesMc._y = 27;
upgradesMc._x = 0;
upgradeIconsArray.splice(0);
var alreadyGotFlak = false;
var _local3 = 0;
while (_local3 < 9) {
var _local4 = upgradesMc.attachMovie("upgradeIcon", "upgradeIcon" + _local3, _local3);
_local4._x = _local3 * 28;
_local4.upgradesMc.gotoAndStop(_local3 + 1);
if (_local3 == 8) {
if (personMc.goodGuy.flakjacket == true) {
_local4.upgradeBack.selectedMc.gotoAndStop(2);
alreadyGotFlak = true;
}
}
if (alreadyGotFlak == false) {
upgradeIconsArray.push(_local4);
_local4.price = rt.upgradePrices[_local3];
_local4.upgradeName = rt.upgradeNames[_local3];
_local4.personMc = personMc;
_local4.indx = _local3;
if (personMc.goodGuy.upgradeType == (_local3 + 1)) {
_local4.upgradeBack.selectedMc.gotoAndStop(2);
} else if (rt.upgradePrices[_local3] > money) {
_local4._alpha = 40;
}
_local4.rt = rt;
_local4.upgradeBack.gameObjectBtn.onRelease = function () {
alreadyGotFlak = false;
if (this._parent._parent.upgradeName == "Flak Jacket") {
if (this._parent._parent.personMc.goodGuy.flakjacket == true) {
alreadyGotFlak = true;
}
}
if (alreadyGotFlak == false) {
if (this._parent._parent.price <= this._parent._parent.rt.Game.money) {
if ((this._parent._parent.personMc.goodGuy.upgradeType - 1) != this._parent._parent.indx) {
if (this._parent._parent.upgradeName != "Flak Jacket") {
this._parent._parent._parent["upgradeIcon" + (this._parent._parent.personMc.goodGuy.upgradeType - 1)].upgradeBack.selectedMc.gotoAndStop(1);
}
this._parent._parent.rt.Game.buyUpgrade(this._parent._parent.upgradeName, this._parent._parent.personMc.goodGuy);
this._parent._parent.rt.Game.decreaseMoney(this._parent._parent.price);
this._parent.selectedMc.gotoAndStop(2);
var _local2 = 0;
while (_local2 < 9) {
if (this._parent._parent.rt.upgradePrices[_local2] > this._parent._parent.rt.Game.money) {
if (this._parent._parent.upgradeNames[_local2] != "Flak Jacket") {
if (this._parent._parent.rt.Game.upgradeIconsArray[_local2].upgradeBack.selectedMc._currentframe == 1) {
this._parent._parent.rt.Game.upgradeIconsArray[_local2]._alpha = 40;
}
}
}
_local2++;
}
var _local3 = this._parent._parent.attachMovie("points", "msg", 1000);
_local3._x = this._parent._x;
_local3._y = this._parent._y;
_local3.txt.pointsTxt.text = "Bought!";
if (this._parent._parent.upgradeName != "Flak Jacket") {
this._parent._parent.personMc.goodGuy.mC.rangeCircle.gotoAndStop(this._parent._parent.personMc.goodGuy.upgradeType + 1);
this._parent._parent.personMc.goodGuy.weaponRange = this._parent._parent.personMc.goodGuy.mC.rangeCircle._width;
}
}
}
}
};
tilesNumber++;
}
_local3++;
}
if (personMc.goodGuy.inHouse == true) {
personMcHouseIcon = upgradesMc.attachMovie("personMoveIcon", "personMoveMc", tilesNumber);
personMcHouseIcon._x = 280;
personMcHouseIcon._y = -26;
personMcHouseIcon.rt = rt;
tilesNumber++;
}
personsEnergyMc = upgradesMc.attachMovie("personEnergyIcon", "personEnergy", tilesNumber);
personsEnergyMc._x = 316;
personsEnergyMc._y = -31;
personsEnergyMc.energyAnimMc.gotoAndStop(personMc.goodGuy.energy);
personsEnergyMc.energyAnimMc.energyMc.energy.text = personMc.goodGuy.energy;
personsEnergyMc.rt = rt;
tilesNumber++;
}
function setupPeoplePanel(panel, upgradeStart) {
panel.gotoAndStop("people");
objectSelected = "";
objectSelected2.mC.selectedMc.gotoAndStop(1);
peopleMc = panel.createEmptyMovieClip("peopleMc", 1);
peopleMc._x = 10;
peopleMc._y = 2;
var _local3 = 0;
while (_local3 < goodGuysArray.length) {
var _local2 = peopleMc.attachMovie("personIcon", "person" + _local3, _local3);
_local2._x = _local3 * (_local2._width + 5);
_local2.rt = rt;
_local2.goodGuy = goodGuysArray[_local3];
_local2.goodGuy.myIcon = _local2;
_local2.gameObjectBtn.onRelease = function () {
if (this._parent.faceMc._currentframe == 1) {
this._parent.rt.Game.selectedIcon.goodGuy.mC.selectedMc.gotoAndStop(1);
this._parent.goodGuy.mC.selectedMc.gotoAndStop(2);
this._parent.rt.Game.selectedIcon.selectedMc.gotoAndStop(1);
this._parent.selectedMc.gotoAndStop(2);
this._parent.rt.Game.selectedIcon = this._parent;
this._parent.rt.Game.setupUpgrades(this._parent._parent, this._parent);
}
};
tilesNumber++;
_local3++;
}
peopleMc["person" + upgradeStart].rt.Game.selectedIcon.goodGuy.mC.selectedMc.gotoAndStop(1);
peopleMc["person" + upgradeStart].goodGuy.mC.selectedMc.gotoAndStop(2);
peopleMc["person" + upgradeStart].rt.Game.selectedIcon.selectedMc.gotoAndStop(1);
peopleMc["person" + upgradeStart].selectedMc.gotoAndStop(2);
peopleMc["person" + upgradeStart].rt.Game.selectedIcon = peopleMc["person" + upgradeStart];
setupUpgrades(peopleMc, peopleMc["person" + upgradeStart]);
}
function runSpookySoundFx() {
}
function mainLoop() {
if (gameState == "play") {
doClock();
if (peopleInHouse == goodGuysArray.length) {
if (startSetupDone == false) {
startSetupDone = true;
var _local4 = inGameStatsMc.ingamestatsmc;
_local4 = _local4.wg;
setupPeoplePanel(_local4.gameItems, 0);
}
}
runSun();
if (rt.mouseButton == true) {
if (rt._ymouse < 500) {
if (rt.Player.gun.collision.hitTest(rt._xmouse, rt._ymouse, true)) {
selectedIcon.goodGuy.xTarget = rt.Player.mC._x;
selectedIcon.goodGuy.yTarget = rt.Player.mC._y;
selectedIcon.goodGuy.backToHouse = true;
selectedIcon.goodGuy.mC.selectedMc.gotoAndStop(2);
selectedIcon.goodGuy.moving = true;
} else {
var _local3 = false;
var _local2 = 0;
while (_local2 < goodGuysArray.length) {
if (goodGuysArray[_local2].starting == false) {
if (goodGuysArray[_local2].inHouse == false) {
if (goodGuysArray[_local2].mC.collisionMc.hitTest(rt._xmouse, rt._ymouse, true)) {
objectSelected2.mC.selectedMc.gotoAndStop(1);
selectedIcon.goodGuy.mC.selectedMc.gotoAndStop(1);
goodGuysArray[_local2].mC.selectedMc.gotoAndStop(2);
selectedIcon.selectedMc.gotoAndStop(1);
selectedIcon = goodGuysArray[_local2].myIcon;
selectedIcon.selectedMc.gotoAndStop(2);
_local3 = true;
objectSelected = "person";
pickedUpItem = "";
objectSelected2 = goodGuysArray[_local2];
setupUpgrades(peopleMc, peopleMc["person" + _local2]);
_local2 = goodGuysArray.length;
}
}
}
_local2++;
}
if (_local3 == false) {
if (selectedIcon.goodGuy.starting == false) {
if (selectedIcon.goodGuy.inHouse == false) {
selectedIcon.goodGuy.backToHouse = false;
selectedIcon.goodGuy.mC.selectedMc.gotoAndStop(2);
selectedIcon.goodGuy.moving = true;
selectedIcon.goodGuy.inHouse = false;
selectedIcon.goodGuy.xTarget = rt._xmouse;
selectedIcon.goodGuy.yTarget = rt._ymouse;
} else {
someonesOut = true;
selectedIcon.goodGuy.pickedUp = true;
selectedIcon.goodGuy.backToHouse = false;
selectedIcon.goodGuy.mC._rotation = 0;
selectedIcon.goodGuy.mC.gotoAndStop(1);
selectedIcon.goodGuy.mC.rangeCircle.gotoAndStop(selectedIcon.goodGuy.upgradeType + 1);
selectedIcon.goodGuy.weaponRange = selectedIcon.goodGuy.mC.rangeCircle._width;
selectedIcon.goodGuy.mC._visible = true;
selectedIcon.goodGuy.inHouse = false;
personMcHouseIcon._visible = false;
pickedUpItem = "personMc";
peopleInHouse2--;
}
}
}
}
}
}
var _local2 = 0;
while (_local2 < goodGuysArray.length) {
if (goodGuysArray[_local2].toKill == false) {
if (goodGuysArray[_local2].mC.collisionMc.hitTest(rt._xmouse, rt._ymouse, true)) {
goodGuysArray[_local2].decreaseEnergy(0);
}
goodGuysArray[_local2].mainLoop();
}
_local2++;
}
hittingHouse = false;
_local2 = 0;
while (_local2 < badGuysArray.length) {
if (badGuysArray[_local2].toKill == true) {
badGuysArray.splice(_local2, 1);
} else {
if (badGuysArray[_local2].mC.hitTest(rt._xmouse, rt._ymouse, true)) {
badGuysArray[_local2].showHealth();
}
badGuysArray[_local2].mainLoop(_local2);
}
_local2++;
}
_local2 = 0;
while (_local2 < missilesArray.length) {
missilesArray[_local2].mainLoop();
_local2++;
}
var _local3 = false;
_local2 = 0;
while (_local2 < upgradeIconsArray.length) {
if (upgradeIconsArray[_local2].hitTest(rt._xmouse, rt._ymouse, true)) {
turnOnTip(upgradeIconsArray[_local2]);
_local3 = true;
}
_local2++;
}
if (_local3 == false) {
turnOffTip();
}
setPeople();
checkForGameOver();
runZombies();
}
}
function personSelect(personSelected) {
if (goodGuysArray[personSelected].toKill == false) {
if (goodGuysArray[personSelected].starting == false) {
objectSelected2.mC.selectedMc.gotoAndStop(1);
selectedIcon.goodGuy.mC.selectedMc.gotoAndStop(1);
goodGuysArray[personSelected].mC.selectedMc.gotoAndStop(2);
selectedIcon.selectedMc.gotoAndStop(1);
selectedIcon = goodGuysArray[personSelected].myIcon;
selectedIcon.selectedMc.gotoAndStop(2);
objectSelected = "person";
pickedUpItem = "";
objectSelected2 = goodGuysArray[personSelected];
setupUpgrades(peopleMc, peopleMc["person" + personSelected]);
}
}
}
function turnOnTip(tipType) {
tip = true;
var _local2 = rt.mousePointer.attachMovie("tipsMc", "tipMc", 1);
_local2.tipMc.txt.text = (tipType.upgradeName + " $") + tipType.price;
_local2._y = -30;
}
function turnOffTip() {
if (tip == true) {
tip = false;
rt.mousePointer.tipMc.removeMovieClip();
}
}
function pauseOn() {
pauseSwitch = true;
gameState = "pause";
backgroundGradient.stop();
rt.Player.gun.stop();
pauseMc = inGameMc.attachMovie("pauseMc", "pauseMc", 3);
}
function pauseOff() {
pauseSwitch = false;
gameState = "play";
backgroundGradient.play();
rt.Player.gun.play();
pauseMc.removeMovieClip();
}
function decreaseMoney(decrease) {
money = int(money - decrease);
if (money < 0) {
money = 0;
}
setMoney();
}
function increaseScore(increase) {
score = int(score + increase);
if (score > 0) {
if (score > 999999) {
score = 999999 /* 0x0F423F */;
}
setScore();
}
}
function increaseMoney(increase) {
money = int(money + increase);
if (money > 0) {
if (money > 9999) {
money = 9999;
}
setMoney();
}
}
function setLives() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.lives.text = lives;
}
function setTarget() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.sizeTarget.text = sizeTarget;
}
function setLevel() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.dayTxt.text = levelNumber;
}
function setPeople() {
var _local4 = inGameStatsMc.ingamestatsmc;
_local4 = _local4.wg;
_local4 = _local4.stats;
var _local3 = 0;
var _local2 = 0;
while (_local2 < goodGuysArray.length) {
if (goodGuysArray[_local2].toKill == false) {
_local3++;
}
_local2++;
}
_local4.people.text = _local3;
}
function setMoney() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
if (money > 9999) {
money = 9999;
}
if (money < 10) {
_local2.money.text = "0000" + money;
} else if (money < 100) {
_local2.money.text = "000" + money;
} else if (money < 1000) {
_local2.money.text = "00" + money;
} else if (money < 10000) {
_local2.money.text = "0" + money;
} else {
_local2.money.text = money;
}
}
function setScore() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
if (score > 999999) {
score = 999999 /* 0x0F423F */;
}
if (score < 10) {
_local2.score.text = "00000" + score;
} else if (score < 100) {
_local2.score.text = "0000" + score;
} else if (score < 1000) {
_local2.score.text = "000" + score;
} else if (score < 10000) {
_local2.score.text = "00" + score;
} else if (score < 100000) {
_local2.score.text = "0" + score;
} else {
_local2.score.text = score;
}
}
function turnMusicOff() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.music.gotoAndStop(2);
}
function turnMusicOn() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.music.gotoAndStop(1);
}
function doClock() {
clockDelay--;
if (clockDelay == 0) {
clockDelay = 2;
countDown();
}
}
function countDown() {
sec++;
if (sec > 59) {
minutes++;
sec = 0;
if (minutes > 23) {
minutes = 0;
sec = 0;
} else if (minutes == 6) {
backgroundGradient.gotoAndPlay(1);
rt.Player.gun.gotoAndPlay(1);
shadowAngle = 45;
shadowLength = 0;
sunDelay = int(sunDelay3 / 9);
sunDelay2 = sunDelay3;
if (levelNumber == 10) {
gameOver("game_complete");
} else {
gameOver("level_complete");
}
dropShadow.distance = 10 - shadowLength;
dropShadow.angle = shadowAngle;
inGameEnemyMc.filters = [dropShadow];
playerMc.filters = [dropShadow];
inGamePeopleMc.filters = [dropShadow];
}
}
displayTime();
}
function displayTime() {
if (sec < 10) {
secDisplay = "0" + sec;
} else {
secDisplay = String(sec);
}
if (minutes < 10) {
minDisplay = "0" + minutes;
} else {
minDisplay = String(minutes);
}
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.time.text = (minDisplay + ":") + secDisplay;
}
}
Symbol 677 MovieClip [__Packages.Enemy] Frame 0
class Enemy
{
var root, currentRing, energyBarOn, arrayIndex, hits, ringRadius, mC, myScore, targetName, targetIndex1, homing, ringDrop, movingCloser, delayToFire, houseDelay, energyMc, attackingHouse, distanceToTarget, distanceArray;
function Enemy (clip, rt, xStart, yStart, sp, ii) {
root = rt;
currentRing = 1;
energyBarOn = 0;
arrayIndex = 0;
hits = 0;
ringRadius = 255;
xOrigin = xStart;
yOrigin = yStart;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
delayToFireMissile = 1;
angle = 0.2;
degrees = 0;
radius = 355;
centerX = root.movieWidth / 2;
centerY = 250;
speed = 6;
speed2 = 6;
angle = (Math.PI * root.Useful1.RandomNumber(1, 360)) / 180;
mC = clip;
numberOfMissiles = 0;
energyStart = 100;
energy = energyStart;
myScore = 10;
targetName = "";
targetIndex1 = 0;
gameObjectType = "";
homing = 0;
ringDrop = 20;
movingCloser = 0;
delayToFire = 50;
houseDelay = 60;
degrees = root.RandomNumber(1, 259);
angle = (Math.PI * degrees) / 180;
}
function UpRing() {
movingCloser = 1;
ringRadius = ringRadius + ringDrop;
}
function DownRing() {
movingCloser = 1;
ringRadius = ringRadius - ringDrop;
}
function showHealth() {
if (energyBarOn == 0) {
energyBarOn = 1;
energyMc = root.Game.inGameScoreMc.attachMovie("energyBar2", "energyBar" + root.scoreIndex, root.scoreIndex + 12000);
energyMc.enemy = this;
}
energyMc._x = mC._x + 15;
energyMc._y = mC._y - 5;
var _local2 = energy / 10;
energyMc.bar.bar._y = 10 - _local2;
root.scoreIndex++;
}
function takingDamage(damage) {
energy = energy - damage;
if (energy <= 0) {
var _local3 = root.Game.inGameExplosionsMc.attachMovie("explosion", "explosion" + root.Game.numberOfDropped, root.Game.numberOfDropped + 1000);
_local3._x = mC._x;
_local3._y = mC._y;
_local3.numberOfParticles = 10;
_local3.numberOfLoops = 1;
_local3.explodeDistance = 30;
_local3.gravity = false;
_local3.artillary = false;
_local3.explodeFrame = 1;
_local3.speed = 8;
_local3.startExplosion = true;
root.Game.numberOfDropped++;
targetIndex1.targeted--;
if (targetIndex1.targeted < 0) {
targetIndex1.targeted = 0;
}
var _local7 = root.Useful1.RandomNumber(1, 100);
var _local5 = "";
var _local6 = 0;
if (_local7 < 50) {
if (_local7 < 15) {
var _local4 = root.Game.inGameEnemyMc.attachMovie("medicPackMc", "medipack" + root.Game.tilesNumber, _root.Game.tilesNumber);
_local4._x = mC._x;
_local4._y = mC._y;
_local5 = "medi";
_local6 = 25;
} else {
var _local4 = root.Game.inGameEnemyMc.attachMovie("moneyMc", "money" + root.Game.tilesNumber, _root.Game.tilesNumber);
_local6 = root.Useful1.RandomNumber(10, 30);
_local4._x = mC._x;
_local4._y = mC._y;
_local5 = "money";
}
root.Game.pickupsArray.push(new GameItem(_local4, root, _local4._x, _local4._y, _local5, _local6));
root.Game.tilesNumber++;
}
root.Game.zombiesKilled++;
root.Game.increaseScore(10);
remove();
} else {
if (energy < 40) {
mC.head = 1;
} else if (energy < 60) {
mC.rightArm = 1;
root.sounds.moanFx.start(0, 1);
}
if (energy < 80) {
mC.leftArm = 1;
}
var _local3 = root.Game.inGameExplosionsMc.attachMovie("explosion", "explosion" + root.Game.numberOfDropped, root.Game.numberOfDropped + 1000);
_local3._x = mC._x;
_local3._y = mC._y;
_local3.numberOfParticles = 7;
_local3.numberOfLoops = 1;
_local3.explodeDistance = 20;
_local3.gravity = false;
_local3.artillary = false;
_local3.explodeFrame = 1;
_local3.speed = 8;
_local3.startExplosion = true;
root.Game.numberOfDropped++;
xPos = xPos - (xVel * 4);
yPos = yPos - (yVel * 4);
mC._x = xOrigin + xPos;
mC._y = yOrigin + yPos;
if (energyBarOn == 0) {
energyBarOn = 1;
energyMc = root.Game.inGameScoreMc.attachMovie("energyBar2", "energyBar" + root.scoreIndex, root.scoreIndex + 12000);
energyMc.enemy = this;
}
energyMc._x = mC._x + 15;
energyMc._y = mC._y - 5;
var _local8 = energy / 10;
energyMc.bar.bar._y = 10 - _local8;
root.scoreIndex++;
}
}
function mainLoop(ind) {
var _local5 = xPos;
var _local6 = yPos;
moveSprite();
var _local4 = root.Useful1.getDistance(root.Player.mC._x, root.Player.mC._y, mC._x, mC._y);
if (_local4 < 80) {
var _local3 = root.CollisionDetection1.CheckMoving(mC, root.Player.gun, xVel, yVel, root);
if (_local3.hit == true) {
root.Game.hittingHouse = true;
xVel = _local3.vx;
yVel = _local3.vy;
houseDelay--;
if (houseDelay == 0) {
houseDelay = 200;
var _local2 = 0;
while (_local2 < root.Game.goodGuysArray.length) {
if (root.Game.goodGuysArray[_local2].inHouse == true) {
if (root.Game.goodGuysArray[_local2].toKill == false) {
root.Player.gun.house.play();
root.Game.goodGuysArray[_local2].decreaseEnergy(1);
}
}
_local2++;
}
}
}
}
updatePosition();
if (attackingHouse == false) {
if (distanceToTarget < 30) {
if (mC.zombie._currentframe == 1) {
mC.zombie.gotoAndPlay("attack");
}
}
if (distanceToTarget < 20) {
if (mC.attack == true) {
targetIndex1.decreaseEnergy(1);
if (targetIndex1.toKill == true) {
getTarget();
mC.zombie.gotoAndPlay(1);
}
}
}
}
}
function getTarget() {
targetName = "";
var _local4 = false;
distanceArray = new Array();
var _local2 = 0;
while (_local2 < root.Game.goodGuysArray.length) {
if (root.Game.goodGuysArray[_local2].inHouse == false) {
if (root.Game.goodGuysArray[_local2].starting == false) {
if (root.Game.goodGuysArray[_local2].toKill == false) {
if (root.Game.goodGuysArray[_local2].targeted < 5) {
var _local3 = root.Useful1.getDistance(root.Game.goodGuysArray[_local2].mC._x, root.Game.goodGuysArray[_local2].mC._y, mC._x, mC._y);
if (_local3 < 150) {
root.Game.goodGuysArray[_local2].tempAngle = _local3;
distanceArray.push(root.Game.goodGuysArray[_local2]);
}
}
}
}
}
_local2++;
}
if (distanceArray.length != 0) {
distanceArray.sortOn("tempAngle", Array.NUMERIC);
distanceArray[0].targeted++;
targetIndex1 = distanceArray[0];
targetName = distanceArray[0].mC._name;
_local4 = true;
attackingHouse = false;
} else {
attackingHouse = true;
targetIndex1 = root.Player;
targetName = root.Player.mC._name;
}
}
function moveSprite() {
if (targetIndex1.mC._name != targetName) {
getTarget();
} else if (attackingHouse == false) {
if (targetIndex1.inHouse == true) {
getTarget();
} else {
distanceToTarget = root.Useful1.getDistance(targetIndex1.mC._x, targetIndex1.mC._y, mC._x, mC._y);
if (distanceToTarget > 300) {
getTarget();
}
}
} else {
var _local4 = false;
if (root.Game.peopleInHouse2 <= 0) {
var _local2 = 0;
while (_local2 < root.Game.goodGuysArray.length) {
var _local3 = root.Useful1.getDistance(root.Game.goodGuysArray[_local2].mC._x, root.Game.goodGuysArray[_local2].mC._y, mC._x, mC._y);
if (_local3 < 300) {
if (root.Game.goodGuysArray[_local2].inHouse == false) {
if (root.Game.goodGuysArray[_local2].starting == false) {
if (root.Game.goodGuysArray[_local2].toKill == false) {
root.Game.goodGuysArray[_local2].targeted++;
targetIndex1 = root.Game.goodGuysArray[_local2];
targetName = root.Game.goodGuysArray[_local2].mC._name;
_local4 = true;
attackingHouse = false;
_local2 = root.Game.goodGuysArray.length;
break;
}
}
}
}
_local2++;
}
} else {
var _local2 = 0;
while (_local2 < root.Game.goodGuysArray.length) {
var _local3 = root.Useful1.getDistance(root.Game.goodGuysArray[_local2].mC._x, root.Game.goodGuysArray[_local2].mC._y, mC._x, mC._y);
if (_local3 < 100) {
if (root.Game.goodGuysArray[_local2].inHouse == false) {
if (root.Game.goodGuysArray[_local2].starting == false) {
if (root.Game.goodGuysArray[_local2].toKill == false) {
root.Game.goodGuysArray[_local2].targeted++;
targetIndex1 = root.Game.goodGuysArray[_local2];
targetName = root.Game.goodGuysArray[_local2].mC._name;
_local4 = true;
attackingHouse = false;
_local2 = root.Game.goodGuysArray.length;
break;
}
}
}
}
_local2++;
}
}
}
var _local6 = root.Useful1.pointTowards(targetIndex1.mC._x, targetIndex1.mC._y, mC._x, mC._y);
distanceToTarget = root.Useful1.getDistance(targetIndex1.mC._x, targetIndex1.mC._y, mC._x, mC._y);
if (distanceToTarget > 15) {
var _local5 = 0;
if (distanceToTarget < 31) {
_local5 = 1;
}
mC._rotation = _local6.spriteRotation;
xVel = _local6.vx * (root.Game.zombieSpeed + _local5);
if (xVel > speed) {
xVel = speed;
}
if (xVel < (-speed)) {
xVel = -speed;
}
yVel = _local6.vy * (root.Game.zombieSpeed + _local5);
if (yVel > speed2) {
yVel = speed2;
}
if (yVel < (-speed2)) {
yVel = -speed2;
}
} else {
xVel = 0;
yVel = 0;
}
}
function remove() {
var _local2 = 0;
while (_local2 < root.Game.badGuysArray.length) {
if (this == root.Game.badGuysArray[_local2]) {
arrayIndex = _local2;
break;
}
_local2++;
}
mC.removeMovieClip();
root.Game.badGuysArray.splice(arrayIndex, 1);
}
function updateRotation() {
xOrigin = centerX + (Math.cos(angle) * radius);
yOrigin = centerY + (Math.sin(angle) * radius);
}
function updatePosition() {
xPos = xPos + xVel;
yPos = yPos + yVel;
mC._x = xOrigin + xPos;
mC._y = yOrigin + yPos;
}
var xOrigin = 0;
var yOrigin = 0;
var xPos = 0;
var yPos = 0;
var xVel = 0;
var yVel = 0;
var angle = 0;
var degrees = 0;
var centerX = 0;
var centerY = 0;
var radius = 0;
var speed = 0;
var speed2 = 0;
var cost = 0;
var playerleft = 0;
var playerright = 0;
var gameObjectType = "";
var energyStart = 0;
var energy = 0;
var delayToFireMissile = 60;
var numberOfMissiles = 0;
}
Symbol 678 MovieClip [__Packages.GameItem] Frame 0
class GameItem
{
var root, amount, mC, spriteType, arrayIndex, hits, delayToFire, gotGold, energyBarOn, xDir, homing, ringDrop, toKill, dropping, movingCloser, rotationDirection, starting, xTarget, yTarget, inHouse, standing, energyMc, dropRingNumber, dropAngle, holeX, holeY, ringNumber, globalAngle;
function GameItem (clip, rt, xStart, yStart, tt, am) {
root = rt;
amount = am;
mC = clip;
spriteType = tt;
arrayIndex = 0;
hits = 0;
xOrigin = xStart;
yOrigin = yStart;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
delayToFire = 30;
gotGold = 0;
energyBarOn = 0;
degrees = 0;
centerX = root.Game.gameWindowWidth / 2;
centerY = root.Game.movieHeight / 2;
xDir = 1;
numberOfMissiles = 0;
energyStart = 100;
energy = energyStart;
homing = 0;
ringDrop = 20;
toKill = false;
dropping = false;
movingCloser = 0;
delayToFire = 50;
rotationDirection = "";
starting = true;
xTarget = root.Player.mC._x;
yTarget = root.Player.mC._y;
inHouse = false;
standing = false;
updatePosition();
}
function mainLoop() {
}
function decreaseEnergy() {
energy = energy - 10;
if (energyBarOn == 0) {
energyBarOn = 1;
energyMc = mC.attachMovie("energyBar2", "energyBar" + root.scoreIndex, root.scoreIndex + 12000);
energyMc.enemy = this;
}
energyMc._x = 0;
energyMc._y = -25;
var _local3 = energy / 10;
energyMc.bar.bar._y = int(10 - _local3);
if (energy <= 0) {
if (gotGold == 1) {
var _local2 = root.inGameBackMc.attachMovie("goldLostAnim", "goldFound" + root.lostGold, root.lostGold);
_local2.g.g.text = "+1";
root.Game.increaseMoney();
var _local4 = (root.inGameBackMc._x - root.inGameBackMc._x) - root.inGameBackMc._x;
_local2._x = mC._x + _local4;
_local2._y = mC._y - root.inGameBackMc._y;
_local2._x + 340;
}
remove();
}
}
function remove() {
mC.removeMovieClip();
toKill = true;
var _local2 = 0;
while (_local2 < root.Game.pickupsArray.length) {
if (this == root.Game.pickupsArray[_local2]) {
arrayIndex = _local2;
break;
}
_local2++;
}
mC.removeMovieClip();
root.Game.pickupsArray[_local2].splice(arrayIndex, 1);
}
function calcFinishPosition() {
var _local2 = root.Game.ringsAngleArray[dropRingNumber - 1];
var _local3 = _local2 + dropAngle;
if (_local3 >= 360) {
_local3 = _local3 - 360;
}
_local2 = (Math.PI * _local3) / 180;
var _local4 = dropRingNumber * root.Game.ballRadius;
holeX = centerX + (Math.cos(_local2) * _local4);
holeY = centerY + (Math.sin(_local2) * _local4);
}
function updateRotation() {
var _local2 = root.Game.ringsAngleArray[ringNumber - 1];
globalAngle = _local2 + angle;
if (globalAngle >= 360) {
globalAngle = globalAngle - 360;
}
_local2 = (Math.PI * globalAngle) / 180;
radius = ringNumber * root.Game.ballRadius;
mC._x = centerX + (Math.cos(_local2) * radius);
mC._y = centerY + (Math.sin(_local2) * radius);
}
function updateEdgeRotation() {
var _local2 = root.Game.ringsAngleArray[ringNumber - 1];
globalAngle = angle;
if (globalAngle >= 360) {
globalAngle = globalAngle - 360;
}
_local2 = (Math.PI * globalAngle) / 180;
mC._x = centerX + (Math.cos(_local2) * radius);
mC._y = centerY + (Math.sin(_local2) * radius);
}
function updatePosition() {
xOrigin = xOrigin + xVel;
yOrigin = yOrigin + yVel;
mC._x = xOrigin;
mC._y = yOrigin;
}
var xOrigin = 0;
var yOrigin = 0;
var xPos = 0;
var yPos = 0;
var xVel = 0;
var yVel = 0;
var angle = 0;
var degrees = 0;
var centerX = 0;
var centerY = 0;
var radius = 0;
var speed = 0;
var cost = 0;
var playerleft = 0;
var playerright = 0;
var gameObjectType = "";
var energyStart = 0;
var energy = 0;
var delayToFireMissile = 60;
var numberOfMissiles = 0;
}
Symbol 679 MovieClip [__Packages.Useful] Frame 0
class Useful
{
function Useful () {
}
function bounce(mc, targetX, targetY, spring, vx, vy, friction) {
var _local4 = (targetX - mc._xscale) * spring;
var _local3 = (targetY - mc._xscale) * spring;
vx = vx + _local4;
vy = vy + _local3;
vx = vx * friction;
vy = vy * friction;
mc._xscale = mc._xscale + vx;
mc._yscale = mc._xscale;
}
function getDistance(xx1, yy1, xx2, yy2) {
var _local4 = xx1;
var _local3 = yy1;
var _local2 = xx2;
var _local1 = yy2;
_local2 = _local4 - _local2;
_local1 = _local3 - _local1;
return(Math.sqrt((_local2 * _local2) + (_local1 * _local1)));
}
function RandomNumber(x, y) {
return(Math.round(Math.random() * (y - x)) + x);
}
function getArcVelocity(gravity, speed, xStart, yStart, xEnd, yEnd) {
var _local1 = new Object();
var _local3 = xEnd - xStart;
var _local4 = yEnd - yStart;
var _local6 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
var _local2 = Math.ceil(_local6 / speed);
_local1.gravity = gravity;
_local1.steps = _local2;
_local1.xStep = _local3 / _local2;
_local1.yStep = _local4 / _local2;
if (gravity > 0) {
_local1.yStep = _local1.yStep - ((_local2 * gravity) / 2);
}
return(_local1);
}
function localToGlobalXY(mc1) {
var _local3 = new Object();
_local3.newX = 0;
_local3.newY = 0;
var _local2 = mc1;
while (_local2 != _root) {
var _local6 = _local3.newX * (_local2._xscale / 100);
var _local5 = _local3.newY * (_local2._yscale / 100);
var _local4 = _local2._rotation * (Math.PI/180);
_local3.newX = (_local6 * Math.cos(_local4)) - (_local5 * Math.sin(_local4));
_local3.newY = (_local6 * Math.sin(_local4)) + (_local5 * Math.cos(_local4));
_local3.newX = _local3.newX + _local2._x;
_local3.newY = _local3.newY + _local2._y;
_local2 = _local2._parent;
}
return(_local3);
}
function radian(degree) {
return((degree * Math.PI) / 180);
}
function addThrust(rot, speed) {
var _local2 = new Object();
_local2.xVel = Math.cos(radian(rot)) * speed;
_local2.yVel = Math.sin(radian(rot)) * speed;
return(_local2);
}
function getVectorFromAngle(rotationVar) {
var _local1 = new Object();
var _local2 = (rotationVar * Math.PI) / 180;
_local1.vx = Math.cos(_local2);
_local1.vy = Math.sin(_local2);
return(_local1);
}
function capVectorSpeed(vx, vy, max) {
var _local2 = new Object();
var _local1 = Math.sqrt((vx * vx) + (vy * vy));
if (_local1 > max) {
vx = vx * (max / _local1);
vy = vy * (max / _local1);
}
_local2.vx = vx;
_local2.vy = vy;
return(_local2);
}
function countMcs(mC) {
var _local2 = new Array();
var _local3 = 0;
for (_local3 in mC) {
if (typeof(mC[_local3]) == "movieclip") {
_local2.push(mC[_local3]);
}
}
return(_local2);
}
function pointTowards(xx, yy, xx2, yy2) {
var _local1 = new Object();
var _local3 = xx - xx2;
var _local2 = yy - yy2;
_local1.spriteAngle = Math.atan2(_local2, _local3);
_local1.spriteRotation = (_local1.spriteAngle * 180) / Math.PI;
_local1.vx = Math.cos(_local1.spriteAngle);
_local1.vy = Math.sin(_local1.spriteAngle);
return(_local1);
}
function rotateXY(centerX, centerY, radius, ringAngle) {
var _local2 = (Math.PI * ringAngle) / 180;
var _local1 = new Object();
_local1.xPos = centerX + (Math.cos(_local2) * radius);
_local1.yPos = centerY + (Math.sin(_local2) * radius);
return(_local1);
}
function dashTo(startx, starty, endx, endy, len, gap, mC) {
if (arguments.length < 6) {
return(false);
}
var _local12;
var _local9;
var _local8;
var _local10;
var _local3;
var _local2;
_local12 = len + gap;
_local9 = endx - startx;
_local8 = endy - starty;
var _local11 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
_local10 = Math.floor(Math.abs(_local11 / _local12));
var _local5 = Math.atan2(_local8, _local9);
_local3 = startx;
_local2 = starty;
_local9 = Math.cos(_local5) * _local12;
_local8 = Math.sin(_local5) * _local12;
var _local4 = 0;
while (_local4 < _local10) {
mC.moveTo(_local3, _local2);
mC.lineTo(_local3 + (Math.cos(_local5) * len), _local2 + (Math.sin(_local5) * len));
_local3 = _local3 + _local9;
_local2 = _local2 + _local8;
_local4++;
}
mC.moveTo(_local3, _local2);
_local11 = Math.sqrt(((endx - _local3) * (endx - _local3)) + ((endy - _local2) * (endy - _local2)));
if (_local11 > len) {
mC.lineTo(_local3 + (Math.cos(_local5) * len), _local2 + (Math.sin(_local5) * len));
} else if (_local11 > 0) {
mC.lineTo(_local3 + (Math.cos(_local5) * _local11), _local2 + (Math.sin(_local5) * _local11));
}
mC.moveTo(endx, endy);
}
function drawDash(startx, starty, endx, endy, len, gap) {
_root.clear();
_root.lineStyle(2, 6719658);
_root.dashTo(startx, starty, endx, endy, len, gap);
updateAfterEvent();
}
}
Symbol 632 Button
on (release) {
gotoAndStop ("show_mj_anim");
}
Symbol 642 MovieClip Frame 1
this._visible = false;
Symbol 644 Button
on (release) {
_root.MindJoltSponsoredAPI.openLink(1);
}
Symbol 663 MovieClip Frame 38
stop();
Symbol 665 MovieClip Frame 1
_parent.stop();
Symbol 665 MovieClip Frame 54
mindlogo.stop();
Symbol 665 MovieClip Frame 60
mindlogo.play();
Symbol 665 MovieClip Frame 177
_parent.play();
stop();