Frame 1
copyright = "Copyright (c) 2005 by Yaroslav Yanovsky";
var plLoaded = false;
var plLoadState = (int((this.getBytesLoaded() / this.getBytesTotal()) * 100) + "%");
fscommand ("showmenu", false);
fscommand ("allowscale", false);
fscommand ("wmode", "opaque");
Frame 2
if (this.getBytesLoaded() < this.getBytesTotal()) {
gotoAndPlay (1);
}
Frame 3
function EncrpytString(strVal) {
var strKey = "aHfEjcDebChGiAfIjDbEjacD";
var nLenKey = strKey.length;
var strZero = "0";
var strOut = "";
var nTot = strVal.length;
var nCntKey = 0;
var strOut = "";
var nCodeVal;
var nCodeKey;
var nTemp;
var nChecksum = 0;
nCnt = 0;
while (nCnt < nTot) {
nCodeVal = strVal.charCodeAt(nCnt);
if (nCodeVal >= 128) {
nCodeVal = "X";
}
nCodeKey = strKey.charCodeAt(nCntKey);
nCntKey = nCntKey + 1;
if (nCntKey >= nLenKey) {
nCntKey = 0;
}
nTemp = (nCodeVal % 16) + nCodeKey;
strOut = strOut + String.fromCharCode(nTemp);
nChecksum = nChecksum + nTemp;
nCodeKey = strKey.charCodeAt(nCntKey);
nCntKey = nCntKey + 1;
if (nCntKey >= nLenKey) {
nCntKey = 0;
}
nTemp = Math.floor(nCodeVal / 16) + nCodeKey;
strOut = strOut + String.fromCharCode(nTemp);
nChecksum = nChecksum + nTemp;
nCnt++;
}
nChecksum = nChecksum % 256;
nCodeKey = strKey.charCodeAt(nCntKey);
nCntKey = nCntKey + 1;
if (nCntKey >= nLenKey) {
nCntKey = 0;
}
nTemp = (nChecksum % 16) + nCodeKey;
strOut = strOut + String.fromCharCode(nTemp);
nCodeKey = strKey.charCodeAt(nCntKey);
nCntKey = nCntKey + 1;
if (nCntKey >= nLenKey) {
nCntKey = 0;
}
nTemp = Math.floor(nChecksum / 16) + nCodeKey;
strOut = strOut + String.fromCharCode(nTemp);
return(strOut);
}
function GetUrlParam(strUrl, strParam) {
var strUrlLC = strUrl.toLowerCase();
var nPos = strUrlLC.indexOf(strParam);
var nParamLen = strParam.length;
if (nPos > 0) {
var nNumChars;
var nPosEnd = strUrlLC.indexOf("&", nPos + nParamLen);
if (nPosEnd > 0) {
nNumChars = nPosEnd - nPos;
} else {
nNumChars = strUrl.length - nPos;
}
return(strUrl.substr(nPos + nParamLen, nNumChars));
}
return("");
}
function GetBaseUrl(strUrl) {
var strUrlLC = strUrl.toLowerCase();
var nNumChars = strUrlLC.length;
var nPos = strUrlLC.indexOf("?", 0);
if (nPos > 0) {
nNumChars = nPos;
}
var strVal = "download";
if (strUrlLC.substr(0, 4) == "http") {
strVal = strUrl.substr(7, nNumChars - 7);
}
return(strVal);
}
function adjustScore(value) {
_root.score = _root.score + value;
if (_root.score < 0) {
_root.score = 0;
}
}
function togglePause() {
if (paused) {
message.gotoAndPlay("unpaused");
} else {
message.gotoAndPlay("paused");
}
togglePauseSilent();
}
function togglePauseSilent() {
paused = !paused;
}
function getEncodedValue(v, key) {
var ss = (v ^ key).toString();
var a = new Array();
a.push(key);
var b = new Array();
i = 0;
while (i < ss.length) {
b.push(ss.charCodeAt(i) ^ key);
i++;
}
a.push(b.length ^ key);
a = a.concat(b);
return(a.join(","));
}
function getScoreEncoded() {
var key1 = random(16777215);
var key2 = random(16777215);
while (key2 == key1) {
key2 = random(16777215);
}
var key3 = random(16777215);
while ((key3 == key1) || (key3 == key2)) {
key3 = random(16777215);
}
var key4 = random(16777215);
while (((key4 == key1) || (key4 == key2)) || (key4 == key3)) {
key4 = random(16777215);
}
var lev = (_root.level + (6 * _root.difficulty));
return(new Array(getEncodedValue(_root.score, key1), getEncodedValue(lev, key2), getEncodedValue(_root.score, key3), getEncodedValue(lev, key4)));
}
function updateMouse() {
var x = _root._xmouse;
var y = _root._ymouse;
var state = ((((x > 0) && (x < 480)) && (y > 0)) && (y < 360));
if (state != mouseInRect) {
if ((mouseInRect = state)) {
Mouse.hide();
cursor._visible = true;
} else {
Mouse.show();
cursor._visible = false;
}
}
cursor._x = x;
cursor._y = y;
}
function updateTitle() {
updateMouse();
}
function hideOffscreenStuff() {
ufo.gotoAndPlay("dead");
ufo2.gotoAndPlay("dead");
terran.gotoAndPlay("dead");
terran3.gotoAndPlay("dead");
mine.gotoAndPlay("dead");
mine2.gotoAndPlay("dead");
caskorange.gotoAndPlay("dead");
caskred.gotoAndPlay("dead");
caskyellow.gotoAndPlay("dead");
caskblue.gotoAndPlay("dead");
caskgreen.gotoAndPlay("dead");
box.gotoAndPlay("dead");
bullet1.gotoAndPlay("dead");
bullet2.gotoAndPlay("dead");
bullet3.gotoAndPlay("dead");
bullet4.gotoAndPlay("dead");
plasma.gotoAndPlay("dead");
aimsrc.gotoAndPlay("dead");
shiphpsrc.gotoAndPlay("dead");
shipxpsrc.gotoAndPlay("dead");
planethpsrc.gotoAndPlay("dead");
weaponsrc.gotoAndPlay("dead");
playersrc.gotoAndPlay("dead");
}
function upgradeNumberToName(num) {
switch (num) {
case 1 :
return("armor");
case 2 :
return("bulletspeed");
case 3 :
return("clipsize");
case 4 :
return("experience");
case 5 :
return("explosion");
case 6 :
return("reload");
case 7 :
return("repair");
case 8 :
return("shipspeed");
case 9 :
return("shotspeed");
}
}
function buildingNumberToName(num) {
switch (Number(num)) {
case 1 :
return("airport");
case 2 :
return("starport");
case 3 :
return("support1");
case 4 :
return("support2");
case 5 :
return("support3");
case 6 :
return("ship");
case 7 :
return("squadron");
case 8 :
return("powerplant");
case 9 :
return("mine");
}
}
function playSound(snd) {
if (_root.soundEnabled) {
_root.sound.gotoAndPlay(snd);
}
}
function playMusic(snd) {
if (_root.musicEnabled) {
stopAllSounds();
_root.sound.gotoAndPlay(snd);
}
}
var rootURL = "http://www.enkord.com/";
if (moreGamesURL == undefined) {
moreGamesURL = rootURL;
}
if (downloadURL == undefined) {
downloadURL = rootURL + "product.php?action=download&product=clashnslash&from=webversion_v2";
}
if (orderURL == undefined) {
orderURL = rootURL + "product.php?action=order&product=clashnslash&from=webversion_v2";
}
if (hiscoreURL == undefined) {
hiscoreURL = rootURL + "clashnslashweb/hiscore.php";
}
moreGamesURL = (("http://www.arcadetown.com/index.asp?gameid=clashnslash&aid=" + GetUrlParam(_url, "aid=")) + "&refer=") + _root.GetBaseUrl(_url);
downloadURL = (("http://www.arcadetown.com/partner/download.asp?gameid=clashnslash&aid=" + GetUrlParam(_url, "aid=")) + "&refer=") + _root.GetBaseUrl(_url);
orderURL = (("http://www.arcadetown.com/clashnslash/ordergame.asp?aid=" + GetUrlParam(_url, "aid=")) + "&refer=") + _root.GetBaseUrl(_url);
highscoreURL = "http://www.arcadetown.com/clashnslash/view_high_scores.asp";
var HiScoreSaveURL = "http://www.arcadetown.com/clashnslash/hs.asp";
var _r;
var paused = false;
var curscreen = "none";
var curweapon = 0;
aimsrc.duplicateMovieClip("cursor", 15000);
var mouseState = false;
var prevMouseState = false;
var gameInit = true;
var score = 0;
var difficulty = 0;
var musicEnabled = true;
var soundEnabled = true;
var mouseInRect = ((((x > 0) && (x < 480)) && (y > 0)) && (y < 360));
if (mouseInRect) {
Mouse.hide();
}
hideOffscreenStuff();
cursor.gotoAndPlay("arrow");
Frame 4
playMusic("menumusic");
Frame 5
_quality = "high";
updateTitle();
_root.bg.gotoAndStop("space1");
play();
Frame 6
updateTitle();
gotoAndPlay (5);
Frame 7
function doInitLevel1() {
game.weapon = new WeaponClass(10, 40, bullet1);
game.maxspawn = 40;
_root.curweapon = 0;
game.shipupgrades = true;
game.shipupgradeshint = true;
game.planetupgrades = false;
game.unlockedweapons = 1;
_root.bg.gotoAndStop("space1");
}
function doSpawnLevel1(count) {
if (count < 20) {
if (count > 17) {
var i = 0;
while (i <= 2) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
} else if (roll == 6) {
bonus = BONUS_SPREAD;
}
game.spawnOnscreen(0.2, mine, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
} else if (roll == 6) {
bonus = BONUS_SPREAD;
}
game.spawnOffscreen(0.2, ufo, bonus);
i++;
}
} else if (count < 40) {
var i = 0;
while (i < 2) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll < 7) {
bonus = BONUS_EXPLOSION;
} else if (roll == 7) {
bonus = BONUS_NUKE;
} else if (roll <= 10) {
bonus = BONUS_SPREAD;
}
game.spawnOffscreen(0.2, ufo, bonus);
i++;
}
}
}
function doInitLevel2() {
game.weapon = new WeaponClass(25, 12, bullet2);
game.maxspawn = 60;
_root.curweapon = 1;
game.shipupgrades = true;
game.planetupgradeshint = true;
game.unlockedweapons = 1;
_root.bg.gotoAndStop("space1");
}
function doSpawnLevel2(count) {
if (count < 20) {
if (count > 17) {
var i = 0;
while (i <= (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
} else if (roll == 6) {
bonus = BONUS_NUKE;
}
game.spawnOnscreen(0.2, mine, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
} else if (roll == 6) {
bonus = BONUS_SLIME;
}
game.spawnOffscreen(0.25, terran, bonus, true);
i++;
}
} else if (count < 40) {
if (count > 37) {
var i = 0;
while (i <= (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
}
game.spawnOnscreen(0.2, mine, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 7) {
bonus = BONUS_NUKE;
} else if (roll <= 9) {
bonus = BONUS_SLIME;
}
game.spawnOffscreen(0.2, ufo2, bonus);
i++;
}
} else if (count < 60) {
var i = 0;
while (i < (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 7) {
bonus = BONUS_NUKE;
} else if (roll == 8) {
bonus = BONUS_SLIME;
}
game.spawnOffscreen(0.3, ufo2, bonus);
i++;
}
game.spawnOffscreen(0.2, ufo, 0);
}
}
function doInitLevel3() {
game.weapon = new WeaponClass(8, 30, bullet3);
game.weapon.isShrapnel = true;
_root.curweapon = 2;
game.maxspawn = 60;
game.shipupgrades = true;
game.unlockedweapons = 2;
_root.bg.gotoAndStop("space1");
}
function doSpawnLevel3(count) {
if (count < 20) {
game.spawnOnscreen(0.2, mine, 0);
if (count > 10) {
game.spawnOnscreen(0.3, mine2, 0);
}
} else if (count < 40) {
var i = 0;
while (i < (((count % 3) == 0) ? 3 : 2)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_SPREAD;
} else if (roll == 6) {
bonus = BONUS_ICE;
}
game.spawnOffscreen(0.2, ufo, bonus);
i++;
}
} else if (count < 60) {
var i = 0;
while (i < (((count % 3) == 0) ? 3 : 2)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll < 7) {
bonus = BONUS_SPREAD;
} else if (roll == 7) {
bonus = BONUS_NUKE;
} else if (roll <= 10) {
bonus = BONUS_ICE;
}
game.spawnOffscreen(0.3, ufo2, bonus);
i++;
}
}
}
function doInitLevel4() {
game.weapon = new WeaponClass(8, 30, bullet3);
game.weapon.isShrapnel = true;
_root.curweapon = 2;
game.maxspawn = 60;
game.shipupgrades = true;
game.unlockedweapons = 3;
_root.bg.gotoAndStop("space2");
}
function doSpawnLevel4(count) {
if (count < 20) {
if (count > 15) {
var i = 0;
while (i <= 3) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
} else if (roll == 6) {
bonus = BONUS_ICE;
}
game.spawnOnscreen(0.3, mine, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
} else if (roll == 6) {
bonus = BONUS_SLIME;
}
game.spawnOffscreen(0.25, terran, bonus, true);
i++;
}
} else if (count < 40) {
var i = 0;
while (i < (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll < 7) {
bonus = BONUS_EXPLOSION;
} else if (roll == 7) {
bonus = BONUS_NUKE;
} else if (roll <= 10) {
bonus = BONUS_ICE;
}
game.spawnOffscreen(0.3, ufo2, bonus);
i++;
}
} else if (count < 60) {
var i = 0;
while (i < (((count % 3) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll < 7) {
bonus = BONUS_EXPLOSION;
} else if (roll == 7) {
bonus = BONUS_NUKE;
} else if (roll <= 10) {
bonus = BONUS_SLIME;
}
game.spawnOnscreen(0.3, mine2, bonus);
i++;
}
game.spawnOffscreen(0.3, ufo2, 0);
}
}
function doInitLevel5() {
game.weapon = new WeaponClass(6, 40, bullet4);
game.weapon.isRocket = true;
_root.curweapon = 3;
game.maxspawn = 80;
game.unlockedweapons = 3;
_root.bg.gotoAndStop("space2");
}
function doSpawnLevel5(count) {
if (count < 20) {
if (count < 5) {
game.spawnOnscreen(0.3, mine2, 0);
}
if (count > 17) {
var i = 0;
while (i <= 2) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
} else if (roll == 6) {
bonus = BONUS_NUKE;
}
game.spawnOnscreen(0.2, mine, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
} else if (roll == 6) {
bonus = BONUS_SPREAD;
}
game.spawnOffscreen(0.25, terran, bonus, true);
i++;
}
} else if (count < 40) {
if (count > 37) {
var i = 0;
while (i <= (((count % 3) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
}
game.spawnOnscreen(0.2, mine, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll < 7) {
bonus = BONUS_EXPLOSION;
} else if (roll == 7) {
bonus = BONUS_NUKE;
} else if (roll <= 9) {
bonus = BONUS_ICE;
}
game.spawnOffscreen(0.3, ufo2, bonus);
i++;
}
} else if (count < 60) {
if (count > 55) {
var i = 0;
while (i <= (((count % 3) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
}
game.spawnOnscreen(0.3, mine2, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 3) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll < 7) {
bonus = BONUS_EXPLOSION;
} else if (roll == 7) {
bonus = BONUS_NUKE;
} else if (roll == 8) {
bonus = BONUS_SLIME;
}
game.spawnOffscreen(0.35, terran3, bonus, true);
i++;
}
game.spawnOffscreen(0.2, ufo, 0);
} else if (count < 80) {
if (count > 75) {
var i = 0;
while (i <= (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_NUKE;
} else if (roll == 6) {
bonus = BONUS_SLIME;
}
game.spawnOnscreen(0.3, mine2, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 2) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll < 7) {
bonus = BONUS_EXPLOSION;
} else if (roll == 7) {
bonus = BONUS_NUKE;
}
game.spawnOffscreen(0.3, ufo2, bonus);
i++;
}
game.spawnOffscreen(0.35, terran3, 0, true);
}
}
function doInitLevel6() {
game.weapon = new WeaponClass(10, 40, bullet1);
_root.curweapon = 0;
game.maxspawn = 80;
game.unlockedweapons = 3;
_root.bg.gotoAndStop("space2");
}
function doSpawnLevel6(count) {
if (count < 20) {
if (count > 17) {
var i = 0;
while (i <= 2) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
} else if (roll == 6) {
bonus = BONUS_NUKE;
}
game.spawnOnscreen(0.2, mine, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 2) == 0) ? 3 : 2)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
} else if (roll == 6) {
bonus = BONUS_SPREAD;
}
game.spawnOffscreen(0.25, terran, bonus, true);
i++;
}
} else if (count < 40) {
if (count > 37) {
var i = 0;
while (i <= (((count % 3) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
}
game.spawnOnscreen(0.3, mine2, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 2) == 0) ? 3 : 2)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll < 7) {
bonus = BONUS_EXPLOSION;
} else if (roll == 7) {
bonus = BONUS_NUKE;
} else if (roll <= 9) {
bonus = BONUS_ICE;
}
game.spawnOffscreen(0.3, ufo2, bonus);
i++;
}
} else if (count < 60) {
if (count > 55) {
var i = 0;
while (i <= (((count % 3) == 0) ? 3 : 2)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
}
game.spawnOnscreen(0.3, mine2, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 3) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll < 7) {
bonus = BONUS_EXPLOSION;
} else if (roll == 7) {
bonus = BONUS_NUKE;
} else if (roll == 8) {
bonus = BONUS_SLIME;
}
game.spawnOffscreen(0.35, terran3, bonus, true);
i++;
}
game.spawnOffscreen(0.2, ufo, 0);
} else if (count < 80) {
if (count > 75) {
var i = 0;
while (i <= (((count % 2) == 0) ? 3 : 2)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_NUKE;
} else if (roll == 6) {
bonus = BONUS_SLIME;
}
game.spawnOnscreen(0.3, mine2, bonus);
i++;
}
}
var i = 0;
while (i < (((count % 2) == 0) ? 3 : 2)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll < 7) {
bonus = BONUS_EXPLOSION;
} else if (roll == 7) {
bonus = BONUS_NUKE;
}
game.spawnOffscreen(0.3, ufo2, bonus);
i++;
}
game.spawnOffscreen(0.35, terran3, 0, true);
}
}
var level = 1;
score = 0;
noshoot = false;
Frame 8
function deg2rad(fVal) {
return((fVal * Math.PI) / 180);
}
function rad2deg(fVal) {
return(fVal * 57.2957795130823);
}
function getLength(x, y) {
return(Math.sqrt((x * x) + (y * y)));
}
function setLength(x, y, len) {
var slen = getLength(x, y);
if (slen < 1E-5) {
return(undefined);
}
if (len > 1E-5) {
slen = slen / len;
x = x / slen;
y = y / slen;
} else {
x = 0;
y = 0;
}
return([x, y]);
}
function EntityClass(x, y, imc) {
imc.duplicateMovieClip("entity" + entityCounter, entityCounter);
this.mc = _root["entity" + entityCounter];
entityCounter++;
this.mc._x = x;
this.mc._y = y;
this.velocityX = 0;
this.velocityY = 0;
this.alive = true;
this.status = STATUS_NORMAL;
this.laststatus = 0;
this.bonus = 0;
}
function BonusClass(x, y, fx, imc) {
super(x, y, imc);
this.effect = fx;
}
function PlayerClass(imc) {
this.velocityX = 0;
this.velocityY = 0;
if (player) {
this.mc = player;
} else {
imc.duplicateMovieClip("player", guiDepth++);
this.mc = player;
}
this.maxhp = 18;
this.hp = this.maxhp;
this.lastdamage = 0;
this.lastrepair = 0;
this.damagepause = 40;
this.repairpause = 150;
this.respawnpause = respawnTime * 2;
this.xp = 0;
this.xplevel = 0;
shipxp.bar._xscale = 0;
}
function PlanetClass(imc) {
this.mc = imc;
this.velocityX = 0;
this.velocityY = 0;
this.maxhp = 200;
this.hp = this.maxhp;
this.xp = 0;
this.xplevel = 0;
this.lastexp = 0;
this.lastregen = 0;
planetxp.bar._xscale = 0;
}
function WeaponClass(clp, cd, imc) {
i = 1;
while (i <= 40) {
var obj = eval ("bulletcover" + i);
if (typeof(obj) == "movieclip") {
obj.removeMovieClip();
}
i++;
}
this.maxclip = clp;
this.clip = this.maxclip;
this.cooldown = cd;
this.lastshot = 0;
gui.clip.gotoAndPlay(this.clip + 2);
this.reloaded = 0;
this.mc = imc;
this.isShrapnel = false;
this.isRocket = false;
i = 1;
while (i <= 40) {
bulletcover.duplicateMovieClip("bulletcover" + i, 8000 + i);
var obj = _root["bulletcover" + i];
obj._x = 25 + (i * 12);
obj._y = 12;
obj._visible = i <= this.maxclip;
i++;
}
}
function GameClass() {
this.objects = new Array();
this.bullets = new Array();
this.bonuses = new Array();
this.player = new PlayerClass(playersrc);
this.player.mc.swapDepths(8000);
this.planet = new PlanetClass(planetsrc);
this.frames = 0;
this.spawnCounter = 0;
this.upgrades = new Array();
this.shipupgrades = true;
this.shipupgradeshint = false;
this.planetupgrades = true;
this.planetupgradeshint = false;
this.buildings = new Array();
this.unlockedweapons = 3;
}
var entityCounter = 100;
var orbitLength = 80;
var reloadTime = aimsrc.reload;
var reloadTimeUpgraded = aimsrc.reloadupgraded;
var respawnTime = aimsrc.respawn;
var guiDepth = 10000;
var levelCompleteMessageDisplayed = false;
var gameOverState = false;
CLEAN_PAUSE = 100;
SPAWN_PAUSE = 100;
_quality = "low";
_root.playMusic("gamemusic");
weaponsrc.duplicateMovieClip("weapon", guiDepth++);
weapon._x = 14;
weapon._y = 14;
message.currentleveltext = "LEVEL " + level;
i = 0;
while (i < difficulty) {
message.currentleveltext = message.currentleveltext + "*";
i++;
}
message.gotoAndPlay("level");
cursor.gotoAndStop("aim");
BONUS_EXPLOSION = 1;
BONUS_NUKE = 2;
BONUS_SPREAD = 3;
BONUS_SCORE = 4;
BONUS_SLIME = 5;
BONUS_ICE = 6;
STATUS_NORMAL = 0;
STATUS_SLIME = 1;
STATUS_ICE = 2;
STATUS_PERIOD = 200;
var bonusmc = new Array();
bonusmc[BONUS_EXPLOSION] = caskorange;
bonusmc[BONUS_NUKE] = caskred;
bonusmc[BONUS_SPREAD] = caskyellow;
bonusmc[BONUS_SCORE] = box;
bonusmc[BONUS_SLIME] = caskgreen;
bonusmc[BONUS_ICE] = caskblue;
SCORE_PLAYER_HIT_PENALTY = -500;
SCORE_PLAYER_DEATH_PENALTY = -5000;
SCORE_PLANET_HIT_PENALTY = -1000;
SCORE_SHOT_MISS_PENALTY = -50;
SCORE_SLIME_CATCH = 200;
SCORE_ICE_CATCH = 500;
SCORE_EXPLOSION_FACTOR = 8;
SCORE_NUKE_FACTOR = 4;
SCORE_SLIME_DEATH_FACTOR = 5;
SCORE_ICE_DEATH_FACTOR = 10;
SCORE_UPGRADE_FACTOR = 1.3;
shiphpsrc.duplicateMovieClip("shiphp", guiDepth++);
shiphp._x = 60;
shiphp._y = 344;
shipxpsrc.duplicateMovieClip("shipxp", guiDepth++);
shipxp._x = 72;
shipxp._y = 330;
planethpsrc.duplicateMovieClip("planethp", guiDepth++);
planethp._x = 420;
planethp._y = 344;
shipxpsrc.duplicateMovieClip("planetxp", guiDepth++);
planetxp._x = 432;
planetxp._y = 330;
mouseListener = new Object();
mouseListener.onMouseDown = function () {
mouseState = true;
};
mouseListener.onMouseUp = function () {
mouseState = false;
};
Mouse.addListener(mouseListener);
EntityClass.prototype.setMovement = function (x, y, vel) {
var len = setLength(x - this.mc._x, y - this.mc._y, vel);
this.velocityX = len[0];
this.velocityY = len[1];
};
EntityClass.prototype.update = function () {
if (this.status != STATUS_NORMAL) {
if ((this.laststatus + STATUS_PERIOD) < game.frames) {
this.setStatus(STATUS_NORMAL);
}
if (this.status == STATUS_SLIME) {
this.mc._x = this.mc._x + (this.velocityX / 2);
this.mc._y = this.mc._y + (this.velocityY / 2);
}
} else {
this.mc._x = this.mc._x + this.velocityX;
this.mc._y = this.mc._y + this.velocityY;
}
};
EntityClass.prototype.die = function () {
if (this.alive) {
var sc = this.mc.score;
if (this.status == STATUS_SLIME) {
sc = sc * SCORE_SLIME_DEATH_FACTOR;
} else if (this.status == STATUS_SLIME) {
sc = sc * SCORE_ICE_DEATH_FACTOR;
}
if (game.upgrades[4]) {
sc = sc * SCORE_UPGRADE_FACTOR;
}
adjustScore(Math.round(sc));
game.player.addExperience(Math.round(sc));
this.mc.gotoAndPlay("decay");
} else {
this.mc.gotoAndPlay("dead");
}
this.alive = false;
if (this.bonus != 0) {
var obj = new BonusClass(this.mc._x, this.mc._y, this.bonus, bonusmc[this.bonus]);
game.addBonus(obj);
}
};
EntityClass.prototype.dieSilent = function () {
this.alive = false;
this.mc.gotoAndPlay("dead");
};
EntityClass.prototype.setStatus = function (newstatus) {
if (newstatus == STATUS_NORMAL) {
this.mc.gotoAndPlay("alive");
this.status = newstatus;
this.laststatus = game.frames;
} else if (this.mc._currentframe == 1) {
this.status = newstatus;
if (newstatus == STATUS_SLIME) {
this.mc.gotoAndPlay("slime");
} else {
this.mc.gotoAndPlay("ice");
}
this.laststatus = game.frames;
}
};
BonusClass.prototype = new EntityClass();
BonusClass.prototype.die = function () {
super.die();
if (this.effect == BONUS_EXPLOSION) {
for (i in game.bonuses) {
var obj = game.bonuses[i];
if ((((obj.alive && (obj.mc._x > (this.mc._x - 60))) && (obj.mc._x < (this.mc._x + 60))) && (obj.mc._y > (this.mc._y - 60))) && (obj.mc._y < (this.mc._y + 60))) {
obj.die();
}
adjustScore(obj.mc.score * SCORE_EXPLOSION_FACTOR);
}
for (i in game.objects) {
var obj = game.objects[i];
if ((((obj.alive && (obj.mc._x > (this.mc._x - 70))) && (obj.mc._x < (this.mc._x + 70))) && (obj.mc._y > (this.mc._y - 70))) && (obj.mc._y < (this.mc._y + 70))) {
obj.die();
}
adjustScore(obj.mc.score * SCORE_EXPLOSION_FACTOR);
}
} else if (this.effect == BONUS_NUKE) {
for (i in game.bonuses) {
var obj = game.bonuses[i];
if ((((obj.alive && (obj.mc._x > (this.mc._x - 90))) && (obj.mc._x < (this.mc._x + 90))) && (obj.mc._y > (this.mc._y - 90))) && (obj.mc._y < (this.mc._y + 90))) {
obj.die();
}
adjustScore(obj.mc.score * SCORE_NUKE_FACTOR);
}
for (i in game.objects) {
var obj = game.objects[i];
if ((((obj.alive && (obj.mc._x > (this.mc._x - 100))) && (obj.mc._x < (this.mc._x + 100))) && (obj.mc._y > (this.mc._y - 100))) && (obj.mc._y < (this.mc._y + 100))) {
obj.die();
}
adjustScore(obj.mc.score * SCORE_NUKE_FACTOR);
}
} else if (this.effect == BONUS_SPREAD) {
obj = new EntityClass(this.mc._x, this.mc._y, plasma);
obj.setMovement(this.mc._x - 10, this.mc._y, 7);
obj.mc._rotation = 270;
game.addBullet(obj);
obj = new EntityClass(this.mc._x, this.mc._y, plasma);
obj.setMovement(this.mc._x + 10, this.mc._y, 7);
obj.mc._rotation = 90;
game.addBullet(obj);
obj = new EntityClass(this.mc._x, this.mc._y, plasma);
obj.setMovement(this.mc._x, this.mc._y - 10, 7);
game.addBullet(obj);
obj = new EntityClass(this.mc._x, this.mc._y, plasma);
obj.setMovement(this.mc._x, this.mc._y + 10, 7);
obj.mc._rotation = 180;
game.addBullet(obj);
obj = new EntityClass(this.mc._x, this.mc._y, plasma);
obj.setMovement(this.mc._x - 10, this.mc._y - 10, 7);
obj.mc._rotation = -45;
game.addBullet(obj);
obj = new EntityClass(this.mc._x, this.mc._y, plasma);
obj.setMovement(this.mc._x + 10, this.mc._y - 10, 7);
obj.mc._rotation = 45;
game.addBullet(obj);
obj = new EntityClass(this.mc._x, this.mc._y, plasma);
obj.setMovement(this.mc._x - 10, this.mc._y + 10, 7);
obj.mc._rotation = 225;
game.addBullet(obj);
obj = new EntityClass(this.mc._x, this.mc._y, plasma);
obj.setMovement(this.mc._x + 10, this.mc._y + 10, 7);
obj.mc._rotation = 135;
game.addBullet(obj);
} else if (this.effect == BONUS_SLIME) {
for (i in game.objects) {
var obj = game.objects[i];
if ((((obj.alive && (obj.mc._x > (this.mc._x - 90))) && (obj.mc._x < (this.mc._x + 90))) && (obj.mc._y > (this.mc._y - 90))) && (obj.mc._y < (this.mc._y + 90))) {
obj.setStatus(STATUS_SLIME);
}
adjustScore(SCORE_SLIME_CATCH);
}
} else if (this.effect == BONUS_ICE) {
for (i in game.objects) {
var obj = game.objects[i];
if ((((obj.alive && (obj.mc._x > (this.mc._x - 90))) && (obj.mc._x < (this.mc._x + 90))) && (obj.mc._y > (this.mc._y - 90))) && (obj.mc._y < (this.mc._y + 90))) {
obj.setStatus(STATUS_ICE);
}
adjustScore(SCORE_ICE_CATCH);
}
}
};
PlayerClass.prototype = new EntityClass();
PlayerClass.prototype.xptable = [700, 4000, 9000, 18000, 30000, 46000, 70000, 100000, 130000, 170000, 1000000];
PlayerClass.prototype.addExperience = function (xpnum) {
if (!game.shipupgrades) {
return(undefined);
}
this.xp = this.xp + xpnum;
var prevxp = ((this.xplevel == 0) ? 0 : (this.xptable[this.xplevel - 1]));
shipxp.bar._xscale = ((this.xp - prevxp) / (this.xptable[this.xplevel] - prevxp)) * 100;
if (shipxp.bar._xscale > 100) {
shipxp.bar._xscale = 100;
}
if ((game.shipupgrades && (this.xp > this.xptable[this.xplevel])) && (shiphp.upgrade._currentframe == 1)) {
if (game.shipupgradeshint) {
shiphp.upgrade.gotoAndStop("hint");
game.shipupgradeshint = false;
togglePauseSilent();
} else {
shiphp.upgrade.gotoAndStop("on");
}
this.xplevel++;
_root.playSound("levelup");
}
};
PlayerClass.prototype.update = function () {
if (this.hp <= 0) {
var resp = this.respawnpause;
if (game.buildings[1]) {
if (game.buildings[2]) {
resp = resp * 0.5;
} else {
resp = resp * 0.75;
}
}
if ((this.lastdamage + resp) < game.frames) {
this.hp = this.maxhp;
this.mc.gotoAndPlay("respawn");
shiphp.bar._xscale = 100;
}
return(undefined);
}
if (game.upgrades[7] && ((this.lastrepair + this.repairpause) < game.frames)) {
this.hp++;
if (this.hp > this.maxhp) {
this.hp = this.maxhp;
}
shiphp.bar._xscale = (this.hp / this.maxhp) * 100;
this.lastrepair = game.frames;
}
var x = (_xmouse - this.mc._x);
var y = (_ymouse - this.mc._y);
var distance = getLength(x, y);
var vel;
if (distance > 100) {
var fvel = ((distance - 100) / 20);
if (fvel > 2) {
fvel = 2;
}
if (game.upgrades[8]) {
fvel = fvel * 2;
}
vel = setLength(x, y, fvel);
} else {
vel = [0, 0];
}
this.velocityX = vel[0];
this.velocityY = vel[1];
super.update();
var x = (this.mc._x - planetsrc._x);
var y = (this.mc._y - planetsrc._y);
var len = setLength(x, y, orbitLength);
x = len[0] + planetsrc._x;
y = len[1] + planetsrc._y;
this.mc._x = x;
this.mc._y = y;
if (distance > 5) {
x = _root._xmouse - x;
y = _root._ymouse - y;
if (x > 0.01) {
var deg = Math.atan(y / x);
this.mc._rotation = (deg * 180) / Math.PI;
} else if (x < -0.01) {
var deg = Math.atan(y / x);
this.mc._rotation = 180 + ((deg * 180) / Math.PI);
} else if (y > 0) {
this.mc._rotation = 90;
} else {
this.mc._rotation = -90;
}
}
};
PlayerClass.prototype.damage = function () {
if ((this.hp <= 0) || ((this.lastdamage + this.damagepause) > game.frames)) {
return(undefined);
}
this.mc.gotoAndPlay("damage");
this.lastdamage = game.frames;
if (game.upgrades[1]) {
this.hp = this.hp - 2;
} else {
this.hp = this.hp - 3;
}
shiphp.bar._xscale = (this.hp / this.maxhp) * 100;
if (this.hp <= 0) {
this.mc.gotoAndPlay("decay");
if (game.buildings[1]) {
if (game.buildings[2]) {
cursor.gotoAndPlay("respawn2");
} else {
cursor.gotoAndPlay("respawn1");
}
} else {
cursor.gotoAndPlay("respawn");
}
adjustScore(SCORE_PLAYER_DEATH_PENALTY);
if (game.upgrades[5]) {
for (i in game.bonuses) {
var obj = game.bonuses[i];
if ((((obj.alive && (obj.mc._x > (this.mc._x - 100))) && (obj.mc._x < (this.mc._x + 100))) && (obj.mc._y > (this.mc._y - 100))) && (obj.mc._y < (this.mc._y + 100))) {
obj.die();
}
adjustScore(obj.mc.score * SCORE_NUKE_FACTOR);
}
for (i in game.objects) {
var obj = game.objects[i];
if ((((obj.alive && (obj.mc._x > (this.mc._x - 100))) && (obj.mc._x < (this.mc._x + 100))) && (obj.mc._y > (this.mc._y - 100))) && (obj.mc._y < (this.mc._y + 100))) {
obj.die();
}
adjustScore(obj.mc.score * SCORE_NUKE_FACTOR);
}
}
} else {
adjustScore(SCORE_PLAYER_HIT_PENALTY);
}
};
PlanetClass.prototype = new EntityClass();
PlanetClass.prototype.xptable = [1000, 5000, 10000, 16000, 23000, 31000, 40000, 50000, 61000, 72000, 1000000];
PlanetClass.prototype.update = function () {
if ((this.lastexp + 50) < game.frames) {
this.lastexp = game.frames;
this.addExperience(100);
}
if ((this.lastregen + 100) < game.frames) {
this.lastregen = game.frames;
var hpadd = 0;
if (game.buildings[3]) {
hpadd = hpadd + 1;
}
if (game.buildings[5]) {
hpadd = hpadd + 3;
}
if (game.buildings[8]) {
hpadd = hpadd + 3;
}
if (game.buildings[9]) {
hpadd = hpadd + 2;
}
this.hp = this.hp + hpadd;
if (this.hp > this.maxhp) {
this.hp = this.maxhp;
}
planethp.bar._xscale = (this.hp / this.maxhp) * 100;
}
};
PlanetClass.prototype.damage = function () {
if ((this.hp <= 0) || ((this.lastdamage + this.damagepause) > game.frames)) {
return(undefined);
}
var hpdec = 20;
if (game.buildings[3]) {
hpdec = hpdec - 2;
}
if (game.buildings[6]) {
hpdec = hpdec - 3;
}
if (game.buildings[7]) {
hpdec = hpdec - 3;
}
if (game.buildings[9]) {
hpdec = hpdec - 1;
}
this.hp = this.hp - hpdec;
planethp.bar._xscale = (this.hp / this.maxhp) * 100;
if (this.hp <= 0) {
this.mc.gotoAndPlay("decay");
}
adjustScore(SCORE_PLANET_HIT_PENALTY);
};
PlanetClass.prototype.addExperience = function (xpnum) {
if (!game.planetupgrades) {
return(undefined);
}
this.xp = this.xp + xpnum;
var prevxp = ((this.xplevel == 0) ? 0 : (this.xptable[this.xplevel - 1]));
planetxp.bar._xscale = ((this.xp - prevxp) / (this.xptable[this.xplevel] - prevxp)) * 100;
if (planetxp.bar._xscale > 100) {
planetxp.bar._xscale = 100;
}
if ((game.planetupgrades && (this.xp > this.xptable[this.xplevel])) && (planethp.upgrade._currentframe == 1)) {
if (game.planetupgradeshint) {
planethp.upgrade.gotoAndStop("hint");
game.planetupgradeshint = false;
togglePauseSilent();
} else {
planethp.upgrade.gotoAndStop("on");
}
this.xplevel++;
_root.playSound("levelup");
}
};
WeaponClass.prototype.shoot = function () {
var cd = this.cooldown;
if (game.upgrades[9]) {
cd = cd * 0.75;
}
if ((this.lastshot + cd) > game.frames) {
return(false);
}
if (this.clip > 0) {
_root["bulletcover" + this.clip]._visible = false;
this.clip--;
if (this.clip <= 0) {
this.reload();
}
this.lastshot = game.frames;
return(true);
}
return(false);
};
WeaponClass.prototype.reload = function () {
if (game.upgrades[6]) {
this.reloaded = game.frames + (reloadTimeUpgraded * 2);
cursor.gotoAndPlay("reloadupgraded");
_root.playSound("reload");
} else {
this.reloaded = game.frames + (reloadTime * 2);
cursor.gotoAndPlay("reload");
_root.playSound("reload");
}
};
WeaponClass.prototype.update = function () {
if ((this.clip <= 0) && (this.reloaded <= game.frames)) {
this.clip = Math.round(this.maxclip * (game.upgrades[3] ? 1.3 : 1));
i = 1;
while (i <= this.clip) {
_root["bulletcover" + i]._visible = true;
i++;
}
}
};
WeaponClass.prototype.remove = function () {
i = 1;
while (i <= this.clip) {
_root["bulletcover" + i].removeMovieClip();
i++;
}
};
GameClass.prototype.init = function () {
_root["doInitLevel" + level]();
};
GameClass.prototype.addObject = function (obj) {
this.objects.push(obj);
};
GameClass.prototype.addBullet = function (bul) {
this.bullets.push(bul);
};
GameClass.prototype.addBonus = function (bon) {
this.bonuses.push(bon);
};
GameClass.prototype.isGameOver = function () {
return((this.objects.length > 0) && (this.planet.mc._currentframe == this.planet.mc._totalframes));
};
GameClass.prototype.cleanUp = function () {
for (i in this.objects) {
this.objects[i].dieSilent();
}
for (i in this.bonuses) {
this.bonuses[i].dieSilent();
}
for (i in this.bullets) {
this.bullets[i].dieSilent();
}
planethp.removeMovieClip();
shiphp.removeMovieClip();
planetxp.removeMovieClip();
shipxp.removeMovieClip();
_root.weapon.removeMovieClip();
this.weapon.remove();
this.clean();
};
GameClass.prototype.gameOver = function () {
this.cleanUp();
cursor.gotoAndPlay("arrow");
gameOverState = true;
this.player.mc.removeMovieClip();
};
GameClass.prototype.levelComplete = function () {
this.cleanUp();
level++;
};
GameClass.prototype.update = function () {
updateMouse();
if (_root.paused) {
return(undefined);
}
this.player.update();
this.weapon.update();
this.planet.update();
for (i in this.objects) {
var obj = this.objects[i];
obj.update();
if (obj.alive) {
if (obj.mc.hit.hitTest(this.player.mc.hit)) {
this.player.damage();
} else if (obj.mc.hit.hitTest(this.planet.mc.hit)) {
this.planet.damage();
obj.die();
}
}
}
for (i in this.bonuses) {
this.bonuses[i].update();
}
for (i in this.bullets) {
var bul = this.bullets[i];
if (bul.alive) {
bul.update();
if ((((bul.mc._x < -20) || (bul.mc._x > 500)) || (bul.mc._y < -20)) || (bul.mc._y > 380)) {
bul.dieSilent();
adjustScore(SCORE_SHOT_MISS_PENALTY);
} else if ((game.frames % 5) == 0) {
for (j in this.bonuses) {
var bon = this.bonuses[j];
if (bon.alive && (bon.mc.hit.hitTest(bul.mc._x, bul.mc._y, false))) {
bon.die();
bul.die();
break;
}
}
for (j in this.objects) {
var obj = this.objects[j];
if (obj.alive && (obj.mc.hit.hitTest(bul.mc._x, bul.mc._y, false))) {
obj.die();
bul.die();
break;
}
}
}
}
}
if (this.isGameOver()) {
this.gameOver();
}
this.frames++;
if ((this.frames % CLEAN_PAUSE) == 0) {
this.clean();
}
if ((this.frames % SPAWN_PAUSE) == 1) {
_root["doSpawnLevel" + level](this.spawnCounter++);
}
};
GameClass.prototype.clean = function () {
var obj = new Array();
for (i in this.objects) {
var o = this.objects[i];
if ((o.alive || ((o.mc._currentframe != o.mc._totalframes) && (o.mc._currentframe != 1))) && ((((o.mc._x > -50) && (o.mc._x < 530)) && (o.mc._y > -50)) && (o.mc._y < 410))) {
obj.push(o);
} else {
o.mc.removeMovieClip();
}
}
this.objects = obj;
var bon = new Array();
for (i in this.bonuses) {
var b = this.bonuses[i];
if (b.alive || (b.mc._currentframe < b.mc._totalframes)) {
bon.push(b);
} else {
b.mc.removeMovieClip();
}
}
this.bonuses = bon;
var bul = new Array();
for (i in this.bullets) {
var b = this.bullets[i];
if (b.alive || (b.mc._currentframe < b.mc._totalframes)) {
bul.push(b);
} else {
b.mc.removeMovieClip();
}
}
this.bullets = bul;
};
GameClass.prototype.shootAt = function (x, y) {
if ((this.player.hp <= 0) || (!this.weapon.shoot())) {
return(undefined);
}
this.player.mc.gotoAndPlay("shot");
var obj = new EntityClass(this.player.mc._x, this.player.mc._y, this.weapon.mc);
var bulletspeed = 5;
if (this.upgrades[2]) {
bulletspeed = bulletspeed + 2;
}
obj.setMovement(x, y, bulletspeed);
game.addBullet(obj);
if (this.weapon.isShrapnel) {
var x1 = (x - this.player.mc._x);
var y1 = (y - this.player.mc._y);
var angle = 0.2;
var s = Math.sin(angle);
var c = Math.cos(angle);
var nx = ((x1 * c) + (y1 * s));
var obj = new EntityClass(this.player.mc._x, this.player.mc._y, this.weapon.mc);
obj.setMovement(nx + this.player.mc._x, (((-x1) * s) + (y1 * c)) + this.player.mc._y, bulletspeed);
obj.mc._xscale = 80;
obj.mc._yscale = 80;
game.addBullet(obj);
var angle = -0.2;
var s = Math.sin(angle);
var c = Math.cos(angle);
var nx = ((x1 * c) + (y1 * s));
var obj = new EntityClass(this.player.mc._x, this.player.mc._y, this.weapon.mc);
obj.setMovement(nx + this.player.mc._x, (((-x1) * s) + (y1 * c)) + this.player.mc._y, bulletspeed);
obj.mc._xscale = 80;
obj.mc._yscale = 80;
game.addBullet(obj);
} else if (this.weapon.isRocket) {
obj.mc._rotation = rad2deg(Math.atan2(y - this.player.mc._y, x - this.player.mc._x)) + 90;
obj.effect = BONUS_EXPLOSION;
obj.dieLikeBonus = BonusClass.prototype.die;
obj.dieOld = EntityClass.prototype.die;
obj.die = function () {
this.dieOld();
this.dieLikeBonus();
};
}
};
GameClass.prototype.spawnOffscreen = function (vel, mc, bonus, orient) {
var x = 0;
var y = 0;
switch (Math.floor(Math.random() * 4)) {
case 0 :
x = -20;
y = Math.random() * 360;
break;
case 1 :
x = 500;
y = Math.random() * 360;
break;
case 2 :
x = Math.random() * 480;
y = -20;
break;
case 3 :
x = Math.random() * 480;
y = 380;
}
if ((x < 50) && (y < 50)) {
x = Math.random() * 480;
y = 380;
}
var obj = new EntityClass(x, y, mc);
obj.bonus = bonus;
obj.setMovement(240, 180, vel * (1 + (0.5 * difficulty)));
if ((orient != undefined) && (orient)) {
obj.mc._rotation = rad2deg(Math.atan2(180 - obj.mc._y, 240 - obj.mc._x)) + 90;
}
this.addObject(obj);
};
GameClass.prototype.spawnOnscreen = function (vel, mc, bonus) {
var x = 0;
var y = 0;
switch (Math.floor(Math.random() * 4)) {
case 0 :
x = 20 + (Math.random() * 110);
y = 20 + (Math.random() * 320);
break;
case 1 :
x = 460 - (Math.random() * 110);
y = 20 + (Math.random() * 320);
break;
case 2 :
x = 20 + (Math.random() * 440);
y = 20 + (Math.random() * 50);
break;
case 3 :
x = 20 + (Math.random() * 440);
y = 340 - (Math.random() * 50);
}
if ((x < 50) && (y < 50)) {
x = Math.random() * 480;
y = 380;
}
var obj = new EntityClass(x, y, mc);
obj.bonus = bonus;
obj.setMovement(240, 180, vel * (1 + (0.5 * difficulty)));
obj.mc.gotoAndPlay("zoom");
this.addObject(obj);
};
GameClass.prototype.beginShipScreen = function (w1, w2, w3) {
if (!_root.paused) {
togglePauseSilent();
}
_root.shiphp.showWeaponPanel(w1, w2, w3);
_root.cursor.gotoAndPlay("arrow");
};
GameClass.prototype.endShipScreen = function (sel) {
_root.curscreen = "none";
togglePauseSilent();
_root.shiphp.hideWeaponPanel(sel);
if (sel.charAt(0) == "w") {
switch (Number(sel.charAt(6))) {
case 1 :
game.weapon = new WeaponClass(25, 12, bullet2);
break;
case 2 :
game.weapon = new WeaponClass(8, 30, bullet3);
game.weapon.isShrapnel = true;
break;
case 3 :
game.weapon = new WeaponClass(6, 40, bullet4);
game.weapon.isRocket = true;
}
_root.curweapon = Number(sel.charAt(6));
} else {
this.upgrades[sel] = true;
}
};
GameClass.prototype.beginPlanetScreen = function () {
if (!_root.paused) {
togglePauseSilent();
}
_root.planethp.showPanel();
_root.cursor.gotoAndPlay("arrow");
};
GameClass.prototype.endPlanetScreen = function (sel) {
_root.curscreen = "none";
togglePauseSilent();
_root.planethp.hidePanel(sel);
this.buildings[sel] = true;
planetsrc.planet[buildingNumberToName(sel)].gotoAndPlay("on");
};
var game = new GameClass();
game.init();
if (gameInit) {
gameInit = false;
} else {
hideOffscreenStuff();
}
Frame 9
game.update();
if ((!Key.isDown(32)) && (prevSpace)) {
if (_root.curscreen == "none") {
if ((shiphp.upgrade._currentframe == 1) && (planethp.upgrade._currentframe == 1)) {
togglePause();
} else if (shiphp.upgrade._currentframe != 1) {
game.beginShipScreen(true, true, false);
} else {
game.beginPlanetScreen();
}
}
}
prevSpace = Key.isDown(32);
if (mouseState && (!paused)) {
canshoot = true;
if (shiphp.upgrade._currentframe != 1) {
var x = _root._xmouse;
var y = _root._ymouse;
if ((((x > 15) && (x < 55)) && (y > 305)) && (y < 340)) {
canshoot = false;
}
} else if (planethp.upgrade._currentframe != 1) {
var x = _root._xmouse;
var y = _root._ymouse;
if ((((x > 355) && (x < 405)) && (y > 305)) && (y < 340)) {
canshoot = false;
}
}
if (canshoot) {
game.shootAt(_root._xmouse, _root._ymouse);
}
}
prevMouseState = mouseState;
if (!paused) {
_quality = "low";
var nextlevel = false;
if (gameOverState) {
game.planet.mc.gotoAndPlay("normal");
_root.playMusic("menumusic");
gotoAndPlay (13);
} else {
if ((game.objects.length == 0) && (game.frames > (game.maxspawn * SPAWN_PAUSE))) {
if (levelCompleteMessageDisplayed) {
if (message._currentframe == 1) {
game.levelComplete();
nextlevel = true;
}
} else {
levelCompleteMessageDisplayed = true;
message.gotoAndPlay("complete");
}
}
if (nextlevel) {
_root.playMusic("menumusic");
game.player.mc.removeMovieClip();
cursor.gotoAndPlay("arrow");
switch (level) {
case 2 :
gotoAndPlay (17);
break;
case 3 :
gotoAndPlay (23);
break;
case 4 :
gotoAndPlay (19);
break;
case 5 :
gotoAndPlay (25);
break;
case 6 :
gotoAndPlay (21);
break;
case 7 :
gotoAndPlay (11);
}
} else {
play();
}
}
}
Frame 10
game.update();
gotoAndPlay (9);
Frame 11
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 12
nameinput.onSetFocus = function (oldFocus) {
if (this.text == "Your name here") {
this.text = "";
}
};
updateMouse();
gotoAndPlay (11);
Frame 13
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space2");
play();
Frame 14
nameinput.onSetFocus = function (oldFocus) {
if (this.text == "Your name here") {
this.text = "";
}
};
updateMouse();
gotoAndPlay (13);
Frame 15
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 16
nameinput.onSetFocus = function (oldFocus) {
if (this.text == "Your name here") {
this.text = "";
}
};
updateMouse();
gotoAndPlay (15);
Frame 17
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 18
updateMouse();
gotoAndPlay (17);
Frame 19
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 20
updateMouse();
gotoAndPlay (19);
Frame 21
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 22
updateMouse();
gotoAndPlay (21);
Frame 23
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 24
updateMouse();
gotoAndPlay (23);
Frame 25
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 26
updateMouse();
gotoAndPlay (25);
Symbol 21 MovieClip Frame 1
stop();
Symbol 21 MovieClip Frame 2
stop();
Symbol 43 MovieClip Frame 14
stop();
Symbol 44 MovieClip Frame 1
var score = 50;
stop();
Symbol 44 MovieClip Frame 2
stop();
Symbol 44 MovieClip Frame 3
stop();
Symbol 44 MovieClip Frame 4
_root.playSound("explosion");
play();
Symbol 44 MovieClip Frame 18
stop();
Symbol 52 MovieClip Frame 1
stop();
Symbol 52 MovieClip Frame 2
_root.playSound("hitbullet");
play();
Symbol 52 MovieClip Frame 28
stop();
Symbol 56 MovieClip Frame 1
stop();
Symbol 56 MovieClip Frame 2
_root.playSound("hitplasma");
play();
Symbol 56 MovieClip Frame 28
stop();
Symbol 58 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 2
_root.playSound("hitbullet");
play();
Symbol 58 MovieClip Frame 28
stop();
Symbol 67 MovieClip Frame 1
var score = 100;
stop();
Symbol 67 MovieClip Frame 2
stop();
Symbol 67 MovieClip Frame 3
stop();
Symbol 67 MovieClip Frame 4
_root.playSound("explosion");
play();
Symbol 67 MovieClip Frame 18
gotoAndPlay (34);
Symbol 67 MovieClip Frame 19
_root.playSound("appear");
play();
Symbol 67 MovieClip Frame 33
gotoAndPlay (1);
Symbol 67 MovieClip Frame 34
stop();
Symbol 73 MovieClip Frame 1
var score = 75;
stop();
Symbol 73 MovieClip Frame 2
stop();
Symbol 73 MovieClip Frame 3
stop();
Symbol 73 MovieClip Frame 4
_root.playSound("explosion");
play();
Symbol 73 MovieClip Frame 18
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 2
_root.playSound("hitbullet");
play();
Symbol 75 MovieClip Frame 28
stop();
Symbol 81 MovieClip Frame 1
var score = 125;
stop();
Symbol 81 MovieClip Frame 2
stop();
Symbol 81 MovieClip Frame 3
stop();
Symbol 81 MovieClip Frame 4
_root.playSound("explosion");
play();
Symbol 81 MovieClip Frame 18
stop();
Symbol 87 MovieClip Frame 1
var score = 150;
stop();
Symbol 87 MovieClip Frame 2
stop();
Symbol 87 MovieClip Frame 3
stop();
Symbol 87 MovieClip Frame 4
_root.playSound("explosion");
play();
Symbol 87 MovieClip Frame 17
gotoAndPlay (33);
Symbol 87 MovieClip Frame 18
_root.playSound("appear");
play();
Symbol 87 MovieClip Frame 32
gotoAndPlay (1);
Symbol 87 MovieClip Frame 33
stop();
Symbol 93 MovieClip Frame 1
var score = 175;
stop();
Symbol 93 MovieClip Frame 2
stop();
Symbol 93 MovieClip Frame 3
stop();
Symbol 93 MovieClip Frame 4
_root.playSound("explosion");
play();
Symbol 93 MovieClip Frame 18
stop();
Symbol 96 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 2
stop();
Symbol 165 MovieClip Frame 1
var score = 25;
stop();
Symbol 165 MovieClip Frame 2
_root.playSound("explosionbig");
play();
Symbol 165 MovieClip Frame 16
stop();
Symbol 170 MovieClip Frame 1
var score = 50;
stop();
Symbol 170 MovieClip Frame 2
_root.playSound("explosionbig");
play();
Symbol 170 MovieClip Frame 16
stop();
Symbol 175 MovieClip Frame 1
var score = 210;
stop();
Symbol 175 MovieClip Frame 2
play();
_root.playSound("shotplasma");
Symbol 175 MovieClip Frame 16
stop();
Symbol 245 MovieClip Frame 1
var score = 100;
stop();
Symbol 245 MovieClip Frame 2
play();
_root.playSound("bonus");
Symbol 245 MovieClip Frame 25
stop();
Symbol 255 MovieClip Frame 1
var score = 75;
stop();
Symbol 255 MovieClip Frame 2
play();
_root.playSound("slime");
Symbol 255 MovieClip Frame 16
stop();
Symbol 265 MovieClip Frame 1
var score = 100;
stop();
Symbol 265 MovieClip Frame 2
play();
_root.playSound("ice");
Symbol 265 MovieClip Frame 16
stop();
Symbol 268 MovieClip Frame 1
stop();
Symbol 268 MovieClip Frame 2
_root.playSound("explosionbigshort");
play();
Symbol 268 MovieClip Frame 28
stop();
Symbol 278 MovieClip Frame 1
var reload = 60;
var reloadupgraded = 30;
var respawn = 120;
stop();
Symbol 278 MovieClip Frame 2
stop();
Symbol 278 MovieClip Frame 3
stop();
Symbol 278 MovieClip Frame 4
play();
Symbol 278 MovieClip Frame 63
gotoAndStop (1);
Symbol 278 MovieClip Frame 64
play();
Symbol 278 MovieClip Frame 183
gotoAndStop (1);
Symbol 278 MovieClip Frame 184
play();
Symbol 278 MovieClip Frame 216
gotoAndStop (1);
Symbol 278 MovieClip Frame 217
play();
Symbol 278 MovieClip Frame 306
gotoAndStop (1);
Symbol 278 MovieClip Frame 307
play();
Symbol 278 MovieClip Frame 366
gotoAndStop (1);
Symbol 278 MovieClip Frame 367
stop();
Symbol 289 MovieClip Frame 1
stop();
Symbol 289 MovieClip Frame 2
if (_root.game.weapon.isRocket) {
_root.playSound("shotrocket");
} else {
_root.playSound("shotcannon");
}
play();
Symbol 289 MovieClip Frame 4
gotoAndStop (1);
Symbol 289 MovieClip Frame 5
_root.playSound("hitbullet");
play();
Symbol 289 MovieClip Frame 15
gotoAndStop (1);
Symbol 289 MovieClip Frame 16
_root.playSound("explosion");
play();
Symbol 289 MovieClip Frame 30
stop();
Symbol 289 MovieClip Frame 31
play();
Symbol 289 MovieClip Frame 50
gotoAndStop (1);
Symbol 307 MovieClip Frame 1
stop();
Symbol 307 MovieClip Frame 2
stop();
Symbol 307 MovieClip Frame 3
stop();
Symbol 307 MovieClip Frame 4
stop();
Symbol 311 MovieClip Frame 1
stop();
Symbol 311 MovieClip Frame 2
stop();
Symbol 311 MovieClip Frame 3
stop();
Symbol 314 Button
on (rollOver) {
if (this.enabled) {
_root.cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
}
}
on (rollOut) {
if (this.enabled) {
_root.cursor.gotoAndPlay("arrow");
}
}
on (release) {
if (this.enabled) {
_root.game.endShipScreen(_name);
}
}
Symbol 319 MovieClip Frame 1
this._quality = "high";
stop();
Symbol 319 MovieClip Frame 2
stop();
Symbol 319 MovieClip Frame 3
stop();
Symbol 319 MovieClip Frame 4
stop();
Symbol 320 MovieClip Frame 1
function setWeapon(w) {
this.icon.gotoAndStop(w);
this.text.gotoAndStop(w);
}
function setEnable(e, h) {
this.enabled = e && (!h);
this.hit._visible = e && (!h);
this._alpha = (e ? 100 : 50);
this.base.gotoAndStop((h ? "selected" : "normal"));
}
var enabled = false;
this.hit._visible = false;
this._alpha = 50;
Symbol 322 MovieClip Frame 2
weapon1.setEnable(_root.game.unlockedweapons > 0, _root.curweapon == 1);
weapon2.setEnable(_root.game.unlockedweapons > 1, _root.curweapon == 2);
weapon3.setEnable(_root.game.unlockedweapons > 2, _root.curweapon == 3);
weapon4.setEnable(false, false);
weapon1.setWeapon("cannon");
weapon2.setWeapon("shrapnel");
weapon3.setWeapon("rocket");
weapon4.setWeapon("shock");
stop();
Symbol 323 MovieClip Frame 1
var wasotherupgrade = 1;
stop();
Symbol 323 MovieClip Frame 2
if (_root.planethp.upgrade._currentframe != 1) {
wasotherupgrade = _root.planethp.upgrade._currentframe;
_root.planethp.upgrade.gotoAndPlay("off");
}
_parent.upgrade.gotoAndStop("off");
_root.curscreen = "ship";
play();
Symbol 323 MovieClip Frame 16
stop();
Symbol 323 MovieClip Frame 17
panel.weapon1.hit._visible = false;
panel.weapon2.hit._visible = false;
panel.weapon3.hit._visible = false;
panel.weapon4.hit._visible = false;
play();
Symbol 323 MovieClip Frame 33
_root.cursor.gotoAndPlay("aim");
if (wasotherupgrade != 1) {
_root.planethp.upgrade.gotoAndPlay(wasotherupgrade);
wasotherupgrade = 1;
}
stop();
Symbol 328 Button
on (rollOver) {
_root.noshoot = true;
_root.cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
}
on (rollOut) {
_root.noshoot = false;
_root.cursor.gotoAndPlay("aim");
}
on (release) {
_root.noshoot = false;
if (_root.planethp.upgrade._currentframe != 3) {
if (_root.curscreen == "none") {
_root.game.beginShipScreen(true, true, false);
}
}
}
on (releaseOutside) {
_root.noshoot = false;
_root.cursor.gotoAndPlay("aim");
}
Symbol 331 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 2
stop();
Symbol 331 MovieClip Frame 3
_quality = "high";
stop();
Symbol 353 MovieClip Frame 1
stop();
Symbol 353 MovieClip Frame 2
stop();
Symbol 353 MovieClip Frame 3
stop();
Symbol 353 MovieClip Frame 4
stop();
Symbol 353 MovieClip Frame 5
stop();
Symbol 353 MovieClip Frame 6
stop();
Symbol 353 MovieClip Frame 7
stop();
Symbol 353 MovieClip Frame 8
stop();
Symbol 353 MovieClip Frame 9
stop();
Symbol 353 MovieClip Frame 10
stop();
Symbol 354 Button
on (rollOver) {
if (this.enabled) {
_root.cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
}
}
on (rollOut) {
if (this.enabled) {
_root.cursor.gotoAndPlay("arrow");
}
}
on (release) {
if (this.enabled) {
_root.game.endShipScreen(_root["u" + _name.charAt(7)]);
}
}
Symbol 364 MovieClip Frame 1
this._quality = "high";
stop();
Symbol 364 MovieClip Frame 2
stop();
Symbol 364 MovieClip Frame 3
stop();
Symbol 364 MovieClip Frame 4
stop();
Symbol 364 MovieClip Frame 5
stop();
Symbol 364 MovieClip Frame 6
stop();
Symbol 364 MovieClip Frame 7
stop();
Symbol 364 MovieClip Frame 8
stop();
Symbol 364 MovieClip Frame 9
stop();
Symbol 365 MovieClip Frame 1
function setUpgrade(w) {
this.icon.gotoAndStop(w);
this.text.gotoAndStop(w);
}
function setEnable(e, h) {
this.enabled = e && (!h);
this.hit._visible = e && (!h);
this._alpha = 100;
this._visible = (e ? true : false);
this.base.gotoAndStop((h ? "selected" : "normal"));
}
var enabled = false;
this.hit._visible = false;
this._alpha = 50;
Symbol 367 MovieClip Frame 2
i = 1;
while (i <= 4) {
var u = this["upgrade" + i];
u.setEnable(_root["u" + i] != 0, false);
u.setUpgrade(_root.upgradeNumberToName(_root["u" + i]));
i++;
}
stop();
Symbol 368 MovieClip Frame 1
stop();
Symbol 368 MovieClip Frame 2
_parent.upgrade.gotoAndStop("off");
play();
Symbol 368 MovieClip Frame 16
stop();
Symbol 368 MovieClip Frame 17
panel.weapon1.hit._visible = false;
panel.weapon2.hit._visible = false;
panel.weapon3.hit._visible = false;
panel.weapon4.hit._visible = false;
play();
Symbol 368 MovieClip Frame 33
_root.cursor.gotoAndPlay("aim");
stop();
Symbol 369 MovieClip Frame 1
function showWeaponPanel(w1, w2, w3) {
_root.w1 = w1;
_root.w2 = w2;
_root.w3 = w3;
wpn.gotoAndPlay("in");
if (_root.curweapon) {
upg.gotoAndPlay("in");
}
setUpgrades(4);
}
function hideWeaponPanel(wsel) {
wpn.gotoAndPlay("out");
if ((upg._currentframe != upg._totalframes) && (upg._currentframe != 1)) {
upg.gotoAndPlay("out");
}
}
function setUpgrades(num) {
numinstalled = 0;
for (i in _root.game.upgrades) {
if (_root.game.upgrades[i]) {
numinstalled++;
}
}
num = 9 - numinstalled;
if (num > 4) {
num = 4;
}
i = 1;
while (i <= 4) {
_root["u" + i] = 0;
i++;
}
var used = new Array();
i = 1;
while (i <= num) {
var u;
do {
u = random(9) + 1;
} while (_root.game.upgrades[u] || (used[u]));
_root["u" + i] = u;
used[u] = true;
i++;
}
}
play();
Symbol 369 MovieClip Frame 2
stop();
Symbol 369 MovieClip Frame 3
stop();
Symbol 390 MovieClip Frame 1
stop();
Symbol 390 MovieClip Frame 2
stop();
Symbol 390 MovieClip Frame 3
stop();
Symbol 390 MovieClip Frame 4
stop();
Symbol 390 MovieClip Frame 5
stop();
Symbol 390 MovieClip Frame 6
stop();
Symbol 390 MovieClip Frame 7
stop();
Symbol 390 MovieClip Frame 8
stop();
Symbol 390 MovieClip Frame 9
stop();
Symbol 391 Button
on (rollOver) {
if (this.enabled) {
_root.cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
_root.planetsrc.planet[_root.buildingNumberToName(_root["b" + _name.charAt(7)])].gotoAndPlay("on");
}
}
on (rollOut) {
if (this.enabled) {
_root.cursor.gotoAndPlay("arrow");
_root.planetsrc.planet[_root.buildingNumberToName(_root["b" + _name.charAt(7)])].gotoAndPlay("off");
}
}
on (release) {
if (this.enabled) {
_root.game.endPlanetScreen(_root["b" + _name.charAt(7)]);
}
}
Symbol 401 MovieClip Frame 1
this._quality = "high";
stop();
Symbol 401 MovieClip Frame 2
stop();
Symbol 401 MovieClip Frame 3
stop();
Symbol 401 MovieClip Frame 4
stop();
Symbol 401 MovieClip Frame 5
stop();
Symbol 401 MovieClip Frame 6
stop();
Symbol 401 MovieClip Frame 7
stop();
Symbol 401 MovieClip Frame 8
stop();
Symbol 401 MovieClip Frame 9
stop();
Symbol 402 MovieClip Frame 1
function setUpgrade(w) {
this.icon.gotoAndStop(w);
this.text.gotoAndStop(w);
}
function setEnable(e, h) {
this.enabled = e && (!h);
this.hit._visible = e && (!h);
this._alpha = 100;
this._visible = (e ? true : false);
this.base.gotoAndStop((h ? "selected" : "normal"));
}
var enabled = false;
this.hit._visible = false;
this._alpha = 50;
Symbol 404 MovieClip Frame 2
i = 1;
while (i <= 4) {
var u = this["upgrade" + i];
u.setEnable(_root["b" + i] != 0, false);
u.setUpgrade(_root.buildingNumberToName(_root["b" + i]));
i++;
}
stop();
Symbol 405 MovieClip Frame 1
var wasotherupgrade = 1;
stop();
Symbol 405 MovieClip Frame 2
if (_root.shiphp.upgrade._currentframe != 1) {
wasotherupgrade = _root.shiphp.upgrade._currentframe;
_root.shiphp.upgrade.gotoAndPlay("off");
}
_root.curscreen = "planet";
_parent.upgrade.gotoAndStop("off");
play();
Symbol 405 MovieClip Frame 16
stop();
Symbol 405 MovieClip Frame 17
panel.upgrade1.hit._visible = false;
panel.upgrade2.hit._visible = false;
panel.upgrade3.hit._visible = false;
panel.upgrade4.hit._visible = false;
play();
Symbol 405 MovieClip Frame 33
_root.cursor.gotoAndPlay("aim");
if (wasotherupgrade != 1) {
_root.shiphp.upgrade.gotoAndPlay(wasotherupgrade);
wasotherupgrade = 1;
}
stop();
Symbol 408 MovieClip Frame 1
function setUpgrade(w) {
this.icon.gotoAndStop(w);
}
function setEnable(e) {
this.enabled = e;
this._visible = e;
}
var enabled = false;
Symbol 412 MovieClip Frame 1
function pickItems() {
var num = 0;
i = 1;
while (i <= 6) {
this["upgrade" + i].setEnable(false);
i++;
}
for (i in _root.game.buildings) {
if (_root.game.buildings[i]) {
num++;
if (num > 6) {
break;
}
var u = this["upgrade" + num];
u.setUpgrade(_root.buildingNumberToName(i));
u.setEnable(true);
}
}
none._visible = !upgrade1._visible;
}
Symbol 412 MovieClip Frame 2
pickItems();
stop();
Symbol 413 MovieClip Frame 1
var wasotherupgrade = 1;
stop();
Symbol 413 MovieClip Frame 2
if (_root.shiphp.upgrade._currentframe != 1) {
wasotherupgrade = _root.shiphp.upgrade._currentframe;
_root.shiphp.upgrade.gotoAndPlay("off");
}
_root.curscreen = "planet";
_parent.upgrade.gotoAndStop("off");
play();
Symbol 413 MovieClip Frame 16
stop();
Symbol 413 MovieClip Frame 17
panel.upgrade1.hit._visible = false;
panel.upgrade2.hit._visible = false;
panel.upgrade3.hit._visible = false;
panel.upgrade4.hit._visible = false;
play();
Symbol 413 MovieClip Frame 33
_root.curscreen = "none";
_root.cursor.gotoAndPlay("aim");
if (wasotherupgrade != 1) {
_root.shiphp.upgrade.gotoAndPlay(wasotherupgrade);
wasotherupgrade = 1;
}
stop();
Symbol 416 Button
on (rollOver) {
_root.noshoot = true;
_root.cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
}
on (rollOut) {
_root.noshoot = false;
_root.cursor.gotoAndPlay("aim");
}
on (release) {
_root.noshoot = false;
if (_root.shiphp.upgrade._currentframe != 3) {
if (_root.curscreen == "none") {
_root.game.beginPlanetScreen();
}
}
}
on (releaseOutside) {
_root.noshoot = false;
_root.cursor.gotoAndPlay("aim");
}
Symbol 419 MovieClip Frame 1
stop();
Symbol 419 MovieClip Frame 2
stop();
Symbol 419 MovieClip Frame 3
_quality = "high";
stop();
Symbol 420 MovieClip Frame 1
function showPanel() {
preparePanel();
upg.gotoAndPlay("in");
ins.gotoAndPlay("in");
}
function hidePanel(wsel) {
wpn.gotoAndPlay("out");
ins.gotoAndPlay("out");
if ((upg._currentframe != upg._totalframes) && (upg._currentframe != 1)) {
upg.gotoAndPlay("out");
}
}
function preparePanel() {
var bld = new Array();
i = 1;
while (i <= 9) {
if (bld[i] == undefined) {
bld[i] = _root.game.buildings[i];
}
if ((!bld[i]) || (bld[i] == undefined)) {
switch (i) {
case 1 :
bld[2] = true;
break;
case 3 :
bld[4] = true;
bld[5] = true;
break;
case 4 :
bld[5] = true;
break;
case 6 :
bld[7] = true;
}
}
i++;
}
numinstalled = 0;
for (i in bld) {
if (bld[i]) {
numinstalled++;
}
}
num = 9 - numinstalled;
if (num > 4) {
num = 4;
}
i = 1;
while (i <= 4) {
_root["b" + i] = 0;
i++;
}
var used = new Array();
i = 1;
while (i <= num) {
var b;
do {
b = random(9) + 1;
} while (bld[b] || (used[b]));
_root["b" + i] = b;
used[b] = true;
i++;
}
}
play();
Symbol 420 MovieClip Frame 2
stop();
Symbol 420 MovieClip Frame 3
stop();
Symbol 439 MovieClip Frame 1
stop();
Symbol 439 MovieClip Frame 3
play();
Symbol 439 MovieClip Frame 4
stop();
Symbol 439 MovieClip Frame 5
play();
Symbol 439 MovieClip Frame 6
stop();
Symbol 439 MovieClip Frame 7
play();
Symbol 439 MovieClip Frame 8
stop();
Symbol 439 MovieClip Frame 9
play();
Symbol 439 MovieClip Frame 10
stop();
Symbol 439 MovieClip Frame 11
play();
Symbol 439 MovieClip Frame 12
stop();
Symbol 439 MovieClip Frame 13
play();
Symbol 439 MovieClip Frame 14
stop();
Symbol 439 MovieClip Frame 15
play();
Symbol 439 MovieClip Frame 16
stop();
Symbol 439 MovieClip Frame 17
play();
Symbol 439 MovieClip Frame 18
stop();
Symbol 439 MovieClip Frame 19
play();
Symbol 439 MovieClip Frame 20
stop();
Symbol 439 MovieClip Frame 21
play();
Symbol 439 MovieClip Frame 22
stop();
Symbol 439 MovieClip Frame 23
play();
Symbol 439 MovieClip Frame 24
stop();
Symbol 439 MovieClip Frame 25
play();
Symbol 439 MovieClip Frame 26
stop();
Symbol 439 MovieClip Frame 27
play();
Symbol 439 MovieClip Frame 28
stop();
Symbol 439 MovieClip Frame 29
play();
Symbol 439 MovieClip Frame 30
stop();
Symbol 439 MovieClip Frame 31
play();
Symbol 439 MovieClip Frame 32
stop();
Symbol 439 MovieClip Frame 33
play();
Symbol 439 MovieClip Frame 34
stop();
Symbol 439 MovieClip Frame 35
play();
Symbol 439 MovieClip Frame 38
stop();
Symbol 439 MovieClip Frame 39
play();
Symbol 439 MovieClip Frame 42
stop();
Symbol 442 MovieClip Frame 1
stop();
Symbol 442 MovieClip Frame 2
stop();
Symbol 445 Button
on (rollOver) {
button2.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("mouseclick");
getURL (_root.downloadURL, "_blank");
}
Symbol 449 MovieClip Frame 1
stop();
Symbol 449 MovieClip Frame 2
play();
Symbol 450 Button
on (rollOver) {
button.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("mouseclick");
_root.gotoAndPlay("play");
}
Symbol 452 MovieClip Frame 1
stop();
Symbol 452 MovieClip Frame 2
play();
Symbol 462 MovieClip Frame 1
stop();
Symbol 462 MovieClip Frame 2
play();
Symbol 463 Button
on (rollOver) {
cursor.gotoAndPlay("hand");
greatgames.gotoAndPlay("zoom");
_root.playSound("mouseover");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
getURL (_root.moreGamesURL, "_blank");
}
Symbol 466 MovieClip Frame 1
stop();
Symbol 466 MovieClip Frame 2
stop();
Symbol 469 MovieClip Frame 1
stop();
Symbol 469 MovieClip Frame 2
stop();
Symbol 470 Button
on (rollOver) {
cursor.gotoAndPlay("hand");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
if ((_root.musicEnabled = !_root.musicEnabled)) {
playMusic("menumusic");
signmusic.gotoAndPlay("on");
} else {
stopAllSounds();
signmusic.gotoAndPlay("off");
}
}
Symbol 471 Button
on (rollOver) {
cursor.gotoAndPlay("hand");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
if ((_root.soundEnabled = !_root.soundEnabled)) {
signsound.gotoAndPlay("on");
} else {
signsound.gotoAndPlay("off");
}
}
Symbol 476 MovieClip Frame 1
stop();
Symbol 476 MovieClip Frame 2
stop();
Symbol 479 MovieClip Frame 1
stop();
Symbol 479 MovieClip Frame 2
stop();
Symbol 482 MovieClip Frame 1
stop();
Symbol 482 MovieClip Frame 2
stop();
Symbol 485 MovieClip Frame 1
stop();
Symbol 485 MovieClip Frame 2
stop();
Symbol 488 MovieClip Frame 1
stop();
Symbol 488 MovieClip Frame 2
stop();
Symbol 491 MovieClip Frame 1
stop();
Symbol 491 MovieClip Frame 2
stop();
Symbol 494 MovieClip Frame 1
stop();
Symbol 494 MovieClip Frame 2
stop();
Symbol 497 MovieClip Frame 1
stop();
Symbol 497 MovieClip Frame 2
stop();
Symbol 500 MovieClip Frame 1
stop();
Symbol 500 MovieClip Frame 2
stop();
Symbol 502 MovieClip Frame 1
planet.airport.gotoAndPlay("off");
planet.starport.gotoAndPlay("off");
planet.support1.gotoAndPlay("off");
planet.support2.gotoAndPlay("off");
planet.support3.gotoAndPlay("off");
planet.powerplant.gotoAndPlay("off");
planet.mine.gotoAndPlay("off");
planet.ship.gotoAndPlay("off");
planet.squadron.gotoAndPlay("off");
Symbol 502 MovieClip Frame 71
stop();
Symbol 503 MovieClip Frame 1
planet.airport.gotoAndPlay("off");
planet.starport.gotoAndPlay("off");
planet.support1.gotoAndPlay("off");
planet.support2.gotoAndPlay("off");
planet.support3.gotoAndPlay("off");
planet.powerplant.gotoAndPlay("off");
planet.mine.gotoAndPlay("off");
planet.ship.gotoAndPlay("off");
planet.squadron.gotoAndPlay("off");
stop();
Symbol 503 MovieClip Frame 2
play();
Symbol 503 MovieClip Frame 5
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 10
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 14
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 18
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 20
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 24
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 28
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 30
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 34
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 39
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 42
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 47
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 50
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 54
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 58
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 62
_root.sound.gotoAndPlay("explosion");
Symbol 503 MovieClip Frame 66
_root.sound.gotoAndPlay("explosionbig");
Symbol 503 MovieClip Frame 95
stop();
Symbol 511 MovieClip Frame 1
stop();
Symbol 511 MovieClip Frame 2
play();
Symbol 511 MovieClip Frame 80
gotoAndStop (1);
Symbol 511 MovieClip Frame 81
play();
Symbol 511 MovieClip Frame 161
gotoAndStop (1);
Symbol 511 MovieClip Frame 162
play();
Symbol 511 MovieClip Frame 311
gotoAndStop (1);
Symbol 511 MovieClip Frame 312
play();
Symbol 511 MovieClip Frame 370
gotoAndStop (1);
Symbol 511 MovieClip Frame 371
play();
Symbol 511 MovieClip Frame 429
gotoAndStop (1);
Symbol 529 Button
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
}
on (release) {
var strOut = ((_root.playername + "|") + _root.score);
var strOut2 = _root.EncrpytString(strOut);
getURL ((_root.HiScoreSaveURL + "?") + strOut2, "_blank");
}
Symbol 531 Button
on (rollOver) {
buttongetfull.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("mouseclick");
getURL (_root.orderURL, "_blank");
}
Symbol 533 MovieClip Frame 1
stop();
Symbol 533 MovieClip Frame 2
play();
Symbol 534 Button
on (rollOver) {
buttonstartover.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("mouseclick");
level = 1;
difficulty++;
_root.gotoAndPlay("level");
}
Symbol 536 MovieClip Frame 1
stop();
Symbol 536 MovieClip Frame 2
play();
Symbol 542 Button
on (rollOver) {
button2.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("mouseclick");
getURL (downloadURL, "_blank");
}
Symbol 544 Button
on (rollOver) {
buttonagain.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("mouseclick");
score = 0;
difficulty = 0;
_root.gotoAndPlay("level");
}
Symbol 545 MovieClip Frame 1
stop();
Symbol 545 MovieClip Frame 2
play();
Symbol 547 Button
on (rollOver) {
buttoncontinue.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("mouseover");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("mouseclick");
_root.gotoAndPlay("level");
}
Symbol 549 MovieClip Frame 1
stop();
Symbol 549 MovieClip Frame 2
play();
Symbol 555 MovieClip Frame 1
stop();
Symbol 558 MovieClip Frame 1
stop();
Symbol 561 MovieClip Frame 1
stop();
Symbol 564 MovieClip Frame 1
stop();
Symbol 567 MovieClip Frame 1
stop();
Symbol 570 MovieClip Frame 1
stop();