Frame 1
_global.musicDisabled = false;
var perc = Math.round((100 / _root.getBytesTotal()) * _root.getBytesLoaded());
txtPercent.text = perc + "%";
var max = 128;
var barWidth = Math.round((max / 100) * perc);
movLoadBar._width = barWidth;
if (_root.getBytesTotal() == _root.getBytesLoaded()) {
gotoAndStop ("frameMenu");
}
Frame 2
gotoAndPlay (1);
Frame 3
_root.music = new Music();
if (_global.musicDisabled) {
checkMusic._visible = false;
checkMusicText._visible = false;
}
stop();
Instance of Symbol 259 MovieClip [FCheckBoxSymbol] "checkSound" in Frame 3
//component parameters
onClipEvent (construct) {
label = "";
initialValue = true;
labelPlacement = "right";
changeHandler = "";
}
Instance of Symbol 259 MovieClip [FCheckBoxSymbol] "checkMusic" in Frame 3
//component parameters
onClipEvent (construct) {
label = "";
initialValue = true;
labelPlacement = "right";
changeHandler = "";
}
Frame 4
_root.game.gameLoop();
Frame 5
gotoAndPlay ("frameGame");
Frame 6
_root.game.destroy();
delete game;
var percent = Math.round((_global.peopleRescued / (_global.levelNumber * 10)) * 100);
rescued_txt.text = ((((_global.peopleRescued + " / ") + (_global.levelNumber * 10)) + " (") + percent) + "%)";
var epercent = Math.round((_global.enemiesKilled / _global.totalEnemies) * 100);
enemies_txt.text = ((((_global.enemiesKilled + " / ") + _global.totalEnemies) + " (") + epercent) + "%)";
var ac = Math.round((_global.shotsHit / _global.shotsFired) * 100);
if (_global.shotsFired == 0) {
ac = 0;
}
acc_txt.text = ((((_global.shotsHit + " / ") + _global.shotsFired) + " (") + ac) + "%)";
if (_global.peopleRescued >= (_global.levelNumber * 8)) {
var sndLevelFinish = new Sound();
sndLevelFinish.attachSound("sndCompleteLevel");
if (_global.soundOn) {
sndLevelFinish.start(0, 1);
}
_global.levplayerShield = _global.playerShield;
_global.levpowerupCluster = _global.powerupCluster;
_global.levpowerupSpeed = _global.powerupSpeed;
leveldesc_txt.text = "STAGE PASSED!";
levscore_txt._visible = true;
levscore._visible = true;
levscore.text = _global.levelScore;
if (percent == 100) {
bonus1._visible = true;
bonus1_txt._visible = true;
_global.levelScore = _global.levelScore + Math.round((levelScore / 100) * 20);
bonus1.text = _global.levelScore;
} else {
bonus1._visible = false;
bonus1_txt._visible = false;
}
if (epercent == 100) {
bonus2._visible = true;
bonus2_txt._visible = true;
_global.levelScore = _global.levelScore + Math.round((levelScore / 100) * 20);
bonus2.text = _global.levelScore;
} else {
bonus2._visible = false;
bonus2_txt._visible = false;
}
if (ac >= 75) {
bonus4._visible = true;
bonus4_txt._visible = true;
_global.levelScore = _global.levelScore + Math.round((levelScore / 100) * 20);
bonus4.text = _global.levelScore;
} else {
bonus4._visible = false;
bonus4_txt._visible = false;
}
if (((ac >= 75) && (percent == 100)) && (epercent == 100)) {
perfectbonus_txt._visible = true;
_global.levelScore = _global.levelScore * 2;
perfectbonus._visible = true;
perfectbonus.text = _global.levelScore;
} else {
perfectbonus_txt._visible = false;
perfectbonus._visible = false;
}
_global.playerScore = _global.playerScore + _global.levelScore;
var count = 0;
var lifetext = "";
if (_global.playerScore >= _global.nextExtraShip) {
_global.playerShips++;
_global.nextExtraShip = _global.nextExtraShip * 2;
lifetext = ("\n\nExtra ship! Next extra ship at " + _global.nextExtraShip) + " points.";
} else {
lifetext = ("\n\nNext extra ship at " + _global.nextExtraShip) + " points.";
}
var debrieftext = "Congratulations you got your quota!\nYour ship has been repaired!\n";
if (_global.levelNumber != 20) {
debrieftext = debrieftext + ((((("In level " + (_global.levelNumber + 1)) + " you will need to rescue ") + ((_global.levelNumber + 1) * 8)) + " people.") + lifetext);
}
trace(debrieftext);
debrief_txt.text = debrieftext;
totalscore._visible = true;
totalscore_txt._visible = true;
totalscore.text = _global.playerScore;
_global.finalPeople = _global.finalPeople + _global.peopleRescued;
_global.finalEnemies = _global.finalEnemies + _global.enemiesKilled;
_global.finalShotsHit = _global.finalShotsHit + _global.shotsHit;
_global.finalShotsFired = _global.finalShotsFired + _global.shotsFired;
} else {
var sndLevelFinish = new Sound();
sndLevelFinish.attachSound("sndFailLevel");
if (_global.soundOn) {
sndLevelFinish.start(0, 1);
}
txtBonus._visible = false;
_global.playerShield = _global.levplayerShield;
_global.powerupCluster = _global.levpowerupCluster;
_global.powerupSpeed = _global.levpowerupSpeed;
leveldesc_txt.text = "STAGE FAILED";
debrief_txt.text = "Sorry you didnt get your quota...\n\nTry again!";
continue_txt.text = "PRESS ENTER TO RETRY";
levscore_txt._visible = false;
levscore._visible = false;
bonus1._visible = false;
bonus1_txt._visible = false;
bonus2._visible = false;
bonus2_txt._visible = false;
bonus3._visible = false;
bonus3_txt._visible = false;
bonus4._visible = false;
bonus4_txt._visible = false;
perfectbonus_txt._visible = false;
totalscore._visible = false;
totalscore_txt._visible = false;
}
stop();
Frame 7
_root.music.stopMusic();
_root.game.destroy();
delete game;
var sndLevelFinish = new Sound();
sndLevelFinish.attachSound("sndFailLevel");
if (_global.soundOn) {
sndLevelFinish.start(0, 1);
}
var percent = Math.round((_global.finalPeople / 2100) * 100);
people_txt.text = ((_global.finalPeople + " / 2100 (") + percent) + "%)";
var epercent = Math.round((_global.finalEnemies / 896) * 100);
enemies_txt.text = ((_global.finalEnemies + " / 896 (") + epercent) + "%)";
var ac = Math.round((_global.finalShotsHit / _global.finalShotsFired) * 100);
if (_global.finalShotsFired == 0) {
ac = 0;
}
accuracy_txt.text = ((((_global.finalShotsHit + " / ") + _global.finalShotsFired) + " (") + ac) + "%)";
if (_global.playerScore > 5000) {
message.text = "Hey! You're Good! \nYou've got a high enough score to enter the competition. \nYou can proudly say that you are a Playaholic!";
butSubmit._visible = true;
} else {
butSubmit._visible = false;
}
stop();
Frame 8
stop();
Symbol 10 Button
on (release) {
gotoAndPlay ("frameMenu");
}
Symbol 390 MovieClip [__Packages.Music] Frame 0
class Music
{
static var sndMusic1, sndMusic2, sndMusic3, sndMusic4, sndMusic5, sndMusic51, sndMusic6, sndMusic8, sndMusic9, sndMusic7, sndMusic10;
function Music () {
trace("loading music");
sndMusic1 = new Sound();
sndMusic1.attachSound("music1");
sndMusic2 = new Sound();
sndMusic2.attachSound("music2");
sndMusic3 = new Sound();
sndMusic3.attachSound("music3");
sndMusic4 = new Sound();
sndMusic4.attachSound("music4");
sndMusic5 = new Sound();
sndMusic5.attachSound("music5");
sndMusic51 = new Sound();
sndMusic51.attachSound("music51");
sndMusic6 = new Sound();
sndMusic6.attachSound("music6");
sndMusic8 = new Sound();
sndMusic8.attachSound("music8");
sndMusic9 = new Sound();
sndMusic9.attachSound("music9");
sndMusic1.onSoundComplete = function () {
Music.musicControl();
};
sndMusic2.onSoundComplete = function () {
Music.musicControl();
};
sndMusic3.onSoundComplete = function () {
Music.musicControl();
};
sndMusic4.onSoundComplete = function () {
Music.musicControl();
};
sndMusic5.onSoundComplete = function () {
Music.musicControl();
};
sndMusic6.onSoundComplete = function () {
Music.musicControl();
};
sndMusic7.onSoundComplete = function () {
Music.musicControl();
};
sndMusic8.onSoundComplete = function () {
Music.musicControl();
};
sndMusic9.onSoundComplete = function () {
Music.musicControl();
};
sndMusic10.onSoundComplete = function () {
Music.musicControl();
};
sndMusic51.onSoundComplete = function () {
Music.musicControl();
};
}
function startMusic() {
trace("hello music: " + sndMusic1);
sndMusic1.start(0, 1);
}
function stopMusic() {
trace("stopping music");
sndMusic1.stop("music1");
sndMusic2.stop("music2");
sndMusic3.stop("music3");
sndMusic4.stop("music4");
sndMusic5.stop("music5");
sndMusic6.stop("music6");
sndMusic7.stop("music7");
sndMusic8.stop("music8");
sndMusic9.stop("music9");
sndMusic10.stop("music10");
sndMusic51.stop("music51");
}
static function musicControl() {
trace("music control!");
switch (musicArrangement[musicPos]) {
case 1 :
sndMusic1.start(0, 1);
break;
case 2 :
sndMusic2.start(0, 1);
break;
case 3 :
sndMusic3.start(0, 1);
break;
case 4 :
sndMusic4.start(0, 1);
break;
case 5 :
sndMusic5.start(0, 1);
break;
case 6 :
sndMusic6.start(0, 1);
break;
case 8 :
sndMusic8.start(0, 1);
break;
case 9 :
sndMusic9.start(0, 1);
break;
case 51 :
sndMusic51.start(0, 1);
}
musicPos++;
if (musicPos >= musicArrangement.length) {
musicPos = 0;
}
}
static var musicArrangement = new Array(2, 3, 3, 4, 5, 3, 3, 3, 3, 51, 6, 6, 6, 6, 8, 9, 9);
static var musicPos = 0;
}
Symbol 391 MovieClip [__Packages.Game] Frame 0
class Game
{
var chopper, hud, level_start, sndClick, people, turrets, tanks, level, back1, back2, levelWidth, quit, ground, explode, level_exit, prisons, scenery, sndLeavingLevel, sndExplosion, sndEngine, sndPrisonAlarm, sndPersonCollect, sndPersonSquash, sndShipHit, sndShipDie, sndExplosionTank, sndExplosionBigTank, sndExplosionBuilding, sndUberBombLaunch, sndUberBombSplit, sndPowerupCluster, sndPowerupShield;
function Game () {
}
function gameLoop() {
getKeys();
if (paused) {
return(undefined);
}
frameControl();
if (levelActive) {
scrollBackground();
chopper.control();
moveCamera();
peopleControl();
enemyControl();
}
}
function frameControl() {
frames++;
fps++;
if ((getTimer() - fpsTimer) >= 1000) {
hud.fps_txt.text = fps;
if (fps < 20) {
}
fps = 0;
fpsTimer = getTimer();
}
if (frames == 24) {
seconds++;
frames = 0;
if (countdown == 1) {
level_start._visible = false;
levelActive = true;
countdown--;
if ((seconds < 4) && (_global.musicOn)) {
}
} else if (countdown > 1) {
countdown--;
seconds--;
level_start.countdown.text = countdown;
sndClick.start(0, 1);
}
}
}
function peopleControl() {
var _local2 = 0;
while (_local2 < people.length) {
people[_local2].control();
_local2++;
}
}
function enemyControl() {
var _local2 = 0;
while (_local2 < turrets.length) {
turrets[_local2].control();
_local2++;
}
_local2 = 0;
while (_local2 < tanks.length) {
tanks[_local2].control();
_local2++;
}
}
function scrollBackground() {
var _local2 = ((level._x * -1) / 1650) * 100;
var _local3 = 2.5 * _local2;
back1._x = _local3 * -1;
var _local4 = ((level._x * -1) / 1650) * 100;
back2._x = _local4 * -1;
}
function moveCamera() {
var _local4 = (level._x * -1) + 275;
var _local3 = _local4 - chopper.player._x;
level._x = levelRealX;
level._y = 0;
if (_local3 > 0) {
if (_local3 < 10) {
level._x++;
} else if ((_local3 >= 10) && (_local3 < 25)) {
level._x = level._x + 2;
} else if ((_local3 >= 25) && (_local3 < 50)) {
level._x = level._x + 3;
} else if ((_local3 >= 50) && (_local3 < 75)) {
level._x = level._x + 4;
} else if ((_local3 >= 75) && (_local3 < 100)) {
level._x = level._x + 5;
} else if ((_local3 >= 100) && (_local3 < 125)) {
level._x = level._x + 6;
} else if (_local3 >= 125) {
level._x = level._x + _global.playerSpeed;
}
}
if (_local3 < 0) {
if (_local3 > -10) {
level._x--;
} else if ((_local3 <= -10) && (_local3 > -25)) {
level._x = level._x - 2;
} else if ((_local3 <= -25) && (_local3 > -50)) {
level._x = level._x - 3;
} else if ((_local3 <= -50) && (_local3 > -75)) {
level._x = level._x - 4;
} else if ((_local3 <= -75) && (_local3 > -100)) {
level._x = level._x - 5;
} else if ((_local3 <= -100) && (_local3 > -125)) {
level._x = level._x - 6;
} else if (_local3 <= -125) {
level._x = level._x - _global.playerSpeed;
}
}
if ((level._x + (levelWidth - 550)) < 0) {
level._x = (levelWidth - 550) * -1;
}
if (level._x > 0) {
level._x = 0;
}
levelRealX = level._x;
if (shakeGround > 0) {
level._x = level._x + (Math.round(Math.random() * 6) - 3);
level._y = level._y + (Math.round(Math.random() * 6) - 3);
shakeGround--;
}
}
function getKeys() {
if (Key.isDown(38)) {
keyUpFlag = true;
} else {
keyUpFlag = false;
}
if (Key.isDown(40)) {
keyDownFlag = true;
} else {
keyDownFlag = false;
}
if (Key.isDown(37)) {
keyLeftFlag = true;
} else {
keyLeftFlag = false;
}
if (Key.isDown(39)) {
keyRightFlag = true;
} else {
keyRightFlag = false;
}
if (Key.isDown(32)) {
keySpaceFlag = true;
} else {
keySpaceFlag = false;
}
if (Key.isDown(27)) {
paused = true;
quit._visible = true;
}
if (paused && ((Key.getAscii() == 121) || (Key.getAscii() == 89))) {
paused = false;
_root.music.stopMusic();
destroy();
_root.gotoAndPlay("frameMenu");
}
if (paused && ((Key.getAscii() == 110) || (Key.getAscii() == 78))) {
paused = false;
quit._visible = false;
}
}
function buildLevel(levelNo) {
trace("1 " + _global.soundOn);
Mouse.hide();
if (_global.soundOn) {
setupSounds();
}
trace("2");
if (levelNo < 18) {
levelWidth = 500 + (levelNo * 100);
} else {
levelWidth = 2200;
}
level = _root.attachMovie("level", "_level", 2);
level._x = ((levelWidth - 550) / 2) * -1;
levelRealX = level._x;
level._y = 0;
trace("3");
var fakeLevel = levelNo;
trace((("Level " + _global.levelNumber) + ": Fake") + fakeLevel);
var backNumber1 = 2;
var backNumber2 = 2;
if (_global.levelNumber <= 5) {
backNumber1 = (backNumber2 = 2);
} else if ((_global.levelNumber > 5) && (_global.levelNumber <= 10)) {
backNumber1 = (backNumber2 = 1);
} else if ((_global.levelNumber > 10) && (_global.levelNumber <= 15)) {
backNumber1 = (backNumber2 = 3);
} else {
backNumber1 = 3;
backNumber2 = 1;
}
trace("4");
back1 = _root.attachMovie(backNumber1 + "back1", "_back1", 1);
back1._x = -125;
back1._y = 0;
back2 = _root.attachMovie(backNumber2 + "back2", "_back2", 0);
back2._x = -50;
back2._y = 0;
ground = new Array();
var i = 0;
while (i < 22) {
ground.push(level.attachMovie("ground" + backNumber1, eval ("_ground" add i), 4 + i));
ground[i]._x = i * 100;
ground[i]._y = 400 - groundHeight;
i++;
}
explode = new Array();
var i = 0;
while (i < _global.playerBombCount) {
explode.push(level.attachMovie("explosion", "_explosion", 51980 + i));
explode[i].anim._visible = false;
explode[i].anim.stop();
i++;
}
hud = _root.attachMovie("hud", "_hud", 50);
hud._x = 0;
hud._y = 0;
if (_global.playerShield == 0) {
hud.shieldPowerup._visible = false;
}
if (!_global.powerupCluster) {
hud.clusterPowerup._visible = false;
}
if (!_global.powerupSpeed) {
hud.speedPowerup._visible = false;
}
hud.shieldPowerup.stop();
hud.clusterPowerup.stop();
hud.speedPowerup.stop();
hud.score_txt.text = _global.playerScore;
hud.rescued_txt.text = "0 / " + (levelNo * 10);
hud.lives_txt.text = _global.playerShips;
hud.exit_guide._visible = false;
quit = _root.attachMovie("quit", "_quit", 100);
quit._x = 160;
quit._y = 140;
quit._visible = false;
level_exit = _root.attachMovie("levelexit", "_levelexit", 53);
level_exit._x = 0;
level_exit._y = 0;
level_exit._visible = false;
level_start = _root.attachMovie("levelstart", "_levelstart", 56);
level_start._x = 0;
level_start._y = 0;
level_start.levellabel.text = "STAGE " + _global.levelNumber;
people = new Array();
prisons = new Array();
var i = 0;
while (i < levelNo) {
prisons.push(new Scenery(this, level, "prison", 35, 30, 10, true, i, false));
i++;
}
scenery = new Array();
if (levelNo == 6) {
scenery.push(new Scenery(this, level, "dropbox", 30, 30, 0, true, levelNo + 1, true));
scenery[0].powerup = "shield";
} else if (levelNo == 8) {
scenery.push(new Scenery(this, level, "dropbox", 30, 30, 0, true, levelNo + 1, true));
scenery[0].powerup = "clusterbomb";
} else if (levelNo == 10) {
scenery.push(new Scenery(this, level, "dropbox", 30, 30, 0, true, levelNo + 1, true));
scenery[0].powerup = "speed";
} else if ((levelNo > 10) && (levelNo < 16)) {
scenery.push(new Scenery(this, level, "dropbox", 30, 30, 0, true, levelNo + 1, true));
} else if (levelNo >= 16) {
scenery.push(new Scenery(this, level, "dropbox", 30, 30, 0, true, levelNo + 1, true));
scenery.push(new Scenery(this, level, "dropbox", 30, 30, 0, true, levelNo + 1, true));
}
turrets = new Array();
var i = 0;
while (i < fakeLevel) {
turrets.push(new ETurret(this, level, 8, 8, 0, 0, "shell", "turret1", i));
i++;
}
var i = 0;
while (i < (fakeLevel - 5)) {
turrets.push(new ETurret(this, level, 1, 20, 1, 1, "rocket", "turret2", turrets.length + 1));
i++;
}
tanks = new Array();
var i = 0;
while (i < fakeLevel) {
tanks.push(new ETank(this, level, 8, 8, 0, 0, 1, "shell", "tank1", 24, 8, i));
i++;
}
var i = 0;
while (i < ((fakeLevel - 3) * 1.5)) {
tanks.push(new ETank(this, level, 8, 8, 0, 0, 3, "shell", "tank2", 35, 7, tanks.length + 5));
i++;
}
if (levelNo > 10) {
var i = 0;
while (i < (fakeLevel - 10)) {
tanks.push(new EUberTank(this, level, "tank3", i));
i++;
}
}
_global.totalEnemies = tanks.length + turrets.length;
chopper = new Chopper(this, level);
chopper.maxThrust = _global.playerSpeed;
scrollBackground();
trace("10");
}
function destroy() {
Mouse.show();
sndLeavingLevel.stop("sndLeavingLevel");
level.removeMovieClip();
back1.removeMovieClip();
back2.removeMovieClip();
hud.removeMovieClip();
quit.removeMovieClip();
level_exit.removeMovieClip();
level_start.removeMovieClip();
}
function setupSounds() {
sndExplosion = new Sound();
sndExplosion.attachSound("sndExplosion");
sndEngine = new Sound(chopper.player);
sndEngine.attachSound("sndEngine");
sndLeavingLevel = new Sound(hud);
sndLeavingLevel.attachSound("sndLeavingLevel");
sndClick = new Sound();
sndClick.attachSound("sndClick");
sndClick.start(0, 1);
sndPrisonAlarm = new Sound();
sndPrisonAlarm.attachSound("sndPrisonAlarm");
sndPersonCollect = new Sound();
sndPersonCollect.attachSound("sndPersonCollect");
sndPersonSquash = new Sound();
sndPersonSquash.attachSound("sndPersonSquash");
sndShipHit = new Sound();
sndShipHit.attachSound("sndShipHit");
sndShipDie = new Sound();
sndShipDie.attachSound("sndShipDie");
sndExplosionTank = new Sound();
sndExplosionTank.attachSound("sndExplosionTank");
sndExplosionBigTank = new Sound();
sndExplosionBigTank.attachSound("sndExplosionBigTank");
sndExplosionBuilding = new Sound();
sndExplosionBuilding.attachSound("sndExplosionBuilding");
sndUberBombLaunch = new Sound();
sndUberBombLaunch.attachSound("sndUberBombLaunch");
sndUberBombSplit = new Sound();
sndUberBombSplit.attachSound("sndUberBombSplit");
sndPowerupCluster = new Sound();
sndPowerupCluster.attachSound("powerup3bomb");
sndPowerupShield = new Sound();
sndPowerupShield.attachSound("powerupShield");
trace("hello sound");
}
var fpsTimer = getTimer();
var fps = 0;
var frames = 0;
var seconds = 0;
var countdown = 3;
var levelActive = false;
var paused = false;
var groundHeight = 25;
var shakeGround = 0;
var levelRealX = 0;
var keyUpFlag = false;
var keyDownFlag = false;
var keyLeftFlag = false;
var keyRightFlag = false;
var keySpaceFlag = false;
}
Symbol 392 MovieClip [__Packages.Chopper] Frame 0
class Chopper
{
var game, level, bombs, bombsVThrust, bombsHThrust, player, tempThrust, maxThrust, playerFakeX;
function Chopper (gam, lev) {
game = gam;
level = lev;
bombs = new Array();
bombsVThrust = new Array();
bombsHThrust = new Array();
var _local3 = 0;
while (_local3 < _global.playerBombCount) {
bombs.push(level.attachMovie("player_bomb", "p_bomb" + _local3, 8299 + _local3));
bombs[_local3]._visible = false;
bombsVThrust.push(0);
bombsHThrust.push(0);
_local3++;
}
player = level.attachMovie("chopperG", "_chopperG", 7000);
player._x = game.levelWidth / 2;
player._y = 40;
player.jet_downG1._visible = false;
player.jet_downG2._visible = false;
player.shield._visible = true;
if (_global.playerShield == 2) {
player.shield._alpha = 100;
}
if (_global.playerShield == 2) {
player.shield._alpha = 60;
}
if (_global.playerShield == 1) {
player.shield._alpha = 30;
}
if (_global.playerShield == 0) {
player.shield._visible = false;
}
if (_global.playerHealth == 1) {
player.gotoAndStop(2);
}
}
function control() {
if (_global.playerHealth <= 0) {
_global.playerHealth--;
if (_global.playerHealth < -36) {
game.level_start._visible = true;
game.levelActive = false;
game.countdown = 3;
game.level_start.countdown.text = 3;
game.frames = 0;
game.sndClick.start(0, 1);
player.gotoAndStop(1);
_global.playerHealth = 3;
player._y = 40;
player._x = (game.level._x * -1) + 275;
player._rotation = 0;
if (_global.playerShips < 0) {
_global.finalPeople = _global.finalPeople + _global.peopleRescued;
_global.finalEnemies = _global.finalEnemies + _global.enemiesKilled;
_global.finalShotsHit = _global.finalShotsHit + _global.shotsHit;
_global.finalShotsFired = _global.finalShotsFired + _global.shotsFired;
_global.playerScore = _global.playerScore + _global.levelScore;
_root.gotoAndStop("frameEndGame");
}
clearProjectiles();
var _local4 = 0;
while (_local4 < game.tanks.length) {
game.tanks[_local4].clearProjectiles();
_local4++;
}
_local4 = 0;
while (_local4 < game.turrets.length) {
game.turrets[_local4].clearProjectiles();
_local4++;
}
}
} else {
moveMe();
}
bombControl();
}
function moveMe() {
vThrust = vThrust - 1;
if (game.keyUpFlag) {
if (_global.powerupSpeed) {
vThrust = vThrust + 6;
} else {
vThrust = vThrust + 3;
}
player.jet_down1._visible = true;
player.jet_down2._visible = true;
if (_global.powerupSpeed) {
player.jet_downG1._visible = true;
player.jet_downG2._visible = true;
}
} else {
player.jet_down1._visible = false;
player.jet_down2._visible = false;
player.jet_downG1._visible = false;
player.jet_downG2._visible = false;
}
if (game.keyLeftFlag && (!onGround)) {
if (_global.powerupSpeed) {
hThrust = hThrust - 6;
}
hThrust = hThrust - 3;
}
if (game.keyRightFlag && (!onGround)) {
if (_global.powerupSpeed) {
hThrust = hThrust + 6;
}
hThrust = hThrust + 3;
}
if (((!game.keyLeftFlag) && (!game.keyRightFlag)) || (onGround)) {
if (hThrust > 0) {
hThrust--;
}
if (hThrust < 0) {
hThrust++;
}
if (onGround) {
if (hThrust > 0) {
hThrust--;
}
if (hThrust < 0) {
hThrust++;
}
}
}
tempThrust = maxThrust;
if (_global.powerupSpeed) {
tempThrust = tempThrust + 2;
}
if (vThrust > maxThrust) {
vThrust = maxThrust;
}
if (vThrust < -10) {
vThrust = -10;
}
if (hThrust > maxThrust) {
hThrust = maxThrust;
}
if (hThrust < (maxThrust * -1)) {
hThrust = maxThrust * -1;
}
if (((hThrust > 0) && (hThrust <= 3)) && (game.keyRightFlag)) {
player._rotation = 3;
} else if ((hThrust > 3) && (game.keyRightFlag)) {
player._rotation = 6;
} else if (((hThrust < 0) && (hThrust >= -3)) && (game.keyLeftFlag)) {
player._rotation = -3;
} else if ((hThrust < -3) && (game.keyLeftFlag)) {
player._rotation = -6;
} else if (((hThrust == 0) || (!game.keyLeftFlag)) || (!game.keyRightFlag)) {
player._rotation = 0;
}
player._x = player._x + hThrust;
player._y = player._y - vThrust;
if ((getPlayerY() + playerHeight) > (400 - game.groundHeight)) {
player._y = ((400 - game.groundHeight) - playerHeight) + (playerHeight / 2);
onGround = true;
var _local4 = 0;
while (_local4 < game.people.length) {
if (((firstTouch && (game.people[_local4].person._visible)) && (game.people[_local4].person._x >= game.chopper.getPlayerX())) && (game.people[_local4].person._x <= (game.chopper.getPlayerX() + game.chopper.playerWidth))) {
game.people[_local4].person._visible = false;
_global.peopleKilled++;
game.sndPersonSquash.start(0, 1);
}
_local4++;
}
firstTouch = false;
} else {
onGround = false;
firstTouch = true;
}
if (player._y <= 20) {
playerFakeX++;
if (exitDelay > 48) {
_global.levelTime = game.seconds;
_root.gotoAndPlay("frameEndLevel");
}
exitDelay++;
if (exitDelay > 12) {
if (!game.level_exit._visible) {
game.sndLeavingLevel.start(0, 2);
}
game.level_exit._visible = true;
}
if (player._y < (25 - playerFakeX)) {
player._y = 25 - playerFakeX;
}
} else {
exitDelay = 0;
playerFakeX = 0;
game.level_exit._visible = false;
game.sndLeavingLevel.stop("sndLeavingLevel");
if (player._y < 25) {
player._y = 25;
}
}
if (getPlayerX() < 0) {
player._x = 0 + (playerWidth / 2);
}
if ((getPlayerX() + playerWidth) > game.levelWidth) {
player._x = game.levelWidth - (playerWidth / 2);
}
var _local4 = 0;
while (_local4 < game.scenery.length) {
if (game.scenery[_local4].scenery._visible && (game.scenery[_local4].powerup != "none")) {
if ((((getPlayerX() >= (game.scenery[_local4].scenery._x - 5)) && ((getPlayerX() + playerWidth) <= ((game.scenery[_local4].scenery._x + game.scenery[_local4].sceneryWidth) + 5))) && (getPlayerY() >= (game.scenery[_local4].scenery._y - 5))) && ((getPlayerY() + playerWidth) <= ((game.scenery[_local4].scenery._y + game.scenery[_local4].sceneryHeight) + 5))) {
game.scenery[_local4].scenery._visible = false;
_global.levelScore = _global.levelScore + 200;
game.hud.score_txt.text = _global.playerScore + _global.levelScore;
if (game.scenery[_local4].powerup == "shield") {
game.hud.shieldPowerup._visible = true;
_global.playerShield = 3;
player.shield._visible = true;
player.shield._alpha = 100;
game.sndPowerupShield.start(0, 1);
} else if (game.scenery[_local4].powerup == "clusterbomb") {
game.hud.clusterPowerup._visible = true;
_global.powerupCluster = true;
game.sndPowerupCluster.start(0, 1);
} else if (game.scenery[_local4].powerup == "speed") {
game.hud.speedPowerup._visible = true;
_global.powerupSpeed = true;
game.sndPowerupCluster.start(0, 1);
}
}
}
_local4++;
}
}
function bombControl() {
var _local3 = 0;
while (_local3 < bombs.length) {
if (bombs[_local3]._visible == false) {
if ((game.keySpaceFlag == true) && (fireDelay <= 0)) {
if ((getPlayerY() < ((400 - game.groundHeight) - (playerHeight * 3))) && (_global.playerHealth > 0)) {
bombsHThrust[_local3] = hThrust;
bombsVThrust[_local3] = vThrust;
bombs[_local3]._x = player._x;
bombs[_local3]._y = (player._y + (playerHeight / 2)) + 2;
bombs[_local3]._visible = true;
fireDelay = 10;
_global.shotsFired++;
if (_global.powerupCluster) {
bombsHThrust[_local3 + 1] = hThrust - 2;
bombsVThrust[_local3 + 1] = vThrust;
bombs[_local3 + 1]._x = player._x;
bombs[_local3 + 1]._y = (player._y + (playerHeight / 2)) + 2;
bombs[_local3 + 1]._visible = true;
bombsHThrust[_local3 + 2] = hThrust + 2;
bombsVThrust[_local3 + 2] = vThrust;
bombs[_local3 + 2]._x = player._x;
bombs[_local3 + 2]._y = (player._y + (playerHeight / 2)) + 2;
bombs[_local3 + 2]._visible = true;
_global.shotsFired = _global.shotsFired + 2;
}
}
}
} else {
bombsVThrust[_local3] = bombsVThrust[_local3] - 2;
if (bombsVThrust[_local3] > 8) {
bombsVThrust[_local3] = 8;
}
bombs[_local3]._x = bombs[_local3]._x + bombsHThrust[_local3];
bombs[_local3]._y = bombs[_local3]._y - bombsVThrust[_local3];
var _local4 = 0;
while (_local4 < game.scenery.length) {
if (game.scenery[_local4].scenery._visible && (game.scenery[_local4].destructable)) {
if ((((bombs[_local3]._x >= (game.scenery[_local4].scenery._x - 2)) && (bombs[_local3]._x <= ((game.scenery[_local4].scenery._x + game.scenery[_local4].sceneryWidth) + 2))) && (bombs[_local3]._y >= (game.scenery[_local4].scenery._y - 2))) && (bombs[_local3]._y <= ((game.scenery[_local4].scenery._y + game.scenery[_local4].sceneryHeight) + 2))) {
game.scenery[_local4].scenery._visible = false;
game.sndExplosionBuilding.start(0, 1);
bombs[_local3]._visible = false;
game.explode[_local3]._x = bombs[_local3]._x;
game.explode[_local3]._y = bombs[_local3]._y;
game.explode[_local3].anim._visible = true;
game.explode[_local3].anim.gotoAndPlay(1);
if (game.scenery[_local4].powerup != "none") {
game.scenery.push(new Scenery(game, level, game.scenery[_local4].powerup, 20, 20, 0, false, _global.levelNo + 2, false));
game.scenery[game.scenery.length - 1].powerup = game.scenery[_local4].powerup;
game.scenery[game.scenery.length - 1].scenery._x = game.scenery[_local4].scenery._x;
}
_global.shotsHit++;
}
}
_local4++;
}
_local4 = 0;
while (_local4 < game.prisons.length) {
if (game.prisons[_local4].scenery._currentframe == 1) {
if ((((bombs[_local3]._x >= (game.prisons[_local4].scenery._x - 2)) && (bombs[_local3]._x <= ((game.prisons[_local4].scenery._x + game.prisons[_local4].sceneryWidth) + 2))) && (bombs[_local3]._y >= (game.prisons[_local4].scenery._y - 2))) && (bombs[_local3]._y <= ((game.prisons[_local4].scenery._y + game.prisons[_local4].sceneryHeight) + 2))) {
game.prisons[_local4].scenery.gotoAndStop(2);
game.sndPrisonAlarm.start(0, 1);
game.sndExplosionBuilding.start(0, 1);
bombs[_local3]._visible = false;
game.explode[_local3]._x = bombs[_local3]._x;
game.explode[_local3]._y = bombs[_local3]._y;
game.explode[_local3].anim._visible = true;
game.explode[_local3].anim.gotoAndPlay(1);
_global.shotsHit++;
var _local5 = 0;
while (_local5 < game.prisons[_local4].people) {
game.people.push(new Person(game, level, false, false, "person", (game.prisons[_local4].scenery._x + (game.prisons[_local4].sceneryWidth / 2)) + (random(30) - 15), game.people.length));
game.people[_local5].person.stop();
_local5++;
}
}
}
_local4++;
}
if (bombs[_local3]._y > (400 - game.groundHeight)) {
bombs[_local3]._visible = false;
game.sndExplosion.start(0, 1);
game.explode[_local3]._x = bombs[_local3]._x;
game.explode[_local3]._y = (400 - game.groundHeight) - 10;
game.explode[_local3].anim._visible = true;
game.explode[_local3].anim.gotoAndPlay(1);
if (bombSplash(_local3, 27)) {
_global.shotsHit++;
}
}
}
_local3++;
}
fireDelay--;
}
function bombHit(cx, cy, cwidth, cheight, splash, splashWidth) {
var _local7 = false;
var _local4 = 10;
var _local8 = false;
var _local3 = 0;
while (_local3 < bombs.length) {
if (bombs[_local3]._visible) {
if ((((bombs[_local3]._x >= (cx - _local4)) && (bombs[_local3]._x <= ((cx + _local4) + cwidth))) && (bombs[_local3]._y >= (cy - (_local4 / 2)))) && (bombs[_local3]._y <= ((cy + _local4) + cheight))) {
_local7 = true;
game.sndExplosion.start(0, 1);
bombs[_local3]._visible = false;
game.explode[_local3]._x = bombs[_local3]._x;
game.explode[_local3]._y = bombs[_local3]._y;
game.explode[_local3].anim._visible = true;
game.explode[_local3].anim.gotoAndPlay(1);
if (splash) {
_local8 = bombSplash(_local3, splashWidth);
}
}
}
_local3++;
}
if (_local7 || (_local8)) {
_global.shotsHit++;
}
return(_local7);
}
function bombSplash(z, bombSplashWidth) {
var _local5 = false;
var _local2 = 0;
while (_local2 < game.tanks.length) {
if (((game.tanks[_local2].tank._currentframe == 1) && ((game.tanks[_local2].tank._x + (game.tanks[_local2].tankWidth / 2)) > (bombs[z]._x - bombSplashWidth))) && ((game.tanks[_local2].tank._x + (game.tanks[_local2].tankWidth / 2)) < (bombs[z]._x + bombSplashWidth))) {
game.tanks[_local2].killMe();
_local5 = true;
}
_local2++;
}
_local2 = 0;
while (_local2 < game.turrets.length) {
if (((game.turrets[_local2].turret._currentframe == 1) && ((game.turrets[_local2].turret._x + (game.turrets[_local2].turretWidth / 2)) > (bombs[z]._x - bombSplashWidth))) && ((game.turrets[_local2].turret._x + (game.turrets[_local2].turretWidth / 2)) < (bombs[z]._x + bombSplashWidth))) {
game.turrets[_local2].killMe();
_local5 = true;
}
_local2++;
}
_local2 = 0;
while (_local2 < game.people.length) {
if (((game.people[_local2].person._visible == true) && (game.people[_local2].person._x > (bombs[z]._x - bombSplashWidth))) && (game.people[_local2].person._x < (bombs[z]._x + bombSplashWidth))) {
game.people[_local2].killMe();
_local5 = true;
}
_local2++;
}
return(_local5);
}
function getPlayerX() {
return(player._x - (playerWidth / 2));
}
function getPlayerY() {
return(player._y - (playerHeight / 2));
}
function clearProjectiles() {
var _local2 = 0;
while (_local2 < bombs.length) {
bombs[_local2]._visible = false;
_local2++;
}
}
function takeHp() {
if (_global.playerHealth <= 0) {
return(undefined);
}
if (_global.playerShield > 0) {
_global.playerShield--;
if (_global.playerShield == 2) {
player.shield._alpha = 60;
}
if (_global.playerShield == 1) {
player.shield._alpha = 30;
}
if (_global.playerShield == 0) {
player.shield._visible = false;
game.hud.shieldPowerup._visible = false;
}
} else {
_global.playerHealth--;
if (_global.playerHealth == 2) {
player.gotoAndStop(2);
}
if (_global.playerHealth == 1) {
player.gotoAndStop(3);
}
if (_global.playerHealth > 0) {
game.sndShipHit.start(0, 1);
}
}
if (_global.playerHealth <= 0) {
_global.playerShips--;
_global.powerupCluster = false;
game.hud.clusterPowerup._visible = false;
_global.powerupSpeed = false;
game.hud.speedPowerup._visible = false;
if (_global.playerShips >= 0) {
game.hud.lives_txt.text = _global.playerShips;
}
game.sndShipDie.start(0, 1);
player.gotoAndStop(4);
vThrust = -5;
hThrust = 0;
onGround = false;
firstTouch = true;
var _local3 = 0;
while (_local3 < game.people.length) {
game.people[_local3].person.gotoAndStop(1);
_local3++;
}
game.level_exit._visible = false;
}
}
var fireDelay = 0;
var vThrust = 0;
var hThrust = 0;
var onGround = false;
var firstTouch = true;
var exitDelay = 0;
var playerWidth = 14;
var playerHeight = 10;
}
Symbol 393 MovieClip [__Packages.Scenery] Frame 0
class Scenery
{
var game, level, scenery, people, destructable, sceneryWidth, sceneryHeight, powerup;
function Scenery (gme, lvl, image, width, height, ppl, destr, tNo, power) {
game = gme;
level = lvl;
scenery = level.attachMovie(image, "_" + image, 2000 + tNo);
people = ppl;
destructable = destr;
sceneryWidth = width;
sceneryHeight = height;
if (power) {
if (_global.powerupCluster || (_global.powerupSpeed)) {
powerup = "shield";
} else if (((_global.playerShield > 0) && (_global.powerupSpeed)) && (!_global.powerupCluster)) {
powerup = "clusterbomb";
} else if ((_global.playerShield > 0) && (_global.powerupCluster)) {
powerup = "speed";
} else {
var _local7 = Math.random();
if (_local7 < 0.3) {
powerup = "clusterbomb";
} else if (_local7 < 0.6) {
powerup = "shield";
} else {
powerup = "speed";
}
}
} else {
powerup = "none";
}
scenery._y = (400 - game.groundHeight) - sceneryHeight;
var _local4 = random(game.levelWidth - sceneryWidth);
var _local5 = true;
var _local6 = 10;
do {
_local5 = true;
var _local3 = 0;
while (_local3 < game.prisons.length) {
if (((_local4 >= game.prisons[_local3].scenery._x) && (_local4 <= (game.prisons[_local3].scenery._x + game.prisons[_local3].sceneryWidth))) || (((_local4 + sceneryWidth) >= game.prisons[_local3].scenery._x) && ((_local4 + sceneryWidth) <= (game.prisons[_local3].scenery._x + game.prisons[_local3].sceneryWidth)))) {
_local5 = false;
_local4 = random(game.levelWidth - sceneryWidth);
}
_local3++;
}
_local6--;
if (_local6 == 0) {
_local5 = true;
}
} while (!_local5);
scenery._x = _local4;
}
}
Symbol 394 MovieClip [__Packages.Person] Frame 0
class Person
{
var game, level, person, moveable, suicide, invulnerable, dir;
function Person (gme, lvl, movea, suic, image, x, tNo) {
game = gme;
level = lvl;
person = level.attachMovie(image, "_" + image, 6000 + tNo);
person._x = x;
person._y = (400 - game.groundHeight) - height;
moveable = movea;
suicide = suic;
invulnerable = 8;
}
function control() {
if (!person._visible) {
return(undefined);
}
if (invulnerable > 0) {
invulnerable--;
}
if (game.chopper.bombHit(person._x - 5, person._y, width + 10, height + 20, true)) {
return(undefined);
}
if (game.chopper.onGround) {
if (random(100) < 10) {
if (random(100) < 50) {
speed--;
} else {
speed++;
}
if (speed < 1) {
speed = 1;
}
if (speed > 3) {
speed = 3;
}
}
if (game.chopper.player._x > person._x) {
dir = 1;
person._x = person._x + speed;
} else {
dir = -1;
person._x = person._x - speed;
}
person.play();
if ((((person._x >= game.chopper.getPlayerX()) && (person._x <= (game.chopper.getPlayerX() + game.chopper.playerWidth))) && (person._y >= game.chopper.getPlayerY())) && (person._y <= (game.chopper.getPlayerY() + game.chopper.playerHeight))) {
person._visible = false;
game.sndPersonCollect.start(0, 1);
_global.peopleRescued++;
game.hud.rescued_txt.text = (_global.peopleRescued + " / ") + (_global.levelNumber * 10);
var _local3 = Math.round((100 / (_global.levelNumber * 10)) * _global.peopleRescued);
game.hud.rescuedperc_txt.text = _local3 + "%";
if (_local3 >= 80) {
game.hud.rescuedperc_txt.textColor = 65382;
game.hud.exit_guide._visible = true;
} else if ((_global.peopleKilled + _global.peopleRescued) == (_global.levelNumber * 10)) {
game.hud.exit_guide._visible = true;
game.hud.exit_guide.debrief_txt.text = "Level Failed. Exit level by holding down the UP arrow at the top of the screen.";
}
_global.levelScore = _global.levelScore + 75;
game.hud.score_txt.text = _global.playerScore + _global.levelScore;
}
} else if (moveable) {
} else {
dir = 0;
person.gotoAndStop(1);
}
}
function killMe() {
if (invulnerable != 0) {
return(undefined);
}
_global.peopleKilled++;
person._visible = false;
var _local3 = Math.round((100 / (_global.levelNumber * 10)) * _global.peopleRescued);
if (((_global.peopleKilled + _global.peopleRescued) == (_global.levelNumber * 10)) && (_local3 < 80)) {
game.hud.exit_guide._visible = true;
game.hud.exit_guide.debrief_txt.text = "Level Failed. Exit level by holding down the UP arrow at the top of the screen.";
}
}
var speed = 2;
var width = 5;
var height = 5;
}
Symbol 395 MovieClip [__Packages.ETurret] Frame 0
class ETurret
{
var game, level, projectile, turret;
function ETurret (gme, lvl, pSpeed, pMaxSpeed, pAccel, pAcurate, pImage, tImage, tNo) {
game = gme;
level = lvl;
projectile = new Projectile();
projectile.projectileSpeed = pSpeed;
projectile.projectileOSpeed = pSpeed;
projectile.maxProjectileSpeed = pMaxSpeed;
projectile.projectileAcceleration = pAccel;
projectile.projectile = level.attachMovie(pImage, "_" + pImage, 100 + tNo);
projectile.projectile._visible = false;
projectile.projectileAcuracy = pAcurate;
projectile.game = game;
projectile.level = level;
turret = level.attachMovie(tImage, "_" + tImage, 300 + tNo);
turret._y = (400 - game.groundHeight) - turretHeight;
var _local2 = random(game.levelWidth - turretWidth);
var _local4 = true;
var _local5 = 10;
do {
_local4 = true;
var _local3 = 0;
while (_local3 < game.prisons.length) {
if (((_local2 >= game.prisons[_local3].scenery._x) && (_local2 <= (game.prisons[_local3].scenery._x + game.prisons[_local3].sceneryWidth))) || (((_local2 + turretWidth) >= game.prisons[_local3].scenery._x) && ((_local2 + turretWidth) <= (game.prisons[_local3].scenery._x + game.prisons[_local3].sceneryWidth)))) {
_local4 = false;
_local2 = random(game.levelWidth - turretWidth);
}
_local3++;
}
_local3 = 0;
while (_local3 < game.turrets.length) {
if (((_local2 >= game.turrets[_local3].turret._x) && (_local2 <= (game.turrets[_local3].turret._x + game.turrets[_local3].turretWidth))) || (((_local2 + turretWidth) >= game.turrets[_local3].turret._x) && ((_local2 + turretWidth) <= (game.turrets[_local3].turret._x + game.turrets[_local3].turretWidth)))) {
_local4 = false;
_local2 = random(game.levelWidth - turretWidth);
}
_local3++;
}
_local3 = 0;
while (_local3 < game.scenery.length) {
if (((_local2 >= game.scenery[_local3].scenery._x) && (_local2 <= (game.scenery[_local3].scenery._x + game.scenery[_local3].sceneryWidth))) || (((_local2 + turretWidth) >= game.scenery[_local3].scenery._x) && ((_local2 + turretWidth) <= (game.scenery[_local3].scenery._x + game.scenery[_local3].sceneryWidth)))) {
_local4 = false;
_local2 = random(game.levelWidth - turretWidth);
}
_local3++;
}
_local5--;
if (_local5 == 0) {
_local4 = true;
}
} while (!_local4);
turret._x = _local2;
}
function control() {
if (projectile.projectile._visible == false) {
if (((turret._x > (level._x * -1)) && (turret._x < ((level._x * -1) + 550))) && (turret._currentframe == 1)) {
projectile.fireProjectile(turret._x + 5, turret._y, 0);
}
} else {
projectile.moveProjectile();
}
if (turret._currentframe != 1) {
return(undefined);
}
game.chopper.bombHit(turret._x, turret._y, turretWidth, turretHeight + 10, true, 27);
}
function killMe() {
_global.levelScore = _global.levelScore + 25;
game.hud.score_txt.text = _global.playerScore + _global.levelScore;
turret.gotoAndStop(2);
game.sndExplosionBuilding.start(0, 1);
_global.enemiesKilled++;
}
function clearProjectiles() {
projectile.projectile._visible = false;
}
var turretHeight = 20;
var turretWidth = 15;
}
Symbol 396 MovieClip [__Packages.Projectile] Frame 0
class Projectile
{
var game, projectileAcuracy, projectileXVelocity, projectileYVelocity, projectile, projectileAcceleration, projectileSpeed, maxProjectileSpeed, level, projectileOSpeed;
function Projectile () {
}
function fireProjectile(tx, ty, variance) {
if (game.countdown > 0) {
return(undefined);
}
if (projectileAcuracy == 0) {
var _local4 = (game.chopper.player._x + (random(variance) - (variance / 2))) - tx;
var _local3 = game.chopper.player._y - ty;
} else {
var _local4 = ((game.chopper.player._x + (random(variance) - (variance / 2))) + (game.chopper.hThrust * 2)) - tx;
var _local3 = (game.chopper.player._y - (game.chopper.vThrust * 2)) - ty;
}
var _local5 = Math.atan2(_local4, _local3);
if ((_local5 < -1.7) || (_local5 > 1.7)) {
var _local7 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
projectileXVelocity = _local4 / _local7;
projectileYVelocity = _local3 / _local7;
projectile._visible = true;
projectile._x = tx;
projectile._y = ty;
if (projectileAcceleration > 0) {
var _local2 = (_local5 / (Math.PI*2)) * 360;
_local2 = _local2 - 180;
if (_local2 < 180) {
_local2 = _local2 * -1;
} else {
_local2 = _local2 - 180;
}
projectile._rotation = _local2;
}
}
}
function moveProjectile() {
projectile._x = projectile._x + (projectileXVelocity * projectileSpeed);
projectile._y = projectile._y + (projectileYVelocity * projectileSpeed);
projectileSpeed = projectileSpeed + projectileAcceleration;
if (projectileSpeed > maxProjectileSpeed) {
projectileSpeed = maxProjectileSpeed;
}
if (((projectile._x < (level._x * -1)) || (projectile._x > ((level._x * -1) + 550))) || (projectile._y < 0)) {
projectile._visible = false;
projectileSpeed = projectileOSpeed;
}
if (_global.playerHealth <= 0) {
return(undefined);
}
if ((((projectile._x >= game.chopper.getPlayerX()) && (projectile._x <= (game.chopper.getPlayerX() + game.chopper.playerWidth))) && (projectile._y >= game.chopper.getPlayerY())) && (projectile._y <= (game.chopper.getPlayerY() + game.chopper.playerHeight))) {
game.chopper.takeHp();
projectile._visible = false;
}
}
}
Symbol 397 MovieClip [__Packages.ETank] Frame 0
class ETank
{
var game, level, projectiles, tank;
function ETank (gme, lvl, pSpeed, pMaxSpeed, pAccel, pAcurate, pCount, pImage, tImage, tSpeed, tLag, tNo) {
game = gme;
level = lvl;
projectiles = new Array();
var _local2 = 0;
while (_local2 < pCount) {
projectiles.push(new Projectile());
projectiles[_local2].projectileSpeed = pSpeed;
projectiles[_local2].projectileOSpeed = pSpeed;
projectiles[_local2].maxProjectileSpeed = pMaxSpeed;
projectiles[_local2].projectileAcceleration = pAccel;
projectiles[_local2].projectile = level.attachMovie(pImage, "_ta_" + pImage, (50000 + (tNo * 10)) + _local2);
projectiles[_local2].projectile._visible = false;
projectiles[_local2].projectileAcuracy = pAcurate;
projectiles[_local2].game = game;
projectiles[_local2].level = level;
_local2++;
}
tankSpeed = tSpeed;
tankAccelLag = tLag;
tank = level.attachMovie(tImage, "_" + tImage, 700 + tNo);
tank._y = (400 - game.groundHeight) - tankHeight;
tank._x = random(game.levelWidth - tankWidth);
}
function control() {
var _local3 = 0;
while (_local3 < projectiles.length) {
if (projectiles[_local3].projectile._visible == false) {
if (((tank._x > (level._x * -1)) && (tank._x < ((level._x * -1) + 550))) && (tank._currentframe == 1)) {
projectiles[_local3].fireProjectile(tank._x + (tankWidth / 2), tank._y, 50);
}
} else {
projectiles[_local3].moveProjectile();
}
_local3++;
}
if (tank._currentframe == 2) {
return(undefined);
}
if (((tank._x + tankWidth) >= (level._x * -1)) && ((tank._x - tankWidth) <= ((level._x * -1) + 550))) {
if (random(100) < 10) {
tankDir = random(3) - 1;
}
if (tankDir == -1) {
tankThrust--;
if (tankThrust < (tankSpeed * -1)) {
tankThrust = tankSpeed * -1;
}
}
if (tankDir == 1) {
tankThrust++;
if (tankThrust > tankSpeed) {
tankThrust = tankSpeed;
}
}
if (tankDir == 0) {
if (tankThrust < 0) {
tankThrust++;
}
if (tankThrust > 0) {
tankThrust--;
}
}
tank._x = tank._x + Math.round(tankThrust / tankAccelLag);
if (tank._x < 0) {
tank._x = 0;
tankThrust = 0;
}
if (tank._x > (game.levelWidth - tankWidth)) {
tank._x = game.levelWidth - tankWidth;
tankThrust = 0;
}
}
if ((((tank._x >= game.chopper.player._x) && (tank._x <= (game.chopper.player._x + game.chopper.playerWidth))) || (((tank._x + tankWidth) >= game.chopper.player._x) && ((tank._x + tankWidth) <= (game.chopper.player._x + game.chopper.playerWidth)))) && ((game.chopper.player._y + game.chopper.playerHeight) > (tank._y + 3))) {
if (_global.playerHealth > 0) {
_global.playerHealth = 1;
game.chopper.takeHp();
}
}
game.chopper.bombHit(tank._x, tank._y - 2, tankWidth, tankHeight + 10, true, 27);
}
function killMe() {
_global.levelScore = _global.levelScore + 50;
game.hud.score_txt.text = _global.playerScore + _global.levelScore;
tank.gotoAndStop(2);
game.sndExplosionTank.start(0, 1);
_global.enemiesKilled++;
}
function clearProjectiles() {
var _local2 = 0;
while (_local2 < projectiles.length) {
projectiles[_local2].projectile._visible = false;
_local2++;
}
}
var tankHeight = 15;
var tankWidth = 25;
var tankSpeed = 32;
var tankAccelLag = 7;
var tankThrust = 0;
var tankDir = 0;
}
Symbol 398 MovieClip [__Packages.EUberTank] Frame 0
class EUberTank
{
var game, level, bomb, tank;
function EUberTank (gme, lvl, tImage, tNo) {
game = gme;
level = lvl;
bomb = new UberBomb(game, level, this, tNo);
tank = level.attachMovie(tImage, "_" + tImage, 600 + tNo);
tank._y = (400 - game.groundHeight) - tankHeight;
tank._x = random(game.levelWidth - tankWidth);
}
function control() {
bomb.control();
if (tank._currentframe == 4) {
return(undefined);
}
if (((tank._x + (tankWidth * 2)) >= ((level._x * -1) - tankWidth)) && ((tank._x - (tankWidth * 2)) <= ((level._x * -1) + 550))) {
if (random(100) < 10) {
tankDir = random(3) - 1;
}
if (tankDir == -1) {
tankThrust--;
if (tankThrust < (tankSpeed * -1)) {
tankThrust = tankSpeed * -1;
}
}
if (tankDir == 1) {
tankThrust++;
if (tankThrust > tankSpeed) {
tankThrust = tankSpeed;
}
}
if (tankDir == 0) {
if (tankThrust < 0) {
tankThrust++;
}
if (tankThrust > 0) {
tankThrust--;
}
}
tank._x = tank._x + Math.round(tankThrust / tankAccelLag);
if (tank._x < 0) {
tank._x = 0;
tankThrust = 0;
}
if (tank._x > (game.levelWidth - tankWidth)) {
tank._x = game.levelWidth - tankWidth;
tankThrust = 0;
}
}
if ((((tank._x >= game.chopper.player._x) && (tank._x <= (game.chopper.player._x + game.chopper.playerWidth))) || (((tank._x + tankWidth) >= game.chopper.player._x) && ((tank._x + tankWidth) <= (game.chopper.player._x + game.chopper.playerWidth)))) && ((game.chopper.player._y + game.chopper.playerHeight) > (tank._y + 3))) {
if (_global.playerHealth > 0) {
_global.playerHealth = 1;
game.chopper.takeHp();
}
}
var _local3 = false;
if (hp == 1) {
_local3 = true;
}
if (game.chopper.bombHit(tank._x, tank._y - 3, tankWidth, tankHeight + 6, _local3, 50)) {
hp--;
if (hp == 2) {
tank.gotoAndStop(2);
}
if (hp == 1) {
tank.gotoAndStop(3);
}
if (hp == 0) {
tank.gotoAndStop(4);
_global.enemiesKilled++;
game.sndExplosionBigTank.start(0, 1);
game.shakeGround = 36;
_global.levelScore = _global.levelScore + 200;
game.hud.score_txt.text = _global.playerScore + _global.levelScore;
}
}
}
function clearProjectiles() {
bomb.clearProjectiles();
}
function killMe() {
hp--;
if (hp == 2) {
tank.gotoAndStop(2);
}
if (hp == 1) {
tank.gotoAndStop(3);
}
if (hp == 0) {
tank.gotoAndStop(4);
_global.enemiesKilled++;
game.sndExplosionBigTank.start(0, 1);
game.shakeGround = 36;
game.chopper.bombHit(tank._x, tank._y - 3, tankWidth, tankHeight + 6, true, 50);
_global.levelScore = _global.levelScore + 200;
game.hud.score_txt.text = _global.playerScore + _global.levelScore;
}
}
var tankHeight = 29;
var tankWidth = 36;
var tankSpeed = 20;
var tankAccelLag = 10;
var tankThrust = 0;
var tankDir = 0;
var hp = 3;
}
Symbol 399 MovieClip [__Packages.UberBomb] Frame 0
class UberBomb
{
var game, level, tank, bomb, projectiles, vThrust;
function UberBomb (gme, lvl, tnk, tNo) {
game = gme;
level = lvl;
tank = tnk;
bomb = level.attachMovie("uber_bomb", "_u_rocket", 1200 + tNo);
bomb._visible = false;
projectiles = new Array();
var _local2 = 0;
while (_local2 <= numProjectiles) {
projectiles.push(new UberProjectile());
projectiles[_local2].projectile = level.attachMovie("shell", "_ushell", (20000 + (tNo * 100)) + _local2);
projectiles[_local2].projectile._visible = false;
projectiles[_local2].game = game;
projectiles[_local2].level = level;
_local2++;
}
}
function control() {
if (game.countdown > 0) {
return(undefined);
}
if (exploding) {
var _local5 = false;
var _local2 = 0;
while (_local2 <= numProjectiles) {
projectiles[_local2].moveProjectile();
if (projectiles[_local2].projectile._visible) {
_local5 = true;
}
_local2++;
}
exploding = _local5;
} else if (bomb._visible) {
bomb._y = bomb._y - vThrust;
vThrust--;
if (vThrust == 0) {
game.sndUberBombSplit.start(0, 1);
exploding = true;
bomb._visible = false;
var _local2 = 0;
while (_local2 < numProjectiles) {
var _local3 = (_local2 / numProjectiles) * 100;
var _local4 = (0.06 * _local3) - 3;
projectiles[_local2].projectile._x = bomb._x;
projectiles[_local2].projectile._y = bomb._y;
projectiles[_local2].fireProjectile(_local4);
projectiles[_local2].projectile._visible = true;
_local2++;
}
}
} else if (((tank.tank._currentframe != 4) && (tank.tank._x >= (level._x * -1))) && ((tank.tank._x + tank.tankWidth) <= ((level._x * -1) + 550))) {
vThrust = 16;
game.sndUberBombLaunch.start(0, 1);
bomb._x = (tank.tank._x + (tank.tankWidth / 2)) - 4;
bomb._y = tank.tank._y;
bomb._visible = true;
}
}
function clearProjectiles() {
bomb._visible = false;
var _local2 = 0;
while (_local2 <= numProjectiles) {
projectiles[_local2].projectile._visible = false;
_local2++;
}
}
var exploding = false;
var numProjectiles = 15;
}
Symbol 400 MovieClip [__Packages.UberProjectile] Frame 0
class UberProjectile
{
var projectileXVelocity, projectileYVelocity, projectile, level, game;
function UberProjectile () {
}
function fireProjectile(angle) {
projectileXVelocity = Math.cos(angle);
projectileYVelocity = Math.sin(angle);
}
function moveProjectile() {
projectile._x = projectile._x + (projectileXVelocity * projectileSpeed);
projectile._y = projectile._y + (projectileYVelocity * projectileSpeed);
if ((((projectile._x < (level._x * -1)) || (projectile._x > ((level._x * -1) + 550))) || (projectile._y < 0)) || (projectile._y > (400 - game.groundHeight))) {
projectile._visible = false;
}
if (_global.playerHealth <= 0) {
return(undefined);
}
if ((((projectile._x >= game.chopper.getPlayerX()) && (projectile._x <= (game.chopper.getPlayerX() + game.chopper.playerWidth))) && (projectile._y >= game.chopper.getPlayerY())) && (projectile._y <= (game.chopper.getPlayerY() + game.chopper.playerHeight))) {
game.chopper.takeHp();
projectile._visible = false;
}
}
var projectileSpeed = 8;
var projectileHeight = 5;
var projectileWidth = 5;
}
Symbol 42 MovieClip [2back1] Frame 1
if (Math.random() < 0.25) {
this.gotoAndPlay(149);
} else {
this.gotoAndPlay(Math.round(Math.random() * 100));
}
Symbol 79 MovieClip Frame 63
stop();
Symbol 80 MovieClip [prison] Frame 1
stop();
Symbol 80 MovieClip [prison] Frame 2
stop();
Symbol 117 MovieClip Frame 10
stop();
Symbol 119 MovieClip [chopperG] Frame 1
stop();
Symbol 119 MovieClip [chopperG] Frame 2
stop();
Symbol 119 MovieClip [chopperG] Frame 3
stop();
Symbol 119 MovieClip [chopperG] Frame 4
stop();
Symbol 208 MovieClip Frame 16
this._visible = false;
stop();
Symbol 225 MovieClip [tank1] Frame 1
stop();
Symbol 225 MovieClip [tank1] Frame 2
stop();
Symbol 229 MovieClip [tank2] Frame 1
stop();
Symbol 229 MovieClip [tank2] Frame 2
stop();
Symbol 239 MovieClip Frame 10
stop();
Symbol 240 MovieClip Frame 21
stop();
Symbol 241 MovieClip [tank3] Frame 1
stop();
Symbol 241 MovieClip [tank3] Frame 2
stop();
Symbol 241 MovieClip [tank3] Frame 3
stop();
Symbol 241 MovieClip [tank3] Frame 4
stop();
Symbol 246 MovieClip [turret1] Frame 1
stop();
Symbol 246 MovieClip [turret1] Frame 2
stop();
Symbol 252 MovieClip [turret2] Frame 1
stop();
Symbol 252 MovieClip [turret2] Frame 2
stop();
Symbol 256 MovieClip [FBoundingBoxSymbol] Frame 1
var component = _parent;
component.registerSkinElement(boundingBox, "background");
stop();
Symbol 256 MovieClip [FBoundingBoxSymbol] Frame 2
component.registerSkinElement(boundingBox2, "backgroundDisabled");
stop();
Symbol 259 MovieClip [FCheckBoxSymbol] Frame 1
#initclip 14
function FCheckBoxClass() {
this.init();
}
FCheckBoxClass.prototype = new FUIComponentClass();
Object.registerClass("FCheckBoxSymbol", FCheckBoxClass);
FCheckBoxClass.prototype.init = function () {
super.setSize(this._width, this._height);
this.boundingBox_mc.unloadMovie();
this.attachMovie("fcb_hitArea", "fcb_hitArea_mc", 1);
this.attachMovie("fcb_states", "fcb_states_mc", 2);
this.attachMovie("FLabelSymbol", "fLabel_mc", 3);
super.init();
this.setChangeHandler(this.changeHandler);
this._xscale = 100;
this._yscale = 100;
this.setSize(this.width, this.height);
if (this.initialValue == undefined) {
this.setCheckState(false);
} else {
this.setCheckState(this.initialValue);
}
if (this.label != undefined) {
this.setLabel(this.label);
}
this.ROLE_SYSTEM_CHECKBUTTON = 44;
this.STATE_SYSTEM_CHECKED = 16;
this.EVENT_OBJECT_STATECHANGE = 32778;
this.EVENT_OBJECT_NAMECHANGE = 32780;
this._accImpl.master = this;
this._accImpl.stub = false;
this._accImpl.get_accRole = this.get_accRole;
this._accImpl.get_accName = this.get_accName;
this._accImpl.get_accState = this.get_accState;
this._accImpl.get_accDefaultAction = this.get_accDefaultAction;
this._accImpl.accDoDefaultAction = this.accDoDefaultAction;
};
FCheckBoxClass.prototype.setLabelPlacement = function (pos) {
this.setLabel(this.getLabel());
this.txtFormat(pos);
var _local7 = this.fLabel_mc._height / 2;
var _local8 = this.fcb_states_mc._height / 2;
var _local5 = _local8 - _local7;
var _local6 = this.fcb_states_mc._width;
var _local4 = this.fcb_states_mc;
var _local9 = this.fLabel_mc;
var _local2 = 0;
if (_local4._width > this.width) {
_local2 = 0;
} else {
_local2 = this.width - _local4._width;
}
this.fLabel_mc.setSize(_local2);
if ((pos == "right") || (pos == undefined)) {
this.labelPlacement = "right";
this.fcb_states_mc._x = 0;
this.fLabel_mc._x = _local6;
this.txtFormat("left");
} else if (pos == "left") {
this.labelPlacement = "left";
this.fLabel_mc._x = 0;
this.fcb_states_mc._x = this.width - _local6;
this.txtFormat("right");
}
this.fLabel_mc._y = _local5;
this.fcb_hitArea_mc._y = _local5;
};
FCheckBoxClass.prototype.txtFormat = function (pos) {
var _local3 = this.textStyle;
var _local4 = this.styleTable;
_local3.align = ((_local4.textAlign.value == undefined) ? ((_local3.align = pos)) : undefined);
_local3.leftMargin = ((_local4.textLeftMargin.value == undefined) ? ((_local3.leftMargin = 0)) : undefined);
_local3.rightMargin = ((_local4.textRightMargin.value == undefined) ? ((_local3.rightMargin = 0)) : undefined);
if (this.flabel_mc._height > this.height) {
super.setSize(this.width, this.flabel_mc._height);
} else {
super.setSize(this.width, this.height);
}
this.fLabel_mc.labelField.setTextFormat(this.textStyle);
this.setEnabled(this.enable);
};
FCheckBoxClass.prototype.setHitArea = function (w, h) {
var _local3 = this.fcb_hitArea_mc;
this.hitArea = _local3;
if (this.fcb_states_mc._width > w) {
_local3._width = this.fcb_states_mc._width;
} else {
_local3._width = w;
}
_local3._visible = false;
if (arguments.length > 1) {
_local3._height = h;
}
};
FCheckBoxClass.prototype.setSize = function (w) {
this.setLabel(this.getLabel());
this.setLabelPlacement(this.labelPlacement);
if (this.fcb_states_mc._height < this.flabel_mc.labelField._height) {
super.setSize(w, this.flabel_mc.labelField._height);
}
this.setHitArea(this.width, this.height);
this.setLabelPlacement(this.labelPlacement);
};
FCheckBoxClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this._width + 6, this._height - 1);
};
FCheckBoxClass.prototype.onPress = function () {
this.pressFocus();
_root.focusRect.removeMovieClip();
var _local3 = this.fcb_states_mc;
if (this.getValue()) {
_local3.gotoAndStop("checkedPress");
} else {
_local3.gotoAndStop("press");
}
};
FCheckBoxClass.prototype.onRelease = function () {
this.fcb_states_mc.gotoAndStop("up");
this.setValue(!this.checked);
};
FCheckBoxClass.prototype.onReleaseOutside = function () {
var _local2 = this.fcb_states_mc;
if (this.getValue()) {
_local2.gotoAndStop("checkedEnabled");
} else {
_local2.gotoAndStop("up");
}
};
FCheckBoxClass.prototype.onDragOut = function () {
var _local2 = this.fcb_states_mc;
if (this.getValue()) {
_local2.gotoAndStop("checkedEnabled");
} else {
_local2.gotoAndStop("up");
}
};
FCheckBoxClass.prototype.onDragOver = function () {
var _local2 = this.fcb_states_mc;
if (this.getValue()) {
_local2.gotoAndStop("checkedPress");
} else {
_local2.gotoAndStop("press");
}
};
FCheckBoxClass.prototype.setValue = function (checkedValue) {
if (checkedValue || (checkedValue == undefined)) {
this.setCheckState(checkedValue);
} else if (checkedValue == false) {
this.setCheckState(checkedValue);
}
this.executeCallBack();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_STATECHANGE, true);
}
};
FCheckBoxClass.prototype.setCheckState = function (checkedValue) {
var _local2 = this.fcb_states_mc;
if (this.enable) {
this.flabel_mc.setEnabled(true);
if (checkedValue || (checkedValue == undefined)) {
_local2.gotoAndStop("checkedEnabled");
this.enabled = true;
this.checked = true;
} else {
_local2.gotoAndStop("up");
this.enabled = true;
this.checked = false;
}
} else {
this.flabel_mc.setEnabled(false);
if (checkedValue || (checkedValue == undefined)) {
_local2.gotoAndStop("checkedDisabled");
this.enabled = false;
this.checked = true;
} else {
_local2.gotoAndStop("uncheckedDisabled");
this.enabled = false;
this.checked = false;
this.focusRect.removeMovieClip();
}
}
};
FCheckBoxClass.prototype.getValue = function () {
return(this.checked);
};
FCheckBoxClass.prototype.setEnabled = function (enable) {
if ((enable == true) || (enable == undefined)) {
this.enable = true;
Super.setEnabled(true);
} else {
this.enable = false;
Super.setEnabled(false);
}
this.setCheckState(this.checked);
};
FCheckBoxClass.prototype.getEnabled = function () {
return(this.enable);
};
FCheckBoxClass.prototype.setLabel = function (label) {
this.fLabel_mc.setLabel(label);
this.txtFormat();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_NAMECHANGE);
}
};
FCheckBoxClass.prototype.getLabel = function () {
return(this.fLabel_mc.labelField.text);
};
FCheckBoxClass.prototype.setTextColor = function (color) {
this.fLabel_mc.labelField.textColor = color;
};
FCheckBoxClass.prototype.myOnKeyDown = function () {
if (((Key.getCode() == 32) && (this.pressOnce == undefined)) && (this.enabled == true)) {
this.setValue(!this.getValue());
this.pressOnce = true;
}
};
FCheckBoxClass.prototype.myOnKeyUp = function () {
if (Key.getCode() == 32) {
this.pressOnce = undefined;
}
};
FCheckBoxClass.prototype.get_accRole = function (childId) {
return(this.master.ROLE_SYSTEM_CHECKBUTTON);
};
FCheckBoxClass.prototype.get_accName = function (childId) {
return(this.master.getLabel());
};
FCheckBoxClass.prototype.get_accState = function (childId) {
if (this.master.getValue()) {
return(this.master.STATE_SYSTEM_CHECKED);
}
return(0);
};
FCheckBoxClass.prototype.get_accDefaultAction = function (childId) {
if (this.master.getValue()) {
return("UnCheck");
}
return("Check");
};
FCheckBoxClass.prototype.accDoDefaultAction = function (childId) {
this.master.setValue(!this.master.getValue());
};
#endinitclip
boundingBox_mc._visible = false;
deadPreview._visible = false;
Symbol 260 MovieClip [FUIComponentSymbol] Frame 1
#initclip 12
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
this.enable = true;
this.focused = false;
this.useHandCursor = false;
this._accImpl = new Object();
this._accImpl.stub = true;
this.styleTable = new Array();
if (_global.globalStyleFormat == undefined) {
_global.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_global._focusControl = new Object();
_global._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_global._focusControl);
}
if (this._name != undefined) {
this._focusrect = false;
this.tabEnabled = true;
this.focusEnabled = true;
this.tabChildren = false;
this.tabFocused = true;
if (this.hostStyle == undefined) {
globalStyleFormat.addListener(this);
} else {
this.styleTable = this.hostStyle;
}
this.deadPreview._visible = false;
this.deadPreview._width = (this.deadPreview._height = 1);
this.methodTable = new Object();
this.keyListener = new Object();
this.keyListener.controller = this;
this.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
this.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var _local3 in this.styleFormat_prm) {
this.setStyleProperty(_local3, this.styleFormat_prm[_local3]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
this.enable = ((arguments.length > 0) ? (enabledFlag) : true);
this.tabEnabled = (this.focusEnabled = enabledFlag);
if ((!this.enable) && (this.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
this.width = w;
this.height = h;
this.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
this.handlerObj = ((obj == undefined) ? (this._parent) : (obj));
this.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
this.methodTable[methodName] = true;
this.onEnterFrame = this.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
if (this.methodTable.setSize) {
this.setSize(this.width, this.height);
} else {
this.cleanUINotSize();
}
this.methodTable = new Object();
delete this.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
for (var _local2 in this.methodTable) {
this[_local2]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var _local4 = this.styleTable.focusRectInner.value;
var _local5 = this.styleTable.focusRectOuter.value;
if (_local4 == undefined) {
_local4 = 16777215 /* 0xFFFFFF */;
}
if (_local5 == undefined) {
_local5 = 0;
}
this.createEmptyMovieClip("focusRect", 1000);
this.focusRect.controller = this;
this.focusRect.lineStyle(1, _local5);
this.focusRect.moveTo(x, y);
this.focusRect.lineTo(x + w, y);
this.focusRect.lineTo(x + w, y + h);
this.focusRect.lineTo(x, y + h);
this.focusRect.lineTo(x, y);
this.focusRect.lineStyle(1, _local4);
this.focusRect.moveTo(x + 1, y + 1);
this.focusRect.lineTo((x + w) - 1, y + 1);
this.focusRect.lineTo((x + w) - 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, y + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
this.tabFocused = false;
this.focusRect.removeMovieClip();
Selection.setFocus(this);
};
FUIComponentClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
this.focused = true;
Key.addListener(this.keyListener);
if (this.tabFocused) {
this.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
this.tabFocused = true;
this.focused = false;
this.focusRect.removeMovieClip();
Key.removeListener(this.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
if (value == "") {
return(undefined);
}
var _local17 = parseInt(value);
if (!isNaN(_local17)) {
value = _local17;
}
var _local16 = ((arguments.length > 2) ? (isGlobal) : false);
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].useGlobal || (!_local16)) {
this.styleTable[propName].value = value;
if (this.setCustomStyleProperty(propName, value)) {
} else if (propName == "embedFonts") {
this.invalidate("setSize");
} else if (propName.subString(0, 4) == "text") {
if (this.textStyle == undefined) {
this.textStyle = new TextFormat();
}
var _local18 = propName.subString(4, propName.length);
this.textStyle[_local18] = value;
this.invalidate("setSize");
} else {
for (var _local15 in this.styleTable[propName].coloredMCs) {
var _local4 = new Color(this.styleTable[propName].coloredMCs[_local15]);
if (this.styleTable[propName].value == undefined) {
var _local5 = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
_local4.setTransform(_local5);
} else {
_local4.setRGB(value);
}
}
}
this.styleTable[propName].useGlobal = _local16;
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].coloredMCs == undefined) {
this.styleTable[propName].coloredMCs = new Object();
}
this.styleTable[propName].coloredMCs[skinMCRef] = skinMCRef;
if (this.styleTable[propName].value != undefined) {
var _local4 = new Color(skinMCRef);
_local4.setRGB(this.styleTable[propName].value);
}
};
_global.FStyleFormat = function () {
this.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
this.listeners = new Object();
this.isGlobal = false;
if (arguments.length > 0) {
for (var _local3 in arguments[0]) {
this[_local3] = arguments[0][_local3];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var _local3 = 0;
while (_local3 < arguments.length) {
var _local4 = arguments[_local3];
this.listeners[arguments[_local3]] = _local4;
for (var _local5 in this) {
if (this.isAStyle(_local5)) {
_local4.updateStyleProperty(this, _local5.toString());
}
}
_local3++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
this.listeners[component] = undefined;
for (var _local4 in this) {
if (this.isAStyle(_local4)) {
if (component.styleTable[_local4].useGlobal == this.isGlobal) {
component.styleTable[_local4].useGlobal = true;
var _local3 = (this.isGlobal ? undefined : (globalStyleFormat[_local4]));
component.setStyleProperty(_local4, _local3, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var _local6 = 0;
for (var _local5 in this.listeners) {
var _local3 = this.listeners[_local5];
if (arguments.length > 0) {
var _local4 = 0;
while (_local4 < arguments.length) {
if (this.isAStyle(arguments[_local4])) {
_local3.updateStyleProperty(this, arguments[_local4]);
}
_local4++;
}
} else {
for (var _local4 in this) {
if (this.isAStyle(_local4)) {
_local3.updateStyleProperty(this, _local4.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 269 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 271 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "background");
Symbol 274 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 276 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 279 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(check_mc, "foregroundDisabled");
Symbol 282 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(check_mc, "check");
Symbol 283 MovieClip [fcb_states] Frame 1
stop();
Symbol 283 MovieClip [fcb_states] Frame 2
stop();
Symbol 283 MovieClip [fcb_states] Frame 3
stop();
Symbol 283 MovieClip [fcb_states] Frame 4
stop();
Symbol 283 MovieClip [fcb_states] Frame 5
stop();
Symbol 283 MovieClip [fcb_states] Frame 6
stop();
Symbol 288 MovieClip [FLabelSymbol] Frame 1
#initclip 13
_global.FLabelClass = function () {
if (this.hostComponent == undefined) {
this.hostComponent = ((this._parent.controller == undefined) ? (this._parent) : (this._parent.controller));
}
if (this.customTextStyle == undefined) {
if (this.hostComponent.textStyle == undefined) {
this.hostComponent.textStyle = new TextFormat();
}
this.textStyle = this.hostComponent.textStyle;
this.enable = true;
}
};
FLabelClass.prototype = new MovieClip();
Object.registerClass("FLabelSymbol", FLabelClass);
FLabelClass.prototype.setLabel = function (label) {
var _local2 = this.hostComponent.styleTable.embedFonts.value;
if (_local2 != undefined) {
this.labelField.embedFonts = _local2;
}
this.labelField.setNewTextFormat(this.textStyle);
this.labelField.text = label;
this.labelField._height = this.labelField.textHeight + 2;
};
FLabelClass.prototype.setSize = function (width) {
this.labelField._width = width;
};
FLabelClass.prototype.setEnabled = function (enable) {
this.enable = enable;
var _local2 = this.hostComponent.styleTable[(enable ? "textColor" : "textDisabled")].value;
if (_local2 == undefined) {
_local2 = (enable ? 0 : 8947848);
}
this.setColor(_local2);
};
FLabelClass.prototype.getLabel = function () {
return(this.labelField.text);
};
FLabelClass.prototype.setColor = function (col) {
this.labelField.textColor = col;
};
#endinitclip
Symbol 320 MovieClip Frame 1
stop();
Instance of Symbol 259 MovieClip [FCheckBoxSymbol] in Symbol 320 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
label = "Check Box";
initialValue = false;
labelPlacement = "right";
changeHandler = "";
}
Instance of Symbol 260 MovieClip [FUIComponentSymbol] in Symbol 320 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
}
Instance of Symbol 288 MovieClip [FLabelSymbol] in Symbol 320 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
}
Symbol 328 Button
on (release) {
_global.levelNumber = 1;
_global.peopleRescued = 0;
_global.peopleKilled = 0;
_global.levelScore = 0;
_global.totalEnemies = 0;
_global.enemiesKilled = 0;
_global.levelTime = 0;
_global.shotsFired = 0;
_global.shotsHit = 0;
_global.playerShips = 2;
_global.playerHealth = 3;
_global.playerShield = 0;
_global.powerupCluster = false;
_global.powerupSpeed = false;
_global.levplayerShield = 0;
_global.levpowerupCluster = false;
_global.levpowerupSpeed = false;
_global.playerScore = 0;
_global.playerSpeed = 7;
_global.playerBombCount = 9;
_global.nextExtraShip = 10000;
_global.finalPeople = 0;
_global.finalEnemies = 0;
_global.finalShotsHit = 0;
_global.finalShotsFired = 0;
_global.soundOn = checkSound.getValue();
_global.musicOn = checkMusic.getValue();
if (_global.musicDisabled) {
_global.musicOn = false;
}
if (_global.musicOn) {
trace("trying to start music..." + _root.music);
_root.music.startMusic();
}
_root.game = new Game();
_root.game.buildLevel(_global.levelNumber);
_root.gotoAndPlay("frameGame");
}
Symbol 331 Button
on (release) {
gotoAndPlay ("frameStory");
}
Symbol 342 Button
on (release, keyPress "<Enter>") {
if ((_global.levelNumber == 20) && (_global.peopleRescued >= (_global.levelNumber * 8))) {
gotoAndStop ("frameEndGame");
} else {
if (_global.peopleRescued >= (_global.levelNumber * 8)) {
_global.levelNumber++;
_global.playerHealth = 3;
}
_global.levelScore = 0;
_global.peopleRescued = 0;
_global.peopleKilled = 0;
_global.totalEnemies = 0;
_global.enemiesKilled = 0;
_global.levelTime = 0;
_global.shotsFired = 0;
_global.shotsHit = 0;
_root.game = new Game();
_root.game.buildLevel(_global.levelNumber);
gotoAndPlay ("frameGame");
}
}
Symbol 387 Button
on (release) {
getURL ("http://www.playaholics.com/comp_entry.php?developer=spectrumwired&game=midnight&score=" + _global.playerScore, "_top");
gotoAndPlay (3);
}
Symbol 389 Button
on (release) {
_global.levelNumber = 1;
_global.peopleRescued = 0;
_global.peopleKilled = 0;
_global.levelScore = 0;
_global.totalEnemies = 0;
_global.enemiesKilled = 0;
_global.levelTime = 0;
_global.shotsFired = 0;
_global.shotsHit = 0;
_global.playerShips = 2;
_global.playerHealth = 3;
_global.playerShield = 0;
_global.powerupCluster = false;
_global.powerupSpeed = false;
_global.levplayerShield = 0;
_global.levpowerupCluster = false;
_global.levpowerupSpeed = false;
_global.playerScore = 0;
_global.playerSpeed = 7;
_global.playerBombCount = 9;
_global.nextExtraShip = 10000;
_global.finalPeople = 0;
_global.finalEnemies = 0;
_global.finalShotsHit = 0;
_global.finalShotsFired = 0;
if (_global.musicOn) {
_root.music.startMusic();
}
_root.game = new Game();
_root.game.buildLevel(_global.levelNumber);
_root.gotoAndPlay("frameGame");
}