Section 1
//CREDITS_17 (ndefence_fla.CREDITS_17)
package ndefence_fla {
import flash.display.*;
import flash.events.*;
public dynamic class CREDITS_17 extends MovieClip {
public var btn_ret:MovieClip;
public function CREDITS_17(){
addFrameScript(14, frame15, 24, frame25);
}
function frame15(){
stop();
btn_ret.addEventListener(MouseEvent.MOUSE_UP, func_btn_ret);
}
function frame25(){
MovieClip(parent).gotoAndStop("TITLE");
}
public function func_btn_ret(_arg1){
btn_ret.removeEventListener(MouseEvent.MOUSE_UP, func_btn_ret);
play();
}
}
}//package ndefence_fla
Section 2
//ENTIREGAME_10 (ndefence_fla.ENTIREGAME_10)
package ndefence_fla {
import flash.display.*;
public dynamic class ENTIREGAME_10 extends MovieClip {
public var graphicsRating;
public var targetFrame;
public var score;
public function ENTIREGAME_10(){
addFrameScript(0, frame1, 1, frame2, 4, frame5);
}
function frame1(){
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package ndefence_fla
Section 3
//GAMEMC_22 (ndefence_fla.GAMEMC_22)
package ndefence_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class GAMEMC_22 extends MovieClip {
public var targetObject1:MovieClip;
public var targetObject3:MovieClip;
public var graphicsRating;
public var targetObject2:MovieClip;
public var TargetPointCount;
public var TargetNum;
public var yellowGlow:GlowFilter;
public var tutorialSwitch;
public var BG;
public var healthTimer;
public var enemySpawnTimer;
public var satType;
public var turret_hyper;
public var bgStarArray;
public var health;
public var bulletSpeed;
public var i;
public var dead;
public var waveTimerStore;
public var targetSats:MovieClip;
public var TOWERS;
public var keySwitch;
public var A_wave10;
public var cursorArray;
public var TargetAdjust;
public var FPSold;
public var FPS;
public var gameFroze;
public var pauseSwitch;
public var HUD:MovieClip;
public var A_wave0;
public var A_wave1;
public var A_wave2;
public var A_wave3;
public var A_wave4;
public var A_wave5;
public var A_wave7;
public var A_wave8;
public var targetChecker:MovieClip;
public var A_wave6;
public var waveArray;
public var A_wave9;
public var money;
public var wave;
public var turret_small;
public var BULLET;
public var blueGlow:GlowFilter;
public var waveBreakStore;
public var enemyGenBalance;
public var waveAddition;
public var sound:MovieClip;
public var ii;
public var bulletCount;
public var turret_large;
public var enemyForceTimeCheck;
public var greenGlow:GlowFilter;
public var glowIndex;
public var healthSphere:MovieClip;
public var MESSAGES;
public var enemyCounter;
public var cursor:MovieClip;
public var clone;
public var waveBreakTimer;
public var deadTimer;
public var tutorial:MovieClip;
public var enemyVoidTimer;
public var whiteGlow:GlowFilter;
public var moneyPot;
public var ENEMY;
public var EFFECT;
public var planet:MovieClip;
public var cursorTrailLength;
public var turret_medium;
public var enemyForceTime;
public var planetSize;
public var mousePressed;
public var gamePaused;
public var redGlow:GlowFilter;
public var waveTimer;
public var framerate;
public var messageText;
public var waveTimerMax;
public var moneyBalance;
public function GAMEMC_22(){
addFrameScript(0, frame1);
}
public function MouseUp(_arg1){
mousePressed = false;
}
public function keySpawning(){
if (((Key.isDown(90)) && ((keySwitch == false)))){
keySwitch = true;
satType = "small";
buildTowerType("small");
} else {
if (((Key.isDown(88)) && ((keySwitch == false)))){
keySwitch = true;
satType = "medium";
buildTowerType("medium");
} else {
if (((Key.isDown(67)) && ((keySwitch == false)))){
keySwitch = true;
satType = "large";
buildTowerType("large");
} else {
if (((Key.isDown(86)) && ((keySwitch == false)))){
keySwitch = true;
satType = "hyper";
buildTowerType("hyper");
};
};
};
};
if ((((((((Key.isDown(86) == false)) && ((Key.isDown(90) == false)))) && ((Key.isDown(88) == false)))) && ((Key.isDown(67) == false)))){
keySwitch = false;
};
}
public function newMiniMessage(_arg1, _arg2, _arg3, _arg4){
var _local5:*;
_local5 = new Mini_Message();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.rotation = _arg3;
_local5.scaleX = _arg4;
EFFECT.addChild(_local5);
}
public function removeTutorial(){
gameFroze = false;
tutorial.removeEventListener(MouseEvent.MOUSE_DOWN, TutMouseDown);
removeChild(tutorial);
}
public function damagePlantUpdate(){
if (healthTimer > 0){
healthTimer--;
planet.alpha = -(planet.alpha);
healthSphere.alpha = 0.8;
} else {
planet.alpha = 1;
if (healthSphere.alpha > 0.2){
healthSphere.alpha = (healthSphere.alpha - 0.01);
} else {
healthSphere.alpha = 0.2;
};
};
}
public function TutMouseDown(_arg1){
tutorial.nextFrame();
}
public function newMessage(_arg1, _arg2, _arg3, _arg4){
var _local5:*;
messageText = _arg3;
_local5 = new MESSAGE();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.rotation = _arg4;
MESSAGES.addChild(_local5);
}
public function targetPoint(_arg1, _arg2){
this[("targetObject" + TargetNum)].x = _arg1;
this[("targetObject" + TargetNum)].y = _arg2;
if (TargetNum < TargetPointCount){
TargetNum++;
} else {
TargetNum = 1;
};
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
graphicsRating = MovieClip(parent).graphicsRating;
planetSize = 35;
Key.initialize(stage);
satType = "";
messageText = 0;
bulletSpeed = 10;
bulletCount = 0;
mousePressed = false;
tutorialSwitch = false;
gamePaused = false;
gameFroze = true;
alpha = -1;
stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
tutorial.addEventListener(MouseEvent.MOUSE_DOWN, TutMouseDown);
pauseSwitch = false;
stage.addEventListener(MouseEvent.MOUSE_UP, MouseUp);
wave = 0;
waveTimerStore = 500;
waveTimer = waveTimerStore;
waveTimerMax = waveTimer;
waveAddition = 0;
HUD.waveText.text = wave;
A_wave0 = new Array(50, 0, 0);
A_wave1 = new Array(45, 0, 0);
A_wave2 = new Array(45, 60, 0);
A_wave3 = new Array(40, 55, 0);
A_wave4 = new Array(35, 50, 0);
A_wave5 = new Array(35, 50, 60);
A_wave6 = new Array(30, 45, 55);
A_wave7 = new Array(25, 40, 50);
A_wave8 = new Array(25, 35, 45);
A_wave9 = new Array(25, 30, 40);
A_wave10 = new Array(20, 20, 30);
waveArray = new Array();
i = 0;
while (i < 11) {
waveArray[i] = this[("A_wave" + i)];
i++;
};
enemyGenBalance = 3;
enemyForceTime = 0;
enemyForceTimeCheck = false;
healthTimer = 0;
health = 8;
healthSphere.gotoAndStop(health);
healthSphere.alpha = 0.2;
dead = false;
BG = new MovieClip();
addChild(BG);
bgStarArray = new Array();
setupStars();
EFFECT = new MovieClip();
addChild(EFFECT);
BULLET = new MovieClip();
addChild(BULLET);
ENEMY = new MovieClip();
addChild(ENEMY);
TOWERS = new MovieClip();
addChild(TOWERS);
MESSAGES = new MovieClip();
addChild(MESSAGES);
setChildIndex(HUD, 15);
setChildIndex(planet, 12);
setChildIndex(healthSphere, 12);
setChildIndex(cursor, 15);
setChildIndex(tutorial, 15);
glowIndex = new Array((10 * (graphicsRating - 0.3)), (10 * (graphicsRating - 0.3)), (10 * (graphicsRating - 0.3)), (5 * (graphicsRating - 0.3)), (3 * (graphicsRating - 0.3)));
redGlow = new GlowFilter(0xFF0000, glowIndex[0], glowIndex[1], glowIndex[2], glowIndex[3], glowIndex[4]);
yellowGlow = new GlowFilter(16771362, glowIndex[0], glowIndex[1], glowIndex[2], glowIndex[3], glowIndex[4]);
blueGlow = new GlowFilter(2276863, glowIndex[0], glowIndex[1], glowIndex[2], glowIndex[3], glowIndex[4]);
greenGlow = new GlowFilter(0x1AFF00, glowIndex[0], glowIndex[1], glowIndex[2], glowIndex[3], glowIndex[4]);
whiteGlow = new GlowFilter(0xFFFFFF, glowIndex[0], glowIndex[1], glowIndex[2], glowIndex[3], glowIndex[4]);
BULLET.filters = [yellowGlow];
money = 9000;
moneyBalance = 2;
turret_small = new Array(3000, 4, 4, 1);
turret_medium = new Array(10000, 6, 6, 2);
turret_large = new Array(20000, 8, 12, 4);
turret_hyper = new Array(40000, 12, 24, 8);
TargetNum = 1;
TargetPointCount = 3;
TargetAdjust = 1;
moneyPot = money;
enemyVoidTimer = 0;
enemySpawnTimer = 50;
keySwitch = false;
waveBreakStore = 440;
waveBreakTimer = 0;
deadTimer = 50;
enemyCounter = 0;
FPS = 0;
FPSold = 0;
framerate = 40;
cursorArray = new Array();
cursorTrailLength = (20 * graphicsRating);
ii = 0;
while (ii < cursorTrailLength) {
cursorArray[ii] = 0;
ii++;
};
}
public function enemyGen(){
if (Math.round((Math.random() * (waveArray[wave][0] * enemyGenBalance))) == 1){
newEnemy("Enemy_YELLOW", undefined, planet.x, planet.y);
} else {
if (Math.round((Math.random() * (waveArray[wave][1] * enemyGenBalance))) == 1){
newEnemy("Enemy_RED", undefined, planet.x, planet.y);
} else {
if (Math.round((Math.random() * (waveArray[wave][2] * enemyGenBalance))) == 1){
newEnemy("Enemy_BLUE", undefined, planet.x, planet.y);
};
};
};
enemyForceTime++;
while ((((enemyForceTimeCheck == false)) && ((enemyForceTime == 43)))) {
if (Math.round((Math.random() * waveArray[wave][0])) == 1){
newEnemy("Enemy_YELLOW", undefined, planet.x, planet.y);
enemyForceTimeCheck = true;
enemyForceTime = 0;
} else {
if (Math.round((Math.random() * waveArray[wave][1])) == 1){
newEnemy("Enemy_RED", undefined, planet.x, planet.y);
enemyForceTimeCheck = true;
enemyForceTime = 0;
} else {
if (Math.round((Math.random() * waveArray[wave][2])) == 1){
newEnemy("Enemy_BLUE", undefined, planet.x, planet.y);
enemyForceTimeCheck = true;
enemyForceTime = 0;
};
};
};
};
enemyForceTimeCheck = false;
}
public function onEnterFrame(_arg1){
var _local2:*;
if (dead == true){
if (deadTimer > 0){
deadTimer--;
HUD.y = (HUD.y + 1);
} else {
if (alpha > 0.01){
alpha = (alpha / 1.1);
} else {
if (deadTimer > -50){
deadTimer--;
alpha = 0;
} else {
stage.removeEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, MouseUp);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeChild(EFFECT);
removeChild(BULLET);
removeChild(ENEMY);
removeChild(TOWERS);
removeChild(MESSAGES);
while (_local2 < bgStarArray.length) {
bgStarArray[_local2].removeParticle();
bgStarArray[_local2] = null;
_local2++;
};
removeChild(BG);
MovieClip(parent).score = (wave + waveAddition);
MovieClip(parent).gotoAndStop("GAMEOVER");
};
};
};
} else {
gamePauser();
if (alpha < 1){
alpha = (alpha + 0.05);
};
if (money < 0){
money = 0;
};
cursorFunction();
hudButtons();
if ((((gamePaused == false)) && ((gameFroze == false)))){
damagePlantUpdate();
keySpawning();
if (tutorialSwitch == false){
if (waveBreakTimer < (waveBreakStore / 2)){
waveBreakTimer++;
} else {
newMessage(600, 100, "Place 3 Satalites to begin...", 80);
waveBreakTimer = 0;
};
if (money == 0){
tutorialSwitch = true;
waveBreakTimer = 100;
};
} else {
HUD.waveBar.scaleX = ((1 / waveTimerMax) * waveTimer);
if (waveBreakTimer < waveBreakStore){
if (enemyCounter <= 0){
waveBreakTimer++;
if (waveBreakTimer == (waveBreakStore - 40)){
newSound("beepLow");
newMessage(600, 100, "1", 40);
};
if (waveBreakTimer == (waveBreakStore - 80)){
newSound("beepLow");
newMessage(600, 100, "2", 40);
};
if (waveBreakTimer == (waveBreakStore - 120)){
newSound("beepLow");
newMessage(600, 100, "3", 40);
};
if (waveBreakTimer == (waveBreakStore - 160)){
newMessage(600, 100, "4", 40);
};
if (waveBreakTimer == waveBreakStore){
newSound("beepHigh");
newMessage(600, 100, "INCOMING!", 100);
};
if (waveBreakTimer == (waveBreakStore - 200)){
newMessage(600, 100, "NEXT WAVE IN", 40);
};
if (tutorialSwitch == undefined){
if (waveBreakTimer == 1){
newMessage(600, 100, "WAVE COMPLETE!", 40);
};
if (waveBreakTimer == 60){
newMessage(600, 100, (("$" + (1000 * (wave + 1))) + "BONUS!"), 40);
money = (money + (1000 * (wave + 1)));
};
};
};
} else {
waveTimer--;
if (waveTimer < 0){
if (wave < 10){
wave++;
} else {
waveAddition++;
enemyGenBalance = (enemyGenBalance / 1.1);
};
waveTimerStore = (waveTimerStore + 100);
waveBreakTimer = 0;
waveTimer = waveTimerStore;
waveTimerMax = waveTimer;
HUD.waveText.text = (wave + waveAddition);
};
enemyGen();
};
};
updateStars();
fpsCalc();
planet.rotation = (planet.rotation + 0.2);
HUD.moneyText.text = ("$" + moneyPot);
if (moneyPot > money){
moneyPot = (moneyPot - Math.ceil(((moneyPot - money) / 10)));
} else {
moneyPot = money;
};
adjustTargetPoints();
} else {
if (gameFroze == true){
if (Key.isDown(Keyboard.ENTER)){
removeTutorial();
};
};
};
};
}
public function MouseDown(_arg1){
mousePressed = true;
}
public function angle(_arg1, _arg2, _arg3, _arg4){
return (Math.round(((Math.atan2((_arg4 - _arg2), (_arg3 - _arg1)) / 3.141593) * 180)));
}
public function fpsCalc(){
FPS = Math.round(((framerate / ((getTimer() - FPSold) / 1000)) / 40));
FPSold = getTimer();
}
public function newSparks(_arg1, _arg2, _arg3, _arg4){
var _local5:*;
newSound("explosion");
_local5 = 0;
while (_local5 < (_arg3 * (graphicsRating / 2))) {
clone = new SPARK();
clone.x = _arg1;
clone.y = _arg2;
clone.rotation = (Math.random() * 360);
clone.scaleX = ((Math.random() * 40) + 1);
clone.filters = [_arg4];
EFFECT.addChild(clone);
_local5++;
};
}
public function hudButtons(){
HUD.zBut.nameText.text = "small";
HUD.xBut.nameText.text = "medium";
HUD.cBut.nameText.text = "large";
HUD.vBut.nameText.text = "hyper";
HUD.zBut.priceText.text = "$3000";
HUD.xBut.priceText.text = "$10000";
HUD.cBut.priceText.text = "$20000";
HUD.vBut.priceText.text = "$40000";
HUD.zBut.keyText.text = "Z";
HUD.xBut.keyText.text = "X";
HUD.cBut.keyText.text = "C";
HUD.vBut.keyText.text = "V";
if (money < turret_small[0]){
HUD.zBut.gotoAndStop("noCash");
} else {
HUD.zBut.gotoAndStop("cash");
};
if (money < turret_medium[0]){
HUD.xBut.gotoAndStop("noCash");
} else {
HUD.xBut.gotoAndStop("cash");
};
if (money < turret_large[0]){
HUD.cBut.gotoAndStop("noCash");
} else {
HUD.cBut.gotoAndStop("cash");
};
if (money < turret_hyper[0]){
HUD.vBut.gotoAndStop("noCash");
} else {
HUD.vBut.gotoAndStop("cash");
};
}
public function adjustTargetPoints(){
this[("targetObject" + TargetAdjust)].x = -1000;
this[("targetObject" + TargetAdjust)].y = -1000;
if (TargetAdjust < TargetPointCount){
TargetAdjust++;
} else {
TargetAdjust = 1;
};
}
public function buildTowerType(_arg1){
if (this[("turret_" + _arg1)][0] <= money){
if (pythag(planet.x, planet.y, mouseX, mouseY) < 50){
newMessage(600, 380, "Can't Build There!", 60);
} else {
money = (money - this[("turret_" + _arg1)][0]);
newTower(mouseX, mouseY, this[("turret_" + _arg1)][1], this[("turret_" + _arg1)][2], this[("turret_" + _arg1)][3]);
};
} else {
newMessage(600, 380, "Not Enough Funds", 60);
};
}
public function pythag(_arg1, _arg2, _arg3, _arg4){
return (Math.sqrt((((_arg2 - _arg4) * (_arg2 - _arg4)) + ((_arg1 - _arg3) * (_arg1 - _arg3)))));
}
public function updateStars(){
var _local1:*;
if (graphicsRating > 0.9){
_local1 = 0;
while (_local1 < bgStarArray.length) {
bgStarArray[_local1].x = (bgStarArray[_local1].x + 0.5);
if (bgStarArray[_local1].x > 400){
bgStarArray[_local1].x = 0;
};
_local1++;
};
};
}
public function cursorFunction(){
var _local1:*;
cursor.x = (cursor.x + ((mouseX - cursor.x) / 3));
cursor.y = (cursor.y + ((mouseY - cursor.y) / 3));
cursorArray.push(cursor.x);
cursorArray.push(cursor.y);
cursorArray.shift();
cursorArray.shift();
EFFECT.graphics.clear();
_local1 = 0;
while (_local1 < (cursorArray.length - 2)) {
EFFECT.graphics.lineStyle((_local1 / (cursorTrailLength / 10)), 0x440000, 1);
EFFECT.graphics.moveTo(cursorArray[_local1], cursorArray[(_local1 + 1)]);
_local1 = (_local1 + 2);
EFFECT.graphics.lineTo(cursorArray[_local1], cursorArray[(_local1 + 1)]);
};
}
public function newSound(_arg1){
sound.gotoAndStop(_arg1);
sound.gotoAndStop(1);
}
public function newTower(_arg1, _arg2, _arg3, _arg4, _arg5){
clone = new TOWER();
clone.x = _arg1;
clone.y = _arg2;
clone.scaleX = _arg3;
clone.scaleY = _arg4;
clone.rotation = _arg5;
clone.visible = false;
TOWERS.addChild(clone);
}
public function checkHit(_arg1, _arg2, _arg3){
var _local4:*;
targetChecker.width = _arg3;
targetChecker.height = _arg3;
targetChecker.x = _arg1;
targetChecker.y = _arg2;
_local4 = 1;
while (_local4 < TargetNum) {
if (targetChecker.hitTestObject(this[("targetObject" + _local4)])){
return (true);
};
_local4++;
};
}
public function gamePauser(){
var _local1:*;
if (((Key.isDown(Keyboard.SPACE)) && ((pauseSwitch == false)))){
if (gamePaused == true){
gamePaused = false;
} else {
gamePaused = true;
_local1 = new PAUSEMENU();
_local1.x = 15;
_local1.y = 100;
addChild(_local1);
};
pauseSwitch = true;
} else {
if (Key.isDown(Keyboard.SPACE) == false){
pauseSwitch = false;
};
};
}
public function newEnemy(_arg1, _arg2, _arg3, _arg4){
var _local5:*;
tutorialSwitch = undefined;
if (_arg1 == "Enemy_BLUE"){
_local5 = new Enemy_BLUE();
_local5.filters = [blueGlow];
} else {
if (_arg1 == "Enemy_YELLOW"){
_local5 = new Enemy_YELLOW();
_local5.filters = [yellowGlow];
} else {
if (_arg1 == "Enemy_RED"){
_local5 = new Enemy_RED();
_local5.filters = [redGlow];
} else {
if (_arg1 == "Enemy_BLUE_CHILD"){
_local5 = new Enemy_BLUE_CHILD();
_local5.filters = [blueGlow];
_local5.rotation = _arg2;
};
};
};
};
_local5.x = _arg3;
_local5.y = _arg4;
ENEMY.addChild(_local5);
enemyCounter++;
}
public function setupStars(){
var _local1:*;
var _local2:*;
if (graphicsRating > 0.4){
_local1 = 0;
while (_local1 < (200 * graphicsRating)) {
_local2 = new STAR();
_local2.x = (Math.random() * 400);
_local2.y = (Math.random() * 400);
_local2.scaleX = (Math.random() * 1);
_local2.scaleY = _local2.scaleX;
bgStarArray[_local1] = _local2;
BG.addChild(_local2);
_local1++;
};
};
}
public function damagePlanet(){
if (healthTimer == 0){
health--;
healthSphere.gotoAndStop(health);
healthTimer = 100;
if (health == 0){
newSparks(planet.x, planet.y, 100, redGlow);
newSparks(planet.x, planet.y, 100, blueGlow);
newSparks(planet.x, planet.y, 100, yellowGlow);
newSparks(planet.x, planet.y, 100, greenGlow);
planet.visible = false;
healthSphere.visible = false;
dead = true;
};
};
}
}
}//package ndefence_fla
Section 4
//Gameoverscreen_33 (ndefence_fla.Gameoverscreen_33)
package ndefence_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Gameoverscreen_33 extends MovieClip {
public var btn_ret:MovieClip;
public var scoreBox:TextField;
public function Gameoverscreen_33(){
addFrameScript(23, frame24, 43, frame44);
}
function frame24(){
stop();
btn_ret.addEventListener(MouseEvent.MOUSE_DOWN, func_btn_ret);
scoreBox.text = MovieClip(parent).score;
}
function frame44(){
MovieClip(parent).gotoAndStop("TITLE");
}
public function func_btn_ret(_arg1){
btn_ret.removeEventListener(MouseEvent.MOUSE_DOWN, func_btn_ret);
play();
}
}
}//package ndefence_fla
Section 5
//HUD_25 (ndefence_fla.HUD_25)
package ndefence_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HUD_25 extends MovieClip {
public var moneyText:TextField;
public var cBut:MovieClip;
public var vBut:MovieClip;
public var waveBar:MovieClip;
public var zBut:MovieClip;
public var waveText:TextField;
public var xBut:MovieClip;
public function HUD_25(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ndefence_fla
Section 6
//HUD_button_27 (ndefence_fla.HUD_button_27)
package ndefence_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HUD_button_27 extends MovieClip {
public var priceText:TextField;
public var keyText:TextField;
public var nameText:TextField;
public function HUD_button_27(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package ndefence_fla
Section 7
//MainTimeline (ndefence_fla.MainTimeline)
package ndefence_fla {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.media.*;
public dynamic class MainTimeline extends MovieClip {
public var myContextMenu:ContextMenu;
public var plb:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 5, frame6);
}
function frame3(){
SoundMixer.stopAll();
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, preLoader);
myContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
contextMenu = myContextMenu;
}
function frame6(){
stop();
}
function frame2(){
stop();
}
public function preLoader(_arg1:Event){
var _local2:*;
var _local3:*;
_local2 = stage.loaderInfo.bytesTotal;
_local3 = stage.loaderInfo.bytesLoaded;
plb.scaleX = ((1 / _local2) * _local3);
if (_local3 >= _local2){
removeEventListener(Event.ENTER_FRAME, preLoader);
play();
};
}
}
}//package ndefence_fla
Section 8
//PAUSE_quitter_35 (ndefence_fla.PAUSE_quitter_35)
package ndefence_fla {
import flash.display.*;
public dynamic class PAUSE_quitter_35 extends MovieClip {
public var btn_no:MovieClip;
public var btn_yes:MovieClip;
}
}//package ndefence_fla
Section 9
//SETTINGS_21 (ndefence_fla.SETTINGS_21)
package ndefence_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class SETTINGS_21 extends MovieClip {
public var btn_ret:MovieClip;
public var btn_med:MovieClip;
public var btn_high:MovieClip;
public var btn_low:MovieClip;
public function SETTINGS_21(){
addFrameScript(19, frame20, 39, frame40);
}
function frame20(){
stop();
btn_high.addEventListener(MouseEvent.MOUSE_UP, func_btn_high);
btn_med.addEventListener(MouseEvent.MOUSE_UP, func_btn_med);
btn_low.addEventListener(MouseEvent.MOUSE_UP, func_btn_low);
btn_ret.addEventListener(MouseEvent.MOUSE_UP, func_btn_ret);
}
public function func_btn_low(_arg1){
MovieClip(parent).graphicsRating = 0.3;
purgeListeners();
play();
}
function frame40(){
if (MovieClip(parent).graphicsRating != 0){
MovieClip(parent).gotoAndStop("GAME");
} else {
MovieClip(parent).gotoAndStop("TITLE");
};
}
public function func_btn_ret(_arg1){
MovieClip(parent).graphicsRating = 0;
purgeListeners();
play();
}
public function func_btn_high(_arg1){
MovieClip(parent).graphicsRating = 1;
purgeListeners();
play();
}
public function purgeListeners(){
btn_high.removeEventListener(MouseEvent.MOUSE_UP, func_btn_high);
btn_med.removeEventListener(MouseEvent.MOUSE_UP, func_btn_med);
btn_low.removeEventListener(MouseEvent.MOUSE_UP, func_btn_low);
btn_ret.removeEventListener(MouseEvent.MOUSE_UP, func_btn_ret);
}
public function func_btn_med(_arg1){
MovieClip(parent).graphicsRating = 0.6;
purgeListeners();
play();
}
}
}//package ndefence_fla
Section 10
//SoundBox_32 (ndefence_fla.SoundBox_32)
package ndefence_fla {
import flash.display.*;
public dynamic class SoundBox_32 extends MovieClip {
public function SoundBox_32(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ndefence_fla
Section 11
//System_Square_48 (ndefence_fla.System_Square_48)
package ndefence_fla {
import flash.display.*;
public dynamic class System_Square_48 extends MovieClip {
public function System_Square_48(){
addFrameScript(0, frame1);
}
function frame1(){
alpha = 0;
}
}
}//package ndefence_fla
Section 12
//TargetObject_24 (ndefence_fla.TargetObject_24)
package ndefence_fla {
import flash.display.*;
public dynamic class TargetObject_24 extends MovieClip {
public function TargetObject_24(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package ndefence_fla
Section 13
//TITLESCREEN_11 (ndefence_fla.TITLESCREEN_11)
package ndefence_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class TITLESCREEN_11 extends MovieClip {
public var btn_high:MovieClip;
public var btn_armor:MovieClip;
public var btn_start:MovieClip;
public var btn_credits:MovieClip;
public function TITLESCREEN_11(){
addFrameScript(49, frame50, 61, frame62);
}
public function func_btn_start(_arg1){
purgeListeners();
MovieClip(parent).targetFrame = "GRAPHICS";
}
public function func_btn_credits(_arg1){
purgeListeners();
MovieClip(parent).targetFrame = "CREDITS";
}
public function purgeListeners(){
btn_start.removeEventListener(MouseEvent.MOUSE_UP, func_btn_start);
btn_credits.removeEventListener(MouseEvent.MOUSE_UP, func_btn_credits);
btn_armor.removeEventListener(MouseEvent.MOUSE_UP, func_btn_armor);
btn_high.removeEventListener(MouseEvent.MOUSE_UP, func_btn_high);
play();
}
function frame50(){
stop();
btn_start.addEventListener(MouseEvent.MOUSE_UP, func_btn_start);
btn_high.addEventListener(MouseEvent.MOUSE_UP, func_btn_high);
btn_credits.addEventListener(MouseEvent.MOUSE_UP, func_btn_credits);
btn_armor.addEventListener(MouseEvent.MOUSE_UP, func_btn_armor);
stop();
}
public function func_btn_armor(_arg1){
var url:String;
var request:URLRequest;
var event = _arg1;
url = "http://www.armorgames.com";
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
function frame62(){
MovieClip(parent).gotoAndStop(MovieClip(parent).targetFrame);
}
public function func_btn_high(_arg1){
MovieClip(parent).highScore();
}
}
}//package ndefence_fla
Section 14
//TUTORIAL_29 (ndefence_fla.TUTORIAL_29)
package ndefence_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class TUTORIAL_29 extends MovieClip {
public function TUTORIAL_29(){
addFrameScript(0, frame1, 5, frame6);
}
function frame6(){
MovieClip(parent).removeTutorial();
}
function frame1(){
stop();
}
}
}//package ndefence_fla
Section 15
//xczcxzc_7 (ndefence_fla.xczcxzc_7)
package ndefence_fla {
import flash.display.*;
public dynamic class xczcxzc_7 extends MovieClip {
public function xczcxzc_7(){
addFrameScript(125, frame126);
}
function frame126(){
MovieClip(parent).play();
}
}
}//package ndefence_fla
Section 16
//Enemy_BLUE (Enemy_BLUE)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Enemy_BLUE extends MovieClip {
public var ring1:MovieClip;
public var destroy;
public var ring2:MovieClip;
public var ySpeed;
public var speed;
public var health;
public var xSpeed;
public var rotationOffset;
public function Enemy_BLUE(){
addFrameScript(0, frame1);
}
public function removeParticle(){
MovieClip(parent.parent).enemyCounter--;
MovieClip(parent.parent).newSparks(x, y, 10, MovieClip(parent.parent).whiteGlow);
MovieClip(parent.parent).newSparks(x, y, 10, MovieClip(parent.parent).blueGlow);
MovieClip(parent.parent).newEnemy("Enemy_BLUE_CHILD", 1, x, y);
MovieClip(parent.parent).newEnemy("Enemy_BLUE_CHILD", -1, x, y);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
parent.removeChild(this);
delete ??getglobalscope
[this];
}
function frame1(){
speed = 1.5;
health = 0;
destroy = false;
rotation = (Math.random() * 360);
ySpeed = (speed * Math.sin((rotation * 0.01745329)));
xSpeed = (speed * Math.cos((rotation * 0.01745329)));
x = (x - (xSpeed * 200));
y = (y - (ySpeed * 200));
rotationOffset = 80;
if (Math.round((Math.random() * 2)) == 1){
rotationOffset = -80;
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1){
if (MovieClip(parent.parent).gamePaused == false){
ring2.rotation = (ring2.rotation - 10);
ring1.rotation = (ring1.rotation + 10);
rotation = MovieClip(parent.parent).angle(x, y, MovieClip(parent.parent).planet.x, MovieClip(parent.parent).planet.y);
rotation = (rotation + rotationOffset);
rotationOffset = (rotationOffset / 1.001);
ySpeed = (speed * Math.sin((rotation * 0.01745329)));
xSpeed = (speed * Math.cos((rotation * 0.01745329)));
x = (x + xSpeed);
y = (y + ySpeed);
if (MovieClip(parent.parent).pythag(x, y, MovieClip(parent.parent).planet.x, MovieClip(parent.parent).planet.y) < MovieClip(parent.parent).planetSize){
MovieClip(parent.parent).damagePlanet();
destroy = true;
};
if (MovieClip(parent.parent).checkHit(x, y, (width * 2)) == true){
if (health > 0){
health--;
MovieClip(parent.parent).newMiniMessage(((x + (Math.random() * 20)) - 10), ((y + (Math.random() * 20)) - 10), -1, 1);
} else {
MovieClip(parent.parent).money = (MovieClip(parent.parent).money + ((100 + Math.round((Math.random() * 50))) * MovieClip(parent.parent).moneyBalance));
destroy = true;
};
};
if ((((destroy == true)) || ((MovieClip(parent.parent).dead == true)))){
removeParticle();
};
};
}
}
}//package
Section 17
//Enemy_BLUE_CHILD (Enemy_BLUE_CHILD)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Enemy_BLUE_CHILD extends MovieClip {
public var destroy;
public var ySpeed;
public var speed;
public var health;
public var xSpeed;
public var rotationOffset;
public var invTimer;
public function Enemy_BLUE_CHILD(){
addFrameScript(0, frame1);
}
public function removeParticle(){
MovieClip(parent.parent).enemyCounter = (MovieClip(parent.parent).enemyCounter - 1);
MovieClip(parent.parent).newSparks(x, y, 20, MovieClip(parent.parent).whiteGlow);
MovieClip(parent.parent).newSparks(x, y, 20, MovieClip(parent.parent).blueGlow);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
parent.removeChild(this);
delete ??getglobalscope
[this];
}
function frame1(){
speed = 1;
health = 0;
destroy = false;
invTimer = 10;
ySpeed = (speed * Math.sin((rotation * 0.01745329)));
xSpeed = (speed * Math.cos((rotation * 0.01745329)));
rotationOffset = (50 + (Math.random() * 30));
if (rotation == 1){
rotationOffset = (-50 - (Math.random() * 30));
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1){
if (MovieClip(parent.parent).gamePaused == false){
rotation = MovieClip(parent.parent).angle(x, y, MovieClip(parent.parent).planet.x, MovieClip(parent.parent).planet.y);
rotation = (rotation + rotationOffset);
rotationOffset = (rotationOffset / 1.005);
ySpeed = (speed * Math.sin((rotation * 0.01745329)));
xSpeed = (speed * Math.cos((rotation * 0.01745329)));
x = (x + xSpeed);
y = (y + ySpeed);
if (MovieClip(parent.parent).pythag(x, y, MovieClip(parent.parent).planet.x, MovieClip(parent.parent).planet.y) < MovieClip(parent.parent).planetSize){
MovieClip(parent.parent).damagePlanet();
destroy = true;
MovieClip(parent.parent).money = (MovieClip(parent.parent).money - 100);
};
if (invTimer == 0){
if (MovieClip(parent.parent).checkHit(x, y, (width * 2)) == true){
if (health > 0){
health--;
MovieClip(parent.parent).newMiniMessage(((x + (Math.random() * 20)) - 10), ((y + (Math.random() * 20)) - 10), -1, 1);
} else {
MovieClip(parent.parent).money = (MovieClip(parent.parent).money + ((50 + Math.round((Math.random() * 50))) * MovieClip(parent.parent).moneyBalance));
destroy = true;
};
};
} else {
invTimer--;
};
if ((((destroy == true)) || ((MovieClip(parent.parent).dead == true)))){
removeParticle();
};
};
}
}
}//package
Section 18
//Enemy_RED (Enemy_RED)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Enemy_RED extends MovieClip {
public var destroy;
public var ySpeed;
public var speed;
public var health;
public var xSpeed;
public var rotationOffset;
public function Enemy_RED(){
addFrameScript(0, frame1);
}
public function removeParticle(){
MovieClip(parent.parent).enemyCounter--;
MovieClip(parent.parent).newSparks(x, y, 50, MovieClip(parent.parent).whiteGlow);
MovieClip(parent.parent).newSparks(x, y, 50, MovieClip(parent.parent).redGlow);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
parent.removeChild(this);
delete ??getglobalscope
[this];
}
function frame1(){
speed = 2.5;
health = 0;
destroy = false;
rotation = (Math.random() * 360);
ySpeed = (speed * Math.sin((rotation * 0.01745329)));
xSpeed = (speed * Math.cos((rotation * 0.01745329)));
x = (x - (xSpeed * 120));
y = (y - (ySpeed * 120));
rotationOffset = 80;
if (Math.round((Math.random() * 2)) == 1){
rotationOffset = -80;
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1){
if (MovieClip(parent.parent).gamePaused == false){
rotation = MovieClip(parent.parent).angle(x, y, MovieClip(parent.parent).planet.x, MovieClip(parent.parent).planet.y);
rotation = (rotation + rotationOffset);
rotationOffset = (rotationOffset / 1.0005);
if ((Math.random() * 50) < 1){
rotationOffset = (rotationOffset * -1);
};
ySpeed = (speed * Math.sin((rotation * 0.01745329)));
xSpeed = (speed * Math.cos((rotation * 0.01745329)));
x = (x + xSpeed);
y = (y + ySpeed);
if (MovieClip(parent.parent).pythag(x, y, MovieClip(parent.parent).planet.x, MovieClip(parent.parent).planet.y) < MovieClip(parent.parent).planetSize){
MovieClip(parent.parent).damagePlanet();
destroy = true;
};
if (MovieClip(parent.parent).checkHit(x, y, (width * 2)) == true){
if (health > 0){
health--;
MovieClip(parent.parent).newMiniMessage(((x + (Math.random() * 20)) - 10), ((y + (Math.random() * 20)) - 10), -1, 1);
} else {
MovieClip(parent.parent).money = (MovieClip(parent.parent).money + ((300 + Math.round((Math.random() * 50))) * MovieClip(parent.parent).moneyBalance));
destroy = true;
};
};
if ((((destroy == true)) || ((MovieClip(parent.parent).dead == true)))){
removeParticle();
};
};
}
}
}//package
Section 19
//Enemy_YELLOW (Enemy_YELLOW)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Enemy_YELLOW extends MovieClip {
public var destroy;
public var ySpeed;
public var speed;
public var health;
public var xSpeed;
public function Enemy_YELLOW(){
addFrameScript(0, frame1);
}
public function removeParticle(){
MovieClip(parent.parent).enemyCounter--;
MovieClip(parent.parent).newSparks(x, y, 50, MovieClip(parent.parent).whiteGlow);
MovieClip(parent.parent).newSparks(x, y, 50, MovieClip(parent.parent).yellowGlow);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
parent.removeChild(this);
delete ??getglobalscope
[this];
}
function frame1(){
speed = 0.5;
health = 0;
destroy = false;
rotation = (Math.random() * 360);
ySpeed = (speed * Math.sin((rotation * 0.01745329)));
xSpeed = (speed * Math.cos((rotation * 0.01745329)));
x = (x - (xSpeed * 600));
y = (y - (ySpeed * 600));
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1){
if (MovieClip(parent.parent).gamePaused == false){
rotation = MovieClip(parent.parent).angle(x, y, MovieClip(parent.parent).planet.x, MovieClip(parent.parent).planet.y);
ySpeed = (speed * Math.sin((rotation * 0.01745329)));
xSpeed = (speed * Math.cos((rotation * 0.01745329)));
x = (x + xSpeed);
y = (y + ySpeed);
if (MovieClip(parent.parent).pythag(x, y, MovieClip(parent.parent).planet.x, MovieClip(parent.parent).planet.y) < MovieClip(parent.parent).planetSize){
MovieClip(parent.parent).damagePlanet();
destroy = true;
MovieClip(parent.parent).money = (MovieClip(parent.parent).money - 100);
};
if (MovieClip(parent.parent).checkHit(x, y, (width * 2)) == true){
if (health > 0){
health--;
MovieClip(parent.parent).newMiniMessage(((x + (Math.random() * 20)) - 10), ((y + (Math.random() * 20)) - 10), -1, 1);
} else {
MovieClip(parent.parent).money = (MovieClip(parent.parent).money + ((200 + Math.round((Math.random() * 50))) * MovieClip(parent.parent).moneyBalance));
destroy = true;
};
};
if ((((destroy == true)) || ((MovieClip(parent.parent).dead == true)))){
removeParticle();
};
};
}
}
}//package
Section 20
//Key (Key)
package {
import flash.display.*;
import flash.events.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
public static function initialize(_arg1:Stage){
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(_arg1:Event):void{
keysDown = new Object();
}
public static function isDown(_arg1:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((_arg1 in keysDown)));
}
private static function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
}
}//package
Section 21
//MESSAGE (MESSAGE)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class MESSAGE extends MovieClip {
public var moveTimer;
public var textBox:TextField;
public function MESSAGE(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
moveTimer = rotation;
rotation = 0;
textBox.text = MovieClip(parent.parent).messageText;
}
public function onEnterFrame(_arg1){
if (moveTimer > 0){
this.x = (this.x + ((200 - x) / 5));
moveTimer--;
} else {
if (moveTimer > -100){
this.x = (this.x + ((-200 - x) / 5));
moveTimer--;
} else {
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
};
};
}
}
}//package
Section 22
//Mini_Message (Mini_Message)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class Mini_Message extends MovieClip {
public var output;
public var outputText:TextField;
public function Mini_Message(){
addFrameScript(0, frame1);
}
public function removeParticle(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
parent.removeChild(this);
delete ??getglobalscope
[this];
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
output = rotation;
gotoAndStop(scaleX);
scaleX = 1;
outputText.text = output;
alpha = 3;
rotation = 0;
}
public function onEnterFrame(_arg1){
alpha = (alpha - 0.05);
if ((((alpha > 0)) && ((alpha < 1)))){
y = (y - 1);
} else {
if (alpha == 0){
removeParticle();
};
};
}
}
}//package
Section 23
//PARTICLE (PARTICLE)
package {
import flash.display.*;
import flash.events.*;
public dynamic class PARTICLE extends MovieClip {
public var ySpeed;
public var speed;
public var spin;
public var dir;
public var sprite:MovieClip;
public var xSpeed;
public function PARTICLE(){
addFrameScript(0, frame1);
}
public function removeParticle(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
parent.removeChild(this);
delete ??getglobalscope
[this];
}
function frame1(){
speed = ((Math.random() * 10) + 5);
spin = ((Math.random() * 20) - 10);
scaleX = (((Math.random() * 5) + 5) / 10);
scaleY = scaleX;
if (Math.round((Math.random() * 2)) == 1){
scaleX = (scaleX * -1);
};
dir = (Math.random() * 360);
ySpeed = (speed * Math.sin((dir * 0.01745329)));
xSpeed = (speed * Math.cos((dir * 0.01745329)));
addEventListener(Event.ENTER_FRAME, onEnterFrame);
sprite.gotoAndStop((Math.round((Math.random() * 4)) + 1));
}
public function onEnterFrame(_arg1){
dir = (dir + spin);
ySpeed = (speed * Math.sin((dir * 0.01745329)));
xSpeed = (speed * Math.cos((dir * 0.01745329)));
x = (x + xSpeed);
y = (y + ySpeed);
if (speed > 0.1){
speed = (speed / 1.05);
xSpeed = (xSpeed / 1.05);
ySpeed = (ySpeed / 1.05);
} else {
removeParticle();
};
}
}
}//package
Section 24
//Particle_Bullet (Particle_Bullet)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Particle_Bullet extends MovieClip {
public var destroy;
public var ySpeed;
public var speed;
public var xSpeed;
public function Particle_Bullet(){
addFrameScript(0, frame1);
}
public function removeParticle(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
parent.removeChild(this);
delete ??getglobalscope
[this];
}
function frame1(){
destroy = false;
alpha = 1;
speed = (MovieClip(parent.parent).bulletSpeed + (Math.random() * 1));
ySpeed = (speed * Math.sin((rotation * 0.01745329)));
xSpeed = (speed * Math.cos((rotation * 0.01745329)));
MovieClip(parent.parent).bulletCount++;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1){
if (MovieClip(parent.parent).gamePaused == false){
if (MovieClip(parent.parent).ENEMY.hitTestPoint(x, y, true)){
destroy = true;
MovieClip(parent.parent).targetPoint(x, y);
};
if ((((((destroy == false)) && ((MovieClip(parent.parent).pythag(x, y, MovieClip(parent.parent).planet.x, MovieClip(parent.parent).planet.y) > MovieClip(parent.parent).planetSize)))) && ((MovieClip(parent.parent).pythag(x, y, MovieClip(parent.parent).planet.x, MovieClip(parent.parent).planet.y) < 250)))){
x = (x + xSpeed);
y = (y + ySpeed);
} else {
removeParticle();
};
};
}
}
}//package
Section 25
//PAUSEMENU (PAUSEMENU)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class PAUSEMENU extends MovieClip {
public var btn_quit:MovieClip;
public var quitter:MovieClip;
public var quitterPos;
public function PAUSEMENU(){
addFrameScript(0, frame1);
}
public function MouseCancel(_arg1){
quitter.x = (quitter.x + 1000);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
btn_quit.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
quitter.btn_yes.addEventListener(MouseEvent.MOUSE_DOWN, MouseQuit);
quitter.btn_no.addEventListener(MouseEvent.MOUSE_DOWN, MouseCancel);
quitterPos = quitter.x;
quitter.x = (quitter.x + 1000);
}
public function MouseQuit(_arg1){
MovieClip(parent).health = 1;
MovieClip(parent).damagePlanet();
MovieClip(parent).gamePaused = false;
removeBox();
}
public function removeBox(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
btn_quit.removeEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
quitter.btn_yes.removeEventListener(MouseEvent.MOUSE_DOWN, MouseQuit);
quitter.btn_no.removeEventListener(MouseEvent.MOUSE_DOWN, MouseCancel);
parent.removeChild(this);
delete ??getglobalscope
[this];
}
public function onEnterFrame(_arg1){
if ((((MovieClip(parent).gamePaused == false)) || ((MovieClip(parent).dead == true)))){
removeBox();
};
}
public function MouseDown(_arg1){
quitter.x = quitterPos;
}
}
}//package
Section 26
//SPARK (SPARK)
package {
import flash.display.*;
import flash.events.*;
public dynamic class SPARK extends MovieClip {
public var ySpeed;
public var speed;
public var xSpeed;
public function SPARK(){
addFrameScript(0, frame1);
}
public function removeParticle(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
parent.removeChild(this);
delete ??getglobalscope
[this];
}
function frame1(){
speed = scaleX;
ySpeed = (scaleX * Math.sin((rotation * 0.01745329)));
xSpeed = (scaleX * Math.cos((rotation * 0.01745329)));
scaleX = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1){
if (scaleX > 0.1){
x = (x + xSpeed);
y = (y + ySpeed);
xSpeed = (xSpeed / 1.1);
ySpeed = (ySpeed / 1.1);
scaleX = (scaleX - 0.05);
} else {
removeParticle();
};
}
}
}//package
Section 27
//STAR (STAR)
package {
import flash.display.*;
public dynamic class STAR extends MovieClip {
public function STAR(){
addFrameScript(0, frame1);
}
public function removeParticle(){
parent.removeChild(this);
delete ??getglobalscope
[this];
}
function frame1(){
}
}
}//package
Section 28
//TOWER (TOWER)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class TOWER extends MovieClip {
public var Bar_Death:MovieClip;
public var Bar_Death_BG:MovieClip;
public var bulletRate;
public var deathTimer;
public var fireRate;
public var clone;
public var i;
public var level;
public var deathTimerMax;
public var fireRateTimer;
public var sprite:MovieClip;
public function TOWER(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
level = scaleX;
deathTimerMax = (scaleY * 100);
deathTimer = deathTimerMax;
sprite.gotoAndStop(MovieClip(parent.parent).satType);
Bar_Death_BG.scaleX = ((1 / deathTimerMax) * deathTimer);
fireRate = 20;
fireRateTimer = 0;
bulletRate = 1;
scaleX = 0;
scaleY = 0;
rotation = 0;
visible = true;
}
public function onEnterFrame(_arg1){
if (MovieClip(parent.parent).gamePaused == false){
sprite.rotation = Math.round(((Math.atan2((MovieClip(parent).mouseY - y), (MovieClip(parent).mouseX - x)) / 3.141593) * 180));
if (scaleX < 1){
scaleX = (scaleX + 0.1);
scaleY = (scaleY + 0.1);
};
if ((((MovieClip(parent.parent).mousePressed == true)) || ((MovieClip(parent.parent).dead == true)))){
if (fireRateTimer > (fireRate / level)){
MovieClip(parent.parent).newSound("laser");
i = 0;
while (i < (bulletRate * (level / 4))) {
newBullet(((Math.round(((Math.atan2((MovieClip(parent).mouseY - y), (MovieClip(parent).mouseX - x)) / 3.141593) * 180)) + (Math.random() * (2 * level))) - level));
i++;
};
fireRateTimer = 0;
} else {
fireRateTimer++;
};
if (((!((deathTimer == 1))) && ((MovieClip(parent.parent).dead == false)))){
Bar_Death.scaleX = ((1 / deathTimerMax) * deathTimer);
deathTimer--;
} else {
MovieClip(parent.parent).newSound("explosion");
MovieClip(parent.parent).newSound("laser");
if (MovieClip(parent.parent).dead == true){
i = 0;
while (i < 10) {
newBullet((Math.random() * 360));
i++;
};
} else {
i = 0;
while (i < 100) {
newBullet((Math.random() * 360));
i++;
};
};
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
parent.removeChild(this);
delete ??getglobalscope
[this];
};
};
};
}
public function newBullet(_arg1){
clone = new Particle_Bullet();
clone.x = x;
clone.y = y;
clone.rotation = _arg1;
MovieClip(parent.parent).BULLET.addChild(clone);
}
}
}//package