Section 1
//MainTimeline (VectorCS31_fla.MainTimeline)
package VectorCS31_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var submit:SimpleButton;
public var lvl:int;
public var hp1:BitmapData;
public var hp2:BitmapData;
public var percent:Number;
public var detailTxt:TextField;
public var i:int;
public var f1:BitmapData;
public var f2:BitmapData;
public var f4:BitmapData;
public var f5:BitmapData;
public var f6:BitmapData;
public var f7:BitmapData;
public var f8:BitmapData;
public var f9:BitmapData;
public var bpuller:MovieClip;
public var myGunName:String;
public var f3:BitmapData;
public var BGM;
public var dFire:Number;
public var meFound;
public var linkpantalla:SimpleButton;
public var fireFrame:BitmapData;
public var dDamage:int;
public var myTimer:Timer;
public var f10:BitmapData;
public var f11:BitmapData;
public var f12:BitmapData;
public var f13:BitmapData;
public var f14:BitmapData;
public var f16:BitmapData;
public var f18:BitmapData;
public var f19:BitmapData;
public var f15:BitmapData;
public var f17:BitmapData;
public var buyMenu:Boolean;
public var noUpgrade:Boolean;
public var pFounder:int;
public var totalMob:int;
public var f25:BitmapData;
public var f26:BitmapData;
public var f27:BitmapData;
public var f28:BitmapData;
public var f22:BitmapData;
public var f23:BitmapData;
public var f24:BitmapData;
public var f20:BitmapData;
public var drag:BitmapData;
public var mb1:BitmapData;
public var mb2:BitmapData;
public var basePoint:Point;
public var mb6:BitmapData;
public var mb7:BitmapData;
public var mb3:BitmapData;
public var mb4:BitmapData;
public var bm2:Bitmap;
public var lvlSpeed:int;
public var mb5:BitmapData;
public var botonlink1:SimpleButton;
public var f21:BitmapData;
public var clickClose:Boolean;
public var aRange:int;
public var planetData:BitmapData;
public var m1:BitmapData;
public var m2:BitmapData;
public var m3:BitmapData;
public var dTime:int;
public var m7:BitmapData;
public var m4:BitmapData;
public var myMode:int;
public var m6:BitmapData;
public var tr1:BitmapData;
public var tr3:BitmapData;
public var tr4:BitmapData;
public var aPrice:int;
public var tr2:BitmapData;
public var menuOut:Boolean;
public var n1:BitmapData;
public var n2:BitmapData;
public var n3:BitmapData;
public var n5:BitmapData;
public var m5:BitmapData;
public var mobRemain:int;
public var n4:BitmapData;
public var upgradeMenu:Boolean;
public var dtype:int;
public var puller:Boolean;
public var dragr:BitmapData;
public var mySound1:Sound;
public var mySound3:Sound;
public var upgrader:Boolean;
public var bmd2:BitmapData;
public var bmd3:BitmapData;
public var bmd1:BitmapData;
public var rect:Rectangle;
public var redd:MovieClip;
public var b11:BitmapData;
public var b12:BitmapData;
public var b13:BitmapData;
public var pt:Point;
public var r12:SimpleButton;
public var r13:SimpleButton;
public var myStar:BitmapData;
public var s3:BitmapData;
public var b23:BitmapData;
public var s1:BitmapData;
public var b21:BitmapData;
public var s2:BitmapData;
public var highScore:int;
public var aFire:int;
public var t2:BitmapData;
public var t3:BitmapData;
public var t1:BitmapData;
public var b33:BitmapData;
public var b31:BitmapData;
public var myName:String;
public var bigmenu:MovieClip;
public var b43:BitmapData;
public var t4:BitmapData;
public var founder2:int;
public var onBGM:int;
public var b41:BitmapData;
public var st:int;
public var bulletArray:Array;
public var key:int;
public var moveX:int;
public var aTime:int;
public var ranger:MovieClip;
public var NoMenu:ContextMenu;
public var outPoint:Point;
public var survive:Boolean;
public var meFounder;
public var pname:TextField;
public var Chan1:SoundChannel;
public var life:int;
public var tUpgrade:MovieClip;
public var dEffect:int;
public var buyTurret:MovieClip;
public var mainLoader:MovieClip;
public var starArray:Array;
public var aDamage:int;
public var cash:int;
public var myDelay:Number;
public var dRange:int;
public var mobArray:Array;
public var dPrice:int;
public var turretArray:Array;
public var tSeconds:int;
public var maxTurret:int;
public var found:Boolean;
public var dragStart:Boolean;
public var gURL:SimpleButton;
public var gameStart:Boolean;
public var endTxt:TextField;
public var founder:int;
public var detailTxt2:TextField;
public var detailTxt3:TextField;
public var helper:MovieClip;
public var holdCtrl:Boolean;
public var percentTxt:TextField;
public var gameOver:Boolean;
public var mousePoint:Point;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
public function loader(_arg1){
if (currentFrame == 1){
percent = int(((root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal) * 100));
percentTxt.text = String((percent + "% Loaded"));
};
if (percent == 100){
removeEventListener(Event.ENTER_FRAME, loader);
play();
};
}
public function closeWindow(_arg1:MouseEvent){
tUpgrade.visible = false;
ranger.visible = false;
upgrader = false;
clickClose = true;
}
public function MainLoop(_arg1){
var _local2:Rectangle;
var _local3:Point;
var _local4:*;
var _local5:int;
var _local6:*;
var _local7:Number;
var _local8:Point;
var _local9:Point;
var _local10:Point;
var _local11:BitmapData;
var _local12:BitmapData;
var _local13:BitmapData;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
stage.focus = stage;
if ((((survive == true)) && ((mobRemain == 0)))){
startNew();
};
if (((((moveX % lvlSpeed) == 0)) && (!((mobRemain == 0))))){
createMob(1);
if (gameStart == true){
mobRemain--;
};
};
if (moveX != 0){
this.removeChild(bm2);
if (gameStart == true){
if (puller == false){
if (mouseY > 487){
if (bpuller.y > 470){
bpuller.y = (bpuller.y - 3);
} else {
puller = true;
};
} else {
if (mouseY <= 465){
if (bpuller.y < 495){
bpuller.y = (bpuller.y + 3);
} else {
puller = false;
bpuller.y = 495;
};
};
};
} else {
if (mouseY <= 465){
if (bpuller.y < 495){
bpuller.y = (bpuller.y + 3);
} else {
puller = false;
bpuller.y = 495;
};
};
};
bpuller.visible = true;
this.removeChild(detailTxt);
this.removeChild(detailTxt2);
this.removeChild(detailTxt3);
this.removeChild(ranger);
this.removeChild(redd);
this.removeChild(helper);
this.removeChild(bpuller);
if (lvl == 2){
helper.visible = false;
};
if (lvl < 2){
helper.visible = true;
};
helper.gotoAndStop(1);
if (turretArray.length > 0){
helper.gotoAndStop(2);
};
if (dragStart == true){
helper.gotoAndStop(4);
} else {
if (mobArray.length > 0){
helper.gotoAndStop(3);
};
};
if (menuOut == true){
this.removeChild(buyTurret);
menuOut = false;
helper.visible = false;
};
if (upgradeMenu == true){
this.removeChild(tUpgrade);
upgradeMenu = false;
helper.visible = false;
};
} else {
this.removeChild(bigmenu);
};
bmd2.dispose();
bmd2 = new BitmapData(700, 700, false, 0);
};
st = 0;
while (st < starArray.length) {
myStar = this[("s" + starArray[st][0])];
starArray[st][2].x = (starArray[st][2].x - starArray[st][1].x);
starArray[st][2].y = (starArray[st][2].y - starArray[st][1].y);
if (starArray[st][2].y < 90){
starArray[st][2].y = (starArray[st][2].y + 500);
starArray[st][2].x = (50 + rand(550));
};
bmd2.copyPixels(myStar, myStar.rect, starArray[st][2], null, null, false);
st++;
};
totalMob = mobArray.length;
moveX++;
pt.x = 100;
pt.y = 100;
bmd2.copyPixels(planetData, planetData.rect, pt, null, null, false);
meFound = false;
found = false;
mousePoint = new Point((mouseX + 77), (mouseY + 77));
i = 0;
while (i < turretArray.length) {
pt.x = turretArray[i][1].x;
pt.y = turretArray[i][1].y;
if (checkPlacement(turretArray[i][1], mousePoint)){
found = true;
pFounder = i;
};
if (checkPlacement2(turretArray[i][1], mousePoint)){
meFound = true;
meFounder = i;
};
if (turretArray[i][8] > 0){
var _local18 = turretArray[i];
var _local19 = 8;
var _local20 = (_local18[_local19] - 1);
_local18[_local19] = _local20;
};
bmd2.copyPixels(turretArray[i][5], turretArray[i][5].rect, pt, null, null, false);
if (noUpgrade == false){
bmd2.copyPixels(this[("n" + turretArray[i][6])], this[("n" + turretArray[i][6])].rect, new Point((pt.x + 15), (pt.y + 14)), null, null);
};
i++;
};
if (dragStart == true){
pt.x = (mouseX + 77);
pt.y = (mouseY + 77);
ranger.x = (mouseX + 2);
ranger.y = (mouseY + 3);
if ((((found == true)) || ((cash < dPrice)))){
bmd2.copyPixels(dragr, dragr.rect, pt, null, null, false);
} else {
bmd2.copyPixels(drag, drag.rect, pt, null, null, false);
};
} else {
if ((((((dragStart == false)) && ((found == true)))) && ((upgrader == true)))){
ranger.x = (turretArray[founder2][1].x - 77);
ranger.y = (turretArray[founder2][1].y - 77);
};
};
i = 0;
while (i < mobArray.length) {
if (mobArray[i][15] > 0){
_local18 = mobArray[i];
_local19 = 15;
_local20 = (_local18[_local19] - 1);
_local18[_local19] = _local20;
};
if (mobArray[i][15] == 0){
mobArray[i][14] = 0;
};
if (mobArray[i][14] == 1){
mobArray[i][1] = (mobArray[i][1] - (mobArray[i][4] / 4));
mobArray[i][2] = (mobArray[i][2] - (mobArray[i][5] / 4));
} else {
mobArray[i][1] = (mobArray[i][1] - mobArray[i][4]);
mobArray[i][2] = (mobArray[i][2] - mobArray[i][5]);
};
_local18 = mobArray[i];
_local19 = 8;
_local20 = (_local18[_local19] + 1);
_local18[_local19] = _local20;
if (mobArray[i][8] == 29){
mobArray[i][8] = 1;
};
fireFrame = getFire(mobArray[i][8]);
if (mobArray[i][14] == 1){
bmd1 = this[("mb" + mobArray[i][0])];
} else {
bmd1 = mobArray[i][9];
};
pt.x = (mobArray[i][1] + 5);
pt.y = (mobArray[i][2] - 40);
bmd2.copyPixels(fireFrame, fireFrame.rect, pt, null, null, false);
pt.x = mobArray[i][1];
pt.y = mobArray[i][2];
if (mobArray[i][0] == 5){
pt.x = (mobArray[i][1] - 5);
pt.y = (mobArray[i][2] - 5);
};
if (mobArray[i][0] == 6){
pt.x = (mobArray[i][1] - 8);
pt.y = (mobArray[i][2] - 8);
};
if (mobArray[i][0] == 7){
pt.x = (mobArray[i][1] - 20);
pt.y = (mobArray[i][2] - 15);
};
bmd2.copyPixels(bmd1, bmd1.rect, pt, null, null, false);
_local2 = hp1.rect;
_local3 = new Point(pt.x, pt.y);
_local3.x = (_local3.x + 4);
_local3.y = (_local3.y + 4);
if (gameStart == true){
bmd2.copyPixels(hp1, hp1.rect, pt, null, null, false);
};
_local2.width = (_local2.width - 8);
_local2.height = (_local2.height - 8);
_local4 = int(((mobArray[i][10] / mobArray[i][11]) * 100));
_local2.width = ((_local2.width * _local4) / 100);
if (gameStart == true){
bmd2.copyPixels(hp2, _local2, _local3, null, null, false);
};
_local5 = 0;
while (_local5 < turretArray.length) {
if (turretArray[_local5][8] == 0){
if (checkRange(pt, turretArray[_local5][1], turretArray[_local5][7])){
if (mobArray[i][12] < mobArray[i][11]){
turretArray[_local5][8] = int(turretArray[_local5][2]);
_local6 = bulletArray.length;
bulletArray[_local6] = new Array();
bulletArray[_local6][0] = turretArray[_local5][0];
switch (bulletArray[_local6][0]){
case 1:
playSound1();
break;
case 2:
playSound1();
break;
case 3:
playSound3();
break;
};
bulletArray[_local6][1] = new Point((turretArray[_local5][1].x + 12), (turretArray[_local5][1].y + 12));
bulletArray[_local6][2] = new Point((turretArray[_local5][1].x + 12), (turretArray[_local5][1].y + 12));
bulletArray[_local6][3] = new Point((turretArray[_local5][1].x + 12), (turretArray[_local5][1].y + 12));
bulletArray[_local6][4] = ((lookAt(turretArray[_local5][1], pt) - 90) + rand(180));
bulletArray[_local6][5] = 2;
bulletArray[_local6][6] = new int(i);
bulletArray[_local6][7] = turretArray[_local5][3];
bulletArray[_local6][8] = turretArray[_local5][4];
bulletArray[_local6][9] = turretArray[_local5][9];
mobArray[i][12] = (mobArray[i][12] + turretArray[_local5][3]);
};
};
};
_local5++;
};
if (outside(pt)){
mobArray.splice(i, 1);
_local5 = 0;
while (_local5 < bulletArray.length) {
if (int(bulletArray[_local5][6]) == i){
bulletArray.splice(_local5, 1);
_local5--;
};
_local5++;
};
_local5 = 0;
while (_local5 < bulletArray.length) {
if (int(bulletArray[_local5][6]) > i){
_local18 = bulletArray[_local5];
_local19 = 6;
_local20 = (_local18[_local19] - 1);
_local18[_local19] = _local20;
};
_local5++;
};
i--;
if (gameStart == true){
redd.play();
life--;
};
if (life == 0){
removeEventListener(Event.ENTER_FRAME, MainLoop);
buyTurret.t1.removeEventListener(MouseEvent.CLICK, bt);
buyTurret.t2.removeEventListener(MouseEvent.CLICK, bt);
buyTurret.t3.removeEventListener(MouseEvent.CLICK, bt);
buyTurret.t4.removeEventListener(MouseEvent.CLICK, bt);
bigmenu.t1.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t2.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t3.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t4.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t5.removeEventListener(MouseEvent.CLICK, jumpURL2);
tUpgrade.t1.removeEventListener(MouseEvent.CLICK, ut);
tUpgrade.t2.removeEventListener(MouseEvent.CLICK, sell);
tUpgrade.closer.removeEventListener(MouseEvent.CLICK, closeWindow);
stage.removeEventListener(MouseEvent.CLICK, checkMouse);
bpuller.r1.removeEventListener(MouseEvent.CLICK, restarter);
bpuller.r2.removeEventListener(MouseEvent.CLICK, switchBGM);
bpuller.r3.removeEventListener(MouseEvent.CLICK, startBut);
bpuller.t1.removeEventListener(MouseEvent.CLICK, bt);
bpuller.t2.removeEventListener(MouseEvent.CLICK, bt);
bpuller.t3.removeEventListener(MouseEvent.CLICK, bt);
bpuller.t4.removeEventListener(MouseEvent.CLICK, bt);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyEnter);
myTimer.removeEventListener("timer", timedFunction);
detailTxt.visible = false;
detailTxt2.visible = false;
detailTxt3.visible = false;
bulletArray = new Array();
mobArray = new Array();
turretArray = new Array();
bmd2.dispose();
gameOver = true;
gotoAndStop(4);
break;
};
};
i++;
};
_local5 = 0;
while (_local5 < bulletArray.length) {
_local7 = lookAt(bulletArray[_local5][1], new Point(mobArray[bulletArray[_local5][6]][1], mobArray[bulletArray[_local5][6]][2]));
bulletArray[_local5][4] = _local7;
if (bulletArray[_local5][5] < 10){
bulletArray[_local5][5] = (bulletArray[_local5][5] + 0.2);
};
_local8 = new Point(bulletArray[_local5][1].x, bulletArray[_local5][1].y);
_local9 = new Point(bulletArray[_local5][2].x, bulletArray[_local5][2].y);
bulletArray[_local5][3] = new Point(_local9.x, _local9.y);
bulletArray[_local5][2] = new Point(_local8.x, _local8.y);
_local10 = moveByAngle(_local8, bulletArray[_local5][4], bulletArray[_local5][5]);
bulletArray[_local5][1].x = (bulletArray[_local5][1].x - _local10.x);
bulletArray[_local5][1].y = (bulletArray[_local5][1].y - _local10.y);
_local11 = this[(("b" + bulletArray[_local5][0]) + "1")];
_local12 = this[(("b" + bulletArray[_local5][0]) + "2")];
_local13 = this[(("b" + bulletArray[_local5][0]) + "3")];
bmd2.copyPixels(_local13, _local13.rect, bulletArray[_local5][2], null, null, false);
bmd2.copyPixels(_local11, _local11.rect, bulletArray[_local5][1], null, null, false);
_local14 = new int(bulletArray[_local5][6]);
if (bulletArray[_local5][0] == 4){
_local15 = 200;
_local16 = 0;
while (!(checkRange(bulletArray[_local5][1], new Point(mobArray[_local14][1], mobArray[_local14][2]), 10))) {
_local16 = (_local16 + 1);
if ((_local16 % 20) == 0){
_local16 = 0;
_local7 = lookAt(bulletArray[_local5][1], new Point(mobArray[bulletArray[_local5][6]][1], mobArray[bulletArray[_local5][6]][2]));
bulletArray[_local5][4] = _local7;
_local8 = new Point(bulletArray[_local5][1].x, bulletArray[_local5][1].y);
_local10 = moveByAngle(_local8, bulletArray[_local5][4], bulletArray[_local5][5]);
};
if (_local15 > 0){
_local15--;
};
bulletArray[_local5][1].x = ((bulletArray[_local5][1].x - _local10.x) + ((rand(_local15) - rand(_local15)) / 100));
bulletArray[_local5][1].y = ((bulletArray[_local5][1].y - _local10.y) + ((rand(_local15) - rand(_local15)) / 100));
bmd2.copyPixels(_local11, _local11.rect, bulletArray[_local5][1], null, null, false);
};
};
if (checkRange(bulletArray[_local5][1], new Point(mobArray[_local14][1], mobArray[_local14][2]), 30)){
if (bulletArray[_local5][8] == 1){
mobArray[_local14][14] = 1;
mobArray[_local14][15] = bulletArray[_local5][9];
};
mobArray[_local14][10] = (mobArray[_local14][10] - bulletArray[_local5][7]);
if (mobArray[_local14][10] <= 0){
highScore = (highScore + (((mobArray[_local14][13] * mobArray[_local14][13]) * 6) + mobArray[_local14][13]));
cash = (cash + mobArray[_local14][13]);
mobArray.splice(_local14, 1);
_local17 = 0;
while (_local17 < bulletArray.length) {
if (bulletArray[_local17][6] == _local14){
bulletArray.splice(_local17, 1);
_local17--;
};
_local17++;
};
_local17 = 0;
while (_local17 < bulletArray.length) {
if (bulletArray[_local17][6] > _local14){
_local18 = bulletArray[_local17];
_local19 = 6;
_local20 = (_local18[_local19] - 1);
_local18[_local19] = _local20;
};
_local17++;
};
} else {
bulletArray.splice(_local5, 1);
};
_local5--;
};
_local5++;
};
if (moveX >= 50){
moveX = 1;
};
if (gameOver == false){
bm2 = new Bitmap(bmd2);
bm2.x = -100;
bm2.y = -100;
updateString();
if (life != 0){
this.addChild(bm2);
if (gameStart == true){
this.addChild(detailTxt);
this.addChild(detailTxt2);
this.addChild(detailTxt3);
this.addChild(ranger);
this.addChild(redd);
this.addChild(helper);
this.addChild(bpuller);
if (buyMenu == true){
this.addChild(buyTurret);
menuOut = true;
};
if (upgrader == true){
this.addChild(tUpgrade);
upgradeMenu = true;
};
} else {
this.addChild(bigmenu);
};
};
};
}
public function rand(_arg1:int){
return (Math.floor((Math.random() * _arg1)));
}
public function getData(){
switch (turretArray[founder][0]){
case 1:
myGunName = "Gun Turret";
switch (turretArray[founder][6]){
case 1:
aPrice = 17;
aDamage = 5;
aFire = 0;
aRange = 10;
aTime = 0;
break;
case 2:
aPrice = 35;
aDamage = 12;
aFire = 0;
aRange = 10;
aTime = 0;
break;
case 3:
aPrice = 70;
aDamage = 25;
aFire = 0;
aRange = 10;
aTime = 0;
break;
case 4:
aPrice = 200;
aDamage = 75;
aFire = 0;
aRange = 10;
aTime = 0;
break;
};
break;
case 2:
myGunName = "Frozer";
switch (turretArray[founder][6]){
case 1:
aPrice = 20;
aDamage = 3;
aFire = 5;
aRange = 0;
aTime = 20;
break;
case 2:
aPrice = 20;
aDamage = 3;
aFire = 5;
aRange = 0;
aTime = 20;
break;
case 3:
aPrice = 20;
aDamage = 3;
aFire = 5;
aRange = 0;
aTime = 20;
break;
case 4:
aPrice = 200;
aDamage = 22;
aFire = 5;
aRange = 0;
aTime = 320;
break;
};
break;
case 3:
myGunName = "Rapid Turret";
switch (turretArray[founder][6]){
case 1:
aPrice = 30;
aDamage = 1;
aFire = 0;
aRange = 10;
aTime = 0;
break;
case 2:
aPrice = 60;
aDamage = 2;
aFire = 0;
aRange = 10;
aTime = 0;
break;
case 3:
aPrice = 80;
aDamage = 3;
aFire = 0;
aRange = 10;
aTime = 0;
break;
case 4:
aPrice = 250;
aDamage = 10;
aFire = 0;
aRange = 30;
aTime = 0;
break;
};
break;
case 4:
myGunName = "Beam Turret";
switch (turretArray[founder][6]){
case 1:
aPrice = 100;
aDamage = 1;
aFire = 0;
aRange = 10;
aTime = 0;
break;
case 2:
aPrice = 200;
aDamage = 2;
aFire = 0;
aRange = 10;
aTime = 0;
break;
case 3:
aPrice = 300;
aDamage = 4;
aFire = 0;
aRange = 10;
aTime = 0;
break;
case 4:
aPrice = 400;
aDamage = 7;
aFire = 0;
aRange = 0;
aTime = 0;
break;
};
break;
};
}
public function timedFunction(_arg1:TimerEvent){
tSeconds++;
}
public function bt(_arg1:MouseEvent){
clickClose = true;
if (_arg1.target.name == "t1"){
drag = t1;
dragr = tr1;
dragStart = true;
buyMenu = false;
dtype = 1;
dFire = 20;
dDamage = 5;
dEffect = 0;
dPrice = 20;
dRange = 200;
dTime = 0;
};
if (_arg1.target.name == "t2"){
drag = t3;
dragr = tr3;
dragStart = true;
buyMenu = false;
dtype = 2;
dFire = 30;
dDamage = 3;
dEffect = 1;
dPrice = 30;
dRange = 400;
dTime = 300;
};
if (_arg1.target.name == "t3"){
drag = t2;
dragr = tr2;
dragStart = true;
buyMenu = false;
dtype = 3;
dFire = 3;
dDamage = 2;
dEffect = 0;
dPrice = 80;
dRange = 300;
dTime = 0;
};
if (_arg1.target.name == "t4"){
drag = t4;
dragr = tr4;
dragStart = true;
buyMenu = false;
dtype = 4;
dFire = 1;
dDamage = 1;
dEffect = 0;
dPrice = 140;
dRange = 200;
dTime = 0;
};
ranger.visible = true;
ranger.width = dRange;
ranger.height = dRange;
}
public function createMob(_arg1:int){
var _local2:int;
var _local3:Point;
var _local4:int;
var _local5:Point;
var _local6:int;
_local2 = mobArray.length;
mobArray[_local2] = new Array();
mobArray[_local2][0] = _arg1;
_local3 = new Point();
_local3.x = (100 + rand(460));
_local3.y = -100;
mobArray[_local2][1] = _local3.x;
mobArray[_local2][2] = _local3.y;
if (_local3.x > 280){
_local4 = (rand(10) + 270);
};
if (_local3.x <= 280){
_local4 = (rand(10) + 260);
};
mobArray[_local2][3] = ((_local4 * Math.PI) / 180);
mobArray[_local2][6] = ((1000 + rand(3000)) / 1000);
_local5 = moveByAngle(_local3, mobArray[_local2][3], mobArray[_local2][6]);
mobArray[_local2][4] = _local5.x;
mobArray[_local2][5] = _local5.y;
mobArray[_local2][7] = 1;
mobArray[_local2][8] = 1;
if (lvl == 0){
_local6 = (rand(4) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 1){
_local6 = (rand(1) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 2){
_local6 = (rand(2) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 3){
_local6 = (rand(2) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 4){
_local6 = (rand(2) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 5){
_local6 = (rand(1) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 6){
_local6 = (rand(3) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 7){
_local6 = (rand(3) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 8){
_local6 = (rand(4) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 9){
_local6 = (rand(4) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 10){
_local6 = (rand(4) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 11){
_local6 = (rand(5) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 12){
_local6 = (rand(5) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 13){
_local6 = (rand(5) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl == 14){
_local6 = (rand(6) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if (lvl >= 15){
_local6 = (rand(6) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
if ((((lvl > 3)) || ((lvl == 0)))){
if ((((rand(100) + 1) - (lvl * 2)) % 99) == 1){
_local6 = ((4 + rand(3)) + 1);
mobArray[_local2][9] = this[("m" + _local6)];
};
};
switch (_local6){
case 1:
mobArray[_local2][10] = ((3 * lvl) + 2);
mobArray[_local2][11] = ((3 * lvl) + 2);
mobArray[_local2][13] = 1;
break;
case 2:
mobArray[_local2][10] = ((6 * lvl) + 2);
mobArray[_local2][11] = ((6 * lvl) + 2);
mobArray[_local2][13] = 3;
break;
case 3:
mobArray[_local2][10] = ((13 * lvl) + 3);
mobArray[_local2][11] = ((13 * lvl) + 3);
mobArray[_local2][13] = 5;
break;
case 4:
mobArray[_local2][10] = ((16 * lvl) + 5);
mobArray[_local2][11] = ((16 * lvl) + 5);
mobArray[_local2][13] = 6;
break;
case 5:
mobArray[_local2][10] = ((21 * lvl) + 15);
mobArray[_local2][11] = ((21 * lvl) + 15);
mobArray[_local2][13] = 10;
break;
case 6:
mobArray[_local2][10] = ((32 * lvl) + 20);
mobArray[_local2][11] = ((32 * lvl) + 20);
mobArray[_local2][13] = 20;
break;
case 7:
mobArray[_local2][10] = ((48 * lvl) + 30);
mobArray[_local2][11] = ((48 * lvl) + 30);
mobArray[_local2][13] = 45;
break;
};
mobArray[_local2][0] = _local6;
if (lvl < 20){
mobArray[_local2][10] = int((mobArray[_local2][10] * (((lvl * 3) + 100) / 100)));
mobArray[_local2][11] = int((mobArray[_local2][11] * (((lvl * 3) + 100) / 100)));
} else {
mobArray[_local2][10] = int((mobArray[_local2][10] * (((lvl * (lvl - 17)) + 100) / 100)));
mobArray[_local2][11] = int((mobArray[_local2][11] * (((lvl * (lvl - 17)) + 100) / 100)));
};
mobArray[_local2][12] = 0;
mobArray[_local2][14] = 0;
mobArray[_local2][15] = 0;
}
function frame2(){
linkpantalla.addEventListener(MouseEvent.CLICK, iraplay);
addEventListener(Event.ENTER_FRAME, checa);
stop();
MochiBot.track(this, "ad923900");
}
function frame3(){
botonlink1.addEventListener(MouseEvent.CLICK, iralink4);
BGM = new myBGM();
onBGM = 1;
Chan1 = BGM.play(0, 99999);
mySound1 = new sound1();
mySound3 = new sound3();
myTimer = new Timer(1000);
tSeconds = 0;
myTimer.addEventListener("timer", timedFunction);
myTimer.start();
bigmenu.t5.addEventListener(MouseEvent.CLICK, jumpURL2);
bigmenu.t6.addEventListener(MouseEvent.CLICK, irawalk);
addEventListener(Event.ENTER_FRAME, MainLoop);
bpuller.r1.addEventListener(MouseEvent.CLICK, restarter);
bpuller.r2.addEventListener(MouseEvent.CLICK, switchBGM);
bpuller.r3.addEventListener(MouseEvent.CLICK, startBut);
bpuller.t1.addEventListener(MouseEvent.CLICK, bt);
bpuller.t2.addEventListener(MouseEvent.CLICK, bt);
bpuller.t3.addEventListener(MouseEvent.CLICK, bt);
bpuller.t4.addEventListener(MouseEvent.CLICK, bt);
buyTurret.t1.addEventListener(MouseEvent.CLICK, bt);
buyTurret.t2.addEventListener(MouseEvent.CLICK, bt);
buyTurret.t3.addEventListener(MouseEvent.CLICK, bt);
buyTurret.t4.addEventListener(MouseEvent.CLICK, bt);
bigmenu.t1.addEventListener(MouseEvent.CLICK, mt);
bigmenu.t2.addEventListener(MouseEvent.CLICK, mt);
bigmenu.t3.addEventListener(MouseEvent.CLICK, mt);
bigmenu.t4.addEventListener(MouseEvent.CLICK, mt);
tUpgrade.t1.addEventListener(MouseEvent.CLICK, ut);
tUpgrade.t2.addEventListener(MouseEvent.CLICK, sell);
stage.addEventListener(MouseEvent.CLICK, checkMouse);
tUpgrade.closer.addEventListener(MouseEvent.CLICK, closeWindow);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyEnter);
stage.addEventListener(KeyboardEvent.KEY_UP, clearKey);
detailTxt.visible = true;
detailTxt2.visible = true;
detailTxt3.visible = true;
lvl = 0;
mobRemain = 5000;
cash = 1000;
life = 10;
noUpgrade = false;
found = false;
turretArray = new Array();
bulletArray = new Array();
upgradeMenu = false;
upgrader = false;
clickClose = false;
mobArray = new Array();
basePoint = new Point();
bmd1 = new ship1(0, 0);
bmd2 = new BitmapData(700, 700);
dragStart = false;
planetData = new planet(0, 0);
hp1 = new hpbar(0, 0);
hp2 = new rd(0, 0);
b11 = new bullet11(0, 0);
b12 = new bullet12(0, 0);
b13 = new bullet13(0, 0);
b21 = new bullet21(0, 0);
b23 = new bullet23(0, 0);
b31 = new bullet31(0, 0);
b33 = new bullet33(0, 0);
b41 = new bullet41(0, 0);
b43 = new bullet41(0, 0);
t1 = new tower1(0, 0);
t2 = new tower2(0, 0);
t3 = new tower3(0, 0);
t4 = new tower4(0, 0);
tr1 = new tower1r(0, 0);
tr2 = new tower2r(0, 0);
tr3 = new tower3r(0, 0);
tr4 = new tower4r(0, 0);
m1 = new ship1(0, 0);
m2 = new ship2(0, 0);
m3 = new ship3(0, 0);
m4 = new ship4(0, 0);
m5 = new ship5b(0, 0);
m6 = new ship6(0, 0);
m7 = new ship7(0, 0);
n1 = new num1(0, 0);
n2 = new num2(0, 0);
n3 = new num3(0, 0);
n4 = new num4(0, 0);
n5 = new num5(0, 0);
mb1 = new ship1b(0, 0);
mb2 = new ship2b(0, 0);
mb3 = new ship3b(0, 0);
mb4 = new ship4b(0, 0);
mb5 = new ship5b(0, 0);
mb6 = new ship6(0, 0);
mb7 = new ship7(0, 0);
f1 = new fire1(0, 0);
f2 = new fire2(0, 0);
f3 = new fire3(0, 0);
f4 = new fire4(0, 0);
f5 = new fire5(0, 0);
f6 = new fire6(0, 0);
f7 = new fire7(0, 0);
f8 = new fire8(0, 0);
f9 = new fire9(0, 0);
f10 = new fire10(0, 0);
f11 = new fire11(0, 0);
f12 = new fire12(0, 0);
f13 = new fire13(0, 0);
f14 = new fire14(0, 0);
f15 = new fire15(0, 0);
f16 = new fire16(0, 0);
f17 = new fire17(0, 0);
f18 = new fire18(0, 0);
f19 = new fire19(0, 0);
f20 = new fire20(0, 0);
f21 = new fire21(0, 0);
f22 = new fire22(0, 0);
f23 = new fire23(0, 0);
f24 = new fire24(0, 0);
f25 = new fire25(0, 0);
f26 = new fire26(0, 0);
f27 = new fire27(0, 0);
f28 = new fire28(0, 0);
s1 = new star1(0, 0);
s2 = new star2(0, 0);
s3 = new star3(0, 0);
starArray = new Array();
buyMenu = false;
gameStart = false;
holdCtrl = false;
moveX = 0;
pt = new Point(0, 0);
lvlSpeed = 2;
puller = false;
highScore = 0;
outPoint = new Point();
menuOut = false;
survive = false;
gameOver = false;
initStar();
init();
updateString();
bpuller.visible = false;
tUpgrade.visible = false;
this.removeChild(buyTurret);
this.removeChild(tUpgrade);
stop();
}
function frame4(){
botonlink1.addEventListener(MouseEvent.CLICK, iralink2);
r13.addEventListener(MouseEvent.CLICK, irainicio);
submit.addEventListener(MouseEvent.CLICK, sendScore);
endTxt.text = ("Your final score\n" + highScore);
}
function frame5(){
botonlink1.addEventListener(MouseEvent.CLICK, iralink3);
endTxt.text = ("Your final score\n" + highScore);
r12.addEventListener(MouseEvent.CLICK, restarter2);
gURL.addEventListener(MouseEvent.CLICK, jumpURL);
}
function frame1(){
botonlink1.addEventListener(MouseEvent.CLICK, iralink1);
addEventListener(Event.ENTER_FRAME, loader);
myName = "";
myMode = 0;
NoMenu = new ContextMenu();
NoMenu.hideBuiltInItems();
this.contextMenu = NoMenu;
stop();
}
public function checkMouse(_arg1:MouseEvent){
if ((((((dragStart == true)) && ((menuOut == false)))) && ((clickClose == false)))){
if ((((found == false)) && ((cash >= dPrice)))){
maxTurret = turretArray.length;
turretArray[maxTurret] = new Array();
turretArray[maxTurret][0] = dtype;
turretArray[maxTurret][1] = mousePoint;
turretArray[maxTurret][2] = dFire;
turretArray[maxTurret][3] = dDamage;
turretArray[maxTurret][4] = dEffect;
turretArray[maxTurret][5] = drag;
turretArray[maxTurret][6] = 1;
turretArray[maxTurret][7] = dRange;
turretArray[maxTurret][8] = 0;
turretArray[maxTurret][9] = dTime;
turretArray[maxTurret][10] = int((dPrice / 2));
cash = (cash - dPrice);
if (holdCtrl == false){
dragStart = false;
ranger.visible = false;
tUpgrade.visible = false;
};
} else {
if (holdCtrl == false){
placementError();
};
};
} else {
if ((((noUpgrade == false)) && ((clickClose == false)))){
if ((((dragStart == false)) && ((meFound == true)))){
if (mouseX > 250){
tUpgrade.x = 105;
} else {
tUpgrade.x = 394;
};
founder2 = meFounder;
founder = meFounder;
tUpgrade.gotoAndStop(turretArray[founder][0]);
getData();
tUpgrade.dName.text = myGunName;
tUpgrade.dDetails.text = ((((((((((("Level: " + turretArray[founder][6]) + "\nDamage: ") + turretArray[founder][3]) + "\nFire Ratio: ") + turretArray[founder][2]) + "\nRange: ") + turretArray[founder][7]) + "\n\nValue: $") + turretArray[founder][10]) + "\nUpgrade Cost: $") + aPrice);
if (turretArray[founder][6] < 5){
tUpgrade.t1.visible = true;
} else {
tUpgrade.t1.visible = false;
};
tUpgrade.visible = true;
upgrader = true;
ranger.width = turretArray[founder][7];
ranger.height = turretArray[founder][7];
ranger.visible = true;
};
} else {
clickClose = false;
};
};
}
public function irainicio(_arg1:MouseEvent):void{
Chan1.stop();
gotoAndStop(2);
}
public function restarter2(_arg1){
Chan1.stop();
gURL.removeEventListener(MouseEvent.CLICK, jumpURL);
r12.removeEventListener(MouseEvent.CLICK, restarter2);
gotoAndPlay(2);
}
public function clearKey(_arg1){
holdCtrl = false;
}
public function checa(_arg1:Event){
if (mainLoader.currentFrame == 143){
removeEventListener(Event.ENTER_FRAME, checa);
play();
};
}
public function init(){
basePoint.x = 350;
basePoint.y = 700;
}
public function checkPlacement2(_arg1:Point, _arg2:Point){
if ((((_arg2.x > (_arg1.x - 20))) && ((_arg2.x < (_arg1.x + 20))))){
if ((((_arg2.y > (_arg1.y - 20))) && ((_arg2.y < (_arg1.y + 20))))){
return (true);
};
};
}
public function switchBGM(_arg1){
if (onBGM == 1){
Chan1.stop();
onBGM = 0;
} else {
Chan1 = BGM.play(0, 99999);
onBGM = 1;
};
}
public function playSound1(){
if (onBGM == 1){
mySound1.play();
};
}
public function playSound3(){
if (onBGM == 1){
mySound3.play();
};
}
public function checkRange(_arg1:Point, _arg2:Point, _arg3:int){
var _local4:Number;
_local4 = (_arg3 / 2);
if ((((_arg2.x > (_arg1.x - _local4))) && ((_arg2.x < (_arg1.x + _local4))))){
if ((((_arg2.y > (_arg1.y - _local4))) && ((_arg2.y < (_arg1.y + _local4))))){
return (true);
};
};
}
public function outside(_arg1:Point){
if (_arg1.y > 600){
return (true);
};
}
public function mt(_arg1:MouseEvent){
if (_arg1.target.name == "t1"){
myMode = 1;
gameStart = true;
lvl = 0;
mobRemain = 0;
mobArray = new Array();
cash = 200;
bigmenu.t1.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t2.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t3.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t4.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t5.removeEventListener(MouseEvent.CLICK, jumpURL2);
this.removeChild(bigmenu);
};
if (_arg1.target.name == "t2"){
myMode = 2;
gameStart = true;
lvl = 0;
mobRemain = 0;
mobArray = new Array();
cash = 200;
survive = true;
bigmenu.t1.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t2.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t3.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t4.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t5.removeEventListener(MouseEvent.CLICK, jumpURL2);
this.removeChild(bigmenu);
};
if (_arg1.target.name == "t3"){
myMode = 3;
gameStart = true;
lvl = 0;
mobRemain = 0;
mobArray = new Array();
cash = 200;
noUpgrade = true;
bigmenu.t1.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t2.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t3.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t4.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t5.removeEventListener(MouseEvent.CLICK, jumpURL2);
this.removeChild(bigmenu);
};
if (_arg1.target.name == "t4"){
myMode = 4;
gameStart = true;
lvl = 9;
mobRemain = 0;
mobArray = new Array();
cash = 10000;
bigmenu.t1.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t2.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t3.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t4.removeEventListener(MouseEvent.CLICK, mt);
bigmenu.t5.removeEventListener(MouseEvent.CLICK, jumpURL2);
this.removeChild(bigmenu);
};
}
public function moveByAngle(_arg1, _arg2, _arg3){
_arg1.x = (Math.cos(_arg2) * _arg3);
_arg1.y = (Math.sin(_arg2) * _arg3);
return (_arg1);
}
public function startNew(){
if ((((((((mobRemain == 0)) && (!((life == 0))))) && ((mobArray.length == 0)))) || ((survive == true)))){
lvl++;
switch (lvl){
case 1:
mobRemain = 70;
lvlSpeed = 7;
break;
case 2:
mobRemain = 50;
lvlSpeed = 8;
break;
case 3:
mobRemain = 100;
lvlSpeed = 6;
break;
case 4:
mobRemain = 150;
lvlSpeed = 5;
break;
case 5:
mobRemain = 150;
lvlSpeed = 4;
break;
case 6:
mobRemain = 250;
lvlSpeed = 5;
break;
case 7:
mobRemain = 250;
lvlSpeed = 4;
break;
case 8:
mobRemain = 250;
lvlSpeed = 4;
break;
case 9:
mobRemain = 300;
lvlSpeed = 3;
break;
case 10:
mobRemain = 300;
lvlSpeed = 3;
break;
case 11:
mobRemain = 300;
lvlSpeed = 3;
break;
case 12:
mobRemain = 500;
lvlSpeed = 2;
break;
case 13:
mobRemain = 500;
lvlSpeed = 2;
break;
case 14:
mobRemain = 700;
lvlSpeed = 2;
break;
case 15:
mobRemain = 700;
lvlSpeed = 1;
break;
case 16:
mobRemain = 400;
lvlSpeed = 1;
break;
case 17:
mobRemain = 600;
lvlSpeed = 1;
break;
case 18:
mobRemain = 800;
lvlSpeed = 1;
break;
case 19:
mobRemain = 1000;
lvlSpeed = 1;
break;
default:
mobRemain = 2000;
lvlSpeed = 1;
break;
};
};
}
public function jumpURL2(_arg1){
var _local2:*;
_local2 = new URLRequest("http://www.playtowerdefensegames.com");
navigateToURL(_local2);
}
public function upgradeScript(){
var _local1:String;
if ((((cash >= aPrice)) && ((turretArray[founder][6] < 5)))){
getData();
_local1 = (((((((((((((((((((("Level: " + turretArray[founder][6]) + "<font color='#00FF00'>+") + 1) + "</font>\nDamage: ") + turretArray[founder][3]) + "<font color='#00FF00'>+") + aDamage) + "</font>\nFire Ratio: ") + turretArray[founder][2]) + "<font color='#00FF00'>+") + aFire) + "</font>\nRange: ") + turretArray[founder][7]) + "<font color='#00FF00'>+") + aRange) + "</font>\n\nValue: $") + turretArray[founder][10]) + "<font color='#00FF00'>+") + int((aPrice / 2))) + "</font>");
cash = (cash - aPrice);
var _local2 = turretArray[founder];
var _local3 = 6;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
turretArray[founder][3] = (turretArray[founder][3] + aDamage);
turretArray[founder][10] = (turretArray[founder][10] + int((aPrice / 2)));
turretArray[founder][9] = (turretArray[founder][9] + aTime);
turretArray[founder][2] = (turretArray[founder][2] - aFire);
turretArray[founder][7] = (turretArray[founder][7] + aRange);
getData();
tUpgrade.dDetails.htmlText = ((_local1 + "\nUpgrade Price: $") + aPrice);
ranger.width = turretArray[founder][7];
ranger.height = turretArray[founder][7];
if (turretArray[founder][6] < 5){
tUpgrade.t1.visible = true;
} else {
tUpgrade.t1.visible = false;
};
};
}
public function irawalk(_arg1){
var _local2:*;
_local2 = new URLRequest("http://www.playtowerdefensegames.com/forum/viewtopic.php?f=6&t=31");
navigateToURL(_local2);
}
public function iralink4(_arg1){
var _local2:*;
_local2 = new URLRequest("http://www.playtowerdefensegames.com");
navigateToURL(_local2);
}
public function iralink1(_arg1){
var _local2:*;
_local2 = new URLRequest("http://www.playtowerdefensegames.com");
navigateToURL(_local2);
}
public function iralink2(_arg1){
var _local2:*;
_local2 = new URLRequest("http://www.playtowerdefensegames.com");
navigateToURL(_local2);
}
public function iralink3(_arg1){
var _local2:*;
_local2 = new URLRequest("http://www.playtowerdefensegames.com");
navigateToURL(_local2);
}
public function placementError(){
dragStart = false;
ranger.visible = false;
}
public function updateString(){
detailTxt.text = String(((("Wave: " + lvl) + "\nRemaining vectors: ") + mobRemain));
detailTxt2.text = String(((("Cash: $" + cash) + "\nLife: ") + life));
detailTxt3.text = String(("High Score: " + highScore));
}
public function jumpURL(_arg1){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.webgames.bz/highScore.php?id=1");
navigateToURL(_local2);
}
public function ut(_arg1:MouseEvent){
if (noUpgrade == false){
if (_arg1.target.name == "t1"){
upgradeScript();
};
if (_arg1.target.name == "t2"){
sellScript();
};
};
}
public function getFire(_arg1:int){
return (this[("f" + _arg1)]);
}
public function sellScript(){
if (upgrader == true){
cash = (cash + turretArray[founder][10]);
turretArray.splice(founder, 1);
meFound = false;
found = false;
tUpgrade.visible = false;
ranger.visible = false;
upgrader = false;
};
}
public function startBut(_arg1){
startNew();
}
public function rRed(_arg1:BitmapData){
if (_arg1 == t1){
_arg1 = tr1;
};
if (_arg1 == t2){
_arg1 = tr2;
};
if (_arg1 == t3){
_arg1 = tr3;
};
if (_arg1 == t4){
_arg1 = tr4;
};
return (_arg1);
}
public function checkPlacement(_arg1:Point, _arg2:Point){
if ((((_arg2.x > (_arg1.x - 35))) && ((_arg2.x < (_arg1.x + 35))))){
if ((((_arg2.y > (_arg1.y - 35))) && ((_arg2.y < (_arg1.y + 35))))){
return (true);
};
};
}
public function restarter(_arg1){
Chan1.stop();
bpuller.r1.removeEventListener(MouseEvent.CLICK, restarter);
gotoAndPlay(2);
}
public function lookAt(_arg1:Point, _arg2:Point){
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local4 = (_arg1.x - _arg2.x);
_local5 = (_arg1.y - _arg2.y);
_local3 = Math.atan2(_local5, _local4);
return (_local3);
}
public function sell(_arg1:MouseEvent){
sellScript();
}
public function initStar(){
st = 0;
while (st < 20) {
starArray[st] = new Array();
starArray[st][0] = 1;
starArray[st][1] = new Point();
starArray[st][1].x = 0;
starArray[st][1].y = 0.5;
starArray[st][2] = new Point();
starArray[st][2].x = (50 + rand(550));
starArray[st][2].y = (50 + rand(550));
st++;
};
st = 20;
while (st < 60) {
starArray[st] = new Array();
starArray[st][0] = 2;
starArray[st][1] = new Point();
starArray[st][1].x = 0;
starArray[st][1].y = 1.5;
starArray[st][2] = new Point();
starArray[st][2].x = (50 + rand(550));
starArray[st][2].y = (50 + rand(550));
st++;
};
st = 60;
while (st < 80) {
starArray[st] = new Array();
starArray[st][0] = 3;
starArray[st][1] = new Point();
starArray[st][1].x = 0;
starArray[st][1].y = 1;
starArray[st][2] = new Point();
starArray[st][2].x = (50 + rand(550));
starArray[st][2].y = (50 + rand(550));
st++;
};
}
public function iraplay(_arg1){
var _local2:*;
_local2 = new URLRequest("http://www.playtowerdefensegames.com");
navigateToURL(_local2);
}
public function keyEnter(_arg1):void{
key = _arg1.keyCode;
switch (key){
case Keyboard.SPACE:
if (gameStart == true){
startNew();
break;
};
case 66:
if (gameStart == true){
if (buyMenu == true){
buyMenu = false;
} else {
ranger.visible = false;
tUpgrade.visible = false;
buyMenu = true;
};
};
break;
case 83:
sellScript();
break;
case 85:
upgradeScript();
break;
};
if (key == 17){
holdCtrl = true;
};
if (key == 27){
ranger.visible = false;
tUpgrade.visible = false;
buyMenu = false;
dragStart = false;
};
}
public function sendScore(_arg1:Event){
var _local2:String;
var _local3:URLRequest;
var _local4:*;
trace(pname.text);
if (myMode == 1){
_local2 = "http://playtowerdefensegames.com/highscores/submit/play4scores.php";
_local3 = new URLRequest(_local2);
_local3.method = URLRequestMethod.POST;
_local4 = new URLVariables();
_local4.game_id = 710;
_local4.user_id = pname.text;
_local4.score = highScore;
_local3.data = _local4;
sendToURL(_local3);
navigateToURL(new URLRequest("http://playtowerdefensegames.com/index.php?action=highscores&gameid=710"));
};
if (myMode == 2){
_local2 = "http://playtowerdefensegames.com/highscores/submit/play4scores.php";
_local3 = new URLRequest(_local2);
_local3.method = URLRequestMethod.POST;
_local4 = new URLVariables();
_local4.game_id = 711;
_local4.user_id = pname.text;
_local4.score = highScore;
_local3.data = _local4;
sendToURL(_local3);
navigateToURL(new URLRequest("http://playtowerdefensegames.com/index.php?action=highscores&gameid=711"));
};
if (myMode == 3){
_local2 = "http://playtowerdefensegames.com/highscores/submit/play4scores.php";
_local3 = new URLRequest(_local2);
_local3.method = URLRequestMethod.POST;
_local4 = new URLVariables();
_local4.game_id = 712;
_local4.user_id = pname.text;
_local4.score = highScore;
_local3.data = _local4;
sendToURL(_local3);
navigateToURL(new URLRequest("http://playtowerdefensegames.com/index.php?action=highscores&gameid=712"));
};
if (myMode == 4){
_local2 = "http://playtowerdefensegames.com/highscores/submit/play4scores.php";
_local3 = new URLRequest(_local2);
_local3.method = URLRequestMethod.POST;
_local4 = new URLVariables();
_local4.game_id = 713;
_local4.user_id = pname.text;
_local4.score = highScore;
_local3.data = _local4;
sendToURL(_local3);
navigateToURL(new URLRequest("http://playtowerdefensegames.com/index.php?action=highscores&gameid=713"));
};
}
public function rNormal(_arg1:BitmapData){
if (_arg1 == tr1){
_arg1 = t1;
};
if (_arg1 == tr2){
_arg1 = t2;
};
if (_arg1 == tr3){
_arg1 = t3;
};
if (_arg1 == tr4){
_arg1 = t4;
};
return (_arg1);
}
}
}//package VectorCS31_fla
Section 2
//Timeline_27 (VectorCS31_fla.Timeline_27)
package VectorCS31_fla {
import flash.display.*;
public dynamic class Timeline_27 extends MovieClip {
public function Timeline_27(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package VectorCS31_fla
Section 3
//Timeline_33 (VectorCS31_fla.Timeline_33)
package VectorCS31_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Timeline_33 extends MovieClip {
public var dName:TextField;
public var t2:SimpleButton;
public var t1:SimpleButton;
public var dDetails:TextField;
public var closer:SimpleButton;
public var dType:MovieClip;
public function Timeline_33(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package VectorCS31_fla
Section 4
//Timeline_42 (VectorCS31_fla.Timeline_42)
package VectorCS31_fla {
import flash.display.*;
public dynamic class Timeline_42 extends MovieClip {
public var t2:SimpleButton;
public var t3:SimpleButton;
public var t1:SimpleButton;
public var t5:SimpleButton;
public var t4:SimpleButton;
public var t6:SimpleButton;
}
}//package VectorCS31_fla
Section 5
//Timeline_56 (VectorCS31_fla.Timeline_56)
package VectorCS31_fla {
import flash.display.*;
public dynamic class Timeline_56 extends MovieClip {
public var r2:SimpleButton;
public var r3:SimpleButton;
public var t2:SimpleButton;
public var t3:SimpleButton;
public var t1:SimpleButton;
public var t4:SimpleButton;
public var r1:SimpleButton;
}
}//package VectorCS31_fla
Section 6
//Timeline_6 (VectorCS31_fla.Timeline_6)
package VectorCS31_fla {
import flash.display.*;
public dynamic class Timeline_6 extends MovieClip {
public var t2:SimpleButton;
public var t3:SimpleButton;
public var t1:SimpleButton;
public var t4:SimpleButton;
}
}//package VectorCS31_fla
Section 7
//Timeline_65 (VectorCS31_fla.Timeline_65)
package VectorCS31_fla {
import flash.display.*;
public dynamic class Timeline_65 extends MovieClip {
public function Timeline_65(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package VectorCS31_fla
Section 8
//bullet11 (bullet11)
package {
import flash.display.*;
public dynamic class bullet11 extends BitmapData {
public function bullet11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 9
//bullet12 (bullet12)
package {
import flash.display.*;
public dynamic class bullet12 extends BitmapData {
public function bullet12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 10
//bullet13 (bullet13)
package {
import flash.display.*;
public dynamic class bullet13 extends BitmapData {
public function bullet13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 11
//bullet21 (bullet21)
package {
import flash.display.*;
public dynamic class bullet21 extends BitmapData {
public function bullet21(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 12
//bullet23 (bullet23)
package {
import flash.display.*;
public dynamic class bullet23 extends BitmapData {
public function bullet23(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 13
//bullet31 (bullet31)
package {
import flash.display.*;
public dynamic class bullet31 extends BitmapData {
public function bullet31(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 14
//bullet33 (bullet33)
package {
import flash.display.*;
public dynamic class bullet33 extends BitmapData {
public function bullet33(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 15
//bullet41 (bullet41)
package {
import flash.display.*;
public dynamic class bullet41 extends BitmapData {
public function bullet41(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 16
//fire1 (fire1)
package {
import flash.display.*;
public dynamic class fire1 extends BitmapData {
public function fire1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 17
//fire10 (fire10)
package {
import flash.display.*;
public dynamic class fire10 extends BitmapData {
public function fire10(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 18
//fire11 (fire11)
package {
import flash.display.*;
public dynamic class fire11 extends BitmapData {
public function fire11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 19
//fire12 (fire12)
package {
import flash.display.*;
public dynamic class fire12 extends BitmapData {
public function fire12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 20
//fire13 (fire13)
package {
import flash.display.*;
public dynamic class fire13 extends BitmapData {
public function fire13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 21
//fire14 (fire14)
package {
import flash.display.*;
public dynamic class fire14 extends BitmapData {
public function fire14(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 22
//fire15 (fire15)
package {
import flash.display.*;
public dynamic class fire15 extends BitmapData {
public function fire15(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 23
//fire16 (fire16)
package {
import flash.display.*;
public dynamic class fire16 extends BitmapData {
public function fire16(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 24
//fire17 (fire17)
package {
import flash.display.*;
public dynamic class fire17 extends BitmapData {
public function fire17(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 25
//fire18 (fire18)
package {
import flash.display.*;
public dynamic class fire18 extends BitmapData {
public function fire18(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 26
//fire19 (fire19)
package {
import flash.display.*;
public dynamic class fire19 extends BitmapData {
public function fire19(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 27
//fire2 (fire2)
package {
import flash.display.*;
public dynamic class fire2 extends BitmapData {
public function fire2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 28
//fire20 (fire20)
package {
import flash.display.*;
public dynamic class fire20 extends BitmapData {
public function fire20(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 29
//fire21 (fire21)
package {
import flash.display.*;
public dynamic class fire21 extends BitmapData {
public function fire21(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 30
//fire22 (fire22)
package {
import flash.display.*;
public dynamic class fire22 extends BitmapData {
public function fire22(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 31
//fire23 (fire23)
package {
import flash.display.*;
public dynamic class fire23 extends BitmapData {
public function fire23(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 32
//fire24 (fire24)
package {
import flash.display.*;
public dynamic class fire24 extends BitmapData {
public function fire24(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 33
//fire25 (fire25)
package {
import flash.display.*;
public dynamic class fire25 extends BitmapData {
public function fire25(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 34
//fire26 (fire26)
package {
import flash.display.*;
public dynamic class fire26 extends BitmapData {
public function fire26(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 35
//fire27 (fire27)
package {
import flash.display.*;
public dynamic class fire27 extends BitmapData {
public function fire27(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 36
//fire28 (fire28)
package {
import flash.display.*;
public dynamic class fire28 extends BitmapData {
public function fire28(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 37
//fire3 (fire3)
package {
import flash.display.*;
public dynamic class fire3 extends BitmapData {
public function fire3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 38
//fire4 (fire4)
package {
import flash.display.*;
public dynamic class fire4 extends BitmapData {
public function fire4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 39
//fire5 (fire5)
package {
import flash.display.*;
public dynamic class fire5 extends BitmapData {
public function fire5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 40
//fire6 (fire6)
package {
import flash.display.*;
public dynamic class fire6 extends BitmapData {
public function fire6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 41
//fire7 (fire7)
package {
import flash.display.*;
public dynamic class fire7 extends BitmapData {
public function fire7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 42
//fire8 (fire8)
package {
import flash.display.*;
public dynamic class fire8 extends BitmapData {
public function fire8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 43
//fire9 (fire9)
package {
import flash.display.*;
public dynamic class fire9 extends BitmapData {
public function fire9(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 44
//hpbar (hpbar)
package {
import flash.display.*;
public dynamic class hpbar extends BitmapData {
public function hpbar(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 45
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 46
//myBGM (myBGM)
package {
import flash.media.*;
public dynamic class myBGM extends Sound {
}
}//package
Section 47
//num1 (num1)
package {
import flash.display.*;
public dynamic class num1 extends BitmapData {
public function num1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 48
//num2 (num2)
package {
import flash.display.*;
public dynamic class num2 extends BitmapData {
public function num2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 49
//num3 (num3)
package {
import flash.display.*;
public dynamic class num3 extends BitmapData {
public function num3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 50
//num4 (num4)
package {
import flash.display.*;
public dynamic class num4 extends BitmapData {
public function num4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 51
//num5 (num5)
package {
import flash.display.*;
public dynamic class num5 extends BitmapData {
public function num5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 52
//planet (planet)
package {
import flash.display.*;
public dynamic class planet extends BitmapData {
public function planet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 53
//rd (rd)
package {
import flash.display.*;
public dynamic class rd extends BitmapData {
public function rd(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 54
//ship1 (ship1)
package {
import flash.display.*;
public dynamic class ship1 extends BitmapData {
public function ship1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 55
//ship1b (ship1b)
package {
import flash.display.*;
public dynamic class ship1b extends BitmapData {
public function ship1b(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 56
//ship2 (ship2)
package {
import flash.display.*;
public dynamic class ship2 extends BitmapData {
public function ship2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 57
//ship2b (ship2b)
package {
import flash.display.*;
public dynamic class ship2b extends BitmapData {
public function ship2b(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 58
//ship3 (ship3)
package {
import flash.display.*;
public dynamic class ship3 extends BitmapData {
public function ship3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 59
//ship3b (ship3b)
package {
import flash.display.*;
public dynamic class ship3b extends BitmapData {
public function ship3b(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 60
//ship4 (ship4)
package {
import flash.display.*;
public dynamic class ship4 extends BitmapData {
public function ship4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 61
//ship4b (ship4b)
package {
import flash.display.*;
public dynamic class ship4b extends BitmapData {
public function ship4b(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 62
//ship5 (ship5)
package {
import flash.display.*;
public dynamic class ship5 extends BitmapData {
public function ship5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 63
//ship5b (ship5b)
package {
import flash.display.*;
public dynamic class ship5b extends BitmapData {
public function ship5b(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 64
//ship6 (ship6)
package {
import flash.display.*;
public dynamic class ship6 extends BitmapData {
public function ship6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 65
//ship7 (ship7)
package {
import flash.display.*;
public dynamic class ship7 extends BitmapData {
public function ship7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 66
//sound1 (sound1)
package {
import flash.media.*;
public dynamic class sound1 extends Sound {
}
}//package
Section 67
//sound3 (sound3)
package {
import flash.media.*;
public dynamic class sound3 extends Sound {
}
}//package
Section 68
//star1 (star1)
package {
import flash.display.*;
public dynamic class star1 extends BitmapData {
public function star1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 69
//star2 (star2)
package {
import flash.display.*;
public dynamic class star2 extends BitmapData {
public function star2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 70
//star3 (star3)
package {
import flash.display.*;
public dynamic class star3 extends BitmapData {
public function star3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 71
//tower1 (tower1)
package {
import flash.display.*;
public dynamic class tower1 extends BitmapData {
public function tower1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 72
//tower1r (tower1r)
package {
import flash.display.*;
public dynamic class tower1r extends BitmapData {
public function tower1r(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 73
//tower2 (tower2)
package {
import flash.display.*;
public dynamic class tower2 extends BitmapData {
public function tower2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 74
//tower2r (tower2r)
package {
import flash.display.*;
public dynamic class tower2r extends BitmapData {
public function tower2r(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 75
//tower3 (tower3)
package {
import flash.display.*;
public dynamic class tower3 extends BitmapData {
public function tower3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 76
//tower3r (tower3r)
package {
import flash.display.*;
public dynamic class tower3r extends BitmapData {
public function tower3r(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 77
//tower4 (tower4)
package {
import flash.display.*;
public dynamic class tower4 extends BitmapData {
public function tower4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 78
//tower4r (tower4r)
package {
import flash.display.*;
public dynamic class tower4r extends BitmapData {
public function tower4r(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package