Frame 1
Mouse.hide();
startDrag ("_root.littleMan", true);
function newpandemic() {
getURL ("http://www.darkrealmstudios.com", "_blank");
}
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var mysite = new ContextMenuItem("Dark Realm Studios", newpandemic);
myMenu.customItems.push(mysite);
_root.menu = myMenu;
total = _root.getBytesTotal();
loaded = _root.getBytesLoaded();
if ((_root.loader.box0.currentPlaying == false) && (((loaded / total) * 100) >= 10)) {
_root.loader.box0.gotoAndPlay(1);
}
if ((_root.loader.box1.currentPlaying == false) && (((loaded / total) * 100) >= 20)) {
_root.loader.box1.gotoAndPlay(1);
}
if ((_root.loader.box2.currentPlaying == false) && (((loaded / total) * 100) >= 30)) {
_root.loader.box2.gotoAndPlay(1);
}
if ((_root.loader.box3.currentPlaying == false) && (((loaded / total) * 100) >= 40)) {
_root.loader.box3.gotoAndPlay(1);
}
if ((_root.loader.box4.currentPlaying == false) && (((loaded / total) * 100) >= 50)) {
_root.loader.box4.gotoAndPlay(1);
}
if ((_root.loader.box5.currentPlaying == false) && (((loaded / total) * 100) >= 60)) {
_root.loader.box5.gotoAndPlay(1);
}
if ((_root.loader.box6.currentPlaying == false) && (((loaded / total) * 100) >= 70)) {
_root.loader.box6.gotoAndPlay(1);
}
if ((_root.loader.box7.currentPlaying == false) && (((loaded / total) * 100) >= 80)) {
_root.loader.box7.gotoAndPlay(1);
}
if ((_root.loader.box8.currentPlaying == false) && (((loaded / total) * 100) >= 90)) {
_root.loader.box8.gotoAndPlay(1);
}
if ((_root.loader.box9.currentPlaying == false) && (((loaded / total) * 100) >= 100)) {
_root.loader.box9.gotoAndPlay(1);
}
Frame 2
Mouse.hide();
startDrag ("_root.littleMan", true);
total = _root.getBytesTotal();
loaded = _root.getBytesLoaded();
if ((_root.loader.box0.currentPlaying == false) && (((loaded / total) * 100) >= 10)) {
_root.loader.box0.gotoAndPlay(1);
}
if ((_root.loader.box1.currentPlaying == false) && (((loaded / total) * 100) >= 20)) {
_root.loader.box1.gotoAndPlay(1);
}
if ((_root.loader.box2.currentPlaying == false) && (((loaded / total) * 100) >= 30)) {
_root.loader.box2.gotoAndPlay(1);
}
if ((_root.loader.box3.currentPlaying == false) && (((loaded / total) * 100) >= 40)) {
_root.loader.box3.gotoAndPlay(1);
}
if ((_root.loader.box4.currentPlaying == false) && (((loaded / total) * 100) >= 50)) {
_root.loader.box4.gotoAndPlay(1);
}
if ((_root.loader.box5.currentPlaying == false) && (((loaded / total) * 100) >= 60)) {
_root.loader.box5.gotoAndPlay(1);
}
if ((_root.loader.box6.currentPlaying == false) && (((loaded / total) * 100) >= 70)) {
_root.loader.box6.gotoAndPlay(1);
}
if ((_root.loader.box7.currentPlaying == false) && (((loaded / total) * 100) >= 80)) {
_root.loader.box7.gotoAndPlay(1);
}
if ((_root.loader.box8.currentPlaying == false) && (((loaded / total) * 100) >= 90)) {
_root.loader.box8.gotoAndPlay(1);
}
if ((_root.loader.box9.currentPlaying == false) && (((loaded / total) * 100) >= 100)) {
_root.loader.box9.gotoAndPlay(1);
}
if (_root.loader.box9.done == true) {
_global.introPlayed = false;
gotoAndPlay (3);
} else {
_root.gotoAndPlay(1);
}
Frame 3
Mouse.hide();
startDrag ("_root.littleMan", true);
stop();
Frame 4
Mouse.hide();
startDrag ("_root.littleMan", true);
Frame 5
Mouse.hide();
startDrag ("_root.littleMan", true);
_global.music = 1;
_global.sound = 1;
_global.autoquality = 1;
_root._quality = "MEDIUM";
_global.door = new Sound();
_global.door.attachSound("hydra");
_global.cannon = new Sound();
_global.cannon.attachSound("cannon");
_global.laser = new Sound();
_global.laser.attachSound("laserSound");
_global.explode0 = new Sound();
_global.explode0.attachSound("sE0");
_global.explode1 = new Sound();
_global.explode1.attachSound("sE1");
_global.explode2 = new Sound();
_global.explode2.attachSound("sE2");
_global.gameMusic = new Sound();
_global.gameMusic.attachSound("movieMusic");
_global.gameOver = false;
Frame 6
Mouse.hide();
startDrag ("_root.littleMan", true);
stop();
Frame 7
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__("619d097f", this, 10301, true);
Mouse.hide();
startDrag ("_root.littleMan", true);
if ((_global.gameOver == true) && (_global.music == 1)) {
_global.gameMusic.start(0, 9999);
_global.gameOver = false;
}
_global.submitScore = false;
stop();
Frame 8
Mouse.hide();
startDrag ("_root.littleMan", true);
Frame 9
Mouse.hide();
startDrag ("_root.littleMan", true);
Frame 10
Mouse.hide();
startDrag ("_root.littleMan", true);
_global.consoleOn = false;
_global.god = "off";
_global.unlMoney = "off";
_global.supShields = "off";
_global.selectedPlatform = "none";
_global.roundKills = 0;
_global.sensors = 1;
_global.cash = 0;
_global.level = 1;
_global.score = 0;
_global.health = 100;
_global.upgradeMode = "off";
_global.gamePaused = "off";
_global.shootingOn = false;
_global.depth = 10;
_global.platforms = new Array();
_global.autos = new Array();
_global.asteroids = new Array();
_global.bullets = new Array();
_global.lasers = new Array();
_global.effects = new Array();
_global.missiles = new Array();
_global.bombs = new Array();
_root.upgradeScreen._visible = false;
_root.sideBar.console._visible = false;
_root.pauseFade._visible = false;
_root.wp0._visible = false;
_root.wp1._visible = false;
_root.wp2._visible = false;
platform0 = new WeaponPlatform(_root.wp0, _root.sideBar.wpw2, "Platform II");
platform0.AddMainWeapon("w2");
platform1 = new WeaponPlatform(_root.wp1, _root.sideBar.wpw1, "Platform I");
platform1.AddMainWeapon("w2");
platform2 = new WeaponPlatform(_root.wp2, _root.sideBar.wpw3, "Platform III");
platform2.AddMainWeapon("w2");
platform0.Mode(0);
platform1.Mode(0);
platform2.Mode(0);
_root.at0._visible = false;
_root.at1._visible = false;
turret0 = new Turret(_root.at0, _root.AIcursor1);
turret1 = new Turret2(_root.at1, _root.AIcursor2);
Frame 11
Mouse.hide();
startDrag ("_root.littleMan", true);
platform0.Enable();
function loop() {
Mouse.hide();
startDrag ("_root.littleMan", true);
effectCount++;
if (effectCount == 8) {
effectCount = 0;
t = 0;
while (t < _global.effects.length) {
_global.effects[t].Run();
if (_global.effects[t].dead == true) {
_global.effects.splice(t, 1);
}
t++;
}
}
if (_global.gamePaused == "off") {
if ((_global.roundKills < (_global.level * 4)) && (_global.asteroids.length <= 100)) {
if ((getTimer() - spawnCounter) >= spawnThreshold) {
trace("TIMER : " + spawnThreshold);
j = 0;
while (j < (Math.floor(_global.level / 2.5) + 1)) {
if ((_global.level >= 1) && (_global.level <= 4)) {
CreateAsteroids(0);
}
if ((_global.level >= 5) && (_global.level <= 10)) {
CreateAsteroids(random(2));
}
if ((_global.level >= 11) && (_global.level <= 20)) {
CreateAsteroids(random(3));
}
j++;
}
spawnThreshold = 20250 - ((_global.level - 1) * 995);
if (_global.level < 5) {
switch (_global.level) {
case 1 :
spawnThreshold = 9200;
break;
case 2 :
spawnThreshold = 8900;
break;
case 3 :
spawnThreshold = 10250;
break;
case 4 :
spawnThreshold = 9750;
}
}
spawnCounter = getTimer();
}
}
platform0.targeted.gun._rotation = (Math.atan2(_root._ymouse - 500, _root._xmouse - 300) * 180) / 3.14;
platform0.WindowUpdate();
platform1.targeted.gun._rotation = (Math.atan2(_root._ymouse - 500, _root._xmouse - 95) * 180) / 3.14;
platform1.WindowUpdate();
platform2.targeted.gun._rotation = (Math.atan2(_root._ymouse - 500, _root._xmouse - 495) * 180) / 3.14;
platform2.WindowUpdate();
if ((_global.shootingOn == true) && ((_global.roundKills < (_global.level * 4)) || (_global.asteroids.length > 0))) {
platform0.Fire();
platform1.Fire();
platform2.Fire();
}
optimizeMan++;
if (optimizeMan <= _global.optmizeThreshold) {
t = 0;
while (t < _global.bullets.length) {
_global.bullets[t].Run();
if (_global.bullets[t].dead == true) {
_global.bullets.splice(t, 1);
t--;
}
t++;
}
t = 0;
while (t < _global.missiles.length) {
_global.missiles[t].Run();
if (_global.missiles[t].dead == true) {
_global.missiles.splice(t, 1);
t--;
}
t++;
}
t = 0;
while (t < _global.bombs.length) {
_global.bombs[t].Run();
if (_global.bombs[t].dead == true) {
_global.bombs.splice(t, 1);
t--;
}
t++;
}
t = 0;
while (t < _global.asteroids.length) {
_global.asteroids[t].Run();
if (_global.asteroids[t].dead == true) {
_global.asteroids.splice(t, 1);
t--;
}
t++;
}
} else {
optimizeMan = 0;
}
turret0.Run();
turret1.Run();
if ((_global.health <= 0) || ((_global.roundKills >= (_global.level * 4)) && (_global.level == 19))) {
trace("game over");
HideButtons();
_global.gamePaused = "on";
_root.gameOverScreen.gotoAndPlay(2);
_global.gameOver = true;
}
if ((((_global.roundKills >= (_global.level * 4)) && (_global.effects.length == 0)) && (_global.asteroids.length == 0)) && (_global.gamePaused == "off")) {
trace("round end");
_root.sideBar.pauseButtonS._visible = false;
_global.gamePaused = "on";
_root.pauseFade._visible = true;
t = 0;
while (t < _global.bullets.length) {
_global.bullets[t].Remove();
t++;
}
t = 0;
while (t < _global.missiles.length) {
_global.missiles[t].Remove();
t++;
}
t = 0;
while (t < _global.bombs.length) {
_global.bombs[t].Remove();
t++;
}
t = 0;
while (t < _global.asteroids.length) {
_global.asteroids[t].Remove();
t++;
}
t = 0;
while (t < _global.effects.length) {
_global.effects[t].Remove();
t++;
}
_global.roundKills = 0;
_global.depth = 10;
_global.asteroids = new Array();
_global.bullets = new Array();
_global.lasers = new Array();
_global.effects = new Array();
_global.missiles = new Array();
_global.bombs = new Array();
_root.levelCompleted.gotoAndPlay(2);
_global.cash = _global.cash + 200;
_global.score = _global.score + 1000;
_root.UpdateInfoWindow();
}
}
}
function CreateAsteroids(typ) {
_global.asteroids[_global.asteroids.length] = new Asteroid(typ, random(510) + 45, -35);
}
function HideButtons() {
_root.sideBar.mainMenuButton._visible = false;
_root.sideBar.pauseButtonS._visible = false;
}
spawnCounter = getTimer();
spawnThreshold = 6000;
optimizeMan = 0;
effectCount = 0;
_global.optmizeThreshold = 6;
_root.onEnterFrame = loop;
function displayUpgrades() {
pauseGame();
}
function pauseGame() {
}
function updateConsoleWindow() {
_root.sideBar.console.infoBox.text = (((((((("Asteroids " + _global.asteroids.length) + "\nEffects ") + _global.effects.length) + "\nMissiles ") + _global.missiles.length) + "\nBullets ") + _global.bullets.length) + "\nRound Kills ") + _global.roundKills;
}
function consoleCommand() {
trace(_root.sideBar.console.inputBox.text);
}
function UpdateInfoWindow() {
_root.sideBar.infoWindow.cash.text = _global.cash;
_root.sideBar.infoWindow.leve.text = _global.level;
_root.sideBar.infoWindow.score.text = _global.score;
_root.sideBar.infoWindow.health.text = _global.health + "%";
_root.upgradeScreen.cashText.text = _global.cash;
}
function UpdateSensors() {
if (_global.sensors == 0) {
_root.upgradeScreen.s1Button._visible = true;
_root.upgradeScreen.s2Button._visible = false;
_root.upgradeScreen.s3Button._visible = false;
_root.upgradeScreen.s4Button._visible = false;
_root.upgradeScreen.sen0._visible = true;
_root.upgradeScreen.sen1._visible = false;
_root.upgradeScreen.sen2._visible = false;
_root.upgradeScreen.sen3._visible = false;
_root.gameScreen.sen0._visible = false;
_root.gameScreen.sen1._visible = false;
_root.gameScreen.sen2._visible = false;
_root.gameScreen.sen3._visible = false;
_root.fogness._y = -95;
}
if (_global.sensors == 1) {
_root.upgradeScreen.s1Button._visible = false;
_root.upgradeScreen.s2Button._visible = true;
_root.upgradeScreen.s3Button._visible = false;
_root.upgradeScreen.s4Button._visible = false;
_root.upgradeScreen.sen0._visible = true;
_root.upgradeScreen.sen1._visible = true;
_root.upgradeScreen.sen2._visible = false;
_root.upgradeScreen.sen3._visible = false;
_root.gameScreen.sen0._visible = true;
_root.gameScreen.sen1._visible = false;
_root.gameScreen.sen2._visible = false;
_root.gameScreen.sen3._visible = false;
_root.fogness._y = _root.gameScreen.sen0._y - _root.fogness._height;
}
if (_global.sensors == 2) {
_root.upgradeScreen.s1Button._visible = false;
_root.upgradeScreen.s2Button._visible = false;
_root.upgradeScreen.s3Button._visible = true;
_root.upgradeScreen.s4Button._visible = false;
_root.upgradeScreen.sen0._visible = true;
_root.upgradeScreen.sen1._visible = true;
_root.upgradeScreen.sen2._visible = true;
_root.upgradeScreen.sen3._visible = false;
_root.gameScreen.sen0._visible = false;
_root.gameScreen.sen1._visible = true;
_root.gameScreen.sen2._visible = false;
_root.gameScreen.sen3._visible = false;
_root.fogness._y = _root.gameScreen.sen1._y - _root.fogness._height;
}
if (_global.sensors == 3) {
_root.upgradeScreen.s1Button._visible = false;
_root.upgradeScreen.s2Button._visible = false;
_root.upgradeScreen.s3Button._visible = false;
_root.upgradeScreen.s4Button._visible = true;
_root.upgradeScreen.sen0._visible = true;
_root.upgradeScreen.sen1._visible = true;
_root.upgradeScreen.sen2._visible = true;
_root.upgradeScreen.sen3._visible = true;
_root.gameScreen.sen0._visible = false;
_root.gameScreen.sen1._visible = false;
_root.gameScreen.sen2._visible = true;
_root.gameScreen.sen3._visible = false;
_root.fogness._y = _root.gameScreen.sen2._y - _root.fogness._height;
}
if (_global.sensors == 4) {
_root.upgradeScreen.s1Button._visible = false;
_root.upgradeScreen.s2Button._visible = false;
_root.upgradeScreen.s3Button._visible = false;
_root.upgradeScreen.s4Button._visible = false;
_root.upgradeScreen.sen0._visible = true;
_root.upgradeScreen.sen1._visible = true;
_root.upgradeScreen.sen2._visible = true;
_root.upgradeScreen.sen3._visible = true;
_root.gameScreen.sen0._visible = false;
_root.gameScreen.sen1._visible = false;
_root.gameScreen.sen2._visible = false;
_root.gameScreen.sen3._visible = true;
_root.fogness._y = _root.gameScreen.sen3._y - _root.fogness._height;
}
}
keyManager = new Object();
Key.addListener(keyManager);
_root.onMouseDown = function () {
_global.shootingOn = true;
};
_root.onMouseUp = function () {
_global.shootingOn = false;
};
keyManager.onKeyDown = function () {
if ((Key.getAscii() == 126) || (Key.getAscii() == 96)) {
if (_global.consoleOn == false) {
_root.sideBar.console._visible = true;
_global.consoleOn = true;
_root.updateConsoleWindow();
} else {
_root.sideBar.console._visible = false;
_global.consoleOn = false;
Selection.setFocus(null);
}
}
if ((Key.getAscii() == 81) || (Key.getAscii() == 113)) {
if ((platform1.platformEnabled == true) && (platform1.secondaryWeapon != "none")) {
platform1.Mode(1);
}
}
if ((Key.getAscii() == 65) || (Key.getAscii() == 97)) {
if ((platform1.platformEnabled == true) && (platform1.mainWeapon != "none")) {
platform1.Mode(0);
}
}
if ((Key.getAscii() == 87) || (Key.getAscii() == 119)) {
if ((platform0.platformEnabled == true) && (platform0.secondaryWeapon != "none")) {
platform0.Mode(1);
}
}
if ((Key.getAscii() == 83) || (Key.getAscii() == 115)) {
if ((platform0.platformEnabled == true) && (platform0.mainWeapon != "none")) {
platform0.Mode(0);
}
}
if ((Key.getAscii() == 69) || (Key.getAscii() == 101)) {
if ((platform2.platformEnabled == true) && (platform2.secondaryWeapon != "none")) {
platform2.Mode(1);
}
}
if ((Key.getAscii() == 68) || (Key.getAscii() == 100)) {
if ((platform2.platformEnabled == true) && (platform2.mainWeapon != "none")) {
platform2.Mode(0);
}
}
if (Key.getAscii() == 13) {
if (Selection.getFocus() == "_level0.sideBar.console.inputBox") {
_root.consoleCommand();
}
}
};
UpdateSensors();
UpdateInfoWindow();
stop();
Symbol 10 MovieClip Frame 1
currentPlaying = false;
stop();
Symbol 10 MovieClip Frame 2
currentPlaying = true;
Symbol 10 MovieClip Frame 9
done = true;
stop();
Symbol 565 MovieClip [__Packages.TurretB] Frame 0
class TurretB
{
var tracer, targeted, turretEnabled, fireRate, targetEnemy, fireTimer;
function TurretB (tar, tra) {
tracer = tra;
targeted = tar;
turretEnabled = false;
fireRate = 250;
targetEnemy = "none";
fireTimer = getTimer();
}
function Run() {
if (((targetEnemy == undefined) || (targetEnemy.dead == true)) || (targetEnemy == "none")) {
Hide();
targetEnemy = "none";
Search();
} else {
Track();
}
}
function Search() {
var _local3 = 0;
if (_local3 < _global.asteroids.length) {
targetEnemy = _global.asteroids[_local3];
Track();
}
}
function Track() {
var _local3;
tracer._visible = true;
tracer._x = targetEnemy.targeted._x + (targetEnemy.targeted._width / 2);
tracer._y = targetEnemy.targeted._y + (targetEnemy.targeted._height / 2);
if ((getTimer() - fireTimer) >= fireRate) {
_local3 = (Math.atan2((targetEnemy.targeted._y + targetEnemy.yVec) - targeted._y, (targetEnemy.targeted._x + (targetEnemy.xVec * 2)) - targeted._x) * 180) / 3.14;
targeted.dome.gotoAndPlay(2);
_global.lasers[_global.lasers.length] = new RedLaserB(targeted._x, targeted._y, _local3);
fireTimer = getTimer();
}
}
function Hide() {
tracer._visible = false;
}
function Enable() {
turretEnabled = true;
targeted._visible = true;
}
}
Symbol 566 MovieClip [__Packages.Projectile] Frame 0
interface Projectile
{
}
Symbol 567 MovieClip [__Packages.RedLaserB] Frame 0
class RedLaserB implements Projectile
{
var dead, constantSpeed, targeted, yVec, xVec;
function RedLaserB (posX, posY, rot) {
dead = false;
constantSpeed = 22;
_root.menuAction.asteroidField.attachMovie("w6", "w6" + _global.depth, _global.depth);
targeted = _root.menuAction.asteroidField["w6" + _global.depth];
targeted._x = posX;
targeted._y = posY;
_global.depth++;
targeted._rotation = rot;
rot = (rot * Math.PI) / 180;
yVec = Math.sin(rot) * constantSpeed;
xVec = Math.cos(rot) * constantSpeed;
}
function Run() {
Collide();
CheckStatus();
targeted._x = targeted._x + xVec;
targeted._y = targeted._y + yVec;
if (((((targeted._x + targeted._width) <= 0) || (targeted._x >= 600)) || (targeted._y <= -15)) || (targeted._y >= 600)) {
dead = true;
CheckStatus();
}
}
function Collide() {
var _local7 = targeted._x + (targeted._width / 2);
var _local6 = targeted._y + (targeted._height / 2);
var _local3 = 0;
while (_local3 < _global.asteroids.length) {
if (_global.asteroids[_local3].dead == false) {
var _local5 = _global.asteroids[_local3].targeted._x + (_global.asteroids[_local3].targeted._width / 2);
var _local4 = _global.asteroids[_local3].targeted._y + (_global.asteroids[_local3].targeted._height / 2);
if (Math.sqrt(Math.pow(_local7 - _local5, 2) + Math.pow(_local6 - _local4, 2)) <= 55) {
if (((targeted._x + xVec) + targeted._width) >= (_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec)) {
if ((targeted._x + xVec) <= ((_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec) + _global.asteroids[_local3].targeted._width)) {
if (((targeted._y + yVec) + targeted._height) >= (_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec)) {
if ((targeted._y + yVec) <= ((_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec) + _global.asteroids[_local3].targeted._height)) {
_global.asteroids[_local3].ModHealth(22);
_global.asteroids[_local3].Hit(xVec / 4, yVec / 4);
CreateEffect(_local7, _local6);
dead = true;
break;
}
}
}
}
}
}
_local3++;
}
}
function CheckStatus() {
if (dead == true) {
removeMovieClip(targeted);
delete targeted;
}
}
function CreateEffect(xPos, yPos) {
_global.effects[_global.effects.length] = new EffectB("RedBoom0", xPos + xVec, yPos + yVec, false, true, targeted);
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 568 MovieClip [__Packages.EffectB] Frame 0
class EffectB
{
var dead, volatile, targeted;
function EffectB (tar, xPos, yPos, vol, ran, cous) {
dead = false;
volatile = vol;
_root.menuAction.asteroidField.attachMovie(tar, "ef" + _global.depth, _global.depth);
targeted = _root.menuAction.asteroidField["ef" + _global.depth];
targeted._rotation = cous._rotation;
targeted._x = xPos;
targeted._y = yPos;
if (ran == false) {
targeted._rotation = 0;
}
if (ran == true) {
targeted._rotation = random(360);
}
_global.depth++;
}
function Run() {
if (targeted.done == true) {
dead = true;
removeMovieClip(targeted);
delete targeted;
}
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 569 MovieClip [__Packages.Turret2B] Frame 0
class Turret2B
{
var tracer, targeted, turretEnabled, fireRate, targetEnemy, fireTimer;
function Turret2B (tar, tra) {
tracer = tra;
targeted = tar;
turretEnabled = false;
fireRate = 250;
targetEnemy = "none";
fireTimer = getTimer();
}
function Run() {
if (((targetEnemy == undefined) || (targetEnemy.dead == true)) || (targetEnemy == "none")) {
Hide();
targetEnemy = "none";
Search();
} else {
Track();
}
}
function Search() {
var _local3 = _global.asteroids.length - 1;
if (_local3 >= 0) {
targetEnemy = _global.asteroids[_local3];
Track();
}
}
function Track() {
var _local3;
tracer._visible = true;
tracer._x = targetEnemy.targeted._x + (targetEnemy.targeted._width / 2);
tracer._y = targetEnemy.targeted._y + (targetEnemy.targeted._height / 2);
if ((getTimer() - fireTimer) >= fireRate) {
_local3 = (Math.atan2((targetEnemy.targeted._y + targetEnemy.yVec) - targeted._y, (targetEnemy.targeted._x + (targetEnemy.xVec * 2)) - targeted._x) * 180) / 3.14;
targeted.dome.gotoAndPlay(2);
_global.lasers[_global.lasers.length] = new RedLaserB(targeted._x, targeted._y, _local3);
fireTimer = getTimer();
}
}
function Hide() {
tracer._visible = false;
}
function Enable() {
turretEnabled = true;
targeted._visible = true;
}
}
Symbol 570 MovieClip [__Packages.AsteroidB] Frame 0
class AsteroidB
{
var dead, yVec, xVec, form, health, targeted;
function AsteroidB (fo, xPos, yPos) {
dead = false;
yVec = 0;
xVec = Math.random() * 1.5;
form = fo;
health = 150 * (fo + 1);
_root.menuAction.asteroidField.attachMovie("asteroid" + fo, "ast" + _global.depth, _global.depth);
targeted = _root.menuAction.asteroidField["ast" + _global.depth];
targeted._x = xPos;
targeted._y = yPos;
_global.depth++;
}
function Run() {
xVec = xVec + 0.025;
targeted._y = targeted._y + yVec;
targeted._x = targeted._x - xVec;
if ((((((targeted._x + targeted._width) <= 0) || (targeted._x >= 500)) || (targeted._y < -30)) || (targeted._y > 605)) && (dead == false)) {
ModHealth(500);
}
}
function Remove2() {
removeMovieClip(targeted);
_root.UpdateInfoWindow();
dead = true;
_global.roundKills++;
delete targeted;
}
function ModHealth(amount) {
health = health - amount;
if (health <= 0) {
_global.cash = _global.cash + ((form + 1) * 50);
_global.score = _global.score + ((form + 1) * 500);
_root.UpdateInfoWindow();
dead = true;
}
CheckStatus();
}
function Hit(amountX, amountY) {
xVec = xVec - (amountX / ((form + 1) * 6));
yVec = yVec - (amountY / ((form + 1) * 6));
}
function CheckStatus() {
if (dead == true) {
_global.roundKills++;
_global.effects[_global.effects.length] = new EffectB(("a" + form) + "Explode", (targeted._x + (targeted._width / 2)) + xVec, (targeted._y + (targeted._height / 2)) + yVec, false, true, targeted);
removeMovieClip(targeted);
delete targeted;
}
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 571 MovieClip [__Packages.WeaponPlatform] Frame 0
class WeaponPlatform
{
var modeT, platformName, targetedWindow, targeted, platformEnabled, mainWeapon, secondaryWeapon, mainWeaponLevel, secondaryWeaponLevel, coolDownPeriodM, coolDownPeriodS, mCoolDownTimer, sCoolDownTimer;
function WeaponPlatform (tar, wind, nam) {
modeT = 0;
platformName = nam;
targetedWindow = wind;
targeted = tar;
platformEnabled = false;
mainWeapon = "none";
secondaryWeapon = "none";
mainWeaponLevel = 1;
secondaryWeaponLevel = 1;
coolDownPeriodM = 1500 / mainWeaponLevel;
coolDownPeriodS = 1500 / secondaryWeaponLevel;
mCoolDownTimer = getTimer();
sCoolDownTimer = getTimer();
}
function AddMainWeapon(weapon) {
if (weapon == "w0") {
coolDownPeriodM = 3250 / mainWeaponLevel;
mainWeapon = "Antimatter Missiles";
}
if (weapon == "w1") {
coolDownPeriodM = 95 / mainWeaponLevel;
mainWeapon = "Blue Lasers";
}
if (weapon == "w2") {
coolDownPeriodM = 225 / mainWeaponLevel;
mainWeapon = "Sledge Rounds";
}
if (weapon == "w3") {
coolDownPeriodM = 925 / mainWeaponLevel;
mainWeapon = "Cluster Bombs";
}
if (weapon == "w4") {
coolDownPeriodM = 1075 / mainWeaponLevel;
mainWeapon = "Cluster Missiles";
}
if (weapon == "w5") {
coolDownPeriodM = 675 / mainWeaponLevel;
mainWeapon = "Missiles";
}
if (weapon == "w6") {
coolDownPeriodM = 160 / mainWeaponLevel;
mainWeapon = "Red Lasers";
}
WindowUpdate();
}
function AddSecondaryWeapon(weapon) {
if (weapon == "w0") {
coolDownPeriodS = 3250 / mainWeaponLevel;
secondaryWeapon = "Antimatter Missiles";
}
if (weapon == "w1") {
coolDownPeriodS = 95 / mainWeaponLevel;
secondaryWeapon = "Blue Lasers";
}
if (weapon == "w2") {
coolDownPeriodS = 225 / mainWeaponLevel;
secondaryWeapon = "Sledge Rounds";
}
if (weapon == "w3") {
coolDownPeriodS = 925 / mainWeaponLevel;
secondaryWeapon = "Cluster Bombs";
}
if (weapon == "w4") {
coolDownPeriodS = 1075 / mainWeaponLevel;
secondaryWeapon = "Cluster Missiles";
}
if (weapon == "w5") {
coolDownPeriodS = 675 / mainWeaponLevel;
secondaryWeapon = "Missiles";
}
if (weapon == "w6") {
coolDownPeriodS = 160 / mainWeaponLevel;
secondaryWeapon = "Red Lasers";
}
WindowUpdate();
}
function WindowUpdate() {
targetedWindow.platformName.text = platformName;
targetedWindow.mainweapon.text = mainWeapon;
targetedWindow.secweapon.text = secondaryWeapon;
}
function Enable() {
targeted._visible = true;
targetedWindow.gotoAndPlay(2);
platformEnabled = true;
}
function Mode(val) {
modeT = val;
targeted.gun.gun.lights.gotoAndStop(modeT + 1);
}
function Fire(weaponSystem) {
if (platformEnabled == true) {
if (modeT == 0) {
if ((getTimer() - mCoolDownTimer) >= coolDownPeriodM) {
targetedWindow.activity.play();
WindowUpdate();
mCoolDownTimer = getTimer();
var _local3 = new Object();
_local3.x = targeted.gun.gun.aimer._x;
_local3.y = targeted.gun.gun.aimer._y;
targeted.gun.gun.localToGlobal(_local3);
switch (mainWeapon) {
case "Sledge Rounds" :
if (_global.sound == 1) {
_global.cannon.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("sledge");
targetedWindow.bar.gotoAndPlay("sledge");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.bullets[_global.bullets.length] = new Bullet(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Missiles" :
if (_global.sound == 1) {
_global.cannon.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("missiles2");
targetedWindow.bar.gotoAndPlay("missiles2");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.missiles[_global.missiles.length] = new Missile(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Cluster Bombs" :
if (_global.sound == 1) {
_global.cannon.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("missiles1");
targetedWindow.bar.gotoAndPlay("missiles1");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.missiles[_global.missiles.length] = new ClusterBomb(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Cluster Missiles" :
if (_global.sound == 1) {
_global.cannon.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("missiles1");
targetedWindow.bar.gotoAndPlay("missiles1");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.missiles[_global.missiles.length] = new ClusterMissile(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Antimatter Missiles" :
if (_global.sound == 1) {
_global.cannon.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("antiMatter");
targetedWindow.bar.gotoAndPlay("antiMatter");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.missiles[_global.missiles.length] = new AntiMatterMissile(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Red Lasers" :
if (_global.sound == 1) {
_global.laser.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("lasers");
targetedWindow.bar.gotoAndPlay("lasers");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.bullets[_global.bullets.length] = new RedLaser(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Blue Lasers" :
if (_global.sound == 1) {
_global.laser.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("lasers");
targetedWindow.bar.gotoAndPlay("lasers");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.bullets[_global.bullets.length] = new BlueLaser(_local3.x, _local3.y, targeted.gun._rotation);
}
}
}
if (modeT == 1) {
if ((getTimer() - sCoolDownTimer) >= coolDownPeriodS) {
targetedWindow.activity.play();
WindowUpdate();
sCoolDownTimer = getTimer();
var _local3 = new Object();
_local3.x = targeted.gun.gun.aimer._x;
_local3.y = targeted.gun.gun.aimer._y;
targeted.gun.gun.localToGlobal(_local3);
switch (secondaryWeapon) {
case "Sledge Rounds" :
if (_global.sound == 1) {
_global.cannon.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("sledge");
targetedWindow.bar.gotoAndPlay("sledge");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.bullets[_global.bullets.length] = new Bullet(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Missiles" :
if (_global.sound == 1) {
_global.cannon.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("missiles2");
targetedWindow.bar.gotoAndPlay("missiles2");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.missiles[_global.missiles.length] = new Missile(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Cluster Bombs" :
if (_global.sound == 1) {
_global.cannon.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("missiles1");
targetedWindow.bar.gotoAndPlay("missiles1");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.missiles[_global.missiles.length] = new ClusterBomb(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Cluster Missiles" :
if (_global.sound == 1) {
_global.cannon.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("missiles1");
targetedWindow.bar.gotoAndPlay("missiles1");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.missiles[_global.missiles.length] = new ClusterMissile(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Antimatter Missiles" :
if (_global.sound == 1) {
_global.cannon.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("antiMatter");
targetedWindow.bar.gotoAndPlay("antiMatter");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.missiles[_global.missiles.length] = new AntiMatterMissile(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Red Lasers" :
if (_global.sound == 1) {
_global.laser.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("lasers");
targetedWindow.bar.gotoAndPlay("lasers");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.bullets[_global.bullets.length] = new RedLaser(_local3.x, _local3.y, targeted.gun._rotation);
break;
case "Blue Lasers" :
if (_global.sound == 1) {
_global.laser.start(0, 1);
}
targeted.gun.gun.gotoAndPlay("lasers");
targetedWindow.bar.gotoAndPlay("lasers");
_global.effects[_global.effects.length] = new Effect("barrelBoom", _local3.x, _local3.y, false, false, targeted.gun);
_global.bullets[_global.bullets.length] = new BlueLaser(_local3.x, _local3.y, targeted.gun._rotation);
}
}
}
}
}
}
Symbol 572 MovieClip [__Packages.Effect] Frame 0
class Effect
{
var dead, volatile, targeted;
function Effect (tar, xPos, yPos, vol, ran, cous) {
dead = false;
volatile = vol;
_root.gameScreen.attachMovie(tar, "ef" + _global.depth, _global.depth);
targeted = _root.gameScreen["ef" + _global.depth];
targeted._rotation = cous._rotation;
targeted._x = xPos;
targeted._y = yPos;
if (ran == true) {
targeted._rotation = random(360);
}
_global.depth++;
}
function Run() {
if (targeted.done == true) {
dead = true;
removeMovieClip(targeted);
delete targeted;
}
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 573 MovieClip [__Packages.Bullet] Frame 0
class Bullet implements Projectile
{
var dead, constantSpeed, targeted, yVec, xVec;
function Bullet (posX, posY, rot) {
dead = false;
constantSpeed = 15;
_root.gameScreen.attachMovie("w2", "w2" + _global.depth, _global.depth);
targeted = _root.gameScreen["w2" + _global.depth];
targeted._x = posX;
targeted._y = posY;
_global.depth++;
targeted._rotation = rot;
rot = (rot * Math.PI) / 180;
yVec = Math.sin(rot) * constantSpeed;
xVec = Math.cos(rot) * constantSpeed;
}
function Run() {
Collide();
CheckStatus();
targeted._x = targeted._x + xVec;
targeted._y = targeted._y + yVec;
if (((((targeted._x + targeted._width) <= 0) || (targeted._x >= 600)) || (targeted._y <= -15)) || (targeted._y >= 600)) {
dead = true;
CheckStatus();
}
}
function Collide() {
var _local7 = targeted._x + (targeted._width / 2);
var _local6 = targeted._y + (targeted._height / 2);
var _local3 = 0;
while (_local3 < _global.asteroids.length) {
if ((_global.asteroids[_local3].dead == false) && ((targeted._y - _global.asteroids[_local3].targeted._y) <= 35)) {
var _local5 = _global.asteroids[_local3].targeted._x + (_global.asteroids[_local3].targeted._width / 2);
var _local4 = _global.asteroids[_local3].targeted._y + (_global.asteroids[_local3].targeted._height / 2);
if (Math.sqrt(Math.pow(_local7 - _local5, 2) + Math.pow(_local6 - _local4, 2)) <= 35) {
if (((targeted._x + xVec) + targeted._width) >= (_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec)) {
if ((targeted._x + xVec) <= ((_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec) + _global.asteroids[_local3].targeted._width)) {
if (((targeted._y + yVec) + targeted._height) >= (_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec)) {
if ((targeted._y + yVec) <= ((_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec) + _global.asteroids[_local3].targeted._height)) {
_global.asteroids[_local3].ModHealth(14, _local3);
_global.asteroids[_local3].Hit(xVec / 3.5, yVec / 3.5);
CreateEffect(_local7, _local6);
dead = true;
break;
}
}
}
}
}
}
_local3++;
}
}
function CheckStatus() {
if (dead == true) {
removeMovieClip(targeted);
delete targeted;
}
}
function CreateEffect(xPos, yPos) {
_global.effects[_global.effects.length] = new Effect("sparks0", xPos + xVec, yPos + yVec, false, true, targeted);
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 574 MovieClip [__Packages.Missile] Frame 0
class Missile implements Projectile
{
var dead, constantSpeed, targeted, yVec, xVec;
function Missile (posX, posY, rot) {
dead = false;
constantSpeed = 10;
_root.gameScreen.attachMovie("w4b", "w4b" + _global.depth, _global.depth);
targeted = _root.gameScreen["w4b" + _global.depth];
targeted._x = posX;
targeted._y = posY;
_global.depth++;
targeted._rotation = rot;
rot = (rot * Math.PI) / 180;
yVec = Math.sin(rot) * constantSpeed;
xVec = Math.cos(rot) * constantSpeed;
}
function Run() {
UpdateSpeed();
Collide();
CheckStatus();
targeted._x = targeted._x + xVec;
targeted._y = targeted._y + yVec;
if (((((targeted._x + targeted._width) <= 0) || (targeted._x >= 600)) || (targeted._y <= -15)) || (targeted._y >= 600)) {
dead = true;
CheckStatus();
}
}
function UpdateSpeed() {
var _local2;
constantSpeed = constantSpeed + 0.4;
_local2 = targeted._rotation;
_local2 = (_local2 * Math.PI) / 180;
yVec = Math.sin(_local2) * constantSpeed;
xVec = Math.cos(_local2) * constantSpeed;
}
function Collide() {
var _local7 = targeted._x + (targeted._width / 2);
var _local6 = targeted._y + (targeted._height / 2);
var _local3 = 0;
while (_local3 < _global.asteroids.length) {
if ((_global.asteroids[_local3].dead == false) && ((targeted._y - _global.asteroids[_local3].targeted._y) <= 40)) {
var _local5 = _global.asteroids[_local3].targeted._x + (_global.asteroids[_local3].targeted._width / 2);
var _local4 = _global.asteroids[_local3].targeted._y + (_global.asteroids[_local3].targeted._height / 2);
if (Math.sqrt(Math.pow(_local7 - _local5, 2) + Math.pow(_local6 - _local4, 2)) <= 40) {
if (((targeted._x + xVec) + targeted._width) >= (_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec)) {
if ((targeted._x + xVec) <= ((_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec) + _global.asteroids[_local3].targeted._width)) {
if (((targeted._y + yVec) + targeted._height) >= (_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec)) {
if ((targeted._y + yVec) <= ((_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec) + _global.asteroids[_local3].targeted._height)) {
_global.asteroids[_local3].ModHealth(35, _local3);
_global.asteroids[_local3].Hit(xVec / 3, yVec / 3);
CreateEffect(_local7, _local6);
dead = true;
break;
}
}
}
}
}
}
_local3++;
}
}
function CheckStatus() {
if (dead == true) {
removeMovieClip(targeted);
delete targeted;
}
}
function CreateEffect(xPos, yPos) {
var _local3 = new Object();
_local3.x = targeted.dot._x;
_local3.y = targeted.dot._y;
targeted.localToGlobal(_local3);
_global.effects[_global.effects.length] = new Effect("MissileExplosion0", _local3.x, _local3.y, true, true, targeted);
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 575 MovieClip [__Packages.ClusterBomb] Frame 0
class ClusterBomb implements Projectile
{
var dead, constantSpeed, targeted, yVec, xVec;
function ClusterBomb (posX, posY, rot) {
dead = false;
constantSpeed = 6.5;
_root.gameScreen.attachMovie("w3", "w3" + _global.depth, _global.depth);
targeted = _root.gameScreen["w3" + _global.depth];
targeted._x = posX;
targeted._y = posY;
_global.depth++;
targeted._rotation = rot;
rot = (rot * Math.PI) / 180;
yVec = Math.sin(rot) * constantSpeed;
xVec = Math.cos(rot) * constantSpeed;
}
function Run() {
UpdateSpeed();
Collide();
CheckStatus();
targeted._x = targeted._x + xVec;
targeted._y = targeted._y + yVec;
if (((((targeted._x + targeted._width) <= 0) || (targeted._x >= 600)) || (targeted._y <= -15)) || (targeted._y >= 600)) {
dead = true;
CheckStatus();
}
}
function UpdateSpeed() {
var _local2;
constantSpeed = constantSpeed + 0.4;
_local2 = targeted._rotation;
_local2 = (_local2 * Math.PI) / 180;
yVec = Math.sin(_local2) * constantSpeed;
xVec = Math.cos(_local2) * constantSpeed;
}
function Collide() {
var _local5 = targeted._x + (targeted._width / 2);
var _local4 = targeted._y + (targeted._height / 2);
var _local3 = 0;
while (_local3 < _global.asteroids.length) {
if ((_global.asteroids[_local3].dead == false) && ((targeted._y - _global.asteroids[_local3].targeted._y) <= 40)) {
var _local7 = _global.asteroids[_local3].targeted._x + (_global.asteroids[_local3].targeted._width / 2);
var _local6 = _global.asteroids[_local3].targeted._y + (_global.asteroids[_local3].targeted._height / 2);
if (Math.sqrt(Math.pow(_local5 - _local7, 2) + Math.pow(_local4 - _local6, 2)) <= 60) {
if (((targeted._x + xVec) + targeted._width) >= (_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec)) {
if ((targeted._x + xVec) <= ((_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec) + _global.asteroids[_local3].targeted._width)) {
if (((targeted._y + yVec) + targeted._height) >= (_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec)) {
if ((targeted._y + yVec) <= ((_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec) + _global.asteroids[_local3].targeted._height)) {
_global.asteroids[_local3].ModHealth(35, _local3);
_global.asteroids[_local3].Hit(xVec, yVec);
CreateEffect(_local5, _local4);
dead = true;
_global.bombs[_global.bombs.length] = new Bomb(_local5, _local4, random(360));
_global.bombs[_global.bombs.length] = new Bomb(_local5, _local4, random(360));
_global.bombs[_global.bombs.length] = new Bomb(_local5, _local4, random(360));
_global.bombs[_global.bombs.length] = new Bomb(_local5, _local4, random(360));
break;
}
}
}
}
}
}
_local3++;
}
}
function CheckStatus() {
if (dead == true) {
removeMovieClip(targeted);
delete targeted;
}
}
function CreateEffect(xPos, yPos) {
var _local3 = new Object();
_local3.x = targeted.dot._x;
_local3.y = targeted.dot._y;
targeted.localToGlobal(_local3);
_global.effects[_global.effects.length] = new Effect("clusterBombExplosion0", _local3.x, _local3.y, true, true, targeted);
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 576 MovieClip [__Packages.Bomb] Frame 0
class Bomb implements Projectile
{
var dead, constantSpeed, targeted, yVec, xVec;
function Bomb (posX, posY, rot) {
dead = false;
constantSpeed = 10;
_root.gameScreen.attachMovie("bombMC", "bo" + _global.depth, _global.depth);
targeted = _root.gameScreen["bo" + _global.depth];
targeted._x = posX;
targeted._y = posY;
_global.depth++;
targeted._rotation = rot;
rot = (rot * Math.PI) / 180;
yVec = Math.sin(rot) * constantSpeed;
xVec = Math.cos(rot) * constantSpeed;
}
function Run() {
Collide();
CheckStatus();
targeted._x = targeted._x + xVec;
targeted._y = targeted._y + yVec;
if (((((targeted._x + targeted._width) <= 0) || (targeted._x >= 600)) || (targeted._y <= -15)) || (targeted._y >= 600)) {
dead = true;
CheckStatus();
}
}
function Collide() {
var _local7 = targeted._x + (targeted._width / 2);
var _local6 = targeted._y + (targeted._height / 2);
var _local3 = 0;
while (_local3 < _global.asteroids.length) {
if ((_global.asteroids[_local3].dead == false) && ((targeted._y - _global.asteroids[_local3].targeted._y) <= 40)) {
var _local5 = _global.asteroids[_local3].targeted._x + (_global.asteroids[_local3].targeted._width / 2);
var _local4 = _global.asteroids[_local3].targeted._y + (_global.asteroids[_local3].targeted._height / 2);
if (Math.sqrt(Math.pow(_local7 - _local5, 2) + Math.pow(_local6 - _local4, 2)) <= 40) {
if (((targeted._x + xVec) + targeted._width) >= (_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec)) {
if ((targeted._x + xVec) <= ((_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec) + _global.asteroids[_local3].targeted._width)) {
if (((targeted._y + yVec) + targeted._height) >= (_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec)) {
if ((targeted._y + yVec) <= ((_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec) + _global.asteroids[_local3].targeted._height)) {
_global.asteroids[_local3].ModHealth(20, _local3);
_global.asteroids[_local3].Hit(xVec / 2, yVec / 2);
CreateEffect(_local7, _local6);
dead = true;
break;
}
}
}
}
}
}
_local3++;
}
}
function CheckStatus() {
if (dead == true) {
removeMovieClip(targeted);
delete targeted;
}
}
function CreateEffect(xPos, yPos) {
_global.effects[_global.effects.length] = new Effect("bomb0", xPos + xVec, yPos + yVec, true, true, targeted);
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 577 MovieClip [__Packages.ClusterMissile] Frame 0
class ClusterMissile implements Projectile
{
var destinationY, dead, constantSpeed, targeted, yVec, xVec;
function ClusterMissile (posX, posY, rot) {
destinationY = _root._ymouse;
dead = false;
constantSpeed = 8;
_root.gameScreen.attachMovie("w4", "w4" + _global.depth, _global.depth);
targeted = _root.gameScreen["w4" + _global.depth];
targeted._x = posX;
targeted._y = posY;
_global.depth++;
targeted._rotation = rot;
rot = (rot * Math.PI) / 180;
yVec = Math.sin(rot) * constantSpeed;
xVec = Math.cos(rot) * constantSpeed;
}
function Run() {
UpdateSpeed();
Collide();
CheckStatus();
targeted._x = targeted._x + xVec;
targeted._y = targeted._y + yVec;
if (((((targeted._x + targeted._width) <= 0) || (targeted._x >= 600)) || (targeted._y <= -15)) || (targeted._y >= 600)) {
dead = true;
CheckStatus();
}
}
function UpdateSpeed() {
var _local2;
constantSpeed = constantSpeed + 0.4;
_local2 = targeted._rotation;
_local2 = (_local2 * Math.PI) / 180;
yVec = Math.sin(_local2) * constantSpeed;
xVec = Math.cos(_local2) * constantSpeed;
}
function Collide() {
var _local5 = targeted._x + (targeted._width / 2);
var _local4 = targeted._y + (targeted._height / 2);
if (_local4 <= destinationY) {
dead = true;
_global.missiles[_global.missiles.length] = new MiniMissile(_local5, _local4, targeted._rotation);
_global.missiles[_global.missiles.length] = new MiniMissile(_local5, _local4, targeted._rotation);
_global.missiles[_global.missiles.length] = new MiniMissile(_local5, _local4, targeted._rotation);
_global.missiles[_global.missiles.length] = new MiniMissile(_local5, _local4, targeted._rotation);
_global.missiles[_global.missiles.length] = new MiniMissile(_local5, _local4, targeted._rotation);
CreateEffect(_local5, _local4);
} else {
var _local3 = 0;
while (_local3 < _global.asteroids.length) {
if ((_global.asteroids[_local3].dead == false) && ((targeted._y - _global.asteroids[_local3].targeted._y) <= 40)) {
var _local7 = _global.asteroids[_local3].targeted._x + (_global.asteroids[_local3].targeted._width / 2);
var _local6 = _global.asteroids[_local3].targeted._y + (_global.asteroids[_local3].targeted._height / 2);
if (Math.sqrt(Math.pow(_local5 - _local7, 2) + Math.pow(_local4 - _local6, 2)) <= 40) {
if (((targeted._x + xVec) + targeted._width) >= (_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec)) {
if ((targeted._x + xVec) <= ((_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec) + _global.asteroids[_local3].targeted._width)) {
if (((targeted._y + yVec) + targeted._height) >= (_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec)) {
if ((targeted._y + yVec) <= ((_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec) + _global.asteroids[_local3].targeted._height)) {
_global.asteroids[_local3].ModHealth(25, _local3);
_global.asteroids[_local3].Hit(xVec / 2, yVec / 2);
dead = true;
_global.missiles[_global.missiles.length] = new MiniMissile(_local5, _local4, targeted._rotation);
_global.missiles[_global.missiles.length] = new MiniMissile(_local5, _local4, targeted._rotation);
_global.missiles[_global.missiles.length] = new MiniMissile(_local5, _local4, targeted._rotation);
_global.missiles[_global.missiles.length] = new MiniMissile(_local5, _local4, targeted._rotation);
_global.missiles[_global.missiles.length] = new MiniMissile(_local5, _local4, targeted._rotation);
CreateEffect(_local5, _local4);
break;
}
}
}
}
}
}
_local3++;
}
}
}
function CheckStatus() {
if (dead == true) {
removeMovieClip(targeted);
delete targeted;
}
}
function CreateEffect(xPos, yPos) {
var _local3 = new Object();
_local3.x = targeted.dot._x;
_local3.y = targeted.dot._y;
targeted.localToGlobal(_local3);
_global.effects[_global.effects.length] = new Effect("ClusterMissileExplosion0", _local3.x, _local3.y, true, true, targeted);
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 578 MovieClip [__Packages.MiniMissile] Frame 0
class MiniMissile implements Projectile
{
var dead, constantSpeed, targeted, yVec, xVec;
function MiniMissile (posX, posY, rot) {
dead = false;
constantSpeed = 10;
_root.gameScreen.attachMovie("w4b", "w4b" + _global.depth, _global.depth);
targeted = _root.gameScreen["w4b" + _global.depth];
targeted._x = posX;
targeted._y = posY;
_global.depth++;
targeted._rotation = (rot + random(35)) - random(35);
rot = (rot * Math.PI) / 180;
yVec = Math.sin(rot) * constantSpeed;
xVec = Math.cos(rot) * constantSpeed;
}
function Run() {
UpdateSpeed();
Collide();
CheckStatus();
targeted._x = targeted._x + xVec;
targeted._y = targeted._y + yVec;
if (((((targeted._x + targeted._width) <= 0) || (targeted._x >= 600)) || (targeted._y <= -15)) || (targeted._y >= 600)) {
dead = true;
CheckStatus();
}
}
function UpdateSpeed() {
var _local2;
constantSpeed = constantSpeed + 0.4;
_local2 = targeted._rotation;
_local2 = (_local2 * Math.PI) / 180;
yVec = Math.sin(_local2) * constantSpeed;
xVec = Math.cos(_local2) * constantSpeed;
}
function Collide() {
var _local7 = targeted._x + (targeted._width / 2);
var _local6 = targeted._y + (targeted._height / 2);
var _local3 = 0;
while (_local3 < _global.asteroids.length) {
if ((_global.asteroids[_local3].dead == false) && ((targeted._y - _global.asteroids[_local3].targeted._y) <= 40)) {
var _local5 = _global.asteroids[_local3].targeted._x + (_global.asteroids[_local3].targeted._width / 2);
var _local4 = _global.asteroids[_local3].targeted._y + (_global.asteroids[_local3].targeted._height / 2);
if (Math.sqrt(Math.pow(_local7 - _local5, 2) + Math.pow(_local6 - _local4, 2)) <= 40) {
if (((targeted._x + xVec) + targeted._width) >= (_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec)) {
if ((targeted._x + xVec) <= ((_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec) + _global.asteroids[_local3].targeted._width)) {
if (((targeted._y + yVec) + targeted._height) >= (_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec)) {
if ((targeted._y + yVec) <= ((_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec) + _global.asteroids[_local3].targeted._height)) {
_global.asteroids[_local3].ModHealth(30, _local3);
_global.asteroids[_local3].Hit(xVec / 3, yVec / 3);
CreateEffect(_local7, _local6);
dead = true;
break;
}
}
}
}
}
}
_local3++;
}
}
function CheckStatus() {
if (dead == true) {
removeMovieClip(targeted);
delete targeted;
}
}
function CreateEffect(xPos, yPos) {
var _local3 = new Object();
_local3.x = targeted.dot._x;
_local3.y = targeted.dot._y;
targeted.localToGlobal(_local3);
_global.effects[_global.effects.length] = new Effect("MiniMissileExplosion0", _local3.x, _local3.y, true, true, targeted);
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 579 MovieClip [__Packages.AntiMatterMissile] Frame 0
class AntiMatterMissile
{
var dead, constantSpeed, targeted, yVec, xVec;
function AntiMatterMissile (posX, posY, rot) {
dead = false;
constantSpeed = 12;
_root.gameScreen.attachMovie("w0", "w0" + _global.depth, _global.depth);
targeted = _root.gameScreen["w0" + _global.depth];
targeted._x = posX;
targeted._y = posY;
_global.depth++;
targeted._rotation = rot;
rot = (rot * Math.PI) / 180;
yVec = Math.sin(rot) * constantSpeed;
xVec = Math.cos(rot) * constantSpeed;
}
function Run() {
UpdateSpeed();
Collide();
CheckStatus();
targeted._x = targeted._x + xVec;
targeted._y = targeted._y + yVec;
if (((((targeted._x + targeted._width) <= 0) || (targeted._x >= 600)) || (targeted._y <= -15)) || (targeted._y >= 600)) {
dead = true;
CheckStatus();
}
}
function UpdateSpeed() {
var _local2;
constantSpeed = constantSpeed + 0.4;
_local2 = targeted._rotation;
_local2 = (_local2 * Math.PI) / 180;
yVec = Math.sin(_local2) * constantSpeed;
xVec = Math.cos(_local2) * constantSpeed;
}
function Collide() {
var _local10 = targeted._x + (targeted._width / 2);
var _local9 = targeted._y + (targeted._height / 2);
var _local4 = 0;
while (_local4 < _global.asteroids.length) {
if ((_global.asteroids[_local4].dead == false) && ((targeted._y - _global.asteroids[_local4].targeted._y) <= 45)) {
var _local8 = _global.asteroids[_local4].targeted._x + (_global.asteroids[_local4].targeted._width / 2);
var _local7 = _global.asteroids[_local4].targeted._y + (_global.asteroids[_local4].targeted._height / 2);
if (Math.sqrt(Math.pow(_local10 - _local8, 2) + Math.pow(_local9 - _local7, 2)) <= 45) {
if (((targeted._x + xVec) + targeted._width) >= (_global.asteroids[_local4].targeted._x + _global.asteroids[_local4].xVec)) {
if ((targeted._x + xVec) <= ((_global.asteroids[_local4].targeted._x + _global.asteroids[_local4].xVec) + _global.asteroids[_local4].targeted._width)) {
if (((targeted._y + yVec) + targeted._height) >= (_global.asteroids[_local4].targeted._y + _global.asteroids[_local4].yVec)) {
if ((targeted._y + yVec) <= ((_global.asteroids[_local4].targeted._y + _global.asteroids[_local4].yVec) + _global.asteroids[_local4].targeted._height)) {
CreateEffect(_local10, _local9, "m");
if (_global.asteroids[_local4].form == 0) {
CreateEffect(_local8, _local7, "a0");
}
if (_global.asteroids[_local4].form == 1) {
CreateEffect(_local8, _local7, "a1");
}
if (_global.asteroids[_local4].form == 2) {
CreateEffect(_local8, _local7, "a2");
}
_global.asteroids[_local4].ModHealth(1000, _local4);
var _local3 = 0;
while (_local3 < _global.asteroids.length) {
if ((_global.asteroids[_local3].dead == false) && (_global.asteroids[_local3] != _global.asteroids[_local4])) {
var _local5 = _global.asteroids[_local3].targeted._x + (_global.asteroids[_local3].targeted._width / 2);
var _local6 = _global.asteroids[_local3].targeted._y + (_global.asteroids[_local3].targeted._height / 2);
if (Math.sqrt(Math.pow(_local5 - _local8, 2) + Math.pow(_local6 - _local7, 2)) <= 75) {
if (_global.asteroids[_local3].form == 0) {
CreateEffect(_local5, _local6, "a0");
}
if (_global.asteroids[_local3].form == 1) {
CreateEffect(_local5, _local6, "a1");
}
if (_global.asteroids[_local3].form == 2) {
CreateEffect(_local5, _local6, "a2");
}
_global.asteroids[_local3].ModHealth(1000);
}
}
_local3++;
}
dead = true;
break;
}
}
}
}
}
}
_local4++;
}
}
function CheckStatus() {
if (dead == true) {
removeMovieClip(targeted);
delete targeted;
}
}
function CreateEffect(xPos, yPos, typ) {
if (typ == "m") {
var _local3 = new Object();
_local3.x = targeted.dot._x;
_local3.y = targeted.dot._y;
targeted.localToGlobal(_local3);
_global.effects[_global.effects.length] = new Effect("AntiMatterExplosion0", _local3.x, _local3.y, true, true, targeted);
}
if (typ == "a0") {
_global.effects[_global.effects.length] = new Effect("AntiMatterExplosion0", xPos, yPos, true, true, targeted);
}
if (typ == "a1") {
_global.effects[_global.effects.length] = new Effect("AntiMatterExplosion1", xPos, yPos, true, true, targeted);
}
if (typ == "a2") {
_global.effects[_global.effects.length] = new Effect("AntiMatterExplosion2", xPos, yPos, true, true, targeted);
}
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 580 MovieClip [__Packages.RedLaser] Frame 0
class RedLaser implements Projectile
{
var dead, constantSpeed, targeted, yVec, xVec;
function RedLaser (posX, posY, rot) {
dead = false;
constantSpeed = 18;
_root.gameScreen.attachMovie("w6", "w6" + _global.depth, _global.depth);
targeted = _root.gameScreen["w6" + _global.depth];
targeted._x = posX;
targeted._y = posY;
_global.depth++;
targeted._rotation = rot;
rot = (rot * Math.PI) / 180;
yVec = Math.sin(rot) * constantSpeed;
xVec = Math.cos(rot) * constantSpeed;
}
function Run() {
Collide();
CheckStatus();
targeted._x = targeted._x + xVec;
targeted._y = targeted._y + yVec;
if (((((targeted._x + targeted._width) <= 0) || (targeted._x >= 600)) || (targeted._y <= -15)) || (targeted._y >= 600)) {
dead = true;
CheckStatus();
}
}
function Collide() {
var _local7 = targeted._x + (targeted._width / 2);
var _local6 = targeted._y + (targeted._height / 2);
var _local3 = 0;
while (_local3 < _global.asteroids.length) {
if ((_global.asteroids[_local3].dead == false) && ((targeted._y - _global.asteroids[_local3].targeted._y) <= 40)) {
var _local5 = _global.asteroids[_local3].targeted._x + (_global.asteroids[_local3].targeted._width / 2);
var _local4 = _global.asteroids[_local3].targeted._y + (_global.asteroids[_local3].targeted._height / 2);
if (Math.sqrt(Math.pow(_local7 - _local5, 2) + Math.pow(_local6 - _local4, 2)) <= 40) {
if (((targeted._x + xVec) + targeted._width) >= (_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec)) {
if ((targeted._x + xVec) <= ((_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec) + _global.asteroids[_local3].targeted._width)) {
if (((targeted._y + yVec) + targeted._height) >= (_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec)) {
if ((targeted._y + yVec) <= ((_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec) + _global.asteroids[_local3].targeted._height)) {
_global.asteroids[_local3].ModHealth(25, _local3);
_global.asteroids[_local3].Hit(xVec / 4, yVec / 4);
CreateEffect(_local7, _local6);
dead = true;
break;
}
}
}
}
}
}
_local3++;
}
}
function CheckStatus() {
if (dead == true) {
removeMovieClip(targeted);
delete targeted;
}
}
function CreateEffect(xPos, yPos) {
_global.effects[_global.effects.length] = new Effect("RedBoom0", xPos + xVec, yPos + yVec, false, true, targeted);
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 581 MovieClip [__Packages.BlueLaser] Frame 0
class BlueLaser implements Projectile
{
var dead, constantSpeed, targeted, yVec, xVec;
function BlueLaser (posX, posY, rot) {
dead = false;
constantSpeed = 20;
_root.gameScreen.attachMovie("w1", "w1" + _global.depth, _global.depth);
targeted = _root.gameScreen["w1" + _global.depth];
targeted._x = posX;
targeted._y = posY;
_global.depth++;
targeted._rotation = rot;
rot = (rot * Math.PI) / 180;
yVec = Math.sin(rot) * constantSpeed;
xVec = Math.cos(rot) * constantSpeed;
}
function Run() {
Collide();
CheckStatus();
targeted._x = targeted._x + xVec;
targeted._y = targeted._y + yVec;
if (((((targeted._x + targeted._width) <= 0) || (targeted._x >= 600)) || (targeted._y <= -15)) || (targeted._y >= 600)) {
dead = true;
CheckStatus();
}
}
function Collide() {
var _local7 = targeted._x + (targeted._width / 2);
var _local6 = targeted._y + (targeted._height / 2);
var _local3 = 0;
while (_local3 < _global.asteroids.length) {
if ((_global.asteroids[_local3].dead == false) && ((targeted._y - _global.asteroids[_local3].targeted._y) <= 45)) {
var _local5 = _global.asteroids[_local3].targeted._x + (_global.asteroids[_local3].targeted._width / 2);
var _local4 = _global.asteroids[_local3].targeted._y + (_global.asteroids[_local3].targeted._height / 2);
if (Math.sqrt(Math.pow(_local7 - _local5, 2) + Math.pow(_local6 - _local4, 2)) <= 45) {
if (((targeted._x + xVec) + targeted._width) >= (_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec)) {
if ((targeted._x + xVec) <= ((_global.asteroids[_local3].targeted._x + _global.asteroids[_local3].xVec) + _global.asteroids[_local3].targeted._width)) {
if (((targeted._y + yVec) + targeted._height) >= (_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec)) {
if ((targeted._y + yVec) <= ((_global.asteroids[_local3].targeted._y + _global.asteroids[_local3].yVec) + _global.asteroids[_local3].targeted._height)) {
_global.asteroids[_local3].ModHealth(35, _local3);
_global.asteroids[_local3].Hit(xVec / 4.25, yVec / 4.25);
CreateEffect(_local7, _local6);
dead = true;
break;
}
}
}
}
}
}
_local3++;
}
}
function CheckStatus() {
if (dead == true) {
removeMovieClip(targeted);
delete targeted;
}
}
function CreateEffect(xPos, yPos) {
_global.effects[_global.effects.length] = new Effect("BlueBoom0", xPos + xVec, yPos + yVec, false, true, targeted);
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 582 MovieClip [__Packages.Turret] Frame 0
class Turret
{
var tracer, targeted, turretEnabled, fireRate, targetEnemy, fireTimer;
function Turret (tar, tra) {
tracer = tra;
targeted = tar;
turretEnabled = false;
fireRate = 250;
targetEnemy = "none";
fireTimer = getTimer();
}
function Run() {
if (turretEnabled == true) {
if (((targetEnemy == undefined) || (targetEnemy.dead == true)) || (targetEnemy == "none")) {
Hide();
targetEnemy = "none";
Search();
} else {
Track();
}
}
}
function Search() {
var _local4 = 0;
if (_global.sensors == 0) {
_local4 = 430;
}
if (_global.sensors == 1) {
_local4 = 335;
}
if (_global.sensors == 2) {
_local4 = 225;
}
if (_global.sensors == 3) {
_local4 = 120;
}
if (_global.sensors == 4) {
_local4 = 10;
}
var _local3 = 0;
while (_local3 < _global.asteroids.length) {
if (_global.asteroids[_local3].targeted._y >= _local4) {
targetEnemy = _global.asteroids[_local3];
Track();
break;
}
_local3++;
}
}
function Track() {
var _local3;
tracer._visible = true;
tracer._x = targetEnemy.targeted._x + (targetEnemy.targeted._width / 2);
tracer._y = targetEnemy.targeted._y + (targetEnemy.targeted._height / 2);
if ((getTimer() - fireTimer) >= fireRate) {
_local3 = (Math.atan2((targetEnemy.targeted._y + (targetEnemy.yVec * 6)) - targeted._y, ((targetEnemy.targeted._x + targetEnemy.xVec) - targeted._x) * 1.2) * 180) / 3.14;
targeted.dome.gotoAndPlay(2);
if (_global.sound == 1) {
_global.laser.start(0, 1);
}
_global.bullets[_global.bullets.length] = new RedLaser(targeted._x, targeted._y, _local3);
fireTimer = getTimer();
}
}
function Hide() {
tracer._visible = false;
}
function Enable() {
turretEnabled = true;
targeted._visible = true;
}
}
Symbol 583 MovieClip [__Packages.Turret2] Frame 0
class Turret2
{
var tracer, targeted, turretEnabled, fireRate, targetEnemy, fireTimer;
function Turret2 (tar, tra) {
tracer = tra;
targeted = tar;
turretEnabled = false;
fireRate = 250;
targetEnemy = "none";
fireTimer = getTimer();
}
function Run() {
if (turretEnabled == true) {
if (((targetEnemy == undefined) || (targetEnemy.dead == true)) || (targetEnemy == "none")) {
Hide();
targetEnemy = "none";
Search();
} else {
Track();
}
}
}
function Search() {
var _local4 = 0;
if (_global.sensors == 0) {
_local4 = 430;
}
if (_global.sensors == 1) {
_local4 = 335;
}
if (_global.sensors == 2) {
_local4 = 225;
}
if (_global.sensors == 3) {
_local4 = 120;
}
if (_global.sensors == 4) {
_local4 = 10;
}
var _local3 = _global.asteroids.length - 1;
while (_local3 >= 0) {
if (_global.asteroids[_local3].targeted._y >= _local4) {
targetEnemy = _global.asteroids[_local3];
Track();
break;
}
_local3--;
}
}
function Track() {
var _local3;
tracer._visible = true;
tracer._x = targetEnemy.targeted._x + (targetEnemy.targeted._width / 2);
tracer._y = targetEnemy.targeted._y + (targetEnemy.targeted._height / 2);
if ((getTimer() - fireTimer) >= fireRate) {
_local3 = (Math.atan2((targetEnemy.targeted._y + (targetEnemy.yVec * 6)) - targeted._y, ((targetEnemy.targeted._x + targetEnemy.xVec) - targeted._x) * 1.2) * 180) / 3.14;
targeted.dome.gotoAndPlay(2);
if (_global.sound == 1) {
_global.laser.start(0, 1);
}
_global.bullets[_global.bullets.length] = new RedLaser(targeted._x, targeted._y, _local3);
fireTimer = getTimer();
}
}
function Hide() {
tracer._visible = false;
}
function Enable() {
turretEnabled = true;
targeted._visible = true;
}
}
Symbol 584 MovieClip [__Packages.Asteroid] Frame 0
class Asteroid
{
var dead, xVec, form, health, yVec, targeted;
function Asteroid (fo, xPos, yPos) {
dead = false;
xVec = 0;
form = fo;
if (_global.level <= 2) {
health = 110 * (fo + 1);
yVec = Math.random() * 1.5;
}
if (_global.level >= 9) {
health = 155 * (fo + 1);
yVec = Math.random() * 1.65;
}
if (_global.level >= 15) {
health = 180 * (fo + 1);
yVec = Math.random() * 1.9;
} else {
health = 150 * (fo + 1);
yVec = Math.random() * 1.5;
}
_root.gameScreen.attachMovie("asteroid" + fo, "ast" + _global.depth, _global.depth);
targeted = _root.gameScreen["ast" + _global.depth];
targeted._x = xPos;
targeted._y = yPos;
_global.depth++;
}
function Run() {
yVec = yVec + 0.0168;
targeted._y = targeted._y + yVec;
targeted._x = targeted._x + xVec;
if ((((targeted._x + targeted._width) <= 0) || (targeted._x >= 600)) && (dead == false)) {
ModHealth(500);
}
if (((targeted._y + targeted._height) >= 583) && (dead == false)) {
_global.health = _global.health - ((form + 1) * 15);
_global.effects[_global.effects.length] = new Effect("deliverExplosion", (targeted._x + (targeted._width / 2)) + xVec, (targeted._y + (targeted._height / 2)) + yVec, false, false, targeted);
Remove2();
}
if (((yVec >= 2) && (targeted._y >= 340)) && (random(5) == 0)) {
_global.effects[_global.effects.length] = new Effect("particle0", ((targeted._x + ((targeted._width / 2) + xVec)) + random(15)) - random(15), (targeted._y + (targeted._height / 2)) + yVec, false, false, targeted);
}
if (targeted._y >= 310) {
targeted.gotoAndStop(2);
if (targeted._y >= 360) {
targeted.gotoAndStop(3);
}
if (targeted._y >= 420) {
targeted.gotoAndStop(4);
}
}
}
function Remove2() {
if (_global.sound == 1) {
if (form == 0) {
_global.explode0.start(0, 1);
}
if (form == 1) {
_global.explode1.start(0, 1);
}
if (form == 2) {
_global.explode2.start(0, 1);
}
}
removeMovieClip(targeted);
_root.UpdateInfoWindow();
dead = true;
_global.roundKills++;
delete targeted;
}
function ModHealth(amount, element) {
health = health - amount;
if (health <= 0) {
_global.cash = _global.cash + ((form + 1) * 50);
_global.score = _global.score + ((form + 1) * 500);
_root.UpdateInfoWindow();
dead = true;
}
CheckStatus(element);
}
function Hit(amountX, amountY) {
xVec = xVec + (amountX / ((form + 1) * 6));
yVec = yVec + (amountY / ((form + 1) * 6));
}
function CheckStatus(element) {
if (dead == true) {
trace("checking : " + _global.asteroids.length);
_global.asteroids.splice(element, 1);
trace("killing : " + _global.asteroids.length);
_global.roundKills++;
_global.effects[_global.effects.length] = new Effect(("a" + form) + "Explode", (targeted._x + (targeted._width / 2)) + xVec, (targeted._y + (targeted._height / 2)) + yVec, false, true, targeted);
removeMovieClip(targeted);
delete targeted;
if (_global.sound == 1) {
if (form == 0) {
_global.explode0.start(0, 1);
}
if (form == 1) {
_global.explode1.start(0, 1);
}
if (form == 2) {
_global.explode2.start(0, 1);
}
}
}
}
function Remove() {
removeMovieClip(targeted);
delete targeted;
dead = true;
}
}
Symbol 21 MovieClip Frame 20
_root.gotoAndPlay(5);
Symbol 25 MovieClip [asteroid2] Frame 1
stop();
Symbol 25 MovieClip [asteroid2] Frame 2
stop();
Symbol 25 MovieClip [asteroid2] Frame 3
stop();
Symbol 25 MovieClip [asteroid2] Frame 4
stop();
Symbol 57 MovieClip [a2Explode] Frame 1
done = false;
Symbol 57 MovieClip [a2Explode] Frame 26
done = true;
stop();
Symbol 61 MovieClip [asteroid1] Frame 1
stop();
Symbol 61 MovieClip [asteroid1] Frame 2
stop();
Symbol 61 MovieClip [asteroid1] Frame 3
stop();
Symbol 61 MovieClip [asteroid1] Frame 4
stop();
Symbol 92 MovieClip [a1Explode] Frame 1
done = false;
Symbol 92 MovieClip [a1Explode] Frame 26
done = true;
stop();
Symbol 96 MovieClip [asteroid0] Frame 1
stop();
Symbol 96 MovieClip [asteroid0] Frame 2
stop();
Symbol 96 MovieClip [asteroid0] Frame 3
stop();
Symbol 96 MovieClip [asteroid0] Frame 4
stop();
Symbol 117 MovieClip [a0Explode] Frame 1
done = false;
Symbol 117 MovieClip [a0Explode] Frame 21
done = true;
stop();
Symbol 132 MovieClip [deliverExplosion] Frame 1
done = false;
Symbol 132 MovieClip [deliverExplosion] Frame 53
done = true;
stop();
Symbol 147 MovieClip [AntiMatterExplosion0] Frame 1
done = false;
Symbol 147 MovieClip [AntiMatterExplosion0] Frame 26
done = true;
stop();
Symbol 148 MovieClip [AntiMatterExplosion1] Frame 1
done = false;
Symbol 148 MovieClip [AntiMatterExplosion1] Frame 26
done = true;
stop();
Symbol 149 MovieClip [AntiMatterExplosion2] Frame 1
done = false;
Symbol 149 MovieClip [AntiMatterExplosion2] Frame 26
done = true;
stop();
Symbol 154 MovieClip [bomb0] Frame 1
done = false;
Symbol 154 MovieClip [bomb0] Frame 16
done = true;
stop();
Symbol 162 MovieClip [clusterBombExplosion0] Frame 1
done = false;
Symbol 162 MovieClip [clusterBombExplosion0] Frame 24
done = true;
stop();
Symbol 167 MovieClip [ClusterMissileExplosion0] Frame 1
done = false;
Symbol 167 MovieClip [ClusterMissileExplosion0] Frame 15
done = true;
stop();
Symbol 172 MovieClip [MiniMissileExplosion0] Frame 1
done = false;
Symbol 172 MovieClip [MiniMissileExplosion0] Frame 15
done = true;
stop();
Symbol 176 MovieClip [MissileExplosion0] Frame 1
done = false;
Symbol 176 MovieClip [MissileExplosion0] Frame 15
done = true;
stop();
Symbol 177 MovieClip Frame 1
done = false;
Symbol 177 MovieClip Frame 21
done = true;
stop();
Symbol 181 MovieClip [BlueBoom0] Frame 1
done = false;
Symbol 181 MovieClip [BlueBoom0] Frame 22
done = true;
stop();
Symbol 185 MovieClip [RedBoom0] Frame 1
done = false;
Symbol 185 MovieClip [RedBoom0] Frame 22
done = true;
stop();
Symbol 189 MovieClip [sparks0] Frame 1
done = false;
Symbol 189 MovieClip [sparks0] Frame 15
done = true;
stop();
Symbol 213 MovieClip [barrelBoom] Frame 1
done = false;
Symbol 213 MovieClip [barrelBoom] Frame 3
done = true;
stop();
Symbol 217 MovieClip [particle0] Frame 1
done = false;
Symbol 217 MovieClip [particle0] Frame 30
done = true;
stop();
Symbol 250 MovieClip Frame 127
stop();
Symbol 254 MovieClip Frame 291
_global.gameMusic.start(0, 99999);
_root.gotoAndPlay(7);
Symbol 267 MovieClip Frame 1
stop();
Symbol 267 MovieClip Frame 8
gotoAndStop (1);
Symbol 269 MovieClip Frame 1
turret0b = new TurretB(at0, ai0);
turret1b = new Turret2B(at1, ai1);
_global.lasers = new Array();
_global.effects = new Array();
_global.asteroids = new Array();
_global.depth = 0;
counter = 0;
Symbol 269 MovieClip Frame 2
counter++;
t = 0;
while (t < _global.lasers.length) {
_global.lasers[t].Run();
if (_global.lasers[t].dead == true) {
_global.lasers.splice(t, 1);
}
t++;
}
t = 0;
while (t < _global.asteroids.length) {
_global.asteroids[t].Run();
if (_global.asteroids[t].dead == true) {
_global.asteroids.splice(t, 1);
}
t++;
}
t = 0;
while (t < _global.effects.length) {
_global.effects[t].Run();
if (_global.effects[t].dead == true) {
_global.effects.splice(t, 1);
}
t++;
}
turret0b.Run();
turret1b.Run();
if (counter == 220) {
counter = 0;
_global.asteroids[_global.asteroids.length] = new AsteroidB(2, 465, random(400) + 100);
}
Symbol 269 MovieClip Frame 3
gotoAndPlay (2);
Symbol 278 Button
on (release) {
getURL ((("http://www.heavygames.com/index.asp?gameid=globaldefensesystem&aid=" + _root.GetUrlParam(_url, "aid=")) + "&refer=") + _root.GetBaseUrl(_url), "_blank");
}
Symbol 283 Button
on (release) {
gotoAndPlay (181);
}
Symbol 287 Button
on (release) {
gotoAndPlay (91);
}
Symbol 291 Button
on (release) {
gotoAndPlay (2);
}
Symbol 295 Button
on (release) {
_root.gotoAndPlay(10);
}
Symbol 322 Button
on (release) {
gotoAndPlay (46);
}
Symbol 323 Button
on (release) {
if (_root._quality == "HIGH") {
_root._quality = "MEDIUM";
_root.mainMenuContent.quality._alpha = 66;
} else if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
_root.mainMenuContent.quality._alpha = 33;
} else {
_root._quality = "HIGH";
_root.mainMenuContent.quality._alpha = 100;
}
}
Symbol 324 Button
on (release) {
if (_global.autoquality == 0) {
_global.autoquality = 1;
_root.mainMenuContent.Aquality._alpha = 100;
} else {
_global.autoquality = 0;
_root.mainMenuContent.Aquality._alpha = 50;
}
}
Symbol 325 Button
on (release) {
if (_global.music == 0) {
_global.music = 1;
_global.gameMusic.start(0, 9999);
_root.mainMenuContent.music._alpha = 100;
} else {
_global.music = 0;
_global.gameMusic.stop();
_root.mainMenuContent.music._alpha = 50;
}
}
Symbol 326 Button
on (release) {
if (_global.sound == 0) {
_global.sound = 1;
_root.mainMenuContent.sound._alpha = 100;
} else {
_global.sound = 0;
_root.mainMenuContent.sound._alpha = 50;
}
}
Symbol 330 Button
on (release) {
gotoAndPlay (136);
}
Symbol 339 MovieClip Frame 1
stop();
Symbol 339 MovieClip Frame 23
Symbol 339 MovieClip Frame 45
if (_root._quality == "LOW") {
quality._alpha = 33;
}
if (_root._quality == "MEDIUM") {
quality._alpha = 66;
}
if (_root._quality == "HIGH") {
quality._alpha = 100;
}
if (_global.sound == 0) {
sound._alpha = 50;
}
if (_global.sound == 1) {
sound._alpha = 100;
}
if (_global.music == 0) {
music._alpha = 50;
}
if (_global.music == 1) {
music._alpha = 100;
}
if (_global.autoquality == 0) {
Aquality._alpha = 50;
}
if (_global.autoquality == 1) {
Aquality._alpha = 100;
}
stop();
Symbol 339 MovieClip Frame 46
if (_root._quality == "LOW") {
quality._alpha = 33;
}
if (_root._quality == "MEDIUM") {
quality._alpha = 66;
}
if (_root._quality == "HIGH") {
quality._alpha = 100;
}
if (_global.sound == 0) {
sound._alpha = 50;
}
if (_global.sound == 1) {
sound._alpha = 100;
}
if (_global.music == 0) {
music._alpha = 50;
}
if (_global.music == 1) {
music._alpha = 100;
}
if (_global.autoquality == 0) {
Aquality._alpha = 50;
}
if (_global.autoquality == 1) {
Aquality._alpha = 100;
}
Symbol 339 MovieClip Frame 60
if (_root._quality == "LOW") {
quality._alpha = 33;
}
if (_root._quality == "MEDIUM") {
quality._alpha = 66;
}
if (_root._quality == "HIGH") {
quality._alpha = 100;
}
if (_global.sound == 0) {
sound._alpha = 50;
}
if (_global.sound == 1) {
sound._alpha = 100;
}
if (_global.music == 0) {
music._alpha = 50;
}
if (_global.music == 1) {
music._alpha = 100;
}
if (_global.autoquality == 0) {
Aquality._alpha = 50;
}
if (_global.autoquality == 1) {
Aquality._alpha = 100;
}
Symbol 339 MovieClip Frame 90
gotoAndStop (1);
Symbol 339 MovieClip Frame 135
stop();
Symbol 339 MovieClip Frame 180
gotoAndStop (1);
Symbol 339 MovieClip Frame 420
gotoAndStop (1);
Symbol 349 Button
on (release) {
getURL ((("http://www.heavygames.com/index.asp?gameid=globaldefensesystem&aid=" + _root.GetUrlParam(_url, "aid=")) + "&refer=") + _root.GetBaseUrl(_url), "_blank");
}
Symbol 353 Button
on (release) {
getURL ("http://www.HeavyGames.com/free_content/index.asp ", "_blank");
}
Symbol 356 MovieClip Frame 20
stop();
Symbol 383 Button
on (release) {
if ((_root.platform1.platformEnabled == false) && (_global.cash >= 600)) {
_global.cash = _global.cash - 600;
_root.platform1.Enable();
_root.UpdateInfoWindow();
_global.selectedPlatform = _root.platform1;
} else {
sen0._visible = false;
sen1._visible = false;
sen2._visible = false;
sen3._visible = false;
s0Button._visible = false;
s1Button._visible = false;
s2Button._visible = false;
s3Button._visible = false;
ammoSelectWindow._visible = true;
_global.selectedPlatform = _root.platform1;
}
}
on (rollOver) {
if (_root.platform1.platformEnabled == false) {
costText.text = "600";
}
}
on (rollOut) {
costText.text = "0";
}
Symbol 387 Button
on (release) {
if ((_root.turret0.turretEnabled == false) && (_global.cash >= 4000)) {
_global.cash = _global.cash - 4000;
_root.turret0.Enable();
_root.UpdateInfoWindow();
_root.upgradeScreen.w1Button._visible = false;
}
}
on (rollOver) {
costText.text = "4000";
}
on (rollOut) {
costText.text = "0";
}
Symbol 388 Button
on (release) {
if ((_root.turret1.turretEnabled == false) && (_global.cash >= 4000)) {
_global.cash = _global.cash - 4000;
_root.turret1.Enable();
_root.UpdateInfoWindow();
_root.upgradeScreen.w2Button._visible = false;
}
}
on (rollOver) {
costText.text = "4000";
}
on (rollOut) {
costText.text = "0";
}
Symbol 389 Button
on (release) {
sen0._visible = false;
sen1._visible = false;
sen2._visible = false;
sen3._visible = false;
s0Button._visible = false;
s1Button._visible = false;
s2Button._visible = false;
s3Button._visible = false;
ammoSelectWindow._visible = true;
_global.selectedPlatform = _root.platform0;
}
Symbol 390 Button
on (release) {
if ((_root.platform2.platformEnabled == false) && (_global.cash >= 600)) {
_global.cash = _global.cash - 600;
_root.platform2.Enable();
_root.UpdateInfoWindow();
_global.selectedPlatform = _root.platform2;
} else {
sen0._visible = false;
sen1._visible = false;
sen2._visible = false;
sen3._visible = false;
s0Button._visible = false;
s1Button._visible = false;
s2Button._visible = false;
s3Button._visible = false;
ammoSelectWindow._visible = true;
_global.selectedPlatform = _root.platform2;
}
}
on (rollOver) {
if (_root.platform2.platformEnabled == false) {
costText.text = "600";
}
}
on (rollOut) {
costText.text = "0";
}
Symbol 395 Button
on (release) {
if (_global.cash >= 300) {
_global.cash = _global.cash - 300;
_global.sensors = 1;
_root.UpdateInfoWindow();
_root.UpdateSensors();
}
}
on (rollOver) {
costText.text = "300";
}
on (rollOut) {
costText.text = "0";
}
Symbol 396 Button
on (release) {
if (_global.cash >= 1800) {
_global.cash = _global.cash - 1800;
_global.sensors = 3;
_root.UpdateInfoWindow();
_root.UpdateSensors();
}
}
on (rollOver) {
costText.text = "1800";
}
on (rollOut) {
costText.text = "0";
}
Symbol 397 Button
on (release) {
if (_global.cash >= 700) {
_global.cash = _global.cash - 700;
_global.sensors = 2;
_root.UpdateInfoWindow();
_root.UpdateSensors();
}
}
on (rollOver) {
costText.text = "700";
}
on (rollOut) {
costText.text = "0";
}
Symbol 401 Button
on (release) {
if (_global.health < 100) {
_global.health = _global.health + 2;
if (_global.health > 100) {
_global.health = 100;
}
}
ammoSelectWindow._visible = false;
_global.selectedPlatform = "none";
_global.level++;
_global.gamePaused = "off";
_root.upgradeScreen._visible = false;
_root.pauseFade._visible = false;
_root.nextLevel.levelz.levelText.text = _global.level;
_root.nextLevel.gotoAndPlay(2);
sen0._visible = true;
sen1._visible = true;
sen2._visible = true;
sen3._visible = true;
s0Button._visible = true;
s1Button._visible = true;
s2Button._visible = true;
s3Button._visible = true;
_root.UpdateInfoWindow();
_root.UpdateSensors();
if ((_global.autoquality == 1) && (_global.level == 7)) {
_root._quality = "low";
}
_root.sideBar.pauseButtonS._visible = true;
if (_global.level >= 14) {
_global.optmizeThreshold = 5;
}
}
Symbol 405 Button
on (release) {
if (_global.cash >= 4000) {
_global.cash = _global.cash - 4000;
_global.sensors = 4;
_root.UpdateInfoWindow();
_root.UpdateSensors();
}
}
on (rollOver) {
costText.text = "4000";
}
on (rollOut) {
costText.text = "0";
}
Symbol 414 MovieClip Frame 1
stop();
Symbol 414 MovieClip Frame 2
stop();
Symbol 421 Button
on (release) {
_root.upgradeScreen.ammoSelectWindow._visible = false;
_global.selectedPlatform = "none";
_root.UpdateSensors();
}
Symbol 435 Button
on (release) {
if (_global.cash >= 400) {
_global.cash = _global.cash - 400;
_global.selectedPlatform.AddMainWeapon("w2");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "400";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 438 Button
on (release) {
if (_global.cash >= 650) {
_global.cash = _global.cash - 650;
_global.selectedPlatform.AddMainWeapon("w5");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "650";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 441 Button
on (release) {
if (_global.cash >= 1400) {
_global.cash = _global.cash - 1400;
_global.selectedPlatform.AddMainWeapon("w3");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "1400";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 443 Button
on (release) {
if (_global.cash >= 1700) {
_global.cash = _global.cash - 1700;
_global.selectedPlatform.AddMainWeapon("w4");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "1700";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 446 Button
on (release) {
if (_global.cash >= 7000) {
_global.cash = _global.cash - 7000;
_global.selectedPlatform.AddMainWeapon("w6");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "7000";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 449 Button
on (release) {
if (_global.cash >= 5000) {
_global.cash = _global.cash - 5000;
_global.selectedPlatform.AddMainWeapon("w0");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "5000";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 452 Button
on (release) {
if (_global.cash >= 10000) {
_global.cash = _global.cash - 10000;
_global.selectedPlatform.AddMainWeapon("w1");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "10000";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 455 Button
on (release) {
if (_global.cash >= 400) {
_global.cash = _global.cash - 400;
_global.selectedPlatform.AddSecondaryWeapon("w2");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "400";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 456 Button
on (release) {
if (_global.cash >= 650) {
_global.cash = _global.cash - 650;
_global.selectedPlatform.AddSecondaryWeapon("w5");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "650";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 457 Button
on (release) {
if (_global.cash >= 1400) {
_global.cash = _global.cash - 1400;
_global.selectedPlatform.AddSecondaryWeapon("w3");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "1400";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 458 Button
on (release) {
if (_global.cash >= 1700) {
_global.cash = _global.cash - 1700;
_global.selectedPlatform.AddSecondaryWeapon("w4");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "1700";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 459 Button
on (release) {
if (_global.cash >= 7000) {
_global.cash = _global.cash - 7000;
_global.selectedPlatform.AddSecondaryWeapon("w6");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "7000";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 460 Button
on (release) {
if (_global.cash >= 5000) {
_global.cash = _global.cash - 5000;
_global.selectedPlatform.AddSecondaryWeapon("w0");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "5000";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 461 Button
on (release) {
if (_global.cash >= 10000) {
_global.cash = _global.cash - 10000;
_global.selectedPlatform.AddSecondaryWeapon("w1");
_root.UpdateInfoWindow();
}
}
on (rollOver) {
_root.upgradeScreen.costText.text = "10000";
}
on (rollOut) {
_root.upgradeScreen.costText.text = "0";
}
Symbol 464 MovieClip Frame 1
prim.b0._visible = true;
prim.b1._visible = true;
prim.b2._visible = true;
prim.b3._visible = true;
prim.b4._visible = true;
prim.b5._visible = true;
prim.b6._visible = true;
seco.b0._visible = true;
seco.b1._visible = true;
seco.b2._visible = true;
seco.b3._visible = true;
seco.b4._visible = true;
seco.b5._visible = true;
seco.b6._visible = true;
if (_global.selectedPlatform != "none") {
switch (_global.selectedPlatform.mainWeapon) {
case "Sledge Rounds" :
prim.b0._visible = false;
break;
case "Missiles" :
prim.b1._visible = false;
break;
case "Cluster Bombs" :
prim.b2._visible = false;
break;
case "Cluster Missiles" :
prim.b3._visible = false;
break;
case "Antimatter Missiles" :
prim.b4._visible = false;
break;
case "Red Lasers" :
prim.b5._visible = false;
break;
case "Blue Lasers" :
prim.b6._visible = false;
}
switch (_global.selectedPlatform.secondaryWeapon) {
case "Sledge Rounds" :
seco.b0._visible = false;
break;
case "Missiles" :
seco.b1._visible = false;
break;
case "Cluster Bombs" :
seco.b2._visible = false;
break;
case "Cluster Missiles" :
seco.b3._visible = false;
break;
case "Antimatter Missiles" :
seco.b4._visible = false;
break;
case "Red Lasers" :
seco.b5._visible = false;
break;
case "Blue Lasers" :
seco.b6._visible = false;
}
}
Symbol 464 MovieClip Frame 2
prim.b0._visible = true;
prim.b1._visible = true;
prim.b2._visible = true;
prim.b3._visible = true;
prim.b4._visible = true;
prim.b5._visible = true;
prim.b6._visible = true;
seco.b0._visible = true;
seco.b1._visible = true;
seco.b2._visible = true;
seco.b3._visible = true;
seco.b4._visible = true;
seco.b5._visible = true;
seco.b6._visible = true;
if (_global.selectedPlatform != "none") {
switch (_global.selectedPlatform.mainWeapon) {
case "Sledge Rounds" :
prim.b0._visible = false;
break;
case "Missiles" :
prim.b1._visible = false;
break;
case "Cluster Bombs" :
prim.b2._visible = false;
break;
case "Cluster Missiles" :
prim.b3._visible = false;
break;
case "Antimatter Missiles" :
prim.b4._visible = false;
break;
case "Red Lasers" :
prim.b5._visible = false;
break;
case "Blue Lasers" :
prim.b6._visible = false;
}
switch (_global.selectedPlatform.secondaryWeapon) {
case "Sledge Rounds" :
seco.b0._visible = false;
break;
case "Missiles" :
seco.b1._visible = false;
break;
case "Cluster Bombs" :
seco.b2._visible = false;
break;
case "Cluster Missiles" :
seco.b3._visible = false;
break;
case "Antimatter Missiles" :
seco.b4._visible = false;
break;
case "Red Lasers" :
seco.b5._visible = false;
break;
case "Blue Lasers" :
seco.b6._visible = false;
}
}
Symbol 465 MovieClip Frame 1
ammoSelectWindow._visible = false;
Symbol 477 MovieClip Frame 1
stop();
Symbol 477 MovieClip Frame 2
stop();
Symbol 489 MovieClip Frame 1
stop();
Symbol 489 MovieClip Frame 70
gotoAndPlay (1);
Symbol 489 MovieClip Frame 94
gotoAndPlay (1);
Symbol 489 MovieClip Frame 108
gotoAndPlay (1);
Symbol 489 MovieClip Frame 115
gotoAndPlay (1);
Symbol 489 MovieClip Frame 118
gotoAndPlay (1);
Symbol 494 MovieClip Frame 1
stop();
Symbol 494 MovieClip Frame 101
_root.upgradeScreen._visible = true;
gotoAndStop (1);
Symbol 498 MovieClip Frame 1
stop();
Symbol 498 MovieClip Frame 101
gotoAndStop (1);
Symbol 511 MovieClip Frame 1
stop();
Symbol 511 MovieClip Frame 89
gotoAndStop (1);
Symbol 511 MovieClip Frame 112
gotoAndStop (1);
Symbol 511 MovieClip Frame 126
gotoAndStop (1);
Symbol 511 MovieClip Frame 131
gotoAndStop (1);
Symbol 511 MovieClip Frame 134
gotoAndStop (1);
Symbol 514 MovieClip Frame 1
stop();
Symbol 514 MovieClip Frame 8
gotoAndStop (1);
Symbol 521 MovieClip Frame 1
stop();
Symbol 521 MovieClip Frame 2
if (_global.sound == 1) {
_global.door.start(0, 1);
}
Symbol 521 MovieClip Frame 36
stop();
Symbol 533 Button
on (release) {
_root.gotoAndPlay(7);
}
Symbol 536 Button
on (release) {
if (_global.gamePaused == "on") {
_global.gamePaused = "off";
_root.pauseFade._visible = false;
} else {
_global.gamePaused = "on";
_root.pauseFade._visible = true;
}
}
Symbol 546 Button
on (release) {
_root.gotoAndPlay(7);
}
Symbol 552 Button
on (release) {
if ((playerName.text != "") && (_global.submitScore == false)) {
_global.submitScore = true;
var strOut = ((playerName.text + "|") + scoreF.text);
var strOut2 = EncrpytString(strOut);
getURL ("http://www.heavygames.com/globaldefensesystem/hs.asp?" + strOut2, "_blank");
_root.gotoAndPlay(7);
}
}
Symbol 560 MovieClip Frame 1
function EncrpytString(strVal) {
var _local7 = "aHfEjcDebChGiAfIjDbEjacD";
var _local8 = _local7.length;
var _local11 = "0";
var _local3 = "";
var _local9 = strVal.length;
var _local1 = 0;
_local3 = "";
var _local4;
var _local6;
var _local2;
var _local5 = 0;
nCnt = 0;
while (nCnt < _local9) {
_local4 = strVal.charCodeAt(nCnt);
if (_local4 >= 128) {
_local4 = "X";
}
_local6 = _local7.charCodeAt(_local1);
_local1 = _local1 + 1;
if (_local1 >= _local8) {
_local1 = 0;
}
_local2 = (_local4 % 16) + _local6;
_local3 = _local3 + String.fromCharCode(_local2);
_local5 = _local5 + _local2;
_local6 = _local7.charCodeAt(_local1);
_local1 = _local1 + 1;
if (_local1 >= _local8) {
_local1 = 0;
}
_local2 = Math.floor(_local4 / 16) + _local6;
_local3 = _local3 + String.fromCharCode(_local2);
_local5 = _local5 + _local2;
nCnt++;
}
_local5 = _local5 % 256;
_local6 = _local7.charCodeAt(_local1);
_local1 = _local1 + 1;
if (_local1 >= _local8) {
_local1 = 0;
}
_local2 = (_local5 % 16) + _local6;
_local3 = _local3 + String.fromCharCode(_local2);
_local6 = _local7.charCodeAt(_local1);
_local1 = _local1 + 1;
if (_local1 >= _local8) {
_local1 = 0;
}
_local2 = Math.floor(_local5 / 16) + _local6;
_local3 = _local3 + String.fromCharCode(_local2);
return(_local3);
}
Symbol 561 MovieClip Frame 1
stop();
Symbol 561 MovieClip Frame 2
_global.gameMusic.setVolume(90);
Symbol 561 MovieClip Frame 3
_global.gameMusic.setVolume(80);
Symbol 561 MovieClip Frame 4
_global.gameMusic.setVolume(70);
Symbol 561 MovieClip Frame 5
_global.gameMusic.setVolume(60);
Symbol 561 MovieClip Frame 6
_global.gameMusic.setVolume(50);
Symbol 561 MovieClip Frame 7
_global.gameMusic.setVolume(40);
Symbol 561 MovieClip Frame 8
_global.gameMusic.setVolume(30);
Symbol 561 MovieClip Frame 9
_global.gameMusic.setVolume(20);
Symbol 561 MovieClip Frame 10
_global.gameMusic.setVolume(10);
Symbol 561 MovieClip Frame 11
_global.gameMusic.stop();
_global.gameMusic.setVolume(100);
Symbol 561 MovieClip Frame 30
if (_global.health > 0) {
gameOverContents.endingType.text = "You saved the world from the asteroids!";
} else {
_global.health = 0;
gameOverContents.endingType.text = "The earth has been destroyed by the asteroids.";
}
gameOverContents.remainingCash.text = _global.cash;
gameOverContents.finalHealth.text = _global.health;
gameOverContents.scoreT.text = _global.score;
gameOverContents.scoreB.text = _global.cash * _global.level;
gameOverContents.scoreP.text = (20 - _global.level) * (100 - _global.health);
gameOverContents.scoreF.text = (_global.score + (_global.cash * _global.level)) - ((20 - _global.level) * (100 - _global.health));
if (((_global.score + (_global.cash * _global.level)) - ((20 - _global.level) * (100 - _global.health))) < 0) {
gameOverContents.scoreF.text = 0;
}
Symbol 561 MovieClip Frame 40
stop();
Symbol 564 MovieClip Frame 260
stop();