Frame 1
function onEnterFrame() {
var _local2 = _root.getBytesLoaded();
var _local3 = int(_local2 / 1000) + "KB";
var _local4 = int((_local2 / clientKB) * 100);
loadBar.gotoAndStop(_local4);
_root.loadTxt = (_local3 + " / ") + clientSize;
if (_local3 == clientSize) {
}
}
var clientKB = _root.getBytesTotal();
var clientSize = (int(clientKB / 1000) + "KB");
var loadTxt;
stop();
mochi.MochiServices.connect("6af03321136b0740");
MochiAd.showPreGameAd({id:"6af03321136b0740", res:"500x500"});
Stage.showMenu = false;
Frame 2
function setBrightness(level, bObj) {
bObj.brightness = (bObj.brightness ? (bObj.brightness) : (new Color(bObj)));
wide = 1;
var _local2 = Math.round(level * (wide ? 1 : 2.55));
bObj.levels = {ra:100, rb:_local2, ga:100, gb:_local2, ba:100, bb:_local2, aa:100, ab:0.5};
bObj.brightness.setTransform(bObj.levels);
}
function startBGM() {
if (curBGM == 1) {
BGM.attachSound("bgMusic");
} else {
BGM.attachSound("bgMusic1");
}
BGM.setVolume(20);
BGM.start(1, 100);
}
function playSound(soundObj, soundName) {
if (_level0.mute == 0) {
soundObj.attachSound(soundName);
soundObj.setVolume(20);
soundObj.start();
}
}
totalKillscore = 0;
totalDie = 0;
stop();
gunSound = new Sound();
awardSound = new Sound();
explodeSound = new Sound();
mute = 0;
curBGM = 1;
BGM = new Sound();
BGM.attachSound("bgMusic");
BGM.setVolume(20);
BGM.start(1, 100);
Instance of Symbol 144 MovieClip in Frame 2
on (release) {
if (_level0.mute == 0) {
stopAllSounds();
_level0.mute = 1;
this.gotoAndStop(2);
} else {
_level0.mute = 0;
this.gotoAndStop(1);
_level0.startBGM();
}
}
Frame 3
function changeGun(gunID) {
myShip.effect = 0;
switch (gunID) {
case 1 :
myShip.gun = 1;
myShip.FR = 8;
myShip.bulletSpeed = 15;
myShip.eUsage = 10;
myShip.damage = (3 * myShip.lvl) + 3;
myShip.effect = 0;
break;
case 2 :
myShip.gun = 2;
myShip.FR = 15;
myShip.bulletSpeed = 15;
myShip.eUsage = 20;
myShip.damage = (2 * myShip.lvl) + 2;
myShip.effect = 1;
myShip.effectTimer = 200;
break;
case 3 :
myShip.gun = 3;
myShip.FR = 30;
myShip.bulletSpeed = 20;
myShip.eUsage = 100;
myShip.damage = (25 * myShip.lvl) + 50;
break;
case 4 :
myShip.gun = 4;
myShip.FR = 20;
myShip.bulletSpeed = 10;
myShip.eUsage = 100;
myShip.effect = 2;
myShip.damage = (2 * myShip.lvl) + 2;
break;
case 5 :
myShip.gun = 5;
myShip.FR = 2;
myShip.bulletSpeed = 20;
myShip.eUsage = 30;
myShip.damage = 5 * myShip.lvl;
break;
case 6 :
myShip.gun = 6;
myShip.FR = 6;
myShip.bulletSpeed = 15;
myShip.eUsage = 15;
myShip.damage = 10 * myShip.lvl;
break;
case 7 :
myShip.gun = 7;
myShip.FR = 10;
myShip.bulletSpeed = 10;
myShip.eUsage = 50;
myShip.damage = 8 * myShip.lvl;
myShip.effect = 1;
myShip.effectTimer = 1000;
break;
case 8 :
myShip.gun = 8;
myShip.FR = 30;
myShip.bulletSpeed = 10;
myShip.eUsage = 250;
myShip.damage = (40 * myShip.lvl) + 50;
break;
case 9 :
myShip.gun = 9;
myShip.FR = 20;
myShip.bulletSpeed = 10;
myShip.eUsage = 100;
myShip.effect = 2;
myShip.damage = 4 * myShip.lvl;
break;
case 10 :
myShip.gun = 10;
myShip.FR = 2;
myShip.bulletSpeed = 20;
myShip.eUsage = 30;
myShip.damage = 10 * myShip.lvl;
break;
}
}
function callShop() {
i = 1;
while (i < 11) {
slotObj = eval ("shop.sslot" + i);
slotObj.gotoAndStop(i + 1);
slotObj.itemDesc = getDesc(i);
slotObj.id = i;
slotObj.onRelease = function () {
this.myPrice = getPrice(this.id);
if (this.myPrice <= myShip.cash) {
found = 0;
w = 1;
while (w < 11) {
mySlot = eval ("myShip.slot" + w);
if (mySlot == this.id) {
_root.toolTip("<font color='#FF0000'>Error: You already have this weapon in your inventory!</font>");
found = 1;
break;
}
w++;
}
if (found == 0) {
myShip.cash = myShip.cash - this.myPrice;
cashTxt = "Cash: $" + myShip.cash;
myShip["slot" + this.id] = this.id;
uAnim.gotoAndPlay(2);
_level0.playSound(_level0.gunSound, "upgrade");
refreshSlot();
}
} else {
_root.toolTip("<font color='#FF0000'>Error: You do not have enough cash!</font>");
}
};
slotObj.onRollOver = function () {
_root.toolTip(this.itemDesc);
};
slotObj.onRollOut = function () {
_root.toolTipRemove();
};
i++;
}
}
function refreshSlot() {
i = 1;
while (i < 11) {
mySlot = eval ("myShip.slot" + i);
if (mySlot != nothing) {
slotObj = eval ("slot" + i);
slotObj.gotoAndStop(mySlot + 1);
slotObj.itemDesc = getDesc(mySlot);
slotObj.onRollOver = function () {
_root.toolTip(this.itemDesc);
};
slotObj.onRollOut = function () {
_root.toolTipRemove();
};
}
i++;
}
}
function getPrice(itemID) {
switch (itemID) {
case 1 :
myPrice = 0;
break;
case 2 :
myPrice = 0;
break;
case 3 :
myPrice = 200;
break;
case 4 :
myPrice = 1000;
break;
case 5 :
myPrice = 5000;
break;
case 6 :
myPrice = 8000;
break;
case 7 :
myPrice = 10000;
break;
case 8 :
myPrice = 20000;
break;
case 9 :
myPrice = 30000;
break;
case 10 :
myPrice = 50000;
break;
}
return(myPrice);
}
function getDesc(itemID) {
switch (itemID) {
case 1 :
itemD = "<b>Plasma Cannon</b><br>One of the most commonly used weapon. Average damage and firing ratio. <br>Cost 10 energy per shot.<br>Price: $0";
break;
case 2 :
itemD = "<b>Freeze Cannon</b><br>Low damage, slows your enemy. <br>Cost 20 energy per shot.<br>Price: $0";
break;
case 3 :
itemD = "<b>Missle</b><br>Extremely high damage. <br>Cost 100 energy per shot.<br>Price: $200";
break;
case 4 :
itemD = "<b>Nova Bomb</b><br>A bomb that explodes with great energy power. Area damage. <br>Cost 100 energy per shot.<br>Price: $1000";
break;
case 5 :
itemD = "<b>Virus Cannon</b><br>Infect your enemies with deadly virus. <br>Cost 30 energy per shot.<br>Price: $5000";
break;
case 6 :
itemD = "<b>A-Plasma Cannon</b><br>Upgraded version of the basic plasma cannon, higher damage and faster firing ratio. <br>Cost 15 energy per shot.<br>Price: $8000";
break;
case 7 :
itemD = "<b>A-Freeze Cannon</b><br>Upgraded version of the freeze cannon, higher slow rate and damage. <br>Cost 50 energy per shot.<br>Price: $10000";
break;
case 8 :
itemD = "<b>A-Missle</b><br>Upgraded version of the missle, higher damage. <br>Cost 250 energy per shot.<br>Price: $20000";
break;
case 9 :
itemD = "<b>A-Nova Bomb</b><br>Upgraded version of the nova bomb, higher damage and range. <br>Cost 100 energy per shot.<br>Price: $30000";
break;
case 10 :
itemD = "<b>A-Virus cannon</b><br>Upgraded version of the virus cannon. <br>Cost 50 energy per shot.<br>Price: $50000";
break;
}
return(itemD);
}
function toolTip(stringTxt) {
toolTipTxt = stringTxt;
toolTipes.toolTiper.autoSize = "left";
if (_root._xmouse > 150) {
toolTipes._x = _root._xmouse - 150;
toolTipes._y = _root._ymouse + 10;
} else {
toolTipes._x = _root._xmouse;
toolTipes._y = _root._ymouse + 10;
}
}
function toolTipRemove() {
toolTipTxt = "";
toolTipes.toolTiper.autoSize = "left";
toolTipes._x = -500;
}
if (curBGM != 1) {
if (mute == 0) {
BGM.stop();
BGM.attachSound("bgMusic");
BGM.setVolume(20);
BGM.start(1, 100);
}
curBGM = 1;
}
if (myShip.gun == nothing) {
myShip.lvl = 1;
myShip.ship = 1;
myShip.shieldLvl = 1;
myShip.shieldMax = (((_level0.myShip.shieldLvl * _level0.myShip.shieldLvl) + _level0.myShip.lvl) * 50) + 50;
myShip.shield = myShip.shieldMax;
myShip.energyLvl = 1;
myShip.energyMax = (((_level0.myShip.energyLvl * _level0.myShip.energyLvl) + _level0.myShip.lvl) * 20) + 60;
myShip.energy = myShip.energyMax;
myShip.luck = 5;
myShip.speed = 8;
myShip.speedLvl = 1;
myShip.eCharge = 1;
myShip.EXP = 0;
myShip.EXPmax = (myShip.lvl * myShip.lvl) * 25;
myShip.cash = 200;
myShip.tCost = 2;
changeGun(1);
mobThisLevel = 20;
myShip.slot1 = 1;
myShip.slot2 = 2;
}
myShip.shield = myShip.shieldMax;
refreshSlot();
callShop();
myShipz.onRollOver = function () {
expPercent = int((myShip.EXP / myShip.EXPmax) * 100);
_root.toolTip(((((((((((((((("<b>Small Fighter</b><br>Ship level: " + myShip.lvl) + "<br>Shield: ") + myShip.shield) + "/") + myShip.shieldMax) + "<br>Energy: ") + myShip.energy) + "/") + myShip.energyMax) + "<br>Energy recover ratio: ") + myShip.eCharge) + "<br>Speed: ") + myShip.speed) + "<br>EXP: ") + expPercent) + "%");
};
myShipz.onRollOut = function () {
_root.toolTipRemove();
};
cashTxt = "Cash: $" + myShip.cash;
Frame 4
function setBut(toSet, toLvl) {
toSet.toLvl = toLvl;
toSet.onRelease = function () {
getLevel(this.toLvl);
};
toSet.onRollOver = function () {
setBrightness(10, this);
};
toSet.onRollOut = function () {
setBrightness(0, this);
};
}
function getLevel(setLevel) {
mission = setLevel;
levelSelector.gotoAndStop(mission + 1);
}
setBrightness(-100, planet2);
setBrightness(-100, planet3);
setBrightness(-100, planet4);
setBrightness(-100, planet5);
setBrightness(-100, planet6);
setBrightness(-100, planet7);
setBrightness(-100, planet8);
setBrightness(-100, planet9);
setBrightness(-100, planet10);
setBrightness(-100, planet11);
setBrightness(-100, planet12);
setBrightness(-100, planet13);
setBrightness(-100, planet14);
setBrightness(-100, planet15);
if (myShip.mission1 == 1) {
_level0.lvlLock2.gotoAndStop(2);
setBrightness(0, planet2);
setBut(planet2, 2);
_level0.lvlLock3.gotoAndStop(2);
setBrightness(0, planet3);
setBut(planet3, 3);
}
if (myShip.mission2 == 1) {
_level0.lvlLock4.gotoAndStop(2);
setBrightness(0, planet4);
setBut(planet4, 4);
_level0.lvlLock6.gotoAndStop(2);
setBrightness(0, planet6);
setBut(planet6, 6);
}
if (myShip.mission3 == 1) {
_level0.lvlLock5.gotoAndStop(2);
setBrightness(0, planet5);
setBut(planet5, 5);
}
if (myShip.mission4 == 1) {
_level0.lvlLock8.gotoAndStop(2);
setBrightness(0, planet8);
setBut(planet8, 8);
}
if (myShip.mission5 == 1) {
_level0.lvlLock7.gotoAndStop(2);
setBrightness(0, planet7);
setBut(planet7, 7);
_level0.lvlLock9.gotoAndStop(2);
setBrightness(0, planet9);
setBut(planet9, 9);
}
if (myShip.mission8 == 1) {
_level0.lvlLock10.gotoAndStop(2);
setBrightness(0, planet10);
setBut(planet10, 10);
}
if (myShip.mission9 == 1) {
_level0.lvlLock11.gotoAndStop(2);
setBrightness(0, planet11);
setBut(planet11, 11);
}
if (myShip.mission10 == 1) {
_level0.lvlLock12.gotoAndStop(2);
setBrightness(0, planet12);
setBut(planet12, 12);
}
if (myShip.mission11 == 1) {
_level0.lvlLock13.gotoAndStop(2);
setBrightness(0, planet13);
setBut(planet13, 13);
}
if ((myShip.mission12 == 1) && (myShip.mission13 == 1)) {
_level0.lvlLock14.gotoAndStop(2);
setBrightness(0, planet14);
setBut(planet14, 14);
}
if (myShip.mission14 == 1) {
_level0.lvlLock15.gotoAndStop(2);
setBrightness(0, planet15);
setBut(planet15, 15);
}
setBut(planet1, 1);
Frame 5
function doubleCreate() {
if (mTarget != 0) {
createMob();
}
if (mTarget != 0) {
createMob();
}
}
function tripleCreate() {
if (mTarget != 0) {
createMob();
}
if (mTarget != 0) {
createMob();
}
if (mTarget != 0) {
createMob();
}
}
function updateSlot() {
us = 1;
while (us < 11) {
swapObj = eval ("slot" + us);
swapObj._alpha = 40;
if (myShip.gun == us) {
swapObj._alpha = 100;
}
swapObj = eval ("gg" + us);
us++;
}
}
function createMob(subMob) {
multiply = 1;
monType = nothing;
if (subMob == nothing) {
mTarget--;
if (mTarget == 0) {
clearInterval(idd);
}
}
totalM = mobArr.length;
if (mission == 1) {
monID = "m1";
monType = 0;
}
if (mission == 2) {
monID = "m2";
monType = 1;
}
if (mission == 3) {
monID = "m3";
monType = 2;
}
if (mission == 4) {
mobNum = random(3) + 1;
monID = "m" + mobNum;
monType = mobNum - 1;
}
if (mission == 5) {
mobNum = random(3) + 1;
monID = "m" + mobNum;
monType = mobNum - 1;
}
if (mission == 6) {
monID = "m4";
}
if (mission == 7) {
monID = "m5";
}
if (mission == 8) {
mobNum = random(2);
monID = "m" + (5 + mobNum);
}
if (mission == 9) {
monID = "m7";
monType = 2;
}
if (mission == 10) {
mobNum = random(3);
monID = "m" + (5 + mobNum);
monType = 4;
}
if (mission == 11) {
monID = "m9";
monType = 0;
}
if (mission == 12) {
monID = "m8";
monType = 5;
}
if (mission == 13) {
monID = "m10";
}
if (mission == 14) {
mobNum = random(3);
monID = "m" + (5 + mobNum);
multiply = 5;
}
if (mission == 15) {
monID = "m8";
monType = 5;
}
if ((subMob != nothing) && (mission == 2)) {
monType = 0;
monID = "m2";
}
if ((subMob != nothing) && (mission == 13)) {
monType = 0;
monID = "m10";
}
MMobject = _level0.attachMovie(monID, "monster" + totalMob, 400 + totalMob);
MMobject.swapDepths(-20001 - totalMob);
if (monID == "m1") {
MMobject.totalLife = 8;
MMobject.life = 8;
MMobject.cash = 5;
MMobject.EXP = 2;
MMobject.speed = 0.8;
MMobject.monType = 0;
}
if (monID == "m2") {
MMobject.totalLife = 100;
MMobject.life = 100;
MMobject.cash = 30;
MMobject.EXP = 20;
MMobject.speed = 0.5;
MMobject.monType = monType;
}
if ((monID == "m2") && (subMob.monType == 1)) {
MMobject.totalLife = 20;
MMobject.life = 20;
MMobject.cash = 3;
MMobject.EXP = 5;
MMobject.speed = 0.6;
MMobject.monType = 0;
}
if (monID == "m3") {
MMobject.totalLife = 60;
MMobject.life = 60;
MMobject.cash = 20;
MMobject.EXP = 20;
MMobject.speed = 0.8;
MMobject.monType = monType;
}
if (monID == "m4") {
MMobject.totalLife = 5000;
MMobject.life = 5000;
MMobject.cash = 1000;
MMobject.EXP = 700;
MMobject.speed = 0.4;
MMobject.monType = 3;
MMobject.agress = 1;
}
if (monID == "m5") {
MMobject.totalLife = 200 * multiply;
MMobject.life = 200 * multiply;
MMobject.cash = 50 * multiply;
MMobject.EXP = 40 * multiply;
MMobject.speed = 1;
MMobject.monType = monType;
if (monType == nothing) {
MMobject.monType = 4;
}
}
if (monID == "m6") {
MMobject.totalLife = 500 * multiply;
MMobject.life = 500 * multiply;
MMobject.cash = 80 * multiply;
MMobject.EXP = 70 * multiply;
MMobject.speed = 0.4;
MMobject.monType = monType;
if (monType == nothing) {
MMobject.monType = 0;
}
}
if (monID == "m7") {
MMobject.totalLife = 1000 * multiply;
MMobject.life = 1000 * multiply;
MMobject.cash = 100 * multiply;
MMobject.EXP = 200 * multiply;
MMobject.speed = 0.5;
MMobject.monType = monType;
if (monType == nothing) {
MMobject.monType = 2;
}
}
if (monID == "m8") {
MMobject.totalLife = 75000 /* 0x0124F8 */;
MMobject.life = 75000 /* 0x0124F8 */;
MMobject.cash = 5000;
MMobject.EXP = 10000;
MMobject.speed = 0.5;
MMobject.monType = 5;
}
if (monID == "m9") {
MMobject.totalLife = 400;
MMobject.life = 400;
MMobject.cash = 50;
MMobject.EXP = 100;
MMobject.speed = 3;
MMobject.monType = 0;
}
if (monID == "m10") {
MMobject.totalLife = 3000;
MMobject.life = 3000;
MMobject.cash = 500;
MMobject.EXP = 1500;
MMobject.speed = 0.8;
MMobject.monType = 1;
MMobject.mobShoot = 1;
}
if ((monID == "m10") && (subMob.monType == 1)) {
MMobject.totalLife = 500;
MMobject.life = 500;
MMobject.cash = 100;
MMobject.EXP = 300;
MMobject.speed = 0.6;
MMobject.monType = 0;
MMobject.mobShoot = 1;
}
mobPlace = random(4);
switch (mobPlace) {
case 0 :
MMobject._x = -50;
MMobject._y = random(500);
break;
case 1 :
MMobject._x = 550;
MMobject._y = random(500);
break;
case 2 :
MMobject._y = 550;
MMobject._x = random(500);
break;
case 3 :
MMobject._y = -50;
MMobject._x = random(500);
break;
}
MMobject.hpbar.gotoAndStop(100);
MMobject._xscale = 70;
MMobject._yscale = 70;
if (subMob != nothing) {
MMobject._xscale = 20;
MMobject._yscale = 20;
MMobject._x = (subMob._x - 50) + random(100);
MMobject._y = (subMob._y - 50) + random(100);
}
MMobject.angle = lookAt(MMobject, 250, 250, 1);
MMobject.myName = "monster" + totalMob;
mobArr[totalM] = "monster" + totalMob;
totalMob++;
MMobject.onEnterFrame = function () {
if (this.effectTimer != nothing) {
if (this.effectTimer > 0) {
this.effectTimer--;
}
if (this.effectTimer == 0) {
this.speed = this.speed * 4;
this.effectTimer = nothing;
oldColor = new Color(this);
newColor = {rb:0, gb:0, bb:0};
oldColor.setTransform(newColor);
}
}
if (this.agress == 1) {
this.angle = lookAt(this, myShip._x, myShip._y, 1);
} else if (adj == 50) {
this.angle = lookAt(this, base._x, base._y, 1);
}
moveByAngle(this, this.angle);
if ((this.monType != 3) && (this.monType != 5)) {
if (this.area.hitTest(base.area)) {
gameStart = 0;
die = 1;
gotoAndStop (6);
}
} else if (this.monType == 3) {
this.bRan = random(1000);
if (this.bRan < 20) {
bossShoot(this, this.angle - 30);
bossShoot(this, this.angle - 20);
bossShoot(this, this.angle - 10);
bossShoot(this, this.angle);
bossShoot(this, this.angle + 10);
bossShoot(this, this.angle + 20);
bossShoot(this, this.angle + 30);
}
if ((this.life < (this.totalLife / 2)) && (this.bRan > 900)) {
bossShoot(this, this.angle + 80);
bossShoot(this, this.angle + 100);
bossShoot(this, this.angle - 80);
bossShoot(this, this.angle - 100);
}
} else {
this.bRan = random(1000);
if (this.bRan < 20) {
bossShoot2(this, this.angle - 10);
bossShoot2(this, this.angle);
bossShoot2(this, this.angle + 10);
}
if ((this.bRan > 20) && (this.bRan < 40)) {
bossShoot2(this, this.angle - 45);
bossShoot2(this, this.angle + 45);
bossShoot2(this, this.angle - 55);
bossShoot2(this, this.angle + 55);
}
if ((this.bRan > 70) && (this.bRan < 80)) {
bossShoot2(this, this.angle - 5);
bossShoot2(this, this.angle - 15);
bossShoot2(this, this.angle + 15);
bossShoot2(this, this.angle + 5);
}
if ((this.life < (this.totalLife / 2)) && (this.bRan > 980)) {
bossShoot(this, this.angle + 80);
bossShoot(this, this.angle + 90);
bossShoot(this, this.angle + 100);
bossShoot(this, this.angle - 80);
bossShoot(this, this.angle - 90);
bossShoot(this, this.angle - 100);
}
}
if (this.area.hitTest(myShip.area)) {
if (myShip.shield > 0) {
myShip.shield = myShip.shield - this.life;
if (myShip.shield > 0) {
this.gotoAndStop(2);
if (this.dead != 1) {
this.dead = 1;
reward(this);
}
}
}
}
if (this.monType == 2) {
if (this.agress == 1) {
this.speed = this.speed + 0.05;
}
}
if (this.monType == 4) {
this.bRan = random(1000);
if (this.bRan < 20) {
this.angle = lookAt(this, myShip._x, myShip._y, 1);
bossShoot(this, this.angle);
this.angle = lookAt(this, base._x, base._y, 1);
}
}
if (this.mobShoot == 1) {
this.bRan = random(1000);
if (this.bRan < 20) {
this.angle = lookAt(this, myShip._x, myShip._y, 1);
bossShoot2(this, this.angle);
this.angle = lookAt(this, base._x, base._y, 1);
}
}
};
}
function bossShoot(bossObj, angle) {
bossBullet++;
var _local2 = new Object();
cMobject = attachMovie("bb1", "bbullet" + bossBullet, 4100 + bossBullet);
cMobject.myName = "bbullet" + bossBullet;
cMobject.swapDepths(-22500 + bossBullet);
cMobject._x = bossObj._x;
cMobject._y = bossObj._y;
cMobject.speed = 10;
cMobject.angle = angle;
cMobject.onEnterFrame = function () {
if (this.hitTest(myShip.area)) {
myShip.shield = myShip.shield - 50;
removeMovieClip("_level0." + this.myName);
}
moveByAngle(this, this.angle);
if ((((this._y > 550) || (this._y < -50)) || (this._x > 550)) || (this._x < -50)) {
removeMovieClip("_level0." + this.myName);
}
};
}
function bossShoot2(bossObj, angle) {
bossBullet++;
var _local2 = new Object();
cMobject = attachMovie("bb2", "bbullet" + bossBullet, 4100 + bossBullet);
cMobject.myName = "bbullet" + bossBullet;
cMobject.swapDepths(-22500 + bossBullet);
cMobject._x = bossObj._x;
cMobject._y = bossObj._y;
cMobject.speed = 10;
cMobject.angle = angle;
cMobject._rotation = angle;
cMobject.onEnterFrame = function () {
if (this.hitTest(myShip.area)) {
myShip.shield = myShip.shield - 200;
removeMovieClip("_level0." + this.myName);
}
moveByAngle(this, this.angle);
if ((((this._y > 550) || (this._y < -50)) || (this._x > 550)) || (this._x < -50)) {
removeMovieClip("_level0." + this.myName);
}
};
}
function reward(rObj) {
if (rObj.cash != nothing) {
myShip.cash = myShip.cash + rObj.cash;
moneyEarned = moneyEarned + rObj.cash;
rdObj = attachMovie("moneyGet", "mg", 10);
rdObj.myName = "mg";
rdObj.myAmount = "+$" + rObj.cash;
rdObj._x = rObj._x;
rdObj._y = rObj._y;
mgTotal++;
}
if (rObj.EXP != nothing) {
myShip.EXP = myShip.EXP + rObj.EXP;
expEarned = expEarned + rObj.EXP;
}
if (myShip.EXP >= myShip.EXPmax) {
myShip.EXP = 0;
myShip.lvl++;
myShip.EXPmax = (myShip.lvl * myShip.lvl) * 25;
myShip.shieldMax = (((_level0.myShip.shieldLvl * _level0.myShip.shieldLvl) + _level0.myShip.lvl) * 50) + 50;
myShip.energyMax = (((_level0.myShip.energyLvl * _level0.myShip.energyLvl) + _level0.myShip.lvl) * 20) + 60;
myShip.energy = myShip.energyMax;
levelAnim._x = myShip._x;
levelAnim._y = myShip._y;
levelAnim.gotoAndPlay(1);
}
}
function shoot() {
totalB = bulletArr.length;
Mobject = _level0.attachMovie("p1", "bullet" + totalBullets, 1100 + totalBullets);
Mobject.swapDepths(-20000 + totalBullets);
Mobject._x = myShip._x;
Mobject._y = myShip._y;
Mobject.hit = 0;
Mobject.myName = "bullet" + totalBullets;
Mobject.angle = myShip._rotation;
Mobject.speed = 20;
Mobject.effect = myShip.effect;
Mobject.effectTimer = myShip.effectTimer;
Mobject.damage = myShip.damage;
Mobject.gotoAndStop(myShip.gun);
Mobject._rotation = Mobject.angle;
bulletArr[totalB] = "bullet" + totalBullets;
totalBullets++;
Mobject.onEnterFrame = function () {
if (this.effect != 2) {
moveByAngle(this, this.angle);
}
if ((((this._y > 550) || (this._y < -50)) || (this._x > 550)) || (this._x < -50)) {
if (this.effect != 2) {
removeBullet(this);
}
}
};
}
function removeBullet(bulletToRemove) {
totalB2 = bulletArr.length + 1;
l = 0;
while (l < totalB2) {
if (bulletArr[l] == bulletToRemove.myName) {
bulletArr.splice(l, 1);
break;
}
l++;
}
bulletHit = bulletHit + int(bulletToRemove.hit);
removeMovieClip(bulletToRemove);
}
function removeMob(mobToRemove) {
if (mobToRemove.monType == 1) {
createMob(mobToRemove);
createMob(mobToRemove);
createMob(mobToRemove);
}
totalM2 = mobArr.length + 1;
k = 0;
while (k < totalM2) {
if (mobArr[k] == mobToRemove.myName) {
mobArr.splice(k, 1);
break;
}
k++;
}
totalKills++;
removeMovieClip(mobToRemove);
}
function lookAt(object, lookX, lookY, lookPmc) {
if ((lookX >= object._x) && (lookY < object._y)) {
x_distance = int(lookX) - int(object._x);
y_distance = int(object._y) - int(lookY);
if (x_distance <= y_distance) {
pmc = (45 * int(x_distance)) / int(y_distance);
} else {
pmc = (45 * int(y_distance)) / int(x_distance);
pmc = 90 - pmc;
}
}
if ((lookX >= object._x) && (lookY > object._y)) {
x_distance = int(lookX) - int(object._x);
y_distance = int(lookY) - int(object._y);
if (x_distance <= y_distance) {
pmc = (45 * int(x_distance)) / int(y_distance);
pmc = 180 - pmc;
} else {
pmc = ((45 * int(y_distance)) / int(x_distance)) + 90;
}
}
if ((lookX <= object._x) && (lookY > object._y)) {
x_distance = int(object._x) - int(lookX);
y_distance = int(lookY) - int(object._y);
if (x_distance <= y_distance) {
pmc = (45 * int(x_distance)) / int(y_distance);
pmc = 180 + pmc;
} else {
pmc = 270 - ((45 * int(y_distance)) / int(x_distance));
}
}
if ((lookX <= object._x) && (lookY < object._y)) {
x_distance = int(object._x) - int(lookX);
y_distance = int(object._y) - int(lookY);
if (x_distance <= y_distance) {
pmc = (45 * int(x_distance)) / int(y_distance);
pmc = 360 - pmc;
} else {
pmc = 270 + ((45 * int(y_distance)) / int(x_distance));
}
}
if (lookPmc == 1) {
object.body._rotation = pmc;
} else {
object._rotation = pmc;
}
return(pmc);
}
function moveByAngle(obj2, angle) {
if (angle < 0) {
angle = angle + 360;
}
if (angle > 360) {
angle = angle - 360;
}
if ((angle >= 0) && (angle <= 90)) {
speedX = angle / 90;
speedY = 1 - speedX;
speedX = -speedX;
} else if ((angle > 90) && (angle <= 180)) {
speedY = (angle - 90) / 90;
speedX = 1 - speedY;
speedX = -speedX;
speedY = -speedY;
} else if ((angle > 180) && (angle <= 270)) {
speedX = (angle - 180) / 90;
speedY = 1 - speedX;
speedX = speedX;
speedY = -speedY;
} else if ((angle > 270) && (angle <= 360)) {
speedY = (angle - 270) / 90;
speedX = 1 - speedY;
speedX = speedX;
speedY = speedY;
}
obj2._x = obj2._x - (speedX * obj2.speed);
obj2._y = obj2._y - (speedY * obj2.speed);
}
function update_pDetails() {
pDetails = "<b>";
switch (myShip.ship) {
case 1 :
pDetails = pDetails + "Small Fighter";
break;
case 2 :
pDetails = pDetails + "Small Destroyer";
break;
case 3 :
pDetails = pDetails + "Small Scout";
break;
default :
pDetails = pDetails + "Unknown";
}
pDetails = pDetails + ((" (Level: " + myShip.lvl) + ")");
shieldPercent = int((myShip.shield / myShip.shieldMax) * 100);
sColor = "#00FF00";
if (shieldPercent < 80) {
myBar.shieldType.gotoAndStop(2);
sColor = "#FFFF00";
}
if (shieldPercent < 30) {
myBar.shieldType.gotoAndStop(3);
sColor = "#FF0000";
}
energyPercent = int((myShip.energy / myShip.energyMax) * 100);
if (energyPercent < 80) {
eColor = "#FFFF00";
}
if (energyPercent < 30) {
eColor = "#FF0000";
}
myExp = int((myShip.EXP / myShip.EXPmax) * 100);
pDetails = pDetails + ((((((((((((((((((("</b>\r<font color='" + sColor) + "'>Shield: ") + shieldPercent) + "% (") + myShip.shield) + "/") + myShip.shieldMax) + ")</font>") + newline) + "<font color='") + ecolor) + "'>Energy: ") + int(myShip.energy)) + "/") + myShip.energyMax) + "</font><br>EXP: ") + myExp) + "% Cash: $") + myShip.cash);
}
delete myShip.onRollOver;
BGM.stop();
if (mute == 0) {
BGM.attachSound("bgMusic2");
BGM.setVolume(20);
BGM.start(1, 100);
}
curBGM = 2;
die = 0;
myShip._x = 252;
myShip._y = 440;
myShip._rotation = 0;
shootCount = 0;
gameStart = 0;
totalBullets = 0;
totalB = 0;
totalM = 0;
totalMob = 0;
moneyEarned = 0;
expEarned = 0;
totalKills = 0;
bulletHit = 0;
bulletArr = new Array();
mobArr = new Array();
totalDrops = 0;
refreshSlot();
myShip.basSpeed = myShip.speed;
switch (mission) {
case 1 :
mTarget = 15;
break;
case 2 :
mTarget = 10;
gameStart = 1;
idd = setInterval(_level0.createMob, 7000);
tutorial.gotoAndStop(2);
break;
case 3 :
mTarget = 30;
gameStart = 1;
idd = setInterval(_level0.createMob, 1500);
tutorial.gotoAndStop(2);
break;
case 4 :
mTarget = 35;
gameStart = 1;
idd = setInterval(_level0.createMob, 1500);
tutorial.gotoAndStop(2);
break;
case 5 :
mTarget = 40;
gameStart = 1;
idd = setInterval(_level0.createMob, 1000);
tutorial.gotoAndStop(2);
break;
case 6 :
mTarget = 1;
gameStart = 1;
idd = setInterval(_level0.createMob, 1000);
tutorial.gotoAndStop(2);
break;
case 7 :
mTarget = 30;
gameStart = 1;
idd = setInterval(_level0.createMob, 2000);
tutorial.gotoAndStop(2);
break;
case 8 :
mTarget = 30;
gameStart = 1;
idd = setInterval(_level0.createMob, 2000);
tutorial.gotoAndStop(2);
break;
case 9 :
mTarget = 30;
gameStart = 1;
idd = setInterval(_level0.createMob, 2000);
tutorial.gotoAndStop(2);
break;
case 10 :
mTarget = 35;
gameStart = 1;
idd = setInterval(_level0.createMob, 1500);
tutorial.gotoAndStop(2);
break;
case 11 :
mTarget = 70;
gameStart = 1;
idd = setInterval(_level0.doubleCreate, 1500);
tutorial.gotoAndStop(2);
break;
case 12 :
mTarget = 1;
gameStart = 1;
idd = setInterval(_level0.createMob, 1000);
tutorial.gotoAndStop(2);
break;
case 13 :
mTarget = 20;
gameStart = 1;
idd = setInterval(_level0.doubleCreate, 7000);
tutorial.gotoAndStop(2);
break;
case 14 :
mTarget = 50;
gameStart = 1;
idd = setInterval(_level0.tripleCreate, 5000);
tutorial.gotoAndStop(2);
break;
case 15 :
mTarget = 3;
gameStart = 1;
idd = setInterval(_level0.tripleCreate, 1000);
tutorial.gotoAndStop(2);
break;
}
base.gotoAndStop(mission);
updateSlot();
delete onEnterFrame;
delete slot1.onRollOver;
delete slot2.onRollOver;
delete slot3.onRollOver;
delete slot4.onRollOver;
delete slot5.onRollOver;
delete slot6.onRollOver;
delete slot7.onRollOver;
delete slot8.onRollOver;
delete slot9.onRollOver;
delete slot10.onRollOver;
subMob = nothing;
bossBullet = 0;
adj = 0;
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
shooter = 1;
};
mouseListener.onMouseUp = function () {
shooter = 0;
};
Mouse.addListener(mouseListener);
onEnterFrame = function () {
var currtime = new Date();
var ttime = (currtime - starttime);
while (ttime < 29.4117647058824) {
var currtime = new Date();
var ttime = (currtime - starttime);
}
starttime = new Date();
adj++;
if (adj > 51) {
adj = 0;
}
if ((mobArr.length == 0) && (mTarget == 0)) {
gameStart = 0;
gotoAndStop (6);
}
if (myShip.shield <= 0) {
gameStart = 0;
die = 1;
gotoAndStop (6);
}
if (gameStart == 1) {
lookAt(myShip, _xmouse, _ymouse);
if (myShip.energy >= myShip.eUsage) {
if (shooter == 1) {
if (shootCount > myShip.FR) {
playSound(gunSound, "gun" + myShip.gun);
if (myShip.gun != 4) {
myShip.sparkle1.gotoAndStop(2);
}
shoot();
shootCount = 0;
myShip.energy = myShip.energy - myShip.eUsage;
}
}
}
if (myShip.energy < myShip.energyMax) {
myShip.energy = myShip.energy + myShip.eCharge;
}
if (Key.isDown(49)) {
sem = 1;
if (myShip["slot" + sem] != nothing) {
changeGun(sem);
updateSlot();
}
}
if (Key.isDown(50)) {
sem = 2;
if (myShip["slot" + sem] != nothing) {
changeGun(sem);
updateSlot();
}
}
if (Key.isDown(51)) {
sem = 3;
if (myShip["slot" + sem] != nothing) {
changeGun(sem);
updateSlot();
}
}
if (Key.isDown(52)) {
sem = 4;
if (myShip["slot" + sem] != nothing) {
changeGun(sem);
updateSlot();
}
}
if (Key.isDown(53)) {
sem = 5;
if (myShip["slot" + sem] != nothing) {
changeGun(sem);
updateSlot();
}
}
if (Key.isDown(54)) {
sem = 6;
if (myShip["slot" + sem] != nothing) {
changeGun(sem);
updateSlot();
}
}
if (Key.isDown(55)) {
sem = 7;
if (myShip["slot" + sem] != nothing) {
changeGun(sem);
updateSlot();
}
}
if (Key.isDown(56)) {
sem = 8;
if (myShip["slot" + sem] != nothing) {
changeGun(sem);
updateSlot();
}
}
if (Key.isDown(57)) {
sem = 9;
if (myShip["slot" + sem] != nothing) {
changeGun(sem);
updateSlot();
}
}
if (Key.isDown(48)) {
sem = 10;
if (myShip["slot" + sem] != nothing) {
changeGun(sem);
updateSlot();
}
}
if (Key.isDown(87)) {
if (myShip._y > 20) {
myShip._y = myShip._y - myShip.speed;
}
}
if (Key.isDown(16)) {
if (myShip.energy > myShip.tCost) {
myShip.engineFlame.gotoAndStop(2);
myShip.speed = myShip.basSpeed + 5;
myShip.energy = myShip.energy - myShip.tCost;
}
} else {
myShip.speed = myShip.basSpeed;
myShip.engineFlame.gotoAndStop(1);
}
if (Key.isDown(83)) {
if (myShip._y < 480) {
myShip._y = myShip._y + myShip.speed;
}
}
if (Key.isDown(65)) {
if (myShip._x > 20) {
myShip._x = myShip._x - myShip.speed;
}
}
if (Key.isDown(68)) {
if (myShip._x < 480) {
myShip._x = myShip._x + myShip.speed;
}
}
}
shootCount++;
totalAmount = s1amount;
moveStar(90);
i = 0;
while (i < totalAmount) {
starObj = eval ("_level0.Stars.sn" + i);
starObj._x = starObj._x + ((speedX * 3) / 4);
starObj._y = starObj._y + ((speedY * 3) / 4);
starWarp(starObj);
i++;
}
totalAmount = s1amount + s2amount;
i = i;
while (i < totalAmount) {
starObj = eval ("_level0.Stars.sn" + i);
starObj._x = starObj._x + ((speedX * 2) / 4);
starObj._y = starObj._y + ((speedY * 2) / 4);
starWarp(starObj);
i++;
}
totalAmount = (s1amount + s2amount) + s3amount;
i = i;
while (i < totalAmount) {
starObj = eval ("_level0.Stars.sn" + i);
starObj._x = starObj._x + ((speedX * 1) / 4);
starObj._y = starObj._y + ((speedY * 1) / 4);
starWarp(starObj);
i++;
}
c = 0;
while (c < bulletArr.length) {
bulletObj = eval (bulletArr[c]);
d = 0;
while (d < mobArr.length) {
testHitObj = eval (mobArr[d]);
if (testHitObj.dead != 1) {
if (testHitObj.area.hitTest(bulletObj)) {
bulletObj.hit = 1;
testHitObj.agress = 1;
if ((testHitObj.life - bulletObj.damage) <= 0) {
if (bulletObj.effect != 2) {
removeBullet(bulletObj);
}
testHitObj.gotoAndStop(2);
testHitObj.dead = 1;
reward(testHitObj);
if (random(100) < 10) {
totalDrops++;
newDrop = _root.attachMovie("mdrop", "mdrops" + totalDrops, 1000 + totalDrops);
newDrop.swapDepths(-22000 - totalDrops);
newDrop._x = testHitObj._x;
newDrop._y = testHitObj._y;
newDrop.life = 200;
newDrop.cash = random(mission * 10) + 10;
newDrop.onEnterFrame = function () {
this.life--;
if (this.life == 0) {
removeMovieClip(this);
}
if (this.hitTest(myShip.area)) {
playSound(awardSound, "bling");
reward(this);
removeMovieClip(this);
}
};
}
} else {
if ((bulletObj.effect == 1) && (testHitObj.effectTimer == nothing)) {
testHitObj.speed = testHitObj.speed / 4;
testHitObj.effectTimer = bulletObj.effectTimer;
oldColor = new Color(testHitObj);
newColor = {rb:0, gb:0, bb:200};
oldColor.setTransform(newColor);
}
if (testHitObj.monType == 3) {
testHitObj.life = testHitObj.life - (bulletObj.damage / 2);
} else {
testHitObj.life = testHitObj.life - bulletObj.damage;
}
hpPercent = int((testHitObj.life / testHitObj.totalLife) * 100);
testHitObj.hpbar.gotoAndStop(hpPercent);
if (bulletObj.effect != 2) {
removeBullet(bulletObj);
}
}
}
}
d++;
}
c++;
}
update_pDetails();
};
stop();
function createStar(starX, starY, id, starType) {
starObj = Stars.attachMovie("s" + starType, "sn" + id, 100 + id);
starObj._x = starX;
starObj._y = starY;
}
function starWarp(starToWarp) {
if (starToWarp._x < 0) {
starToWarp._x = 500;
starToWarp._y = random(500);
}
if (starToWarp._x > 500) {
starToWarp._x = 0;
starToWarp._y = random(500);
}
if (starToWarp._y < 0) {
starToWarp._y = 500;
starToWarp._x = random(500);
}
if (starToWarp._y > 500) {
starToWarp._y = 0;
starToWarp._x = random(500);
}
}
function moveStar(angle) {
if ((angle >= 0) && (angle <= 90)) {
speedX = angle / 90;
speedY = 1 - speedX;
speedX = -speedX;
} else if ((angle > 90) && (angle <= 180)) {
speedY = (angle - 90) / 90;
speedX = 1 - speedY;
speedX = -speedX;
speedY = -speedY;
} else if ((angle > 180) && (angle <= 270)) {
speedX = (angle - 180) / 90;
speedY = 1 - speedX;
speedX = speedX;
speedY = -speedY;
} else if ((angle > 270) && (angle <= 360)) {
speedY = (angle - 270) / 90;
speedX = 1 - speedY;
speedX = speedX;
speedY = speedY;
}
}
s1amount = 15;
s2amount = 10;
s3amount = 10;
totalAmount = s1amount;
i = 0;
while (i < s1amount) {
createStar(random(500), random(500), i, 1);
i++;
}
totalAmount = s1amount + s2amount;
i = i;
while (i < totalAmount) {
createStar(random(500), random(500), i, 2);
i++;
}
totalAmount = (s1amount + s2amount) + s3amount;
i = i;
while (i < totalAmount) {
createStar(random(500), random(500), i, 3);
i++;
}
totalI = i;
Frame 6
myShip._x = -500;
myShip._y = -500;
levelCompleted.swapDepths(50000);
accuracy = int((Number(bulletHit) / Number(totalBullets)) * 100);
levelCompleted.resultTxt = ((((((("$" + moneyEarned) + newline) + expEarned) + newline) + totalKills) + newline) + accuracy) + "%";
delete onEnterFrame;
totalKillscore = totalKillscore + totalKills;
clearInterval(idd);
if (die == 1) {
totalDie++;
levelCompleted.gotoAndStop(2);
} else {
myShip["mission" + mission] = 1;
}
Frame 7
inventory = 0;
i = 1;
while (i < 11) {
if (myShip["slot" + i] != nothing) {
inventory++;
}
i++;
}
unlocked = 0;
i = 1;
while (i < 16) {
if (myShip["mission" + i] != nothing) {
unlocked++;
}
i++;
}
finalEndScore = 0;
finalEndScore = finalEndScore + (myShip.lvl * 50);
finalEndScore = finalEndScore + (myShip.shieldLvl * 100);
finalEndScore = finalEndScore + (myShip.energyLvl * 100);
finalEndScore = finalEndScore + (myShip.speedLvl * 100);
finalEndScore = finalEndScore + (inventory * 100);
finalEndScore = finalEndScore - (totalDie * 100);
finalEndScore = finalEndScore + (totalKillscore * 1);
finalEndScore = finalEndScore + (myShip.cash / 1000);
finalEndScore = finalEndScore + (unlocked * 100);
finalEndScore = int(finalEndScore);
finalScoreTxt = (((((((((((((((((((myShip.lvl + newline) + myShip.shieldLvl) + newline) + myShip.energyLvl) + newline) + myShip.speedLvl) + newline) + inventory) + newline) + totalDie) + newline) + totalKillscore) + newline) + "$") + myShip.cash) + newline) + unlocked) + newline) + newline) + finalEndScore;
Frame 8
mochi.MochiScores.showLeaderboard({boardID:"a23ca8ac63438ed4", score:finalEndScore});
Symbol 25 MovieClip Frame 10
myBullet = eval ("_level0." + _parent.myName);
_level0.removeBullet(myBullet);
stop();
Symbol 28 MovieClip [p1] Frame 1
stop();
Symbol 38 MovieClip Frame 1
stop();
Symbol 55 MovieClip [e1] Frame 1
_level0.playSound(_level0.explodeSound, "explode1");
Symbol 55 MovieClip [e1] Frame 9
_level0.removeMob(_parent);
stop();
Symbol 56 MovieClip [m9] Frame 1
stop();
Symbol 58 MovieClip [m1] Frame 1
stop();
Symbol 67 MovieClip [moneyGet] Frame 30
removeMovieClip("_level0." + myName);
Symbol 71 MovieClip [m8] Frame 1
stop();
Symbol 75 MovieClip [m4] Frame 1
stop();
Symbol 78 MovieClip [m6] Frame 1
stop();
Symbol 82 MovieClip [m5] Frame 1
stop();
Symbol 86 MovieClip [m7] Frame 1
stop();
Symbol 88 MovieClip [m3] Frame 1
stop();
Symbol 92 MovieClip [m10] Frame 1
stop();
Symbol 94 MovieClip [m2] Frame 1
stop();
Symbol 106 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 100
_level0.fadeOut.gotoAndPlay(2);
Symbol 109 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 40
stop();
Symbol 459 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.2");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 460 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 461 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if (options.clip != mochi.MochiServices.__get__clip()) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 128 Button
on (release) {
_level0.gameMode = 1;
_level0.gotoAndStop(3);
}
Symbol 132 Button
on (release) {
gotoAndStop (2);
}
Symbol 136 Button
on (release) {
gotoAndStop (1);
}
Symbol 139 MovieClip Frame 1
stop();
Symbol 144 MovieClip Frame 1
stop();
Symbol 157 MovieClip Frame 1
stop();
Symbol 179 MovieClip Frame 1
stop();
Symbol 184 Button
on (release) {
shop.gotoAndStop(1);
_level0.callShop();
}
Symbol 185 Button
on (release) {
shop.gotoAndStop(2);
}
Symbol 186 Button
on (release) {
shop.gotoAndStop(3);
}
Symbol 187 Button
on (release) {
_level0.gotoAndStop(4);
}
Symbol 194 Button
on (release) {
if (_level0.myShip.cash >= sCost) {
_level0.myShip.cash = _level0.myShip.cash - sCost;
_level0.myShip.shieldLvl++;
_level0.myShip.shieldMax = (((_level0.myShip.shieldLvl * _level0.myShip.shieldLvl) + _level0.myShip.lvl) * 50) + 50;
_level0.myShip.shield = _level0.myShip.shieldMax;
sCost = (_level0.myShip.shieldLvl * _level0.myShip.shieldLvl) * 100;
sShopTxt = (("Shield level: " + _level0.myShip.shieldLvl) + "<br>Upgrade cost: $") + sCost;
_level0.cashTxt = "Cash: $" + _level0.myShip.cash;
_level0.playSound(_level0.gunSound, "upgrade");
_level0.uAnim.gotoAndPlay(1);
} else {
_root.toolTip("<font color='#FF0000'>Error: You do not have enough cash!</font>");
}
}
on (rollOut) {
_root.toolTipRemove();
}
Symbol 198 Button
on (release) {
if (_level0.myShip.cash >= eCost) {
if ((_level0.myShip.energyLvl % 2) == 1) {
_level0.myShip.eCharge = _level0.myShip.eCharge + 0.2;
}
_level0.myShip.cash = _level0.myShip.cash - eCost;
_level0.myShip.energyLvl++;
_level0.myShip.energyMax = (((_level0.myShip.energyLvl * _level0.myShip.energyLvl) + _level0.myShip.lvl) * 20) + 60;
_level0.myShip.energy = _level0.myShip.energyMax;
eCost = (_level0.myShip.energyLvl * _level0.myShip.energyLvl) * 100;
eShopTxt = (("Energy level: " + _level0.myShip.energyLvl) + "<br>Upgrade cost: $") + eCost;
_level0.cashTxt = "Cash: $" + _level0.myShip.cash;
_level0.playSound(_level0.gunSound, "upgrade");
_level0.uAnim.gotoAndPlay(1);
} else {
_root.toolTip("<font color='#FF0000'>Error: You do not have enough cash!</font>");
}
}
on (rollOut) {
_root.toolTipRemove();
}
Symbol 200 Button
on (release) {
if (_level0.myShip.cash >= enCost) {
_level0.myShip.cash = _level0.myShip.cash - enCost;
_level0.myShip.speedLvl++;
_level0.myShip.speed++;
enCost = (_level0.myShip.speedLvl * _level0.myShip.speedLvl) * 100;
enShopTxt = (("Engine level: " + _level0.myShip.speedLvl) + "<br>Upgrade cost: $") + enCost;
_level0.cashTxt = "Cash: $" + _level0.myShip.cash;
_level0.playSound(_level0.gunSound, "upgrade");
_level0.uAnim.gotoAndPlay(1);
} else {
_root.toolTip("<font color='#FF0000'>Error: You do not have enough cash!</font>");
}
}
on (rollOut) {
_root.toolTipRemove();
}
Symbol 201 MovieClip Frame 1
stop();
Symbol 201 MovieClip Frame 2
sCost = (_level0.myShip.shieldLvl * _level0.myShip.shieldLvl) * 100;
sShopTxt = (("Shield level: " + _level0.myShip.shieldLvl) + "<br>Upgrade cost: $") + sCost;
eCost = (_level0.myShip.energyLvl * _level0.myShip.energyLvl) * 100;
eShopTxt = (("Energy level: " + _level0.myShip.energyLvl) + "<br>Upgrade cost: $") + eCost;
Symbol 201 MovieClip Frame 3
enCost = (_level0.myShip.speedLvl * _level0.myShip.speedLvl) * 100;
enShopTxt = (("Engine level: " + _level0.myShip.speedLvl) + "<br>Upgrade cost: $") + enCost;
Symbol 202 MovieClip Frame 1
stop();
Symbol 203 Button
on (release) {
_level0.gotoAndStop(7);
}
Symbol 272 MovieClip Frame 98
gotoAndPlay (2);
Symbol 273 MovieClip Frame 1
stop();
Symbol 282 MovieClip Frame 8
stop();
Symbol 283 MovieClip Frame 8
_parent.gotoAndStop(1);
stop();
Symbol 284 MovieClip Frame 1
stop();
Symbol 285 MovieClip Frame 1
stop();
Symbol 352 MovieClip Frame 1
stop();
Symbol 391 MovieClip Frame 1
stop();
Symbol 396 Button
on (release) {
_level0.gotoAndStop(5);
}
Symbol 427 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 2
base.gotoAndStop(_level0.mission);
Instance of Symbol 393 MovieClip in Symbol 427 MovieClip Frame 2
on (release) {
_parent.gotoAndStop(1);
}
Symbol 427 MovieClip Frame 3
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 4
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 5
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 6
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 7
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 8
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 9
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 10
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 11
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 12
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 13
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 14
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 15
base.gotoAndStop(_level0.mission);
Symbol 427 MovieClip Frame 16
base.gotoAndStop(_level0.mission);
Symbol 428 Button
on (release) {
_level0.gotoAndStop(3);
}
Symbol 434 MovieClip Frame 1
stop();
Symbol 440 MovieClip Frame 31
stop();
Symbol 443 MovieClip Frame 1
stop();
Instance of Symbol 356 MovieClip in Symbol 443 MovieClip Frame 1
on (release) {
_level0.gameStart = 1;
_level0.idd = setInterval(_level0.createMob, 1500);
_level0.tutorial.gotoAndStop(2);
}
Symbol 451 MovieClip Frame 1
stop();
Instance of Symbol 356 MovieClip in Symbol 451 MovieClip Frame 1
on (release) {
removeMovieClip(_level0.myBar);
removeMovieClip(_level0.levelCompleted);
us = 1;
while (us < 11) {
removeMovieClip("_level0.slot" + us);
us++;
}
us = 1;
while (us < 11) {
removeMovieClip("_level0.gg" + us);
us++;
}
us = 0;
while (us < 100) {
removeMovieClip("_level0.monster" + us);
us++;
}
removeMovieClip(_level0.txtnum);
_level0.gotoAndStop(3);
}
Instance of Symbol 356 MovieClip in Symbol 451 MovieClip Frame 2
on (release) {
_level0.myShip.EXP = _level0.myShip.EXP - (_level0.myShip.EXPmax / 10);
if (_level0.myShip.EXP < 0) {
_level0.myShip.EXP = 0;
}
_level0.myShip.cash = _level0.myShip.cash - (_level0.myShip.cash / 10);
removeMovieClip(_level0.myBar);
removeMovieClip(_level0.levelCompleted);
us = 1;
while (us < 11) {
removeMovieClip("_level0.slot" + us);
us++;
}
us = 1;
while (us < 11) {
removeMovieClip("_level0.gg" + us);
us++;
}
us = 0;
while (us < 100) {
removeMovieClip("_level0.monster" + us);
us++;
}
removeMovieClip(_level0.txtnum);
_level0.gotoAndStop(3);
}
Symbol 455 Button
on (release) {
gotoAndStop (3);
}
Symbol 456 Button
on (release) {
_root.gotoAndStop(8);
}