Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("0411a389", this, 10301, true);
stop();
this.onEnterFrame = function () {
var _local3 = this.getBytesLoaded();
var _local2 = this.getBytesTotal();
var _local4 = (_local3 / _local2) * 100;
if ((_local3 >= _local2) && (_local2 > 0)) {
cubeLoader.loadBar._xscale = _local4;
delete this.onEnterFrame;
this.gotoAndPlay(3);
} else {
cubeLoader.loadBar._xscale = _local4;
}
};
Frame 3
function gameKeyHandler() {
if (bGameKeys) {
switch (Key.getCode()) {
case nkey0 :
if (bGameInPlay && (nAutoFireID == null)) {
switch (nSelectedUnit) {
case 0 :
if (mcGunBase.bMovable) {
addLaser();
}
break;
case 1 :
if (mcTankA.bMovable) {
addLaserA();
}
break;
case 2 :
if (!mcTankB.bMovable) {
break;
}
addLaserB();
}
}
return;
case nkey1 :
if (bGameInPlay && (bMultipleUnits)) {
bRadiansUpdated = false;
toggleUnitSelection();
}
return;
case nkey2 :
activatekey2();
return;
case nkey3 :
activatekey3();
return;
case nkey6 :
if (bGameKeys) {
if (bPaused) {
unPauseGame(true);
mcPauseScreen._visible = false;
} else {
pauseGame(true);
mcPauseScreen._visible = true;
}
}
return;
case nkey7 :
resetGame();
return;
case nkey8 :
if (bHelp) {
bHelp = false;
clearHelpWinB();
} else {
bHelp = true;
mcHelpWinA.bShown = false;
mcHelpWinC.bShown = false;
}
flushBoolData();
}
}
}
function menuKeyHandler() {
var _local4 = Key.getCode();
var _local3 = false;
var _local2 = 0;
while (_local2 < 9) {
if (this["row" + _local2].bHighlighted == true) {
_local3 = true;
break;
}
_local2++;
}
if (_local3) {
switch (_local4) {
case 48 :
case 49 :
case 50 :
case 51 :
case 52 :
case 53 :
case 54 :
case 55 :
case 56 :
case 57 :
case 65 :
case 66 :
case 67 :
case 68 :
case 69 :
case 70 :
case 71 :
case 72 :
case 73 :
case 74 :
case 75 :
case 76 :
case 77 :
case 78 :
case 79 :
case 80 :
case 81 :
case 82 :
case 83 :
case 84 :
case 85 :
case 86 :
case 87 :
case 88 :
case 89 :
case 90 :
case 32 :
case 37 :
case 38 :
case 39 :
case 40 :
case 16 :
case 17 :
mapRowKey(_local4, _local2);
}
}
}
function activatekey3() {
switch (nSelectedUnit) {
case 0 :
if ((bGameInPlay && (mcGunBase.bMovable)) && (mcSelectBox._visible == true)) {
activatePowerUp();
}
return;
case 1 :
if ((bGameInPlay && (mcTankA.bMovable)) && (mcSelectBox._visible == true)) {
activatePowerUpA();
}
return;
case 2 :
if (!((bGameInPlay && (mcTankB.bMovable)) && (mcSelectBox._visible == true))) {
break;
}
activatePowerUpB();
}
}
function activatekey2() {
if (bGameInPlay && (mcSelectBox._visible == true)) {
var _local1 = 0;
while (_local1 < 3) {
if (mcSelectBox._y == aSelectPos[_local1]) {
if (_local1 < (aListPowerUps.length - 1)) {
mcSelectBox._y = aSelectPos[_local1 + 1];
} else {
mcSelectBox._y = aSelectPos[0];
}
break;
}
_local1++;
}
_local1 = 0;
while (_local1 < 3) {
if (mcSelectBox._y == aSelectPos[_local1]) {
oPowerUp.selectedPowerUp = aListPowerUps[_local1];
oPowerUp.powerUpIndex = _local1;
}
_local1++;
}
switch (oPowerUp.selectedPowerUp) {
case 0 :
case 1 :
case 2 :
if (!bHelp) {
break;
}
clearHelpWinB();
mcHelpWinB.helpWinKey.text = sWinKey3;
mcHelpWinB._visible = true;
mcHelpWinB._x = 640;
mcHelpWinB._y = aSelectPos[oPowerUp.powerUpIndex] - (mcHelpWinB._height / 2);
nHelpBIntervalID = setInterval(clearHelpWinB, 2500);
}
}
}
function playLogo() {
var _local2 = attachMovie("logo", "mcLogo", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:(Stage.height / 2) + 10});
}
function playIntro() {
var _local4 = attachMovie("intro", "mcIntro", this.getNextHighestDepth(), {_x:0, _y:0});
}
function showGameCursor() {
mcCursor._visible = true;
}
function hideGameCursor() {
mcCursor._visible = false;
}
function showTargetCursor() {
mcTargetCursor._visible = true;
}
function hideTargetCursor() {
mcTargetCursor._visible = false;
}
function newGame() {
if (bMusic) {
mainBgMusic.start();
}
sWinKey1 = mcControlScreen.row1.key.text;
sWinKey2 = mcControlScreen.row2.key.text;
sWinKey3 = mcControlScreen.row3.key.text;
sWinKey4 = mcControlScreen.row4.key.text;
sWinKey5 = mcControlScreen.row5.key.text;
nScore = 0;
nEnergy = 1000;
bGameInPlay = true;
mcGunBase.inPlay = true;
yMouseBounds = mcGunBase._y;
nGameLocation = 0;
readyGameField();
showGameCursor();
switchModes(0);
setGameInterval();
setTargetInterval();
}
function initCity() {
var _local1 = 0;
while (_local1 < nMin) {
aListBuildingsL.push(_local1);
_local1++;
}
_local1 = nMin;
while (_local1 <= nMax) {
aListBuildingsR.push(_local1);
_local1++;
}
_local1 = 0;
while (_local1 < nMinA) {
aListDomeBuildingsL.push(_local1);
_local1++;
}
_local1 = nMinA;
while (_local1 <= nMaxA) {
aListDomeBuildingsR.push(_local1);
_local1++;
}
_local1 = 0;
while (_local1 < nMinB) {
aListPortBuildingsL.push(_local1);
_local1++;
}
_local1 = nMinB;
while (_local1 <= nMaxB) {
aListPortBuildingsR.push(_local1);
_local1++;
}
}
function renderCity(bRender) {
if (bRender) {
var _local1 = 0;
while (_local1 < aBuildings.length) {
aBuildings[_local1].gotoAndStop(1);
_local1++;
}
_local1 = 0;
while (_local1 < aInfectedBuildings.length) {
aInfectedBuildings[_local1].gotoAndStop(1);
_local1++;
}
mcCity._visible = true;
} else {
var _local1 = 0;
while (_local1 < aBuildings.length) {
aBuildings[_local1].gotoAndStop("noRender");
_local1++;
}
_local1 = 0;
while (_local1 < aInfectedBuildings.length) {
aInfectedBuildings[_local1].gotoAndStop("noRender");
_local1++;
}
mcCity._visible = false;
}
}
function renderAgriDome(bRender) {
if (bRender) {
var _local1 = 0;
while (_local1 < aDomeBuildings.length) {
aDomeBuildings[_local1].gotoAndStop(1);
_local1++;
}
mcAgriDome._visible = true;
} else {
var _local1 = 0;
while (_local1 < aDomeBuildings.length) {
aDomeBuildings[_local1].gotoAndStop("noRender");
_local1++;
}
mcAgriDome._visible = false;
}
}
function renderSpacePort(bRender) {
if (bRender) {
var _local1 = 0;
while (_local1 < aPortBuildings.length) {
aPortBuildings[_local1].gotoAndStop(1);
_local1++;
}
_local1 = 0;
while (_local1 < aInfectedPortBuildings.length) {
aInfectedPortBuildings[_local1].gotoAndStop(1);
_local1++;
}
mcSpacePort._visible = true;
} else {
var _local1 = 0;
while (_local1 < aPortBuildings.length) {
aPortBuildings[_local1].gotoAndStop("noRender");
_local1++;
}
_local1 = 0;
while (_local1 < aInfectedPortBuildings.length) {
aInfectedPortBuildings[_local1].gotoAndStop("noRender");
_local1++;
}
mcSpacePort._visible = false;
}
}
function renderOtherSide(bRender) {
if (bRender) {
mcOtherSide.gotoAndStop(1);
mcOtherSide._visible = true;
} else {
mcOtherSide.gotoAndStop("noRender");
mcOtherSide._visible = false;
}
}
function initGameField() {
var _local2 = {x:0, y:0};
oPlanetPos.x = 0;
oPlanetPos.y = 70;
oPlanetPos.z = -225;
mcPlanet._rotation = 0;
mcPlanetOverlay._rotation = 0;
mcPowerLines._rotation = 0;
mcCity._rotation = 0;
mcAgriDome._rotation = 75;
mcSpacePort._rotation = -75;
oPlanetPos.angle = 0;
mcTankA.angle = nTankAinit;
mcTankB.angle = nTankBinit;
scalePlanet();
mcPlanet._visible = true;
mcPlanetOverlay._visible = true;
mcPowerLines._visible = false;
mcPowerLines.line1._visible = true;
mcPowerLines.line2._visible = true;
mcPowerLines.line3._visible = true;
mcPowerLines.line4._visible = true;
mcPowerLines.line5._visible = true;
mcPowerLines.line6._visible = true;
mcMountains._visible = true;
updateCenterPoint();
renderCity(true);
renderAgriDome(true);
renderSpacePort(true);
renderOtherSide(true);
var _local1 = 0;
while (_local1 < aBuildings.length) {
aBuildings[_local1]._visible = true;
aBuildings[_local1].inPlay = true;
aBuildings[_local1].sqEnergy = 100;
_local1++;
}
_local1 = 0;
while (_local1 < aPortBuildings.length) {
aPortBuildings[_local1].sqEnergy = 100;
_local1++;
}
mcAntenna1._visible = true;
mcAntenna2._visible = true;
mcAntenna3._visible = true;
mcAntenna4._visible = true;
mcAntenna5._visible = true;
mcAntenna6._visible = true;
mcAntenna7._visible = true;
mcAntenna8._visible = true;
mcAntenna9._visible = true;
mcAntenna10._visible = true;
mcAntenna11._visible = true;
mcAgriDome._rotation = 75;
mcSpacePort._rotation = -75;
mcMountains._rotation = 2.5;
mcOtherSide._rotation = 180;
_local1 = 0;
while (_local1 < aDomeBuildings.length) {
aDomeBuildings[_local1]._visible = true;
aDomeBuildings[_local1].inPlay = true;
_local1++;
}
_local1 = 0;
while (_local1 < aPortBuildings.length) {
aPortBuildings[_local1]._visible = true;
aPortBuildings[_local1].inPlay = true;
aPortBuildings[_local1].sqEnergy = 100;
_local1++;
}
mcGunBase.inPlay = false;
mcTankA.inPlay = false;
mcTankB.inPlay = false;
nSelectedUnit = 0;
mcGunBase.gunTurret.missileA._visible = false;
mcGunBase.gunTurret.missileB._visible = false;
mcTankA.tankTurret.missileA._visible = false;
mcTankA.tankTurret.missileB._visible = false;
mcTankB.tankTurret.missileA._visible = false;
mcTankB.tankTurret.missileB._visible = false;
setSquidTargets(true);
mcBonusScreen.bonusTextA._visible = false;
mcBonusScreen.bonusTextB._visible = false;
mcBonusScreen.bonusTextC._visible = false;
}
function setSquidTargets(bCityLocation) {
var _local2 = {x:0, y:0};
var _local3 = aSquidTargets.length;
var _local1 = 0;
while (_local1 < _local3) {
aSquidTargets.shift();
_local1++;
}
if (bCityLocation) {
aSquidTargets.push(7);
aSquidTargets.push(10);
aSquidTargets.push(20);
aSquidTargets.push(24);
} else {
aSquidTargets.push(5);
aSquidTargets.push(8);
aSquidTargets.push(16);
}
_local1 = 0;
while (_local1 < aSquidTargets.length) {
if (bCityLocation) {
_local2.x = aBuildings[aSquidTargets[_local1]]._x;
_local2.y = aBuildings[aSquidTargets[_local1]]._y;
mcCity.localToGlobal(_local2);
} else {
_local2.x = aPortBuildings[aSquidTargets[_local1]]._x;
_local2.y = aPortBuildings[aSquidTargets[_local1]]._y;
mcSpacePort.localToGlobal(_local2);
}
aBuildingEnergyBars[_local1]._x = _local2.x;
aBuildingEnergyBars[_local1]._y = _local2.y + 100;
_local1++;
}
}
function readyGameField() {
renderAgriDome(false);
renderSpacePort(false);
renderOtherSide(false);
if (nIntervalID == null) {
yInt = 0;
nIntervalID = setInterval(readyGameFieldInterval, 25);
}
scalePlanet();
mcGunBase._alpha = 0;
mcPowerLines._alpha = 0;
mcGunBase._visible = true;
mcPowerLines._visible = true;
mcGunBase.inPlay = true;
if (bInitMouse) {
bInitMouse = false;
Mouse.addListener(oMouseListener);
}
mcCursor._x = _xmouse;
mcCursor._y = _ymouse;
}
function readyGameFieldInterval() {
if (yInt < 50) {
if (yInt > 40) {
yInt = yInt + 0.5;
oPlanetPos.y = oPlanetPos.y + 0.05;
mcGunBase._alpha = mcGunBase._alpha + 1;
mcPowerLines._alpha = mcPowerLines._alpha + 1;
scalePlanet();
} else {
yInt = yInt + 1;
oPlanetPos.y = oPlanetPos.y + 0.1;
mcGunBase._alpha = mcGunBase._alpha + 2;
mcPowerLines._alpha = mcPowerLines._alpha + 2;
scalePlanet();
}
} else {
clearInterval(nIntervalID);
nIntervalID = null;
mcGunBase._alpha = 100;
mcPowerLines._alpha = 100;
bGameKeys = true;
gLevel.setLevel(1);
showMessage(0, 0);
if (nIntervalID == null) {
nIntervalID = setInterval(showMessage, 1500, 1, 0);
}
showStatus(true);
}
yMouseBounds = mcGunBase._y;
}
function resetGame() {
var _local5 = 0;
var _local6 = 0;
var _local8 = nScore;
var _local2 = null;
var _local4 = 0;
var _local7 = 0;
if (gLevel.nLasersFired > 0) {
_local7 = Math.ceil((gLevel.nLasersHit / gLevel.nLasersFired) * 100);
}
if (mcTotalScreen.aTotalAccuracy.length > 0) {
i = 0;
while (i < mcTotalScreen.aTotalAccuracy.length) {
_local5 = _local5 + mcTotalScreen.aTotalAccuracy[i];
i++;
}
if (gLevel.nLevel == 15) {
if (_local5 > mcTotalScreen.aTotalAccuracy.length) {
_local6 = Math.ceil(_local5 / mcTotalScreen.aTotalAccuracy.length);
} else {
_local6 = 0;
}
} else if ((_local5 + _local7) > (mcTotalScreen.aTotalAccuracy.length + 1)) {
_local6 = Math.ceil((_local5 + _local7) / (mcTotalScreen.aTotalAccuracy.length + 1));
} else {
_local6 = 0;
}
} else {
_local6 = _local7;
}
if (bMusic) {
mainBgMusic.stop();
}
delete this.onEnterFrame;
bGameInPlay = false;
bGameKeys = false;
mcGunBase.bMovable = true;
mcTankA.bMovable = true;
mcTankB.bMovable = true;
bTankAMovement = false;
bTankBMovement = false;
bMultipleUnits = false;
bEffect = false;
bBossBEffect = false;
powerUpMode = 0;
nMissiles = 0;
nLineTimer = 0;
bResumeBeamA = false;
bResumeBeamB = false;
bResumeMessage = false;
clearGameInterval();
clearBossAInterval();
clearBossBInterval();
clearAutoFireInterval();
clearTargetInterval();
nScore = 0;
gLevel.resetLevel();
hideStatus();
hideGameCursor();
hideTargetCursor();
mcUnitCursor._visible = false;
mcGameOver.removeMessage();
mcAreaWasted.removeMessage();
mcTowersInfected.removeMessage();
mcPlanetDefended.removeMessage();
mcHelpWinA.removeHelpWin(true);
if (nHelpAIntervalID != null) {
clearInterval(nHelpAIntervalID);
nHelpAIntervalID = null;
}
mcHelpWinB.removeHelpWin(true);
if (nHelpBIntervalID != null) {
clearInterval(nHelpBIntervalID);
nHelpBIntervalID = null;
}
mcHelpWinC.removeHelpWin(true);
if (nHelpCIntervalID != null) {
clearInterval(nHelpCIntervalID);
nHelpCIntervalID = null;
}
mcHelpWinD.removeHelpWin(true);
mcHelpWinE.removeHelpWin(true);
mcAPIa.clear();
mcAPIp.clear();
mcAPIe.clear();
mcAPIb.clear();
if (bSound) {
sndBossBHover.stop();
}
if (bPaused) {
bPaused = false;
if (bTargetUpdate) {
bTargetUpdate = false;
mcTargetCursor.gotoAndPlay(mcTargetCursor._currentframe);
}
if (mcBossA._visible == true) {
mcBossA.gotoAndPlay(mcBossA._currentframe);
}
if (mcBossB._visible == true) {
mcBossB.gotoAndPlay(mcBossB._currentframe);
}
if (mcBossBEscortA._visible == true) {
mcBossBEscortA.escortGraphic.gotoAndPlay(mcBossBEscortA.escortGraphic._currentframe);
}
if (mcBossBEscortB._visible == true) {
mcBossBEscortB.escortGraphic.gotoAndPlay(mcBossBEscortB.escortGraphic._currentframe);
}
if (mcBossBBeamA._visible == true) {
mcBossBBeamA.gotoAndPlay(mcBossBBeamA._currentframe);
}
if (mcBossBBeamB._visible == true) {
mcBossBBeamB.gotoAndPlay(mcBossBBeamB._currentframe);
}
if (mcBossA.stun._visible == true) {
mcBossA.stun.stunA.gotoAndPlay(mcBossA.stun.stunA._currentframe);
mcBossA.stun.stunB.gotoAndPlay(mcBossA.stun.stunB._currentframe);
mcBossA.stun.stunC.gotoAndPlay(mcBossA.stun.stunC._currentframe);
mcBossA.stun.stunD.gotoAndPlay(mcBossA.stun.stunD._currentframe);
}
if (mcBossAAnimationL._visible == true) {
mcBossAAnimationL.gotoAndPlay(mcBossAAnimationL._currentframe);
}
if (mcBossAAnimationR._visible == true) {
mcBossAAnimationR.gotoAndPlay(mcBossAAnimationR._currentframe);
}
var i = 0;
while (i < aAliens.length) {
if (aAliens[i]._visible == true) {
aAliens[i].gotoAndPlay(aAliens[i]._currentframe);
}
i++;
}
i = 0;
while (i < aAlienAnimations.length) {
if (aAlienAnimations[i]._visible == true) {
aAlienAnimations[i].gotoAndPlay(aAlienAnimations[i]._currentframe);
if ((aAlienAnimations[i].alienType == 2) || (aAlienAnimations[i].alienType == 3)) {
aAlienAnimations[i].subAnimation.gotoAndPlay(aAlienAnimations[i].subAnimation._currentframe);
}
}
i++;
}
if (mcBossBEscortAnimationAA._visible == true) {
mcBossBEscortAnimationAA.gotoAndPlay(mcBossBEscortAnimationAA._currentframe);
}
if (mcBossBEscortAnimationAB._visible == true) {
mcBossBEscortAnimationAB.gotoAndPlay(mcBossBEscortAnimationAB._currentframe);
}
if (mcBossBEscortAnimationBA._visible == true) {
mcBossBEscortAnimationBA.gotoAndPlay(mcBossBEscortAnimationBA._currentframe);
}
if (mcBossBEscortAnimationBB._visible == true) {
mcBossBEscortAnimationBB.gotoAndPlay(mcBossBEscortAnimationBB._currentframe);
}
if (mcBossBAnimation._visible == true) {
mcBossBAnimation.gotoAndPlay(mcBossBAnimation._currentframe);
}
if (mcBossBExplosion._visible == true) {
mcBossBExplosion.gotoAndPlay(mcBossBExplosion._currentframe);
}
i = 0;
while (i < aPowerUpAnimations.length) {
if (aPowerUpAnimations[i]._visible == true) {
aPowerUpAnimations[i].gotoAndPlay(aPowerUpAnimations[i]._currentframe);
}
i++;
}
i = 0;
while (i < aListBomb.length) {
if (aBombs[aListBomb[i]]._currentframe != 1) {
aBombs[aListBomb[i]].gotoAndPlay(aBombs[aListBomb[i]]._currentframe);
}
i++;
}
i = 0;
while (i < aBombAnimations.length) {
if (aBombAnimations[i]._visible == true) {
aBombAnimations[i].gotoAndPlay(aBombAnimations[i]._currentframe);
}
i++;
}
i = 0;
while (i < aBuildingAnimations.length) {
if (aBuildingAnimations[i]._visible == true) {
aBuildingAnimations[i].gotoAndPlay(aBuildingAnimations[i]._currentframe);
}
i++;
}
i = 0;
while (i < aBuildingDamageAnimations.length) {
if (aBuildingDamageAnimations[i]._visible == true) {
aBuildingDamageAnimations[i].gotoAndPlay(aBuildingDamageAnimations[i]._currentframe);
}
i++;
}
i = 1;
while (i <= 6) {
if ((mcPowerLines["line" + i]._visible == true) && (mcPowerLines["line" + i]._currentframe != 1)) {
mcPowerLines["line" + i].gotoAndPlay(mcPowerLines["line" + i]._currentframe);
}
i++;
}
i = 0;
while (i < 6) {
if (aPowerLineAnimations[i]._visible == true) {
aPowerLineAnimations[i].gotoAndPlay(aPowerLineAnimations[i]._currentframe);
}
i++;
}
i = 0;
while (i < aDomeBuildingAnimations.length) {
if (aDomeBuildingAnimations[i]._visible == true) {
aDomeBuildingAnimations[i].gotoAndPlay(aDomeBuildingAnimations[i]._currentframe);
}
i++;
}
i = 0;
while (i < aDomeBuildingDamageAnimations.length) {
if (aDomeBuildingDamageAnimations[i]._visible == true) {
aDomeBuildingDamageAnimations[i].gotoAndPlay(aDomeBuildingDamageAnimations[i]._currentframe);
}
i++;
}
i = 0;
while (i < aPortBuildingAnimations.length) {
if (aPortBuildingAnimations[i]._visible == true) {
aPortBuildingAnimations[i].gotoAndPlay(aPortBuildingAnimations[i]._currentframe);
}
i++;
}
i = 0;
while (i < aPortBuildingDamageAnimations.length) {
if (aPortBuildingDamageAnimations[i]._visible == true) {
aPortBuildingDamageAnimations[i].gotoAndPlay(aPortBuildingDamageAnimations[i]._currentframe);
}
i++;
}
i = 0;
while (i < aMissiles.length) {
if (aMissiles[i].inPlay) {
aMissiles[i].thruster.gotoAndPlay(aMissiles[i].thruster._currentframe);
}
i++;
}
_local4 = 0;
i = 0;
while (i < 3) {
_local4 = aPowerUps[i].length;
var _local3 = 0;
while (_local3 < _local4) {
if ((aPowerUps[i][_local3]._visible == true) && (aPowerUps[i][_local3]._currentframe != 25)) {
aPowerUps[i][_local3].gotoAndPlay(aPowerUps[i][_local3]._currentframe);
}
_local3++;
}
i++;
}
i = 0;
while (i < aMessages.length) {
_local4 = aMessages[i].length;
var _local3 = 0;
while (_local3 < _local4) {
if (aMessages[i][_local3]._visible == true) {
aMessages[i][_local3].gotoAndPlay(aMessages[i][_local3]._currentframe);
}
_local3++;
}
i++;
}
if (mcTowersInfected._visible == true) {
mcTowersInfected.gotoAndPlay(mcTowersInfected._currentframe);
}
}
mcStoryScreen._visible = false;
mcPauseScreen._visible = false;
if (nEffectID != null) {
clearInterval(nEffectID);
nEffectID = null;
}
if (nBossBEffectID != null) {
clearInterval(nBossBEffectID);
nBossBEffectID = null;
}
if (nBonusID != null) {
clearInterval(nBonusID);
nBonusID = null;
}
if (nIntervalID != null) {
clearInterval(nIntervalID);
nIntervalID = null;
}
plLaser.reset();
alLaser.reset();
nLasers = 0;
mcBossA.gotoAndPlay(1);
mcBossA.removeBoss();
mcBossA.stun._visible = false;
mcBossAAnimationL.removeAnimation();
mcBossAAnimationR.removeAnimation();
mcBossB.removeBoss();
mcBossBEscortA.removeAlienEscort();
mcBossBEscortB.removeAlienEscort();
mcBossBBeamA.removeShieldBeam();
mcBossBBeamB.removeShieldBeam();
mcBossBShield.removeBossBShield();
mcBossBEscortAnimationAA.removeAnimation();
mcBossBEscortAnimationAB.removeAnimation();
mcBossBEscortAnimationBA.removeAnimation();
mcBossBEscortAnimationBB.removeAnimation();
mcBossBAnimation.removeAnimation();
mcBossBExplosion.removeAnimation();
nBossPowerUps = 0;
nBossMines = 0;
if (nBeamAIntervalID != null) {
clearInterval(nBeamAIntervalID);
nBeamAIntervalID = null;
}
if (nBeamBIntervalID != null) {
clearInterval(nBeamBIntervalID);
nBeamBIntervalID = null;
}
var i = 0;
while (i < aAliens.length) {
aAliens[i].removeAlien();
i++;
}
i = 0;
while (i < aAlienAnimations.length) {
aAlienAnimations[i].removeAnimation();
i++;
}
i = 0;
while (i < aListBox.length) {
aScoreBoxes[aListBox[i]].removeScoreBox();
i++;
}
_local2 = aListBox.length;
i = 0;
while (i < _local2) {
aListBox.shift();
i++;
}
i = 0;
while (i < nProjectiles) {
aAlienProjectiles[i].removeProjectile();
i++;
}
i = 0;
while (i < nParticles) {
aParticles[i].removeParticle();
i++;
}
i = 0;
while (i < aListBomb.length) {
aBombs[aListBomb[i]].removeBomb();
i++;
}
_local2 = aListBomb.length;
i = 0;
while (i < _local2) {
aListBomb.shift();
i++;
}
i = 0;
while (i < aAlienBombs.length) {
aAlienBombs[i].removeAlienBomb();
i++;
}
i = 0;
while (i < aBombAnimations.length) {
aBombAnimations[i]._visible = false;
i++;
}
i = 0;
while (i < aMissiles.length) {
aMissiles[i].removeMissile();
i++;
}
i = 0;
while (i < aBuildingEnergyBars.length) {
aBuildingEnergyBars[i]._visible = false;
i++;
}
i = 0;
while (i < aPowerUpAnimations.length) {
aPowerUpAnimations[i]._visible = false;
i++;
}
i = 0;
while (i < 6) {
aPowerLineAnimations[i]._visible = false;
i++;
}
_local2 = aListPowerUps.length;
i = 0;
while (i < _local2) {
aListPowerUps.shift();
i++;
}
updatePowerUps(false, false);
i = 0;
while (i < aMessages.length) {
_local4 = aMessages[i].length;
var _local3 = 0;
while (_local3 < _local4) {
if (aMessages[i][_local3]._visible == true) {
aMessages[i][_local3]._visible = false;
}
_local3++;
}
i++;
}
mcGunBase._visible = false;
mcGunBase.gunTurret.missileA._visible = false;
mcGunBase.gunTurret.missileB._visible = false;
mcTankA.tankTurret.missileA._visible = false;
mcTankA.tankTurret.missileB._visible = false;
mcTankB.tankTurret.missileA._visible = false;
mcTankB.tankTurret.missileB._visible = false;
mcTankA._visible = false;
mcTankB._visible = false;
if (nTankAID != null) {
clearInterval(nTankAID);
bTankAMovement = false;
nTankAID = null;
}
if (nTankBID != null) {
clearInterval(nTankBID);
bTankBMovement = false;
nTankBID = null;
}
i = 0;
while (i < aInfectedBuildings.length) {
aInfectedBuildings[i]._visible = false;
i++;
}
i = 0;
while (i < aInfectedPortBuildings.length) {
aInfectedPortBuildings[i]._visible = false;
i++;
}
i = 0;
while (i < aBuildings.length) {
aBuildings[i].removeBuilding();
i++;
}
i = 0;
while (i < aBuildingAnimations.length) {
aBuildingAnimations[i]._visible = false;
i++;
}
i = 0;
while (i < aBuildingDamageAnimations.length) {
aBuildingDamageAnimations[i]._visible = false;
i++;
}
i = 0;
while (i < aBuildings.length) {
if (aBuildings[i].bMask) {
aBuildings[i].damageMask._visible = false;
}
i++;
}
i = 0;
while (i < aListBuildingMasks.length) {
aListBuildingMasks[i].removeMovieClip();
i++;
}
_local2 = aListBuildingMasks.length;
i = 0;
while (i < _local2) {
aListBuildingMasks.shift();
i++;
}
i = 0;
while (i < aListInfectedBuildingMasks.length) {
aListInfectedBuildingMasks[i].removeMovieClip();
i++;
}
_local2 = aListInfectedBuildingMasks.length;
i = 0;
while (i < _local2) {
aListInfectedBuildingMasks.shift();
i++;
}
i = 0;
while (i < aDomeBuildings.length) {
aDomeBuildings[i].removeBuilding();
i++;
}
i = 0;
while (i < aDomeBuildingAnimations.length) {
aDomeBuildingAnimations[i]._visible = false;
i++;
}
i = 0;
while (i < aDomeBuildingDamageAnimations.length) {
aDomeBuildingDamageAnimations[i]._visible = false;
i++;
}
i = 0;
while (i < aDomeBuildings.length) {
if (aDomeBuildings[i].bMask) {
aDomeBuildings[i].damageMask._visible = false;
}
i++;
}
i = 0;
while (i < aListDomeBuildingMasks.length) {
aListDomeBuildingMasks[i].removeMovieClip();
i++;
}
_local2 = aListDomeBuildingMasks.length;
i = 0;
while (i < _local2) {
aListDomeBuildingMasks.shift();
i++;
}
i = 0;
while (i < aPortBuildings.length) {
aPortBuildings[i].removeBuilding();
i++;
}
i = 0;
while (i < aPortBuildingAnimations.length) {
aPortBuildingAnimations[i]._visible = false;
i++;
}
i = 0;
while (i < aPortBuildingDamageAnimations.length) {
aPortBuildingDamageAnimations[i]._visible = false;
i++;
}
i = 0;
while (i < aPortBuildings.length) {
if (aPortBuildings[i].bMask) {
aPortBuildings[i].damageMask._visible = false;
}
i++;
}
i = 0;
while (i < aListPortBuildingMasks.length) {
aListPortBuildingMasks[i].removeMovieClip();
i++;
}
_local2 = aListPortBuildingMasks.length;
i = 0;
while (i < _local2) {
aListPortBuildingMasks.shift();
i++;
}
i = 0;
while (i < aListInfectedPortBuildingMasks.length) {
aListInfectedPortBuildingMasks[i].removeMovieClip();
i++;
}
_local2 = aListInfectedPortBuildingMasks.length;
i = 0;
while (i < _local2) {
aListInfectedPortBuildingMasks.shift();
i++;
}
_local2 = aListBuildingsL.length;
i = 0;
while (i < _local2) {
aListBuildingsL.shift();
i++;
}
_local2 = aListBuildingsR.length;
i = 0;
while (i < _local2) {
aListBuildingsR.shift();
i++;
}
_local2 = aListDomeBuildingsL.length;
i = 0;
while (i < _local2) {
aListDomeBuildingsL.shift();
i++;
}
_local2 = aListDomeBuildingsR.length;
i = 0;
while (i < _local2) {
aListDomeBuildingsR.shift();
i++;
}
_local2 = aListPortBuildingsL.length;
i = 0;
while (i < _local2) {
aListPortBuildingsL.shift();
i++;
}
_local2 = aListPortBuildingsR.length;
i = 0;
while (i < _local2) {
aListPortBuildingsR.shift();
i++;
}
initCity();
initGameField();
mcTotalScreen._x = Stage.width / 2;
mcTotalScreen._y = Stage.height / 2;
mcTotalScreen.totalAccuracy.text = String(_local6 + "%");
mcTotalScreen.totalScore.text = String(_local8);
mcTotalScreen.statisticMessage.text = "Play P.O.D. with high scores on Kongregate.com.";
mcTotalScreen._visible = true;
mcTotalScreen.resetTotals();
Mouse.show();
}
function showMessage(mType, mIndex) {
aMessages[mType][mIndex]._x = aMessages[mType][mIndex].xPos;
aMessages[mType][mIndex]._y = aMessages[mType][mIndex].yPos;
aMessages[mType][mIndex]._visible = true;
aMessages[mType][mIndex].gotoAndPlay(1);
if (mType == 1) {
clearInterval(nIntervalID);
nIntervalID = null;
}
}
function showStatus(bShowEnergy) {
updateStatusLevel();
updateStatusScore();
mcStatus._visible = true;
if (bShowEnergy) {
updateEnergy();
mcEnergy._visible = true;
}
}
function hideStatus() {
mcStatus._visible = false;
mcEnergy._visible = false;
}
function updateStatusLevel() {
mcStatus.levelTxt.text = "Level " + gLevel.nLevel;
}
function updateStatusScore() {
mcStatus.scoreTxt.text = String(nScore);
}
function updateEnergy() {
mcEnergy.energyBarA._xscale = nEnergy / 10;
mcEnergy.energyBarB._xscale = nEnergy / 10;
mcEnergy.energyBarB._alpha = nEnergy / 10;
}
function updatePowerUps(bNew, bShowHelp) {
var _local1 = 0;
while (_local1 < 3) {
if (aListPowerUps.length > _local1) {
if (bNew && (aPowerUps[_local1][aListPowerUps[_local1]]._visible == false)) {
aPowerUps[_local1][aListPowerUps[_local1]]._visible = true;
aPowerUps[_local1][aListPowerUps[_local1]].gotoAndPlay(1);
} else {
aPowerUps[_local1][aListPowerUps[_local1]]._visible = true;
}
var _local2 = 0;
while (_local2 < 5) {
if (_local2 != aListPowerUps[_local1]) {
aPowerUps[_local1][_local2]._visible = false;
}
_local2++;
}
} else {
var _local2 = 0;
while (_local2 < 5) {
aPowerUps[_local1][_local2]._visible = false;
_local2++;
}
if ((mcSelectBox._y == aSelectPos[_local1]) && (_local1 > 0)) {
mcSelectBox._y = aSelectPos[_local1 - 1];
} else if (_local1 == 0) {
mcSelectBox._visible = false;
oPowerUp.selectedPowerUp = null;
oPowerUp.powerUpIndex = null;
}
}
_local1++;
}
_local1 = 0;
while (_local1 < 3) {
if ((mcSelectBox._y == aSelectPos[_local1]) && (mcSelectBox._visible == true)) {
oPowerUp.selectedPowerUp = aListPowerUps[_local1];
oPowerUp.powerUpIndex = _local1;
}
_local1++;
}
switch (oPowerUp.selectedPowerUp) {
case 0 :
case 1 :
case 2 :
if (!(bHelp && (bShowHelp))) {
break;
}
clearHelpWinB();
mcHelpWinB.helpWinKey.text = sWinKey3;
mcHelpWinB._visible = true;
mcHelpWinB._x = 640;
mcHelpWinB._y = aSelectPos[oPowerUp.powerUpIndex] - (mcHelpWinB._height / 2);
nHelpBIntervalID = setInterval(clearHelpWinB, 2500);
}
}
function hidePowerUps() {
var _local2 = 0;
i = 0;
while (i < 3) {
_local2 = aPowerUps[i].length;
var _local1 = 0;
while (_local1 < _local2) {
if (aPowerUps[i][_local1]._visible == true) {
aPowerUps[i][_local1]._visible = false;
}
_local1++;
}
i++;
}
mcSelectBox._visible = false;
}
function showPowerUps() {
mcSelectBox._visible = true;
updatePowerUps(true, false);
}
function clearHelpWin(nWin) {
switch (nWin) {
case 0 :
mcHelpWinA.removeHelpWin(false);
mcHelpWinD.removeHelpWin(false);
clearInterval(nHelpAIntervalID);
nHelpAIntervalID = null;
break;
case 1 :
mcHelpWinC.removeHelpWin(false);
mcHelpWinE.removeHelpWin(false);
clearInterval(nHelpCIntervalID);
nHelpCIntervalID = null;
}
mcStoryScreen._visible = false;
bGameKeys = true;
unPauseGame();
}
function clearHelpWinB() {
mcHelpWinB.removeHelpWin(false);
if (nHelpBIntervalID != null) {
clearInterval(nHelpBIntervalID);
nHelpBIntervalID = null;
}
}
function updateMissile() {
mcGunBase.gunTurret.missileA._visible = false;
mcGunBase.gunTurret.missileB._visible = false;
mcTankA.tankTurret.missileA._visible = false;
mcTankA.tankTurret.missileB._visible = false;
mcTankB.tankTurret.missileA._visible = false;
mcTankB.tankTurret.missileB._visible = false;
}
function updateCenterPoint() {
centerPoint.x = mcPlanet._x;
centerPoint.y = mcPlanet._y;
}
function updateGunBase() {
switch (nMissiles) {
case 1 :
mcGunBase.gunTurret.missileA._visible = true;
mcGunBase.gunTurret.missileB._visible = false;
return;
case 2 :
mcGunBase.gunTurret.missileA._visible = true;
mcGunBase.gunTurret.missileB._visible = true;
return;
case 0 :
default :
mcGunBase.gunTurret.missileA._visible = false;
mcGunBase.gunTurret.missileB._visible = false;
}
}
function updateTankA() {
switch (nMissiles) {
case 1 :
mcTankA.tankTurret.missileA._visible = true;
mcTankA.tankTurret.missileB._visible = false;
return;
case 2 :
mcTankA.tankTurret.missileA._visible = true;
mcTankA.tankTurret.missileB._visible = true;
return;
case 0 :
default :
mcTankA.tankTurret.missileA._visible = false;
mcTankA.tankTurret.missileB._visible = false;
}
}
function updateTankB() {
switch (nMissiles) {
case 1 :
mcTankB.tankTurret.missileA._visible = true;
mcTankB.tankTurret.missileB._visible = false;
return;
case 2 :
mcTankB.tankTurret.missileA._visible = true;
mcTankB.tankTurret.missileB._visible = true;
return;
case 0 :
default :
mcTankB.tankTurret.missileA._visible = false;
mcTankB.tankTurret.missileB._visible = false;
}
}
function addMissile(xPos, yPos, targetI) {
var _local1 = 0;
while (_local1 < nPMissiles) {
if (aMissiles[_local1].inPool) {
aMissiles[_local1].inPool = false;
aMissiles[_local1].inPlay = true;
aMissiles[_local1]._x = xPos;
aMissiles[_local1]._y = yPos;
aMissiles[_local1].targetI = targetI;
aMissiles[_local1]._rotation = mcGunBase.gunTurret._rotation;
aMissiles[_local1]._visible = true;
return(true);
}
_local1++;
}
return(false);
}
function addAlienProjectile(xPos, yPos) {
var _local1 = 0;
while (_local1 < nProjectiles) {
if (aAlienProjectiles[_local1].inPool) {
getBossATarget(_local1, xPos);
aAlienProjectiles[_local1].inPool = false;
aAlienProjectiles[_local1].inPlay = true;
aAlienProjectiles[_local1]._x = xPos;
aAlienProjectiles[_local1]._y = yPos;
aAlienProjectiles[_local1].initialY = yPos;
aAlienProjectiles[_local1]._visible = true;
return(true);
}
_local1++;
}
return(false);
}
function addAlienBomb(xPos, yPos, nMode) {
var _local1 = 0;
while (_local1 < nAlienBombs) {
if (aAlienBombs[_local1].inPool && (getBombTarget(_local1, xPos, nMode))) {
aAlienBombs[_local1].inPool = false;
aAlienBombs[_local1].inPlay = true;
aAlienBombs[_local1]._x = xPos;
aAlienBombs[_local1]._y = yPos;
aAlienBombs[_local1].initialY = yPos;
aAlienBombs[_local1]._visible = true;
return(aAlienBombs[_local1].targetI);
}
_local1++;
}
return(null);
}
function addBombAnimation(xPos, yPos, nScale) {
var _local1 = 0;
while (_local1 < nBombAnimations) {
if (aBombAnimations[_local1].inPool) {
aBombAnimations[_local1].inPool = false;
aBombAnimations[_local1]._xscale = (aBombAnimations[_local1]._yscale = nScale);
aBombAnimations[_local1]._x = xPos;
aBombAnimations[_local1]._y = yPos;
aBombAnimations[_local1]._visible = true;
aBombAnimations[_local1].gotoAndPlay(2);
if (bSound) {
sndBomb.start();
}
return(true);
}
_local1++;
}
return(false);
}
function addBomb(xPos, yPos, bScale, bMaxTimer) {
var _local1 = 0;
while (_local1 < nBombs) {
if (aBombs[_local1].inPool) {
aBombs[_local1].inPool = false;
aBombs[_local1]._x = xPos;
aBombs[_local1]._y = yPos;
aBombs[_local1].bScale = bScale;
aBombs[_local1].bMaxTimer = bMaxTimer;
aBombs[_local1].updateBomb();
aBombs[_local1]._visible = true;
aListBomb.push(_local1);
return(true);
}
_local1++;
}
return(false);
}
function pBombHit(xBomb, yBomb, bRadius) {
var _local3 = null;
var _local2 = null;
var _local4 = null;
var _local1 = 0;
while (_local1 < aAliens.length) {
if (aAliens[_local1].inPlay) {
_local3 = aAliens[_local1]._x - xBomb;
_local2 = aAliens[_local1]._y - yBomb;
_local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (_local4 < bRadius) {
aAliens[_local1].energy = aAliens[_local1].energy - 1;
if (aAliens[_local1].energy <= 0) {
gLevel.nLasersHit++;
removeAlien(_local1, true);
}
}
}
_local1++;
}
_local1 = 0;
while (_local1 < nAlienBombs) {
if (aAlienBombs[_local1].inPlay) {
_local3 = aAlienBombs[_local1]._x - xBomb;
_local2 = aAlienBombs[_local1]._y - yBomb;
_local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (_local4 < bRadius) {
gLevel.nLasersHit++;
removeAlienBomb(_local1, aAlienBombs[_local1]._x, aAlienBombs[_local1]._y, true);
}
}
_local1++;
}
}
function bossABombHit(xBomb, yBomb, bRadius) {
var _local3 = null;
var _local2 = null;
var _local4 = null;
var _local1 = nSquids + nSpitters;
while (_local1 < (((nSquids + nSpitters) + nPowerUps) + nMines)) {
if (aAliens[_local1].inPlay) {
_local3 = aAliens[_local1]._x - xBomb;
_local2 = aAliens[_local1]._y - yBomb;
_local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (_local4 < bRadius) {
aAliens[_local1].energy = aAliens[_local1].energy - 1;
if (aAliens[_local1].energy <= 0) {
gLevel.nLasersHit++;
removeAlien(_local1, true);
switch (aAliens[_local1].alienType) {
case 2 :
nBossPowerUps = nBossPowerUps - 1;
break;
case 3 :
nBossMines = nBossMines - 1;
}
}
}
}
_local1++;
}
_local3 = mcBossA._x - xBomb;
_local2 = mcBossA._y - yBomb;
_local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (mcBossA.inPlay && ((_local4 - 15) < bRadius)) {
if (mcBossA.bStunned == false) {
mcBossA.bStunned = true;
mcBossA.stun._visible = true;
}
mcBossA.energy = mcBossA.energy - 1;
if (mcBossA.energy <= 0) {
removeBossA();
}
}
}
function bossBBombHit(xBomb, yBomb, bRadius) {
var _local3 = null;
var _local2 = null;
var _local4 = null;
var _local1 = nSquids + nSpitters;
while (_local1 < (((nSquids + nSpitters) + nPowerUps) + nMines)) {
if (aAliens[_local1].inPlay) {
_local3 = aAliens[_local1]._x - xBomb;
_local2 = aAliens[_local1]._y - yBomb;
_local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (_local4 < bRadius) {
aAliens[_local1].energy = aAliens[_local1].energy - 1;
if (aAliens[_local1].energy <= 0) {
gLevel.nLasersHit++;
removeAlien(_local1, true);
switch (aAliens[_local1].alienType) {
case 2 :
nBossPowerUps = nBossPowerUps - 1;
break;
case 3 :
nBossMines = nBossMines - 1;
}
}
}
}
_local1++;
}
_local3 = mcBossB._x - xBomb;
_local2 = mcBossB._y - yBomb;
_local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (mcBossB.inPlay && ((_local4 - 15) < bRadius)) {
if (mcBossBShield.inPlay == false) {
mcBossB.energy = mcBossB.energy - 1;
if (mcBossB.energy <= 0) {
removeBossB();
}
}
}
_local3 = mcBossBEscortA._x - xBomb;
_local2 = mcBossBEscortA._y - yBomb;
_local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (mcBossBEscortA.inPlay && (_local4 < bRadius)) {
mcBossBEscortA.energy = mcBossBEscortA.energy - 1;
if (mcBossBEscortA.energy <= 0) {
removeAlienShipEscort(true);
}
}
_local3 = mcBossBEscortB._x - xBomb;
_local2 = mcBossBEscortB._y - yBomb;
_local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (mcBossBEscortB.inPlay && (_local4 < bRadius)) {
mcBossBEscortB.energy = mcBossBEscortB.energy - 1;
if (mcBossBEscortB.energy <= 0) {
removeAlienShipEscort(false);
}
}
}
function getBombTarget(i, xPos, nMode) {
var _local2 = {x:0, y:0};
var _local5 = null;
var _local1 = null;
var _local3 = null;
switch (nMode) {
case 1 :
if (xPos < (Stage.width / 2)) {
if (aListBuildingsL.length > 0) {
if (aListBuildingsL.length == 1) {
_local1 = aListBuildingsL[0];
} else {
_local3 = Math.floor(Math.random() * aListBuildingsL.length);
_local1 = aListBuildingsL[_local3];
}
// unexpected jump
}
return(false);
}
if (aListBuildingsR.length > 0) {
if (aListBuildingsR.length == 1) {
_local1 = aListBuildingsR[0];
} else {
_local3 = Math.floor(Math.random() * aListBuildingsR.length);
_local1 = aListBuildingsR[_local3];
}
} else {
return(false);
}
switch (_local1) {
case 2 :
case 6 :
case 9 :
case 11 :
case 17 :
case 19 :
case 23 :
if (!aBuildings[_local1 + 1].inPlay) {
break;
}
_local1 = _local1 + 1;
}
_local2.x = aBuildings[_local1]._x;
_local2.y = aBuildings[_local1]._y;
mcCity.localToGlobal(_local2);
_local5 = Math.abs(xPos - _local2.x);
if (aBuildings[_local1].inPlay && (_local5 < 100)) {
aAlienBombs[i].targetI = _local1;
aAlienBombs[i].targetX = _local2.x;
aAlienBombs[i].targetY = _local2.y;
return(true);
}
return(false);
case 2 :
if (xPos < (Stage.width / 2)) {
if (aListDomeBuildingsL.length > 0) {
if (aListDomeBuildingsL.length == 1) {
_local1 = aListDomeBuildingsL[0];
} else {
_local3 = Math.floor(Math.random() * aListDomeBuildingsL.length);
_local1 = aListDomeBuildingsL[_local3];
}
// unexpected jump
}
return(false);
}
if (aListDomeBuildingsR.length > 0) {
if (aListDomeBuildingsR.length == 1) {
_local1 = aListDomeBuildingsR[0];
} else {
_local3 = Math.floor(Math.random() * aListDomeBuildingsR.length);
_local1 = aListDomeBuildingsR[_local3];
}
} else {
return(false);
}
_local2.x = aDomeBuildings[_local1]._x;
_local2.y = aDomeBuildings[_local1]._y;
mcAgriDome.localToGlobal(_local2);
_local5 = Math.abs(xPos - _local2.x);
if (aDomeBuildings[_local1].inPlay && (_local5 < 100)) {
aAlienBombs[i].targetI = _local1;
aAlienBombs[i].targetX = _local2.x;
aAlienBombs[i].targetY = _local2.y;
return(true);
}
return(false);
case 3 :
if (xPos < (Stage.width / 2)) {
if (aListPortBuildingsL.length > 0) {
if (aListPortBuildingsL.length == 1) {
_local1 = aListPortBuildingsL[0];
} else {
_local3 = Math.floor(Math.random() * aListPortBuildingsL.length);
_local1 = aListPortBuildingsL[_local3];
}
// unexpected jump
}
return(false);
}
if (aListPortBuildingsR.length > 0) {
if (aListPortBuildingsR.length == 1) {
_local1 = aListPortBuildingsR[0];
} else {
_local3 = Math.floor(Math.random() * aListPortBuildingsR.length);
_local1 = aListPortBuildingsR[_local3];
}
} else {
return(false);
}
switch (_local1) {
case 6 :
case 14 :
if (aPortBuildings[_local1 + 1].inPlay) {
_local1 = _local1 + 1;
}
case 0 :
case 4 :
case 7 :
case 11 :
case 15 :
if (!aPortBuildings[_local1 + 1].inPlay) {
break;
}
_local1 = _local1 + 1;
}
_local2.x = aPortBuildings[_local1]._x;
_local2.y = aPortBuildings[_local1]._y;
mcSpacePort.localToGlobal(_local2);
_local5 = Math.abs(xPos - _local2.x);
if (aPortBuildings[_local1].inPlay && (_local5 < 100)) {
aAlienBombs[i].targetI = _local1;
aAlienBombs[i].targetX = _local2.x;
aAlienBombs[i].targetY = _local2.y;
return(true);
}
return(false);
}
}
function getBossATarget(j, xPos) {
var _local1 = {x:0, y:0};
var _local7 = 155;
var _local3 = false;
var _local5 = null;
var _local8 = null;
var _local9 = null;
var _local6 = new Array();
var _local2 = 0;
while (_local2 < aBuildings.length) {
_local1.x = aBuildings[_local2]._x;
_local1.y = aBuildings[_local2]._y;
mcCity.localToGlobal(_local1);
if (mcBossA.nTentacle == 0) {
_local5 = Math.abs(xPos - _local1.x);
if ((_local1.x < xPos) && (aBuildings[_local2].inPlay)) {
_local3 = true;
} else {
_local3 = false;
}
} else if (mcBossA.nTentacle == 1) {
_local5 = Math.abs(_local1.x - xPos);
if ((_local1.x > xPos) && (aBuildings[_local2].inPlay)) {
_local3 = true;
} else {
_local3 = false;
}
}
if ((_local5 < _local7) && (_local3)) {
_local6.push(_local2);
}
_local2++;
}
if (_local6.length > 0) {
_local8 = Math.floor(Math.random() * _local6.length);
switch (_local6[_local8]) {
case 2 :
case 6 :
case 9 :
case 11 :
case 17 :
case 19 :
case 23 :
if (!aBuildings[_local6[_local8] + 1].inPlay) {
break;
}
_local6[_local8] = _local6[_local8] + 1;
}
_local9 = _local6[_local8];
_local1.x = aBuildings[_local9]._x;
_local1.y = aBuildings[_local9]._y;
mcCity.localToGlobal(_local1);
} else {
if (mcBossA.nTentacle == 0) {
_local1.x = (xPos - _local7) + Math.floor(Math.random() * _local7);
} else if (mcBossA.nTentacle == 1) {
_local1.x = (xPos + _local7) - Math.floor(Math.random() * _local7);
}
if (_local1.x > (Stage.width - 75)) {
_local1.x = _local1.x - (_local1.x - (Stage.width - 75));
} else if (_local1.x < 75) {
_local1.x = _local1.x + (75 - _local1.x);
}
_local1.y = 500;
_local9 = null;
}
aAlienProjectiles[j].targetI = _local9;
aAlienProjectiles[j].targetX = _local1.x;
aAlienProjectiles[j].targetY = _local1.y;
}
function getBossBTarget() {
var _local4 = {x:0, y:0};
var _local3 = null;
var _local5 = null;
var _local2 = new Array();
var _local1 = 0;
while (_local1 < aPortBuildings.length) {
if (aPortBuildings[_local1].inPlay) {
_local2.push(_local1);
}
_local1++;
}
if (_local2.length > 0) {
_local3 = Math.floor(Math.random() * _local2.length);
switch (_local2[_local3]) {
case 9 :
if (aPortBuildings[_local2[_local3] - 3].inPlay) {
_local2[_local3] = _local2[_local3] - 3;
}
case 6 :
case 14 :
if (aPortBuildings[_local2[_local3] + 1].inPlay) {
_local2[_local3] = _local2[_local3] + 1;
}
case 0 :
case 4 :
case 7 :
case 11 :
case 15 :
if (!aPortBuildings[_local2[_local3] + 1].inPlay) {
break;
}
_local2[_local3] = _local2[_local3] + 1;
}
_local5 = _local2[_local3];
_local4.x = aPortBuildings[_local5]._x;
_local4.y = aPortBuildings[_local5]._y;
mcSpacePort.localToGlobal(_local4);
mcBossB.targetI = _local5;
mcBossB.targetJ = 0;
mcBossB.targetX = _local4.x;
mcBossB.targetY = _local4.y;
return(true);
}
return(false);
}
function addAutoLaser() {
switch (nSelectedUnit) {
case 0 :
if (mcGunBase.bMovable) {
addLaser();
}
return;
case 1 :
if (mcTankA.bMovable) {
addLaserA();
}
return;
case 2 :
if (!mcTankB.bMovable) {
break;
}
addLaserB();
}
}
function addLaser() {
if (((nLasers < maxLasers) && (nEnergy > 10)) && (bRadiansUpdated == true)) {
gLevel.nLasersFired++;
nEnergy = nEnergy - 10;
updateEnergy();
mcGunBase.gunTurret.gunBarrel.gotoAndPlay(2);
switch (powerUpMode) {
case 1 :
if (bSound) {
sndLaser.start();
}
laserPointA.x = mcGunBase.gunTurret.gunTurretMarker._x - 5;
laserPointA.y = mcGunBase.gunTurret.gunTurretMarker._y;
laserPointB.x = mcGunBase.gunTurret.gunTurretMarker._x + 5;
laserPointB.y = mcGunBase.gunTurret.gunTurretMarker._y;
mcGunBase.gunTurret.localToGlobal(laserPointA);
mcGunBase.gunTurret.localToGlobal(laserPointB);
plLaser.addLaser(laserPointA, nRadians);
plLaser.addLaser(laserPointB, nRadians);
nLasers = nLasers + 2;
break;
case 2 :
if (bSound) {
sndLancer.start();
}
laserPointA.x = mcGunBase.gunTurret.gunTurretMarker._x;
laserPointA.y = mcGunBase.gunTurret.gunTurretMarker._y;
laserPointB.x = mcGunBase.gunTurret.gunTurretMarker._x;
laserPointB.y = mcGunBase.gunTurret.gunTurretMarker._y - 8;
laserPointC.x = mcGunBase.gunTurret.gunTurretMarker._x;
laserPointC.y = mcGunBase.gunTurret.gunTurretMarker._y - 16;
mcGunBase.gunTurret.localToGlobal(laserPointA);
mcGunBase.gunTurret.localToGlobal(laserPointB);
mcGunBase.gunTurret.localToGlobal(laserPointC);
plLaser.addLaser(laserPointA, nRadians);
plLaser.addLaser(laserPointB, nRadians);
plLaser.addLaser(laserPointC, nRadians);
nLasers = nLasers + 3;
break;
case 3 :
if (bSound) {
sndLaser.start();
}
laserPointA.x = mcGunBase.gunTurret.gunTurretMarker._x;
laserPointA.y = mcGunBase.gunTurret.gunTurretMarker._y;
mcGunBase.gunTurret.localToGlobal(laserPointA);
plLaser.addLaser(laserPointA, nRadians - 0.1);
plLaser.addLaser(laserPointA, nRadians + 0.1);
plLaser.addLaser(laserPointA, nRadians);
nLasers = nLasers + 3;
break;
default :
if (bSound) {
sndLaser.start();
}
laserPointA.x = mcGunBase.gunTurret.gunTurretMarker._x;
laserPointA.y = mcGunBase.gunTurret.gunTurretMarker._y;
mcGunBase.gunTurret.localToGlobal(laserPointA);
plLaser.addLaser(laserPointA, nRadians);
nLasers = nLasers + 1;
}
} else if (nEnergy < 0) {
nEnergy = 0;
}
}
function addLaserA() {
if ((nLasers < maxLasers) && (bRadiansUpdated == true)) {
gLevel.nLasersFired++;
mcTankA.tankTurret.tankBarrelA.gotoAndPlay(2);
mcTankA.tankTurret.tankBarrelB.gotoAndPlay(2);
switch (powerUpMode) {
case 2 :
if (bSound) {
sndLancer.start();
}
laserPointA.x = mcTankA.tankTurret.tankTurretMarkerA._x + ((mcTankA.tankTurret.tankTurretMarkerB._x - mcTankA.tankTurret.tankTurretMarkerA._x) / 2);
laserPointA.y = mcTankA.tankTurret.tankTurretMarkerA._y;
laserPointB.x = mcTankA.tankTurret.tankTurretMarkerA._x + ((mcTankA.tankTurret.tankTurretMarkerB._x - mcTankA.tankTurret.tankTurretMarkerA._x) / 2);
laserPointB.y = mcTankA.tankTurret.tankTurretMarkerA._y - 8;
laserPointC.x = mcTankA.tankTurret.tankTurretMarkerA._x + ((mcTankA.tankTurret.tankTurretMarkerB._x - mcTankA.tankTurret.tankTurretMarkerA._x) / 2);
laserPointC.y = mcTankA.tankTurret.tankTurretMarkerA._y - 16;
mcTankA.tankTurret.localToGlobal(laserPointA);
mcTankA.tankTurret.localToGlobal(laserPointB);
mcTankA.tankTurret.localToGlobal(laserPointC);
plLaser.addLaser(laserPointA, nRadians);
plLaser.addLaser(laserPointB, nRadians);
plLaser.addLaser(laserPointC, nRadians);
nLasers = nLasers + 3;
break;
case 3 :
if (bSound) {
sndLaser.start();
}
laserPointA.x = mcTankA.tankTurret.tankTurretMarkerA._x;
laserPointA.y = mcTankA.tankTurret.tankTurretMarkerA._y;
laserPointB.x = mcTankA.tankTurret.tankTurretMarkerB._x;
laserPointB.y = mcTankA.tankTurret.tankTurretMarkerB._y;
mcTankA.tankTurret.localToGlobal(laserPointA);
mcTankA.tankTurret.localToGlobal(laserPointB);
plLaser.addLaser(laserPointA, nRadians - 0.1);
plLaser.addLaser(laserPointA, nRadians);
plLaser.addLaser(laserPointB, nRadians + 0.1);
plLaser.addLaser(laserPointB, nRadians);
nLasers = nLasers + 4;
break;
case 1 :
default :
if (bSound) {
sndLaser.start();
}
laserPointA.x = mcTankA.tankTurret.tankTurretMarkerA._x;
laserPointA.y = mcTankA.tankTurret.tankTurretMarkerA._y;
laserPointB.x = mcTankA.tankTurret.tankTurretMarkerB._x;
laserPointB.y = mcTankA.tankTurret.tankTurretMarkerB._y;
mcTankA.tankTurret.localToGlobal(laserPointA);
mcTankA.tankTurret.localToGlobal(laserPointB);
plLaser.addLaser(laserPointA, nRadians);
plLaser.addLaser(laserPointB, nRadians);
nLasers = nLasers + 2;
}
} else if (nEnergy < 0) {
nEnergy = 0;
}
}
function addLaserB() {
if ((nLasers < maxLasers) && (bRadiansUpdated == true)) {
gLevel.nLasersFired++;
mcTankB.tankTurret.tankBarrelA.gotoAndPlay(2);
mcTankB.tankTurret.tankBarrelB.gotoAndPlay(2);
switch (powerUpMode) {
case 2 :
if (bSound) {
sndLancer.start();
}
laserPointA.x = mcTankB.tankTurret.tankTurretMarkerA._x + ((mcTankB.tankTurret.tankTurretMarkerB._x - mcTankB.tankTurret.tankTurretMarkerA._x) / 2);
laserPointA.y = mcTankB.tankTurret.tankTurretMarkerA._y;
laserPointB.x = mcTankB.tankTurret.tankTurretMarkerA._x + ((mcTankB.tankTurret.tankTurretMarkerB._x - mcTankB.tankTurret.tankTurretMarkerA._x) / 2);
laserPointB.y = mcTankB.tankTurret.tankTurretMarkerA._y - 8;
laserPointC.x = mcTankB.tankTurret.tankTurretMarkerA._x + ((mcTankB.tankTurret.tankTurretMarkerB._x - mcTankB.tankTurret.tankTurretMarkerA._x) / 2);
laserPointC.y = mcTankB.tankTurret.tankTurretMarkerA._y - 16;
mcTankB.tankTurret.localToGlobal(laserPointA);
mcTankB.tankTurret.localToGlobal(laserPointB);
mcTankB.tankTurret.localToGlobal(laserPointC);
plLaser.addLaser(laserPointA, nRadians);
plLaser.addLaser(laserPointB, nRadians);
plLaser.addLaser(laserPointC, nRadians);
nLasers = nLasers + 3;
break;
case 3 :
if (bSound) {
sndLaser.start();
}
laserPointA.x = mcTankB.tankTurret.tankTurretMarkerA._x;
laserPointA.y = mcTankB.tankTurret.tankTurretMarkerA._y;
laserPointB.x = mcTankB.tankTurret.tankTurretMarkerB._x;
laserPointB.y = mcTankB.tankTurret.tankTurretMarkerB._y;
mcTankB.tankTurret.localToGlobal(laserPointA);
mcTankB.tankTurret.localToGlobal(laserPointB);
plLaser.addLaser(laserPointA, nRadians - 0.1);
plLaser.addLaser(laserPointA, nRadians);
plLaser.addLaser(laserPointB, nRadians + 0.1);
plLaser.addLaser(laserPointB, nRadians);
nLasers = nLasers + 4;
break;
case 1 :
default :
if (bSound) {
sndLaser.start();
}
laserPointA.x = mcTankB.tankTurret.tankTurretMarkerA._x;
laserPointA.y = mcTankB.tankTurret.tankTurretMarkerA._y;
laserPointB.x = mcTankB.tankTurret.tankTurretMarkerB._x;
laserPointB.y = mcTankB.tankTurret.tankTurretMarkerB._y;
mcTankB.tankTurret.localToGlobal(laserPointA);
mcTankB.tankTurret.localToGlobal(laserPointB);
plLaser.addLaser(laserPointA, nRadians);
plLaser.addLaser(laserPointB, nRadians);
nLasers = nLasers + 2;
}
} else if (nEnergy < 0) {
nEnergy = 0;
}
}
function addBossParticle(xPos, yPos, vx, vy) {
var _local3 = (Math.random() * (-vx)) * 3;
var _local2 = (Math.random() * (-vy)) * 3;
var _local1 = 0;
while (_local1 < nParticles) {
if (aParticles[_local1].inPool) {
aParticles[_local1].inPool = false;
aParticles[_local1].inPlay = true;
aParticles[_local1]._x = xPos;
aParticles[_local1]._y = yPos;
aParticles[_local1].vx = _local3;
aParticles[_local1].vy = _local2;
aParticles[_local1]._visible = true;
aListParticles.push(_local1);
break;
}
_local1++;
}
}
function pTargetLock(xPos, yPos, nLockedTarget, bTargetAll) {
if ((yPos > 250) && (bTargetAll)) {
nMinIndex = 0;
nMaxIndex = ((nSquids + nSpitters) + nMines) + nPowerUps;
} else if (bTargetAll) {
nMinIndex = nSquids + nSpitters;
nMaxIndex = aAliens.length;
} else {
nMinIndex = ((nSquids + nSpitters) + nMines) + nPowerUps;
nMaxIndex = aAliens.length;
}
var _local1 = nMinIndex;
while (_local1 < nMaxIndex) {
if (aAliens[_local1].inPlay && (aAliens[_local1].hitTest(xPos, yPos, false))) {
if (nLockedTarget != _local1) {
bTargetLock = true;
nTargetLock = _local1;
} else {
bTargetLock = false;
}
return(true);
}
_local1++;
}
return(false);
}
function bossATargetLock(xPos, yPos, nLockedTarget, bTargetAll) {
if (bTargetAll) {
nMinIndex = nSquids + nSpitters;
nMaxIndex = ((nSquids + nSpitters) + nMines) + nPowerUps;
var _local1 = nMinIndex;
while (_local1 < nMaxIndex) {
if (aAliens[_local1].inPlay && (aAliens[_local1].hitTest(xPos, yPos, false))) {
if (nLockedTarget != _local1) {
bTargetLock = true;
nTargetLock = _local1;
} else {
bTargetLock = false;
}
return(true);
}
_local1++;
}
}
if (mcBossA.inPlay && (mcBossA.hitTest(xPos, yPos, true))) {
if (nLockedTarget != -1) {
bTargetLock = true;
nTargetLock = -1;
} else {
bTargetLock = false;
}
return(true);
}
return(false);
}
function bossBTargetLock(xPos, yPos, nLockedTarget, bTargetAll) {
if (bTargetAll) {
nMinIndex = nSquids + nSpitters;
nMaxIndex = ((nSquids + nSpitters) + nMines) + nPowerUps;
var _local1 = nMinIndex;
while (_local1 < nMaxIndex) {
if (aAliens[_local1].inPlay && (aAliens[_local1].hitTest(xPos, yPos, false))) {
if (nLockedTarget != _local1) {
bTargetLock = true;
nTargetLock = _local1;
} else {
bTargetLock = false;
}
return(true);
}
_local1++;
}
}
if (mcBossB.inPlay && (mcBossB.hitTest(xPos, yPos, true))) {
if (nLockedTarget != -1) {
bTargetLock = true;
nTargetLock = -1;
} else {
bTargetLock = false;
}
return(true);
}
if (mcBossBEscortA.inPlay && (mcBossBEscortA.hitTest(xPos, yPos, true))) {
if (nLockedTarget != -2) {
bTargetLock = true;
nTargetLock = -2;
} else {
bTargetLock = false;
}
return(true);
}
if (mcBossBEscortB.inPlay && (mcBossBEscortB.hitTest(xPos, yPos, true))) {
if (nLockedTarget != -3) {
bTargetLock = true;
nTargetLock = -3;
} else {
bTargetLock = false;
}
return(true);
}
return(false);
}
function pMissileHit(xPos, yPos, newX, newY) {
var _local1 = ((nSquids + nSpitters) + nMines) + nPowerUps;
while (_local1 < aAliens.length) {
if ((aAliens[_local1].inPlay && (aAliens[_local1].hitTest(xPos, yPos, false))) && (((aAliens[_local1].alienType == 4) || (aAliens[_local1].alienType == 5)) || (aAliens[_local1].alienType == 6))) {
gLevel.nLasersFired++;
addMissile(newX, newY, _local1);
return(true);
}
_local1++;
}
return(false);
}
function bossAMissileHit(xPos, yPos, newX, newY) {
if (mcBossA.inPlay && (mcBossA.hitTest(xPos, yPos, true))) {
gLevel.nLasersFired++;
mcBossA.bLocked = true;
addMissile(newX, newY, -1);
return(true);
}
return(false);
}
function bossBMissileHit(xPos, yPos, newX, newY) {
if (mcBossB.inPlay && (mcBossB.hitTest(xPos, yPos, true))) {
mcBossB.bLocked = true;
gLevel.nLasersFired++;
addMissile(newX, newY, -1);
return(true);
}
if (mcBossBEscortA.inPlay && (mcBossBEscortA.hitTest(xPos, yPos, true))) {
gLevel.nLasersFired++;
addMissile(newX, newY, -2);
return(true);
}
if (mcBossBEscortB.inPlay && (mcBossBEscortB.hitTest(xPos, yPos, true))) {
gLevel.nLasersFired++;
addMissile(newX, newY, -3);
return(true);
}
return(false);
}
function pLazerHit(xPos, yPos) {
if (yPos > 250) {
nMinIndex = 0;
nMaxIndex = ((nSquids + nSpitters) + nMines) + nPowerUps;
} else {
nMinIndex = nSquids + nSpitters;
nMaxIndex = aAliens.length;
}
var _local1 = nMinIndex;
while (_local1 < nMaxIndex) {
if (aAliens[_local1].inPlay && (aAliens[_local1].hitTest(xPos, yPos, false))) {
gLevel.nLasersFired++;
lazerPoint.i = _local1;
lazerPoint.j = 0;
return(true);
}
_local1++;
}
return(false);
}
function bossALazerHit(xPos, yPos) {
nMinIndex = nSquids + nSpitters;
nMaxIndex = ((nSquids + nSpitters) + nMines) + nPowerUps;
var _local1 = nMinIndex;
while (_local1 < nMaxIndex) {
if (aAliens[_local1].inPlay && (aAliens[_local1].hitTest(xPos, yPos, false))) {
gLevel.nLasersFired++;
lazerPoint.i = _local1;
lazerPoint.j = 0;
return(true);
}
_local1++;
}
if (mcBossA.inPlay && (mcBossA.hitTest(xPos, yPos, false))) {
gLevel.nLasersFired++;
mcBossA.bLocked = true;
lazerPoint.i = -1;
lazerPoint.j = 0;
return(true);
}
return(false);
}
function bossBLazerHit(xPos, yPos) {
nMinIndex = nSquids + nSpitters;
nMaxIndex = ((nSquids + nSpitters) + nMines) + nPowerUps;
var _local1 = nMinIndex;
while (_local1 < nMaxIndex) {
if (aAliens[_local1].inPlay && (aAliens[_local1].hitTest(xPos, yPos, false))) {
gLevel.nLasersFired++;
lazerPoint.i = _local1;
lazerPoint.j = 0;
return(true);
}
_local1++;
}
if (mcBossB.inPlay && (mcBossB.hitTest(xPos, yPos, false))) {
gLevel.nLasersFired++;
mcBossB.bLocked = true;
lazerPoint.i = -1;
lazerPoint.j = 0;
return(true);
}
if (mcBossBEscortA.inPlay && (mcBossBEscortA.hitTest(xPos, yPos, false))) {
gLevel.nLasersFired++;
lazerPoint.i = -2;
lazerPoint.j = 0;
return(true);
}
if (mcBossBEscortB.inPlay && (mcBossBEscortB.hitTest(xPos, yPos, false))) {
gLevel.nLasersFired++;
lazerPoint.i = -3;
lazerPoint.j = 0;
return(true);
}
return(false);
}
function pLaserHit(xPos, yPos) {
if (yPos > 250) {
nMinIndex = 0;
nMaxIndex = ((nSquids + nSpitters) + nMines) + nPowerUps;
} else {
nMinIndex = nSquids + nSpitters;
nMaxIndex = aAliens.length;
}
var _local1 = nMinIndex;
while (_local1 < nMaxIndex) {
if (aAliens[_local1].inPlay && (aAliens[_local1].hitTest(xPos, yPos, true))) {
gLevel.nLasersHit++;
aAliens[_local1].energy = aAliens[_local1].energy - 1;
if (aAliens[_local1].energy <= 0) {
removeAlien(_local1, true);
}
return(true);
}
_local1++;
}
_local1 = 0;
while (_local1 < nAlienBombs) {
if (aAlienBombs[_local1].inPlay && (aAlienBombs[_local1].hitTest(xPos, yPos, true))) {
gLevel.nLasersHit++;
removeAlienBomb(_local1, aAlienBombs[_local1]._x, aAlienBombs[_local1]._y, true);
return(true);
}
_local1++;
}
return(false);
}
function pLaserHitBossA(xPos, yPos, vx, vy) {
nMinIndex = nSquids + nSpitters;
nMaxIndex = ((nSquids + nSpitters) + nPowerUps) + nMines;
var _local1 = nMinIndex;
while (_local1 < nMaxIndex) {
if (aAliens[_local1].inPlay && (aAliens[_local1].hitTest(xPos, yPos, true))) {
gLevel.nLasersHit++;
aAliens[_local1].energy = aAliens[_local1].energy - 1;
if (aAliens[_local1].energy <= 0) {
removeAlien(_local1, true);
switch (aAliens[_local1].alienType) {
case 2 :
nBossPowerUps = nBossPowerUps - 1;
break;
case 3 :
nBossMines = nBossMines - 1;
}
}
return(true);
}
_local1++;
}
if (mcBossA.inPlay && (mcBossA.hitTest(xPos, yPos, true))) {
gLevel.nLasersHit++;
if (mcBossA.bStunned) {
mcBossA.energy = mcBossA.energy - 1;
addBossParticle(xPos, yPos, vx, vy);
if (mcBossA.energy <= 0) {
removeBossA();
}
}
return(true);
}
return(false);
}
function pLaserHitBossB(xPos, yPos, vx, vy) {
nMinIndex = nSquids + nSpitters;
nMaxIndex = ((nSquids + nSpitters) + nPowerUps) + nMines;
var _local1 = nMinIndex;
while (_local1 < nMaxIndex) {
if (aAliens[_local1].inPlay && (aAliens[_local1].hitTest(xPos, yPos, true))) {
gLevel.nLasersHit++;
aAliens[_local1].energy = aAliens[_local1].energy - 1;
if (aAliens[_local1].energy <= 0) {
removeAlien(_local1, true);
switch (aAliens[_local1].alienType) {
case 2 :
nBossPowerUps = nBossPowerUps - 1;
break;
case 3 :
nBossMines = nBossMines - 1;
}
}
return(true);
}
_local1++;
}
if (mcBossB.inPlay) {
if (mcBossBShield.inPlay) {
if (mcBossBShield.hitTest(xPos, yPos, true)) {
gLevel.nLasersHit++;
return(true);
}
} else if (mcBossB.hitTest(xPos, yPos, true)) {
gLevel.nLasersHit++;
mcBossB.energy = mcBossB.energy - 1;
addBossParticle(xPos, yPos, vx, vy);
if (mcBossB.energy <= 0) {
removeBossB();
}
return(true);
}
}
if (mcBossBEscortA.inPlay && (mcBossBEscortA.hitTest(xPos, yPos, true))) {
gLevel.nLasersHit++;
mcBossBEscortA.energy = mcBossBEscortA.energy - 1;
if (mcBossBEscortA.energy <= 0) {
removeAlienShipEscort(true);
}
return(true);
}
if (mcBossBEscortB.inPlay && (mcBossBEscortB.hitTest(xPos, yPos, true))) {
gLevel.nLasersHit++;
mcBossBEscortB.energy = mcBossBEscortB.energy - 1;
if (mcBossBEscortB.energy <= 0) {
removeAlienShipEscort(false);
}
return(true);
}
return(false);
}
function pLaserHitBossBEvent(xPos, yPos, vx, vy) {
if (yPos > 250) {
nMinIndex = 0;
nMaxIndex = ((nSquids + nSpitters) + nMines) + nPowerUps;
} else {
nMinIndex = nSquids + nSpitters;
nMaxIndex = aAliens.length;
}
var _local1 = nMinIndex;
while (_local1 < nMaxIndex) {
if (aAliens[_local1].inPlay && (aAliens[_local1].hitTest(xPos, yPos, true))) {
gLevel.nLasersHit++;
aAliens[_local1].energy = aAliens[_local1].energy - 1;
if (aAliens[_local1].energy <= 0) {
removeAlien(_local1, true);
}
return(true);
}
_local1++;
}
_local1 = 0;
while (_local1 < nAlienBombs) {
if (aAlienBombs[_local1].inPlay && (aAlienBombs[_local1].hitTest(xPos, yPos, true))) {
gLevel.nLasersHit++;
removeAlienBomb(_local1, aAlienBombs[_local1]._x, aAlienBombs[_local1]._y, true);
return(true);
}
_local1++;
}
if (mcBossB.inPlay && (mcBossB.hitTest(xPos, yPos, true))) {
gLevel.nLasersHit++;
mcBossB.energy = mcBossB.energy - 1;
addBossParticle(xPos, yPos, vx, vy);
return(true);
}
return(false);
}
function aLaserHit(xPos, yPos) {
if (xPos < (Stage.width / 2)) {
iMin = 0;
iMax = nMin;
} else {
iMin = nMin;
iMax = nMax;
}
var _local1 = iMin;
while (_local1 <= iMax) {
if (aBuildings[_local1].inPlay && (aBuildings[_local1].hitTest(xPos, yPos, true))) {
aBuildings[_local1].energy = aBuildings[_local1].energy - 1;
if (aBuildings[_local1].energy <= 0) {
removeBuilding(_local1);
} else {
aBuildings[_local1].gotoAndPlay("laserHit");
}
return(true);
}
_local1++;
}
if (xPos < (Stage.width / 2)) {
iMin = 0;
iMax = 4;
} else {
iMin = 4;
iMax = 8;
}
_local1 = iMin;
while (_local1 < iMax) {
if ((aInfectedBuildings[_local1]._visible == true) && (aInfectedBuildings[_local1].hitTest(xPos, yPos, true))) {
return(true);
}
_local1++;
}
return(false);
}
function aLaserHitA(xPos, yPos) {
if (xPos < (Stage.width / 2)) {
iMin = 0;
iMax = nMinA;
} else {
iMin = nMinA;
iMax = nMaxA;
}
var _local1 = iMin;
while (_local1 <= iMax) {
if (aDomeBuildings[_local1].inPlay && (aDomeBuildings[_local1].hitTest(xPos, yPos, true))) {
aDomeBuildings[_local1].energy = aDomeBuildings[_local1].energy - 1;
if (aDomeBuildings[_local1].energy <= 0) {
removeBuildingA(_local1);
} else {
aDomeBuildings[_local1].gotoAndPlay("laserHit");
}
return(true);
}
_local1++;
}
return(false);
}
function aLaserHitB(xPos, yPos) {
if (xPos < (Stage.width / 2)) {
iMin = 0;
iMax = nMinB;
} else {
iMin = nMinB;
iMax = nMaxB;
}
var _local1 = iMin;
while (_local1 <= iMax) {
if (aPortBuildings[_local1].inPlay && (aPortBuildings[_local1].hitTest(xPos, yPos, true))) {
aPortBuildings[_local1].energy = aPortBuildings[_local1].energy - 1;
if (aPortBuildings[_local1].energy <= 0) {
removeBuildingA(_local1);
} else {
aPortBuildings[_local1].gotoAndPlay("laserHit");
}
return(true);
}
_local1++;
}
if (xPos < (Stage.width / 2)) {
iMin = 0;
iMax = 5;
} else {
iMin = 5;
iMax = 8;
}
_local1 = iMin;
while (_local1 < iMax) {
if ((aInfectedPortBuildings[_local1]._visible == true) && (aInfectedPortBuildings[_local1].hitTest(xPos, yPos, true))) {
return(true);
}
_local1++;
}
return(false);
}
function laserOut(xPos, yPos) {
if (xPos > Stage.width) {
return(true);
}
if (xPos < 0) {
return(true);
}
if (yPos > Stage.height) {
return(true);
}
if (yPos < 0) {
return(true);
}
return(false);
}
function fadeAliens() {
var _local1 = 0;
while (_local1 < aAliens.length) {
if (aAliens[_local1].inPlay) {
aAliens[_local1].filters = alienFilter;
aAliens[_local1].fadeAlien(true);
}
_local1++;
}
}
function fadeOutAlienBombs() {
var _local2 = true;
var _local1 = 0;
while (_local1 < aAlienBombs.length) {
if (aAlienBombs[_local1].inPlay) {
_local2 = false;
aAlienBombs[_local1]._alpha = aAlienBombs[_local1]._alpha - 10;
if (aAlienBombs[_local1]._alpha <= 0) {
aAlienBombs[_local1].removeAlienBomb();
_local2 = true;
}
}
_local1++;
}
_local1 = 0;
while (_local1 < nPMissiles) {
if (aMissiles[_local1].inPlay) {
_local2 = false;
aMissiles[_local1]._alpha = aMissiles[_local1]._alpha - 10;
if (aMissiles[_local1]._alpha <= 0) {
aMissiles[_local1].removeMissile();
_local2 = true;
}
}
_local1++;
}
if (_local2) {
bEffect = false;
clearInterval(nEffectID);
nEffectID = null;
}
}
function removeBossA() {
if (mcBossA.inPlay) {
mcBossA.inPlay = false;
mcBossA.bLocked = false;
if (bSound) {
sndRemoveBossA.start();
}
mcBossA.bRemoveBoss = true;
mcBossA.stun._visible = false;
}
}
function removeBossB() {
if (mcBossB.inPlay) {
mcBossB.inPlay = false;
removeAlienShipEscort(true);
removeAlienShipEscort(false);
mcBossB.bLocked = false;
if (bSound) {
sndBomb.start();
}
mcBossB.removeInterval = 0;
mcBossB.bAnimateBoss = true;
}
}
function addBossBBombAnimation() {
mcBossBExplosion._x = mcBossB.xBomb;
mcBossBExplosion._y = mcBossB.yBomb;
mcBossBExplosion._visible = true;
mcBossBExplosion.gotoAndPlay(1);
if (bSound) {
sndBomb.start();
}
}
function removeAlien(i, bScore) {
animateAlien(i);
if (bScore) {
nScore = nScore + aAliens[i].alienScore;
updateStatusScore();
}
switch (aAliens[i].alienType) {
case 0 :
if (bSound) {
sndRemoveSquid.start();
}
var _local3 = true;
var _local2 = 0;
while (_local2 < nSquids) {
if ((((aAliens[_local2].nTarget == aAliens[i].nTarget) && (aAliens[_local2].bSucking)) && (aAliens[_local2].inPlay)) && (_local2 != i)) {
_local3 = false;
}
_local2++;
}
if (_local3) {
resetBuildingSqEnergy(i);
}
if (bScore) {
aScoreBoxes[i]._x = aAliens[i]._x;
aScoreBoxes[i]._y = aAliens[i]._y;
aScoreBoxes[i]._visible = true;
aListBox.push(i);
}
break;
case 1 :
if (bSound) {
sndRemoveSquid.start();
}
if (aAliens[i].groupA != null) {
if (aAliens[aAliens[i].groupA].groupA == i) {
aAliens[aAliens[i].groupA].groupA = null;
} else {
aAliens[aAliens[i].groupA].groupB = null;
}
}
if (aAliens[i].groupB != null) {
if (aAliens[aAliens[i].groupB].groupA == i) {
aAliens[aAliens[i].groupB].groupA = null;
} else {
aAliens[aAliens[i].groupB].groupB = null;
}
}
aScoreBoxes[i]._x = aAliens[i]._x;
aScoreBoxes[i]._y = aAliens[i]._y;
aScoreBoxes[i]._visible = true;
aListBox.push(i);
break;
case 2 :
if (bSound) {
sndPowerUp.start();
}
aAlienAnimations[i].alienIndex = i;
case 3 :
addBomb(aAliens[i]._x, aAliens[i]._y, 300, 15);
break;
case 4 :
if (bSound) {
sndRemoveBrain.start();
}
aScoreBoxes[i]._x = aAliens[i]._x;
aScoreBoxes[i]._y = aAliens[i]._y;
aScoreBoxes[i]._visible = true;
aListBox.push(i);
break;
case 6 :
aAliens[i].nTarget = null;
case 5 :
if (bSound) {
sndRemoveShip.start();
}
addBombAnimation(aAliens[i]._x, aAliens[i]._y - 10, 100);
aScoreBoxes[i]._x = aAliens[i]._x;
aScoreBoxes[i]._y = aAliens[i]._y;
aScoreBoxes[i]._visible = true;
aListBox.push(i);
}
aAliens[i].removeAlien();
}
function removeAlienShipEscort(bAlienFlag) {
if (bAlienFlag) {
if (bSound) {
sndRemoveShip.start();
}
addBombAnimation(mcBossBEscortA._x, mcBossBEscortA._y - 10, 100);
aScoreBoxes[aScoreBoxes.length - 2]._x = mcBossBEscortA._x;
aScoreBoxes[aScoreBoxes.length - 2]._y = mcBossBEscortA._y;
aScoreBoxes[aScoreBoxes.length - 2]._visible = true;
aListBox.push(aScoreBoxes.length - 2);
if (mcBossBEscortA._currentframe < 30) {
mcBossBEscortAnimationAA._x = mcBossBEscortA._x;
mcBossBEscortAnimationAA._y = mcBossBEscortA._y;
mcBossBEscortAnimationAA._visible = true;
mcBossBEscortAnimationAA.gotoAndPlay(1);
} else {
mcBossBEscortAnimationAB._x = mcBossBEscortA._x;
mcBossBEscortAnimationAB._y = mcBossBEscortA._y;
mcBossBEscortAnimationAB._visible = true;
mcBossBEscortAnimationAB.gotoAndPlay(1);
}
mcBossBEscortA.removeAlienEscort();
if (mcBossBBeamA._visible == true) {
mcBossBBeamA.removeShieldBeam();
}
} else {
if (bSound) {
sndRemoveShip.start();
}
addBombAnimation(mcBossBEscortB._x, mcBossBEscortB._y - 10, 100);
aScoreBoxes[aScoreBoxes.length - 1]._x = mcBossBEscortB._x;
aScoreBoxes[aScoreBoxes.length - 1]._y = mcBossBEscortB._y;
aScoreBoxes[aScoreBoxes.length - 1]._visible = true;
aListBox.push(aScoreBoxes.length - 1);
if (mcBossBEscortB._currentframe < 30) {
mcBossBEscortAnimationBA._x = mcBossBEscortB._x;
mcBossBEscortAnimationBA._y = mcBossBEscortB._y;
mcBossBEscortAnimationBA._visible = true;
mcBossBEscortAnimationBA.gotoAndPlay(1);
} else {
mcBossBEscortAnimationBB._x = mcBossBEscortB._x;
mcBossBEscortAnimationBB._y = mcBossBEscortB._y;
mcBossBEscortAnimationBB._visible = true;
mcBossBEscortAnimationBB.gotoAndPlay(1);
}
mcBossBEscortB.removeAlienEscort();
if (mcBossBBeamB._visible == true) {
mcBossBBeamB.removeShieldBeam();
}
}
if ((mcBossBBeamA.inPlay == false) && (mcBossBBeamB.inPlay == false)) {
mcBossBShield.removeBossBShield();
}
}
function resetBuildingSqEnergy(i) {
switch (nGameLocation) {
case 0 :
aBuildings[aAliens[i].nTarget].sqEnergy = 100;
break;
case 2 :
aPortBuildings[aAliens[i].nTarget].sqEnergy = 100;
}
aBuildingEnergyBars[aAliens[i].aTarget]._visible = false;
}
function removeAlienProjectile(i, xPos, yPos) {
addBombAnimation(xPos, yPos, 100);
aAlienProjectiles[i].removeProjectile();
}
function removeAlienBomb(i, xPos, yPos, bScore) {
if (bScore) {
nScore = nScore + aAlienBombs[i].bombScore;
updateStatusScore();
}
addBombAnimation(xPos, yPos, 100);
aAlienBombs[i].removeAlienBomb();
}
function removeSquid(i) {
var _local1 = 0;
while (_local1 < nSquids) {
if ((aAliens[_local1].nTarget == i) && (aAliens[_local1].bSucking)) {
removeAlien(_local1, false);
}
_local1++;
}
}
function removeBuilding(i) {
var _local1 = 0;
while (_local1 < nSquids) {
if (aAliens[_local1].nTarget == i) {
if ((aAliens[_local1].dist < 25) && (aAliens[_local1].inPlay)) {
removeAlien(_local1, false);
} else {
aAliens[_local1].filters = alienFilter;
aAliens[_local1].fadeAlien(true);
}
}
_local1++;
}
_local1 = 0;
while (_local1 < aSquidTargets.length) {
if (aSquidTargets[_local1] == i) {
aSquidTargets.splice(_local1, 1);
break;
}
_local1++;
}
animateBuilding(i);
var _local3 = {x:0, y:0};
_local3.x = aBuildings[i]._x;
_local3.y = aBuildings[i]._y;
mcCity.localToGlobal(_local3);
addBombAnimation(_local3.x, _local3.y, 100);
if (aBuildings[i].nBombAnimations == 1) {
addBombAnimation(_local3.x, _local3.y, 90);
} else if (aBuildings[i].bBombAlignment) {
addBombAnimation(_local3.x - 10, _local3.y, 60);
addBombAnimation(_local3.x + 10, _local3.y, 60);
} else {
addBombAnimation(_local3.x, _local3.y - 10, 60);
addBombAnimation(_local3.x, _local3.y + 10, 60);
}
if (i < nMin) {
_local1 = 0;
while (_local1 < aListBuildingsL.length) {
if (aListBuildingsL[_local1] == i) {
aListBuildingsL.splice(_local1, 1);
}
_local1++;
}
} else {
_local1 = 0;
while (_local1 < aListBuildingsR.length) {
if (aListBuildingsR[_local1] == i) {
aListBuildingsR.splice(_local1, 1);
}
_local1++;
}
}
if (gLevel.nLevel < 7) {
switch (i) {
case 0 :
mcPowerLines.line1._visible = false;
aPowerLineAnimations[0]._visible = true;
aPowerLineAnimations[0].gotoAndPlay(1);
break;
case 1 :
mcPowerLines.line2._visible = false;
aPowerLineAnimations[1]._visible = true;
aPowerLineAnimations[1].gotoAndPlay(1);
break;
case 5 :
mcPowerLines.line3._visible = false;
aPowerLineAnimations[2]._visible = true;
aPowerLineAnimations[2].gotoAndPlay(1);
break;
case 13 :
mcPowerLines.line4._visible = false;
aPowerLineAnimations[3]._visible = true;
aPowerLineAnimations[3].gotoAndPlay(1);
break;
case 16 :
mcPowerLines.line5._visible = false;
aPowerLineAnimations[4]._visible = true;
aPowerLineAnimations[4].gotoAndPlay(1);
break;
case 22 :
mcPowerLines.line6._visible = false;
aPowerLineAnimations[5]._visible = true;
aPowerLineAnimations[5].gotoAndPlay(1);
}
}
aBuildings[i].removeBuilding();
}
function removeBuildingA(i) {
animateBuildingA(i);
var _local3 = 60;
var _local1 = {x:0, y:0};
_local1.x = aDomeBuildings[i]._x;
_local1.y = aDomeBuildings[i]._y;
mcAgriDome.localToGlobal(_local1);
switch (i) {
case 0 :
_local3 = _local3 + 60;
_local1.y = _local1.y - 10;
break;
case 2 :
_local3 = _local3 + 60;
_local1.y = _local1.y - 10;
break;
case 6 :
_local3 = _local3 + 60;
_local1.y = _local1.y - 10;
break;
case 8 :
_local3 = _local3 + 60;
_local1.y = _local1.y - 10;
break;
case 3 :
_local1.y = _local1.y + 10;
}
addBombAnimation(_local1.x, _local1.y, 100);
if (aDomeBuildings[i].nBombAnimations == 1) {
addBombAnimation(_local1.x, _local1.y, _local3 + 30);
} else if (aDomeBuildings[i].bBombAlignment) {
addBombAnimation(_local1.x - 10, _local1.y, _local3);
addBombAnimation(_local1.x + 10, _local1.y, _local3);
} else {
addBombAnimation(_local1.x, _local1.y - 10, _local3);
addBombAnimation(_local1.x, _local1.y + 10, _local3);
}
if (i < nMinA) {
j = 0;
while (j < aListDomeBuildingsL.length) {
if (aListDomeBuildingsL[j] == i) {
aListDomeBuildingsL.splice(j, 1);
}
j++;
}
} else {
j = 0;
while (j < aListDomeBuildingsR.length) {
if (aListDomeBuildingsR[j] == i) {
aListDomeBuildingsR.splice(j, 1);
}
j++;
}
}
aDomeBuildings[i].removeBuilding();
}
function removeBuildingB(i) {
var _local1 = 0;
while (_local1 < nSquids) {
if (aAliens[_local1].nTarget == i) {
if ((aAliens[_local1].dist < 25) && (aAliens[_local1].inPlay)) {
removeAlien(_local1, false);
} else {
aAliens[_local1].filters = alienFilter;
aAliens[_local1].fadeAlien(true);
}
}
_local1++;
}
_local1 = 0;
while (_local1 < aSquidTargets.length) {
if (aSquidTargets[_local1] == i) {
aSquidTargets.splice(_local1, 1);
break;
}
_local1++;
}
animateBuildingB(i);
var _local4 = 60;
var _local3 = {x:0, y:0};
_local3.x = aPortBuildings[i]._x;
_local3.y = aPortBuildings[i]._y;
mcSpacePort.localToGlobal(_local3);
switch (i) {
case 8 :
_local4 = _local4 + 60;
break;
case 9 :
_local4 = _local4 + 60;
break;
case 14 :
_local4 = _local4 + 60;
}
addBombAnimation(_local3.x, _local3.y, 100);
if (aPortBuildings[i].nBombAnimations == 1) {
addBombAnimation(_local3.x, _local3.y, _local4 + 30);
} else if (aPortBuildings[i].bBombAlignment) {
addBombAnimation(_local3.x - 10, _local3.y, _local4);
addBombAnimation(_local3.x + 10, _local3.y, _local4);
} else {
addBombAnimation(_local3.x, _local3.y - 10, _local4);
addBombAnimation(_local3.x, _local3.y + 10, _local4);
}
if (i < nMinA) {
_local1 = 0;
while (_local1 < aListPortBuildingsL.length) {
if (aListPortBuildingsL[_local1] == i) {
aListPortBuildingsL.splice(_local1, 1);
}
_local1++;
}
} else {
_local1 = 0;
while (_local1 < aListPortBuildingsR.length) {
if (aListPortBuildingsR[_local1] == i) {
aListPortBuildingsR.splice(_local1, 1);
}
_local1++;
}
}
aPortBuildings[i].removeBuilding();
}
function removeBuildingInfectA(i) {
var _local1 = 0;
while (_local1 < nSquids) {
if (aAliens[_local1].nTarget == i) {
aAliens[_local1].filters = alienFilter;
aAliens[_local1].fadeAlien(true);
}
_local1++;
}
_local1 = 0;
while (_local1 < aSquidTargets.length) {
if (aSquidTargets[_local1] == i) {
aSquidTargets.splice(_local1, 1);
break;
}
_local1++;
}
animateBuildingInfectA(i);
if (i < nMin) {
_local1 = 0;
while (_local1 < aListBuildingsL.length) {
if (aListBuildingsL[_local1] == i) {
aListBuildingsL.splice(_local1 - 1, 2);
}
_local1++;
}
} else {
_local1 = 0;
while (_local1 < aListBuildingsR.length) {
if (aListBuildingsR[_local1] == i) {
aListBuildingsR.splice(_local1 - 1, 2);
}
_local1++;
}
}
aBuildings[i].removeBuilding();
aBuildings[i - 1].removeBuilding();
}
function removeBuildingInfectB(i) {
var _local1 = 0;
while (_local1 < nSquids) {
if (aAliens[_local1].nTarget == i) {
aAliens[_local1].filters = alienFilter;
aAliens[_local1].fadeAlien(true);
}
_local1++;
}
_local1 = 0;
while (_local1 < aSquidTargets.length) {
if (aSquidTargets[_local1] == i) {
aSquidTargets.splice(_local1, 1);
break;
}
_local1++;
}
animateBuildingInfectB(i);
if (i < nMinB) {
_local1 = 0;
while (_local1 < aListPortBuildingsL.length) {
if (aListPortBuildingsL[_local1] == i) {
if (i == 8) {
aListPortBuildingsL.splice(_local1 - 2, 3);
} else {
aListPortBuildingsL.splice(_local1 - 1, 2);
}
}
_local1++;
}
} else {
_local1 = 0;
while (_local1 < aListPortBuildingsR.length) {
if (aListPortBuildingsR[_local1] == i) {
aListPortBuildingsR.splice(_local1 - 2, 3);
}
_local1++;
}
}
switch (i) {
case 8 :
case 16 :
aPortBuildings[i].removeBuilding();
aPortBuildings[i - 1].removeBuilding();
aPortBuildings[i - 2].removeBuilding();
break;
default :
aPortBuildings[i].removeBuilding();
aPortBuildings[i - 1].removeBuilding();
}
}
function animateBuilding(i) {
aBuildingAnimations[i]._visible = true;
aBuildingAnimations[i].gotoAndPlay(1);
}
function animateBuildingA(i) {
aDomeBuildingAnimations[i]._visible = true;
aDomeBuildingAnimations[i].gotoAndPlay(1);
}
function animateBuildingB(i) {
aPortBuildingAnimations[i]._visible = true;
aPortBuildingAnimations[i].gotoAndPlay(1);
}
function animateBuildingDamage(i) {
aBuildingDamageAnimations[i]._visible = true;
aBuildingDamageAnimations[i].gotoAndPlay(1);
}
function animateBuildingDamageA(i) {
aDomeBuildingDamageAnimations[i]._visible = true;
aDomeBuildingDamageAnimations[i].gotoAndPlay(1);
}
function animateBuildingDamageB(i) {
aPortBuildingDamageAnimations[i]._visible = true;
aPortBuildingDamageAnimations[i].gotoAndPlay(1);
}
function animateBuildingInfectA(i) {
var _local2 = null;
var _local1 = null;
switch (i) {
case 7 :
_local2 = 0;
_local1 = 1;
break;
case 10 :
_local2 = 2;
_local1 = 3;
break;
case 20 :
_local2 = 4;
_local1 = 5;
break;
case 24 :
_local2 = 6;
_local1 = 7;
}
aInfectedBuildings[_local2]._visible = true;
aInfectedBuildings[_local1]._visible = true;
}
function animateBuildingInfectB(i) {
var _local4 = null;
var _local3 = null;
var _local5 = null;
switch (i) {
case 5 :
_local4 = 0;
_local3 = 1;
var _local1 = 0;
while (_local1 < aListPortBuildingMasks.length) {
if (aListPortBuildingMasks[_local1].nIndex == i) {
aListInfectedPortBuildingMasks.push(aInfectedPortBuildings[_local3].attachMovie("smallMask", "smallMask", aInfectedPortBuildings[_local3].getNextHighestDepth(), {_x:aListPortBuildingMasks[_local1]._x, _y:aListPortBuildingMasks[_local1]._y, blendMode:"erase"}));
}
if (aListPortBuildingMasks[_local1].nIndex == (i - 1)) {
aListInfectedPortBuildingMasks.push(aInfectedPortBuildings[_local4].attachMovie("smallMask", "smallMask", aInfectedPortBuildings[_local4].getNextHighestDepth(), {_x:aListPortBuildingMasks[_local1]._x, _y:aListPortBuildingMasks[_local1]._y, blendMode:"erase"}));
}
_local1++;
}
aInfectedPortBuildings[_local4]._visible = true;
aInfectedPortBuildings[_local3]._visible = true;
if (aPortBuildings[i].bDamage) {
aListInfectedPortBuildingMasks.push(aInfectedPortBuildings[_local3].attachMovie("portMask" + (i + 1), "damageMask", aInfectedPortBuildings[_local3].getNextHighestDepth(), {blendMode:"erase"}));
}
break;
case 8 :
_local4 = 2;
_local3 = 3;
_local5 = 4;
_local1 = 0;
while (_local1 < aListPortBuildingMasks.length) {
if (aListPortBuildingMasks[_local1].nIndex == i) {
aListInfectedPortBuildingMasks.push(aInfectedPortBuildings[_local5].attachMovie("smallMask", "smallMask", aInfectedPortBuildings[_local5].getNextHighestDepth(), {_x:aListPortBuildingMasks[_local1]._x, _y:aListPortBuildingMasks[_local1]._y, blendMode:"erase"}));
}
if (aListPortBuildingMasks[_local1].nIndex == (i - 1)) {
aListInfectedPortBuildingMasks.push(aInfectedPortBuildings[_local3].attachMovie("smallMask", "smallMask", aInfectedPortBuildings[_local3].getNextHighestDepth(), {_x:aListPortBuildingMasks[_local1]._x, _y:aListPortBuildingMasks[_local1]._y, blendMode:"erase"}));
}
if (aListPortBuildingMasks[_local1].nIndex == (i - 2)) {
aListInfectedPortBuildingMasks.push(aInfectedPortBuildings[_local4].attachMovie("smallMask", "smallMask", aInfectedPortBuildings[_local4].getNextHighestDepth(), {_x:aListPortBuildingMasks[_local1]._x, _y:aListPortBuildingMasks[_local1]._y, blendMode:"erase"}));
}
_local1++;
}
aInfectedPortBuildings[_local4]._visible = true;
aInfectedPortBuildings[_local3]._visible = true;
aInfectedPortBuildings[_local5]._visible = true;
if (aPortBuildings[i].bDamage) {
aListInfectedPortBuildingMasks.push(aInfectedPortBuildings[_local5].attachMovie("portMask" + (i + 1), "damageMask", aInfectedPortBuildings[_local5].getNextHighestDepth(), {blendMode:"erase"}));
}
break;
case 16 :
_local4 = 5;
_local3 = 6;
_local5 = 7;
_local1 = 0;
while (_local1 < aListPortBuildingMasks.length) {
if (aListPortBuildingMasks[_local1].nIndex == i) {
aListInfectedPortBuildingMasks.push(aInfectedPortBuildings[_local5].attachMovie("smallMask", "smallMask", aInfectedPortBuildings[_local5].getNextHighestDepth(), {_x:aListPortBuildingMasks[_local1]._x, _y:aListPortBuildingMasks[_local1]._y, blendMode:"erase"}));
}
if (aListPortBuildingMasks[_local1].nIndex == (i - 1)) {
aListInfectedPortBuildingMasks.push(aInfectedPortBuildings[_local3].attachMovie("smallMask", "smallMask", aInfectedPortBuildings[_local3].getNextHighestDepth(), {_x:aListPortBuildingMasks[_local1]._x, _y:aListPortBuildingMasks[_local1]._y, blendMode:"erase"}));
}
if (aListPortBuildingMasks[_local1].nIndex == (i - 2)) {
aListInfectedPortBuildingMasks.push(aInfectedPortBuildings[_local4].attachMovie("smallMask", "smallMask", aInfectedPortBuildings[_local4].getNextHighestDepth(), {_x:aListPortBuildingMasks[_local1]._x, _y:aListPortBuildingMasks[_local1]._y, blendMode:"erase"}));
}
_local1++;
}
aInfectedPortBuildings[_local4]._visible = true;
aInfectedPortBuildings[_local3]._visible = true;
aInfectedPortBuildings[_local5]._visible = true;
if (!aPortBuildings[i].bDamage) {
break;
}
aListInfectedPortBuildingMasks.push(aInfectedPortBuildings[_local5].attachMovie("portMask" + (i + 1), "damageMask", aInfectedPortBuildings[_local5].getNextHighestDepth(), {blendMode:"erase"}));
}
}
function animateAlien(i) {
aAlienAnimations[i]._x = aAliens[i]._x;
aAlienAnimations[i]._y = aAliens[i]._y;
aAlienAnimations[i]._rotation = aAliens[i]._rotation;
aAlienAnimations[i]._visible = true;
aAlienAnimations[i].gotoAndPlay(1);
}
function activatePowerUp() {
var _local2 = false;
if (bHelp && (mcHelpWinB._visible == true)) {
mcHelpWinB.removeHelpWin(false);
}
switch (oPowerUp.selectedPowerUp) {
case 0 :
if (bSound) {
sndPowerUp.start();
}
powerUpMode = 1;
nPowerUpTimer = 8;
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
break;
case 1 :
if (bSound) {
sndPowerUp.start();
}
powerUpMode = 2;
nPowerUpTimer = 4;
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
break;
case 2 :
if (bSound) {
sndPowerUp.start();
}
powerUpMode = 3;
nPowerUpTimer = 4;
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
break;
case 3 :
if (gLevel.nLevel == 8) {
if (bossALazerHit(mcCursor._x, mcCursor._y)) {
_local2 = true;
}
} else if (gLevel.nLevel == 15) {
if (bossBLazerHit(mcCursor._x, mcCursor._y)) {
_local2 = true;
}
} else if (pLazerHit(mcCursor._x, mcCursor._y)) {
_local2 = true;
}
if (_local2) {
if (bSound) {
sndLazer.start();
}
var _local1 = {x:0, y:0};
_local1.x = mcGunBase.gunTurret.gunTurretMarker._x;
_local1.y = mcGunBase.gunTurret.gunTurretMarker._y;
mcGunBase.gunTurret.localToGlobal(_local1);
mcGunBase.bMovable = false;
bEffect = true;
nEffectType = 1;
if (gLevel.nLevel == 8) {
nEffectID = setInterval(lazerEffectIntervalA, 50, _local1.x, _local1.y);
} else if (gLevel.nLevel == 15) {
nEffectID = setInterval(lazerEffectIntervalB, 50, _local1.x, _local1.y);
} else {
nEffectID = setInterval(lazerEffectInterval, 50, _local1.x, _local1.y);
}
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
if (bHelp && (mcHelpWinB._visible == true)) {
mcHelpWinB.removeHelpWin(false);
}
}
break;
case 4 :
var _local1 = {x:0, y:0};
if (nMissiles > 1) {
_local1.x = mcGunBase.gunTurret.missileB._x;
_local1.y = mcGunBase.gunTurret.missileB._y;
} else {
_local1.x = mcGunBase.gunTurret.missileA._x;
_local1.y = mcGunBase.gunTurret.missileA._y;
}
mcGunBase.gunTurret.localToGlobal(_local1);
if (gLevel.nLevel == 8) {
if (bossAMissileHit(mcCursor._x, mcCursor._y, _local1.x, _local1.y)) {
_local2 = true;
}
} else if (gLevel.nLevel == 15) {
if (bossBMissileHit(mcCursor._x, mcCursor._y, _local1.x, _local1.y)) {
_local2 = true;
}
} else if (pMissileHit(mcCursor._x, mcCursor._y, _local1.x, _local1.y)) {
_local2 = true;
}
if (!_local2) {
break;
}
if (bSound) {
sndMissile.start();
}
nMissiles = nMissiles - 1;
updateGunBase();
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
if (!(bHelp && (mcHelpWinB._visible == true))) {
break;
}
mcHelpWinB.removeHelpWin(false);
}
}
function activatePowerUpA() {
var _local2 = false;
if (bHelp && (mcHelpWinB._visible == true)) {
mcHelpWinB.removeHelpWin(false);
}
switch (oPowerUp.selectedPowerUp) {
case 0 :
if (bSound) {
sndPowerUp.start();
}
powerUpMode = 1;
nPowerUpTimer = 8;
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
break;
case 1 :
if (bSound) {
sndPowerUp.start();
}
powerUpMode = 2;
nPowerUpTimer = 4;
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
break;
case 2 :
if (bSound) {
sndPowerUp.start();
}
powerUpMode = 3;
nPowerUpTimer = 4;
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
break;
case 3 :
if (gLevel.nLevel == 8) {
if (bossALazerHit(mcCursor._x, mcCursor._y)) {
_local2 = true;
}
} else if (gLevel.nLevel == 15) {
if (bossBLazerHit(mcCursor._x, mcCursor._y)) {
_local2 = true;
}
} else if (pLazerHit(mcCursor._x, mcCursor._y)) {
_local2 = true;
}
if (_local2) {
if (bSound) {
sndLazer.start();
}
var _local1 = {x:0, y:0};
_local1.x = mcTankA.tankTurret.tankTurretMarkerA._x + ((mcTankA.tankTurret.tankTurretMarkerB._x - mcTankA.tankTurret.tankTurretMarkerA._x) / 2);
_local1.y = mcTankA.tankTurret.tankTurretMarkerA._y;
mcTankA.tankTurret.localToGlobal(_local1);
mcTankA.bMovable = false;
bEffect = true;
nEffectType = 1;
if (gLevel.nLevel == 8) {
nEffectID = setInterval(lazerEffectIntervalA, 50, _local1.x, _local1.y);
} else if (gLevel.nLevel == 15) {
nEffectID = setInterval(lazerEffectIntervalB, 50, _local1.x, _local1.y);
} else {
nEffectID = setInterval(lazerEffectInterval, 50, _local1.x, _local1.y);
}
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
}
break;
case 4 :
var _local1 = {x:0, y:0};
if (nMissiles > 1) {
_local1.x = mcTankA.tankTurret.missileB._x;
_local1.y = mcTankA.tankTurret.missileB._y;
} else {
_local1.x = mcTankA.tankTurret.missileA._x;
_local1.y = mcTankA.tankTurret.missileA._y;
}
mcTankA.tankTurret.localToGlobal(_local1);
if (gLevel.nLevel == 8) {
if (bossAMissileHit(mcCursor._x, mcCursor._y, _local1.x, _local1.y)) {
_local2 = true;
}
} else if (gLevel.nLevel == 15) {
if (bossBMissileHit(mcCursor._x, mcCursor._y, _local1.x, _local1.y)) {
_local2 = true;
}
} else if (pMissileHit(mcCursor._x, mcCursor._y, _local1.x, _local1.y)) {
_local2 = true;
}
if (!_local2) {
break;
}
if (bSound) {
sndMissile.start();
}
nMissiles = nMissiles - 1;
updateTankA();
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
if (!(bHelp && (mcHelpWinB._visible == true))) {
break;
}
mcHelpWinB.removeHelpWin(false);
}
}
function activatePowerUpB() {
var _local2 = false;
if (bHelp && (mcHelpWinB._visible == true)) {
mcHelpWinB.removeHelpWin(false);
}
switch (oPowerUp.selectedPowerUp) {
case 0 :
if (bSound) {
sndPowerUp.start();
}
powerUpMode = 1;
nPowerUpTimer = 8;
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
break;
case 1 :
if (bSound) {
sndPowerUp.start();
}
powerUpMode = 2;
nPowerUpTimer = 4;
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
break;
case 2 :
if (bSound) {
sndPowerUp.start();
}
powerUpMode = 3;
nPowerUpTimer = 4;
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
break;
case 3 :
if (gLevel.nLevel == 8) {
if (bossALazerHit(mcCursor._x, mcCursor._y)) {
_local2 = true;
}
} else if (gLevel.nLevel == 15) {
if (bossBLazerHit(mcCursor._x, mcCursor._y)) {
_local2 = true;
}
} else if (pLazerHit(mcCursor._x, mcCursor._y)) {
_local2 = true;
}
if (_local2) {
if (bSound) {
sndLazer.start();
}
var _local1 = {x:0, y:0};
_local1.x = mcTankB.tankTurret.tankTurretMarkerA._x + ((mcTankB.tankTurret.tankTurretMarkerB._x - mcTankB.tankTurret.tankTurretMarkerA._x) / 2);
_local1.y = mcTankB.tankTurret.tankTurretMarkerA._y;
mcTankB.tankTurret.localToGlobal(_local1);
mcTankB.bMovable = false;
bEffect = true;
nEffectType = 1;
if (gLevel.nLevel == 8) {
nEffectID = setInterval(lazerEffectIntervalA, 50, _local1.x, _local1.y);
} else if (gLevel.nLevel == 15) {
nEffectID = setInterval(lazerEffectIntervalB, 50, _local1.x, _local1.y);
} else {
nEffectID = setInterval(lazerEffectInterval, 50, _local1.x, _local1.y);
}
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
if (bHelp && (mcHelpWinB._visible == true)) {
mcHelpWinB.removeHelpWin(false);
}
}
break;
case 4 :
var _local1 = {x:0, y:0};
if (nMissiles > 1) {
_local1.x = mcTankB.tankTurret.missileB._x;
_local1.y = mcTankB.tankTurret.missileB._y;
} else {
_local1.x = mcTankB.tankTurret.missileA._x;
_local1.y = mcTankB.tankTurret.missileA._y;
}
mcTankB.tankTurret.localToGlobal(_local1);
if (gLevel.nLevel == 8) {
if (bossAMissileHit(mcCursor._x, mcCursor._y, _local1.x, _local1.y)) {
_local2 = true;
}
} else if (gLevel.nLevel == 15) {
if (bossBMissileHit(mcCursor._x, mcCursor._y, _local1.x, _local1.y)) {
_local2 = true;
}
} else if (pMissileHit(mcCursor._x, mcCursor._y, _local1.x, _local1.y)) {
_local2 = true;
}
if (!_local2) {
break;
}
if (bSound) {
sndMissile.start();
}
nMissiles = nMissiles - 1;
updateTankB();
aListPowerUps.splice(oPowerUp.powerUpIndex, 1);
updatePowerUps(false, true);
if (!(bHelp && (mcHelpWinB._visible == true))) {
break;
}
mcHelpWinB.removeHelpWin(false);
}
}
function removePowerUp(i) {
if (bGameInPlay) {
var _local1 = aListPowerUps.length;
if (_local1 == 0) {
mcSelectBox._visible = true;
mcSelectBox._y = aSelectPos[0];
}
if (_local1 < 3) {
aListPowerUps[_local1] = addPowerUp(aAlienAnimations[i]._x, aAlienAnimations[i]._y);
if ((bHelp && (mcHelpWinA.bShown == false)) && (aListPowerUps.length > 1)) {
mcHelpWinA.bShown = true;
pauseGame(false);
bGameKeys = false;
mcStoryScreen._visible = true;
mcHelpWinA.helpWinKey.text = sWinKey2;
mcHelpWinA._visible = true;
mcHelpWinA._x = 640;
if (aListPowerUps.length > 2) {
mcHelpWinA._y = 500 - (mcHelpWinA._height / 2);
} else {
mcHelpWinA._y = 550 - (mcHelpWinA._height / 2);
}
mcHelpWinD._visible = true;
mcHelpWinD._x = Stage.width / 2;
mcHelpWinD._y = 250;
nHelpAIntervalID = setInterval(clearHelpWin, 10000, 0);
}
if ((aListPowerUps[_local1] == 4) && (nMissiles < 2)) {
nMissiles = nMissiles + 1;
switch (nSelectedUnit) {
case 0 :
updateGunBase();
break;
case 1 :
updateTankA();
break;
case 2 :
updateTankB();
}
}
updatePowerUps(true, true);
}
}
}
function addPowerUp(xPos, yPos) {
var _local1 = null;
var _local4 = Math.ceil(Math.random() * 10);
switch (_local4) {
case 1 :
case 2 :
aPowerUpAnimations[0]._x = xPos;
aPowerUpAnimations[0]._y = yPos;
aPowerUpAnimations[0]._visible = true;
aPowerUpAnimations[0].gotoAndPlay(1);
_local1 = 0;
break;
case 3 :
aPowerUpAnimations[1]._x = xPos;
aPowerUpAnimations[1]._y = yPos;
aPowerUpAnimations[1]._visible = true;
aPowerUpAnimations[1].gotoAndPlay(1);
_local1 = 1;
break;
case 4 :
aPowerUpAnimations[2]._x = xPos;
aPowerUpAnimations[2]._y = yPos;
aPowerUpAnimations[2]._visible = true;
aPowerUpAnimations[2].gotoAndPlay(1);
_local1 = 2;
break;
case 5 :
case 6 :
case 7 :
aPowerUpAnimations[3]._x = xPos;
aPowerUpAnimations[3]._y = yPos;
aPowerUpAnimations[3]._visible = true;
aPowerUpAnimations[3].gotoAndPlay(1);
_local1 = 3;
break;
case 8 :
case 9 :
case 10 :
if (nMissiles < 2) {
aPowerUpAnimations[4]._x = xPos;
aPowerUpAnimations[4]._y = yPos;
aPowerUpAnimations[4]._visible = true;
aPowerUpAnimations[4].gotoAndPlay(1);
_local1 = 4;
} else {
aPowerUpAnimations[3]._x = xPos;
aPowerUpAnimations[3]._y = yPos;
aPowerUpAnimations[3]._visible = true;
aPowerUpAnimations[3].gotoAndPlay(1);
_local1 = 3;
}
}
return(_local1);
}
function addAlienSquid() {
var _local4 = null;
var _local2 = null;
var _local3 = null;
var _local1 = {x:0, y:0};
if (aSquidTargets.length > 1) {
_local4 = Math.ceil(Math.random() * aSquidTargets.length) - 1;
} else {
_local4 = 0;
}
if (aSquidTargets.length >= 1) {
_local2 = aSquidTargets[_local4];
} else {
return(false);
}
switch (nGameLocation) {
case 0 :
switch (_local2) {
case 7 :
_local3 = 0;
break;
case 10 :
_local3 = 1;
break;
case 20 :
_local3 = 2;
break;
case 24 :
_local3 = 3;
}
_local1.x = (aBuildings[_local2]._x - (squidRange / 2)) + (Math.random() * squidRange);
_local1.y = aBuildings[_local2]._y - ((Math.random() * (squidRange / 2)) + 100);
mcCity.localToGlobal(_local1);
break;
case 2 :
switch (_local2) {
case 5 :
_local3 = 0;
break;
case 8 :
_local3 = 1;
break;
case 16 :
_local3 = 2;
}
_local1.x = (aPortBuildings[_local2]._x - (squidRange / 2)) + (Math.random() * squidRange);
_local1.y = aPortBuildings[_local2]._y - ((Math.random() * (squidRange / 2)) + 100);
mcSpacePort.localToGlobal(_local1);
break;
default :
return(false);
}
var _local5 = false;
_local5 = addAlien(0, 0, 0, 0, _local1.x, _local1.y);
if (_local5) {
switch (nGameLocation) {
case 0 :
_local1.x = aBuildings[_local2]._x;
_local1.y = aBuildings[_local2]._y;
mcCity.localToGlobal(_local1);
break;
case 2 :
_local1.x = aPortBuildings[_local2]._x;
_local1.y = aPortBuildings[_local2]._y;
mcSpacePort.localToGlobal(_local1);
}
aAliens[groupRef].tx = _local1.x;
aAliens[groupRef].ty = _local1.y;
aAliens[groupRef].nTarget = _local2;
aAliens[groupRef].aTarget = _local3;
aAliens[groupRef].bSucking = false;
return(true);
}
return(false);
}
function addAlienSpitter(nOrbit, nColumn, nDirection) {
var _local7 = 3;
var _local3 = null;
var _local5 = null;
switch (nColumn) {
case 1 :
_local3 = -89.97;
break;
case 2 :
_local3 = -89.76;
break;
case 3 :
_local3 = -89.54;
break;
case 4 :
_local3 = -89.32;
break;
case 5 :
_local3 = -89.1;
}
switch (nOrbit) {
case 1 :
_local5 = 635;
break;
case 2 :
_local5 = 670;
break;
case 3 :
_local5 = 705;
break;
case 4 :
_local5 = 740;
break;
case 5 :
_local5 = 775;
}
var _local2 = new Array();
var _local4 = false;
var _local1 = 0;
while (_local1 < _local7) {
_local4 = addAlien(1, _local3, _local5, nDirection, -1000, -1000);
if (_local4) {
_local2.push(groupRef);
} else {
break;
}
if (nDirection == 1) {
_local3 = _local3 + 0.03;
} else {
_local3 = _local3 - 0.03;
}
_local1++;
}
if (_local2.length < _local7) {
_local1 = 0;
while (_local1 < _local2.length) {
aAliens[_local2[_local1]].removeAlien();
_local1++;
}
return(false);
}
aAliens[_local2[0]].groupA = _local2[1];
aAliens[_local2[0]].groupB = _local2[2];
aAliens[_local2[1]].groupA = _local2[0];
aAliens[_local2[1]].groupB = _local2[2];
aAliens[_local2[2]].groupA = _local2[0];
aAliens[_local2[2]].groupB = _local2[1];
return(true);
}
function addAlienMine(nDirection, yOffset, bPowerUp) {
var _local1 = (Math.random() * (Stage.width - 200)) + 100;
var _local2 = (Math.random() * (Stage.height - (400 + yOffset))) + (150 + yOffset);
if (bPowerUp) {
return(addAlien(2, 0, 0, nDirection, _local1, _local2));
}
return(addAlien(3, 0, 0, nDirection, _local1, _local2));
}
function addAlienBrain(nOrbit, nColumn, nDirection) {
var _local1 = null;
var _local2 = null;
switch (nColumn) {
case 1 :
_local1 = -89.9;
break;
case 2 :
_local1 = -89.76;
break;
case 3 :
_local1 = -89.54;
break;
case 4 :
_local1 = -89.32;
break;
case 5 :
_local1 = -89.17;
}
switch (nOrbit) {
case 1 :
_local2 = 870;
break;
case 2 :
_local2 = 905;
break;
case 3 :
_local2 = 940;
}
return(addAlien(4, _local1, _local2, nDirection, -1000, -1000));
}
function addAlienShip(nOrbit, nDirection, bElite) {
var _local1 = null;
switch (nOrbit) {
case 1 :
_local1 = 100;
break;
case 2 :
_local1 = 135;
}
if (bElite) {
if (nDirection == 1) {
return(addAlien(6, 0, _local1, nDirection, -80, -1000));
}
return(addAlien(6, 0, _local1, nDirection, Stage.width + 80, -1000));
}
if (nDirection == 1) {
return(addAlien(5, 0, _local1, nDirection, -80, -1000));
}
return(addAlien(5, 0, _local1, nDirection, Stage.width + 80, -1000));
}
function addAlien(alienType, angle, oDist, nDirection, xPos, yPos) {
var _local2 = 0;
switch (alienType) {
case 6 :
_local2 = _local2 + nShips;
case 5 :
_local2 = _local2 + nBrains;
case 4 :
_local2 = _local2 + nMines;
case 3 :
_local2 = _local2 + nPowerUps;
case 2 :
_local2 = _local2 + nSpitters;
case 1 :
_local2 = _local2 + nSquids;
case 0 :
}
var _local1 = _local2;
while (_local1 < aAliens.length) {
if (aAliens[_local1].inPool && (aAliens[_local1].alienType == alienType)) {
aAliens[_local1].inPool = false;
switch (alienType) {
case 2 :
case 3 :
aAliens[_local1].gotoAndStop(1);
break;
default :
aAliens[_local1].gotoAndPlay(1);
}
aAliens[_local1]._x = xPos;
aAliens[_local1]._y = yPos;
aAliens[_local1]._visible = true;
aAliens[_local1].filters = alienFilter;
aAliens[_local1].fadeAlien(false);
aAliens[_local1].angle = angle;
aAliens[_local1].orbitDist = oDist;
aAliens[_local1].bDirection = nDirection;
groupRef = _local1;
return(true);
}
_local1++;
}
return(false);
}
function addAlienShipEscort(xPos, yPos, bAlienFlag) {
if (bAlienFlag) {
mcBossBEscortA.inPool = false;
mcBossBEscortA.inPlay = true;
mcBossBEscortA._x = xPos;
mcBossBEscortA._y = yPos;
mcBossBEscortA._visible = true;
mcBossBEscortA.bMovement = true;
mcBossBEscortA.bAlienFlag = bAlienFlag;
mcBossBEscortA.escortGraphic.gotoAndPlay(1);
return(true);
}
mcBossBEscortB.inPool = false;
mcBossBEscortB.inPlay = true;
mcBossBEscortB._x = xPos;
mcBossBEscortB._y = yPos;
mcBossBEscortB._visible = true;
mcBossBEscortB.bMovement = true;
mcBossBEscortB.bAlienFlag = bAlienFlag;
mcBossBEscortB.escortGraphic.gotoAndPlay(1);
return(true);
}
function cityIntervalA() {
if (bGameInPlay) {
mcAPIa.clear();
mcAPIp.clear();
nEnergy = nEnergy + (1 + nPowerRegen);
if (nEnergy > 1000) {
nEnergy = 1000;
}
updateEnergy();
if (bTargetUpdate) {
mcTargetCursor._x = aAliens[nTargetLock]._x;
mcTargetCursor._y = aAliens[nTargetLock]._y;
}
if (mcHelpWinB.inPlay) {
mcHelpWinB._x = mcCursor._x - 25;
mcHelpWinB._y = mcCursor._y - (mcHelpWinB._height / 2);
}
if (mcGunBase.bMovable) {
xDist = mcCursor._x - mcGunBase._x;
yDist = mcCursor._y - mcGunBase._y;
nRadians = Math.atan2(yDist, xDist);
mcGunBase.gunTurret._rotation = ((nRadians * 180) / Math.PI) + 90;
mcGunBase.gunJoint._rotation = (((nRadians * 0.5) * 180) / Math.PI) + 10;
mcGunBase.gunTurret._x = 0;
mcGunBase.gunJoint._x = 0;
mcGunBase.gunTurret._x = mcGunBase.gunTurret._x + (xDist * 0.015);
mcGunBase.gunJoint._x = mcGunBase.gunJoint._x + (xDist * 0.01);
}
var _local1 = 0;
while (_local1 < nSquids) {
if (!aAliens[_local1].inPool) {
aAliens[_local1].update();
if (aAliens[_local1].bSucking && (aAliens[_local1].inPlay)) {
aBuildings[aAliens[_local1].nTarget].sqEnergy = aBuildings[aAliens[_local1].nTarget].sqEnergy - 0.25;
if (aBuildings[aAliens[_local1].nTarget].sqEnergy <= 0) {
aBuildings[aAliens[_local1].nTarget].sqEnergy = 0;
removeBuildingInfectA(aAliens[_local1].nTarget);
aBuildingEnergyBars[aAliens[_local1].aTarget]._visible = false;
} else {
aBuildingEnergyBars[aAliens[_local1].aTarget]._visible = true;
aBuildingEnergyBars[aAliens[_local1].aTarget].energyBar._xscale = aBuildings[aAliens[_local1].nTarget].sqEnergy;
}
}
}
_local1++;
}
while (_local1 < aAliens.length) {
if (!aAliens[_local1].inPool) {
aAliens[_local1].update(centerPoint.x, centerPoint.y);
if (aAliens[_local1].laserActive && (aAliens[_local1].inPlay)) {
if (aAliens[_local1].alienType == 6) {
if (aAliens[_local1].nTarget != null) {
if (bSound) {
sndShipLaser.start();
}
targetPoint.x = aBuildings[aAliens[_local1].nTarget]._x;
targetPoint.y = aBuildings[aAliens[_local1].nTarget]._y;
mcCity.localToGlobal(targetPoint);
aAliens[_local1].calcRotation(targetPoint.x, targetPoint.y);
alLaser.addLaser(aAliens[_local1]._x, aAliens[_local1]._y, aAliens[_local1].radians, aAliens[_local1].lColor, aAliens[_local1].lLen, aAliens[_local1].lVel, aAliens[_local1].lWid);
}
} else {
if (bSound) {
sndSpitterLaser.start();
}
alLaser.addLaser(aAliens[_local1]._x, aAliens[_local1]._y, aAliens[_local1].radians, aAliens[_local1].lColor, aAliens[_local1].lLen, aAliens[_local1].lVel, aAliens[_local1].lWid);
}
aAliens[_local1].laserActive = false;
}
if (aAliens[_local1].bombsActive) {
if (aAliens[_local1].alienType == 6) {
aAliens[_local1].nTarget = addAlienBomb(aAliens[_local1]._x, aAliens[_local1]._y, 1);
} else {
addAlienBomb(aAliens[_local1]._x, aAliens[_local1]._y, 1);
}
aAliens[_local1].bombsActive = false;
}
}
_local1++;
}
calcAlienBounds();
calcPlLasers();
_local1 = 0;
while (_local1 < alLaser.aNumLasers) {
alLaser.calcLaser(_local1);
mcAPIa.lineStyle(alLaser.aLaserWid[_local1], alLaser.aLaserHex[_local1], 100);
mcAPIa.moveTo(alLaser.ax1[_local1], alLaser.ay1[_local1]);
mcAPIa.lineTo(alLaser.ax2[_local1], alLaser.ay2[_local1]);
if ((alLaser.ay2[_local1] > 485) && (aLaserHit(alLaser.ax2[_local1], alLaser.ay2[_local1]))) {
alLaser.spliceLaser(_local1);
} else if (laserOut(alLaser.ax2[_local1], alLaser.ay2[_local1])) {
alLaser.spliceLaser(_local1);
}
_local1++;
}
calcScoreBoxes();
_local1 = 0;
while (_local1 < nAlienBombs) {
if (aAlienBombs[_local1].inPlay) {
aAlienBombs[_local1].update(centerPoint.x, centerPoint.y);
if (aAlienBombs[_local1]._y >= aAlienBombs[_local1].targetY) {
if (aBuildings[aAlienBombs[_local1].targetI].inPlay) {
aBuildings[aAlienBombs[_local1].targetI].energy = aBuildings[aAlienBombs[_local1].targetI].energy - 25;
var _local2 = {x:0, y:0};
_local2.x = aAlienBombs[_local1]._x;
_local2.y = aAlienBombs[_local1]._y - 5;
addBombAnimation(_local2.x, _local2.y, 50);
switch (aAlienBombs[_local1].targetI) {
case 7 :
mcAntenna1._visible = false;
removeSquid(7);
aBuildings[aAlienBombs[_local1].targetI].sqEnergy = 100;
aBuildingEnergyBars[0]._visible = false;
break;
case 10 :
mcAntenna2._visible = false;
removeSquid(10);
aBuildings[aAlienBombs[_local1].targetI].sqEnergy = 100;
aBuildingEnergyBars[1]._visible = false;
break;
case 20 :
mcAntenna3._visible = false;
removeSquid(20);
aBuildings[aAlienBombs[_local1].targetI].sqEnergy = 100;
aBuildingEnergyBars[2]._visible = false;
break;
case 24 :
mcAntenna4._visible = false;
removeSquid(24);
aBuildings[aAlienBombs[_local1].targetI].sqEnergy = 100;
aBuildingEnergyBars[3]._visible = false;
}
if (aBuildings[aAlienBombs[_local1].targetI].energy <= 0) {
removeBuilding(aAlienBombs[_local1].targetI);
} else {
aBuildings[aAlienBombs[_local1].targetI].globalToLocal(_local2);
aListBuildingMasks.push(aBuildings[aAlienBombs[_local1].targetI].attachMovie("smallMask", "smallMask", aBuildings[aAlienBombs[_local1].targetI].getNextHighestDepth(), {_x:_local2.x, _y:_local2.y, nIndex:aAlienBombs[_local1].targetI, blendMode:"erase"}));
if (aBuildings[aAlienBombs[_local1].targetI].bMask) {
if (aBuildings[aAlienBombs[_local1].targetI].bDamage == false) {
aBuildings[aAlienBombs[_local1].targetI].damageMask._visible = true;
animateBuildingDamage(aAlienBombs[_local1].targetI);
aBuildings[aAlienBombs[_local1].targetI].bDamage = true;
}
}
}
removeAlienBomb(_local1, aAlienBombs[_local1]._x, aAlienBombs[_local1]._y, false);
} else if (aAlienBombs[_local1].distance < 495) {
removeAlienBomb(_local1, aAlienBombs[_local1]._x, aAlienBombs[_local1]._y, false);
}
}
}
_local1++;
}
calcBombs();
calcMissiles();
}
}
function cityIntervalB() {
if (bGameInPlay) {
mcAPIa.clear();
mcAPIp.clear();
if (bTargetUpdate) {
mcTargetCursor._x = aAliens[nTargetLock]._x;
mcTargetCursor._y = aAliens[nTargetLock]._y;
}
if (mcHelpWinB.inPlay) {
mcHelpWinB._x = mcCursor._x - 25;
mcHelpWinB._y = mcCursor._y - (mcHelpWinB._height / 2);
}
if (Key.isDown(nkey4)) {
if (nSelectedUnit == 1) {
if (bTankAMovement == false) {
mcTankA.moveLeft();
if (mcTankA.bAnimate) {
mcTankA.wheelA._rotation = mcTankA.wheelA._rotation - 2;
mcTankA.wheelB._rotation = mcTankA.wheelB._rotation - 2;
mcTankA.wheelC._rotation = mcTankA.wheelC._rotation - 2;
mcTankA.tankBase._y = mcTankA.origBasePos - (Math.sin(mcTankA.sinAngle) * mcTankA.bounce);
scaleTanks();
updateUnitSelection();
}
}
} else if (nSelectedUnit == 2) {
if (bTankBMovement == false) {
mcTankB.moveLeft();
if (mcTankB.bAnimate) {
mcTankB.wheelA._rotation = mcTankB.wheelA._rotation - 2;
mcTankB.wheelB._rotation = mcTankB.wheelB._rotation - 2;
mcTankB.wheelC._rotation = mcTankB.wheelC._rotation - 2;
mcTankB.tankBase._y = mcTankB.origBasePos - (Math.sin(mcTankB.sinAngle) * mcTankB.bounce);
scaleTanks();
updateUnitSelection();
}
}
}
} else if (Key.isDown(nkey5)) {
if (nSelectedUnit == 1) {
if (bTankAMovement == false) {
mcTankA.moveRight();
if (mcTankA.bAnimate) {
mcTankA.wheelA._rotation = mcTankA.wheelA._rotation + 2;
mcTankA.wheelB._rotation = mcTankA.wheelB._rotation + 2;
mcTankA.wheelC._rotation = mcTankA.wheelC._rotation + 2;
mcTankA.tankBase._y = mcTankA.origBasePos - (Math.sin(mcTankA.sinAngle) * mcTankA.bounce);
scaleTanks();
updateUnitSelection();
}
}
} else if (nSelectedUnit == 2) {
if (bTankBMovement == false) {
mcTankB.moveRight();
if (mcTankB.bAnimate) {
mcTankB.wheelA._rotation = mcTankB.wheelA._rotation + 2;
mcTankB.wheelB._rotation = mcTankB.wheelB._rotation + 2;
mcTankB.wheelC._rotation = mcTankB.wheelC._rotation + 2;
mcTankB.tankBase._y = mcTankB.origBasePos - (Math.sin(mcTankB.sinAngle) * mcTankB.bounce);
scaleTanks();
updateUnitSelection();
}
}
}
}
if (mcTankA.bMovable) {
xDist = mcCursor._x - mcTankA._x;
yDist = mcCursor._y - mcTankA._y;
nRadians = Math.atan2(yDist, xDist);
bRadiansUpdated = true;
mcTankA.tankTurret._rotation = ((nRadians * 180) / Math.PI) + (90 - mcTankA._rotation);
mcTankA.tankJoint._rotation = (((nRadians * 0.5) * 180) / Math.PI) + (10 - mcTankA._rotation);
mcTankA.tankTurret._x = mcTankA.origTurretPos;
mcTankA.tankJoint._x = mcTankA.origJointPos;
mcTankA.tankTurret._x = mcTankA.tankTurret._x + (xDist * 0.01);
mcTankA.tankJoint._x = mcTankA.tankJoint._x + (xDist * 0.005);
} else if (mcTankB.bMovable) {
xDist = mcCursor._x - mcTankB._x;
yDist = mcCursor._y - mcTankB._y;
nRadians = Math.atan2(yDist, xDist);
bRadiansUpdated = true;
mcTankB.tankTurret._rotation = ((nRadians * 180) / Math.PI) + (90 - mcTankB._rotation);
mcTankB.tankJoint._rotation = (((nRadians * 0.5) * 180) / Math.PI) + (10 - mcTankB._rotation);
mcTankB.tankTurret._x = mcTankB.origTurretPos;
mcTankB.tankJoint._x = mcTankB.origJointPos;
mcTankB.tankTurret._x = mcTankB.tankTurret._x + (xDist * 0.01);
mcTankB.tankJoint._x = mcTankB.tankJoint._x + (xDist * 0.005);
}
if (mcBossB.inPlay) {
mcBossB.updateA();
if (mcBossB._x < (-(mcBossB._width / 2))) {
sndBossBHover.stop();
mcBossB._visible = false;
mcBossB.inPlay = false;
}
}
var _local1 = nSquids;
while (_local1 < aAliens.length) {
if (!aAliens[_local1].inPool) {
aAliens[_local1].update(centerPoint.x, centerPoint.y);
if (aAliens[_local1].laserActive && (aAliens[_local1].inPlay)) {
if (aAliens[_local1].alienType == 6) {
if (aAliens[_local1].nTarget != null) {
if (bSound) {
sndShipLaser.start();
}
targetPoint.x = aBuildings[aAliens[_local1].nTarget]._x;
targetPoint.y = aBuildings[aAliens[_local1].nTarget]._y;
mcCity.localToGlobal(targetPoint);
aAliens[_local1].calcRotation(targetPoint.x, targetPoint.y);
alLaser.addLaser(aAliens[_local1]._x, aAliens[_local1]._y, aAliens[_local1].radians, aAliens[_local1].lColor, aAliens[_local1].lLen, aAliens[_local1].lVel, aAliens[_local1].lWid);
}
} else {
if (bSound) {
sndSpitterLaser.start();
}
alLaser.addLaser(aAliens[_local1]._x, aAliens[_local1]._y, aAliens[_local1].radians, aAliens[_local1].lColor, aAliens[_local1].lLen, aAliens[_local1].lVel, aAliens[_local1].lWid);
}
aAliens[_local1].laserActive = false;
}
if (aAliens[_local1].bombsActive) {
if (aAliens[_local1].alienType == 6) {
aAliens[_local1].nTarget = addAlienBomb(aAliens[_local1]._x, aAliens[_local1]._y, 1);
} else {
addAlienBomb(aAliens[_local1]._x, aAliens[_local1]._y, 1);
}
aAliens[_local1].bombsActive = false;
}
}
_local1++;
}
calcAlienBounds();
calcPlLasersBossB0();
_local1 = 0;
while (_local1 < alLaser.aNumLasers) {
alLaser.calcLaser(_local1);
mcAPIa.lineStyle(alLaser.aLaserWid[_local1], alLaser.aLaserHex[_local1], 100);
mcAPIa.moveTo(alLaser.ax1[_local1], alLaser.ay1[_local1]);
mcAPIa.lineTo(alLaser.ax2[_local1], alLaser.ay2[_local1]);
if ((alLaser.ay2[_local1] > 485) && (aLaserHit(alLaser.ax2[_local1], alLaser.ay2[_local1]))) {
alLaser.spliceLaser(_local1);
} else if (laserOut(alLaser.ax2[_local1], alLaser.ay2[_local1])) {
alLaser.spliceLaser(_local1);
}
_local1++;
}
calcScoreBoxes();
_local1 = 0;
while (_local1 < nAlienBombs) {
if (aAlienBombs[_local1].inPlay) {
aAlienBombs[_local1].update(centerPoint.x, centerPoint.y);
if (aAlienBombs[_local1]._y >= aAlienBombs[_local1].targetY) {
if (aBuildings[aAlienBombs[_local1].targetI].inPlay) {
aBuildings[aAlienBombs[_local1].targetI].energy = aBuildings[aAlienBombs[_local1].targetI].energy - 25;
var _local2 = {x:0, y:0};
_local2.x = aAlienBombs[_local1]._x;
_local2.y = aAlienBombs[_local1]._y - 5;
addBombAnimation(_local2.x, _local2.y, 50);
switch (aAlienBombs[_local1].targetI) {
case 7 :
mcAntenna1._visible = false;
removeSquid(7);
aBuildings[aAlienBombs[_local1].targetI].sqEnergy = 100;
aBuildingEnergyBars[0]._visible = false;
break;
case 10 :
mcAntenna2._visible = false;
removeSquid(10);
aBuildings[aAlienBombs[_local1].targetI].sqEnergy = 100;
aBuildingEnergyBars[1]._visible = false;
break;
case 20 :
mcAntenna3._visible = false;
removeSquid(20);
aBuildings[aAlienBombs[_local1].targetI].sqEnergy = 100;
aBuildingEnergyBars[2]._visible = false;
break;
case 24 :
mcAntenna4._visible = false;
removeSquid(24);
aBuildings[aAlienBombs[_local1].targetI].sqEnergy = 100;
aBuildingEnergyBars[3]._visible = false;
}
if (aBuildings[aAlienBombs[_local1].targetI].energy <= 0) {
removeBuilding(aAlienBombs[_local1].targetI);
} else {
aBuildings[aAlienBombs[_local1].targetI].globalToLocal(_local2);
aListBuildingMasks.push(aBuildings[aAlienBombs[_local1].targetI].attachMovie("smallMask", "smallMask", aBuildings[aAlienBombs[_local1].targetI].getNextHighestDepth(), {_x:_local2.x, _y:_local2.y, nIndex:aAlienBombs[_local1].targetI, blendMode:"erase"}));
if (aBuildings[aAlienBombs[_local1].targetI].bMask) {
if (aBuildings[aAlienBombs[_local1].targetI].bDamage == false) {
aBuildings[aAlienBombs[_local1].targetI].damageMask._visible = true;
animateBuildingDamage(aAlienBombs[_local1].targetI);
aBuildings[aAlienBombs[_local1].targetI].bDamage = true;
}
}
}
removeAlienBomb(_local1, aAlienBombs[_local1]._x, aAlienBombs[_local1]._y, false);
} else if (aAlienBombs[_local1].distance < 495) {
removeAlienBomb(_local1, aAlienBombs[_local1]._x, aAlienBombs[_local1]._y, false);
}
}
}
_local1++;
}
calcBombs();
calcMissiles();
calcBossParticles();
}
}
function agriDomeInterval() {
if (bGameInPlay) {
mcAPIa.clear();
mcAPIp.clear();
if (bTargetUpdate) {
mcTargetCursor._x = aAliens[nTargetLock]._x;
mcTargetCursor._y = aAliens[nTargetLock]._y;
}
if (mcHelpWinB.inPlay) {
mcHelpWinB._x = mcCursor._x - 25;
mcHelpWinB._y = mcCursor._y - (mcHelpWinB._height / 2);
}
if (Key.isDown(nkey4)) {
if (nSelectedUnit == 1) {
if (bTankAMovement == false) {
mcTankA.moveLeft();
if (mcTankA.bAnimate) {
mcTankA.wheelA._rotation = mcTankA.wheelA._rotation - 2;
mcTankA.wheelB._rotation = mcTankA.wheelB._rotation - 2;
mcTankA.wheelC._rotation = mcTankA.wheelC._rotation - 2;
mcTankA.tankBase._y = mcTankA.origBasePos - (Math.sin(mcTankA.sinAngle) * mcTankA.bounce);
scaleTanks();
updateUnitSelection();
}
}
} else if (nSelectedUnit == 2) {
if (bTankBMovement == false) {
mcTankB.moveLeft();
if (mcTankB.bAnimate) {
mcTankB.wheelA._rotation = mcTankB.wheelA._rotation - 2;
mcTankB.wheelB._rotation = mcTankB.wheelB._rotation - 2;
mcTankB.wheelC._rotation = mcTankB.wheelC._rotation - 2;
mcTankB.tankBase._y = mcTankB.origBasePos - (Math.sin(mcTankB.sinAngle) * mcTankB.bounce);
scaleTanks();
updateUnitSelection();
}
}
}
} else if (Key.isDown(nkey5)) {
if (nSelectedUnit == 1) {
if (bTankAMovement == false) {
mcTankA.moveRight();
if (mcTankA.bAnimate) {
mcTankA.wheelA._rotation = mcTankA.wheelA._rotation + 2;
mcTankA.wheelB._rotation = mcTankA.wheelB._rotation + 2;
mcTankA.wheelC._rotation = mcTankA.wheelC._rotation + 2;
mcTankA.tankBase._y = mcTankA.origBasePos - (Math.sin(mcTankA.sinAngle) * mcTankA.bounce);
scaleTanks();
updateUnitSelection();
}
}
} else if (nSelectedUnit == 2) {
if (bTankBMovement == false) {
mcTankB.moveRight();
if (mcTankB.bAnimate) {
mcTankB.wheelA._rotation = mcTankB.wheelA._rotation + 2;
mcTankB.wheelB._rotation = mcTankB.wheelB._rotation + 2;
mcTankB.wheelC._rotation = mcTankB.wheelC._rotation + 2;
mcTankB.tankBase._y = mcTankB.origBasePos - (Math.sin(mcTankB.sinAngle) * mcTankB.bounce);
scaleTanks();
updateUnitSelection();
}
}
}
}
if (mcTankA.bMovable) {
xDist = mcCursor._x - mcTankA._x;
yDist = mcCursor._y - mcTankA._y;
nRadians = Math.atan2(yDist, xDist);
bRadiansUpdated = true;
mcTankA.tankTurret._rotation = ((nRadians * 180) / Math.PI) + (90 - mcTankA._rotation);
mcTankA.tankJoint._rotation = (((nRadians * 0.5) * 180) / Math.PI) + (10 - mcTankA._rotation);
mcTankA.tankTurret._x = mcTankA.origTurretPos;
mcTankA.tankJoint._x = mcTankA.origJointPos;
mcTankA.tankTurret._x = mcTankA.tankTurret._x + (xDist * 0.01);
mcTankA.tankJoint._x = mcTankA.tankJoint._x + (xDist * 0.005);
} else if (mcTankB.bMovable) {
xDist = mcCursor._x - mcTankB._x;
yDist = mcCursor._y - mcTankB._y;
nRadians = Math.atan2(yDist, xDist);
bRadiansUpdated = true;
mcTankB.tankTurret._rotation = ((nRadians * 180) / Math.PI) + (90 - mcTankB._rotation);
mcTankB.tankJoint._rotation = (((nRadians * 0.5) * 180) / Math.PI) + (10 - mcTankB._rotation);
mcTankB.tankTurret._x = mcTankB.origTurretPos;
mcTankB.tankJoint._x = mcTankB.origJointPos;
mcTankB.tankTurret._x = mcTankB.tankTurret._x + (xDist * 0.01);
mcTankB.tankJoint._x = mcTankB.tankJoint._x + (xDist * 0.005);
}
var _local1 = nSquids;
while (_local1 < aAliens.length) {
if (!aAliens[_local1].inPool) {
aAliens[_local1].update(centerPoint.x, centerPoint.y);
if (aAliens[_local1].laserActive && (aAliens[_local1].inPlay)) {
if (aAliens[_local1].alienType == 6) {
if (aAliens[_local1].nTarget != null) {
if (bSound) {
sndShipLaser.start();
}
targetPoint.x = aDomeBuildings[aAliens[_local1].nTarget]._x;
targetPoint.y = aDomeBuildings[aAliens[_local1].nTarget]._y;
mcAgriDome.localToGlobal(targetPoint);
aAliens[_local1].calcRotation(targetPoint.x, targetPoint.y);
alLaser.addLaser(aAliens[_local1]._x, aAliens[_local1]._y, aAliens[_local1].radians, aAliens[_local1].lColor, aAliens[_local1].lLen, aAliens[_local1].lVel, aAliens[_local1].lWid);
}
} else {
if (bSound) {
sndSpitterLaser.start();
}
alLaser.addLaser(aAliens[_local1]._x, aAliens[_local1]._y, aAliens[_local1].radians, aAliens[_local1].lColor, aAliens[_local1].lLen, aAliens[_local1].lVel, aAliens[_local1].lWid);
}
aAliens[_local1].laserActive = false;
}
if (aAliens[_local1].bombsActive) {
if (aAliens[_local1].alienType == 6) {
aAliens[_local1].nTarget = addAlienBomb(aAliens[_local1]._x, aAliens[_local1]._y, 2);
} else {
addAlienBomb(aAliens[_local1]._x, aAliens[_local1]._y, 2);
}
aAliens[_local1].bombsActive = false;
}
}
_local1++;
}
calcAlienBounds();
calcPlLasers();
_local1 = 0;
while (_local1 < alLaser.aNumLasers) {
alLaser.calcLaser(_local1);
mcAPIa.lineStyle(alLaser.aLaserWid[_local1], alLaser.aLaserHex[_local1], 100);
mcAPIa.moveTo(alLaser.ax1[_local1], alLaser.ay1[_local1]);
mcAPIa.lineTo(alLaser.ax2[_local1], alLaser.ay2[_local1]);
if ((alLaser.ay2[_local1] > 485) && (aLaserHitA(alLaser.ax2[_local1], alLaser.ay2[_local1]))) {
alLaser.spliceLaser(_local1);
} else if (laserOut(alLaser.ax2[_local1], alLaser.ay2[_local1])) {
alLaser.spliceLaser(_local1);
}
_local1++;
}
calcScoreBoxes();
_local1 = 0;
while (_local1 < nAlienBombs) {
if (aAlienBombs[_local1].inPlay) {
aAlienBombs[_local1].update(centerPoint.x, centerPoint.y);
if (aAlienBombs[_local1]._y >= aAlienBombs[_local1].targetY) {
if (aDomeBuildings[aAlienBombs[_local1].targetI].inPlay) {
aDomeBuildings[aAlienBombs[_local1].targetI].energy = aDomeBuildings[aAlienBombs[_local1].targetI].energy - 25;
var _local2 = {x:0, y:0};
_local2.x = aAlienBombs[_local1]._x;
_local2.y = aAlienBombs[_local1]._y - 5;
switch (aAlienBombs[_local1].targetI) {
case 0 :
mcAntenna5._visible = false;
_local2.y = _local2.y - 10;
break;
case 2 :
mcAntenna6._visible = false;
_local2.y = _local2.y - 10;
break;
case 6 :
mcAntenna7._visible = false;
_local2.y = _local2.y - 10;
break;
case 8 :
mcAntenna8._visible = false;
_local2.y = _local2.y - 10;
break;
case 3 :
_local2.y = _local2.y + 10;
}
addBombAnimation(_local2.x, _local2.y, 50);
if (aDomeBuildings[aAlienBombs[_local1].targetI].energy <= 0) {
removeBuildingA(aAlienBombs[_local1].targetI);
} else {
aDomeBuildings[aAlienBombs[_local1].targetI].globalToLocal(_local2);
aListDomeBuildingMasks.push(aDomeBuildings[aAlienBombs[_local1].targetI].attachMovie("smallMask", "smallMask", aDomeBuildings[aAlienBombs[_local1].targetI].getNextHighestDepth(), {_x:_local2.x, _y:_local2.y, nIndex:aAlienBombs[_local1].targetI, blendMode:"erase"}));
if (aDomeBuildings[aAlienBombs[_local1].targetI].bMask) {
if (aDomeBuildings[aAlienBombs[_local1].targetI].bDamage == false) {
aDomeBuildings[aAlienBombs[_local1].targetI].damageMask._visible = true;
animateBuildingDamageA(aAlienBombs[_local1].targetI);
aDomeBuildings[aAlienBombs[_local1].targetI].bDamage = true;
}
}
}
removeAlienBomb(_local1, aAlienBombs[_local1]._x, aAlienBombs[_local1]._y, false);
} else if (aAlienBombs[_local1].distance < 495) {
removeAlienBomb(_local1, aAlienBombs[_local1]._x, aAlienBombs[_local1]._y, false);
}
}
}
_local1++;
}
calcBombs();
calcMissiles();
}
}
function spacePortInterval() {
if (bGameInPlay) {
mcAPIa.clear();
mcAPIp.clear();
if (bTargetUpdate) {
mcTargetCursor._x = aAliens[nTargetLock]._x;
mcTargetCursor._y = aAliens[nTargetLock]._y;
}
if (mcHelpWinB.inPlay) {
mcHelpWinB._x = mcCursor._x - 25;
mcHelpWinB._y = mcCursor._y - (mcHelpWinB._height / 2);
}
if (Key.isDown(nkey4)) {
if (nSelectedUnit == 1) {
if (bTankAMovement == false) {
mcTankA.moveLeft();
if (mcTankA.bAnimate) {
mcTankA.wheelA._rotation = mcTankA.wheelA._rotation - 2;
mcTankA.wheelB._rotation = mcTankA.wheelB._rotation - 2;
mcTankA.wheelC._rotation = mcTankA.wheelC._rotation - 2;
mcTankA.tankBase._y = mcTankA.origBasePos - (Math.sin(mcTankA.sinAngle) * mcTankA.bounce);
scaleTanks();
updateUnitSelection();
}
}
} else if (nSelectedUnit == 2) {
if (bTankBMovement == false) {
mcTankB.moveLeft();
if (mcTankB.bAnimate) {
mcTankB.wheelA._rotation = mcTankB.wheelA._rotation - 2;
mcTankB.wheelB._rotation = mcTankB.wheelB._rotation - 2;
mcTankB.wheelC._rotation = mcTankB.wheelC._rotation - 2;
mcTankB.tankBase._y = mcTankB.origBasePos - (Math.sin(mcTankB.sinAngle) * mcTankB.bounce);
scaleTanks();
updateUnitSelection();
}
}
}
} else if (Key.isDown(nkey5)) {
if (nSelectedUnit == 1) {
if (bTankAMovement == false) {
mcTankA.moveRight();
if (mcTankA.bAnimate) {
mcTankA.wheelA._rotation = mcTankA.wheelA._rotation + 2;
mcTankA.wheelB._rotation = mcTankA.wheelB._rotation + 2;
mcTankA.wheelC._rotation = mcTankA.wheelC._rotation + 2;
mcTankA.tankBase._y = mcTankA.origBasePos - (Math.sin(mcTankA.sinAngle) * mcTankA.bounce);
scaleTanks();
updateUnitSelection();
}
}
} else if (nSelectedUnit == 2) {
if (bTankBMovement == false) {
mcTankB.moveRight();
if (mcTankB.bAnimate) {
mcTankB.wheelA._rotation = mcTankB.wheelA._rotation + 2;
mcTankB.wheelB._rotation = mcTankB.wheelB._rotation + 2;
mcTankB.wheelC._rotation = mcTankB.wheelC._rotation + 2;
mcTankB.tankBase._y = mcTankB.origBasePos - (Math.sin(mcTankB.sinAngle) * mcTankB.bounce);
scaleTanks();
updateUnitSelection();
}
}
}
}
if (mcTankA.bMovable) {
xDist = mcCursor._x - mcTankA._x;
yDist = mcCursor._y - mcTankA._y;
nRadians = Math.atan2(yDist, xDist);
bRadiansUpdated = true;
mcTankA.tankTurret._rotation = ((nRadians * 180) / Math.PI) + (90 - mcTankA._rotation);
mcTankA.tankJoint._rotation = (((nRadians * 0.5) * 180) / Math.PI) + (10 - mcTankA._rotation);
mcTankA.tankTurret._x = mcTankA.origTurretPos;
mcTankA.tankJoint._x = mcTankA.origJointPos;
mcTankA.tankTurret._x = mcTankA.tankTurret._x + (xDist * 0.01);
mcTankA.tankJoint._x = mcTankA.tankJoint._x + (xDist * 0.005);
} else if (mcTankB.bMovable) {
xDist = mcCursor._x - mcTankB._x;
yDist = mcCursor._y - mcTankB._y;
nRadians = Math.atan2(yDist, xDist);
bRadiansUpdated = true;
mcTankB.tankTurret._rotation = ((nRadians * 180) / Math.PI) + (90 - mcTankB._rotation);
mcTankB.tankJoint._rotation = (((nRadians * 0.5) * 180) / Math.PI) + (10 - mcTankB._rotation);
mcTankB.tankTurret._x = mcTankB.origTurretPos;
mcTankB.tankJoint._x = mcTankB.origJointPos;
mcTankB.tankTurret._x = mcTankB.tankTurret._x + (xDist * 0.01);
mcTankB.tankJoint._x = mcTankB.tankJoint._x + (xDist * 0.005);
}
var _local1 = 0;
while (_local1 < nSquids) {
if (!aAliens[_local1].inPool) {
aAliens[_local1].update();
if (aAliens[_local1].bSucking && (aAliens[_local1].inPlay)) {
aPortBuildings[aAliens[_local1].nTarget].sqEnergy = aPortBuildings[aAliens[_local1].nTarget].sqEnergy - 0.25;
if (aPortBuildings[aAliens[_local1].nTarget].sqEnergy <= 0) {
aPortBuildings[aAliens[_local1].nTarget].sqEnergy = 0;
removeBuildingInfectB(aAliens[_local1].nTarget);
aBuildingEnergyBars[aAliens[_local1].aTarget]._visible = false;
} else {
aBuildingEnergyBars[aAliens[_local1].aTarget]._visible = true;
aBuildingEnergyBars[aAliens[_local1].aTarget].energyBar._xscale = aPortBuildings[aAliens[_local1].nTarget].sqEnergy;
}
}
}
_local1++;
}
while (_local1 < aAliens.length) {
if (!aAliens[_local1].inPool) {
aAliens[_local1].update(centerPoint.x, centerPoint.y);
if (aAliens[_local1].laserActive && (aAliens[_local1].inPlay)) {
if (aAliens[_local1].alienType == 6) {
if (aAliens[_local1].nTarget != null) {
if (bSound) {
sndShipLaser.start();
}
targetPoint.x = aPortBuildings[aAliens[_local1].nTarget]._x;
targetPoint.y = aPortBuildings[aAliens[_local1].nTarget]._y;
mcSpacePort.localToGlobal(targetPoint);
aAliens[_local1].calcRotation(targetPoint.x, targetPoint.y);
alLaser.addLaser(aAliens[_local1]._x, aAliens[_local1]._y, aAliens[_local1].radians, aAliens[_local1].lColor, aAliens[_local1].lLen, aAliens[_local1].lVel, aAliens[_local1].lWid);
}
} else {
if (bSound) {
sndSpitterLaser.start();
}
alLaser.addLaser(aAliens[_local1]._x, aAliens[_local1]._y, aAliens[_local1].radians, aAliens[_local1].lColor, aAliens[_local1].lLen, aAliens[_local1].lVel, aAliens[_local1].lWid);
}
aAliens[_local1].laserActive = false;
}
if (aAliens[_local1].bombsActive) {
if (aAliens[_local1].alienType == 6) {
aAliens[_local1].nTarget = addAlienBomb(aAliens[_local1]._x, aAliens[_local1]._y, 3);
} else {
addAlienBomb(aAliens[_local1]._x, aAliens[_local1]._y, 3);
}
aAliens[_local1].bombsActive = false;
}
}
_local1++;
}
calcAlienBounds();
calcPlLasers();
_local1 = 0;
while (_local1 < alLaser.aNumLasers) {
alLaser.calcLaser(_local1);
mcAPIa.lineStyle(alLaser.aLaserWid[_local1], alLaser.aLaserHex[_local1], 100);
mcAPIa.moveTo(alLaser.ax1[_local1], alLaser.ay1[_local1]);
mcAPIa.lineTo(alLaser.ax2[_local1], alLaser.ay2[_local1]);
if ((alLaser.ay2[_local1] > 455) && (aLaserHitB(alLaser.ax2[_local1], alLaser.ay2[_local1]))) {
alLaser.spliceLaser(_local1);
} else if (laserOut(alLaser.ax2[_local1], alLaser.ay2[_local1])) {
alLaser.spliceLaser(_local1);
}
_local1++;
}
calcScoreBoxes();
_local1 = 0;
while (_local1 < nAlienBombs) {
if (aAlienBombs[_local1].inPlay) {
aAlienBombs[_local1].update(centerPoint.x, centerPoint.y);
if (aAlienBombs[_local1]._y >= aAlienBombs[_local1].targetY) {
if (aPortBuildings[aAlienBombs[_local1].targetI].inPlay) {
aPortBuildings[aAlienBombs[_local1].targetI].energy = aPortBuildings[aAlienBombs[_local1].targetI].energy - 25;
var _local2 = {x:0, y:0};
_local2.x = aAlienBombs[_local1]._x;
_local2.y = aAlienBombs[_local1]._y - 5;
switch (aAlienBombs[_local1].targetI) {
case 5 :
mcAntenna9._visible = false;
removeSquid(5);
aDomeBuildings[aAlienBombs[_local1].targetI].sqEnergy = 100;
aDomeBuildingEnergyBars[0]._visible = false;
break;
case 8 :
mcAntenna10._visible = false;
removeSquid(8);
aDomeBuildings[aAlienBombs[_local1].targetI].sqEnergy = 100;
aDomeBuildingEnergyBars[1]._visible = false;
break;
case 16 :
mcAntenna11._visible = false;
removeSquid(16);
aDomeBuildings[aAlienBombs[_local1].targetI].sqEnergy = 100;
aDomeBuildingEnergyBars[2]._visible = false;
}
addBombAnimation(_local2.x, _local2.y, 50);
if (aPortBuildings[aAlienBombs[_local1].targetI].energy <= 0) {
removeBuildingB(aAlienBombs[_local1].targetI);
} else {
aPortBuildings[aAlienBombs[_local1].targetI].globalToLocal(_local2);
aListPortBuildingMasks.push(aPortBuildings[aAlienBombs[_local1].targetI].attachMovie("smallMask", "smallMask", aPortBuildings[aAlienBombs[_local1].targetI].getNextHighestDepth(), {_x:_local2.x, _y:_local2.y, nIndex:aAlienBombs[_local1].targetI, blendMode:"erase"}));
if (aPortBuildings[aAlienBombs[_local1].targetI].bMask) {
if (aPortBuildings[aAlienBombs[_local1].targetI].bDamage == false) {
aPortBuildings[aAlienBombs[_local1].targetI].damageMask._visible = true;
animateBuildingDamageB(aAlienBombs[_local1].targetI);
aPortBuildings[aAlienBombs[_local1].targetI].bDamage = true;
}
}
}
removeAlienBomb(_local1, aAlienBombs[_local1]._x, aAlienBombs[_local1]._y, false);
} else if (aAlienBombs[_local1].distance < 495) {
removeAlienBomb(_local1, aAlienBombs[_local1]._x, aAlienBombs[_local1]._y, false);
}
}
}
_local1++;
}
calcBombs();
calcMissiles();
}
}
function calcAlienBounds() {
var _local1 = 0;
while (_local1 < aAliens.length) {
if (!aAliens[_local1].inPool) {
switch (aAliens[_local1].alienType) {
case 1 :
if (aAliens[_local1]._x > (Stage.width - aAliens[_local1]._width)) {
aAliens[_local1].bDirection = 0;
if (aAliens[_local1].groupA != null) {
aAliens[aAliens[_local1].groupA].bDirection = 0;
}
if (aAliens[_local1].groupB != null) {
aAliens[aAliens[_local1].groupB].bDirection = 0;
}
} else if (aAliens[_local1]._x < aAliens[_local1]._width) {
aAliens[_local1].bDirection = 1;
if (aAliens[_local1].groupA != null) {
aAliens[aAliens[_local1].groupA].bDirection = 1;
}
if (aAliens[_local1].groupB != null) {
aAliens[aAliens[_local1].groupB].bDirection = 1;
}
}
break;
case 4 :
if (aAliens[_local1]._x > (Stage.width - aAliens[_local1]._width)) {
aAliens[_local1].bDirection = 0;
} else if (aAliens[_local1]._x < aAliens[_local1]._width) {
aAliens[_local1].bDirection = 1;
}
break;
case 2 :
case 3 :
case 5 :
if ((aAliens[_local1]._x > (Stage.width + aAliens[_local1]._width)) && (aAliens[_local1].bDirection == 1)) {
aAliens[_local1].removeAlien();
} else if ((aAliens[_local1]._x < (-aAliens[_local1]._width)) && (aAliens[_local1].bDirection == 0)) {
aAliens[_local1].removeAlien();
}
break;
case 6 :
if ((aAliens[_local1]._x > (Stage.width + aAliens[_local1]._width)) && (aAliens[_local1].bDirection == 1)) {
aAliens[_local1].nTarget = null;
aAliens[_local1].removeAlien();
} else {
if (!((aAliens[_local1]._x < (-aAliens[_local1]._width)) && (aAliens[_local1].bDirection == 0))) {
break;
}
aAliens[_local1].nTarget = null;
aAliens[_local1].removeAlien();
}
}
}
_local1++;
}
}
function calcAlienBoundsBoss() {
var _local1 = nSquids + nSpitters;
while (_local1 < (((nSquids + nSpitters) + nPowerUps) + nMines)) {
if (!aAliens[_local1].inPool) {
switch (aAliens[_local1].alienType) {
case 2 :
if ((aAliens[_local1]._x > (Stage.width + aAliens[_local1]._width)) && (aAliens[_local1].bDirection == 1)) {
aAliens[_local1].removeAlien();
nBossPowerUps = nBossPowerUps - 1;
} else if ((aAliens[_local1]._x < (-aAliens[_local1]._width)) && (aAliens[_local1].bDirection == 0)) {
aAliens[_local1].removeAlien();
nBossPowerUps = nBossPowerUps - 1;
}
break;
case 3 :
if ((aAliens[_local1]._x > (Stage.width + aAliens[_local1]._width)) && (aAliens[_local1].bDirection == 1)) {
aAliens[_local1].removeAlien();
nBossMines = nBossMines - 1;
} else {
if (!((aAliens[_local1]._x < (-aAliens[_local1]._width)) && (aAliens[_local1].bDirection == 0))) {
break;
}
aAliens[_local1].removeAlien();
nBossMines = nBossMines - 1;
}
}
}
_local1++;
}
}
function calcPlLasers() {
var _local1 = 0;
while (_local1 < plLaser.pNumLasers) {
plLaser.calcLaser(_local1);
mcAPIp.lineStyle(3, plLaser.pLaserHex, 100);
mcAPIp.moveTo(plLaser.px1[_local1], plLaser.py1[_local1]);
mcAPIp.lineTo(plLaser.px2[_local1], plLaser.py2[_local1]);
if (pLaserHit(plLaser.px2[_local1], plLaser.py2[_local1])) {
plLaser.spliceLaser(_local1);
nLasers = nLasers - 1;
} else if (laserOut(plLaser.px2[_local1], plLaser.py2[_local1])) {
plLaser.spliceLaser(_local1);
nLasers = nLasers - 1;
}
_local1++;
}
}
function calcPlLasersBossA() {
var _local1 = 0;
while (_local1 < plLaser.pNumLasers) {
plLaser.calcLaser(_local1);
mcAPIp.lineStyle(3, plLaser.pLaserHex, 100);
mcAPIp.moveTo(plLaser.px1[_local1], plLaser.py1[_local1]);
mcAPIp.lineTo(plLaser.px2[_local1], plLaser.py2[_local1]);
if (pLaserHitBossA(plLaser.px2[_local1], plLaser.py2[_local1], plLaser.pvx[_local1], plLaser.pvy[_local1])) {
plLaser.spliceLaser(_local1);
nLasers = nLasers - 1;
} else if (laserOut(plLaser.px2[_local1], plLaser.py2[_local1])) {
plLaser.spliceLaser(_local1);
nLasers = nLasers - 1;
}
_local1++;
}
}
function calcPlLasersBossB0() {
var _local1 = 0;
while (_local1 < plLaser.pNumLasers) {
plLaser.calcLaser(_local1);
mcAPIp.lineStyle(3, plLaser.pLaserHex, 100);
mcAPIp.moveTo(plLaser.px1[_local1], plLaser.py1[_local1]);
mcAPIp.lineTo(plLaser.px2[_local1], plLaser.py2[_local1]);
if (pLaserHitBossBEvent(plLaser.px2[_local1], plLaser.py2[_local1], plLaser.pvx[_local1], plLaser.pvy[_local1])) {
plLaser.spliceLaser(_local1);
nLasers = nLasers - 1;
} else if (laserOut(plLaser.px2[_local1], plLaser.py2[_local1])) {
plLaser.spliceLaser(_local1);
nLasers = nLasers - 1;
}
_local1++;
}
}
function calcPlLasersBossB1() {
var _local1 = 0;
while (_local1 < plLaser.pNumLasers) {
plLaser.calcLaser(_local1);
mcAPIp.lineStyle(3, plLaser.pLaserHex, 100);
mcAPIp.moveTo(plLaser.px1[_local1], plLaser.py1[_local1]);
mcAPIp.lineTo(plLaser.px2[_local1], plLaser.py2[_local1]);
if (pLaserHitBossB(plLaser.px2[_local1], plLaser.py2[_local1], plLaser.pvx[_local1], plLaser.pvy[_local1])) {
plLaser.spliceLaser(_local1);
nLasers = nLasers - 1;
} else if (laserOut(plLaser.px2[_local1], plLaser.py2[_local1])) {
plLaser.spliceLaser(_local1);
nLasers = nLasers - 1;
}
_local1++;
}
}
function calcAlienProjectiles() {
var _local1 = 0;
while (_local1 < nProjectiles) {
if (aAlienProjectiles[_local1].inPlay) {
aAlienProjectiles[_local1].update(centerPoint.x, centerPoint.y);
if (aAlienProjectiles[_local1]._y >= aAlienProjectiles[_local1].targetY) {
if (aAlienProjectiles[_local1].targetI != null) {
aBuildings[aAlienProjectiles[_local1].targetI].energy = aBuildings[aAlienProjectiles[_local1].targetI].energy - 25;
var _local2 = {x:0, y:0};
_local2.x = aAlienProjectiles[_local1]._x;
_local2.y = aAlienProjectiles[_local1]._y - 5;
addBombAnimation(_local2.x, _local2.y, 50);
switch (aAlienProjectiles[_local1].targetI) {
case 7 :
mcAntenna1._visible = false;
break;
case 10 :
mcAntenna2._visible = false;
break;
case 20 :
mcAntenna3._visible = false;
break;
case 24 :
mcAntenna4._visible = false;
}
if (aBuildings[aAlienProjectiles[_local1].targetI].energy <= 0) {
removeBuilding(aAlienProjectiles[_local1].targetI);
} else {
aBuildings[aAlienProjectiles[_local1].targetI].globalToLocal(_local2);
aListBuildingMasks.push(aBuildings[aAlienProjectiles[_local1].targetI].attachMovie("smallMask", "smallMask", aBuildings[aAlienProjectiles[_local1].targetI].getNextHighestDepth(), {_x:_local2.x, _y:_local2.y, nIndex:aAlienProjectiles[_local1].targetI, blendMode:"erase"}));
if (aBuildings[aAlienProjectiles[_local1].targetI].bMask) {
if (aBuildings[aAlienProjectiles[_local1].targetI].bDamage == false) {
aBuildings[aAlienProjectiles[_local1].targetI].damageMask._visible = true;
animateBuildingDamage(aAlienProjectiles[_local1].targetI);
aBuildings[aAlienProjectiles[_local1].targetI].bDamage = true;
}
}
}
removeAlienProjectile(_local1, aAlienProjectiles[_local1]._x, aAlienProjectiles[_local1]._y);
} else if (aAlienProjectiles[_local1].distance < 495) {
removeAlienProjectile(_local1, aAlienProjectiles[_local1]._x, aAlienProjectiles[_local1]._y);
}
}
}
_local1++;
}
}
function calcScoreBoxes() {
var _local1 = 0;
while (_local1 < aListBox.length) {
aScoreBoxes[aListBox[_local1]].nFrames = aScoreBoxes[aListBox[_local1]].nFrames - 1;
if (aScoreBoxes[aListBox[_local1]].nFrames <= 0) {
aScoreBoxes[aListBox[_local1]].removeScoreBox();
aListBox.splice(_local1, 1);
break;
}
aScoreBoxes[aListBox[_local1]]._xscale = aScoreBoxes[aListBox[_local1]]._xscale + aScoreBoxes[aListBox[_local1]].growthRateX;
aScoreBoxes[aListBox[_local1]]._yscale = aScoreBoxes[aListBox[_local1]]._yscale + aScoreBoxes[aListBox[_local1]].growthRateY;
aScoreBoxes[aListBox[_local1]]._alpha = aScoreBoxes[aListBox[_local1]]._alpha - 5;
_local1++;
}
}
function calcBombs() {
var _local1 = 0;
while (_local1 < aListBomb.length) {
aBombs[aListBomb[_local1]].bTimer--;
if (aBombs[aListBomb[_local1]].bTimer <= 0) {
if (aBombs[aListBomb[_local1]].playMe) {
aBombs[aListBomb[_local1]].playMe = false;
aBombs[aListBomb[_local1]].gotoAndPlay(2);
if (bSound) {
sndBomb.start();
}
}
pBombHit(aBombs[aListBomb[_local1]]._x, aBombs[aListBomb[_local1]]._y, aBombs[aListBomb[_local1]].radius);
bRemove = aBombs[aListBomb[_local1]].incrementRadius();
if (bRemove) {
aListBomb.splice(_local1, 1);
break;
}
}
_local1++;
}
}
function calcBossABombs() {
var _local1 = 0;
while (_local1 < aListBomb.length) {
aBombs[aListBomb[_local1]].bTimer--;
if (aBombs[aListBomb[_local1]].bTimer <= 0) {
if (aBombs[aListBomb[_local1]].playMe) {
aBombs[aListBomb[_local1]].playMe = false;
aBombs[aListBomb[_local1]].gotoAndPlay(2);
if (bSound) {
sndBomb.start();
}
}
bossABombHit(aBombs[aListBomb[_local1]]._x, aBombs[aListBomb[_local1]]._y, aBombs[aListBomb[_local1]].radius);
bRemove = aBombs[aListBomb[_local1]].incrementRadius();
if (bRemove) {
aListBomb.splice(_local1, 1);
break;
}
}
_local1++;
}
}
function calcBossBBombs() {
var _local1 = 0;
while (_local1 < aListBomb.length) {
aBombs[aListBomb[_local1]].bTimer--;
if (aBombs[aListBomb[_local1]].bTimer <= 0) {
if (aBombs[aListBomb[_local1]].playMe) {
aBombs[aListBomb[_local1]].playMe = false;
aBombs[aListBomb[_local1]].gotoAndPlay(2);
if (bSound) {
sndBomb.start();
}
}
bossBBombHit(aBombs[aListBomb[_local1]]._x, aBombs[aListBomb[_local1]]._y, aBombs[aListBomb[_local1]].radius);
bRemove = aBombs[aListBomb[_local1]].incrementRadius();
if (bRemove) {
aListBomb.splice(_local1, 1);
break;
}
}
_local1++;
}
}
function calcBossParticles() {
var _local1 = 0;
while (_local1 < aListParticles.length) {
aParticles[aListParticles[_local1]].update();
bRemove = aParticles[aListParticles[_local1]].fadeOut();
if (bRemove) {
aParticles[aListParticles[_local1]].removeParticle();
aListParticles.splice(_local1, 1);
break;
}
_local1++;
}
}
function calcMissiles() {
var _local1 = 0;
while (_local1 < nPMissiles) {
if (aMissiles[_local1].inPlay) {
if (aAliens[aMissiles[_local1].targetI].inPlay) {
aMissiles[_local1].update(aAliens[aMissiles[_local1].targetI]._x, aAliens[aMissiles[_local1].targetI]._y, true);
} else {
aMissiles[_local1].update(aAliens[aMissiles[_local1].targetI]._x, aAliens[aMissiles[_local1].targetI]._y, false);
}
if (aMissiles[_local1]._y < (-aMissiles[_local1]._height)) {
aMissiles[_local1].removeMissile();
} else if (aMissiles[_local1].distance < 15) {
addBomb(aAliens[aMissiles[_local1].targetI]._x, aAliens[aMissiles[_local1].targetI]._y, 400, null);
aMissiles[_local1].removeMissile();
}
}
_local1++;
}
}
function calcBossAMissiles() {
var _local1 = 0;
while (_local1 < nPMissiles) {
if (aMissiles[_local1].inPlay) {
if (mcBossA.bLocked && (aMissiles[_local1].bMissTarget == false)) {
aMissiles[_local1].update(mcBossA._x, mcBossA._y, true);
} else {
aMissiles[_local1].update(mcBossA._x, mcBossA._y, false);
aMissiles[_local1].bMissTarget = true;
}
if (aMissiles[_local1]._y < (-aMissiles[_local1]._height)) {
aMissiles[_local1].removeMissile();
} else if (aMissiles[_local1].distance < 30) {
addBomb(aMissiles[_local1]._x, aMissiles[_local1]._y, 400, null);
aMissiles[_local1].removeMissile();
}
}
_local1++;
}
}
function calcBossBMissiles() {
var _local1 = 0;
while (_local1 < nPMissiles) {
if (aMissiles[_local1].inPlay) {
switch (aMissiles[_local1].targetI) {
case -1 :
if (mcBossB.bLocked && (aMissiles[_local1].bMissTarget == false)) {
aMissiles[_local1].update(mcBossB._x, mcBossB._y, true);
} else {
aMissiles[_local1].update(mcBossB._x, mcBossB._y, false);
aMissiles[_local1].bMissTarget = true;
}
break;
case -2 :
if (mcBossBEscortA.inPlay) {
aMissiles[_local1].update(mcBossBEscortA._x, mcBossBEscortA._y, true);
} else {
aMissiles[_local1].update(mcBossBEscortA._x, mcBossBEscortA._y, false);
}
break;
case -3 :
if (mcBossBEscortB.inPlay) {
aMissiles[_local1].update(mcBossBEscortB._x, mcBossBEscortB._y, true);
} else {
aMissiles[_local1].update(mcBossBEscortB._x, mcBossBEscortB._y, false);
}
}
if (aMissiles[_local1]._y < (-aMissiles[_local1]._height)) {
aMissiles[_local1].removeMissile();
} else if (aMissiles[_local1].distance < 30) {
addBomb(aMissiles[_local1]._x, aMissiles[_local1]._y, 400, null);
aMissiles[_local1].removeMissile();
}
}
_local1++;
}
}
function resetGameOver() {
clearInterval(nGameOverID);
nGameOverID = null;
resetGame();
}
function bossAIntro() {
mcBossAIntro.x = mcBossAIntro.x + 0.45;
mcBossAIntro.y = mcBossAIntro.y - 1;
mcBossAIntro.z = mcBossAIntro.z - 0.75;
var _local1 = fl / (fl + mcBossAIntro.z);
mcBossAIntro._alpha = _local1 * 100;
mcBossAIntro._xscale = (mcBossAIntro._yscale = _local1 * 100);
mcBossAIntro._x = vpx + (mcBossAIntro.x * _local1);
mcBossAIntro._y = vpy + (mcBossAIntro.y * _local1);
if (mcBossAIntro._xscale >= 100) {
nextLevel();
mcBossAIntro._xscale = (mcBossAIntro._yscale = 100);
mcBossAIntro._alpha = 100;
pScale = 1;
setBossAInterval();
unPauseGameTransition();
switchModes(6);
mcBossAIntro._visible = false;
mcBossA._x = mcBossAIntro._x;
mcBossA._y = mcBossAIntro._y;
mcBossA.nIntI = 2;
mcBossA.nIntM = 9;
mcBossA.gotoAndPlay(1);
mcBossA._visible = true;
mcBossA.inPlay = true;
mcBossAIntro.removeBoss();
}
}
function bossAUpdate() {
if (bGameInPlay) {
mcAPIa.clear();
mcAPIp.clear();
if (bTargetUpdate) {
switch (nTargetLock) {
case -1 :
mcTargetCursor._x = mcBossA._x;
mcTargetCursor._y = mcBossA._y;
break;
default :
mcTargetCursor._x = aAliens[nTargetLock]._x;
mcTargetCursor._y = aAliens[nTargetLock]._y;
}
}
if (mcHelpWinB.inPlay) {
mcHelpWinB._x = mcCursor._x - 25;
mcHelpWinB._y = mcCursor._y - (mcHelpWinB._height / 2);
}
if (Key.isDown(nkey4)) {
if (nSelectedUnit == 1) {
if (bTankAMovement == false) {
mcTankA.moveLeft();
if (mcTankA.bAnimate) {
mcTankA.wheelA._rotation = mcTankA.wheelA._rotation - 2;
mcTankA.wheelB._rotation = mcTankA.wheelB._rotation - 2;
mcTankA.wheelC._rotation = mcTankA.wheelC._rotation - 2;
mcTankA.tankBase._y = mcTankA.origBasePos - (Math.sin(mcTankA.sinAngle) * mcTankA.bounce);
scaleTanks();
updateUnitSelection();
}
}
} else if (nSelectedUnit == 2) {
if (bTankBMovement == false) {
mcTankB.moveLeft();
if (mcTankB.bAnimate) {
mcTankB.wheelA._rotation = mcTankB.wheelA._rotation - 2;
mcTankB.wheelB._rotation = mcTankB.wheelB._rotation - 2;
mcTankB.wheelC._rotation = mcTankB.wheelC._rotation - 2;
mcTankB.tankBase._y = mcTankB.origBasePos - (Math.sin(mcTankB.sinAngle) * mcTankB.bounce);
scaleTanks();
updateUnitSelection();
}
}
}
} else if (Key.isDown(nkey5)) {
if (nSelectedUnit == 1) {
if (bTankAMovement == false) {
mcTankA.moveRight();
if (mcTankA.bAnimate) {
mcTankA.wheelA._rotation = mcTankA.wheelA._rotation + 2;
mcTankA.wheelB._rotation = mcTankA.wheelB._rotation + 2;
mcTankA.wheelC._rotation = mcTankA.wheelC._rotation + 2;
mcTankA.tankBase._y = mcTankA.origBasePos - (Math.sin(mcTankA.sinAngle) * mcTankA.bounce);
scaleTanks();
updateUnitSelection();
}
}
} else if (nSelectedUnit == 2) {
if (bTankBMovement == false) {
mcTankB.moveRight();
if (mcTankB.bAnimate) {
mcTankB.wheelA._rotation = mcTankB.wheelA._rotation + 2;
mcTankB.wheelB._rotation = mcTankB.wheelB._rotation + 2;
mcTankB.wheelC._rotation = mcTankB.wheelC._rotation + 2;
mcTankB.tankBase._y = mcTankB.origBasePos - (Math.sin(mcTankB.sinAngle) * mcTankB.bounce);
scaleTanks();
updateUnitSelection();
}
}
}
}
if (mcTankA.bMovable) {
xDist = mcCursor._x - mcTankA._x;
yDist = mcCursor._y - mcTankA._y;
nRadians = Math.atan2(yDist, xDist);
bRadiansUpdated = true;
mcTankA.tankTurret._rotation = ((nRadians * 180) / Math.PI) + (90 - mcTankA._rotation);
mcTankA.tankJoint._rotation = (((nRadians * 0.5) * 180) / Math.PI) + (10 - mcTankA._rotation);
mcTankA.tankTurret._x = mcTankA.origTurretPos;
mcTankA.tankJoint._x = mcTankA.origJointPos;
mcTankA.tankTurret._x = mcTankA.tankTurret._x + (xDist * 0.01);
mcTankA.tankJoint._x = mcTankA.tankJoint._x + (xDist * 0.005);
} else if (mcTankB.bMovable) {
xDist = mcCursor._x - mcTankB._x;
yDist = mcCursor._y - mcTankB._y;
nRadians = Math.atan2(yDist, xDist);
bRadiansUpdated = true;
mcTankB.tankTurret._rotation = ((nRadians * 180) / Math.PI) + (90 - mcTankB._rotation);
mcTankB.tankJoint._rotation = (((nRadians * 0.5) * 180) / Math.PI) + (10 - mcTankB._rotation);
mcTankB.tankTurret._x = mcTankB.origTurretPos;
mcTankB.tankJoint._x = mcTankB.origJointPos;
mcTankB.tankTurret._x = mcTankB.tankTurret._x + (xDist * 0.01);
mcTankB.tankJoint._x = mcTankB.tankJoint._x + (xDist * 0.005);
}
var _local1 = nSquids + nSpitters;
while (_local1 < (((nSquids + nSpitters) + nPowerUps) + nMines)) {
if (!aAliens[_local1].inPool) {
aAliens[_local1].update(centerPoint.x, centerPoint.y);
}
_local1++;
}
if (mcBossA.bAttackReady) {
if (mcBossA.inPlay) {
var _local2 = {x:0, y:0};
_local2.x = mcBossA.nProjectileX;
_local2.y = mcBossA.nProjectileY;
mcBossA.localToGlobal(_local2);
addAlienProjectile(_local2.x, _local2.y);
}
mcBossA.bAttackReady = false;
}
if (mcBossA.bAnimateBoss) {
mcBossA.vy = mcBossA.vy + mcBossA.gravity;
mcBossA._y = mcBossA._y + mcBossA.vy;
if (mcBossA._x < centerPoint.x) {
addBossParticle(mcBossA._x, mcBossA._y, Math.random(), Math.random());
} else {
addBossParticle(mcBossA._x, mcBossA._y, -Math.random(), -Math.random());
}
mcBossA.calcRotation(centerPoint.x, centerPoint.y);
mcBossA.tr = ((mcBossA.radians * 180) / Math.PI) - 90;
if (mcBossA._x < centerPoint.x) {
mcBossA._x = mcBossA._x + 0.1;
if (mcBossA.tr < mcBossA._rotation) {
mcBossA._rotation = mcBossA._rotation - 0.1;
}
} else {
mcBossA._x = mcBossA._x - 0.1;
if (mcBossA.tr > mcBossA._rotation) {
mcBossA._rotation = mcBossA._rotation + 0.1;
}
}
mcBossA.calcDistance(centerPoint.x, centerPoint.y);
if (mcBossA.distance <= 515) {
if (bSound) {
sndCollideBossA.start();
}
if (mcBossA._x < centerPoint.x) {
mcBossAAnimationL._x = mcBossA._x;
mcBossAAnimationL._y = mcBossA._y;
mcBossAAnimationL._rotation = mcBossA._rotation;
mcBossAAnimationL.beginAnimation();
} else {
mcBossAAnimationR._x = mcBossA._x;
mcBossAAnimationR._y = mcBossA._y;
mcBossAAnimationR._rotation = mcBossA._rotation;
mcBossAAnimationR.beginAnimation();
}
mcBossA.removeBoss();
}
}
calcAlienBoundsBoss();
calcPlLasersBossA();
calcBossParticles();
calcAlienProjectiles();
calcBossABombs();
calcBossAMissiles();
}
}
function bossBUpdate() {
if (bGameInPlay) {
mcAPIa.clear();
mcAPIp.clear();
if (bTargetUpdate) {
switch (nTargetLock) {
case -1 :
mcTargetCursor._x = mcBossB._x;
mcTargetCursor._y = mcBossB._y;
break;
case -2 :
mcTargetCursor._x = mcBossBEscortA._x;
mcTargetCursor._y = mcBossBEscortA._y;
break;
case -3 :
mcTargetCursor._x = mcBossBEscortB._x;
mcTargetCursor._y = mcBossBEscortB._y;
break;
default :
mcTargetCursor._x = aAliens[nTargetLock]._x;
mcTargetCursor._y = aAliens[nTargetLock]._y;
}
}
if (mcHelpWinB.inPlay) {
mcHelpWinB._x = mcCursor._x - 25;
mcHelpWinB._y = mcCursor._y - (mcHelpWinB._height / 2);
}
if (Key.isDown(nkey4)) {
if (nSelectedUnit == 1) {
if (bTankAMovement == false) {
mcTankA.moveLeft();
if (mcTankA.bAnimate) {
mcTankA.wheelA._rotation = mcTankA.wheelA._rotation - 2;
mcTankA.wheelB._rotation = mcTankA.wheelB._rotation - 2;
mcTankA.wheelC._rotation = mcTankA.wheelC._rotation - 2;
mcTankA.tankBase._y = mcTankA.origBasePos - (Math.sin(mcTankA.sinAngle) * mcTankA.bounce);
scaleTanks();
updateUnitSelection();
}
}
} else if (nSelectedUnit == 2) {
if (bTankBMovement == false) {
mcTankB.moveLeft();
if (mcTankB.bAnimate) {
mcTankB.wheelA._rotation = mcTankB.wheelA._rotation - 2;
mcTankB.wheelB._rotation = mcTankB.wheelB._rotation - 2;
mcTankB.wheelC._rotation = mcTankB.wheelC._rotation - 2;
mcTankB.tankBase._y = mcTankB.origBasePos - (Math.sin(mcTankB.sinAngle) * mcTankB.bounce);
scaleTanks();
updateUnitSelection();
}
}
}
} else if (Key.isDown(nkey5)) {
if (nSelectedUnit == 1) {
if (bTankAMovement == false) {
mcTankA.moveRight();
if (mcTankA.bAnimate) {
mcTankA.wheelA._rotation = mcTankA.wheelA._rotation + 2;
mcTankA.wheelB._rotation = mcTankA.wheelB._rotation + 2;
mcTankA.wheelC._rotation = mcTankA.wheelC._rotation + 2;
mcTankA.tankBase._y = mcTankA.origBasePos - (Math.sin(mcTankA.sinAngle) * mcTankA.bounce);
scaleTanks();
updateUnitSelection();
}
}
} else if (nSelectedUnit == 2) {
if (bTankBMovement == false) {
mcTankB.moveRight();
if (mcTankB.bAnimate) {
mcTankB.wheelA._rotation = mcTankB.wheelA._rotation + 2;
mcTankB.wheelB._rotation = mcTankB.wheelB._rotation + 2;
mcTankB.wheelC._rotation = mcTankB.wheelC._rotation + 2;
mcTankB.tankBase._y = mcTankB.origBasePos - (Math.sin(mcTankB.sinAngle) * mcTankB.bounce);
scaleTanks();
updateUnitSelection();
}
}
}
}
if (mcTankA.bMovable) {
xDist = mcCursor._x - mcTankA._x;
yDist = mcCursor._y - mcTankA._y;
nRadians = Math.atan2(yDist, xDist);
bRadiansUpdated = true;
mcTankA.tankTurret._rotation = ((nRadians * 180) / Math.PI) + (90 - mcTankA._rotation);
mcTankA.tankJoint._rotation = (((nRadians * 0.5) * 180) / Math.PI) + (10 - mcTankA._rotation);
mcTankA.tankTurret._x = mcTankA.origTurretPos;
mcTankA.tankJoint._x = mcTankA.origJointPos;
mcTankA.tankTurret._x = mcTankA.tankTurret._x + (xDist * 0.01);
mcTankA.tankJoint._x = mcTankA.tankJoint._x + (xDist * 0.005);
} else if (mcTankB.bMovable) {
xDist = mcCursor._x - mcTankB._x;
yDist = mcCursor._y - mcTankB._y;
nRadians = Math.atan2(yDist, xDist);
bRadiansUpdated = true;
mcTankB.tankTurret._rotation = ((nRadians * 180) / Math.PI) + (90 - mcTankB._rotation);
mcTankB.tankJoint._rotation = (((nRadians * 0.5) * 180) / Math.PI) + (10 - mcTankB._rotation);
mcTankB.tankTurret._x = mcTankB.origTurretPos;
mcTankB.tankJoint._x = mcTankB.origJointPos;
mcTankB.tankTurret._x = mcTankB.tankTurret._x + (xDist * 0.01);
mcTankB.tankJoint._x = mcTankB.tankJoint._x + (xDist * 0.005);
}
var _local1 = nSquids + nSpitters;
while (_local1 < (((nSquids + nSpitters) + nPowerUps) + nMines)) {
if (!aAliens[_local1].inPool) {
aAliens[_local1].update(centerPoint.x, centerPoint.y);
}
_local1++;
}
if (mcBossBEscortA.inPlay) {
if (mcBossBEscortA.bMovement) {
mcBossBEscortA.calcDistance(mcBossB._x, mcBossB._y);
mcBossBEscortA.update();
}
if (mcBossBEscortA.bActivate) {
mcBossBEscortA.bActivate = false;
mcBossBEscortA.gotoAndPlay("lowerDish");
}
if (mcBossBEscortA.bShieldBeam) {
mcBossBEscortA.bShieldBeam = false;
mcBossBEscortA.bShieldBeamActive = true;
activateEscortAShieldBeam();
}
}
if (mcBossBEscortB.inPlay) {
if (mcBossBEscortB.bMovement) {
mcBossBEscortB.calcDistance(mcBossB._x, mcBossB._y);
mcBossBEscortB.update();
}
if (mcBossBEscortB.bActivate) {
mcBossBEscortB.bActivate = false;
mcBossBEscortB.gotoAndPlay("lowerDish");
}
if (mcBossBEscortB.bShieldBeam) {
mcBossBEscortB.bShieldBeam = false;
mcBossBEscortB.bShieldBeamActive = true;
activateEscortBShieldBeam();
}
}
if ((mcBossBShield.inPlay == false) && (mcBossBEscortA.bShieldBeamActive || (mcBossBEscortB.bShieldBeamActive))) {
mcBossBShield._x = mcBossB._x - (mcBossBShield._width / 2);
mcBossBShield._y = mcBossB._y - (mcBossBShield._height / 2);
mcBossBShield._alpha = 0;
mcBossBShield._visible = true;
mcBossBShield.inPlay = true;
}
mcBossB.updateB();
if (mcBossB.bAttackReady) {
if (mcBossB.inPlay) {
if (getBossBTarget()) {
bBossBEffect = true;
nBossBEffectID = setInterval(bossBLazerEffectInterval, 50);
}
}
mcBossB.bAttackReady = false;
}
if (mcBossB.bAnimateBoss) {
if (mcBossB.calcIntervalA(60)) {
mcBossB.removeInterval++;
} else {
switch (mcBossB.removeInterval) {
case 0 :
if (mcBossB.calcIntervalB(10)) {
mcBossB.calcRemoveBomb();
addBombAnimation(mcBossB.xBomb, mcBossB.yBomb, 100);
}
mcBossB._y = mcBossB._y + 0.1;
break;
case 1 :
if (mcBossB.calcIntervalB(15)) {
mcBossB.calcRemoveBomb();
addBossBBombAnimation();
}
mcBossB._y = mcBossB._y + 0.1;
mcBossB._rotation = mcBossB._rotation + 0.05;
break;
case 2 :
if (mcBossB.calcIntervalB(30)) {
mcBossB.calcRemoveBomb();
addBossBBombAnimation();
}
mcBossB._y = mcBossB._y + 0.1;
mcBossB._rotation = mcBossB._rotation - 0.1;
break;
case 3 :
if (mcBossB.calcIntervalB(15)) {
mcBossB.calcRemoveBomb();
addBossBBombAnimation();
}
mcBossB._y = mcBossB._y + 0.1;
mcBossB._rotation = mcBossB._rotation + 0.05;
break;
case 4 :
mcBossBAnimation._x = mcBossB._x;
mcBossBAnimation._y = mcBossB._y;
mcBossBAnimation._rotation = mcBossB._rotation;
mcBossBAnimation.beginAnimation();
addBombAnimation(mcBossB._x, mcBossB._y, 400);
addBombAnimation(mcBossB._x - 25, mcBossB._y - 25, 200);
addBombAnimation(mcBossB._x - 25, mcBossB._y + 25, 200);
addBombAnimation(mcBossB._x + 25, mcBossB._y - 25, 200);
addBombAnimation(mcBossB._x + 25, mcBossB._y + 25, 200);
if (bSound) {
sndBossBHover.stop();
}
mcBossB.removeBoss();
}
}
}
calcAlienBoundsBoss();
calcPlLasersBossB1();
calcScoreBoxes();
calcBossParticles();
calcBossBBombs();
calcBossBMissiles();
}
}
function activateEscortAShieldBeam() {
var _local1 = {x:0, y:0};
_local1.x = mcBossBEscortA.escortDish.escortMarker._x;
_local1.y = mcBossBEscortA.escortDish.escortMarker._y;
mcBossBEscortA.escortDish.localToGlobal(_local1);
mcBossBBeamA._x = _local1.x;
mcBossBBeamA._y = _local1.y;
var _local4 = mcBossB._x - mcBossBBeamA._x;
var _local3 = mcBossB._y - mcBossBBeamA._y;
var _local2 = Math.atan2(_local3, _local4);
mcBossBBeamA._rotation = ((_local2 * 180) / Math.PI) - 90;
mcBossBBeamA._alpha = 0;
mcBossBBeamA._visible = true;
mcBossBBeamA.inPlay = true;
nBeamAIntervalID = setInterval(fadeInBeamA, 50);
}
function fadeInBeamA() {
mcBossBBeamA._alpha = mcBossBBeamA._alpha + 5;
if (mcBossBShield._alpha < 100) {
mcBossBShield._alpha = mcBossBShield._alpha + 5;
}
if (mcBossBBeamA._alpha >= 100) {
mcBossBBeamA._alpha = 100;
mcBossBShield._alpha = 100;
clearInterval(nBeamAIntervalID);
nBeamAIntervalID = null;
}
}
function activateEscortBShieldBeam() {
var _local1 = {x:0, y:0};
_local1.x = mcBossBEscortB.escortDish.escortMarker._x;
_local1.y = mcBossBEscortB.escortDish.escortMarker._y;
mcBossBEscortB.escortDish.localToGlobal(_local1);
mcBossBBeamB._x = _local1.x;
mcBossBBeamB._y = _local1.y;
var _local4 = mcBossB._x - mcBossBBeamB._x;
var _local3 = mcBossB._y - mcBossBBeamB._y;
var _local2 = Math.atan2(_local3, _local4);
mcBossBBeamB._rotation = ((_local2 * 180) / Math.PI) - 90;
mcBossBBeamB._alpha = 0;
mcBossBBeamB._visible = true;
mcBossBBeamB.inPlay = true;
nBeamBIntervalID = setInterval(fadeInBeamB, 50);
}
function fadeInBeamB() {
mcBossBBeamB._alpha = mcBossBBeamB._alpha + 5;
if (mcBossBShield._alpha < 100) {
mcBossBShield._alpha = mcBossBShield._alpha + 5;
}
if (mcBossBBeamB._alpha >= 100) {
mcBossBBeamB._alpha = 100;
clearInterval(nBeamBIntervalID);
nBeamBIntervalID = null;
}
}
function bossBIntroA() {
mcBossB.calcDistance(350, 413);
if (mcBossB.distance < 25) {
mcBossB.x = mcBossB.x - 0.15;
mcBossB.y = mcBossB.y - 0.01;
mcBossB.z = mcBossB.z - 0.15;
} else if (mcBossB.distance < 50) {
mcBossB.x = mcBossB.x - 0.3;
mcBossB.y = mcBossB.y - 0.03;
mcBossB.z = mcBossB.z - 0.3;
} else {
mcBossB.x = mcBossB.x - 0.5;
mcBossB.y = mcBossB.y - 0.05;
mcBossB.z = mcBossB.z - 0.5;
}
pScale = fl / (fl + mcBossB.z);
if (bSound) {
sndBossBHover.setVolume(pScale * 25);
}
mcBossB._alpha = (pScale * 100) - mcBossB.adjustAlpha;
if (mcBossB.adjustAlpha > 0) {
mcBossB.adjustAlpha = mcBossB.adjustAlpha - 0.25;
} else {
mcBossB.adjustAlpha = 0;
}
scaleBossB();
if (mcBossB._xscale >= 100) {
pScale = 1;
mcBossB._alpha = 100;
mcBossB.x = 0;
mcBossB.y = 75;
mcBossB.z = 0;
scaleBossB();
oPlanetPos.tx = 0;
oPlanetPos.ty = 70;
oPlanetPos.tz = -230;
mcBossB.tx = -3.3;
mcBossB.ty = 0;
mcBossB.tz = -70;
if (mcBossBLazerB.bGameOver) {
mcBossBLazerB.bGameOver = false;
mcGameOver._x = mcGameOver.xPos;
mcGameOver._y = mcGameOver.yPos;
mcGameOver._visible = true;
mcGameOver.gotoAndPlay(1);
switchModes(9);
} else {
switchModes(10);
}
}
}
function bossBIntroB() {
mcBossBIntro.calcDistance(350, 413);
if (mcBossBIntro.distance < 25) {
mcBossBIntro.y = mcBossBIntro.y - 0.3;
mcBossBIntro.z = mcBossBIntro.z - 0.3;
} else if (mcBossBIntro.distance < 50) {
mcBossBIntro.y = mcBossBIntro.y - 0.6;
mcBossBIntro.z = mcBossBIntro.z - 0.3;
} else {
mcBossBIntro.y = mcBossBIntro.y - 1;
mcBossBIntro.z = mcBossBIntro.z - 0.5;
}
pScale = fl / (fl + mcBossBIntro.z);
if (bSound) {
sndBossBHover.setVolume(pScale * 25);
}
mcBossBIntro._alpha = pScale * 100;
scaleBossBIntro();
if (mcBossBIntro._xscale >= 100) {
nextLevel();
nBossPowerUps = 0;
nBossMines = 0;
mcBossBIntro._xscale = (mcBossBIntro._yscale = 100);
mcBossBIntro._alpha = 100;
pScale = 1;
setBossBInterval();
unPauseGameTransition();
switchModes(8);
mcBossBIntro.x = 0;
mcBossBIntro.z = 0;
scaleBossBIntro();
mcBossB._xscale = mcBossBIntro._xscale;
mcBossB._yscale = mcBossBIntro._yscale;
mcBossB._x = mcBossBIntro._x;
mcBossB._y = mcBossBIntro._y;
mcBossB.gotoAndPlay(mcBossBIntro._currentframe);
mcBossB._visible = true;
mcBossB.inPlay = true;
mcBossBIntro.removeBoss();
}
}
function scaleBossB() {
mcBossB._xscale = (mcBossB._yscale = pScale * 100);
mcBossB._x = vpx + (mcBossB.x * pScale);
mcBossB._y = vpy + (mcBossB.y * pScale);
}
function scaleBossBIntro() {
mcBossBIntro._xscale = (mcBossBIntro._yscale = pScale * 100);
mcBossBIntro._x = vpx + (mcBossBIntro.x * pScale);
mcBossBIntro._y = vpy + (mcBossBIntro.y * pScale);
}
function scaleBossBEvent(xDist, yDist, zDist) {
oPlanetPos.x = oPlanetPos.x + ((xDist * easing) * 2);
oPlanetPos.y = oPlanetPos.y + ((yDist * easing) * 2);
oPlanetPos.z = oPlanetPos.z + ((zDist * easing) * 2);
scalePlanet();
xDist = mcBossB.tx - mcBossB.x;
yDist = mcBossB.ty - mcBossB.y;
zDist = mcBossB.tz - mcBossB.z;
mcBossB.x = mcBossB.x + ((xDist * easing) * 2);
mcBossB.y = mcBossB.y + ((yDist * easing) * 2);
mcBossB.z = mcBossB.z + ((zDist * easing) * 2);
pScale = fl / (fl + mcBossB.z);
scaleBossB();
}
function bossBGameOver() {
xDist = oPlanetPos.tx - oPlanetPos.x;
yDist = oPlanetPos.ty - oPlanetPos.y;
zDist = oPlanetPos.tz - oPlanetPos.z;
maxDist = Math.sqrt(((xDist * xDist) + (yDist * yDist)) + (zDist * zDist));
if (maxDist <= 1) {
if (mcBossBLazerB.bPlaying == false) {
var _local1 = {x:0, y:0};
_local1.x = mcBossB.marker._x;
_local1.y = mcBossB.marker._y;
mcBossB.localToGlobal(_local1);
mcBossBLazerB._x = _local1.x;
mcBossBLazerB._y = _local1.y;
mcBossBLazerB.beginAnimation();
if (bSound) {
sndBossBPowerUp.start();
}
} else if (mcBossBLazerB.bDone) {
mcBossBLazerB.bPlaying = false;
mcGameOver.removeMessage();
resetGame();
}
} else {
if (bSound) {
sndBossBHover.setVolume((pScale * 25) + ((pScale - 1) * 50));
}
scaleBossBEvent(xDist, yDist, zDist);
}
}
function animateBossBEventA() {
mcGunBase._visible = false;
var _local1 = 1;
while (_local1 <= 6) {
if (mcPowerLines["line" + _local1]._visible) {
mcPowerLines["line" + _local1]._visible = false;
aPowerLineAnimations[_local1 - 1]._visible = true;
aPowerLineAnimations[_local1 - 1].gotoAndPlay(1);
}
_local1++;
}
}
function bossBEventA() {
xDist = oPlanetPos.tx - oPlanetPos.x;
yDist = oPlanetPos.ty - oPlanetPos.y;
zDist = oPlanetPos.tz - oPlanetPos.z;
maxDist = Math.sqrt(((xDist * xDist) + (yDist * yDist)) + (zDist * zDist));
if (maxDist <= 1) {
if (mcBossBLazerA.bPlaying == false) {
var _local1 = {x:0, y:0};
_local1.x = mcBossB.marker._x;
_local1.y = mcBossB.marker._y;
mcBossB.localToGlobal(_local1);
mcBossBLazerA._x = _local1.x;
mcBossBLazerA._y = _local1.y;
mcBossBLazerA.beginAnimation();
if (bSound) {
sndBossBPowerUp.start();
}
} else if (mcBossBLazerA.bDone) {
mcBossBLazerA.bPlaying = false;
oPlanetPos.tx = 0;
oPlanetPos.ty = 75;
oPlanetPos.tz = -225;
mcBossB.tx = 0;
mcBossB.ty = 75;
mcBossB.tz = 0;
switchModes(11);
}
} else {
if (bSound) {
sndBossBHover.setVolume((pScale * 25) + ((pScale - 1) * 50));
}
scaleBossBEvent(xDist, yDist, zDist);
}
}
function bossBEventB() {
xDist = oPlanetPos.tx - oPlanetPos.x;
yDist = oPlanetPos.ty - oPlanetPos.y;
zDist = oPlanetPos.tz - oPlanetPos.z;
maxDist = Math.sqrt(((xDist * xDist) + (yDist * yDist)) + (zDist * zDist));
if (maxDist <= 0.5) {
oPlanetPos.x = 0;
oPlanetPos.y = 75;
oPlanetPos.z = -225;
scalePlanet();
bGameKeys = true;
mcStoryScreen._visible = false;
showStatus(false);
bGameInPlay = true;
bGameKeys = true;
bPaused = false;
setTargetInterval();
setGameInterval();
nGameLocation = 0;
switchModes(1);
mcBossB.inPlay = true;
mcBossB.orbitDist = mcBossB._y;
nextLevel();
} else {
if (bSound) {
sndBossBHover.setVolume((pScale * 25) + ((pScale - 1) * 50));
}
scaleBossBEvent(xDist, yDist, zDist);
}
}
function locationInterval() {
xDist = oPlanetPos.tx - oPlanetPos.x;
yDist = oPlanetPos.ty - oPlanetPos.y;
zDist = oPlanetPos.tz - oPlanetPos.z;
maxDist = Math.sqrt(((xDist * xDist) + (yDist * yDist)) + (zDist * zDist));
oPlanetPos.x = oPlanetPos.x + (xDist * easing);
oPlanetPos.y = oPlanetPos.y + (yDist * easing);
oPlanetPos.z = oPlanetPos.z + (zDist * easing);
scalePlanet();
rDist = oPlanetPos.angle - oPlanetPos.targetAngle;
if ((!bLocDone) && (oPlanetPos.targetAngle < 0)) {
if (rDist < 5) {
mcPlanet._rotation = mcPlanet._rotation - ((rDist * easingR) + 0.05);
mcPlanetOverlay._rotation = mcPlanetOverlay._rotation - ((rDist * easingR) + 0.05);
mcPowerLines._rotation = mcPowerLines._rotation - ((rDist * easingR) + 0.05);
mcCity._rotation = mcCity._rotation - ((rDist * easingR) + 0.05);
mcAgriDome._rotation = mcAgriDome._rotation - ((rDist * easingR) + 0.05);
mcSpacePort._rotation = mcSpacePort._rotation - ((rDist * easingR) + 0.05);
mcMountains._rotation = mcMountains._rotation - ((rDist * easingR) + 0.05);
mcOtherSide._rotation = mcOtherSide._rotation - ((rDist * easingR) + 0.05);
oPlanetPos.angle = oPlanetPos.angle - ((rDist * easingR) + 0.05);
mcTankA.angle = mcTankA.angle - ((rDist * easingR) + 0.05);
mcTankB.angle = mcTankB.angle - ((rDist * easingR) + 0.05);
if (rDist < 0.5) {
bLocDone = true;
}
} else if (rDist < 40) {
mcPlanet._rotation = mcPlanet._rotation - ((rDist * easingR) + 0.075);
mcPlanetOverlay._rotation = mcPlanetOverlay._rotation - ((rDist * easingR) + 0.075);
mcPowerLines._rotation = mcPowerLines._rotation - ((rDist * easingR) + 0.075);
mcCity._rotation = mcCity._rotation - ((rDist * easingR) + 0.075);
mcAgriDome._rotation = mcAgriDome._rotation - ((rDist * easingR) + 0.075);
mcSpacePort._rotation = mcSpacePort._rotation - ((rDist * easingR) + 0.075);
mcMountains._rotation = mcMountains._rotation - ((rDist * easingR) + 0.075);
mcOtherSide._rotation = mcOtherSide._rotation - ((rDist * easingR) + 0.075);
oPlanetPos.angle = oPlanetPos.angle - ((rDist * easingR) + 0.075);
mcTankA.angle = mcTankA.angle - ((rDist * easingR) + 0.075);
mcTankB.angle = mcTankB.angle - ((rDist * easingR) + 0.075);
} else {
mcPlanet._rotation = mcPlanet._rotation - (rDist * easingR);
mcPlanetOverlay._rotation = mcPlanetOverlay._rotation - (rDist * easingR);
mcPowerLines._rotation = mcPowerLines._rotation - (rDist * easingR);
mcCity._rotation = mcCity._rotation - (rDist * easingR);
mcAgriDome._rotation = mcAgriDome._rotation - (rDist * easingR);
mcSpacePort._rotation = mcSpacePort._rotation - (rDist * easingR);
mcMountains._rotation = mcMountains._rotation - (rDist * easingR);
mcOtherSide._rotation = mcOtherSide._rotation - (rDist * easingR);
oPlanetPos.angle = oPlanetPos.angle - (rDist * easingR);
mcTankA.angle = mcTankA.angle - (rDist * easingR);
mcTankB.angle = mcTankB.angle - (rDist * easingR);
}
} else if (!bLocDone) {
if (rDist > -5) {
mcPlanet._rotation = mcPlanet._rotation + (-((rDist * easingR) - 0.05));
mcPlanetOverlay._rotation = mcPlanetOverlay._rotation + (-((rDist * easingR) - 0.05));
mcPowerLines._rotation = mcPowerLines._rotation + (-((rDist * easingR) - 0.05));
mcCity._rotation = mcCity._rotation + (-((rDist * easingR) - 0.05));
mcAgriDome._rotation = mcAgriDome._rotation + (-((rDist * easingR) - 0.05));
mcSpacePort._rotation = mcSpacePort._rotation + (-((rDist * easingR) - 0.05));
mcMountains._rotation = mcMountains._rotation + (-((rDist * easingR) - 0.05));
mcOtherSide._rotation = mcOtherSide._rotation + (-((rDist * easingR) - 0.05));
oPlanetPos.angle = oPlanetPos.angle + (-((rDist * easingR) - 0.05));
mcTankA.angle = mcTankA.angle + (-((rDist * easingR) - 0.05));
mcTankB.angle = mcTankB.angle + (-((rDist * easingR) - 0.05));
if (rDist > -0.5) {
bLocDone = true;
}
} else if (rDist > -50) {
mcPlanet._rotation = mcPlanet._rotation + (-((rDist * easingR) - 0.075));
mcPlanetOverlay._rotation = mcPlanetOverlay._rotation + (-((rDist * easingR) - 0.075));
mcPowerLines._rotation = mcPowerLines._rotation + (-((rDist * easingR) - 0.075));
mcCity._rotation = mcCity._rotation + (-((rDist * easingR) - 0.075));
mcAgriDome._rotation = mcAgriDome._rotation + (-((rDist * easingR) - 0.075));
mcSpacePort._rotation = mcSpacePort._rotation + (-((rDist * easingR) - 0.075));
mcMountains._rotation = mcMountains._rotation + (-((rDist * easingR) - 0.075));
mcOtherSide._rotation = mcOtherSide._rotation + (-((rDist * easingR) - 0.075));
oPlanetPos.angle = oPlanetPos.angle + (-((rDist * easingR) - 0.075));
mcTankA.angle = mcTankA.angle + (-((rDist * easingR) - 0.075));
mcTankB.angle = mcTankB.angle + (-((rDist * easingR) - 0.075));
} else {
mcPlanet._rotation = mcPlanet._rotation + (-(rDist * easingR));
mcPlanetOverlay._rotation = mcPlanetOverlay._rotation + (-(rDist * easingR));
mcPowerLines._rotation = mcPowerLines._rotation + (-(rDist * easingR));
mcCity._rotation = mcCity._rotation + (-(rDist * easingR));
mcAgriDome._rotation = mcAgriDome._rotation + (-(rDist * easingR));
mcSpacePort._rotation = mcSpacePort._rotation + (-(rDist * easingR));
mcMountains._rotation = mcMountains._rotation + (-(rDist * easingR));
mcOtherSide._rotation = mcOtherSide._rotation + (-(rDist * easingR));
oPlanetPos.angle = oPlanetPos.angle + (-(rDist * easingR));
mcTankA.angle = mcTankA.angle + (-(rDist * easingR));
mcTankB.angle = mcTankB.angle + (-(rDist * easingR));
}
}
if (bLocDone && (maxDist <= 0.5)) {
if (gLevel.nLevel == 6) {
renderAgriDome(false);
switchModes(7);
} else {
bGameKeys = true;
mcStoryScreen._visible = false;
switch (gLevel.nLocation) {
case 0 :
showStatus(true);
showGameCursor();
renderAgriDome(false);
nGameLocation = 0;
switchModes(0);
break;
case 1 :
showStatus(false);
showGameCursor();
renderCity(false);
mcGunBase._visible = false;
nGameLocation = 1;
switchModes(2);
break;
case 2 :
showStatus(false);
renderCity(false);
setSquidTargets(false);
nGameLocation = 2;
switchModes(3);
}
bGameInPlay = true;
bGameKeys = true;
bPaused = false;
setTargetInterval();
setGameInterval();
nextLevel();
}
} else if (maxDist < 9) {
oPlanetPos.tx = oPlanetPos.txOrig;
oPlanetPos.ty = oPlanetPos.tyOrig;
oPlanetPos.tz = oPlanetPos.tzOrig;
}
}
function locationIntervalFinal() {
xDist = oPlanetPos.tx - oPlanetPos.x;
yDist = oPlanetPos.ty - oPlanetPos.y;
zDist = oPlanetPos.tz - oPlanetPos.z;
maxDist = Math.sqrt(((xDist * xDist) + (yDist * yDist)) + (zDist * zDist));
rDist = oPlanetPos.targetAngle - oPlanetPos.angle;
if (!bLocDone) {
mcPlanet._rotation = mcPlanet._rotation + rotationSpeed;
mcPlanetOverlay._rotation = mcPlanetOverlay._rotation + rotationSpeed;
mcPowerLines._rotation = mcPowerLines._rotation + rotationSpeed;
mcCity._rotation = mcCity._rotation + rotationSpeed;
mcAgriDome._rotation = mcAgriDome._rotation + rotationSpeed;
mcSpacePort._rotation = mcSpacePort._rotation + rotationSpeed;
mcMountains._rotation = mcMountains._rotation + rotationSpeed;
mcOtherSide._rotation = mcOtherSide._rotation + rotationSpeed;
oPlanetPos.angle = oPlanetPos.angle + rotationSpeed;
mcTankA.angle = mcTankA.angle + rotationSpeed;
mcTankB.angle = mcTankB.angle + rotationSpeed;
if (rDist < 0.5) {
bLocDone = true;
}
}
if (maxDist <= 0.5) {
if (bLocDone) {
resetGame();
}
} else {
oPlanetPos.x = oPlanetPos.x + (xDist * (easing / 2));
oPlanetPos.y = oPlanetPos.y + (yDist * (easing / 2));
oPlanetPos.z = oPlanetPos.z + (zDist * (easing / 2));
scalePlanet();
}
}
function scalePlanet() {
pScale = fl / (fl + oPlanetPos.z);
unitOrbitDist = (vpy + (oPlanetPos.y * pScale)) - (vpy + ((oPlanetPos.y - 52) * pScale));
mcPlanet._xscale = (mcPlanet._yscale = (mcPlanetOverlay._xscale = (mcPlanetOverlay._yscale = pScale * 100)));
mcPlanet._x = (mcPlanetOverlay._x = (mcPowerLines._x = (mcCity._x = (mcAgriDome._x = (mcSpacePort._x = (mcMountains._x = (mcOtherSide._x = vpx + (oPlanetPos.x * pScale))))))));
mcPlanet._y = (mcPlanetOverlay._y = (mcPowerLines._y = (mcCity._y = (mcAgriDome._y = (mcSpacePort._y = (mcMountains._y = (mcOtherSide._y = vpy + (oPlanetPos.y * pScale))))))));
mcPowerLines._xscale = (mcPowerLines._yscale = (mcCity._xscale = (mcCity._yscale = (mcAgriDome._xscale = (mcAgriDome._yscale = (mcSpacePort._xscale = (mcSpacePort._yscale = (mcMountains._xscale = (mcMountains._yscale = (mcOtherSide._xscale = (mcOtherSide._yscale = (pScale * 100) / 10)))))))))));
mcGunBase._x = mcPlanet._x + (Math.cos(((oPlanetPos.angle - 90) * Math.PI) / 180) * unitOrbitDist);
mcGunBase._y = mcPlanet._y + (Math.sin(((oPlanetPos.angle - 90) * Math.PI) / 180) * unitOrbitDist);
mcGunBase._xscale = (mcGunBase._yscale = (pScale * 100) / 10);
mcGunBase._rotation = oPlanetPos.angle;
scaleTanks();
}
function scaleTanks() {
pScale = fl / (fl + oPlanetPos.z);
unitOrbitDist = ((vpy + (oPlanetPos.y * pScale)) - (vpy + ((oPlanetPos.y - 52) * pScale))) - 5;
mcTankA._x = mcPlanet._x + (Math.cos(((mcTankA.angle - 90) * Math.PI) / 180) * unitOrbitDist);
mcTankA._y = mcPlanet._y + (Math.sin(((mcTankA.angle - 90) * Math.PI) / 180) * unitOrbitDist);
mcTankA._xscale = (mcTankA._yscale = pScale * 10);
mcTankA._rotation = mcTankA.angle;
mcTankB._x = mcPlanet._x + (Math.cos(((mcTankB.angle - 90) * Math.PI) / 180) * unitOrbitDist);
mcTankB._y = mcPlanet._y + (Math.sin(((mcTankB.angle - 90) * Math.PI) / 180) * unitOrbitDist);
mcTankB._xscale = (mcTankB._yscale = pScale * 10);
mcTankB._rotation = mcTankB.angle;
}
function resetUnits() {
mcTankA._visible = false;
mcTankA.inPlay = false;
mcTankA._rotation = nTankAinit;
mcTankB._visible = false;
mcTankB.inPlay = false;
mcTankB._rotation = nTankBinit;
mcGunBase._visible = true;
}
function setUnits(nLevel) {
switch (nLevel) {
case 1 :
case 2 :
case 3 :
bMultipleUnits = false;
mcUnitCursor._visible = false;
mcGunBase.inPlay = true;
mcTankA.inPlay = false;
mcTankB.inPlay = false;
nSelectedUnit = 0;
updateUnitSelection();
break;
case 4 :
bMultipleUnits = true;
mcUnitCursor._visible = true;
mcGunBase.inPlay = false;
mcTankA.inPlay = true;
mcTankB.inPlay = true;
nSelectedUnit = 1;
updateUnitSelection();
break;
case 5 :
bMultipleUnits = false;
mcUnitCursor._visible = false;
mcGunBase.inPlay = true;
mcTankA.inPlay = false;
mcTankB.inPlay = false;
nSelectedUnit = 0;
updateUnitSelection();
break;
case 6 :
bMultipleUnits = true;
mcUnitCursor._visible = true;
mcGunBase.inPlay = false;
mcTankA.inPlay = true;
mcTankB.inPlay = true;
nSelectedUnit = 1;
updateUnitSelection();
break;
case 7 :
bMultipleUnits = true;
mcGunBase.inPlay = false;
mcTankA.inPlay = false;
mcTankB.inPlay = false;
mcTankA.bMovable = false;
mcTankB.bMovable = false;
mcTankA.tankTurret._rotation = 0;
mcTankB.tankTurret._rotation = 0;
if (nTankAID == null) {
nTankAID = setInterval(addTankAInterval, 25);
bTankAMovement = true;
}
if (nTankBID == null) {
nTankBID = setInterval(addTankBInterval, 25);
bTankBMovement = true;
}
mcTankA.angle = -45;
mcTankB.angle = 45;
scaleTanks();
break;
case 8 :
bMultipleUnits = true;
mcUnitCursor._visible = true;
mcGunBase.inPlay = false;
mcTankA.inPlay = true;
mcTankB.inPlay = true;
updateUnitSelection();
break;
case 9 :
bMultipleUnits = true;
mcGunBase.inPlay = false;
mcTankA.inPlay = false;
mcTankB.inPlay = false;
mcTankA.bMovable = false;
mcTankB.bMovable = false;
mcTankA.tankTurret._rotation = 0;
mcTankB.tankTurret._rotation = 0;
if (nTankAID == null) {
nTankAID = setInterval(addTankAInterval, 25);
bTankAMovement = true;
}
if (nTankBID == null) {
nTankBID = setInterval(addTankBInterval, 25);
bTankBMovement = true;
}
mcTankA.angle = -45;
mcTankB.angle = 45;
scaleTanks();
break;
case 10 :
case 11 :
case 12 :
case 13 :
case 14 :
case 15 :
bMultipleUnits = true;
mcUnitCursor._visible = true;
mcGunBase.inPlay = false;
mcTankA.inPlay = true;
mcTankB.inPlay = true;
updateUnitSelection();
}
}
function updateUnitSelection() {
switch (nSelectedUnit) {
case 0 :
updateMissile();
updateGunBase();
yMouseBounds = mcGunBase._y;
if (mcCursor._y > mcGunBase._y) {
mcCursor._y = mcGunBase._y;
}
mcGunBase.bMovable = true;
mcTankA.bMovable = false;
mcTankB.bMovable = false;
return;
case 1 :
updateMissile();
updateTankA();
yMouseBounds = mcTankA._y;
mcUnitCursor._x = mcTankA._x + 15;
mcUnitCursor._y = mcTankA._y + 40;
if (mcCursor._y > mcTankA._y) {
mcCursor._y = mcTankA._y;
}
mcGunBase.bMovable = false;
mcTankA.bMovable = true;
mcTankB.bMovable = false;
if (bHelp && (mcHelpWinC.bShown == false)) {
mcHelpWinC.bShown = true;
pauseGame(false);
bGameKeys = false;
mcStoryScreen._visible = true;
mcHelpWinC.helpWinKey.text = sWinKey1;
mcHelpWinC._visible = true;
mcHelpWinC._x = mcTankB._x - 50;
mcHelpWinC._y = mcTankB._y - (mcHelpWinC._height / 2);
mcHelpWinE.helpWinKeyA.text = sWinKey4;
mcHelpWinE.helpWinKeyB.text = sWinKey5;
mcHelpWinE._visible = true;
mcHelpWinE._x = Stage.width / 2;
mcHelpWinE._y = 250;
nHelpCIntervalID = setInterval(clearHelpWin, 10000, 1);
}
return;
case 2 :
updateMissile();
updateTankB();
yMouseBounds = mcTankB._y;
mcUnitCursor._x = mcTankB._x - 15;
mcUnitCursor._y = mcTankB._y + 40;
if (mcCursor._y > mcTankB._y) {
mcCursor._y = mcTankB._y;
}
mcGunBase.bMovable = false;
mcTankA.bMovable = false;
mcTankB.bMovable = true;
if (!(bHelp && (mcHelpWinC.bShown == false))) {
break;
}
mcHelpWinC.bShown = true;
pauseGame(false);
bGameKeys = false;
mcStoryScreen._visible = true;
mcHelpWinC.helpWinKey.text = sWinKey1;
mcHelpWinC._visible = true;
mcHelpWinC._x = mcTankA._x - 25;
mcHelpWinC._y = mcTankA._y - (mcHelpWinC._height / 2);
mcHelpWinE.helpWinKeyA.text = sWinKey4;
mcHelpWinE.helpWinKeyB.text = sWinKey5;
mcHelpWinE._visible = true;
mcHelpWinE._x = Stage.width / 2;
mcHelpWinE._y = 250;
nHelpCIntervalID = setInterval(clearHelpWin, 10000, 1);
}
}
function toggleUnitSelection() {
mcUnitCursor.gotoAndPlay(2);
switch (nSelectedUnit) {
case 1 :
if (mcTankB.inPlay) {
nSelectedUnit = 2;
updateUnitSelection();
}
return;
case 2 :
if (!mcTankA.inPlay) {
break;
}
nSelectedUnit = 1;
updateUnitSelection();
}
}
function setGameInterval() {
if (nGameIntervalID == null) {
nGameIntervalID = setInterval(gameInterval, 1500);
}
}
function setBossAInterval() {
if (nBossAIntervalID == null) {
nBossAIntervalID = setInterval(bossAInterval, 1500);
}
}
function setBossBInterval() {
if (nBossBIntervalID == null) {
nBossBIntervalID = setInterval(bossBInterval, 1500);
}
}
function setTargetInterval() {
if (nTargetID == null) {
nTargetID = setInterval(targetInterval, 350);
}
}
function clearGameInterval() {
if (nGameIntervalID != null) {
clearInterval(nGameIntervalID);
nGameIntervalID = null;
}
}
function clearBossAInterval() {
if (nBossAIntervalID != null) {
clearInterval(nBossAIntervalID);
nBossAIntervalID = null;
}
}
function clearBossBInterval() {
if (nBossBIntervalID != null) {
clearInterval(nBossBIntervalID);
nBossBIntervalID = null;
}
}
function clearTargetInterval() {
if (nTargetID != null) {
clearInterval(nTargetID);
nTargetID = null;
}
}
function clearAutoFireInterval() {
if (nAutoFireID != null) {
clearInterval(nAutoFireID);
nAutoFireID = null;
}
}
function calcAlienLifeSpan(bRemoveAll) {
var _local1 = 0;
while (_local1 < aAliens.length) {
if ((aAliens[_local1].inPlay == false) && (aAliens[_local1].inPool == false)) {
if (aAliens[_local1].bFaded || (bRemoveAll)) {
aAliens[_local1].removeAlien();
} else {
aAliens[_local1].growAlien();
}
}
_local1++;
}
}
function genRandParamA() {
return(Math.floor(Math.random() * 2));
}
function genRandParamB(nMax) {
return(Math.floor(1 + (Math.random() * nMax)));
}
function genRandParamC(nLevel) {
switch (nLevel) {
case 1 :
return(100);
case 2 :
return(50);
}
return(0);
}
function bossAInterval() {
if ((nPowerUpTimer != null) && (nPowerUpTimer > 0)) {
nPowerUpTimer--;
} else {
powerUpMode = 0;
}
if (gLevel.bFaded == true) {
clearBossAInterval();
} else {
calcAlienLifeSpan(false);
if (nBossPowerUps < 1) {
addAlienMine(genRandParamA(), genRandParamC(gLevel.nLevel), true);
nBossPowerUps++;
}
if (nBossMines < 3) {
addAlienMine(genRandParamA(), genRandParamC(gLevel.nLevel), false);
nBossMines++;
}
}
var _local2 = 0;
var _local1 = 0;
while (_local1 < aBuildings.length) {
if (aBuildings[_local1].inPlay) {
_local2++;
}
_local1++;
}
if (mcBossA.bBossDefeated) {
if (gLevel.bFaded == false) {
fadeAliens();
gLevel.bFaded = true;
} else {
bonusTransition();
}
} else if (_local2 < 4) {
if (gLevel.bFaded == false) {
fadeAliens();
gLevel.bFaded = true;
} else {
pauseGame(false);
gameOverTransition();
}
}
}
function bossBInterval() {
if ((nPowerUpTimer != null) && (nPowerUpTimer > 0)) {
nPowerUpTimer--;
} else {
powerUpMode = 0;
}
if (gLevel.bFaded == true) {
clearBossBInterval();
} else {
calcAlienLifeSpan(false);
if (nBossPowerUps < 1) {
addAlienMine(genRandParamA(), genRandParamC(gLevel.nLevel), true);
nBossPowerUps++;
}
if (nBossMines < 3) {
addAlienMine(genRandParamA(), genRandParamC(gLevel.nLevel), false);
nBossMines++;
}
if (((mcBossBEscortA.inPlay == false) && (mcBossB._y <= mcBossB.maxHeight)) && (mcBossB.inPlay)) {
addAlienShipEscort(mcBossB._x, mcBossB._y, true);
}
if (((mcBossBEscortB.inPlay == false) && (mcBossB._y <= mcBossB.maxHeight)) && (mcBossB.inPlay)) {
addAlienShipEscort(mcBossB._x, mcBossB._y, false);
}
}
var _local2 = 0;
var _local1 = 0;
while (_local1 < aPortBuildings.length) {
if (aPortBuildings[_local1].inPlay) {
_local2++;
}
_local1++;
}
if (mcBossB.bBossDefeated) {
if (gLevel.bFaded == false) {
fadeAliens();
gLevel.bFaded = true;
} else {
bonusTransition();
}
} else if (_local2 < 2) {
if (gLevel.bFaded == false) {
fadeAliens();
gLevel.bFaded = true;
} else {
pauseGame(false);
gameOverTransition();
}
}
}
function gameIntervalLocA() {
var _local2 = 0;
nLineTimer++;
if ((nLineTimer % 4) == 0) {
mcPowerLines.line1.gotoAndPlay(2);
mcPowerLines.line2.gotoAndPlay(2);
mcPowerLines.line3.gotoAndPlay(2);
mcPowerLines.line4.gotoAndPlay(2);
mcPowerLines.line5.gotoAndPlay(2);
mcPowerLines.line6.gotoAndPlay(2);
}
var _local1 = 0;
while (_local1 < aBuildings.length) {
if (aBuildings[_local1].inPlay) {
_local2++;
if (aBuildings[_local1].buildingType == 1) {
nPowerRegen = nPowerRegen + 0.1;
}
}
_local1++;
}
if (_local2 < 5) {
if (nGameMode == 0) {
if (gLevel.bFaded == false) {
fadeLevelTransition();
gLevel.bFaded = true;
gLevel.bGameOver = true;
} else {
pauseGameTransition();
mcBossBLazerB.bGameOver = true;
switchModes(7);
}
} else if (nGameMode == 1) {
if (gLevel.bFaded == false) {
fadeLevelTransition();
gLevel.bFaded = true;
gLevel.bGameOver = true;
} else {
gameOverTransition();
}
}
}
}
function gameIntervalLocB() {
var _local2 = 0;
var _local1 = 0;
while (_local1 < aDomeBuildings.length) {
if (aDomeBuildings[_local1].inPlay) {
_local2++;
}
_local1++;
}
if (_local2 < 4) {
if (gLevel.bFaded == false) {
fadeLevelTransition();
gLevel.bFaded = true;
mcAreaWasted._x = mcAreaWasted.xPos;
mcAreaWasted._y = mcAreaWasted.yPos;
mcAreaWasted._visible = true;
mcAreaWasted.gotoAndPlay(1);
} else {
gLevel.nLocation = 0;
gLevel.bSwitchLocation = true;
}
}
}
function gameIntervalLocC() {
var _local2 = 0;
var _local1 = 0;
while (_local1 < aPortBuildings.length) {
if (aPortBuildings[_local1].inPlay) {
_local2++;
}
_local1++;
}
if (_local2 < 4) {
if (gLevel.bFaded == false) {
fadeLevelTransition();
gLevel.bFaded = true;
gLevel.bGameOver = true;
} else {
gameOverTransition();
}
}
}
function gameInterval() {
if ((nPowerUpTimer != null) && (nPowerUpTimer > 0)) {
nPowerUpTimer--;
} else {
powerUpMode = 0;
}
nPowerRegen = 0;
if (gLevel.bFaded == true) {
clearGameInterval();
} else {
calcAlienLifeSpan(false);
gLevel.updateIntervals();
generateAlienInterval();
}
switch (nGameLocation) {
case 0 :
gameIntervalLocA();
break;
case 1 :
gameIntervalLocB();
break;
case 2 :
gameIntervalLocC();
}
if ((gLevel.bBossLevel || (gLevel.bSwitchLocation)) && (gLevel.bGameOver == false)) {
if (gLevel.bFaded == false) {
fadeLevelTransition();
gLevel.bFaded = true;
} else {
gLevel.bNewLevel = true;
}
}
if (gLevel.bNewLevel) {
if (gLevel.bBossLevel || (gLevel.bSwitchLocation)) {
bonusTransition();
} else {
bonusNormal();
}
gLevel.bNewLevel = false;
}
switch (gLevel.nLevel) {
case 1 :
if ((((aBuildings[7].inPlay == false) && (aBuildings[10].inPlay == false)) && (aBuildings[20].inPlay == false)) && (aBuildings[24].inPlay == false)) {
if (nBonusID == null) {
nBonusID = setInterval(bonusNormal, 4000);
}
mcTowersInfected._x = mcTowersInfected.xPos;
mcTowersInfected._y = mcTowersInfected.yPos;
mcTowersInfected._visible = true;
mcTowersInfected.gotoAndPlay(1);
}
return;
case 9 :
case 10 :
if (!(((aPortBuildings[5].inPlay == false) && (aPortBuildings[8].inPlay == false)) && (aPortBuildings[16].inPlay == false))) {
break;
}
if (nBonusID == null) {
nBonusID = setInterval(bonusNormal, 4000);
}
mcTowersInfected._x = mcTowersInfected.xPos;
mcTowersInfected._y = mcTowersInfected.yPos;
mcTowersInfected._visible = true;
mcTowersInfected.gotoAndPlay(1);
}
}
function fadeLevelTransition() {
fadeAliens();
if (nEffectID == null) {
bEffect = true;
nEffectType = 0;
nEffectID = setInterval(fadeOutAlienBombs, 50);
} else {
mcAPIe.clear();
clearInterval(nEffectID);
bEffect = true;
nEffectType = 0;
nEffectID = setInterval(fadeOutAlienBombs, 50);
}
}
function gameOverTransition() {
pauseGameTransition();
mcStoryScreen._visible = true;
mcGameOver._x = mcGameOver.xPos;
mcGameOver._y = mcGameOver.yPos;
mcGameOver._visible = true;
mcGameOver.gotoAndPlay(1);
if (nGameOverID == null) {
nGameOverID = setInterval(resetGameOver, 4500);
}
}
function bonusNormal() {
mcTowersInfected.removeMessage();
bGameKeys = false;
pauseGame(false);
mcLevelBonus._x = mcLevelBonus.xPos;
mcLevelBonus._y = mcLevelBonus.yPos;
mcLevelBonus._visible = true;
mcLevelBonus.gotoAndPlay(1);
if (nBonusID == null) {
nBonusID = setInterval(calcBonus, 500, false, false);
} else {
clearInterval(nBonusID);
nBonusID = setInterval(calcBonus, 500, false, false);
}
}
function bonusTransition() {
mcAreaWasted.removeMessage();
bGameKeys = false;
pauseGameTransition();
mcLevelBonus._x = mcLevelBonus.xPos;
mcLevelBonus._y = mcLevelBonus.yPos;
mcLevelBonus._visible = true;
mcLevelBonus.gotoAndPlay(1);
if (gLevel.bBossLevel || (gLevel.nLevel == 15)) {
if (nBonusID == null) {
nBonusID = setInterval(calcBonus, 500, true, false);
}
} else if (nBonusID == null) {
nBonusID = setInterval(calcBonus, 500, false, true);
}
}
function pauseGameTransition() {
calcAlienLifeSpan(true);
gLevel.bFaded = false;
mcAPIa.clear();
mcAPIp.clear();
plLaser.reset();
alLaser.reset();
nLasers = 0;
clearGameInterval();
clearBossAInterval();
clearBossBInterval();
clearTargetInterval();
clearAutoFireInterval();
bGameInPlay = false;
bPaused = true;
bGameKeys = false;
hideGameCursor();
mcUnitCursor._visible = false;
hideStatus();
hidePowerUps();
clearHelpWinB();
}
function unPauseGameTransition() {
bGameInPlay = true;
bPaused = false;
showStatus(false);
showGameCursor();
bGameKeys = true;
mcStoryScreen._visible = false;
setTargetInterval();
}
function generateAlienInterval() {
if (gLevel.bGen) {
if (gLevel.bGenTypeA) {
i = 0;
while (i < gLevel.nGenTypeA) {
addAlienSquid();
i++;
}
gLevel.bGenTypeA = false;
}
if (gLevel.bGenTypeB) {
i = 0;
while (i < gLevel.nGenTypeB) {
if (addAlienSpitter(genRandParamB(5), genRandParamB(5), genRandParamA())) {
if (bSound) {
sndSpitterWarning.start();
}
}
i++;
}
gLevel.bGenTypeB = false;
}
if (gLevel.bGenTypeC) {
i = 0;
while (i < gLevel.nGenTypeC) {
addAlienMine(genRandParamA(), genRandParamC(gLevel.nLevel), true);
i++;
}
gLevel.bGenTypeC = false;
}
if (gLevel.bGenTypeD) {
i = 0;
while (i < gLevel.nGenTypeD) {
addAlienMine(genRandParamA(), genRandParamC(gLevel.nLevel), false);
i++;
}
gLevel.bGenTypeD = false;
}
if (gLevel.bGenTypeE) {
i = 0;
while (i < gLevel.nGenTypeE) {
addAlienBrain(genRandParamB(3), genRandParamB(5), genRandParamA());
i++;
}
gLevel.bGenTypeE = false;
}
if (gLevel.bGenTypeF) {
i = 0;
while (i < gLevel.nGenTypeF) {
if (addAlienShip(genRandParamB(2), genRandParamA(), false)) {
if (bSound) {
sndShipWarning.start();
}
}
i++;
}
gLevel.bGenTypeF = false;
}
if (gLevel.bGenTypeG) {
i = 0;
while (i < gLevel.nGenTypeG) {
if (addAlienShip(genRandParamB(2), genRandParamA(), true)) {
if (bSound) {
sndShipWarning.start();
}
}
i++;
}
gLevel.bGenTypeG = false;
}
gLevel.bGen = false;
}
}
function calcBonus(bBossLevel, bSwitchLocation) {
clearInterval(nBonusID);
nBonusID = null;
mcTowersInfected.removeMessage();
mcAreaWasted.removeMessage();
nBonusInterval = 0;
mcBonusScreen._visible = true;
var _local3 = 0;
var _local2 = 0;
var _local4 = 0;
var _local7 = null;
var _local6 = null;
var _local10 = null;
var _local9 = null;
var _local8 = null;
var _local11 = null;
var _local5 = 0;
mcBonusScreen.accuracyBonus._visible = false;
mcBonusScreen.bossBonus._visible = false;
mcBonusScreen.levelReady._visible = false;
bGameKeys = false;
hideStatus();
mcUnitCursor._visible = false;
hidePowerUps();
switch (nGameLocation) {
case 0 :
_local7 = 1000;
_local6 = 750;
_local10 = 500;
var _local1 = 0;
while (_local1 < aBuildings.length) {
if (aBuildings[_local1].inPlay) {
switch (aBuildings[_local1].buildingType) {
case 0 :
_local3++;
break;
case 1 :
_local2++;
break;
case 2 :
_local4++;
}
}
_local1++;
}
break;
case 1 :
_local7 = 1500;
_local6 = 500;
_local1 = 0;
while (_local1 < aDomeBuildings.length) {
if (aDomeBuildings[_local1].inPlay) {
switch (aDomeBuildings[_local1].buildingType) {
case 0 :
_local3++;
break;
case 1 :
_local2++;
}
}
_local1++;
}
break;
case 2 :
_local7 = 1000;
_local6 = 750;
_local10 = 500;
_local1 = 0;
for(;;){
if (_local1 >= aPortBuildings.length) {
break;
}
if (aPortBuildings[_local1].inPlay) {
switch (aPortBuildings[_local1].buildingType) {
case 0 :
_local3++;
break;
case 1 :
_local2++;
break;
case 2 :
_local4++;
}
}
_local1++;
};
}
_local9 = _local3 * _local7;
_local8 = _local2 * _local6;
if (_local10 != null) {
_local11 = _local4 * _local10;
}
if (gLevel.nLasersFired > 0) {
if (Math.ceil((gLevel.nLasersHit / gLevel.nLasersFired) * 100) > 100) {
_local5 = 5000;
} else if (Math.ceil((gLevel.nLasersHit / gLevel.nLasersFired) * 100) > 90) {
_local5 = 2500;
}
}
if (gLevel.nLevel == 8) {
_local5 = _local5 + mcBossA.bossScore;
} else if (gLevel.nLevel == 15) {
_local5 = _local5 + mcBossB.bossScore;
}
switch (nGameLocation) {
case 0 :
mcBonusScreen.bonusTextA._visible = true;
mcBonusScreen.bonusTextA.type0.text = String(_local3);
mcBonusScreen.bonusTextA.type1.text = String(_local2);
mcBonusScreen.bonusTextA.type2.text = String(_local4);
mcBonusScreen.bonusTextA.mult0.text = String(_local7);
mcBonusScreen.bonusTextA.mult1.text = String(_local6);
mcBonusScreen.bonusTextA.mult2.text = String(_local10);
mcBonusScreen.bonusTextA.bonus0.text = String(_local9);
mcBonusScreen.bonusTextA.bonus1.text = String(_local8);
mcBonusScreen.bonusTextA.bonus2.text = String(_local11);
if (nBonusID == null) {
nBonusID = setInterval(calcBonusInterval, 50, bBossLevel, bSwitchLocation, true, 0, _local9, _local8, _local11, _local5);
}
break;
case 1 :
mcBonusScreen.bonusTextB._visible = true;
mcBonusScreen.bonusTextB.type0.text = String(_local3);
mcBonusScreen.bonusTextB.type1.text = String(_local2);
mcBonusScreen.bonusTextB.mult0.text = String(_local7);
mcBonusScreen.bonusTextB.mult1.text = String(_local6);
mcBonusScreen.bonusTextB.bonus0.text = String(_local9);
mcBonusScreen.bonusTextB.bonus1.text = String(_local8);
if (nBonusID == null) {
nBonusID = setInterval(calcBonusInterval, 50, bBossLevel, bSwitchLocation, false, 1, _local9, _local8, _local11, _local5);
}
break;
case 2 :
mcBonusScreen.bonusTextC._visible = true;
mcBonusScreen.bonusTextC.type0.text = String(_local3);
mcBonusScreen.bonusTextC.type1.text = String(_local2);
mcBonusScreen.bonusTextC.type2.text = String(_local4);
mcBonusScreen.bonusTextC.mult0.text = String(_local7);
mcBonusScreen.bonusTextC.mult1.text = String(_local6);
mcBonusScreen.bonusTextC.mult2.text = String(_local10);
mcBonusScreen.bonusTextC.bonus0.text = String(_local9);
mcBonusScreen.bonusTextC.bonus1.text = String(_local8);
mcBonusScreen.bonusTextC.bonus2.text = String(_local11);
if (nBonusID != null) {
break;
}
nBonusID = setInterval(calcBonusInterval, 50, bBossLevel, bSwitchLocation, true, 2, _local9, _local8, _local11, _local5);
}
}
function calcBonusInterval(bBossLevel, bSwitchLocation, bShowLastRow, nUpdateFlag, nBonus0, nBonus1, nBonus2, nBonusA) {
nBonusInterval++;
switch (nBonusInterval) {
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
case 7 :
case 8 :
case 9 :
case 10 :
calcBonusIntervalRowA(nUpdateFlag, true, nBonus0);
calcBonusIntervalRowB(nUpdateFlag, true, nBonus1);
if (bShowLastRow) {
calcBonusIntervalRowC(nUpdateFlag, true, nBonus2);
}
break;
case 11 :
case 12 :
case 13 :
case 14 :
case 15 :
case 16 :
case 17 :
case 18 :
case 19 :
case 20 :
calcBonusIntervalRowA(nUpdateFlag, false, nBonus0);
calcBonusIntervalRowB(nUpdateFlag, true, nBonus1);
if (bShowLastRow) {
calcBonusIntervalRowC(nUpdateFlag, true, nBonus2);
}
break;
case 21 :
case 22 :
case 23 :
case 24 :
case 25 :
case 26 :
case 27 :
case 28 :
case 29 :
case 30 :
calcBonusIntervalRowA(nUpdateFlag, false, nBonus0);
calcBonusIntervalRowB(nUpdateFlag, false, nBonus1);
if (bShowLastRow) {
calcBonusIntervalRowC(nUpdateFlag, true, nBonus2);
}
break;
case 31 :
case 32 :
case 33 :
case 34 :
case 35 :
case 36 :
case 37 :
case 38 :
case 39 :
case 40 :
calcBonusIntervalRowA(nUpdateFlag, false, nBonus0);
calcBonusIntervalRowB(nUpdateFlag, false, nBonus1);
if (bShowLastRow) {
calcBonusIntervalRowC(nUpdateFlag, false, nBonus2);
}
break;
case 50 :
if (gLevel.nLasersFired > 0) {
if ((gLevel.nLevel == 8) || (gLevel.nLevel == 15)) {
mcBonusScreen.bossBonus._visible = true;
} else if (Math.ceil((gLevel.nLasersHit / gLevel.nLasersFired) * 100) > 90) {
mcBonusScreen.accuracyBonus._visible = true;
}
mcBonusScreen.accuracy.text = String(Math.ceil((gLevel.nLasersHit / gLevel.nLasersFired) * 100) + "%");
mcTotalScreen.submitAccuracy(Math.ceil((gLevel.nLasersHit / gLevel.nLasersFired) * 100));
} else {
mcBonusScreen.accuracy.text = "N/A";
mcTotalScreen.submitAccuracy(0);
}
break;
case 55 :
var _local2 = null;
if (bShowLastRow) {
_local2 = ((nBonus0 + nBonus1) + nBonus2) + nBonusA;
} else {
_local2 = (nBonus0 + nBonus1) + nBonusA;
}
if (gLevel.nLasersFired > 0) {
_local2 = _local2 * (Math.ceil((gLevel.nLasersHit / gLevel.nLasersFired) * 50) * 0.1);
} else {
_local2 = 0;
}
nScore = nScore + _local2;
mcBonusScreen.totalBonus.text = String(_local2);
mcBonusScreen.levelReady._visible = true;
}
if (nBonusInterval > 100) {
mcBonusScreen._visible = false;
mcLevelBonus.removeMessage();
mcBonusScreen.bonusTextA._visible = false;
mcBonusScreen.bonusTextB._visible = false;
mcBonusScreen.bonusTextC._visible = false;
mcBonusScreen.accuracy.text = "";
mcBonusScreen.totalBonus.text = "";
clearInterval(nBonusID);
nBonusID = null;
if (bBossLevel) {
if (gLevel.nLevel == 15) {
switchModes(13);
} else {
switch (gLevel.nBossLocation) {
case 0 :
switchModes(5);
break;
case 1 :
switchModes(7);
break;
case 2 :
switchModes(12);
}
}
} else if (bSwitchLocation) {
if (gLevel.nLevel == 8) {
gLevel.nLocation = 2;
switchLocation(gLevel.nLocation);
} else {
switchLocation(gLevel.nLocation);
}
} else {
nextLevel();
if (gLevel.nLocation == 0) {
showStatus(true);
} else {
showStatus(false);
}
showGameCursor();
bGameKeys = true;
unPauseGame(false);
}
}
}
function calcBonusIntervalRowA(nUpdateFlag, bRand, nBonus) {
switch (nUpdateFlag) {
case 0 :
if (bRand) {
mcBonusScreen.bonusTextA.bonus0.text = String(Math.floor(Math.random() * 5000));
} else {
mcBonusScreen.bonusTextA.bonus0.text = String(nBonus);
}
break;
case 1 :
if (bRand) {
mcBonusScreen.bonusTextB.bonus0.text = String(Math.floor(Math.random() * 5000));
} else {
mcBonusScreen.bonusTextB.bonus0.text = String(nBonus);
}
break;
case 2 :
if (bRand) {
mcBonusScreen.bonusTextC.bonus0.text = String(Math.floor(Math.random() * 5000));
} else {
mcBonusScreen.bonusTextC.bonus0.text = String(nBonus);
}
}
}
function calcBonusIntervalRowB(nUpdateFlag, bRand, nBonus) {
switch (nUpdateFlag) {
case 0 :
if (bRand) {
mcBonusScreen.bonusTextA.bonus1.text = String(Math.floor(Math.random() * 5000));
} else {
mcBonusScreen.bonusTextA.bonus1.text = String(nBonus);
}
break;
case 1 :
if (bRand) {
mcBonusScreen.bonusTextB.bonus1.text = String(Math.floor(Math.random() * 5000));
} else {
mcBonusScreen.bonusTextB.bonus1.text = String(nBonus);
}
break;
case 2 :
if (bRand) {
mcBonusScreen.bonusTextC.bonus1.text = String(Math.floor(Math.random() * 5000));
} else {
mcBonusScreen.bonusTextC.bonus1.text = String(nBonus);
}
}
}
function calcBonusIntervalRowC(nUpdateFlag, bRand, nBonus) {
switch (nUpdateFlag) {
case 0 :
if (bRand) {
mcBonusScreen.bonusTextA.bonus2.text = String(Math.floor(Math.random() * 5000));
} else {
mcBonusScreen.bonusTextA.bonus2.text = String(nBonus);
}
break;
case 1 :
if (bRand) {
mcBonusScreen.bonusTextB.bonus2.text = String(Math.floor(Math.random() * 5000));
} else {
mcBonusScreen.bonusTextB.bonus2.text = String(nBonus);
}
break;
case 2 :
if (bRand) {
mcBonusScreen.bonusTextC.bonus2.text = String(Math.floor(Math.random() * 5000));
} else {
mcBonusScreen.bonusTextC.bonus2.text = String(nBonus);
}
}
}
function nextLevel() {
showMessage(0, gLevel.nLevel);
if (nIntervalID == null) {
nIntervalID = setInterval(showMessage, 1500, 1, gLevel.nLevel);
}
gLevel.setLevel(gLevel.nLevel + 1);
updateStatusLevel();
setUnits(gLevel.nLevel);
showPowerUps();
}
function targetInterval() {
var _local1 = false;
switch (oPowerUp.selectedPowerUp) {
case 3 :
if (gLevel.nLevel == 8) {
if (bossATargetLock(mcCursor._x, mcCursor._y, nTargetLock, true)) {
_local1 = true;
}
} else if (gLevel.nLevel == 15) {
if (bossBTargetLock(mcCursor._x, mcCursor._y, nTargetLock, true)) {
_local1 = true;
}
} else if (pTargetLock(mcCursor._x, mcCursor._y, nTargetLock, true)) {
_local1 = true;
}
if (_local1) {
bTargetUpdate = true;
if (bTargetLock) {
if (bHelp) {
clearHelpWinB();
mcHelpWinB.helpWinKey.text = sWinKey3;
mcHelpWinB._visible = true;
mcHelpWinB.inPlay = true;
}
mcTargetCursor._visible = true;
mcTargetCursor.gotoAndPlay(1);
}
} else {
if (bHelp && (mcHelpWinB._visible == true)) {
mcHelpWinB.removeHelpWin(false);
}
nTargetLock = null;
bTargetUpdate = false;
mcTargetCursor._visible = false;
}
break;
case 4 :
if (gLevel.nLevel == 8) {
if (bossATargetLock(mcCursor._x, mcCursor._y, nTargetLock, false)) {
_local1 = true;
}
} else if (gLevel.nLevel == 15) {
if (bossBTargetLock(mcCursor._x, mcCursor._y, nTargetLock, false)) {
_local1 = true;
}
} else if (pTargetLock(mcCursor._x, mcCursor._y, nTargetLock, false)) {
_local1 = true;
}
if (_local1) {
bTargetUpdate = true;
if (bTargetLock) {
if (bHelp) {
clearHelpWinB();
mcHelpWinB.helpWinKey.text = sWinKey3;
mcHelpWinB._visible = true;
mcHelpWinB.inPlay = true;
}
mcTargetCursor._visible = true;
mcTargetCursor.gotoAndPlay(1);
}
} else {
if (bHelp && (mcHelpWinB._visible == true)) {
mcHelpWinB.removeHelpWin(false);
}
nTargetLock = null;
bTargetUpdate = false;
mcTargetCursor._visible = false;
}
break;
default :
nTargetLock = null;
bTargetUpdate = false;
mcTargetCursor._visible = false;
}
}
function addTankAInterval() {
mcTankA.moveRight();
mcTankA.wheelA._rotation = mcTankA.wheelA._rotation + 2;
mcTankA.wheelB._rotation = mcTankA.wheelB._rotation + 2;
mcTankA.wheelC._rotation = mcTankA.wheelC._rotation + 2;
mcTankA.tankBase._y = mcTankA.origBasePos - (Math.sin(mcTankA.sinAngle) * mcTankA.bounce);
scaleTanks();
if (mcTankA.angle > -25) {
clearInterval(nTankAID);
bTankAMovement = false;
nTankAID = null;
mcTankA.inPlay = true;
mcTankA.bMovable = true;
nSelectedUnit = 1;
updateUnitSelection();
mcUnitCursor._visible = true;
showGameCursor();
}
}
function addTankBInterval() {
mcTankB.moveLeft();
mcTankB.wheelA._rotation = mcTankB.wheelA._rotation - 2;
mcTankB.wheelB._rotation = mcTankB.wheelB._rotation - 2;
mcTankB.wheelC._rotation = mcTankB.wheelC._rotation - 2;
mcTankB.tankBase._y = mcTankB.origBasePos - (Math.sin(mcTankB.sinAngle) * mcTankB.bounce);
scaleTanks();
if (mcTankB.angle < 25) {
clearInterval(nTankBID);
bTankBMovement = false;
nTankBID = null;
mcTankB.inPlay = true;
mcTankB.bMovable = true;
}
}
function lazerEffectInterval(xPos, yPos) {
if (aAliens[lazerPoint.i].inPlay) {
switch (lazerPoint.j) {
case 0 :
mcAPIe.clear();
mcAPIe.lineStyle(2, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(aAliens[lazerPoint.i]._x, aAliens[lazerPoint.i]._y);
break;
case 1 :
mcAPIe.clear();
mcAPIe.lineStyle(3, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(aAliens[lazerPoint.i]._x, aAliens[lazerPoint.i]._y);
break;
case 2 :
case 3 :
mcAPIe.clear();
mcAPIe.lineStyle(4, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(aAliens[lazerPoint.i]._x, aAliens[lazerPoint.i]._y);
mcAPIe.lineStyle(2, 16751052, 100);
mcAPIe.lineTo(xPos, yPos);
break;
case 4 :
mcAPIe.clear();
mcAPIe.lineStyle(3, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(aAliens[lazerPoint.i]._x, aAliens[lazerPoint.i]._y);
break;
default :
mcAPIe.clear();
clearInterval(nEffectID);
nEffectID = null;
switch (nSelectedUnit) {
case 0 :
mcGunBase.bMovable = true;
break;
case 1 :
mcTankA.bMovable = true;
break;
case 2 :
mcTankB.bMovable = true;
}
bEffect = false;
addBomb(aAliens[lazerPoint.i]._x, aAliens[lazerPoint.i]._y, 200, null);
}
lazerPoint.j++;
} else {
mcAPIe.clear();
clearInterval(nEffectID);
nEffectID = null;
switch (nSelectedUnit) {
case 0 :
mcGunBase.bMovable = true;
break;
case 1 :
mcTankA.bMovable = true;
break;
case 2 :
mcTankB.bMovable = true;
}
bEffect = false;
}
}
function lazerEffectIntervalA(xPos, yPos) {
var _local5 = false;
var _local2 = null;
var _local1 = null;
switch (lazerPoint.i) {
case -1 :
if (mcBossA.inPlay && (mcBossA.bLocked)) {
_local5 = true;
_local2 = mcBossA._x;
_local1 = mcBossA._y;
}
break;
default :
if (!aAliens[lazerPoint.i].inPlay) {
break;
}
_local5 = true;
_local2 = aAliens[lazerPoint.i]._x;
_local1 = aAliens[lazerPoint.i]._y;
}
if (_local5) {
switch (lazerPoint.j) {
case 0 :
mcAPIe.clear();
mcAPIe.lineStyle(2, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(_local2, _local1);
break;
case 1 :
mcAPIe.clear();
mcAPIe.lineStyle(3, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(_local2, _local1);
break;
case 2 :
case 3 :
mcAPIe.clear();
mcAPIe.lineStyle(4, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(_local2, _local1);
mcAPIe.lineStyle(2, 16751052, 100);
mcAPIe.lineTo(xPos, yPos);
break;
case 4 :
mcAPIe.clear();
mcAPIe.lineStyle(3, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(_local2, _local1);
break;
default :
mcAPIe.clear();
clearInterval(nEffectID);
nEffectID = null;
switch (nSelectedUnit) {
case 0 :
mcGunBase.bMovable = true;
break;
case 1 :
mcTankA.bMovable = true;
break;
case 2 :
mcTankB.bMovable = true;
}
bEffect = false;
addBomb(_local2, _local1, 200, null);
}
lazerPoint.j++;
} else {
mcAPIe.clear();
clearInterval(nEffectID);
nEffectID = null;
switch (nSelectedUnit) {
case 0 :
mcGunBase.bMovable = true;
break;
case 1 :
mcTankA.bMovable = true;
break;
case 2 :
mcTankB.bMovable = true;
}
bEffect = false;
}
}
function lazerEffectIntervalB(xPos, yPos) {
var _local3 = false;
var _local2 = null;
var _local1 = null;
switch (lazerPoint.i) {
case -1 :
if (mcBossB.inPlay && (mcBossB.bLocked)) {
_local3 = true;
_local2 = mcBossB._x;
_local1 = mcBossB._y;
}
break;
case -2 :
if (mcBossBEscortA.inPlay) {
_local3 = true;
_local2 = mcBossBEscortA._x;
_local1 = mcBossBEscortA._y;
}
break;
case -3 :
if (mcBossBEscortB.inPlay) {
_local3 = true;
_local2 = mcBossBEscortB._x;
_local1 = mcBossBEscortB._y;
}
break;
default :
if (!aAliens[lazerPoint.i].inPlay) {
break;
}
_local3 = true;
_local2 = aAliens[lazerPoint.i]._x;
_local1 = aAliens[lazerPoint.i]._y;
}
if (_local3) {
switch (lazerPoint.j) {
case 0 :
mcAPIe.clear();
mcAPIe.lineStyle(2, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(_local2, _local1);
break;
case 1 :
mcAPIe.clear();
mcAPIe.lineStyle(3, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(_local2, _local1);
break;
case 2 :
case 3 :
mcAPIe.clear();
mcAPIe.lineStyle(4, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(_local2, _local1);
mcAPIe.lineStyle(2, 16751052, 100);
mcAPIe.lineTo(xPos, yPos);
break;
case 4 :
mcAPIe.clear();
mcAPIe.lineStyle(3, 16737945, 100);
mcAPIe.moveTo(xPos, yPos);
mcAPIe.lineTo(_local2, _local1);
break;
default :
mcAPIe.clear();
clearInterval(nEffectID);
nEffectID = null;
switch (nSelectedUnit) {
case 0 :
mcGunBase.bMovable = true;
break;
case 1 :
mcTankA.bMovable = true;
break;
case 2 :
mcTankB.bMovable = true;
}
bEffect = false;
addBomb(_local2, _local1, 200, null);
}
lazerPoint.j++;
} else {
mcAPIe.clear();
clearInterval(nEffectID);
nEffectID = null;
switch (nSelectedUnit) {
case 0 :
mcGunBase.bMovable = true;
break;
case 1 :
mcTankA.bMovable = true;
break;
case 2 :
mcTankB.bMovable = true;
}
bEffect = false;
}
}
function bossBLazerEffectInterval() {
var _local1 = calcBossBEffectPoint();
mcBossB.targetJ++;
switch (mcBossB.targetJ) {
case 0 :
mcAPIb.clear();
mcAPIb.lineStyle(2, 6750054, 100);
mcAPIb.moveTo(_local1.x, _local1.y);
mcAPIb.lineTo(mcBossB.targetX, mcBossB.targetY);
break;
case 1 :
mcAPIb.clear();
mcAPIb.lineStyle(3, 6750054, 100);
mcAPIb.moveTo(_local1.x, _local1.y);
mcAPIb.lineTo(mcBossB.targetX, mcBossB.targetY);
break;
case 2 :
case 3 :
mcAPIb.clear();
mcAPIb.lineStyle(4, 6750054, 100);
mcAPIb.moveTo(_local1.x, _local1.y);
mcAPIb.lineTo(mcBossB.targetX, mcBossB.targetY);
mcAPIb.lineStyle(2, 6745651, 100);
mcAPIb.lineTo(_local1.x, _local1.y);
break;
case 4 :
mcAPIb.clear();
mcAPIb.lineStyle(3, 6750054, 100);
mcAPIb.moveTo(_local1.x, _local1.y);
mcAPIb.lineTo(mcBossB.targetX, mcBossB.targetY);
break;
default :
mcAPIb.clear();
clearInterval(nBossBEffectID);
nBossBEffectID = null;
bBossBEffect = false;
_local1.x = aPortBuildings[mcBossB.targetI]._x;
_local1.y = aPortBuildings[mcBossB.targetI]._y;
mcSpacePort.localToGlobal(_local1);
addBombAnimation(_local1.x, _local1.y, 100);
aPortBuildings[mcBossB.targetI].energy = aPortBuildings[mcBossB.targetI].energy - 25;
if (aPortBuildings[mcBossB.targetI].energy <= 0) {
switch (mcBossB.targetI) {
case 5 :
mcAntenna9._visible = false;
break;
case 8 :
mcAntenna10._visible = false;
break;
case 16 :
mcAntenna11._visible = false;
}
removeBuildingB(mcBossB.targetI);
} else {
if (aPortBuildings[mcBossB.targetI].bMask) {
if (aPortBuildings[mcBossB.targetI].bDamage == false) {
aPortBuildings[mcBossB.targetI].damageMask._visible = true;
animateBuildingDamageB(mcBossB.targetI);
aPortBuildings[mcBossB.targetI].bDamage = true;
}
}
switch (mcBossB.targetI) {
case 5 :
mcAntenna9._visible = false;
break;
case 8 :
mcAntenna10._visible = false;
break;
case 16 :
mcAntenna11._visible = false;
}
}
}
}
function pauseGame(bKeyPressed) {
bGameInPlay = false;
bPaused = true;
if (bKeyPressed) {
if (bMusic) {
nResumeMusic = mainBgMusic.position;
mainBgMusic.stop();
}
}
hideGameCursor();
hideTargetCursor();
clearHelpWinB();
if (bTargetUpdate) {
mcTargetCursor.gotoAndStop(mcTargetCursor._currentframe);
}
var _local1 = 0;
while (_local1 < aAliens.length) {
if (aAliens[_local1]._visible == true) {
aAliens[_local1].gotoAndStop(aAliens[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < aAlienAnimations.length) {
if (aAlienAnimations[_local1]._visible == true) {
aAlienAnimations[_local1].gotoAndStop(aAlienAnimations[_local1]._currentframe);
if ((aAlienAnimations[_local1].alienType == 2) || (aAlienAnimations[_local1].alienType == 3)) {
aAlienAnimations[_local1].subAnimation.gotoAndStop(aAlienAnimations[_local1].subAnimation._currentframe);
}
}
_local1++;
}
_local1 = 0;
while (_local1 < aPowerUpAnimations.length) {
if (aPowerUpAnimations[_local1]._visible == true) {
aPowerUpAnimations[_local1].gotoAndStop(aPowerUpAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < aListBomb.length) {
aBombs[aListBomb[_local1]].gotoAndStop(aBombs[aListBomb[_local1]]._currentframe);
_local1++;
}
_local1 = 0;
while (_local1 < aBombAnimations.length) {
if (aBombAnimations[_local1]._visible == true) {
aBombAnimations[_local1].gotoAndStop(aBombAnimations[_local1]._currentframe);
}
_local1++;
}
switch (nGameMode) {
case 6 :
mcBossA.gotoAndStop(mcBossA._currentframe);
if (mcBossA.stun._visible == true) {
mcBossA.stun.stunA.gotoAndStop(mcBossA.stun.stunA._currentframe);
mcBossA.stun.stunB.gotoAndStop(mcBossA.stun.stunB._currentframe);
mcBossA.stun.stunC.gotoAndStop(mcBossA.stun.stunC._currentframe);
mcBossA.stun.stunD.gotoAndStop(mcBossA.stun.stunD._currentframe);
}
if (mcBossAAnimationL._visible == true) {
mcBossAAnimationL.gotoAndStop(mcBossAAnimationL._currentframe);
}
if (mcBossAAnimationR._visible == true) {
mcBossAAnimationR.gotoAndStop(mcBossAAnimationR._currentframe);
}
case 0 :
_local1 = 0;
while (_local1 < aBuildingAnimations.length) {
if (aBuildingAnimations[_local1]._visible == true) {
aBuildingAnimations[_local1].gotoAndStop(aBuildingAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < aBuildingDamageAnimations.length) {
if (aBuildingDamageAnimations[_local1]._visible == true) {
aBuildingDamageAnimations[_local1].gotoAndStop(aBuildingDamageAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 1;
while (_local1 <= 6) {
if (mcPowerLines["line" + _local1]._visible == true) {
mcPowerLines["line" + _local1].gotoAndStop(mcPowerLines["line" + _local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < 6) {
if (aPowerLineAnimations[_local1]._visible == true) {
aPowerLineAnimations[_local1].gotoAndStop(aPowerLineAnimations[_local1]._currentframe);
}
_local1++;
}
break;
case 1 :
_local1 = 0;
while (_local1 < aBuildingAnimations.length) {
if (aBuildingAnimations[_local1]._visible == true) {
aBuildingAnimations[_local1].gotoAndStop(aBuildingAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < aBuildingDamageAnimations.length) {
if (aBuildingDamageAnimations[_local1]._visible == true) {
aBuildingDamageAnimations[_local1].gotoAndStop(aBuildingDamageAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 1;
while (_local1 <= 6) {
if (mcPowerLines["line" + _local1]._visible == true) {
mcPowerLines["line" + _local1].gotoAndStop(mcPowerLines["line" + _local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < 6) {
if (aPowerLineAnimations[_local1]._visible == true) {
aPowerLineAnimations[_local1].gotoAndStop(aPowerLineAnimations[_local1]._currentframe);
}
_local1++;
}
if (mcBossB._visible == true) {
mcBossB.gotoAndStop(mcBossB._currentframe);
if (bSound) {
sndBossBHover.stop();
}
}
break;
case 2 :
_local1 = 0;
while (_local1 < aDomeBuildingAnimations.length) {
if (aDomeBuildingAnimations[_local1]._visible == true) {
aDomeBuildingAnimations[_local1].gotoAndStop(aDomeBuildingAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < aDomeBuildingDamageAnimations.length) {
if (aDomeBuildingDamageAnimations[_local1]._visible == true) {
aDomeBuildingDamageAnimations[_local1].gotoAndStop(aDomeBuildingDamageAnimations[_local1]._currentframe);
}
_local1++;
}
break;
case 8 :
mcBossB.gotoAndStop(mcBossB._currentframe);
if (bSound) {
sndBossBHover.stop();
}
if (mcBossBEscortA._visible == true) {
mcBossBEscortA.escortGraphic.gotoAndStop(mcBossBEscortA.escortGraphic._currentframe);
if (mcBossBEscortA._currentframe != 1) {
mcBossBEscortA.gotoAndStop(mcBossBEscortA._currentframe);
}
}
if (mcBossBEscortB._visible == true) {
mcBossBEscortB.escortGraphic.gotoAndStop(mcBossBEscortB.escortGraphic._currentframe);
if (mcBossBEscortB._currentframe != 1) {
mcBossBEscortB.gotoAndStop(mcBossBEscortB._currentframe);
}
}
if (mcBossBBeamA._visible == true) {
mcBossBBeamA.gotoAndStop(mcBossBBeamA._currentframe);
}
if (mcBossBBeamB._visible == true) {
mcBossBBeamB.gotoAndStop(mcBossBBeamB._currentframe);
}
if (mcBossBEscortAnimationAA._visible == true) {
mcBossBEscortAnimationAA.gotoAndStop(mcBossBEscortAnimationAA._currentframe);
}
if (mcBossBEscortAnimationAB._visible == true) {
mcBossBEscortAnimationAB.gotoAndStop(mcBossBEscortAnimationAB._currentframe);
}
if (mcBossBEscortAnimationBA._visible == true) {
mcBossBEscortAnimationBA.gotoAndStop(mcBossBEscortAnimationBA._currentframe);
}
if (mcBossBEscortAnimationBB._visible == true) {
mcBossBEscortAnimationBB.gotoAndStop(mcBossBEscortAnimationBB._currentframe);
}
if (mcBossBAnimation._visible == true) {
mcBossBAnimation.gotoAndStop(mcBossBAnimation._currentframe);
}
if (mcBossBExplosion._visible == true) {
mcBossBExplosion.gotoAndStop(mcBossBExplosion._currentframe);
}
case 3 :
_local1 = 0;
while (_local1 < aPortBuildingAnimations.length) {
if (aPortBuildingAnimations[_local1]._visible == true) {
aPortBuildingAnimations[_local1].gotoAndStop(aPortBuildingAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
for(;;){
if (_local1 >= aPortBuildingDamageAnimations.length) {
break;
}
if (aPortBuildingDamageAnimations[_local1]._visible == true) {
aPortBuildingDamageAnimations[_local1].gotoAndStop(aPortBuildingDamageAnimations[_local1]._currentframe);
}
_local1++;
};
}
_local1 = 0;
while (_local1 < aMissiles.length) {
if (aMissiles[_local1].inPlay) {
aMissiles[_local1].thruster.gotoAndStop(aMissiles[_local1].thruster._currentframe);
nResumeMissile = sndMissile.position;
sndMissile.stop();
}
_local1++;
}
var _local3 = 0;
_local1 = 0;
while (_local1 < 3) {
_local3 = aPowerUps[_local1].length;
var _local2 = 0;
while (_local2 < _local3) {
if (aPowerUps[_local1][_local2]._visible == true) {
aPowerUps[_local1][_local2].gotoAndStop(aPowerUps[_local1][_local2]._currentframe);
}
_local2++;
}
_local1++;
}
_local1 = 0;
while (_local1 < aMessages.length) {
_local3 = aMessages[_local1].length;
var _local2 = 0;
while (_local2 < _local3) {
if (aMessages[_local1][_local2]._visible == true) {
aMessages[_local1][_local2].gotoAndStop(aMessages[_local1][_local2]._currentframe);
}
_local2++;
}
_local1++;
}
if (mcTowersInfected._visible == true) {
mcTowersInfected.gotoAndStop(mcTowersInfected._currentframe);
if (nBonusID != null) {
clearInterval(nBonusID);
nBonusID = null;
}
bSkipToBonus = true;
}
if (nEffectID != null) {
clearInterval(nEffectID);
nEffectID = null;
}
if (nBossBEffectID != null) {
clearInterval(nBossBEffectID);
nBossBEffectID = null;
}
if (nIntervalID != null) {
clearInterval(nIntervalID);
nIntervalID = null;
bResumeMessage = true;
}
if (nBeamAIntervalID != null) {
clearInterval(nBeamAIntervalID);
nBeamAIntervalID = null;
bResumeBeamA = true;
}
if (nBeamBIntervalID != null) {
clearInterval(nBeamBIntervalID);
nBeamBIntervalID = null;
bResumeBeamB = true;
}
if (nTankAID != null) {
clearInterval(nTankAID);
}
if (nTankBID != null) {
clearInterval(nTankBID);
}
clearGameInterval();
clearBossAInterval();
clearBossBInterval();
clearTargetInterval();
clearAutoFireInterval();
}
function unPauseGame(bKeyPressed) {
bGameInPlay = true;
bPaused = false;
if (bKeyPressed) {
if (bMusic) {
mainBgMusic.start(nResumeMusic / 1000);
}
}
showGameCursor();
if (bTargetUpdate) {
showTargetCursor();
mcTargetCursor.gotoAndPlay(mcTargetCursor._currentframe);
}
var _local1 = 0;
while (_local1 < aAliens.length) {
if (aAliens[_local1]._visible == true) {
aAliens[_local1].gotoAndPlay(aAliens[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < aAlienAnimations.length) {
if (aAlienAnimations[_local1]._visible == true) {
aAlienAnimations[_local1].gotoAndPlay(aAlienAnimations[_local1]._currentframe);
if ((aAlienAnimations[_local1].alienType == 2) || (aAlienAnimations[_local1].alienType == 3)) {
aAlienAnimations[_local1].subAnimation.gotoAndPlay(aAlienAnimations[_local1].subAnimation._currentframe);
}
}
_local1++;
}
_local1 = 0;
while (_local1 < aPowerUpAnimations.length) {
if (aPowerUpAnimations[_local1]._visible == true) {
aPowerUpAnimations[_local1].gotoAndPlay(aPowerUpAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < aListBomb.length) {
if (aBombs[aListBomb[_local1]]._currentframe != 1) {
aBombs[aListBomb[_local1]].gotoAndPlay(aBombs[aListBomb[_local1]]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < aBombAnimations.length) {
if (aBombAnimations[_local1]._visible == true) {
aBombAnimations[_local1].gotoAndPlay(aBombAnimations[_local1]._currentframe);
}
_local1++;
}
switch (nGameMode) {
case 6 :
if (mcBossA._visible == true) {
mcBossA.gotoAndPlay(mcBossA._currentframe);
}
if (mcBossA.stun._visible == true) {
mcBossA.stun.stunA.gotoAndPlay(mcBossA.stun.stunA._currentframe);
mcBossA.stun.stunB.gotoAndPlay(mcBossA.stun.stunB._currentframe);
mcBossA.stun.stunC.gotoAndPlay(mcBossA.stun.stunC._currentframe);
mcBossA.stun.stunD.gotoAndPlay(mcBossA.stun.stunD._currentframe);
}
if (mcBossAAnimationL._visible == true) {
mcBossAAnimationL.gotoAndPlay(mcBossAAnimationL._currentframe);
}
if (mcBossAAnimationR._visible == true) {
mcBossAAnimationR.gotoAndPlay(mcBossAAnimationR._currentframe);
}
case 0 :
_local1 = 0;
while (_local1 < aBuildingAnimations.length) {
if (aBuildingAnimations[_local1]._visible == true) {
aBuildingAnimations[_local1].gotoAndPlay(aBuildingAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < aBuildingDamageAnimations.length) {
if (aBuildingDamageAnimations[_local1]._visible == true) {
aBuildingDamageAnimations[_local1].gotoAndPlay(aBuildingDamageAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 1;
while (_local1 <= 6) {
if ((mcPowerLines["line" + _local1]._visible == true) && (mcPowerLines["line" + _local1]._currentframe != 1)) {
mcPowerLines["line" + _local1].gotoAndPlay(mcPowerLines["line" + _local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < 6) {
if (aPowerLineAnimations[_local1]._visible == true) {
aPowerLineAnimations[_local1].gotoAndPlay(aPowerLineAnimations[_local1]._currentframe);
}
_local1++;
}
break;
case 1 :
_local1 = 0;
while (_local1 < aBuildingAnimations.length) {
if (aBuildingAnimations[_local1]._visible == true) {
aBuildingAnimations[_local1].gotoAndPlay(aBuildingAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < aBuildingDamageAnimations.length) {
if (aBuildingDamageAnimations[_local1]._visible == true) {
aBuildingDamageAnimations[_local1].gotoAndPlay(aBuildingDamageAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 1;
while (_local1 <= 6) {
if ((mcPowerLines["line" + _local1]._visible == true) && (mcPowerLines["line" + _local1]._currentframe != 1)) {
mcPowerLines["line" + _local1].gotoAndPlay(mcPowerLines["line" + _local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < 6) {
if (aPowerLineAnimations[_local1]._visible == true) {
aPowerLineAnimations[_local1].gotoAndPlay(aPowerLineAnimations[_local1]._currentframe);
}
_local1++;
}
if (mcBossB._visible == true) {
mcBossB.gotoAndPlay(mcBossB._currentframe);
if (bSound) {
sndBossBHover.start(0, 99);
}
}
break;
case 2 :
_local1 = 0;
while (_local1 < aDomeBuildingAnimations.length) {
if (aDomeBuildingAnimations[_local1]._visible == true) {
aDomeBuildingAnimations[_local1].gotoAndPlay(aDomeBuildingAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
while (_local1 < aDomeBuildingDamageAnimations.length) {
if (aDomeBuildingDamageAnimations[_local1]._visible == true) {
aDomeBuildingDamageAnimations[_local1].gotoAndPlay(aDomeBuildingDamageAnimations[_local1]._currentframe);
}
_local1++;
}
break;
case 8 :
if (mcBossB._visible == true) {
mcBossB.gotoAndPlay(mcBossB._currentframe);
if (bSound) {
sndBossBHover.start(0, 999);
}
}
if (mcBossBEscortA._visible == true) {
mcBossBEscortA.escortGraphic.gotoAndPlay(mcBossBEscortA.escortGraphic._currentframe);
if ((mcBossBEscortA._currentframe != 1) && (mcBossBEscortA._currentframe != 40)) {
mcBossBEscortA.gotoAndPlay(mcBossBEscortA._currentframe);
}
}
if (mcBossBEscortB._visible == true) {
mcBossBEscortB.escortGraphic.gotoAndPlay(mcBossBEscortB.escortGraphic._currentframe);
if ((mcBossBEscortB._currentframe != 1) && (mcBossBEscortB._currentframe != 40)) {
mcBossBEscortB.gotoAndPlay(mcBossBEscortB._currentframe);
}
}
if (mcBossBBeamA._visible == true) {
mcBossBBeamA.gotoAndPlay(mcBossBBeamA._currentframe);
}
if (mcBossBBeamB._visible == true) {
mcBossBBeamB.gotoAndPlay(mcBossBBeamB._currentframe);
}
if (mcBossBEscortAnimationAA._visible == true) {
mcBossBEscortAnimationAA.gotoAndPlay(mcBossBEscortAnimationAA._currentframe);
}
if (mcBossBEscortAnimationAB._visible == true) {
mcBossBEscortAnimationAB.gotoAndPlay(mcBossBEscortAnimationAB._currentframe);
}
if (mcBossBEscortAnimationBA._visible == true) {
mcBossBEscortAnimationBA.gotoAndPlay(mcBossBEscortAnimationBA._currentframe);
}
if (mcBossBEscortAnimationBB._visible == true) {
mcBossBEscortAnimationBB.gotoAndPlay(mcBossBEscortAnimationBB._currentframe);
}
if (mcBossBAnimation._visible == true) {
mcBossBAnimation.gotoAndPlay(mcBossBAnimation._currentframe);
}
if (mcBossBExplosion._visible == true) {
mcBossBExplosion.gotoAndPlay(mcBossBExplosion._currentframe);
}
case 3 :
_local1 = 0;
while (_local1 < aPortBuildingAnimations.length) {
if (aPortBuildingAnimations[_local1]._visible == true) {
aPortBuildingAnimations[_local1].gotoAndPlay(aPortBuildingAnimations[_local1]._currentframe);
}
_local1++;
}
_local1 = 0;
for(;;){
if (_local1 >= aPortBuildingDamageAnimations.length) {
break;
}
if (aPortBuildingDamageAnimations[_local1]._visible == true) {
aPortBuildingDamageAnimations[_local1].gotoAndPlay(aPortBuildingDamageAnimations[_local1]._currentframe);
}
_local1++;
};
}
_local1 = 0;
while (_local1 < aMissiles.length) {
if (aMissiles[_local1].inPlay) {
aMissiles[_local1].thruster.gotoAndPlay(aMissiles[_local1].thruster._currentframe);
sndMissile.start(nResumeMissile / 1000);
}
_local1++;
}
var _local3 = 0;
_local1 = 0;
while (_local1 < 3) {
_local3 = aPowerUps[_local1].length;
var _local2 = 0;
while (_local2 < _local3) {
if ((aPowerUps[_local1][_local2]._visible == true) && (aPowerUps[_local1][_local2]._currentframe != 25)) {
aPowerUps[_local1][_local2].gotoAndPlay(aPowerUps[_local1][_local2]._currentframe);
}
_local2++;
}
_local1++;
}
_local1 = 0;
while (_local1 < aMessages.length) {
_local3 = aMessages[_local1].length;
var _local2 = 0;
while (_local2 < _local3) {
if (aMessages[_local1][_local2]._visible == true) {
aMessages[_local1][_local2].gotoAndPlay(aMessages[_local1][_local2]._currentframe);
}
_local2++;
}
_local1++;
}
if (bEffect) {
switch (nEffectType) {
case 0 :
nEffectID = setInterval(fadeOutAlienBombs, 50);
break;
case 1 :
var _local4 = calcEffectPoint();
if (gLevel.nLevel == 8) {
nEffectID = setInterval(lazerEffectIntervalA, 50, _local4.x, _local4.y);
} else if (gLevel.nLevel == 15) {
nEffectID = setInterval(lazerEffectIntervalB, 50, _local4.x, _local4.y);
} else {
nEffectID = setInterval(lazerEffectInterval, 50, _local4.x, _local4.y);
}
}
}
if (bBossBEffect) {
nBossBEffectID = setInterval(bossBLazerEffectInterval, 50);
}
if (bResumeBeamA) {
nBeamAIntervalID = setInterval(fadeInBeamA, 50);
bResumeBeamA = false;
}
if (bResumeBeamB) {
nBeamBIntervalID = setInterval(fadeInBeamB, 50);
bResumeBeamB = false;
}
if (bResumeMessage) {
nIntervalID = setInterval(showMessage, 1500, 1, gLevel.nLevel - 1);
bResumeMessage = false;
}
if (bTankAMovement) {
nTankAID = setInterval(addTankAInterval, 25);
bTankAMovement = true;
}
if (bTankBMovement) {
nTankBID = setInterval(addTankBInterval, 25);
bTankBMovement = true;
}
if (bSkipToBonus) {
bSkipToBonus = false;
bonusNormal();
} else {
if (gLevel.nLevel == 8) {
setBossAInterval();
} else if (gLevel.nLevel == 15) {
setBossBInterval();
} else {
setGameInterval();
}
setTargetInterval();
}
}
function calcEffectPoint() {
var _local1 = {x:0, y:0};
switch (nSelectedUnit) {
case 0 :
_local1.x = mcGunBase.gunTurret.gunTurretMarker._x;
_local1.y = mcGunBase.gunTurret.gunTurretMarker._y;
mcGunBase.gunTurret.localToGlobal(_local1);
break;
case 1 :
_local1.x = mcTankA.tankTurret.tankTurretMarkerA._x + 5;
_local1.y = mcTankA.tankTurret.tankTurretMarkerA._y;
mcTankA.tankTurret.localToGlobal(_local1);
break;
case 2 :
_local1.x = mcTankB.tankTurret.tankTurretMarkerA._x + 5;
_local1.y = mcTankB.tankTurret.tankTurretMarkerA._y;
mcTankB.tankTurret.localToGlobal(_local1);
}
return(_local1);
}
function calcBossBEffectPoint() {
var _local1 = {x:0, y:0};
if (mcBossB.targetX < 350) {
_local1.x = mcBossB.markerA._x;
_local1.y = mcBossB.markerA._y;
} else {
_local1.x = mcBossB.markerB._x;
_local1.y = mcBossB.markerB._y;
}
mcBossB.localToGlobal(_local1);
return(_local1);
}
function switchModes(nMode) {
nGameMode = nMode;
switch (nMode) {
case 0 :
this.onEnterFrame = cityIntervalA;
break;
case 1 :
this.onEnterFrame = cityIntervalB;
break;
case 2 :
this.onEnterFrame = agriDomeInterval;
break;
case 3 :
this.onEnterFrame = spacePortInterval;
break;
case 4 :
mcStoryScreen._visible = true;
this.onEnterFrame = locationInterval;
break;
case 5 :
mcStoryScreen._visible = true;
if (bMusic) {
setBossMusic();
}
mcBossAIntro.x = -300;
mcBossAIntro.y = 725;
mcBossAIntro.z = 500;
mcBossAIntro._visible = true;
this.onEnterFrame = bossAIntro;
break;
case 6 :
this.onEnterFrame = bossAUpdate;
break;
case 7 :
mcStoryScreen._visible = true;
mcBossB.x = 250;
mcBossB.y = 100;
mcBossB.z = 250;
mcBossB.adjustAlpha = 50;
mcBossB._visible = true;
if (bSound) {
sndBossBHover.setVolume(0);
sndBossBHover.start(0, 99);
}
this.onEnterFrame = bossBIntroA;
break;
case 8 :
this.onEnterFrame = bossBUpdate;
break;
case 9 :
this.onEnterFrame = bossBGameOver;
break;
case 10 :
this.onEnterFrame = bossBEventA;
break;
case 11 :
this.onEnterFrame = bossBEventB;
break;
case 12 :
mcStoryScreen._visible = true;
if (bMusic) {
setBossMusic();
}
mcBossBIntro.x = 0;
mcBossBIntro.y = 625;
mcBossBIntro.z = 300;
mcBossBIntro._visible = true;
if (bSound) {
sndBossBHover.setVolume(0);
sndBossBHover.start(0, 999);
}
this.onEnterFrame = bossBIntroB;
break;
case 13 :
bLocDone = false;
renderCity(true);
renderAgriDome(true);
renderSpacePort(true);
renderOtherSide(true);
oPlanetPos.tx = oPlanetPos.x;
oPlanetPos.ty = oPlanetPos.y;
oPlanetPos.tz = oPlanetPos.z + 15;
oPlanetPos.txOrig = oPlanetPos.x;
oPlanetPos.tyOrig = oPlanetPos.y;
oPlanetPos.tzOrig = oPlanetPos.z;
oPlanetPos.targetAngle = 360;
mcStoryScreen._visible = true;
mcPlanetDefended._x = mcPlanetDefended.xPos;
mcPlanetDefended._y = mcPlanetDefended.yPos;
mcPlanetDefended._visible = true;
mcPlanetDefended.gotoAndPlay(1);
this.onEnterFrame = locationIntervalFinal;
}
}
function switchLocation(nLocation) {
bLocDone = false;
var _local1 = null;
switch (nLocation) {
case 0 :
renderCity(true);
_local1 = -1.5707963267949;
mcGunBase.gunTurret._rotation = ((_local1 * 180) / Math.PI) + 90;
mcGunBase.gunJoint._rotation = (((_local1 * 0.5) * 180) / Math.PI) + 10;
mcGunBase.gunTurret._x = 0;
mcGunBase.gunJoint._x = 0;
mcGunBase._visible = true;
oPlanetPos.tx = oPlanetPos.x - 10;
oPlanetPos.ty = oPlanetPos.y - 15;
oPlanetPos.tz = oPlanetPos.z + 10;
oPlanetPos.txOrig = oPlanetPos.x;
oPlanetPos.tyOrig = oPlanetPos.y;
oPlanetPos.tzOrig = oPlanetPos.z;
oPlanetPos.targetAngle = 0;
break;
case 1 :
renderAgriDome(true);
mcTankA.tankTurret._rotation = 0;
mcTankB.tankTurret._rotation = 0;
mcTankA._visible = true;
mcTankB._visible = true;
oPlanetPos.tx = oPlanetPos.x + 10;
oPlanetPos.ty = oPlanetPos.y - 15;
oPlanetPos.tz = oPlanetPos.z + 10;
oPlanetPos.txOrig = oPlanetPos.x;
oPlanetPos.tyOrig = oPlanetPos.y;
oPlanetPos.tzOrig = oPlanetPos.z;
oPlanetPos.targetAngle = -75;
break;
case 2 :
renderSpacePort(true);
oPlanetPos.tx = oPlanetPos.x - 10;
oPlanetPos.ty = oPlanetPos.y - 15;
oPlanetPos.tz = oPlanetPos.z + 10;
oPlanetPos.txOrig = oPlanetPos.x;
oPlanetPos.tyOrig = oPlanetPos.y;
oPlanetPos.tzOrig = oPlanetPos.z;
oPlanetPos.targetAngle = 75;
}
switchModes(4);
}
function renderMenu() {
mcControlScreen.onKeyUp = menuKeyHandler;
mcMenu._alpha = 100;
mcMenu.gotoAndStop(1);
setMenuHandlers();
mcMenu._x = Stage.width / 2;
mcMenu._y = Stage.height / 2;
mcControlScreen._x = 0;
mcControlScreen._y = 0;
mcInstructionScreen._x = 0;
mcInstructionScreen._y = 0;
showGameMenu();
}
function showGameMenu() {
mcMenu._visible = true;
mcControlScreen._visible = false;
mcInstructionScreen._visible = false;
mcAgriDome._visible = false;
mcSpacePort._visible = false;
oPlanetPos.x = 0;
oPlanetPos.y = 70;
oPlanetPos.z = -225;
scalePlanet();
}
function menuPlayGame() {
if (bGameInPlay == false) {
loadSharedObjectData();
mIntervalID = setInterval(fadeGameMenu, 25);
this.onKeyUp = gameKeyHandler;
newGame();
}
}
function menuInstructions() {
if (bGameInPlay == false) {
loadSharedObjectData();
mcInstructionScreen.resetInstructionPages();
mcMenu._visible = false;
mcInstructionScreen._visible = true;
mcAgriDome._visible = true;
mcSpacePort._visible = true;
oPlanetPos.x = 0;
oPlanetPos.y = 4;
oPlanetPos.z = -195;
scalePlanet();
}
}
function menuGameControls() {
if (bGameInPlay == false) {
loadSharedObjectData();
mcMenu._visible = false;
mcControlScreen._visible = true;
updateGameControls();
mcAgriDome._visible = true;
mcSpacePort._visible = true;
oPlanetPos.x = 0;
oPlanetPos.y = -14;
oPlanetPos.z = -175;
scalePlanet();
}
}
function updateGameControls() {
if (bHelp) {
mcControlScreen.helptoggle.toggleBox._x = 48;
} else {
mcControlScreen.helptoggle.toggleBox._x = 131;
}
if (bAutoFire) {
mcControlScreen.autofiretoggle.toggleBox._x = 48;
} else {
mcControlScreen.autofiretoggle.toggleBox._x = 131;
}
if (bSound) {
mcControlScreen.soundtoggle.toggleBox._x = 48;
} else {
mcControlScreen.soundtoggle.toggleBox._x = 131;
}
if (bMusic) {
mcControlScreen.musictoggle.toggleBox._x = 48;
} else {
mcControlScreen.musictoggle.toggleBox._x = 131;
}
}
function clearToggleIntervals() {
if (mcControlScreen.helptoggle.nIntervalID != null) {
clearInterval(mcControlScreen.helptoggle.nIntervalID);
mcControlScreen.helptoggle.nIntervalID = null;
}
if (mcControlScreen.soundtoggle.nIntervalID != null) {
clearInterval(mcControlScreen.soundtoggle.nIntervalID);
mcControlScreen.soundtoggle.nIntervalID = null;
}
if (mcControlScreen.musictoggle.nIntervalID != null) {
clearInterval(mcControlScreen.musictoggle.nIntervalID);
mcControlScreen.musictoggle.nIntervalID = null;
}
if (mcControlScreen.autofiretoggle.nIntervalID != null) {
clearInterval(mcControlScreen.autofiretoggle.nIntervalID);
mcControlScreen.autofiretoggle.nIntervalID = null;
}
}
function controlsMainMenu() {
mcMenu._visible = true;
mcControlScreen._visible = false;
clearToggleIntervals();
var _local1 = 0;
while (_local1 < nRows) {
if (mcControlScreen["row" + _local1].bHighlighted) {
mcControlScreen["row" + _local1].resetRow();
mcControlScreen["row" + _local1].rowBg._alpha = 0;
updateRowText(mcControlScreen["row" + _local1].nKeyCode, _local1);
}
_local1++;
}
flushKeyData();
flushBoolData();
showGameMenu();
}
function controlsReset() {
var _local2 = 0;
while (_local2 < nRows) {
this["nkey" + _local2] = this["defaultKey" + _local2];
updateRowText(this["nkey" + _local2], _local2);
updateRowCode(this["nkey" + _local2], _local2);
_local2++;
}
bHelp = true;
bAutoFire = true;
bSound = true;
bMusic = true;
clearToggleIntervals();
updateGameControls();
}
function setMenuHandlers() {
mcMenu.playGame.onPress = function () {
this._parent._parent.menuPlayGame();
};
mcMenu.instructions.onPress = function () {
this._parent._parent.menuInstructions();
};
mcMenu.gameControls.onPress = function () {
this._parent._parent.menuGameControls();
};
mcControlScreen.mainMenu.onPress = function () {
this._parent._parent.controlsMainMenu();
};
mcControlScreen.resetControls.onPress = function () {
this._parent._parent.controlsReset();
};
mcMenu.sponsorLogo.onPress = function () {
_root.getURL("http://www.kongregate.com?gamereferrer=pod", "_blank");
};
mcMenu.indieLogo.onPress = function () {
_root.getURL("http://www.indieflasharcade.com/", "_blank");
};
}
function setControlScreenHandlers() {
var _local8 = 350;
var _local5 = 150;
var _local4 = null;
var _local2 = 0;
while (_local2 < nRows) {
var _local3 = mcControlScreen.attachMovie("row" + _local2, "row" + _local2, _local2, {_x:_local8, _y:_local5, rowID:_local2});
_local4 = _local3._height;
_local5 = _local5 + _local4;
_local3.onPress = function () {
this._parent._parent.highlightRow(this.rowID);
};
_local2++;
}
}
function loadSharedObjectData() {
var _local2 = 8;
for (var _local3 in soKeyControls.data) {
if ((soKeyControls.data[_local3] != undefined) && (soKeyControls.data[_local3] != 0)) {
updateRowText(soKeyControls.data[_local3], _local2);
updateRowCode(soKeyControls.data[_local3], _local2);
this["nkey" + _local2] = soKeyControls.data[_local3];
} else {
updateRowText(this["nkey" + _local2], _local2);
updateRowCode(this["nkey" + _local2], _local2);
}
_local2--;
}
_local2 = 3;
for (var _local3 in soBoolControls.data) {
switch (_local2) {
case 0 :
if (soBoolControls.data[_local3] != undefined) {
bHelp = soBoolControls.data[_local3];
}
break;
case 1 :
if (soBoolControls.data[_local3] != undefined) {
bAutoFire = soBoolControls.data[_local3];
}
break;
case 2 :
if (soBoolControls.data[_local3] != undefined) {
bSound = soBoolControls.data[_local3];
}
break;
case 3 :
if (soBoolControls.data[_local3] == undefined) {
break;
}
bMusic = soBoolControls.data[_local3];
}
_local2--;
}
}
function flushKeyData() {
soKeyControls.data.key0 = nkey0;
soKeyControls.data.key1 = nkey1;
soKeyControls.data.key2 = nkey2;
soKeyControls.data.key3 = nkey3;
soKeyControls.data.key4 = nkey4;
soKeyControls.data.key5 = nkey5;
soKeyControls.data.key6 = nkey6;
soKeyControls.data.key7 = nkey7;
soKeyControls.data.key8 = nkey8;
soKeyControls.flush();
}
function flushBoolData() {
soBoolControls.data.boolA = bHelp;
soBoolControls.data.boolB = bAutoFire;
soBoolControls.data.boolC = bSound;
soBoolControls.data.boolD = bMusic;
soBoolControls.flush();
}
function fadeGameMenu() {
if (mcMenu._alpha == 0) {
clearInterval(mIntervalID);
mIntervalID = null;
mcMenu._visible = false;
mcMenu.gotoAndStop("noRender");
mcMenu._x = -1000;
mcMenu._y = -1000;
mcControlScreen._x = -1000;
mcControlScreen._y = -1000;
mcInstructionScreen._x = -1000;
mcInstructionScreen._y = -1000;
} else {
mcMenu._alpha = mcMenu._alpha - 10;
if (mcMenu._alpha <= 10) {
mcMenu._alpha = 0;
}
}
}
function highlightRow(rowID) {
if (mcControlScreen["row" + rowID].bHighlighted) {
mcControlScreen["row" + rowID].resetRow();
mcControlScreen["row" + rowID].rowBg._alpha = 0;
updateRowText(mcControlScreen["row" + rowID].nKeyCode, rowID);
} else {
var _local1 = 0;
while (_local1 < nRows) {
mcControlScreen["row" + _local1].resetRow();
mcControlScreen["row" + _local1].rowBg._alpha = 0;
updateRowText(mcControlScreen["row" + _local1].nKeyCode, _local1);
_local1++;
}
mcControlScreen["row" + rowID].bHighlighted = true;
mcControlScreen["row" + rowID].rowBg._alpha = 75;
mcControlScreen["row" + rowID].key.text = "type key";
}
}
function mapRowKey(keyCode, rowID) {
var _local4 = true;
var _local2 = 0;
while (_local2 < nRows) {
if (mcControlScreen["row" + _local2].nKeyCode == keyCode) {
_local4 = false;
break;
}
_local2++;
}
if (_local4) {
updateRowText(keyCode, rowID);
updateRowCode(keyCode, rowID);
this["nkey" + rowID] = keyCode;
}
mcControlScreen["row" + rowID].resetRow();
mcControlScreen["row" + rowID].rowBg._alpha = 0;
updateRowText(mcControlScreen["row" + rowID].nKeyCode, rowID);
}
function updateRowCode(keyCode, rowID) {
mcControlScreen["row" + rowID].nKeyCode = keyCode;
}
function updateRowText(keyCode, rowID) {
var _local1 = "";
switch (keyCode) {
case 48 :
_local1 = "0";
break;
case 49 :
_local1 = "1";
break;
case 50 :
_local1 = "2";
break;
case 51 :
_local1 = "3";
break;
case 52 :
_local1 = "4";
break;
case 53 :
_local1 = "5";
break;
case 54 :
_local1 = "6";
break;
case 55 :
_local1 = "7";
break;
case 56 :
_local1 = "8";
break;
case 57 :
_local1 = "9";
break;
case 65 :
_local1 = "A";
break;
case 66 :
_local1 = "B";
break;
case 67 :
_local1 = "C";
break;
case 68 :
_local1 = "D";
break;
case 69 :
_local1 = "E";
break;
case 70 :
_local1 = "F";
break;
case 71 :
_local1 = "G";
break;
case 72 :
_local1 = "H";
break;
case 73 :
_local1 = "I";
break;
case 74 :
_local1 = "J";
break;
case 75 :
_local1 = "K";
break;
case 76 :
_local1 = "L";
break;
case 77 :
_local1 = "M";
break;
case 78 :
_local1 = "N";
break;
case 79 :
_local1 = "O";
break;
case 80 :
_local1 = "P";
break;
case 81 :
_local1 = "Q";
break;
case 82 :
_local1 = "R";
break;
case 83 :
_local1 = "S";
break;
case 84 :
_local1 = "T";
break;
case 85 :
_local1 = "U";
break;
case 86 :
_local1 = "V";
break;
case 87 :
_local1 = "W";
break;
case 88 :
_local1 = "X";
break;
case 89 :
_local1 = "Y";
break;
case 90 :
_local1 = "Z";
break;
case 32 :
_local1 = "SPACE";
break;
case 37 :
_local1 = "LEFT";
break;
case 38 :
_local1 = "UP";
break;
case 39 :
_local1 = "RIGHT";
break;
case 40 :
_local1 = "DOWN";
break;
case 16 :
_local1 = "SHIFT";
break;
case 17 :
_local1 = "CTRL";
}
mcControlScreen["row" + rowID].key.text = _local1;
}
function setBossMusic() {
nMusicIntervalID = setInterval(fadeOutBgMusic, 50);
}
function fadeOutBgMusic() {
mainBgMusic.setVolume(mainBgMusic.getVolume() - 1);
if (mainBgMusic.getVolume() <= 1) {
mainBgMusic.stop();
mainBgMusic.start(nMusicPosition);
clearInterval(nMusicIntervalID);
nMusicIntervalID = setInterval(fadeInBgMusic, 50);
}
}
function fadeInBgMusic() {
mainBgMusic.setVolume(mainBgMusic.getVolume() + 2);
if (mainBgMusic.getVolume() >= 99) {
mainBgMusic.setVolume(100);
clearInterval(nMusicIntervalID);
nMusicIntervalID = null;
}
}
Stage.showMenu = false;
Key.addListener(this);
var bf3 = (new flash.filters.BlurFilter(3, 3, 3));
var bf2 = (new flash.filters.BlurFilter(2, 2, 3));
var thrustFilter = [bf3];
var alienFilter = [bf2];
var bombFilter = [bf2];
var soKeyControls = SharedObject.getLocal("keyControlsPOD");
var soBoolControls = SharedObject.getLocal("boolControlsPOD");
if (soKeyControls.data.key0 == undefined) {
soKeyControls.clear();
soKeyControls.data.key0 = new Number();
soKeyControls.data.key1 = new Number();
soKeyControls.data.key2 = new Number();
soKeyControls.data.key3 = new Number();
soKeyControls.data.key4 = new Number();
soKeyControls.data.key5 = new Number();
soKeyControls.data.key6 = new Number();
soKeyControls.data.key7 = new Number();
soKeyControls.data.key8 = new Number();
}
if (soBoolControls.data.boolA == undefined) {
soBoolControls.clear();
soBoolControls.data.boolA = new Boolean(true);
soBoolControls.data.boolB = new Boolean(true);
soBoolControls.data.boolC = new Boolean(true);
soBoolControls.data.boolD = new Boolean(true);
}
var mcSoundLib = this.createEmptyMovieClip("mcSoundLib", this.getNextHighestDepth());
var mcSound1 = mcSoundLib.createEmptyMovieClip("mcSound1", 1);
var mcSound2 = mcSoundLib.createEmptyMovieClip("mcSound2", 2);
var mcSound3 = mcSoundLib.createEmptyMovieClip("mcSound3", 3);
var mcSound4 = mcSoundLib.createEmptyMovieClip("mcSound4", 4);
var mcSound5 = mcSoundLib.createEmptyMovieClip("mcSound5", 5);
var mcSound6 = mcSoundLib.createEmptyMovieClip("mcSound6", 6);
var mcSound7 = mcSoundLib.createEmptyMovieClip("mcSound7", 7);
var mcSound8 = mcSoundLib.createEmptyMovieClip("mcSound8", 8);
var mcSound9 = mcSoundLib.createEmptyMovieClip("mcSound9", 9);
var mcSound10 = mcSoundLib.createEmptyMovieClip("mcSound10", 10);
var mcSound11 = mcSoundLib.createEmptyMovieClip("mcSound11", 11);
var mcSound12 = mcSoundLib.createEmptyMovieClip("mcSound12", 12);
var mcSound13 = mcSoundLib.createEmptyMovieClip("mcSound13", 13);
var mcSound14 = mcSoundLib.createEmptyMovieClip("mcSound14", 14);
var mcSound15 = mcSoundLib.createEmptyMovieClip("mcSound15", 15);
var mcSound16 = mcSoundLib.createEmptyMovieClip("mcSound16", 16);
var mcSound17 = mcSoundLib.createEmptyMovieClip("mcSound17", 17);
var mcSound18 = mcSoundLib.createEmptyMovieClip("mcSound18", 18);
var mcSound16 = mcSoundLib.createEmptyMovieClip("mcSound16", 19);
var mcSound17 = mcSoundLib.createEmptyMovieClip("mcSound17", 20);
var mcSound18 = mcSoundLib.createEmptyMovieClip("mcSound18", 21);
var introMusic = new Sound(mcSound1);
var mainBgMusic = new Sound(mcSound2);
introMusic.attachSound("KuruPODa");
mainBgMusic.attachSound("KuruPODb");
introMusic.stop();
mainBgMusic.stop();
var sndLaser = new Sound(mcSound4);
var sndLancer = new Sound(mcSound5);
var sndLazer = new Sound(mcSound6);
var sndMissile = new Sound(mcSound7);
var sndBomb = new Sound(mcSound8);
var sndRemoveSquid = new Sound(mcSound9);
var sndRemoveBrain = new Sound(mcSound10);
var sndRemoveShip = new Sound(mcSound11);
var sndPowerUp = new Sound(mcSound12);
var sndSpitterWarning = new Sound(mcSound13);
var sndShipWarning = new Sound(mcSound14);
var sndSpitterLaser = new Sound(mcSound15);
var sndShipLaser = new Sound(mcSound16);
var sndBossBHover = new Sound(mcSound17);
var sndBossBPowerUp = new Sound(mcSound18);
var sndBossATeleport = new Sound(mcSound19);
var sndRemoveBossA = new Sound(mcSound20);
var sndCollideBossA = new Sound(mcSound21);
sndLaser.attachSound("sndLaser");
sndLancer.attachSound("sndLancer");
sndBomb.attachSound("sndBomb");
sndLazer.attachSound("sndLazer");
sndMissile.attachSound("sndMissile");
sndRemoveSquid.attachSound("sndRemoveSquid");
sndRemoveBrain.attachSound("sndRemoveBrain");
sndRemoveShip.attachSound("sndRemoveShip");
sndPowerUp.attachSound("sndPowerUp");
sndSpitterWarning.attachSound("sndSpitterWarning");
sndShipWarning.attachSound("sndShipWarning");
sndSpitterLaser.attachSound("sndSpitterLaser");
sndShipLaser.attachSound("sndShipLaser");
sndBossBHover.attachSound("sndBossBHover");
sndBossBPowerUp.attachSound("sndBossBPowerUp");
sndBossATeleport.attachSound("sndBossATeleport");
sndRemoveBossA.attachSound("sndRemoveBossA");
sndCollideBossA.attachSound("sndCollideBossA");
var bGameInPlay = false;
var bPaused = false;
var bGameKeys = false;
var bMultipleUnits = false;
var bEffect = false;
var bBossBEffect = false;
var bResumeMessage = false;
var bResumeBeamA = false;
var bResumeBeamB = false;
var bTargetUpdate = false;
var bTargetLock = false;
var bRemove = false;
var bInitMouse = true;
var bLocDone = false;
var bSkipToBonus = false;
var bTankAMovement = false;
var bTankBMovement = false;
var bRadiansUpdated = true;
var bHelp = true;
var bSound = true;
var bMusic = true;
var bAutoFire = true;
var defaultKey0 = 87;
var defaultKey1 = 65;
var defaultKey2 = 83;
var defaultKey3 = 68;
var defaultKey4 = 90;
var defaultKey5 = 88;
var defaultKey6 = 80;
var defaultKey7 = 82;
var defaultKey8 = 79;
var nkey0 = defaultKey0;
var nkey1 = defaultKey1;
var nkey2 = defaultKey2;
var nkey3 = defaultKey3;
var nkey4 = defaultKey4;
var nkey5 = defaultKey5;
var nkey6 = defaultKey6;
var nkey7 = defaultKey7;
var nkey8 = defaultKey8;
var nRows = 9;
var sWinKey1 = "";
var sWinKey2 = "";
var sWinKey3 = "";
var sWinKey4 = "";
var sWinKey5 = "";
var yMouseBounds = null;
var nResumeMusic = 0;
var nMusicPosition = 70;
var nResumeMissile = null;
var nGameMode = null;
var nGameLocation = null;
var nSelectedUnit = 0;
var nIntervalID = null;
var mIntervalID = null;
var nGameIntervalID = null;
var nMusicIntervalID = null;
var nBossAIntervalID = null;
var nBossBIntervalID = null;
var nHelpAIntervalID = null;
var nHelpBIntervalID = null;
var nHelpCIntervalID = null;
var nBeamAIntervalID = null;
var nBeamBIntervalID = null;
var nBossBEffectID = null;
var nEffectID = null;
var nTargetID = null;
var nAutoFireID = null;
var nBonusID = null;
var nGameOverID = null;
var nBonusInterval = null;
var nTankAID = null;
var nTankBID = null;
var nEffectType = null;
var nPowerUpTimer = null;
var oPowerUp = {selectedPowerUp:null, powerUpIndex:null};
var nLineTimer = 0;
var nTargetLock = null;
var nScore = null;
var nTotalShots = null;
var nTotalHits = null;
var nAccuracy = null;
var nEnergy = null;
var nLasers = 0;
var nMissiles = 0;
var nPMissiles = 3;
var maxLasers = 30;
var nSquids = 15;
var nSpitters = 12;
var nPowerUps = 2;
var nMines = 6;
var nBrains = 3;
var nShips = 3;
var nEliteShips = 2;
var nBombs = 8;
var nProjectiles = 2;
var nAlienBombs = 10;
var nBombAnimations = 12;
var nBossPowerUps = 0;
var nBossMines = 0;
var nParticles = 15;
var nLevels = 15;
var squidRange = 200;
var groupRef = null;
var yInt = null;
var nPowerRegen = 0;
var centerPoint = {x:0, y:0};
var lazerPoint = {i:0, j:0};
var targetPoint = {x:0, y:0};
var laserPointA = {x:0, y:0};
var laserPointB = {x:0, y:0};
var laserPointC = {x:0, y:0};
var nMinIndex = 0;
var nMaxIndex = 0;
var nMin = 14;
var nMax = 24;
var nMinA = 4;
var nMaxA = 8;
var nMinB = 9;
var nMaxB = 16;
var iMin = null;
var iMax = null;
var powerUpMode = null;
var unitOrbitDist = null;
var nTankAinit = 60;
var nTankBinit = 90;
var oPlanetPos = {x:0, y:0, z:0, angle:0, tx:0, ty:0, tz:0, txOrig:0, tyOrig:0, tzOrig:0, targetAngle:0};
var pScale = null;
var easing = 0.02;
var easingR = 0.01;
var rotationSpeed = 0.3;
var fl = 250;
var vpx = (Stage.width / 2);
var vpy = (Stage.height / 2);
var xDist = null;
var yDist = null;
var zDist = null;
var rDist = null;
var maxDist = null;
var gLevel = new level();
var plLaser = new pLaser(16737945, 10, 8);
var alLaser = new aLaser();
var nRadians = null;
var mcLoader = attachMovie("cubeLoader", "mcLoader", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2});
var mcBossAIntro = attachMovie("alienBossA", "mcBossAIntro", this.getNextHighestDepth(), {_visible:false, _x:-1000, _y:-1000});
var mcBossBIntro = attachMovie("alienBossB", "mcBossBIntro", this.getNextHighestDepth(), {_visible:false, _x:-1000, _y:-1000});
var mcPlanet = attachMovie("planet", "mcPlanet", this.getNextHighestDepth(), {_visible:false});
var aParticles = new Array();
var aListParticles = new Array();
var i = 0;
while (i < nParticles) {
aParticles.push(attachMovie("particleA", "particle" + i, this.getNextHighestDepth(), {_visible:false, _x:-1000, _y:-1000}));
i++;
aParticles.push(attachMovie("particleB", "particle" + i, this.getNextHighestDepth(), {_visible:false, _x:-1000, _y:-1000}));
i++;
}
var mcBossA = attachMovie("alienBossA", "mcBossA", this.getNextHighestDepth(), {stageWidth:Stage.width, stageHeight:Stage.height, bossScore:25000, energy:225, maxEnergy:225, _x:-1000, _y:-1000, _visible:false});
var mcBossAAnimationL = attachMovie("bossAAnimationL", "mcBossAAnimationL", this.getNextHighestDepth(), {_visible:false, _x:-1000, _y:-1000});
var mcBossAAnimationR = attachMovie("bossAAnimationR", "mcBossAAnimationR", this.getNextHighestDepth(), {_visible:false, _x:-1000, _y:-1000});
mcBossAIntro.stun._visible = false;
mcBossA.stun._visible = false;
var mcCity = attachMovie("cityContainer", "mcCity", this.getNextHighestDepth(), {_visible:false});
var mcAgriDome = attachMovie("agriDomeContainer", "mcAgriDome", this.getNextHighestDepth(), {_visible:false});
var mcSpacePort = attachMovie("spacePortContainer", "mcSpacePort", this.getNextHighestDepth(), {_visible:false});
var mcMountains = attachMovie("mountains", "mcMountains", this.getNextHighestDepth(), {_visible:false});
var aSquidTargets = new Array();
var aBuildings = new Array();
var aBuildingAnimations = new Array();
var aBuildingDamageAnimations = new Array();
var aBuildingMasks = new Array();
var aInfectedBuildings = new Array();
var aListBuildingsL = new Array();
var aListBuildingsR = new Array();
var aListBuildingMasks = new Array();
var aListInfectedBuildingMasks = new Array();
var aDomeBuildings = new Array();
var aDomeBuildingAnimations = new Array();
var aDomeBuildingDamageAnimations = new Array();
var aDomeBuildingMasks = new Array();
var aListDomeBuildingsL = new Array();
var aListDomeBuildingsR = new Array();
var aListDomeBuildingMasks = new Array();
var aPortBuildings = new Array();
var aPortBuildingAnimations = new Array();
var aPortBuildingDamageAnimations = new Array();
var aPortBuildingMasks = new Array();
var aInfectedPortBuildings = new Array();
var aListPortBuildingsL = new Array();
var aListPortBuildingsR = new Array();
var aListPortBuildingMasks = new Array();
var aListInfectedPortBuildingMasks = new Array();
aBuildings.push(mcCity.attachMovie("powerPlant1", "powerPlant1", mcCity.getNextHighestDepth(), {_x:-271.6, _y:-484.6, _visible:false, buildingType:1, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("powerPlant2", "powerPlant2", mcCity.getNextHighestDepth(), {_x:-237.3, _y:-497.7, _visible:false, buildingType:1, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection1", "citySection1", mcCity.getNextHighestDepth(), {_x:-202.1, _y:-510.4, _visible:false, buildingType:2, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("controlTower1", "controlTower1", mcCity.getNextHighestDepth(), {_x:-228.5, _y:-540.1, _visible:false, buildingType:0, energy:25, maxEnergy:25, nBombAnimations:1, bBombAlignment:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection2", "citySection2", mcCity.getNextHighestDepth(), {_x:-179.8, _y:-523.9, _visible:false, buildingType:2, energy:25, maxEnergy:25, nBombAnimations:1, bBombAlignment:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("powerPlant3", "powerPlant3", mcCity.getNextHighestDepth(), {_x:-153.3, _y:-534.6, _visible:false, buildingType:1, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection3", "citySection3", mcCity.getNextHighestDepth(), {_x:-118, _y:-539.4, _visible:false, buildingType:2, energy:50, maxEnergy:50, nBombAnimations:2, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("controlTower2", "controlTower2", mcCity.getNextHighestDepth(), {_x:-140.7, _y:-576.9, _visible:false, buildingType:0, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection4", "citySection4", mcCity.getNextHighestDepth(), {_x:-91.6, _y:-543.9, _visible:false, buildingType:2, energy:50, maxEnergy:50, nBombAnimations:1, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection5", "citySection5", mcCity.getNextHighestDepth(), {_x:-76.4, _y:-545.3, _visible:false, buildingType:2, energy:50, maxEnergy:50, nBombAnimations:1, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("controlTower3", "controlTower3", mcCity.getNextHighestDepth(), {_x:-78.5, _y:-584.5, _visible:false, buildingType:0, energy:50, maxEnergy:50, nBombAnimations:1, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection6", "citySection6", mcCity.getNextHighestDepth(), {_x:-56.8, _y:-557.8, _visible:false, buildingType:2, energy:50, maxEnergy:50, nBombAnimations:2, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("controlTower4", "controlTower4", mcCity.getNextHighestDepth(), {_x:-48.8, _y:-600.7, _visible:false, buildingType:0, energy:25, maxEnergy:25, nBombAnimations:1, bBombAlignment:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("powerPlant4", "powerPlant4", mcCity.getNextHighestDepth(), {_x:-33, _y:-558.8, _visible:false, buildingType:1, energy:25, maxEnergy:25, nBombAnimations:1, bBombAlignment:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection7", "citySection7", mcCity.getNextHighestDepth(), {_x:-3.3, _y:-545.2, _visible:false, buildingType:2, energy:50, maxEnergy:50, nBombAnimations:1, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection8", "citySection8", mcCity.getNextHighestDepth(), {_x:37.7, _y:-564.6, _visible:false, buildingType:2, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("powerPlant5", "powerPlant5", mcCity.getNextHighestDepth(), {_x:64.7, _y:-555.6, _visible:false, buildingType:1, energy:50, maxEnergy:50, nBombAnimations:1, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection9", "citySection9", mcCity.getNextHighestDepth(), {_x:90.9, _y:-549.8, _visible:false, buildingType:2, energy:50, maxEnergy:50, nBombAnimations:2, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("controlTower5", "controlTower5", mcCity.getNextHighestDepth(), {_x:107, _y:-588.1, _visible:false, buildingType:0, energy:25, maxEnergy:25, nBombAnimations:1, bBombAlignment:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection10", "citySection10", mcCity.getNextHighestDepth(), {_x:121.5, _y:-541.4, _visible:false, buildingType:2, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("controlTower6", "controlTower6", mcCity.getNextHighestDepth(), {_x:147.4, _y:-583.1, _visible:false, buildingType:0, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection11", "citySection11", mcCity.getNextHighestDepth(), {_x:163.8, _y:-531.3, _visible:false, buildingType:2, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("powerPlant6", "powerPlant6", mcCity.getNextHighestDepth(), {_x:207.7, _y:-517, _visible:false, buildingType:1, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("citySection12", "citySection12", mcCity.getNextHighestDepth(), {_x:251.2, _y:-490.5, _visible:false, buildingType:2, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aBuildings.push(mcCity.attachMovie("controlTower7", "controlTower7", mcCity.getNextHighestDepth(), {_x:264.1, _y:-539, _visible:false, buildingType:0, energy:50, maxEnergy:50, nBombAnimations:1, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aInfectedBuildings.push(mcCity.attachMovie("infectedBuilding1", "infectedBuilding1", mcCity.getNextHighestDepth(), {_x:-118, _y:-539.4, _visible:false, blendMode:"layer"}));
aInfectedBuildings.push(mcCity.attachMovie("infectedBuilding2", "infectedBuilding2", mcCity.getNextHighestDepth(), {_x:-140.7, _y:-576.9, _visible:false, blendMode:"layer"}));
aInfectedBuildings.push(mcCity.attachMovie("infectedBuilding3", "infectedBuilding3", mcCity.getNextHighestDepth(), {_x:-76.4, _y:-545.3, _visible:false, blendMode:"layer"}));
aInfectedBuildings.push(mcCity.attachMovie("infectedBuilding4", "infectedBuilding4", mcCity.getNextHighestDepth(), {_x:-78.5, _y:-584.5, _visible:false, blendMode:"layer"}));
aInfectedBuildings.push(mcCity.attachMovie("infectedBuilding5", "infectedBuilding5", mcCity.getNextHighestDepth(), {_x:121.5, _y:-541.4, _visible:false, blendMode:"layer"}));
aInfectedBuildings.push(mcCity.attachMovie("infectedBuilding6", "infectedBuilding6", mcCity.getNextHighestDepth(), {_x:147.4, _y:-583.1, _visible:false, blendMode:"layer"}));
aInfectedBuildings.push(mcCity.attachMovie("infectedBuilding7", "infectedBuilding7", mcCity.getNextHighestDepth(), {_x:251.2, _y:-490.5, _visible:false, blendMode:"layer"}));
aInfectedBuildings.push(mcCity.attachMovie("infectedBuilding8", "infectedBuilding8", mcCity.getNextHighestDepth(), {_x:264.1, _y:-539, _visible:false, blendMode:"layer"}));
aDomeBuildings.push(mcAgriDome.attachMovie("dome1", "dome1", mcAgriDome.getNextHighestDepth(), {_x:-220.4, _y:-504.5, _visible:false, buildingType:0, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aDomeBuildings.push(mcAgriDome.attachMovie("domeSection1", "domeSection1", mcAgriDome.getNextHighestDepth(), {_x:-161.6, _y:-532.4, _visible:false, buildingType:1, energy:50, maxEnergy:50, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aDomeBuildings.push(mcAgriDome.attachMovie("dome2", "dome2", mcAgriDome.getNextHighestDepth(), {_x:-98.2, _y:-547.4, _visible:false, buildingType:0, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aDomeBuildings.push(mcAgriDome.attachMovie("domeSection2", "domeSection2", mcAgriDome.getNextHighestDepth(), {_x:-30.6, _y:-566.2, _visible:false, buildingType:1, energy:50, maxEnergy:50, nBombAnimations:2, bBombAlignment:false, blendMode:"layer"}));
aDomeBuildings.push(mcAgriDome.attachMovie("domeSection3", "domeSection3", mcAgriDome.getNextHighestDepth(), {_x:3.1, _y:-567.7, _visible:false, buildingType:1, energy:50, maxEnergy:50, nBombAnimations:1, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aDomeBuildings.push(mcAgriDome.attachMovie("domeSection4", "domeSection4", mcAgriDome.getNextHighestDepth(), {_x:33.1, _y:-557.9, _visible:false, buildingType:1, energy:50, maxEnergy:50, nBombAnimations:1, bBombAlignment:false, blendMode:"layer"}));
aDomeBuildings.push(mcAgriDome.attachMovie("dome3", "dome3", mcAgriDome.getNextHighestDepth(), {_x:97.9, _y:-547.3, _visible:false, buildingType:0, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aDomeBuildings.push(mcAgriDome.attachMovie("domeSection5", "domeSection5", mcAgriDome.getNextHighestDepth(), {_x:160.9, _y:-531.9, _visible:false, buildingType:1, energy:50, maxEnergy:50, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aDomeBuildings.push(mcAgriDome.attachMovie("dome4", "dome4", mcAgriDome.getNextHighestDepth(), {_x:222, _y:-503.9, _visible:false, buildingType:0, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portSection1", "portSection1", mcSpacePort.getNextHighestDepth(), {_x:-199.7, _y:-508.6, _visible:false, buildingType:2, energy:25, maxEnergy:25, nBombAnimations:1, bBombAlignment:false, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portTower1", "portTower1", mcSpacePort.getNextHighestDepth(), {_x:-208.7, _y:-527.9, _visible:false, buildingType:0, energy:25, maxEnergy:25, nBombAnimations:1, bBombAlignment:false, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portSection2", "portSection2", mcSpacePort.getNextHighestDepth(), {_x:-184.2, _y:-528.4, _visible:false, buildingType:2, energy:50, maxEnergy:50, nBombAnimations:2, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portSection3", "portSection3", mcSpacePort.getNextHighestDepth(), {_x:-168.55, _y:-532.8, _visible:false, buildingType:2, energy:50, maxEnergy:50, nBombAnimations:2, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portSection4", "portSection4", mcSpacePort.getNextHighestDepth(), {_x:-143.25, _y:-546.3, _visible:false, buildingType:2, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portTower2", "portTower2", mcSpacePort.getNextHighestDepth(), {_x:-155.4, _y:-593.85, _visible:false, buildingType:0, energy:50, maxEnergy:50, nBombAnimations:1, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portPlant1", "portPlant1", mcSpacePort.getNextHighestDepth(), {_x:-16.9, _y:-544.65, _visible:false, buildingType:1, energy:25, maxEnergy:25, nBombAnimations:1, bBombAlignment:false, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portSection5", "portSection5", mcSpacePort.getNextHighestDepth(), {_x:-38.4, _y:-562.9, _visible:false, buildingType:2, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:false, bMask:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portTower3", "portTower3", mcSpacePort.getNextHighestDepth(), {_x:-34, _y:-612.5, _visible:false, buildingType:0, energy:100, maxEnergy:100, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portPlatform", "portPlatform", mcSpacePort.getNextHighestDepth(), {_x:-84.65, _y:-533.3, _visible:false, buildingType:1, energy:100, maxEnergy:100, nBombAnimations:2, bBombAlignment:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portPlant2", "portPlant2", mcSpacePort.getNextHighestDepth(), {_x:25.45, _y:-547.5, _visible:false, buildingType:1, energy:50, maxEnergy:50, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portPlant3", "portPlant3", mcSpacePort.getNextHighestDepth(), {_x:56.8, _y:-544.3, _visible:false, buildingType:1, energy:25, maxEnergy:25, nBombAnimations:1, bBombAlignment:false, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portTower4", "portTower4", mcSpacePort.getNextHighestDepth(), {_x:56.7, _y:-565.8, _visible:false, buildingType:0, energy:25, maxEnergy:25, nBombAnimations:1, bBombAlignment:false, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portPlant4", "portPlant4", mcSpacePort.getNextHighestDepth(), {_x:93.55, _y:-540.8, _visible:false, buildingType:1, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portPlant5", "portPlant5", mcSpacePort.getNextHighestDepth(), {_x:175, _y:-516.3, _visible:false, buildingType:1, energy:100, maxEnergy:100, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portSection6", "portSection6", mcSpacePort.getNextHighestDepth(), {_x:184.9, _y:-537.75, _visible:false, buildingType:2, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aPortBuildings.push(mcSpacePort.attachMovie("portTower5", "portTower5", mcSpacePort.getNextHighestDepth(), {_x:185.6, _y:-580.45, _visible:false, buildingType:0, energy:75, maxEnergy:75, nBombAnimations:2, bBombAlignment:true, bMask:true, blendMode:"layer"}));
aInfectedPortBuildings.push(mcSpacePort.attachMovie("infectedPortBuilding1", "infectedPortBuilding1", mcSpacePort.getNextHighestDepth(), {_x:-143.25, _y:-546.3, _visible:false, blendMode:"layer"}));
aInfectedPortBuildings.push(mcSpacePort.attachMovie("infectedPortBuilding2", "infectedPortBuilding2", mcSpacePort.getNextHighestDepth(), {_x:-155.4, _y:-593.85, _visible:false, blendMode:"layer"}));
aInfectedPortBuildings.push(mcSpacePort.attachMovie("infectedPortBuilding3", "infectedPortBuilding3", mcSpacePort.getNextHighestDepth(), {_x:-16.9, _y:-544.65, _visible:false, blendMode:"layer"}));
aInfectedPortBuildings.push(mcSpacePort.attachMovie("infectedPortBuilding4", "infectedPortBuilding4", mcSpacePort.getNextHighestDepth(), {_x:-38.4, _y:-562.9, _visible:false, blendMode:"layer"}));
aInfectedPortBuildings.push(mcSpacePort.attachMovie("infectedPortBuilding5", "infectedPortBuilding5", mcSpacePort.getNextHighestDepth(), {_x:-34, _y:-612.5, _visible:false, blendMode:"layer"}));
aInfectedPortBuildings.push(mcSpacePort.attachMovie("infectedPortBuilding6", "infectedPortBuilding6", mcSpacePort.getNextHighestDepth(), {_x:175, _y:-516.3, _visible:false, blendMode:"layer"}));
aInfectedPortBuildings.push(mcSpacePort.attachMovie("infectedPortBuilding7", "infectedPortBuilding7", mcSpacePort.getNextHighestDepth(), {_x:184.9, _y:-537.75, _visible:false, blendMode:"layer"}));
aInfectedPortBuildings.push(mcSpacePort.attachMovie("infectedPortBuilding8", "infectedPortBuilding8", mcSpacePort.getNextHighestDepth(), {_x:185.6, _y:-580.45, _visible:false, blendMode:"layer"}));
initCity();
i = 0;
while (i < aBuildings.length) {
aBuildingAnimations.push(mcCity.attachMovie("buildingAnimation" + (i + 1), "buildingAnimation" + (i + 1), mcCity.getNextHighestDepth(), {_x:aBuildings[i]._x, _y:aBuildings[i]._y, _visible:false}));
i++;
}
i = 0;
while (i < aDomeBuildings.length) {
aDomeBuildingAnimations.push(mcAgriDome.attachMovie("buildingAnimationDome" + (i + 1), "buildingAnimationDome" + (i + 1), mcAgriDome.getNextHighestDepth(), {_x:aDomeBuildings[i]._x, _y:aDomeBuildings[i]._y, _visible:false}));
i++;
}
i = 0;
while (i < aPortBuildings.length) {
aPortBuildingAnimations.push(mcSpacePort.attachMovie("buildingAnimationPort" + (i + 1), "buildingAnimationPort" + (i + 1), mcSpacePort.getNextHighestDepth(), {_x:aPortBuildings[i]._x, _y:aPortBuildings[i]._y, _visible:false}));
i++;
}
i = 0;
while (i < aBuildings.length) {
if (aBuildings[i].bMask) {
aBuildingDamageAnimations.push(mcCity.attachMovie("cityDamage" + (i + 1), "cityDamage" + (i + 1), mcCity.getNextHighestDepth(), {_x:aBuildings[i]._x, _y:aBuildings[i]._y, _visible:false}));
} else {
aBuildingDamageAnimations.push(null);
}
i++;
}
i = 0;
while (i < aDomeBuildings.length) {
if (aDomeBuildings[i].bMask) {
aDomeBuildingDamageAnimations.push(mcAgriDome.attachMovie("domeDamage" + (i + 1), "domeDamage" + (i + 1), mcAgriDome.getNextHighestDepth(), {_x:aDomeBuildings[i]._x, _y:aDomeBuildings[i]._y, _visible:false}));
} else {
aDomeBuildingDamageAnimations.push(null);
}
i++;
}
i = 0;
while (i < aPortBuildings.length) {
if (aPortBuildings[i].bMask) {
aPortBuildingDamageAnimations.push(mcSpacePort.attachMovie("portDamage" + (i + 1), "portDamage" + (i + 1), mcSpacePort.getNextHighestDepth(), {_x:aPortBuildings[i]._x, _y:aPortBuildings[i]._y, _visible:false}));
} else {
aPortBuildingDamageAnimations.push(null);
}
i++;
}
i = 0;
while (i < aBuildings.length) {
if (aBuildings[i].bMask) {
aBuildingMasks.push(aBuildings[i].attachMovie("cityMask" + (i + 1), "damageMask", aBuildings[i].getNextHighestDepth(), {blendMode:"erase", _visible:false}));
} else {
aBuildingMasks.push(null);
}
i++;
}
i = 0;
while (i < aDomeBuildings.length) {
if (aDomeBuildings[i].bMask) {
aDomeBuildingMasks.push(aDomeBuildings[i].attachMovie("domeMask" + (i + 1), "damageMask", aDomeBuildings[i].getNextHighestDepth(), {blendMode:"erase", _visible:false}));
} else {
aDomeBuildingMasks.push(null);
}
i++;
}
i = 0;
while (i < aPortBuildings.length) {
if (aPortBuildings[i].bMask) {
aPortBuildingMasks.push(aPortBuildings[i].attachMovie("portMask" + (i + 1), "damageMask", aPortBuildings[i].getNextHighestDepth(), {blendMode:"erase", _visible:false}));
} else {
aPortBuildingMasks.push(null);
}
i++;
}
var mcAntenna1 = mcCity.attachMovie("antenna1", "mcAntenna1", mcCity.getNextHighestDepth(), {_x:-151.5, _y:-593, _visible:false});
var mcAntenna2 = mcCity.attachMovie("antenna2", "mcAntenna2", mcCity.getNextHighestDepth(), {_x:-80, _y:-599, _visible:false});
var mcAntenna3 = mcCity.attachMovie("antenna3", "mcAntenna3", mcCity.getNextHighestDepth(), {_x:157.1, _y:-599, _visible:false});
var mcAntenna4 = mcCity.attachMovie("antenna4", "mcAntenna4", mcCity.getNextHighestDepth(), {_x:276.5, _y:-554, _visible:false});
var mcAntenna5 = mcAgriDome.attachMovie("antenna5", "mcAntenna5", mcAgriDome.getNextHighestDepth(), {_x:-238.7, _y:-533, _visible:false});
var mcAntenna6 = mcAgriDome.attachMovie("antenna6", "mcAntenna6", mcAgriDome.getNextHighestDepth(), {_x:-106, _y:-574, _visible:false});
var mcAntenna7 = mcAgriDome.attachMovie("antenna7", "mcAntenna7", mcAgriDome.getNextHighestDepth(), {_x:106.7, _y:-575.2, _visible:false});
var mcAntenna8 = mcAgriDome.attachMovie("antenna8", "mcAntenna8", mcAgriDome.getNextHighestDepth(), {_x:240.2, _y:-533.8, _visible:false});
var mcAntenna9 = mcSpacePort.attachMovie("antenna9", "mcAntenna9", mcSpacePort.getNextHighestDepth(), {_x:-158.7, _y:-613.8, _visible:false});
var mcAntenna10 = mcSpacePort.attachMovie("antenna10", "mcAntenna10", mcSpacePort.getNextHighestDepth(), {_x:-29.7, _y:-637.8, _visible:false});
var mcAntenna11 = mcSpacePort.attachMovie("antenna11", "mcAntenna11", mcSpacePort.getNextHighestDepth(), {_x:188.7, _y:-601.9, _visible:false});
var aAlienBombs = new Array();
i = 0;
while (i < nAlienBombs) {
aAlienBombs.push(attachMovie("alienBomb", "alienBomb" + i, this.getNextHighestDepth(), {bombScore:50, _visible:false}));
i++;
}
var aAliens = new Array();
var aAlienAnimations = new Array();
i = 0;
while (i < nSquids) {
aAliens.push(attachMovie("alienSquid", "alienSquid" + i, this.getNextHighestDepth(), {speed:1.5, maxSpeed:1.5, alienScore:100, alienType:0, energy:1, maxEnergy:1, _visible:false}));
aAlienAnimations.push(attachMovie("squidAnimation", "squidAnimation" + i, this.getNextHighestDepth(), {_visible:false, alienType:0}));
i++;
}
i = 0;
while (i < nSpitters) {
aAliens.push(attachMovie("alienSpitter", "alienSpitter" + i, this.getNextHighestDepth(), {speed:0.002, maxSpeed:0.002, alienScore:250, alienType:1, energy:1, maxEnergy:1, _visible:false, lColor:6750054, lLen:5, lVel:5, lWid:2}));
aAlienAnimations.push(attachMovie("spitterAnimation", "spitterAnimation" + i, this.getNextHighestDepth(), {_visible:false, alienType:1}));
i++;
}
i = 0;
while (i < nPowerUps) {
aAliens.push(attachMovie("alienPowerUp", "alienPowerUp" + i, this.getNextHighestDepth(), {speed:0.25, maxSpeed:0.25, alienScore:100, alienType:2, energy:1, maxEnergy:1, _visible:false}));
aAlienAnimations.push(attachMovie("powerUpAnimation", "powerUpAnimation" + i, this.getNextHighestDepth(), {_visible:false, alienType:2}));
i++;
}
i = 0;
while (i < nMines) {
aAliens.push(attachMovie("alienMine", "alienMine" + i, this.getNextHighestDepth(), {speed:0.25, maxSpeed:0.25, alienScore:100, alienType:3, energy:1, maxEnergy:1, _visible:false}));
aAlienAnimations.push(attachMovie("mineAnimation", "mineAnimation" + i, this.getNextHighestDepth(), {_visible:false, alienType:3}));
i++;
}
i = 0;
while (i < nBrains) {
aAliens.push(attachMovie("alienBrain", "alienBrain" + i, this.getNextHighestDepth(), {speed:0.001, maxSpeed:0.001, alienScore:500, alienType:4, energy:3, maxEnergy:3, _visible:false, lColor:3394815, lLen:10, lVel:8, lWid:2}));
aAlienAnimations.push(attachMovie("brainAnimation", "brainAnimation" + i, this.getNextHighestDepth(), {_visible:false, alienType:4}));
i++;
}
i = 0;
while (i < nShips) {
aAliens.push(attachMovie("alienShip", "alienShip" + i, this.getNextHighestDepth(), {speed:1, maxSpeed:1, alienScore:1000, alienType:5, energy:5, maxEnergy:5, _visible:false, ySpeed:3}));
aAlienAnimations.push(attachMovie("shipAnimation", "shipAnimation" + i, this.getNextHighestDepth(), {_visible:false, alienType:5}));
i++;
}
i = 0;
while (i < nEliteShips) {
aAliens.push(attachMovie("alienShipElite", "alienShipElite" + i, this.getNextHighestDepth(), {speed:1, maxSpeed:1, alienScore:1500, alienType:6, energy:10, maxEnergy:10, _visible:false, lColor:3394815, lLen:15, lVel:8, lWid:2, ySpeed:3}));
aAlienAnimations.push(attachMovie("shipEliteAnimation", "shipEliteAnimation" + i, this.getNextHighestDepth(), {_visible:false, alienType:6}));
i++;
}
var mcBossBEscortA = attachMovie("alienShipEscort", "mcBossBEscortA", this.getNextHighestDepth(), {speed:0.5, maxSpeed:0.5, alienScore:2500, alienType:7, energy:25, maxEnergy:25, _visible:false});
mcBossBEscortA._xscale = mcBossBEscortA._xscale * -1;
var mcBossBEscortB = attachMovie("alienShipEscort", "mcBossBEscortB", this.getNextHighestDepth(), {speed:0.5, maxSpeed:0.5, alienScore:2500, alienType:7, energy:25, maxEnergy:25, _visible:false});
var mcBossBBeamA = attachMovie("bossBShieldBeam", "mcBossBBeamA", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcBossBBeamB = attachMovie("bossBShieldBeam", "mcBossBBeamB", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcBossBEscortAnimationAA = attachMovie("shipEscortAnimationA", "mcBossBEscortAnimationAA", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcBossBEscortAnimationAB = attachMovie("shipEscortAnimationB", "mcBossBEscortAnimationAB", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcBossBEscortAnimationBA = attachMovie("shipEscortAnimationA", "mcBossBEscortAnimationBA", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcBossBEscortAnimationBB = attachMovie("shipEscortAnimationB", "mcBossBEscortAnimationBB", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcBossB = attachMovie("alienBossB", "mcBossB", this.getNextHighestDepth(), {speed:0.75, stageWidth:Stage.width, stageHeight:Stage.height, bossScore:50000, energy:550, maxEnergy:550, _x:-1000, _y:-1000, _visible:false});
var mcBossBAnimation = attachMovie("bossBAnimation", "mcBossBAnimation", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcBossBExplosion = attachMovie("bossBExplosion", "mcBossBExplosion", this.getNextHighestDepth(), {_xscale:50, _yscale:50, _x:-1000, _y:-1000, _visible:false});
var mcBossBShield = attachMovie("bossBShield", "mcBossBShield", this.getNextHighestDepth(), {_xscale:225, _yscale:155, _x:-1000, _y:-1000, _visible:false});
var aListBox = new Array();
var aScoreBoxes = new Array();
i = 0;
while (i < nSquids) {
aScoreBoxes.push(attachMovie("scoreBox100", "scoreBox100" + i, this.getNextHighestDepth(), {_visible:false}));
i++;
}
i = 0;
while (i < nSpitters) {
aScoreBoxes.push(attachMovie("scoreBox250", "scoreBox250" + i, this.getNextHighestDepth(), {_visible:false}));
i++;
}
i = 0;
while (i < nPowerUps) {
aScoreBoxes.push(null);
i++;
}
i = 0;
while (i < nMines) {
aScoreBoxes.push(null);
i++;
}
i = 0;
while (i < nBrains) {
aScoreBoxes.push(attachMovie("scoreBox500", "scoreBox500" + i, this.getNextHighestDepth(), {_visible:false}));
i++;
}
i = 0;
while (i < nShips) {
aScoreBoxes.push(attachMovie("scoreBox1000", "scoreBox1000" + i, this.getNextHighestDepth(), {_visible:false}));
i++;
}
i = 0;
while (i < nEliteShips) {
aScoreBoxes.push(attachMovie("scoreBox1500", "scoreBox1500" + i, this.getNextHighestDepth(), {_visible:false}));
i++;
}
aScoreBoxes.push(attachMovie("scoreBox2500", "scoreBox25000", this.getNextHighestDepth(), {_visible:false}));
aScoreBoxes.push(attachMovie("scoreBox2500", "scoreBox25001", this.getNextHighestDepth(), {_visible:false}));
var aPowerUpAnimations = new Array();
aPowerUpAnimations.push(attachMovie("twinAnimation", "twinAnimation", this.getNextHighestDepth(), {_visible:false, _xscale:250, _yscale:250}));
aPowerUpAnimations.push(attachMovie("lancerAnimation", "lancerAnimation", this.getNextHighestDepth(), {_visible:false, _xscale:250, _yscale:250}));
aPowerUpAnimations.push(attachMovie("spreadAnimation", "spreadAnimation", this.getNextHighestDepth(), {_visible:false, _xscale:250, _yscale:250}));
aPowerUpAnimations.push(attachMovie("lazerAnimation", "lazerAnimation", this.getNextHighestDepth(), {_visible:false, _xscale:250, _yscale:250}));
aPowerUpAnimations.push(attachMovie("missileAnimation", "missileAnimation", this.getNextHighestDepth(), {_visible:false, _xscale:250, _yscale:250}));
var aListBomb = new Array();
var aBombs = new Array();
i = 0;
while (i < nBombs) {
aBombs.push(attachMovie("bomb", "bomb" + i, this.getNextHighestDepth(), {filters:bombFilter, _visible:false}));
i++;
}
var aAlienProjectiles = new Array();
i = 0;
while (i < nProjectiles) {
aAlienProjectiles.push(attachMovie("alienProjectile", "alienProjectile" + i, this.getNextHighestDepth(), {_visible:false}));
i++;
}
var aBombAnimations = new Array();
i = 0;
while (i < nBombAnimations) {
aBombAnimations.push(attachMovie("bombAnimation", "bombAnimation" + i, this.getNextHighestDepth(), {filters:bombFilter, _visible:false}));
i++;
}
this.createEmptyMovieClip("mcAPIa", this.getNextHighestDepth());
this.createEmptyMovieClip("mcAPIe", this.getNextHighestDepth());
this.createEmptyMovieClip("mcAPIb", this.getNextHighestDepth());
var mcPlanetOverlay = attachMovie("planetOverlay", "mcPlanetOverlay", this.getNextHighestDepth(), {_visible:false});
var mcPowerLines = attachMovie("powerLines", "mcPowerLines", this.getNextHighestDepth(), {_visible:false});
var mcOtherSide = attachMovie("otherSide", "mcOtherSide", this.getNextHighestDepth(), {_visible:false});
var mcGunBase = attachMovie("gunBase", "mcGunBase", this.getNextHighestDepth(), {_visible:false});
var mcTankA = attachMovie("tankA", "mcTankA", this.getNextHighestDepth(), {speed:0.1, nTankFlag:0, _visible:false});
var mcTankB = attachMovie("tankB", "mcTankB", this.getNextHighestDepth(), {speed:0.1, nTankFlag:1, _visible:false});
this.createEmptyMovieClip("mcAPIp", this.getNextHighestDepth());
mcTankA.origTurretPos = mcTankA.tankTurret._x;
mcTankA.origJointPos = mcTankA.tankJoint._x;
mcTankB.origTurretPos = mcTankB.tankTurret._x;
mcTankB.origJointPos = mcTankB.tankJoint._x;
var aPowerLineAnimations = new Array();
i = 1;
while (i <= 6) {
aPowerLineAnimations.push(mcPowerLines.attachMovie("lineAnimation" + i, "lineAnimation" + i, mcPowerLines.getNextHighestDepth(), {_x:mcPowerLines["line" + i]._x, _y:mcPowerLines["line" + i]._y, _visible:false}));
i++;
}
var mcBossBLazerA = attachMovie("bossBLazerA", "mcBossBLazerA", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcBossBLazerB = attachMovie("bossBLazerB", "mcBossBLazerB", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var aMissiles = new Array();
i = 0;
while (i < nPMissiles) {
aMissiles.push(attachMovie("gameMissile", "gameMissile" + i, this.getNextHighestDepth(), {_visible:false}));
aMissiles[i].thruster.filters = thrustFilter;
i++;
}
var aBuildingEnergyBars = new Array();
aBuildingEnergyBars.push(attachMovie("buildingEnergy", "buildingEnergy1", this.getNextHighestDepth(), {_visible:false}));
aBuildingEnergyBars.push(attachMovie("buildingEnergy", "buildingEnergy2", this.getNextHighestDepth(), {_visible:false}));
aBuildingEnergyBars.push(attachMovie("buildingEnergy", "buildingEnergy3", this.getNextHighestDepth(), {_visible:false}));
aBuildingEnergyBars.push(attachMovie("buildingEnergy", "buildingEnergy4", this.getNextHighestDepth(), {_visible:false}));
var mcUnitCursor = attachMovie("cursorUnit", "mcUnitCursor", this.getNextHighestDepth(), {_visible:false});
var aPowerUps = new Array();
var aListPowerUps = new Array();
var aSelectPos = new Array();
aSelectPos[0] = 600;
i = 0;
while (i < 3) {
aPowerUps[i] = new Array();
aPowerUps[i].push(attachMovie("twin", "twin" + i, this.getNextHighestDepth(), {_x:660, _y:aSelectPos[i], _xscale:300, _yscale:300, _visible:false}));
aPowerUps[i].push(attachMovie("lancer", "lancer" + i, this.getNextHighestDepth(), {_x:660, _y:aSelectPos[i], _xscale:300, _yscale:300, _visible:false}));
aPowerUps[i].push(attachMovie("spread", "spread" + i, this.getNextHighestDepth(), {_x:660, _y:aSelectPos[i], _xscale:300, _yscale:300, _visible:false}));
aPowerUps[i].push(attachMovie("lazer", "lazer" + i, this.getNextHighestDepth(), {_x:660, _y:aSelectPos[i], _xscale:300, _yscale:300, _visible:false}));
aPowerUps[i].push(attachMovie("missile", "missile" + i, this.getNextHighestDepth(), {_x:660, _y:aSelectPos[i], _xscale:300, _yscale:300, _visible:false}));
if (i < 2) {
aSelectPos[i + 1] = aSelectPos[i] - 50;
}
i++;
}
var mcSelectBox = attachMovie("selectBox", "mcSelectBox", this.getNextHighestDepth(), {_x:660, _y:aSelectPos[0], _xscale:300, _yscale:300, _visible:false});
var mcStatus = attachMovie("status", "mcStatus", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:25, _visible:false});
var mcEnergy = attachMovie("energy", "mcEnergy", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:655, _visible:false});
var aMessages = new Array();
aMessages[0] = new Array();
i = 1;
while (i <= nLevels) {
aMessages[0].push(attachMovie("level" + i, "level" + i, this.getNextHighestDepth(), {_x:-1000, _y:-1000, xPos:Stage.width / 2, yPos:(Stage.height / 2) - 150, _visible:false}));
i++;
}
aMessages[1] = new Array();
i = 1;
while (i <= nLevels) {
aMessages[1].push(attachMovie("levelMessage" + i, "levelMessage" + i, this.getNextHighestDepth(), {_x:-1000, _y:-1000, xPos:Stage.width / 2, yPos:Stage.height / 2, _visible:false}));
i++;
}
var mcGameOver = attachMovie("gameOver", "mcGameOver", this.getNextHighestDepth(), {_x:-1000, _y:-1000, xPos:Stage.width / 2, yPos:(Stage.height / 2) - 75, _visible:false});
var mcAreaWasted = attachMovie("areaWasted", "mcAreaWasted", this.getNextHighestDepth(), {_x:-1000, _y:-1000, xPos:Stage.width / 2, yPos:(Stage.height / 2) - 75, _visible:false});
var mcTowersInfected = attachMovie("towersInfected", "mcTowersInfected", this.getNextHighestDepth(), {_x:-1000, _y:-1000, xPos:Stage.width / 2, yPos:(Stage.height / 2) - 75, _visible:false});
var mcPlanetDefended = attachMovie("planetDefended", "mcPlanetDefended", this.getNextHighestDepth(), {_x:-1000, _y:-1000, xPos:Stage.width / 2, yPos:(Stage.height / 2) - 75, _visible:false});
var mcMenu = attachMovie("gameMenu", "mcMenu", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2, _visible:false});
var mcControlScreen = attachMovie("controlScreen", "mcControlScreen", this.getNextHighestDepth(), {_x:0, _y:0, _visible:false});
var mcInstructionScreen = attachMovie("instructionScreen", "mcInstructionScreen", this.getNextHighestDepth(), {_x:0, _y:0, _visible:false});
setMenuHandlers();
setControlScreenHandlers();
Key.addListener(mcControlScreen);
var mcPauseScreen = attachMovie("pauseScreen", "mcPauseScreen", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2, _visible:false});
var mcBonusScreen = attachMovie("bonusScreen", "mcBonusScreen", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2, _visible:false});
var mcLevelBonus = attachMovie("levelBonus", "mcLevelBonus", this.getNextHighestDepth(), {_x:-1000, _y:-1000, xPos:Stage.width / 2, yPos:(Stage.height / 2) - 200, _visible:false});
var mcStoryScreen = attachMovie("storyScreen", "mcStoryScreen", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2, _visible:false});
var mcHelpWinA = attachMovie("helpWinA", "mcHelpWinA", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcHelpWinB = attachMovie("helpWinB", "mcHelpWinB", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcHelpWinC = attachMovie("helpWinC", "mcHelpWinC", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcHelpWinD = attachMovie("helpWinD", "mcHelpWinD", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcHelpWinE = attachMovie("helpWinE", "mcHelpWinE", this.getNextHighestDepth(), {_x:-1000, _y:-1000, _visible:false});
var mcTotalScreen = attachMovie("totalScreen", "mcTotalScreen", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2, _visible:false});
var mcCursor = attachMovie("cursorTarget", "mcCursor", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:-100, _visible:false});
var mcTargetCursor = attachMovie("targetLock", "mcTargetCursor", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:-100, _visible:false});
mcHelpWinB.onPress = function () {
this._parent.clearHelpWinB();
};
mcTotalScreen.mainMenu.onPress = function () {
this._parent._visible = false;
this._parent._x = -1000;
this._parent._y = -1000;
this._parent._parent.renderMenu();
};
mcTotalScreen.kongChallenge.onPress = function () {
_root.getURL("http://www.kongregate.com?gamereferrer=pod", "_blank");
};
mcTotalScreen.statisticMessage.selectable = false;
mcTotalScreen.totalAccuracy.selectable = false;
mcTotalScreen.totalScore.selectable = false;
mcStatus.levelTxt.selectable = false;
mcStatus.scoreTxt.selectable = false;
mcHelpWinA.helpWinKey.selectable = false;
mcHelpWinA.helpWinTextA.selectable = false;
mcHelpWinA.helpWinTextB.selectable = false;
mcHelpWinA.helpWinTextC.selectable = false;
mcHelpWinB.helpWinKey.selectable = false;
mcHelpWinB.helpWinTextA.selectable = false;
mcHelpWinC.helpWinKey.selectable = false;
mcHelpWinC.helpWinTextA.selectable = false;
mcHelpWinC.helpWinTextB.selectable = false;
mcHelpWinD.helpWinTitle.selectable = false;
mcHelpWinD.helpWinText.selectable = false;
mcHelpWinE.helpWinTitle.selectable = false;
mcHelpWinE.helpWinTextA.selectable = false;
mcHelpWinE.helpWinTextB.selectable = false;
mcHelpWinE.helpWinTextC.selectable = false;
mcHelpWinE.helpWinKeyA.selectable = false;
mcHelpWinE.helpWinKeyB.selectable = false;
mcBonusScreen.bonusTextA.type0.selectable = false;
mcBonusScreen.bonusTextA.type1.selectable = false;
mcBonusScreen.bonusTextA.type2.selectable = false;
mcBonusScreen.bonusTextA.mult0.selectable = false;
mcBonusScreen.bonusTextA.mult1.selectable = false;
mcBonusScreen.bonusTextA.mult2.selectable = false;
mcBonusScreen.bonusTextA.bonus0.selectable = false;
mcBonusScreen.bonusTextA.bonus1.selectable = false;
mcBonusScreen.bonusTextA.bonus2.selectable = false;
mcBonusScreen.bonusTextB.type0.selectable = false;
mcBonusScreen.bonusTextB.type1.selectable = false;
mcBonusScreen.bonusTextB.mult0.selectable = false;
mcBonusScreen.bonusTextB.mult1.selectable = false;
mcBonusScreen.bonusTextB.bonus0.selectable = false;
mcBonusScreen.bonusTextB.bonus1.selectable = false;
mcBonusScreen.bonusTextC.type0.selectable = false;
mcBonusScreen.bonusTextC.type1.selectable = false;
mcBonusScreen.bonusTextC.type2.selectable = false;
mcBonusScreen.bonusTextC.mult0.selectable = false;
mcBonusScreen.bonusTextC.mult1.selectable = false;
mcBonusScreen.bonusTextC.mult2.selectable = false;
mcBonusScreen.bonusTextC.bonus0.selectable = false;
mcBonusScreen.bonusTextC.bonus1.selectable = false;
mcBonusScreen.bonusTextC.bonus2.selectable = false;
mcBonusScreen.accuracy.selectable = false;
mcBonusScreen.totalBonus.selectable = false;
var mcGameMask = attachMovie("gameMask", "mcGameMask", this.getNextHighestDepth());
this.setMask(mcGameMask);
var oMouseListener = new Object();
oMouseListener.onMouseMove = function () {
mcCursor._x = _xmouse;
if (_ymouse < yMouseBounds) {
mcCursor._y = _ymouse;
}
};
oMouseListener.onMouseDown = function () {
if (bGameInPlay) {
if (bAutoFire) {
addAutoLaser();
if (nAutoFireID == null) {
nAutoFireID = setInterval(addAutoLaser, 125);
}
} else {
addAutoLaser();
}
}
};
oMouseListener.onMouseUp = function () {
if (bGameInPlay) {
Mouse.hide();
if (bAutoFire) {
clearAutoFireInterval();
}
}
};
mcControlScreen.onKeyUp = menuKeyHandler;
playLogo();
Frame 4
stop();
Symbol 19 MovieClip Frame 1
function init() {
points[0] = {x:-40, y:-40, z:-40};
points[1] = {x:40, y:-40, z:-40};
points[2] = {x:40, y:40, z:-40};
points[3] = {x:-40, y:40, z:-40};
points[4] = {x:-40, y:-40, z:40};
points[5] = {x:40, y:-40, z:40};
points[6] = {x:40, y:40, z:40};
points[7] = {x:-40, y:40, z:40};
triangles[0] = {a:0, b:1, c:2, col:15658734};
triangles[1] = {a:0, b:2, c:3, col:15658734};
triangles[2] = {a:0, b:5, c:1, col:10066381};
triangles[3] = {a:0, b:4, c:5, col:10066381};
triangles[4] = {a:4, b:6, c:5, col:15658734};
triangles[5] = {a:4, b:7, c:6, col:15658734};
triangles[6] = {a:3, b:2, c:6, col:10066381};
triangles[7] = {a:3, b:6, c:7, col:10066381};
triangles[8] = {a:1, b:5, c:6, col:13421823};
triangles[9] = {a:1, b:6, c:2, col:13421823};
triangles[10] = {a:4, b:0, c:3, col:13421823};
triangles[11] = {a:4, b:3, c:7, col:13421823};
}
function onEnterFrame() {
var _local1 = 0;
while (_local1 < points.length) {
rotateY(points[_local1], angleY);
rotateX(points[_local1], angleX);
var _local3 = fl / ((fl + points[_local1].z) + zOffset);
points[_local1].xPos = vpx + (points[_local1].x * _local3);
points[_local1].yPos = vpy + (points[_local1].y * _local3);
_local1++;
}
clear();
var _local2 = 0;
while (_local2 < triangles.length) {
renderTriangle(triangles[_local2]);
_local2++;
}
}
function renderTriangle(tri) {
var _local4 = points[tri.a];
var _local3 = points[tri.b];
var _local2 = points[tri.c];
if (isBackFace(_local4, _local3, _local2)) {
return(undefined);
}
beginFill(tri.col, 100);
moveTo(points[tri.a].xPos, points[tri.a].yPos);
lineTo(points[tri.b].xPos, points[tri.b].yPos);
lineTo(points[tri.c].xPos, points[tri.c].yPos);
lineTo(points[tri.a].xPos, points[tri.a].yPos);
endFill();
}
function isBackFace(pointA, pointB, pointC) {
var _local5 = pointC.xPos - pointA.xPos;
var _local3 = pointC.yPos - pointA.yPos;
var _local4 = pointB.xPos - pointC.xPos;
var _local2 = pointB.yPos - pointC.yPos;
if ((_local5 * _local2) > (_local3 * _local4)) {
return(true);
}
return(false);
}
function rotateX(point, angle) {
var _local6 = [point.x, point.y, point.z];
var _local4 = Math.sin(angle);
var _local5 = Math.cos(angle);
var _local1 = new Array();
_local1[0] = [1, 0, 0];
_local1[1] = [0, _local5, _local4];
_local1[2] = [0, -_local4, _local5];
var _local3 = matrixMultiply(_local6, _local1);
point.x = _local3[0];
point.y = _local3[1];
point.z = _local3[2];
}
function rotateY(point, angle) {
var _local6 = [point.x, point.y, point.z];
var _local4 = Math.sin(angle);
var _local5 = Math.cos(angle);
var _local1 = new Array();
_local1[0] = [_local5, 0, _local4];
_local1[1] = [0, 1, 0];
_local1[2] = [-_local4, 0, _local5];
var _local3 = matrixMultiply(_local6, _local1);
point.x = _local3[0];
point.y = _local3[1];
point.z = _local3[2];
}
function matrixMultiply(matrixA, matrixB) {
var _local3 = new Array();
_local3[0] = ((matrixA[0] * matrixB[0][0]) + (matrixA[1] * matrixB[1][0])) + (matrixA[2] * matrixB[2][0]);
_local3[1] = ((matrixA[0] * matrixB[0][1]) + (matrixA[1] * matrixB[1][1])) + (matrixA[2] * matrixB[2][1]);
_local3[2] = ((matrixA[0] * matrixB[0][2]) + (matrixA[1] * matrixB[1][2])) + (matrixA[2] * matrixB[2][2]);
return(_local3);
}
var points = new Array();
var triangles = new Array();
var fl = 250;
var vpx = 0;
var vpy = 0;
var angleY = 0.05;
var angleX = 0.05;
var zOffset = 200;
init();
Symbol 30 MovieClip [lineAnimation6] Frame 8
stop();
this._visible = false;
Symbol 35 MovieClip [lineAnimation5] Frame 8
stop();
this._visible = false;
Symbol 40 MovieClip [lineAnimation4] Frame 8
stop();
this._visible = false;
Symbol 45 MovieClip [lineAnimation3] Frame 8
stop();
this._visible = false;
Symbol 50 MovieClip [lineAnimation2] Frame 8
stop();
this._visible = false;
Symbol 55 MovieClip [lineAnimation1] Frame 8
stop();
this._visible = false;
Symbol 62 MovieClip [bossBShield] Frame 1
#initclip 184
Object.registerClass("bossBShield", bossBShield);
#endinitclip
Symbol 67 MovieClip [bossBShieldBeam] Frame 1
#initclip 35
Object.registerClass("bossBShieldBeam", shieldBeam);
#endinitclip
Symbol 92 MovieClip [portDamage17] Frame 15
stop();
this._visible = false;
Symbol 95 MovieClip [buildingAnimationPort17] Frame 15
stop();
this._visible = false;
Symbol 96 MovieClip [portDamage16] Frame 15
stop();
this._visible = false;
Symbol 97 MovieClip [buildingAnimationPort16] Frame 15
stop();
this._visible = false;
Symbol 98 MovieClip [portDamage15] Frame 15
stop();
this._visible = false;
Symbol 99 MovieClip [buildingAnimationPort15] Frame 15
stop();
this._visible = false;
Symbol 100 MovieClip [portDamage14] Frame 15
stop();
this._visible = false;
Symbol 101 MovieClip [buildingAnimationPort14] Frame 15
stop();
this._visible = false;
Symbol 102 MovieClip [buildingAnimationPort13] Frame 15
stop();
this._visible = false;
Symbol 103 MovieClip [buildingAnimationPort12] Frame 15
stop();
this._visible = false;
Symbol 104 MovieClip [portDamage11] Frame 15
stop();
this._visible = false;
Symbol 105 MovieClip [buildingAnimationPort11] Frame 15
stop();
this._visible = false;
Symbol 106 MovieClip [buildingAnimationPort10] Frame 15
stop();
this._visible = false;
Symbol 107 MovieClip [portDamage9] Frame 15
stop();
this._visible = false;
Symbol 108 MovieClip [buildingAnimationPort9] Frame 15
stop();
this._visible = false;
Symbol 109 MovieClip [portDamage8] Frame 15
stop();
this._visible = false;
Symbol 110 MovieClip [buildingAnimationPort8] Frame 15
stop();
this._visible = false;
Symbol 111 MovieClip [buildingAnimationPort7] Frame 15
stop();
this._visible = false;
Symbol 112 MovieClip [portDamage6] Frame 15
stop();
this._visible = false;
Symbol 113 MovieClip [buildingAnimationPort6] Frame 15
stop();
this._visible = false;
Symbol 114 MovieClip [portDamage5] Frame 15
stop();
this._visible = false;
Symbol 115 MovieClip [buildingAnimationPort5] Frame 15
stop();
this._visible = false;
Symbol 116 MovieClip [portDamage4] Frame 15
stop();
this._visible = false;
Symbol 117 MovieClip [buildingAnimationPort4] Frame 15
stop();
this._visible = false;
Symbol 118 MovieClip [portDamage3] Frame 15
stop();
this._visible = false;
Symbol 119 MovieClip [buildingAnimationPort3] Frame 15
stop();
this._visible = false;
Symbol 120 MovieClip [buildingAnimationPort2] Frame 15
stop();
this._visible = false;
Symbol 121 MovieClip [buildingAnimationPort1] Frame 15
stop();
this._visible = false;
Symbol 123 MovieClip [towersInfected] Frame 1
#initclip 36
Object.registerClass("towersInfected", gMessage);
#endinitclip
Symbol 125 MovieClip [areaWasted] Frame 1
#initclip 37
Object.registerClass("areaWasted", gMessage);
#endinitclip
Symbol 128 MovieClip [planetDefended] Frame 1
#initclip 38
Object.registerClass("planetDefended", gMessage);
#endinitclip
Symbol 130 MovieClip [gameOver] Frame 1
#initclip 39
Object.registerClass("gameOver", gMessage);
#endinitclip
Symbol 137 MovieClip [bossBAnimation] Frame 1
#initclip 40
Object.registerClass("bossBAnimation", bossAnimation);
#endinitclip
stop();
Symbol 137 MovieClip [bossBAnimation] Frame 17
this._parent.mcBossB.bBossDefeated = true;
this.removeAnimation();
Symbol 159 MovieClip [alienBossB] Frame 1
#initclip 41
Object.registerClass("alienBossB", alienBossB);
#endinitclip
Symbol 161 MovieClip [otherSide] Frame 1
stop();
Symbol 163 MovieClip [domeDamage9] Frame 15
stop();
this._visible = false;
Symbol 164 MovieClip [domeDamage8] Frame 15
stop();
this._visible = false;
Symbol 165 MovieClip [domeDamage7] Frame 15
stop();
this._visible = false;
Symbol 166 MovieClip [domeDamage5] Frame 15
stop();
this._visible = false;
Symbol 167 MovieClip [domeDamage3] Frame 15
stop();
this._visible = false;
Symbol 168 MovieClip [domeDamage2] Frame 15
stop();
this._visible = false;
Symbol 169 MovieClip [domeDamage1] Frame 15
stop();
this._visible = false;
Symbol 171 MovieClip [buildingAnimationDome1] Frame 15
stop();
this._visible = false;
Symbol 172 MovieClip [buildingAnimationDome3] Frame 15
stop();
this._visible = false;
Symbol 173 MovieClip [buildingAnimationDome7] Frame 15
stop();
this._visible = false;
Symbol 174 MovieClip [buildingAnimationDome9] Frame 15
stop();
this._visible = false;
Symbol 175 MovieClip [buildingAnimationDome2] Frame 15
stop();
this._visible = false;
Symbol 176 MovieClip [buildingAnimationDome6] Frame 15
stop();
this._visible = false;
Symbol 177 MovieClip [buildingAnimationDome8] Frame 15
stop();
this._visible = false;
Symbol 178 MovieClip [buildingAnimationDome4] Frame 15
stop();
this._visible = false;
Symbol 179 MovieClip [buildingAnimationDome5] Frame 15
stop();
this._visible = false;
Symbol 195 MovieClip [cityDamage25] Frame 15
stop();
this._visible = false;
Symbol 198 MovieClip [cityDamage15] Frame 15
stop();
this._visible = false;
Symbol 201 MovieClip [cityDamage24] Frame 15
stop();
this._visible = false;
Symbol 202 MovieClip [cityDamage23] Frame 15
stop();
this._visible = false;
Symbol 203 MovieClip [cityDamage22] Frame 15
stop();
this._visible = false;
Symbol 204 MovieClip [cityDamage21] Frame 15
stop();
this._visible = false;
Symbol 205 MovieClip [cityDamage20] Frame 15
stop();
this._visible = false;
Symbol 206 MovieClip [cityDamage18] Frame 15
stop();
this._visible = false;
Symbol 207 MovieClip [cityDamage17] Frame 15
stop();
this._visible = false;
Symbol 208 MovieClip [cityDamage16] Frame 15
stop();
this._visible = false;
Symbol 209 MovieClip [cityDamage12] Frame 15
stop();
this._visible = false;
Symbol 210 MovieClip [cityDamage11] Frame 15
stop();
this._visible = false;
Symbol 211 MovieClip [cityDamage10] Frame 15
stop();
this._visible = false;
Symbol 212 MovieClip [cityDamage9] Frame 15
stop();
this._visible = false;
Symbol 213 MovieClip [cityDamage8] Frame 15
stop();
this._visible = false;
Symbol 214 MovieClip [cityDamage7] Frame 15
stop();
this._visible = false;
Symbol 215 MovieClip [cityDamage6] Frame 15
stop();
this._visible = false;
Symbol 216 MovieClip [cityDamage3] Frame 15
stop();
this._visible = false;
Symbol 217 MovieClip [cityDamage2] Frame 15
stop();
this._visible = false;
Symbol 218 MovieClip [cityDamage1] Frame 15
stop();
this._visible = false;
Symbol 255 MovieClip [levelBonus] Frame 1
#initclip 42
Object.registerClass("levelBonus", gMessage);
#endinitclip
Symbol 255 MovieClip [levelBonus] Frame 29
stop();
Symbol 323 MovieClip Frame 1
stop();
Symbol 329 MovieClip [tankB] Frame 1
#initclip 43
Object.registerClass("tankB", tank);
#endinitclip
Symbol 330 MovieClip [tankA] Frame 1
#initclip 44
Object.registerClass("tankA", tank);
#endinitclip
Symbol 335 MovieClip [gameMissile] Frame 1
#initclip 45
Object.registerClass("gameMissile", missile);
#endinitclip
Symbol 352 MovieClip [missileAnimation] Frame 1
#initclip 46
Object.registerClass("missileAnimation", animation);
#endinitclip
Symbol 352 MovieClip [missileAnimation] Frame 37
this.removeAnimation();
Symbol 355 MovieClip [missile] Frame 25
stop();
Symbol 357 MovieClip [alienPowerUp] Frame 1
#initclip 47
Object.registerClass("alienPowerUp", alienMine);
#endinitclip
stop();
Symbol 362 MovieClip [twinAnimation] Frame 1
#initclip 48
Object.registerClass("twinAnimation", animation);
#endinitclip
Symbol 362 MovieClip [twinAnimation] Frame 38
this.removeAnimation();
Symbol 365 MovieClip [twin] Frame 25
stop();
Symbol 378 MovieClip [lazerAnimation] Frame 1
#initclip 49
Object.registerClass("lazerAnimation", animation);
#endinitclip
Symbol 378 MovieClip [lazerAnimation] Frame 36
this.removeAnimation();
Symbol 382 MovieClip Frame 1
stop();
Symbol 382 MovieClip Frame 2
stop();
Symbol 382 MovieClip Frame 3
stop();
Symbol 383 MovieClip [lazer] Frame 25
stop();
Symbol 393 MovieClip [spreadAnimation] Frame 1
#initclip 50
Object.registerClass("spreadAnimation", animation);
#endinitclip
Symbol 393 MovieClip [spreadAnimation] Frame 36
this.removeAnimation();
Symbol 396 MovieClip [spread] Frame 25
stop();
Symbol 399 MovieClip [lancer] Frame 25
stop();
Symbol 403 MovieClip [lancerAnimation] Frame 1
#initclip 51
Object.registerClass("lancerAnimation", animation);
#endinitclip
Symbol 403 MovieClip [lancerAnimation] Frame 38
this.removeAnimation();
Symbol 405 MovieClip [infectedBuilding7] Frame 1
stop();
Symbol 407 MovieClip [infectedBuilding5] Frame 1
stop();
Symbol 409 MovieClip [infectedBuilding3] Frame 1
stop();
Symbol 411 MovieClip [infectedBuilding1] Frame 1
stop();
Symbol 413 MovieClip [infectedBuilding8] Frame 1
stop();
Symbol 415 MovieClip [infectedBuilding6] Frame 1
stop();
Symbol 417 MovieClip [infectedBuilding4] Frame 1
stop();
Symbol 419 MovieClip [infectedBuilding2] Frame 1
stop();
Symbol 426 MovieClip [brainAnimation] Frame 1
#initclip 52
Object.registerClass("brainAnimation", alienAnimation);
#endinitclip
Symbol 426 MovieClip [brainAnimation] Frame 10
this.removeAnimation();
Symbol 432 MovieClip [alienBrain] Frame 1
#initclip 53
Object.registerClass("alienBrain", alienBrain);
#endinitclip
Symbol 432 MovieClip [alienBrain] Frame 24
if (this._parent.bPaused) {
stop();
} else {
gotoAndPlay (1);
}
Symbol 460 MovieClip Frame 1
kongLink.onPress = function () {
getURL ("http://www.kongregate.com?gamereferrer=pod", "_blank");
};
Symbol 460 MovieClip Frame 105
kongLink.onPress = function () {
getURL ("http://www.kongregate.com", "_blank");
};
Symbol 460 MovieClip Frame 129
stop();
this.removeMovieClip();
Symbol 473 MovieClip [logo] Frame 269
stop();
this._parent.playIntro();
this.removeMovieClip();
Symbol 475 MovieClip [buildingAnimation4] Frame 15
stop();
this._visible = false;
Symbol 476 MovieClip [buildingAnimation8] Frame 15
stop();
this._visible = false;
Symbol 477 MovieClip [buildingAnimation11] Frame 15
stop();
this._visible = false;
Symbol 478 MovieClip [buildingAnimation13] Frame 15
stop();
this._visible = false;
Symbol 479 MovieClip [buildingAnimation19] Frame 15
stop();
this._visible = false;
Symbol 480 MovieClip [buildingAnimation21] Frame 15
stop();
this._visible = false;
Symbol 481 MovieClip [buildingAnimation25] Frame 15
stop();
this._visible = false;
Symbol 482 MovieClip [buildingAnimation6] Frame 15
stop();
this._visible = false;
Symbol 483 MovieClip [buildingAnimation14] Frame 15
stop();
this._visible = false;
Symbol 484 MovieClip [buildingAnimation17] Frame 15
stop();
this._visible = false;
Symbol 485 MovieClip [buildingAnimation23] Frame 15
stop();
this._visible = false;
Symbol 486 MovieClip [buildingAnimation2] Frame 15
stop();
this._visible = false;
Symbol 487 MovieClip [buildingAnimation3] Frame 15
stop();
this._visible = false;
Symbol 488 MovieClip [buildingAnimation5] Frame 15
stop();
this._visible = false;
Symbol 489 MovieClip [buildingAnimation7] Frame 15
stop();
this._visible = false;
Symbol 490 MovieClip [buildingAnimation9] Frame 15
stop();
this._visible = false;
Symbol 491 MovieClip [buildingAnimation10] Frame 15
stop();
this._visible = false;
Symbol 492 MovieClip [buildingAnimation12] Frame 15
stop();
this._visible = false;
Symbol 493 MovieClip [buildingAnimation15] Frame 15
stop();
this._visible = false;
Symbol 494 MovieClip [buildingAnimation16] Frame 15
stop();
this._visible = false;
Symbol 495 MovieClip [buildingAnimation18] Frame 15
stop();
this._visible = false;
Symbol 496 MovieClip [buildingAnimation20] Frame 15
stop();
this._visible = false;
Symbol 497 MovieClip [buildingAnimation22] Frame 15
stop();
this._visible = false;
Symbol 498 MovieClip [buildingAnimation24] Frame 15
stop();
this._visible = false;
Symbol 499 MovieClip [buildingAnimation1] Frame 15
stop();
this._visible = false;
Symbol 507 MovieClip [alienSquid] Frame 1
#initclip 54
Object.registerClass("alienSquid", alienSquid);
#endinitclip
Symbol 507 MovieClip [alienSquid] Frame 24
if (this._parent.bPaused) {
stop();
} else {
gotoAndPlay (1);
}
Symbol 510 MovieClip [alienSpitter] Frame 1
#initclip 55
Object.registerClass("alienSpitter", alienSpitter);
#endinitclip
Symbol 510 MovieClip [alienSpitter] Frame 10
if (this._parent.bPaused) {
stop();
} else {
gotoAndPlay (1);
}
Symbol 512 MovieClip [alienMine] Frame 1
#initclip 56
Object.registerClass("alienMine", alienMine);
#endinitclip
stop();
Symbol 518 MovieClip [spitterAnimation] Frame 1
#initclip 57
Object.registerClass("spitterAnimation", alienAnimation);
#endinitclip
Symbol 518 MovieClip [spitterAnimation] Frame 10
this.removeAnimation();
Symbol 535 MovieClip [shipEscortAnimationB] Frame 1
#initclip 58
Object.registerClass("shipEscortAnimationB", alienAnimation);
#endinitclip
Symbol 535 MovieClip [shipEscortAnimationB] Frame 11
this.removeAnimation();
Symbol 540 MovieClip [shipEscortAnimationA] Frame 1
#initclip 59
Object.registerClass("shipEscortAnimationA", alienAnimation);
#endinitclip
Symbol 540 MovieClip [shipEscortAnimationA] Frame 11
this.removeAnimation();
Symbol 545 MovieClip [shipEliteAnimation] Frame 1
#initclip 60
Object.registerClass("shipEliteAnimation", alienAnimation);
#endinitclip
Symbol 545 MovieClip [shipEliteAnimation] Frame 11
this.removeAnimation();
Symbol 553 MovieClip [shipAnimation] Frame 1
#initclip 61
Object.registerClass("shipAnimation", alienAnimation);
#endinitclip
Symbol 553 MovieClip [shipAnimation] Frame 11
this.removeAnimation();
Symbol 559 MovieClip [squidAnimation] Frame 1
#initclip 62
Object.registerClass("squidAnimation", alienAnimation);
#endinitclip
Symbol 559 MovieClip [squidAnimation] Frame 10
this.removeAnimation();
Symbol 568 MovieClip [bomb] Frame 1
#initclip 63
Object.registerClass("bomb", bomb);
#endinitclip
stop();
Symbol 568 MovieClip [bomb] Frame 17
this.removeBomb();
Symbol 569 MovieClip [bombAnimation] Frame 1
#initclip 64
Object.registerClass("bombAnimation", bombAnimation);
#endinitclip
stop();
Symbol 569 MovieClip [bombAnimation] Frame 17
this.removeBombAnimation();
Symbol 576 MovieClip [powerUpAnimation] Frame 1
#initclip 65
Object.registerClass("powerUpAnimation", alienAnimation);
#endinitclip
Symbol 576 MovieClip [powerUpAnimation] Frame 21
this._parent.removePowerUp(this.alienIndex);
this.removeAnimation();
Symbol 584 MovieClip [mineAnimation] Frame 1
#initclip 66
Object.registerClass("mineAnimation", alienAnimation);
#endinitclip
Symbol 584 MovieClip [mineAnimation] Frame 21
this.removeAnimation();
Symbol 587 MovieClip [levelMessage6] Frame 1
#initclip 67
Object.registerClass("levelMessage6", gMessage);
#endinitclip
Symbol 587 MovieClip [levelMessage6] Frame 49
stop();
this.removeMessage();
Symbol 590 MovieClip [levelMessage15] Frame 1
#initclip 68
Object.registerClass("levelMessage15", gMessage);
#endinitclip
Symbol 590 MovieClip [levelMessage15] Frame 49
stop();
this.removeMessage();
Symbol 593 MovieClip [levelMessage14] Frame 1
#initclip 69
Object.registerClass("levelMessage14", gMessage);
#endinitclip
Symbol 593 MovieClip [levelMessage14] Frame 49
stop();
this.removeMessage();
Symbol 596 MovieClip [levelMessage13] Frame 1
#initclip 70
Object.registerClass("levelMessage13", gMessage);
#endinitclip
Symbol 596 MovieClip [levelMessage13] Frame 49
stop();
this.removeMessage();
Symbol 599 MovieClip [levelMessage12] Frame 1
#initclip 71
Object.registerClass("levelMessage12", gMessage);
#endinitclip
Symbol 599 MovieClip [levelMessage12] Frame 49
stop();
this.removeMessage();
Symbol 602 MovieClip [levelMessage11] Frame 1
#initclip 72
Object.registerClass("levelMessage11", gMessage);
#endinitclip
Symbol 602 MovieClip [levelMessage11] Frame 49
stop();
this.removeMessage();
Symbol 605 MovieClip [levelMessage10] Frame 1
#initclip 73
Object.registerClass("levelMessage10", gMessage);
#endinitclip
Symbol 605 MovieClip [levelMessage10] Frame 49
stop();
this.removeMessage();
Symbol 608 MovieClip [levelMessage9] Frame 1
#initclip 74
Object.registerClass("levelMessage9", gMessage);
#endinitclip
Symbol 608 MovieClip [levelMessage9] Frame 49
stop();
this.removeMessage();
Symbol 611 MovieClip [levelMessage8] Frame 1
#initclip 75
Object.registerClass("levelMessage8", gMessage);
#endinitclip
Symbol 611 MovieClip [levelMessage8] Frame 49
stop();
this.removeMessage();
Symbol 614 MovieClip [levelMessage7] Frame 1
#initclip 76
Object.registerClass("levelMessage7", gMessage);
#endinitclip
Symbol 614 MovieClip [levelMessage7] Frame 49
stop();
this.removeMessage();
Symbol 617 MovieClip [levelMessage5] Frame 1
#initclip 77
Object.registerClass("levelMessage5", gMessage);
#endinitclip
Symbol 617 MovieClip [levelMessage5] Frame 49
stop();
this.removeMessage();
Symbol 620 MovieClip [levelMessage4] Frame 1
#initclip 78
Object.registerClass("levelMessage4", gMessage);
#endinitclip
Symbol 620 MovieClip [levelMessage4] Frame 49
stop();
this.removeMessage();
Symbol 623 MovieClip [levelMessage3] Frame 1
#initclip 79
Object.registerClass("levelMessage3", gMessage);
#endinitclip
Symbol 623 MovieClip [levelMessage3] Frame 49
stop();
this.removeMessage();
Symbol 626 MovieClip [levelMessage2] Frame 1
#initclip 80
Object.registerClass("levelMessage2", gMessage);
#endinitclip
Symbol 626 MovieClip [levelMessage2] Frame 49
stop();
this.removeMessage();
Symbol 629 MovieClip [levelMessage1] Frame 1
#initclip 81
Object.registerClass("levelMessage1", gMessage);
#endinitclip
Symbol 629 MovieClip [levelMessage1] Frame 49
stop();
this.removeMessage();
Symbol 632 MovieClip [level1] Frame 1
#initclip 82
Object.registerClass("level1", gMessage);
#endinitclip
Symbol 632 MovieClip [level1] Frame 49
stop();
this.removeMessage();
Symbol 635 MovieClip [level2] Frame 1
#initclip 83
Object.registerClass("level2", gMessage);
#endinitclip
Symbol 635 MovieClip [level2] Frame 49
stop();
this.removeMessage();
Symbol 638 MovieClip [level3] Frame 1
#initclip 84
Object.registerClass("level3", gMessage);
#endinitclip
Symbol 638 MovieClip [level3] Frame 49
stop();
this.removeMessage();
Symbol 641 MovieClip [level4] Frame 1
#initclip 85
Object.registerClass("level4", gMessage);
#endinitclip
Symbol 641 MovieClip [level4] Frame 49
stop();
this.removeMessage();
Symbol 644 MovieClip [level5] Frame 1
#initclip 86
Object.registerClass("level5", gMessage);
#endinitclip
Symbol 644 MovieClip [level5] Frame 49
stop();
this.removeMessage();
Symbol 647 MovieClip [level6] Frame 1
#initclip 87
Object.registerClass("level6", gMessage);
#endinitclip
Symbol 647 MovieClip [level6] Frame 49
stop();
this.removeMessage();
Symbol 650 MovieClip [level7] Frame 1
#initclip 88
Object.registerClass("level7", gMessage);
#endinitclip
Symbol 650 MovieClip [level7] Frame 49
stop();
this.removeMessage();
Symbol 653 MovieClip [level8] Frame 1
#initclip 89
Object.registerClass("level8", gMessage);
#endinitclip
Symbol 653 MovieClip [level8] Frame 49
stop();
this.removeMessage();
Symbol 656 MovieClip [level9] Frame 1
#initclip 90
Object.registerClass("level9", gMessage);
#endinitclip
Symbol 656 MovieClip [level9] Frame 49
stop();
this.removeMessage();
Symbol 659 MovieClip [level10] Frame 1
#initclip 91
Object.registerClass("level10", gMessage);
#endinitclip
Symbol 659 MovieClip [level10] Frame 49
stop();
this.removeMessage();
Symbol 662 MovieClip [level11] Frame 1
#initclip 92
Object.registerClass("level11", gMessage);
#endinitclip
Symbol 662 MovieClip [level11] Frame 49
stop();
this.removeMessage();
Symbol 665 MovieClip [level12] Frame 1
#initclip 93
Object.registerClass("level12", gMessage);
#endinitclip
Symbol 665 MovieClip [level12] Frame 49
stop();
this.removeMessage();
Symbol 668 MovieClip [level13] Frame 1
#initclip 94
Object.registerClass("level13", gMessage);
#endinitclip
Symbol 668 MovieClip [level13] Frame 49
stop();
this.removeMessage();
Symbol 671 MovieClip [level14] Frame 1
#initclip 95
Object.registerClass("level14", gMessage);
#endinitclip
Symbol 671 MovieClip [level14] Frame 49
stop();
this.removeMessage();
Symbol 674 MovieClip [level15] Frame 1
#initclip 96
Object.registerClass("level15", gMessage);
#endinitclip
Symbol 674 MovieClip [level15] Frame 49
stop();
this.removeMessage();
Symbol 680 MovieClip [gameControls] Frame 1
stop();
Symbol 680 MovieClip [gameControls] Frame 2
stop();
Symbol 680 MovieClip [gameControls] Frame 3
stop();
Symbol 685 MovieClip [playGame] Frame 1
stop();
Symbol 685 MovieClip [playGame] Frame 2
stop();
Symbol 685 MovieClip [playGame] Frame 3
stop();
Symbol 701 MovieClip [intro] Frame 1
function playIntro() {
this.onEnterFrame = updateIntro;
skipIntro._visible = true;
nIntervalID1 = setInterval(fadeIn, 100, mcPlanet);
}
function playIntroMusic() {
this._parent.introMusic.start();
}
function updateIntro() {
var _local6 = tx - x;
var _local5 = ty - y;
var _local4 = tz - z;
var _local3 = Math.sqrt(((_local6 * _local6) + (_local5 * _local5)) + (_local4 * _local4));
x = x + (_local6 * easing);
y = y + (_local5 * easing);
z = z + (_local4 * easing);
if (playBoolA) {
mcCity._alpha = (mcAgriDome._alpha = (mcSpacePort._alpha = (mcMountains._alpha = (mcOtherSide._alpha = (maxDist - (_local3 - maxDist)) / _local3))));
}
if (_local3 < 100) {
if (playBoolB) {
addIntroAlien();
nIntervalID0 = setInterval(fadeOut, 100, skipIntro);
nIntervalID1 = setInterval(addIntroAlien, 1250);
playBoolB = false;
}
}
if (_local3 < 5) {
if (playBoolA) {
mcCity._alpha = (mcAgriDome._alpha = (mcSpacePort._alpha = (mcMountains._alpha = (mcOtherSide._alpha = 100))));
tx = 0;
ty = 70;
tz = -225;
clearInterval(nIntervalID1);
nIntervalID1 = null;
playBoolA = false;
} else {
fadeOutIntro();
}
}
scaleIntro();
var _local2 = null;
if (bBossUpdate) {
introBoss.x = introBoss.x + 1;
introBoss.y = introBoss.y + 0.75;
introBoss.z = introBoss.z - 1.2;
_local2 = fl / (fl + introBoss.z);
introBoss._alpha = (_local2 * 250) - introBoss.adjustAlpha;
introBoss._xscale = (introBoss._yscale = _local2 * 100);
introBoss._x = vpx + (introBoss.x * _local2);
introBoss._y = vpy + (introBoss.y * _local2);
}
var _local1 = 0;
while (_local1 < introAliens.length) {
introAliens[_local1].x = introAliens[_local1].x + 1;
introAliens[_local1].y = introAliens[_local1].y + 0.75;
introAliens[_local1].z = introAliens[_local1].z - 1.2;
_local2 = fl / (fl + introAliens[_local1].z);
introAliens[_local1]._alpha = (_local2 * 250) - introAliens[_local1].adjustAlpha;
if (introAliens[_local1].adjustAlpha > 0) {
introAliens[_local1].adjustAlpha = introAliens[_local1].adjustAlpha - 0.5;
} else {
introAliens[_local1].adjustAlpha = 0;
}
introAliens[_local1]._xscale = (introAliens[_local1]._yscale = _local2 * 100);
introAliens[_local1]._x = vpx + (introAliens[_local1].x * _local2);
introAliens[_local1]._y = vpy + (introAliens[_local1].y * _local2);
_local1++;
}
}
function scaleIntro() {
var _local1 = fl / (fl + z);
scalePlanet(_local1);
mcCity._xscale = (mcCity._yscale = (_local1 * 100) / 10);
mcCity._x = vpx + (x * _local1);
mcCity._y = vpy + (y * _local1);
mcAgriDome._xscale = (mcAgriDome._yscale = (_local1 * 100) / 10);
mcAgriDome._x = vpx + (x * _local1);
mcAgriDome._y = vpy + (y * _local1);
mcSpacePort._xscale = (mcSpacePort._yscale = (_local1 * 100) / 10);
mcSpacePort._x = vpx + (x * _local1);
mcSpacePort._y = vpy + (y * _local1);
mcMountains._xscale = (mcMountains._yscale = (_local1 * 100) / 10);
mcMountains._x = vpx + (x * _local1);
mcMountains._y = vpy + (y * _local1);
mcOtherSide._xscale = (mcOtherSide._yscale = (_local1 * 100) / 10);
mcOtherSide._x = vpx + (x * _local1);
mcOtherSide._y = vpy + (y * _local1);
}
function scalePlanet(scale) {
mcPlanet._xscale = (mcPlanet._yscale = scale * 100);
mcPlanet._x = vpx + (x * scale);
mcPlanet._y = vpy + (y * scale);
}
function fadeOutIntro() {
this._parent.introMusic.setVolume(this._parent.introMusic.getVolume() - 1);
this._alpha = this._alpha - 1;
if (this._alpha <= 1) {
x = 0;
y = 70;
z = -225;
scalePlanet(fl / (fl + z));
this._parent.introMusic.stop();
this._parent.initGameField();
this._parent.renderMenu();
this.removeMovieClip();
}
}
function addIntroAlien() {
var _local4 = 5;
var _local2 = null;
var _local1 = null;
var _local3 = null;
if ((introAliens.length > 20) && (bBossUpdate == false)) {
bBossUpdate = true;
introBoss._visible = true;
}
if (introAliens.length < 30) {
_local2 = -1000 + (Math.random() * 250);
_local1 = -1000 + (Math.random() * 250);
_local3 = 1250 - (Math.random() * 250);
nDepth++;
introAliens.push(attachMovie("introSpitter", "introSpitter" + nDepth, nDepth, {x:_local2, y:_local1, z:_local3, adjustAlpha:50}));
_local2 = -1000 + (Math.random() * 250);
_local1 = -1000 + (Math.random() * 250);
_local3 = 1250 - (Math.random() * 250);
nDepth++;
introAliens.push(attachMovie("introShip", "introShip" + nDepth, nDepth, {x:_local2, y:_local1, z:_local3, adjustAlpha:50}));
_local2 = -1000 + (Math.random() * 250);
_local1 = -1000 + (Math.random() * 250);
_local3 = 1250 - (Math.random() * 250);
nDepth++;
introAliens.push(attachMovie("introSquid", "introSquid" + nDepth, nDepth, {x:_local2, y:_local1, z:_local3, adjustAlpha:50}));
_local2 = -1000 + (Math.random() * 250);
_local1 = -1000 + (Math.random() * 250);
_local3 = 1250 - (Math.random() * 250);
nDepth++;
introAliens.push(attachMovie("introSpitter", "introSpitter" + nDepth, nDepth, {x:_local2, y:_local1, z:_local3, adjustAlpha:50}));
_local2 = -1000 + (Math.random() * 250);
_local1 = -1000 + (Math.random() * 250);
_local3 = 1250 - (Math.random() * 250);
nDepth++;
introAliens.push(attachMovie("introSpitter", "introSpitter" + nDepth, nDepth, {x:_local2, y:_local1, z:_local3, adjustAlpha:50}));
}
}
function fadeOut(mcTarget) {
if (mcTarget._alpha == 0) {
clearInterval(nIntervalID0);
nIntervalID0 = null;
} else {
mcTarget._alpha = mcTarget._alpha - 10;
if (mcTarget._alpha <= 10) {
mcTarget._alpha = 0;
}
}
}
function fadeIn(mcTarget) {
if (mcTarget._alpha == 100) {
clearInterval(nIntervalID1);
nIntervalID1 = null;
} else {
mcTarget._alpha = mcTarget._alpha + 10;
if (mcTarget._alpha >= 90) {
mcTarget._alpha = 100;
}
}
}
Key.addListener(this);
var mcPlanet = attachMovie("planet", "mcPlanet", -1001, {_x:Stage.width / 2, _y:(Stage.height / 2) - 50, _alpha:0});
var mcCity = attachMovie("city", "mcCity", -999, {_x:Stage.width / 2, _y:(Stage.height / 2) - 50, _alpha:0, _xscale:10, _yscale:10});
var mcAgriDome = attachMovie("agriDome", "mcAgriDome", -998, {_x:Stage.width / 2, _y:(Stage.height / 2) - 50, _alpha:0, _xscale:10, _yscale:10, _rotation:75});
var mcSpacePort = attachMovie("spacePort", "mcSpacePort", -997, {_x:Stage.width / 2, _y:(Stage.height / 2) - 50, _alpha:0, _xscale:10, _yscale:10, _rotation:-75});
var mcMountains = attachMovie("mountains", "mcMountains", -996, {_x:Stage.width / 2, _y:(Stage.height / 2) - 50, _alpha:0, _xscale:10, _yscale:10, _rotation:2.5});
var mcOtherSide = attachMovie("otherSide", "mcOtherSide", -995, {_x:Stage.width / 2, _y:(Stage.height / 2) - 50, _alpha:0, _xscale:10, _yscale:10, _rotation:180});
var mcTitle = attachMovie("titlePod", "mcTitle", 0, {_x:Stage.width / 2, _y:(Stage.height / 2) - 50});
var bBossUpdate = false;
var introBoss = attachMovie("alienBossA", "introBoss", 1);
introBoss._visible = false;
introBoss.stun._visible = false;
introBoss.x = -1000 + (Math.random() * 250);
introBoss.y = -1000 + (Math.random() * 250);
introBoss.z = 1250 - (Math.random() * 250);
introBoss.adjustAlpha = 35;
skipIntro._visible = false;
var introAliens = new Array();
var nDepth = 333;
var nIntervalID0 = null;
var nIntervalID1 = null;
var playBoolA = true;
var playBoolB = true;
var x = 0;
var y = -50;
var z = 0;
var scale = null;
var tx = 25;
var ty = 100;
var tz = -200;
var easing = 0.007;
var fl = 250;
var vpx = (Stage.width / 2);
var vpy = (Stage.height / 2);
var dx = (tx - x);
var dy = (ty - y);
var dz = (tz - z);
var maxDist = Math.sqrt(((dx * dx) + (dy * dy)) + (dz * dz));
this.onPress = function () {
if (nIntervalID0 != null) {
clearInterval(nIntervalID0);
nIntervalID0 = null;
}
if (nIntervalID1 != null) {
clearInterval(nIntervalID1);
nIntervalID1 = null;
}
x = 0;
y = 70;
z = -225;
scalePlanet(fl / (fl + z));
this._parent.introMusic.stop();
this._parent.initGameField();
this._parent.renderMenu();
this.removeMovieClip();
};
this.onKeyUp = function () {
if (!(Key.getCode() === 32)) {
} else {
if (nIntervalID0 != null) {
clearInterval(nIntervalID0);
nIntervalID0 = null;
}
if (nIntervalID1 != null) {
clearInterval(nIntervalID1);
nIntervalID1 = null;
}
x = 0;
y = 70;
z = -225;
scalePlanet(fl / (fl + z));
this._parent.introMusic.stop();
this._parent.initGameField();
this._parent.renderMenu();
this.removeMovieClip();
}
};
Symbol 710 MovieClip Frame 1
stop();
Symbol 710 MovieClip Frame 2
stop();
Symbol 710 MovieClip Frame 3
stop();
Symbol 725 MovieClip [gameMenu] Frame 1
stop();
Symbol 726 MovieClip [titlePod] Frame 1
this._parent.playIntroMusic();
Symbol 726 MovieClip [titlePod] Frame 170
this._parent.playIntro();
Symbol 726 MovieClip [titlePod] Frame 200
this.removeMovieClip();
Symbol 733 MovieClip Frame 1
stop();
Symbol 736 MovieClip Frame 1
stop();
Symbol 739 MovieClip Frame 1
stop();
Symbol 742 MovieClip Frame 1
stop();
Symbol 745 MovieClip Frame 1
stop();
Symbol 749 MovieClip Frame 1
stop();
Symbol 765 MovieClip [controlTower1] Frame 1
#initclip 97
Object.registerClass("controlTower1", building);
#endinitclip
stop();
Symbol 765 MovieClip [controlTower1] Frame 3
stop();
Symbol 768 MovieClip [controlTower2] Frame 1
#initclip 98
Object.registerClass("controlTower2", building);
#endinitclip
stop();
Symbol 768 MovieClip [controlTower2] Frame 3
stop();
Symbol 771 MovieClip [controlTower3] Frame 1
#initclip 99
Object.registerClass("controlTower3", building);
#endinitclip
stop();
Symbol 771 MovieClip [controlTower3] Frame 3
stop();
Symbol 774 MovieClip [controlTower4] Frame 1
#initclip 100
Object.registerClass("controlTower4", building);
#endinitclip
stop();
Symbol 774 MovieClip [controlTower4] Frame 3
stop();
Symbol 778 MovieClip [controlTower5] Frame 1
#initclip 101
Object.registerClass("controlTower5", building);
#endinitclip
stop();
Symbol 778 MovieClip [controlTower5] Frame 3
stop();
Symbol 781 MovieClip [controlTower6] Frame 1
#initclip 102
Object.registerClass("controlTower6", building);
#endinitclip
stop();
Symbol 781 MovieClip [controlTower6] Frame 3
stop();
Symbol 785 MovieClip [controlTower7] Frame 1
#initclip 103
Object.registerClass("controlTower7", building);
#endinitclip
stop();
Symbol 785 MovieClip [controlTower7] Frame 3
stop();
Symbol 789 MovieClip [powerPlant3] Frame 1
#initclip 104
Object.registerClass("powerPlant3", building);
#endinitclip
stop();
Symbol 789 MovieClip [powerPlant3] Frame 3
stop();
Symbol 793 MovieClip [powerPlant4] Frame 1
#initclip 105
Object.registerClass("powerPlant4", building);
#endinitclip
stop();
Symbol 793 MovieClip [powerPlant4] Frame 3
stop();
Symbol 797 MovieClip [powerPlant5] Frame 1
#initclip 106
Object.registerClass("powerPlant5", building);
#endinitclip
stop();
Symbol 797 MovieClip [powerPlant5] Frame 3
stop();
Symbol 801 MovieClip [powerPlant6] Frame 1
#initclip 107
Object.registerClass("powerPlant6", building);
#endinitclip
stop();
Symbol 801 MovieClip [powerPlant6] Frame 3
stop();
Symbol 805 MovieClip [powerPlant2] Frame 1
#initclip 108
Object.registerClass("powerPlant2", building);
#endinitclip
stop();
Symbol 805 MovieClip [powerPlant2] Frame 3
stop();
Symbol 808 MovieClip [citySection1] Frame 1
#initclip 109
Object.registerClass("citySection1", building);
#endinitclip
stop();
Symbol 808 MovieClip [citySection1] Frame 3
stop();
Symbol 812 MovieClip [citySection2] Frame 1
#initclip 110
Object.registerClass("citySection2", building);
#endinitclip
stop();
Symbol 812 MovieClip [citySection2] Frame 3
stop();
Symbol 816 MovieClip [citySection3] Frame 1
#initclip 111
Object.registerClass("citySection3", building);
#endinitclip
stop();
Symbol 816 MovieClip [citySection3] Frame 3
stop();
Symbol 819 MovieClip [citySection4] Frame 1
#initclip 112
Object.registerClass("citySection4", building);
#endinitclip
stop();
Symbol 819 MovieClip [citySection4] Frame 3
stop();
Symbol 823 MovieClip [citySection5] Frame 1
#initclip 113
Object.registerClass("citySection5", building);
#endinitclip
stop();
Symbol 823 MovieClip [citySection5] Frame 3
stop();
Symbol 826 MovieClip [citySection6] Frame 1
#initclip 114
Object.registerClass("citySection6", building);
#endinitclip
stop();
Symbol 826 MovieClip [citySection6] Frame 3
stop();
Symbol 830 MovieClip [citySection7] Frame 1
#initclip 115
Object.registerClass("citySection7", building);
#endinitclip
stop();
Symbol 830 MovieClip [citySection7] Frame 3
stop();
Symbol 833 MovieClip [citySection8] Frame 1
#initclip 116
Object.registerClass("citySection8", building);
#endinitclip
stop();
Symbol 833 MovieClip [citySection8] Frame 3
stop();
Symbol 837 MovieClip [citySection9] Frame 1
#initclip 117
Object.registerClass("citySection9", building);
#endinitclip
stop();
Symbol 837 MovieClip [citySection9] Frame 3
stop();
Symbol 841 MovieClip [citySection10] Frame 1
#initclip 118
Object.registerClass("citySection10", building);
#endinitclip
stop();
Symbol 841 MovieClip [citySection10] Frame 3
stop();
Symbol 844 MovieClip [citySection11] Frame 1
#initclip 119
Object.registerClass("citySection11", building);
#endinitclip
stop();
Symbol 844 MovieClip [citySection11] Frame 3
stop();
Symbol 847 MovieClip [citySection12] Frame 1
#initclip 120
Object.registerClass("citySection12", building);
#endinitclip
stop();
Symbol 847 MovieClip [citySection12] Frame 3
stop();
Symbol 853 MovieClip Frame 1
stop();
Symbol 859 MovieClip [gunBase] Frame 1
#initclip 121
Object.registerClass("gunBase", gunBase);
#endinitclip
Symbol 862 MovieClip [cursorTarget] Frame 1
stop();
Symbol 862 MovieClip [cursorTarget] Frame 2
stop();
Symbol 865 MovieClip [scoreBox2500] Frame 1
#initclip 122
Object.registerClass("scoreBox2500", scoreBox);
#endinitclip
Symbol 867 MovieClip [scoreBox1500] Frame 1
#initclip 123
Object.registerClass("scoreBox1500", scoreBox);
#endinitclip
Symbol 869 MovieClip [scoreBox1000] Frame 1
#initclip 124
Object.registerClass("scoreBox1000", scoreBox);
#endinitclip
Symbol 871 MovieClip [scoreBox500] Frame 1
#initclip 125
Object.registerClass("scoreBox500", scoreBox);
#endinitclip
Symbol 873 MovieClip [scoreBox100] Frame 1
#initclip 126
Object.registerClass("scoreBox100", scoreBox);
#endinitclip
Symbol 875 MovieClip [scoreBox250] Frame 1
#initclip 127
Object.registerClass("scoreBox250", scoreBox);
#endinitclip
Symbol 886 MovieClip [powerPlant1] Frame 1
#initclip 128
Object.registerClass("powerPlant1", building);
#endinitclip
stop();
Symbol 886 MovieClip [powerPlant1] Frame 3
stop();
Symbol 891 MovieClip [alienShipElite] Frame 1
#initclip 129
Object.registerClass("alienShipElite", alienShipElite);
#endinitclip
Symbol 891 MovieClip [alienShipElite] Frame 19
if (this._parent.bPaused) {
stop();
} else {
gotoAndPlay (1);
}
Symbol 893 MovieClip [alienShip] Frame 1
#initclip 130
Object.registerClass("alienShip", alienShip);
#endinitclip
Symbol 893 MovieClip [alienShip] Frame 19
if (this._parent.bPaused) {
stop();
} else {
gotoAndPlay (1);
}
Symbol 898 MovieClip [alienBomb] Frame 1
#initclip 131
Object.registerClass("alienBomb", alienBomb);
#endinitclip
Symbol 900 MovieClip [smallMask] Frame 1
#initclip 132
Object.registerClass("smallMask", buildingMask);
#endinitclip
Symbol 907 MovieClip Frame 1
stop();
Symbol 907 MovieClip Frame 2
stop();
Symbol 907 MovieClip Frame 3
stop();
Symbol 908 MovieClip [instructionScreen] Frame 1
function nextInstructionPage() {
nInstructionIndex++;
if (nInstructionIndex >= nInstructionPages) {
nInstructionIndex = 0;
}
removeInstructionPages();
this._parent["instructionPage" + nInstructionIndex]._visible = true;
updateDynamicText();
}
function updateDynamicText() {
switch (nInstructionIndex) {
case 0 :
this.instructionPage0.moveTankTxt.text = ((("Press " + getKeyCodeText(this._parent.nkey4)) + " and ") + getKeyCodeText(this._parent.nkey5)) + " to move your tanks.";
this.instructionPage0.switchTankTxt.text = ("Press " + getKeyCodeText(this._parent.nkey1)) + " to switch tanks.";
break;
case 2 :
this.instructionPage2.switchPowerUpTxt.text = ("Press " + getKeyCodeText(this._parent.nkey2)) + " to select next power-up.";
this.instructionPage2.activatePowerUpTxt.text = ("Press " + getKeyCodeText(this._parent.nkey3)) + " to activate selected power-up.";
}
}
function removeInstructionPages() {
var _local2 = 0;
while (_local2 < nInstructionPages) {
this["instructionPage" + _local2]._visible = false;
_local2++;
}
}
function resetInstructionPages() {
removeInstructionPages();
nInstructionIndex = 0;
this["instructionPage" + nInstructionIndex]._visible = true;
updateDynamicText();
}
function getKeyCodeText(nKeyCode) {
var _local1 = "";
switch (nKeyCode) {
case 48 :
_local1 = "0";
break;
case 49 :
_local1 = "1";
break;
case 50 :
_local1 = "2";
break;
case 51 :
_local1 = "3";
break;
case 52 :
_local1 = "4";
break;
case 53 :
_local1 = "5";
break;
case 54 :
_local1 = "6";
break;
case 55 :
_local1 = "7";
break;
case 56 :
_local1 = "8";
break;
case 57 :
_local1 = "9";
break;
case 65 :
_local1 = "A";
break;
case 66 :
_local1 = "B";
break;
case 67 :
_local1 = "C";
break;
case 68 :
_local1 = "D";
break;
case 69 :
_local1 = "E";
break;
case 70 :
_local1 = "F";
break;
case 71 :
_local1 = "G";
break;
case 72 :
_local1 = "H";
break;
case 73 :
_local1 = "I";
break;
case 74 :
_local1 = "J";
break;
case 75 :
_local1 = "K";
break;
case 76 :
_local1 = "L";
break;
case 77 :
_local1 = "M";
break;
case 78 :
_local1 = "N";
break;
case 79 :
_local1 = "O";
break;
case 80 :
_local1 = "P";
break;
case 81 :
_local1 = "Q";
break;
case 82 :
_local1 = "R";
break;
case 83 :
_local1 = "S";
break;
case 84 :
_local1 = "T";
break;
case 85 :
_local1 = "U";
break;
case 86 :
_local1 = "V";
break;
case 87 :
_local1 = "W";
break;
case 88 :
_local1 = "X";
break;
case 89 :
_local1 = "Y";
break;
case 90 :
_local1 = "Z";
break;
case 32 :
_local1 = "SPACE";
break;
case 37 :
_local1 = "LEFT";
break;
case 38 :
_local1 = "UP";
break;
case 39 :
_local1 = "RIGHT";
break;
case 40 :
_local1 = "DOWN";
break;
case 16 :
_local1 = "SHIFT";
break;
case 17 :
_local1 = "CTRL";
}
return(_local1);
}
var nInstructionPages = 3;
var nInstructionIndex = 0;
var i = 0;
while (i < nInstructionPages) {
this.attachMovie("instructionPage" + i, "instructionPage" + i, this.getNextHighestDepth(), {_x:Stage.width / 2, _y:(Stage.height / 2) + 15, _visible:false});
this["instructionPage" + i].onPress = nextInstructionPage;
i++;
}
this["instructionPage" + nInstructionIndex]._visible = true;
updateDynamicText();
mainMenu.onPress = function () {
this._parent._visible = false;
this._parent._parent.showGameMenu();
};
Symbol 915 MovieClip Frame 1
stop();
Symbol 915 MovieClip Frame 2
stop();
Symbol 915 MovieClip Frame 3
stop();
Symbol 919 MovieClip Frame 1
stop();
Symbol 919 MovieClip Frame 2
stop();
Symbol 919 MovieClip Frame 3
stop();
Symbol 922 MovieClip Frame 1
function easeToggleBox(targetX) {
var _local1 = (targetX - toggleBox._x) * easing;
toggleBox._x = toggleBox._x + _local1;
}
var easing = 0.3;
var targetXon = 48;
var targetXoff = 131;
var nIntervalID = null;
soundOn.onPress = function (Void) {
if (nIntervalID != null) {
clearInterval(nIntervalID);
}
nIntervalID = setInterval(easeToggleBox, 50, targetXon);
this._parent._parent._parent.bSound = true;
};
soundOff.onPress = function (Void) {
if (nIntervalID != null) {
clearInterval(nIntervalID);
}
nIntervalID = setInterval(easeToggleBox, 50, targetXoff);
this._parent._parent._parent.bSound = false;
};
Symbol 924 MovieClip Frame 1
function easeToggleBox(targetX) {
var _local1 = (targetX - toggleBox._x) * easing;
toggleBox._x = toggleBox._x + _local1;
}
var easing = 0.3;
var targetXon = 48;
var targetXoff = 131;
var nIntervalID = null;
musicOn.onPress = function (Void) {
if (nIntervalID != null) {
clearInterval(nIntervalID);
}
nIntervalID = setInterval(easeToggleBox, 50, targetXon);
this._parent._parent._parent.bMusic = true;
};
musicOff.onPress = function (Void) {
if (nIntervalID != null) {
clearInterval(nIntervalID);
}
nIntervalID = setInterval(easeToggleBox, 50, targetXoff);
this._parent._parent._parent.bMusic = false;
};
Symbol 926 MovieClip Frame 1
function easeToggleBox(targetX) {
var _local1 = (targetX - toggleBox._x) * easing;
toggleBox._x = toggleBox._x + _local1;
}
var easing = 0.3;
var targetXon = 48;
var targetXoff = 131;
var nIntervalID = null;
soundOn.onPress = function (Void) {
if (nIntervalID != null) {
clearInterval(nIntervalID);
}
nIntervalID = setInterval(easeToggleBox, 50, targetXon);
this._parent._parent._parent.bHelp = true;
};
soundOff.onPress = function (Void) {
if (nIntervalID != null) {
clearInterval(nIntervalID);
}
nIntervalID = setInterval(easeToggleBox, 50, targetXoff);
this._parent._parent._parent.bHelp = false;
};
Symbol 928 MovieClip Frame 1
function easeToggleBox(targetX) {
var _local1 = (targetX - toggleBox._x) * easing;
toggleBox._x = toggleBox._x + _local1;
}
var easing = 0.3;
var targetXon = 48;
var targetXoff = 131;
var nIntervalID = null;
soundOn.onPress = function (Void) {
if (nIntervalID != null) {
clearInterval(nIntervalID);
}
nIntervalID = setInterval(easeToggleBox, 50, targetXon);
this._parent._parent._parent.bAutoFire = true;
};
soundOff.onPress = function (Void) {
if (nIntervalID != null) {
clearInterval(nIntervalID);
}
nIntervalID = setInterval(easeToggleBox, 50, targetXoff);
this._parent._parent._parent.bAutoFire = false;
};
Symbol 932 MovieClip Frame 1
stop();
Symbol 932 MovieClip Frame 2
stop();
Symbol 932 MovieClip Frame 3
stop();
Symbol 950 MovieClip [dome1] Frame 1
#initclip 133
Object.registerClass("dome1", building);
#endinitclip
stop();
Symbol 950 MovieClip [dome1] Frame 3
stop();
Symbol 953 MovieClip [dome2] Frame 1
#initclip 134
Object.registerClass("dome2", building);
#endinitclip
stop();
Symbol 953 MovieClip [dome2] Frame 3
stop();
Symbol 956 MovieClip [dome3] Frame 1
#initclip 135
Object.registerClass("dome3", building);
#endinitclip
stop();
Symbol 956 MovieClip [dome3] Frame 3
stop();
Symbol 959 MovieClip [dome4] Frame 1
#initclip 136
Object.registerClass("dome4", building);
#endinitclip
stop();
Symbol 959 MovieClip [dome4] Frame 3
stop();
Symbol 963 MovieClip [domeSection1] Frame 1
#initclip 137
Object.registerClass("domeSection1", building);
#endinitclip
stop();
Symbol 963 MovieClip [domeSection1] Frame 3
stop();
Symbol 966 MovieClip [domeSection4] Frame 1
#initclip 138
Object.registerClass("domeSection4", building);
#endinitclip
stop();
Symbol 966 MovieClip [domeSection4] Frame 3
stop();
Symbol 970 MovieClip [domeSection5] Frame 1
#initclip 139
Object.registerClass("domeSection5", building);
#endinitclip
stop();
Symbol 970 MovieClip [domeSection5] Frame 3
stop();
Symbol 982 MovieClip [domeSection2] Frame 1
#initclip 140
Object.registerClass("domeSection2", building);
#endinitclip
stop();
Symbol 982 MovieClip [domeSection2] Frame 3
stop();
Symbol 986 MovieClip [domeSection3] Frame 1
#initclip 141
Object.registerClass("domeSection3", building);
#endinitclip
stop();
Symbol 986 MovieClip [domeSection3] Frame 3
stop();
Symbol 989 MovieClip [portTower1] Frame 1
#initclip 142
Object.registerClass("portTower1", building);
#endinitclip
stop();
Symbol 989 MovieClip [portTower1] Frame 3
stop();
Symbol 991 MovieClip [infectedPortBuilding2] Frame 1
stop();
Symbol 994 MovieClip [portTower2] Frame 1
#initclip 143
Object.registerClass("portTower2", building);
#endinitclip
stop();
Symbol 994 MovieClip [portTower2] Frame 3
stop();
Symbol 996 MovieClip [infectedPortBuilding5] Frame 1
stop();
Symbol 999 MovieClip [portTower3] Frame 1
#initclip 144
Object.registerClass("portTower3", building);
#endinitclip
stop();
Symbol 999 MovieClip [portTower3] Frame 3
stop();
Symbol 1002 MovieClip [portTower4] Frame 1
#initclip 145
Object.registerClass("portTower4", building);
#endinitclip
stop();
Symbol 1002 MovieClip [portTower4] Frame 3
stop();
Symbol 1004 MovieClip [infectedPortBuilding8] Frame 1
stop();
Symbol 1007 MovieClip [portTower5] Frame 1
#initclip 146
Object.registerClass("portTower5", building);
#endinitclip
stop();
Symbol 1007 MovieClip [portTower5] Frame 3
stop();
Symbol 1010 MovieClip [portSection1] Frame 1
#initclip 147
Object.registerClass("portSection1", building);
#endinitclip
stop();
Symbol 1010 MovieClip [portSection1] Frame 3
stop();
Symbol 1013 MovieClip [portSection2] Frame 1
#initclip 148
Object.registerClass("portSection2", building);
#endinitclip
stop();
Symbol 1013 MovieClip [portSection2] Frame 3
stop();
Symbol 1016 MovieClip [portSection3] Frame 1
#initclip 149
Object.registerClass("portSection3", building);
#endinitclip
stop();
Symbol 1016 MovieClip [portSection3] Frame 3
stop();
Symbol 1018 MovieClip [infectedPortBuilding1] Frame 1
stop();
Symbol 1021 MovieClip [portSection4] Frame 1
#initclip 150
Object.registerClass("portSection4", building);
#endinitclip
stop();
Symbol 1021 MovieClip [portSection4] Frame 3
stop();
Symbol 1024 MovieClip [portPlatform] Frame 1
#initclip 151
Object.registerClass("portPlatform", building);
#endinitclip
stop();
Symbol 1024 MovieClip [portPlatform] Frame 3
stop();
Symbol 1026 MovieClip [infectedPortBuilding4] Frame 1
stop();
Symbol 1030 MovieClip [portSection5] Frame 1
#initclip 152
Object.registerClass("portSection5", building);
#endinitclip
stop();
Symbol 1030 MovieClip [portSection5] Frame 3
stop();
Symbol 1032 MovieClip [infectedPortBuilding7] Frame 1
stop();
Symbol 1035 MovieClip [portSection6] Frame 1
#initclip 153
Object.registerClass("portSection6", building);
#endinitclip
stop();
Symbol 1035 MovieClip [portSection6] Frame 3
stop();
Symbol 1037 MovieClip [infectedPortBuilding3] Frame 1
stop();
Symbol 1040 MovieClip [portPlant1] Frame 1
#initclip 154
Object.registerClass("portPlant1", building);
#endinitclip
stop();
Symbol 1040 MovieClip [portPlant1] Frame 3
stop();
Symbol 1044 MovieClip [portPlant2] Frame 1
#initclip 155
Object.registerClass("portPlant2", building);
#endinitclip
stop();
Symbol 1044 MovieClip [portPlant2] Frame 3
stop();
Symbol 1048 MovieClip [portPlant3] Frame 1
#initclip 156
Object.registerClass("portPlant3", building);
#endinitclip
stop();
Symbol 1048 MovieClip [portPlant3] Frame 3
stop();
Symbol 1052 MovieClip [portPlant4] Frame 1
#initclip 157
Object.registerClass("portPlant4", building);
#endinitclip
stop();
Symbol 1052 MovieClip [portPlant4] Frame 3
stop();
Symbol 1054 MovieClip [infectedPortBuilding6] Frame 1
stop();
Symbol 1058 MovieClip [portPlant5] Frame 1
#initclip 158
Object.registerClass("portPlant5", building);
#endinitclip
stop();
Symbol 1058 MovieClip [portPlant5] Frame 3
stop();
Symbol 1071 MovieClip [cursorUnit] Frame 1
stop();
Symbol 1079 MovieClip [row3] Frame 1
#initclip 159
Object.registerClass("row3", keyRow);
#endinitclip
stop();
Symbol 1079 MovieClip [row3] Frame 2
stop();
Symbol 1079 MovieClip [row3] Frame 3
stop();
Symbol 1084 MovieClip [row2] Frame 1
#initclip 160
Object.registerClass("row2", keyRow);
#endinitclip
stop();
Symbol 1084 MovieClip [row2] Frame 2
stop();
Symbol 1084 MovieClip [row2] Frame 3
stop();
Symbol 1089 MovieClip [row0] Frame 1
#initclip 161
Object.registerClass("row0", keyRow);
#endinitclip
stop();
Symbol 1089 MovieClip [row0] Frame 2
stop();
Symbol 1089 MovieClip [row0] Frame 3
stop();
Symbol 1094 MovieClip [row6] Frame 1
#initclip 162
Object.registerClass("row6", keyRow);
#endinitclip
stop();
Symbol 1094 MovieClip [row6] Frame 2
stop();
Symbol 1094 MovieClip [row6] Frame 3
stop();
Symbol 1099 MovieClip [row7] Frame 1
#initclip 163
Object.registerClass("row7", keyRow);
#endinitclip
stop();
Symbol 1099 MovieClip [row7] Frame 2
stop();
Symbol 1099 MovieClip [row7] Frame 3
stop();
Symbol 1104 MovieClip [row8] Frame 1
#initclip 164
Object.registerClass("row8", keyRow);
#endinitclip
stop();
Symbol 1104 MovieClip [row8] Frame 2
stop();
Symbol 1104 MovieClip [row8] Frame 3
stop();
Symbol 1109 MovieClip [row1] Frame 1
#initclip 165
Object.registerClass("row1", keyRow);
#endinitclip
stop();
Symbol 1109 MovieClip [row1] Frame 2
stop();
Symbol 1109 MovieClip [row1] Frame 3
stop();
Symbol 1114 MovieClip [row4] Frame 1
#initclip 166
Object.registerClass("row4", keyRow);
#endinitclip
stop();
Symbol 1114 MovieClip [row4] Frame 2
stop();
Symbol 1114 MovieClip [row4] Frame 3
stop();
Symbol 1119 MovieClip [row5] Frame 1
#initclip 167
Object.registerClass("row5", keyRow);
#endinitclip
stop();
Symbol 1119 MovieClip [row5] Frame 2
stop();
Symbol 1119 MovieClip [row5] Frame 3
stop();
Symbol 1129 MovieClip [targetLock] Frame 10
stop();
Symbol 1141 MovieClip Frame 1
stop();
Symbol 1141 MovieClip Frame 2
stop();
Symbol 1141 MovieClip Frame 3
stop();
Symbol 1142 MovieClip [highScore] Frame 1
submit.onPress = function () {
var _local1 = new LoadVars();
_local1.game = "Pod";
_local1.player = "Ben";
_local1.score = 1507555 /* 0x1700E3 */;
_local1.acc = 100;
_local1.level = 12;
_local1.ip = "24.12.22.69";
_local1.send("http://www.indyflasharcade.com/sethighscore.php", "_blank", "GET");
};
Symbol 1199 MovieClip [alienProjectile] Frame 1
#initclip 168
Object.registerClass("alienProjectile", alienProjectile);
#endinitclip
Symbol 1339 MovieClip [alienBossA] Frame 1
#initclip 169
Object.registerClass("alienBossA", alienBossA);
#endinitclip
this.update();
Symbol 1339 MovieClip [alienBossA] Frame 24
gotoAndPlay (1);
Symbol 1339 MovieClip [alienBossA] Frame 47
gotoAndPlay (1);
Symbol 1339 MovieClip [alienBossA] Frame 70
gotoAndPlay (1);
Symbol 1339 MovieClip [alienBossA] Frame 93
gotoAndPlay (1);
Symbol 1339 MovieClip [alienBossA] Frame 101
this.nProjectileX = 36;
this.nProjectileY = 51;
this.nTentacle = 1;
this.bAttackReady = true;
Symbol 1339 MovieClip [alienBossA] Frame 116
gotoAndPlay (1);
Symbol 1339 MovieClip [alienBossA] Frame 139
gotoAndPlay (1);
Symbol 1339 MovieClip [alienBossA] Frame 162
gotoAndPlay (1);
Symbol 1339 MovieClip [alienBossA] Frame 170
this.nProjectileX = -48;
this.nProjectileY = 51;
this.nTentacle = 0;
this.bAttackReady = true;
Symbol 1339 MovieClip [alienBossA] Frame 185
gotoAndPlay (1);
Symbol 1339 MovieClip [alienBossA] Frame 201
gotoAndPlay (1);
Symbol 1339 MovieClip [alienBossA] Frame 203
stun._visible = false;
Symbol 1339 MovieClip [alienBossA] Frame 217
gotoAndPlay (1);
Symbol 1339 MovieClip [alienBossA] Frame 240
gotoAndPlay (1);
Symbol 1339 MovieClip [alienBossA] Frame 263
gotoAndPlay (1);
Symbol 1346 MovieClip [helpWinA] Frame 1
#initclip 170
Object.registerClass("helpWinA", helpWin);
#endinitclip
Symbol 1351 MovieClip [helpWinB] Frame 1
#initclip 171
Object.registerClass("helpWinB", helpWin);
#endinitclip
Symbol 1357 MovieClip [helpWinC] Frame 1
#initclip 172
Object.registerClass("helpWinC", helpWin);
#endinitclip
Symbol 1373 MovieClip [bossAAnimationL] Frame 1
#initclip 173
Object.registerClass("bossAAnimationL", bossAnimation);
#endinitclip
stop();
Symbol 1373 MovieClip [bossAAnimationL] Frame 54
this._parent.mcBossA.bBossDefeated = true;
this.removeAnimation();
Symbol 1380 MovieClip [bossAAnimationR] Frame 1
#initclip 174
Object.registerClass("bossAAnimationR", bossAnimation);
#endinitclip
stop();
Symbol 1380 MovieClip [bossAAnimationR] Frame 54
this._parent.mcBossA.bBossDefeated = true;
this.removeAnimation();
Symbol 1382 MovieClip [particleB] Frame 1
#initclip 175
Object.registerClass("particleB", particle);
#endinitclip
Symbol 1384 MovieClip [particleA] Frame 1
#initclip 176
Object.registerClass("particleA", particle);
#endinitclip
Symbol 1394 MovieClip Frame 16
stop();
Symbol 1419 MovieClip Frame 11
stop();
Symbol 1421 MovieClip [bossBLazerB] Frame 1
#initclip 177
Object.registerClass("bossBLazerB", bossAnimation);
#endinitclip
stop();
Symbol 1421 MovieClip [bossBLazerB] Frame 164
this._parent.animateBossBEventA();
Symbol 1421 MovieClip [bossBLazerB] Frame 173
this._parent.mcPowerLines._visible = false;
Symbol 1421 MovieClip [bossBLazerB] Frame 250
this.removeAnimation();
Symbol 1423 MovieClip Frame 25
stop();
Symbol 1424 MovieClip [bossBLazerA] Frame 1
#initclip 178
Object.registerClass("bossBLazerA", bossAnimation);
#endinitclip
stop();
Symbol 1424 MovieClip [bossBLazerA] Frame 164
this._parent.animateBossBEventA();
Symbol 1424 MovieClip [bossBLazerA] Frame 173
this._parent.mcPowerLines._visible = false;
Symbol 1424 MovieClip [bossBLazerA] Frame 250
this.removeAnimation();
Symbol 1429 MovieClip Frame 1
stop();
Symbol 1429 MovieClip Frame 2
stop();
Symbol 1429 MovieClip Frame 3
stop();
Symbol 1468 MovieClip Frame 1
stop();
Symbol 1472 MovieClip Frame 1
stop();
Symbol 1475 MovieClip Frame 1
stop();
Symbol 1476 MovieClip Frame 1
stop();
Symbol 1478 MovieClip Frame 1
stop();
Symbol 1479 MovieClip Frame 1
stop();
Symbol 1480 MovieClip Frame 1
stop();
Symbol 1480 MovieClip Frame 2
stop();
Symbol 1493 MovieClip [bossBExplosion] Frame 1
#initclip 179
Object.registerClass("bossBExplosion", animation);
#endinitclip
Symbol 1493 MovieClip [bossBExplosion] Frame 11
this.removeAnimation();
Symbol 1496 MovieClip Frame 19
if (this._parent._parent.bPaused) {
stop();
} else {
gotoAndPlay (1);
}
Symbol 1500 MovieClip [alienShipEscort] Frame 1
#initclip 180
Object.registerClass("alienShipEscort", alienShipEscort);
#endinitclip
stop();
Symbol 1500 MovieClip [alienShipEscort] Frame 40
stop();
this.bShieldBeam = true;
Symbol 1509 MovieClip [helpWinE] Frame 1
#initclip 181
Object.registerClass("helpWinE", helpWin);
#endinitclip
Symbol 1512 MovieClip [helpWinD] Frame 1
#initclip 182
Object.registerClass("helpWinD", helpWin);
#endinitclip
Symbol 1520 MovieClip [totalScreen] Frame 1
#initclip 183
Object.registerClass("totalScreen", totalScreen);
#endinitclip
stop();
Symbol 1523 MovieClip Frame 1
stop();
Symbol 1524 MovieClip [__Packages.shieldBeam] Frame 0
class shieldBeam extends MovieClip
{
var _x, _y, _visible;
function shieldBeam () {
super();
}
function removeShieldBeam() {
inPlay = false;
_x = -1000;
_y = -1000;
_visible = false;
}
var inPlay = false;
}
Symbol 1525 MovieClip [__Packages.gMessage] Frame 0
class gMessage extends MovieClip
{
var stop, _visible, _x, _y;
function gMessage () {
super();
}
function removeMessage() {
stop();
_visible = false;
_x = -1000;
_y = -1000;
}
var xPos = null;
var yPos = null;
}
Symbol 1526 MovieClip [__Packages.bossAnimation] Frame 0
class bossAnimation extends MovieClip
{
var _visible, gotoAndPlay, stop, _x, _y;
function bossAnimation () {
super();
}
function beginAnimation() {
bDone = false;
bPlaying = true;
_visible = true;
gotoAndPlay(2);
}
function removeAnimation() {
stop();
bDone = true;
_visible = false;
_x = -1000;
_y = -1000;
}
var bDone = false;
var bPlaying = false;
var bGameOver = false;
}
Symbol 1527 MovieClip [__Packages.alienBoss] Frame 0
class alienBoss extends MovieClip
{
var _visible, _rotation, _x, _y;
function alienBoss () {
super();
}
function removeBoss(Void) {
nIntA = 0;
nIntB = 0;
nIntI = 0;
nIntM = 0;
energy = maxEnergy;
angle = 0;
distance = null;
bAttackReady = false;
bRemoveBoss = false;
bBossDefeated = false;
bAnimateBoss = false;
bStunned = false;
bLocked = false;
inPlay = false;
_visible = false;
_rotation = 0;
_x = -1000;
_y = -1000;
}
function calcIntervalA(nInt) {
nIntA++;
if (nIntA > nInt) {
nIntA = 0;
return(true);
}
return(false);
}
function calcIntervalB(nInt) {
nIntB++;
if (nIntB > nInt) {
nIntB = 0;
return(true);
}
return(false);
}
function calcIntervalM(nInt) {
nIntM++;
if (nIntM > nInt) {
nIntM = 0;
return(true);
}
return(false);
}
var energy = null;
var maxEnergy = null;
var bossScore = null;
var angle = 0;
var distance = null;
var nIntA = 0;
var nIntB = 0;
var nIntI = 0;
var nIntM = 0;
var inPlay = false;
var bAttackReady = false;
var bRemoveBoss = false;
var bBossDefeated = false;
var bAnimateBoss = false;
var bStunned = false;
var bLocked = false;
var blankFilter = new Array();
}
Symbol 1528 MovieClip [__Packages.alienBossB] Frame 0
class alienBossB extends alienBoss
{
var _x, _y, angle, inPlay, calcIntervalM, bAttackReady, _width, _height;
function alienBossB () {
super();
}
function updateA() {
_x = _x - speed;
_y = orbitDist + (Math.sin(angle) * range);
angle = angle - (speed / 125);
}
function updateB() {
if (inPlay) {
if (calcIntervalM(100)) {
bAttackReady = true;
}
if (_y > maxHeight) {
_y = _y - (speed / 2);
}
}
}
function calcDistance(xPos, yPos) {
dx = xPos - _x;
dy = yPos - _y;
distance = Math.sqrt((dx * dx) + (dy * dy));
}
function calcRemoveBomb() {
xBomb = (_x - (_width / 2)) + (Math.random() * (_width - 25));
yBomb = (_y - ((_height / 2) - 15)) + (Math.random() * (_height - 25));
}
var speed = null;
var adjustAlpha = null;
var orbitDist = null;
var dx = null;
var dy = null;
var distance = null;
var range = 30;
var maxHeight = 300;
var removeInterval = 0;
var xBomb = null;
var yBomb = null;
var targetI = null;
var targetJ = null;
var targetX = null;
var targetY = null;
var x = null;
var y = null;
var z = null;
var tx = null;
var ty = null;
var tz = null;
}
Symbol 1529 MovieClip [__Packages.tank] Frame 0
class tank extends MovieClip
{
function tank () {
super();
}
function moveLeft() {
switch (nTankFlag) {
case 0 :
if (angle > -28.8) {
angle = angle - speed;
sinAngle = sinAngle + (speed * 10);
bAnimate = true;
} else {
bAnimate = false;
}
break;
case 1 :
if (angle > 7) {
angle = angle - speed;
sinAngle = sinAngle + (speed * 10);
bAnimate = true;
} else {
bAnimate = false;
}
}
}
function moveRight() {
switch (nTankFlag) {
case 0 :
if (angle < -7) {
angle = angle + speed;
sinAngle = sinAngle + (speed * 10);
bAnimate = true;
} else {
bAnimate = false;
}
break;
case 1 :
if (angle < 28.8) {
angle = angle + speed;
sinAngle = sinAngle + (speed * 10);
bAnimate = true;
} else {
bAnimate = false;
}
}
}
var speed = null;
var orbitDist = null;
var bounce = 1;
var angle = null;
var sinAngle = 0;
var origTurretPos = null;
var origJointPos = null;
var origBasePos = 0;
var nTankFlag = null;
var bMovable = true;
var bAnimate = true;
var inPlay = false;
}
Symbol 1530 MovieClip [__Packages.missile] Frame 0
class missile extends MovieClip
{
var _x, _y, _rotation, _visible, _alpha;
function missile () {
super();
}
function update(xPos, yPos, bEasing) {
calcDistance(xPos, yPos);
if (distance > 50) {
if (prevX != null) {
dx = prevX - _x;
dy = prevY - _y;
radians = Math.atan2(dy, dx);
_rotation = ((radians * 180) / Math.PI) - 90;
}
prevX = _x;
prevY = _y;
}
if (bEasing) {
easing = easing + 0.003;
vx = (xPos - _x) * easing;
_x = _x + vx;
} else {
_x = _x + vx;
}
vy = vy + thrust;
_y = _y - vy;
}
function calcDistance(xPos, yPos) {
dx = xPos - _x;
dy = yPos - _y;
distance = Math.sqrt((dx * dx) + (dy * dy));
}
function removeMissile() {
inPlay = false;
inPool = true;
bMissTarget = false;
easing = 0.02;
vx = null;
vy = 3;
prevX = null;
prevY = null;
targetI = null;
_visible = false;
_alpha = 100;
_x = -1000;
_y = -1000;
}
var easing = 0.02;
var vx = null;
var vy = 3;
var prevX = null;
var prevY = null;
var dx = null;
var dy = null;
var radians = null;
var distance = null;
var thrust = 0.2;
var targetI = null;
var missileScore = null;
var inPlay = false;
var inPool = true;
var bMissTarget = false;
}
Symbol 1531 MovieClip [__Packages.animation] Frame 0
class animation extends MovieClip
{
var stop, _visible, _x, _y;
function animation () {
super();
}
function removeAnimation() {
stop();
_visible = false;
_x = -1000;
_y = -1000;
}
}
Symbol 1532 MovieClip [__Packages.alien] Frame 0
class alien extends MovieClip
{
var filters, _alpha, _xscale, _yscale, _visible, gotoAndStop, _x, _y;
function alien () {
super();
}
function growAlien(Void) {
filters = blankFilter;
_alpha = 100;
_xscale = 100;
_yscale = 100;
speed = maxSpeed;
inPlay = true;
}
function fadeAlien(bRemove) {
_alpha = 50;
_xscale = 85;
_yscale = 85;
speed = speed * 0.5;
inPlay = false;
if (bRemove) {
bFaded = true;
speed = speed * 0.5;
}
}
function removeAlien(Void) {
filters = blankFilter;
nTarget = null;
aTarget = null;
nIntA = 0;
nIntB = 0;
speed = maxSpeed;
energy = maxEnergy;
inPlay = false;
inPool = true;
bFaded = false;
laserActive = false;
bombsActive = false;
_visible = false;
gotoAndStop("noRender");
_x = -1000;
_y = -1000;
}
function calcIntervalA(nInt) {
nIntA++;
if (nIntA > nInt) {
nIntA = 0;
return(true);
}
return(false);
}
function calcIntervalB(nInt) {
nIntB++;
if (nIntB > nInt) {
nIntB = 0;
return(true);
}
return(false);
}
function calcRotation(xPos, yPos) {
dx = xPos - _x;
dy = yPos - _y;
radians = Math.atan2(dy, dx);
}
var speed = null;
var maxSpeed = null;
var energy = null;
var maxEnergy = null;
var alienScore = null;
var alienType = null;
var nTarget = null;
var aTarget = null;
var dx = null;
var dy = null;
var radians = null;
var orbitDist = null;
var angle = null;
var lColor = null;
var lLen = null;
var lVel = null;
var lWid = null;
var nIntA = 0;
var nIntB = 0;
var bDirection = null;
var bFaded = false;
var inPlay = false;
var inPool = true;
var laserActive = false;
var bombsActive = false;
var blankFilter = new Array();
}
Symbol 1533 MovieClip [__Packages.alienMine] Frame 0
class alienMine extends alien
{
var calcRotation, _rotation, radians, bDirection, _x, speed, _y;
function alienMine () {
super();
}
function update(xPos, yPos) {
calcRotation(xPos, yPos);
_rotation = ((radians * 180) / Math.PI) - 90;
if (bDirection == 1) {
_x = _x + speed;
} else {
_x = _x - speed;
}
_y = _y - (speed / 10);
}
}
Symbol 1534 MovieClip [__Packages.alienAnimation] Frame 0
class alienAnimation extends MovieClip
{
var stop, _visible, _x, _y;
function alienAnimation () {
super();
}
function removeAnimation() {
stop();
_visible = false;
_x = -1000;
_y = -1000;
}
var alienType = null;
var alienIndex = null;
}
Symbol 1535 MovieClip [__Packages.alienBrain] Frame 0
class alienBrain extends alien
{
var calcRotation, _rotation, radians, bDirection, angle, speed, _x, orbitDist, _y, calcIntervalA, inPlay, laserActive;
function alienBrain () {
super();
}
function update(xPos, yPos) {
calcRotation(xPos, yPos);
_rotation = ((radians * 180) / Math.PI) - 90;
if (bDirection == 1) {
angle = angle + speed;
} else {
angle = angle - speed;
}
_x = xPos + (Math.cos(angle) * orbitDist);
_y = yPos + (Math.sin(angle) * orbitDist);
if (calcIntervalA(250) && (inPlay)) {
laserActive = true;
}
}
var sinAngle = null;
}
Symbol 1536 MovieClip [__Packages.alienSquid] Frame 0
class alienSquid extends alien
{
var calcRotation, _rotation, radians, dy, dx, speed, _x, _y;
function alienSquid () {
super();
}
function update() {
calcRotation(tx, ty);
_rotation = ((radians * 180) / Math.PI) - 90;
dist = Math.sqrt((dx * dx) + (dy * dy));
if (dist > minDist) {
vx = Math.cos(radians) * speed;
vy = Math.sin(radians) * speed;
_x = _x + vx;
_y = _y + vy;
} else {
bSucking = true;
}
}
var vx = null;
var vy = null;
var tx = null;
var ty = null;
var minDist = 10;
var dist = null;
var bSucking = false;
}
Symbol 1537 MovieClip [__Packages.alienSpitter] Frame 0
class alienSpitter extends alien
{
var calcRotation, _rotation, radians, bDirection, angle, speed, _x, orbitDist, _y, calcIntervalA, inPlay, laserActive;
function alienSpitter () {
super();
}
function update(xPos, yPos) {
calcRotation(xPos, yPos);
_rotation = ((radians * 180) / Math.PI) - 90;
if (bDirection == 1) {
angle = angle + speed;
} else {
angle = angle - speed;
}
_x = xPos + (Math.cos(angle) * orbitDist);
_y = yPos + (Math.sin(angle) * orbitDist);
if (calcIntervalA(150) && (inPlay)) {
laserActive = true;
}
}
var groupA = null;
var groupB = null;
}
Symbol 1538 MovieClip [__Packages.bomb] Frame 0
class bomb extends MovieClip
{
var _visible, _x, _y, _xscale, _yscale;
function bomb () {
super();
}
function removeBomb() {
playMe = true;
bDone = false;
inPool = true;
_visible = false;
_x = -1000;
_y = -1000;
}
function updateBomb() {
radius = bScale / 10;
_xscale = (_yscale = bScale);
if (bMaxTimer != null) {
bTimer = bMaxTimer;
} else {
bTimer = 0;
}
}
function incrementRadius() {
if (bDone == false) {
if (radius < (27.5 * (bScale / 100))) {
radius = radius + (nSpeed * (bScale / 100));
} else {
bDone = true;
}
}
return(bDone);
}
var nSpeed = 2;
var radius = null;
var bTimer = null;
var bMaxTimer = null;
var bScale = null;
var playMe = true;
var bDone = false;
var inPool = true;
}
Symbol 1539 MovieClip [__Packages.bombAnimation] Frame 0
class bombAnimation extends MovieClip
{
var stop, _visible, _xscale, _yscale, _x, _y;
function bombAnimation () {
super();
}
function removeBombAnimation() {
stop();
inPool = true;
_visible = false;
_xscale = (_yscale = 100);
_x = -1000;
_y = -1000;
}
var inPool = true;
}
Symbol 1540 MovieClip [__Packages.building] Frame 0
class building extends MovieClip
{
var _visible;
function building () {
super();
}
function removeBuilding() {
_visible = false;
inPlay = false;
bDamage = false;
energy = maxEnergy;
}
var energy = null;
var maxEnergy = null;
var sqEnergy = null;
var buildingType = null;
var bMask = false;
var bDamage = false;
var nBombAnimations = null;
var bBombAlignment = null;
var inPlay = true;
}
Symbol 1541 MovieClip [__Packages.gunBase] Frame 0
class gunBase extends MovieClip
{
function gunBase () {
super();
}
var inPlay = false;
var bMovable = true;
}
Symbol 1542 MovieClip [__Packages.scoreBox] Frame 0
class scoreBox extends MovieClip
{
var _visible, _x, _y, _xscale, _yscale, _alpha;
function scoreBox () {
super();
}
function removeScoreBox() {
_visible = false;
_x = -1000;
_y = -1000;
nFrames = maxFrames;
_xscale = 100;
_yscale = 100;
_alpha = 100;
}
var nFrames = 10;
var maxFrames = 10;
var growthRateX = 1;
var growthRateY = 2.5;
}
Symbol 1543 MovieClip [__Packages.alienShipElite] Frame 0
class alienShipElite extends alien
{
var bDirection, _x, speed, _y, angle, orbitDist, calcIntervalA, inPlay, bombsActive, calcIntervalB, laserActive;
function alienShipElite () {
super();
}
function update(xPos, yPos) {
if (bDirection == 1) {
_x = _x + speed;
} else {
_x = _x - speed;
}
_y = orbitDist + (Math.sin(angle) * range);
angle = angle + (speed / 50);
if (calcIntervalA(100) && (inPlay)) {
bombsActive = true;
}
if (calcIntervalB(75) && (inPlay)) {
laserActive = true;
}
}
var range = 30;
var nTarget = null;
}
Symbol 1544 MovieClip [__Packages.alienShip] Frame 0
class alienShip extends alien
{
var bDirection, _x, speed, _y, angle, orbitDist, calcIntervalA, inPlay, bombsActive;
function alienShip () {
super();
}
function update(xPos, yPos) {
if (bDirection == 1) {
_x = _x + speed;
} else {
_x = _x - speed;
}
_y = orbitDist + (Math.sin(angle) * range);
angle = angle + (speed / 50);
if (calcIntervalA(100) && (inPlay)) {
bombsActive = true;
}
}
var range = 30;
}
Symbol 1545 MovieClip [__Packages.alienBomb] Frame 0
class alienBomb extends MovieClip
{
var _y, _x, _rotation, _visible, _alpha;
function alienBomb () {
super();
}
function update(xPos, yPos) {
if (_y >= (targetY - 10)) {
applyVelocity();
calcDistance(xPos, yPos);
} else if (_y > (initialY + 150)) {
applyVelocity();
} else {
if (prevX != null) {
dx = prevX - _x;
dy = prevY - _y;
radians = Math.atan2(dy, dx);
_rotation = ((radians * 180) / Math.PI) + 90;
}
prevX = _x;
prevY = _y;
applyVelocity();
}
}
function applyVelocity() {
vx = (targetX - _x) * easing;
vy = vy + gravity;
_x = _x + vx;
_y = _y + vy;
}
function calcDistance(xPos, yPos) {
dx = xPos - _x;
dy = yPos - _y;
distance = Math.sqrt((dx * dx) + (dy * dy));
}
function removeAlienBomb() {
inPlay = false;
inPool = true;
vx = null;
vy = 0.5;
prevX = null;
prevY = null;
targetX = null;
targetY = null;
targetI = null;
_visible = false;
_alpha = 100;
_x = -1000;
_y = -1000;
}
var easing = 0.02;
var vx = null;
var vy = 0.5;
var prevX = null;
var prevY = null;
var dx = null;
var dy = null;
var radians = null;
var distance = null;
var gravity = 0.03;
var initialY = null;
var targetX = null;
var targetY = null;
var targetI = null;
var bombScore = null;
var inPlay = false;
var inPool = true;
}
Symbol 1546 MovieClip [__Packages.buildingMask] Frame 0
class buildingMask extends MovieClip
{
function buildingMask () {
super();
}
var nIndex = null;
}
Symbol 1547 MovieClip [__Packages.keyRow] Frame 0
class keyRow extends MovieClip
{
function keyRow () {
super();
}
function resetRow() {
bHighlighted = false;
}
var rowID = null;
var nKeyCode = null;
var bHighlighted = false;
}
Symbol 1548 MovieClip [__Packages.alienProjectile] Frame 0
class alienProjectile extends MovieClip
{
var _y, _x, _visible, _alpha;
function alienProjectile () {
super();
}
function update(xPos, yPos) {
if (_y >= (targetY - 10)) {
applyVelocity();
calcDistance(xPos, yPos);
} else {
applyVelocity();
}
}
function applyVelocity() {
vx = (targetX - _x) * easing;
_x = _x + vx;
_y = _y + speed;
}
function calcDistance(xPos, yPos) {
dx = xPos - _x;
dy = yPos - _y;
distance = Math.sqrt((dx * dx) + (dy * dy));
}
function removeProjectile() {
inPlay = false;
inPool = true;
vx = null;
targetX = null;
targetY = null;
targetI = null;
_visible = false;
_alpha = 100;
_x = -1000;
_y = -1000;
}
var easing = 0.1;
var speed = 8;
var vx = null;
var dx = null;
var dy = null;
var radians = null;
var distance = null;
var initialY = null;
var targetX = null;
var targetY = null;
var targetI = null;
var inPlay = false;
var inPool = true;
}
Symbol 1549 MovieClip [__Packages.alienBossA] Frame 0
class alienBossA extends alienBoss
{
var inPlay, calcIntervalM, nIntI, nIntM, gotoAndPlay, bRemoveBoss, bAnimateBoss, _x, _y, distance, _parent, bLocked, bStunned;
function alienBossA () {
super();
}
function update() {
if (inPlay) {
if (calcIntervalM(10)) {
nIntI++;
if (nIntI > 3) {
nIntI = 0;
}
}
switch (nIntI) {
case 0 :
switch (nIntM) {
case 0 :
teleportBoss();
(gotoAndPlay("teleport2"));// not popped
break;
case 2 :
(gotoAndPlay("normalMouth"));// not popped
break;
case 3 :
teleportSound();
(gotoAndPlay("teleport1"));// not popped
break;
case 4 :
teleportBoss();
(gotoAndPlay("teleport2"));// not popped
break;
case 6 :
(gotoAndPlay("normalMouth"));// not popped
break;
case 7 :
teleportSound();
(gotoAndPlay("teleport1"));// not popped
break;
case 8 :
teleportBoss();
(gotoAndPlay("teleport2"));// not popped
break;
case 10 :
teleportSound();
(gotoAndPlay("teleport1"));// not popped
break;
default :
(gotoAndPlay("normal"));// not popped
}
break;
case 1 :
case 2 :
switch (nIntM) {
case 0 :
teleportBoss();
(gotoAndPlay("teleport2"));// not popped
break;
case 2 :
(gotoAndPlay("normalMouth"));// not popped
break;
case 4 :
(gotoAndPlay("throwA0"));// not popped
break;
case 5 :
(gotoAndPlay("throwA1"));// not popped
break;
case 6 :
(gotoAndPlay("throwA2"));// not popped
break;
case 7 :
(gotoAndPlay("throwB0"));// not popped
break;
case 8 :
(gotoAndPlay("throwB1"));// not popped
break;
case 9 :
(gotoAndPlay("throwB2"));// not popped
break;
case 10 :
teleportSound();
(gotoAndPlay("teleport1"));// not popped
break;
default :
(gotoAndPlay("normal"));// not popped
}
break;
case 3 :
switch (nIntM) {
case 0 :
teleportBoss();
(gotoAndPlay("teleport2"));// not popped
break;
case 2 :
(gotoAndPlay("throwA0"));// not popped
break;
case 3 :
(gotoAndPlay("throwA1"));// not popped
break;
case 4 :
(gotoAndPlay("throwA2"));// not popped
break;
case 5 :
teleportSound();
(gotoAndPlay("teleport1"));// not popped
break;
case 6 :
teleportBoss();
(gotoAndPlay("teleport2"));// not popped
break;
case 7 :
(gotoAndPlay("throwB0"));// not popped
break;
case 8 :
(gotoAndPlay("throwB1"));// not popped
break;
case 9 :
(gotoAndPlay("throwB2"));// not popped
break;
case 10 :
teleportSound();
(gotoAndPlay("teleport1"));// not popped
break;
default :
(gotoAndPlay("normal"));// not popped
}
}
} else if (bRemoveBoss) {
bRemoveBoss = false;
vy = 0;
bAnimateBoss = true;
(gotoAndPlay("bossHit"));// not popped
} else if (bAnimateBoss) {
(gotoAndPlay("bossAnimation"));// not popped
} else {
if (calcIntervalM(2)) {
}
switch (nIntM) {
case 2 :
(gotoAndPlay("normalMouth"));// not popped
break;
default :
(gotoAndPlay("normal"));// not popped
}
}
}
function calcDistance(xPos, yPos) {
dx = xPos - _x;
dy = yPos - _y;
distance = Math.sqrt((dx * dx) + (dy * dy));
}
function calcRotation(xPos, yPos) {
dx = xPos - _x;
dy = yPos - _y;
radians = Math.atan2(dy, dx);
}
function teleportBoss() {
calcRandPoint();
if ((oRandPoint.x < 350) && (_parent.aListBuildingsL.length == 0)) {
oRandPoint.x = oRandPoint.x + 150;
} else if ((oRandPoint.x > 350) && (_parent.aListBuildingsR.length == 0)) {
oRandPoint.x = oRandPoint.x - 150;
}
bLocked = false;
_x = oRandPoint.x;
_y = oRandPoint.y;
bStunned = false;
}
function teleportSound() {
if (_parent.bSound) {
_parent.sndBossATeleport.start();
}
}
function calcRandPoint() {
oRandPoint.x = (Math.random() * (stageWidth - 400)) + 200;
oRandPoint.y = (Math.random() * (stageHeight - 450)) + 100;
}
var stageWidth = null;
var stageHeight = null;
var gravity = 0.03;
var dx = null;
var dy = null;
var tr = null;
var radians = null;
var oRandPoint = {x:0, y:0};
var nProjectileX = null;
var nProjectileY = null;
var nTentacle = null;
var vy = 0;
}
Symbol 1550 MovieClip [__Packages.helpWin] Frame 0
class helpWin extends MovieClip
{
var _visible, _x, _y;
function helpWin () {
super();
}
function removeHelpWin(bReset) {
_visible = false;
_x = -1000;
_y = -1000;
inPlay = false;
if (bReset) {
bShown = false;
}
}
var inPlay = false;
var bShown = false;
}
Symbol 1551 MovieClip [__Packages.particle] Frame 0
class particle extends MovieClip
{
var _x, _y, _alpha, _visible;
function particle () {
super();
}
function update() {
vy = vy + gravity;
_x = _x + vx;
_y = _y + vy;
}
function fadeOut() {
_alpha = _alpha - 4;
if (_alpha <= 0) {
_alpha = 0;
return(true);
}
return(false);
}
function removeParticle() {
inPlay = false;
inPool = true;
vx = null;
vy = null;
_visible = false;
_alpha = 100;
_x = -1000;
_y = -1000;
}
var vx = null;
var vy = null;
var gravity = 0.03;
var inPlay = false;
var inPool = true;
}
Symbol 1552 MovieClip [__Packages.alienShipEscort] Frame 0
class alienShipEscort extends alien
{
var _y, speed, _x, energy, maxEnergy, inPlay, inPool, _visible, gotoAndStop;
function alienShipEscort () {
super();
}
function update() {
if (bAlienFlag) {
_y = _y - speed;
_x = _x - (speed / 2);
} else {
_y = _y - speed;
_x = _x + (speed / 2);
}
if (distance > maxDist) {
bMovement = false;
bActivate = true;
}
}
function calcDistance(xPos, yPos) {
dx = xPos - _x;
dy = yPos - _y;
distance = Math.sqrt((dx * dx) + (dy * dy));
}
function removeAlienEscort(Void) {
energy = maxEnergy;
inPlay = false;
inPool = true;
_visible = false;
_x = -1000;
_y = -1000;
gotoAndStop(1);
bMovement = false;
bActivate = false;
bShieldBeam = false;
bShieldBeamActive = false;
}
var distance = null;
var maxDist = 225;
var dx = null;
var dy = null;
var bMovement = false;
var bActivate = false;
var bShieldBeam = false;
var bShieldBeamActive = false;
var bAlienFlag = false;
}
Symbol 1553 MovieClip [__Packages.totalScreen] Frame 0
class totalScreen extends MovieClip
{
function totalScreen () {
super();
}
function submitAccuracy(nAccuracy) {
aTotalAccuracy.push(nAccuracy);
}
function resetTotals() {
var _local3 = aTotalAccuracy.length;
var _local2 = 0;
while (_local2 < _local3) {
aTotalAccuracy.shift();
_local2++;
}
}
var aTotalAccuracy = new Array();
}
Symbol 1554 MovieClip [__Packages.bossBShield] Frame 0
class bossBShield extends MovieClip
{
var _visible, _x, _y;
function bossBShield () {
super();
}
function removeBossBShield() {
inPlay = false;
_visible = false;
_x = -1000;
_y = -1000;
}
var inPlay = false;
}
Symbol 1555 MovieClip [__Packages.aLaser] Frame 0
class aLaser
{
function aLaser () {
}
function reset(Void) {
var _local2 = 0;
while (_local2 < aNumLasers) {
ax1.shift();
ay1.shift();
ax2.shift();
ay2.shift();
avx.shift();
avy.shift();
aLaserHex.shift();
aLaserLen.shift();
aLaserVel.shift();
aLaserWid.shift();
_local2++;
}
aNumLasers = 0;
}
function addLaser(xPos, yPos, radians, nColor, nLen, nVel, nWid) {
aNumLasers = aNumLasers + 1;
ax1.push(xPos);
ay1.push(yPos);
avx.push(Math.cos(radians));
avy.push(Math.sin(radians));
xPos = xPos + (Math.cos(radians) * nLen);
yPos = yPos + (Math.sin(radians) * nLen);
ax2.push(xPos);
ay2.push(yPos);
aLaserHex.push(nColor);
aLaserLen.push(nLen);
aLaserVel.push(nVel);
aLaserWid.push(nWid);
}
function calcLaser(i) {
ax1[i] = ax1[i] + (avx[i] * aLaserVel[i]);
ay1[i] = ay1[i] + (avy[i] * aLaserVel[i]);
ax2[i] = ax1[i] + (avx[i] * aLaserLen[i]);
ay2[i] = ay1[i] + (avy[i] * aLaserLen[i]);
}
function spliceLaser(i) {
aNumLasers = aNumLasers - 1;
ax1.splice(i, 1);
ay1.splice(i, 1);
ax2.splice(i, 1);
ay2.splice(i, 1);
avx.splice(i, 1);
avy.splice(i, 1);
aLaserHex.splice(i, 1);
aLaserLen.splice(i, 1);
aLaserVel.splice(i, 1);
aLaserWid.splice(i, 1);
}
var aNumLasers = 0;
var ax1 = new Array();
var ay1 = new Array();
var ax2 = new Array();
var ay2 = new Array();
var avx = new Array();
var avy = new Array();
var aLaserHex = new Array();
var aLaserLen = new Array();
var aLaserVel = new Array();
var aLaserWid = new Array();
}
Symbol 1556 MovieClip [__Packages.level] Frame 0
class level
{
function level () {
}
function updateIntervals() {
if (updateIntervalM(lIntM)) {
switch (nLevel) {
case 3 :
bSwitchLocation = true;
nLocation = 1;
break;
case 4 :
bSwitchLocation = true;
nLocation = 0;
break;
case 5 :
bSwitchLocation = true;
nLocation = 1;
break;
case 6 :
bSwitchLocation = true;
nLocation = 0;
break;
case 7 :
bBossLevel = true;
nBossLocation = 0;
break;
case 14 :
bBossLevel = true;
nBossLocation = 2;
break;
default :
bSwitchLocation = false;
bNewLevel = true;
}
} else {
bGen = false;
if (updateQuadIntervalM(lIntM / 4)) {
setQuadLevel();
}
if (lIntA > 0) {
if (updateIntervalA(lIntA)) {
bGenTypeA = true;
bGen = true;
} else {
bGenTypeA = false;
}
}
if (lIntB > 0) {
if (updateIntervalB(lIntB)) {
bGenTypeB = true;
bGen = true;
} else {
bGenTypeB = false;
}
}
if (lIntC > 0) {
if (updateIntervalC(lIntC)) {
bGenTypeC = true;
bGen = true;
} else {
bGenTypeC = false;
}
}
if (lIntD > 0) {
if (updateIntervalD(lIntD)) {
bGenTypeD = true;
bGen = true;
} else {
bGenTypeD = false;
}
}
if (lIntE > 0) {
if (updateIntervalE(lIntE)) {
bGenTypeE = true;
bGen = true;
} else {
bGenTypeE = false;
}
}
if (lIntF > 0) {
if (updateIntervalF(lIntF)) {
bGenTypeF = true;
bGen = true;
} else {
bGenTypeF = false;
}
}
if (lIntG > 0) {
if (updateIntervalG(lIntG)) {
bGenTypeG = true;
bGen = true;
} else {
bGenTypeG = false;
}
}
}
}
function updateIntervalM(nInt) {
nIntM++;
if (nIntM > nInt) {
return(true);
}
return(false);
}
function updateQuadIntervalM(nInt) {
nIntQM++;
if (nIntQM > nInt) {
nIntQM = 0;
return(true);
}
return(false);
}
function updateIntervalA(nInt) {
nIntA++;
if (nIntA > nInt) {
nIntA = 0;
return(true);
}
return(false);
}
function updateIntervalB(nInt) {
nIntB++;
if (nIntB > nInt) {
nIntB = 0;
return(true);
}
return(false);
}
function updateIntervalC(nInt) {
nIntC++;
if (nIntC > nInt) {
nIntC = 0;
return(true);
}
return(false);
}
function updateIntervalD(nInt) {
nIntD++;
if (nIntD > nInt) {
nIntD = 0;
return(true);
}
return(false);
}
function updateIntervalE(nInt) {
nIntE++;
if (nIntE > nInt) {
nIntE = 0;
return(true);
}
return(false);
}
function updateIntervalF(nInt) {
nIntF++;
if (nIntF > nInt) {
nIntF = 0;
return(true);
}
return(false);
}
function updateIntervalG(nInt) {
nIntG++;
if (nIntG > nInt) {
nIntG = 0;
return(true);
}
return(false);
}
function setQuadLevel() {
nQuad++;
lIntA = aIntA[nLevel - 1][nQuad];
nGenTypeA = aGenTypeA[nLevel - 1][nQuad];
lIntB = aIntB[nLevel - 1][nQuad];
nGenTypeB = aGenTypeB[nLevel - 1][nQuad];
lIntC = aIntC[nLevel - 1][nQuad];
nGenTypeC = aGenTypeC[nLevel - 1][nQuad];
lIntD = aIntD[nLevel - 1][nQuad];
nGenTypeD = aGenTypeD[nLevel - 1][nQuad];
lIntE = aIntE[nLevel - 1][nQuad];
nGenTypeE = aGenTypeE[nLevel - 1][nQuad];
lIntF = aIntF[nLevel - 1][nQuad];
nGenTypeF = aGenTypeF[nLevel - 1][nQuad];
lIntG = aIntG[nLevel - 1][nQuad];
nGenTypeG = aGenTypeG[nLevel - 1][nQuad];
}
function setLevel(tLevel) {
bNewLevel = false;
bSwitchLocation = false;
bBossLevel = false;
bGameOver = false;
nLevel = tLevel;
nQuad = 0;
nLasersFired = 0;
nLasersHit = 0;
lIntM = aIntM[nLevel - 1];
lIntA = aIntA[nLevel - 1][nQuad];
nGenTypeA = aGenTypeA[nLevel - 1][nQuad];
lIntB = aIntB[nLevel - 1][nQuad];
nGenTypeB = aGenTypeB[nLevel - 1][nQuad];
lIntC = aIntC[nLevel - 1][nQuad];
nGenTypeC = aGenTypeC[nLevel - 1][nQuad];
lIntD = aIntD[nLevel - 1][nQuad];
nGenTypeD = aGenTypeD[nLevel - 1][nQuad];
lIntE = aIntE[nLevel - 1][nQuad];
nGenTypeE = aGenTypeE[nLevel - 1][nQuad];
lIntF = aIntF[nLevel - 1][nQuad];
nGenTypeF = aGenTypeF[nLevel - 1][nQuad];
lIntG = aIntG[nLevel - 1][nQuad];
nGenTypeG = aGenTypeG[nLevel - 1][nQuad];
nIntA = 0;
nIntB = 0;
nIntC = 0;
nIntD = 0;
nIntE = 0;
nIntF = 0;
nIntG = 0;
nIntM = 0;
nIntQM = 0;
}
function resetLevel() {
nLocation = 0;
bFaded = false;
bNewLevel = false;
bSwitchLocation = false;
bBossLevel = false;
bGameOver = false;
nLevel = null;
nQuad = 0;
nLasersFired = 0;
nLasersHit = 0;
nIntA = 0;
nIntB = 0;
nIntC = 0;
nIntD = 0;
nIntE = 0;
nIntF = 0;
nIntG = 0;
nIntM = 0;
nIntQM = 0;
lIntA = 0;
lIntB = 0;
lIntC = 0;
lIntD = 0;
lIntE = 0;
lIntF = 0;
lIntG = 0;
}
var bInit = true;
var nLevel = null;
var bGameOver = false;
var bNewLevel = false;
var bFaded = false;
var bSwitchLocation = false;
var bBossLevel = false;
var nLocation = 0;
var nBossLocation = null;
var nLasersFired = null;
var nLasersHit = null;
var bGen = false;
var bGenTypeA = false;
var nGenTypeA = null;
var bGenTypeB = false;
var nGenTypeB = null;
var bGenTypeC = false;
var nGenTypeC = null;
var bGenTypeD = false;
var nGenTypeD = null;
var bGenTypeE = false;
var nGenTypeE = null;
var bGenTypeF = false;
var nGenTypeF = null;
var bGenTypeG = false;
var nGenTypeG = null;
var nIntM = 0;
var nIntQM = 0;
var lIntM = null;
var nQuad = 0;
var nIntA = 0;
var lIntA = null;
var nIntB = 0;
var lIntB = null;
var nIntC = 0;
var lIntC = null;
var nIntD = 0;
var lIntD = null;
var nIntE = 0;
var lIntE = null;
var nIntF = 0;
var lIntF = null;
var nIntG = 0;
var lIntG = null;
var aIntM = [48, 60, 36, 84, 48, 96, 36, 4, 24, 24, 36, 48, 72, 84, 4];
var aIntA = [[2, 2, 2, 1], [2, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0], [2, 1, 2, 1], [1, 1, 1, 1], [1, 2, 2, 0], [2, 0, 2, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0]];
var aGenTypeA = [[4, 5, 5, 5], [5, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0], [4, 6, 8, 8], [8, 10, 10, 15], [5, 8, 5, 0], [4, 0, 8, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0]];
var aIntB = [[8, 8, 8, 8], [2, 4, 4, 6], [6, 8, 4, 4], [6, 8, 4, 4], [4, 8, 8, 8], [4, 8, 8, 8], [8, 8, 8, 8], [0], [8, 8, 8, 8], [4, 4, 6, 6], [4, 4, 6, 6], [8, 8, 8, 8], [4, 8, 8, 8], [4, 4, 6, 6], [0]];
var aGenTypeB = [[1, 1, 1, 1], [1, 2, 2, 1], [1, 2, 2, 1], [1, 2, 2, 1], [1, 1, 1, 2], [1, 1, 1, 2], [1, 1, 1, 1], [0], [1, 2, 1, 2], [1, 2, 1, 2], [1, 2, 1, 2], [1, 1, 1, 1], [1, 1, 1, 2], [1, 1, 1, 1], [0]];
var aIntC = [[9, 9, 9, 9], [9, 8, 8, 5], [5, 8, 8, 8], [5, 8, 8, 8], [8, 8, 9, 9], [8, 8, 9, 9], [8, 8, 5, 5], [0], [7, 7, 8, 9], [9, 9, 9, 9], [6, 8, 6, 8], [7, 7, 8, 9], [8, 8, 9, 9], [6, 4, 6, 4], [0]];
var aGenTypeC = [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 2], [1, 1, 1, 2], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [0], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 2, 2], [1, 1, 1, 1], [0]];
var aIntD = [[6, 6, 8, 10], [8, 4, 8, 8], [5, 5, 5, 3], [5, 5, 5, 3], [8, 8, 5, 5], [8, 8, 5, 5], [5, 5, 8, 8], [0], [6, 6, 8, 4], [8, 8, 8, 8], [5, 5, 5, 5], [6, 6, 8, 4], [8, 8, 5, 5], [4, 4, 5, 5], [0]];
var aGenTypeD = [[1, 1, 2, 2], [2, 1, 2, 2], [1, 2, 2, 2], [1, 2, 2, 2], [1, 2, 2, 1], [1, 2, 2, 1], [2, 1, 1, 3], [0], [1, 1, 2, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 2, 1], [1, 2, 2, 1], [1, 1, 2, 2], [0]];
var aIntE = [[0, 0, 0, 0], [0, 0, 8, 8], [8, 6, 8, 8], [8, 6, 8, 8], [4, 4, 8, 8], [8, 4, 4, 8], [8, 8, 8, 8], [0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 8, 8], [8, 8, 8, 8], [8, 8, 8, 8], [8, 8, 8, 8], [0]];
var aGenTypeE = [[0, 0, 0, 0], [0, 0, 1, 1], [1, 1, 2, 1], [1, 1, 2, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [0]];
var aIntF = [[0, 0, 0, 0], [0, 10, 8, 6], [4, 3, 4, 0], [5, 3, 4, 4], [4, 4, 4, 4], [2, 2, 2, 2], [3, 2, 3, 4], [0], [0, 0, 0, 0], [0, 0, 0, 0], [8, 8, 6, 6], [4, 3, 4, 6], [2, 2, 4, 4], [4, 4, 3, 3], [0]];
var aGenTypeF = [[0, 0, 0, 0], [0, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [0], [0, 0, 0, 0], [0, 0, 0, 0], [1, 2, 1, 2], [1, 1, 1, 1], [1, 1, 2, 2], [2, 2, 1, 1], [0]];
var aIntG = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 10, 10, 0], [0, 10, 10, 8], [0, 8, 8, 4], [8, 8, 4, 4], [8, 4, 4, 2], [0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 8, 8], [0, 10, 10, 0], [0, 8, 8, 4], [4, 6, 8, 8], [0]];
var aGenTypeG = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 1, 1, 0], [0, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 1], [0, 1, 1, 0], [0, 1, 1, 1], [1, 1, 2, 1], [0]];
}
Symbol 1557 MovieClip [__Packages.pLaser] Frame 0
class pLaser extends MovieClip
{
function pLaser (nColor, nLen, nVel) {
super();
pLaserHex = nColor;
pLaserLen = nLen;
pLaserVel = nVel;
}
function configLaser(nColor, nLen, nVel) {
pLaserHex = nColor;
pLaserLen = nLen;
pLaserVel = nVel;
}
function reset(Void) {
var _local2 = 0;
while (_local2 < pNumLasers) {
px1.shift();
py1.shift();
px2.shift();
py2.shift();
pvx.shift();
pvy.shift();
_local2++;
}
pNumLasers = 0;
}
function addLaser(oPoint, radians) {
pNumLasers = pNumLasers + 1;
px1.push(oPoint.x);
py1.push(oPoint.y);
pvx.push(Math.cos(radians));
pvy.push(Math.sin(radians));
oPoint.x = oPoint.x + (Math.cos(radians) * pLaserLen);
oPoint.y = oPoint.y + (Math.sin(radians) * pLaserLen);
px2.push(oPoint.x);
py2.push(oPoint.y);
}
function calcLaser(i) {
px1[i] = px1[i] + (pvx[i] * pLaserVel);
py1[i] = py1[i] + (pvy[i] * pLaserVel);
px2[i] = px1[i] + (pvx[i] * pLaserLen);
py2[i] = py1[i] + (pvy[i] * pLaserLen);
}
function spliceLaser(i) {
pNumLasers = pNumLasers - 1;
px1.splice(i, 1);
py1.splice(i, 1);
px2.splice(i, 1);
py2.splice(i, 1);
pvx.splice(i, 1);
pvy.splice(i, 1);
}
var pLaserHex = null;
var pLaserLen = null;
var pLaserVel = null;
var pNumLasers = 0;
var px1 = new Array();
var py1 = new Array();
var px2 = new Array();
var py2 = new Array();
var pvx = new Array();
var pvy = new Array();
}