Frame 5
_quality = "high";
Stage.showMenu = false;
Instance of Symbol 11 MovieClip "loadingbar" in Frame 5
onClipEvent (load) {
var percent = 0;
var startedFlag = false;
_width = 0;
this.onEnterFrame = function () {
percent = Math.floor((_parent.getBytesLoaded() / _parent.getBytesTotal()) * 100);
_width = (1.28 * percent);
if (percent < 25) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
if (percent == 100) {
_width = 0;
_parent.surround.gotoAndStop(2);
delete this.onEnterFrame;
}
};
}
Instance of Symbol 2043 MovieClip in Frame 6
onClipEvent (load) {
_visible = false;
}
Frame 8
if (loadingbar.percent >= 100) {
this.gotoAndPlay(this._currentframe + 1);
} else {
this.gotoAndPlay(this._currentframe - 1);
}
Frame 9
function loadMap() {
varReciever = new LoadVars();
varReciever.onData = function (src) {
parseMap(src);
};
var _local2 = new LoadVars();
_local2.sendAndLoad("_map/level.txt", varReciever, "POST");
this.onEnterFrame = progressBarUpdateLoadVars;
}
function progressBarUpdateLoadVars() {
var _local3 = varReciever.getBytesLoaded();
var _local4 = varReciever.getBytesTotal();
var _local2 = Math.floor((_local3 / _local4) * 100);
if (_local3 == undefined) {
return(undefined);
}
loadingbar._width = 1.28 * _local2;
if (_local2 < 25) {
loadingbar.gotoAndStop(2);
} else {
loadingbar.gotoAndStop(1);
if (_local2 == 100) {
delete this.onEnterFrame;
}
}
}
function parseMap(src) {
var tempMap = src.split("|");
var tempData;
var _local6 = tempMap.shift();
var mapWidth = tempMap.shift();
var mapHeight = tempMap.shift();
var cnt = 0;
var _local5 = 0;
var hL = 0;
this.onEnterFrame = function () {
var _local3 = new Array();
var _local2 = -1;
var _local4 = 0;
while (_local4++ , _local4 != 10) {
_local2 = -1;
_local3 = new Array();
while (_local2++ , _local2 < mapWidth) {
tempData = tempMap[cnt++].split(",");
_local3[_local2] = [tempData[0], tempData[1], 1];
}
_map[hL] = _local3;
_mapMaster[hL] = _local3;
if ((++hL) >= mapHeight) {
delete this.onEnterFrame;
this.gotoAndPlay(this._currentframe + 1);
break;
}
}
};
}
var _map = new Array();
var _mapMaster = new Array();
var varReciever;
loadMap();
stop();
Frame 10
var ver = "ver$0.9 - 2006_12_05";
_global.frameRate = 31;
_global.masterVolume = 100;
var inkey = Key.isDown;
var currentName = "Name";
var currentEmail = "Email";
var compEntry = true;
var level;
var score;
var health = 1;
var playerInputFunc;
var keyUP = 38;
var keyDOWN = 40;
var keyLEFT = 37;
var keyRIGHT = 39;
var keyFIRE = 32;
var playerSFX;
var playerDirection;
var playerAnimFlag;
var verticalAnimFlag;
var deadFlag;
var activeMates;
var matesCoord;
var jeffStatus;
var peteStatus;
var johnStatus;
var gfStatus;
var activeSoldiers = new Array();
var activeMeteorites = new Array();
var activeUFOs = new Array();
var satNavAnimHandlerFunc;
var satNavInputFunc;
var satNavQuitTestFunc;
var satNavScroller;
var targetX;
var targetY;
var targetSprite;
var targetFound;
var scrollSpeed = 4;
var defaultPlayFieldPos;
var defaultPlayFieldContainerPos;
var timer;
var tick;
var explosionFlipFlop;
var explosionXCoord;
var explosionYCoord;
var explosionFunc;
var spritePlayField;
var hiScoreTable = new Array();
function distanceCalc(coords1, coords2) {
var _local2 = coords2.x - coords1.x;
var _local1 = coords2.y - coords1.y;
return(int(Math.sqrt((_local2 * _local2) + (_local1 * _local1)) / 2));
}
function rotateClips() {
var _local3;
var _local2 = int(((Math.atan2(targetY - playerYPos, targetX - playerXPos) / 3.14) * 180) + 90);
_local2 = mode360(_local2);
var _local1 = mode360(player.compass._rotation);
if (targetX > playerXPos) {
if (_local1 <= 180) {
if (_local2 <= _local1) {
_local3 = -1;
} else {
_local3 = 1;
}
}
if (_local1 > 180) {
if ((_local1 - _local2) >= ((360 - _local1) + _local2)) {
_local3 = 1;
} else {
_local3 = -1;
}
}
}
if (targetX < playerXPos) {
if (_local1 <= 180) {
if (((_local1 + 360) - _local2) <= (_local2 - _local1)) {
_local3 = -1;
} else {
_local3 = 1;
}
}
if (_local1 > 180) {
if (_local2 <= _local1) {
_local3 = -1;
} else {
_local3 = 1;
}
}
}
var _local4 = Math.abs(_local2 - _local1);
return(Math.min(_local4 / 3, 10) * _local3);
}
function mode360(num) {
return((num + 360) % 360);
}
_global.findPath = function (map, startY, startX, endY, endX) {
var _local18 = 10;
var _local12 = 14;
var _local16 = false;
var _local15 = true;
isOpen = function (y, x) {
return(mapStatus[y][x].open);
};
isClosed = function (y, x) {
return(mapStatus[y][x].closed);
};
nearerSquare = function () {
var _local4 = 999999 /* 0x0F423F */;
var _local5 = 0;
var _local2;
var _local3;
var _local1 = openList.length;
while ((_local1--) > 0) {
_local3 = mapStatus[openList[_local1][0]][openList[_local1][1]];
_local2 = _local3.heuristic + _local3.movementCost;
if (_local2 <= _local4) {
_local4 = _local2;
_local5 = _local1;
}
}
return(_local5);
};
closeSquare = function (y, x) {
var _local2 = openList.length;
var _local1 = 0;
while (_local1 < _local2) {
if (openList[_local1][0] == y) {
if (openList[_local1][1] == x) {
openList.splice(_local1, 1);
break;
}
}
_local1++;
}
mapStatus[y][x].open = false;
mapStatus[y][x].closed = true;
};
openSquare = function (y, x, parent, movementCost, heuristic, replacing) {
if (!replacing) {
openList.push([y, x]);
mapStatus[y][x] = {heuristic:heuristic, open:true, closed:false};
}
mapStatus[y][x].parent = parent;
mapStatus[y][x].movementCost = movementCost;
};
var _local8 = map.length;
var _local17 = map[0].length;
var mapStatus = new Array();
var _local11 = 0;
while (_local11 < _local8) {
mapStatus[_local11] = new Array();
_local11++;
}
var openList = new Array();
openSquare(startY, startX, undefined, 0);
while ((openList.length > 0) && (!isClosed(endY, endX))) {
_local11 = nearerSquare();
var _local6 = openList[_local11][0];
var _local7 = openList[_local11][1];
closeSquare(_local6, _local7);
var _local2 = _local6 - 1;
while (_local2 < (_local6 + 2)) {
var _local1 = _local7 - 1;
while (_local1 < (_local7 + 2)) {
if (((((((_local2 >= 0) && (_local2 < _local8)) && (_local1 >= 0)) && (_local1 < _local17)) && (!((_local2 == _local6) && (_local1 == _local7)))) && ((_local16 || (_local2 == _local6)) || (_local1 == _local7))) && (((_local15 || (_local2 == _local6)) || (_local1 == _local7)) || ((map[_local2][_local7] != 0) && (map[_local6][_local1])))) {
if (map[_local2][_local1] != 0) {
if (!isClosed(_local2, _local1)) {
var _local3 = mapStatus[_local6][_local7].movementCost + ((((_local2 == _local6) || (_local1 == _local7)) ? (_local18) : (_local12)) * map[_local2][_local1]);
if (isOpen(_local2, _local1)) {
if (_local3 < mapStatus[_local2][_local1].movementCost) {
openSquare(_local2, _local1, [_local6, _local7], _local3, undefined, true);
}
} else {
var _local5 = (Math.abs(_local2 - endY) + Math.abs(_local1 - endX)) * 10;
openSquare(_local2, _local1, [_local6, _local7], _local3, _local5, false);
}
}
}
}
_local1++;
}
_local2++;
}
}
var _local27 = isClosed(endY, endX);
delete isOpen;
delete isClosed;
delete nearerSquare;
delete closeSquare;
delete openSquare;
if (_local27) {
var _local22 = new Array();
var _local6 = endY;
var _local7 = endX;
while ((_local6 != startY) || (_local7 != startX)) {
_local22.push([_local6, _local7]);
var _local19 = mapStatus[_local6][_local7].parent[0];
var _local20 = mapStatus[_local6][_local7].parent[1];
_local6 = _local19;
_local7 = _local20;
}
_local22.push([startY, startX]);
return(_local22);
}
return(null);
};
XML.prototype.ignoreWhite = true;
XML.prototype.makeObj = function (xObj, obj) {
if (xObj == null) {
xObj = this;
}
if (obj == null) {
obj = {};
}
var _local7;
var _local5;
var _local3;
var _local6;
var _local8;
var _local9;
for (_local7 in xObj.attributes) {
obj[_local7] = xObj.attributes[_local7];
}
for (_local5 in xObj.childNodes) {
_local3 = xObj.childNodes[_local5].nodeName;
_local6 = xObj.childNodes[_local5].nodeType;
_local8 = xObj.childNodes[_local5].nodeValue;
if (_local6 == 3) {
obj._value = _local8;
obj._type = "text";
}
if ((_local6 == 1) && (_local3 != null)) {
if (obj[_local3] == null) {
obj[_local3] = this.makeObj(xObj.childNodes[_local5], {});
} else if (obj[_local3]._type != "array") {
obj[_local3] = [obj[_local3]];
obj[_local3]._type = "array";
}
if (obj[_local3]._type == "array") {
obj[_local3].unshift(this.makeObj(xObj.childNodes[_local5], {}));
}
}
}
return(obj);
};
Color.prototype.setBrightness = function (bright) {
var _local3 = 0;
if (bright > 0) {
_local3 = 256 * (bright / 100);
}
var _local2 = new Object();
_local2.ra = (_local2.ga = (_local2.ba = 100 - Math.abs(bright)));
_local2.rb = (_local2.gb = (_local2.bb = _local3));
this.setTransform(_local2);
};
Array.prototype.random = function () {
var _local5 = [];
var _local4 = this.length;
var _local3 = 0;
while (_local3 < _local4) {
_local5[_local3++] = this.splice(Math.floor(Math.random() * this.length), 1);
}
var _local2 = 0;
while (_local2 < _local4) {
this[_local2] = _local5[_local2];
_local2++;
}
return(this);
};
function getHiScores() {
varReciever = new LoadVars();
varReciever.onData = function (src) {
if (src == undefined) {
scoresLoaded = true;
return(undefined);
}
var _local1 = new XML();
_local1.parseXML(src);
hiScoreObject = _local1.makeObj();
parseHiScores();
};
var _local2 = new LoadVars();
_local2.sendAndLoad(getHighScoreURL, varReciever, "POST");
}
function parseHiScores() {
hiScoreTable = new Array();
var _local1;
var _local2 = -1;
var _local3 = hiScoreObject.score.row.length;
if ((_local3 == undefined) || (_local3 == 0)) {
_local1 = hiScoreObject.score.row;
hiScoreTable.push(["1", "0", "Player"]);
} else {
while (_local2++ , _local2 != _local3) {
_local1 = hiScoreObject.score.row[_local2];
hiScoreTable.push([_local1.rank, _local1.score, _local1.playerName]);
}
hiScoreTable.sortOn(0);
}
scoresLoaded = true;
}
var mailform = "mailamate.php";
var getHighScoreURL = "gethighscore.php";
var sendHighScoreURL = "submitscore.php";
var hiScoreObject;
var hiScoreTable;
var scoresLoaded;
function getDistanceVolume(xCoord, yCoord, amount) {
var _local3 = {x:xCoord, y:yCoord};
var _local2 = {x:playerXPos, y:playerYPos};
var _local4 = distanceCalc(_local3, _local2);
if (amount == undefined) {
amount = 2;
}
var _local1 = 100 - (_local4 * amount);
return(_local1);
}
function getDistancePan(xCoord) {
var _local1 = xCoord - playerXPos;
var _local2 = _local1 * 4;
return(_local2);
}
function toggleSound() {
delete infoModule.soundToggle.onEnterFrame;
if (_global.masterVolume == 100) {
_global.masterVolume = 0;
var frame = 2;
} else {
_global.masterVolume = 100;
var frame = 1;
}
titleMod.setVolume(_global.masterVolume);
backgroundSFX.setVolume(_global.masterVolume);
infoModule.soundToggle.frame = frame;
infoModule.soundToggle.onEnterFrame = function () {
if (this._currentframe != this.frame) {
this.gotoAndStop(this.frame);
} else {
delete infoModule.soundToggle.onEnterFrame;
}
};
}
var footStepSFX = new Sound(surround);
footStepSFX.attachSound("footStepSFX");
var backgroundSFX = new Sound(surround);
backgroundSFX.attachSound("backgroundSFX");
var satNavButtonSFX = new Sound(surround);
satNavButtonSFX.attachSound("satNavButtonSFX");
var satNavErrorSFX = new Sound(surround);
satNavErrorSFX.attachSound("satNavErrorSFX");
var titleMod = new Sound(player);
titleMod.attachSound("titleMod");
var playerHurtSFX = new Array("hurt1SFX", "hurt2SFX", "hurt3SFX", "hurt4SFX", "hurt5SFX");
var playerStartPositions = new Array([6, 4], [68, 14], [21, 61], [115, 6], [192, 85], [151, 157]);
var startTimes = new Array(90, 120, 180, 180, 120, 120);
var targetCoords = new Array([67, 14], [19, 60], [114, 5], [191, 85], [151, 156], [38, 160]);
var targetStorage = new Array("mate1", "mate2", "mate3", "mate4", "cashPoint", "pub");
var mateStartPositions1 = new Array([67, 14], [20, 59], [112, 6], [190, 83], [152, 159]);
var mateStartPositions2 = new Array([0, 0], [19, 60], [113, 5], [189, 84], [153, 156]);
var mateStartPositions3 = new Array([0, 0], [0, 0], [114, 5], [193, 86], [151, 156]);
var mateStartPositions4 = new Array([0, 0], [0, 0], [0, 0], [191, 85], [152, 157]);
var zombiePositions = new Array([53, 25, 18, 36, 25, 57], [45, 21, 25, 47, 8, 33], [37, 25, 26, 55, 58, 35], [26, 29, 15, 61, 40, 38], [24, 24, 27, 62, 72, 6], [40, 28, 27, 66, 31, 49], [14, 26, 8, 61, 31, 37], [25, 37, 28, 63, 8, 56], [29, 39, 15, 49, 45, 53], [61, 28, 28, 32, 9, 52]);
var zombiePositions2 = new Array([7, 57, null, null, null, null], [11, 71, null, null, null, null], [8, 80, null, null, null, null]);
var firePositions = new Array([[6, 19, "fireHorizontal4", 44, 15, "fireHorizontal2", 86, 14, "fireVertical4"], [24, 32, "fireHorizontal5", 8, 1, "fireHorizontal3", 69, 32, "fireHorizontal3"], [6, 35, "fireHorizontal4", 38, 25, "fireHorizontal2", 81, 25, "fireVertical4"], [24, 24, "fireHorizontal5", 57, 35, "fireHorizontal4", 89, 3, "fireVertical4"]], [[75, 36, "fireVertical4", 6, 67, "fireHorizontal4", 89, 3, "fireVertical4"], [41, 59, "fireVertical4", 44, 15, "fireHorizontal2", 86, 14, "fireVertical4"], [33, 47, "fireVertical5", 15, 59, "fireHorizontal2", 88, 25, "fireVertical4"], [24, 69, "fireHorizontal5", 6, 24, "fireHorizontal4", 88, 25, "fireVertical4"]], [[6, 47, "fireHorizontal4", 6, 98, "fireHorizontal4", 70, 93, "fireVertical4"], [19, 49, "fireVertical3", 53, 81, "fireVertical4", 93, 25, "fireVertical4"], [51, 70, "fireVertical4", 116, 59, "fireVertical4", 15, 59, "fireHorizontal2"], [76, 81, "fireVertical4", 108, 14, "fireVertical4", 44, 99, "fireHorizontal2"]], [[151, 90, "fireHorizontal4", 113, 12, "fireHorizontal3", 145, 38, "fireVertical4"], [100, 4, "fireVertical3", 158, 4, "fireVertical4", 146, 59, "fireVertical4"], [191, 22, "fireHorizontal3", 152, 65, "fireHorizontal2", null, null, null], [143, 74, "fireHorizontal2", null, null, null, null, null, null], [145, 49, "fireVertical3", 191, 101, "fireHorizontal3", null, null, null]], [[176, 94, "fireVertical3", 146, 149, "fireVertical4", null, null, null], [149, 104, "fireVertical4", 148, 160, "fireVertical4", null, null, null], [148, 119, "fireHorizontal3", null, null, null, null, null, null]], [[148, 119, "fireHorizontal3", null, null, null, null, null, null]]);
var crackPositions = new Array([[67, 4, "crackVertical"], [57, 17, "crackHorizontal"]], [[22, 59, "crackVertical"]], [[16, 70, "crackVertical4"], [57, 77, "crackHorizontal"], [139, 38, "crackVertical"], [121, 14, "crackVertical4"]], [[174, 59, "crackVertical4"], [149, 83, "crackVertical"], [169, 98, "crackHorizontal"], [182, 27, "crackVertical4"]], [[148, 128, "crackVertical"], [151, 155, "crackHorizontal"]]);
var toxicPositions = new Array([[149, 39, 4], [169, 56, 3], [149, 73, 2], [146, 95, 1]]);
var tentaclePositions = new Array([16, 1, 2], [44, 38, 1], [111, 49, 1], [136, 3, 2]);
var antPositions = new Array([[51, 95, 110, 49, 75, 71], [104, 60, null, null, null, null], [104, 28, null, null, null, null]], [[138, 5, 169, 34, 154, 48]]);
var spiderPositions = new Array([94, 38, 117, 14, null, null], [120, 26, 25, 97, null, null], [89, 60, null, null, null, null]);
var soldierPositions = new Array([[70, 82, 104, 48, 111, 15], [81, 71, 103, 37, null, null], [71, 50, 122, 26, null, null]], [[138, 9, 149, 27, 151, 78], [152, 11, 169, 38, null, null], [162, 51, null, null, null, null], [173, 72, null, null, null, null]]);
var alienPositions = new Array([[156, 17, 191, 40, 164, 94], [155, 31, 153, 60, 183, 95], [185, 27, 168, 59, null, null], [177, 41, 171, 69, null, null], [184, 49, 152, 71, null, null]], [[187, 95, 177, 107, 160, 140], [188, 105, 163, 153, null, null], [193, 110, 156, 107, 169, 157], [186, 117, 151, 112, 162, 165], [170, 103, 153, 128, 192, 119], [178, 120, 151, 149, null, null]]);
function init() {
hiScoreTable = new Array();
var _local1 = 0;
while (_local1++ , _local1 != 11) {
hiScoreTable.push([_local1, 0, "Player"]);
}
playField.createEmptyMovieClip("container", 1);
spritePlayField = playField.createEmptyMovieClip("spritePlayField", 2);
topSpritePlayField = topSpritePlayFieldHolder.createEmptyMovieClip("container", 1);
highestSpritePlayField = highestSpritePlayFieldHolder.createEmptyMovieClip("container", 1);
scrollerOneShot();
}
function scrollerOneShot() {
map1Parameters.container = playField.container;
defaultPlayFieldPos = {x:spritePlayField._x, y:spritePlayField._y};
defaultPlayFieldContainerPos = {x:playField.container._x, y:playField.container._y};
playField.scrollRect = new flash.geom.Rectangle(playField.container._x, playField.container._y, 416, 288);
topSpritePlayFieldHolder.scrollRect = new flash.geom.Rectangle(topSpritePlayField._x, topSpritePlayField._y, 416, 288);
highestSpritePlayFieldHolder.scrollRect = new flash.geom.Rectangle(highestSpritePlayField._x, highestSpritePlayField._y, 416, 288);
map1Parameters.map = _map;
scroller = new scrollerEngine();
scroller.init(map1Parameters);
scrollerReset();
satNavScroller = new scrollerEngine();
fadeGameIn();
}
function scrollerReset() {
playField.container._x = defaultPlayFieldContainerPos.x;
playField.container._y = defaultPlayFieldContainerPos.y;
scroller.resetScroller();
highestSpritePlayField._x = (topSpritePlayField._x = (spritePlayField._x = playField.container._x));
highestSpritePlayField._y = (topSpritePlayField._y = (spritePlayField._y = playField.container._y));
}
function fadeGameIn() {
coverAll.onEnterFrame = function () {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
surround.gotoAndPlay(1);
this.onEnterFrame = function () {
if (surround._currentframe == surround._totalframes) {
delete this.onEnterFrame;
coverAll.unloadMovie();
titleText.gotoAndPlay(1);
titleText._visible = true;
attractMode();
}
};
}
};
}
function attractMode() {
if (frame._visible == false) {
frame._visible = (playField._visible = (softEdges._visible = true));
surround.frame._visible = (infoBar._visible = false);
}
delete attract.onEnterFrame;
titleMod.setVolume(0);
titleMod.start(0, 999999);
player.onEnterFrame = function () {
var _local3 = titleMod.getVolume();
if (_local3 == _global.masterVolume) {
delete this.onEnterFrame;
} else {
_local3 = _local3 + 2;
titleMod.setVolume(_local3);
}
};
titleText.fireVideo.gotoAndPlay(titleText.fireVideo._currentframe);
attract.gotoAndPlay(2);
}
function attractModeKill() {
titleText.fireVideo.gotoAndStop(titleText.fireVideo._currentframe);
attract.setMask(wipe);
wipe.gotoAndPlay(1);
wipe._visible = true;
introScreenInit(1);
if (masterVolume != 0) {
player.onEnterFrame = function () {
var _local2 = titleMod.getVolume();
if (_local2 == 0) {
titleMod.stop();
titleMod.setVolume(masterVolume);
delete this.onEnterFrame;
} else {
_local2 = _local2 - 2;
titleMod.setVolume(_local2);
}
};
} else {
titleMod.stop();
}
this.onEnterFrame = function () {
if (wipe._currentframe == wipe._totalframes) {
attract.gotoAndPlay(1);
attract.setMask(null);
this.onEnterFrame = function () {
delete this.onEnterFrame;
startGame();
introScreenButtonInit();
};
}
};
}
function startGame() {
level = 1;
score = 0;
infoModule.healthBar.gotoAndStop(health);
backgroundSFX.setVolume(masterVolume);
matesInit();
_map = duplicateMap(_mapMaster);
map1Parameters.map = _map;
continueGameHidden();
}
function continueGameHidden() {
timerInit();
infoBar._visible = true;
playerInit();
scroller.startXPos = playerXPos - 6;
scroller.startYPos = playerYPos - 4;
scrollerReset();
targetInit();
objectInit();
setPieceInit();
soldiersMainInit();
if (level > 1) {
if (level < 6) {
addMate();
}
}
repositionMates();
baddiesInit();
baddieMainLoop();
artBasedHandler();
if (level != 6) {
explosionInit();
if (level == 5) {
}
} else {
meteoriteInit();
}
}
function continueGame() {
sfxHandler.startSFX();
this.onEnterFrame = master;
}
function houseKeeping() {
playerHouseKeeping();
targetHouseKeeping();
matesHouseKeeping();
satNavHouseKeeping();
baddiesHouseKeeping();
objectHouseKeeping();
soldiersHouseKeeping();
meteoriteHouseKeeping();
ufoHouseKeeping();
}
function cls() {
var _local1 = 0;
for (_local1 in spritePlayField) {
if (typeof(spritePlayField[_local1]) == "movieclip") {
spritePlayField[_local1].removeMovieClip();
}
}
for (_local1 in topSpritePlayField) {
if (typeof(topSpritePlayField[_local1]) == "movieclip") {
topSpritePlayField[_local1].removeMovieClip();
}
}
for (_local1 in highestSpritePlayField) {
if (typeof(highestSpritePlayField[_local1]) == "movieclip") {
highestSpritePlayField[_local1].removeMovieClip();
}
}
}
function playerDead() {
delete this.onEnterFrame;
deadBitmap = new flash.display.BitmapData(600, 425, true, 0);
deadBitmap.draw(_root);
bitmapHolder.attachBitmap(deadBitmap, 1);
spritePlayField._visible = (topSpritePlayField._visible = (highestSpritePlayField._visible = false));
bitmapHolder.colour = new Color(bitmapHolder);
bitmapHolder.colour.setBrightness(0);
bitmapHolder.filters = null;
var brightness = 0;
var blurValue = 0;
this.onEnterFrame = function () {
var _local3 = new flash.filters.BlurFilter(blurValue, blurValue, 1);
var _local2 = new Array();
_local2.push(_local3);
bitmapHolder.filters = _local2;
blurValue = blurValue + 0.2;
brightness--;
bitmapHolder.colour.setBrightness(brightness);
if (brightness <= -50) {
player._alpha = player._alpha - 2;
if (player._alpha <= 0) {
player._visible = false;
player._alpha = 100;
delete this.onEnterFrame;
sfxHandler.endSFXHandler();
backgroundSFX.stop();
gameOverScreenInit();
houseKeeping();
}
}
};
}
function gameOverScreenInit() {
attract.setMask(starWarsWipe);
starWarsWipe.gotoAndPlay(1);
starWarsWipe._visible = true;
attract.gotoAndPlay("gameOver");
attract._visible = true;
if (level < 5) {
introScreens.gotoAndStop("parkingFrame");
introScreens._visible = true;
}
this.onEnterFrame = function () {
if (starWarsWipe._currentframe == starWarsWipe._totalframes) {
deadBitmap.dispose();
cls();
spritePlayField._visible = (topSpritePlayField._visible = (highestSpritePlayField._visible = true));
attract.setMask(null);
starWarsWipe.gotoAndStop(1);
starWarsWipe._visible = false;
delete this.onEnterFrame;
}
};
}
function levelCompletedInit() {
delete this.onEnterFrame;
player_collected();
target_collected();
mates_collected();
pausebaddies();
sfxHandler.endSFXHandler();
var _local2;
if (level == 6) {
_local2 = infoBar.gameCompletedText;
} else {
_local2 = infoBar.levelCompletedText;
}
_local2._alpha = 0;
_local2._visible = true;
_local2.onEnterFrame = function () {
this._alpha = this._alpha + 10;
if (this._alpha >= 100) {
this._alpha = 100;
delete this.onEnterFrame;
levelCompleted();
}
};
}
function levelCompleted() {
var delayCnt = 0;
var delayValue = 10;
var delayValueDecCnt = 0;
infoModule.sec1._visible = (infoModule.sec2._visible = (infoModule.min._visible = (infoModule.colon._visible = true)));
this.onEnterFrame = function () {
mateMainLoop();
if (infoModule.healthBar._currentframe != 100) {
infoModule.healthBar.nextFrame();
score = score + 100;
}
if ((++delayCnt) >= delayValue) {
delayCnt = 0;
if ((++delayValueDecCnt) == 4) {
delayValueDecCnt = 0;
delayValue--;
}
timer--;
score = score + 100;
scorePlotter();
plotSeconds();
if ((timer <= 0) && (infoModule.healthBar._currentframe == 100)) {
delete this.onEnterFrame;
pauseMates();
levelCompletedDelayInit();
}
}
if (inkey(keyFIRE)) {
delayValue = (delayCnt = 0);
}
};
}
function levelCompletedDelayInit() {
var delayCnt = 0;
var textMC;
if (level == 6) {
textMC = infoBar.gameCompletedText;
} else {
textMC = infoBar.levelCompletedText;
}
this.onEnterFrame = function () {
if ((++delayCnt) == frameRate) {
this.onEnterFrame = function () {
textMC._alpha = textMC._alpha - 10;
if (textMC._alpha <= 0) {
textMC._visible = false;
delete this.onEnterFrame;
bumpLevel();
}
};
}
};
}
function bumpLevel() {
if (level == 6) {
gameCompleted();
} else {
level++;
introScreenWipeIn();
}
}
function levelBumped() {
houseKeeping();
continueGameHidden();
}
function gameCompleted() {
attract.setMask(starWarsWipe);
starWarsWipe.gotoAndPlay(1);
starWarsWipe._visible = true;
attract.gotoAndPlay("gameDone");
attract._visible = true;
this.onEnterFrame = function () {
if (starWarsWipe._currentframe == starWarsWipe._totalframes) {
houseKeeping();
cls();
attract.setMask(null);
starWarsWipe.gotoAndStop(1);
starWarsWipe._visible = false;
delete this.onEnterFrame;
}
};
}
function levelFailed() {
delete this.onEnterFrame;
player.compass._visible = false;
target_collected();
infoModule.sec1._visible = (infoModule.sec2._visible = (infoModule.min._visible = (infoModule.colon._visible = true)));
pauseMates();
pausebaddies();
stopPlayerAnimating();
if (satNav._visible == true) {
satNavKill();
} else {
levelFailed2();
}
}
function levelFailed2() {
if (level == 1) {
killJeff();
} else if (level == 2) {
killPete();
} else if (level == 3) {
killJohn();
} else if (level == 4) {
killGF();
} else {
displayFailedMessage();
}
}
function displayFailedMessage() {
var delayCnt = 0;
var delayAmount;
if (level >= 5) {
delayAmount = frameRate * 3;
} else {
delayAmount = frameRate * 2;
}
textMC = infoBar.failedText;
textMC.gotoAndStop(level);
textMC._alpha = 0;
textMC._visible = true;
textMC._alpha = 0;
textMC._visible = true;
textMC.onEnterFrame = function () {
this._alpha = this._alpha + 10;
if (this._alpha >= 100) {
this._alpha = 100;
this.onEnterFrame = function () {
if ((++delayCnt) == delayAmount) {
this.onEnterFrame = function () {
textMC._alpha = textMC._alpha - 10;
if (textMC._alpha <= 0) {
textMC._visible = false;
delete this.onEnterFrame;
if (level >= 5) {
sfxHandler.endSFXHandler();
backgroundSFX.stop();
gameOverScreenInit();
} else {
bumpLevel();
}
}
};
}
};
}
};
}
function introScreenInit(frame) {
introScreens.gotoAndStop(frame);
introScreens._visible = true;
introScreens.continueButton._visible = false;
}
function introScreenWipeIn() {
backgroundSFX.stop();
introScreens.setMask(starWarsWipe);
introScreenInit(level);
starWarsWipe.gotoAndPlay(1);
starWarsWipe._visible = true;
this.onEnterFrame = function () {
if (starWarsWipe._currentframe == starWarsWipe._totalframes) {
introScreens.setMask(null);
starWarsWipe.gotoAndStop(1);
starWarsWipe._visible = false;
levelBumped();
delete this.onEnterFrame;
introScreenButtonInit();
}
};
}
function introScreenButtonInit() {
introScreens.continueButton._visible = true;
introScreens.continueButton.onRelease = introScreenKill;
introScreens.onEnterFrame = function () {
if (inkey(keyFIRE)) {
introScreenKill();
}
};
}
function introScreenKill() {
getURL ("javascript:_hbPageView('space','warmbeer');");
delete introScreens.onEnterFrame;
delete introScreens.continueButton.onRelease;
backgroundSFX.start(0, 999999);
introScreens.setMask(wipe);
wipe.gotoAndPlay(1);
wipe._visible = true;
this.onEnterFrame = function () {
if (wipe._currentframe == wipe._totalframes) {
introScreens._visible = false;
introScreens.setMask(null);
delete this.onEnterFrame;
continueGame();
}
};
}
function timerInit() {
timer = startTimes[level - 1];
tick = 0;
plotSeconds();
}
function plotSeconds() {
if (timer < 10) {
infoModule.sec2.gotoAndStop(1);
infoModule.min.gotoAndStop(1);
var _local2 = timer;
} else if (timer >= 60) {
var _local3 = int(timer / 60);
infoModule.min.gotoAndStop(_local3 + 1);
var _local1 = timer - (_local3 * 60);
infoModule.sec2.gotoAndStop(int(_local1 / 10) + 1);
var _local2 = _local1 - (int(_local1 / 10) * 10);
} else {
infoModule.min.gotoAndStop(1);
infoModule.sec2.gotoAndStop(int(timer / 10) + 1);
var _local2 = timer - (int(timer / 10) * 10);
}
infoModule.sec1.gotoAndStop(_local2 + 1);
}
function scorePlotter() {
infoModule.scoreClip.plotScore();
}
function artBasedHandler() {
var _local1 = 0;
for (_local1 in spritePlayField) {
spritePlayField[_local1]._visible = spritePlayField[_local1].hitTest(spriteHitArea);
}
for (_local1 in topSpritePlayField) {
topSpritePlayField[_local1]._visible = topSpritePlayField[_local1].hitTest(spriteHitArea);
}
for (_local1 in highestSpritePlayField) {
highestSpritePlayField[_local1]._visible = highestSpritePlayField[_local1].hitTest(spriteHitArea);
}
}
function scrollerEngine() {
this.map = null;
this.objects = null;
this.objectsArray = new Array();
this.mapWidth = null;
this.mapHeight = null;
this.tileHeight = null;
this.tileWidth = null;
this.visAreaX = null;
this.visAreaY = null;
this.tileSet = null;
this.hitSet = null;
this.startXPos = null;
this.startYPos = null;
this.container = null;
this.containerOffsetX = null;
this.containerOffsetY = null;
this.hitTestContainer = null;
this.iterationY = null;
this.iterationIntY = null;
this.iterationX = null;
this.iterationIntX = null;
this.wrap = null;
this.scrollRightMethod = null;
this.scrollLeftMethod = null;
this.scrollUpMethod = null;
this.scrollDownMethod = null;
this.decunchedMap = null;
this.decunchedObjects = null;
this.xdiff = 0;
this.ydiff = 0;
this.mapXPos = 0;
this.mapYPos = 0;
this.actualMapXPos = 0;
this.actualMapYPos = 0;
this.xUpdate = false;
this.yUpdate = false;
this.xBoundary = false;
this.yBoundary = false;
}
function duplicateMap(src) {
var _local8 = src[0].length;
var _local10 = src.length;
var _local7 = new Array();
var _local9 = [];
var _local1 = -1;
var _local2 = -1;
while (_local2++ , _local2 != _local10) {
_local1 = -1;
_local7 = new Array();
while (_local1++ , _local1 != _local8) {
var _local6 = src[_local2][_local1][0];
var _local5 = src[_local2][_local1][1];
var _local4 = src[_local2][_local1][2];
_local7.push([_local6, _local5, _local4]);
}
_local9[_local2] = _local7;
}
return(_local9);
}
scrollerEngine.prototype.init = function (setUp) {
this.setUp = setUp;
this.map = setUp.map;
this.mapWidth = this.map[0].length;
this.mapHeight = this.map.length;
this.tileHeight = setUp.tileHeight;
this.tileWidth = setUp.tileWidth;
this.visAreaX = setUp.visAreaX;
this.visAreaY = setUp.visAreaY - 1;
this.tileSet = setUp.tileSet;
this.startXPos = setUp.startX;
this.startYPos = setUp.startY;
this.actualMapXPos = this.startXPos + (this.visAreaX + 1);
this.actualMapYPos = this.startYPos + (this.visAreaY + 1);
this.wrap = setUp.wrap;
this.xdiff = 0;
this.ydiff = 0;
this.container = setUp.container;
if (setUp.containerOffsetX != undefined) {
this.containerOffsetX = setUp.containerOffsetX;
this.containerOffsetY = setUp.containerOffsetY;
} else {
this.containerOffsetX = this.container._x;
this.containerOffsetY = this.container._y;
}
this.iterationY = (this.visAreaY + 1) % 2;
this.iterationIntY = int((this.visAreaY + 1) / 2);
this.iterationX = (this.visAreaX + 1) % 4;
this.iterationIntX = int((this.visAreaX + 1) / 4);
this.scrollRightMethod = this.scrollRightNoHitTest;
this.scrollLeftMethod = this.scrollLeftNoHitTest;
this.scrollUpMethod = this.scrollUpNoHitTest;
this.scrollDownMethod = this.scrollDownNoHitTest;
this.mapPlotter();
};
scrollerEngine.prototype.resetScroller = function () {
this.xdiff = (this.ydiff = 0);
this.mapXPos = (this.mapYPos = 0);
this.actualMapXPos = this.startXPos + (this.visAreaX + 1);
this.actualMapYPos = this.startYPos + (this.visAreaY + 1);
this.map = this.setUp.map;
this.mapPlotter();
};
scrollerEngine.prototype.mapPlotter = function () {
var _local3 = this.positionMap(this.startXPos, this.mapWidth, this.visAreaX, 0);
var _local4 = this.positionMap(this.startYPos, this.mapHeight, this.visAreaY, 1);
this.container._x = (-(_local3 * this.tileWidth)) + this.containerOffsetX;
this.container._y = (-(_local4 * this.tileHeight)) + this.containerOffsetY;
var _local5 = 0;
this.mapYPos = _local4;
while (this.mapYPos < ((_local4 + this.visAreaY) + 1)) {
this.mapXPos = _local3;
while (this.mapXPos < ((_local3 + this.visAreaX) + 1)) {
var _local2 = this.container.attachMovie(this.tileSet, (("t_" + this.mapXPos) + "_") + this.mapYPos, _local5++);
if (this.mapYPos >= this.mapHeight) {
tellTarget (_local2) {
gotoAndStop (1);
};
}
if (this.mapXPos >= this.mapWidth) {
tellTarget (_local2) {
gotoAndStop (1);
};
} else {
_local2.gotoAndStop(this.map[this.mapYPos][this.mapXPos][0]);
if (_local2.anim != undefined) {
_local2.anim.gotoAndStop(this.map[this.mapYPos][this.mapXPos][2]);
}
}
this.tile_Init(_local2);
this.mapXPos++;
}
this.mapYPos++;
}
};
scrollerEngine.prototype.positionMap = function (buildFrom, mapSize, visibleArea, arrayPos) {
if (mapSize <= visibleArea) {
return(0);
}
var _local1 = buildFrom + visibleArea;
while (_local1 > mapSize) {
_local1--;
}
return(_local1 - visibleArea);
};
scrollerEngine.prototype.scrollRight = function (speed) {
this.scrollRightMethod(speed);
};
scrollerEngine.prototype.scrollLeft = function (speed) {
this.scrollLeftMethod(speed);
};
scrollerEngine.prototype.scrollUp = function (speed) {
this.scrollUpMethod(speed);
};
scrollerEngine.prototype.scrollDown = function (speed) {
this.scrollDownMethod(speed);
};
scrollerEngine.prototype.scrollRightHitTest = function (speed) {
if (this.mapXPos >= (this.mapWidth + 1)) {
this.xBoundary = true;
}
this.container._x = this.container._x - speed;
this.hitTestContainer._x = this.hitTestContainer._x - speed;
this.xdiff = this.xdiff - (-speed);
if (this.xdiff >= this.tileWidth) {
this.xUpdate = true;
var _local9 = (this.mapXPos - this.visAreaX) - 1;
var _local2 = (this.mapYPos - this.visAreaY) - 1;
var _local4 = this.mapXPos * this.tileWidth;
var _local5 = ("t_" + this.mapXPos) + "_";
var _local6 = ("t_" + _local9) + "_";
var _local3 = null;
var _local7 = this.iterationY;
while (_local7--) {
_local3 = _local6 + _local2;
t = this.container[_local3];
setProperty("t", _x , _local4);
setProperty("t", _name , _local5 + _local2);
t.gotoAndStop(this.map[_local2++][this.mapXPos][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _x , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = _local6 + _local2;
t = this.container[_local3];
setProperty("t", _x , _local4);
setProperty("t", _name , _local5 + _local2);
t.gotoAndStop(this.map[_local2++][this.mapXPos][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _x , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
}
_local7 = this.iterationIntY;
while (_local7--) {
_local3 = _local6 + _local2;
t = this.container[_local3];
setProperty("t", _x , _local4);
setProperty("t", _name , _local5 + _local2);
t.gotoAndStop(this.map[_local2++][this.mapXPos][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _x , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = _local6 + _local2;
t = this.container[_local3];
setProperty("t", _x , _local4);
setProperty("t", _name , _local5 + _local2);
t.gotoAndStop(this.map[_local2++][this.mapXPos][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _x , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
}
this.mapXPos++;
this.xdiff = this.xdiff - this.tileWidth;
}
};
scrollerEngine.prototype.scrollLeftHitTest = function (speed) {
if (this.mapXPos <= this.visAreaX) {
this.xBoundary = true;
}
this.container._x = this.container._x - (-speed);
this.hitTestContainer._x = this.hitTestContainer._x - (-speed);
this.xdiff = this.xdiff - speed;
if (this.xdiff <= 0) {
this.xUpdate = true;
this.mapXPos--;
var _local5 = (this.mapXPos - this.visAreaX) - 1;
var _local2 = (this.mapYPos - this.visAreaY) - 1;
var _local3 = _local5 * this.tileWidth;
var _local6 = ("t_" + _local5) + "_";
var _local7 = ("t_" + this.mapXPos) + "_";
var _local4 = null;
var _local8 = this.iterationY;
while (_local8--) {
_local4 = _local7 + _local2;
t = this.container[fn];
setProperty("t", _x , _local3);
setProperty("t", _name , _local6 + _local2);
t.gotoAndStop(this.map[_local2++][_local5][0]);
ht = this.hitTestContainer[_local4];
setProperty("ht", _x , _local3);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local4 = _local7 + _local2;
t = this.container[fn];
setProperty("t", _x , _local3);
setProperty("t", _name , _local6 + _local2);
t.gotoAndStop(this.map[_local2++][_local5][0]);
ht = this.hitTestContainer[_local4];
setProperty("ht", _x , _local3);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
}
_local8 = this.iterationIntY;
while (_local8--) {
_local4 = _local7 + _local2;
t = this.container[fn];
setProperty("t", _x , _local3);
setProperty("t", _name , _local6 + _local2);
t.gotoAndStop(this.map[_local2++][_local5][0]);
ht = this.hitTestContainer[_local4];
setProperty("ht", _x , _local3);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local4 = _local7 + _local2;
t = this.container[fn];
setProperty("t", _x , _local3);
setProperty("t", _name , _local6 + _local2);
t.gotoAndStop(this.map[_local2++][_local5][0]);
ht = this.hitTestContainer[_local4];
setProperty("ht", _x , _local3);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
}
this.xdiff = this.xdiff + this.tileWidth;
}
};
scrollerEngine.prototype.scrollUpHitTest = function (speed) {
this.container._y = this.container._y - (-speed);
this.hitTestContainer._y = this.hitTestContainer._y - (-speed);
this.ydiff = this.ydiff - speed;
if (this.ydiff <= 0) {
this.yUpdate = true;
this.mapYPos--;
var _local2 = (this.mapXPos - this.visAreaX) - 1;
var _local5 = (this.mapYPos - this.visAreaY) - 1;
var _local4 = _local5 * this.tileWidth;
var _local6 = "_" + _local5;
var _local7 = "_" + this.mapYPos;
var _local3 = null;
var _local8 = this.iterationX;
while (_local8--) {
_local3 = ("t_" + _local2) + _local7;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local6);
t.gotoAndStop(this.map[_local5][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local7;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local6);
t.gotoAndStop(this.map[_local5][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local7;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local6);
t.gotoAndStop(this.map[_local5][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local7;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local6);
t.gotoAndStop(this.map[_local5][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
}
_local8 = this.iterationIntX;
while (_local8--) {
_local3 = ("t_" + _local2) + _local7;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local6);
t.gotoAndStop(this.map[_local5][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local7;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local6);
t.gotoAndStop(this.map[_local5][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local7;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local6);
t.gotoAndStop(this.map[_local5][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local7;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local6);
t.gotoAndStop(this.map[_local5][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
}
this.ydiff = this.ydiff + this.tileHeight;
}
};
scrollerEngine.prototype.scrollDownHitTest = function (speed) {
this.container._y = this.container._y - speed;
this.hitTestContainer._y = this.hitTestContainer._y - speed;
this.ydiff = this.ydiff - (-speed);
if (this.ydiff >= this.tileHeight) {
this.yUpdate = true;
var _local2 = (this.mapXPos - this.visAreaX) - 1;
var _local9 = (this.mapYPos - this.visAreaY) - 1;
var _local4 = this.mapYPos * this.tileWidth;
var _local5 = "_" + this.mapYPos;
var _local6 = "_" + _local9;
var _local3 = null;
var _local7 = this.iterationX;
while (_local7--) {
_local3 = ("t_" + _local2) + _local6;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local5);
t.gotoAndStop(this.map[this.mapYPos][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local6;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local5);
t.gotoAndStop(this.map[this.mapYPos][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local6;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local5);
t.gotoAndStop(this.map[this.mapYPos][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local6;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local5);
t.gotoAndStop(this.map[this.mapYPos][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
}
_local7 = this.iterationIntX;
while (_local7--) {
_local3 = ("t_" + _local2) + _local6;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local5);
t.gotoAndStop(this.map[this.mapYPos][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local6;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local5);
t.gotoAndStop(this.map[this.mapYPos][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local6;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local5);
t.gotoAndStop(this.map[this.mapYPos][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
_local3 = ("t_" + _local2) + _local6;
t = this.container[_local3];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local5);
t.gotoAndStop(this.map[this.mapYPos][_local2++][0]);
ht = this.hitTestContainer[_local3];
setProperty("ht", _y , _local4);
setProperty("ht", _name , t._name);
ht.gotoAndStop(t._currentframe);
}
this.mapYPos++;
this.ydiff = this.ydiff - this.tileHeight;
}
};
scrollerEngine.prototype.scrollRightNoHitTest = function (speed) {
this.container._x = this.container._x - speed;
this.xdiff = this.xdiff - (-speed);
if (this.xdiff >= this.tileWidth) {
this.xUpdate = true;
var _local2 = (this.mapYPos - this.visAreaY) - 1;
var _local4 = ("t_" + ((this.mapXPos - this.visAreaX) - 1)) + "_";
if (this.actualMapXPos > this.mapWidth) {
if (this.wrap == true) {
this.actualMapXPos = this.actualMapXPos - (this.mapWidth - 4);
} else {
this.xBoundary = true;
}
}
var _local5 = this.mapXPos * this.tileWidth;
var _local3 = ("t_" + this.mapXPos) + "_";
var _local6 = this.iterationIntY;
while (_local6--) {
this.tile_MoveRight(this.container[_local4 + _local2], _local5, _local3, _local2);
_local2++;
this.tile_MoveRight(this.container[_local4 + _local2], _local5, _local3, _local2);
_local2++;
}
this.tile_MoveRight(this.container[_local4 + _local2], _local5, _local3, _local2);
this.mapXPos++;
this.actualMapXPos++;
this.xdiff = this.xdiff - this.tileWidth;
}
};
scrollerEngine.prototype.scrollLeftNoHitTest = function (speed) {
this.container._x = this.container._x - (-speed);
this.xdiff = this.xdiff - speed;
if (this.xdiff <= 0) {
this.xUpdate = true;
if (this.actualMapXPos <= (this.visAreaX + 1)) {
if (this.wrap == true) {
this.actualMapXPos = (this.mapWidth + this.visAreaX) - 1;
} else {
this.xBoundary = true;
}
}
this.mapXPos--;
this.actualMapXPos--;
var _local7 = (this.mapXPos - this.visAreaX) - 1;
var _local2 = (this.mapYPos - this.visAreaY) - 1;
var _local5 = _local7 * this.tileWidth;
var _local3 = ("t_" + _local7) + "_";
var _local4 = ("t_" + this.mapXPos) + "_";
var _local6 = this.iterationIntY;
while (_local6--) {
this.tile_MoveLeft(this.container[_local4 + _local2], _local5, _local3, _local2);
_local2++;
this.tile_MoveLeft(this.container[_local4 + _local2], _local5, _local3, _local2);
_local2++;
}
this.tile_MoveLeft(this.container[_local4 + _local2], _local5, _local3, _local2);
this.xdiff = this.xdiff + this.tileWidth;
}
};
scrollerEngine.prototype.scrollUpNoHitTest = function (speed) {
this.container._y = this.container._y - (-speed);
this.ydiff = this.ydiff - speed;
if (this.ydiff <= 0) {
this.yUpdate = true;
this.mapYPos--;
var _local2 = (this.mapXPos - this.visAreaX) - 1;
var _local3 = (this.mapYPos - this.visAreaY) - 1;
var _local5 = _local3 * this.tileWidth;
var _local4 = "_" + _local3;
var _local6 = "_" + this.mapYPos;
var _local7 = this.iterationX;
while (_local7--) {
t = this.container[("t_" + _local2) + _local6];
setProperty("t", _y , _local5);
setProperty("t", _name , ("t_" + _local2) + _local4);
t.gotoAndStop(this.map[_local3][_local2][0]);
t.anim.gotoAndStop(this.map[_local3][_local2++][2]);
t = this.container[("t_" + _local2) + _local6];
setProperty("t", _y , _local5);
setProperty("t", _name , ("t_" + _local2) + _local4);
t.gotoAndStop(this.map[_local3][_local2][0]);
t.anim.gotoAndStop(this.map[_local3][_local2++][2]);
t = this.container[("t_" + _local2) + _local6];
setProperty("t", _y , _local5);
setProperty("t", _name , ("t_" + _local2) + _local4);
t.gotoAndStop(this.map[_local3][_local2][0]);
t.anim.gotoAndStop(this.map[_local3][_local2++][2]);
t = this.container[("t_" + _local2) + _local6];
setProperty("t", _y , _local5);
setProperty("t", _name , ("t_" + _local2) + _local4);
t.gotoAndStop(this.map[_local3][_local2][0]);
t.anim.gotoAndStop(this.map[_local3][_local2++][2]);
}
_local7 = this.iterationIntX;
while (_local7--) {
t = this.container[("t_" + _local2) + _local6];
setProperty("t", _y , _local5);
setProperty("t", _name , ("t_" + _local2) + _local4);
t.gotoAndStop(this.map[_local3][_local2][0]);
t.anim.gotoAndStop(this.map[_local3][_local2++][2]);
t = this.container[("t_" + _local2) + _local6];
setProperty("t", _y , _local5);
setProperty("t", _name , ("t_" + _local2) + _local4);
t.gotoAndStop(this.map[_local3][_local2][0]);
t.anim.gotoAndStop(this.map[_local3][_local2++][2]);
t = this.container[("t_" + _local2) + _local6];
setProperty("t", _y , _local5);
setProperty("t", _name , ("t_" + _local2) + _local4);
t.gotoAndStop(this.map[_local3][_local2][0]);
t.anim.gotoAndStop(this.map[_local3][_local2++][2]);
t = this.container[("t_" + _local2) + _local6];
setProperty("t", _y , _local5);
setProperty("t", _name , ("t_" + _local2) + _local4);
t.gotoAndStop(this.map[_local3][_local2][0]);
t.anim.gotoAndStop(this.map[_local3][_local2++][2]);
}
this.ydiff = this.ydiff + this.tileHeight;
}
};
scrollerEngine.prototype.scrollDownNoHitTest = function (speed) {
this.container._y = this.container._y - speed;
this.ydiff = this.ydiff - (-speed);
if (this.ydiff >= this.tileHeight) {
this.yUpdate = true;
var _local2 = (this.mapXPos - this.visAreaX) - 1;
var _local7 = (this.mapYPos - this.visAreaY) - 1;
var _local4 = this.mapYPos * this.tileWidth;
var _local3 = "_" + this.mapYPos;
var _local5 = "_" + _local7;
var _local6 = this.iterationX;
while (_local6--) {
t = this.container[("t_" + _local2) + _local5];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local3);
t.gotoAndStop(this.map[this.mapYPos][_local2][0]);
t.anim.gotoAndStop(this.map[this.mapYPos][_local2++][2]);
t = this.container[("t_" + _local2) + _local5];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local3);
t.gotoAndStop(this.map[this.mapYPos][_local2][0]);
t.anim.gotoAndStop(this.map[this.mapYPos][_local2++][2]);
t = this.container[("t_" + _local2) + _local5];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local3);
t.gotoAndStop(this.map[this.mapYPos][_local2][0]);
t.anim.gotoAndStop(this.map[this.mapYPos][_local2++][2]);
t = this.container[("t_" + _local2) + _local5];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local3);
t.gotoAndStop(this.map[this.mapYPos][_local2][0]);
t.anim.gotoAndStop(this.map[this.mapYPos][_local2++][2]);
}
_local6 = this.iterationIntX;
while (_local6--) {
t = this.container[("t_" + _local2) + _local5];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local3);
t.gotoAndStop(this.map[this.mapYPos][_local2][0]);
t.anim.gotoAndStop(this.map[this.mapYPos][_local2++][2]);
t = this.container[("t_" + _local2) + _local5];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local3);
t.gotoAndStop(this.map[this.mapYPos][_local2][0]);
t.anim.gotoAndStop(this.map[this.mapYPos][_local2++][2]);
t = this.container[("t_" + _local2) + _local5];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local3);
t.gotoAndStop(this.map[this.mapYPos][_local2][0]);
t.anim.gotoAndStop(this.map[this.mapYPos][_local2++][2]);
t = this.container[("t_" + _local2) + _local5];
setProperty("t", _y , _local4);
setProperty("t", _name , ("t_" + _local2) + _local3);
t.gotoAndStop(this.map[this.mapYPos][_local2][0]);
t.anim.gotoAndStop(this.map[this.mapYPos][_local2++][2]);
}
this.mapYPos++;
this.ydiff = this.ydiff - this.tileHeight;
}
};
scrollerEngine.prototype.scrollRightNoHitTestNoRoll = function (speed) {
if (this.mapXPos >= (this.mapWidth + 1)) {
this.xBoundary = true;
}
this.container._x = this.container._x - speed;
this.xdiff = this.xdiff - (-speed);
if (this.xdiff >= this.tileWidth) {
this.xUpdate = true;
var _local2 = (this.mapYPos - this.visAreaY) - 1;
var _local5 = this.mapXPos * this.tileWidth;
var _local3 = ("t_" + this.mapXPos) + "_";
var _local4 = ("t_" + ((this.mapXPos - this.visAreaX) - 1)) + "_";
var _local6 = this.iterationIntY;
while (_local6--) {
t = this.container[_local4 + _local2];
setProperty("t", _x , _local5);
setProperty("t", _name , _local3 + _local2);
t.gotoAndStop(this.map[_local2++][this.mapXPos][0]);
t = this.container[_local4 + _local2];
setProperty("t", _x , _local5);
setProperty("t", _name , _local3 + _local2);
t.gotoAndStop(this.map[_local2++][this.mapXPos][0]);
}
this.mapXPos++;
this.xdiff = this.xdiff - this.tileWidth;
}
};
scrollerEngine.prototype.scrollLeftNoHitTestNoRoll = function (speed) {
if (this.mapXPos <= (this.visAreaX + 1)) {
this.xBoundary = true;
}
this.container._x = this.container._x - (-speed);
this.xdiff = this.xdiff - speed;
if (this.xdiff <= 0) {
this.xUpdate = true;
this.mapXPos--;
var _local3 = (this.mapXPos - this.visAreaX) - 1;
var _local2 = (this.mapYPos - this.visAreaY) - 1;
var _local6 = _local3 * this.tileWidth;
var _local4 = ("t_" + _local3) + "_";
var _local5 = ("t_" + this.mapXPos) + "_";
var _local7 = this.iterationIntY;
while (_local7--) {
t = this.container[_local5 + _local2];
setProperty("t", _x , _local6);
setProperty("t", _name , _local4 + _local2);
t.gotoAndStop(this.map[_local2++][_local3][0]);
t = this.container[_local5 + _local2];
setProperty("t", _x , _local6);
setProperty("t", _name , _local4 + _local2);
t.gotoAndStop(this.map[_local2++][_local3][0]);
}
this.xdiff = this.xdiff + this.tileWidth;
}
};
scrollerEngine.prototype.tile_Init = function (mc) {
tellTarget (mc) {
map = this.map;
visAreaX = this.visAreaX;
visAreaY = this.visAreaY;
tileWidth = this.tileWidth;
tileHeight = this.tileHeight;
_x = (this.mapXPos * this.tileWidth);
_y = (this.mapYPos * this.tileHeight);
};
};
scrollerEngine.prototype.tile_MoveRight = function (mc, qX, qN, lasty) {
mc._x = qX;
mc._name = qN + lasty;
mc.gotoAndStop(this.map[lasty][this.actualMapXPos][0]);
mc.anim.gotoAndStop(this.map[lasty][this.actualMapXPos][2]);
};
scrollerEngine.prototype.tile_MoveLeft = function (mc, qX, qN, lasty) {
mc._x = qX;
mc._name = qN + lasty;
mc.gotoAndStop(this.map[lasty][(this.actualMapXPos - this.visAreaX) - 1][0]);
mc.anim.gotoAndStop(this.map[lasty][(this.actualMapXPos - this.visAreaX) - 1][2]);
};
var map1Parameters = {map:null, tileHeight:32, tileWidth:32, visAreaX:13, visAreaY:10, startX:0, startY:0, tileSet:"tiles", container:playField.container};
var satNavParameters = {map:null, tileHeight:4, tileWidth:4, visAreaX:46, visAreaY:30, startX:0, startY:0, tileSet:"satNavTiles", container:null};
function matesInit() {
activeMates = new Array();
jeffStatus = (peteStatus = (johnStatus = (gfStatus = true)));
}
function matesHouseKeeping() {
var _local2;
var _local1 = -1;
var _local3 = activeMates.length;
while (_local1++ , _local1 != _local3) {
_local2 = activeMates[_local1];
if (_local2.currentStatus != 2) {
_local2.stopAnimation();
} else {
_local2.destroy();
delete activeMates[_local1];
activeMates.splice(_local1, 1);
if ((_local1 + 1) >= _local3) {
break;
}
_local3--;
}
}
}
function mates_collected() {
var _local2;
var _local1 = -1;
while (_local1++ , _local1 != activeMates.length) {
_local2 = activeMates[_local1];
_local2.stopAnimation();
}
}
function addMate() {
if (level == 2) {
if (jeffStatus == false) {
return(undefined);
}
} else if (level == 3) {
if (peteStatus == false) {
return(undefined);
}
} else if (level == 4) {
if (johnStatus == false) {
return(undefined);
}
} else if (level == 5) {
if (gfStatus == false) {
return(undefined);
}
}
var _local3 = this["mateStartPositions" + (level - 1)];
var _local2 = new mateObj();
_local2.init(level - 1, _local3[level - 2]);
activeMates.push(_local2);
}
function repositionMates() {
var _local3;
var _local5;
var _local2 = -1;
var _local4 = activeMates.length;
while (_local2++ , _local2 != _local4) {
_local3 = activeMates[_local2];
if (_local3.currentStatus != 2) {
_local5 = this["mateStartPositions" + _local3.num];
_local3.resetPositon(_local5[level - 2]);
} else {
_local3.destroy();
delete activeMates[_local2];
activeMates.splice(_local2, 1);
if ((_local2 + 1) >= _local4) {
break;
}
_local4--;
}
}
}
function mateMainLoop() {
var _local2;
var _local1 = -1;
var _local3 = activeMates.length;
while (_local1++ , _local1 != _local3) {
_local2 = activeMates[_local1];
_local2.mainloop();
}
}
function pauseMates() {
var _local1;
var _local2 = -1;
while (_local2++ , _local2 != activeMates.length) {
_local1 = activeMates[_local2];
if (_local1.currentStatus != 2) {
_local1.pause();
}
}
}
function resumeMates() {
var _local1;
var _local2 = -1;
while (_local2++ , _local2 != activeMates.length) {
_local1 = activeMates[_local2];
if (_local1.currentStatus != 2) {
_local1.resume();
}
}
}
function mateObj() {
this.num = 0;
this.sprite = null;
this.xPos = 0;
this.yPos = 0;
this.speed = 4;
this.speedNextTimeAround = 4;
this.destXpos = 0;
this.destYpos = 0;
this.currentDir = 0;
this.prevDir = 0;
this.scrollMoveCnt = 0;
this.checkDistance = 1;
this.currentStatus = 0;
this.power = 100;
this.currentMethod = null;
this.currentMethodStore = null;
this.hurtMaleSFX = new Array("hurt1SFX", "hurt2SFX", "hurt3SFX", "hurt4SFX", "hurt5SFX");
this.hurtFemaleSFX = new Array("girlHurt1SFX", "girlHurt2SFX");
this.sfx = null;
}
mateObj.prototype.init = function (num, position) {
this.num = num;
this.createSprite();
this.resetPositon(position);
if (this.num != 4) {
this.checkDistance = this.checkDistance + this.num;
}
};
mateObj.prototype.createSprite = function () {
this.sprite = spritePlayField.attachMovie("mate" + this.num, "mate" + this.num, spritePlayField.getNextHighestDepth());
this.sprite.baddiehitAreaMC._self = this;
};
mateObj.prototype.destroy = function () {
this.sprite.removeMovieClip();
this.sprite = null;
};
mateObj.prototype.resetMovementProperties = function (position) {
this.currentDir = (this.prevDirection = "Right");
this.prevDir = 0;
this.stopAnimation();
this.scrollMoveCnt = 0;
this.currentMethod = this.getMovementDirection;
};
mateObj.prototype.resetPositon = function (position) {
this.xPos = position[0];
this.yPos = position[1];
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.speedNextTimeAround = (this.speed = 4);
if ((this.power + 25) > 100) {
this.power = 100;
} else {
this.power = this.power + 25;
}
this.sfx = null;
this.resetMovementProperties();
};
mateObj.prototype.decreaseHealth = function (arg) {
if (arg == undefined) {
arg = 1;
} else {
arg = int(arg / 2);
}
this.power = this.power - arg;
if (this.power < 50) {
if (this.power <= 0) {
this.killed();
} else {
this.speedNextTimeAround = 2;
}
}
if (this.sfx == null) {
this.sfx = new Sound(this.sprite);
this.sfx.class = this;
if (this.num != 4) {
var _local4 = int(Math.random() * this.hurtMaleSFX.length);
this.sfx.attachSound(this.hurtMaleSFX[_local4]);
} else {
var _local4 = int(Math.random() * this.hurtFemaleSFX.length);
this.sfx.attachSound(this.hurtFemaleSFX[_local4]);
}
var _local3 = getDistanceVolume(this.xPos, this.yPos, 20);
if (masterVolume != 0) {
this.sfx.setVolume(_local3);
this.sfx.setPan(getDistancePan(this.xPos));
} else {
this.sfx.setVolume(0);
}
this.sfx.start();
this.sfx.onSoundComplete = function () {
this=this.class;//parameter overwritten
this.class;
this.sfx = null;
};
}
};
mateObj.prototype.killed = function () {
this.currentMethod = null;
this.currentStatus = 2;
this.sprite.gotoAndStop("dead");
if (this.num == 1) {
jeffStatus = false;
} else if (this.num == 2) {
peteStatus = false;
} else if (this.num == 3) {
johnStatus = false;
} else {
gfStatus = false;
}
};
mateObj.prototype.mainloop = function () {
this.currentMethod();
};
mateObj.prototype.getMovementDirection = function () {
var _local15 = Math.abs(playerXPos - this.xPos);
var _local14 = Math.abs(playerYPos - this.yPos);
var _local10 = _local15 + _local14;
if (_local10 <= this.checkDistance) {
this.stopAnimation();
this.currentMethod = this.waitingOnPlayer;
return(undefined);
}
this.destXpos = playerXPos;
this.destYpos = playerYPos;
this.speed = this.speedNextTimeAround;
var _local4 = new Array(-1, -1, -1, -1);
var _local8 = new Array();
var _local17 = _map[this.yPos][this.xPos + 1][1];
if (_local17 == 0) {
if (this.prevDir != 1) {
_local4[0] = 0;
_local8.push(0);
}
}
var _local9 = _map[this.yPos][this.xPos - 1][1];
if (_local9 == 0) {
if (this.prevDir != 0) {
_local4[1] = 1;
_local8.push(1);
}
}
var _local12 = _map[this.yPos - 1][this.xPos][1];
if (_local12 == 0) {
if (this.prevDir != 3) {
_local4[2] = 2;
_local8.push(2);
}
}
var _local16 = _map[this.yPos + 1][this.xPos][1];
if (_local16 == 0) {
if (this.prevDir != 2) {
_local4[3] = 3;
_local8.push(3);
}
}
var _local6 = 101;
var _local5 = 101;
if (this.yPos < this.destYpos) {
_local5 = 3;
} else if (this.yPos > this.destYpos) {
_local5 = 2;
}
if (this.xPos > this.destXpos) {
_local6 = 1;
} else if (this.xPos < this.destXpos) {
_local6 = 0;
}
var _local3 = -1;
var _local2;
var _local13 = this.num % 2;
if (_local13 == 1) {
var _local7 = _local4.length;
while (_local7-- , _local7 >= 0) {
_local2 = _local4[_local7];
if (_local2 == _local5) {
_local3 = _local2;
break;
}
if (_local2 == _local6) {
_local3 = _local2;
break;
}
}
} else {
var _local7 = -1;
while (_local7++ , _local7 != _local4.length) {
_local2 = _local4[_local7];
if (_local2 == _local6) {
_local3 = _local2;
break;
}
if (_local2 == _local5) {
_local3 = _local2;
break;
}
}
}
if (_local3 == -1) {
_local3 = _local8[int(Math.random() * _local8.length)];
}
this.prevDir = _local3;
this.scrollMoveCnt = (32 / this.speed) - 1;
var _local11 = this["chosenDir" + _local3];
_local11(this);
};
mateObj.prototype.chosenDir0 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Right") {
this.currentDir = (this.prevDirection = "Right");
}
this.sprite.gotoAndPlay("runningRight");
this.sprite._x = this.sprite._x + this.speed;
this.currentMethod = this.moveRight;
};
mateObj.prototype.chosenDir1 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Left") {
this.currentDir = (this.prevDirection = "Left");
}
this.sprite.gotoAndPlay("runningLeft");
this.sprite._x = this.sprite._x - this.speed;
this.currentMethod = this.moveLeft;
};
mateObj.prototype.chosenDir2 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Up") {
this.currentDir = (this.prevDirection = "Up");
}
this.sprite.gotoAndPlay("runningUp");
this.sprite._y = this.sprite._y - this.speed;
this.currentMethod = this.moveUp;
};
mateObj.prototype.chosenDir3 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Down") {
this.currentDir = (this.prevDirection = "Down");
}
this.sprite.gotoAndPlay("runningDown");
this.sprite._y = this.sprite._y + this.speed;
this.currentMethod = this.moveDown;
};
mateObj.prototype.moveRight = function () {
this.sprite._x = this.sprite._x + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos++;
this.currentMethod = this.getMovementDirection;
}
};
mateObj.prototype.moveLeft = function () {
this.sprite._x = this.sprite._x - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos--;
this.currentMethod = this.getMovementDirection;
}
};
mateObj.prototype.moveUp = function () {
this.sprite._y = this.sprite._y - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos--;
this.currentMethod = this.getMovementDirection;
}
};
mateObj.prototype.moveDown = function () {
this.sprite._y = this.sprite._y + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos++;
this.currentMethod = this.getMovementDirection;
}
};
mateObj.prototype.waitingOnPlayer = function () {
var _local4 = Math.abs(playerXPos - this.xPos);
var _local3 = Math.abs(playerYPos - this.yPos);
var _local2 = _local4 + _local3;
if (_local2 > this.checkDistance) {
this.currentMethod = this.getMovementDirection;
}
};
mateObj.prototype.stopAnimation = function () {
if (this.currentDir == "Right") {
this.sprite.gotoAndStop("standingRight");
} else if (this.currentDir == "Left") {
this.sprite.gotoAndStop("standingLeft");
} else if (this.currentDir == "Up") {
this.sprite.gotoAndStop("standingUp");
} else if (this.currentDir == "Down") {
this.sprite.gotoAndStop("standingDown");
}
this.sprite.arrow._visible = false;
};
mateObj.prototype.pause = function () {
this.sprite.gotoAndStop(this.sprite._currentframe);
this.sprite.anim.gotoAndStop(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndStop(this.sprite.shadowAnim._currentframe);
};
mateObj.prototype.resume = function () {
if (this.sprite._currentframe < 74) {
this.sprite.gotoAndPlay(this.sprite._currentframe);
this.sprite.anim.gotoAndPlay(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndPlay(this.sprite.shadowAnim._currentframe);
}
};
function baddiesInit() {
activeBaddies = new Array();
if (level < 6) {
fireInit();
}
if (level == 2) {
zombiesInit();
} else if (level == 3) {
zombiesInit();
antInit();
spiderInit();
} else if (level == 4) {
antInit();
alienInit();
} else if (level == 5) {
alienInit();
} else if (level == 6) {
godZillaInit();
}
}
function baddiesHouseKeeping() {
var _local2;
var _local1 = -1;
while (_local1++ , _local1 != activeBaddies.length) {
_local2 = activeBaddies[_local1];
_local2.destroy();
}
}
function baddieMainLoop() {
xMapCoord = scroller.mapXPos - 18;
yMapCoord = scroller.mapYPos - 16;
var _local2;
var _local1 = -1;
var _local3 = activeBaddies.length;
while (_local1++ , _local1 != _local3) {
_local2 = activeBaddies[_local1];
_local2.mainloop();
}
}
function forceBaddiesOnScreen() {
xMapCoord = scroller.mapXPos - 18;
yMapCoord = scroller.mapYPos - 16;
var _local1;
var _local2 = -1;
while (_local2++ , _local2 != activeBaddies.length) {
_local1 = activeBaddies[_local2];
if (_local1.type == "Zombie") {
_local1.setPieceFlag = true;
}
_local1.waitingCnt = 0;
_local1.onScreen();
}
}
function pausebaddies() {
var _local2;
var _local1 = -1;
while (_local1++ , _local1 != activeBaddies.length) {
_local2 = activeBaddies[_local1];
_local2.pause();
}
pauseSoldiers();
pauseMeteorites();
pauseUFOs();
}
function resumebaddies() {
var _local2;
var _local1 = -1;
while (_local1++ , _local1 != activeBaddies.length) {
_local2 = activeBaddies[_local1];
_local2.resume();
}
resumeMates();
resumeSoldiers();
resumeMeteorites();
resumeUFOs();
}
function godZillaInit() {
var _local1 = new godZillaObj();
_local1.init();
activeBaddies.push(_local1);
}
function godZillaObj() {
this.name = "godZilla";
this.sprite = null;
this.xPos = 58;
this.yPos = 155;
this.currentStatus = 0;
this.fireTimer = 0;
this.collisionFlipFlop = 0;
this.currentMethod = null;
this.fireSFX = null;
}
godZillaObj.prototype.init = function () {
this.sprite = highestSpritePlayField.attachMovie("godZilla", "godZilla", highestSpritePlayField.getNextHighestDepth());
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.currentMethod = this.onScreen;
};
godZillaObj.prototype.destroy = function () {
this.sprite.removeMovieClip();
};
godZillaObj.prototype.mainloop = function () {
this.currentMethod();
};
godZillaObj.prototype.onScreen = function () {
if (this.sprite._visible != true) {
this.fireTimer = 0;
return(undefined);
}
meteoriteDelayMaster = frameRate + 5;
this.currentMethod = this.checkForFire;
};
godZillaObj.prototype.checkForFire = function () {
if ((++this.fireTimer) == frameRate) {
this.sprite.gotoAndStop(2);
this.fireSFX = new Sound(this.sprite);
this.fireSFX.attachSound("flamesSFX");
this.fireSFX.setVolume(masterVolume);
this.fireSFX.setPan(getDistancePan(this.xPos));
this.fireSFX.start();
this.currentMethod = this.breathingFire;
}
if (this.sprite._visible != true) {
this.currentMethod = this.onScreen;
}
};
godZillaObj.prototype.breathingFire = function () {
if (this.sprite.fire._currentframe == this.sprite.fire._totalframes) {
this.fireTimer = 0;
this.sprite.gotoAndStop(1);
var _local5 = int(Math.random() * 10);
if (_local5 < 2) {
var _local4 = new Sound(this.sprite);
_local4.attachSound("roarSFX");
_local4.start();
}
this.currentMethod = this.onScreen;
}
var _local3 = activeMates.length;
var _local2 = -1;
while (_local2++ , _local2 != _local3) {
obj = activeMates[_local2];
if (obj.currentStatus != 2) {
if (this.sprite.fire.hitAreaMC.hitTest(obj.sprite.baddiehitAreaMC)) {
obj.decreaseHealth();
break;
}
}
}
if (this.sprite.fire.hitAreaMC.hitTest(player.baddiehitAreaMC)) {
decreaseHealth();
}
};
function zombiesInit() {
var _local1 = -1;
var _local2;
if (level == 2) {
while (_local1++ , _local1 != zombiePositions.length) {
_local2 = new zombieObj();
_local2.init(_local1, zombiePositions[_local1]);
activeBaddies.push(_local2);
}
} else if (level == 3) {
while (_local1++ , _local1 != zombiePositions2.length) {
_local2 = new zombieObj();
_local2.init(_local1, zombiePositions2[_local1]);
activeBaddies.push(_local2);
}
}
}
function zombieObj() {
this.num = 0;
this.type = "Zombie";
this.sprite = null;
this.xPos = 0;
this.yPos = 0;
this.Xpos1 = 0;
this.Ypos1 = 0;
this.Xpos2 = 0;
this.Ypos2 = 0;
this.Xpos3 = 0;
this.Ypos3 = 0;
this.selectedCoords = 0;
this.speed = 1;
this.destXpos = 0;
this.destYpos = 0;
this.currentDir = 0;
this.prevDir = 0;
this.scrollMoveCnt = 0;
(this.directionArray = "Up");
this.currentStatus = 0;
this.waitingCnt = 0;
this.currentMethod = null;
this.currentMethodStore = null;
this.targetSprite = null;
this.mapStorage = 0;
this.prevX = 0;
this.prevY = 0;
this.setPieceFlag = false;
this.moaningSFX = new Array("zombieMoanSFX", "zombieMoan2SFX", "zombieMoan3SFX");
this.growlingSFX = new Array("zombieGrowlSFX", "zombieGrowl2SFX");
this.sfx = null;
}
zombieObj.prototype.init = function (num, positions) {
this.num = num;
this.Xpos1 = positions[0];
this.Ypos1 = positions[1];
this.Xpos2 = positions[2];
this.Ypos2 = positions[3];
this.Xpos3 = positions[4];
this.Ypos3 = positions[5];
this.xPos = this.Xpos1;
this.yPos = this.Ypos1;
this.createSprite();
this.waitingCnt = 0;
this.onScreen();
};
zombieObj.prototype.createSprite = function () {
this.sprite = spritePlayField.attachMovie("zombie", "zombie" + this.num, spritePlayField.getNextHighestDepth());
};
zombieObj.prototype.destroy = function () {
this.sprite.removeMovieClip();
this.sprite = null;
};
zombieObj.prototype.resetPositon = function (position) {
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.getRandomDirection();
};
zombieObj.prototype.getRandomDirection = function () {
var _local2 = int(Math.random() * 4);
this.currentDir = (this.prevDirection = this.directionArray[_local2]);
this.prevDir = 0;
this.stopAnimation();
this.scrollMoveCnt = 0;
};
zombieObj.prototype.mainloop = function () {
this.currentMethod();
};
zombieObj.prototype.onScreen = function () {
if ((--this.waitingCnt) > 0) {
return(undefined);
}
if (this.screenTest(this.Xpos1, this.Ypos1) == true) {
this.selectedCoords = 1;
this.arrivedOnTheMap();
return(undefined);
}
if (this.Xpos2 != null) {
if (this.screenTest(this.Xpos2, this.Ypos2) == true) {
this.selectedCoords = 2;
this.arrivedOnTheMap();
return(undefined);
}
} else {
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
return(undefined);
}
if (this.Xpos3 != null) {
if (this.screenTest(this.Xpos3, this.Ypos3) == true) {
this.selectedCoords = 3;
this.arrivedOnTheMap();
return(undefined);
}
}
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
};
zombieObj.prototype.arrivedOnTheMap = function () {
this.randomMoan();
this.resetPositon();
if (this.setPieceFlag == false) {
this.getDestination();
} else {
this.destXpos = targetX;
this.destYpos = targetY;
if (this.xPos == this.destXpos) {
if (this.xPos < this.destXpos) {
this.sprite.gotoAndPlay("runningRight");
} else {
this.sprite.gotoAndPlay("runningLeft");
}
} else if (this.yPos < this.destYpos) {
this.sprite.gotoAndPlay("runningDown");
} else {
this.sprite.gotoAndPlay("runningUp");
}
}
this.currentMethod = this.getMovementDirection;
};
zombieObj.prototype.randomMoan = function () {
if (this.sfx != null) {
return(undefined);
}
if (this.num > 101) {
return(undefined);
}
if (this.setPieceFlag == true) {
if (this.num < 101) {
return(undefined);
}
}
this.sfx = new Sound(this.sprite);
this.sfx.class = this;
var _local3 = int(Math.random() * this.moaningSFX.length);
this.sfx.attachSound(this.moaningSFX[_local3]);
var _local2 = getDistanceVolume(this.xPos, this.yPos, 20);
if (masterVolume != 0) {
this.sfx.setVolume(_local2);
this.sfx.setPan(getDistancePan(this.xPos));
} else {
this.sfx.setVolume(0);
}
this.sfx.start();
this.sfx.onSoundComplete = function () {
this=this.class;//parameter overwritten
this.class;
this.sfx = null;
};
};
zombieObj.prototype.randomGrowl = function () {
this.growling = true;
if (this.sfx != null) {
this.sfx.stop();
}
var _local3 = int(Math.random() * this.growlingSFX.length);
this.sfx.class = this;
this.sfx.attachSound(this.growlingSFX[_local3]);
var _local2 = getDistanceVolume(this.xPos, this.yPos, 10);
if (masterVolume != 0) {
this.sfx.setVolume(_local2);
this.sfx.setPan(getDistancePan(this.xPos));
} else {
this.sfx.setVolume(0);
}
this.sfx.start();
this.sfx.onSoundComplete = function () {
this=this.class;//parameter overwritten
this.class;
this.sfx = null;
this.growling = false;
};
};
zombieObj.prototype.screenTest = function (x, y) {
if (x > xMapCoord) {
if (x < (xMapCoord + 18)) {
if (y > yMapCoord) {
if (y < (yMapCoord + 16)) {
this.xPos = x;
this.yPos = y;
return(true);
}
}
}
}
return(false);
};
zombieObj.prototype.offScreen = function () {
if (this.sprite._visible == true) {
return(true);
}
this.stopAnimation();
this.prevDirection = null;
this.sfx = null;
if (!this.sprite.hitTest(spriteHitAreaFull)) {
this["Xpos" + this.selectedCoords] = this.xPos;
this["Ypos" + this.selectedCoords] = this.yPos;
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
return(false);
}
};
zombieObj.prototype.getDestination = function () {
var _local5 = {x:playerXPos, y:playerYPos};
this.targetSprite = player.baddiehitAreaMC;
var _local10 = {x:this.xPos, y:this.yPos};
var _local2;
var _local3;
var _local4;
var _local6 = distanceCalc(_local10, _local5);
var _local11 = activeMates.length;
var _local7 = -1;
while (_local7++ , _local7 != _local11) {
_local2 = activeMates[_local7];
if (_local2.currentStatus != 2) {
_local3 = {x:_local2.xPos, y:_local2.yPos};
_local4 = distanceCalc(_local10, _local3);
if (_local4 <= _local6) {
_local5.x = _local3.x;
_local5.y = _local3.y;
this.targetSprite = _local2.sprite.baddiehitAreaMC;
_local6 = _local4;
}
}
}
this.destXpos = _local5.x;
this.destYpos = _local5.y;
};
zombieObj.prototype.eating = function () {
if (this.sprite.hitAreaMC.hitTest(this.targetSprite)) {
if (this.targetSprite._self != undefined) {
if (this.targetSprite._self.currentStatus == 2) {
this.currentMethod = this.currentMethodStore;
} else {
this.targetSprite._self.decreaseHealth();
}
} else {
decreaseHealth();
}
} else {
this.currentMethod = this.currentMethodStore;
}
};
zombieObj.prototype.getMovementDirection = function () {
if (this.offScreen() == false) {
return(undefined);
}
if (this.setPieceFlag == false) {
this.getDestination();
this.randomMoan();
}
var _local3 = new Array(-1, -1, -1, -1);
var _local8 = new Array();
var _local13 = _map[this.yPos][this.xPos + 1][1];
if (_local13 == 0) {
if (this.prevDir != 1) {
_local3[0] = 0;
_local8.push(0);
}
}
var _local9 = _map[this.yPos][this.xPos - 1][1];
if (_local9 == 0) {
if (this.prevDir != 0) {
_local3[1] = 1;
_local8.push(1);
}
}
var _local11 = _map[this.yPos - 1][this.xPos][1];
if (_local11 == 0) {
if (this.prevDir != 3) {
_local3[2] = 2;
_local8.push(2);
}
}
var _local12 = _map[this.yPos + 1][this.xPos][1];
if (_local12 == 0) {
if (this.prevDir != 2) {
_local3[3] = 3;
_local8.push(3);
}
}
var _local7 = 101;
var _local6 = 101;
if (this.yPos < this.destYpos) {
_local6 = 3;
} else if (this.yPos > this.destYpos) {
_local6 = 2;
}
if (this.xPos > this.destXpos) {
_local7 = 1;
} else if (this.xPos < this.destXpos) {
_local7 = 0;
}
var _local4 = -1;
var _local2;
var _local5 = -1;
while (_local5++ , _local5 != _local3.length) {
_local2 = _local3[_local5];
if (_local2 == _local7) {
_local4 = _local2;
break;
}
if (_local2 == _local6) {
_local4 = _local2;
break;
}
}
if (_local4 == -1) {
_local4 = _local8[int(Math.random() * _local8.length)];
}
this.prevDir = _local4;
this.scrollMoveCnt = (32 / this.speed) - 1;
var _local10 = this["chosenDir" + _local4];
_local10(this);
};
zombieObj.prototype.chosenDir0 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Right") {
this.currentDir = (this.prevDirection = "Right");
}
this.sprite.gotoAndPlay("runningRight");
this.sprite._x = this.sprite._x + this.speed;
this.currentMethod = this.moveRight;
};
zombieObj.prototype.chosenDir1 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Left") {
this.currentDir = (this.prevDirection = "Left");
}
this.sprite.gotoAndPlay("runningLeft");
this.sprite._x = this.sprite._x - this.speed;
this.currentMethod = this.moveLeft;
};
zombieObj.prototype.chosenDir2 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Up") {
this.currentDir = (this.prevDirection = "Up");
}
this.sprite.gotoAndPlay("runningUp");
this.sprite._y = this.sprite._y - this.speed;
this.currentMethod = this.moveUp;
};
zombieObj.prototype.chosenDir3 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Down") {
this.currentDir = (this.prevDirection = "Down");
}
this.sprite.gotoAndPlay("runningDown");
this.sprite._y = this.sprite._y + this.speed;
this.currentMethod = this.moveDown;
};
zombieObj.prototype.moveRight = function () {
this.sprite._x = this.sprite._x + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos++;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
zombieObj.prototype.moveLeft = function () {
this.sprite._x = this.sprite._x - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos--;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
zombieObj.prototype.moveUp = function () {
this.sprite._y = this.sprite._y - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos--;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
zombieObj.prototype.moveDown = function () {
this.sprite._y = this.sprite._y + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos++;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
zombieObj.prototype.collisionCheck = function () {
var _local3 = Math.abs(this.destXpos - this.xPos);
var _local2 = Math.abs(this.destYpos - this.yPos);
if ((_local3 + _local2) <= 4) {
if (this.sprite.hitAreaMC.hitTest(this.targetSprite)) {
if (this.growling != true) {
this.randomGrowl();
}
this.currentMethodStore = this.currentMethod;
this.currentMethod = this.eating;
} else if (this.targetSprite._self == undefined) {
if (this.sprite.hitAreaMC.hitTest(player.baddiehitAreaMC)) {
this.targetSprite = player.baddiehitAreaMC;
this.destXpos = playerXPos;
this.destYpos = playerYPos;
if (this.growling != true) {
this.randomGrowl();
}
this.currentMethodStore = this.currentMethod;
this.currentMethod = this.eating;
}
}
} else if (this.targetSprite._self != undefined) {
if (this.sprite.hitAreaMC.hitTest(player.baddiehitAreaMC)) {
this.targetSprite = player.baddiehitAreaMC;
this.destXpos = playerXPos;
this.destYpos = playerYPos;
if (this.growling != true) {
this.randomGrowl();
}
this.currentMethodStore = this.currentMethod;
this.currentMethod = this.eating;
}
}
};
zombieObj.prototype.stopAnimation = function () {
this.sprite.gotoAndStop(1);
this.sprite.anim.gotoAndStop(1);
};
zombieObj.prototype.pause = function () {
this.sprite.gotoAndStop(this.sprite._currentframe);
this.sprite.anim.gotoAndStop(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndStop(this.sprite.shadowAnim._currentframe);
};
zombieObj.prototype.resume = function () {
if (this.sprite._visible == true) {
this.sprite.gotoAndPlay(this.sprite._currentframe);
this.sprite.anim.gotoAndPlay(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndPlay(this.sprite.shadowAnim._currentframe);
}
};
function alienInit() {
var _local1 = -1;
var _local2;
var _local3 = alienPositions[level - 4].length;
while (_local1++ , _local1 != _local3) {
_local2 = new alienObj();
_local2.init(_local1, alienPositions[level - 4][_local1]);
activeBaddies.push(_local2);
}
}
function alienObj() {
this.num = 0;
this.sprite = null;
this.xPos = 0;
this.yPos = 0;
this.Xpos1 = 0;
this.Ypos1 = 0;
this.Xpos2 = 0;
this.Ypos2 = 0;
this.Xpos3 = 0;
this.Ypos3 = 0;
this.selectedCoords = 0;
this.speed = 2;
this.destXpos = 0;
this.destYpos = 0;
this.currentDir = 0;
this.prevDir = 0;
this.scrollMoveCnt = 0;
(this.directionArray = "Up");
this.currentStatus = 0;
this.waitingCnt = 0;
this.currentMethod = null;
this.currentMethodStore = null;
this.targetSprite = null;
this.mapStorage = 0;
this.prevX = 0;
this.prevY = 0;
this.moaningSFX = new Array("alienTalkingSFX1", "alienTalkingSFX2", "alienTalkingSFX3", "alienTalkingSFX4", "alienTalkingSFX5");
this.talkSFX = null;
}
alienObj.prototype.init = function (num, positions) {
this.num = num;
this.Xpos1 = positions[0];
this.Ypos1 = positions[1];
this.Xpos2 = positions[2];
this.Ypos2 = positions[3];
this.Xpos3 = positions[4];
this.Ypos3 = positions[5];
this.createSprite();
this.sfx = new Sound(this.sprite);
this.waitingCnt = 0;
this.onScreen();
};
alienObj.prototype.createSprite = function () {
this.sprite = spritePlayField.attachMovie("alien", "alien" + this.num, spritePlayField.getNextHighestDepth());
};
alienObj.prototype.destroy = function () {
this.sprite.removeMovieClip();
this.sprite = null;
};
alienObj.prototype.resetPositon = function (position) {
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.getRandomDirection();
};
alienObj.prototype.getRandomDirection = function () {
var _local2 = int(Math.random() * 4);
this.currentDir = (this.prevDirection = this.directionArray[_local2]);
this.prevDir = 0;
this.stopAnimation();
this.scrollMoveCnt = 0;
};
alienObj.prototype.randomMoan = function () {
if (this.talkSFX != null) {
return(undefined);
}
this.talkSFX = new Sound(this.sprite);
this.talkSFX.class = this;
var _local3 = int(Math.random() * this.moaningSFX.length);
this.talkSFX.attachSound(this.moaningSFX[_local3]);
var _local2 = getDistanceVolume(this.xPos, this.yPos, 5);
if (masterVolume != 0) {
this.talkSFX.setVolume(_local2);
this.talkSFX.setPan(getDistancePan(this.xPos));
} else {
this.talkSFX.setVolume(0);
}
this.talkSFX.start();
this.talkSFX.onSoundComplete = function () {
this=this.class;//parameter overwritten
this.class;
this.talkSFX = null;
};
};
alienObj.prototype.mainloop = function () {
this.currentMethod();
};
alienObj.prototype.onScreen = function () {
if ((--this.waitingCnt) > 0) {
return(undefined);
}
if (this.screenTest(this.Xpos1, this.Ypos1) == true) {
this.selectedCoords = 1;
this.arrivedOnTheMap();
return(undefined);
}
if (this.Xpos2 != null) {
if (this.screenTest(this.Xpos2, this.Ypos2) == true) {
this.selectedCoords = 2;
this.arrivedOnTheMap();
return(undefined);
}
} else {
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
return(undefined);
}
if (this.Xpos3 != null) {
if (this.screenTest(this.Xpos3, this.Ypos3) == true) {
this.selectedCoords = 3;
this.arrivedOnTheMap();
return(undefined);
}
}
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
};
alienObj.prototype.arrivedOnTheMap = function () {
this.resetPositon();
this.getDestination();
this.currentMethod = this.getMovementDirection;
};
alienObj.prototype.screenTest = function (x, y) {
if (x > xMapCoord) {
if (x < (xMapCoord + 18)) {
if (y > yMapCoord) {
if (y < (yMapCoord + 16)) {
this.xPos = x;
this.yPos = y;
return(true);
}
}
}
}
return(false);
};
alienObj.prototype.offScreen = function () {
if (this.sprite._visible == true) {
return(true);
}
this.stopAnimation();
this.prevDirection = null;
if (!this.sprite.hitTest(spriteHitAreaFull)) {
this["Xpos" + this.selectedCoords] = this.xPos;
this["Ypos" + this.selectedCoords] = this.yPos;
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
return(false);
}
};
alienObj.prototype.getDestination = function () {
var _local5 = {x:playerXPos, y:playerYPos};
this.targetSprite = player.baddiehitAreaMC;
var _local10 = {x:this.xPos, y:this.yPos};
var _local2;
var _local3;
var _local4;
var _local6 = distanceCalc(_local10, _local5);
var _local11 = activeMates.length;
var _local7 = -1;
while (_local7++ , _local7 != _local11) {
_local2 = activeMates[_local7];
if (_local2.currentStatus != 2) {
_local3 = {x:_local2.xPos, y:_local2.yPos};
_local4 = distanceCalc(_local10, _local3);
if (_local4 <= _local6) {
_local5.x = _local3.x;
_local5.y = _local3.y;
this.targetSprite = _local2.sprite.baddiehitAreaMC;
_local6 = _local4;
}
}
}
this.destXpos = _local5.x;
this.destYpos = _local5.y;
};
alienObj.prototype.takingAShot = function () {
if (this.destXpos == this.xPos) {
if (this.destYpos < this.yPos) {
this.sprite.gotoAndStop("shootingUp");
} else {
this.sprite.gotoAndStop("shootingDown");
}
} else if (this.destXpos < this.xPos) {
this.sprite.gotoAndStop("shootingLeft");
} else {
this.sprite.gotoAndStop("shootingRight");
}
this.shotDelay = 0;
this.currentMethod = this.waitingToShoot;
};
alienObj.prototype.waitingToShoot = function () {
if ((++this.shotDelay) == 4) {
this.sprite.lazer._visible = true;
this.sprite.lazer.gotoAndPlay(1);
var _local2 = new Sound(this.sprite);
_local2.attachSound("lazerSFX");
var _local3 = getDistanceVolume(this.xPos, this.yPos, 10);
if (masterVolume != 0) {
_local2.setVolume(_local3);
_local2.setPan(getDistancePan(this.xPos));
} else {
_local2.setVolume(0);
}
_local2.start();
this.currentMethod = this.shootingEndedCheck;
}
};
alienObj.prototype.shootingEndedCheck = function () {
if (this.sprite.lazer._currentframe == this.sprite.lazer._totalframes) {
this.getDestination();
this.currentMethod = this.getMovementDirection;
} else if (this.sprite.lazer.hitAreaMC != undefined) {
if (this.sprite.lazer.hitAreaMC.hitTest(this.targetSprite)) {
if (this.targetSprite._self != undefined) {
if (this.targetSprite._self.currentStatus == 2) {
this.getDestination();
this.currentMethod = this.getMovementDirection;
} else {
this.targetSprite._self.decreaseHealth();
}
if (this.sprite.lazer.hitAreaMC.hitTest(player.baddiehitAreaMC)) {
decreaseHealth();
}
} else {
decreaseHealth();
}
} else if (this.targetSprite._self == undefined) {
if (this.sprite.lazer.hitAreaMC.hitTest(player.baddiehitAreaMC)) {
decreaseHealth();
}
}
}
};
alienObj.prototype.getMovementDirection = function () {
if (this.offScreen() == false) {
return(undefined);
}
var _local13 = Math.abs(this.destXpos - this.xPos);
var _local12 = Math.abs(this.destYpos - this.yPos);
if ((_local13 + _local12) < 7) {
if ((this.destXpos == this.xPos) || (this.destYpos == this.yPos)) {
if (this.losPass1() == true) {
this.randomMoan();
this.takingAShot();
return(undefined);
}
}
}
this.randomMoan();
this.getDestination();
var _local3 = new Array(-1, -1, -1, -1);
var _local8 = new Array();
var _local15 = _map[this.yPos][this.xPos + 1][1];
if (_local15 == 0) {
if (this.prevDir != 1) {
_local3[0] = 0;
_local8.push(0);
}
}
var _local9 = _map[this.yPos][this.xPos - 1][1];
if (_local9 == 0) {
if (this.prevDir != 0) {
_local3[1] = 1;
_local8.push(1);
}
}
var _local11 = _map[this.yPos - 1][this.xPos][1];
if (_local11 == 0) {
if (this.prevDir != 3) {
_local3[2] = 2;
_local8.push(2);
}
}
var _local14 = _map[this.yPos + 1][this.xPos][1];
if (_local14 == 0) {
if (this.prevDir != 2) {
_local3[3] = 3;
_local8.push(3);
}
}
var _local7 = 101;
var _local6 = 101;
if (this.yPos < this.destYpos) {
_local6 = 3;
} else if (this.yPos > this.destYpos) {
_local6 = 2;
}
if (this.xPos > this.destXpos) {
_local7 = 1;
} else if (this.xPos < this.destXpos) {
_local7 = 0;
}
var _local4 = -1;
var _local2;
var _local5 = -1;
while (_local5++ , _local5 != _local3.length) {
_local2 = _local3[_local5];
if (_local2 == _local7) {
_local4 = _local2;
break;
}
if (_local2 == _local6) {
_local4 = _local2;
break;
}
}
if (_local4 == -1) {
_local4 = _local8[int(Math.random() * _local8.length)];
}
this.prevDir = _local4;
this.scrollMoveCnt = (32 / this.speed) - 1;
var _local10 = this["chosenDir" + _local4];
_local10(this);
};
alienObj.prototype.chosenDir0 = function (scope) {
this=scope;//parameter overwritten
this.sprite.gotoAndPlay("runningRight");
if (this.prevDirection != "Right") {
this.currentDir = (this.prevDirection = "Right");
this.sprite.anim.gotoAndPlay(1);
}
this.sprite._x = this.sprite._x + this.speed;
this.currentMethod = this.moveRight;
};
alienObj.prototype.chosenDir1 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Left") {
this.currentDir = (this.prevDirection = "Left");
}
this.sprite.gotoAndPlay("runningLeft");
this.sprite._x = this.sprite._x - this.speed;
this.currentMethod = this.moveLeft;
};
alienObj.prototype.chosenDir2 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Up") {
this.currentDir = (this.prevDirection = "Up");
}
this.sprite.gotoAndPlay("runningUp");
this.sprite._y = this.sprite._y - this.speed;
this.currentMethod = this.moveUp;
};
alienObj.prototype.chosenDir3 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Down") {
this.currentDir = (this.prevDirection = "Down");
}
this.sprite.gotoAndPlay("runningDown");
this.sprite._y = this.sprite._y + this.speed;
this.currentMethod = this.moveDown;
};
alienObj.prototype.moveRight = function () {
this.sprite._x = this.sprite._x + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos++;
this.currentMethod = this.getMovementDirection;
}
};
alienObj.prototype.moveLeft = function () {
this.sprite._x = this.sprite._x - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos--;
this.currentMethod = this.getMovementDirection;
}
};
alienObj.prototype.moveUp = function () {
this.sprite._y = this.sprite._y - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos--;
this.currentMethod = this.getMovementDirection;
}
};
alienObj.prototype.moveDown = function () {
this.sprite._y = this.sprite._y + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos++;
this.currentMethod = this.getMovementDirection;
}
};
alienObj.prototype.stopAnimation = function () {
this.sprite.gotoAndStop(1);
this.sprite.anim.gotoAndStop(1);
};
alienObj.prototype.losPass1 = function () {
if (this.destXpos > this.xPos) {
var _local2 = this.xPos - 1;
while (_local2++ , _local2 != (this.destXpos + 1)) {
if (_map[this.yPos][_local2][1] == 1) {
return(false);
}
}
} else {
var _local2 = this.destXpos - 1;
while (_local2++ , _local2 != (this.xPos + 1)) {
if (_map[this.yPos][_local2][1] == 1) {
return(false);
}
}
}
return(this.losPass2());
};
alienObj.prototype.losPass2 = function () {
if (this.destYpos > this.yPos) {
var _local2 = this.yPos - 1;
while (_local2++ , _local2 != (this.destYpos + 1)) {
if (_map[_local2][this.yPos][1] == 1) {
return(false);
}
}
} else {
var _local2 = this.destYpos - 1;
while (_local2++ , _local2 != (this.yPos + 1)) {
if (_map[_local2][this.xPos][1] == 1) {
return(false);
}
}
}
return(true);
};
alienObj.prototype.pause = function () {
this.sprite.gotoAndStop(this.sprite._currentframe);
this.sprite.anim.gotoAndStop(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndStop(this.sprite.shadowAnim._currentframe);
};
alienObj.prototype.resume = function () {
if (this.sprite._visible == true) {
if (this.sprite._currentframe < 86) {
this.sprite.gotoAndPlay(this.sprite._currentframe);
this.sprite.anim.gotoAndPlay(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndPlay(this.sprite.shadowAnim._currentframe);
}
}
};
function antInit() {
var _local1 = -1;
var _local2;
var _local3 = antPositions[level - 3].length;
while (_local1++ , _local1 != _local3) {
_local2 = new antObj();
_local2.init(_local1, antPositions[level - 3][_local1]);
activeBaddies.push(_local2);
}
}
function antObj() {
this.num = 0;
this.type = "Ant";
this.sprite = null;
this.xPos = 0;
this.yPos = 0;
this.Xpos1 = 0;
this.Ypos1 = 0;
this.Xpos2 = 0;
this.Ypos2 = 0;
this.Xpos3 = 0;
this.Ypos3 = 0;
this.selectedCoords = 0;
this.speed = 2;
this.destXpos = 0;
this.destYpos = 0;
this.currentDir = 0;
this.prevDir = 0;
this.scrollMoveCnt = 0;
(this.directionArray = "Up");
this.currentStatus = 0;
this.waitingCnt = 0;
this.currentMethod = null;
this.currentMethodStore = null;
this.targetSprite = null;
this.mapStorage = 0;
this.prevX = 0;
this.prevY = 0;
this.sfx = null;
}
antObj.prototype.init = function (num, positions) {
this.num = num;
this.Xpos1 = positions[0];
this.Ypos1 = positions[1];
this.Xpos2 = positions[2];
this.Ypos2 = positions[3];
this.Xpos3 = positions[4];
this.Ypos3 = positions[5];
this.xPos = this.Xpos1;
this.yPos = this.Ypos1;
this.createSprite();
this.waitingCnt = 0;
this.onScreen();
};
antObj.prototype.createSprite = function () {
this.sprite = topSpritePlayField.attachMovie("ant", "ant" + this.num, topSpritePlayField.getNextHighestDepth());
};
antObj.prototype.destroy = function () {
this.sprite.removeMovieClip();
this.sprite = null;
};
antObj.prototype.resetPositon = function (position) {
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.getRandomDirection();
};
antObj.prototype.getRandomDirection = function () {
var _local2 = int(Math.random() * 4);
this.currentDir = (this.prevDirection = this.directionArray[_local2]);
this.prevDir = 0;
this.stopAnimation();
this.scrollMoveCnt = 0;
};
antObj.prototype.mainloop = function () {
this.currentMethod();
};
antObj.prototype.onScreen = function () {
if ((--this.waitingCnt) > 0) {
return(undefined);
}
if (this.screenTest(this.Xpos1, this.Ypos1) == true) {
this.selectedCoords = 1;
this.arrivedOnTheMap();
return(undefined);
}
if (this.Xpos2 == null) {
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
return(undefined);
}
if (this.screenTest(this.Xpos2, this.Ypos2) == true) {
this.selectedCoords = 2;
this.arrivedOnTheMap();
return(undefined);
}
if (this.screenTest(this.Xpos3, this.Ypos3) == true) {
this.selectedCoords = 3;
this.arrivedOnTheMap();
return(undefined);
}
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
};
antObj.prototype.arrivedOnTheMap = function () {
this.randomMoan();
this.resetPositon();
this.getDestination();
this.currentMethod = this.getMovementDirection;
};
antObj.prototype.screenTest = function (x, y) {
if (x > xMapCoord) {
if (x < (xMapCoord + 18)) {
if (y > yMapCoord) {
if (y < (yMapCoord + 16)) {
this.xPos = x;
this.yPos = y;
return(true);
}
}
}
}
return(false);
};
antObj.prototype.offScreen = function () {
if (this.sprite._visible == true) {
return(true);
}
this.stopAnimation();
this.prevDirection = null;
if (!this.sprite.hitTest(spriteHitAreaFull)) {
this["Xpos" + this.selectedCoords] = this.xPos;
this["Ypos" + this.selectedCoords] = this.yPos;
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
return(false);
}
};
antObj.prototype.getDestination = function () {
var _local5 = {x:playerXPos, y:playerYPos};
var _local10 = {x:this.xPos, y:this.yPos};
var _local2;
var _local3;
var _local4;
var _local6 = distanceCalc(_local10, _local5);
var _local11 = activeMates.length;
var _local7 = -1;
while (_local7++ , _local7 != _local11) {
_local2 = activeMates[_local7];
if (_local2.currentStatus != 2) {
_local3 = {x:_local2.xPos, y:_local2.yPos};
_local4 = distanceCalc(_local10, _local3);
if (_local4 <= _local6) {
_local5.x = _local3.x;
_local5.y = _local3.y;
this.targetSprite = _local2.sprite.baddiehitAreaMC;
_local6 = _local4;
}
}
}
this.destXpos = _local5.x;
this.destYpos = _local5.y;
};
antObj.prototype.eating = function () {
if (this.sfx == null) {
this.sfx = new Sound(this.sprite);
this.sfx.class = this;
this.sfx.attachSound("antEatingSFX");
this.sfx.setVolume(masterVolume);
this.sfx.start();
this.sfx.onSoundComplete = function () {
this=this.class;//parameter overwritten
this.class;
this.sfx = null;
};
}
if (this.sprite.hitAreaMC.hitTest(this.targetSprite)) {
if (this.targetSprite._self != undefined) {
if (this.targetSprite._self.currentStatus == 2) {
this.currentMethod = this.currentMethodStore;
} else {
this.targetSprite._self.decreaseHealth(2);
}
} else {
decreaseHealth(2);
}
} else {
this.currentMethod = this.currentMethodStore;
}
};
antObj.prototype.getMovementDirection = function () {
if (this.offScreen() == false) {
return(undefined);
}
this.getDestination();
var _local3 = new Array(-1, -1, -1, -1);
var _local8 = new Array();
var _local13 = _map[this.yPos][this.xPos + 1][1];
if (_local13 == 0) {
if (this.prevDir != 1) {
_local3[0] = 0;
_local8.push(0);
}
}
var _local9 = _map[this.yPos][this.xPos - 1][1];
if (_local9 == 0) {
if (this.prevDir != 0) {
_local3[1] = 1;
_local8.push(1);
}
}
var _local11 = _map[this.yPos - 1][this.xPos][1];
if (_local11 == 0) {
if (this.prevDir != 3) {
_local3[2] = 2;
_local8.push(2);
}
}
var _local12 = _map[this.yPos + 1][this.xPos][1];
if (_local12 == 0) {
if (this.prevDir != 2) {
_local3[3] = 3;
_local8.push(3);
}
}
var _local7 = 101;
var _local6 = 101;
if (this.yPos < this.destYpos) {
_local6 = 3;
} else if (this.yPos > this.destYpos) {
_local6 = 2;
}
if (this.xPos > this.destXpos) {
_local7 = 1;
} else if (this.xPos < this.destXpos) {
_local7 = 0;
}
var _local4 = -1;
var _local2;
var _local5 = -1;
while (_local5++ , _local5 != _local3.length) {
_local2 = _local3[_local5];
if (_local2 == _local7) {
_local4 = _local2;
break;
}
if (_local2 == _local6) {
_local4 = _local2;
break;
}
}
if (_local4 == -1) {
_local4 = _local8[int(Math.random() * _local8.length)];
}
this.prevDir = _local4;
this.scrollMoveCnt = (32 / this.speed) - 1;
var _local10 = this["chosenDir" + _local4];
_local10(this);
};
antObj.prototype.chosenDir0 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Right") {
this.currentDir = (this.prevDirection = "Right");
}
this.sprite.gotoAndPlay("runningRight");
this.sprite._x = this.sprite._x + this.speed;
this.currentMethod = this.moveRight;
};
antObj.prototype.chosenDir1 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Left") {
this.currentDir = (this.prevDirection = "Left");
}
this.sprite.gotoAndPlay("runningLeft");
this.sprite._x = this.sprite._x - this.speed;
this.currentMethod = this.moveLeft;
};
antObj.prototype.chosenDir2 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Up") {
this.currentDir = (this.prevDirection = "Up");
}
this.sprite.gotoAndPlay("runningUp");
this.sprite._y = this.sprite._y - this.speed;
this.currentMethod = this.moveUp;
};
antObj.prototype.chosenDir3 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Down") {
this.currentDir = (this.prevDirection = "Down");
}
this.sprite.gotoAndPlay("runningDown");
this.sprite._y = this.sprite._y + this.speed;
this.currentMethod = this.moveDown;
};
antObj.prototype.moveRight = function () {
this.sprite._x = this.sprite._x + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos++;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
antObj.prototype.moveLeft = function () {
this.sprite._x = this.sprite._x - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos--;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
antObj.prototype.moveUp = function () {
this.sprite._y = this.sprite._y - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos--;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
antObj.prototype.moveDown = function () {
this.sprite._y = this.sprite._y + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos++;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
antObj.prototype.collisionCheck = function () {
var _local3 = Math.abs(this.destXpos - this.xPos);
var _local2 = Math.abs(this.destYpos - this.yPos);
if ((_local3 + _local2) <= 4) {
if (this.sprite.hitAreaMC.hitTest(this.targetSprite)) {
this.currentMethodStore = this.currentMethod;
this.currentMethod = this.eating;
} else if (this.sprite.hitAreaMC.hitTest(player.baddiehitAreaMC)) {
this.targetSprite = player.baddiehitAreaMC;
this.currentMethodStore = this.currentMethod;
this.currentMethod = this.eating;
}
} else if (this.sprite.hitAreaMC.hitTest(player.baddiehitAreaMC)) {
this.targetSprite = player.baddiehitAreaMC;
this.currentMethodStore = this.currentMethod;
this.currentMethod = this.eating;
}
};
antObj.prototype.stopAnimation = function () {
this.sprite.gotoAndStop(1);
this.sprite.anim.gotoAndStop(1);
};
antObj.prototype.pause = function () {
this.sprite.gotoAndStop(this.sprite._currentframe);
this.sprite.anim.rotate.gotoAndStop(this.sprite.anim.rotate._currentframe);
this.sprite.shadowAnim.rotate.gotoAndStop(this.sprite.shadowAnim.rotate._currentframe);
};
antObj.prototype.resume = function () {
if (this.sprite._visible == true) {
this.sprite.gotoAndPlay(this.sprite._currentframe);
this.sprite.anim.rotate.gotoAndPlay(this.sprite.anim.rotate._currentframe);
this.sprite.shadowAnim.rotate.gotoAndPlay(this.sprite.shadowAnim.rotate._currentframe);
}
};
function spiderInit() {
var _local1 = -1;
var _local2;
var _local3 = spiderPositions.length;
while (_local1++ , _local1 != _local3) {
_local2 = new spiderObj();
_local2.init(_local1, spiderPositions[_local1]);
activeBaddies.push(_local2);
}
}
function spiderObj() {
this.num = 0;
this.type = "Spider";
this.sprite = null;
this.xPos = 0;
this.yPos = 0;
this.Xpos1 = 0;
this.Ypos1 = 0;
this.Xpos2 = 0;
this.Ypos2 = 0;
this.Xpos3 = 0;
this.Ypos3 = 0;
this.selectedCoords = 0;
this.speed = 4;
this.destXpos = 0;
this.destYpos = 0;
this.currentDir = 0;
this.prevDir = 0;
this.scrollMoveCnt = 0;
(this.directionArray = "Up");
this.currentStatus = 0;
this.waitingCnt = 0;
this.stalkingCnt = 0;
this.scuttleCnt = 0;
this.currFrame = 1;
this.currentMethod = null;
this.currentMethodStore = null;
this.targetSprite = null;
this.mapStorage = 0;
this.prevX = 0;
this.prevY = 0;
this.sfx = null;
}
spiderObj.prototype.init = function (num, positions) {
this.num = num;
this.Xpos1 = positions[0];
this.Ypos1 = positions[1];
this.Xpos2 = positions[2];
this.Ypos2 = positions[3];
this.Xpos3 = positions[4];
this.Ypos3 = positions[5];
this.xPos = this.Xpos1;
this.yPos = this.Ypos1;
this.createSprite();
this.stalkingCnt = (int(Math.random() * 4) + 3) * frameRate;
this.scuttleCnt = int(Math.random() * 15) + 10;
this.onScreen();
};
spiderObj.prototype.createSprite = function () {
this.sprite = topSpritePlayField.attachMovie("spider", "spider" + this.num, topSpritePlayField.getNextHighestDepth());
};
spiderObj.prototype.destroy = function () {
this.sprite.removeMovieClip();
this.sprite = null;
};
spiderObj.prototype.resetPositon = function (position) {
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.getRandomDirection();
};
spiderObj.prototype.getRandomDirection = function () {
var _local2 = int(Math.random() * 4);
this.currentDir = (this.prevDirection = this.directionArray[_local2]);
this.prevDir = 0;
this.stopAnimation();
this.scrollMoveCnt = 0;
};
spiderObj.prototype.mainloop = function () {
this.currentMethod();
};
spiderObj.prototype.onScreen = function () {
if ((--this.waitingCnt) > 0) {
return(undefined);
}
if (this.screenTest(this.Xpos1, this.Ypos1) == true) {
this.selectedCoords = 1;
this.arrivedOnTheMap();
return(undefined);
}
if (this.Xpos2 == null) {
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
return(undefined);
}
if (this.screenTest(this.Xpos2, this.Ypos2) == true) {
this.selectedCoords = 2;
this.arrivedOnTheMap();
return(undefined);
}
if (this.screenTest(this.Xpos3, this.Ypos3) == true) {
this.selectedCoords = 3;
this.arrivedOnTheMap();
return(undefined);
}
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
};
spiderObj.prototype.arrivedOnTheMap = function () {
this.stopAnimation();
this.resetPositon();
this.getDestination();
this.currentMethod = this.getMovementDirection;
};
spiderObj.prototype.screenTest = function (x, y) {
if (x > xMapCoord) {
if (x < (xMapCoord + 18)) {
if (y > yMapCoord) {
if (y < (yMapCoord + 16)) {
this.xPos = x;
this.yPos = y;
return(true);
}
}
}
}
return(false);
};
spiderObj.prototype.offScreen = function () {
if (this.sprite._visible == true) {
return(true);
}
this.stopAnimation();
this.prevDirection = null;
if (!this.sprite.hitTest(spriteHitAreaFull)) {
this["Xpos" + this.selectedCoords] = this.xPos;
this["Ypos" + this.selectedCoords] = this.yPos;
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
return(false);
}
};
spiderObj.prototype.getDestination = function () {
var _local5 = {x:playerXPos, y:playerYPos};
var _local10 = {x:this.xPos, y:this.yPos};
var _local2;
var _local3;
var _local4;
var _local6 = distanceCalc(_local10, _local5);
var _local11 = activeMates.length;
var _local7 = -1;
while (_local7++ , _local7 != _local11) {
_local2 = activeMates[_local7];
if (_local2.currentStatus != 2) {
_local3 = {x:_local2.xPos, y:_local2.yPos};
_local4 = distanceCalc(_local10, _local3);
if (_local4 <= _local6) {
_local5.x = _local3.x;
_local5.y = _local3.y;
this.targetSprite = _local2.sprite.baddiehitAreaMC;
_local6 = _local4;
}
}
}
this.destXpos = _local5.x;
this.destYpos = _local5.y;
};
spiderObj.prototype.eating = function () {
this.stopAnimation();
if (this.sprite.hitAreaMC.hitTest(this.targetSprite)) {
if (this.targetSprite._self != undefined) {
if (this.targetSprite._self.currentStatus == 2) {
this.currentMethod = this.currentMethodStore;
} else {
this.targetSprite._self.decreaseHealth(2);
}
} else {
decreaseHealth();
}
} else {
this.currentMethod = this.currentMethodStore;
}
};
spiderObj.prototype.getMovementDirection = function () {
if (this.offScreen() == false) {
return(undefined);
}
if ((--this.stalkingCnt) > 0) {
this.stopAnimation();
return(undefined);
}
if ((--this.scuttleCnt) <= 0) {
this.stalkingCnt = (int(Math.random() * 4) + 3) * frameRate;
this.scuttleCnt = int(Math.random() * 15) + 10;
} else if (this.scuttleCnt >= 15) {
if (this.sfx == null) {
this.sfx = new Sound(this.sprite);
this.sfx.class = this;
this.sfx.attachSound("spiderAwakeSFX");
this.sfx.setVolume(masterVolume);
this.sfx.start();
this.sfx.onSoundComplete = function () {
this=this.class;//parameter overwritten
this.class;
this.sfx = null;
};
}
}
this.getDestination();
var _local3 = new Array(-1, -1, -1, -1);
var _local8 = new Array();
var _local13 = _map[this.yPos][this.xPos + 1][1];
if (_local13 == 0) {
if (this.prevDir != 1) {
_local3[0] = 0;
_local8.push(0);
}
}
var _local9 = _map[this.yPos][this.xPos - 1][1];
if (_local9 == 0) {
if (this.prevDir != 0) {
_local3[1] = 1;
_local8.push(1);
}
}
var _local11 = _map[this.yPos - 1][this.xPos][1];
if (_local11 == 0) {
if (this.prevDir != 3) {
_local3[2] = 2;
_local8.push(2);
}
}
var _local12 = _map[this.yPos + 1][this.xPos][1];
if (_local12 == 0) {
if (this.prevDir != 2) {
_local3[3] = 3;
_local8.push(3);
}
}
var _local7 = 101;
var _local6 = 101;
if (this.yPos < this.destYpos) {
_local6 = 3;
} else if (this.yPos > this.destYpos) {
_local6 = 2;
}
if (this.xPos > this.destXpos) {
_local7 = 1;
} else if (this.xPos < this.destXpos) {
_local7 = 0;
}
var _local4 = -1;
var _local2;
var _local5 = -1;
while (_local5++ , _local5 != _local3.length) {
_local2 = _local3[_local5];
if (_local2 == _local7) {
_local4 = _local2;
break;
}
if (_local2 == _local6) {
_local4 = _local2;
break;
}
}
if (_local4 == -1) {
_local4 = _local8[int(Math.random() * _local8.length)];
}
this.prevDir = _local4;
this.scrollMoveCnt = (32 / this.speed) - 1;
var _local10 = this["chosenDir" + _local4];
_local10(this);
};
spiderObj.prototype.chosenDir0 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Right") {
this.currentDir = (this.prevDirection = "Right");
}
this.currFrame = this.sprite.anim._currentframe;
this.sprite.gotoAndPlay("runningRight");
this.startAnimation();
this.sprite._x = this.sprite._x + this.speed;
this.currentMethod = this.moveRight;
};
spiderObj.prototype.chosenDir1 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Left") {
this.currentDir = (this.prevDirection = "Left");
}
this.currFrame = this.sprite.anim._currentframe;
this.sprite.gotoAndPlay("runningLeft");
this.startAnimation();
this.sprite._x = this.sprite._x - this.speed;
this.currentMethod = this.moveLeft;
};
spiderObj.prototype.chosenDir2 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Up") {
this.currentDir = (this.prevDirection = "Up");
}
this.currFrame = this.sprite.anim._currentframe;
this.sprite.gotoAndPlay("runningUp");
this.startAnimation();
this.sprite._y = this.sprite._y - this.speed;
this.currentMethod = this.moveUp;
};
spiderObj.prototype.chosenDir3 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Down") {
this.currentDir = (this.prevDirection = "Down");
}
this.currFrame = this.sprite.anim._currentframe;
this.sprite.gotoAndPlay("runningDown");
this.startAnimation();
this.sprite._y = this.sprite._y + this.speed;
this.currentMethod = this.moveDown;
};
spiderObj.prototype.moveRight = function () {
this.sprite._x = this.sprite._x + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos++;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
spiderObj.prototype.moveLeft = function () {
this.sprite._x = this.sprite._x - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos--;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
spiderObj.prototype.moveUp = function () {
this.sprite._y = this.sprite._y - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos--;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
spiderObj.prototype.moveDown = function () {
this.sprite._y = this.sprite._y + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos++;
this.currentMethod = this.getMovementDirection;
} else {
this.collisionCheck();
}
};
spiderObj.prototype.collisionCheck = function () {
var _local3 = Math.abs(this.destXpos - this.xPos);
var _local2 = Math.abs(this.destYpos - this.yPos);
if ((_local3 + _local2) <= 4) {
if (this.sprite.hitAreaMC.hitTest(this.targetSprite)) {
this.currentMethodStore = this.currentMethod;
this.currentMethod = this.eating;
} else if (this.sprite.hitAreaMC.hitTest(player.baddiehitAreaMC)) {
this.targetSprite = player.baddiehitAreaMC;
this.currentMethodStore = this.currentMethod;
this.currentMethod = this.eating;
}
} else if (this.sprite.hitAreaMC.hitTest(player.baddiehitAreaMC)) {
this.targetSprite = player.baddiehitAreaMC;
this.currentMethodStore = this.currentMethod;
this.currentMethod = this.eating;
}
};
spiderObj.prototype.stopAnimation = function () {
this.currFrame = this.sprite.anim._currentframe;
this.sprite.anim.gotoAndStop(this.currFrame);
this.sprite.shadowAnim.gotoAndStop(this.currFrame);
};
spiderObj.prototype.startAnimation = function () {
this.sprite.gotoAndPlay(this.sprite._currentframe);
this.sprite.anim.gotoAndPlay(this.currFrame);
this.sprite.shadowAnim.gotoAndPlay(this.currFrame);
};
spiderObj.prototype.pause = function () {
this.sprite.gotoAndStop(this.sprite._currentframe);
this.sprite.anim.gotoAndStop(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndStop(this.sprite.shadowAnim._currentframe);
};
spiderObj.prototype.resume = function () {
if (this.sprite._visible == true) {
this.sprite.gotoAndPlay(this.sprite._currentframe);
this.sprite.anim.gotoAndPlay(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndPlay(this.sprite.shadowAnim._currentframe);
}
};
function fireInit() {
var _local1 = -1;
var _local2;
var _local3 = firePositions[level - 1].length;
while (_local1++ , _local1 != _local3) {
_local2 = new fireObj();
_local2.init(_local1, firePositions[level - 1][_local1]);
activeBaddies.push(_local2);
}
}
function fireObj() {
this.num = 0;
this.type = "Fire";
this.sprite = null;
this.depth = 0;
this.linkageID1 = "";
this.linkageID2 = "";
this.linkageID3 = "";
this.xPos = 0;
this.yPos = 0;
this.Xpos1 = 0;
this.Ypos1 = 0;
this.Xpos2 = 0;
this.Ypos2 = 0;
this.Xpos3 = 0;
this.Ypos3 = 0;
this.selectedCoords = 0;
this.alteredTiles = new Array();
this.currentStatus = 0;
this.sfxFlipFlip = 0;
this.currentMethod = null;
}
fireObj.prototype.init = function (num, positions) {
this.num = num;
this.Xpos1 = positions[0];
this.Ypos1 = positions[1];
this.linkageID1 = positions[2];
this.Xpos2 = positions[3];
this.Ypos2 = positions[4];
this.linkageID2 = positions[5];
this.Xpos3 = positions[6];
this.Ypos3 = positions[7];
this.linkageID3 = positions[8];
this.waitingCnt = 0;
this.alterMap();
this.onScreen();
};
fireObj.prototype.createSprite = function (linkageID) {
this.sprite = spritePlayField.attachMovie(linkageID, "fire" + this.num, spritePlayField.getNextHighestDepth());
this.sprite.blendMode = 8;
this.fireSFX = new Sound(this.sprite);
this.fireSFX.attachSound("fireSFX");
this.fireSFX.setVolume(masterVolume);
this.fireSFX.start(0, 99999);
this.currentMethod = this.handleSFX;
};
fireObj.prototype.destroy = function () {
this.fireSFX.stop();
this.sprite.removeMovieClip();
this.sprite = null;
var _local2;
var _local4 = this.alteredTiles.length;
var _local3 = -1;
while (_local3++ , _local3 != _local4) {
_local2 = this.alteredTiles[_local3];
_map[_local2[1]][_local2[0]][1] = _local2[2];
}
};
fireObj.prototype.remove = function () {
this.fireSFX.stop();
this.sprite.removeMovieClip();
this.sprite = null;
};
fireObj.prototype.resetPositon = function (id) {
this.createSprite(id);
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
};
fireObj.prototype.alterMap = function () {
this.alterTiles(this.Xpos1, this.Ypos1, this.linkageID1);
this.alterTiles(this.Xpos2, this.Ypos2, this.linkageID2);
this.alterTiles(this.Xpos3, this.Ypos3, this.linkageID3);
};
fireObj.prototype.alterTiles = function (x, y, id) {
if (id == "fireHorizontal5") {
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
x++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
x++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
x++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
x++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
return(undefined);
}
if (id == "fireHorizontal4") {
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
x++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
x++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
x++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
return(undefined);
}
if (id == "fireHorizontal3") {
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
x++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
x++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
return(undefined);
}
if (id == "fireHorizontal2") {
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
x++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
return(undefined);
}
if (id == "fireVertical5") {
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
y++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
y++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
y++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
y++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
return(undefined);
}
if (id == "fireVertical4") {
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
y++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
y++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
y++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
return(undefined);
}
if (id == "fireVertical3") {
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
y++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
y++;
this.alteredTiles.push([x, y, _map[y][x][1]]);
_map[y][x][1] = 1;
return(undefined);
}
};
fireObj.prototype.mainloop = function () {
this.currentMethod();
};
fireObj.prototype.onScreen = function () {
if ((--this.waitingCnt) > 0) {
return(undefined);
}
if (this.screenTest(this.Xpos1, this.Ypos1) == true) {
this.selectedCoords = 1;
this.resetPositon(this.linkageID1);
return(undefined);
}
if (this.screenTest(this.Xpos2, this.Ypos2) == true) {
this.selectedCoords = 2;
this.resetPositon(this.linkageID2);
return(undefined);
}
if (this.screenTest(this.Xpos3, this.Ypos3) == true) {
this.selectedCoords = 3;
this.resetPositon(this.linkageID3);
return(undefined);
}
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
};
fireObj.prototype.screenTest = function (x, y) {
if (x > xMapCoord) {
if (x < (xMapCoord + 18)) {
if (y > yMapCoord) {
if (y < (yMapCoord + 16)) {
this.xPos = x;
this.yPos = y;
return(true);
}
}
}
}
return(false);
};
fireObj.prototype.offScreen = function () {
if (this.sprite._visible == true) {
return(true);
}
if (!this.sprite.hitTest(spriteHitAreaFull)) {
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
return(false);
}
};
fireObj.prototype.handleSFX = function () {
if ((++this.sfxFlipFlip) == 3) {
this.sfxFlipFlip = 0;
var _local2 = getDistanceVolume(this.xPos + 2, this.yPos, 10);
if (_local2 <= 0) {
this.remove();
this.currentMethod = this.offScreen;
} else if (masterVolume != 0) {
this.fireSFX.setVolume(_local2);
this.fireSFX.setPan(getDistancePan(this.xPos));
} else {
this.fireSFX.setVolume(0);
}
} else if (this.sfxFlipFlip == 1) {
this.collisionCheck();
}
};
fireObj.prototype.collisionCheck = function () {
if (this.sprite.hitAreaMC.hitTest(player.hitAreaMC)) {
decreaseHealth();
}
};
function soldiersMainInit() {
soldierFunc = null;
if ((level < 3) || (level >= 5)) {
return(undefined);
}
activeSoldiers = new Array();
soldierFunc = soldiersMainLoop;
soldierInit();
}
function soldiersHouseKeeping() {
if (activeSoldiers.length == 0) {
return(undefined);
}
var _local2;
var _local1 = -1;
while (_local1++ , _local1 != activeSoldiers.length) {
_local2 = activeSoldiers[_local1];
_local2.destroy();
}
}
function soldiersMainLoop() {
xMapCoord = scroller.mapXPos - 18;
yMapCoord = scroller.mapYPos - 16;
var _local2;
var _local1 = -1;
while (_local1++ , _local1 != activeSoldiers.length) {
_local2 = activeSoldiers[_local1];
_local2.mainloop();
}
}
function pauseSoldiers() {
var _local2;
var _local1 = -1;
while (_local1++ , _local1 != activeSoldiers.length) {
_local2 = activeSoldiers[_local1];
_local2.pause();
}
}
function resumeSoldiers() {
var _local2;
var _local1 = -1;
while (_local1++ , _local1 != activeSoldiers.length) {
_local2 = activeSoldiers[_local1];
_local2.resume();
}
}
function soldierInit() {
var _local1 = -1;
var _local2;
var _local3 = soldierPositions[level - 3].length;
while (_local1++ , _local1 != _local3) {
_local2 = new soldierObj();
_local2.init(_local1, soldierPositions[level - 3][_local1]);
activeSoldiers.push(_local2);
}
}
function soldierObj() {
this.num = 0;
this.sprite = null;
this.xPos = 0;
this.yPos = 0;
this.Xpos1 = 0;
this.Ypos1 = 0;
this.Xpos2 = 0;
this.Ypos2 = 0;
this.Xpos3 = 0;
this.Ypos3 = 0;
this.selectedCoords = 0;
this.speed = 2;
this.destXpos = 0;
this.destYpos = 0;
this.currentDir = 0;
this.prevDir = 0;
this.scrollMoveCnt = 0;
(this.directionArray = "Up");
this.currentStatus = 0;
this.waitingCnt = 0;
this.currentMethod = null;
this.currentMethodStore = null;
this.targetSprite = null;
this.mapStorage = 0;
this.prevX = 0;
this.prevY = 0;
this.runningSFX = null;
}
soldierObj.prototype.init = function (num, positions) {
this.num = num;
this.Xpos1 = positions[0];
this.Ypos1 = positions[1];
this.Xpos2 = positions[2];
this.Ypos2 = positions[3];
this.Xpos3 = positions[4];
this.Ypos3 = positions[5];
this.createSprite();
this.runningSFX = new Sound(this.sprite);
this.runningSFX.attachSound("soldierRunningSFX");
this.waitingCnt = 0;
this.onScreen();
};
soldierObj.prototype.createSprite = function () {
this.sprite = spritePlayField.attachMovie("soldier", "soldier" + this.num, spritePlayField.getNextHighestDepth());
};
soldierObj.prototype.destroy = function () {
this.sprite.removeMovieClip();
this.sprite = null;
};
soldierObj.prototype.resetPositon = function (position) {
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.getRandomDirection();
};
soldierObj.prototype.getRandomDirection = function () {
var _local2 = int(Math.random() * 4);
this.currentDir = (this.prevDirection = this.directionArray[_local2]);
this.prevDir = 0;
this.stopAnimation();
this.scrollMoveCnt = 0;
};
soldierObj.prototype.mainloop = function () {
this.currentMethod();
};
soldierObj.prototype.onScreen = function () {
if ((--this.waitingCnt) > 0) {
return(undefined);
}
if (this.screenTest(this.Xpos1, this.Ypos1) == true) {
this.selectedCoords = 1;
this.arrivedOnTheMap();
return(undefined);
}
if (this.Xpos2 != null) {
if (this.screenTest(this.Xpos2, this.Ypos2) == true) {
this.selectedCoords = 2;
this.arrivedOnTheMap();
return(undefined);
}
} else {
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
return(undefined);
}
if (this.Xpos3 != null) {
if (this.screenTest(this.Xpos3, this.Ypos3) == true) {
this.selectedCoords = 3;
this.arrivedOnTheMap();
return(undefined);
}
}
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
};
soldierObj.prototype.arrivedOnTheMap = function () {
this.resetPositon();
this.getDestination();
this.currentMethod = this.getMovementDirection;
};
soldierObj.prototype.screenTest = function (x, y) {
if (x > xMapCoord) {
if (x < (xMapCoord + 18)) {
if (y > yMapCoord) {
if (y < (yMapCoord + 16)) {
this.xPos = x;
this.yPos = y;
return(true);
}
}
}
}
return(false);
};
soldierObj.prototype.offScreen = function () {
if (this.sprite._visible == true) {
return(true);
}
this.stopAnimation();
this.runningSFX.stop();
if (!this.sprite.hitTest(spriteHitAreaFull)) {
this["Xpos" + this.selectedCoords] = this.xPos;
this["Ypos" + this.selectedCoords] = this.yPos;
this.waitingCnt = 2 + (this.num % 2);
this.currentMethod = this.onScreen;
return(false);
}
};
soldierObj.prototype.getDestination = function () {
var _local12 = activeBaddies[0];
var _local5 = {x:_local12.xPos, y:_local12.yPos};
var _local11 = {x:this.xPos, y:this.yPos};
var _local2;
var _local3;
var _local4;
var _local6 = 100001 /* 0x0186A1 */;
var _local10 = activeBaddies.length;
var _local7 = 0;
while (_local7++ , _local7 != _local10) {
_local2 = activeBaddies[_local7];
if (_local2.type != "Fire") {
_local3 = {x:_local2.xPos, y:_local2.yPos};
_local4 = distanceCalc(_local11, _local3);
if (_local4 < _local6) {
_local5.x = _local3.x;
_local5.y = _local3.y;
this.targetSprite = _local2.sprite;
_local6 = _local4;
}
}
}
this.destXpos = _local5.x;
this.destYpos = _local5.y;
};
soldierObj.prototype.takingAShot = function () {
if (this.destXpos == this.xPos) {
if (this.destYpos < this.yPos) {
this.sprite.gotoAndStop("shootingUp");
} else {
this.sprite.gotoAndStop("shootingDown");
}
} else if (this.destXpos < this.xPos) {
this.sprite.gotoAndStop("shootingLeft");
} else {
this.sprite.gotoAndStop("shootingRight");
}
this.shotDelay = 0;
this.currentMethod = this.waitingToShoot;
};
soldierObj.prototype.waitingToShoot = function () {
if ((++this.shotDelay) == 4) {
this.sprite.gunFire._visible = true;
this.sprite.gunFire.gotoAndPlay(1);
var _local2 = new Sound(this.sprite);
_local2.attachSound("m16SFX");
var _local3 = getDistanceVolume(this.xPos, this.yPos, 10);
if (masterVolume != 0) {
_local2.setVolume(_local3);
_local2.setPan(getDistancePan(this.xPos));
} else {
_local2.setVolume(0);
}
_local2.start();
this.currentMethod = this.shootingEndedCheck;
}
};
soldierObj.prototype.shootingEndedCheck = function () {
if (this.sprite.gunFire._currentframe == this.sprite.gunFire._totalframes) {
this.getDestination();
this.currentMethod = this.getMovementDirection;
}
};
soldierObj.prototype.getMovementDirection = function () {
if (this.offScreen() == false) {
return(undefined);
}
var _local14 = Math.abs(this.destXpos - this.xPos);
var _local13 = Math.abs(this.destYpos - this.yPos);
if ((_local14 + _local13) < 7) {
if ((this.destXpos == this.xPos) || (this.destYpos == this.yPos)) {
if (this.losPass1() == true) {
this.takingAShot();
return(undefined);
}
}
}
this.getDestination();
var _local10 = getDistanceVolume(this.xPos, this.yPos, 20);
if (masterVolume != 0) {
this.runningSFX.setVolume(_local10);
this.runningSFX.setPan(getDistancePan(this.xPos));
} else {
this.runningSFX.setVolume(0);
}
this.runningSFX.start();
var _local3 = new Array(-1, -1, -1, -1);
var _local8 = new Array();
var _local16 = _map[this.yPos][this.xPos + 1][1];
if (_local16 == 0) {
if (this.prevDir != 1) {
_local3[0] = 0;
_local8.push(0);
}
}
var _local9 = _map[this.yPos][this.xPos - 1][1];
if (_local9 == 0) {
if (this.prevDir != 0) {
_local3[1] = 1;
_local8.push(1);
}
}
var _local12 = _map[this.yPos - 1][this.xPos][1];
if (_local12 == 0) {
if (this.prevDir != 3) {
_local3[2] = 2;
_local8.push(2);
}
}
var _local15 = _map[this.yPos + 1][this.xPos][1];
if (_local15 == 0) {
if (this.prevDir != 2) {
_local3[3] = 3;
_local8.push(3);
}
}
var _local7 = 101;
var _local6 = 101;
if (this.yPos < this.destYpos) {
_local6 = 3;
} else if (this.yPos > this.destYpos) {
_local6 = 2;
}
if (this.xPos > this.destXpos) {
_local7 = 1;
} else if (this.xPos < this.destXpos) {
_local7 = 0;
}
var _local4 = -1;
var _local2;
var _local5 = -1;
while (_local5++ , _local5 != _local3.length) {
_local2 = _local3[_local5];
if (_local2 == _local7) {
_local4 = _local2;
break;
}
if (_local2 == _local6) {
_local4 = _local2;
break;
}
}
if (_local4 == -1) {
_local4 = _local8[int(Math.random() * _local8.length)];
}
this.prevDir = _local4;
this.scrollMoveCnt = (32 / this.speed) - 1;
var _local11 = this["chosenDir" + _local4];
_local11(this);
};
soldierObj.prototype.chosenDir0 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Right") {
this.currentDir = (this.prevDirection = "Right");
}
this.sprite.gotoAndPlay("runningRight");
this.sprite._x = this.sprite._x + this.speed;
this.currentMethod = this.moveRight;
};
soldierObj.prototype.chosenDir1 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Left") {
this.currentDir = (this.prevDirection = "Left");
}
this.sprite.gotoAndPlay("runningLeft");
this.sprite._x = this.sprite._x - this.speed;
this.currentMethod = this.moveLeft;
};
soldierObj.prototype.chosenDir2 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Up") {
this.currentDir = (this.prevDirection = "Up");
}
this.sprite.gotoAndPlay("runningUp");
this.sprite._y = this.sprite._y - this.speed;
this.currentMethod = this.moveUp;
};
soldierObj.prototype.chosenDir3 = function (scope) {
this=scope;//parameter overwritten
if (this.prevDirection != "Down") {
this.currentDir = (this.prevDirection = "Down");
}
this.sprite.gotoAndPlay("runningDown");
this.sprite._y = this.sprite._y + this.speed;
this.currentMethod = this.moveDown;
};
soldierObj.prototype.moveRight = function () {
this.sprite._x = this.sprite._x + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos++;
this.currentMethod = this.getMovementDirection;
}
};
soldierObj.prototype.moveLeft = function () {
this.sprite._x = this.sprite._x - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.xPos--;
this.currentMethod = this.getMovementDirection;
}
};
soldierObj.prototype.moveUp = function () {
this.sprite._y = this.sprite._y - this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos--;
this.currentMethod = this.getMovementDirection;
}
};
soldierObj.prototype.moveDown = function () {
this.sprite._y = this.sprite._y + this.speed;
if ((--this.scrollMoveCnt) == 0) {
this.yPos++;
this.currentMethod = this.getMovementDirection;
}
};
soldierObj.prototype.stopAnimation = function () {
this.sprite.gotoAndStop(1);
this.sprite.anim.gotoAndStop(1);
};
soldierObj.prototype.losPass1 = function () {
if (this.destXpos > this.xPos) {
var _local2 = this.xPos - 1;
while (_local2++ , _local2 != (this.destXpos + 1)) {
if (_map[this.yPos][_local2][1] == 1) {
return(false);
}
}
} else {
var _local2 = this.destXpos - 1;
while (_local2++ , _local2 != (this.xPos + 1)) {
if (_map[this.yPos][_local2][1] == 1) {
return(false);
}
}
}
return(this.losPass2());
};
soldierObj.prototype.losPass2 = function () {
if (this.destYpos > this.yPos) {
var _local2 = this.yPos - 1;
while (_local2++ , _local2 != (this.destYpos + 1)) {
if (_map[_local2][this.yPos][1] == 1) {
return(false);
}
}
} else {
var _local2 = this.destYpos - 1;
while (_local2++ , _local2 != (this.yPos + 1)) {
if (_map[_local2][this.xPos][1] == 1) {
return(false);
}
}
}
return(true);
};
soldierObj.prototype.pause = function () {
this.sprite.gotoAndStop(this.sprite._currentframe);
this.sprite.anim.gotoAndStop(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndStop(this.sprite.shadowAnim._currentframe);
};
soldierObj.prototype.resume = function () {
if (this.sprite._visible == true) {
if (this.sprite._currentframe < 75) {
this.sprite.gotoAndPlay(this.sprite._currentframe);
this.sprite.anim.gotoAndPlay(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndPlay(this.sprite.shadowAnim._currentframe);
}
}
};
function objectInit() {
activeObjects = new Array();
tentalcesInit();
if (level == 1) {
collapsingBuildingInit();
crackInit();
} else if (level == 2) {
collapsingBuildingInit2();
crackInit();
} else if (level == 3) {
crackInit();
} else if (level == 4) {
toxicInit();
crackInit();
} else if (level == 5) {
crackInit();
}
}
function objectMainLoop() {
var _local2;
var _local1 = -1;
while (_local1++ , _local1 != activeObjects.length) {
_local2 = activeObjects[_local1];
_local2.mainloop();
}
}
function objectHouseKeeping() {
var _local1;
var _local2 = -1;
while (_local2++ , _local2 != activeObjects.length) {
_local1 = activeObjects[_local2];
if (_local1.name != "building") {
_local1.destroy();
} else if (level > 2) {
_local1.destroy();
}
}
}
function collapsingBuildingInit() {
building = new buildingObj();
building.init(64, 8);
collapsingBuildingInit2();
}
function collapsingBuildingInit2() {
activeObjects.push(building);
}
function buildingObj() {
this.name = "building";
this.sprite = null;
this.xPos = 0;
this.yPos = 0;
this.currentStatus = 0;
this.waitingCnt = 0;
this.fireSFX = null;
this.currentMethod = null;
}
buildingObj.prototype.init = function (xpos, ypos) {
this.xPos = xpos;
this.yPos = ypos;
this.createSprite();
this.fireSFX.setVolume(masterVolume);
};
buildingObj.prototype.createSprite = function () {
this.sprite = spritePlayField.attachMovie("building", "building", spritePlayField.getNextHighestDepth());
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.sprite.gotoAndStop(1);
};
buildingObj.prototype.destroy = function () {
this.fireSFX.stop();
this.sprite.removeMovieClip();
this.sprite = null;
};
buildingObj.prototype.mainloop = function () {
this.currentMethod();
};
buildingObj.prototype.blownUp = function () {
this.fireSFX = new Sound(this.sprite);
this.fireSFX.attachSound("fireSFX");
this.fireSFX.start(0, 99999);
this.currentMethod = this.handleSFX;
};
buildingObj.prototype.handleSFX = function () {
var _local2 = getDistanceVolume(this.xPos + 5, this.yPos + 4, 10);
if (_local2 <= 0) {
this.destroy();
this.currentMethod = null;
return("dead");
}
if (masterVolume != 0) {
this.fireSFX.setVolume(_local2);
this.fireSFX.setPan(getDistancePan(this.xPos));
} else {
this.fireSFX.setVolume(0);
}
};
function toxicInit() {
var _local1 = -1;
var _local2;
var _local3 = toxicPositions[level - 4].length;
while (_local1++ , _local1 != _local3) {
_local2 = new toxicObj();
_local2.init(_local1, toxicPositions[level - 4][_local1]);
activeObjects.push(_local2);
}
}
function toxicObj() {
this.num = 0;
this.sprite = null;
this.frame = 1;
this.xPos = 0;
this.yPos = 0;
this.selectedCoords = 0;
this.currentStatus = 0;
this.sfx = null;
this.currentMethod = null;
}
toxicObj.prototype.init = function (num, positions) {
this.num = num;
this.xPos = positions[0];
this.yPos = positions[1];
this.frame = positions[2];
this.createSprite();
};
toxicObj.prototype.createSprite = function () {
this.sprite = spritePlayField.attachMovie("toxicWaste", "toxic" + this.num, spritePlayField.getNextHighestDepth());
this.sprite.gotoAndStop(this.frame);
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.currentMethod = this.collisionCheck;
};
toxicObj.prototype.destroy = function () {
this.sprite.removeMovieClip();
this.sprite = null;
};
toxicObj.prototype.mainloop = function () {
this.currentMethod();
};
toxicObj.prototype.collisionCheck = function () {
if (this.sprite._visible != true) {
return(undefined);
}
if (this.sprite.hitAreaMC.hitTest(player.hitAreaMC)) {
if (this.sfx == null) {
this.sfx = new Sound(this.sprite);
this.sfx.class = this;
this.sfx.attachSound("acidSFX");
this.sfx.setVolume(masterVolume);
this.sfx.start();
this.sfx.onSoundComplete = function () {
this=this.class;//parameter overwritten
this.class;
this.sfx = null;
};
}
decreaseHealth();
} else {
var _local3 = activeMates.length;
var _local2 = -1;
while (_local2++ , _local2 != _local3) {
obj = activeMates[_local2];
if (obj.currentStatus != 2) {
if (this.sprite.hitAreaMC.hitTest(obj.sprite.baddiehitAreaMC)) {
if (this.sfx == null) {
this.sfx = new Sound(this.sprite);
this.sfx.class = this;
this.sfx.attachSound("acidSFX");
this.sfx.setVolume(masterVolume);
this.sfx.start();
this.sfx.onSoundComplete = function () {
this=this.class;//parameter overwritten
this.class;
this.sfx = null;
};
}
obj.decreaseHealth();
break;
}
}
}
}
};
function tentalcesInit() {
var _local1 = -1;
var _local2;
var _local3 = tentaclePositions.length;
while (_local1++ , _local1 != _local3) {
_local2 = new tentaclesObj();
_local2.init(_local1, tentaclePositions[_local1]);
activeObjects.push(_local2);
}
}
function tentaclesObj() {
this.num = 0;
this.sprite = null;
this.frame = 1;
this.xPos = 0;
this.yPos = 0;
this.selectedCoords = 0;
this.currentStatus = 0;
this.sfx = null;
this.currentMethod = null;
}
tentaclesObj.prototype.init = function (num, positions) {
this.num = num;
this.xPos = positions[0];
this.yPos = positions[1];
this.frame = positions[2];
this.createSprite();
};
tentaclesObj.prototype.createSprite = function () {
this.sprite = spritePlayField.attachMovie("tentacle", "tentacles" + this.num, spritePlayField.getNextHighestDepth());
this.sprite.gotoAndStop(this.frame);
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.currentMethod = this.collisionCheck;
};
tentaclesObj.prototype.destroy = function () {
this.sprite.removeMovieClip();
this.sprite = null;
};
tentaclesObj.prototype.mainloop = function () {
this.currentMethod();
};
tentaclesObj.prototype.collisionCheck = function () {
if (this.sprite._visible != true) {
return(undefined);
}
if (this.sprite.hitAreaMC.hitTest(player.hitAreaMC)) {
decreaseHealth();
} else {
var _local3 = activeMates.length;
var _local2 = -1;
while (_local2++ , _local2 != _local3) {
obj = activeMates[_local2];
if (obj.currentStatus != 2) {
if (this.sprite.hitAreaMC.hitTest(obj.sprite.baddiehitAreaMC)) {
obj.decreaseHealth();
break;
}
}
}
}
};
function crackInit() {
var _local1 = -1;
var _local2;
var _local3 = crackPositions[level - 1].length;
while (_local1++ , _local1 != _local3) {
_local2 = new crackObj();
_local2.init(_local1, crackPositions[level - 1][_local1]);
activeObjects.push(_local2);
}
}
function crackObj() {
this.num = 0;
this.sprite = null;
this.linkageID = "";
this.xPos = 0;
this.yPos = 0;
this.xOffset = 0;
this.yOffset = 0;
this.selectedCoords = 0;
this.alteredTiles = new Array();
this.currentStatus = 0;
this.currentMethod = null;
}
crackObj.prototype.init = function (num, positions) {
this.num = num;
this.xOffset = (this.xPos = positions[0]);
this.yOffset = (this.yPos = positions[1]);
this.linkageID = positions[2];
this.createSprite();
};
crackObj.prototype.createSprite = function () {
this.sprite = spritePlayField.attachMovie(this.linkageID, "crack" + this.num, spritePlayField.getNextHighestDepth());
this.sprite.gotoAndStop(1);
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.currentMethod = this.collisionCheck;
};
crackObj.prototype.destroy = function () {
this.sprite.removeMovieClip();
this.sprite = null;
this.alterTiles();
this.alterTiles2();
};
crackObj.prototype.alterTiles = function () {
var _local3 = this.xPos;
var _local2 = this.yPos;
if (this.linkageID == "crackHorizontal") {
_map[_local2][_local3][1] = 1;
_local3++;
_map[_local2][_local3][1] = 1;
_local3++;
_map[_local2][_local3][1] = 1;
this.xOffset++;
return(undefined);
}
if (this.linkageID == "crackVertical") {
_map[_local2][_local3][1] = 1;
_local2++;
_map[_local2][_local3][1] = 1;
_local2++;
_map[_local2][_local3][1] = 1;
this.yOffset++;
}
if (this.linkageID == "crackVertical4") {
_map[_local2][_local3][1] = 1;
_local2++;
_map[_local2][_local3][1] = 1;
_local2++;
_map[_local2][_local3][1] = 1;
_local2++;
_map[_local2][_local3][1] = 1;
this.yOffset = this.yOffset + 2;
}
};
crackObj.prototype.alterTiles2 = function () {
var _local3 = this.xPos;
var _local2 = this.yPos;
if (this.linkageID == "crackHorizontal") {
_map[_local2][_local3][0] = 184;
_local3++;
_map[_local2][_local3][0] = 185;
_local3++;
_map[_local2][_local3][0] = 186;
return(undefined);
}
if (this.linkageID == "crackVertical") {
_map[_local2][_local3][0] = 151;
_local2++;
_map[_local2][_local3][0] = 176;
_local2++;
_map[_local2][_local3][0] = 201;
}
if (this.linkageID == "crackVertical4") {
_map[_local2][_local3][0] = 151;
_local2++;
_map[_local2][_local3][0] = 176;
_local2++;
_map[_local2][_local3][0] = 176;
_local2++;
_map[_local2][_local3][0] = 201;
}
};
crackObj.prototype.mainloop = function () {
this.currentMethod();
};
crackObj.prototype.collisionCheck = function () {
if (this.currentStatus == 1) {
return(undefined);
}
if (this.sprite._visible != true) {
return(undefined);
}
if (this.sprite.hitAreaMC.hitTest(player.hitAreaMC)) {
this.currentStatus = 1;
this.alterTiles();
this.sprite.gotoAndPlay(2);
if (masterVolume != 0) {
var _local2 = new Sound(this.sprite);
_local2.attachSound("roofExplosionSFX");
_local2.setVolume(getDistanceVolume(xCoord, yCoord));
_local2.setPan(getDistancePan(xCoord));
_local2.start();
}
this.currentMethod = this.waitingForAnimToFinish;
}
};
crackObj.prototype.triggerRubble = function () {
var _local3 = topSpritePlayField.getNextHighestDepth();
var _local2;
var _local4 = -1;
while (_local4++ , _local4 != 4) {
_local2 = topSpritePlayField.attachMovie("rubbleParticle", "rub" + _local3, _local3++);
_local2._x = (this.xPos + this.xOffset) * 32;
_local2._y = (this.yPos + this.yOffset) * 32;
}
};
crackObj.prototype.waitingForAnimToFinish = function () {
if (this.sprite._currentframe == this.sprite._totalframes) {
this.alterTiles2();
this.currentMethod = null;
} else if (this.sprite._currentframe == 3) {
this.triggerRubble();
}
};
function setPieceInit() {
setPieceFunc = null;
if (level == 2) {
if (jeffStatus == true) {
setPieceFunc = luckyEscape;
}
} else if (level == 6) {
setPieceFunc = satDown;
}
}
function drawTheBlinds() {
delete this.onEnterFrame;
stopPlayerAnimating();
filmBorders._visible = true;
filmBorders.gotoAndPlay(1);
filmBorders.onEnterFrame = function () {
if (this.animFlag == true) {
delete this.onEnterFrame;
filmCallBack();
}
};
}
function openTheBlinds() {
var animHolder = highestSpritePlayField.animFadeCover;
if (animHolder != undefined) {
animHolder.gotoAndPlay("out");
this.onEnterFrame = function () {
if (animHolder._currentframe == animHolder._totalframes) {
animHolder.removeMovieClip();
var delay = 0;
this.onEnterFrame = function () {
if ((++delay) == frameRate) {
delete this.onEnterFrame;
openTheBlinds();
}
};
}
};
return(undefined);
}
filmBorders.gotoAndPlay("out");
filmBorders.onEnterFrame = function () {
if (this._currentframe == this._totalframes) {
delete this.onEnterFrame;
filmBorders._visible = false;
filmBorders.gotoAndStop(1);
filmCallBack();
}
};
}
function satDown() {
if (playerXPos < 150) {
pauseBaddies();
pauseMates();
pauseMeteorites();
filmCallBack = satAnimInit;
drawTheBlinds();
return(true);
}
}
function satAnimInit() {
backgroundSFX.stop();
var animHolder = highestSpritePlayField.attachMovie("satHitAnim", "satHitAnim", highestSpritePlayField.getNextHighestDepth());
var _local2 = {x:highestSpritePlayFieldHolder._x, y:highestSpritePlayFieldHolder._y};
highestSpritePlayField.globalToLocal(_local2);
animHolder._x = _local2.x + 209;
animHolder._y = _local2.y + 144;
this.onEnterFrame = function () {
if (animHolder._currentframe == animHolder._totalframes) {
delete this.onEnterFrame;
animHolder.removeMovieClip();
filmCallBack = satAnimDone;
backgroundSFX.start(0, 999999);
sfxHandler.startSFX();
openTheBlinds();
}
};
}
function satAnimDone() {
resumeBaddies();
setPieceFunc = null;
this.onEnterFrame = master;
}
function luckyEscape() {
var _local1 = activeMates[0];
if (_local1.xPos >= 71) {
matesHouseKeeping();
filmCallBack = collapseTheBuildingInit;
drawTheBlinds();
return(true);
}
}
function killJeff() {
jeffStatus = false;
filmCallBack = collapseTheBuildingInit;
drawTheBlinds();
}
function collapseTheBuildingInit() {
this.onEnterFrame = scrollTowardsBuilding;
}
function scrollTowardsBuilding() {
var _local3 = building.xPos - 5;
var _local6 = building.yPos - 2;
var _local4 = scroller.mapXPos - 14;
var _local5 = scroller.mapYPos - 11;
var _local9 = {x:_local3, y:_local6};
var _local8 = {x:_local4, y:_local5};
var _local7 = distanceCalc(_local9, _local8);
var _local2 = 6;
if (_local7 > 10) {
_local2 = 8;
} else if (_local7 < 4) {
_local2 = 4;
}
if (_local4 < _local3) {
scroller.scrollRight(_local2);
spritePlayField._x = spritePlayField._x - _local2;
topSpritePlayField._x = topSpritePlayField._x - _local2;
player._x = player._x - _local2;
if (_local4 > _local3) {
scroller.scrollLeft(1);
spritePlayField._x++;
topSpritePlayField._x++;
player._x++;
}
} else if (_local4 > _local3) {
scroller.scrollLeft(_local2);
spritePlayField._x = spritePlayField._x + _local2;
topSpritePlayField._x = topSpritePlayField._x + _local2;
player._x = player._x + _local2;
if (_local4 < _local3) {
scroller.scrollRight(1);
spritePlayField._x--;
topSpritePlayField._x--;
player._x--;
}
}
if (_local5 < _local6) {
scroller.scrollDown(_local2);
spritePlayField._y = spritePlayField._y - _local2;
topSpritePlayField._y = topSpritePlayField._y - _local2;
player._y = player._y - _local2;
} else if (_local5 > _local6) {
scroller.scrollUp(_local2);
spritePlayField._y = spritePlayField._y + _local2;
topSpritePlayField._y = topSpritePlayField._y + _local2;
player._y = player._y + _local2;
}
artBasedHandler();
if ((_local5 == _local6) && (_local4 == _local3)) {
building.sprite.gotoAndPlay(2);
this.onEnterFrame = waitingForBuildingCollapseToFinish;
}
}
function waitingForBuildingCollapseToFinish() {
if (building.sprite._currentframe == building.sprite._totalframes) {
filmCallBack = collapseTheBuildingDone;
this.onEnterFrame = scrollTowardsPlayer;
} else if (jeffStatus == false) {
if (building.sprite._currentframe == 11) {
targetHouseKeeping();
}
}
}
function scrollTowardsPlayer() {
var _local8 = playerXPos;
var _local7 = playerYPos;
var _local9 = scroller.mapXPos;
var _local4 = scroller.mapYPos;
var _local6 = {x:_local8, y:_local7};
var _local5 = {x:_local9, y:_local4};
var _local3 = distanceCalc(_local6, _local5);
var _local10 = highestSpritePlayField.animFadeCover;
if (_local10 != undefined) {
var _local2 = 32;
} else {
var _local2 = 6;
if (_local3 > 10) {
_local2 = 8;
} else if (_local3 < 4) {
_local2 = 4;
}
}
if (player._x > 286) {
scroller.scrollRight(_local2);
spritePlayField._x = spritePlayField._x - _local2;
player._x = player._x - _local2;
topSpritePlayField._x = topSpritePlayField._x - _local2;
if (player._x < 286) {
scroller.scrollLeft(286 - player._x);
spritePlayField._x = spritePlayField._x + (286 - player._x);
topSpritePlayField._x = topSpritePlayField._x + (286 - player._x);
player._x = player._x + (286 - player._x);
}
} else if (player._x < 286) {
scroller.scrollLeft(_local2);
spritePlayField._x = spritePlayField._x + _local2;
topSpritePlayField._x = topSpritePlayField._x + _local2;
player._x = player._x + _local2;
if (player._x > 286) {
scroller.scrollRight(player._x - 286);
spritePlayField._x = spritePlayField._x - (player._x - 286);
topSpritePlayField._x = topSpritePlayField._x - (player._x - 286);
player._x = player._x - (player._x - 286);
}
}
if (player._y > 189) {
scroller.scrollDown(_local2);
spritePlayField._y = spritePlayField._y - _local2;
topSpritePlayField._y = topSpritePlayField._y - _local2;
player._y = player._y - _local2;
if (player._y < 189) {
scroller.scrollUp(189 - player._y);
spritePlayField._y = spritePlayField._y + (189 - player._y);
topSpritePlayField._y = topSpritePlayField._y + (189 - player._y);
player._y = player._y + (189 - player._y);
}
} else if (player._y < 189) {
scroller.scrollUp(_local2);
spritePlayField._y = spritePlayField._y + _local2;
topSpritePlayField._y = topSpritePlayField._y + _local2;
player._y = player._y + _local2;
if (player._y > 189) {
scroller.scrollDown(player._y - 189);
spritePlayField._y = spritePlayField._y - (player._y - 189);
topSpritePlayField._y = topSpritePlayField._y - (player._y - 189);
player._y = player._y - (player._y - 189);
}
}
artBasedHandler();
if ((player._y == 189) && (player._x == 286)) {
delete this.onEnterFrame;
openTheBlinds();
}
}
function collapseTheBuildingDone() {
setPieceFunc = null;
if (jeffStatus == false) {
displayFailedMessage();
} else {
this.onEnterFrame = master;
}
}
function killPete() {
peteStatus = false;
pauseBaddies();
pauseMates();
filmCallBack = scrollTowardsDeadMateInit;
drawTheBlinds();
}
function scrollTowardsDeadMateInit() {
var animHolder = highestSpritePlayField.attachMovie("animFadeCover", "animFadeCover", highestSpritePlayField.getNextHighestDepth());
var _local2 = {x:highestSpritePlayFieldHolder._x, y:highestSpritePlayFieldHolder._y};
highestSpritePlayField.globalToLocal(_local2);
animHolder._x = _local2.x + 209;
animHolder._y = _local2.y + 144;
this.onEnterFrame = function () {
if (animHolder.animFlag == true) {
this.onEnterFrame = scrollTowardsDeadMate;
}
};
}
function scrollTowardsDeadMate() {
var _local3 = targetX - 7;
var _local6 = targetY - 5;
var _local4 = scroller.mapXPos - 14;
var _local5 = scroller.mapYPos - 11;
var _local8 = {x:_local3, y:_local6};
var _local7 = {x:_local4, y:_local5};
var _local11 = distanceCalc(_local8, _local7);
var _local2 = 32;
if (_local4 < _local3) {
scroller.scrollRight(_local2);
spritePlayField._x = spritePlayField._x - _local2;
player._x = player._x - _local2;
topSpritePlayField._x = topSpritePlayField._x - _local2;
if (_local4 > _local3) {
scroller.scrollLeft(1);
spritePlayField._x++;
player._x++;
topSpritePlayField._x++;
}
} else if (_local4 > _local3) {
scroller.scrollLeft(_local2);
spritePlayField._x = spritePlayField._x + _local2;
topSpritePlayField._x = topSpritePlayField._x + _local2;
player._x = player._x + _local2;
if (_local4 < _local3) {
scroller.scrollRight(1);
spritePlayField._x--;
player._x--;
topSpritePlayField._x--;
}
}
if (_local5 < _local6) {
scroller.scrollDown(_local2);
spritePlayField._y = spritePlayField._y - _local2;
player._y = player._y - _local2;
topSpritePlayField._y = topSpritePlayField._y - _local2;
} else if (_local5 > _local6) {
scroller.scrollUp(_local2);
spritePlayField._y = spritePlayField._y + _local2;
player._y = player._y + _local2;
topSpritePlayField._y = topSpritePlayField._y + _local2;
}
if ((_local5 == _local6) && (_local4 == _local3)) {
delete this.onEnterFrame;
artBasedHandler();
if (level == 2) {
fadePeteBackUp();
} else if (level == 3) {
fadeJohnBackUp();
} else if (level == 4) {
fadeGFBackUp();
}
}
}
function fadePeteBackUp() {
forceBaddiesOnScreen();
var obj;
zombies101 = new Array();
obj = new zombieObj();
obj.setPieceFlag = true;
obj.init(101, [17, 61]);
zombies101.push(obj);
obj = new zombieObj();
obj.setPieceFlag = true;
obj.init(102, [18, 62]);
zombies101.push(obj);
obj = new zombieObj();
obj.setPieceFlag = true;
obj.init(103, [18, 59]);
zombies101.push(obj);
obj = new zombieObj();
obj.setPieceFlag = true;
obj.init(104, [20, 59]);
zombies101.push(obj);
var animHolder = highestSpritePlayField.animFadeCover;
animHolder.gotoAndPlay("out");
var zombieAttackCnt = 0;
this.onEnterFrame = function () {
if (animHolder._currentframe == animHolder._totalframes) {
animHolder.animFlag = false;
this.onEnterFrame = function () {
var _local2 = -1;
while (_local2++ , _local2 != zombies101.length) {
obj = zombies101[_local2];
obj.currentMethod();
}
if ((++zombieAttackCnt) == 50) {
animHolder.gotoAndPlay(1);
} else if (zombieAttackCnt == 20) {
var _local3 = new Sound(this);
_local3.attachSound("mateEatenSFX");
_local3.setVolume(masterVolume);
_local3.start();
}
if (animHolder.animFlag == true) {
delete this.onEnterFrame;
peteBeenEaten();
}
};
}
};
}
function peteBeenEaten() {
var _local2 = -1;
while (_local2++ , _local2 != zombies101.length) {
obj = zombies101[_local2];
obj.destroy();
}
filmCallBack = displayFailedMessage;
this.onEnterFrame = scrollTowardsPlayer;
}
function killJohn() {
johnStatus = false;
pauseBaddies();
pauseMates();
filmCallBack = scrollTowardsDeadMateInit;
drawTheBlinds();
}
function fadeJohnBackUp() {
forceBaddiesOnScreen();
var animHolder = highestSpritePlayField.animFadeCover;
animHolder.gotoAndPlay("out");
this.onEnterFrame = function () {
if (animHolder._currentframe == animHolder._totalframes) {
animHolder.animFlag = false;
delete this.onEnterFrame;
johnAboutToBeEaten();
}
};
}
function johnAboutToBeEaten() {
var spiderMC = spritePlayField.attachMovie("spider", "johnsDead", spritePlayField.getNextHighestDepth());
spiderMC._x = (targetX - 10) * 32;
spiderMC._y = targetY * 32;
var _local2 = new Sound(this);
_local2.attachSound("spiderAwakeSFX");
_local2.setVolume(masterVolume);
_local2.start();
var animHolder = highestSpritePlayField.animFadeCover;
this.onEnterFrame = function () {
spiderMC._x = spiderMC._x + 8;
if (spiderMC._x == 3544) {
animHolder.gotoAndPlay(1);
var _local2 = new Sound(this);
_local2.attachSound("mateEatenSFX");
_local2.setVolume(masterVolume);
_local2.start();
this.onEnterFrame = function () {
spiderMC._x = spiderMC._x + 8;
if (animHolder.animFlag == true) {
spiderMC.removeMovieClip();
delete this.onEnterFrame;
johnBeenEaten();
}
};
}
};
}
function johnBeenEaten() {
filmCallBack = displayFailedMessage;
this.onEnterFrame = scrollTowardsPlayer;
}
function killGF() {
gfStatus = false;
pauseBaddies();
pauseMates();
filmCallBack = scrollTowardsDeadMateInit;
drawTheBlinds();
}
function fadeGFBackUp() {
forceBaddiesOnScreen();
var animHolder = highestSpritePlayField.animFadeCover;
animHolder.gotoAndPlay("out");
this.onEnterFrame = function () {
if (animHolder._currentframe == animHolder._totalframes) {
animHolder.animFlag = false;
delete this.onEnterFrame;
gfAboutToBeAbducted();
}
};
}
function gfAboutToBeAbducted() {
var ufoMC = spritePlayField.attachMovie("ufoTween", "ufoTween", spritePlayField.getNextHighestDepth());
ufoMC._x = (targetX - 1) * 32;
ufoMC._y = (targetY - 1) * 32;
var animHolder = highestSpritePlayField.animFadeCover;
var sfx = new Sound(ufoMC);
sfx.attachSound("ufoSFX");
sfx.setVolume(masterVolume);
sfx.start(0, 99999);
this.onEnterFrame = function () {
if (ufoMC._currentframe == ufoMC._totalframes) {
animHolder.gotoAndPlay(1);
this.onEnterFrame = function () {
if (animHolder.animFlag == true) {
sfx.stop();
ufoMC.removeMovieClip();
delete this.onEnterFrame;
gfBeenAbducted();
}
};
} else if (ufoMC._currentframe == 55) {
var _local2 = new Sound(ufoMC);
_local2.attachSound("teleportSFX");
_local2.setVolume(masterVolume);
_local2.start();
}
};
}
function gfBeenAbducted() {
filmCallBack = displayFailedMessage;
this.onEnterFrame = scrollTowardsPlayer;
}
function meteoriteInit() {
meteoriteDelay = int(Math.random() * 96) + 31;
meteoriteDelayMaster = 20;
activeMeteorites = new Array();
}
function meteoriteHandler() {
var _local3;
if ((--meteoriteDelay) <= 0) {
meteoriteDelay = meteoriteDelayMaster;
_local3 = new meteoriteObj();
_local3.init(activeMeteorites.length);
activeMeteorites.push(_local3);
}
var _local2 = activeMeteorites.length;
var _local1 = -1;
while (_local1++ , _local1 != _local2) {
_local3 = activeMeteorites[_local1];
if (_local3.mainloop() == "dead") {
delete activeMeteorites[_local1];
activeMeteorites.splice(_local1, 1);
if ((_local1 + 1) >= _local2) {
break;
}
_local2--;
}
}
}
function meteoriteHouseKeeping() {
var _local2;
var _local3 = activeMeteorites.length;
var _local1 = -1;
while (_local1++ , _local1 != _local3) {
_local2 = activeMeteorites[_local1];
_local2.destroy();
}
}
function pauseMeteorites() {
var _local2;
var _local3 = activeMeteorites.length;
var _local1 = -1;
while (_local1++ , _local1 != _local3) {
_local2 = activeMeteorites[_local1];
_local2.pause();
}
}
function resumeMeteorites() {
var _local2;
var _local3 = activeMeteorites.length;
var _local1 = -1;
while (_local1++ , _local1 != _local3) {
_local2 = activeMeteorites[_local1];
_local2.resume();
}
}
function meteoriteObj() {
this.name = "meteorite";
this.num = 0;
this.sprite = null;
this.xPos = 0;
this.yPos = 0;
this.friction = 0.98;
this.currentStatus = 0;
this.currentMethod = null;
}
meteoriteObj.prototype.init = function (numArg) {
this.num = numArg;
var _local7 = int(Math.random() * 10);
var _local5 = int(Math.random() * 10);
if (_local7 < 5) {
this.xPos = (scroller.mapXPos + 2) - int(Math.random() * 18);
if (_local5 < 5) {
this.yPos = scroller.mapYPos + 2;
} else {
this.yPos = scroller.mapYPos - 14;
}
} else {
this.yPos = (scroller.mapYPos + 2) - int(Math.random() * 16);
if (_local5 < 5) {
this.xPos = scroller.mapXPos + 2;
} else {
this.xPos = scroller.mapXPos - 16;
}
}
this.createSprite();
var _local3 = playerXPos;
var _local2 = playerYPos;
if (playerDirection == "Left") {
_local3 = _local3 - 4;
} else if (playerDirection == "Right") {
_local3 = _local3 + 4;
} else if (playerDirection == "Up") {
_local2 = _local2 - 4;
} else {
_local2 = _local2 + 4;
}
var _local6 = Math.atan2(_local2 - this.yPos, _local3 - this.xPos);
var _local4 = int(Math.random() * 4) + 5;
this.xMove = _local4 * Math.cos(_local6);
this.yMove = _local4 * Math.sin(_local6);
if (this.bigRock == true) {
this.currentMethod = this.moveBigRock;
} else {
this.currentMethod = this.moveRock;
}
};
meteoriteObj.prototype.createSprite = function () {
var _local4 = int(Math.random() * 20);
if (_local4 < 3) {
this.bigRock = true;
this.bigRockDelay = frameRate * 2;
this.sprite = highestSpritePlayField.attachMovie("medRock", "mrock" + this.num, highestSpritePlayField.getNextHighestDepth());
var _local3 = new flash.filters.BlurFilter(4, 4, 1);
var _local2 = new Array();
_local2.push(_local3);
this.sprite.filters = _local2;
} else {
this.sprite = topSpritePlayField.attachMovie("smallRock", "srock" + this.num, topSpritePlayField.getNextHighestDepth());
}
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
this.sprite._xscale = (this.sprite._yscale = 200);
this.sprite._rotation = int(Math.random() * 360);
};
meteoriteObj.prototype.destroy = function () {
this.sprite.removeMovieClip();
this.sprite = null;
};
meteoriteObj.prototype.mainloop = function () {
this.currentMethod();
};
meteoriteObj.prototype.moveRock = function () {
this.sprite._x = this.sprite._x + this.xMove;
this.sprite._y = this.sprite._y + this.yMove;
this.sprite._xscale = this.sprite._xscale * this.friction;
this.sprite._yscale = this.sprite._yscale * this.friction;
this.xPos = int(this.sprite._x / 32);
this.yPos = int(this.sprite._y / 32);
if (_map[this.yPos][this.xPos][1] > 1) {
var _local2 = 70;
} else {
var _local2 = 30;
}
if (this.sprite._xscale < _local2) {
this.explode();
this.destroy();
if (this.currentMethod == null) {
return("dead");
}
}
};
meteoriteObj.prototype.moveBigRock = function () {
this.sprite._x = this.sprite._x + this.xMove;
this.sprite._y = this.sprite._y + this.yMove;
if ((--this.bigRockDelay) <= 0) {
if (this.sprite._visible == false) {
this.destroy();
return("dead");
}
}
};
meteoriteObj.prototype.explode = function () {
if (this.sprite._visible == false) {
this.currentMethod = null;
return(undefined);
}
if (_map[this.yPos][this.xPos][1] != 0) {
this.currentMethod = null;
} else {
this.hitTestCnt = 0;
this.currentMethod = this.collisionChecks;
}
var _local3 = topSpritePlayField.getNextHighestDepth();
this.explosionSprite = topSpritePlayField.attachMovie("explosion2", "rexp" + _local3, _local3);
this.explosionSprite._xscale = (this.explosionSprite._yscale = 200);
this.explosionSprite._x = this.sprite._x;
this.explosionSprite._y = this.sprite._y;
if (masterVolume != 100) {
return(undefined);
}
var _local2 = new Sound(mc);
_local2.attachSound("roofExplosionSFX");
_local2.setVolume(getDistanceVolume(xCoord, yCoord));
_local2.setPan(getDistancePan(xCoord));
_local2.start();
};
meteoriteObj.prototype.collisionChecks = function () {
if (this.explosionSprite._currentframe == this.explosionSprite._totalframes) {
return("dead");
}
if (this.explosionSprite.hitAreaMC == undefined) {
return(undefined);
}
if ((++this.hitTestCnt) == 1) {
this.testAgainstPlayer();
} else {
this.testAgainstMate();
}
};
meteoriteObj.prototype.testAgainstPlayer = function () {
if (this.explosionSprite.hitAreaMC.hitTest(player.baddiehitAreaMC)) {
decreaseHealth(2);
}
};
meteoriteObj.prototype.testAgainstMate = function () {
if ((activeMates.length == 0) || (this.hitTestCnt == activeMates.length)) {
this.hitTestCnt = 0;
return(undefined);
}
var _local2 = activeMates[this.hitTestCnt - 2];
if (_local2.currentStatus != 2) {
if (this.explosionSprite.hitAreaMC.hitTest(_local2.sprite.baddiehitAreaMC)) {
_local2.decreaseHealth();
}
}
};
meteoriteObj.prototype.pause = function () {
this.sprite.gotoAndStop(this.sprite._currentframe);
this.sprite.anim.gotoAndStop(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndStop(this.sprite.shadowAnim._currentframe);
};
meteoriteObj.prototype.resume = function () {
if (this.sprite._visible == true) {
this.sprite.gotoAndPlay(this.sprite._currentframe);
this.sprite.anim.gotoAndPlay(this.sprite.anim._currentframe);
this.sprite.shadowAnim.gotoAndPlay(this.sprite.shadowAnim._currentframe);
}
};
function ufoInit() {
ufoDelay = (int(Math.random() * 5) + 5) * 31;
activeUFOs = new Array();
}
function ufoHandler() {
var _local3;
if ((--ufoDelay) <= 0) {
ufoDelay = (int(Math.random() * 5) + 5) * 31;
_local3 = new ufoObj();
_local3.init(activeUFOs.length);
activeUFOs.push(_local3);
}
var _local2 = activeUFOs.length;
var _local1 = -1;
while (_local1++ , _local1 != _local2) {
_local3 = activeUFOs[_local1];
if (_local3.mainloop() == "dead") {
delete activeUFOs[_local1];
activeUFOs.splice(_local1, 1);
if ((_local1 + 1) >= _local2) {
break;
}
_local2--;
}
}
}
function ufoHouseKeeping() {
var _local2;
var _local3 = activeUFOs.length;
var _local1 = -1;
while (_local1++ , _local1 != _local3) {
_local2 = activeUFOs[_local1];
_local2.destroy();
}
}
function pauseUFOs() {
var _local2;
var _local3 = activeUFOs.length;
var _local1 = -1;
while (_local1++ , _local1 != _local3) {
_local2 = activeUFOs[_local1];
_local2.pause();
}
}
function resumeUFOs() {
var _local2;
var _local3 = activeUFOs.length;
var _local1 = -1;
while (_local1++ , _local1 != _local3) {
_local2 = activeUFOs[_local1];
_local2.resume();
}
}
function ufoObj() {
this.name = "ufo";
this.num = 0;
this.sprite = null;
this.xPos = 0;
this.yPos = 0;
this.currentStatus = 0;
this.currentMethod = null;
}
ufoObj.prototype.init = function (numArg) {
this.num = numArg;
var _local7 = int(Math.random() * 10);
var _local5 = int(Math.random() * 10);
if (_local7 < 5) {
this.xPos = (scroller.mapXPos + 2) - int(Math.random() * 18);
if (_local5 < 5) {
this.yPos = scroller.mapYPos + 2;
} else {
this.yPos = scroller.mapYPos - 14;
}
} else {
this.yPos = (scroller.mapYPos + 2) - int(Math.random() * 16);
if (_local5 < 5) {
this.xPos = scroller.mapXPos + 2;
} else {
this.xPos = scroller.mapXPos - 16;
}
}
this.createSprite();
var _local3 = playerXPos;
var _local2 = playerYPos;
if (playerDirection == "Left") {
_local3 = _local3 - 4;
} else if (playerDirection == "Right") {
_local3 = _local3 + 4;
} else if (playerDirection == "Up") {
_local2 = _local2 - 4;
} else {
_local2 = _local2 + 4;
}
var _local6 = Math.atan2(_local2 - this.yPos, _local3 - this.xPos);
var _local4 = int(Math.random() * 4) + 5;
this.xMove = _local4 * Math.cos(_local6);
this.yMove = _local4 * Math.sin(_local6);
this.ufoSFX = new Sound(this.sprite);
this.ufoSFX.attachSound("ufoSFX");
this.ufoSFX.setVolume(masterVolume);
this.ufoSFX.start(0, 99999);
this.currentMethod = this.moveUFO;
};
ufoObj.prototype.createSprite = function () {
var _local2 = int(Math.random() * 20);
this.bigRockDelay = frameRate * 2;
this.sprite = highestSpritePlayField.attachMovie("ufo", "ufo" + this.num, highestSpritePlayField.getNextHighestDepth());
this.sprite._x = this.xPos * 32;
this.sprite._y = this.yPos * 32;
};
ufoObj.prototype.destroy = function () {
this.ufoSFX.stop();
this.sprite.removeMovieClip();
this.sprite = null;
};
ufoObj.prototype.mainloop = function () {
this.currentMethod();
};
ufoObj.prototype.moveUFO = function () {
this.sprite._x = this.sprite._x + this.xMove;
this.sprite._y = this.sprite._y + this.yMove;
if ((--this.bigRockDelay) <= 0) {
if (this.sprite._visible == false) {
this.destroy();
return("dead");
}
}
this.xPos = int(this.sprite._x / 32);
this.yPos = int(this.sprite._y / 32);
var _local2 = getDistanceVolume(this.xPos, this.yPos, 10);
if (_local2 <= 0) {
return(undefined);
}
if (masterVolume != 0) {
this.ufoSFX.setVolume(_local2);
this.ufoSFX.setPan(getDistancePan(this.xPos));
} else {
this.ufoSFX.setVolume(0);
}
};
ufoObj.prototype.pause = function () {
this.sprite.gotoAndStop(this.sprite._currentframe);
};
ufoObj.prototype.resume = function () {
if (this.sprite._visible == true) {
this.sprite.gotoAndPlay(this.sprite._currentframe);
}
};
function playerInit() {
playerXPos = playerStartPositions[level - 1][0];
playerYPos = playerStartPositions[level - 1][1];
playerDirection = "Down";
stopPlayerAnimating();
player.compass._rotation = 0;
player.compass._alpha = 100;
player.compass._visible = true;
player._visible = true;
playerSFX = null;
deadFlag = false;
horizontalAnimFlag = false;
var healthTarget;
if (level == 1) {
healthTarget = (health = 1);
} else if (health > 25) {
healthTarget = health - 25;
} else {
healthTarget = 1;
}
infoModule.healthBar.onEnterFrame = function () {
if (this._currentframe == healthTarget) {
delete this.onEnterFrame;
} else {
this.gotoAndStop(this._currentframe - 1);
}
};
playerInputFunc = playerInput;
}
function playerHouseKeeping() {
delete playerSFX.onSoundComplete;
playerSFX.stop();
}
function player_collected() {
stopPlayerAnimating();
}
function decreaseHealth(arg) {
var _local1 = arg;
if (_local1 == undefined) {
_local1 = 1;
}
health = health + _local1;
if (health >= 100) {
health = 100;
player.gotoAndStop("dead");
player.compass._visible = false;
playerInputFunc = null;
deadFlag = true;
}
infoModule.healthBar.gotoAndStop(health);
if (playerSFX == null) {
playerSFX = new Sound(player);
var _local2 = int(Math.random() * playerHurtSFX.length);
playerSFX.attachSound(playerHurtSFX[_local2]);
playerSFX.start();
playerSFX.onSoundComplete = function () {
playerSFX = null;
};
}
}
function playerMainLoop() {
playerInputFunc();
updateCompass();
return(playerCollectionCheck());
}
function updateCompass() {
player.compass._rotation = player.compass._rotation + rotateClips();
}
function playerInput() {
var _local1 = false;
verticalAnimFlag = false;
if (inkey(keyUP)) {
moveUp();
_local1 = (verticalAnimFlag = true);
} else if (inkey(87)) {
moveUp();
_local1 = (verticalAnimFlag = true);
} else if (inkey(keyDOWN)) {
moveDown();
_local1 = (verticalAnimFlag = true);
} else if (inkey(83)) {
moveDown();
_local1 = (verticalAnimFlag = true);
}
if (inkey(keyLEFT)) {
moveLeft();
_local1 = (horizontalAnimFlag = true);
} else if (inkey(65)) {
moveLeft();
_local1 = (horizontalAnimFlag = true);
} else if (inkey(keyRIGHT)) {
moveRight();
_local1 = (horizontalAnimFlag = true);
} else if (inkey(68)) {
moveRight();
_local1 = (horizontalAnimFlag = true);
} else {
horizontalAnimFlag = false;
}
if (_local1 == false) {
if (playerAnimFlag == true) {
if ((player.anim._currentframe == 16) || (player.anim._currentframe == 9)) {
footStepSFX.start();
stopPlayerAnimating();
} else {
autoMove();
}
}
} else if ((player.anim._currentframe == 16) || (player.anim._currentframe == 9)) {
footStepSFX.start();
}
if ((--keyPressDelay) <= 0) {
if (inkey(keyFIRE)) {
satNavInit();
return(undefined);
}
}
if (inkey(80)) {
keyPressDelay = 20;
pauseGame();
}
}
function autoMove() {
if (playerDirection == "Up") {
moveUp();
} else if (playerDirection == "Down") {
moveDown();
} else if (playerDirection == "Left") {
moveLeft();
} else {
moveRight();
}
}
function moveRight() {
if (verticalAnimFlag == false) {
if (playerDirection != "Right") {
playerDirection = "Right";
stopPlayerAnimating();
return(undefined);
}
if (playerAnimFlag == false) {
playerAnimFlag = true;
player.gotoAndStop("runningRight");
}
} else if (playerDirection == "Up") {
player.gotoAndPlay("runningUpRight");
} else {
player.gotoAndPlay("runningDownRight");
}
playerXPos = Math.abs(Math.round((playField.container._x - 212) / 32));
if ((playField.container._y % 32) == 0) {
playerYPos = Math.abs(Math.round((playField.container._y - 130) / 32));
var _local3 = _map[playerYPos][playerXPos][1];
if (_local3 == 0) {
scroller.scrollRight(scrollSpeed);
spritePlayField._x = spritePlayField._x - scrollSpeed;
topSpritePlayField._x = topSpritePlayField._x - scrollSpeed;
highestSpritePlayField._x = highestSpritePlayField._x - scrollSpeed;
}
} else {
var _local4 = Math.abs(Math.round((playField.container._y - 112) / 32));
var _local2 = Math.abs(Math.round((playField.container._y - 148) / 32));
var _local3 = _map[_local4][playerXPos][1];
var _local1 = _map[_local2][playerXPos][1];
if ((_local3 == 0) && (_local1 == 0)) {
scroller.scrollRight(scrollSpeed);
spritePlayField._x = spritePlayField._x - scrollSpeed;
topSpritePlayField._x = topSpritePlayField._x - scrollSpeed;
highestSpritePlayField._x = highestSpritePlayField._x - scrollSpeed;
}
}
}
function moveLeft() {
if (verticalAnimFlag == false) {
if (playerDirection != "Left") {
playerDirection = "Left";
stopPlayerAnimating();
return(undefined);
}
if (playerAnimFlag == false) {
playerAnimFlag = true;
player.gotoAndStop("runningLeft");
}
} else if (playerDirection == "Up") {
player.gotoAndPlay("runningUpLeft");
} else {
player.gotoAndPlay("runningDownLeft");
}
playerXPos = Math.abs(Math.round((playField.container._x - 176) / 32));
if ((playField.container._y % 32) == 0) {
playerYPos = Math.abs(Math.round((playField.container._y - 130) / 32));
var _local3 = _map[playerYPos][playerXPos][1];
if (_local3 == 0) {
scroller.scrollLeft(scrollSpeed);
spritePlayField._x = spritePlayField._x + scrollSpeed;
topSpritePlayField._x = topSpritePlayField._x + scrollSpeed;
highestSpritePlayField._x = highestSpritePlayField._x + scrollSpeed;
}
} else {
var _local4 = Math.abs(Math.round((playField.container._y - 112) / 32));
var _local2 = Math.abs(Math.round((playField.container._y - 148) / 32));
var _local3 = _map[_local4][playerXPos][1];
var _local1 = _map[_local2][playerXPos][1];
if ((_local3 == 0) && (_local1 == 0)) {
scroller.scrollLeft(scrollSpeed);
spritePlayField._x = spritePlayField._x + scrollSpeed;
topSpritePlayField._x = topSpritePlayField._x + scrollSpeed;
highestSpritePlayField._x = highestSpritePlayField._x + scrollSpeed;
}
}
}
function moveDown() {
if (playerDirection != "Down") {
playerDirection = "Down";
stopPlayerAnimating();
return(undefined);
}
if (playerAnimFlag == false) {
playerAnimFlag = true;
player.gotoAndStop("runningDown");
} else if (horizontalAnimFlag == false) {
if (player._currentframe >= 73) {
player.gotoAndPlay("runningDown");
}
}
playerYPos = Math.abs(Math.round((playField.container._y - 148) / 32));
if ((playField.container._x % 32) == 0) {
playerXPos = Math.abs(Math.round((playField.container._x - 180) / 32));
var _local2 = _map[playerYPos][playerXPos][1];
if (_local2 == 0) {
scroller.scrollDown(scrollSpeed);
spritePlayField._y = spritePlayField._y - scrollSpeed;
topSpritePlayField._y = topSpritePlayField._y - scrollSpeed;
highestSpritePlayField._y = highestSpritePlayField._y - scrollSpeed;
}
} else {
var _local3 = Math.abs(Math.round((playField.container._x - 212) / 32));
var _local4 = Math.abs(Math.round((playField.container._x - 176) / 32));
var _local2 = _map[playerYPos][_local3][1];
var _local1 = _map[playerYPos][_local4][1];
if ((_local2 == 0) && (_local1 == 0)) {
scroller.scrollDown(scrollSpeed);
spritePlayField._y = spritePlayField._y - scrollSpeed;
topSpritePlayField._y = topSpritePlayField._y - scrollSpeed;
highestSpritePlayField._y = highestSpritePlayField._y - scrollSpeed;
}
}
}
function moveUp() {
if (playerDirection != "Up") {
playerDirection = "Up";
stopPlayerAnimating();
return(undefined);
}
if (playerAnimFlag == false) {
playerAnimFlag = true;
player.gotoAndStop("runningUp");
} else if (horizontalAnimFlag == false) {
if (player._currentframe >= 73) {
player.gotoAndPlay("runningUp");
}
}
playerYPos = Math.abs(Math.round((playField.container._y - 112) / 32));
if ((playField.container._x % 32) == 0) {
playerXPos = Math.abs(Math.round((playField.container._x - 180) / 32));
var _local2 = _map[playerYPos][playerXPos][1];
if (_local2 == 0) {
scroller.scrollUp(scrollSpeed);
spritePlayField._y = spritePlayField._y + scrollSpeed;
topSpritePlayField._y = topSpritePlayField._y + scrollSpeed;
highestSpritePlayField._y = highestSpritePlayField._y + scrollSpeed;
}
} else {
var _local3 = Math.abs(Math.round((playField.container._x - 212) / 32));
var _local4 = Math.abs(Math.round((playField.container._x - 176) / 32));
var _local2 = _map[playerYPos][_local3][1];
var _local1 = _map[playerYPos][_local4][1];
if ((_local2 == 0) && (_local1 == 0)) {
scroller.scrollUp(scrollSpeed);
spritePlayField._y = spritePlayField._y + scrollSpeed;
topSpritePlayField._y = topSpritePlayField._y + scrollSpeed;
highestSpritePlayField._y = highestSpritePlayField._y + scrollSpeed;
}
}
}
function stopPlayerAnimating() {
playerAnimFlag = false;
if (playerDirection == "Left") {
player.gotoAndStop("standingLeft");
} else if (playerDirection == "Right") {
player.gotoAndStop("standingRight");
} else if (playerDirection == "Up") {
player.gotoAndStop("standingUp");
} else {
player.gotoAndStop("standingDown");
}
}
function pausePlayer() {
player.gotoAndStop(player._currentframe);
player.anim.gotoAndStop(player.anim._currentframe);
player.shadowAnim.gotoAndStop(player.shadowAnim._currentframe);
}
function resumePlayer() {
if (player._currentframe < 74) {
player.gotoAndPlay(player._currentframe);
player.anim.gotoAndPlay(player.anim._currentframe);
player.shadowAnim.gotoAndPlay(player.shadowAnim._currentframe);
}
}
function playerCollectionCheck() {
if (targetSprite._visible == false) {
return(false);
}
var _local4 = Math.abs(playerXPos - targetX);
var _local3 = Math.abs(playerYPos - targetY);
var _local2 = _local4 + _local3;
if (_local2 > 4) {
targetSprite.arrow._visible = true;
player.compass._visible = true;
targetSprite.arrow.onEnterFrame = function () {
if (this._alpha == 100) {
delete this.onEnterFrame;
} else {
this._alpha = this._alpha + 20;
player.compass._alpha = player.compass._alpha + 20;
if (this._alpha >= 100) {
this._alpha = 100;
player.compass._alpha = 100;
delete this.onEnterFrame;
}
}
if (this._currentframe == 1) {
this.gotoAndPlay(2);
}
};
} else {
targetSprite.arrow.onEnterFrame = function () {
if (this._alpha == 0) {
this.gotoAndStop(1);
this._visible = false;
delete this.onEnterFrame;
} else {
this._alpha = this._alpha - 20;
player.compass._alpha = player.compass._alpha - 20;
if (this._alpha <= 0) {
this._alpha = 0;
this.gotoAndStop(1);
this._visible = false;
player.compass._alpha = 0;
player.compass._visible = false;
delete this.onEnterFrame;
}
}
};
if (player.hitAreaMC.hitTest(targetSprite.hitAreaMC)) {
delete targetSprite.arrow.onEnterFrame;
targetSprite.arrow._visible = (player.compass._visible = false);
targetFound = true;
}
}
return(targetFound);
}
function satNavInit() {
delete this.onEnterFrame;
pausebaddies();
pauseMates();
satNavZoomer._visible = true;
satNavZoomer.gotoAndPlay(1);
satNavZoomer.onEnterFrame = function () {
if (this.animFlag == true) {
delete this.onEnterFrame;
satNav._visible = true;
calcSatNavMap();
}
};
}
function satNavPowerUp() {
satNav.anim.gotoAndPlay(1);
satNav.delay = 0;
satNavAnimHandlerFunc = waitingForSignal;
satNavInputFunc = null;
satNavQuitTestFunc = null;
this.onEnterFrame = satNavMainLoop;
}
function satNavHouseKeeping() {
satNav._visible = (satNavZoomer._visible = false);
}
function satNavMainLoop() {
satNavAnimHandlerFunc();
satNavInputFunc();
satNavQuitTestFunc();
handleTimer();
}
function waitingForSignal() {
if (satNav.delay == 25) {
var _local2 = new Sound(this);
_local2.attachSound("satNavJingleSFX");
_local2.setVolume(masterVolume);
_local2.start();
}
if ((++satNav.delay) == (frameRate * 2)) {
if ((level == 6) && (setPieceFunc == null)) {
satNav.delay = 0;
delete this.onEnterFrame;
errorTriggered();
return(undefined);
}
satNav.anim.nextFrame();
calculatePath();
} else if (satNav.delay == ((frameRate * 2) + 1)) {
plotPath();
} else if (satNav.delay == ((frameRate * 2) + 2)) {
plotSatNavMap();
} else if (satNav.delay == ((frameRate * 2) + 3)) {
plotLocationCursors();
} else if (satNav.delay == ((frameRate * 3) - 10)) {
satNav.anim.logo.gotoAndPlay("out");
} else if (satNav.delay == (frameRate * 3)) {
satNav.anim.nextFrame();
satNavInputFunc = satNavInput;
satNav.anim.mapHolder._visible = true;
} else if (satNav.delay == ((frameRate * 3) + 1)) {
satNavAnimHandlerFunc = null;
satNavQuitTestFunc = satNavQuitTest;
satNavButtonsInit();
}
}
function calcSatNavMap() {
_satMapAStar = [];
_satMap = [];
var _local8 = _map[0].length;
var _local9 = _map.length;
var _local6 = new Array();
var _local7 = new Array();
var _local5 = -1;
var _local4 = -1;
while (_local4++ , _local4 != _local9) {
_local5 = -1;
_local6 = new Array();
_local7 = new Array();
while (_local5++ , _local5 != _local8) {
var _local3 = _map[_local4][_local5][1];
if (_local3 != 0) {
var _local2 = 1;
var _local1 = 0;
} else {
var _local2 = 2;
var _local1 = 1;
}
_local6.push([_local2]);
_local7.push(_local1);
}
_satMap[_local4] = _local6;
_satMapAStar[_local4] = _local7;
}
satNavPowerUp();
}
function calculatePath() {
satNavPlayerX = Math.abs(Math.round((playField.container._x - 180) / 32));
satNavPlayerY = Math.abs(Math.round((playField.container._y - 130) / 32));
actualPath = findPath(_satMapAStar, satNavPlayerY, satNavPlayerX, targetY, targetX);
}
function plotPath() {
var _local4 = actualPath.length;
var _local2;
var _local3;
var _local1 = -1;
while (_local1++ , _local1 != _local4) {
_local2 = actualPath[_local1][0];
_local3 = actualPath[_local1][1];
_satMap[_local2][_local3][0] = 3;
}
}
function plotSatNavMap() {
satNavParameters.map = _satMap;
satNavParameters.container = satNav.anim.mapHolder;
var _local1 = playerXPos - 23;
if (_local1 < 0) {
_local1 = 0;
} else if (_local1 > 152) {
_local1 = 152;
}
var _local2 = playerYPos - 15;
if (_local2 < 0) {
_local2 = 0;
}
satNavParameters.startX = _local1;
satNavParameters.startY = _local2;
satNavScroller.init(satNavParameters);
}
function plotLocationCursors() {
var _local1 = satNav.anim.mapHolder.attachMovie("playerSatNavCursor", "playerSatNavCursor", satNav.anim.mapHolder.getNextHighestDepth());
_local1._x = satNavPlayerX * 4;
_local1._y = satNavPlayerY * 4;
_local1 = satNav.anim.mapHolder.attachMovie("targetSatNavCursor", "targetSatNavCursor", satNav.anim.mapHolder.getNextHighestDepth());
_local1._x = targetX * 4;
_local1._y = targetY * 4;
}
function satNavInput() {
if (inkey(keyUP)) {
moveSatUp();
} else if (inkey(87)) {
moveSatUp();
} else if (inkey(keyDOWN)) {
moveSatDown();
} else if (inkey(83)) {
moveSatDown();
}
if (inkey(keyLEFT)) {
moveSatLeft();
} else if (inkey(65)) {
moveSatLeft();
} else if (inkey(keyRIGHT)) {
moveSatRight();
} else if (inkey(68)) {
moveSatRight();
}
}
function moveSatUp() {
if (satNavScroller.mapYPos > 30) {
satNavScroller.scrollUp(4);
}
}
function moveSatDown() {
if (satNavScroller.mapYPos < 200) {
satNavScroller.scrollDown(4);
}
}
function moveSatLeft() {
if (satNavScroller.mapXPos > 47) {
satNavScroller.scrollLeft(4);
}
}
function moveSatRight() {
if (satNavScroller.mapXPos < 200) {
satNavScroller.scrollRight(4);
}
}
function satNavButtonsInit() {
satNav.anim.AButton._alpha = (satNav.anim.BButton._alpha = 100);
satNav.anim.AButton.onRelease = moveToA;
satNav.anim.BButton.onRelease = moveToB;
}
function satNavButtonsKill() {
delete satNav.anim.AButton.onRelease;
delete satNav.anim.BButton.onRelease;
satNav.anim.AButton._alpha = (satNav.anim.BButton._alpha = 50);
}
function moveToA() {
this=_root;//parameter overwritten
miniMapX = playerXPos - 23;
miniMapY = playerYPos - 15;
miniMapMoveSetUp();
}
function moveToB() {
this=_root;//parameter overwritten
miniMapX = targetX - 23;
miniMapY = targetY - 15;
miniMapMoveSetUp();
}
function miniMapMoveSetUp() {
if (miniMapX < 0) {
infoModule.miniMapX = 0;
}
if (miniMapY < 0) {
infoModule.miniMapY = 0;
}
satNavButtonsKill();
satNavButtonSFX.start();
satNavInputFunc = moveminiMap;
}
function moveminiMap() {
var _local1 = false;
var _local3 = false;
var _local2 = satNavScroller.mapXPos - satNavScroller.visAreaX;
if (_local2 < 1) {
_local2 = 1;
_local1 = true;
} else if ((_local2 == 1) && (miniMapX <= 0)) {
_local1 = true;
}
if (_local2 >= 154) {
if (miniMapX > 152) {
_local2 = 154;
_local1 = true;
}
}
if (_local1 == false) {
if (_local2 < miniMapX) {
moveSatRight();
_local1 = false;
} else if (_local2 > miniMapX) {
moveSatLeft();
} else {
_local1 = true;
}
}
var _local4 = satNavScroller.mapYPos - satNavScroller.visAreaY;
if (_local4 < 1) {
_local4 = 1;
_local3 = true;
} else if (_local4 == 1) {
_local3 = true;
}
if (_local4 < miniMapY) {
_local3 = false;
moveSatDown();
} else if (_local4 > miniMapY) {
moveSatUp();
} else {
_local3 = true;
}
if ((_local1 == true) && (_local3 == true)) {
satNavInputFunc = satNavInput;
satNavButtonsInit();
}
}
function errorTriggered() {
this.onEnterFrame = function () {
handleTimer();
if ((++satNav.delay) == frameRate) {
satNavErrorSFX.start();
satNav.anim.gotoAndPlay("error");
this.onEnterFrame = function () {
handleTimer();
satNavQuitTest();
};
}
};
}
function satNavQuitTest() {
if (inkey(keyFIRE)) {
satNavKill();
}
}
function satNavKill() {
satNav.anim.gotoAndPlay("out");
this.onEnterFrame = function () {
if (satNav.anim.animFlag == true) {
delete this.onEnterFrame;
zoomSatNavOut();
}
};
}
function zoomSatNavOut() {
satNavZoomer._visible = true;
satNavZoomer.gotoAndPlay("out");
satNav._visible = false;
this.onEnterFrame = function () {
if (satNavZoomer._currentframe == satNavZoomer._totalframes) {
satNavZoomer._visible = false;
if (timer == 0) {
delete this.onEnterFrame;
levelFailed2();
} else {
resumebaddies();
this.onEnterFrame = master;
}
}
};
}
function targetInit() {
targetX = targetCoords[level - 1][0];
targetY = targetCoords[level - 1][1];
var _local1 = targetStorage[level - 1];
targetSprite = spritePlayField.attachMovie(_local1, _local1, spritePlayField.getNextHighestDepth());
targetSprite._x = targetX * 32;
targetSprite._y = targetY * 32;
targetSprite.gotoAndStop("standingLeft");
targetFound = false;
}
function target_collected() {
targetSprite.arrow._visible = false;
}
function targetHouseKeeping() {
targetSprite.removeMovieClip();
}
function explosionInit() {
explosionFlipFlop = level * frameRate;
explosionFunc = explosionHandler;
}
function explosionHandler() {
if ((--explosionFlipFlop) > 0) {
return(undefined);
}
explosionXCoord = scroller.mapXPos - int(Math.random() * 12);
explosionYCoord = scroller.mapYPos - int(Math.random() * 8);
var _local1 = _map[explosionYCoord][explosionXCoord][1];
if (_local1 == 2) {
_map[explosionYCoord][explosionXCoord][1] = 1;
_map[explosionYCoord][explosionXCoord][2] = 2;
playField.container[(("t_" + explosionXCoord) + "_") + explosionYCoord].anim.gotoAndStop(2);
plotBuildingExplosion();
explosionFlipFlop = (level * frameRate) * 2;
} else if (_local1 == 3) {
plotRoofExplosion();
explosionFlipFlop = (level * frameRate) * 2;
} else {
explosionFlipFlop = 4;
}
}
function plotBuildingExplosion() {
var _local3 = topSpritePlayField.getNextHighestDepth();
var _local2 = topSpritePlayField.attachMovie("explosion1", "exp" + _local3, _local3++);
_local2._x = (explosionXCoord * 32) + 16;
_local2._y = (explosionYCoord * 32) + 8;
var _local1;
var _local4 = -1;
while (_local4++ , _local4 != 3) {
_local1 = topSpritePlayField.attachMovie("rubbleParticle2", "rub" + _local3, _local3++);
_local1._x = _local2._x;
_local1._y = _local2._y;
}
if (masterVolume != 0) {
var _local5 = new Sound(_local2);
_local5.attachSound("frontBlownOutSFX");
_local5.setVolume(getDistanceVolume(explosionXCoord, explosionYCoord));
_local5.setPan(getDistancePan(explosionXCoord));
_local5.start();
}
}
function plotRoofExplosion() {
var _local3 = topSpritePlayField.getNextHighestDepth();
var _local1 = topSpritePlayField.attachMovie("explosion2", "rexp" + _local3, _local3++);
_local1._x = (explosionXCoord * 32) + 16;
_local1._y = (explosionYCoord * 32) + 16;
_local1._xscale = (_local1._yscale = 200);
var _local2;
var _local4 = -1;
while (_local4++ , _local4 != 3) {
_local2 = topSpritePlayField.attachMovie("rubbleParticle", "rub" + _local3, _local3++);
_local2._x = _local1._x;
_local2._y = _local1._y;
}
if (masterVolume != 0) {
var _local5 = new Sound(_local1);
_local5.attachSound("roofExplosionSFX");
_local5.setVolume(getDistanceVolume(explosionXCoord, explosionYCoord));
_local5.setPan(getDistancePan(explosionXCoord));
_local5.start();
}
explosionFunc = destroyRoof;
}
function destroyFront() {
var _local1 = explosionXCoord;
while (_local1-- , _local1) {
if (_map[explosionYCoord][_local1][1] != 2) {
_local1++;
break;
}
}
var _local2 = explosionYCoord;
while (_local2-- , _local2) {
if (_map[_local2][_local1][1] != 2) {
_local2++;
break;
}
}
var _local3 = _local1;
var _local4 = 0;
while (_local4++ , _local4) {
_map[_local2][_local1][1] = 1;
_map[_local2][_local1][2] = 2;
playField.container[(("t_" + _local1) + "_") + _local2].anim.gotoAndStop(2);
_local1++;
if (_map[_local2][_local1][1] != 2) {
_local1 = _local3;
_local2++;
if (_map[_local2][_local1][1] != 2) {
break;
}
}
}
explosionFunc = explosionHandler;
}
function destroyRoof() {
var _local1 = explosionXCoord;
while (_local1-- , _local1) {
if (_map[explosionYCoord][_local1][1] != 3) {
_local1++;
break;
}
}
var _local2 = explosionYCoord;
while (_local2-- , _local2) {
if (_map[_local2][_local1][1] != 3) {
_local2++;
break;
}
}
var _local3 = _local1;
var _local4 = 0;
while (_local4++ , _local4) {
_map[_local2][_local1][1] = 1;
_map[_local2][_local1][2] = 2;
playField.container[(("t_" + _local1) + "_") + _local2].anim.gotoAndStop(2);
_local1++;
if (_map[_local2][_local1][1] != 3) {
_local1 = _local3;
_local2++;
if (_map[_local2][_local1][1] != 3) {
break;
}
}
}
explosionFunc = explosionHandler;
}
function master() {
artBasedHandler();
if (playerMainLoop() == true) {
levelCompletedInit();
return(undefined);
}
if (deadFlag == true) {
playerDead();
return(undefined);
}
mateMainLoop();
baddieMainLoop();
soldierFunc();
if (level != 6) {
explosionFunc();
if (level == 5) {
ufoHandler();
}
} else {
meteoriteHandler();
}
objectMainLoop();
setPieceFunc();
handleTimer();
}
function handleTimer() {
if ((++tick) == frameRate) {
tick = 0;
timer--;
plotSeconds();
if (timer == 0) {
infoModule.sec1._visible = (infoModule.sec2._visible = (infoModule.min._visible = (infoBar.infoModule.colon._visible = true)));
levelFailed();
}
} else if (timer <= 5) {
if ((tick % 10) == 0) {
if (infoModule.sec1._visible == true) {
infoModule.sec1._visible = (infoModule.sec2._visible = (infoModule.min._visible = (infoBar.infoModule.colon._visible = false)));
} else {
infoModule.sec1._visible = (infoModule.sec2._visible = (infoModule.min._visible = (infoBar.infoModule.colon._visible = true)));
}
}
}
}
function pauseGame() {
pausebaddies();
pauseMates();
pausePlayer();
infoBar.pauseText._visible = true;
this.onEnterFrame = pauseWaiting;
}
function pauseWaiting() {
if (inkey(keyFIRE)) {
resumeGame();
}
}
function resumeGame() {
infoBar.pauseText._visible = false;
resumebaddies();
resumePlayer();
this.onEnterFrame = master;
}
_quality = "medium";
Instance of Symbol 2049 MovieClip "surround" in Frame 10
onClipEvent (load) {
this.gotoAndStop(1);
}
Instance of Symbol 2050 MovieClip "playField" in Frame 10
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 2062 MovieClip "player" in Frame 10
onClipEvent (load) {
_visible = false;
this.gotoAndStop(1);
this.anim.gotoAndStop(1);
this._x = 286;
this._y = 189;
}
Instance of Symbol 2069 MovieClip "filmBorders" in Frame 10
onClipEvent (load) {
_visible = false;
this.gotoAndStop(1);
}
Instance of Symbol 2072 MovieClip "softEdges" in Frame 10
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1488 MovieClip "spriteHitAreaFull" in Frame 10
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1488 MovieClip "spriteHitArea" in Frame 10
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 2079 MovieClip "satNavZoomer" in Frame 10
onClipEvent (load) {
_visible = false;
this.gotoAndStop(1);
}
Instance of Symbol 2132 MovieClip "satNav" in Frame 10
onClipEvent (load) {
_visible = false;
this.anim.gotoAndStop(1);
}
Instance of Symbol 2148 MovieClip "infoBar" in Frame 10
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 2176 MovieClip "introScreens" in Frame 10
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 2048 MovieClip "frame" in Frame 10
onClipEvent (load) {
_visible = false;
this.blackBox._visible = false;
}
Instance of Symbol 2447 MovieClip "infoModule" in Frame 10
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 2457 MovieClip "titleText" in Frame 10
onClipEvent (load) {
this.gotoAndStop(1);
_visible = false;
}
Instance of Symbol 1546 MovieClip [starWarsWipe] "starWarsWipe" in Frame 10
onClipEvent (load) {
_visible = false;
this.gotoAndStop(1);
}
Instance of Symbol 1452 MovieClip [wipeCircle] "wipe" in Frame 10
onClipEvent (load) {
_visible = false;
this.gotoAndStop(1);
}
Instance of Symbol 2460 MovieClip "sfxHandler" in Frame 10
onClipEvent (load) {
function startSFX() {
if (currentSfxArray.length == 0) {
var _local1 = new Array();
_local1 = sfxArray.slice();
var _local2 = -1;
while (_local2++ , _local2 != sfxArray.length) {
var _local3 = int(Math.random() * _local1.length);
currentSfxArray.push(_local1[_local3]);
_local1.splice[1];
}
}
var _local3 = int(Math.random() * 4000) + 3000;
intervalID = setInterval(callBack, _local3);
}
function callBack() {
endSFXHandler();
startSFX();
if (_global.masterVolume == 0) {
return(undefined);
}
var _local2 = currentSfxArray[0];
currentSfxArray.shift();
_local2.start();
var _local3 = int(Math.random() * 200) - 100;
_local2.setPan(_local3);
var _local4 = int(Math.random() * 30) + 60;
_local2.setVolume(_local4);
}
function endSFXHandler() {
stop();
clearInterval(intervalID);
}
function reset() {
sfx.setPan(0);
sfx.setVolume(_global.masterVolume);
endSFXHandler();
}
_visible = false;
var intervalID = null;
var bgSFX1 = new Sound(this);
bgSFX1.attachSound("helicoptorSFX");
var bgSFX2 = new Sound(this);
bgSFX2.attachSound("m60SFX");
var bgSFX3 = new Sound(this);
bgSFX3.attachSound("moreGunFireSFX");
var bgSFX4 = new Sound(this);
bgSFX4.attachSound("rocketSFX");
var bgSFX5 = new Sound(this);
bgSFX5.attachSound("underFireSFX");
var bgSFX6 = new Sound(this);
bgSFX6.attachSound("sirenSFX");
var bgSFX7 = new Sound(this);
bgSFX7.attachSound("carAlarm");
var bgSFX8 = new Sound(this);
bgSFX8.attachSound("carHornSFX");
var bgSFX9 = new Sound(this);
bgSFX9.attachSound("screamSFX");
var bgSFX10 = new Sound(this);
bgSFX10.attachSound("carCrashSFX");
var sfxArray = new Array(bgSFX1, bgSFX2, bgSFX3, bgSFX4, bgSFX5, bgSFX6, bgSFX7, bgSFX8, bgSFX9, bgSFX10, bgSFX1, bgSFX2, bgSFX3, bgSFX4);
var currentSfxArray = new Array();
var satBleep = new Sound(this);
satBleep.attachSound("satNavButtonSFX");
var flames = new Sound(this);
flames.attachSound("flamesSFX");
var explosion = new Sound(this);
explosion.attachSound("roofExplosionSFX");
}
Frame 11
init();
stop();
Symbol 2461 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 2462 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 2463 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 2464 MovieClip [__Packages.mx.transitions.easing.Back] Frame 0
class mx.transitions.easing.Back
{
function Back () {
}
static function easeIn(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / d;
return((((c * t) * t) * (((s + 1) * t) - s)) + b);
}
static function easeOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = (t / d) - 1;
return((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
static function easeInOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
s = s * 1.525;
return(((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b);
}
t = t - 2;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 8 MovieClip Frame 1
stop();
Symbol 11 MovieClip Frame 1
stop();
Symbol 11 MovieClip Frame 2
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 79 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 1
stop();
Symbol 1450 MovieClip [tiles] Frame 1
stop();
Symbol 1452 MovieClip [wipeCircle] Frame 46
_visible = false;
stop();
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1498 MovieClip [mate1] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1488 MovieClip "baddiehitAreaMC" in Symbol 1498 MovieClip [mate1] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1498 MovieClip [mate1] Frame 16
this.gotoAndPlay(1);
Symbol 1498 MovieClip [mate1] Frame 34
this.gotoAndPlay("runningLeft");
Symbol 1498 MovieClip [mate1] Frame 52
this.gotoAndPlay("runningUp");
Symbol 1498 MovieClip [mate1] Frame 70
this.gotoAndPlay("runningDown");
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1521 MovieClip [mate2] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1488 MovieClip "baddiehitAreaMC" in Symbol 1521 MovieClip [mate2] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1521 MovieClip [mate2] Frame 16
this.gotoAndPlay(1);
Symbol 1521 MovieClip [mate2] Frame 34
this.gotoAndPlay("runningLeft");
Symbol 1521 MovieClip [mate2] Frame 52
this.gotoAndPlay("runningUp");
Symbol 1521 MovieClip [mate2] Frame 70
this.gotoAndPlay("runningDown");
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1544 MovieClip [mate3] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1488 MovieClip "baddiehitAreaMC" in Symbol 1544 MovieClip [mate3] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1544 MovieClip [mate3] Frame 16
this.gotoAndPlay(1);
Symbol 1544 MovieClip [mate3] Frame 34
this.gotoAndPlay("runningLeft");
Symbol 1544 MovieClip [mate3] Frame 52
this.gotoAndPlay("runningUp");
Symbol 1544 MovieClip [mate3] Frame 70
this.gotoAndPlay("runningDown");
Symbol 1546 MovieClip [starWarsWipe] Frame 45
stop();
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1569 MovieClip [mate4] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1488 MovieClip "baddiehitAreaMC" in Symbol 1569 MovieClip [mate4] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1569 MovieClip [mate4] Frame 16
this.gotoAndPlay(1);
Symbol 1569 MovieClip [mate4] Frame 34
this.gotoAndPlay("runningLeft");
Symbol 1569 MovieClip [mate4] Frame 52
this.gotoAndPlay("runningUp");
Symbol 1569 MovieClip [mate4] Frame 70
this.gotoAndPlay("runningDown");
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1570 MovieClip [cashPoint] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1571 MovieClip [pub] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1575 MovieClip [satNavTiles] Frame 1
stop();
Symbol 1610 MovieClip [explosion1] Frame 17
this.removeMovieClip();
stop();
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1624 MovieClip [zombie] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1624 MovieClip [zombie] Frame 26
this.gotoAndPlay(1);
Symbol 1624 MovieClip [zombie] Frame 56
this.gotoAndPlay("runningLeft");
Symbol 1624 MovieClip [zombie] Frame 86
this.gotoAndPlay("runningUp");
Symbol 1624 MovieClip [zombie] Frame 116
this.gotoAndPlay("runningDown");
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1669 MovieClip [explosion2] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1669 MovieClip [explosion2] Frame 23
stop();
this.removeMovieClip();
Symbol 1703 MovieClip Frame 41
stop();
this.removeMovieClip();
Symbol 1741 MovieClip [building] Frame 2
var sfx = new Sound(this);
sfx.attachSound("roofExplosionSFX");
sfx.setVolume(_global.masterVolume);
sfx.start();
Symbol 1741 MovieClip [building] Frame 7
var sfx2 = new Sound(this);
sfx2.attachSound("roofExplosionSFX");
sfx2.setVolume(_global.masterVolume);
sfx2.start();
Instance of Symbol 1703 MovieClip in Symbol 1741 MovieClip [building] Frame 9
onClipEvent (load) {
this.onEnterFrame = function () {
this._xscale = this._xscale + 10;
this._yscale = this._yscale + 10;
this._alpha = this._alpha - 3;
if (this._currentframe == this._totalframes) {
delete this.onEnterFrame;
}
};
}
Symbol 1741 MovieClip [building] Frame 14
var sfx3 = new Sound(this);
sfx3.attachSound("roofExplosionSFX");
sfx3.setVolume(_global.masterVolume);
sfx3.start();
Instance of Symbol 1740 MovieClip in Symbol 1741 MovieClip [building] Frame 15
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1740 MovieClip in Symbol 1741 MovieClip [building] Frame 15
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1740 MovieClip in Symbol 1741 MovieClip [building] Frame 15
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1740 MovieClip in Symbol 1741 MovieClip [building] Frame 15
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1740 MovieClip in Symbol 1741 MovieClip [building] Frame 15
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Symbol 1741 MovieClip [building] Frame 23
_root.building.blownUp();
Symbol 1741 MovieClip [building] Frame 80
stop();
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1743 MovieClip [crackVertical] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1703 MovieClip in Symbol 1743 MovieClip [crackVertical] Frame 2
onClipEvent (load) {
_alpha = 10;
this.onEnterFrame = function () {
_alpha = (_alpha + 5);
if (this._currentframe == 7) {
this.onEnterFrame = function () {
if (_alpha > 0) {
_alpha = (_alpha - 2);
}
if (this._currentframe == this._totalframes) {
delete this.onEnterFrame;
}
};
}
};
}
Symbol 1743 MovieClip [crackVertical] Frame 43
stop();
Instance of Symbol 1744 MovieClip in Symbol 1745 MovieClip [fireHorizontal4] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1745 MovieClip [fireHorizontal4] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1745 MovieClip [fireHorizontal4] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1745 MovieClip [fireHorizontal4] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1745 MovieClip [fireHorizontal4] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1744 MovieClip in Symbol 1746 MovieClip [fireVertical4] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1746 MovieClip [fireVertical4] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1746 MovieClip [fireVertical4] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1746 MovieClip [fireVertical4] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1746 MovieClip [fireVertical4] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1748 MovieClip [crackHorizontal] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1703 MovieClip in Symbol 1748 MovieClip [crackHorizontal] Frame 2
onClipEvent (load) {
_alpha = 10;
this.onEnterFrame = function () {
_alpha = (_alpha + 5);
if (this._currentframe == 7) {
this.onEnterFrame = function () {
if (_alpha > 0) {
_alpha = (_alpha - 2);
}
if (this._currentframe == this._totalframes) {
delete this.onEnterFrame;
}
};
}
};
}
Symbol 1748 MovieClip [crackHorizontal] Frame 43
stop();
Instance of Symbol 1744 MovieClip in Symbol 1749 MovieClip [fireHorizontal5] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1749 MovieClip [fireHorizontal5] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1749 MovieClip [fireHorizontal5] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1749 MovieClip [fireHorizontal5] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1749 MovieClip [fireHorizontal5] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1749 MovieClip [fireHorizontal5] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1744 MovieClip in Symbol 1750 MovieClip [fireHorizontal2] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1750 MovieClip [fireHorizontal2] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1750 MovieClip [fireHorizontal2] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1744 MovieClip in Symbol 1751 MovieClip [fireHorizontal3] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1751 MovieClip [fireHorizontal3] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1751 MovieClip [fireHorizontal3] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1751 MovieClip [fireHorizontal3] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1744 MovieClip in Symbol 1752 MovieClip [fireVertical5] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1752 MovieClip [fireVertical5] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1752 MovieClip [fireVertical5] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1752 MovieClip [fireVertical5] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1752 MovieClip [fireVertical5] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1752 MovieClip [fireVertical5] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1744 MovieClip in Symbol 1753 MovieClip [fireVertical3] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1753 MovieClip [fireVertical3] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1744 MovieClip in Symbol 1753 MovieClip [fireVertical3] Frame 1
onClipEvent (load) {
this.gotoAndPlay(int(Math.random() * this._totalframes));
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1753 MovieClip [fireVertical3] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1755 MovieClip [crackVertical4] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1703 MovieClip in Symbol 1755 MovieClip [crackVertical4] Frame 2
onClipEvent (load) {
_alpha = 10;
this.onEnterFrame = function () {
_alpha = (_alpha + 5);
if (this._currentframe == 7) {
this.onEnterFrame = function () {
if (_alpha > 0) {
_alpha = (_alpha - 2);
}
if (this._currentframe == this._totalframes) {
delete this.onEnterFrame;
}
};
}
};
}
Symbol 1755 MovieClip [crackVertical4] Frame 43
stop();
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1774 MovieClip [ant] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1774 MovieClip [ant] Frame 17
this.gotoAndPlay(1);
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1774 MovieClip [ant] Frame 20
onClipEvent (load) {
_visible = false;
}
Symbol 1774 MovieClip [ant] Frame 37
this.gotoAndPlay("runningLeft");
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1774 MovieClip [ant] Frame 40
onClipEvent (load) {
_visible = false;
}
Symbol 1774 MovieClip [ant] Frame 57
this.gotoAndPlay("runningUp");
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1774 MovieClip [ant] Frame 60
onClipEvent (load) {
_visible = false;
}
Symbol 1774 MovieClip [ant] Frame 77
this.gotoAndPlay("runningDown");
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1788 MovieClip [spider] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1788 MovieClip [spider] Frame 13
this.gotoAndPlay(1);
Symbol 1788 MovieClip [spider] Frame 33
this.gotoAndPlay("runningLeft");
Symbol 1788 MovieClip [spider] Frame 54
this.gotoAndPlay("runningUp");
Symbol 1788 MovieClip [spider] Frame 74
this.gotoAndPlay("runningDown");
Symbol 1815 MovieClip [soldier] Frame 17
this.gotoAndPlay(1);
Symbol 1815 MovieClip [soldier] Frame 35
this.gotoAndPlay("runningLeft");
Symbol 1815 MovieClip [soldier] Frame 53
this.gotoAndPlay("runningUp");
Symbol 1815 MovieClip [soldier] Frame 71
this.gotoAndPlay("runningDown");
Instance of Symbol 1814 MovieClip "gunFire" in Symbol 1815 MovieClip [soldier] Frame 75
onClipEvent (load) {
_visible = false;
this.gotoAndStop(1);
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1834 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1834 MovieClip Frame 9
onClipEvent (load) {
_visible = false;
}
Symbol 1834 MovieClip Frame 19
stop();
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1835 MovieClip [alien] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1835 MovieClip [alien] Frame 19
this.gotoAndPlay(1);
Symbol 1835 MovieClip [alien] Frame 41
this.gotoAndPlay("runningLeft");
Symbol 1835 MovieClip [alien] Frame 63
this.gotoAndPlay("runningUp");
Symbol 1835 MovieClip [alien] Frame 85
this.gotoAndPlay("runningDown");
Instance of Symbol 1834 MovieClip "lazer" in Symbol 1835 MovieClip [alien] Frame 86
onClipEvent (load) {
_visible = false;
this.gotoAndStop(1);
}
Symbol 1851 MovieClip [toxicWaste] Frame 1
stop();
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1851 MovieClip [toxicWaste] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1883 MovieClip [rubbleParticle] Frame 1
var xvel = (int(Math.random() * 20) - 10);
var yvel = (int(Math.random() * 20) - 10);
var alphaAmount = (int(Math.random() * 30) + 70);
var alphasteps = (int(Math.random() * 2) + 2);
var xposition = this._x;
var yposition = this._y;
var rnd = int(Math.random() * anim._totalframes);
anim.gotoAndPlay(rnd);
anim._rotation = int(Math.random() * 360);
var colour = new Color(this);
Symbol 1883 MovieClip [rubbleParticle] Frame 2
yposition = yposition + yvel;
xposition = xposition + xvel;
alphaAmount = alphaAmount - alphasteps;
_y = yposition;
_x = xposition;
_xscale = alphaAmount;
_yscale = alphaAmount;
var half = int(alphaAmount / 2);
colour.setBrightness(-half);
if (_xscale <= 5) {
this.removeMovieClip();
}
Symbol 1883 MovieClip [rubbleParticle] Frame 3
this.gotoAndPlay(2);
Symbol 1884 MovieClip [rubbleParticle2] Frame 1
var xvel = (int(Math.random() * 14) - 7);
var yvel = (int(Math.random() * 12) + 4);
var gravity = 0.92;
var alphaAmount = (int(Math.random() * 40) + 40);
var alphasteps = (int(Math.random() * 2) + 2);
var xposition = _x;
var yposition = _y;
var rnd = int(Math.random() * anim._totalframes);
anim.gotoAndPlay(rnd);
anim._rotation = int(Math.random() * 360);
var colour = new Color(this);
Symbol 1884 MovieClip [rubbleParticle2] Frame 2
yposition = yposition + yvel;
yvel = yvel * gravity;
xposition = xposition + xvel;
alphaAmount = alphaAmount - alphasteps;
_y = yposition;
_x = xposition;
_xscale = alphaAmount;
_yscale = alphaAmount;
var half = int(alphaAmount / 2);
colour.setBrightness(-half);
if (_xscale <= 5) {
this.removeMovieClip();
} else if (yvel < 0.5) {
this.removeMovieClip();
}
Symbol 1884 MovieClip [rubbleParticle2] Frame 3
this.gotoAndPlay(2);
Symbol 1890 MovieClip Frame 1
_root.sfxHandler.reset();
_root.sfxHandler.satBleep.setVolume(_root.masterVolume);
_root.sfxHandler.satBleep.start();
Symbol 1947 MovieClip [satHitAnim] Frame 103
_root.sfxHandler.flames.setVolume(_global.masterVolume);
_root.sfxHandler.flames.start();
Symbol 1947 MovieClip [satHitAnim] Frame 121
_root.sfxHandler.explosion.setVolume(_global.masterVolume);
_root.sfxHandler.explosion.start();
Symbol 1947 MovieClip [satHitAnim] Frame 174
stop();
Symbol 1948 MovieClip [animFadeCover] Frame 1
var animFlag = false;
Symbol 1948 MovieClip [animFadeCover] Frame 10
animFlag = true;
stop();
Symbol 1948 MovieClip [animFadeCover] Frame 19
animFlag = false;
stop();
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1951 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1951 MovieClip Frame 37
stop();
Symbol 1952 MovieClip [godZilla] Frame 1
stop();
Symbol 1958 MovieClip [ufoTween] Frame 65
_root.targetSprite._visible = false;
Symbol 1958 MovieClip [ufoTween] Frame 126
stop();
Symbol 1996 MovieClip [tentacle] Frame 1
stop();
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 1996 MovieClip [tentacle] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 2049 MovieClip Frame 32
stop();
Instance of Symbol 1488 MovieClip "hitAreaMC" in Symbol 2062 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 1488 MovieClip "baddiehitAreaMC" in Symbol 2062 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 2062 MovieClip Frame 16
this.gotoAndPlay(1);
Symbol 2062 MovieClip Frame 34
this.gotoAndPlay("runningLeft");
Symbol 2062 MovieClip Frame 52
this.gotoAndPlay("runningUp");
Symbol 2062 MovieClip Frame 70
this.gotoAndPlay("runningDown");
Symbol 2062 MovieClip Frame 88
this.gotoAndPlay("runningUpRight");
Symbol 2062 MovieClip Frame 105
this.gotoAndPlay("runningUpLeft");
Symbol 2062 MovieClip Frame 123
this.gotoAndPlay("runningDownRight");
Symbol 2062 MovieClip Frame 141
this.gotoAndPlay("runningDownLeft");
Symbol 2069 MovieClip Frame 1
var animFlag = false;
Symbol 2069 MovieClip Frame 20
animFlag = true;
stop();
Symbol 2069 MovieClip Frame 40
_visible = false;
this.gotoAndStop(1);
Symbol 2079 MovieClip Frame 1
var animFlag = false;
Instance of Symbol 2078 MovieClip in Symbol 2079 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(2);
}
Symbol 2079 MovieClip Frame 15
animFlag = true;
Symbol 2079 MovieClip Frame 16
stop();
Instance of Symbol 2078 MovieClip in Symbol 2079 MovieClip Frame 17
onClipEvent (load) {
this.gotoAndStop(2);
}
Symbol 2079 MovieClip Frame 30
stop();
Symbol 2095 MovieClip Frame 1
stop();
Symbol 2095 MovieClip Frame 10
stop();
Symbol 2103 MovieClip Frame 21
stop();
Symbol 2104 MovieClip Frame 31
stop();
Symbol 2104 MovieClip Frame 41
stop();
Symbol 2117 MovieClip Frame 1
stop();
Symbol 2123 MovieClip Frame 1
stop();
Symbol 2126 MovieClip Frame 1
stop();
Symbol 2128 MovieClip Frame 1
_parent.powerLight.gotoAndPlay(1);
Symbol 2128 MovieClip Frame 10
stop();
Symbol 2128 MovieClip Frame 11
stop();
Instance of Symbol 2095 MovieClip "signal" in Symbol 2128 MovieClip Frame 11
onClipEvent (load) {
this.gotoAndPlay(2);
this.onEnterFrame = function () {
if (this._currentframe == 2) {
this.gotoAndPlay(3);
delete this.onEnterFrame;
}
};
}
Instance of Symbol 2050 MovieClip "mapHolder" in Symbol 2128 MovieClip Frame 11
onClipEvent (load) {
_visible = false;
}
Symbol 2128 MovieClip Frame 12
ticker.gotoAndStop(_root.level);
stop();
Symbol 2128 MovieClip Frame 13
_parent.powerLight.gotoAndPlay("out");
var animFlag = false;
Symbol 2128 MovieClip Frame 16
animFlag = true;
stop();
Symbol 2128 MovieClip Frame 17
stop();
Instance of Symbol 2104 MovieClip "logo" in Symbol 2128 MovieClip Frame 17
onClipEvent (load) {
this.gotoAndStop(30);
}
Symbol 2131 MovieClip Frame 3
stop();
Symbol 2131 MovieClip Frame 6
stop();
Instance of Symbol 2128 MovieClip "anim" in Symbol 2132 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(1);
}
Instance of Symbol 2141 MovieClip "failedText" in Symbol 2148 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
this.gotoAndStop(1);
}
Instance of Symbol 2143 MovieClip "levelCompletedText" in Symbol 2148 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 2145 MovieClip "gameCompletedText" in Symbol 2148 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 2147 MovieClip "pauseText" in Symbol 2148 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 2166 MovieClip Frame 49
gotoAndPlay (1);
Symbol 2169 MovieClip Frame 1
stop();
Symbol 2176 MovieClip Frame 1
stop();
Instance of Symbol 2166 MovieClip in Symbol 2176 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(1);
}
Symbol 2176 MovieClip Frame 7
stop();
Symbol 2193 MovieClip Frame 1
stop();
Symbol 2196 MovieClip Frame 1
stop();
Symbol 2199 MovieClip Frame 1
stop();
Symbol 2202 MovieClip Frame 1
stop();
Instance of Symbol 2193 MovieClip "playButton" in Symbol 2203 MovieClip Frame 18
on (release) {
getURL ("javascript:_hbPageView('play','warmbeer');");
}
Symbol 2203 MovieClip Frame 43
stop();
Symbol 2212 MovieClip Frame 32
stop();
Symbol 2229 Button
on (release) {
aIn(copy01, 30);
aOut(copy02, 10);
}
Symbol 2230 Button
on (release) {
if (copy01._x > 0) {
aOut(copy01, 10);
}
aIn(copy02, 30);
}
Symbol 2236 MovieClip Frame 44
function aIn(clip, time) {
var _local1 = new mx.transitions.Tween(clip, "_x", mx.transitions.easing.Back.easeOut, -400, 30, time, false);
}
function aOut(clip, time) {
var _local1 = new mx.transitions.Tween(clip, "_x", mx.transitions.easing.Back.easeIn, -400, -400, time, false);
}
stop();
Symbol 2243 MovieClip Frame 1
stop();
Symbol 2244 MovieClip Frame 30
stop();
Instance of Symbol 2243 MovieClip "backButtonMC" in Symbol 2244 MovieClip Frame 30
onClipEvent (load) {
this.onRelease = function () {
_parent._parent.gotoAndPlay("mainScreen");
};
}
Symbol 2258 MovieClip Frame 1
stop();
Symbol 2280 MovieClip Frame 1
var lHS = _root.hiScoreTable;
var len = lHS.length;
var cnt = -1;
while ((++cnt) != len) {
this["nameText" + (cnt + 1)].text = lHS[cnt][2];
this["scoreText" + (cnt + 1)].text = lHS[cnt][1];
}
Symbol 2284 MovieClip Frame 1
stop();
Instance of Symbol 2258 MovieClip "downArrow" in Symbol 2284 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 2258 MovieClip "upArrow" in Symbol 2284 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 2284 MovieClip Frame 2
function upArrowKill() {
delete upArrow.onPress;
upArrow._alpha = 40;
}
function downArrowKill() {
delete downArrow.onPress;
downArrow._alpha = 40;
}
function upArrowInit() {
upArrow._alpha = 100;
upArrow.onPress = function () {
upArrowKill();
downArrowKill();
moveScoresUpInit();
};
}
function downArrowInit() {
downArrow._alpha = 100;
downArrow.onPress = function () {
upArrowKill();
downArrowKill();
moveScoresDownInit();
};
}
function moveScoresDownInit() {
var moveCnt = 0;
this.onEnterFrame = function () {
scoresHolder._y = scoresHolder._y - 5;
if ((++moveCnt) == 4) {
delete this.onEnterFrame;
upArrowInit();
if (scoresHolder._y != 54) {
downArrowInit();
}
}
};
}
function moveScoresUpInit() {
var moveCnt = 0;
this.onEnterFrame = function () {
scoresHolder._y = scoresHolder._y + 5;
if ((++moveCnt) == 4) {
delete this.onEnterFrame;
downArrowInit();
if (scoresHolder._y != 134) {
upArrowInit();
}
}
};
}
upArrow._visible = (downArrow._visible = true);
upArrowKill();
downArrowInit();
stop();
Symbol 2285 MovieClip Frame 2
_root.scoresLoaded = false;
_root.getHiScores();
Symbol 2285 MovieClip Frame 34
if (_root.scoresLoaded == false) {
this.gotoAndPlay(this._currentframe - 1);
}
Symbol 2285 MovieClip Frame 48
stop();
Instance of Symbol 2284 MovieClip "hiScoreTable" in Symbol 2285 MovieClip Frame 48
onClipEvent (load) {
this.gotoAndPlay(2);
}
Symbol 2307 Button
on (press) {
this.formcheck();
}
Symbol 2312 Button
on (press) {
_root.compEntry = true;
gotoAndStop (2);
}
Symbol 2315 Button
on (press) {
_root.compEntry = false;
gotoAndStop (1);
}
Symbol 2316 MovieClip Frame 1
stop();
Instance of Symbol 2310 MovieClip "mHtml" in Symbol 2316 MovieClip Frame 1
/* no clip actions */
Symbol 2316 MovieClip Frame 2
stop();
Symbol 2325 MovieClip Frame 1
stop();
Symbol 2327 MovieClip Frame 1
function validate(address) {
if (address.length >= 7) {
if (address.indexOf("@") > 0) {
if ((address.indexOf("@") + 2) < address.lastIndexOf(".")) {
if (address.lastIndexOf(".") < (address.length - 2)) {
return(true);
}
}
}
}
return(false);
}
function formcheck() {
if (((name == null) || (name == "Name")) || (name == "")) {
action = "";
errorClip1.play();
}
if (!validate(email)) {
action = "";
errorClip2.play();
}
if (((fname == null) || (fname == "Friends Name")) || (fname == "")) {
action = "";
errorClip3.play();
}
if (!validate(femail)) {
action = "";
errorClip4.play();
}
if (radioBtn._currentFrame == 1) {
mailhtml = 1;
} else {
mailhtml = 0;
}
if ((((name != null) && (validate(email))) && (fname != null)) && (validate(femail))) {
action = "send";
lvOut.sendersName = name;
lvOut.sendersEmail = email;
lvOut.friendsName = fname;
lvOut.friendsEmail = femail;
lvOut.emailFormat = mailhtml;
lvOut.sendAndLoad(_root.mailform, lvIn, "POST");
this.play();
}
}
stop();
var lvOut = new LoadVars();
var lvIn = new LoadVars();
action = "send";
t1 = _root.currentName;
t2 = _root.currentEmail;
t3 = "Friends name";
t4 = "Friends email";
input1.text = t1;
input2.text = t2;
input3.text = t3;
input4.text = t4;
input1.onKillFocus = function () {
if (input1.text == "") {
input1.text = t1;
} else {
_root.currentName = input1.text;
}
};
input2.onKillFocus = function () {
if (input2.text == "") {
input2.text = t2;
} else {
_root.currentEmail = input2.text;
}
};
input3.onKillFocus = function () {
if (input3.text == "") {
input3.text = t3;
}
};
input4.onKillFocus = function () {
if (input4.text == "") {
input4.text = t4;
}
};
input1.onSetFocus = function () {
if ((input1.text = t1)) {
input1.text = "";
}
if (input2.text == "") {
input2.text = t2;
}
if (input3.text == "") {
input3.text = t3;
}
if (input4.text == "") {
input4.text = t4;
}
};
input2.onSetFocus = function () {
if (input1.text == "") {
input1.text = t1;
}
if (input2.text == t2) {
input2.text = "";
}
if (input3.text == "") {
input3.text = t3;
}
if (input4.text == "") {
input4.text = t4;
}
};
input3.onSetFocus = function () {
if (input1.text == "") {
input1.text = t1;
}
if (input2.text == "") {
input2.text = t2;
}
if (input3.text == t3) {
input3.text = "";
}
if (input4.text == "") {
input4.text = t4;
}
};
input4.onSetFocus = function () {
if (input1.text == "") {
input1.text = t1;
}
if (input2.text == "") {
input2.text = t2;
}
if (input3.text == "") {
input3.text = t3;
}
if (input4.text == t4) {
input4.text = "";
}
};
input1.tabIndex = 1;
input2.tabIndex = 2;
input3.tabIndex = 3;
input4.tabIndex = 4;
Instance of Symbol 2327 MovieClip "form" in Symbol 2330 MovieClip Frame 56
/* no clip actions */
Symbol 2330 MovieClip Frame 57
stop();
Symbol 2351 Button
on (release) {
getURL ("javascript:_hbPageView('completedsubmit','warmbeer');");
aIn(forms, 40);
aOut(Wcopy1, 30);
aOut(continueButton, 30);
aOut2(scoreButton, 30);
}
Symbol 2353 MovieClip Frame 1
stop();
Symbol 2361 Button
on (press) {
formcheck();
}
Symbol 2367 MovieClip Frame 1
function validate(address) {
if (address.length >= 7) {
if (address.indexOf("@") > 0) {
if ((address.indexOf("@") + 2) < address.lastIndexOf(".")) {
if (address.lastIndexOf(".") < (address.length - 2)) {
return(true);
}
}
}
}
return(false);
}
function formcheck() {
var _local4 = true;
var _local3 = true;
if (((field1.text == null) || (field1.text == "Name")) || (field1.text == "")) {
action = "";
_local4 = false;
errorClip1.play();
}
if (!validate(field2.text)) {
_local3 = false;
action = "";
errorClip2.play();
}
if (_root.compEntry == true) {
competitionOpt = 1;
} else {
competitionOpt = 0;
}
if ((_local4 == true) && (_local3 == true)) {
action = "send";
lvOut.playerName = _root.currentName;
lvOut.email = _root.currentEmail;
lvOut.score = _root.score;
lvOut.competition_opt = competitionOpt;
lvOut.sendAndLoad(_root.sendHighScoreURL, lvIn, "POST");
this.play();
}
}
var lvOut = new LoadVars();
var lvIn = new LoadVars();
action = "send";
t1 = (field1.text = _root.currentName);
t2 = (field2.text = _root.currentEmail);
radioBtn.gotoAndStop(_root.compEntry + 1);
field1.onKillFocus = function () {
if (field1.text == "") {
field1.text = t1;
} else {
_root.currentName = field1.text;
}
};
field2.onKillFocus = function () {
if (field2.text == "") {
field2.text = t2;
} else {
_root.currentEmail = field2.text;
}
};
field1.onSetFocus = function () {
if ((field1.text = t1)) {
field1.text = "";
}
if (field2.text == "") {
field2.text = t2;
}
};
field2.onSetFocus = function () {
if (field1.text == "") {
field1.text = t1;
}
if (field2.text == t2) {
field2.text = "";
}
};
field1.tabIndex = 1;
field2.tabIndex = 2;
stop();
Symbol 2367 MovieClip Frame 20
_parent._parent.gotoAndPlay("fancyAnother");
Symbol 2368 MovieClip Frame 44
function aIn(clip, time) {
var _local1 = new mx.transitions.Tween(clip, "_x", mx.transitions.easing.Back.easeOut, -400, 20, time, false);
}
function aOut(clip, time) {
var _local1 = new mx.transitions.Tween(clip, "_x", mx.transitions.easing.Back.easeIn, 20, -400, time, false);
}
function aOut2(clip, time) {
var _local1 = new mx.transitions.Tween(clip, "_x", mx.transitions.easing.Back.easeIn, 122, -400, time, false);
}
aIn(Wcopy1, 30);
stop();
Instance of Symbol 2353 MovieClip "continueButton" in Symbol 2368 MovieClip Frame 44
onClipEvent (load) {
this.onRelease = function () {
getURL ("javascript:_hbPageView('completedcontinue','warmbeer');");
_parent._parent.gotoAndPlay("fancyAnother");
};
}
Symbol 2372 Button
on (release) {
getURL ("javascript:_hbPageView('gameoversubmit','warmbeer');");
aIn(forms, 40);
aOut(Lcopy1, 30);
aOut(continueButton, 30);
aOut2(scoreButton, 30);
}
Instance of Symbol 2353 MovieClip "continueButton" in Symbol 2376 MovieClip Frame 32
onClipEvent (load) {
this.onRelease = function () {
getURL ("javascript:_hbPageView('gameovercontinue','warmbeer');");
_parent._parent.gotoAndPlay("fancyAnother");
};
}
Symbol 2376 MovieClip Frame 44
function aIn(clip, time) {
var _local1 = new mx.transitions.Tween(clip, "_x", mx.transitions.easing.Back.easeOut, -400, 20, time, false);
}
function aOut(clip, time) {
var _local1 = new mx.transitions.Tween(clip, "_x", mx.transitions.easing.Back.easeIn, 20, -400, time, false);
}
function aOut2(clip, time) {
var _local1 = new mx.transitions.Tween(clip, "_x", mx.transitions.easing.Back.easeIn, 122, -400, time, false);
}
aIn(Lcopy1, 20);
stop();
Symbol 2379 MovieClip Frame 1
stop();
Symbol 2380 MovieClip Frame 30
stop();
Instance of Symbol 2379 MovieClip "backButtonMC" in Symbol 2380 MovieClip Frame 30
onClipEvent (load) {
this.onRelease = function () {
_root.attractMode();
};
}
Symbol 2400 MovieClip Frame 1
stop();
Symbol 2401 MovieClip Frame 65
stop();
Instance of Symbol 2400 MovieClip in Symbol 2401 MovieClip Frame 65
onClipEvent (load) {
this.onPress = function () {
getURL ("javascript:_hbPageView('race','warmbeer');");
getURL ("http://www.carling.com/bored/race");
};
}
Instance of Symbol 2400 MovieClip in Symbol 2401 MovieClip Frame 65
onClipEvent (load) {
this.onPress = function () {
getURL ("javascript:_hbPageView('tabletop','warmbeer');");
getURL ("http://www.carling.com/football/entertainment/table_top_football/");
};
}
Instance of Symbol 2400 MovieClip in Symbol 2401 MovieClip Frame 65
onClipEvent (load) {
this.onPress = function () {
getURL ("javascript:_hbPageView('bar','warmbeer');");
getURL ("http://www.carling.com/bored/brave-the-bar/");
};
}
Instance of Symbol 2400 MovieClip in Symbol 2401 MovieClip Frame 65
onClipEvent (load) {
this.onPress = function () {
getURL ("javascript:_hbPageView('wall','warmbeer');");
getURL ("http://www.carling.com/bored/penalty/");
};
}
Symbol 2402 MovieClip Frame 1
_visible = false;
_alpha = 100;
stop();
Symbol 2402 MovieClip Frame 2
function initButtons() {
titlepage.buttonsHolder.playButton.onRelease = function () {
killButtons();
getURL ("javascript:_hbPageView('play','warmbeer');");
titlepage.couple.gotoAndStop(titlepage.couple._currentframe);
_parent.attractModeKill();
};
titlepage.buttonsHolder.instructionsButton.onRelease = function () {
killButtons();
gotoAndPlay ("instructions");
};
titlepage.buttonsHolder.hiScoresButton.onRelease = function () {
killButtons();
gotoAndPlay ("displayScores");
};
titlepage.buttonsHolder.sendButton.onRelease = function () {
killButtons();
gotoAndPlay ("sendToAFriend");
};
}
function killButtons() {
this=_root.attract;//parameter overwritten
_root.attract;
delete this.onEnterFrame;
delete titlepage.buttonsHolder.playButton.onRelease;
delete titlepage.buttonsHolder.instructionsButton.onRelease;
delete titlepage.buttonsHolder.hiScoresButton.onRelease;
delete titlepage.buttonsHolder.sendButton.onRelease;
}
_alpha = 100;
_visible = true;
this.titlepage.onEnterFrame = function () {
if (this.buttonsHolder._currentframe == this.buttonsHolder._totalframes) {
initButtons();
this.onEnterFrame = function () {
if (Key.isDown(32)) {
delete this.onEnterFrame;
killButtons();
titlepage.couple.gotoAndStop(titlepage.couple._currentframe);
titlepage.buttonsHolder.playButton.gotoAndStop(2);
_parent.attractModeKill();
}
};
}
};
stop();
Symbol 2402 MovieClip Frame 13
stop();
Symbol 2402 MovieClip Frame 22
stop();
Symbol 2402 MovieClip Frame 33
stop();
Symbol 2402 MovieClip Frame 45
_parent.titleText.fireVideo.gotoAndPlay(_parent.titleText.fireVideo._currentframe);
stop();
Symbol 2402 MovieClip Frame 56
_parent.titleText.fireVideo.gotoAndPlay(_parent.titleText.fireVideo._currentframe);
stop();
Symbol 2402 MovieClip Frame 66
stop();
Symbol 2410 MovieClip Frame 1
stop();
Symbol 2434 MovieClip Frame 1
stop();
Symbol 2446 MovieClip Frame 1
stop();
Instance of Symbol 2439 MovieClip "scoreClip" in Symbol 2447 MovieClip Frame 1
onClipEvent (load) {
function plotScore() {
var _local8 = _root.score;
var _local3 = _local8.toString();
var _local7;
while (_local3.length < 6) {
_local7 = "0" + _local3;
_local3 = _local7;
}
var _local4;
var _local6 = 6;
var _local5 = -1;
while (_local5++ , _local5 != 6) {
_local4 = _local3.charCodeAt(_local5);
_local4 = _local4 - 47;
this["digit" + _local6].gotoAndStop(_local4);
_local6--;
}
myfunc = null;
}
var d1 = ((d2 = (d3 = (d4 = (d5 = (d6 = 0))))));
myfunc = plotScore;
}
onClipEvent (enterFrame) {
myfunc();
}
Instance of Symbol 2446 MovieClip "soundToggle" in Symbol 2447 MovieClip Frame 1
onClipEvent (load) {
if (_global.masterVolume == 100) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
this.onPress = function () {
_root.toggleSound();
};
}
Instance of Symbol 2446 MovieClip "soundToggle" in Symbol 2457 MovieClip Frame 1
onClipEvent (load) {
if (masterVolume == 100) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
}
Symbol 2457 MovieClip Frame 20
_parent.infoModule._visible = true;
Symbol 2457 MovieClip Frame 50
stop();