Frame 2
var tGame = new Game(this.stage_mc);
Frame 40
stop();
Frame 54
this.gotoAndPlay("choose");
Frame 71
stop();
Frame 87
stop();
Frame 98
var fakeVar = new Date().getTime();
loadMovieNum ("tracker.swf?" + fakeVar, 10000);
Frame 100
tGame.startGame();
this.onEnterFrame = function () {
tGame.update();
};
stop();
Frame 104
stop();
Symbol 92 MovieClip [mc.ship] Frame 1
stop();
Symbol 92 MovieClip [mc.ship] Frame 40
this.gotoAndStop("tMid");
this.flame_mc._visible = false;
Symbol 92 MovieClip [mc.ship] Frame 50
this.gotoAndStop("aMid");
this.flame_mc._visible = false;
Symbol 92 MovieClip [mc.ship] Frame 66
this.gotoAndStop("twinMid");
this.flame_mc._visible = false;
Symbol 92 MovieClip [mc.ship] Frame 82
this.gotoAndStop("twinMid");
this.flame_mc._visible = false;
Symbol 92 MovieClip [mc.ship] Frame 98
this.gotoAndStop("aMid");
this.flame_mc._visible = false;
Symbol 107 MovieClip [mc.explosion] Frame 1
this._rotation = Math.ceil(Math.random() * 4) * 90;
Symbol 107 MovieClip [mc.explosion] Frame 8
this.removeMovieClip();
Symbol 224 MovieClip [mc.explosionF] Frame 9
this.removeMovieClip();
Symbol 246 MovieClip [mc.impact] Frame 1
this._rotation = Math.ceil(Math.random() * 4) * 90;
Symbol 246 MovieClip [mc.impact] Frame 7
this.removeMovieClip();
Symbol 260 MovieClip [mc.rocket] Frame 1
stop();
Symbol 265 MovieClip [mc.building] Frame 1
this.gotoAndStop(Math.ceil(Math.random() * 2));
stop();
Symbol 282 MovieClip [mc.explode] Frame 38
this.removeMovieClip();
Symbol 304 MovieClip Frame 1
stop();
Symbol 309 MovieClip Frame 39
stop();
Symbol 310 MovieClip Frame 1
stop();
Symbol 310 MovieClip Frame 121
stop();
Symbol 310 MovieClip Frame 135
stop();
Symbol 312 MovieClip [mc.fade] Frame 20
stop();
Symbol 312 MovieClip [mc.fade] Frame 41
stop();
Symbol 314 MovieClip Frame 1
Symbol 446 MovieClip [__Packages.Game] Frame 0
class Game
{
var pStage, pHiScore, pShip, pWeapons, pMotherShip, pGroundUnit, pSoundObj, pScore, pLives, pLevel, pCount, pPaused, pState;
function Game (mc) {
pStage = mc;
pHiScore = 0;
pShip = new Ship(-100, 100, mc, this);
pWeapons = new Weapons(mc, this);
pMotherShip = new Mothership(mc, this);
pGroundUnit = new Ground(mc, this);
pSoundObj = new SoundObj(mc);
}
function startGame() {
RandomFib.setSeed(23, 45);
pScore = 0;
pLives = 3;
pLevel = 0;
pCount = 0;
pPaused = false;
pState = 0;
pStage._parent.titleBar_mc.lives_mc.showNum(pLives);
pStage.fade_mc.swapDepths(999999);
pStage.messages_mc.swapDepths(1000000);
pStage.fade_mc.gotoAndPlay("fadeout");
pShip.startGame();
pWeapons.startGame();
pGroundUnit.startGame();
pMotherShip.startGame();
}
function update() {
if (Key.isDown(16)) {
}
switch (pState) {
case 0 :
if ((++pCount) >= 20) {
pState = 1;
pCount = 0;
pMotherShip.unpauseWaves();
pShip.reset();
}
break;
case 1 :
if (!pPaused) {
pLevel++;
}
break;
case 2 :
if ((++pCount) >= 50) {
pState = 3;
pCount = 0;
pStage.fade_mc.gotoAndPlay("fadeIn");
pStage.messages_mc.gotoAndPlay("stage");
pSoundObj.startGame();
}
break;
case 3 :
if ((++pCount) >= 120) {
pState = 0;
pCount = 0;
pShip.hideShip();
pStage._parent.bg_mc.nextBG();
pStage.fade_mc.gotoAndPlay("fadeOut");
}
break;
case 4 :
if ((++pCount) >= 200) {
pStage.fade_mc.gotoAndPlay("fadeIn");
pState = 5;
pCount = 0;
}
break;
case 5 :
if ((++pCount) < 20) {
break;
}
pWeapons.endGame();
pSoundObj.endGame();
pMotherShip.endGame();
delete pStage._parent.onEnterFrame;
pStage._parent.gotoAndPlay("load");
pStage.messages_mc.gotoAndStop(1);
}
if (!Key.isDown(17)) {
pShip.move();
pWeapons.update();
pMotherShip.update();
pGroundUnit.update();
}
}
function levelComplete() {
pState = 2;
}
function gameOver() {
if (pState == 1) {
pLives--;
pStage._parent.titleBar_mc.lives_mc.showNum(pLives);
if (pLives < 0) {
pSoundObj.playSound("gameover");
pStage.messages_mc.gotoAndPlay("gameover");
pState = 4;
pCount = 0;
} else {
pMotherShip.stepBack();
pShip.reset();
}
}
}
function addScore(num) {
pScore = pScore + num;
pStage._parent.titleBar_mc.score_mc.showNum(pScore);
if (pScore > pHiScore) {
pHiScore = pScore;
pStage._parent.titleBar_mc.hiscore_mc.showNum(pHiScore);
}
}
function getLevel() {
var _local2 = pLevel / 30;
return(_local2);
}
}
Symbol 447 MovieClip [__Packages.Mobile] Frame 0
class Mobile
{
var pX, pY;
function Mobile () {
}
function setPos(x, y) {
pX = x;
pY = y;
}
function setSpeed(xs, ys) {
pSpeedX = xs;
pSpeedY = ys;
}
function update() {
pX = pX + pSpeedX;
pY = pY + pSpeedY;
}
var pSpeedX = 0;
var pSpeedY = 0;
}
Symbol 448 MovieClip [__Packages.Craft] Frame 0
class Craft extends Mobile
{
var p_mc, pX, pY, update;
function Craft () {
super();
}
function createMc(mcParent, type) {
switch (type) {
case 0 :
p_mc = mcParent.attachMovie("mc.ship", "ship", 100000, {_x:-100, _y:-100});
p_mc.cacheAsBitmap = true;
break;
default :
var _local2 = Depth.getNewDepth(1);
p_mc = mcParent.attachMovie("mc.enemy", "enemy" + _local2, _local2, {_x:-100, _y:-100});
p_mc.cacheAsBitmap = true;
p_mc.gotoAndStop(type);
}
p_mc.cacheAsBitmap = true;
}
function getPos() {
var _local2 = new flash.geom.Point(pX, pY);
return(_local2);
}
function die() {
p_mc.removeMovieClip();
}
function move() {
update();
}
function draw() {
p_mc._x = pX;
p_mc._y = pY;
}
}
Symbol 449 MovieClip [__Packages.Depth] Frame 0
class Depth
{
function Depth () {
}
static function getNewDepth(block) {
var _local1 = pStacks[block];
_local1++;
if (_local1 >= pMax) {
_local1 = pMin;
}
pStacks[block] = _local1;
return(_local1 + ((block + 1) * pMax));
}
static var pMin = 10;
static var pMax = 50000;
static var pStacks = new Array(9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
}
Symbol 450 MovieClip [__Packages.Ship] Frame 0
class Ship extends Craft
{
var pGame, pMcParent, createMc, setPos, pState, pMode, pTwinCount, pSafeCount, pShield, pDieCount, p_mc, pSpeedX, pSpeedY, pX, pY, pFire_mc;
function Ship (x, y, mcParent, gameHost) {
super();
pGame = gameHost;
pMcParent = mcParent;
createMc(mcParent, 0);
setPos(x, y);
var _local3 = new Object();
_local3.pObj = this;
_local3.onKeyDown = function () {
this.pObj.changeMode();
};
Key.addListener(_local3);
}
function startGame() {
switch (_global.pSpeed) {
case 1 :
pAcc = 0.5;
break;
case 2 :
pAcc = 2;
break;
case 3 :
pAcc = 5;
}
pState = 1;
pMode = 1;
pTwinCount = 0;
pSafeCount = 0;
pShield = false;
pDieCount = 0;
p_mc._visible = false;
}
function reset() {
p_mc._visible = true;
p_mc.gotoAndStop("aMid");
setPos(-10, 175);
pSpeedX = 18;
pSpeedY = 0;
pState = 10;
pMode = 0;
pTwinCount = 0;
pSafeCount = 99;
pShield = true;
pDieCount = 0;
pMcParent._parent.titleBar_mc.attack_mc.gotoAndPlay(2);
pMcParent._parent.titleBar_mc.target_mc.gotoAndStop(1);
pMcParent._parent.titleBar_mc.twinAni_mc.gotoAndStop(1);
}
function hideShip() {
pState = 11;
p_mc._visible = false;
}
function move() {
switch (pState) {
case 11 :
break;
case 10 :
pSpeedX = pSpeedX * 0.9;
super.move();
break;
case 9 :
pSpeedX = pSpeedX - 0.2;
pSpeedY = pSpeedY + 0.3;
super.move();
break;
default :
var _local3 = (Key.isDown(40) - Key.isDown(38)) * pAcc;
if (_local3 != 0) {
pSpeedY = pSpeedY + _local3;
pSpeedY = Math.max(-pMaxSpeed, Math.min(pMaxSpeed, pSpeedY));
} else {
pSpeedY = pSpeedY * pDec;
}
var _local4 = (Key.isDown(39) - Key.isDown(37)) * pAcc;
if (_local4 != 0) {
pSpeedX = pSpeedX + _local4;
pSpeedX = Math.max(-pMaxSpeed, Math.min(pMaxSpeed, pSpeedX));
} else {
pSpeedX = pSpeedX * pDec;
}
super.move();
if (pX > 580) {
pX = 580;
} else if (pX < 20) {
pX = 20;
}
if (pY > 330) {
pY = 330;
} else if (pY < 80) {
pY = 80;
}
pFireCount--;
if (Key.isDown(32)) {
if (pFireCount <= 0) {
pGame.pWeapons.launchWeapon(pX, pY, true, pMode);
pFireCount = pFireRate;
}
} else {
pFireCount = 0;
}
if (pMode != 3) {
break;
}
pTwinCount--;
if (pTwinCount <= 0) {
pState = 8;
pMode = 0;
p_mc.gotoAndPlay("twin_a");
pGame.pSoundObj.playSound("change");
pMcParent._parent.titleBar_mc.twinAni_mc.gotoAndStop(1);
pMcParent._parent.titleBar_mc.attack_mc.gotoAndPlay(2);
pMcParent._parent.titleBar_mc.target_mc.gotoAndStop(1);
} else {
pMcParent._parent.titleBar_mc.twinAni_mc.gotoAndStop((29 - Math.ceil(pTwinCount / 8)) + 2);
}
}
draw();
}
function changeMode() {
if (pMode != 3) {
switch (Key.getCode()) {
case 0 :
case 77 :
case 78 :
case 66 :
case 86 :
case 67 :
case 88 :
case 90 :
case 191 :
if (pState == 1) {
pState = 3;
pMode = 0;
p_mc.gotoAndPlay("a_t");
pMcParent._parent.titleBar_mc.attack_mc.gotoAndStop(1);
pMcParent._parent.titleBar_mc.target_mc.gotoAndPlay(2);
pGame.pSoundObj.playSound("change");
} else {
if (pState != 2) {
break;
}
pState = 4;
pMode = 0;
p_mc.gotoAndPlay("t_a");
pMcParent._parent.titleBar_mc.attack_mc.gotoAndPlay(2);
pMcParent._parent.titleBar_mc.target_mc.gotoAndStop(1);
pGame.pSoundObj.playSound("change");
}
}
}
}
function hit(strength) {
if ((pState != 9) && (pState != 10)) {
if (!pShield) {
pState = 9;
pMode = 0;
pDieCount = 0;
pSpeedX = 0;
pSpeedY = -3;
var _local2 = Depth.getNewDepth(8);
pFire_mc = pMcParent.attachMovie("mc.explode", "explode_mc", _local2, {_x:50, _y:50});
pGame.pWeapons.dropPowerUps(pX, pY);
pGame.pSoundObj.playSound("explosion");
}
}
}
function getPos() {
if (pState == 9) {
var _local3 = flash.geom.Point.polar(400, Math.random() * 6.283);
_local3.offset(300, 200);
return(_local3);
}
return(super.getPos());
}
function usePower(type) {
pTwinCount = 232;
if (pState == 1) {
pState = 5;
pMode = 0;
p_mc.gotoAndPlay("a_twin");
pGame.pSoundObj.playSound("change");
} else if (pState == 2) {
pState = 6;
pMode = 0;
p_mc.gotoAndPlay("t_twin");
pGame.pSoundObj.playSound("change");
}
}
function checkHit(point, size, type) {
if (pState == 9) {
return(false);
}
var _local2 = new flash.geom.Point(pX, pY);
if (flash.geom.Point.distance(_local2, point) < ((25 + size) / 2)) {
return(true);
}
return(false);
}
function draw() {
if (pShield) {
pSafeCount--;
if (pSafeCount <= 0) {
pShield = false;
p_mc._visible = true;
} else if (pState != 11) {
if ((pSafeCount % 3) == 0) {
p_mc._visible = !p_mc._visible;
}
}
}
switch (pState) {
case 1 :
var _local3 = Math.max(1, Math.min(5, 3 + Math.round(pSpeedY / 2)));
p_mc.gotoAndStop(_local3);
p_mc.flame_mc._visible = pSpeedX > 3;
break;
case 2 :
_local3 = 10 + Math.max(1, Math.min(5, 3 + Math.round(pSpeedY / 2)));
p_mc.gotoAndStop(_local3);
p_mc.flame_mc._visible = pSpeedX > 3;
break;
case 7 :
_local3 = 20 + Math.max(1, Math.min(5, 3 + Math.round(pSpeedY / 2)));
p_mc.gotoAndStop(_local3);
break;
case 3 :
if (p_mc._currentframe < 30) {
pState = 2;
pMode = 2;
}
break;
case 4 :
case 8 :
if (p_mc._currentframe < 30) {
pState = 1;
pMode = 1;
}
break;
case 5 :
p_mc.play();
case 6 :
if (p_mc._currentframe < 30) {
pState = 7;
pMode = 3;
}
break;
case 9 :
pDieCount++;
switch (pDieCount) {
case 24 :
p_mc._visible = false;
break;
case 50 :
pGame.gameOver();
}
pFire_mc._x = pX;
pFire_mc._y = pY;
break;
case 10 :
if (pSpeedX > 1) {
break;
}
pState = 1;
pMode = 1;
pSafeCount = 45;
p_mc._visible = true;
}
super.draw();
}
var pAcc = 2;
var pDec = 0.6;
var pMaxSpeed = 10;
var pFireRate = 10;
var pFireCount = 0;
}
Symbol 451 MovieClip [__Packages.Weapons] Frame 0
class Weapons
{
var pMcParent, pGame, pFriends, pFoes, pPowers, pFireRate, pPLevels;
function Weapons (mcParent, gameHost) {
pMcParent = mcParent;
pGame = gameHost;
pFriends = new Array();
pFoes = new Array();
pPowers = new Array();
pFireRate = 0;
pPLevels = new Array(2);
pPLevels[0] = 2;
pPLevels[1] = 2;
pMcParent._parent.titleBar_mc.attackM_mc.setLevel(2);
pMcParent._parent.titleBar_mc.targetM_mc.setLevel(2);
}
function endGame() {
if (pFriends.length > 0) {
for (var _local2 in pFriends) {
pFriends[_local2].die();
delete pFriends[_local2];
pFriends.splice(Number(_local2), 1);
}
}
if (pFoes.length > 0) {
for (var _local2 in pFoes) {
pFoes[_local2].die();
delete pFoes[_local2];
pFoes.splice(Number(_local2), 1);
}
}
if (pPowers.length > 0) {
for (var _local2 in pPowers) {
pPowers[_local2].die();
delete pPowers[_local2];
pPowers.splice(Number(_local2), 1);
}
}
}
function startGame() {
pFriends.splice(0);
pFoes.splice(0);
pPowers.splice(0);
pFireRate = 0;
pPLevels[0] = 2;
pPLevels[1] = 2;
pMcParent._parent.titleBar_mc.attackM_mc.setLevel(2);
pMcParent._parent.titleBar_mc.targetM_mc.setLevel(2);
}
function dropPowerUps(x, y) {
var _local3 = 0;
while (_local3 < (pPLevels[0] - 1)) {
var _local2 = flash.geom.Point.polar((Math.random() * 4) + 6, (Math.random() * Math.PI) * 2);
pPowers.push(new PowerUp(x, y, _local2.x, _local2.y, pMcParent, 1));
_local3++;
}
_local3 = 0;
while (_local3 < (pPLevels[1] - 1)) {
var _local2 = flash.geom.Point.polar(7, (Math.random() * Math.PI) * 2);
pPowers.push(new PowerUp(x, y, _local2.x, _local2.y, pMcParent, 2));
_local3++;
}
pPLevels[0] = 1;
pPLevels[1] = 1;
pMcParent._parent.titleBar_mc.attackM_mc.setLevel(pPLevels[0]);
pMcParent._parent.titleBar_mc.targetM_mc.setLevel(pPLevels[1]);
}
function launchWeapon(x, y, friend, mode) {
if (friend) {
if (mode == 1) {
fireAttack(x, y);
} else if (mode == 2) {
fireTarget(x, y);
} else if (mode == 3) {
fireAttack(x, y);
fireTarget(x, y);
}
} else {
switch (mode) {
case 1 :
var _local5 = (new flash.geom.Point(x, y)).subtract(pGame.pShip.getPos());
var _local7 = Math.atan2(_local5.y, _local5.x);
var _local6 = Math.min(9, 2 + (pGame.getLevel() / 40));
var _local2 = -2;
while (_local2 < 2) {
var _local8 = flash.geom.Point.polar(_local6, _local7 + (_local2 * 0.2));
pFoes.push(new Bullet(x, y, -_local8.x, -_local8.y, pMcParent, 8));
_local2++;
}
break;
default :
var _local5 = (new flash.geom.Point(x, y)).subtract(pGame.pShip.getPos());
var _local8 = new flash.geom.Point(_local5.y, _local5.x * -1);
_local8.normalize(_local5.length / 6);
var _local9 = (Math.random() * 2) - 1;
_local5.offset(_local8.x * _local9, _local8.y * _local9);
_local5.normalize(3);
pFoes.push(new Bullet(x, y, -_local5.x, -_local5.y, pMcParent, 8));
}
}
}
function fireAttack(x, y) {
switch (pPLevels[0]) {
case 6 :
pFriends.push(new Bullet(x + 35, y, 35, 0, pMcParent, 5));
pFriends.push(new Bullet(x - 15, y, -12, 0, pMcParent, 6));
pFriends.push(new Bullet(x - 5, y - 5, -9, -7, pMcParent, 6));
pFriends.push(new Bullet(x - 5, y + 5, -9, 7, pMcParent, 6));
pGame.pSoundObj.playSound("laser5");
break;
case 5 :
pFriends.push(new Bullet(x + 35, y, 35, 0, pMcParent, 4));
pFriends.push(new Bullet(x - 5, y - 5, -9, -7, pMcParent, 6));
pFriends.push(new Bullet(x - 5, y + 5, -9, 7, pMcParent, 6));
pGame.pSoundObj.playSound("laser4");
break;
case 4 :
pFriends.push(new Bullet(x - 5, y - 5, -9, -7, pMcParent, 6));
pFriends.push(new Bullet(x - 5, y + 5, -9, 7, pMcParent, 6));
case 3 :
pFriends.push(new Bullet(x + 25, y, 20, 0, pMcParent, 3));
pGame.pSoundObj.playSound("laser3");
break;
case 2 :
pFriends.push(new Bullet(x + 25, y, 20, 0, pMcParent, 2));
pGame.pSoundObj.playSound("laser2");
break;
case 1 :
pFriends.push(new Bullet(x + 25, y, 20, 0, pMcParent, 1));
pGame.pSoundObj.playSound("laser1");
}
}
function fireTarget(x, y) {
if (pFireRate >= 10) {
pFireRate = 0;
switch (pPLevels[1]) {
case 6 :
case 5 :
pFriends.push(new Seeker(x + 25, y, -1, pMcParent));
case 4 :
pFriends.push(new Missile(x + 25, y, -1, pMcParent));
case 3 :
pFriends.push(new Seeker(x + 25, y, 1, pMcParent));
case 2 :
pFriends.push(new Missile(x + 25, y, 1, pMcParent));
pGame.pSoundObj.playSound("missile");
case 1 :
pFriends.push(new Bomb(x + 25, y, pMcParent));
pGame.pSoundObj.playSound("sbomb");
}
}
}
function launchPowerUp(x, y) {
if ((Math.random() * 10) > 3) {
if (pPLevels[0] > pPLevels[1]) {
var _local4 = Math.ceil(Math.random() * 3);
pPowers.push(new PowerUp(x, y, -2, 0, pMcParent, 2));
} else {
var _local4 = Math.ceil(Math.random() * 3);
pPowers.push(new PowerUp(x, y, -2, 0, pMcParent, 1));
}
} else {
pPowers.push(new PowerUp(x, y, -2, 0, pMcParent, 3));
}
}
function collectPower(type) {
if (pPLevels[type - 1] < 6) {
pPLevels[type - 1]++;
}
pMcParent._parent.titleBar_mc.attackM_mc.setLevel(pPLevels[0]);
pMcParent._parent.titleBar_mc.targetM_mc.setLevel(pPLevels[1]);
}
function update() {
pFireRate++;
for (var _local7 in pFriends) {
if (!pFriends[_local7].onScreen()) {
pFriends[_local7].die();
delete pFriends[_local7];
pFriends.splice(Number(_local7), 1);
} else {
var _local3 = pFriends[_local7].getPos();
var _local4 = pFriends[_local7].getSize();
var _local5 = pFriends[_local7].getStrg();
if (pGame.pMotherShip.checkHit(_local3, _local4, _local5, pFriends[_local7])) {
var _local6 = pFriends[_local7].getStrg();
if (_local6 <= 0) {
pFriends[_local7].die();
delete pFriends[_local7];
pFriends.splice(Number(_local7), 1);
} else {
pFriends[_local7].move();
}
} else {
pFriends[_local7].move();
}
}
}
for (var _local7 in pFoes) {
var _local3 = pGame.pShip.getPos();
if (!pFoes[_local7].onScreen()) {
pFoes[_local7].die();
delete pFoes[_local7];
pFoes.splice(Number(_local7), 1);
} else if (pFoes[_local7].checkHit(_local3)) {
pGame.pShip.hit();
pFoes[_local7].die();
delete pFoes[_local7];
pFoes.splice(Number(_local7), 1);
} else {
pFoes[_local7].move();
}
}
for (var _local7 in pPowers) {
if (!pPowers[_local7].onScreen()) {
pPowers[_local7].die();
delete pPowers[_local7];
pPowers.splice(Number(_local7), 1);
} else {
var _local3 = pPowers[_local7].getPos();
var _local4 = pPowers[_local7].getSize();
var _local2 = pPowers[_local7].getType();
if (pGame.pShip.checkHit(_local3, _local4, _local2)) {
pPowers[_local7].die();
delete pPowers[_local7];
pPowers.splice(Number(_local7), 1);
pGame.pSoundObj.playSound("pickup");
if (_local2 < 3) {
collectPower(_local2);
} else {
pGame.pShip.usePower(_local2);
pGame.pSoundObj.playSound("powerup");
}
} else {
pPowers[_local7].move();
}
}
}
}
}
Symbol 452 MovieClip [__Packages.Bullet] Frame 0
class Bullet extends Mobile
{
var pType, pStrength, pLife, pSize, p_mc, setPos, setSpeed, update, pX, pY;
function Bullet (x, y, xs, ys, mc, type) {
super();
createMc(mc, type);
pType = type;
if (type == 6) {
pStrength = 2;
} else {
pStrength = type;
}
pLife = 9999;
if (type == 8) {
pLife = 150;
}
pSize = p_mc._height;
setPos(x, y);
setSpeed(xs, ys);
}
function createMc(mcParent, type) {
var _local2 = Depth.getNewDepth(6);
p_mc = mcParent.attachMovie("mc.bullet", "b" + _local2, _local2, {_x:-100, _y:-100});
p_mc.gotoAndStop("b" + type);
p_mc.cacheAsBitmap = true;
}
function move() {
update();
draw();
pLife--;
if (pLife <= 0) {
pX = -10;
}
}
function checkHit(point) {
if (flash.geom.Point.distance(point, new flash.geom.Point(pX, pY)) < 20) {
return(true);
}
return(false);
}
function onScreen() {
if ((((pX < 0) || (pX > 600)) || (pY < 0)) || (pY > 400)) {
return(false);
}
return(true);
}
function getMcDepth() {
return(p_mc.getDepth());
}
function die() {
p_mc.removeMovieClip();
}
function draw() {
p_mc._x = pX;
p_mc._y = pY;
}
function getPos() {
var _local2 = new flash.geom.Point(pX, pY);
return(_local2);
}
function getSize() {
return(pSize);
}
function getType() {
return(pType);
}
function getStrg() {
return(pStrength);
}
function setStrength(strength) {
pStrength = pStrength - strength;
}
}
Symbol 453 MovieClip [__Packages.PowerUp] Frame 0
class PowerUp extends Bullet
{
var pType, pSize, p_mc, setPos, setSpeed, pSpeedX, pSpeedY;
function PowerUp (x, y, xs, ys, mc, type) {
super();
createMc(mc, type);
pType = type;
pSize = p_mc._height;
setPos(x, y);
setSpeed(xs, ys);
}
function createMc(mcParent, type) {
var _local2 = Depth.getNewDepth(4);
p_mc = mcParent.attachMovie("mc.powerup", "p" + _local2, _local2, {_x:-100, _y:-100});
p_mc.gotoAndStop("p" + type);
p_mc.cacheAsBitmap = true;
}
function getType() {
return(pType);
}
function move() {
if (pSpeedX > -2) {
pSpeedX = pSpeedX - 0.1;
} else if (pSpeedX < -2) {
pSpeedX = pSpeedX + 0.1;
}
pSpeedY = pSpeedY * 0.9;
super.move();
}
}
Symbol 454 MovieClip [__Packages.Seeker] Frame 0
class Seeker extends Bullet
{
var p_mc, pDirection, pStrength, pSize, setPos, setSpeed, pSpeedX, pSpeedY, update, draw;
function Seeker (x, y, dir, mc, type) {
super();
createMc(mc);
p_mc._yscale = -100 * dir;
pDirection = dir;
pStrength = 4;
pSize = p_mc._height;
setPos(x - 10, y + (dir * -12));
setSpeed(6, dir * -3);
}
function createMc(mcParent) {
var _local2 = Depth.getNewDepth(6);
p_mc = mcParent.attachMovie("mc.seeker", "ms" + _local2, _local2, {_x:-100, _y:-100});
p_mc.gotoAndStop(1);
p_mc.cacheAsBitmap = true;
}
function move() {
if (pSpeedX < 12) {
pSpeedX = pSpeedX + 1;
}
pSpeedY = pSpeedY + (pDirection * 0.5);
update();
p_mc.gotoAndStop(Math.round(Math.abs(pSpeedY) / 2));
draw();
}
}
Symbol 455 MovieClip [__Packages.Missile] Frame 0
class Missile extends Bullet
{
var pStrength, pSize, p_mc, pState, setPos, setSpeed, pSpeedX, pSpeedY;
function Missile (x, y, ys, mc) {
super();
createMc(mc);
pStrength = 4;
pSize = p_mc._height;
pState = 0;
setPos(x - 10, y + (ys * 12));
setSpeed(-6, ys * 8);
}
function createMc(mcParent) {
var _local2 = Depth.getNewDepth(6);
p_mc = mcParent.attachMovie("mc.missile", "m" + _local2, _local2, {_x:-100, _y:-100});
p_mc.gotoAndStop(1);
p_mc.cacheAsBitmap = true;
}
function move() {
switch (pState) {
case 2 :
break;
case 0 :
pSpeedX = pSpeedX * 0.8;
pSpeedY = pSpeedY * 0.7;
if (Math.abs(pSpeedY) < 1) {
pSpeedY = 0;
pSpeedX = 1;
pState = 1;
p_mc.gotoAndPlay("fly");
}
break;
case 1 :
pSpeedX = pSpeedX * 1.4;
if (pSpeedX <= 25) {
break;
}
pSpeedX = 25;
pState = 2;
}
super.move();
}
}
Symbol 456 MovieClip [__Packages.Bomb] Frame 0
class Bomb extends Bullet
{
var pStrength, pSize, p_mc, setPos, setSpeed, pSpeedX, pSpeedY;
function Bomb (x, y, mc) {
super();
createMc(mc);
pStrength = 3;
pSize = p_mc._height;
setPos(x - 5, y + 12);
setSpeed(7, 0);
}
function createMc(mcParent) {
var _local2 = Depth.getNewDepth(6);
p_mc = mcParent.attachMovie("mc.bomb", "bm" + _local2, _local2, {_x:-100, _y:-100});
p_mc.gotoAndStop("bomb1");
p_mc.cacheAsBitmap = true;
}
function move() {
pSpeedX = pSpeedX * 0.92;
pSpeedY = pSpeedY + 0.5;
switch (true) {
case pSpeedY == 3.5 :
p_mc.gotoAndStop("bomb3");
break;
case pSpeedY == 2 :
p_mc.gotoAndStop("bomb2");
}
super.move();
}
}
Symbol 457 MovieClip [__Packages.Mothership] Frame 0
class Mothership
{
var pMcParent, pGame, pEnemies, pPathSets, pTime, pTimeStep, pPause, pPathNum, pPathOrder;
function Mothership (mcParent, gameHost) {
pMcParent = mcParent;
pGame = gameHost;
pEnemies = new Array();
pPathSets = new Array();
pPathSets.push(new Array(1, 2, 3, 4, 5, 10, 11, 1, 2, 3, 4, 5, 10, 11));
pPathSets.push(new Array(6, 7, 8, 9, 6, 7, 8, 9));
pPathSets.push(new Array(12, 13, 12, 13));
pPathSets.push([14]);
pPathSets.push([20]);
pTime = 50;
pTimeStep = 70;
pPause = true;
}
function startGame() {
pPathNum = 0;
pPathOrder.splice(0);
pPathOrder = new Array(0, 0, 1, 0, 1, 0, 2, 0, 1, 2, 1, 0, 3, 0, 1, 1, 0, 2, 1, 1, 2, 0, 0, 1, 0, 1, 3, 3, 4);
pTime = 50;
pTimeStep = 70;
pPause = true;
}
function stepBack() {
pPathNum = Math.max(0, pPathNum - 5);
}
function endGame() {
if (pEnemies.length > 0) {
for (var _local2 in pEnemies) {
pEnemies[_local2].die();
delete pEnemies[_local2];
pEnemies.splice(Number(_local2), 1);
}
}
}
function sendWave() {
var _local2 = pPathSets[pPathOrder[pPathNum]];
var _local3 = _local2[RandomFib.getRange(0, _local2.length - 1)];
if ((++pPathNum) == pPathOrder.length) {
pPathNum = 0;
}
pEnemies.push(new EnemySet(_local3, 1, pMcParent, pGame));
}
function pauseWaves() {
pPause = true;
}
function unpauseWaves() {
pPause = false;
}
function update() {
var _local2 = pGame.pShip.getPos();
for (var _local3 in pEnemies) {
if (!pEnemies[_local3].onScreen()) {
pEnemies[_local3].die();
delete pEnemies[_local3];
pEnemies.splice(Number(_local3), 1);
} else {
if (checkHit(_local2, 12, 100)) {
pGame.pShip.hit();
}
pEnemies[_local3].update();
}
}
if ((pTime++) >= pTimeStep) {
if (!pPause) {
pTime = 0;
sendWave();
}
}
}
function checkHit(point, size, strength, bullet) {
for (var _local5 in pEnemies) {
if (pEnemies[_local5].onScreen()) {
if (pEnemies[_local5].checkHit(point, size, strength, bullet)) {
return(true);
}
}
}
return(false);
}
function addGroundUnit(pos) {
if (!pPause) {
var _local3 = pGame.getLevel();
if ((RandomFib.getNum() * 200) < _local3) {
switch (RandomFib.getRange(0, 2)) {
case 1 :
pEnemies.push(new Rocket(pos.x, pos.y, pMcParent, pGame));
break;
case 2 :
pEnemies.push(new Building(pos.x, pos.y, pMcParent, pGame));
}
}
}
}
}
Symbol 458 MovieClip [__Packages.RandomFib] Frame 0
class RandomFib
{
function RandomFib () {
}
static function setSeed(s1, s2) {
pSeed1 = Math.round(s1 * 123);
pSeed2 = Math.round(s2 * 123);
}
static function getSeed(s1, s2) {
return((String(pSeed1) + " - ") + String(pSeed2));
}
static function getNum() {
var _local1 = trimNum(pSeed1 + pSeed2);
pSeed1 = pSeed2;
pSeed2 = _local1;
return(_local1 / 1000);
}
static function getRange(min, max) {
return(min + Math.round((max - min) * getNum()));
}
static function trimNum(num) {
return(Math.round(num % 1000));
}
static var pSeed1 = 12;
static var pSeed2 = 34;
}
Symbol 459 MovieClip [__Packages.EnemySet] Frame 0
class EnemySet
{
var pMcParent, pGame, pPath, pCount, pKills, pGap, pGapCount, pYStart, pSet, pType, pYArray;
function EnemySet (path, count, mc, gameHost) {
pMcParent = mc;
pGame = gameHost;
pPath = path;
pCount = count;
pKills = count;
pGap = 0;
pGapCount = 16;
pYStart = RandomFib.getRange(100, 300);
pSet = new Array();
switch (path) {
case 1 :
pType = RandomFib.getRange(9, 11);
pCount = 5;
pKills = 5;
pGapCount = 6;
pYStart = (RandomFib.getRange(0, 3) * 60) + 120;
break;
case 2 :
case 3 :
pType = RandomFib.getRange(9, 11);
pCount = 3;
pKills = 3;
pGapCount = 12;
break;
case 4 :
case 5 :
pType = RandomFib.getRange(9, 11);
pCount = 3;
pKills = 3;
pGapCount = 12;
break;
case 6 :
case 7 :
pType = RandomFib.getRange(4, 8);
pCount = 6;
pKills = 6;
pGapCount = 4;
break;
case 8 :
case 9 :
pType = RandomFib.getRange(4, 8);
pCount = 3;
pKills = 3;
pGapCount = 2;
break;
case 10 :
case 11 :
pType = RandomFib.getRange(1, 4);
pCount = 3;
pKills = 3;
pGapCount = 18;
break;
case 12 :
case 13 :
pType = path;
pCount = 5;
pKills = 5;
pGapCount = 6;
pYStart = 0;
pYArray = new Array(110, 160, 210, 260, 310);
break;
case 14 :
pType = 30;
pCount = 12;
pKills = 12;
pGapCount = 12;
pYStart = 0;
pYArray = new Array(90, 110, 130, 150, 170, 190, 210, 230, 250, 270, 290, 310);
pGame.pMotherShip.pauseWaves();
break;
case 20 :
pType = 20;
pKills = 1;
pGapCount = 10;
pCount = 0;
var _local4 = new Boss(1000, 220, pMcParent, pGame, pType);
pSet.push(_local4);
var _local6 = RandomFib.getRange(14, 18);
var _local5 = RandomFib.getRange(14, 18);
var _local2 = 0;
while (_local2 < 6) {
var _local3 = new Orbiter(-100, 100, pMcParent, pGame, _local6, _local4, 1.0471975511966 * _local2, 60, 0.1);
pSet.push(_local3);
_local2++;
}
_local2 = 0;
while (_local2 < 10) {
var _local3 = new Orbiter(-100, 100, pMcParent, pGame, _local5, _local4, 0.628318530717959 * _local2, 100, -0.1);
pSet.push(_local3);
_local2++;
}
pGame.pMotherShip.pauseWaves();
break;
}
}
function update() {
if (pCount > 0) {
if ((pGap++) > pGapCount) {
pGap = 0;
pCount--;
var _local3 = new Enemy(600, pYStart, pMcParent, pGame, pType);
if (pYStart == 0) {
var _local4 = RandomFib.getRange(0, pYArray.length - 1);
_local3.setPath(pPath, pYArray[_local4]);
pYArray.splice(_local4, 1);
} else {
_local3.setPath(pPath, pYStart);
}
pSet.push(_local3);
}
}
for (var _local2 in pSet) {
if (!pSet[_local2].onScreen()) {
removeEnemy(Number(_local2));
} else {
pSet[_local2].update();
}
}
}
function die() {
if (pSet.length > 0) {
for (var _local2 in pSet) {
pSet[_local2].die();
delete pSet[_local2];
pSet.splice(_local2, 1);
}
}
}
function removeEnemy(index) {
if ((pCount == 0) && (pSet.length == 1)) {
if (pKills == 0) {
var _local2 = pSet[index].getPos();
pGame.pWeapons.launchPowerUp(_local2.x, _local2.y);
} else if (Math.random() > 0.8) {
pGame.pWeapons.launchPowerUp(600, 130 + Math.round(Math.random() * 270));
}
if (pType == 30) {
pGame.pMotherShip.unpauseWaves();
}
}
pSet[index].die();
delete pSet[index];
pSet.splice(index, 1);
}
function checkHit(point, size, strength, bullet) {
for (var _local5 in pSet) {
if (pSet[_local5].onScreen()) {
if (pSet[_local5].checkHit(point, size, strength, bullet)) {
if (!pSet[_local5].onScreen()) {
pKills--;
removeEnemy(Number(_local5));
}
return(true);
}
}
}
return(false);
}
function onScreen() {
if ((pCount == 0) && (pSet.length == 0)) {
return(false);
}
return(true);
}
}
Symbol 460 MovieClip [__Packages.Boss] Frame 0
class Boss extends Craft
{
var pMcParent, pGame, pType, pStrength, setPos, setSpeed, createMc, pSize, p_mc, pCentre, pRad, pProtection, pCount, pX, pY, draw;
function Boss (x, y, mcParent, gameHost, type) {
super();
pMcParent = mcParent;
pGame = gameHost;
pType = type;
pStrength = 20;
setPos(x, y);
setSpeed(0, 0);
createMc(mcParent, RandomFib.getRange(19, 23));
pSize = p_mc._height;
pCentre = new flash.geom.Point(1000, 220);
pRad = 1;
pProtection = 0;
pCount = 0;
}
function addProtection() {
pProtection++;
}
function removeProtection() {
pProtection--;
}
function update() {
pCount++;
if (pCount >= 50) {
pCount = 0;
shoot();
}
if (pCentre.x > 450) {
pCentre.x = pCentre.x - 4;
}
pRad = pRad + 0.05;
pX = pCentre.x + (Math.sin(pRad) * 50);
pY = pCentre.y + (Math.cos((-pRad) * 1.5) * 50);
draw();
}
function onScreen() {
return(pStrength > 0);
}
function checkHit(point, size, strength, bullet) {
var _local3 = new flash.geom.Point(pX, pY);
if (flash.geom.Point.distance(_local3, point) < ((pSize + size) / 2)) {
bullet.setStrength(pStrength);
if (pProtection == 0) {
pStrength = pStrength - strength;
}
if (pStrength <= 0) {
var _local2 = Depth.getNewDepth(8);
pMcParent.attachMovie("mc.explosion", "ex" + _local2, _local2, {_x:pX, _y:pY});
pGame.pSoundObj.playSound("explode1");
pGame.levelComplete();
} else {
var _local2 = Depth.getNewDepth(8);
pMcParent.attachMovie("mc.impact", "ex" + _local2, _local2, {_x:point.x, _y:point.y});
}
return(true);
}
return(false);
}
function shoot() {
pGame.pWeapons.launchWeapon(pX, pY, false, 1);
}
}
Symbol 461 MovieClip [__Packages.Orbiter] Frame 0
class Orbiter extends Craft
{
var pMcParent, pGame, pHost, pType, pStrength, setPos, setSpeed, createMc, pSize, p_mc, pCentre, pRad, pOffset, pRadius, pSpeed, pX, pY, draw;
function Orbiter (x, y, mcParent, gameHost, type, boss, offset, radius, speed) {
super();
pMcParent = mcParent;
pGame = gameHost;
pHost = boss;
pType = type;
pStrength = 7;
setPos(x, y);
setSpeed(0, 0);
createMc(mcParent, pType);
pSize = p_mc._height;
pCentre = new flash.geom.Point(450, 220);
pRad = 0;
pOffset = offset;
pRadius = radius;
pSpeed = speed;
pHost.addProtection();
}
function update() {
var _local2 = pHost.getPos();
pRad = pRad + pSpeed;
var _local3 = Math.sin(pRad + pOffset);
pX = _local2.x + (_local3 * pRadius);
pY = _local2.y + (Math.cos(pRad + pOffset) * pRadius);
draw();
}
function onScreen() {
return(pStrength > 0);
}
function die() {
pHost.removeProtection();
delete pHost;
super.die();
}
function checkHit(point, size, strength, bullet) {
var _local3 = new flash.geom.Point(pX, pY);
if (flash.geom.Point.distance(_local3, point) < ((pSize + size) / 2)) {
bullet.setStrength(pStrength);
pStrength = pStrength - strength;
if (pStrength <= 0) {
var _local2 = Depth.getNewDepth(8);
pMcParent.attachMovie("mc.explosion", "ex" + _local2, _local2, {_x:pX, _y:pY});
pGame.pSoundObj.playSound("explode1");
} else {
var _local2 = Depth.getNewDepth(8);
pMcParent.attachMovie("mc.impact", "ex" + _local2, _local2, {_x:point.x, _y:point.y});
}
return(true);
}
return(false);
}
function shoot() {
pGame.pWeapons.launchWeapon(pX, pY, false);
}
}
Symbol 462 MovieClip [__Packages.Enemy] Frame 0
class Enemy extends Craft
{
var pMcParent, pGame, pType, pStrength, setPos, pSpeed, pXSpeed, createMc, pSize, p_mc, pPath, pStartY, pTime, draw, pX, pY;
function Enemy (x, y, mcParent, gameHost, type) {
super();
pMcParent = mcParent;
pGame = gameHost;
pType = type;
switch (type) {
case 20 :
pType = RandomFib.getRange(20, 23);
pStrength = 7 + Math.floor(pGame.getLevel() / 60);
break;
case 30 :
pType = RandomFib.getRange(30, 35);
if (pType > 33) {
pStrength = 7 + Math.floor(pGame.getLevel() / 60);
} else {
pStrength = 10 + Math.floor(pGame.getLevel() / 60);
}
break;
default :
pStrength = 1 + Math.floor(pGame.getLevel() / 60);
}
setPos(x, y);
pSpeed = 1;
pXSpeed = RandomFib.getRange(4, 8);
createMc(mcParent, pType);
pSize = p_mc._height;
}
function setPath(path, y) {
pPath = path;
pStartY = y;
pTime = 0;
}
function update() {
getPath();
draw();
}
function onScreen() {
return(pTime >= 0);
}
function checkHit(point, size, strength, bullet) {
var _local3 = new flash.geom.Point(pX, pY);
if (flash.geom.Point.distance(_local3, point) < ((pSize + size) / 2)) {
bullet.setStrength(pStrength);
pStrength = pStrength - strength;
if (pStrength <= 0) {
pTime = -1;
var _local2 = Depth.getNewDepth(8);
pMcParent.attachMovie("mc.explosion", "ex" + _local2, _local2, {_x:pX, _y:pY});
pGame.addScore(100);
pGame.pSoundObj.playSound("explode1");
} else {
var _local2 = Depth.getNewDepth(8);
pMcParent.attachMovie("mc.impact", "ex" + _local2, _local2, {_x:point.x, _y:point.y});
pGame.addScore(50);
}
return(true);
}
return(false);
}
function shoot() {
pGame.pWeapons.launchWeapon(pX, pY, false);
}
function getPath() {
pTime = pTime + pSpeed;
var _local5 = 1;
switch (pPath) {
case 1 :
pX = 610 - (pTime * 7);
var _local4 = 0.172787595947439;
pY = pStartY + (Math.sin(pTime * _local4) * 30);
if (pTime == 40) {
shoot();
}
if (pTime >= 100) {
pTime = -1;
}
break;
case 2 :
if (pTime <= 20) {
pY = 115;
pX = Tween.easeOutQuad(pTime, 605, -160, 20);
} else {
if (pTime == 28) {
shoot();
}
pX = Tween.easeInQuad(pTime - 20, 445, -500, 40);
pY = Tween.easeInQuad(pTime - 20, 115, 500, 40);
if (pTime >= 100) {
pTime = -1;
}
}
break;
case 3 :
if (pTime <= 20) {
pY = 275;
pX = Tween.easeOutQuad(pTime, 605, -160, 20);
} else {
if (pTime == 28) {
shoot();
}
pX = Tween.easeInQuad(pTime - 20, 445, -500, 40);
pY = Tween.easeInQuad(pTime - 20, 275, -500, 40);
if (pTime >= 100) {
pTime = -1;
}
}
break;
case 4 :
if (pTime <= 20) {
pY = 130;
pX = Tween.easeOutQuad(pTime, 605, -160, 20);
} else if (pTime < 40) {
if (pTime == 30) {
shoot();
}
pY = Tween.easeInOutQuad(pTime - 20, 130, 150, 20);
} else {
pX = Tween.easeInQuad(pTime - 40, 445, -500, 40);
if (pTime >= 100) {
pTime = -1;
}
}
break;
case 5 :
if (pTime <= 20) {
pY = 280;
pX = Tween.easeOutQuad(pTime, 605, -160, 20);
} else if (pTime < 40) {
if (pTime == 30) {
shoot();
}
pY = Tween.easeInOutQuad(pTime - 20, 280, -150, 20);
} else {
pX = Tween.easeInQuad(pTime - 40, 445, -500, 40);
if (pTime >= 100) {
pTime = -1;
}
}
break;
case 6 :
if (pTime <= 15) {
pX = 450 - (pTime * 8);
pY = -10 + (pTime * 8);
} else if (pTime <= 100) {
var _local3 = ((pTime - 15) / 10) + 3.92699081698724;
var _local2 = 125 - ((pTime - 15) / 2);
pX = 420 + (Math.sin(_local3) * _local2);
pY = 200 + (Math.cos(_local3) * _local2);
if (pTime == 65) {
shoot();
}
} else {
pX = 408 + ((pTime - 100) * 9);
if (pTime >= 150) {
pTime = -1;
}
}
break;
case 7 :
if (pTime <= 15) {
pX = 450 - (pTime * 8);
pY = 410 - (pTime * 8);
} else if (pTime <= 100) {
var _local3 = ((pTime - 15) / 10) + 3.92699081698724;
var _local2 = 125 - ((pTime - 15) / 2);
pX = 420 + (Math.sin(_local3) * _local2);
pY = 200 + (Math.cos(_local3) * (-_local2));
if (pTime == 65) {
shoot();
}
} else {
pX = 408 + ((pTime - 100) * 9);
if (pTime >= 150) {
pTime = -1;
}
}
break;
case 8 :
if (pTime <= 20) {
pX = -10 + (pTime * 10);
pY = 100;
} else if (pTime <= 83) {
var _local3 = (pTime - 20) / 10;
var _local2 = 115;
pX = 190 + (Math.sin(_local3) * _local2);
pY = (100 + _local2) + (Math.cos(_local3) * (-_local2));
} else {
pX = 190 + ((pTime - 83) * 10);
if (pTime == 95) {
shoot();
}
if (pX >= 605) {
pTime = -1;
}
}
break;
case 9 :
if (pTime <= 20) {
pX = -10 + (pTime * 10);
pY = 330;
} else if (pTime <= 83) {
var _local3 = (pTime - 20) / 10;
var _local2 = 115;
pX = 190 + (Math.sin(_local3) * _local2);
pY = (330 - _local2) + (Math.cos(_local3) * _local2);
} else {
pX = 190 + ((pTime - 83) * 10);
if (pTime == 95) {
shoot();
}
if (pX >= 605) {
pTime = -1;
}
}
break;
case 10 :
if (pTime <= 25) {
pY = 130;
pX = Tween.easeOutQuad(pTime, 605, -300, 25);
} else if (pTime < 50) {
pX = Tween.easeInOutQuad(pTime - 25, 305, 150, 25);
pY = Tween.easeInOutQuad(pTime - 25, 130, 150, 25);
if (pTime == 35) {
shoot();
}
} else {
pX = Tween.easeInQuad(pTime - 50, 455, -500, 30);
if (pTime >= 80) {
pTime = -1;
}
}
break;
case 11 :
if (pTime <= 25) {
pY = 280;
pX = Tween.easeOutQuad(pTime, 605, -300, 25);
} else if (pTime < 50) {
pX = Tween.easeInOutQuad(pTime - 25, 305, 150, 25);
pY = Tween.easeInOutQuad(pTime - 25, 280, -150, 25);
if (pTime == 35) {
shoot();
}
} else {
pX = Tween.easeInQuad(pTime - 50, 455, -500, 30);
if (pTime >= 80) {
pTime = -1;
}
}
break;
case 12 :
if (pTime <= 25) {
pY = pStartY;
pX = Tween.easeOutQuad(pTime, 615, -200, 25);
} else {
pX = Tween.easeInQuad(pTime - 25, 415, -450, 25);
if (pTime >= 50) {
pTime = -1;
}
}
break;
case 13 :
pY = pStartY;
pX = Tween.easeInQuad(pTime, 620, -660, 30);
if (pTime >= 30) {
pTime = -1;
}
break;
case 14 :
pY = pStartY;
pX = 630 - (pTime * pXSpeed);
if (pX < -30) {
pTime = -1;
}
break;
case 20 :
pX = 500;
pY = 200;
break;
case 7 :
if (pTime <= 15) {
pX = Tween.easeOutQuad(pTime, 605, -90, 15);
pY = Tween.easeOutQuad(pTime, 200, -90, 15);
} else if (pTime < 40) {
pX = Tween.easeInOutQuad(pTime - 15, 515, -150, 25);
pY = Tween.easeInOutQuad(pTime - 15, 110, 150, 25);
if (pTime == 39) {
shoot();
}
} else if (pTime < 55) {
pX = Tween.easeInOutQuad(pTime - 40, 365, 60, 15);
pY = Tween.easeInOutQuad(pTime - 40, 260, 60, 15);
} else if (pTime < 70) {
pX = Tween.easeInOutQuad(pTime - 55, 425, 60, 15);
pY = Tween.easeInOutQuad(pTime - 55, 320, -60, 15);
} else {
pX = Tween.easeInQuad(pTime - 70, 485, -350, 30);
pY = Tween.easeInQuad(pTime - 70, 260, -350, 30);
if (pTime < 100) {
break;
}
pTime = -1;
}
}
}
function getStrg() {
switch (pType) {
case 1 :
return(1);
case 2 :
return(2);
case 3 :
return(3);
case 4 :
return(1);
case 5 :
return(1);
}
}
}
Symbol 463 MovieClip [__Packages.Tween] Frame 0
class Tween
{
function Tween () {
}
static function easeInQuad(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOutQuad(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOutQuad(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
}
Symbol 464 MovieClip [__Packages.Rocket] Frame 0
class Rocket extends Craft
{
var pMcParent, pGame, pSize, p_mc, pStrength, pState, pCount, setPos, setSpeed, pX, pY, pSpeedY, draw;
function Rocket (x, y, mc, gameHost) {
super();
pMcParent = mc;
pGame = gameHost;
createMc(mc);
pSize = p_mc._height;
pStrength = 1;
pState = 0;
pCount = 5 + Math.round(Math.random() * 60);
setPos(x, y);
setSpeed(-5, 0);
}
function createMc(mcParent) {
var _local2 = Depth.getNewDepth(1);
p_mc = mcParent.attachMovie("mc.rocket", "r" + _local2, _local2, {_x:-50, _y:-50});
p_mc.gotoAndStop(1);
p_mc.cacheAsBitmap = true;
}
function checkHit(point, size, strength) {
var _local3 = new flash.geom.Point(pX, pY);
if (flash.geom.Point.distance(_local3, point) < ((pSize + size) / 2)) {
pStrength = pStrength - strength;
if (pStrength <= 0) {
var _local2 = Depth.getNewDepth(8);
pMcParent.attachMovie("mc.explosionF", "ex" + _local2, _local2, {_x:pX - 5, _y:pY});
pGame.addScore(100);
pGame.pSoundObj.playSound("explode2");
pX = -10;
} else {
var _local2 = Depth.getNewDepth(8);
pMcParent.attachMovie("mc.impact", "ex" + _local2, _local2, {_x:pX - 5, _y:pY});
pGame.addScore(50);
}
return(true);
}
return(false);
}
function update() {
switch (pState) {
case 0 :
pCount--;
if (pCount <= 0) {
p_mc.gotoAndStop(2);
pState = 1;
}
break;
case 1 :
pSpeedY = pSpeedY - 0.2;
if (pSpeedY < -6) {
pState = 2;
}
break;
case 2 :
}
super.update();
draw();
}
function onScreen() {
if ((((pX < 0) || (pX > 750)) || (pY < 0)) || (pY > 400)) {
return(false);
}
return(true);
}
}
Symbol 465 MovieClip [__Packages.Building] Frame 0
class Building extends Craft
{
var pMcParent, pGame, pSize, p_mc, pStrength, setPos, setSpeed, pX, pY, draw;
function Building (x, y, mc, gameHost) {
super();
pMcParent = mc;
pGame = gameHost;
createMc(mc);
pSize = p_mc._width;
pStrength = 1;
setPos(x, y);
setSpeed(-5, 0);
}
function createMc(mcParent) {
var _local2 = Depth.getNewDepth(0);
p_mc = mcParent.attachMovie("mc.building", "r" + _local2, _local2, {_x:-50, _y:-50});
p_mc.gotoAndStop(1);
p_mc.cacheAsBitmap = true;
}
function checkHit(point, size, strength) {
var _local3 = new flash.geom.Point(pX, pY);
if (flash.geom.Point.distance(_local3, point) < ((pSize + size) / 2)) {
pStrength = pStrength - strength;
if (pStrength <= 0) {
var _local2 = Depth.getNewDepth(8);
pMcParent.attachMovie("mc.explosionF", "ex" + _local2, _local2, {_x:pX - 5, _y:pY});
pGame.addScore(100);
pGame.pSoundObj.playSound("radar");
pX = -10;
} else {
var _local2 = Depth.getNewDepth(8);
pMcParent.attachMovie("mc.impact", "ex" + _local2, _local2, {_x:pX, _y:pY});
pGame.addScore(50);
}
return(true);
}
return(false);
}
function update() {
super.update();
draw();
}
function onScreen() {
if ((((pX < 0) || (pX > 750)) || (pY < 0)) || (pY > 400)) {
return(false);
}
return(true);
}
}
Symbol 466 MovieClip [__Packages.Ground] Frame 0
class Ground
{
var pGame, pX, pSpeedX, pFloor, pPlanet1, pPlanet2, pLocations, pIndex, pLaunchPoint;
function Ground (mcParent, gameHost) {
pGame = gameHost;
pX = 0;
pSpeedX = 5;
pFloor = mcParent.attachMovie("mc.ground", "ground_mc", 3, {_x:0, _y:310});
pFloor.cacheAsBitmap = true;
pPlanet1 = mcParent.attachMovie("mc.planet1", "planet1_mc", 1, {_x:300, _y:225});
pPlanet1.cacheAsBitmap = true;
pPlanet2 = mcParent.attachMovie("mc.planet2", "planet2_mc", 2, {_x:446, _y:121});
pPlanet2.cacheAsBitmap = true;
pLocations = new Array();
pLocations.push(new flash.geom.Point(55, 381));
pLocations.push(new flash.geom.Point(99, 354));
pLocations.push(new flash.geom.Point(147, 374));
pLocations.push(new flash.geom.Point(188, 374));
pLocations.push(new flash.geom.Point(245, 349));
pLocations.push(new flash.geom.Point(297, 354));
pLocations.push(new flash.geom.Point(341, 374));
pLocations.push(new flash.geom.Point(381, 374));
pLocations.push(new flash.geom.Point(423, 361));
pLocations.push(new flash.geom.Point(476, 381));
pLocations.push(new flash.geom.Point(514, 381));
pLocations.push(new flash.geom.Point(569, 356));
pLocations.push(new flash.geom.Point(1000, 0));
pIndex = 0;
pLaunchPoint = pLocations[pIndex].x;
}
function startGame() {
pX = 0;
pSpeedX = 5;
pIndex = 0;
pLaunchPoint = pLocations[pIndex].x;
}
function update() {
pPlanet1._x = pPlanet1._x - 0.05;
if (pPlanet1._x < -500) {
pPlanet1._x = 900;
}
pPlanet2._x = pPlanet2._x - 1;
if (pPlanet2._x < -500) {
pPlanet2._x = 900;
pPlanet2._y = 80 + Math.round(Math.random() * 260);
}
pX = pX - pSpeedX;
if (pX < -600) {
pX = pX + 600;
pIndex = 0;
pLaunchPoint = pLocations[pIndex].x;
}
pFloor._x = pX;
if ((-pX) >= (pLaunchPoint - 30)) {
var _local2 = pLocations[pIndex].clone();
_local2.offset(pX + 600, -14);
pGame.pMotherShip.addGroundUnit(_local2);
if (pIndex < (pLocations.length - 1)) {
pIndex++;
pLaunchPoint = pLocations[pIndex].x;
}
}
}
}
Symbol 467 MovieClip [__Packages.SoundObj] Frame 0
class SoundObj
{
var pSoundObjs, pGlobalSound, pMusic, pNewG, pMenu;
function SoundObj (mc) {
pSoundObjs = new Array();
pGlobalSound = new Sound();
pMusic = new Sound(mc);
pMusic.attachSound("ingame_snd");
pNewG = new Sound(mc);
pNewG.attachSound("newG_snd");
pMenu = new Sound(mc);
pMenu.attachSound("menu_snd");
pMenu.start(0, 9999);
var _local2 = new Sound(mc);
_local2.attachSound("laser1_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("laser2_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("laser3_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("laser4_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("laser5_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("change_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("sbomb_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("missile_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("explode1_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("explode2_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("radar_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("pickup_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("explosion_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("gameover_snd");
pSoundObjs.push(_local2);
_local2 = new Sound(mc);
_local2.attachSound("powerup_snd");
pSoundObjs.push(_local2);
}
function startGame() {
pMenu.stop();
pNewG.start();
pMusic.onSoundComplete = function () {
this.start(2.902, 99999);
delete this.onSoundComplete;
};
pMusic.start();
}
function endGame() {
pMusic.stop();
pMenu.start(0, 99999);
}
function playSound(tName) {
switch (tName) {
case "laser1" :
pSoundObjs[0].start();
break;
case "laser2" :
pSoundObjs[1].start();
break;
case "laser3" :
pSoundObjs[2].start();
break;
case "laser4" :
pSoundObjs[3].start();
break;
case "laser5" :
pSoundObjs[4].start();
break;
case "change" :
pSoundObjs[5].start();
break;
case "sbomb" :
pSoundObjs[6].start();
break;
case "missile" :
pSoundObjs[7].start();
break;
case "explode1" :
pSoundObjs[8].start();
break;
case "explode2" :
pSoundObjs[9].start();
break;
case "radar" :
pSoundObjs[10].start();
break;
case "pickup" :
pSoundObjs[11].start();
break;
case "explosion" :
pSoundObjs[12].start();
break;
case "gameover" :
pSoundObjs[13].start();
break;
case "powerup" :
pSoundObjs[14].start();
}
}
function switchVolume() {
if (pGlobalSound.getVolume() == 100) {
pGlobalSound.setVolume(0);
return(false);
}
pGlobalSound.setVolume(100);
return(true);
}
function getVolume() {
if (pGlobalSound.getVolume() == 100) {
return(true);
}
return(false);
}
}
Symbol 348 MovieClip Frame 36
stop();
Symbol 351 Button
on (release) {
this.gotoAndPlay("new game");
}
Symbol 353 Button
on (release) {
this.gotoAndPlay("instruct");
}
Symbol 358 MovieClip Frame 1
if (this._parent.tGame.pSoundObj.getVolume()) {
this.gotoAndStop("on");
} else {
this.gotoAndStop("off");
}
this.hitArea = this.hitTest_mc;
this.hitTest_mc._alpha = 0;
stop();
this.onPress = function () {
if (this._parent.tGame.pSoundObj.switchVolume()) {
this.gotoAndStop("on");
} else {
this.gotoAndStop("off");
}
};
Symbol 365 Button
on (release) {
_global.pSpeed = 3;
tGame.pSoundObj.startGame();
this.play();
}
Symbol 368 Button
on (release) {
_global.pSpeed = 2;
tGame.pSoundObj.startGame();
this.play();
}
Symbol 371 Button
on (release) {
_global.pSpeed = 1;
tGame.pSoundObj.startGame();
this.play();
}
Symbol 391 Button
on (release) {
this.gotoAndPlay("instructOut");
}
Symbol 410 MovieClip Frame 1
this.nextBG = function () {
if (this._currentframe == this._totalframes) {
this.gotoAndStop(1);
} else {
this.nextFrame();
}
};
stop();
Symbol 417 MovieClip Frame 19
stop();
Symbol 422 MovieClip Frame 19
stop();
Symbol 426 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 1
this.setLevel = function (level) {
var _local2 = 0;
while (_local2 < 6) {
if (_local2 < level) {
this[("blip" + _local2) + "_mc"].gotoAndStop(2);
} else {
this[("blip" + _local2) + "_mc"].gotoAndStop(1);
}
_local2++;
}
};
stop();
Symbol 430 MovieClip Frame 1
stop();
Symbol 431 MovieClip Frame 1
this.setLevel = function (level) {
var _local2 = 0;
while (_local2 < 6) {
if (_local2 < level) {
this[("blip" + _local2) + "_mc"].gotoAndStop(2);
} else {
this[("blip" + _local2) + "_mc"].gotoAndStop(1);
}
_local2++;
}
};
stop();
Symbol 434 MovieClip Frame 1
this.showNum = function (tNum) {
this.digit_mc._y = tNum * -10;
};
stop();
Symbol 436 MovieClip Frame 1
this.showNum = function (num) {
if (num < 0) {
num = 0;
}
var _local5 = "00" + String(num);
var _local3 = _local5.substr(-2).split("");
var _local2 = 0;
while (_local2 < 2) {
this[("num" + _local2) + "_mc"].digit_mc._y = _local3[_local2] * -10;
_local2++;
}
};
stop();
Symbol 437 MovieClip Frame 1
this.showNum = function (num) {
var _local4 = "00000000" + String(num);
var _local3 = _local4.substr(-8).split("");
var _local2 = 0;
while (_local2 < 8) {
this[("num" + _local2) + "_mc"].digit_mc._y = _local3[_local2] * -10;
_local2++;
}
};
stop();
Symbol 441 MovieClip Frame 1
stop();
Symbol 444 Button
on (release) {
this.gotoAndPlay("start");
}