Instance of Symbol 417 MovieClip "mcLoader" in Frame 1
onClipEvent (load) {
_root.stop();
}
onClipEvent (enterFrame) {
i = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
txtPercentLoaded = i;
trace((((i + " getBytesLoaded:") + _root.getBytesLoaded()) + " getBytesTotal:") + _root.getBytesTotal());
if (i >= 100) {
this.gotoAndStop(2);
}
}
Frame 231
function setDefaultKeys() {
keyQualityToggle = 79;
keyMusicOnOff = 77;
keyPauseGame = 80;
trace("setting default keys");
key_pLMoveRight = 68;
key_pLMoveLeft = 65;
key_pLMoveUp = 87;
key_pLMoveDown = 83;
key_pLWalking = 16;
key_pLNextWeapon = 69;
key_pLPrevWeapon = 81;
key_pLUse = 32;
}
function displayKeyAssignments() {
arrKeyCodeValue = new Array();
arrKeyCodeValue[8] = "Backspace";
arrKeyCodeValue[9] = "Tab";
arrKeyCodeValue[12] = "Clear";
arrKeyCodeValue[13] = "Enter";
arrKeyCodeValue[16] = "Shift";
arrKeyCodeValue[17] = "Control";
arrKeyCodeValue[18] = "Alt";
arrKeyCodeValue[20] = "Caps Lock";
arrKeyCodeValue[27] = "Esc";
arrKeyCodeValue[32] = "Spacebar";
arrKeyCodeValue[33] = "Page Up";
arrKeyCodeValue[34] = "Page Down";
arrKeyCodeValue[35] = "End";
arrKeyCodeValue[36] = "Home";
arrKeyCodeValue[37] = "Left Arrow";
arrKeyCodeValue[38] = "Up Arrow";
arrKeyCodeValue[39] = "Right Arrow";
arrKeyCodeValue[40] = "Down Arrow";
arrKeyCodeValue[45] = "Insert";
arrKeyCodeValue[46] = "Delete";
arrKeyCodeValue[47] = "Help";
arrKeyCodeValue[48] = "0";
arrKeyCodeValue[49] = "1";
arrKeyCodeValue[50] = "2";
arrKeyCodeValue[51] = "3";
arrKeyCodeValue[52] = "4";
arrKeyCodeValue[53] = "5";
arrKeyCodeValue[54] = "6";
arrKeyCodeValue[55] = "7";
arrKeyCodeValue[56] = "8";
arrKeyCodeValue[57] = "9";
arrKeyCodeValue[65] = "A";
arrKeyCodeValue[66] = "B";
arrKeyCodeValue[67] = "C";
arrKeyCodeValue[68] = "D";
arrKeyCodeValue[69] = "E";
arrKeyCodeValue[70] = "F";
arrKeyCodeValue[71] = "G";
arrKeyCodeValue[72] = "H";
arrKeyCodeValue[73] = "I";
arrKeyCodeValue[74] = "J";
arrKeyCodeValue[75] = "K";
arrKeyCodeValue[76] = "L";
arrKeyCodeValue[77] = "M";
arrKeyCodeValue[78] = "N";
arrKeyCodeValue[79] = "O";
arrKeyCodeValue[80] = "P";
arrKeyCodeValue[81] = "Q";
arrKeyCodeValue[82] = "R";
arrKeyCodeValue[83] = "S";
arrKeyCodeValue[84] = "T";
arrKeyCodeValue[85] = "U";
arrKeyCodeValue[86] = "V";
arrKeyCodeValue[87] = "W";
arrKeyCodeValue[88] = "X";
arrKeyCodeValue[89] = "Y";
arrKeyCodeValue[90] = "Z";
arrKeyCodeValue[96] = "Numpad 0";
arrKeyCodeValue[97] = "Numpad 1";
arrKeyCodeValue[98] = "Numpad 2";
arrKeyCodeValue[99] = "Numpad 3";
arrKeyCodeValue[100] = "Numpad 4";
arrKeyCodeValue[101] = "Numpad 5";
arrKeyCodeValue[102] = "Numpad 6";
arrKeyCodeValue[103] = "Numpad 7";
arrKeyCodeValue[104] = "Numpad 8";
arrKeyCodeValue[105] = "Numbpad 9";
arrKeyCodeValue[106] = "Numpad Multiply";
arrKeyCodeValue[107] = "Numpad Add";
arrKeyCodeValue[108] = "Numpad Enter";
arrKeyCodeValue[109] = "Numpad Subtract";
arrKeyCodeValue[110] = "Numpad Decimal";
arrKeyCodeValue[111] = "Numpad Divide";
arrKeyCodeValue[112] = "F1";
arrKeyCodeValue[113] = "F2";
arrKeyCodeValue[114] = "F3";
arrKeyCodeValue[115] = "F4";
arrKeyCodeValue[116] = "F5";
arrKeyCodeValue[117] = "F6";
arrKeyCodeValue[118] = "F7";
arrKeyCodeValue[119] = "F8";
arrKeyCodeValue[120] = "F9";
arrKeyCodeValue[121] = "F10";
arrKeyCodeValue[122] = "F11";
arrKeyCodeValue[123] = "F12";
arrKeyCodeValue[124] = "F13";
arrKeyCodeValue[125] = "F14";
arrKeyCodeValue[126] = "F15";
arrKeyCodeValue[144] = "Num Lock";
arrKeyCodeValue[186] = ";";
arrKeyCodeValue[187] = "=";
arrKeyCodeValue[189] = "-";
arrKeyCodeValue[191] = "/";
arrKeyCodeValue[192] = "`";
arrKeyCodeValue[219] = "[";
arrKeyCodeValue[220] = "\\";
arrKeyCodeValue[221] = "]";
arrKeyCodeValue[222] = "'";
menuWindowMC.keyRotateLeftMC.txtKey = arrKeyCodeValue[keyRotateLeft];
menuWindowMC.keyRotateRightMC.txtKey = arrKeyCodeValue[keyRotateRight];
menuWindowMC.keyThrustOnMC.txtKey = arrKeyCodeValue[keyThrustOn];
menuWindowMC.keyQualityToggleMC.txtKey = arrKeyCodeValue[keyQualityToggle];
menuWindowMC.keyMusicOnOffMC.txtKey = arrKeyCodeValue[keyMusicOnOff];
trace("displaying key " + arrKeyCodeValue[221]);
trace("displaying key " + arrKeyCodeValue[221]);
}
function displayKeyValue(obj) {
obj.status = "none";
obj.txtKey = _root.arrKeyCodeValue[_root[obj._name]];
}
function setKeyValue(obj) {
if (obj.status == "selected") {
obj.status = "none";
_root[obj._name] = Key.getCode();
obj.txtKey = _root.arrKeyCodeValue[_root[obj._name]];
}
obj.gotoAndStop(1);
}
function highlightKey(obj) {
if (obj.hitTest(_root._xmouse, _root._ymouse, 1)) {
obj.status = "selected";
obj.gotoAndStop(2);
} else {
obj.status = "none";
obj.gotoAndStop(1);
}
}
function getAngle2toAngle1direction(angle1, angle2) {
angleDiff = angle1 - angle2;
if ((angle1 * angle2) < 0) {
if (angle1 < 0) {
angle1 = angle1 + 180;
angleDiff = -(angle1 - angle2);
} else {
angle2 = angle2 + 180;
angleDiff = -(angle1 - angle2);
}
}
if (angleDiff > 0) {
return(1);
}
return(-1);
}
function setCutSceneDialogue() {
trace((("dialogueArr " + g_missionNo) + "_") + g_taskNo);
dialogueArr = [];
switch ((g_missionNo + "_") + g_taskNo) {
case "1_1" :
addNewDialogueLine("Sp", "Excellent! You're ready for some real challenges.");
addNewDialogueLine("Demon", "Grrrr.");
addNewDialogueLine("Sam", "What the hell is that !?!");
addNewDialogueLine("Sp", "Oh, that's your playmate. You're going to have an encounter \nlater. But first things first. Are you afraid of the dark, Sam?");
addNewDialogueLine("Sam", "Not really.");
addNewDialogueLine("Sp", "Good. Your first real assignment should be easy for you. \nAlmost forgot, be careful of thezz grzzz zz z zzzzzzzzzzz");
addNewDialogueLine("Sam", "The what?");
break;
case "1_2" :
addNewDialogueLine("Spider", "Hello Sam. I've been waiting for you.");
addNewDialogueLine("Sam", "Really? I'm honored.");
addNewDialogueLine("Spider", "Yes, you see I haven't eaten in a while. Not many make \nit this far.");
addNewDialogueLine("Sam", "Something tells me that I don't feel like being your dinner.");
addNewDialogueLine("Spider", "We shall see\u2026");
break;
case "1_3" :
addNewDialogueLine("Sam", "As I told you\u2026");
addNewDialogueLine("Sam", "I'm definitely no spider food!");
break;
case "1_4" :
addNewDialogueLine("Wasp", "Ah, if it isn't little tiny Sammy boyo. It's a pleasure to meet you.");
addNewDialogueLine("Wasp", "Too bad it is our last encounter.");
addNewDialogueLine("Sam", "Oh great! Let me see, where have I heard that before?");
break;
case "1_5" :
addNewDialogueLine("Sam", "Piece of cake. I wonder what's next.");
break;
case "1_6" :
addNewDialogueLine("Demon", "Hello Sam. I've been watching you. Every move you made.");
addNewDialogueLine("Sam", "Even when I was doing my business?! You're a pervert! \nI want my privacy!!");
addNewDialogueLine("Demon", "Don't be silly, Sammy boy! I'm not interested in that. I was \nlooking for your strengths.");
addNewDialogueLine("Sam", "Haha! You must be scared!");
addNewDialogueLine("Demon", "Actually, you don't seem to have any strengths. \nOnly weaknesses. Muhahaha!!!");
addNewDialogueLine("Sam", "Ah, great. Here we go again with the \"mind games\"! \n Can we get on with it?");
addNewDialogueLine("Demon", "As you wish, Sammy boy.");
break;
case "1_7" :
addNewDialogueLine("Sam", "Phew, done");
addNewDialogueLine("Sp", "Great work Sam! Now my demon head collection is complete. \n Take a look.");
addNewDialogueLine("None", "");
addNewDialogueLine("Sam", "All, that effort for you to have your collections complete!?");
addNewDialogueLine("Sp", "Yes. Sweet, ha?");
addNewDialogueLine("Sam", "I've been meaning to ask you something. Where am I?");
addNewDialogueLine("Sp", "Ah, more questions. Good. Unfortunately, all I can say is \nthat answers will come later.");
addNewDialogueLine("Sp", "Take some rest until your second assignment. You'll need it.");
addNewDialogueLine("None", "");
break;
}
testArray = dialogueArr;
arrNo = testArray.length;
while ((arrNo--) > 0) {
trace(((((" tempEnemyArr :: " + arrNo) + " :: ") + testArray[arrNo][0]) + " :: ") + testArray[arrNo][1]);
}
}
function addNewDialogueLine(currSpeaker, currText) {
trace("addNewDialogueLine");
moveToNextFrame = true;
dialogueArr.push([currSpeaker, currText, moveToNextFrame]);
}
function continueDialogue() {
trace(((dialogueArr.length + dialogueArr[0][0]) + " ") + dialogueArr[0][1]);
if (dialogueArr.length == 0) {
_root.game_start();
} else {
menuWindowMC.cutScenesMC.speakerHeadMC.gotoAndStop(dialogueArr[0][0]);
menuWindowMC.cutScenesMC.txtDialogue = dialogueArr[0][1];
if (dialogueArr[0][2]) {
menuWindowMC.cutScenesMC.nextFrame();
}
dialogueArr.splice(0, 1);
}
}
function updateTimer(time) {
temp60s = int(time / 60);
temp10s = int((time - (temp60s * 60)) / 10);
temp1s = int((time - (temp60s * 60)) - (temp10s * 10));
displayDigit(time_60s_MC, temp60s);
displayDigit(time_10s_MC, temp10s);
displayDigit(time_1s_MC, temp1s);
}
function displayDigit(numericDigit, value) {
if (value == 0) {
numericDigit.gotoAndStop(10);
} else {
numericDigit.gotoAndStop(value);
}
}
function playSound(sndOwner, sndOwnerMC, soundType, percentToPlay) {
trace((((("PLAYING SOUND: sndOwner: " + sndOwner) + " soundType: ") + soundType) + " sndOwnerMC: ") + sndOwnerMC);
trace((((("PLAYING SOUND: sndOwner: " + sndOwner) + " soundType: ") + soundType) + " sndOwnerMC: ") + sndOwnerMC);
trace((((("PLAYING SOUND: sndOwner: " + sndOwner) + " soundType: ") + soundType) + " sndOwnerMC: ") + sndOwnerMC);
trace((((("PLAYING SOUND: sndOwner: " + sndOwner) + " soundType: ") + soundType) + " sndOwnerMC: ") + sndOwnerMC);
trace((((("PLAYING SOUND: sndOwner: " + sndOwner) + " soundType: ") + soundType) + " sndOwnerMC: ") + sndOwnerMC);
trace((((("PLAYING SOUND: sndOwner: " + sndOwner) + " soundType: ") + soundType) + " sndOwnerMC: ") + sndOwnerMC);
trace((((("PLAYING SOUND: sndOwner: " + sndOwner) + " soundType: ") + soundType) + " sndOwnerMC: ") + sndOwnerMC);
trace((((("PLAYING SOUND: sndOwner: " + sndOwner) + " soundType: ") + soundType) + " sndOwnerMC: ") + sndOwnerMC);
if (Math_random() < percentToPlay) {
arrNo = soundArr.length;
while ((arrNo--) > 0) {
soundObj = soundArr[arrNo];
if ((sndOwner == soundObj.owner) && (soundType == soundObj.soundType)) {
if (soundType == "getsHurt") {
soundNo = 1 + int(soundObj.noOfSounds * Math_random());
} else {
soundNo = "";
}
sndOwnerMC = new Sound();
sndOwnerMC.attachSound(soundObj.soundName + soundNo);
sndOwnerMC.start(0.1, 1);
trace((("PLAYING SOUND: soundObj.soundName + soundNo: " + soundObj.soundName) + soundNo) + "~~");
}
}
}
}
Abs = Math.abs;
GetTimer = getTimer;
Math_random = Math.random;
function bgndObj(type, distance, doorSide) {
this.type = type;
this.distance = distance;
this.doorSide = doorSide;
}
function removeAttachedMCs() {
temp_pL_MC = game_MC.pL_MC;
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
removeMovieClip("game_MC.pL_MC");
trace(" temp_pL_MC gone ------------------------");
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
trace(" temp_pL_MC :: " + temp_pL_MC);
removeMovieClip("game_MC.projectileAttachMC");
removeMovieClip("game_MC.pickUpItemMC");
removeMovieClip("game_MC.enemyAttachMC");
removeMovieClip("game_MC.ricochetAttachMC");
removeMovieClip("game_MC.smokeTrailAttachMC");
removeMovieClip("game_MC.explosionParticleAttachMC");
removeMovieClip("game_MC.bgndMC");
removeMovieClip("game_MC.platformMC");
}
function checkLevelCode(levelCode) {
levelCodeArrNo = levelCodeArr.length;
trace("levelCode: " + levelCode);
invalidCode = true;
i = 1;
while (i < levelCodeArr.length) {
j = 1;
while (j < levelCodeArr[i].length) {
trace((((((levelCode + " levelCodeArr[") + i) + "][") + j) + "]: ") + levelCodeArr[i][j].code);
if (levelCode == levelCodeArr[i][j].code) {
eval (("menuWindowMC.mission_" + i) + "_tasks_MC").gotoAndStop("mission_" + i);
k = 1;
while (k < j) {
eval (("menuWindowMC.mission_" + i) + "_tasks_MC").nextFrame();
k++;
}
levelCodeArr[i][j].unlocked = true;
k = 1;
while (k <= j) {
levelCodeArr[i][k].unlocked = true;
k++;
}
invalidCode = false;
trace((((("unlocked mission: " + i) + " task: ") + j) + " with code ") + levelCodeArr[i][j].code);
}
j++;
}
i++;
}
i = 1;
while (i < levelCodeArr.length) {
j = 1;
while (j < levelCodeArr[i].length) {
trace((((("levelCodeArr[" + i) + "][") + j) + "]: ") + levelCodeArr[i][j].unlocked);
j++;
}
i++;
}
if (invalidCode) {
menuWindowMC.txtLevelCode = "Invalid Code";
}
}
function displayUnlockedLevels() {
i = 1;
while (i < levelCodeArr.length) {
j = 1;
while (j < levelCodeArr[i].length) {
if (levelCodeArr[i][j].unlocked) {
eval (("menuWindowMC.mission_" + i) + "_tasks_MC").gotoAndStop("mission_" + i);
k = 1;
while (k < j) {
eval (("menuWindowMC.mission_" + i) + "_tasks_MC").nextFrame();
k++;
}
}
j++;
}
i++;
}
}
function game_start() {
stopAllSounds();
g_stat = "play";
_quality = game_quality;
if (playGameMusic) {
musicSndNo = 1;
musicSnd = new Sound();
musicSnd.attachSound("music" + musicSndNo);
musicSnd.start(0, 1000);
}
menuWindowMC.gotoAndStop("game_start");
onEnterFrame = onEnterFrame_game;
onMouseDown = onMouseDown_game;
onMouseUp = onMouseUp_game;
createEmptyMovieClip("_keyListener", 1);
Key.addListener(_keyListener);
_keyListener.onKeyDown = onKeyDown_game;
menuWindowMC.swapDepths(1000);
game_MC.crossHairMC.swapDepths(1050);
gameCoverMC.swapDepths(1100);
Mouse.hide();
game_MC.doorButtonsMC.swapDepths(1030);
game_MC.doorButtonsMC._visible = false;
trace("====================== > pL.health: " + pL.health);
trace("====================== > pL.currentMission: " + pL.currentMission);
trace("====================== > g_missionNo: " + g_missionNo);
if (pL.currentMission != g_missionNo) {
pL = new Player(levelCodeArr[g_missionNo][g_taskNo].pL_x, levelCodeArr[g_missionNo][g_taskNo].pL_y, 100, "F00000", 100);
pL_changeWeapon(0);
} else {
pL.x = levelCodeArr[g_missionNo][g_taskNo].pL_x;
pL.y = levelCodeArr[g_missionNo][g_taskNo].pL_y;
}
game_MC.attachMovie("stickman", "pL_MC", pL.layerDepth);
pL_changeWeapon(1);
pL_changeWeapon(-1);
statusWindowMC.pL_heathMC.barMC._xscale = (pL.health = 100);
statusWindowMC.pL_ReloadMC.barMC._xscale = 100;
pL.target = "game_MC.pL_MC";
[pL.target]._x = pL.x;
[pL.target]._y = pL.y;
pL_mouseDown = false;
i = 0;
while (i < pL_weaponsArr.length) {
trace("------------pL_weaponsArr[i].type: " + pL_weaponsArr[i].type);
trace("------------pL_weaponsArr[i].available: " + pL_weaponsArr[i].available);
trace("------------pL_weaponsArr[i].currReloadFr: " + pL_weaponsArr[i].currReloadFr);
pL_weaponsArr[i].currReloadFr = 0;
i++;
}
trace("-------------------------- pL.currWeaponNo: " + pL.currWeaponNo);
pL.status = "walk";
trace("-------------------------- pL.currentMission: " + pL.currentMission);
if (pL.currentMission != g_missionNo) {
switch (g_missionNo) {
case 0 :
pL_setWeaponAmmo([0, 0, 0, 0, 0, 0, 0, 0, 0]);
pL_setWeaponAmmo(["inf", "inf", "inf", "inf", "inf", "inf", "inf", "inf", "inf"]);
roomArr = [];
roomArr[1] = {bufferTop:130, bufferBot:180, bufferLeft:30, bufferRight:400};
setRoomConnections(1, 4, 0, 0, 2);
doorArr = [];
doorArr.push({roomNo:1, doorNo:1, x:100, y:180, type:"noDoor", connRoom:2, connDoor:2});
doorArr.push({roomNo:1, doorNo:2, x:150, y:180, type:"noDoor", connRoom:2, connDoor:1});
doorArr.push({roomNo:1, doorNo:3, x:190, y:180, type:"knob", connRoom:2, connDoor:3});
doorArr.push({roomNo:1, doorNo:3, x:300, y:roomArr[1].bufferBot, type:"finishedMission", connRoom:4, connDoor:1});
doorArr.push({roomNo:2, doorNo:1, x:100, y:180, type:"noDoor", connRoom:1, connDoor:2});
doorArr.push({roomNo:2, doorNo:2, x:150, y:180, type:"noDoor", connRoom:1, connDoor:1});
doorArr.push({roomNo:2, doorNo:3, x:190, y:180, type:"knob", connRoom:1, connDoor:3});
pickUpItemArr = [];
pickUpItemArr.push(new pickUpItem(true, 1, 1, 150, 180, "uzi", 30));
pickUpItemArr.push(new pickUpItem(true, 2, 1, 150, 180, "health", 10));
break;
case 1 :
trace("-------------------------- pL.currentMission: " + pL.currentMission);
pL.currentMission = g_missionNo;
trace("-------------------------- pL.currentMission: " + pL.currentMission);
pL_setWeaponAmmo(["inf", "inf", "inf", "inf", "inf", "inf", "inf", "inf", "inf"]);
pL_setWeaponAmmo(["inf", 0, 0, 0, 0, 0, 0, 0, 0]);
roomArr = [];
i = 1;
while (i <= 42) {
roomArr[i] = {bufferTop:40, bufferBot:280, bufferLeft:0, bufferRight:440};
i++;
}
setRoomConnections(1, 4, 0, 0, 2);
setRoomConnections(2, 0, 0, 1, 3);
setRoomConnections(3, 0, 0, 2, 4);
setRoomConnections(4, 0, 0, 3, 5);
setRoomConnections(5, 0, 6, 4, 0);
setRoomConnections(6, 5, 0, 7, 0);
setRoomConnections(7, 0, 0, 8, 6);
setRoomConnections(8, 0, 0, 9, 7);
setRoomConnections(9, 0, 12, 10, 8);
setRoomConnections(10, 0, 11, 5, 9);
setRoomConnections(11, 10, 0, 0, 12);
setRoomConnections(12, 9, 0, 11, 13);
setRoomConnections(13, 0, 16, 12, 14);
setRoomConnections(14, 0, 15, 13, 19);
setRoomConnections(15, 14, 0, 16, 0);
setRoomConnections(16, 13, 0, 17, 15);
setRoomConnections(17, 0, 0, 18, 16);
setRoomConnections(18, 0, 0, 0, 17);
setRoomConnections(19, 0, 0, 14, 20);
setRoomConnections(20, 22, 21, 19, 0);
setRoomConnections(21, 20, 0, 0, 0);
setRoomConnections(22, 23, 20, 0, 0);
setRoomConnections(23, 24, 22, 0, 0);
setRoomConnections(24, 25, 23, 0, 0);
setRoomConnections(25, 26, 24, 28, 0);
setRoomConnections(26, 0, 25, 29, 27);
setRoomConnections(27, 0, 0, 26, 0);
setRoomConnections(28, 29, 38, 37, 25);
setRoomConnections(29, 0, 28, 30, 26);
setRoomConnections(30, 0, 0, 31, 29);
setRoomConnections(31, 0, 0, 32, 30);
setRoomConnections(32, 0, 35, 33, 31);
setRoomConnections(33, 0, 34, 0, 32);
setRoomConnections(34, 33, 42, 0, 35);
setRoomConnections(35, 32, 41, 34, 36);
setRoomConnections(36, 0, 0, 35, 37);
setRoomConnections(37, 0, 0, 36, 28);
setRoomConnections(38, 28, 0, 39, 0);
setRoomConnections(39, 0, 0, 40, 38);
setRoomConnections(40, 0, 0, 41, 39);
setRoomConnections(41, 35, 0, 0, 40);
setRoomConnections(42, 340, 0, 0, 0);
doorArr = [];
testing_only = false;
if (testing_only) {
doorArr.push({roomNo:1, doorNo:0, x:220, y:180, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:4, doorNo:0, x:280, y:180, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:7, doorNo:0, x:400, y:180, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:10, doorNo:0, x:380, y:120, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:14, doorNo:0, x:50, y:200, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:20, doorNo:0, x:50, y:250, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:24, doorNo:0, x:220, y:140, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:26, doorNo:0, x:70, y:230, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:30, doorNo:0, x:220, y:260, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:32, doorNo:0, x:70, y:190, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:37, doorNo:0, x:360, y:250, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:40, doorNo:0, x:220, y:130, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:34, doorNo:0, x:220, y:260, type:"doublesliding", noOfDoors:30});
}
doorArr.push({roomNo:2, doorNo:1, x:340, y:180, type:"noDoor", connRoom:1002, connDoor:1});
doorArr.push({roomNo:6, doorNo:1, x:340, y:180, type:"noDoor", connRoom:1006, connDoor:1});
doorArr.push({roomNo:8, doorNo:1, x:140, y:200, type:"noDoor", connRoom:1008, connDoor:1});
doorArr.push({roomNo:10, doorNo:1, x:50, y:130, type:"noDoor", connRoom:1010, connDoor:1});
doorArr.push({roomNo:18, doorNo:1, x:60, y:200, type:"noDoor", connRoom:1018, connDoor:1});
doorArr.push({roomNo:23, doorNo:1, x:40, y:200, type:"noDoor", connRoom:1023, connDoor:1});
doorArr.push({roomNo:27, doorNo:1, x:360, y:230, type:"noDoor", connRoom:1027, connDoor:1});
doorArr.push({roomNo:28, doorNo:2, x:260, y:250, type:"noDoor", connRoom:1028, connDoor:2});
doorArr.push({roomNo:28, doorNo:1, x:180, y:250, type:"noDoor", connRoom:1028, connDoor:1});
doorArr.push({roomNo:34, doorNo:1, x:360, y:150, type:"noDoor", connRoom:1034, connDoor:1});
doorArr.push({roomNo:35, doorNo:1, x:190, y:260, type:"noDoor", connRoom:1035, connDoor:1});
doorArr.push({roomNo:39, doorNo:1, x:360, y:130, type:"noDoor", connRoom:1039, connDoor:1});
doorArr.push({roomNo:1002, doorNo:1, x:340, y:180, type:"noDoor", connRoom:2, connDoor:1});
doorArr.push({roomNo:1006, doorNo:1, x:340, y:180, type:"noDoor", connRoom:6, connDoor:1});
doorArr.push({roomNo:1008, doorNo:1, x:140, y:200, type:"noDoor", connRoom:8, connDoor:1});
doorArr.push({roomNo:1010, doorNo:1, x:50, y:130, type:"noDoor", connRoom:10, connDoor:1});
doorArr.push({roomNo:1018, doorNo:1, x:60, y:200, type:"noDoor", connRoom:18, connDoor:1});
doorArr.push({roomNo:1023, doorNo:1, x:40, y:200, type:"noDoor", connRoom:23, connDoor:1});
doorArr.push({roomNo:1027, doorNo:1, x:360, y:230, type:"noDoor", connRoom:27, connDoor:1});
doorArr.push({roomNo:1028, doorNo:2, x:260, y:250, type:"noDoor", connRoom:28, connDoor:2});
doorArr.push({roomNo:1028, doorNo:1, x:180, y:250, type:"noDoor", connRoom:28, connDoor:1});
doorArr.push({roomNo:1034, doorNo:1, x:360, y:150, type:"noDoor", connRoom:34, connDoor:1});
doorArr.push({roomNo:1035, doorNo:1, x:190, y:260, type:"noDoor", connRoom:35, connDoor:1});
doorArr.push({roomNo:1039, doorNo:1, x:360, y:130, type:"noDoor", connRoom:39, connDoor:1});
pickUpItemArr = [];
pickUpItemArr.push(new pickUpItem(true, 19, 1, 351, 250, "uzi", 20));
pickUpItemArr.push(new pickUpItem(true, 19, 2, 379, 250, "blasterGun", 20));
pickUpItemArr.push(new pickUpItem(true, 31, 1, 56, 259, "uzi", 40));
pickUpItemArr.push(new pickUpItem(true, 31, 3, 113, 259, "flameThrower", 30));
pickUpItemArr.push(new pickUpItem(true, 31, 2, 85, 259, "machineGun", 40));
pickUpItemArr.push(new pickUpItem(true, 42, 1, 322, 259, "uzi", 30));
pickUpItemArr.push(new pickUpItem(true, 42, 3, 379, 259, "flameThrower", 50));
pickUpItemArr.push(new pickUpItem(true, 42, 2, 351, 259, "machineGun", 40));
pickUpItemArr.push(new pickUpItem(true, 1002, 1, 280, 180, "blasterGun", 20));
pickUpItemArr.push(new pickUpItem(true, 1006, 1, 280, 180, "blasterGun", 20));
pickUpItemArr.push(new pickUpItem(true, 1008, 1, 179, 200, "health", 25));
pickUpItemArr.push(new pickUpItem(true, 1008, 2, 207, 200, "blasterGun", 20));
pickUpItemArr.push(new pickUpItem(true, 1010, 1, 92, 130, "uzi", 20));
pickUpItemArr.push(new pickUpItem(true, 1010, 2, 121, 130, "blasterGun", 20));
pickUpItemArr.push(new pickUpItem(true, 1018, 1, 103, 200, "health", 25));
pickUpItemArr.push(new pickUpItem(true, 1018, 2, 131, 200, "machineGun", 20));
pickUpItemArr.push(new pickUpItem(true, 1023, 1, 169, 200, "machineGun", 20));
pickUpItemArr.push(new pickUpItem(true, 1027, 1, 312, 230, "flameThrower", 20));
pickUpItemArr.push(new pickUpItem(true, 1028, 1, 85, 250, "health", 25));
pickUpItemArr.push(new pickUpItem(true, 1028, 2, 364, 250, "health", 25));
pickUpItemArr.push(new pickUpItem(true, 1034, 1, 255, 150, "uzi", 20));
pickUpItemArr.push(new pickUpItem(true, 1034, 2, 284, 150, "flameThrower", 25));
pickUpItemArr.push(new pickUpItem(true, 1035, 1, 76, 260, "health", 25));
pickUpItemArr.push(new pickUpItem(true, 1035, 2, 104, 260, "uzi", 20));
pickUpItemArr.push(new pickUpItem(true, 1035, 3, 133, 260, "flameThrower", 20));
pickUpItemArr.push(new pickUpItem(true, 1039, 2, 236, 130, "machineGun", 20));
break;
case 2 :
break;
}
}
g_roomNo = levelCodeArr[g_missionNo][g_taskNo].roomNo;
room_init();
game_FrNo = 0;
startTime = getTimer();
levelCompleteCounter = 0;
statusWindowMC.missionMessageMC._visible = false;
statusWindowMC.missionMessageMC.gotoAndStop(1);
trace("=============================================================");
trace("levelAllowedTime " + levelAllowedTime);
trace("g_missionType " + g_missionType);
}
function setRoomConnections(roomNo, topNo, bottomNo, leftNo, rightNo) {
roomArr[roomNo].top = topNo;
roomArr[roomNo].bottom = bottomNo;
roomArr[roomNo].left = leftNo;
roomArr[roomNo].right = rightNo;
}
function room_init() {
currRoom_FrNo = 0;
projectileArr = [];
explosionParticleArr = [];
platformArr = [];
fadeAwayArr = [];
noOfBgndItemCreated = 0;
game_MC.createEmptyMovieClip("bgndMC", 20);
noOfpickUpItemCreated = 0;
game_MC.createEmptyMovieClip("pickUpItemMC", 40);
noOfEnemyCreated = 0;
game_MC.createEmptyMovieClip("enemyAttachMC", 60);
noOfPlatformCreated = 0;
game_MC.createEmptyMovieClip("platformMC", 120);
noOfExplosionParticleCreated = 0;
game_MC.createEmptyMovieClip("ExplosionParticleAttachMC", 140);
pL_noOfProjCreated = 0;
game_MC.createEmptyMovieClip("projectileAttachMC", 160);
noOfSmokeTrailCreated = 0;
game_MC.createEmptyMovieClip("smokeTrailAttachMC", 180);
noOfRicochetCreated = 0;
game_MC.createEmptyMovieClip("ricochetAttachMC", 200);
game_MC.bgnd_MC.gotoAndStop("mission_" + g_missionNo);
i = 1;
while (i < g_roomNo) {
game_MC.bgnd_MC.nextFrame();
i++;
}
roomBufferTop = 40;
roomBufferBottom = sh - 40;
roomBufferLeft = 0;
roomBufferRight = sw;
trace("----------- room_init----------------------");
trace((("g_missionNo: " + g_missionNo) + " :: g_roomNo: ") + g_roomNo);
trace("roomBufferTop: " + roomBufferTop);
trace("roomBufferBottom: " + roomBufferBottom);
switch (g_missionNo) {
case 0 :
switch (g_roomNo) {
case 1 :
createPlatform("black", 0, 180, 440, 101.15);
createPlatform("black", 0, 40.4, 440, 90);
createPlatform("black", 0, 40.4, 30, 240);
createPlatform("black", 400, 40, 40, 240);
break;
case 2 :
createPlatform("black", 0, 180, 440, 101.15);
createPlatform("black", 0, 40.4, 440, 90);
createPlatform("black", 0, 40.4, 80, 240);
createPlatform("black", 250, 40, 190, 240);
}
break;
case 1 :
switch (g_roomNo) {
case 1 :
createPlatform("black", 0, 180, 440, 101);
createPlatform("black", 0, 40, 440, 90);
createPlatform("black", 0, 40, 30, 240);
break;
case 2 :
createPlatform("black", 0, 180, 440, 101);
createPlatform("black", 30, 40, 410, 70);
createPlatform("black", 0, 40, 30, 90);
break;
case 3 :
createPlatform("black", 0, 180, 440, 101);
createPlatform("black", 0, 40, 410, 70);
createPlatform("black", 410, 40, 30, 90);
break;
case 4 :
createPlatform("black", 0, 180, 440, 101);
createPlatform("black", 0, 40, 439, 90);
break;
case 5 :
createPlatform("black", 0, 180, 100, 140);
createPlatform("black", 0, 40, 410, 20);
createPlatform("black", 410, 40, 30, 240);
createPlatform("black", 0, 40, 10, 90);
createPlatform("black", 100, 120, 250, 20);
createPlatform("black", 163, 200, 250, 120);
createPlatform("black", 70, 120, 30, 90);
createPlatform("black", 40, 154, 40, 70);
break;
case 6 :
createPlatform("black", 0, 180, 440, 101);
createPlatform("black", 410, 40, 30, 240);
createPlatform("black", 0, 0, 100, 129);
createPlatform("black", 163, 0, 250, 129);
break;
case 7 :
createPlatform("black", 0, 180, 440, 101);
createPlatform("black", 0, 100, 100, 100);
createPlatform("black", 0, 40, 440, 10);
createPlatform("black", 385, 40, 60, 90);
createPlatform("black", 90, 130, 100, 100);
createPlatform("black", 180, 160, 100, 100);
break;
case 8 :
createPlatform("black", 0, 200, 440, 101);
createPlatform("black", 0, 40, 440, 10);
createPlatform("black", 400, 100, 100, 120);
createPlatform("black", 0, 100, 158, 25);
createPlatform("black", 0, 110, 100, 100);
createPlatform("black", 200, 130, 126, 20);
break;
case 9 :
createPlatform("black", 0, 40, 440, 10);
createPlatform("black", 240, 130, 210, 190);
createPlatform("black", 0, 130, 180, 190);
createPlatform("black", 400, 100, 50, 35);
break;
case 10 :
createPlatform("black", 0, 40, 440, 10);
createPlatform("black", 240, 130, 210, 190);
createPlatform("black", 0, 130, 180, 190);
createPlatform("black", 0, 40, 20, 100);
break;
case 11 :
createPlatform("black", 240, 0, 210, 130);
createPlatform("black", 0, 0, 180, 280);
createPlatform("black", 150, 200, 300, 100);
break;
case 12 :
createPlatform("black", 240, 0, 210, 130);
createPlatform("black", 0, 0, 180, 130);
createPlatform("black", 0, 200, 440, 100);
break;
case 13 :
createPlatform("black", 240, 200, 210, 120);
createPlatform("black", 0, 200, 180, 120);
createPlatform("black", 0, 40, 440, 90);
break;
case 14 :
createPlatform("black", 0, 200, 280, 120);
createPlatform("black", 0, 40, 440, 90);
createPlatform("black", 360, 250, 90, 70);
createPlatform("black", 390, 120, 70, 70);
break;
case 15 :
createPlatform("black", 0, 40, 140, 100);
createPlatform("black", 0, 200, 440, 100);
createPlatform("black", 360, 0, 100, 200);
createPlatform("black", 0, 0, 280, 60);
createPlatform("black", 323, 75, 50, 70);
createPlatform("black", 240, 140, 130, 80);
break;
case 16 :
createPlatform("black", 240, 0, 210, 140);
createPlatform("black", 0, 0, 180, 140);
createPlatform("black", 0, 200, 440, 100);
break;
case 17 :
createPlatform("black", 0, 40, 440, 100);
createPlatform("black", 0, 200, 440, 100);
break;
case 18 :
createPlatform("black", 0, 40, 440, 90);
createPlatform("black", 0, 200, 440, 100);
createPlatform("black", 350, 50, 90, 90);
createPlatform("black", 0, 120, 35, 90);
break;
case 19 :
createPlatform("black", 0, 40, 440, 20);
createPlatform("black", 0, 250, 440, 40);
createPlatform("black", 0, 40, 20, 220);
createPlatform("black", 420, 40, 25, 220);
break;
case 20 :
createPlatform("black", 0, 250, 200, 70);
createPlatform("black", 0, 0, 200, 190);
createPlatform("black", 280, 0, 170, 320);
createPlatform("black", 260, 200, 20, 20);
createPlatform("black", 200, 70, 20, 20);
createPlatform("black", 230, 140, 20, 20);
createPlatform("black", 0, 180, 20, 80);
break;
case 21 :
createPlatform("black", 260, 180, 20, 20);
createPlatform("black", 0, 0, 200, 290);
createPlatform("black", 280, 0, 170, 290);
createPlatform("black", 180, 250, 120, 40);
createPlatform("black", 260, 50, 20, 20);
createPlatform("black", 230, 115, 20, 20);
break;
case 22 :
createPlatform("black", 0, 250, 200, 100);
createPlatform("black", 0, 0, 200, 60);
createPlatform("black", 280, 0, 170, 320);
createPlatform("black", 20, 180, 20, 20);
createPlatform("black", 100, 130, 200, 40);
createPlatform("black", 0, 0, 20, 260);
createPlatform("black", 260, 60, 20, 20);
break;
case 23 :
createPlatform("black", 0, 200, 200, 120);
createPlatform("black", 0, 0, 200, 130);
createPlatform("black", 280, 140, 170, 180);
createPlatform("black", 400, 0, 50, 140);
createPlatform("black", 0, 0, 20, 260);
createPlatform("black", 200, 250, 20, 20);
createPlatform("black", 200, 0, 120, 60);
createPlatform("black", 380, 75, 20, 20);
break;
case 24 :
createPlatform("black", 0, 140, 320, 180);
createPlatform("black", 400, 0, 40, 320);
createPlatform("black", 380, 180, 20, 20);
createPlatform("black", 320, 250, 20, 20);
createPlatform("black", 0, 0, 150, 170);
createPlatform("black", 250, 0, 160, 80);
createPlatform("black", 140, 70, 40, 90);
break;
case 25 :
createPlatform("black", 0, 0, 150, 170);
createPlatform("black", 0, 250, 150, 70);
createPlatform("black", 250, 0, 190, 320);
createPlatform("black", 220, 180, 35, 60);
createPlatform("black", 150, 110, 20, 20);
createPlatform("black", 200, 60, 20, 20);
break;
case 26 :
createPlatform("black", 0, 0, 440, 160);
createPlatform("black", 0, 230, 150, 90);
createPlatform("black", 250, 230, 190, 90);
break;
case 27 :
createPlatform("black", 0, 0, 440, 160);
createPlatform("black", 0, 230, 440, 90);
createPlatform("black", 400, 150, 40, 90);
break;
case 28 :
createPlatform("black", 0, 0, 280, 180);
createPlatform("black", 150, 250, 300, 70);
createPlatform("black", 350, 0, 190, 180);
createPlatform("black", 0, 250, 80, 70);
createPlatform("black", 205, 170, 30, 90);
break;
case 29 :
createPlatform("black", 0, 230, 280, 90);
createPlatform("black", 0, 0, 440, 90);
createPlatform("black", 350, 230, 90, 90);
createPlatform("black", 0, 160, 200, 70);
createPlatform("black", 320, 90, 120, 60);
break;
case 30 :
createPlatform("black", 0, 260, 440, 60);
createPlatform("black", 0, 0, 440, 90);
createPlatform("black", 410, 160, 30, 120);
createPlatform("black", 0, 70, 30, 130);
break;
case 31 :
createPlatform("black", 0, 260, 440, 60);
createPlatform("black", 0, 0, 440, 70);
createPlatform("black", 410, 60, 30, 210);
createPlatform("black", 0, 60, 30, 210);
break;
case 32 :
createPlatform("black", 0, 260, 300, 60);
createPlatform("black", 0, 0, 440, 70);
createPlatform("black", 340, 60, 100, 100);
createPlatform("black", 0, 190, 200, 80);
createPlatform("black", 370, 260, 300, 60);
createPlatform("black", 420, 150, 20, 120);
break;
case 33 :
createPlatform("black", 0, 0, 440, 70);
createPlatform("black", 0, 60, 40, 260);
createPlatform("black", 120, 190, 320, 130);
createPlatform("black", 100, 255, 20, 20);
break;
case 34 :
createPlatform("black", 0, 150, 440, 50);
createPlatform("black", 0, 0, 40, 320);
createPlatform("black", 120, 0, 320, 80);
createPlatform("black", 120, 260, 440, 50);
createPlatform("black", 400, 70, 40, 90);
createPlatform("black", 40, 80, 20, 20);
break;
case 35 :
createPlatform("black", 0, 0, 300, 200);
createPlatform("black", 370, 0, 70, 200);
createPlatform("black", 0, 260, 80, 60);
createPlatform("black", 150, 260, 290, 60);
createPlatform("black", 220, 190, 40, 80);
break;
case 36 :
createPlatform("black", 0, 0, 440, 200);
createPlatform("black", 0, 260, 440, 60);
break;
case 37 :
createPlatform("black", 0, 0, 80, 200);
createPlatform("black", 70, 0, 370, 180);
createPlatform("black", 0, 260, 440, 60);
createPlatform("black", 220, 250, 230, 70);
break;
case 38 :
createPlatform("black", 150, 0, 290, 180);
createPlatform("black", 0, 0, 80, 180);
createPlatform("black", 1, 260, 440, 60);
createPlatform("black", 390, 170, 50, 100);
break;
case 39 :
createPlatform("black", 0, 0, 440, 60);
createPlatform("black", 1, 260, 440, 60);
createPlatform("black", 0, 130, 50, 140);
createPlatform("black", 130, 130, 120, 70);
createPlatform("black", 300, 130, 140, 70);
createPlatform("black", 390, 50, 50, 90);
createPlatform("black", 110, 190, 40, 20);
break;
case 40 :
createPlatform("black", 0, 0, 440, 60);
createPlatform("black", 1, 260, 440, 60);
createPlatform("black", 0, 130, 440, 140);
break;
case 41 :
createPlatform("black", 1, 240, 440, 60);
createPlatform("black", 390, 130, 50, 140);
createPlatform("black", 150, 0, 160, 200);
createPlatform("black", 0, 0, 80, 270);
createPlatform("black", 260, 0, 180, 60);
createPlatform("black", 80, 200, 20, 70);
createPlatform("black", 80, 80, 20, 50);
createPlatform("black", 130, 150, 20, 50);
break;
case 42 :
createPlatform("black", 0, 260, 440, 50);
createPlatform("black", 0, 0, 40, 320);
createPlatform("black", 120, 0, 320, 50);
createPlatform("black", 400, 40, 40, 230);
break;
case 1001 :
break;
case 1002 :
createPlatform("black", 0, 180, 440, 101);
createPlatform("black", 0, 40, 440, 90);
createPlatform("black", 0, 100, 190, 90);
createPlatform("black", 380, 100, 60, 90);
break;
case 1003 :
break;
case 1004 :
break;
case 1005 :
break;
case 1006 :
createPlatform("black", 0, 180, 440, 101);
createPlatform("black", 0, 40, 440, 90);
createPlatform("black", 0, 100, 190, 90);
createPlatform("black", 380, 100, 60, 90);
break;
case 1007 :
break;
case 1008 :
createPlatform("black", 0, 200, 440, 101);
createPlatform("black", 0, 40, 440, 110);
createPlatform("black", 340, 100, 100, 120);
createPlatform("black", 0, 110, 100, 100);
break;
case 1009 :
break;
case 1010 :
createPlatform("black", 0, 130, 440, 200);
createPlatform("black", 0, 40, 440, 40);
createPlatform("black", 0, 70, 25, 90);
createPlatform("black", 160, 60, 280, 90);
break;
case 1011 :
break;
case 1012 :
break;
case 1013 :
break;
case 1014 :
break;
case 1015 :
break;
case 1016 :
break;
case 1017 :
break;
case 1018 :
createPlatform("black", 0, 40, 440, 110);
createPlatform("black", 0, 200, 440, 100);
createPlatform("black", 170, 130, 270, 90);
createPlatform("black", 0, 130, 35, 90);
break;
case 1019 :
break;
case 1020 :
break;
case 1021 :
break;
case 1022 :
break;
case 1023 :
createPlatform("black", 0, 200, 440, 120);
createPlatform("black", 0, 0, 440, 150);
createPlatform("black", 0, 140, 20, 70);
createPlatform("black", 200, 140, 240, 70);
break;
case 1024 :
break;
case 1025 :
break;
case 1026 :
break;
case 1027 :
createPlatform("black", 0, 0, 440, 180);
createPlatform("black", 0, 230, 440, 90);
createPlatform("black", 400, 150, 40, 90);
createPlatform("black", 0, 150, 280, 90);
break;
case 1028 :
createPlatform("black", 0, 0, 440, 200);
createPlatform("black", 0, 250, 440, 70);
createPlatform("black", 390, 180, 50, 90);
createPlatform("black", 205, 180, 30, 90);
createPlatform("black", 0, 180, 50, 90);
break;
case 1029 :
break;
case 1030 :
break;
case 1031 :
break;
case 1032 :
break;
case 1033 :
break;
case 1034 :
createPlatform("black", 0, 150, 440, 171);
createPlatform("black", 0, 0, 439, 100);
createPlatform("black", 400, 80, 40, 90);
createPlatform("black", 0, 80, 220, 90);
break;
case 1035 :
createPlatform("black", 0, 0, 440, 200);
createPlatform("black", 0, 260, 440, 60);
createPlatform("black", 220, 190, 219, 80);
createPlatform("black", 0, 190, 50, 80);
break;
case 1036 :
break;
case 1037 :
break;
case 1038 :
break;
case 1039 :
createPlatform("black", 0, 0, 440, 80);
createPlatform("black", 0, 130, 440, 190);
createPlatform("black", 390, 50, 50, 90);
createPlatform("black", 0, 50, 212, 92);
break;
case 1040 :
break;
case 1041 :
break;
case 1042 :
createPlatform("generic", -10, roomBufferTop - 15, sw + 30, 15);
createPlatform("generic", -10, roomBufferBottom, sw + 30, 15);
createPlatform("generic", -10, -10, 15, sh + 30);
createPlatform("generic", sw - 5, -10, 15, sh + 30);
createPlatform("generic", 0, 190, 15, 45);
createPlatform("generic", 70, 230, 15, 45);
createPlatform("generic", 85, 215, 15, 15);
createPlatform("generic", 150, 240, 15, 15);
createPlatform("generic", 65, 160, 100, 5);
createPlatform("generic", 220, 200, 100, 15);
createPlatform("generic", -5, roomBufferBottom - 10, 100, 15);
}
break;
}
i = 0;
while (i < doorArr.length) {
if (noOfPlatformCreated > 500) {
noOfPlatformCreated = 0;
}
doorObj = doorArr[i];
if (doorObj.roomNo == g_roomNo) {
doorID = "door_" + doorObj.type;
doorBgndID = doorID + "_bgnd";
game_MC.bgndMC.attachMovie(doorBgndID, ((doorBgndID + "_") + doorObj.doorNo) + "_MC", ++noOfPlatformCreated);
doorBgndMC = eval (((("game_MC.bgndMC." + doorBgndID) + "_") + doorObj.doorNo) + "_MC");
game_MC.bgndMC.attachMovie(doorID, ((doorID + "_") + doorObj.doorNo) + "_MC", ++noOfPlatformCreated);
doorMC = eval (((("game_MC.bgndMC." + doorID) + "_") + doorObj.doorNo) + "_MC");
doorMC._x = (doorBgndMC._x = doorObj.x);
doorMC._y = (doorBgndMC._y = doorObj.y);
doorObj.target = doorMC;
doorObj.bgndTarget = doorBgndMC;
}
i++;
}
i = 0;
while (i < pickUpItemArr.length) {
if (noOfpickUpItemCreated > 500) {
noOfpickUpItemCreated = 0;
}
itemObj = pickUpItemArr[i];
if (itemObj.available && (itemObj.roomNo == g_roomNo)) {
itemID = "pickUpItem";
game_MC.pickUpItemMC.attachMovie(itemID, ((itemID + "_") + itemObj.itemNo) + "_MC", ++noOfpickUpItemCreated);
pickUpItemMC = eval (((("game_MC.pickUpItemMC." + itemID) + "_") + itemObj.itemNo) + "_MC");
pickUpItemMC.gotoAndStop(itemObj.type);
pickUpItemMC._x = itemObj.x;
pickUpItemMC._y = itemObj.y;
itemObj.w = pickUpItemMC._width;
itemObj.h = pickUpItemMC._height;
itemObj.registration = "bottomCenter";
}
i++;
}
enemyArr = [];
tempEnemyArr = [];
if (!roomArr[g_roomNo].visited) {
switch (g_missionNo) {
case 0 :
switch (g_roomNo) {
case 1 :
break;
case 2 :
}
break;
case 1 :
switch (g_roomNo) {
case 19 :
case 31 :
case 42 :
g_missionType = "destroyEnemies";
break;
default :
g_missionType = "";
}
switch (g_roomNo) {
case 19 :
tempEnemyArr.push(new GiantSpider(0, 1, sw / 2, 220, 100, 50 / FPS, "Path1"));
break;
case 31 :
tempEnemyArr.push(new GiantWasp(0, 1, sw / 2, 220, 100, 60 / FPS, "Path3"));
break;
case 42 :
tempEnemyArr.push(new Demon(0, 1, sw / 2, 80, 100, 60 / FPS, "Path3"));
break;
case 1 :
break;
case 2 :
tempEnemyArr.push(new Zombie(0, 1, 214, 180, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 3 :
tempEnemyArr.push(new Zombie(0, 1, 204, 180, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 234, 180, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 4 :
tempEnemyArr.push(new Zombie(0, 1, 254, 180, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 284, 180, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 304, 180, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 5 :
tempEnemyArr.push(new Zombie(0, 1, 298, 120, 6, 10 / FPS, 0, 0, 440, 0, 320, 88, 338, 120, 120));
tempEnemyArr.push(new Crawler(0, 1, 234, 200, 6, 30 / FPS, "pL_follow", 234, 454, 140, 205, 174, 294, 200, 200));
tempEnemyArr.push(new Grass(0, 1, 381, 200));
break;
case 6 :
tempEnemyArr.push(new Grass(0, 1, 127, 180));
tempEnemyArr.push(new Bat(0, 1, 300, 160, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 145, 175));
tempEnemyArr.push(new Grass(0, 1, 137, 180));
break;
case 7 :
tempEnemyArr.push(new Bat(0, 1, 193, 95, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 8 :
tempEnemyArr.push(new Bat(0, 1, 261, 172, 5, 50 / FPS, "pL_follow", 41, 481, 112, 222, 0, 440, 0, 320));
tempEnemyArr.push(new Crawler(0, 1, 200, 200, 6, 30 / FPS, "pL_follow", 200, 420, 140, 205, 110, 390, 200, 200));
break;
case 9 :
break;
case 10 :
tempEnemyArr.push(new Crawler(0, 1, 307, 130, 6, 30 / FPS, "pL_follow", 0, 440, 0, 320, 257, 467, 130, 130));
tempEnemyArr.push(new Zombie(0, 1, 85, 130, 6, 10 / FPS, 0, 0, 440, 70, 135, 25, 165, 130, 130));
break;
case 11 :
tempEnemyArr.push(new Crawler(0, 1, 326, 200, 6, 30 / FPS, "pL_follow", 0, 440, 0, 320, 246, 406, 200, 200));
tempEnemyArr.push(new Grass(0, 1, 207, 200));
tempEnemyArr.push(new Grass(0, 1, 221, 200));
tempEnemyArr.push(new Grass(0, 1, 193, 200));
break;
case 12 :
tempEnemyArr.push(new Crawler(0, 1, 100, 200, 6, 30 / FPS, "pL_follow", 0, 440, 0, 320, 20, 180, 200, 200));
tempEnemyArr.push(new Grass(0, 1, 209, 200));
tempEnemyArr.push(new Grass(0, 1, 219, 200));
tempEnemyArr.push(new Crawler(0, 1, 366, 200, 6, 30 / FPS, "pL_follow", 0, 440, 0, 320, 286, 446, 200, 200));
break;
case 13 :
tempEnemyArr.push(new Zombie(0, 1, 105, 200, 6, 10 / FPS, 0, 0, 440, 0, 320, 25, 165, 200, 200));
tempEnemyArr.push(new Bat(0, 1, 208, 166, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 136, 196));
break;
case 14 :
tempEnemyArr.push(new Zombie(0, 1, 90, 200, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Grass(0, 1, 176, 200));
tempEnemyArr.push(new Bat(0, 1, 276, 160, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Bat(0, 1, 246, 160, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 15 :
tempEnemyArr.push(new Grass(0, 1, 235, 200));
tempEnemyArr.push(new Bat(0, 1, 190, 148, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 90, 200, 6, 10 / FPS, 0, 0, 440, 0, 320, 50, 210, 0, 320));
tempEnemyArr.push(new Crawler(0, 1, 125, 200, 6, 30 / FPS, "pL_follow", 0, 440, 0, 320, 65, 185, 0, 320));
break;
case 16 :
tempEnemyArr.push(new Grass(0, 1, 232, 200));
tempEnemyArr.push(new Bat(0, 1, 274, 177, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Grass(0, 1, 186, 200));
break;
case 17 :
tempEnemyArr.push(new Bat(0, 1, 220, 163, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Bat(0, 1, 178, 167, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 18 :
tempEnemyArr.push(new Zombie(0, 1, 114, 200, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 136, 200, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 156, 200, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 177, 200, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 207, 200, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 19 :
break;
case 20 :
tempEnemyArr.push(new Zombie(0, 1, 46, 250, 6, 10 / FPS, 0, 0, 440, 0, 320, 46, 166, 0, 320));
tempEnemyArr.push(new Bat(0, 1, 142, 220, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 21 :
tempEnemyArr.push(new Grass(0, 1, 203, 250));
tempEnemyArr.push(new Grass(0, 1, 256, 250));
break;
case 22 :
tempEnemyArr.push(new Bat(0, 1, 108, 214, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Bat(0, 1, 181, 102, 5, 50 / FPS, "pL_follow", 0, 440, 42, 182, 0, 440, 0, 320));
break;
case 23 :
tempEnemyArr.push(new Bat(0, 1, 242, 129, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Crawler(0, 1, 107, 200, 6, 30 / FPS, "pL_follow", 0, 440, 0, 320, 87, 167, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 64, 199, 6, 10 / FPS, 0, 64, 440, 179, 219, 44, 164, 199, 199));
break;
case 24 :
tempEnemyArr.push(new Zombie(0, 1, 205, 139, 6, 10 / FPS, 0, 0, 440, 0, 320, 185, 265, 139, 139));
tempEnemyArr.push(new Zombie(0, 1, 225, 139, 6, 10 / FPS, 0, 0, 440, 0, 320, 205, 285, 139, 139));
break;
case 25 :
tempEnemyArr.push(new Bat(0, 1, 131, 218, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 43, 250, 6, 10 / FPS, 0, 0, 440, 0, 320, 43, 123, 250, 250));
tempEnemyArr.push(new Grass(0, 1, 245, 180));
break;
case 26 :
tempEnemyArr.push(new Bat(0, 1, 402, 202, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 27 :
tempEnemyArr.push(new Wasp(0, 1, 202, 182, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 276, 230, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 297, 230, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 332, 230, 6, 10 / FPS, 0, 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 28 :
tempEnemyArr.push(new Crawler(0, 1, 290, 250, 6, 30 / FPS, "pL_follow", 0, 440, 0, 320, 290, 390, 250, 250));
tempEnemyArr.push(new Grass(0, 1, 313, 250));
tempEnemyArr.push(new Grass(0, 1, 320, 250));
break;
case 29 :
tempEnemyArr.push(new Zombie(0, 1, 44, 160, 6, 10 / FPS, 0, 0, 440, 0, 320, 44, 144, 160, 160));
tempEnemyArr.push(new Zombie(0, 1, 65, 160, 6, 10 / FPS, 0, 0, 440, 0, 320, 65, 165, 160, 160));
break;
case 30 :
tempEnemyArr.push(new Crawler(0, 1, 49, 260, 6, 30 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Wasp(0, 1, 202, 138, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Wasp(0, 1, 241, 138, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Crawler(0, 1, 84, 260, 6, 30 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Crawler(0, 1, 119, 260, 6, 30 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 31 :
break;
case 32 :
tempEnemyArr.push(new Bat(0, 1, 246, 146, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Bat(0, 1, 196, 137, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 33 :
tempEnemyArr.push(new Zombie(0, 1, 286, 190, 6, 10 / FPS, 0, 0, 440, 0, 320, 186, 386, 190, 190));
tempEnemyArr.push(new Wasp(0, 1, 202, 128, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 165, 190, 6, 10 / FPS, 0, 0, 440, 0, 320, 145, 385, 190, 190));
break;
case 34 :
tempEnemyArr.push(new Wasp(0, 1, 202, 119, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 79, 139));
tempEnemyArr.push(new Wasp(0, 1, 249, 120, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 80, 140));
tempEnemyArr.push(new Wasp(0, 1, 282, 120, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 80, 140));
tempEnemyArr.push(new Wasp(0, 1, 167, 231, 3, 80 / FPS, "pL_follow", 0, 440, 191, 271, 0, 440, 0, 320));
tempEnemyArr.push(new Wasp(0, 1, 233, 231, 3, 80 / FPS, "pL_follow", 0, 440, 191, 271, 0, 440, 0, 320));
tempEnemyArr.push(new Wasp(0, 1, 291, 230, 3, 80 / FPS, "pL_follow", 0, 440, 190, 270, 0, 440, 0, 320));
break;
case 35 :
tempEnemyArr.push(new Zombie(0, 1, 359, 260, 6, 10 / FPS, 0, 0, 440, 0, 320, 299, 399, 260, 260));
tempEnemyArr.push(new Grass(0, 1, 331, 260));
tempEnemyArr.push(new Grass(0, 1, 339, 260));
break;
case 36 :
tempEnemyArr.push(new Wasp(0, 1, 258, 215, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Wasp(0, 1, 300, 222, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 37 :
tempEnemyArr.push(new Wasp(0, 1, 381, 189, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Bat(0, 1, 270, 214, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Bat(0, 1, 199, 221, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 38 :
tempEnemyArr.push(new Bat(0, 1, 207, 221, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Bat(0, 1, 304, 221, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Grass(0, 1, 104, 260));
tempEnemyArr.push(new Bat(0, 1, 273, 228, 5, 50 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 39 :
tempEnemyArr.push(new Grass(0, 1, 277, 260));
tempEnemyArr.push(new Zombie(0, 1, 339, 130, 6, 10 / FPS, 0, 0, 440, 110, 170, 319, 359, 130, 130));
tempEnemyArr.push(new Wasp(0, 1, 131, 235, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 40 :
tempEnemyArr.push(new Wasp(0, 1, 104, 82, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Wasp(0, 1, 163, 89, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Wasp(0, 1, 131, 112, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
tempEnemyArr.push(new Wasp(0, 1, 265, 90, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
break;
case 41 :
tempEnemyArr.push(new Zombie(0, 1, 159, 240, 6, 10 / FPS, 0, 0, 440, 200, 260, 139, 440, 0, 320));
tempEnemyArr.push(new Bat(0, 1, 267, 217, 5, 50 / FPS, "pL_follow", 0, 440, 197, 237, 0, 440, 0, 320));
tempEnemyArr.push(new Crawler(0, 1, 207, 240, 6, 30 / FPS, "pL_follow", 0, 440, 200, 260, 187, 440, 0, 320));
tempEnemyArr.push(new Grass(0, 1, 104, 240));
tempEnemyArr.push(new Crawler(0, 1, 179, 240, 6, 30 / FPS, "pL_follow", 0, 440, 200, 260, 159, 440, 0, 320));
tempEnemyArr.push(new Zombie(0, 1, 138, 240, 6, 10 / FPS, 0, 0, 440, 200, 260, 118, 440, 0, 320));
break;
}
break;
case 2 :
break;
}
} else {
trace("---------RESTORING ENEMIES -------------------------");
updateRestoredEnemies = true;
enemyArr = roomArr[g_roomNo].enemyArr;
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
enemyObj = enemyArr[enemyNo];
if ((noOfEnemyCreated++) > 200) {
noOfEnemyCreated = 0;
}
game_MC.enemyAttachMC.attachMovie(enemyObj.type + enemyObj.typeNo, (((enemyObj.type + enemyObj.typeNo) + "_") + noOfEnemyCreated) + "_MC", noOfEnemyCreated);
enemyMC = eval ((((("game_MC.enemyAttachMC." + enemyObj.type) + enemyObj.typeNo) + "_") + noOfEnemyCreated) + "_MC");
enemyMC._x = enemyObj.x;
enemyMC._y = enemyObj.y;
enemyObj.target = enemyMC;
enemyMC._xscale = enemyMC._xscale * enemyObj.direction;
enemyMC.gotoAndStop(enemyObj.status);
multiPartNo = enemyObj.multiPartArr.length;
trace(" multiPartNo :: " + multiPartNo);
trace(" enemyMC :: " + enemyMC);
while ((multiPartNo--) > 0) {
partObj = enemyObj.multiPartArr[multiPartNo];
partMC = eval ((((enemyObj.target + ".") + partObj.name) + partObj.id) + "_MC");
trace(((((" enemyObj.target... :: " + enemyObj.target) + ".") + partObj.name) + partObj.id) + "_MC");
trace(" partMC._currentframe :: " + partMC._currentframe);
currFrameNo = 1 + int(partMC._totalframes * (1 - (partObj.health / partObj.fullHealth)));
partMC.gotoAndStop(currFrameNo);
trace(" currFrameNo :: " + currFrameNo);
trace(" partMC._totalframes :: " + partMC._totalframes);
trace(" partMC._currentframe :: " + partMC._currentframe);
trace(" partObj.health :: " + partObj.health);
trace(" partObj.fullHealth :: " + partObj.fullHealth);
}
}
}
testArray = tempEnemyArr;
arrNo = testArray.length;
while ((arrNo--) > 0) {
trace(((((" tempEnemyArr :: " + arrNo) + " :: ") + testArray[arrNo].showUpFr) + " :: ") + testArray[arrNo].attackDamage);
}
nextEnemyFrNo = tempEnemyArr[0].showUpFr;
moreEnemyToCome = true;
}
function reachedroomBuffer(bufferSide) {
saveRoomData();
trace((("g_missionNo: " + g_missionNo) + " :: g_roomNo: ") + g_roomNo);
trace("bufferSide: " + bufferSide);
trace("pL.y: " + pL.y);
switch (bufferSide) {
case "top" :
g_roomNo = roomArr[g_roomNo].top;
pL.y = roomArr[g_roomNo].bufferBot - grav;
break;
case "bottom" :
g_roomNo = roomArr[g_roomNo].bottom;
pL.y = roomArr[g_roomNo].bufferTop;
break;
case "left" :
g_roomNo = roomArr[g_roomNo].left;
pL.x = roomArr[g_roomNo].bufferRight;
break;
case "right" :
g_roomNo = roomArr[g_roomNo].right;
pL.x = roomArr[g_roomNo].bufferLeft;
break;
}
trace((("g_roomNo: " + g_roomNo) + " :: levelCodeArr[g_missionNo][g_taskNo + 1].roomNo: ") + levelCodeArr[g_missionNo][g_taskNo + 1].roomNo);
if (g_roomNo == levelCodeArr[g_missionNo][g_taskNo + 1].roomNo) {
game_over("missionComplete");
} else {
trace((("g_missionNo: " + g_missionNo) + " :: g_roomNo: ") + g_roomNo);
room_init();
checkPlatformCollision(pL);
trace("pL.y: " + pL.y);
}
}
function startMissionTask(tempMissionNo, tempTaskNo) {
g_missionNo = tempMissionNo;
g_taskNo = tempTaskNo;
showCutScenes();
}
function resetGameDifficulty() {
g_difficulty = 0;
}
function setGameDifficulty(tempDifficulty) {
switch (tempDifficulty) {
case "easy" :
g_difficulty = 0.25;
break;
case "med" :
g_difficulty = 1;
break;
case "hard" :
g_difficulty = 2;
break;
}
menuWindowMC.gotoAndStop("level_select");
}
function showCutScenes() {
menuWindowMC.gotoAndStop("cutscenes");
menuWindowMC.cutScenesMC.gotoAndStop((("mission_" + g_missionNo) + "_") + g_taskNo);
menuWindowMC.cutScenesMC.txtLevelNo = g_missionNo;
menuWindowMC.cutScenesMC.txtLevelCode = levelCodeArr[g_missionNo][g_taskNo].code;
setCutSceneDialogue();
menuWindowMC.cutScenesMC.speakerHeadMC.gotoAndStop(dialogueArr[0][0]);
menuWindowMC.cutScenesMC.txtDialogue = dialogueArr[0][1];
trace((_root.g_missionNo + " :: ") + dialogueArr[0][0]);
["menuWindowMC.pL_missionButtonsMC"].removeMovieClip();
missionButtonsMC = menuWindowMC.pL_missionButtonsMC;
missionButtonsMC.removeMovieClip();
dialogueArr.splice(0, 1);
}
function pL_setWeaponAmmo(ammoArr) {
i = 0;
while (i < pL_weaponsArr.length) {
if ((ammoArr[i] == "inf") || (ammoArr[i] > 0)) {
pL_weaponsArr[i].available = true;
pL_weaponsArr[i].ammo = ammoArr[i];
} else {
pL_weaponsArr[i].available = false;
pL_weaponsArr[i].ammo = 0;
}
pL_weaponsArr[i].currReloadFr = 0;
trace("pL_weaponsArr[i].available: " + pL_weaponsArr[i].available);
trace("pL_weaponsArr[i].ammo: " + pL_weaponsArr[i].ammo);
i++;
}
trace((("pL_weaponsArr[pL.currWeaponNo].currReloadFr: " + pL_weaponsArr[pL.currWeaponNo].currReloadFr) + " :: pL_weaponsArr[pL.currWeaponNo].ammo: ") + pL_weaponsArr[pL.currWeaponNo].ammo);
}
function setStickManColor(targetMC, tempColor) {
tempColor = "0x" + tempColor;
currColor = new Color(targetMC.head_MC);
currColor.setRGB(tempColor);
currColor = new Color(targetMC.body_MC);
currColor.setRGB(tempColor);
currColor = new Color(targetMC.legs_MC);
currColor.setRGB(tempColor);
currColor = new Color(targetMC.arms_MC);
currColor.setRGB(tempColor);
}
function saveRoomData() {
if (!roomArr[g_roomNo].visited) {
roomArr[g_roomNo].enemyArr = [];
roomArr[g_roomNo].enemyArr = enemyArr;
roomArr[g_roomNo].visited = true;
}
}
function game_over(status) {
trace("game_over status: " + status);
_quality = "HIGH";
musicSnd.stop("music" + musicSndNo);
pL_weaponSoundStop();
removeAttachedMCs();
delete onEnterFrame;
delete onMouseDown;
delete onMouseUp;
delete _keyListener;
pL_weaponSoundStop();
menuWindowMC._visible = true;
Mouse.show();
switch (status) {
case "missionComplete" :
levelCodeArr[g_missionNo][g_taskNo].unlocked = true;
menuWindowMC.cutScenesMC.txtLevelCode = levelCodeArr[g_missionNo][g_taskNo].code;
if (g_taskNo >= levelCodeArr[g_missionNo].length) {
g_missionNo++;
} else {
g_taskNo++;
}
showCutScenes(g_missionNo, g_taskNo);
return;
case "pL_dead" :
menuWindowMC._visible = true;
menuWindowMC.gotoAndStop("pL_dies");
return;
case "timeIsUp" :
menuWindowMC.gotoAndStop("cutscenes");
return;
}
}
function Player(x, y, health, skinColor, layerDepth) {
this.x = x;
this.y = y;
this.status = "";
this.fullHealth = (this.health = health);
this.skinColor = skinColor;
this.h = 30;
this.w = 10;
this.classification = "pL";
this.shape = "rectangle";
this.registration = "bottomCenter";
this.jumpSpeed = 300 / FPS;
this.runSpeed = 120 / FPS;
this.walkSpeed = 60 / FPS;
this.weaponRotationY = 21;
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", shape:"circle", registration:"bottomCenter", rad:4, health:health};
this.multiPartArr[1] = {name:"body", shape:"rectangle", registration:"bottomCenter", health:health};
this.multiPartArr[2] = {name:"legs", shape:"rectangle", registration:"bottomCenter", health:health};
trace("pL.layerDepth " + pL.layerDepth);
this.layerDepth = layerDepth;
}
function Weapon(available, type, ammo, reloadFr, attackDamage) {
this.available = available;
this.type = type;
this.ammo = ammo;
this.reloadFr = reloadFr;
this.currReloadFr = 0;
this.attackDamage = attackDamage;
}
function pickUpItem(available, roomNo, itemNo, x, y, type, quantity) {
this.available = available;
this.roomNo = roomNo;
this.itemNo = itemNo;
this.x = x;
this.y = y;
this.type = type;
this.quantity = quantity;
}
function Projectile(targetMC, type, originObj, x, y, ux, uy, attackDamage) {
this.targetMC = targetMC;
this.type = type;
this.originObj = originObj;
this.x = x;
this.y = y;
switch (type) {
case "rocketLauncher" :
velocity = 400 / FPS;
break;
case "flameThrower" :
velocity = 150 / FPS;
this.timer = 1 * FPS;
break;
case "grenade" :
velocity = 10 + ((pL.grenadeThrowVelocity * 10) / FPS);
this.timer = 2 * FPS;
break;
case "zombieSpit" :
case "GiantSpiderSpit" :
case "GiantWaspSpit" :
case "DemonSpit" :
velocity = 150 / FPS;
break;
}
this.vx = velocity * ux;
this.vy = velocity * uy;
this.attackDamage = attackDamage;
}
function Bat(showUpFr, typeNo, x, y, health, v, pathName, noticeXmin, noticeXmax, noticeYmin, noticeYmax, moveXmin, moveXmax, moveYmin, moveYmax) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "bat";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "circle";
this.registration = "bottomCenter";
this.rad = 5;
this.attackDamage = 3;
this.pathName = pathName;
this.status = "stand";
this.noticedTarget = false;
this.noticeXmin = noticeXmin;
this.noticeXmax = noticeXmax;
this.noticeYmin = noticeYmin;
this.noticeYmax = noticeYmax;
this.moveXmin = moveXmin;
this.moveXmax = moveXmax;
this.moveYmin = moveYmin;
this.moveYmax = moveYmax;
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:5, health:4, fullHealth:4};
this.multiPartArr[1] = {name:"wing", id:"L", damageable:true, shape:"circle", registration:"center", rad:4, health:1, fullHealth:1};
this.multiPartArr[2] = {name:"wing", id:"R", damageable:true, shape:"circle", registration:"center", rad:4, health:1, fullHealth:1};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:1});
this.explosionBodyPartsArr.push({name:"wing", noOfParts:2});
this.nextCheckPointX = x;
this.nextCheckPointY = y;
this.reachedCheckPointDist = 5;
this.direction = 1;
}
function Crawler(showUpFr, typeNo, x, y, health, v, pathName, noticeXmin, noticeXmax, noticeYmin, noticeYmax, moveXmin, moveXmax, moveYmin, moveYmax) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "crawler";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "rectangle";
this.registration = "bottomCenter";
this.w = 40;
this.h = 40;
this.pathName = pathName;
this.status = "stand";
this.noticedTarget = false;
this.noticeXmin = noticeXmin;
this.noticeXmax = noticeXmax;
this.noticeYmin = noticeYmin;
this.noticeYmax = noticeYmax;
this.moveXmin = moveXmin;
this.moveXmax = moveXmax;
this.moveYmin = moveYmin;
this.moveYmax = moveYmax;
switch (typeNo) {
case 1 :
this.attackDist = 135;
this.nextAttackFr = 1 * FPS;
this.attackDamage = 10;
break;
case 2 :
this.attackDist = 150;
this.nextAttackFr = FPS;
this.attackDamage = 10;
}
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:5, health:health, fullHealth:health};
this.multiPartArr[1] = {name:"leg", id:"F", damageable:true, shape:"rectangle", registration:"middleLeft", health:health, fullHealth:health};
this.multiPartArr[2] = {name:"leg", id:"B", damageable:true, shape:"rectangle", registration:"middleLeft", health:health, fullHealth:health};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:1});
this.explosionBodyPartsArr.push({name:"leg", noOfParts:6});
this.direction = 1;
}
function Grass(showUpFr, typeNo, x, y, health) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "grass";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.status = "stand";
this.attackDamage = 3;
this.currAttackFr = 0;
this.nextAttackFr = 1 * FPS;
this.attackDist = 15;
this.direction = 1;
}
function Mine(showUpFr, typeNo, x, y) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "mine";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.status = "stand";
this.attackDamage = 5;
this.currAttackFr = 0;
this.nextAttackFr = 1 * FPS;
this.attackDist = 15;
this.direction = 1;
}
function Wasp(showUpFr, typeNo, x, y, health, v, pathName, noticeXmin, noticeXmax, noticeYmin, noticeYmax, moveXmin, moveXmax, moveYmin, moveYmax) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "wasp";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "rectangle";
this.registration = "bottomCenter";
this.w = 10;
this.h = 4;
this.attackDamage = 3;
this.pathName = pathName;
this.status = "stand";
this.noticedTarget = false;
this.noticeXmin = noticeXmin;
this.noticeXmax = noticeXmax;
this.noticeYmin = noticeYmin;
this.noticeYmax = noticeYmax;
this.moveXmin = moveXmin;
this.moveXmax = moveXmax;
this.moveYmin = moveYmin;
this.moveYmax = moveYmax;
this.multiPartArr = [];
this.multiPartArr[0] = {name:"body", damageable:true, shape:"circle", registration:"bottomCenter", rad:3, health:health};
this.multiPartArr[1] = {name:"head", damageable:true, shape:"circle", registration:"center", rad:4, health:health / 2, fullHealth:health / 2};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"body", noOfParts:1});
this.explosionBodyPartsArr.push({name:"head", noOfParts:1});
this.nextCheckPointX = x;
this.nextCheckPointY = y;
this.reachedCheckPointDist = 5;
this.direction = 1;
}
function Zombie(showUpFr, typeNo, x, y, health, v, pathName, noticeXmin, noticeXmax, noticeYmin, noticeYmax, moveXmin, moveXmax, moveYmin, moveYmax) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "zombie";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "rectangle";
this.registration = "bottomCenter";
this.w = 10;
this.h = 30;
this.pathName = pathName;
this.status = "stand";
this.noticedTarget = false;
this.noticeXmin = noticeXmin;
this.noticeXmax = noticeXmax;
this.noticeYmin = noticeYmin;
this.noticeYmax = noticeYmax;
this.moveXmin = moveXmin;
this.moveXmax = moveXmax;
this.moveYmin = moveYmin;
this.moveYmax = moveYmax;
switch (typeNo) {
case 1 :
this.attackDist = 15;
this.nextAttackFr = 10;
this.attackDamage = 5;
break;
case 2 :
this.attackDist = 150;
this.nextAttackFr = FPS;
this.attackDamage = 10;
}
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:4, health:health / 2, fullHealth:health / 2};
this.multiPartArr[1] = {name:"body", damageable:true, shape:"rectangle", registration:"bottomCenter", health:health / 2, fullHealth:health / 2};
this.multiPartArr[2] = {name:"legs", damageable:true, shape:"rectangle", registration:"bottomCenter", health:health / 2, fullHealth:health / 2};
this.multiPartArr[3] = {name:"arms", damageable:true, shape:"rectangle", registration:"middleLeft", health:health / 2, fullHealth:health / 2};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:1});
this.explosionBodyPartsArr.push({name:"body", noOfParts:2});
this.explosionBodyPartsArr.push({name:"leg", noOfParts:4});
this.explosionBodyPartsArr.push({name:"arm", noOfParts:2});
this.direction = 1;
}
function GiantSpider(showUpFr, typeNo, x, y, health, v, pathName) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "GiantSpider";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "rectangle";
this.registration = "bottomCenter";
this.w = 30;
this.h = 52;
this.status = "attack";
this.attackDamage = 5;
this.attackType = 1;
this.currAttackFr = (this.nextAttackFr = 3 * FPS);
this.currCrawlerSpawnFr = (this.nextCrawlerSpawnFr = 15 * FPS);
this.pathName = pathName;
this.checkPointArrNo = 0;
tempPathArr = eval (("checkPoint" + this.pathName) + "_arr");
this.nextCheckPointX = tempPathArr[this.checkPointArrNo][0];
this.nextCheckPointY = tempPathArr[this.checkPointArrNo][1];
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:15, health:health};
this.multiPartArr[1] = {name:"abdomen", damageable:true, shape:"circle", registration:"bottomCenter", rad:15, health:health};
this.multiPartArr[2] = {name:"tail", id:"F", damageable:true, shape:"circle", registration:"center", rad:2, health:health, fullHealth:health};
this.multiPartArr[3] = {name:"tail", id:"B", damageable:true, shape:"circle", registration:"center", rad:2, health:health, fullHealth:health};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:4});
this.explosionBodyPartsArr.push({name:"abdomen", noOfParts:1});
this.explosionBodyPartsArr.push({name:"tail", noOfParts:2});
this.reachedCheckPointDist = 5;
this.direction = 1;
}
function GiantWasp(showUpFr, typeNo, x, y, health, v, pathName) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "GiantWasp";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "circle";
this.registration = "center";
this.rad = 40;
this.status = "attack";
this.attackDamage = 5;
this.attackType = 1;
this.currAttackFr = (this.nextAttackFr = 3 * FPS);
this.currCrawlerSpawnFr = (this.nextCrawlerSpawnFr = 5 * FPS);
this.pathName = pathName;
this.checkPointArrNo = 0;
tempPathArr = eval (("checkPoint" + this.pathName) + "_arr");
this.nextCheckPointX = tempPathArr[this.checkPointArrNo][0];
this.nextCheckPointY = tempPathArr[this.checkPointArrNo][1];
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:7.5, health:health};
this.multiPartArr[1] = {name:"abdomen", damageable:true, shape:"circle", registration:"bottomCenter", rad:10, health:health};
this.multiPartArr[2] = {name:"tail", id:"F", damageable:true, shape:"circle", registration:"bottomCenter", rad:7.5, health:health, fullHealth:health};
this.multiPartArr[3] = {name:"tail", id:"B", damageable:true, shape:"circle", registration:"bottomCenter", rad:6, health:health, fullHealth:health};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:4});
this.explosionBodyPartsArr.push({name:"abdomen", noOfParts:1});
this.explosionBodyPartsArr.push({name:"eye", noOfParts:2});
this.explosionBodyPartsArr.push({name:"leg", noOfParts:12});
this.reachedCheckPointDist = 5;
this.direction = 1;
}
function Demon(showUpFr, typeNo, x, y, health, v, pathName) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "Demon";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "circle";
this.registration = "center";
this.rad = 40;
this.status = "attack";
this.attackDamage = 5;
this.attackType = 1;
this.currAttackFr = (this.nextAttackFr = 3 * FPS);
this.currCrawlerSpawnFr = (this.nextCrawlerSpawnFr = 7 * FPS);
this.pathName = pathName;
this.checkPointArrNo = 0;
tempPathArr = eval (("checkPoint" + this.pathName) + "_arr");
this.nextCheckPointX = tempPathArr[this.checkPointArrNo][0];
this.nextCheckPointY = tempPathArr[this.checkPointArrNo][1];
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:7.5, health:health};
this.multiPartArr[1] = {name:"abdomen", damageable:true, shape:"circle", registration:"bottomCenter", rad:10, health:health};
this.multiPartArr[2] = {name:"tail", id:"F", damageable:true, shape:"circle", registration:"bottomCenter", rad:7.5, health:health, fullHealth:health};
this.multiPartArr[3] = {name:"tail", id:"B", damageable:true, shape:"circle", registration:"bottomCenter", rad:6, health:health, fullHealth:health};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:1});
this.explosionBodyPartsArr.push({name:"arm", noOfParts:2});
this.explosionBodyPartsArr.push({name:"body", noOfParts:3});
this.reachedCheckPointDist = 5;
this.direction = 1;
}
function nextCP(tempObj) {
tempObj.checkPointArrNo++;
tempPathArr = eval (("checkPoint" + tempObj.pathName) + "_arr");
if (tempObj.checkPointArrNo >= tempPathArr.length) {
tempObj.checkPointArrNo = 0;
}
tempObj.nextCheckPointX = tempPathArr[tempObj.checkPointArrNo][0];
tempObj.nextCheckPointY = tempPathArr[tempObj.checkPointArrNo][1];
}
function ExplosionParticle(targetMC, debryType, x, y, vx, vy, rotSpeed, startSize, finishSize, durationFr, smokeTrail) {
this.targetMC = targetMC;
this.type = debryType;
this.debryType = debryType;
this.x = x;
this.y = y;
this.vx = vx;
this.vy = vy;
this.rotSpeed = rotSpeed;
this.startSize = startSize;
this.finishSize = finishSize;
this.durationFr = durationFr;
this.sizeChangePerFr = (startSize - finishSize) / durationFr;
this.smokeTrail = smokeTrail;
}
function Platform(target, type, x, y, w, h) {
this.target = target;
this.type = type;
this.classification = "platform";
this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.shape = "rectangle";
this.registration = "topLeft";
}
function createRicochet(type, typeNo, x, y, angle) {
if ((noOfRicochetCreated++) > 500) {
noOfRicochetCreated = 0;
}
game_MC.ricochetAttachMC.attachMovie(type + typeNo, (((type + typeNo) + "_") + noOfRicochetCreated) + "_MC", noOfRicochetCreated);
ricMC = eval ((((("game_MC.ricochetAttachMC." + type) + typeNo) + "_") + noOfRicochetCreated) + "_MC");
ricMC._x = x;
ricMC._y = y;
ricMC._rotation = angle;
ricMC._xscale = int(25 + (75 * Math_random()));
ricMC._yscale = int(50 + (50 * Math_random()));
if (Math_random() > 0.5) {
ricMC._yscale = ricMC._yscale * -1;
}
}
function createExplosionParticle(debryType, x, y, v, angleDeg, startSize, finishSize, durationFr, smokeTrail) {
if ((noOfExplosionParticleCreated++) > 500) {
noOfExplosionParticleCreated = 0;
}
game_MC.explosionParticleAttachMC.attachMovie(debryType, ((debryType + "_") + noOfExplosionParticleCreated) + "_MC", noOfExplosionParticleCreated);
targetMC = eval (((("game_MC.explosionParticleAttachMC." + debryType) + "_") + noOfExplosionParticleCreated) + "_MC");
targetMC._x = x;
targetMC._y = y;
targetMC._xscale = (targetMC._yscale = startSize);
targetMC._rotation = angleDeg;
angleDeg = angleDeg + int(30 * (0.5 - Math_random()));
vx = v * Math.cos((angleDeg / 180) * PI);
vy = v * Math.sin((angleDeg / 180) * PI);
rotSpeed = vel;
explosionParticleArr.push(new ExplosionParticle(targetMC, debryType, x, y, vx, vy, rotSpeed, startSize, finishSize, durationFr, smokeTrail));
}
function createProjectile(originObj, weaponType, x, y, ux, uy, attackDamage) {
if ((pL_noOfProjCreated++) > 500) {
pL_noOfProjCreated = 0;
}
game_MC.projectileAttachMC.attachMovie(weaponType, ((weaponType + "_") + pL_noOfProjCreated) + "_MC", pL_noOfProjCreated);
projMC = eval (((("game_MC.projectileAttachMC." + weaponType) + "_") + pL_noOfProjCreated) + "_MC");
projMC._x = x;
projMC._y = y;
switch (weaponType) {
case "rocketLauncher" :
projMC._rotation = pL.weaponAngleDeg;
break;
case "flameThrower" :
projMC._rotation = pL.weaponAngleDeg;
break;
case "grenade" :
game_MC.pL_MC.weapon_MC.arms_MC.gotoAndPlay("throw");
break;
case "zombieSpit" :
case "GiantSpiderSpit" :
case "GiantWaspSpit" :
case "DemonSpit" :
break;
}
projectileArr.push(new Projectile(projMC, weaponType, originObj, x, y, ux, uy, attackDamage));
}
function createPlatform(type, x, y, w, h) {
if ((noOfPlatformCreated++) > 500) {
noOfPlatformCreated = 0;
}
platformType = "platform_" + type;
game_MC.platformMC.attachMovie(platformType, ((platformType + "_") + noOfPlatformCreated) + "_MC", noOfPlatformCreated);
platformMC = eval (((("game_MC.platformMC." + platformType) + "_") + noOfPlatformCreated) + "_MC");
platformMC._x = x;
platformMC._y = y;
platformMC._width = w;
platformMC._height = h;
platformArr.push(new Platform(platformMC, type, x, y, w, h));
}
function pL_changeWeapon(direction) {
trace(" direction : " + direction);
trace("pL_weaponsArr[i].available: " + pL_weaponsArr[i].available);
trace("pL_weaponsArr[i].ammo: " + pL_weaponsArr[i].ammo);
pL_weaponSoundStop();
if (direction == 0) {
pL.currWeaponNo = 0;
} else {
tempCurrWeaponNo = pL.currWeaponNo;
i = 0;
while (i < pL_weaponsArr.length) {
tempCurrWeaponNo = tempCurrWeaponNo + direction;
if (tempCurrWeaponNo < 0) {
tempCurrWeaponNo = pL_weaponsArr.length - 1;
} else if (tempCurrWeaponNo >= pL_weaponsArr.length) {
tempCurrWeaponNo = 0;
}
if (pL_weaponsArr[tempCurrWeaponNo].available) {
if ((pL_weaponsArr[tempCurrWeaponNo].ammo == "inf") || (pL_weaponsArr[tempCurrWeaponNo].ammo > 0)) {
pL_oldWeaponNo = pL.currWeaponNo;
pL.currWeaponNo = tempCurrWeaponNo;
with (game_MC.pL_MC.weapon_MC) {
gotoAndStop(pL_weaponsArr[tempCurrWeaponNo].type);
flash_MC._x = (lineOfFire_MC._x = nozzle_MC._x);
flash_MC._y = (lineOfFire_MC._y = nozzle_MC._y);
}
game_MC.pL_MC.arms_MC.gotoAndStop(pL_weaponsArr[tempCurrWeaponNo].type);
statusWindowMC.pL_weaponDisplayMC.gotoAndStop(pL_weaponsArr[tempCurrWeaponNo].type);
statusWindowMC.txtAmmo = pL_weaponsArr[tempCurrWeaponNo].ammo;
trace(" pL_oldWeaponNo : " + pL_weaponsArr[pL_oldWeaponNo].currReloadFr);
pL_weaponsArr[pL_oldWeaponNo].currReloadFr = pL_weaponsArr[pL_oldWeaponNo].currReloadFr + game_FrNo;
trace((game_FrNo + " pL_oldWeaponNo : ") + pL_weaponsArr[pL_oldWeaponNo].currReloadFr);
if (pL_weaponsArr[pL.currWeaponNo].currReloadFr < game_FrNo) {
statusWindowMC.txtReloading = (pL_weaponsArr[pL.currWeaponNo].currReloadFr = 0);
statusWindowMC.pL_ReloadMC.barMC._xscale = 100;
} else {
trace((game_FrNo + " pL.currWeaponNo : ") + pL_weaponsArr[pL.currWeaponNo].currReloadFr);
statusWindowMC.txtReloading = (pL_weaponsArr[pL.currWeaponNo].currReloadFr = pL_weaponsArr[pL.currWeaponNo].currReloadFr - game_FrNo);
statusWindowMC.pL_ReloadMC.barMC._xscale = (100 * (pL_weaponsArr[pL.currWeaponNo].reloadFr - pL_weaponsArr[pL.currWeaponNo].currReloadFr)) / pL_weaponsArr[pL.currWeaponNo].reloadFr;
}
i = pL_weaponsArr.length;
}
}
i++;
}
}
pL.weaponType = pL_weaponsArr[pL.currWeaponNo].type;
pL.attackDamage = pL_weaponsArr[pL.currWeaponNo].attackDamage;
game_MC.pL_MC.weapon_MC.flash_MC.gotoAndStop(1);
game_MC.pL_MC.weapon_MC.lineOfFire_MC.gotoAndStop(1);
game_MC.pL_MC.head_MC.flash_MC.gotoAndStop(1);
game_MC.pL_MC.body_MC.flash_MC.gotoAndStop(1);
pL_mouseDown = false;
}
function pL_weaponSoundStop() {
pL_weaponFireSnd.stop(pL.weaponType + "_fire");
}
function lineObjectIntersectionDist(line_x, line_y, line_ux, line_uy, object) {
tempdistancesObj = [];
tempdistancesObj.classification = object.classification;
if (object.shape == "rectangle") {
if (object.registration == "bottomCenter") {
object_xmin = object.x - (object.w / 2);
object_xmax = object.x + (object.w / 2);
object_ymin = object.y - object.h;
object_ymax = object.y;
} else if (object.registration == "topLeft") {
object_xmin = object.x;
object_xmax = object.x + object.w;
object_ymin = object.y;
object_ymax = object.y + object.h;
} else if (object.registration == "middleLeft") {
object_xmin = object.x;
object_xmax = object.x + object.w;
object_ymin = object.y - (object.h / 2);
object_ymax = object.y + (object.h / 2);
} else if (object.registration == "center") {
object_xmin = object.x - (object.w / 2);
object_xmax = object.x + (object.w / 2);
object_ymin = object.y - (object.h / 2);
object_ymax = object.y + (object.h / 2);
}
if ((line_x > object_xmin) && (line_x < object_xmax)) {
if ((line_y > object_ymin) && (line_y < object_ymax)) {
tempdistancesObj.minDist = 1;
tempdistancesObj.minX = line_x;
tempdistancesObj.minY = line_y;
tempdistancesObj.maxDist = 2;
tempdistancesObj.maxX = line_x;
tempdistancesObj.maxY = line_y;
return(tempdistancesObj);
}
}
dist = Math.sqrt(((object_xmin - line_x) * (object_xmin - line_x)) + ((object_ymin - line_y) * (object_ymin - line_y)));
dist_alongLineToOrigin = (line_uy * (object_ymin - line_y)) + (line_ux * (object_xmin - line_x));
sameSide = false;
if (object_xmin > line_x) {
if (line_ux > 0) {
sameSide = true;
}
} else if (object_xmax < line_x) {
if (line_ux < 0) {
sameSide = true;
}
} else if (object_ymin > line_y) {
if (line_uy > 0) {
sameSide = true;
}
} else if (object_ymax < line_y) {
if (line_uy < 0) {
sameSide = true;
}
}
if (sameSide) {
dist_LT = (line_ux * (object_ymin - line_y)) - (line_uy * (object_xmin - line_x));
dist_RT = (line_ux * (object_ymin - line_y)) - (line_uy * (object_xmax - line_x));
dist_LB = (line_ux * (object_ymax - line_y)) - (line_uy * (object_xmin - line_x));
dist_RB = (line_ux * (object_ymax - line_y)) - (line_uy * (object_xmax - line_x));
dist_min = dist_LT;
if (dist_RT < dist_min) {
dist_min = dist_RT;
}
if (dist_LB < dist_min) {
dist_min = dist_LB;
}
if (dist_RB < dist_min) {
dist_min = dist_RB;
}
dist_max = dist_LT;
if (dist_RT > dist_max) {
dist_max = dist_RT;
}
if (dist_LB > dist_max) {
dist_max = dist_LB;
}
if (dist_RB > dist_max) {
dist_max = dist_RB;
}
if (dist_min < 0) {
if (dist_max > 0) {
hitWall_1 = [];
hitWall_1.name = "";
hitWall_2 = [];
hitWall_2.name = "";
if ((dist_LT * dist_LB) < 0) {
hitWall_1.name = "left";
hitWall_1.hitX = object_xmin;
hitWall_1.hitY = line_y + (((object_xmin - line_x) * line_uy) / line_ux);
}
if ((dist_RB * dist_RT) < 0) {
if (hitWall_1.name != "") {
hitWall_2.name = "rigth";
hitWall_2.hitX = object_xmax;
hitWall_2.hitY = line_y + (((object_xmax - line_x) * line_uy) / line_ux);
} else {
hitWall_1.name = "rigth";
hitWall_1.hitX = object_xmax;
hitWall_1.hitY = line_y + (((object_xmax - line_x) * line_uy) / line_ux);
}
}
if ((dist_LB * dist_RB) < 0) {
if (hitWall_1.name != "") {
hitWall_2.name = "top";
hitWall_2.hitY = object_ymax;
hitWall_2.hitX = line_x + (((object_ymax - line_y) * line_ux) / line_uy);
} else {
hitWall_1.name = "top";
hitWall_1.hitY = object_ymax;
hitWall_1.hitX = line_x + (((object_ymax - line_y) * line_ux) / line_uy);
}
}
if ((dist_LT * dist_RT) < 0) {
hitWall_2.hitY = object_ymin;
hitWall_2.hitX = line_x + (((object_ymin - line_y) * line_ux) / line_uy);
hitWall_2.name = "bottom";
}
dist_1 = Math.sqrt(((hitWall_1.hitX - line_x) * (hitWall_1.hitX - line_x)) + ((hitWall_1.hitY - line_y) * (hitWall_1.hitY - line_y)));
dist_2 = Math.sqrt(((hitWall_2.hitX - line_x) * (hitWall_2.hitX - line_x)) + ((hitWall_2.hitY - line_y) * (hitWall_2.hitY - line_y)));
if (dist_1 < dist_2) {
tempdistancesObj.minDist = dist_1;
tempdistancesObj.minX = hitWall_1.hitX;
tempdistancesObj.minY = hitWall_1.hitY;
tempdistancesObj.maxDist = dist_2;
tempdistancesObj.maxX = hitWall_2.hitX;
tempdistancesObj.maxY = hitWall_2.hitY;
} else {
tempdistancesObj.minDist = dist_2;
tempdistancesObj.minX = hitWall_2.hitX;
tempdistancesObj.minY = hitWall_2.hitY;
tempdistancesObj.maxDist = dist_1;
tempdistancesObj.maxX = hitWall_1.hitX;
tempdistancesObj.maxY = hitWall_1.hitY;
}
trace(" =================== ");
trace("\nobject.shape " + object.shape);
trace("object.registration " + object.registration);
trace((("line_x: " + line_x) + " :: line_y: ") + line_y);
trace((("line_ux: " + line_ux) + " :: line_uy: ") + line_uy);
trace((("object.x " + object.x) + " object.y ") + object.y);
trace((("object.w " + object.w) + " object.h ") + object.h);
trace("tempdistancesObj.minDist: " + tempdistancesObj.minDist);
trace("dist_alongLineToOrigin " + dist_alongLineToOrigin);
return(tempdistancesObj);
}
}
}
} else if (object.shape == "circle") {
trace(">>>>>>>>>>>>>>>>>>>>>>>>=====================>>> object.rotation: " + object.rotation);
trace("object.x: " + object.x);
trace("object.y: " + object.y);
trace("object.rad: " + object.rad);
trace("object.registration: " + object.registration);
if (object.registration == "bottomCenter") {
ux = Math.sin((object.rotation * PI) / 180);
uy = Math.cos((object.rotation * PI) / 180);
object_x = object.x + ((object.rad * ux) * object.parentDirection);
object_y = object.y - (object.rad * uy);
trace("ux: " + ux);
trace("uy: " + uy);
trace("object.parentDirection: " + object.parentDirection);
} else if (object.registration == "center") {
object_x = object.x;
object_y = object.y;
}
trace("-------------------------------");
trace("object_x: " + object_x);
trace("object_y: " + object_y);
temp_dx = line_x - object_x;
temp_dy = line_y - object_y;
if (((temp_dx * temp_dx) + (temp_dy * temp_dy)) < (object.rad * object.rad)) {
tempdistancesObj.minDist = 1;
tempdistancesObj.minX = line_x;
tempdistancesObj.minY = line_y;
tempdistancesObj.maxDist = 2;
tempdistancesObj.maxX = line_x;
tempdistancesObj.maxY = line_y;
return(tempdistancesObj);
}
dist_perpLineToOrigin = (line_ux * (object_y - line_y)) - (line_uy * (object_x - line_x));
trace("dist_perpLineToOrigin " + dist_perpLineToOrigin);
dist_alongLineToOrigin = (line_uy * (object_y - line_y)) + (line_ux * (object_x - line_x));
trace("dist_alongLineToOrigin " + dist_alongLineToOrigin);
if (dist_alongLineToOrigin > 0) {
if (Abs(dist_perpLineToOrigin) < object.rad) {
modifierDist = Math.sqrt((object.rad * object.rad) - (dist_perpLineToOrigin * dist_perpLineToOrigin));
trace("modifierDist " + modifierDist);
tempdistancesObj.minDist = dist_alongLineToOrigin - modifierDist;
tempdistancesObj.maxDist = dist_alongLineToOrigin + modifierDist;
trace("=======================");
return(tempdistancesObj);
}
}
}
return(0);
}
function lineOfFireHitsWall(tempLine_x, tempLine_y, tempLine_ux, tempLine_uy) {
dist_LT = (tempLine_ux * (roomBufferTop - tempLine_y)) - (tempLine_uy * (roomBufferLeft - tempLine_x));
dist_RT = (tempLine_ux * (roomBufferTop - tempLine_y)) - (tempLine_uy * (roomBufferRight - tempLine_x));
dist_LB = (tempLine_ux * (roomBufferBottom - tempLine_y)) - (tempLine_uy * (roomBufferLeft - tempLine_x));
dist_RB = (tempLine_ux * (roomBufferBottom - tempLine_y)) - (tempLine_uy * (roomBufferRight - tempLine_x));
if ((dist_LT > 0) && (dist_LB < 0)) {
temp_dx = roomBufferLeft - tempLine_x;
temp_dy = (temp_dx * tempLine_uy) / tempLine_ux;
temp_angle = 0;
} else if ((dist_RB > 0) && (dist_RT < 0)) {
temp_dx = roomBufferRight - tempLine_x;
temp_dy = (temp_dx * tempLine_uy) / tempLine_ux;
temp_angle = 180;
} else if ((dist_LB < 0) && (dist_RB > 0)) {
temp_dy = roomBufferTop - tempLine_y;
temp_dx = (temp_dy * tempLine_ux) / tempLine_uy;
temp_angle = 90;
} else if ((dist_LB > 0) && (dist_RB < 0)) {
temp_dy = roomBufferBottom - tempLine_y;
temp_dx = (temp_dy * tempLine_ux) / tempLine_uy;
temp_angle = -90;
}
temp_x = tempLine_x + temp_dx;
temp_y = tempLine_y + temp_dy;
createRicochet("ricochet", 2, temp_x, temp_y, temp_angle);
shortestLineOfFireDist = 1000;
}
function objectGetsHurt(tempObj, damage, temp_x, temp_y, temp_ux, temp_uy) {
trace("tempObj.classification: " + tempObj.classification);
if (tempObj.classification == "pL") {
trace((("temp_ux: " + temp_ux) + " :: temp_uy: ") + temp_uy);
trace((("temp_x: " + temp_x) + " :: temp_y: ") + temp_y);
if (pL.status != "dies") {
pL.health = pL.health - (damage * g_difficulty);
if (pL.health <= 0) {
pL_weaponSoundStop();
pL_mouseDown = false;
pL.health = 0;
pL.status = "dies";
pL.currentMission = "";
game_MC.pL_MC.gotoAndStop("dies");
startLevelCompleteCountdown("pL_dead");
i = 1;
while (i < 28) {
createExplosionParticle("bloodsplatterRed1", temp_x, temp_y, 5 * (0.2 + (0.8 * Math.random())), -180 * Math.random(), 15 + (15 * Math.random()), 20, 5 * FPS, false);
i++;
}
playSound("pL", "game_MC", "dies", 1);
} else {
pL.status = "getsHurt";
pL.vx = damage * temp_ux;
pL.vy = damage * temp_uy;
pL_getsHurtCounterFr = FPS / 2;
playSound("pL", "game_MC", "getsHurt", 0.5);
}
temp_angle = (180 / PI) * Math.acos(temp_ux / 1);
if (temp_uy < 0) {
temp_angle = temp_angle * -1;
}
i = 1;
while (i < (damage / 2)) {
createExplosionParticle("bloodsplatterRed1", temp_x, temp_y, 5 * (0.4 + (0.6 * Math.random())), (temp_angle - 180) + (50 * (0.5 - Math.random())), 15 + (15 * Math.random()), 20, 5 * FPS, false);
i++;
}
i = 1;
while (i < (1.5 * damage)) {
createExplosionParticle("bloodsplatterRed1", temp_x, temp_y, (damage * 2) * (0.4 + (0.6 * Math.random())), temp_angle + (30 * (0.5 - Math.random())), 15 + (15 * Math.random()), 20, 5 * FPS, false);
i++;
}
statusWindowMC.pL_heathMC.barMC._xscale = pL.health;
}
} else {
tempEnemyNo = tempObj.arrayNo;
trace(("-- hitObject.multiPart.name: " + hitObject.multiPart.name) + hitObject.multiPart.id);
trace("-------------------tempEnemyNo health: " + tempObj.health);
trace("-------------------tempEnemyObj.multiPart.health: " + tempObj.multiPart.health);
trace(("-------------------tempEnemyObj.multiPart.name: " + tempObj.multiPart.name) + tempObj.multiPart.id);
if (tempObj.multiPart.name != "") {
tempObj.health = tempObj.health - damage;
tempObj.multiPart.health = tempObj.multiPart.health - damage;
if ((tempObj.health <= 0) || (tempObj.multiPart.health <= 0)) {
}
} else {
tempObj.health = tempObj.health - damage;
}
if (tempObj.health <= 0) {
tempObj.health = 0;
tempObjMC = eval (tempObj.target);
trace(" @@@@@@@@@@@@@@@@@@ ENEMY DIES: " + tempObjMC);
tempObjMC.gotoAndStop("explosionParts");
multiPartNo = tempObj.explosionBodyPartsArr.length;
while ((multiPartNo--) > 0) {
partObj = tempObj.multiPartArr[multiPartNo];
explosionObj = tempObj.explosionBodyPartsArr[multiPartNo];
if (damage > 20) {
v_adjust = 20;
} else {
v_adjust = damage;
}
v_adjust = v_adjust / 4;
temp_v = 4 + ((v_adjust * Math_random()) / 2);
subNo = 1;
while (subNo <= explosionObj.noOfParts) {
multiPartMC = eval (((tempObj.target + ".") + explosionObj.name) + subNo);
temp_x = tempObjMC._x + multiPartMC._x;
temp_y = tempObjMC._y + multiPartMC._y;
temp_angle = temp_angle + (20 * (-0.5 + Math_random()));
temp_angle = -90 + (150 * (-0.5 + Math_random()));
createExplosionParticle((tempObj.type + "_") + explosionObj.name, temp_x, temp_y, temp_v, temp_angle, 100, 100, 5 * FPS, false);
explosionPartMC = eval (explosionParticleArr[explosionParticleArr.length - 1].targetMC);
explosionPartMC._rotation = multiPartMC._rotation;
explosionPartMC.gotoAndStop(explosionPartMC._totalframes - int(explosionPartMC._totalframes * (partObj.health / partObj.fullHealth)));
subNo++;
}
}
tempObjMC.gotoAndStop("dies");
enemyArr.splice(tempEnemyNo, 1);
switch (tempObj.type) {
case "zombie" :
case "crawler" :
case "bat" :
case "wasp" :
case "GiantSpider" :
case "GiantWasp" :
i = 1;
while (i < 10) {
i++;
}
break;
case "demon" :
break;
default :
switch (tempObj.shape) {
case "circle" :
enemyArea = (4 * tempObj.rad) * tempObj.rad;
break;
case "rectangle" :
enemyArea = tempObj.w * tempObj.h;
}
trace("enemyArea: " + enemyArea);
noOfDebry = 2 + (enemyArea / 80);
if ((enemyArea / 3) > 100) {
debrySize = 100;
} else {
debrySize = 30 + ((enemyArea * 70) / 300);
}
startAngle = 360 * Math.random();
i = 1;
for(;;){
if (i >= 3) {
break;
}
createExplosionParticle("debry1", enemyMC._x, enemyMC._y, noOfDebry, startAngle - ((i * 360) / (enemyArea / 50)), debrySize, 0, 0, false);
i++;
};
}
playSound(tempObj.type, tempObj.target, "dies", 1);
} else {
if (tempObj.multiPart.name != "") {
enemyMC = eval ((((tempObj.target + ".") + tempObj.multiPart.name) + tempObj.multiPart.id) + "_MC");
if (enemyMC._totalframes > 1) {
enemyMC.gotoAndStop(1 + int(enemyMC._totalframes * (1 - (tempObj.multiPart.health / tempObj.multiPart.fullHealth))));
goToFr = 1 + int(enemyMC._totalframes * (1 - (tempObj.multiPart.health / tempObj.multiPart.fullHealth)));
trace("-- goToFr: " + goToFr);
}
trace("-- enemyMC: " + enemyMC);
trace("-- enemyMC._totalframes: " + enemyMC._totalframes);
trace("-- enemyMC._currentframe: " + enemyMC._currentframe);
trace("-------------------tempObj.multiPart.name: " + tempObj.multiPart.name);
trace("-------------------tempObj.multiPart.health: " + tempObj.multiPart.health);
trace("-------------------tempObj.multiPart.fullHealth: " + tempObj.multiPart.fullHealth);
} else {
trace(("-- hitObject.multiPart.name: " + hitObject.multiPart.name) + tempObj.multiPart.id);
trace("-------------------tempEnemyNo health: " + tempObj.health);
trace("-------------------tempEnemyObj.multiPart.health: " + tempObj.multiPart.health);
trace("-------------------tempEnemyObj.multiPart.fullHealth: " + tempObj.multiPart.fullHealth);
trace(("-------------------tempEnemyObj.multiPart.name: " + tempObj.multiPart.name) + tempObj.multiPart.id);
}
temp_angle = (180 / PI) * Math.acos(temp_ux / 1);
if (temp_uy < 0) {
temp_angle = temp_angle * -1;
}
trace("tempObj.type.: " + tempObj.type);
switch (tempObj.type) {
case "zombie" :
case "crawler" :
case "bat" :
case "wasp" :
case "GiantSpider" :
case "GiantWasp" :
case "Demon" :
i = 1;
while (i < 3) {
createExplosionParticle("bloodsplatterGreen1", temp_x, temp_y, 8 * (0.2 + (0.8 * Math.random())), (temp_angle - 180) + (40 * (0.5 - Math.random())), 15 + (15 * Math.random()), 20, (0.5 + (0.5 * Math.random())) * FPS, false);
i++;
}
i = 1;
while (i < (3 + damage)) {
createExplosionParticle("bloodsplatterGreen1", temp_x, temp_y, 8 * (0.2 + (0.8 * Math.random())), temp_angle + (40 * (0.5 - Math.random())), 15 + (15 * Math.random()), 20, (0.5 + (0.5 * Math.random())) * FPS, false);
i++;
}
playSound(tempObj.type, tempObj.target, "getsHurt", 0.6);
break;
default :
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
trace("tempObj.type.: " + tempObj.type);
}
}
statusWindowMC.EnemyStatusMC._visible = true;
statusWindowMC.EnemyStatusMC.gotoAndStop(tempObj.type + tempObj.typeNo);
statusWindowMC.EnemyStatusMC.heathMC.barMC._xscale = (100 * tempObj.health) / tempObj.fullHealth;
enemyStatusDisplayFr = 3 * FPS;
}
}
function sgExplodes(sgObj) {
switch (sgObj.type) {
case "debry1" :
explosionRadius = 50;
explosionDamage = 5;
break;
case "zombie" :
break;
case "turret" :
case "flying" :
case "walker" :
explosionRadius = 40;
explosionDamage = 10;
break;
case "rocketLauncher" :
explosionRadius = 40;
explosionDamage = sgObj.attackDamage / 2;
break;
case "flameThrower" :
break;
case "grenade" :
explosionRadius = 20;
explosionDamage = sgObj.attackDamage / 2;
break;
case "bloodsplatterRed1" :
case "bloodsplatterGreen1" :
explosionRadius = 0;
explosionDamage = 0;
case "zombieSpit" :
case "GiantSpiderSpit" :
case "GiantWaspSpit" :
case "DemonSpit" :
explosionRadius = 20;
explosionDamage = sgObj.attackDamage / 2;
}
if (sgObj.originObj.classification == "pL") {
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
}
}
temp_dx = pL.x - sgObj.x;
temp_dy = (pL.y - (pL.h / 2)) - sgObj.y;
temp_dist = Math.sqrt((temp_dx * temp_dx) + (temp_dy * temp_dy));
if (temp_dist < explosionRadius) {
temp_ux = temp_dx / temp_dist;
temp_uy = temp_dy / temp_dist;
temp_x = pL.x + (temp_ux * dist);
temp_y = (pL.y - (pL.h / 2)) + (temp_uy * temp_dist);
damage = sgObj.attackDamage * (1 - (temp_dist / explosionRadius));
objectGetsHurt(pL, damage, pL.x, pL.y - (pL.h / 2), temp_ux, temp_uy);
}
}
function checkPlatformCollision(obj) {
obj.xmin = obj.x - (obj.w / 2);
obj.xmax = obj.x + (obj.w / 2);
obj.ymin = obj.y - obj.h;
obj.ymax = obj.y;
platfromNo = platformArr.length;
while ((platfromNo--) > 0) {
P = platformArr[platfromNo];
P.xmin = P.x;
P.xmax = P.xmin + P.w;
P.ymin = P.y;
P.ymax = P.ymin + P.h;
if ((obj.xmax > P.xmin) && (obj.xmin < P.xmax)) {
if ((P.ymin <= obj.ymax) && (P.ymin >= (obj.ymax - obj.vy))) {
obj.y = (obj.ymax = P.ymin);
obj.vy = 0;
obj.jumping = false;
} else if ((P.ymax >= obj.ymin) && (P.ymax <= (obj.ymin - obj.vy))) {
obj.ymin = P.ymax;
obj.y = obj.ymin + obj.h;
obj.vy = 0;
}
if ((obj.ymax > P.ymin) && (obj.ymin < P.ymax)) {
if ((P.xmin <= obj.xmax) && (P.xmin >= (obj.xmax - obj.vx))) {
obj.xmax = P.xmin;
obj.xmin = obj.xmax - obj.w;
} else if ((P.xmax >= obj.xmin) && (P.xmax <= (obj.xmin - obj.vx))) {
obj.xmin = P.xmax;
obj.xmax = obj.xmin + obj.w;
}
}
}
}
obj.x = (obj.xmin + obj.xmax) / 2;
}
function moveObjectTowardObject(movementType, moveObject, towardObject) {
switch (movementType) {
case "x" :
return;
case "y" :
return;
case "xy" :
return;
}
}
function checkIfLineOfFireHitAnything(firingObj, checkPL, checkEnemies, checkPlatforms) {
nothingHitDist = 1000;
shortestLineOfFireObj = [];
shortestLineOfFireObj.minDist = nothingHitDist;
currDistObj = [];
hitObject = [];
hitObject.classification = "nothing";
firingObj_MC = eval (firingObj.target);
tempLineObj = firingObj_MC.weapon_MC.lineOfFire_MC;
nozzleX = firingObj_MC.weapon_MC.nozzle_MC._x;
nozzleY = (firingObj_MC.weapon_MC.nozzle_MC._y * firingObj_MC.weapon_MC._xscale) / 100;
tempLine_x = (firingObj.x + (firingObj.weapon_ux * nozzleX)) - (firingObj.weapon_uy * nozzleY);
tempLine_y = ((firingObj.y - firingObj.weaponRotationY) + (firingObj.weapon_ux * nozzleY)) + (firingObj.weapon_uy * nozzleX);
if (checkPL) {
multiPartObj = pL;
currDistObj = lineObjectIntersectionDist(tempLine_x, tempLine_y, firingObj.weapon_ux, firingObj.weapon_uy, multiPartObj);
if (currDistObj.minDist > 0) {
trace("multiPartObj.multiPartArr.length " + multiPartObj.multiPartArr.length);
if (currDistObj.minDist < shortestLineOfFireObj.minDist) {
if (multiPartObj.multiPartArr.length <= 0) {
shortestLineOfFireObj = currDistObj;
hitObject = multiPartObj;
hitObject.arrayNo = enemyNo;
} else {
trace("type: " + multiPartObj.type);
trace("multi: " + multiPartObj.multiPartArr.length);
multiPartNo = multiPartObj.multiPartArr.length;
while ((multiPartNo--) > 0) {
partObj = multiPartObj.multiPartArr[multiPartNo];
if (partObj.health > 0) {
trace(((multiPartNo + " multi: ") + partObj.name) + partObj.id);
partMC = eval ((((multiPartObj.target + ".") + partObj.name) + partObj.id) + "_MC");
trace("multi partMC: " + partMC);
trace("multi partObj.registration: " + partObj.registration);
trace("multi parent x: " + partMC._parent._x);
trace("multi parent y: " + partMC._parent._y);
trace("partObj.shape: " + partObj.shape);
if (multiPartObj.vx < 0) {
partObj.parentDirection = -1;
} else {
partObj.parentDirection = 1;
}
partObj.parentDirection = multiPartObj.direction;
trace("multiPartObj.direction: " + multiPartObj.direction);
partObj.x = partMC._parent._x + (partMC._x * partObj.parentDirection);
partObj.y = partMC._parent._y + partMC._y;
if (partObj.shape == "circle") {
partObj.rotation = partMC._rotation;
trace("partObj.rotation: " + partObj.rotation);
} else if (partObj.shape == "rectangle") {
partObj.w = partMC._width;
partObj.h = partMC._height;
}
trace("multi partMC x: " + partObj.x);
trace("multi partMC y: " + partObj.y);
trace("multi partMC w: " + partMC._width);
trace("multi partMC h: " + partMC._height);
currDistObj = lineObjectIntersectionDist(tempLine_x, tempLine_y, firingObj.weapon_ux, firingObj.weapon_uy, partObj);
trace("-- currDistObj.minDist: " + currDistObj.minDist);
if ((currDistObj.minDist > 0) && (currDistObj.minDist < shortestLineOfFireObj.minDist)) {
shortestLineOfFireObj = currDistObj;
trace("shortestLineOfFireObj.classification " + shortestLineOfFireObj.classification);
hitObject = multiPartObj;
hitObject.multiPart = partObj;
hitObject.arrayNo = enemyNo;
trace(("-- hitObject.multiPart.name: " + hitObject.multiPart.name) + hitObject.multiPart.id);
}
}
}
}
}
}
}
if (checkEnemies) {
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
enemyObj = enemyArr[enemyNo];
currDistObj = lineObjectIntersectionDist(tempLine_x, tempLine_y, firingObj.weapon_ux, firingObj.weapon_uy, enemyObj);
if (currDistObj.minDist > 0) {
trace("enemyObj.multiPartArr.length " + enemyObj.multiPartArr.length);
if (currDistObj.minDist < shortestLineOfFireObj.minDist) {
if (enemyObj.multiPartArr.length <= 0) {
shortestLineOfFireObj = currDistObj;
hitObject = enemyObj;
hitObject.arrayNo = enemyNo;
} else {
trace("type: " + enemyObj.type);
trace("multi: " + enemyObj.multiPartArr.length);
multiPartNo = enemyObj.multiPartArr.length;
while ((multiPartNo--) > 0) {
partObj = enemyObj.multiPartArr[multiPartNo];
if (partObj.health > 0) {
trace(((multiPartNo + "multi: ") + partObj.name) + partObj.id);
partMC = eval ((((enemyObj.target + ".") + partObj.name) + partObj.id) + "_MC");
trace("multi partMC: " + partMC);
trace("multi partObj.registration: " + partObj.registration);
trace("multi parent x: " + enemyObj.target._x);
trace("multi parent y: " + enemyObj.target._y);
trace("partObj.shape: " + partObj.shape);
trace("enemyObj.direction: " + enemyObj.direction);
partObj.x = enemyObj.target._x + (partMC._x * enemyObj.direction);
partObj.y = enemyObj.target._y + partMC._y;
if (partObj.shape == "circle") {
partObj.rotation = partMC._rotation;
trace("partObj.rotation: " + partObj.rotation);
} else if (partObj.shape == "rectangle") {
partObj.w = partMC._width;
partObj.h = partMC._height;
}
partObj.parentDirection = enemyObj.direction;
trace("enemyObj.direction: " + enemyObj.direction);
trace("multi partMC x: " + partObj.x);
trace("multi partMC y: " + partObj.y);
trace("multi partMC w: " + partMC._width);
trace("multi partMC h: " + partMC._height);
currDistObj = lineObjectIntersectionDist(tempLine_x, tempLine_y, firingObj.weapon_ux, firingObj.weapon_uy, partObj);
trace("-- currDistObj.minDist: " + currDistObj.minDist);
if ((currDistObj.minDist > 0) && (currDistObj.minDist < shortestLineOfFireObj.minDist)) {
shortestLineOfFireObj = currDistObj;
trace("shortestLineOfFireObj.classification " + shortestLineOfFireObj.classification);
hitObject = enemyObj;
hitObject.multiPart = partObj;
hitObject.arrayNo = enemyNo;
trace(("-- hitObject.multiPart.name: " + hitObject.multiPart.name) + hitObject.multiPart.id);
}
}
}
}
}
}
}
}
if (checkPlatforms) {
platformNo = platformArr.length;
trace("platformNo: " + platformNo);
while ((platformNo--) > 0) {
currDistObj = lineObjectIntersectionDist(tempLine_x, tempLine_y, firingObj.weapon_ux, firingObj.weapon_uy, platformArr[platformNo]);
currDist = currDistObj.minDist;
if (currDistObj.minDist > 0) {
if (currDistObj.minDist < shortestLineOfFireObj.minDist) {
shortestLineOfFireObj = currDistObj;
hitObject = platformArr[platformNo];
hitObject.arrayNo = platformNo;
}
}
}
}
if (shortestLineOfFireObj.minDist > 0) {
trace(" ###################################### ");
trace(" # hitObject.classification " + hitObject.classification);
trace(" ###################################### ");
trace(shortestLineOfFireObj.minDist);
switch (hitObject.classification) {
case "pL" :
trace(" shortestLineOfFireObj.maxX " + shortestLineOfFireObj.maxX);
temp_x = tempLine_x + (shortestLineOfFireObj.minDist * firingObj.weapon_ux);
temp_y = tempLine_y + (shortestLineOfFireObj.minDist * firingObj.weapon_uy);
objectGetsHurt(hitObject, firingObj.attackDamage, temp_x, temp_y, firingObj.weapon_ux, firingObj.weapon_uy);
case "platform" :
temp_angle = (180 / Math.PI) * Math.atan(firingObj.weapon_uy / firingObj.weapon_ux);
temp_x = tempLine_x + (shortestLineOfFireObj.minDist * firingObj.weapon_ux);
temp_y = tempLine_y + (shortestLineOfFireObj.minDist * firingObj.weapon_uy);
createRicochet("ricochet", 1, temp_x, temp_y, firingObj.weaponAngleDeg + 180);
break;
case "enemy" :
temp_angle = (180 / Math.PI) * Math.atan(firingObj.weapon_uy / firingObj.weapon_ux);
temp_x = tempLine_x + (shortestLineOfFireObj.minDist * firingObj.weapon_ux);
temp_y = tempLine_y + (shortestLineOfFireObj.minDist * firingObj.weapon_uy);
objectGetsHurt(hitObject, firingObj.attackDamage, temp_x, temp_y, firingObj.weapon_ux, firingObj.weapon_uy);
temp_x = tempLine_x + (shortestLineOfFireObj.maxDist * firingObj.weapon_ux);
temp_y = tempLine_y + (shortestLineOfFireObj.maxDist * firingObj.weapon_uy);
break;
case "nothing" :
}
} else {
shortestLineOfFireObj.minDist = 1000;
}
trace("firingObj.weaponType: " + firingObj.weaponType);
trace("firingObj.weaponType: " + firingObj.weaponType);
trace("firingObj.weaponType: " + firingObj.weaponType);
trace("firingObj.weaponType: " + firingObj.weaponType);
trace("firingObj.weaponType: " + firingObj.weaponType);
trace("firingObj.weaponType: " + firingObj.weaponType);
trace("firingObj.weaponType: " + firingObj.weaponType);
trace("firingObj.weaponType: " + firingObj.weaponType);
firingObj_MC.weapon_MC.flash_MC.gotoAndPlay(firingObj.weaponType);
firingObj_MC.weapon_MC.lineOfFire_MC.gotoAndPlay(2);
firingObj_MC.weapon_MC.lineOfFire_MC._width = shortestLineOfFireObj.minDist;
}
function doorIsOpen() {
if (pL.currDoor.usage == "enter") {
if ((pL.x == pL.currDoor.x) && (pL.y == pL.currDoor.y)) {
pL.z = 1;
pL.status = "wait";
game_MC.pL_MC.swapDepths(20 + pL.currDoor.target.getDepth());
game_MC.pL_MC.attachMovie("door_" + pL.currDoor.type, "accessedDoorMC", 50);
game_MC.pL_MC.accessedDoorMC.gotoAndPlay("close");
} else {
pL.currDoor.target.gotoAndPlay("close");
pL.currDoor.usage = "none";
}
} else if (pL.currDoor.usage == "exit") {
pL.z = 0;
pL.status = "walk";
game_MC.pL_MC.accessedDoorMC.removeMovieClip();
pL.currDoor.target.gotoAndPlay("close");
game_MC.pL_MC.swapDepths(pL.layerDepth);
}
}
function doorIsClosed() {
trace("----------- doorIsClosed ----------------------");
if (pL.currDoor.usage == "enter") {
pL.currDoor.target.gotoAndStop(1);
if (pL.currDoor.noOfDoors >= 3) {
game_MC.doorButtonsMC._visible = true;
game_MC.doorButtonsMC._x = pL.currDoor.x + 40;
game_MC.doorButtonsMC._y = pL.currDoor.y;
game_MC.doorButtonsMC.gotoAndStop(pL.currDoor.noOfDoors);
} else if (pL.currDoor.type == "finishedMission") {
startLevelCompleteCountdown("missionComplete");
trace("----------- missionComplete ----------------------");
} else if (pL.currDoor.connRoom != g_roomNo) {
saveRoomData();
g_roomNo = pL.currDoor.connRoom;
g_doorNo = pL.currDoor.connDoor;
i = 0;
while (i < 15) {
trace((("g_roomNo: " + g_roomNo) + " :: g_doorNo: ") + g_doorNo);
trace("pL.currDoor.connDoor: " + pL.currDoor.connDoor);
i++;
}
trace("doorArr.length: " + doorArr.length);
i = 0;
while (i < doorArr.length) {
doorObj = doorArr[i];
trace((i + " doorObj.type: ") + doorObj.type);
if ((doorObj.roomNo == g_roomNo) && (doorObj.doorNo == g_doorNo)) {
pL.currDoor = doorObj;
room_init();
doorID = "door_" + pL.currDoor.type;
doorMC = eval (((("game_MC.bgndMC." + doorID) + "_") + g_doorNo) + "_MC");
pL.currDoor.target = doorMC;
pL.x = pL.currDoor.x;
pL.y = pL.currDoor.y;
pL.currDoor.target.gotoAndStop("open");
game_MC.pL_MC.attachMovie("door_" + pL.currDoor.type, "accessedDoorMC", 50);
game_MC.pL_MC.accessedDoorMC.gotoAndPlay("open");
pL.currDoor.usage = "exit";
i = doorArr.length;
}
i++;
}
} else {
move_pLtoSelectedDoor();
}
} else if (pL.currDoor.usage == "exit") {
}
}
function move_pLtoSelectedDoor() {
if (pL.currDoor.noOfDoors >= 3) {
saveRoomData();
temp_doorNo = 0;
selected_doorNo = pL.currDoor.connDoor;
i = 0;
while (i < doorArr.length) {
doorObj = doorArr[i];
if (doorObj.noOfDoors >= 3) {
temp_doorNo++;
if (selected_doorNo == temp_doorNo) {
pL.currDoor.connDoor = (g_doorNo = doorObj.doorNo);
if (g_roomNo != doorObj.roomNo) {
g_roomNo = doorObj.roomNo;
room_init();
}
}
}
i++;
}
}
g_doorNo = pL.currDoor.connDoor;
i = 0;
while (i < doorArr.length) {
doorObj = doorArr[i];
if ((doorObj.roomNo == g_roomNo) && (doorObj.doorNo == g_doorNo)) {
doorID = "door_" + doorObj.type;
doorMC = eval (((("game_MC.bgndMC." + doorID) + "_") + g_doorNo) + "_MC");
pL.currDoor = doorObj;
pL.currDoor.target = doorMC;
pL.x = (pL_MC._x = doorMC._x);
pL.y = (pL_MC._y = doorMC._y);
}
i++;
}
pL.currDoor.usage = "exit";
game_MC.pL_MC.attachMovie("door_" + pL.currDoor.type, "accessedDoorMC", 50);
game_MC.pL_MC.accessedDoorMC.gotoAndPlay("open");
pL.currDoor.target.gotoAndStop("open");
game_MC.doorButtonsMC._visible = false;
}
trace("=====================================================================");
trace((("xtype: " + xtype) + " :: xtype: ") + xtype);
i = 1;
while (i < 10) {
trace("multiPartObj.: " + multiPartObj);
i++;
}
Array.prototype.sortOn = function (p) {
Array.$sortprop = p;
var sortfunc = function (a, b) {
var p = Array.$sortprop;
return(b[p] < a[p]);
};
this.sort(sortfunc);
delete Array.$sortprop;
};
if (firstTimeToLoad == undefined) {
firstTimeToLoad = false;
setDefaultKeys();
FPS = 24;
sw = 440;
sh = 320;
PI = 3.1415;
grav = 24 / FPS;
g = [];
g_missionNo = 1;
g_taskNo = 1;
g_difficulty = 0;
soundArr = [];
soundArr.push({owner:"pL", soundType:"getsHurt", noOfSounds:2, soundName:"uh"});
soundArr.push({owner:"pL", soundType:"dies", soundName:"uuuuh1"});
soundArr.push({owner:"grass", soundType:"attack", soundName:"swoosh1"});
soundArr.push({owner:"bat", soundType:"getsHurt", soundName:"ee"});
soundArr.push({owner:"bat", soundType:"dies", soundName:"eeee1"});
soundArr.push({owner:"wasp", soundType:"getsHurt", soundName:"ee"});
soundArr.push({owner:"wasp", soundType:"dies", soundName:"eeee1"});
soundArr.push({owner:"crawler", soundType:"attack", soundName:"pew1"});
soundArr.push({owner:"crawler", soundType:"getsHurt", noOfSounds:3, soundName:"thud"});
soundArr.push({owner:"crawler", soundType:"dies", soundName:"squish_long"});
soundArr.push({owner:"zombie", soundType:"getsHurt", noOfSounds:3, soundName:"squish"});
soundArr.push({owner:"zombie", soundType:"dies", soundName:"squish_long"});
soundArr.push({owner:"GiantSpider", soundType:"dies", soundName:"squish_long"});
soundArr.push({owner:"GiantSpider", soundType:"getsHurt", noOfSounds:3, soundName:"squish"});
soundArr.push({owner:"GiantWasp", soundType:"dies", soundName:"squish_long"});
soundArr.push({owner:"GiantWasp", soundType:"getsHurt", noOfSounds:3, soundName:"squish"});
soundArr.push({owner:"Demon", soundType:"dies", soundName:"squish_long"});
soundArr.push({owner:"Demon", soundType:"getsHurt", noOfSounds:3, soundName:"squish"});
levelCodeArr = [];
levelCodeArr[1] = [];
levelCodeArr[1][1] = {code:"briefing", unlocked:true, roomNo:1, pL_x:100, pL_y:178};
levelCodeArr[1][2] = {code:"spidersense", unlocked:false, roomNo:19, pL_x:100, pL_y:250};
levelCodeArr[1][3] = {code:"thechoice", unlocked:false, roomNo:20, pL_x:50, pL_y:250};
levelCodeArr[1][4] = {code:"stinger", unlocked:false, roomNo:31, pL_x:220, pL_y:260};
levelCodeArr[1][5] = {code:"jumpjump", unlocked:false, roomNo:32, pL_x:380, pL_y:260};
levelCodeArr[1][6] = {code:"funtime", unlocked:false, roomNo:42, pL_x:80, pL_y:260};
levelCodeArr[2] = [];
levelCodeArr[2][1] = {code:"21", unlocked:true, roomNo:1, pL_x:TO_BE_SET, pL_y:TO_BE_SET};
levelCodeArr[2][2] = {code:"22", unlocked:false, roomNo:TO_BE_SET, pL_x:TO_BE_SET, pL_y:TO_BE_SET};
levelCodeArr[2][3] = {code:"23", unlocked:false, roomNo:TO_BE_SET, pL_x:TO_BE_SET, pL_y:TO_BE_SET};
levelCodeArr[2][4] = {code:"24", unlocked:false, roomNo:TO_BE_SET, pL_x:TO_BE_SET, pL_y:TO_BE_SET};
levelCodeArr[2][5] = {code:"25", unlocked:false, roomNo:TO_BE_SET, pL_x:TO_BE_SET, pL_y:TO_BE_SET};
i = 1;
while (i < levelCodeArr.length) {
j = 1;
while (j < levelCodeArr[i].length) {
trace((((("levelCodeArr[" + i) + "][") + j) + "]: ") + levelCodeArr[i][j].code);
trace((((("levelCodeArr[" + i) + "][") + j) + "]: ") + levelCodeArr[i][j].unlocked);
j++;
}
i++;
}
checkPointPath1_arr = [];
currCheckPointPath_arr = checkPointPath1_arr;
currCheckPointPath_arr.push([320, 110]);
currCheckPointPath_arr.push([120, 110]);
checkPointPath2_arr = [];
currCheckPointPath_arr = checkPointPath2_arr;
currCheckPointPath_arr.push([320, 70]);
currCheckPointPath_arr.push([120, 70]);
currCheckPointPath_arr.push([120, 160]);
currCheckPointPath_arr.push([320, 160]);
checkPointPath3_arr = [];
currCheckPointPath_arr = (checkPointPath3_arr = []);
currCheckPointPath_arr.push([220, 50]);
currCheckPointPath_arr.push([140, 100]);
currCheckPointPath_arr.push([220, 150]);
currCheckPointPath_arr.push([300, 100]);
checkPointPath4_arr = [];
currCheckPointPath_arr = checkPointPath4_arr;
currCheckPointPath_arr.push([220, 100]);
currCheckPointPath_arr.push([160, 130]);
currCheckPointPath_arr.push([160, 190]);
currCheckPointPath_arr.push([220, 220]);
currCheckPointPath_arr.push([280, 190]);
currCheckPointPath_arr.push([280, 130]);
checkPointPath5_arr = [];
currCheckPointPath_arr = checkPointPath5_arr;
currCheckPointPath_arr.push([320, 110]);
currCheckPointPath_arr.push([120, 110]);
currCheckPointPath_arr.push([320, 160]);
currCheckPointPath_arr.push([120, 160]);
currCheckPointPath_arr.push([320, 210]);
currCheckPointPath_arr.push([120, 210]);
testArray = checkPointPath1_arr;
arrNo = checkPointPath1_arr.length;
while ((arrNo--) > 0) {
trace(((((" checkPointPath_1_arr :: " + arrNo) + " :: ") + testArray[arrNo][0]) + " :: ") + testArray[arrNo][1]);
}
pL_weaponsArr = [];
pL_weaponsArr.push(new Weapon(true, "pistol", "inf", FPS / 3, 1));
pL_weaponsArr.push(new Weapon(true, "blasterGun", "inf", FPS * 0.66, 3));
pL_weaponsArr.push(new Weapon(true, "uzi", 40, 4, 1));
pL_weaponsArr.push(new Weapon(true, "machineGun", "inf", 4, 1));
pL_weaponsArr.push(new Weapon(true, "miniGun", 50, 3, 1));
pL_weaponsArr.push(new Weapon(true, "laser", "inf", FPS, 4 / FPS, 1));
pL_weaponsArr.push(new Weapon(true, "rocketLauncher", "inf", 0.3 * FPS, 12));
pL_weaponsArr.push(new Weapon(true, "flameThrower", "inf", 2, 1));
pL_weaponsArr.push(new Weapon(true, "grenade", "inf", FPS, 4));
pL.grenadeThrowVelocity = 0;
testArray = pL_weaponsArr;
arrNo = testArray.length;
while ((arrNo--) > 0) {
trace(((((" borderArr :: " + arrNo) + " :: ") + testArray[arrNo].type) + " :: ") + testArray[arrNo].attackDamage);
}
playGameMusic = true;
}
function onEnterFrame_game() {
function pickUpItem(available, roomNo, itemNo, x, y, type, quantity) {
this.available = available;
this.roomNo = roomNo;
this.itemNo = itemNo;
this.x = x;
this.y = y;
this.type = type;
this.quantity = quantity;
}
game_FrNo++;
currRoom_FrNo++;
pL_moveStatus = false;
pL.prevStatus = pL.status;
if (pL.status == "wait") {
} else if (pL.status == "dies") {
if (levelCompleteCounter <= 35) {
pL.vx = 0;
}
pL.x = pL.x + pL.vx;
pL.y = pL.y + ((pL.vy = pL.vy + grav));
checkPlatformCollision(pL);
} else {
if (pL.status == "getsHurt") {
if ((pL_getsHurtCounterFr--) <= 0) {
pL.status = "stand";
}
} else {
if (Key.isDown(key_pLMoveUp) && (!pL.jumping)) {
if (pL.vy == 0) {
pL.vy = pL.vy - pL.jumpSpeed;
pL_moveStatus = true;
pL.jumping = true;
}
}
pL.walking = false;
if ((!pL.jumping) && (Key.isDown(key_pLWalking))) {
pL.walking = true;
trace("pL.walking: " + pL.walking);
}
if (Key.isDown(key_pLMoveLeft)) {
pL_moveStatus = true;
if (pL.walking) {
pL.status = "walk";
pL.vx = (-pL.runSpeed) / 3;
} else {
pL.status = "run";
pL.vx = -pL.runSpeed;
}
} else if (Key.isDown(key_pLMoveRight)) {
pL_moveStatus = true;
if (pL.walking) {
pL.status = "walk";
pL.vx = pL.runSpeed / 3;
} else {
pL.status = "run";
pL.vx = pL.runSpeed;
}
} else if (!pL_moveStatus) {
pL.vx = 0;
pL.status = "stand";
}
if (pL.jumping) {
pL.status = "jump";
}
}
if (pL.vx > 0) {
game_MC.pL_MC.legs_MC._xscale = 100;
} else if (pL.vx < 0) {
game_MC.pL_MC.legs_MC._xscale = -100;
}
pL.x = pL.x + pL.vx;
pL.vy = pL.vy + grav;
pL.y = pL.y + pL.vy;
checkPlatformCollision(pL);
if (pL.x < roomBufferLeft) {
pL.y = pL.y - grav;
reachedroomBuffer("left");
} else if (pL.x > roomBufferRight) {
pL.y = pL.y - grav;
reachedroomBuffer("right");
}
if (pL.y < roomBufferTop) {
reachedroomBuffer("top");
} else if (pL.y > roomBufferBottom) {
reachedroomBuffer("bottom");
}
pL_weapon_dx = _xmouse - pL.x;
pL_weapon_dy = _ymouse - (pL.y - pL.weaponRotationY);
pL_weapon_dist = (dist = Math.sqrt((pL_weapon_dx * pL_weapon_dx) + (pL_weapon_dy * pL_weapon_dy)));
dx_adjust = pL_weapon_dx / Abs(pL_weapon_dx);
dy_adjust = pL_weapon_dy / Abs(pL_weapon_dy);
nozzleY = (game_MC.pL_MC.weapon_MC.nozzle_MC._y * dx_adjust) * dy_adjust;
angleRad = Math.acos(pL_weapon_dx / dist) - Math.asin(nozzleY / dist);
angleRad = angleRad * (pL_weapon_dy / Abs(pL_weapon_dy));
if (pL_weapon_dx < 0) {
}
pL.weaponAngleDeg = 57.2957795130823 * angleRad;
pL.weapon_ux = (ux = Math.cos(angleRad));
pL.weapon_uy = (uy = Math.sin(angleRad));
if (pL_mouseDown) {
if (pL_weaponsArr[pL.currWeaponNo].currReloadFr <= 0) {
if (pL.weaponType == "grenade") {
if ((++pL.grenadeThrowVelocity) >= 15) {
pL.grenadeThrowVelocity = 15;
}
statusWindowMC.txtGrenadeThrow = pL.grenadeThrowVelocity;
pL_weaponsArr[pL.currWeaponNo].currReloadFr = 0;
} else if ((pL_weaponsArr[pL.currWeaponNo].ammo > 0) || (pL_weaponsArr[pL.currWeaponNo].ammo == "inf")) {
if (pL_weaponsArr[pL.currWeaponNo].ammo != "inf") {
statusWindowMC.txtAmmo = --pL_weaponsArr[pL.currWeaponNo].ammo;
}
pL_weaponsArr[pL.currWeaponNo].currReloadFr = pL_weaponsArr[pL.currWeaponNo].reloadFr;
switch (pL.weaponType) {
case "pistol" :
case "blasterGun" :
case "laser" :
pL_weaponFireSnd.start(0, 1);
case "uzi" :
case "machineGun" :
case "miniGun" :
checkIfLineOfFireHitAnything(pL, false, true, true);
game_MC.pL_MC.head_MC.flash_MC.gotoAndPlay(2);
game_MC.pL_MC.body_MC.flash_MC.gotoAndPlay(2);
break;
case "grenade" :
break;
case "rocketLauncher" :
case "flameThrower" :
game_MC.pL_MC.weapon_MC.flash_MC.gotoAndPlay(pL.weaponType);
game_MC.pL_MC.head_MC.flash_MC.gotoAndPlay(2);
game_MC.pL_MC.body_MC.flash_MC.gotoAndPlay(2);
nozzleX = game_MC.pL_MC.weapon_MC.nozzle_MC._x;
nozzleY = (game_MC.pL_MC.weapon_MC.nozzle_MC._y * game_MC.pL_MC.weapon_MC._xscale) / 100;
temp_x = (pL.x + (pL.weapon_ux * nozzleX)) - (pL.weapon_uy * nozzleY);
temp_y = ((pL.y - pL.weaponRotationY) + (pL.weapon_ux * nozzleY)) + (pL.weapon_uy * nozzleX);
createProjectile(pL, pL.weaponType, temp_x, temp_y, pL.weapon_ux, pL.weapon_uy, pL.attackDamage);
break;
}
} else {
pL_weaponSoundStop();
}
}
}
}
if ((--pL_weaponsArr[pL.currWeaponNo].currReloadFr) < 0) {
pL_weaponsArr[pL.currWeaponNo].currReloadFr = 0;
} else {
statusWindowMC.txtReloading = pL_weaponsArr[pL.currWeaponNo].currReloadFr;
statusWindowMC.pL_ReloadMC.barMC._xscale = (100 * (pL_weaponsArr[pL.currWeaponNo].reloadFr - pL_weaponsArr[pL.currWeaponNo].currReloadFr)) / pL_weaponsArr[pL.currWeaponNo].reloadFr;
}
with (game_MC) {
pL_MC._x = pL.x;
pL_MC._y = pL.y;
crossHairMC._x = _xmouse;
crossHairMC._y = _ymouse;
crossHairMC._rotation = pL.weaponAngleDeg;
if (pL_weapon_dx > 0) {
game_MC.pL_MC.arms_MC._xscale = (pL_MC.weapon_MC._xscale = 100);
game_MC.pL_MC.arms_MC._rotation = (pL_MC.weapon_MC._rotation = pL.weaponAngleDeg);
pL_MC.head_MC._xscale = 100;
pL_MC.head_MC._rotation = pL.weaponAngleDeg;
pL_MC.body_MC._xscale = 100;
} else {
game_MC.pL_MC.arms_MC._xscale = (pL_MC.weapon_MC._xscale = -100);
game_MC.pL_MC.arms_MC._rotation = (pL_MC.weapon_MC._rotation = pL.weaponAngleDeg + 180);
pL_MC.head_MC._xscale = -100;
pL_MC.head_MC._rotation = pL.weaponAngleDeg + 180;
pL_MC.body_MC._xscale = -100;
}
if (pL.status != pL.prevStatus) {
game_MC.pL_MC.gotoAndStop(pL.status);
trace((game_FrNo + " ") + pL.status);
}
}
if (projectileArr.length > 0) {
projectileNo = projectileArr.length;
while ((projectileNo--) > 0) {
projObj = projectileArr[projectileNo];
projectileMC = eval (projObj.targetMC);
projExplode = false;
switch (projObj.type) {
case "rocketLauncher" :
break;
case "grenade" :
projObj.vy = projObj.vy + grav;
case "flameThrower" :
if ((--projObj.timer) < 0) {
projExplode = true;
}
break;
case "zombieSpit" :
projObj.vy = projObj.vy + (grav / 8);
break;
case "GiantSpiderSpit" :
case "GiantWaspSpit" :
case "DemonSpit" :
break;
}
projObj.x = projObj.x + projObj.vx;
projObj.y = projObj.y + projObj.vy;
projectileMC._x = projObj.x;
projectileMC._y = projObj.y;
projCollision = false;
if (projObj.originObj.classification == "pL") {
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
enemyMC = eval (enemyArr[enemyNo].target);
if (projectileMC.hitTest(enemyMC.hitAreaMC)) {
projCollision = true;
enemyArr[enemyNo].arrayNo = enemyNo;
objectGetsHurt(enemyArr[enemyNo], projObj.attackDamage);
projExplode = true;
}
}
} else if (projObj.originObj.classification == "enemy") {
if (projectileMC.hitTest(game_MC.pL_MC.hitAreaMC)) {
projCollision = true;
direction = projObj.vx / Abs(projObj.vx);
projExplode = true;
}
}
platfromNo = platformArr.length;
switch (projObj.type) {
case "grenade" :
projObj.rad = 2;
obj = projObj;
trace("===========================================");
obj.xmin = obj.x - obj.rad;
obj.xmax = obj.x + obj.rad;
obj.ymin = obj.y - obj.rad;
obj.ymax = obj.y + obj.rad;
platfromNo = platformArr.length;
while ((platfromNo--) > 0) {
P = platformArr[platfromNo];
P.xmin = P.x;
P.xmax = P.xmin + P.w;
P.ymin = P.y;
P.ymax = P.ymin + P.h;
if ((obj.xmax > P.xmin) && (obj.xmin < P.xmax)) {
if ((P.ymin <= obj.ymax) && (P.ymin >= (obj.ymax - obj.vy))) {
obj.y = (P.ymin - (obj.ymax - P.ymin)) - obj.rad;
obj.vy = (-0.6) * Abs(obj.vy);
obj.vx = obj.vx * 0.8;
} else if ((P.ymax >= obj.ymin) && (P.ymax <= (obj.ymin - obj.vy))) {
obj.y = (P.ymax + (P.ymax - obj.ymax)) + obj.rad;
obj.vy = 0.6 * Abs(obj.vy);
obj.vx = obj.vx * 0.8;
}
if ((obj.ymax > P.ymin) && (obj.ymin < P.ymax)) {
if ((P.xmin <= obj.xmax) && (P.xmin >= (obj.xmax - obj.vx))) {
obj.x = (P.xmin - (obj.xmax - P.xmin)) - obj.rad;
obj.vx = obj.vx * (-1);
obj.vy = obj.vy * 0.6;
} else if ((P.xmax >= obj.xmin) && (P.xmax <= (obj.xmin - obj.vx))) {
obj.x = (P.xmax + (P.xmax - obj.xmax)) + obj.rad;
obj.vx = obj.vx * (-1);
obj.vy = obj.vy * 0.6;
}
}
}
}
break;
case "rocketLauncher" :
case "flameThrower" :
case "zombieSpit" :
case "GiantSpiderSpit" :
case "GiantWaspSpit" :
case "DemonSpit" :
for(;;){
if ((platfromNo--) <= 0) {
break;
}
P = platformArr[platfromNo];
platfromMC = eval (platformArr[platfromNo].target);
if (projectileMC.hitTest(platfromMC)) {
projExplode = true;
}
};
}
if (projObj.y < roomBufferTop) {
projCollision = "removeOnly";
collisionDirection = "y";
projectileMC._y = roomBufferTop;
} else if (projObj.y > roomBufferBottom) {
projCollision = "removeOnly";
collisionDirection = "y";
projectileMC._y = roomBufferBottom;
}
if (projObj.x < roomBufferLeft) {
projCollision = "removeOnly";
collisionDirection = "x";
projectileMC._x = roomBufferLeft;
} else if (projObj.x > roomBufferRight) {
projCollision = "removeOnly";
collisionDirection = "x";
projectileMC._x = roomBufferRight;
}
if (projCollision == true) {
} else if (projCollision == "removeOnly") {
projectileArr.splice(projectileNo, 1);
projectileMC.removeMovieClip();
}
if (projExplode) {
sgExplodes(projObj);
projectileMC.gotoAndPlay("explode");
projectileArr.splice(projectileNo, 1);
}
}
}
i = 0;
while (i < pickUpItemArr.length) {
itemObj = pickUpItemArr[i];
if (itemObj.available && (itemObj.roomNo == g_roomNo)) {
itemID = "pickUpItem";
pickUpItemMC = eval (((("game_MC.pickUpItemMC." + itemID) + "_") + itemObj.itemNo) + "_MC");
if (pickUpItemMC.hitTest(game_MC.pL_MC.hitAreaMC)) {
switch (itemObj.type) {
case "health" :
trace("health: " + g_difficulty);
pL.health = pL.health + (itemObj.quantity / g_difficulty);
trace("health: " + pL.health);
if (pL.health >= 100) {
pL.health = 100;
}
statusWindowMC.pL_heathMC.barMC._xscale = pL.health;
break;
default :
i = 0;
for(;;){
if (i >= pL_weaponsArr.length) {
break;
}
if (pL_weaponsArr[i].type == itemObj.type) {
pL_weaponsArr[i].available = true;
if (pL_weaponsArr[i].ammo != "inf") {
pL_weaponsArr[i].ammo = pL_weaponsArr[i].ammo + itemObj.quantity;
statusWindowMC.txtAmmo = pL_weaponsArr[pL.currWeaponNo].ammo;
}
}
i++;
};
}
itemObj.available = false;
pickUpItemMC.removeMovieClip();
}
}
i++;
}
if (moreEnemyToCome) {
while ((currRoom_FrNo > nextEnemyFrNo) && (moreEnemyToCome)) {
enemyArr.push(tempEnemyArr[0]);
enemyObj = tempEnemyArr[0];
if ((noOfEnemyCreated++) > 200) {
noOfEnemyCreated = 0;
}
game_MC.enemyAttachMC.attachMovie(enemyObj.type + enemyObj.typeNo, (((enemyObj.type + enemyObj.typeNo) + "_") + noOfEnemyCreated) + "_MC", noOfEnemyCreated);
enemyMC = eval ((((("game_MC.enemyAttachMC." + enemyObj.type) + enemyObj.typeNo) + "_") + noOfEnemyCreated) + "_MC");
enemyMC._x = enemyObj.x;
enemyMC._y = enemyObj.y;
enemyObj.type + enemyObj.typeNo;
trace((((enemyObj.type + enemyObj.typeNo) + "_") + noOfEnemyCreated) + "_MC");
switch (enemyObj.type) {
case "turret" :
case "walker" :
enemyMC.weapon_MC._rotation = enemyObj.weaponAngle;
break;
}
enemyObj.target = enemyMC;
tempEnemyArr.splice(0, 1);
nextEnemyFrNo = tempEnemyArr[0].showUpFr;
if (tempEnemyArr.length <= 0) {
moreEnemyToCome = false;
}
}
} else if (updateRestoredEnemies) {
updateRestoredEnemies = false;
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
enemyObj = enemyArr[enemyNo];
multiPartNo = enemyObj.multiPartArr.length;
while ((multiPartNo--) > 0) {
partObj = enemyObj.multiPartArr[multiPartNo];
partMC = eval ((((enemyObj.target + ".") + partObj.name) + partObj.id) + "_MC");
currFrameNo = 1 + int(partMC._totalframes * (1 - (partObj.health / partObj.fullHealth)));
partMC.gotoAndStop(currFrameNo);
}
}
}
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
enemyObj = enemyArr[enemyNo];
enemyMC = eval (enemyObj.target);
enemyPL_dx = pL.x - enemyObj.x;
enemyPL_dy = (pL.y - (pL.h / 2)) - enemyObj.y;
enemyPL_dist = Math.sqrt((enemyPL_dx * enemyPL_dx) + (enemyPL_dy * enemyPL_dy));
enemyPL_ux = enemyPL_dx / enemyPL_dist;
enemyPL_uy = enemyPL_dy / enemyPL_dist;
enemyPL_angle = Math.acos(enemyPL_dx / enemyPL_dist) * (enemyPL_dy / Abs(enemyPL_dy));
enemyPL_angleDeg = 57.2957795130823 * enemyPL_angle;
switch (enemyObj.type) {
case "bat" :
if (!enemyObj.noticedTarget) {
enemyObj.attackTarget = pL;
trace((((("x: " + enemyObj.noticeXmin) + " < ") + enemyObj.attackTarget.x) + " > ") + enemyObj.noticeXmax);
trace((((("y: " + enemyObj.noticeYmin) + " > ") + enemyObj.attackTarget.y) + " < ") + enemyObj.noticeYmax);
if ((enemyObj.attackTarget.x > enemyObj.noticeXmin) && (enemyObj.attackTarget.x < enemyObj.noticeXmax)) {
trace("here 1");
if ((enemyObj.attackTarget.y > enemyObj.noticeYmin) && (enemyObj.attackTarget.y < enemyObj.noticeYmax)) {
trace("here 2");
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
}
if (enemyObj.health < enemyObj.fullHealth) {
trace("here 3");
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
} else {
if (enemyObj.pathName == "pL_follow") {
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
if (Abs(enemyCP_dx) < enemyObj.reachedCheckPointDist) {
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
if (Abs(enemyCP_dy) < enemyObj.reachedCheckPointDist) {
enemyCP_dx = pL.x - enemyObj.x;
enemyCP_dy = (pL.y - (pL.h / 2)) - enemyObj.y;
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
flyDist = 20 + (5 * Math_random());
enemyObj.nextCheckPointX = (enemyObj.x + (flyDist * enemyCP_ux)) + (5 * ((-0.5) + Math_random()));
enemyObj.nextCheckPointY = (enemyObj.y + (flyDist * enemyCP_uy)) + (15 * ((-0.5) + Math_random()));
enemyObj.status = "attack";
trace("enemyObj.nextCheckPointX: " + enemyObj.nextCheckPointX);
trace("enemyCP_dx: " + enemyCP_dx);
trace("enemyObj.x: " + enemyObj.x);
trace("pL.x: " + pL.x);
}
}
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
}
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
enemyObj.x = enemyObj.x + ((enemyObj.vx = enemyCP_ux * enemyObj.v));
enemyObj.y = enemyObj.y + ((enemyObj.vy = enemyCP_uy * enemyObj.v));
if (enemyObj.status == "attack") {
if (game_MC.pL_MC.hitAreaMC.hitTest(enemyMC._x, enemyMC._y, false)) {
objectGetsHurt(pL, enemyObj.attackDamage, enemyObj.x, enemyObj.y, 0.7 * enemyObj.direction, -0.7);
enemyObj.status = "move";
trace("Enemy attacks: " + enemyCP_dist);
enemyCP_dx = (sw / 2) - enemyObj.x;
enemyCP_dy = 0;
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
flyDist = 40 + (20 * Math_random());
enemyObj.nextCheckPointX = (enemyObj.x + (flyDist * enemyCP_ux)) + (5 * ((-0.5) + Math_random()));
enemyObj.nextCheckPointY = (enemyObj.y + (flyDist * enemyCP_uy)) + (25 * ((-0.5) + Math_random()));
playSound(enemyObj.type, enemyObj.target, "attack", 1);
}
}
enemyMC._x = enemyObj.x;
enemyMC._y = enemyObj.y;
}
break;
case "wasp" :
if (!enemyObj.noticedTarget) {
enemyObj.attackTarget = pL;
trace((((("x: " + enemyObj.noticeXmin) + " < ") + enemyObj.attackTarget.x) + " > ") + enemyObj.noticeXmax);
trace((((("y: " + enemyObj.noticeYmin) + " > ") + enemyObj.attackTarget.y) + " < ") + enemyObj.noticeYmax);
if ((enemyObj.attackTarget.x > enemyObj.noticeXmin) && (enemyObj.attackTarget.x < enemyObj.noticeXmax)) {
if ((enemyObj.attackTarget.y > enemyObj.noticeYmin) && (enemyObj.attackTarget.y < enemyObj.noticeYmax)) {
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
}
if (enemyObj.health < enemyObj.fullHealth) {
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
} else {
if (enemyObj.pathName == "pL_follow") {
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
if (Abs(enemyCP_dx) < enemyObj.reachedCheckPointDist) {
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
if (Abs(enemyCP_dy) < enemyObj.reachedCheckPointDist) {
enemyCP_dx = pL.x - enemyObj.x;
enemyCP_dy = (pL.y - (pL.h / 2)) - enemyObj.y;
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
flyDist = 20 + (5 * Math_random());
enemyObj.nextCheckPointX = (enemyObj.x + (flyDist * enemyCP_ux)) + (5 * ((-0.5) + Math_random()));
enemyObj.nextCheckPointY = (enemyObj.y + (flyDist * enemyCP_uy)) + (15 * ((-0.5) + Math_random()));
enemyObj.status = "attack";
trace("enemyObj.nextCheckPointX: " + enemyObj.nextCheckPointX);
trace("enemyCP_dx: " + enemyCP_dx);
trace("enemyObj.x: " + enemyObj.x);
trace("pL.x: " + pL.x);
}
}
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
}
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
enemyObj.x = enemyObj.x + ((enemyObj.vx = enemyCP_ux * enemyObj.v));
enemyObj.y = enemyObj.y + ((enemyObj.vy = enemyCP_uy * enemyObj.v));
if (enemyObj.vx < 0) {
enemyObj.direction = -1;
} else {
enemyObj.direction = 1;
}
enemyMC._xscale = enemyObj.direction * 100;
if (enemyObj.status == "attack") {
if (game_MC.pL_MC.hitAreaMC.hitTest(enemyMC._x, enemyMC._y, false)) {
objectGetsHurt(pL, enemyObj.attackDamage, enemyObj.x, enemyObj.y, 0.7 * enemyObj.direction, -0.7);
enemyObj.status = "move";
trace("Enemy attacks: " + enemyCP_dist);
enemyCP_dx = (sw / 2) - enemyObj.x;
enemyCP_dy = 0;
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
flyDist = 40 + (20 * Math_random());
enemyObj.nextCheckPointX = (enemyObj.x + (flyDist * enemyCP_ux)) + (5 * ((-0.5) + Math_random()));
enemyObj.nextCheckPointY = (enemyObj.y + (flyDist * enemyCP_uy)) + (25 * ((-0.5) + Math_random()));
playSound(enemyObj.type, enemyObj.target, "attack", 1);
}
}
enemyMC._x = enemyObj.x;
enemyMC._y = enemyObj.y;
}
break;
case "crawler" :
if (!enemyObj.noticedTarget) {
enemyObj.attackTarget = pL;
trace((((("x: " + enemyObj.noticeXmin) + " < ") + enemyObj.attackTarget.x) + " > ") + enemyObj.noticeXmax);
trace((((("y: " + enemyObj.noticeYmin) + " > ") + enemyObj.attackTarget.y) + " < ") + enemyObj.noticeYmax);
if ((enemyObj.attackTarget.x > enemyObj.noticeXmin) && (enemyObj.attackTarget.x < enemyObj.noticeXmax)) {
if ((enemyObj.attackTarget.y > enemyObj.noticeYmin) && (enemyObj.attackTarget.y < enemyObj.noticeYmax)) {
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
}
if (enemyObj.health < enemyObj.fullHealth) {
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
}
if (enemyObj.status == "move") {
if (enemyPL_dx < 0) {
enemyObj.vx = -enemyObj.v;
enemyObj.direction = -1;
} else {
enemyObj.vx = enemyObj.v;
enemyObj.direction = 1;
}
enemyObj.x = enemyObj.x + enemyObj.vx;
if (enemyObj.vx > 0) {
enemyMC._xscale = 100;
enemyMC.gotoAndStop("walk");
} else if (enemyObj.vx < 0) {
enemyMC._xscale = -100;
enemyMC.gotoAndStop("walk");
}
enemyReachedMoveLimit = false;
if (enemyObj.x < enemyObj.moveXmin) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmin;
} else if (enemyObj.x > enemyObj.moveXmax) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmax;
}
if (enemyObj.y < enemyObj.moveYmin) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveXmin;
} else if (enemyObj.y > enemyObj.moveYmax) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveYmax;
}
if (enemyReachedMoveLimit) {
enemyObj.status = "stand";
enemyMC.gotoAndStop("stand");
}
}
if (enemyObj.noticedTarget) {
if ((enemyObj.currAttackFr--) < 0) {
enemyObj.currAttackFr = 0;
}
if ((Abs(enemyPL_dx) < enemyObj.attackDist) && (enemyObj.currAttackFr < 0)) {
switch (enemyObj.typeNo) {
case 1 :
enemyPL_dx = pL.x - (enemyObj.x + (enemyObj.direction * enemyMC.head_MC._x));
enemyPL_dy = (pL.y - pL.h) - (enemyObj.y + enemyMC.head_MC._y);
enemyPL_dist = Math.sqrt((enemyPL_dx * enemyPL_dx) + (enemyPL_dy * enemyPL_dy));
enemyPL_ux = enemyPL_dx / enemyPL_dist;
enemyPL_uy = enemyPL_dy / enemyPL_dist;
enemyPL_angle = Math.acos(enemyPL_dx / enemyPL_dist) * (enemyPL_dy / Abs(enemyPL_dy));
enemyPL_angleDeg = (180 / Math.PI) * enemyPL_angle;
if (enemyObj.direction > 0) {
enemyMC.head_MC._rotation = enemyPL_angleDeg;
} else {
enemyMC.head_MC._rotation = (-180) - enemyPL_angleDeg;
}
enemyMC.head_MC._rotation = enemyMC.head_MC._rotation + 90;
temp_x = enemyObj.x + (enemyObj.direction * enemyMC.head_MC._x);
temp_y = enemyObj.y + enemyMC.head_MC._y;
createProjectile(enemyObj, "zombieSpit", temp_x, temp_y, enemyPL_ux, enemyPL_uy, 5);
playSound(enemyObj.type, enemyObj.target, "attack", 1);
break;
case 2 :
}
enemyObj.vx = 0;
enemyObj.currAttackFr = enemyObj.nextAttackFr;
enemyObj.status = "attack";
enemyMC.gotoAndStop("attack");
}
}
if (enemyObj.status == "attack") {
if (enemyObj.currAttackFr > 0) {
} else {
enemyObj.status = "move";
}
}
enemyMC._x = enemyObj.x;
break;
case "zombie" :
if (!enemyObj.noticedTarget) {
enemyObj.attackTarget = pL;
trace((((("x: " + enemyObj.noticeXmin) + " < ") + enemyObj.attackTarget.x) + " > ") + enemyObj.noticeXmax);
trace((((("y: " + enemyObj.noticeYmin) + " > ") + enemyObj.attackTarget.y) + " < ") + enemyObj.noticeYmax);
if ((enemyObj.attackTarget.x > enemyObj.noticeXmin) && (enemyObj.attackTarget.x < enemyObj.noticeXmax)) {
if ((enemyObj.attackTarget.y > enemyObj.noticeYmin) && (enemyObj.attackTarget.y < enemyObj.noticeYmax)) {
enemyObj.noticedTarget = true;
enemyObj.status = "walk";
}
}
if (enemyObj.health < enemyObj.fullHealth) {
enemyObj.noticedTarget = true;
enemyObj.status = "walk";
}
} else {
if (enemyObj.status != "attack") {
if (enemyPL_dx < 0) {
enemyObj.vx = -enemyObj.v;
enemyObj.direction = -1;
} else {
enemyObj.vx = enemyObj.v;
enemyObj.direction = 1;
}
enemyObj.x = enemyObj.x + enemyObj.vx;
if ((enemyObj.vx > 0) || (enemyObj.vx < 0)) {
enemyMC._xscale = enemyObj.direction * 100;
}
enemyReachedMoveLimit = false;
if (enemyObj.x < enemyObj.moveXmin) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmin;
} else if (enemyObj.x > enemyObj.moveXmax) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmax;
}
if (enemyObj.y < enemyObj.moveYmin) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveXmin;
} else if (enemyObj.y > enemyObj.moveYmax) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveYmax;
}
if (enemyReachedMoveLimit) {
enemyObj.status = "stand";
enemyMC.gotoAndStop("stand");
}
}
if ((enemyObj.currAttackFr--) < 0) {
enemyObj.currAttackFr = 0;
}
if ((Abs(enemyPL_dx) < enemyObj.attackDist) && (enemyObj.currAttackFr < 0)) {
switch (enemyObj.typeNo) {
case 1 :
break;
case 2 :
temp_x = enemyObj.x + (enemyObj.direction * (enemyMC.head_MC._width / 2));
temp_y = (enemyObj.y + enemyMC.head_MC._y) - (enemyMC.head_MC._height / 2);
createProjectile(enemyObj, "zombieSpit", temp_x, temp_y, 0.9 * enemyObj.direction, -0.15, 5);
}
enemyObj.vx = 0;
enemyObj.currAttackFr = enemyObj.nextAttackFr;
enemyObj.status = "attack";
enemyMC.gotoAndStop("attack");
playSound(enemyObj.type, enemyObj.target, "attack", 1);
}
if (enemyObj.status == "attack") {
if (enemyObj.currAttackFr > 0) {
if (enemyMC.arms_MC.arm_MC.attackPoint_MC.hitTest(game_MC.pL_MC.hitAreaMC)) {
temp_x = (enemyMC._x + enemyMC.arms_MC._x) + enemyMC.arms_MC.attackPoint_MC._x;
temp_y = (enemyMC._y + enemyMC.arms_MC._y) + enemyMC.arms_MC.attackPoint_MC._y;
objectGetsHurt(pL, enemyObj.attackDamage, temp_x, temp_y, 0.7 * enemyObj.direction, -0.7);
trace("-- enemyObj.attackDamage: " + enemyObj.attackDamage);
}
} else {
enemyObj.status = "walk";
}
}
enemyMC._x = enemyObj.x;
if (enemyObj.status != enemyObj.prevStatus) {
enemyMC.gotoAndStop(enemyObj.status);
multiPartNo = enemyObj.multiPartArr.length;
while ((multiPartNo--) > 0) {
partObj = enemyObj.multiPartArr[multiPartNo];
partMC = eval ((((enemyObj.target + ".") + partObj.name) + partObj.id) + "_MC");
currFrameNo = 1 + int(partMC._totalframes * (1 - (partObj.health / partObj.fullHealth)));
partMC.gotoAndStop(currFrameNo);
}
}
enemyObj.prevStatus = enemyObj.status;
}
break;
case "grass" :
if ((enemyObj.currAttackFr--) < 0) {
enemyObj.currAttackFr = 0;
}
if ((Abs(enemyPL_dx) < enemyObj.attackDist) && (enemyObj.currAttackFr < 0)) {
enemyObj.currAttackFr = enemyObj.nextAttackFr;
enemyObj.status = "attack";
enemyMC.gotoAndStop("attack");
}
if (enemyObj.status == "attack") {
if (enemyObj.currAttackFr > 0) {
if (enemyMC.attack_MC.hitTest(game_MC.pL_MC.hitAreaMC)) {
objectGetsHurt(pL, enemyObj.attackDamage, pL.x, enemyObj.y - enemyMC._height, enemyPL_ux, enemyPL_uy);
enemyObj.status = "stand";
playSound(enemyObj.type, enemyObj.target, "attack", 1);
}
}
}
break;
case "stickman" :
if (enemyObj.status == "move") {
if (enemyPL_dx < 0) {
enemyObj.vx = -enemyObj.v;
enemyObj.direction = -1;
} else {
enemyObj.vx = enemyObj.v;
enemyObj.direction = 1;
}
if ((enemyObj.vx > 0) || (enemyObj.vx < 0)) {
enemyMC._xscale = enemyObj.direction * 100;
enemyMC.gotoAndStop("run");
}
}
if ((enemyObj.currAttackFr--) < 0) {
enemyObj.currAttackFr = 0;
}
if ((Abs(enemyPL_dx) < enemyObj.attackDist) && (enemyObj.currAttackFr < 0)) {
switch (enemyObj.typeNo) {
case 1 :
break;
case 2 :
temp_x = enemyObj.x + (enemyObj.direction * (enemyMC.head_MC._width / 2));
temp_y = (enemyObj.y + enemyMC.head_MC._y) - (enemyMC.head_MC._height / 2);
createProjectile(enemyObj, "zombieSpit", temp_x, temp_y, 0.9 * enemyObj.direction, -0.15, 5);
}
enemyObj.vx = 0;
enemyObj.currAttackFr = enemyObj.nextAttackFr;
enemyObj.status = "attack";
enemyMC.gotoAndStop("attack");
}
if (enemyObj.status == "attack") {
if (enemyObj.currAttackFr > 0) {
if (enemyMC.arms_MC.attackPoint_MC.hitTest(game_MC.pL_MC.hitAreaMC)) {
temp_x = (enemyMC._x + arms_MC._x) + attackPoint_MC._x;
temp_y = (enemyMC._y + arms_MC._y) + attackPoint_MC._y;
objectGetsHurt(pL, enemyObj.attackDamage, temp_x, temp_y, 0.7 * enemyObj.direction, -0.7);
}
} else {
enemyObj.status = "move";
}
}
enemyMC._x = (enemyObj.x = enemyObj.x + enemyObj.vx);
break;
case "walker" :
if (enemyPL_dx < 0) {
enemyObj.weaponAngle = enemyObj.weaponAngle - enemyObj.gunRotSpeed;
} else {
enemyObj.weaponAngle = enemyObj.weaponAngle + enemyObj.gunRotSpeed;
}
if ((enemyObj.weaponAngle < -180) || (enemyObj.weaponAngle > 90)) {
enemyObj.weaponAngle = -180;
} else if (enemyObj.weaponAngle > 0) {
enemyObj.weaponAngle = 0;
}
if (enemyPL_dx < 0) {
enemyMC.gotoAndStop("walk");
enemyObj.vx = -enemyObj.v;
} else {
enemyMC.gotoAndStop("walk");
enemyObj.vx = enemyObj.v;
}
damage = 1;
enemyMC._x = (enemyObj.x = enemyObj.x + enemyObj.vx);
enemyMC.wheel_MC._rotation = enemyMC.wheel_MC._rotation + (4 * enemyObj.vx);
enemyMC.weapon_MC._rotation = enemyObj.weaponAngle;
break;
case "flying" :
if (enemyObj.pathName == "pL_follow") {
if (game_MC.pL_MC.hitAreaMC.hitTest(enemyMC)) {
enemyMC.gotoAndPlay("dies");
enemyArr.splice(enemyNo, 1);
}
enemyCP_dx = pL.x - enemyObj.x;
enemyCP_dy = (pL.y - (pL.h / 2)) - enemyObj.y;
} else {
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
if (Abs(enemyCP_dx) < reachedCheckPointDist) {
if (Abs(enemyCP_dy) < reachedCheckPointDist) {
nextCP(enemyObj);
}
}
}
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
thrust_x = enemyCP_ux * enemyObj.v;
thrust_y = enemyCP_uy * enemyObj.v;
enemyObj.vx = thrust_x;
enemyObj.vy = thrust_y;
if (enemyObj.weaponAngle > 180) {
enemyObj.weaponAngle = enemyObj.weaponAngle - 360;
} else if (enemyObj.weaponAngle < -180) {
enemyObj.weaponAngle = enemyObj.weaponAngle + 360;
}
enemyObj.weaponAngle = enemyObj.weaponAngle + (getAngle2toAngle1direction(enemyPL_angleDeg, enemyObj.weaponAngle) * enemyObj.gunRotSpeed);
if (enemyObj.nextAttackIntervalFr > 0) {
if ((--enemyObj.nextAttackFr) <= 0) {
enemyObj.nextAttackFr = enemyObj.nextAttackIntervalFr;
weaponAngleRad = (enemyObj.weaponAngle / 180) * Math.PI;
enemyObj.weapon_ux = Math.cos(weaponAngleRad);
enemyObj.weapon_uy = Math.sin(weaponAngleRad);
checkIfLineOfFireHitAnything(enemyObj, true, false, true);
}
}
enemyMC._x = (enemyObj.x = enemyObj.x + enemyObj.vx);
enemyMC._y = (enemyObj.y = enemyObj.y + enemyObj.vy);
enemyMC.weapon_MC._rotation = enemyObj.weaponAngle;
break;
case "GiantSpider" :
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
if (Abs(enemyCP_dx) < enemyObj.reachedCheckPointDist) {
if (Abs(enemyCP_dy) < enemyObj.reachedCheckPointDist) {
nextCP(enemyObj);
if (enemyObj.vx > 0) {
enemyObj.nextAttackFr = 0.3 * FPS;
} else {
enemyObj.nextAttackFr = 1 * FPS;
}
enemyObj.currAttackFr = enemyObj.nextAttackFr;
}
}
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
enemyObj.vx = enemyCP_ux * enemyObj.v;
enemyObj.vy = enemyCP_uy * enemyObj.v;
if ((enemyObj.currAttackFr--) < 0) {
enemyObj.currAttackFr = 0;
}
if (enemyObj.currAttackFr < 0) {
enemyObj.status = "attack";
enemyObj.currAttackFr = enemyObj.nextAttackFr;
temp_x = enemyObj.x;
temp_y = enemyObj.y;
if (enemyObj.vx > 0) {
createProjectile(enemyObj, "GiantSpiderSpit", temp_x, temp_y, enemyPL_ux, enemyPL_uy, 5);
} else {
enemyObj.projectileNo++;
if (enemyObj.projectileNo > 5) {
enemyObj.projectileNo = 1;
}
trace("enemyObj.currAttackFr: " + enemyObj.currAttackFr);
temp_dx = (25 + (enemyObj.projectileNo * ((sw - (2 * 25)) / 5))) - enemyObj.x;
temp_dy = 250 - enemyObj.y;
temp_dist = Math.sqrt((temp_dx * temp_dx) + (temp_dy * temp_dy));
temp_ux = temp_dx / temp_dist;
temp_uy = temp_dy / temp_dist;
createProjectile(enemyObj, "GiantSpiderSpit", temp_x, temp_y, temp_ux, temp_uy, 5);
}
}
if ((enemyObj.currCrawlerSpawnFr--) < 0) {
enemyObj.currCrawlerSpawnFr = enemyObj.nextCrawlerSpawnFr;
tempEnemyArr.push(new Crawler(0 * FPS, 1, roomBufferRight - 10, 250, 10, 30 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
moreEnemyToCome = true;
}
enemyMC._x = (enemyObj.x = enemyObj.x + enemyObj.vx);
enemyMC._y = (enemyObj.y = enemyObj.y + enemyObj.vy);
break;
case "GiantWasp" :
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
if (Abs(enemyCP_dx) < enemyObj.reachedCheckPointDist) {
if (Abs(enemyCP_dy) < enemyObj.reachedCheckPointDist) {
nextCP(enemyObj);
if (enemyObj.vx > 0) {
enemyObj.nextAttackFr = 0.3 * FPS;
} else {
enemyObj.nextAttackFr = 1 * FPS;
}
enemyObj.currAttackFr = enemyObj.nextAttackFr;
}
}
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
enemyObj.vx = enemyCP_ux * enemyObj.v;
enemyObj.vy = enemyCP_uy * enemyObj.v;
if (enemyObj.vx < 0) {
enemyObj.direction = -1;
} else {
enemyObj.direction = 1;
}
enemyMC._xscale = enemyObj.direction * 100;
if ((enemyObj.currAttackFr--) < 0) {
enemyObj.currAttackFr = 0;
}
if (enemyObj.currAttackFr < 0) {
enemyObj.status = "attack";
enemyObj.currAttackFr = enemyObj.nextAttackFr;
temp_x = enemyObj.x;
temp_y = enemyObj.y;
if (enemyObj.vx > 0) {
createProjectile(enemyObj, "GiantWaspSpit", temp_x, temp_y, enemyPL_ux, enemyPL_uy, 5);
} else {
enemyObj.projectileNo++;
if (enemyObj.projectileNo > 5) {
enemyObj.projectileNo = 1;
}
trace("enemyObj.currAttackFr: " + enemyObj.currAttackFr);
temp_dx = (25 + (enemyObj.projectileNo * ((sw - (2 * 25)) / 5))) - enemyObj.x;
temp_dy = 250 - enemyObj.y;
temp_dist = Math.sqrt((temp_dx * temp_dx) + (temp_dy * temp_dy));
temp_ux = temp_dx / temp_dist;
temp_uy = temp_dy / temp_dist;
createProjectile(enemyObj, "GiantWaspSpit", temp_x, temp_y, temp_ux, temp_uy, 5);
}
}
if ((enemyObj.currCrawlerSpawnFr--) < 0) {
enemyObj.currCrawlerSpawnFr = enemyObj.nextCrawlerSpawnFr;
tempEnemyArr.push(new Wasp(0, 1, enemyObj.x, enemyObj.y, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
moreEnemyToCome = true;
}
enemyMC._x = (enemyObj.x = enemyObj.x + enemyObj.vx);
enemyMC._y = (enemyObj.y = enemyObj.y + enemyObj.vy);
break;
case "Demon" :
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
if (Abs(enemyCP_dx) < enemyObj.reachedCheckPointDist) {
if (Abs(enemyCP_dy) < enemyObj.reachedCheckPointDist) {
nextCP(enemyObj);
if (enemyObj.vx > 0) {
enemyObj.nextAttackFr = 0.3 * FPS;
} else {
enemyObj.nextAttackFr = 1 * FPS;
}
enemyObj.currAttackFr = enemyObj.nextAttackFr;
}
}
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
enemyObj.vx = enemyCP_ux * enemyObj.v;
enemyObj.vy = enemyCP_uy * enemyObj.v;
if ((enemyObj.currAttackFr--) < 0) {
enemyObj.currAttackFr = 0;
}
if (enemyObj.currAttackFr < 0) {
enemyObj.status = "attack";
enemyObj.currAttackFr = enemyObj.nextAttackFr;
temp_x = enemyObj.x;
temp_y = enemyObj.y;
if (enemyObj.vx > 0) {
createProjectile(enemyObj, "DemonSpit", temp_x, temp_y, enemyPL_ux, enemyPL_uy, 5);
} else {
enemyObj.projectileNo++;
if (enemyObj.projectileNo > 5) {
enemyObj.projectileNo = 1;
}
trace("enemyObj.currAttackFr: " + enemyObj.currAttackFr);
temp_dx = (25 + (enemyObj.projectileNo * ((sw - (2 * 25)) / 5))) - enemyObj.x;
temp_dy = 250 - enemyObj.y;
temp_dist = Math.sqrt((temp_dx * temp_dx) + (temp_dy * temp_dy));
temp_ux = temp_dx / temp_dist;
temp_uy = temp_dy / temp_dist;
createProjectile(enemyObj, "DemonSpit", temp_x, temp_y, temp_ux, temp_uy, 5);
}
}
if ((enemyObj.currCrawlerSpawnFr--) < 0) {
enemyObj.currCrawlerSpawnFr = enemyObj.nextCrawlerSpawnFr;
tempNo = Math_random();
if (tempNo < 0.33) {
tempEnemyArr.push(new Crawler(0 * FPS, 1, roomBufferRight - 10, 260, 10, 30 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
} else if (tempNo < 0.66) {
tempEnemyArr.push(new Crawler(0 * FPS, 1, roomBufferLeft + 10, 260, 10, 30 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
} else {
tempEnemyArr.push(new Wasp(0, 1, enemyObj.x, enemyObj.y, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
}
moreEnemyToCome = true;
}
enemyMC._x = (enemyObj.x = enemyObj.x + enemyObj.vx);
enemyMC._y = (enemyObj.y = enemyObj.y + enemyObj.vy);
break;
}
}
if ((enemyStatusDisplayFr--) == 0) {
statusWindowMC.EnemyStatusMC.gotoAndStop("none");
statusWindowMC.EnemyStatusMC.heathMC.barMC._xscale = 100;
statusWindowMC.EnemyStatusMC._visible = false;
} else if (enemyStatusDisplayFr < 0) {
enemyStatusDisplayFr = -2;
}
if (explosionParticleArr.length > 0) {
explosionParticleNo = explosionParticleArr.length;
while ((explosionParticleNo--) > 0) {
explosionParticleObj = explosionParticleArr[explosionParticleNo];
explosionParticleMC = eval (explosionParticleObj.targetMC);
if (explosionParticleObj.smokeTrail) {
explosionParticleObj.vy = explosionParticleObj.vy + (grav / 20);
explosionParticleObj.vx = explosionParticleObj.vx * 0.95;
explosionParticleObj.vy = explosionParticleObj.vy * 0.95;
} else {
explosionParticleObj.vy = explosionParticleObj.vy + (grav / 3);
explosionParticleObj.vx = explosionParticleObj.vx * 0.98;
explosionParticleObj.vy = explosionParticleObj.vy * 0.98;
}
explosionParticleObj.x = explosionParticleObj.x + explosionParticleObj.vx;
explosionParticleObj.y = explosionParticleObj.y + explosionParticleObj.vy;
explosionParticleMC._x = explosionParticleObj.x;
explosionParticleMC._y = explosionParticleObj.y;
explosionParticleMC._rotation = explosionParticleMC._rotation + (4 * explosionParticleObj.vx);
explosionParticleMC._xscale = (explosionParticleMC._yscale = explosionParticleMC._yscale - explosionParticleObj.sizeChangePerFr);
explosionParticleExplode = false;
explosionParticleCollision = false;
platfromNo = platformArr.length;
while ((platfromNo--) > 0) {
P = platformArr[platfromNo];
if (explosionParticleMC.hitTest(P.target)) {
explosionParticleExplode = true;
}
}
bufferDist = 30;
if (explosionParticleObj.y < (roomBufferTop - bufferDist)) {
explosionParticleCollision = "removeOnly";
collisionDirection = "y";
explosionParticleMC._y = roomBufferTop;
} else if (explosionParticleObj.y > (roomBufferBottom + bufferDist)) {
explosionParticleCollision = "removeOnly";
collisionDirection = "y";
explosionParticleMC._y = roomBufferBottom;
}
if (explosionParticleObj.x < (roomBufferLeft - bufferDist)) {
explosionParticleCollision = "removeOnly";
collisionDirection = "x";
explosionParticleMC._x = roomBufferLeft;
} else if (explosionParticleObj.x > (roomBufferRight + bufferDist)) {
explosionParticleCollision = "removeOnly";
collisionDirection = "x";
explosionParticleMC._x = roomBufferRight;
}
if (explosionParticleCollision == true) {
explosionParticleObj.rotSpeed = explosionParticleObj.rotSpeed * (-0.8 * (0.5 - Math_random()));
if ((explosionParticleObj.debryType == "bloodsplatterRed1") || (explosionParticleObj.debryType == "bloodsplatterGreen1")) {
explosionParticleExplode = true;
}
if (collisionDirection == "x") {
explosionParticleObj.vx = explosionParticleObj.vx * -1;
} else if (collisionDirection == "y") {
explosionParticleObj.vy = explosionParticleObj.vy * -0.7;
if ((explosionParticleObj.bounceNo++) > 3) {
explosionParticleExplode = true;
}
}
} else if (explosionParticleCollision == "removeOnly") {
explosionParticleArr.splice(explosionParticleNo, 1);
explosionParticleMC.removeMovieClip();
}
if (explosionParticleObj.smokeTrail) {
smokeColor = "white";
game_MC.smokeTrailAttachMC.attachMovie(smokeColor + "Smoke", (((smokeColor + "Smoke") + "_") + noOfSmokeTrailCreated) + "_MC", noOfSmokeTrailCreated);
targetMC = eval ((((("game_MC.smokeTrailAttachMC." + smokeColor) + "Smoke") + "_") + noOfSmokeTrailCreated) + "_MC");
targetMC._x = explosionParticleObj.x;
targetMC._y = explosionParticleObj.y;
targetMC._rotation = targetMC._rotation + (3 * explosionParticleObj.vx);
trace("explosionParticleObj.vx: " + explosionParticleObj.vx);
targetMC._xscale = (targetMC._yscale = explosionParticleMC._xscale);
}
switch (explosionParticleObj.debryType) {
case "zombie_head" :
case "zombie_body" :
case "zombie_arm" :
case "zombie_leg" :
case "crawler_head" :
case "crawler_leg" :
case "bat_wing" :
case "bat_head" :
case "wasp_head" :
case "wasp_body" :
case "GiantSpider_head" :
case "GiantSpider_abdomen" :
case "GiantSpider_eye" :
case "GiantSpider_leg" :
case "GiantWasp_head" :
case "GiantWasp_abdomen" :
case "GiantWasp_tail" :
case "Demon_head" :
case "Demon_body" :
case "Demon_arm" :
if (Math_random() > 0.5) {
createExplosionParticle("bloodsplatterGreen1", explosionParticleObj.x, explosionParticleObj.y, 4 * (0.5 + (0.5 * Math.random())), (-180) * Math_random(), 15 + (15 * Math.random()), 20, 5, false);
}
break;
case "demon" :
}
if ((explosionParticleObj.durationFr--) <= 0) {
explosionParticleExplode = true;
}
if (explosionParticleExplode) {
explosionParticleMC.gotoAndPlay("explode");
explosionParticleArr.splice(explosionParticleNo, 1);
switch (explosionParticleObj.debryType) {
case "zombie_head" :
case "zombie_body" :
case "zombie_arm" :
case "zombie_leg" :
case "crawler_head" :
case "crawler_leg" :
case "bat_wing" :
case "bat_head" :
case "wasp_head" :
case "wasp_body" :
case "GiantSpider_head" :
case "GiantSpider_abdomen" :
case "GiantSpider_eye" :
case "GiantSpider_leg" :
case "GiantWasp_head" :
case "GiantWasp_abdomen" :
case "GiantWasp_tail" :
case "Demon_head" :
case "Demon_body" :
case "Demon_arm" :
trace("explosionParticleMC: " + explosionParticleMC);
fadeAwayArr.push({targetMC:explosionParticleMC, alpha:100});
break;
case "demon" :
}
if ((noOfSmokeTrailCreated++) > 500) {
noOfSmokeTrailCreated = 0;
}
}
}
}
arrNo = fadeAwayArr.length;
while ((arrNo--) > 0) {
fadeAwayObj = fadeAwayArr[arrNo];
eval (fadeAwayObj.targetMC)._alpha = (fadeAwayObj.alpha = fadeAwayObj.alpha - 4);
if (fadeAwayObj.alpha <= 0) {
eval (fadeAwayObj.targetMC).removeMovieClip();
fadeAwayArr.splice(arrNo, 1);
}
}
currentTime = int((getTimer() - startTime) / 1000);
updateTimer(currentTime);
if (levelCompleteCounter > 0) {
levelCompleteCounter--;
trace("almost level complete " + levelCompleteCounter);
if (levelCompleteCounter == 0) {
game_over(g.missionFinishedReason);
}
} else if (g_missionType == "destroyEnemies") {
if ((enemyArr.length <= 0) && (tempEnemyArr.length <= 0)) {
if (explosionParticleArr.length <= 0) {
startLevelCompleteCountdown("missionComplete");
}
}
} else if (g_missionType == "timeTrial") {
if (currentTime < 0) {
startLevelCompleteCountdown("missionComplete");
}
}
}
function startLevelCompleteCountdown(reason) {
statusWindowMC.missionMessageMC._visible = true;
statusWindowMC.missionMessageMC.gotoAndStop(reason);
g.missionFinishedReason = reason;
trace("g.missionFinishedReason " + g.missionFinishedReason);
if (!(reason === "missionComplete")) {
}
levelCompleteCounter = 2 * FPS;
missionMessageMC._visible = true;
level_finish_time = getTimer();
}
onKeyDown_game = function () {
currKey = Key.getCode();
if (testing_only) {
if (currKey == 17) {
pL.x = _xmouse;
pL.y = _ymouse;
}
}
if (currKey == keyQualityToggle) {
if (_quality == "HIGH") {
_quality = "LOW";
} else if (_quality == "LOW") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "HIGH";
}
mcQualityStatus.gotoAndPlay(2);
mcQualityStatus.txtQuality = (game_quality = _quality);
}
if (g_stat == "play") {
if (Key.isDown(key_pLNextWeapon)) {
pL_changeWeapon(1);
} else if (Key.isDown(key_pLPrevWeapon)) {
pL_changeWeapon(-1);
} else if (Key.isDown(key_pLUse)) {
trace("PRESSED: USE KEY");
i = 0;
while (i < doorArr.length) {
doorObj = doorArr[i];
if (doorObj.roomNo == g_roomNo) {
doorID = "door_" + doorObj.type;
doorBgndID = doorID + "_bgnd";
if ((Abs(pL.x - doorObj.x) < 15) && (Abs(doorObj.y - pL.y) < 5)) {
pL.currDoor = doorObj;
pL.currDoor.target = doorObj.target;
pL.currDoor.usage = "enter";
pL.x = doorObj.x;
pL.y = doorObj.y;
pL.currDoor.target.gotoAndPlay("open");
}
}
i++;
}
} else if (currKey == keyMusicOnOff) {
trace("playGameMusic: " + playGameMusic);
if (!playGameMusic) {
musicSndNo = 1;
musicSnd = new Sound();
musicSnd.attachSound("music" + musicSndNo);
musicSnd.start(0, 1000);
playGameMusic = true;
} else {
musicSnd.stop("music" + musicSndNo);
playGameMusic = false;
}
} else if (currKey == keyPauseGame) {
tempOnEnterFrame = onEnterFrame;
tempOnMouseDown = onMouseDown;
tempOnMouseUp = onMouseUp;
g_stat = "paused";
Mouse.show();
menuWindowMC.gotoAndStop("pause");
pause_start_time = getTimer();
delete onEnterFrame;
delete onMouseDown;
delete onMouseUp;
}
} else if (g_stat == "paused") {
if (currKey == keyPauseGame) {
onEnterFrame = tempOnEnterFrame;
onMouseDown = tempOnMouseDown;
onMouseUp = tempOnMouseUp;
g_stat = "play";
menuWindowMC.gotoAndStop("game_start");
startTime = startTime + (getTimer() - pause_start_time);
Mouse.hide();
}
}
};
onMouseDown_game = function () {
Mouse.hide();
trace("pL_weapon_dist: " + pL_weapon_dist);
pL_mouseDown = true;
pL_weaponFireSnd = new Sound();
if ((pL_weaponsArr[pL.currWeaponNo].ammo > 0) || (pL_weaponsArr[pL.currWeaponNo].ammo == "inf")) {
pL_weaponFireSnd.attachSound(pL.weaponType + "_fire");
}
switch (pL.weaponType) {
case "pistol" :
return;
case "blasterGun" :
return;
case "uzi" :
case "machineGun" :
case "miniGun" :
pL_weaponFireSnd.start(0, 1000);
return;
case "laser" :
return;
case "rocketLauncher" :
return;
case "grenade" :
case "flameThrower" :
return;
}
};
onMouseUp_game = function () {
pL_mouseDown = false;
if (pL.weaponType == "grenade") {
if (pL.grenadeThrowVelocity > 0) {
nozzleX = game_MC.pL_MC.weapon_MC.nozzle_MC._x;
nozzleY = (game_MC.pL_MC.weapon_MC.nozzle_MC._y * game_MC.pL_MC.weapon_MC._xscale) / 100;
temp_x = (pL.x + (pL.weapon_ux * nozzleX)) - (pL.weapon_uy * nozzleY);
temp_y = ((pL.y - pL.weaponRotationY) + (pL.weapon_ux * nozzleY)) + (pL.weapon_uy * nozzleX);
createProjectile(pL, pL.weaponType, temp_x, temp_y, pL.weapon_ux, pL.weapon_uy, pL.attackDamage);
pL_weaponsArr[pL.currWeaponNo].currReloadFr = pL_weaponsArr[pL.currWeaponNo].reloadFr;
statusWindowMC.txtAmmo = --pL_weaponsArr[pL.currWeaponNo].ammo;
statusWindowMC.txtGrenadeThrow = (pL.grenadeThrowVelocity = 0);
}
}
switch (pL.weaponType) {
case "pistol" :
return;
case "blasterGun" :
return;
case "uzi" :
case "machineGun" :
case "miniGun" :
pL_weaponSoundStop();
return;
}
};
Frame 232
stop();
Symbol 29 MovieClip [platform_black] Frame 1
trace("1 - created platform " + platformType);
Symbol 31 MovieClip [platform_generic] Frame 1
trace("1 - created platform " + platformType);
Symbol 35 Button
on (release) {
_root.g_missionNo = buttonNo;
_root.showCutScenes();
}
Symbol 39 MovieClip [missionButton] Frame 1
stop();
Symbol 47 MovieClip Frame 1
stop();
Symbol 50 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 1
stop();
Symbol 54 MovieClip [crawler_head] Frame 1
stop();
Symbol 55 MovieClip [crawler1] Frame 1
stop();
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 55 MovieClip [crawler1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 55 MovieClip [crawler1] Frame 5
this.removeMovieClip();
stop();
Symbol 58 MovieClip Frame 1
stop();
Symbol 63 MovieClip Frame 1
stop();
Symbol 66 MovieClip Frame 1
_visible = false;
Symbol 70 MovieClip Frame 2
stop();
Symbol 80 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 91 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 3
gotoAndStop (1);
Symbol 100 MovieClip Frame 5
gotoAndStop (1);
Symbol 100 MovieClip Frame 7
gotoAndStop (1);
Symbol 100 MovieClip Frame 9
gotoAndStop (1);
Symbol 100 MovieClip Frame 11
gotoAndStop (1);
Symbol 100 MovieClip Frame 13
gotoAndStop (1);
Symbol 100 MovieClip Frame 16
gotoAndStop (1);
Symbol 100 MovieClip Frame 18
gotoAndStop (1);
Symbol 100 MovieClip Frame 20
gotoAndStop (1);
Symbol 113 MovieClip Frame 1
stop();
Symbol 114 MovieClip Frame 1
stop();
Symbol 115 MovieClip [zombie2] Frame 1
stop();
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 115 MovieClip [zombie2] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 115 MovieClip [zombie2] Frame 7
this.removeMovieClip();
stop();
Symbol 116 MovieClip Frame 1
stop();
Symbol 118 MovieClip [zombie1] Frame 1
stop();
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 118 MovieClip [zombie1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 118 MovieClip [zombie1] Frame 8
this.removeMovieClip();
stop();
Symbol 127 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 9
stop();
Symbol 156 MovieClip [stickman] Frame 1
stop();
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 156 MovieClip [stickman] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 157 MovieClip [zombie_head] Frame 1
stop();
Symbol 158 MovieClip [crawler_leg] Frame 1
stop();
Symbol 160 MovieClip [zombie_leg] Frame 1
stop();
Symbol 161 MovieClip [zombie_arm] Frame 1
stop();
Symbol 163 MovieClip [zombie_body] Frame 1
stop();
Symbol 168 MovieClip [flameThrower] Frame 14
this._rotation = int(360 * Math.random());
Symbol 168 MovieClip [flameThrower] Frame 23
this.removeMovieClip();
Symbol 171 MovieClip Frame 1
_rotation = (360 * Math.random());
Symbol 171 MovieClip Frame 10
stop();
Symbol 172 MovieClip [rocketLauncher] Frame 1
stop();
Symbol 172 MovieClip [rocketLauncher] Frame 11
this.removeMovieClip();
Symbol 174 MovieClip [DemonSpit] Frame 1
stop();
Symbol 174 MovieClip [DemonSpit] Frame 5
this.removeMovieClip();
Symbol 176 MovieClip [GiantWaspSpit] Frame 1
stop();
Symbol 176 MovieClip [GiantWaspSpit] Frame 5
this.removeMovieClip();
Symbol 178 MovieClip [GiantSpiderSpit] Frame 1
stop();
Symbol 178 MovieClip [GiantSpiderSpit] Frame 5
this.removeMovieClip();
Symbol 180 MovieClip [zombieSpit] Frame 1
stop();
Symbol 180 MovieClip [zombieSpit] Frame 5
this.removeMovieClip();
Symbol 181 MovieClip [grenade] Frame 1
stop();
Symbol 181 MovieClip [grenade] Frame 7
this.removeMovieClip();
Symbol 184 MovieClip [wasp_body] Frame 1
stop();
Symbol 188 MovieClip [wasp_head] Frame 1
stop();
Symbol 190 MovieClip [wasp1] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 190 MovieClip [wasp1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 190 MovieClip [wasp1] Frame 3
this.removeMovieClip();
Symbol 194 MovieClip [Demon_head] Frame 1
stop();
Symbol 195 MovieClip [Demon_body] Frame 1
stop();
Symbol 203 MovieClip [Demon1] Frame 1
stop();
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 203 MovieClip [Demon1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 203 MovieClip [Demon1] Frame 3
this.removeMovieClip();
Symbol 207 MovieClip [GiantSpider_abdomen] Frame 1
stop();
Symbol 212 MovieClip Frame 1
stop();
Symbol 214 MovieClip [GiantSpider_eye] Frame 1
stop();
Symbol 219 MovieClip [GiantSpider1] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 219 MovieClip [GiantSpider1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 210 MovieClip in Symbol 219 MovieClip [GiantSpider1] Frame 1
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 210 MovieClip in Symbol 219 MovieClip [GiantSpider1] Frame 1
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 210 MovieClip in Symbol 219 MovieClip [GiantSpider1] Frame 1
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 216 MovieClip [GiantSpider_leg] "leg7" in Symbol 219 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 216 MovieClip [GiantSpider_leg] "leg8" in Symbol 219 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 216 MovieClip [GiantSpider_leg] "leg9" in Symbol 219 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 216 MovieClip [GiantSpider_leg] "leg1" in Symbol 219 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 216 MovieClip [GiantSpider_leg] "leg2" in Symbol 219 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 216 MovieClip [GiantSpider_leg] "leg3" in Symbol 219 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Symbol 219 MovieClip [GiantSpider1] Frame 3
this.removeMovieClip();
Symbol 224 MovieClip Frame 9
_parent.gotoAndStop("stand");
Symbol 232 MovieClip [bat_wing] Frame 1
trace("ATTACHED WING");
stop();
Symbol 236 MovieClip [bat_head] Frame 1
stop();
Symbol 237 MovieClip [grass1] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Symbol 237 MovieClip [grass1] Frame 4
this.removeMovieClip();
Symbol 238 MovieClip [bat1] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 238 MovieClip [bat1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 238 MovieClip [bat1] Frame 3
this.removeMovieClip();
Symbol 241 MovieClip [bloodsplatter0] Frame 1
Symbol 241 MovieClip [bloodsplatter0] Frame 6
this.removeMovieCLip();
Symbol 245 MovieClip [ricochet2] Frame 4
this.removeMovieCLip();
Symbol 248 MovieClip [ricochet1] Frame 4
this.removeMovieCLip();
Symbol 251 MovieClip [explosion1] Frame 5
this.removeMovieCLip();
Symbol 259 MovieClip [debry1] Frame 1
this.gotoAndStop(1 + int(3 * Math.random()));
stop();
Symbol 259 MovieClip [debry1] Frame 10
this.removeMovieClip();
Symbol 262 MovieClip [bloodsplatterGreen1] Frame 1
stop();
Symbol 262 MovieClip [bloodsplatterGreen1] Frame 4
this.removeMovieClip();
Symbol 264 MovieClip [bloodsplatterRed1] Frame 1
stop();
Symbol 264 MovieClip [bloodsplatterRed1] Frame 13
this.removeMovieClip();
Symbol 267 MovieClip [whiteSmoke] Frame 8
this.removeMovieClip();
Symbol 281 MovieClip [door_doublesliding] Frame 1
stop();
Symbol 281 MovieClip [door_doublesliding] Frame 2
play();
Symbol 281 MovieClip [door_doublesliding] Frame 14
_root.doorIsOpen();
stop();
Symbol 281 MovieClip [door_doublesliding] Frame 15
play();
Symbol 281 MovieClip [door_doublesliding] Frame 23
_root.doorIsClosed();
Symbol 287 MovieClip [door_finishedMission] Frame 1
stop();
Symbol 287 MovieClip [door_finishedMission] Frame 2
play();
Symbol 287 MovieClip [door_finishedMission] Frame 12
_root.doorIsOpen();
stop();
Symbol 287 MovieClip [door_finishedMission] Frame 13
play();
Symbol 287 MovieClip [door_finishedMission] Frame 21
_root.doorIsClosed();
Symbol 289 MovieClip [door_noDoor] Frame 1
stop();
Symbol 289 MovieClip [door_noDoor] Frame 2
play();
Symbol 289 MovieClip [door_noDoor] Frame 4
_root.doorIsOpen();
stop();
Symbol 289 MovieClip [door_noDoor] Frame 5
play();
Symbol 289 MovieClip [door_noDoor] Frame 6
_root.doorIsClosed();
Symbol 294 MovieClip [door_knob] Frame 1
stop();
Symbol 294 MovieClip [door_knob] Frame 2
play();
Symbol 294 MovieClip [door_knob] Frame 12
_root.doorIsOpen();
stop();
Symbol 294 MovieClip [door_knob] Frame 13
play();
Symbol 294 MovieClip [door_knob] Frame 21
_root.doorIsClosed();
Symbol 296 MovieClip [door_doublesliding_bgnd] Frame 1
stop();
Symbol 298 MovieClip [door_finishMission_bgnd] Frame 1
stop();
Symbol 299 MovieClip [door_knob_bgnd] Frame 1
stop();
Symbol 310 Button [missionButton]
on (release) {
_root.levelNo = idNo;
_root.g.practiceMode = true;
trace((_parent.idNo + " : ") + idNo);
_root.levelInit();
_parent.gotoAndStop("game_start");
_parent.removePracticeLevelButtons();
}
Symbol 330 MovieClip Frame 1
stop();
Symbol 335 MovieClip [GiantWasp_abdomen] Frame 1
stop();
Symbol 337 MovieClip [GiantWasp_head] Frame 1
stop();
Symbol 340 MovieClip [GiantWasp_tail] Frame 1
stop();
Symbol 343 MovieClip [GiantWasp1] Frame 1
stop();
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 343 MovieClip [GiantWasp1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 343 MovieClip [GiantWasp1] Frame 3
this.removeMovieClip();
Symbol 348 MovieClip Frame 1
stop();
Symbol 350 MovieClip Frame 1
stop();
Symbol 355 MovieClip [walker1] Frame 1
stop();
Symbol 355 MovieClip [walker1] Frame 14
this.removeMovieClip();
Symbol 370 MovieClip Frame 9
stop();
Symbol 371 MovieClip [flying3] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Symbol 371 MovieClip [flying3] Frame 15
this.removeMovieClip();
Symbol 373 MovieClip Frame 1
stop();
Symbol 379 MovieClip [flying2] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Symbol 379 MovieClip [flying2] Frame 15
this.removeMovieClip();
Symbol 383 MovieClip [flying1] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Symbol 383 MovieClip [flying1] Frame 15
this.removeMovieClip();
Symbol 389 MovieClip [turret1] Frame 1
stop();
Symbol 389 MovieClip [turret1] Frame 13
this.removeMovieClip();
Symbol 395 MovieClip [stationary3] Frame 1
stop();
Symbol 395 MovieClip [stationary3] Frame 11
this.removeMovieClip();
Symbol 401 MovieClip [stationary2] Frame 1
stop();
Symbol 401 MovieClip [stationary2] Frame 15
this.removeMovieClip();
Symbol 404 MovieClip [stationary1] Frame 1
stop();
Symbol 404 MovieClip [stationary1] Frame 15
this.removeMovieClip();
Symbol 416 Button
on (release) {
_root.play();
}
Symbol 417 MovieClip Frame 1
stop();
Symbol 417 MovieClip Frame 2
Symbol 431 Button
on (release) {
getURL ("http://www.crazymonkeygames.com", "_blank");
}
Symbol 433 Button
on (release) {
getURL ("http://www.crazymonkeygames.com", "_blank");
}
Symbol 443 MovieClip Frame 131
stop();
Symbol 490 MovieClip Frame 1
stop();
Symbol 495 MovieClip Frame 1
Symbol 497 Button
on (release) {
_root.pL.currDoor.connDoor = 1;
_root.move_pLtoSelectedDoor();
}
Symbol 498 Button
on (release) {
_root.pL.currDoor.connDoor = 2;
_root.move_pLtoSelectedDoor();
}
Symbol 503 Button
on (release) {
_root.pL.currDoor.connDoor = 3;
_root.move_pLtoSelectedDoor();
}
Symbol 505 Button
on (release) {
_root.pL.currDoor.connDoor = 4;
_root.move_pLtoSelectedDoor();
}
Symbol 507 Button
on (release) {
_root.pL.currDoor.connDoor = 5;
_root.move_pLtoSelectedDoor();
}
Symbol 509 Button
on (release) {
_root.pL.currDoor.connDoor = 6;
_root.move_pLtoSelectedDoor();
}
Symbol 511 Button
on (release) {
_root.pL.currDoor.connDoor = 7;
_root.move_pLtoSelectedDoor();
}
Symbol 513 Button
on (release) {
_root.pL.currDoor.connDoor = 8;
_root.move_pLtoSelectedDoor();
}
Symbol 515 Button
on (release) {
_root.pL.currDoor.connDoor = txtButtonNo;
_root.move_pLtoSelectedDoor();
}
Symbol 517 MovieClip Frame 3
stop();
Symbol 518 MovieClip Frame 1
stop();
Symbol 527 MovieClip Frame 1
stop();
Symbol 537 MovieClip Frame 1
stop();
Symbol 549 MovieClip Frame 1
stop();
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 549 MovieClip Frame 11
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 549 MovieClip Frame 12
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 41 MovieClip "hitAreaMC" in Symbol 549 MovieClip Frame 13
onClipEvent (load) {
this._visible = false;
}
Symbol 553 Button
on (release) {
g_levelNo = txt_levelNo;
game_over("missionComplete");
}
Symbol 555 Button
on (release) {
g_levelNo = (txt_levelNo = 0);
}
Symbol 556 Button
on (release) {
g_levelNo = txt_levelNo++;
}
Symbol 557 Button
on (release) {
g_levelNo = txt_levelNo--;
}
Symbol 571 MovieClip Frame 1
stop();
Symbol 573 Button
on (release) {
_root.resetGameDifficulty();
gotoAndStop (4);
}
Symbol 576 Button
on (release) {
gotoAndStop (7);
_root.displayKeyAssignments();
}
Symbol 583 Button
on (release) {
gotoAndStop (8);
}
Symbol 587 Button
on (release) {
getURL ("http://www.crazymonkeygames.com", "_blank");
}
Symbol 591 Button
on (release) {
getURL ("http://www.crazymonkeygames.com/Stickman-Sam.html", "_blank");
}
Symbol 596 Button
on (release) {
getURL ("http://www.io3creations.com", "_blank");
}
Symbol 599 Button
on (release) {
trace("player level code: " + _root.pL_levelCode);
_root.checkLevelCode(txtLevelCode);
}
Symbol 604 MovieClip Frame 1
_x = 0;
_y = 0;
Symbol 605 Button
on (release) {
i = 1;
while (i < _root.levelCodeArr.length) {
j = 1;
while (j < _root.levelCodeArr[i].length) {
_root.levelCodeArr[i][j].unlocked = true;
j++;
}
i++;
}
_root.displayUnlockedLevels();
}
Symbol 611 Button
on (release) {
_root.startMissionTask(1, 1);
}
Symbol 613 Button
on (release) {
_root.startMissionTask(1, 2);
}
Symbol 615 Button
on (release) {
_root.startMissionTask(1, 3);
}
Symbol 617 Button
on (release) {
_root.startMissionTask(1, 4);
}
Symbol 619 Button
on (release) {
_root.startMissionTask(1, 5);
}
Symbol 621 Button
on (release) {
_root.startMissionTask(1, 6);
}
Symbol 624 Button
on (release) {
_root.startMissionTask(2, 1);
}
Symbol 625 Button
on (release) {
_root.startMissionTask(2, 2);
}
Symbol 627 Button
on (release) {
_root.startMissionTask(2, 3);
}
Symbol 629 Button
on (release) {
_root.startMissionTask(2, 4);
}
Symbol 631 Button
on (release) {
_root.startMissionTask(2, 5);
}
Symbol 633 Button
on (release) {
_root.startMissionTask(2, 6);
}
Symbol 635 MovieClip Frame 1
stop();
Symbol 638 Button
on (release) {
gotoAndStop (1);
}
Symbol 639 Button
on (release) {
_root.setGameDifficulty("med");
}
Symbol 640 Button
on (release) {
_root.setGameDifficulty("hard");
}
Symbol 642 Button
on (release) {
_root.setGameDifficulty("easy");
}
Symbol 656 MovieClip Frame 1
Symbol 661 Button
on (release) {
_root.continueDialogue();
}
Symbol 666 Button
on (release) {
_root.game_start();
}
Symbol 693 MovieClip Frame 1
stop();
Symbol 693 MovieClip Frame 2
Symbol 693 MovieClip Frame 10
Symbol 693 MovieClip Frame 16
Symbol 693 MovieClip Frame 19
Symbol 693 MovieClip Frame 23
Symbol 693 MovieClip Frame 25
Symbol 693 MovieClip Frame 33
Symbol 709 MovieClip Frame 1
stop();
Symbol 709 MovieClip Frame 2
stop();
Symbol 725 Button
on (release) {
_root.game_start();
}
Symbol 726 MovieClip Frame 1
Mouse.show();
_quality = "HIGH";
stopAllSounds();
stop();
Symbol 726 MovieClip Frame 3
_root.displayUnlockedLevels();
Instance of Symbol 709 MovieClip "key_pLMoveLeft" in Symbol 726 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 709 MovieClip "key_pLMoveRight" in Symbol 726 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 709 MovieClip "key_pLMoveUp" in Symbol 726 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 709 MovieClip "keyQualityToggle" in Symbol 726 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 709 MovieClip "keyMusicOnOff" in Symbol 726 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 709 MovieClip "keyPauseGame" in Symbol 726 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 709 MovieClip "key_pLNextWeapon" in Symbol 726 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 709 MovieClip "key_pLPrevWeapon" in Symbol 726 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 709 MovieClip "key_pLWalking" in Symbol 726 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}