Frame 2
fscommand ("showmenu", false);
Mouse.hide();
Frame 151
function fadeTrans(targetFrame) {
if (_root.blackBox.flag == false) {
if (_root.blackBox._alpha < 100) {
_root.blackBox._alpha = _root.blackBox._alpha + 4;
} else {
_root.blackBox.flag = true;
}
} else {
_root.gotoAndStop(targetFrame);
_root.blackBox.onEnterFrame = function () {
_root.fadeOut();
};
}
}
function fadeOut() {
if (_root.blackBox._alpha > 0) {
_root.blackBox._alpha = _root.blackBox._alpha - 4;
} else {
delete _root.blackBox.onEnterFrame;
_root.blackBox.flag = false;
}
}
stop();
masterVolume = new Sound();
masterVolume.setVolume(100);
globalVol = masterVolume.getVolume() / 12.5;
canAppear = new Sound(this);
canAppear.attachSound("canAppear");
canAppear.start();
novaboom = new Sound(this);
novaboom.attachSound("novaboom");
madeSounds = false;
lastScore = 0;
_root.attachMovie("blackBox", "blackBox", 1100000000, {_x:0, _y:0, _alpha:0});
var mp = Math.PI;
var mpow = Math.pow;
var msr = Math.sqrt;
var mf = Math.floor;
var mr = Math.random;
var mm = Math.max;
var ma = Math.abs;
var mmi = Math.min;
var ms = Math.sin;
var mc = Math.cos;
Array.prototype.insert = function (index, val) {
if (index < 0) {
return(undefined);
}
var _local2 = this.slice();
var _local3 = _local2.splice(index);
_local2[index] = val;
_local2 = _local2.concat(_local3);
return(_local2);
};
Frame 152
exGuy = new Array(50);
var i = 0;
while (i < 50) {
exGuy[i] = false;
i++;
}
exGuyCur = 1;
glRoidVel = new Array(-3, -2, -1, 1, 2, 3);
glShakeVel = new Array(-4, -3, -2, -1, 1, 2, 3, 4);
meteorShower = 0;
canShower = 0;
if (!madeSounds) {
alarm = new Sound(this);
alarm.attachSound("alarm");
allright = new Sound(this);
allright.attachSound("allright");
boop = new Sound(this);
boop.attachSound("boop");
clang = new Sound(this);
clang.attachSound("clang");
cometsnd = new Sound(this);
cometsnd.attachSound("cometsnd");
dindun = new Sound(this);
dindun.attachSound("dindun");
explosion = new Sound(this);
explosion.attachSound("explosion");
fail = new Sound(this);
fail.attachSound("fail");
freeze = new Sound(this);
freeze.attachSound("freeze");
gameOverLaugh = new Sound(this);
gameOverLaugh.attachSound("gameoverlaugh");
helpme = new Sound(this);
helpme.attachSound("helpme");
jets = new Sound(this);
jets.attachSound("jets");
kieru = new Sound(this);
kieru.attachSound("kieru");
mine = new Sound(this);
mine.attachSound("mine");
multiappear = new Sound(this);
multiappear.attachSound("multiappear");
multihit = new Sound(this);
multihit.attachSound("multihit");
shield = new Sound(this);
shield.attachSound("shield");
shot = new Sound(this);
shot.attachSound("shot");
newriff = new Sound(this);
newriff.attachSound("newriff");
nova = new Sound(this);
nova.attachSound("nova");
pauseSound = new Sound(this);
pauseSound.attachSound("pause");
prettygood = new Sound(this);
prettygood.attachSound("prettygood");
scoresplat = new Sound(this);
scoresplat.attachSound("scoresplat");
sweet = new Sound(this);
sweet.attachSound("sweet");
thankgoodness = new Sound(this);
thankgoodness.attachSound("thankgoodness");
twonothins = new Sound(this);
twonothins.attachSound("twonothins");
vortexsnd = new Sound(this);
vortexsnd.attachSound("vortexsnd");
yeeha = new Sound(this);
yeeha.attachSound("yeeha");
yo = new Sound(this);
yo.attachSound("yo");
madeSounds = true;
}
score = 0;
genericIndex = 0;
lives = 3;
currentDepth = 5;
wave = 1;
rads = 0.017453;
paused = false;
cheat = false;
hsList = SharedObject.getLocal("maelstromHighScores");
if ((hsList.data.scores == undefined) || (hsList.data.scores == null)) {
hsList.data.clear();
hsList.flush();
hsList.data.scores = new Array(10);
var i = 0;
while (i < hsList.data.scores.length) {
hsList.data.scores[i] = new Array(3);
i++;
}
}
var i = 0;
while (i < hsList.data.scores.length) {
if (hsList.data.scores[i][0] != undefined) {
_root.hsName.text = _root.hsName.text + (("" + hsList.data.scores[i][0]) + newline);
_root.hsScore.text = _root.hsScore.text + (("" + hsList.data.scores[i][1]) + newline);
_root.hsWave.text = _root.hsWave.text + (("" + hsList.data.scores[i][2]) + newline);
}
i++;
}
Instance of Symbol 40 MovieClip [extrasControl] "maincontrol" in Frame 152
onClipEvent (keyDown) {
if (_root.blackBox._alpha > 0) {
return(undefined);
}
if (((Key.getCode() >= 48) && (Key.getCode() <= 56)) && (((_root.cheatmc._currentframe == _root.xthingmc._currentframe) == _root.controlsmc._currentframe) == 1)) {
_root.globalVol = Key.getCode() - 48;
_root.masterVolume.setVolume(12.5 * (Key.getCode() - 48));
_root.yo.start();
} else if (Key.isDown(65) && (((_root.cheatmc._currentframe == _root.xthingmc._currentframe) == _root.controlsmc._currentframe) == 1)) {
_root.nova.start();
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("about1");
};
} else if (Key.isDown(67) && (((_root.cheatmc._currentframe == _root.xthingmc._currentframe) == _root.controlsmc._currentframe) == 1)) {
Mouse.show();
_root.mine.start();
_root.controlsmc.gotoAndPlay(1);
} else if (Key.isDown(76) && (((_root.cheatmc._currentframe == _root.xthingmc._currentframe) == _root.controlsmc._currentframe) == 1)) {
Mouse.show();
_root.sweet.start();
_root.cheatmc.play();
} else if (Key.isDown(80) && (((_root.cheatmc._currentframe == _root.xthingmc._currentframe) == _root.controlsmc._currentframe) == 1)) {
stopAllSounds();
_root.yo.start();
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("game");
};
delete this.onKeyDown;
} else if (Key.isDown(81) && (((_root.cheatmc._currentframe == _root.xthingmc._currentframe) == _root.controlsmc._currentframe) == 1)) {
stopAllSounds();
_root.kieru.onSoundComplete = function () {
delete _root.kieru.onSoundComplete;
getURL ("javascript:window.close();");
delete _root.kieru.onSoundComplete;
};
_root.kieru.start();
} else if (Key.isDown(88) && (((_root.cheatmc._currentframe == _root.xthingmc._currentframe) == _root.controlsmc._currentframe) == 1)) {
Mouse.show();
_root.alarm.start();
_root.xthingmc.gotoAndPlay(1);
} else if (Key.isDown(90) && (((_root.cheatmc._currentframe == _root.xthingmc._currentframe) == _root.controlsmc._currentframe) == 1)) {
var i = 0;
while (i < _root.hsList.data.scores.length) {
_root.hsList.data.scores[i] = new Array(3);
i++;
}
_root.multihit.start();
_root.hsName.text = (_root.hsScore.text = (_root.hsWave.text = ""));
} else if (((_root.cheatmc._currentframe == _root.xthingmc._currentframe) == _root.controlsmc._currentframe) == 1) {
_root.clang.start();
}
}
Instance of Symbol 40 MovieClip [extrasControl] "about1control" in Frame 153
onClipEvent (keyDown) {
if (_root.blackBox._alpha > 0) {
return(undefined);
}
_root.explosion.start();
if (Key.isDown(13)) {
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("about2");
};
} else {
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("main");
};
}
}
Instance of Symbol 40 MovieClip [extrasControl] "about2control" in Frame 154
onClipEvent (keyDown) {
if (_root.blackBox._alpha > 0) {
return(undefined);
}
_root.explosion.start();
if (Key.isDown(13)) {
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("about3");
};
} else {
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("main");
};
}
}
Instance of Symbol 40 MovieClip [extrasControl] "about3control" in Frame 155
onClipEvent (keyDown) {
if (_root.blackBox._alpha > 0) {
return(undefined);
}
_root.prettygood.start();
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("main");
};
}
Frame 156
function md(x1, y1, x2, y2) {
return(msr(mpow(x1 - x2, 2) + mpow(y1 - y2, 2)));
}
function checkEx() {
if (_root.score > (_root.exGuyCur * 50000)) {
_root.yo.start();
_root.exGuyCur++;
_root.lives++;
}
}
function gamePause() {
_root.dindun.stop();
_root.pauseSound.start();
var _local6 = 0;
var _local5 = 0;
var _local4 = 0;
var _local3 = 0;
var _local7 = 0;
var _local2 = 0;
ttl = (((_root.ast.length + _root.stb.length) + _root.shots.length) + _root.xtr.length) + 10;
_root.paws = new Array(ttl);
delete _root.gameControl.onEnterFrame;
while (_local6 < _root.ast.length) {
_root.paws[_local2] = _root.ast[_local6].onEnterFrame;
delete _root.ast[_local6].onEnterFrame;
_local2++;
_local6++;
}
while (_local5 < _root.stb.length) {
_root.paws[_local2] = _root.stb[_local5].onEnterFrame;
delete _root.stb[_local5].onEnterFrame;
_local2++;
_local5++;
}
while (_local4 < _root.shots.length) {
_root.paws[_local2] = _root.shots[_local4].onEnterFrame;
delete _root.shots[_local4].onEnterFrame;
_local2++;
_local4++;
}
while (_local7 < _root.eshots.length) {
_root.paws[_local2] = _root.eshots[_local7].onEnterFrame;
delete _root.eshots[_local7].onEnterFrame;
_local2++;
e++;
}
while (_local3 < _root.xtr.length) {
_root.paws[_local2] = _root.xtr[_local3].onEnterFrame;
delete _root.xtr[_local3].onEnterFrame;
_local2++;
_local3++;
}
delete _root.daship.onEnterFrame;
delete _root.onEnterFrame;
_root.dead.stop();
_root.paused = true;
}
function unPause() {
_root.dindun.start(0, 9999);
var _local6 = 0;
var _local5 = 0;
var _local4 = 0;
var _local3 = 0;
var _local2 = 0;
while (_local6 < _root.ast.length) {
_root.ast[_local6].onEnterFrame = _root.paws[_local2];
_local2++;
_local6++;
}
while (_local5 < _root.stb.length) {
_root.stb[_local5].onEnterFrame = _root.paws[_local2];
_local2++;
_local5++;
}
while (_local4 < _root.shots.length) {
_root.shots[_local4].onEnterFrame = _root.paws[_local2];
_local2++;
_local4++;
}
while (_local3 < _root.xtr.length) {
_root.xtr[_local3].onEnterFrame = _root.paws[_local2];
_local2++;
_local3++;
}
_root.gameControl.onEnterFrame = _root.gameControl.main;
_root.daship.onEnterFrame = _root.moveShip;
_root.dead.play();
_root.onEnterFrame = _root.main;
_root.paused = false;
}
function novaBlast() {
var _local3 = _root.ast.length - 1;
var _local4 = 0;
var _local2 = _root.xtr.length - 1;
while (_local3 >= 0) {
killRoid(_root.ast[_local3], _local3);
_local3--;
}
while (_local4 < _root.stb.length) {
_root.stb[_local4].damage++;
_local4++;
}
while (_local2 >= 0) {
if ((_root.xtr[_local2].targetType == "canister") || (_root.xtr[_local2].targetType == "extraLife")) {
_root.xtr[_local2].play();
_root.xtr.splice(_local2, 1);
} else if ((_root.xtr[_local2].targetType == "comet") || (_root.xtr[_local2].targetType == "multiplier")) {
_root.xtr[_local2].removeMovieClip();
_root.xtr.splice(_local2, 1);
} else if (_root.xtr[_local2].targetType == "ufo") {
_root.boop.start();
_root.xtr[_local2].damage++;
if (_root.xtr[_local2].damage >= 4) {
_root.xtr[_local2].alive = false;
_root.xtr[_local2].play();
_root.xtr.splice(_local2, 1);
}
} else if (_root.xtr[_local2].targetType == "mine") {
_root.clang.start();
_root.xtr[_local2].damage++;
if (_root.xtr[_local2].damage >= 9) {
_root.xtr[_local2].alive = false;
_root.xtr[_local2].play();
_root.xtr.splice(_local2, 1);
}
}
_local2--;
}
_root.onEnterFrame = _root.novaMain;
}
function checkHighScore() {
var _local2 = 0;
while (_local2 < _root.hsList.data.scores.length) {
if (_root.score >= _root.hsList.data.scores[_local2][1]) {
return(_local2);
}
_local2++;
}
return(-1);
}
function checkBounds(object) {
if (object._x <= _root.xmin) {
object._x = object._x + (_root.xmax - 10);
}
if (object._x >= _root.xmax) {
object._x = object._x - (_root.xmax - 10);
}
if (object._y <= _root.ymin) {
object._y = object._y + (_root.ymax - 10);
}
if (object._y >= _root.ymax) {
object._y = object._y - (_root.ymax - 10);
}
}
function createAsteroid(factor, x, y) {
var _local3 = this.attachMovie("asteroid" + factor, "roid" + (this.currentDepth++), this.currentDepth);
_local3.xvel = 0;
_local3.yvel = 0;
_local3.targetType = "roid";
if (factor > 1) {
_local3.boost = factor * 0.5;
} else {
_local3.boost = 1;
}
_local3._x = x;
_local3._y = y;
_local3.rot = (_local3._rotation = mf(mr() * 360) - 180);
_local3.level = factor;
_local3.xvel = _root.glRoidVel[mf((mr() * 4) + 1)];
_local3.yvel = _root.glRoidVel[mf((mr() * 4) + 1)];
_local3.onEnterFrame = function () {
_root.checkBounds(this);
this._x = this._x + (this.xvel * this.boost);
this._y = this._y + (this.yvel * this.boost);
this._rotation = this._rotation + ((this.rot / 60) * this.level);
};
return(_local3);
}
function createSteelBall(x, y) {
var _local3 = this.attachMovie("steelBall", "ball" + (this.currentDepth++), this.currentDepth);
_local3.xvel = 0;
_local3.yvel = 0;
_local3.maxvel = 10;
_local3.targetType = "ball";
_local3.level = 1;
_local3.damage = 0;
_local3.xvel = _root.glRoidVel[mf(mr() * 6)];
_local3.yvel = _root.glRoidVel[mf(mr() * 6)];
_local3._x = x;
_local3._y = y;
_local3.onEnterFrame = function () {
_root.checkBounds(this);
this._x = this._x + this.xvel;
this._y = this._y + this.yvel;
};
return(_local3);
}
function makeShip(long, weapon, mgun, retros, luck, shield) {
this.attachMovie("ship", "daship", _root.currentDepth++);
this.panel.shieldbar._width = shield / 2;
this.daship._x = 320;
this.daship._y = 230;
this.daship.bounds = this.daship._width;
this.daship.tempInvincibleCounter = 60;
this.daship.booster._visible = 0;
this.daship.hasLuck = 0;
this.daship.shieldPower = shield;
this.daship.mGun = mgun;
this.daship.shotDist = long;
this.daship.thrust = 0.5;
this.daship.weaponType = weapon;
this.daship.angle = 0;
this.daship.decay = Math.ceil(retros);
this.daship.maxvel = 8;
this.daship.xvel = 0;
this.daship.yvel = 0;
this.daship.timer = 0;
this.daship.weaponTimer = 5;
this.shots = new Array();
this.daship.onEnterFrame = moveShip;
}
function moveShip() {
if (this.tempInvincibleCounter > 0) {
this.tempInvincibleCounter--;
this.bounds = this.shield._width + 12;
this.shield._visible = true;
} else if (Key.isDown(32) && (this.shieldPower > 1)) {
this.shield._visible = true;
this.bounds = this.shield._width + 12;
this.shieldPower = this.shieldPower - 0.66;
_root.panel.shieldbar._width = this.shieldPower / 2;
} else {
this.bounds = this._width;
this.shield._visible = false;
}
if (Key.isDown(17) && (this.timer == 0)) {
switch (this.weaponType) {
case 1 :
_root.shootTshot(this);
break;
default :
_root.shootRshot(this);
}
} else if (!Key.isDown(17)) {
this.timer = 0;
}
if (Key.isDown(39)) {
this._rotation = this._rotation + 10;
} else if (Key.isDown(37)) {
this._rotation = this._rotation - 10;
}
if (Key.isDown(38)) {
this.xvel = this.xvel + (this.thrust * ms(this._rotation * (mp / 180)));
this.yvel = this.yvel + (this.thrust * mc(this._rotation * (mp / 180)));
} else {
this.xvel = this.xvel * this.decay;
this.yvel = this.yvel * this.decay;
}
this.speed = msr((this.xvel * this.xvel) + (this.yvel * this.yvel));
if (this.speed > this.maxvel) {
this.xvel = this.xvel * (this.maxvel / this.speed);
this.yvel = this.yvel * (this.maxvel / this.speed);
}
this._y = this._y - this.yvel;
this._x = this._x + this.xvel;
_root.checkBounds(this);
}
function shootRshot(ship) {
if ((_root.shots.length < 18) && (ship.timer == 0)) {
if (!ship.mGun) {
ship.timer = 1;
}
_root.shot.start();
_root.shots.push(_root.attachMovie("rshot", "r" + (_root.currentDepth++), _root.currentDepth));
var _local4 = _root.shots.length - 1;
var _local2 = _root.shots[_local4];
_local2.id = _local4;
_local2.angle = ship._rotation;
_local2.xvel = (8 * ms((mp / 180) * _local2.angle)) + ship.xvel;
_local2.yvel = (-8 * mc((mp / 180) * _local2.angle)) - ship.yvel;
_local2.alive = 28 * ship.shotDist;
_local2._x = ship._x + (ms(ship._rotation * _root.rads) * 12);
_local2._y = ship._y + ((-mc(ship._rotation * _root.rads)) * 12);
_local2.ship = ship;
_local2.onEnterFrame = _root.fireLaser;
}
}
function shootTshot(ship) {
if ((_root.shots.length < 36) && (ship.timer == 0)) {
if (!ship.mGun) {
ship.timer = 1;
}
_root.shot.start();
_root.shots.push(_root.attachMovie("rshot", "r" + (_root.currentDepth++), _root.currentDepth));
_root.shots.push(_root.attachMovie("rshot", "r" + (_root.currentDepth++), _root.currentDepth));
_root.shots.push(_root.attachMovie("rshot", "r" + (_root.currentDepth++), _root.currentDepth));
var _local3 = _root.shots[_root.shots.length - 1];
var _local5 = _root.shots[_root.shots.length - 2];
var _local4 = _root.shots[_root.shots.length - 3];
_local3.id = _root.shots.length - 1;
_local5.id = _root.shots.length - 2;
_local4.id = _root.shots.length - 3;
_local3.angle = ship._rotation + 7;
_local5.angle = ship._rotation;
_local4.angle = ship._rotation - 7;
_local3.xvel = (8 * ms((mp / 180) * _local3.angle)) + ship.xvel;
_local5.xvel = (8 * ms((mp / 180) * _local5.angle)) + ship.xvel;
_local4.xvel = (8 * ms((mp / 180) * _local4.angle)) + ship.xvel;
_local3.yvel = (-8 * mc((mp / 180) * _local3.angle)) - ship.yvel;
_local5.yvel = (-8 * mc((mp / 180) * _local5.angle)) - ship.yvel;
_local4.yvel = (-8 * mc((mp / 180) * _local4.angle)) - ship.yvel;
_local3.alive = (_local5.alive = (_local4.alive = 28 * ship.shotDist));
_local3._x = (_local5._x = (_local4._x = ship._x));
_local3._y = (_local5._y = (_local4._y = ship._y));
_local3.ship = (_local5.ship = (_local4.ship = ship));
_local3.onEnterFrame = (_local5.onEnterFrame = (_local4.onEnterFrame = _root.fireLaser));
}
}
function fireLaser() {
if (this.alive > 0) {
this.alive--;
this._x = this._x + this.xvel;
this._y = this._y + this.yvel;
_root.checkBounds(this);
} else {
if (this.ship._name == "daship") {
for (var _local3 in _root.shots) {
if (_root.shots[_local3] == this) {
_root.shots.splice(_local3, 1);
}
}
} else {
for (var _local3 in _root.eshots) {
if (_root.eshots[_local3] == this) {
_root.eshots.splice(_local3, 1);
}
}
}
this.removeMovieClip();
}
}
function killRoid(roid, i) {
if (roid.level < 3) {
newx = roid._x;
newy = roid._y;
var _local4 = mf((mr() * 2) + roid.level);
roid.level++;
var _local2 = 0;
while (_local2 < _local4) {
_root.ast.push(createAsteroid(roid.level, newx, newy));
_local2++;
}
}
roid.play();
_root.ast.splice(i, 1);
}
function killShip(ship) {
ship.play();
ship._name = "dead";
var _local2 = 1;
while (_local2 < 6) {
_root.panel["bonus" + _local2]._visible = false;
_local2++;
}
}
function checkComet(ship, bull, b) {
var _local2 = 0;
while (_local2 < 7) {
if (_root["comet" + _local2] && (md(_root["comet" + _local2]._x, _root["comet" + _local2]._y, bull._x, bull._y) < (_root["comet" + _local2]._width / 2))) {
delete _root["comet" + _local2].onEnterFrame;
_root["comet" + _local2].targetType = "dead";
_root.yeeha.start();
_root.shots.splice(b, 1);
bull.removeMovieClip();
switch (int(mr() * 10)) {
case 0 :
_root.bonus = _root.bonus + 500;
_root["comet" + _local2].gotoAndPlay("gohyaku");
break;
case 1 :
case 2 :
_root.bonus = _root.bonus + 1000;
_root["comet" + _local2].gotoAndPlay("sen");
break;
case 3 :
case 4 :
_root.bonus = _root.bonus + 2000;
_root["comet" + _local2].gotoAndPlay("nisen");
break;
case 5 :
case 6 :
_root.bonus = _root.bonus + 3000;
_root["comet" + _local2].gotoAndPlay("sanzen");
break;
case 7 :
case 8 :
_root.bonus = _root.bonus + 4000;
_root["comet" + _local2].gotoAndPlay("yonsen");
break;
case 9 :
_root.bonus = _root.bonus + 5000;
_root["comet" + _local2].gotoAndPlay("gosen");
}
_root["comet" + _local2]._name = "deadcomet" + _local2;
}
_local2++;
}
}
function checkHit(ship, roid) {
if (ship.shield._visible) {
if (roid.level == 1) {
return(md(roid._x, roid._y, daship._x, daship._y) < ((0.5 * roid._width) + 8));
}
return(md(roid._x, roid._y, daship._x, daship._y) < (0.5 * ship.bounds));
}
return(md(roid._x, roid._y, daship._x, daship._y) < mm(0.5 * ship.bounds, 0.5 * roid._width));
}
function checkShot(ship, roid, bull, b, i) {
if (md(roid._x, roid._y, bull._x, bull._y) < (roid._width / 2)) {
if (roid.targetType == "roid") {
killRoid(roid, i);
} else if (roid.targetType == "ball") {
_root.clang.start();
roid.damage++;
if ((roid.damage % 10) == 0) {
switch (mf(mr() * 4)) {
case 0 :
_root.score = _root.score + 100;
break;
case 1 :
_root.ast.push(createAsteroid(2, roid._x, roid._y));
_root.stb.splice(i, 1);
roid.removeMovieClip();
break;
case 2 :
roid.targetType = "dead";
roid.play();
_root.stb.splice(i, 1);
break;
case 3 :
_root.gameControl.makeMine(roid._x, roid._y);
_root.stb.splice(i, 1);
roid.removeMovieClip();
}
} else {
roid.yvel = roid.yvel + (-4 * mc((mp / 180) * bull.angle));
roid.xvel = roid.xvel + (4 * ms((mp / 180) * bull.angle));
}
} else if ((roid.targetType == "vortex") || (roid.targetType == "nova")) {
roid.targetType = "dead";
roid.alive = false;
roid.gotoAndPlay("death");
_root.xtr.splice(i, 1);
} else if (roid.targetType == "ufo") {
_root.boop.start();
roid.damage++;
if (roid.damage >= 4) {
_root.xtr.splice(i, 1);
roid.alive = false;
roid.targetType = "dead";
roid.play();
} else {
roid.yvel = roid.yvel + (-4 * mc((mp / 180) * bull.angle));
roid.xvel = roid.xvel + (2 * ms((mp / 180) * bull.angle));
}
} else if (roid.targetType == "mine") {
_root.clang.start();
roid.damage++;
if (roid.damage >= 9) {
roid.alive = false;
roid.play();
_root.xtr.splice(i, 1);
} else {
roid.yvel = roid.yvel + (-4 * mc((mp / 180) * bull.angle));
roid.xvel = roid.xvel + (4 * ms((mp / 180) * bull.angle));
}
} else if ((roid.targetType == "canister") || (roid.targetType == "extraLife")) {
roid.play();
_root.xtr.splice(i, 1);
} else if (roid.targetType == "multiplier") {
_root.panel.multiplierPanel.gotoAndStop(roid.multiValue);
_root.panel.multiplierPanel._visible = true;
_root.multihit.start();
_root.scoreMulti = roid.multiValue;
roid.removeMovieClip();
_root.xtr.splice(i, 1);
} else if (roid.targetType == "comet") {
checkComet(ship, bull, b);
_root.xtr.splice(i, 1);
}
_root.shots.splice(b, 1);
bull.removeMovieClip();
}
}
function checkCan() {
var _local2 = 0;
while (_local2 < 6) {
if (_root["bonusCan" + _local2]) {
return(true);
}
_local2++;
}
return(false);
}
function checkLives() {
if (_root.lives == 0) {
_root.blackBox.flag = false;
delete _root.onEnterFrame;
if (_root.cheat) {
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("badgameover");
};
} else {
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("gameover");
};
}
}
}
function isLucky(ship) {
if (ship.hasLuck && (mf(mr() * 3) == 1)) {
_root.sweet.start();
return(true);
}
return(false);
}
function cleanUp() {
for (var _local4 in _root.stb) {
_root.stb[_local4].removeMovieClip();
}
for (var _local3 in _root.ufo.shots) {
_root.ufo.shots[_local3].removeMovieClip();
}
for (x in _root.xtr) {
_root.xtr[x].removeMovieClip();
}
for (var _local5 in _root.shots) {
_root.shots[_local5].removeMovieClip();
}
var _local2 = 0;
while (_local2 < 7) {
_root["comet" + _local2].removeMovieClip();
_root["bonusCan" + _local2].removeMovieClip();
_local2++;
}
_root.gameControl.removeMovieClip();
_root.extraLife.removeMovieClip();
_root.mplier.removeMovieClip();
}
function main() {
if (_root.ast.length == 0) {
_root.genericIndexB++;
if (_root.genericIndexB >= 60) {
_root.dead.stop();
_root.daship.timer = -1;
_root.genericIndex = (_root.genericIndexB = 0);
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("bonusTally");
};
delete _root.onEnterFrame;
delete _root.daship.onEnterFrame;
_root.daship.booster._visible = false;
}
}
if (_root.bonus > 0) {
_root.genericIndex++;
if ((_root.genericIndex % 30) == 0) {
_root.bonus = _root.bonus - 20;
}
}
if (((!_root.daship) && (!_root.dead)) && (_root.lives > 0)) {
_root.makeShip(1, 0, 0, 1, 0, 60);
}
for (i in _root.ast) {
if (checkHit(_root.daship, _root.ast[i])) {
if ((!_root.daship.shield._visible) && (!isLucky(_root.daship))) {
killShip(_root.daship);
}
killRoid(_root.ast[i], i);
}
for (b in _root.shots) {
checkShot(_root.daship, _root.ast[i], _root.shots[b], b, i);
}
}
for (s in _root.stb) {
if (checkHit(_root.daship, _root.stb[s])) {
if ((!_root.daship.shield._visible) && (!isLucky(_root.daship))) {
killShip(_root.daship);
} else {
_root.clang.start();
_root.stb[s].damage++;
_root.daship.xvel = _root.daship.xvel * -1.5;
_root.daship.yvel = _root.daship.yvel * -1.5;
}
}
for (b in _root.shots) {
checkShot(_root.daship, _root.stb[s], _root.shots[b], b, s);
}
}
for (x in _root.xtr) {
if (checkHit(_root.daship, _root.xtr[x])) {
if (((_root.xtr[x].isEnemy && (_root.xtr[x].alive)) && (!_root.daship.shield._visible)) && (!isLucky(_root.daship))) {
killShip(_root.daship);
}
if (_root.xtr[x].targetType == "ufo") {
_root.boop.start();
_root.xtr[x].damage++;
if (_root.xtr[x].damage >= 4) {
_root.xtr[x].alive = false;
_root.xtr[x].play();
_root.xtr.splice(x, 1);
}
} else if ((_root.xtr[x].targetType == "vortex") || (_root.xtr[x].targetType == "nova")) {
_root.xtr[x].gotoAndPlay("death");
_root.xtr.splice(x, 1);
} else if (_root.xtr[x].targetType == "mine") {
_root.clang.start();
_root.xtr[x].damage++;
if (_root.xtr[x].damage >= 9) {
_root.xtr[x].alive = false;
_root.xtr[x].play();
_root.xtr.splice(x, 1);
}
}
}
for (b in _root.shots) {
checkShot(_root.daship, _root.xtr[x], _root.shots[b], b, x);
}
}
checkEx();
}
function novaMain() {
if (_root.shakeCounter > 0) {
_root.shakeCounter--;
if (_root.ast.length == 0) {
_root.genericIndexB++;
if (_root.genericIndexB >= 60) {
_root.dead.stop();
delete _root.onEnterFrame;
delete _root.daship.onEnterFrame;
_root.daship.timer = -1;
_root.genericIndex = (_root.genericIndexB = 0);
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("bonusTally");
};
}
}
if (_root.bonus > 0) {
_root.genericIndex++;
if ((_root.genericIndex % 30) == 0) {
_root.bonus = _root.bonus - 20;
}
}
if (((!_root.daship) && (!_root.dead)) && (_root.lives > 0)) {
_root.makeShip(1, 0, 0, 1, 0, 60);
}
for (i in _root.ast) {
if (checkHit(_root.daship, _root.ast[i])) {
if ((!_root.daship.shield._visible) && (!isLucky(_root.daship))) {
killShip(_root.daship);
}
killRoid(_root.ast[i], i);
}
for (b in _root.shots) {
checkShot(_root.daship, _root.ast[i], _root.shots[b], b, i);
}
_root.ast[i].xvel = _root.glShakeVel[mf(mr() * 8)];
_root.ast[i].yvel = _root.glShakeVel[mf(mr() * 8)];
}
for (s in _root.stb) {
if (checkHit(_root.daship, _root.stb[s])) {
if ((!_root.daship.shield._visible) && (!isLucky(_root.daship))) {
killShip(_root.daship);
} else {
_root.clang.start();
_root.stb[s].damage++;
_root.daship.xvel = _root.daship.xvel * -1.5;
_root.daship.yvel = _root.daship.yvel * -1.5;
}
}
for (b in _root.shots) {
checkShot(_root.daship, _root.stb[s], _root.shots[b], b);
}
_root.stb[s].xvel = _root.glShakeVel[mf(mr() * 8)];
_root.stb[s].yvel = _root.glShakeVel[mf(mr() * 8)];
}
for (x in _root.xtr) {
if ((_root.xtr[x].targetType == "mine") || (_root.xtr[x].targetType == "ufo")) {
_root.xtr[x].xvel = _root.glShakeVel[mf(mr() * 8)];
_root.xtr[x].yvel = _root.glShakeVel[mf(mr() * 8)];
}
if (checkHit(_root.daship, _root.xtr[x])) {
if ((_root.xtr[x].isEnemy && (_root.xtr[x].alive)) && (!isLucky(_root.daship))) {
killShip(_root.daship);
}
if (_root.xtr[x].targetType == "ufo") {
_root.boop.start();
_root.xtr[x].damage++;
if (_root.xtr[x].damage >= 4) {
_root.xtr[x].alive = false;
_root.xtr[x].play();
_root.xtr.splice(x, 1);
}
} else if ((_root.xtr[x].targetType == "vortex") || (_root.xtr[x].targetType == "nova")) {
_root.xtr[x].gotoAndPlay("death");
_root.xtr.splice(x, 1);
} else if (_root.xtr[x].targetType == "mine") {
_root.clang.start();
_root.xtr[x].damage++;
if (_root.xtr[x].damage >= 9) {
_root.xtr[x].alive = false;
_root.xtr[x].play();
_root.xtr.splice(x, 1);
}
}
}
for (b in _root.shots) {
checkShot(_root.daship, _root.xtr[x], _root.shots[b], b);
}
}
checkEx();
_root.daship.xvel = _root.glShakeVel[mf(mr() * 8)];
_root.daship.yvel = _root.glShakeVel[mf(mr() * 8)];
} else {
_root.onEnterFrame = _root.main;
_root.shakeCounter = 120;
}
}
function Game() {
stopAllSounds();
_root.genericIndex = 0;
_root.genericIndexB = 0;
_root.shakeCounter = 150;
_root.bonus = 2000;
_root.scoreMulti = 1;
_root.xmax = 640;
_root.xmin = 0;
_root.ymax = 490;
_root.ymin = 0;
_root.attachMovie("panel", "panel", 1000000000, {_x:0, _y:460});
_root.attachMovie("wall", "lwall", 1000000001, {_x:0, _y:0});
_root.attachMovie("wall", "rwall", 1000000002, {_x:615, _y:0});
_root.attachMovie("ceiling", "ceiling", 1000000003, {_x:0, _y:0});
_root.attachMovie("extrasControl", "gameControl", _root.currentDepth++, {_x:700, _y:0});
gameControl.onEnterFrame = function () {
this.main();
};
ast = new Array();
stb = new Array();
xtr = new Array();
ice = new Array();
pawz = new Array();
shots = new Array();
eshots = new Array();
var _local4 = 0;
var _local5 = 3 + mf(_root.wave / 4);
var _local3 = 0;
i = 0;
while (i < _local5) {
if (((mr() * 10) > 8) && (_local4 < 2)) {
_local4++;
stb[i] = new Object();
stb[i] = createSteelBall(mf(mr() * 640), mf(mr() * 100));
} else {
ast[_local3] = new Object();
ast[_local3] = createAsteroid(1, mf(mr() * 640), mf(mr() * 100));
_local3++;
}
i++;
}
if (!_root.daship) {
_root.makeShip(1, 0, 0, 1, 0, 60);
} else {
_root.makeship(_root.daship.shotDist, _root.daship.weaponType, _root.daship.mGun, _root.daship.decay, _root.daship.hasLuck, _root.daship.shieldPower);
}
_root.daship._x = 320;
_root.daship._y = 230;
_root.daship.timer = 0;
_root.daship.tempInvincibleCounter = 60;
_root.daship._visible = true;
_root.daship.onEnterFrame = _root.moveShip;
_root.dindun.start(0, 9999);
}
delete this.multiappear.onSoundComplete;
delete this.scoresplat.onSoundComplete;
delete this.newriff.onSoundComplete;
delete this.prettygood.onSoundComplete;
delete this.twonothins.onSoundComplete;
whee = new Game();
this.onEnterFrame = main;
Instance of Symbol 40 MovieClip [extrasControl] "cheatControl" in Frame 156
onClipEvent (keyDown) {
if ((Key.isDown(80) && (_root.paused == false)) && (pPressed == false)) {
pPressed = true;
_root.gamePause();
} else if ((Key.isDown(80) && (_root.paused == true)) && (pPressed == false)) {
pPressed = true;
_root.unPause();
}
if (Key.isDown(81)) {
delete _root.onEnterFrame;
_root.daship.removeMovieClip();
_root.blackBox.flag = false;
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("badgameover");
};
}
if (((Key.isDown(32) && (_root.daship)) && (!_root.paused)) && (!sPressed)) {
if (_root.daship.shieldPower >= 1) {
sPressed = true;
_root.shield.start();
} else {
_root.fail.start();
}
}
if (((Key.isDown(38) && (_root.daship)) && (!_root.paused)) && (!jPressed)) {
_root.jets.start(0, 99);
jPressed = (_root.daship.booster._visible = true);
}
}
onClipEvent (keyUp) {
if (!Key.isDown(80)) {
pPressed = false;
}
if (!Key.isDown(32)) {
sPressed = false;
}
if (!Key.isDown(38)) {
_root.jets.stop("jets");
jPressed = (_root.daship.booster._visible = false);
}
}
Frame 157
function tallyScores() {
_root.onEnterFrame = function () {
if (_root.blackBox._alpha <= 0) {
if (_root.bonus <= 0) {
delete _root.onEnterFrame;
_root.bonus = "";
_root.blackBox.flag = false;
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("game");
};
} else if (_root.bonus >= 500) {
_root.boop.start();
_root.bonus = _root.bonus - 500;
_root.score = _root.score + 500;
} else {
_root.boop.start();
_root.score = _root.score + bonus;
_root.bonus = 0;
}
_root.checkEx();
}
};
}
function newTallyScores() {
_root.onEnterFrame = function () {
if (_root.blackBox._alpha <= 0) {
if (_root.newBonus <= 0) {
delete _root.onEnterFrame;
_root.newBonus = "";
_root.blackBox.flag = false;
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("game");
};
} else if (_root.newBonus >= 500) {
_root.boop.start();
_root.newBonus = _root.newBonus - 500;
_root.score = _root.score + 500;
} else {
_root.boop.start();
_root.score = _root.score + newBonus;
_root.newBonus = 0;
}
_root.checkEx();
}
};
}
lastWave = wave;
wave++;
cleanUp();
newBonus = "";
stopAllSounds();
_root.dead.removeMovieClip();
_root.daship._visible = (bonusBox2._visible = (bonusBox4._visible = (bonusBox5._visible = false)));
_root.daship.xvel = (_root.daship.yvel = (_root.daship._rotation = 0));
delete _root.daship.onEnterFrame;
for (var b in _root.shots) {
_root.shots[b].removeMovieClip();
}
_root.prettygood.onSoundComplete = (_root.twonothins.onSoundComplete = function () {
delete this.onSoundComplete;
newTallyScores();
});
_root.scoresplat.onSoundComplete = function () {
delete this.onSoundComplete;
if (_root.newBonus == "") {
if (_root.bonus >= 10000) {
_root.prettygood.onSoundComplete = function () {
tallyScores();
};
_root.prettygood.start();
} else {
tallyScores();
}
} else if (_root.newBonus > 10000) {
_root.prettygood.start();
} else if (_root.newBonus <= 0) {
_root.twonothins.start();
} else {
newTallyScores();
}
};
_root.multiappear.onSoundComplete = function () {
delete this.onSoundComplete;
_root.newBonus = _root.scoreMulti * _root.bonus;
_root.scoresplat.start();
_root.bonusBox4._visible = true;
};
_root.newriff.onSoundComplete = function () {
delete this.onSoundComplete;
if (_root.scoreMulti > 1) {
_root.bonusBox2._visible = (_root.bonusBox5._visible = true);
_root.multiappear.start();
_root.bonusMulti.gotoAndStop(_root.scoreMulti);
} else {
_root.bonusBox2._visible = (_root.bonusBox5._visible = true);
_root.scoresplat.start();
}
};
_root.newriff.start();
Frame 158
_root.cleanUp();
_root.panel._visible = false;
_root.dead.removeMovieClip();
stopAllSounds();
for (var i in _root.ast) {
_root.ast[i].removeMovieClip();
}
Instance of Symbol 316 MovieClip [hiScore] "hiScoreEntry" in Frame 158
onClipEvent (load) {
this._visible = false;
}
onClipEvent (keyDown) {
if (((this._visible == true) && ((Key.getCode() >= 48) && (Key.getCode() <= 57))) || ((Key.getCode() >= 65) && (Key.getCode() <= 90))) {
_root.shot.start();
}
}
Instance of Symbol 40 MovieClip [extrasControl] in Frame 158
onClipEvent (load) {
delete _root.onEnterFrame;
_root.lastScore = _root.score;
gameResult = _root.checkHighScore();
if (gameResult >= 0) {
_root.highScoreName = "";
_root.gameOverLaugh.onSoundComplete = function () {
_root.hiScoreEntry._visible = true;
_root.yeeha.start();
Selection.setFocus(_root.hiScoreEntry.highScoreBox);
_root.hiScoreEntry.onEnterFrame = function () {
if (Key.isDown(13) && (gameResult != -1)) {
stopAllSounds();
newHighScore = new Array(_root.highScoreName, _root.score, _root.wave);
_root.hsList.data.scores = _root.hsList.data.scores.insert(gameResult, newHighScore);
_root.hsList.data.scores = _root.hsList.data.scores.slice(0, 10);
_root.hsList.flush();
gameResult = -1;
_root.allright.start();
_root.blackBox.flag = false;
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("main");
};
}
};
};
} else {
_root.gameOverLaugh.onSoundComplete = function () {
_root.blackBox.flag = false;
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("main");
};
};
}
_root.gameOverLaugh.start();
}
Frame 159
_root.cleanUp();
_root.panel._visible = false;
_root.dead.removeMovieClip();
_root.daship.removeMovieClip();
stopAllSounds();
for (var i in _root.ast) {
_root.ast[i].removeMovieClip();
}
Instance of Symbol 40 MovieClip [extrasControl] in Frame 159
onClipEvent (load) {
delete _root.onEnterFrame;
_root.daship.removeMovieClip();
_root.gameOverLaugh.onSoundComplete = function () {
_root.blackBox.flag = false;
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("main");
};
};
_root.gameOverLaugh.start();
}
Symbol 24 MovieClip [canister] Frame 1
stop();
Symbol 24 MovieClip [canister] Frame 2
delete this.onEnterFrame;
Symbol 24 MovieClip [canister] Frame 34
_root.score = _root.score + 50;
this.removeMovieClip();
Symbol 26 MovieClip [blackBox] Frame 1
stop();
this.flag = false;
Symbol 36 MovieClip Frame 1
loaderbar._xscale = (100 * (_root.getBytesLoaded() / _root.getBytesTotal())) + 0.1;
Symbol 36 MovieClip Frame 3
if (_root.getBytesLoaded() < _root.getBytesTotal()) {
this.gotoAndPlay(1);
} else {
stop();
_root.novaboom.start();
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("main");
};
}
Symbol 40 MovieClip [extrasControl] Frame 1
function reset() {
if (mf(mr() * 2)) {
this.bonusItem = 0;
}
if (mf(mr() * 2)) {
this.comet = 0;
}
if (mf(mr() * 2)) {
this.multiplier = 0;
}
if (mf(mr() * 3) == 0) {
this.ufo = 0;
}
if (mf((mr() * 10) + _root.wave) > 10) {
this.vortex = 0;
}
if (mf((mr() * 10) + _root.wave) > 11) {
this.mine = 0;
}
if (mf(mr() * 10) == 0) {
this.extraLife = 0;
}
if (mf((mr() * 10) + _root.wave) > 12) {
this.nova = 0;
}
this.counter = 0;
this.enemyCount = 0;
}
function resetPanel() {
if (_root.daship.mGun) {
_root.panel.bonus1._visible = true;
}
if (_root.daship.decay < 1) {
_root.panel.bonus2._visible = true;
}
if (_root.daship.hasLuck) {
_root.panel.bonus3._visible = true;
}
if (_root.daship.weaponType == 1) {
_root.panel.bonus4._visible = true;
}
if (_root.daship.shotDist > 1) {
_root.panel.bonus5._visible = true;
}
_root.panel.shieldbar._width = _root.daship.shieldPower / 2;
}
function makeCanister(type, num) {
this.bonusItem = 1;
if (int(mr() * 2)) {
_root.xtr.push(_root.attachMovie("canister", "bonusCan" + num, _root.currentDepth++, {_x:mr() * 630, _y:0}));
} else {
_root.xtr.push(_root.attachMovie("canister", "bonusCan" + num, _root.currentDepth++, {_x:0, _y:mr() * 470}));
}
_root["bonusCan" + num].targetType = "canister";
_root["bonusCan" + num].timer = 300;
_root["bonusCan" + num].bonusType = type;
_root["bonusCan" + num].xvel = _root.glRoidVel[mf(mr() * 6)];
_root["bonusCan" + num].yvel = _root.glRoidVel[mf(mr() * 6)];
_root["bonusCan" + num].onEnterFrame = function () {
this.timer--;
if (this.timer <= 0) {
this.play();
delete this.onEnterFrame;
}
if (_root.md(this._x, this._y, _root.daship._x, _root.daship._y) < this._width) {
_root.allright.start();
switch (this.bonusType) {
case 1 :
_root.daship.mGun = true;
break;
case 2 :
_root.daship.decay = 0.95;
break;
case 3 :
_root.daship.hasLuck = 1;
break;
case 4 :
_root.daship.weaponType = 1;
break;
case 5 :
_root.daship.shotDist = 1.5;
break;
case 6 :
_root.daship.shieldPower = mmi(_root.daship.shieldPower + 50, 101);
_root.panel.shieldbar._width = _root.daship.shieldPower / 2;
break;
case 7 :
_root.novaboom.start();
_root.novaBlast();
}
_root.panel["bonus" + this.bonusType]._visible = true;
this.removeMovieClip();
}
this._x = this._x + this.xvel;
this._y = this._y + this.yvel;
this._rotation = this._rotation + 5;
_root.checkBounds(this);
};
}
function makeComet(num) {
if (int(mr() * 2)) {
_root.xtr.push(_root.attachMovie("comet", "comet" + num, _root.currentDepth++, {_x:mr() * 630, _y:0}));
} else {
_root.xtr.push(_root.attachMovie("comet", "comet" + num, _root.currentDepth++, {_x:0, _y:mr() * 470}));
}
_root["comet" + num].timer = 300;
_root["comet" + num].targetType = "comet";
_root["comet" + num].onEnterFrame = function () {
this.timer--;
this._x = this._x + 4;
this._y = this._y + 4;
_root.checkBounds(this);
if (this.timer <= 0) {
_root.kieru.start();
this.removeMovieClip();
}
};
}
function makeMultiplier(type) {
this.multiplier = 1;
_root.xtr.push(_root.attachMovie("mplier", "mplier", _root.currentDepth++, {_x:(mr() * 560) + 40, _y:(mr() * 400) + 40}));
_root.multiappear.start();
_root.mplier.gotoAndStop(type);
_root.mplier.targetType = "multiplier";
_root.mplier.timer = 210;
_root.mplier.multiValue = type;
_root.mplier.onEnterFrame = function () {
this.timer--;
if (this.timer <= 0) {
_root.kieru.start();
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
function makeVortex(num) {
this.vortex = 1;
_root.xtr.push(_root.attachMovie("vortex", "vortex" + num, _root.currentDepth++, {_x:(mr() * 560) + 40, _y:(mr() * 400) + 40}));
_root["vortex" + num].alive = true;
_root["vortex" + num].isEnemy = true;
_root["vortex" + num].targetType = "vortex";
_root["vortex" + num].level = 3;
_root["vortex" + num].onEnterFrame = function () {
if (_root.daship && (this.alive)) {
if (_root.daship._x > this._x) {
_root.daship.xvel = _root.daship.xvel - 0.3;
if (_root.daship._y < this._y) {
_root.daship.yvel = _root.daship.yvel + 0.3;
} else {
_root.daship.yvel = _root.daship.yvel - 0.3;
}
}
if (_root.daship._x < this._x) {
_root.daship.xvel = _root.daship.xvel + 0.3;
if (_root.daship._y < this._y) {
_root.daship.yvel = _root.daship.yvel + 0.3;
} else {
_root.daship.yvel = _root.daship.yvel - 0.3;
}
}
}
};
}
function makeMine(x, y) {
this.mine = 1;
_root.xtr.push(_root.attachMovie("minegfx", "hMine", _root.currentDepth++, {_x:x, _y:y}));
_root.hMine.alive = true;
_root.hMine.isEnemy = true;
_root.hMine.targetType = "mine";
_root.hMine.level = 3;
_root.hMine.xvel = 0;
_root.hMine.yvel = 0;
_root.hMine.damage = 0;
_root.hMine.onEnterFrame = function () {
_root.checkBounds(this);
if (_root.daship && (this.alive)) {
if (_root.daship._x < this._x) {
this.xvel = mm(this.xvel - 0.3, -8);
if (_root.daship._y > this._y) {
this.yvel = mmi(this.yvel + 0.3, 8);
} else {
this.yvel = mm(this.yvel - 0.3, -8);
}
}
if (_root.daship._x > this._x) {
this.xvel = mmi(this.xvel + 0.3, 8);
if (_root.daship._y > this._y) {
this.yvel = mmi(this.yvel + 0.3, 8);
} else {
this.yvel = mm(this.yvel - 0.3, -8);
}
}
}
this._x = this._x + this.xvel;
this._y = this._y + this.yvel;
};
}
function makeNova(x, y) {
this.nova = true;
_root.xtr.push(_root.attachMovie("novagfx", "novaStar", _root.currentDepth++, {_x:x, _y:y}));
_root.novaStar.isEnemy = true;
_root.novaStar.targetType = "nova";
_root.novaStar.onEnterFrame = function () {
this.gotoAndStop(++this._currentframe);
};
}
function makeUFO() {
this.ufo = 1;
if (_root.wave < 7) {
_root.xtr.push(_root.attachMovie("ufobig", "ufo", _root.currentDepth++, {_x:0, _y:mf((mr() * 400) + 40)}));
} else {
_root.xtr.push(_root.attachMovie("ufosm", "ufo", _root.currentDepth++, {_x:0, _y:mf((mr() * 400) + 40)}));
}
_root.ufo.alive = true;
_root.ufo.isEnemy = true;
_root.ufo.shotCount = 0;
_root.ufo.targetType = "ufo";
_root.ufo.xvel = 2;
_root.ufo.yvel = 0;
_root.ufo._rotation = 0;
_root.ufo.damage = 0;
if (_root.wave > 5) {
_root.ufo.sRate = 5;
} else {
_root.ufo.sRate = 10;
}
_root.ufo.shots = new Array();
_root.alarm.start();
_root.ufo.onEnterFrame = function () {
this.shotCount++;
if (((this.shotCount % this.sRate) == 0) && (_root.daship)) {
this.shootEshot(this);
}
this._x = this._x + this.xvel;
this._y = this._y + this.yvel;
_root.checkBounds(this);
if (this._x >= 627) {
this.removeMovieClip();
}
if (this.yvel > 0) {
this.yvel = this.yvel - 0.25;
} else if (this.yvel < 0) {
this.yvel = this.yvel + 0.25;
}
if (this.xvel > 2) {
this.xvel = this.xvel - 0.25;
} else if (this.xvel < 2) {
this.xvel = this.xvel + 0.25;
}
if (this._y < 70) {
this._y++;
} else if (this._y > 430) {
this._y--;
}
for (var _local4 in _root.ast) {
if (_root.md(this._x, this._y, _root.ast[_local4]._x, _root.ast[_local4]._y) < (0.5 * this._width)) {
_root.killRoid(_root.ast[_local4], _local4);
}
for (var _local3 in _root.eshots) {
if (_root.md(_root.eshots[_local3]._x, _root.eshots[_local3]._y, _root.ast[_local4]._x, _root.ast[_local4]._y) < (0.5 * _root.ast[_local4]._width)) {
_root.killRoid(_root.ast[_local4], _local4);
_root.eshots[_local3].removeMovieClip();
_root.eshots.splice(_local3, 1);
}
}
}
for (var _local3 in _root.eshots) {
if (_root.md(_root.eshots[_local3]._x, _root.eshots[_local3]._y, _root.daship._x, _root.daship._y) < (0.5 * _root.daship._width)) {
if ((!_root.daship.shield._visible) && (!_root.isLucky(_root.daship))) {
_root.killShip(_root.daship);
}
_root.eshots[_local3].removeMovieClip();
_root.eshots.splice(_local3, 1);
}
}
};
}
function main() {
this.counter++;
if ((this.counter % 30) == 0) {
switch (mf(mr() * 50)) {
case 0 :
if (this.bonusItem == 0) {
if (((!_root.canShower) && (mr() > (1 - (0.01 * _root.wave)))) && (_root.wave >= 5)) {
this.bonusItem = 1;
_root.canShower = 1;
_root.canAppear.start();
this.makeCanister(int((mr() * 7) + 1), 0);
this.makeCanister(int((mr() * 7) + 1), 1);
this.makeCanister(int((mr() * 7) + 1), 2);
this.makeCanister(int((mr() * 7) + 1), 3);
this.makeCanister(int((mr() * 7) + 1), 4);
} else {
this.bonusItem = 1;
_root.canAppear.start();
this.makeCanister(int((mr() * 7) + 1), 0);
return(undefined);
}
}
case 1 :
if (this.comet == 0) {
if (((!_root.meteorShower) && (mr() > (1 - (0.01 * _root.wave)))) && (_root.wave >= 5)) {
_root.cometsnd.start();
_root.meteorShower = 1;
this.comet = 1;
this.makeComet(0);
this.makeComet(1);
this.makeComet(2);
this.makeComet(3);
this.makeComet(4);
this.makeComet(5);
this.makeComet(6);
} else {
_root.cometsnd.start();
this.comet = 1;
this.makeComet(0);
}
}
return(undefined);
case 2 :
if (this.extraLife == 0) {
this.extraLife = 1;
_root.xtr.push(_root.attachMovie("extraLife", "extraLife", _root.currentDepth++, {_x:mr() * 630, _y:480}));
_root.extraLife.timer = 240;
_root.extraLife.targetType = "extraLife";
_root.extraLife.xvel = int(((mr() * 2) - 1) * 2);
if (_root.extraLife.xvel > 0) {
_root.extraLife.yvel = -1.5;
} else {
_root.extraLife.yvel = 1.5;
}
_root.helpme.start();
_root.extraLife.onEnterFrame = function () {
this.timer--;
if (this.timer <= 0) {
this.play();
delete this.onEnterFrame;
}
if (_root.md(this._x, this._y, _root.daship._x, _root.daship._y) < this._width) {
_root.lives++;
_root.thankgoodness.start();
this.removeMovieClip();
}
this._x = this._x + this.xvel;
this._y = this._y + this.yvel;
this._rotation = this._rotation + 35;
_root.checkBounds(this);
if (this.timer <= 0) {
this.removeMovieClip();
}
};
}
return(undefined);
case 3 :
if (this.multiplier == 0) {
this.makeMultiplier(int((mr() * 3) + 2));
return(undefined);
}
case 4 :
if ((this.vortex == 0) && (this.enemyCount < (1 + mf(_root.wave / 3)))) {
_root.vortexsnd.start();
var _local3 = 0;
while (_local3 < mf(_root.wave / 6)) {
this.makeVortex(_local3);
_local3++;
}
return(undefined);
}
case 5 :
if (((this.mine == 0) && (_root.wave > 7)) && (this.enemyCount < (1 + mf(_root.wave / 5)))) {
_root.mine.start();
this.makeMine(mf(mr() * 640, 0));
return(undefined);
}
case 6 :
if (((this.nova == 0) && (_root.wave > 2)) && (this.enemyCount < (1 + mf(_root.wave / 5)))) {
this.makeNova((mr() * 580) + 40, (mr() * 400) + 40);
return(undefined);
}
case 7 :
if (!((this.ufo == 0) && (this.enemyCount < (1 + mf(_root.wave / 5))))) {
break;
}
this.makeUFO();
return(undefined);
}
return(undefined);
}
}
var mp = Math.PI;
var mpow = Math.pow;
var msr = Math.sqrt;
var mf = Math.floor;
var mr = Math.random;
var mm = Math.max;
var mmi = Math.min;
var ma = Math.abs;
var ms = Math.sin;
var mc = Math.cos;
reset();
resetPanel();
sPressed = (pPressed = (jPressed = false));
stop();
Symbol 57 Button
on (release, keyPress "<Enter>") {
Mouse.hide();
this.gotoAndStop(1);
}
Symbol 58 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 4
stop();
Symbol 65 Button
on (release, keyPress "<Enter>") {
Mouse.hide();
_root.cheat = true;
_root.wave = Math.min(cheatWave, 40);
_root.lives = Math.min(cheatLives, 10);
stopAllSounds();
_root.yo.start();
_root.blackBox.onEnterFrame = function () {
_root.fadeTrans("game");
};
}
Symbol 70 Button
on (release) {
Mouse.hide();
this.gotoAndStop(1);
}
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 4
stop();
Symbol 79 MovieClip Frame 1
stop();
Symbol 79 MovieClip Frame 5
stop();
Symbol 85 MovieClip [asteroid3] Frame 1
stop();
Symbol 85 MovieClip [asteroid3] Frame 2
delete this.onEnterFrame;
Symbol 85 MovieClip [asteroid3] Frame 34
_root.score = _root.score + 100;
this.removeMovieClip();
Symbol 90 MovieClip [asteroid1] Frame 1
stop();
Symbol 90 MovieClip [asteroid1] Frame 2
delete this.onEnterFrame;
Symbol 90 MovieClip [asteroid1] Frame 34
_root.score = _root.score + 50;
this.removeMovieClip();
Symbol 93 MovieClip [asteroid2] Frame 1
stop();
Symbol 93 MovieClip [asteroid2] Frame 2
delete this.onEnterFrame;
Symbol 93 MovieClip [asteroid2] Frame 34
_root.score = _root.score + 100;
this.removeMovieClip();
Symbol 107 MovieClip [comet] Frame 1
stop();
Symbol 107 MovieClip [comet] Frame 61
stop();
this.removeMovieClip();
Symbol 107 MovieClip [comet] Frame 121
stop();
this.removeMovieClip();
Symbol 107 MovieClip [comet] Frame 181
stop();
this.removeMovieClip();
Symbol 107 MovieClip [comet] Frame 241
stop();
this.removeMovieClip();
Symbol 107 MovieClip [comet] Frame 300
stop();
this.removeMovieClip();
Symbol 107 MovieClip [comet] Frame 361
stop();
this.removeMovieClip();
Symbol 114 MovieClip [extraLife] Frame 1
stop();
Symbol 114 MovieClip [extraLife] Frame 2
delete this.onEnterFrame;
Symbol 114 MovieClip [extraLife] Frame 88
this.removeMovieClip();
Symbol 119 MovieClip [mplier] Frame 1
stop();
Symbol 124 MovieClip [mulitplierPanel] Frame 1
stop();
Instance of Symbol 124 MovieClip [mulitplierPanel] "multiplierPanel" in Symbol 151 MovieClip [panel] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 138 MovieClip "bonus1" in Symbol 151 MovieClip [panel] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 141 MovieClip "bonus2" in Symbol 151 MovieClip [panel] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 144 MovieClip "bonus3" in Symbol 151 MovieClip [panel] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 147 MovieClip "bonus4" in Symbol 151 MovieClip [panel] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 150 MovieClip "bonus5" in Symbol 151 MovieClip [panel] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 151 MovieClip [panel] Frame 2
stop();
_root.gameControl.resetPanel();
Symbol 162 MovieClip [ship] Frame 1
stop();
Symbol 162 MovieClip [ship] Frame 2
delete this.onEnterFrame;
Symbol 162 MovieClip [ship] Frame 92
_root.lives--;
_root.checkLives();
this.removeMovieClip();
Symbol 165 MovieClip [steelBall] Frame 1
stop();
Symbol 165 MovieClip [steelBall] Frame 2
delete this.onEnterFrame;
Symbol 165 MovieClip [steelBall] Frame 34
_root.score = _root.score + 100;
this.removeMovieClip();
Symbol 198 MovieClip Frame 32
stop();
Symbol 201 MovieClip [minegfx] Frame 1
stop();
Symbol 201 MovieClip [minegfx] Frame 2
delete this.onEnterFrame;
this.targetType = (this._name = "deadmine");
Symbol 201 MovieClip [minegfx] Frame 34
_root.score = _root.score + 700;
this.removeMovieClip();
Symbol 223 MovieClip [ufobig] Frame 1
function shootEshot() {
if (_root.eshots.length < 3) {
_root.eshots.push(_root.attachMovie("eshot", "e" + (_root.currentDepth++), _root.currentDepth, {_x:this._x, _y:this._y}));
var _local4 = _root.eshots.length - 1;
var _local3 = _root.eshots[_local4];
_local3.id = _local4;
o = _root.daship._x - this._x;
h = _root.md(this._x, this._y, _root.daship._x, _root.daship._y);
if (this._y > _root.daship._y) {
_local3.angle = ((180 * ma(o / h)) / mp) + (5 * _root.glShakeVel[mf(mr() * 8)]);
} else {
_local3.angle = ((-((180 * ma(o / h)) / mp)) - 180) + (5 * _root.glShakeVel[mf(mr() * 8)]);
}
_local3.xvel = (mf((mr() * 2) + 4) * ms((mp / 180) * _local3.angle)) + this.xvel;
_local3.yvel = ((-mf((mr() * 2) + 4)) * mc((mp / 180) * _local3.angle)) - this.yvel;
_local3.alive = 50;
_local3.ship = this;
_local3.onEnterFrame = _root.fireLaser;
}
}
stop();
var mp = Math.PI;
var ms = Math.sin;
var mc = Math.cos;
var mr = Math.random;
var mf = Math.floor;
var ma = Math.asin;
Symbol 223 MovieClip [ufobig] Frame 2
delete this.onEnterFrame;
Symbol 223 MovieClip [ufobig] Frame 34
_root.score = _root.score + 1000;
this.removeMovieClip();
Symbol 243 MovieClip [ufosm] Frame 1
function shootEshot() {
if (_root.eshots.length < 5) {
_root.eshots.push(_root.attachMovie("eshot", "e" + (_root.currentDepth++), _root.currentDepth, {_x:this._x, _y:this._y}));
var _local4 = _root.eshots.length - 1;
var _local3 = _root.eshots[_local4];
_local3.id = _local4;
o = _root.daship._x - this._x;
h = _root.md(this._x, this._y, _root.daship._x, _root.daship._y);
if (this._y > _root.daship._y) {
_local3.angle = ((180 * ma(o / h)) / mp) + (5 * _root.glShakeVel[mf(mr() * 8)]);
} else {
_local3.angle = ((-((180 * ma(o / h)) / mp)) - 180) + (5 * _root.glShakeVel[mf(mr() * 8)]);
}
_local3.xvel = (mf((mr() * 2) + 4) * ms((mp / 180) * _local3.angle)) + this.xvel;
_local3.yvel = ((-mf((mr() * 2) + 4)) * mc((mp / 180) * _local3.angle)) - this.yvel;
_local3.alive = 50;
_local3.ship = this;
_local3.onEnterFrame = _root.fireLaser;
}
}
stop();
var mp = Math.PI;
var ms = Math.sin;
var mc = Math.cos;
var mr = Math.random;
var mf = Math.floor;
var ma = Math.asin;
Symbol 243 MovieClip [ufosm] Frame 2
delete this.onEnterFrame;
Symbol 243 MovieClip [ufosm] Frame 34
_root.score = _root.score + 1000;
this.removeMovieClip();
Symbol 264 MovieClip [vortex] Frame 21
gotoAndPlay (1);
Symbol 264 MovieClip [vortex] Frame 22
this.alive = false;
this.targetType = (this._name = "deadvort");
delete this.onEnterFrame;
Symbol 264 MovieClip [vortex] Frame 35
_root.score = _root.score + 500;
this.removeMovieClip();
Symbol 297 MovieClip [novagfx] Frame 1
stop();
Symbol 297 MovieClip [novagfx] Frame 49
stop();
_root.novaboom.start();
_root.novaBlast();
this.removeMovieClip();
Symbol 297 MovieClip [novagfx] Frame 50
delete this.onEnterFrame;
Symbol 297 MovieClip [novagfx] Frame 82
_root.score = _root.score + 1000;
this.removeMovieClip();
Symbol 316 MovieClip [hiScore] Frame 1
stop();