Frame 1
Stage.showMenu = false;
_global.mouseOnly = true;
if (generalKeyListener == undefined) {
generalKeyListener = new Object();
Key.addListener(generalKeyListener);
}
generalKeyListener.onKeyDown = function () {
if (Key.isDown(16)) {
}
if (Key.isDown(80)) {
if (debugmode == true) {
nextLevel();
}
}
if (Key.isDown(70)) {
_global.mouseOnly = !mouseOnly;
}
};
Frame 3
stop();
Frame 6
function makeCustomMouse() {
Mouse.hide();
attachMovie("mousePointer", "mp", 7);
mp.onEnterFrame = customMouse;
}
function customMouse() {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
function pausegame() {
mypause = !mypause;
myMouseIsDown = false;
pausescreen();
if (mypause) {
disableship();
} else {
enableship();
}
light.pausemethod();
mymovelayer.theOC.pausemethod();
mymovelayer.theENV.pausemethod();
mymovelayer.currentLevel.pausemethod();
mymovelayer.currentMGDHit.pausemethod();
var _local1 = new Array();
_local1 = _local1.concat(baddie_array, object_array, hit_array, shot_array, wall_array, mg_array, mghit_array, shipbullet_array);
i = 0;
while (i < _local1.length) {
_local1[i].pausemethod();
i++;
}
}
function forcepause(shouldpause) {
mypause = !shouldpause;
pausegame();
}
function pausescreen() {
if (mypause) {
attachpausescreen();
} else {
removepausescreen();
}
}
function attachpausescreen() {
myscenelayer.attachMovie("PauseMenu", "mypausemenu", 5);
myscenelayer.mypausemenu._x = 200;
myscenelayer.mypausemenu._y = 130;
myscenelayer.mypausemenu._alpha = 80;
_quality = "HIGH";
}
function removepausescreen() {
myscenelayer.mypausemenu.removeMovieClip();
}
function startgame() {
attachmain();
makeship();
setupship();
Key.addListener(pauseListener);
beginLevel(mylevel);
}
function endgame() {
stopAllSounds();
removeship();
removemain();
clearLevel();
Key.removeListener(pauseListener);
Mouse.removeListener(shipMouseListener);
}
function backtomenu() {
endgame();
gotoAndStop ("menu");
}
function gotowon() {
endgame();
playSound(konamizedS);
gotoAndStop ("won");
attachMovie("credits", "thecredits", 3);
}
function restart() {
clearLevel();
disableship();
setupship();
beginLevel(mylevel);
}
function clearLevel() {
baddie_array = new Array();
object_array = new Array();
hit_array = new Array();
shot_array = new Array();
wall_array = new Array();
mg_array = new Array();
mghit_array = new Array();
clearshipbullet_array();
roomenemies = 0;
pausescreen();
removeLevel();
Mouse.show();
forcepause(false);
darkLevel(false);
myscenelayer.currentCUTSCENE.removeMovieClip();
myscenelayer.bossHP.removeMovieClip();
mp.removeMovieClip();
}
function clearshipbullet_array() {
while (shipbullet_array.length > 0) {
removeMovieClip(shipbullet_array.pop());
}
shipbullet_array = new Array();
}
function nextLevel() {
if (mylevel == -1) {
mylevel = 1;
} else {
mylevel++;
}
if (mylevel == 7) {
theship.maxhp = 150;
} else if (mylevel == 13) {
theship.maxhp = 200;
}
clearLevel();
Key.removeListener(pauseListener);
Key.addListener(pauseListener);
gotbonusbox = false;
setupship();
beginLevel(mylevel);
}
function attachmain() {
attachMovie("mainbar", "statusbar", 5);
statusbar._y = 262.6;
attachMovie("scenelayer", "myscenelayer", 6);
}
function removemain() {
statusbar.removeMovieClip();
myscenelayer.removeMovieClip();
}
function beginLevel(levelNum) {
makeCustomMouse();
_quality = "HIGH";
if (levelNum == -1) {
generateLevel("leveltesthit", "leveltestfg", "leveltestmg", "leveltestbg", "leveltestobjects");
} else if (levelNum == 1) {
playSound(konamizedS);
generateLevel("level4hit", "level4fg", "level4mg", "level4bg", "level4objects");
addcutscene("howtoplay1");
} else if (levelNum == 2) {
playSound(konamizedS);
generateLevel("level2hit", "level2fg", "level2mg", "level2bg", "level2objects");
addcutscene("howtoplay2");
} else if (levelNum == 3) {
playSound(konamizedS);
generateLevel("level5hit", "level5fg", "level5mg", "level5bg", "level5objects");
addcutscene("howtoplay3");
} else if (levelNum == 4) {
playSound(konamizedS);
generateLevel("level12hit", "level12fg", "level12mg", "level12bg", "level12objects");
addcutscene("howtoplay5");
} else if (levelNum == 5) {
playSound(konamizedS);
generateLevel("level13hit", "level13fg", "level13mg", "level13bg", "level13objects");
addcutscene("controls");
} else if (levelNum == 6) {
streamCheck();
playSound(stratosphereS);
generateLevel("levelboss1hit", "levelboss1fg", "levelboss1mg", "levelboss1bg", "levelboss1objects");
addcutscene("boss1");
} else if (levelNum == 7) {
streamCheck();
playSound(memoriesS);
generateLevel("level7hit", "level7fg", "level7mg", "level7bg", "level7objects");
addcutscene("ocean1");
} else if (levelNum == 8) {
streamCheck();
playSound(memoriesS);
generateLevel("level16hit", "level16fg", "level16mg", "level16bg", "level16objects");
addcutscene("controls2");
} else if (levelNum == 9) {
streamCheck();
playSound(memoriesS);
generateLevel("level15hit", "level15fg", "level15mg", "level15bg", "level15objects");
addcutscene("ocean2");
} else if (levelNum == 10) {
streamCheck();
playSound(memoriesS);
generateLevel("level14hit", "level14fg", "level14mg", "level14bg", "level14objects");
} else if (levelNum == 11) {
streamCheck();
playSound(memoriesS);
generateLevel("level17hit", "level17fg", "level17mg", "level17bg", "level17objects");
} else if (levelNum == 12) {
playSound(stratosphereS);
generateLevel("levelboss2hit", "levelboss2fg", "levelboss2mg", "levelboss2bg", "levelboss2objects");
addcutscene("boss2");
} else if (levelNum == 13) {
streamCheck();
playSound(overdriveS);
generateLevel("level18hit", "level18fg", "level18mg", "level18bg", "level18objects");
addcutscene("asteroid1");
} else if (levelNum == 14) {
streamCheck();
playSound(overdriveS);
generateLevel("level19hit", "level19fg", "level19mg", "level19bg", "level19objects");
addcutscene("cannons");
} else if (levelNum == 15) {
streamCheck();
playSound(overdriveS);
generateLevel("level20hit", "level20fg", "level20mg", "level20bg", "level20objects");
addcutscene("asteroid2");
} else if (levelNum == 16) {
streamCheck();
playSound(overdriveS);
generateLevel("level21hit", "level21fg", "level21mg", "level21bg", "level21objects");
} else if (levelNum == 17) {
streamCheck();
playSound(overdriveS);
generateLevel("level22hit", "level22fg", "level22mg", "level22bg", "level22objects");
addcutscene("asteroid3");
} else if (levelNum == 18) {
streamCheck();
playSound(stratosphereS);
generateLevel("levelboss3hit", "levelboss3fg", "levelboss3mg", "levelboss3bg", "levelboss3objects");
addcutscene("boss3");
} else {
gotowon();
}
}
function generateLevel(level, fgd, mgd, bgd, enemy) {
mymovelayer.attachMovie("theENVclip", "theENV", 7);
mymovelayer.theENV.pausemethod = howtopause;
mymovelayer.attachMovie("objectclip", "theOC", 6);
mymovelayer.theOC.onEnterFrame = hitTestActions;
mymovelayer.theOC.compileArray = makeOCArray;
mymovelayer.theOC.pausemethod = howtopause;
mymovelayer.attachMovie(level, "currentLevel", 5);
mymovelayer.currentLevel.onEnterFrame = hitTestActions;
mymovelayer.currentLevel.compileArray = makeCLArray;
mymovelayer.currentLevel.pausemethod = howtopause;
mymovelayer.attachMovie("MGDHit", "currentMGDHit", 4);
mymovelayer.currentMGDHit.onEnterFrame = hitTestActions;
mymovelayer.currentMGDHit.compileArray = makeMGDHitArray;
mymovelayer.currentMGDHit.pausemethod = howtopause;
mymovelayer.attachMovie("bulletclip", "theBL", 9);
mymovelayer.attachMovie(fgd, "currentFGD", 10);
mymovelayer.attachMovie(mgd, "currentMGD", 3);
mymovelayer.attachMovie(bgd, "currentBGD", 2);
mymovelayer.attachMovie(enemy, "currentENEMY", 1);
mymovelayer.currentENEMY._visible = false;
}
function addcutscene(sceneName) {
myscenelayer.attachMovie(sceneName, "currentCUTSCENE", 6);
if (myscenelayer.currentCUTSCENE != undefined) {
_root.forcepause(true);
Key.removeListener(pauseListener);
myscenelayer.currentCUTSCENE.onMouseUp = removecutscene;
}
}
function removecutscene() {
Key.addListener(pauseListener);
_root.forcepause(false);
this.removeMovieClip();
}
function removeLevel() {
_quality = "HIGH";
mymovelayer.theOC.removeMovieClip();
mymovelayer.theENV.removeMovieClip();
mymovelayer.theBL.removeMovieClip();
mymovelayer.currentLevel.removeMovieClip();
mymovelayer.currentFGD.removeMovieClip();
mymovelayer.currentMGD.removeMovieClip();
mymovelayer.currentMGDHit.removeMovieClip();
mymovelayer.currentBGD.removeMovieClip();
mymovelayer.currentENEMY.removeMovieClip();
}
function darkLevel(makedark) {
if (makedark) {
attachMovie("darkness", "light", 4);
light.onEnterFrame = followMouse;
light.pausemethod = howtopause;
} else {
light.removeMovieClip();
}
}
function followMouse() {
this._x = _xmouse;
this._y = _ymouse;
}
function createBullet() {
gun1S.start(0, 0);
shipbulletDepth = mymovelayer.theBL.getNextHighestDepth();
nm = ["bl" + shipbulletDepth];
mymovelayer.theBL.attachMovie("bullet_gr", nm, shipbulletDepth);
sb = mymovelayer.theBL[nm];
sb.moveblx = Math.cos(myangle * (Math.PI/180));
sb.movebly = Math.sin(myangle * (Math.PI/180)) * -1;
sb.moveblx = sb.moveblx * 1000;
sb.movebly = sb.movebly * 1000;
sb.moveblx = Math.round(sb.moveblx);
sb.movebly = Math.round(sb.movebly);
sb.moveblx = sb.moveblx / 1000;
sb.movebly = sb.movebly / 1000;
sb._x = (sb.startx = theship._x + (sb.moveblx * 15));
sb._y = (sb.starty = theship._y + (sb.movebly * 15));
sb.speed = 7;
sb.onEnterFrame = moveBullet;
sb.pausemethod = howtopause;
shipbullet_array.push(sb);
}
function moveBullet() {
this._x = this._x + (this.moveblx * this.speed);
this._y = this._y + (this.movebly * this.speed);
if ((Math.abs(this._x - theship._x) > 215) || (Math.abs(this._y - theship._y) > 165)) {
removeBullet(this);
}
}
function removeBullet(bullet) {
if (bullet == undefined) {
trace("ERROR: removeBullet bullet undefined");
}
ble = _root.attachObject("bullet_gr_explode");
ble._x = bullet._x;
ble._y = bullet._y;
ble._rotation = random(360);
ble.bullethitactions = _root.ignorebullet;
ble.shiphitactions = _root.ignoreship;
rb = 0;
while (rb < shipbullet_array.length) {
if (bullet == shipbullet_array[rb]) {
shipbullet_array[rb].removeMovieClip();
shipbullet_array.splice(rb, 1);
}
rb++;
}
}
function createEnemyBullet(myname, myangle, myx, myy) {
bl = attachShot(myname);
moveblx = Math.cos(myangle * (Math.PI/180));
movebly = Math.sin(myangle * (Math.PI/180)) * -1;
moveblx = moveblx * 1000;
movebly = movebly * 1000;
moveblx = Math.round(moveblx);
movebly = Math.round(movebly);
moveblx = moveblx / 1000;
movebly = movebly / 1000;
bl._x = (bl.startx = myx + (moveblx * 35));
bl._y = (bl.starty = myy + (movebly * 35));
bl.moveblx = moveblx;
bl.movebly = movebly;
bl.speed = 4;
bl.onEnterFrame = moveEnemyBullet;
bl._rotation = -myangle;
bl.mydamage = 20;
bl.shiphitactions = removebulletandhurt;
bl.bullethitactions = ignorebullet;
bl.pausemethod = howtopause;
}
function moveEnemyBullet() {
this._x = this._x + (this.moveblx * this.speed);
this._y = this._y + (this.movebly * this.speed);
if ((Math.abs(this._x - this.startx) > 400) || (Math.abs(this._y - this.starty) > 300)) {
this.removeMovieClip();
}
}
function createGloopDrop() {
dr = attachtoMGDHit(this.mydrop);
dr._x = this._x;
dr._y = (dr.starty = this._y);
dr.airtime = getTimer();
dr.speed = 0;
dr.onEnterFrame = moveGloopDrop;
dr.mydamage = 15;
dr.shiphitactions = removebulletandhurt;
dr.bullethitactions = removebothbullets;
dr.pausemethod = howtopause;
}
function moveGloopDrop() {
this.speed = this.speed + 0.2;
this._y = this._y + this.speed;
if ((this._y - this.starty) > 250) {
this.removeMovieClip();
}
}
function removebothbullets() {
removeBullet(this.hitbybullet);
this.removeMovieClip();
}
function removebulletandhurt() {
theship.hurtship(this.mydamage);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
theship.px = 0;
theship.py = 0;
this.removeMovieClip();
}
function ignorebullet() {
}
function ignoreship() {
}
function attachBaddie(myname, myx, myy) {
baddieDepth = mymovelayer.theOC.getNextHighestDepth();
bd = ["enemy" + baddieDepth];
mymovelayer.theOC.attachMovie(myname, bd, baddieDepth);
mymovelayer.theOC[bd]._x = myx;
mymovelayer.theOC[bd]._y = myy;
mymovelayer.theOC[bd].pausemethod = howtopause;
baddie_array.push(mymovelayer.theOC[bd]);
roomenemies++;
return(mymovelayer.theOC[bd]);
}
function attachObject(myname) {
objectDepth = mymovelayer.theOC.getNextHighestDepth();
bd = ["object" + objectDepth];
mymovelayer.theOC.attachMovie(myname, bd, objectDepth);
mymovelayer.theOC[bd].pausemethod = howtopause;
object_array.push(mymovelayer.theOC[bd]);
return(mymovelayer.theOC[bd]);
}
function attachtoHit(myname) {
hitDepth = mymovelayer.currentLevel.getNextHighestDepth();
ht = ["hit" + hitDepth];
mymovelayer.currentLevel.attachMovie(myname, ht, hitDepth);
mymovelayer.currentLevel[ht].pausemethod = howtopause;
hit_array.push(mymovelayer.currentLevel[ht]);
return(mymovelayer.currentLevel[ht]);
}
function attachShot(myname) {
shotDepth = mymovelayer.theOC.getNextHighestDepth();
sh = ["projectile" + shotDepth];
mymovelayer.theOC.attachMovie(myname, sh, shotDepth);
mymovelayer.theOC[sh].pausemethod = howtopause;
shot_array.push(mymovelayer.theOC[sh]);
return(mymovelayer.theOC[sh]);
}
function attachWall(myname) {
wallDepth = mymovelayer.currentMGDHit.getNextHighestDepth();
wl = ["wall" + wallDepth];
mymovelayer.currentMGDHit.attachMovie(myname, wl, wallDepth);
wall_array.push(mymovelayer.currentMGDHit[wl]);
return(mymovelayer.currentMGDHit[wl]);
}
function attachtoMGD(myname) {
mgDepth = mymovelayer.currentMGD.getNextHighestDepth();
mg = ["mg" + mgDepth];
mymovelayer.currentMGD.attachMovie(myname, mg, mgDepth);
mg_array.push(mymovelayer.currentMGD[mg]);
return(mymovelayer.currentMGD[mg]);
}
function attachtoMGDHit(myname) {
mghitDepth = mymovelayer.currentMGDHit.getNextHighestDepth();
mgh = ["mgh" + mghitDepth];
mymovelayer.currentMGDHit.attachMovie(myname, mgh, mghitDepth);
mghit_array.push(mymovelayer.currentMGDHit[mgh]);
return(mymovelayer.currentMGDHit[mgh]);
}
function howtopause() {
if (this.beforepause == undefined) {
this.beforepause = this.onEnterFrame;
}
if (mypause) {
this.onEnterFrame = null;
if (this.animationpause != undefined) {
this.animationpause();
}
} else if (!mypause) {
this.onEnterFrame = this.beforepause;
if (this.animationpause != undefined) {
this.animationpause();
}
}
}
function turnRed(mc) {
var _local2 = [1, 0, 0, 0, 200, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1];
var _local1 = new flash.filters.ColorMatrixFilter(_local2);
mc.filters = [_local1];
}
function turnNormal(mc) {
mc.filters = null;
}
function playSound(sound) {
if (prevSound != sound) {
stopAllSounds();
sound.start(0, 999);
}
prevSound = sound;
}
function refreshFPS() {
temp = Math.round(fps);
if (temp > 45) {
temp = 45;
}
statusbar.frameRate_txt.text = "fps: " + temp;
adjustQuality();
}
function refreshSomeThings() {
statusbar.enemiestext.text = "Enemies: " + roomenemies;
if (_global.mouseOnly) {
statusbar.controltext.text = "Control: Mouse Only";
} else {
statusbar.controltext.text = "Control: Mouse+Keyboard";
}
}
function adjustQuality() {
if (fps < 26) {
if (this._quality == "HIGH") {
this._quality = "MEDIUM";
}
} else if (fps < 20) {
if (this._quality == "MEDIUM") {
this._quality = "LOW";
}
} else if (fps > 44) {
if (this._quality == "MEDIUM") {
this._quality = "HIGH";
}
} else if (fps > 40) {
if (this._quality == "LOW") {
this._quality = "MEDIUM";
}
}
}
function streamCheck() {
stratosphereS.attachSound("stratosphere");
memoriesS.attachSound("sea of memories");
overdriveS.attachSound("overdrive");
}
function goalactions() {
if (roomenemies < 0) {
trace("Error: Roomenemies: " + roomenemies);
backtomenu();
}
if (roomenemies == 0) {
this.gotoAndStop("flashy");
if (dsf == undefined) {
goalbeepS.start(0, 0);
}
dsf = 0;
if (this.hitTest(mymovelayer._x + theship._x, mymovelayer._y + theship._y, false)) {
goalpulseS.stop("goalpulse");
dsf = undefined;
nextLevel();
}
} else {
this.gotoAndStop("normal");
goalpulseS.stop("goalpulse");
}
}
function goalpause() {
if (mypause) {
this.myflashy.stop();
} else {
this.myflashy.play();
}
}
function randombubble() {
if ((k == undefined) || (k == 100)) {
k = 0;
bl = attachObject("bubble");
bl._x = (theship._x - 200) + random(400);
bl._y = theship._y + 200;
bl._rotation = 0;
bl._xscale = (bl._yscale = 50 + random(100));
bl.myHP = 1;
bl.onEnterFrame = _root.movebubble;
bl.shiphitactions = _root.bubblebounce;
bl.bullethitactions = _root.bubblehurt;
}
k++;
}
function randomasteroid() {
if ((d == undefined) || (d == 60)) {
d = 0;
as = attachObject("asteroid");
as._x = (theship._x + 150) + random(200);
as._y = theship._y - 200;
as._rotation = 0;
as._xscale = (as._yscale = 50 + random(100));
as.myHP = 3;
as.onEnterFrame = _root.moveasteroid;
as.shiphitactions = _root.asteroidbounce;
as.bullethitactions = _root.asteroidhurt;
}
d++;
}
function randomasteroid2() {
if ((k == undefined) || (k == 50)) {
k = 0;
as = attachObject("asteroid");
as._x = (theship._x + 150) + random(200);
as._y = theship._y - 200;
as._rotation = 0;
as._xscale = (as._yscale = 50 + random(100));
as.myHP = 3;
as.onEnterFrame = _root.moveasteroid;
as.shiphitactions = _root.asteroidbounce;
as.bullethitactions = _root.asteroidhurt;
as.px = -3;
as.py = 3;
}
k++;
}
function hitTestActions() {
mymx = mymovelayer._x;
mymy = mymovelayer._y;
theshipx = theship.x;
theshipy = theship.y;
shiphittestx = theshipx + mymx;
shiphittesty = theshipy + mymy;
var _local4 = false;
this.compileArray();
var _local2 = new Array();
_local2 = this.myobjects_array;
if (_local2 == undefined) {
trace("ERROR: Layer without eval_array");
}
if (this.hitTest(shiphittestx, shiphittesty, true)) {
i = 0;
while (i < (_local2.length + 1)) {
if (_local2[i].hitTest(shiphittestx, shiphittesty, true)) {
if (_local2[i].shiphitactions == undefined) {
theship.bounceandhurt(10);
} else {
_local2[i].shiphitactions();
}
_local4 = true;
}
if ((i == _local2.length) && (!_local4)) {
theship.bounceandhurt(10);
}
i++;
}
} else {
theship.consecutiveHits = 0;
}
j = 0;
while (j < shipbullet_array.length) {
bl = shipbullet_array[j];
bulletx = bl._x + mymx;
bullety = bl._y + mymy;
var _local3 = false;
if (this.hitTest(bulletx, bullety, true)) {
i = 0;
while (i < (_local2.length + 1)) {
if (_local2[i].hitTest(bulletx, bullety, true)) {
if (_local2[i].bullethitactions == undefined) {
removeBullet(bl);
bulletexplodeS.start(0.03, 0);
} else {
_local2[i].hitbybullet = bl;
_local2[i].bullethitactions();
}
_local3 = true;
}
if ((i == _local2.length) && (!_local3)) {
removeBullet(bl);
bulletexplodeS.start(0.03, 0);
}
i++;
}
}
j++;
}
}
function makeCLArray() {
var _local2 = new Array();
this.myobjects_array = _local2.concat(hit_array, wall_array);
}
function makeMGDHitArray() {
var _local2 = new Array();
this.myobjects_array = _local2.concat(mghit_array);
}
function makeOCArray() {
var _local2 = new Array();
this.myobjects_array = _local2.concat(baddie_array, object_array, shot_array);
}
function gloop() {
if (this.k == undefined) {
this.k = random(99);
}
if (this.k >= 100) {
this.k = 0;
this.createGloopDrop();
}
this.k++;
}
function gloopwallbounce() {
gloophitS.start(0.005, 0);
theship.px = theship.px * -2;
theship.py = theship.py * -2;
capshipspeed(9);
}
function gloopwallhurt() {
this.myHP--;
removeBullet(this.hitbybullet);
bulletexplodeS.start(0.03, 0);
if (this.myHP <= 0) {
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this.gotoAndStop("explode");
} else {
this.gotoAndStop("hit");
}
}
function watercurrentbounce() {
if (this.angle == undefined) {
if (this._rotation < 0) {
this.angle = Math.round(this._rotation * -1);
} else {
this.angle = Math.round(360 - this._rotation);
}
movecrx = Math.cos(this.angle * (Math.PI/180));
movecry = Math.sin(this.angle * (Math.PI/180)) * -1;
movecrx = movecrx * 1000;
movecry = movecry * 1000;
movecrx = Math.round(movecrx);
movecry = Math.round(movecry);
movecrx = movecrx / 1000;
movecry = movecry / 1000;
this.movecrx = movecrx;
this.movecry = movecry;
this.speed = 1;
}
if (!theship.deadzone) {
theship.px = theship.px * 0.9;
theship.py = theship.py * 0.9;
}
theship.px = theship.px + (this.movecrx * this.speed);
theship.py = theship.py + (this.movecry * this.speed);
capshipspeed(8);
}
function watercurrentpause() {
if (mypause) {
this.mycurrent.stop();
} else {
this.mycurrent.play();
}
}
function blowupwallswitchhurt() {
removeBullet(this.hitbybullet);
this.bullethitactions = undefined;
this.gotoAndStop("activated");
m = wall_array.length - 1;
while (m >= 0) {
if (wall_array[m] != undefined) {
wl = wall_array[m];
switchhitS.start(0.02, 0);
cwe = _root.attachtoMGD("cavewall_explode");
cwe._x = wl._x;
cwe._y = wl._y;
cwe._xscale = wl._xscale;
cwe._yscale = wl._yscale;
temp_rotation = wl._rotation;
wl._rotation = 0;
cwe._width = wl._width;
cwe._height = wl._height;
cwe._rotation = temp_rotation;
wl.removeMovieClip();
wall_array.splice(m, 1);
m = -1;
}
m--;
}
}
function bonusboxhurt() {
this.myHP--;
removeBullet(this.hitbybullet);
bulletexplodeS.start(0.03, 0);
if (this.myHP <= 0) {
smb3_coinS.start(0, 0);
bbe = _root.attachtoHit("bonusbox_explode");
bbe._x = this._x;
bbe._y = this._y;
bbe._xscale = this._xscale;
bbe._yscale = this._yscale;
bbe.bullethitactions = _root.ignorebullet;
bbe.shiphitactions = _root.ignoreship;
gotbonusbox = true;
bonusboxnum++;
this.removeMovieClip();
}
}
function makeship() {
mymovelayer.attachMovie("ship", "myship", 8);
theship = mymovelayer.myship;
theship.maxhp = 100;
}
function setupship() {
theship.gotoAndStop("normal");
theship.onEnterFrame = mainship;
theship.focusEnabled = true;
theship.invulnerableTime = getTimer();
theship.hurtship = hurtship;
theship.invulnerableship = invulnerableship;
theship.aimship = aimship;
theship.moveship = moveship;
theship.removeship = removeship;
theship.bounceship = bounceship;
theship.bounceandhurt = bounceandhurt;
theship.mykeyboardmove = mykeyboardmove;
theship.mymousemove = mymousemove;
theship.killship = killship;
Mouse.removeListener(shipMouseListener);
Mouse.addListener(shipMouseListener);
this.deadzone = false;
theship.xmax = 4;
theship.ymax = 4;
theship.myhploss = 20;
theship.x = (theship.prevx = theship._x);
theship.y = (theship.prevy = theship._y);
theship.px = 0;
theship.py = 0;
theship.myhp = theship.maxhp;
statusbar.myhpbar._width = (theship.myhp / theship.maxhp) * 110;
}
function removeship() {
this.removeMovieClip();
}
function disableship() {
theship.onEnterFrame = null;
theship.focusEnabled = false;
theship.hurtship = null;
theship.invulnerableship = null;
theship.aimship = null;
theship.moveship = null;
theship.removeship = null;
theship.killship = null;
theship.ship_gr.myshipflame.stop();
Mouse.removeListener(shipMouseListener);
}
function enableship() {
theship.gotoAndStop("normal");
theship.onEnterFrame = mainship;
theship.focusEnabled = true;
theship.hurtship = hurtship;
theship.invulnerableship = invulnerableship;
theship.aimship = aimship;
theship.moveship = moveship;
theship.removeship = removeship;
theship.mykeyboardmove = mykeyboardmove;
theship.mymousemove = mymousemove;
theship.killship = killship;
theship.ship_gr.myshipflame.play();
Mouse.removeListener(shipMouseListener);
Mouse.addListener(shipMouseListener);
}
function mainship() {
this.moveship();
scrollBGD();
this.aimship();
}
function setcoordinates(myx, myy) {
theship._x = (theship.x = myx);
theship._y = (theship.y = myy);
}
function capshipspeed(max) {
if (theship.px > max) {
theship.px = max;
} else if (theship.px < (-max)) {
theship.px = -max;
}
if (theship.py > max) {
theship.py = max;
} else if (theship.py < (-max)) {
theship.py = -max;
}
}
function aimship() {
x = this.center_script._xmouse;
y = this.center_script._ymouse * -1;
angle = Math.atan(y / x) / (Math.PI/180);
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
if ((angle > 90) && (angle < 270)) {
this.ship_gr._yscale = -Math.abs(this._xscale);
} else {
this.ship_gr._yscale = Math.abs(this._xscale);
}
angle = Math.round(angle);
statusbar.angletext.text = "Angle: " + angle;
_root.myangle = angle;
this.ship_gr._rotation = angle * -1;
}
function moveship() {
if (_global.mouseOnly) {
this.mymousemove();
} else {
this.mykeyboardmove();
}
this.px = this.px * 0.95;
this.py = this.py * 0.95;
if (Math.abs(this.px) < 0.12) {
this.px = 0;
}
if (Math.abs(this.py) < 0.12) {
this.py = 0;
}
if ((getTimer() - this.invulnerableTime) > 1000) {
this._alpha = 100;
}
abspx = Math.abs(this.px);
abspy = Math.abs(this.py);
if ((abspx < 0.5) && (abspy < 0.5)) {
with (this.ship_gr.myshipflame) {
_xscale = 50;
_yscale = 50;
_x = -32.9;
_y = -2.6;
}
} else if ((abspx < 3) && (abspy < 3)) {
with (this.ship_gr.myshipflame) {
_xscale = 75;
_yscale = 75;
_x = -38.7;
_y = -4.4;
}
} else {
with (this.ship_gr.myshipflame) {
_xscale = 100;
_yscale = 100;
_x = -42.6;
_y = -6.7;
}
}
this.x = this.x + this.px;
this.y = this.y + this.py;
this._x = Math.floor(this.x);
this._y = Math.floor(this.y);
this.prevx = this.x;
this.prevy = this.y;
this.prevpx = this.px;
this.prevpy = this.py;
}
function bounceandhurt(damage) {
this.bounceship();
this.hurtship(damage);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
this.consecutiveHits++;
if (this.consecutiveHits >= 10) {
trace("stuck in wall");
this.killship();
}
}
function bounceship() {
if ((Math.abs(this.px) > 16) || (Math.abs(this.py) > 16)) {
this.px = this.px * -0.5;
this.py = this.py * -0.5;
} else if ((Math.abs(this.px) > 1) || (Math.abs(this.py) > 1)) {
this.x = this.prevx;
this.y = this.prevy;
this.px = this.px * -1.3;
this.py = this.py * -1.3;
} else {
this.px = this.px * -2;
this.py = this.py * -2;
}
}
function mykeyboardmove() {
if (this.px < this.xmax) {
if (Key.isDown(39) || (Key.isDown(68))) {
this.px = this.px + 0.4;
}
}
if (this.px > (-this.xmax)) {
if (Key.isDown(37) || (Key.isDown(65))) {
this.px = this.px - 0.4;
}
}
if (this.py < this.ymax) {
if (Key.isDown(40) || (Key.isDown(83))) {
this.py = this.py + 0.4;
}
}
if (this.py > (-this.ymax)) {
if (Key.isDown(38) || (Key.isDown(87))) {
this.py = this.py - 0.4;
}
}
this.deadzone = false;
}
function mymousemove() {
x = this.center_script._xmouse;
y = this.center_script._ymouse * -1;
if (this.px > (-this.xmax)) {
if (x < -45) {
this.px = this.px - 0.2;
}
if (x <= -80) {
this.px = this.px - 0.2;
}
}
if (this.px < this.xmax) {
if (x > 45) {
this.px = this.px + 0.2;
}
if (x >= 80) {
this.px = this.px + 0.2;
}
}
if (this.py > (-this.ymax)) {
if (y > 45) {
this.py = this.py - 0.2;
}
if (y >= 80) {
this.py = this.py - 0.2;
}
}
if (this.py < this.ymax) {
if (y < -45) {
this.py = this.py + 0.2;
}
if (y <= -80) {
this.py = this.py + 0.2;
}
}
if ((Math.abs(x) < 60) && (Math.abs(y) < 60)) {
this.deadzone = true;
this.px = this.px * 0.9;
this.py = this.py * 0.9;
} else {
this.deadzone = false;
}
}
function hurtship(damage) {
if ((getTimer() - this.invulnerableTime) > 1000) {
this.myhp = this.myhp - damage;
statusbar.myhpbar._width = (this.myhp / this.maxhp) * 110;
if (this.myhp <= 1) {
statusbar.myhpbar._width = 0;
if (!debugmode) {
_root.disableship();
this.gotoAndStop("explode");
return(undefined);
}
}
this.invulnerableship();
}
}
function invulnerableship() {
this.invulnerableTime = getTimer();
this._alpha = 50;
}
function killship() {
this.consecutiveHits = 0;
this.myhp = 0;
statusbar.myhpbar._width = 0;
if (!debugmode) {
_root.disableship();
this.bounceandhurt = null;
this.onEnterFrame = null;
this.gotoAndStop("explode");
return(undefined);
}
}
function scrollBGD() {
mymovelayer._x = Math.round(200 - theship._x);
mymovelayer._y = Math.round(140 - theship._y);
mymovelayer.currentBGD._x = Math.round(200 - (mymovelayer._x / 2));
mymovelayer.currentBGD._y = Math.round(200 - (mymovelayer._y / 2));
}
function moveclovite() {
this._rotation = this._rotation + 1;
if (this._rotation == 360) {
this._rotation = 0;
}
}
function clovitebounce() {
theship.px = theship.px * -1.5;
theship.py = theship.py * -1.5;
capshipspeed(8);
theship.hurtship(20);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
}
function clovitehurt() {
this.myHP--;
clovitehitS.start(0, 0);
removeBullet(this.hitbybullet);
if (this.myHP <= 0) {
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this.gotoAndStop("explode");
} else {
this.gotoAndStop("hit");
}
}
function moveblastite() {
if (this.px == undefined) {
this.px = 0;
this.py = 0;
}
if (Math.abs(this._x - theship._x) > 1) {
if (this._x > theship._x) {
this.px = this.px - 0.5;
} else if (this._x < theship._x) {
this.px = this.px + 0.5;
}
}
if (Math.abs(this._y - theship._y) > 1) {
if (this._y > theship._y) {
this.py = this.py - 0.5;
} else if (this._y < theship._y) {
this.py = this.py + 0.5;
}
}
if (this.px > 3) {
this.px = 3;
} else if (this.px < -3) {
this.px = -3;
}
if (this.py > 3) {
this.py = 3;
} else if (this.py < -3) {
this.py = -3;
}
this._x = this._x + Math.round(this.px);
this._y = this._y + Math.round(this.py);
}
function blastitebounce() {
theship.px = theship.px * -1.5;
theship.py = theship.py * -1.5;
capshipspeed(8);
theship.hurtship(20);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
}
function blastitebounce2() {
theship.px = theship.px + this.px;
theship.py = theship.py + this.py;
capshipspeed(8);
theship.hurtship(20);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
}
function blastitebounce3() {
theship.hurtship(50);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
theship.py = theship.py - 2;
capshipspeed(8);
}
}
function blastitehurt() {
this.myHP--;
clovitehitS.start(0, 0);
removeBullet(this.hitbybullet);
if (this.myHP <= 0) {
this.onEnterFrame = moveblastite;
this.beforepause = this.onEnterFrame;
this.bullethitactions = undefined;
this.shiphitactions = _root.blastitebounce2;
this.gotoAndStop("explode");
} else {
this.gotoAndStop("hit");
}
}
function blastitepause() {
if (mypause) {
this.myexplode.stop();
} else {
this.myexplode.play();
}
}
function movechompy() {
if ((Math.abs(this._x - theship._x) < 225) && (Math.abs(this._y - theship._y) < 170)) {
this.gotoAndStop("chomping");
if (this.px == undefined) {
this.px = 0;
this.py = 0;
}
x = (-this._x) + theship._x;
y = (-this._y) + theship._y;
angle = Math.atan(y / x) / (Math.PI/180);
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
if ((angle > 90) && (angle < 270)) {
this._yscale = -Math.abs(this._xscale);
} else {
this._yscale = Math.abs(this._xscale);
}
angle = Math.round(angle);
this._rotation = angle;
theshipx = theship._x;
theshipy = theship._y;
if (Math.abs(this._x - theshipx) > 1) {
if (this._x > theshipx) {
this.px = this.px - 0.5;
} else if (this._x < theshipx) {
this.px = this.px + 0.5;
}
}
if (Math.abs(this._y - theshipy) > 1) {
if (this._y > theshipy) {
this.py = this.py - 0.5;
} else if (this._y < theshipy) {
this.py = this.py + 0.5;
}
}
if (this.px > 2) {
this.px = 2;
} else if (this.px < -2) {
this.px = -2;
}
if (this.py > 2) {
this.py = 2;
} else if (this.py < -2) {
this.py = -2;
}
this._x = this._x + Math.round(this.px);
this._y = this._y + Math.round(this.py);
} else {
this.gotoAndStop("normal");
}
}
function chompybounce() {
theship.px = theship.px + this.px;
theship.py = theship.py + this.py;
capshipspeed(6);
theship.hurtship(20);
}
function chompyhurt() {
this.px = this.px * -2;
this.py = this.py * -2;
this.myHP--;
chompyhitS.start(0, 0);
removeBullet(this.hitbybullet);
if (this.myHP <= 0) {
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this.gotoAndStop("explode");
} else {
this.gotoAndStop("hit");
}
}
function chompypause() {
if (mypause) {
this.mychomping.stop();
} else {
this.mychomping.play();
}
}
function moveswimmy() {
this._rotation = this._rotation + 1;
if (this._rotation == 360) {
this._rotation = 0;
}
}
function swimmybounce() {
theship.px = theship.px * -1.5;
theship.py = theship.py * -1.5;
capshipspeed(8);
theship.hurtship(20);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
}
function swimmyhurt() {
this.myHP--;
this._rotation = this._rotation - 2;
clovitehitS.start(0, 0);
removeBullet(this.hitbybullet);
if (this.myHP <= 0) {
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this.gotoAndStop("explode");
} else {
this.gotoAndPlay("hit");
}
}
function swimmypause() {
if (mypause) {
this.myswimming.stop();
} else {
this.myswimming.play();
}
}
function movepuffite() {
this._rotation = this._rotation + 1;
if (this._rotation == 360) {
this._rotation = 0;
}
}
function puffitebounce() {
theship.px = theship.px * -1.5;
theship.py = theship.py * -1.5;
capshipspeed(8);
theship.hurtship(20);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
}
function puffitehurt() {
this.myHP--;
puffitehitS.start(0, 0);
removeBullet(this.hitbybullet);
if (this.myHP <= 0) {
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this.gotoAndStop("explode");
this.createEnemyBullet("puffite_bullet", 0, this._x, this._y);
this.createEnemyBullet("puffite_bullet", 45, this._x, this._y);
this.createEnemyBullet("puffite_bullet", 90, this._x, this._y);
this.createEnemyBullet("puffite_bullet", 135, this._x, this._y);
this.createEnemyBullet("puffite_bullet", 180, this._x, this._y);
this.createEnemyBullet("puffite_bullet", 225, this._x, this._y);
this.createEnemyBullet("puffite_bullet", 270, this._x, this._y);
this.createEnemyBullet("puffite_bullet", 315, this._x, this._y);
} else {
this.gotoAndStop("hit");
this.dx = (-this._x) + theship._x;
this.dy = this._y - theship._y;
this.angle = Math.atan(this.dy / this.dx) / (Math.PI/180);
if (this.dx < 0) {
this.angle = this.angle + 180;
}
if ((this.dx >= 0) && (this.dy < 0)) {
this.angle = this.angle + 360;
}
this.angle = Math.round(this.angle);
this.createEnemyBullet("puffite_bullet", this.angle, this._x, this._y);
}
}
function moveblotch() {
this._rotation = this._rotation + 1;
if (this._rotation == 360) {
this._rotation = 0;
}
}
function blotchbounce() {
theship.px = theship.px * -1.5;
theship.py = theship.py * -1.5;
capshipspeed(8);
theship.hurtship(20);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
}
function blotchhurt() {
this.myHP--;
blotchhitS.start(0, 0);
removeBullet(this.hitbybullet);
if (this.myHP <= 0) {
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this.gotoAndStop("explode");
} else {
this.gotoAndStop("hit");
}
}
function blotchshoot() {
if (((Math.abs(this._x - theship._x) < 225) && (Math.abs(this._y - theship._y) < 175)) && (!mypause)) {
blotchshootS.start(0, 0);
this.dx = (-this._x) + theship._x;
this.dy = this._y - theship._y;
this.angle = Math.atan(this.dy / this.dx) / (Math.PI/180);
if (this.dx < 0) {
this.angle = this.angle + 180;
}
if ((this.dx >= 0) && (this.dy < 0)) {
this.angle = this.angle + 360;
}
this.angle = Math.round(this.angle);
this.createEnemyBullet("blotch_bl", this.angle, this._x, this._y);
}
}
function moveblotch2() {
this._rotation = this._rotation - this._parent.rotateRate;
if (this._rotation == 360) {
this._rotation = 0;
}
this.myangle = this.myangle + this._parent.rotateRate;
this._x = Math.round(100 * Math.cos(this.myangle * (Math.PI/180)));
this._y = Math.round(100 * Math.sin(this.myangle * (Math.PI/180)));
}
function blotchshoot2() {
if (((Math.abs((this._x + this._parent._x) - theship._x) < 350) && (Math.abs((this._y + this._parent._y) - theship._y) < 300)) && (!mypause)) {
blotchshootS.start(0, 0);
this.dx = (-(this._parent._x + this._x)) + theship._x;
this.dy = (this._parent._y + this._y) - theship._y;
this.angle = Math.atan(this.dy / this.dx) / (Math.PI/180);
if (this.dx < 0) {
this.angle = this.angle + 180;
}
if ((this.dx >= 0) && (this.dy < 0)) {
this.angle = this.angle + 360;
}
this.angle = Math.round(this.angle);
this.createEnemyBullet("blotch_bl", this.angle, this._parent._x + this._x, this._parent._y + this._y);
}
}
function movebubble() {
if (this.px == undefined) {
this.px = 0;
this.py = -3;
this.xwiggle = 1;
}
if ((this.px > 3) || (this.px < -3)) {
this.xwiggle = this.xwiggle * -1;
}
this.px = this.px + this.xwiggle;
this._x = this._x + Math.round(this.px);
this._y = this._y + Math.round(this.py);
if ((theship._y - this._y) > 230) {
this.removeMovieClip();
}
}
function bubblebounce() {
theship.px = theship.px + (this.px * 2);
theship.py = theship.py + (this.py * 2);
capshipspeed(8);
theship.hurtship(10);
bubblepopS.start(0, 0);
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this.gotoAndStop("explode");
}
function bubblehurt() {
this.myHP--;
bubblepopS.start(0, 0);
removeBullet(this.hitbybullet);
if (this.myHP <= 0) {
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this.gotoAndStop("explode");
} else {
this.gotoAndStop("hit");
}
}
function moveasteroid() {
this._rotation = this._rotation + 2;
if (this._rotation == 360) {
this._rotation = 0;
}
if (this.px == undefined) {
this.px = -2;
this.py = 2;
}
this._x = this._x + Math.round(this.px);
this._y = this._y + Math.round(this.py);
if ((theship._y - this._y) < -230) {
this.removeMovieClip();
}
}
function asteroidbounce() {
theship.px = 0;
theship.py = 0;
theship.px = theship.px + (this.px * 2);
theship.py = theship.py + (this.py * 2);
capshipspeed(8);
theship.hurtship(10);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this.gotoAndStop("explode");
}
function asteroidhurt() {
this.myHP--;
bulletexplodeS.start(0.03, 0);
removeBullet(this.hitbybullet);
if (this.myHP <= 0) {
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this.gotoAndStop("explode");
} else {
this.gotoAndStop("hit");
}
}
function movecannon1() {
if ((this.mylaser._rotation >= 360) || (this.myrotation >= 360)) {
this.mylaser._rotation = 0;
this.myrotation = 0;
}
this.myrotation++;
if (this.myrotation >= 180) {
this.mylaser._rotation = -(360 - this.myrotation);
} else {
this.mylaser._rotation = -this.myrotation;
}
}
function cannon1bounce() {
theship.px = 0;
theship.py = 0;
theship.hurtship(10);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
}
function movecannon2() {
if ((Math.abs(this._x - theship._x) < 228) && (Math.abs(this._y - theship._y) < 175)) {
this.dx = (-this._x) + theship._x;
this.dy = this._y - theship._y;
this.angle = Math.atan(this.dy / this.dx) / (Math.PI/180);
if (this.dx < 0) {
this.angle = this.angle + 180;
}
if ((this.dx >= 0) && (this.dy < 0)) {
this.angle = this.angle + 360;
}
this.angle = Math.round(this.angle);
this.mygun._rotation = this.angle * -1;
if (random(45) == 0) {
gun2S.start(0, 0);
this.createEnemyBullet("bullet_gr2", this.angle, this._x, this._y);
}
}
}
function attachHP() {
_root.myscenelayer.attachMovie("bosshpbar", "bossHP", 1);
_root.myscenelayer.bossHP._x = 0;
_root.myscenelayer.bossHP._y = 250;
}
function movemegaclovite() {
myscenelayer.bossHP._width = this.myHP * 3;
this._rotation = this._rotation + 1;
if (this._rotation == 360) {
this._rotation = 0;
}
if (this.px == undefined) {
this.px = 1;
this.py = 2;
this.xmax = 1;
this.ymax = 2;
this.consecutivehits = 0;
}
if (this.px > this.xmax) {
this.px = this.xmax;
} else if (this.px < (-this.xmax)) {
this.px = -this.xmax;
}
if (this.py > this.ymax) {
this.py = this.ymax;
} else if (this.py < (-this.ymax)) {
this.py = -this.ymax;
}
myx = this._x;
myy = this._y;
movex = mymovelayer._x;
movey = mymovelayer._y;
hitx = myx + movex;
hity = myy + movey;
shipx = theship._x;
shipy = theship._y;
if (mymovelayer.currentLevel.hitTest(hitx, hity, true)) {
if (!mymovelayer.currentLevel.hitTest(hitx, hity - (this.py * 2), true)) {
this.py = this.py * -2;
} else if (!mymovelayer.currentLevel.hitTest(hitx - (this.px * 2), hity, true)) {
this.px = this.px * -2;
} else {
this.px = this.px * -2;
this.py = this.py * -2;
}
}
this._x = this._x + this.px;
this._y = this._y + this.py;
}
function megaclovitebounce() {
x = (-this._x) + theship._x;
y = (-this._y) + theship._y;
angle = Math.atan(y / x) / (Math.PI/180);
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
bouncex = Math.cos(angle * (Math.PI/180));
bouncey = Math.sin(angle * (Math.PI/180));
theship.px = theship.px + (bouncex * 2.5);
theship.py = theship.py + (bouncey * 2.5);
capshipspeed(12);
theship.hurtship(20);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
if (mymovelayer.currentLevel.hitTest(theship.x + mymovelayer._x, theship.y + mymovelayer._y, true)) {
this.px = -10 * bouncex;
this.py = -10 * bouncey;
}
}
function megaclovitehurt() {
this.myHP--;
megaclovitehitS.start(0.02, 0);
removeBullet(this.hitbybullet);
if (this.myHP <= 20) {
this.xmax = 2;
this.ymax = 3;
this.px = this.px * 2;
this.py = this.py * 2;
}
if (this.myHP <= 0) {
myscenelayer.bossHP._width = 0;
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this._rotation = 0;
this.gotoAndStop("explode");
} else {
this.gotoAndStop("hit");
}
}
function moveGEC() {
myscenelayer.bossHP._width = this.myHP * 2;
if (this.frameshurt == undefined) {
this.frameshurt = 0;
}
if (this.frameshurt > 0) {
this.frameshurt--;
} else if (this.frameshurt == 0) {
_root.turnNormal(this);
this.frameshurt = -1;
}
myx = this._x;
myy = this._y;
movex = mymovelayer._x;
movey = mymovelayer._y;
shipx = theship._x;
shipy = theship._y;
if ((this.f == 120) || (this.f == undefined)) {
this.f = 0;
if (random(3) == 1) {
this.mystate = "attack";
} else {
this.mystate = "move";
}
}
this.f++;
if (this.mystate == "move") {
this.gotoAndStop("walking");
if (this.px == undefined) {
this.px = 1;
this.xmax = 1;
}
if (this.px > this.xmax) {
this.px = this.xmax;
} else if (this.px < (-this.xmax)) {
this.px = -this.xmax;
}
if (mymovelayer.currentLevel.hitTest(myx + movex, myy + movey, true)) {
if (!mymovelayer.currentLevel.hitTest((myx + movex) - (this.px * 2), myy + movey, true)) {
this.px = this.px * -2;
} else {
trace("Error: Crab Movement");
}
}
this._x = this._x + this.px;
} else if (this.mystate == "attack") {
this.gotoAndStop("normal");
if ((this.f % 10) == 0) {
puffitehitS.start(0, 0);
this.createEnemyBullet("bullet_gr3", 225 + random(90), myx, myy + 35);
}
}
}
function GECbounce() {
theship.px = theship.px + this.px;
theship.py = theship.py + 2;
capshipspeed(12);
theship.hurtship(20);
}
function GEChurt() {
this.myHP = this.myHP - 0.05;
movex = mymovelayer._x;
movey = mymovelayer._y;
bullet = this.hitbybullet;
if (this.crabbody.hitTest((bullet._x + movex) + this.crabbody._x, (bullet._y + movey) + this.crabbody._y, true)) {
this.myHP--;
megaclovitehitS.start(0.02, 0);
_root.turnRed(this);
this.frameshurt = 3;
} else {
chompyhitS.start(0.02, 0);
}
removeBullet(this.hitbybullet);
if (this.myHP <= 0) {
_root.turnNormal(this);
myscenelayer.bossHP._width = 0;
this.crabbody.removeMovieClip();
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this.gotoAndStop("explode");
}
}
function GECpause() {
if (mypause) {
this.mywalking.stop();
} else {
this.mywalking.play();
}
}
function moveblotchqueen() {
if (this.px == undefined) {
this.px = 0;
this.py = 0;
this.rotateRate = 1;
myscenelayer.bossHP._width = this.myHP * 1.5;
this.attachblotch_array = new Array();
this.myangle = 0;
}
this.myangle = this.myangle + this.rotateRate;
this.mybq_gr._rotation = this.myangle;
if (this.myangle == 360) {
this.myangle = 0;
}
if (this.frameshurt == undefined) {
this.frameshurt = 0;
}
if (this.frameshurt > 0) {
this.frameshurt--;
} else if (this.frameshurt == 0) {
_root.turnNormal(this);
this.frameshurt = -1;
}
if (Math.abs(this._x - theship._x) > 1) {
if (this._x > theship._x) {
this.px = this.px - 0.1;
} else if (this._x < theship._x) {
this.px = this.px + 0.1;
}
}
if (Math.abs(this._y - theship._y) > 1) {
if (this._y > theship._y) {
this.py = this.py - 0.1;
} else if (this._y < theship._y) {
this.py = this.py + 0.1;
}
}
if (this.px > 8) {
this.px = 8;
} else if (this.px < -8) {
this.px = -8;
}
if (this.py > 8) {
this.py = 8;
} else if (this.py < -8) {
this.py = -8;
}
if (this.px > 2) {
this.px = this.px * 0.95;
} else if (this.px < -2) {
this.px = this.px * 0.95;
}
if (this.py > 2) {
this.py = this.py * 0.95;
} else if (this.py < -2) {
this.py = this.py * 0.95;
}
this._x = this._x + Math.round(this.px);
this._y = this._y + Math.round(this.py);
}
function blotchqueenbounce() {
x = (-this._x) + theship._x;
y = (-this._y) + theship._y;
angle = Math.atan(y / x) / (Math.PI/180);
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
bouncex = Math.cos(angle * (Math.PI/180));
bouncey = Math.sin(angle * (Math.PI/180));
theship.px = theship.px + (bouncex * 2.5);
theship.py = theship.py + (bouncey * 2.5);
capshipspeed(12);
theship.hurtship(20);
if ((shiphitS.position == 0) || (shiphitS.position == shiphitS.duration)) {
shiphitS.start(0, 0);
}
if (mymovelayer.currentLevel.hitTest(theship.x + mymovelayer._x, theship.y + mymovelayer._y, true)) {
this.px = -10 * bouncex;
this.py = -10 * bouncey;
this.rotateRate = this.rotateRate * -1;
}
}
function blotchqueenhurt() {
movex = mymovelayer._x;
movey = mymovelayer._y;
bullet = this.hitbybullet;
if (this.mybq_gr.hitTest((bullet._x + movex) + this.mybq_gr._x, (bullet._y + movey) + this.mybq_gr._y, true)) {
this.myHP--;
myscenelayer.bossHP._width = this.myHP * 1.5;
megaclovitehitS.start(0.02, 0);
_root.turnRed(this);
this.frameshurt = 3;
if (this.myHP == 180) {
this.blotchqueenattachblotch(0);
}
if (this.myHP == 140) {
someangle = this.attachblotch_array[this.attachblotch_array.length - 1].myangle;
someangle = someangle - this.myangle;
someangle = someangle + 120;
this.blotchqueenattachblotch(someangle);
}
if (this.myHP == 110) {
someangle = this.attachblotch_array[this.attachblotch_array.length - 1].myangle;
someangle = someangle - this.myangle;
someangle = someangle + 120;
this.blotchqueenattachblotch(someangle);
}
if (this.myHP == 80) {
someangle = this.attachblotch_array[this.attachblotch_array.length - 1].myangle;
someangle = someangle - this.myangle;
someangle = someangle + 60;
this.blotchqueenattachblotch(someangle);
}
if (this.myHP == 50) {
someangle = this.attachblotch_array[this.attachblotch_array.length - 1].myangle;
someangle = someangle - this.myangle;
someangle = someangle + 120;
this.blotchqueenattachblotch(someangle);
}
if (this.myHP == 20) {
someangle = this.attachblotch_array[this.attachblotch_array.length - 1].myangle;
someangle = someangle - this.myangle;
someangle = someangle + 120;
this.blotchqueenattachblotch(someangle);
}
}
removeBullet(this.hitbybullet);
if (this.myHP <= 0) {
_root.turnNormal(this);
myscenelayer.bossHP._width = 0;
while (this.attachblotch_array.length > 0) {
removeMovieClip(this.attachblotch_array.pop());
}
this.onEnterFrame = null;
this.bullethitactions = _root.ignorebullet;
this.shiphitactions = _root.ignoreship;
this._rotation = 0;
this.gotoAndStop("explode");
}
}
function blotchqueenshoot() {
if (((Math.abs(this._x - theship._x) < 350) && (Math.abs(this._y - theship._y) < 300)) && (!mypause)) {
blotchshootS.start(0, 0);
this.dx = (-(this._parent._x + this._x)) + theship._x;
this.dy = (this._parent._y + this._y) - theship._y;
this.angle = Math.atan(this.dy / this.dx) / (Math.PI/180);
if (this.dx < 0) {
this.angle = this.angle + 180;
}
if ((this.dx >= 0) && (this.dy < 0)) {
this.angle = this.angle + 360;
}
this.angle = Math.round(this.angle);
this.createEnemyBullet("bullet_gr4", this.angle, this._parent._x + this._x, this._parent._y + this._y);
if ((this.blotchIndex == undefined) || (this.blotchIndex >= this.attachblotch_array.length)) {
this.blotchIndex = 0;
}
this.attachblotch_array[this.blotchIndex].blotchshoot2();
this.blotchIndex++;
}
}
function blotchqueenattachblotch(attachAngle) {
blotchDepth = this.getNextHighestDepth();
bd = ["attachblotch" + blotchDepth];
this.attachMovie("blotch2", bd, blotchDepth);
bh = this[bd];
bh.myangle = attachAngle + this.myangle;
bh._x = Math.round(100 * Math.cos(bh.myangle * (Math.PI/180)));
bh._y = Math.round(100 * Math.sin(bh.myangle * (Math.PI/180)));
bh.onEnterFrame = _root.moveblotch2;
bh.blotchshoot2 = _root.blotchshoot2;
bh.pausemethod = _root.howtopause;
bh.shiphitactions = _root.ignorebullet;
bh.createEnemyBullet = _root.createEnemyBullet;
this.attachblotch_array.push(bh);
}
function blotchqueenpause() {
i = 0;
while (i < this.attachblotch_array.length) {
this.attachblotch_array[i].pausemethod();
i++;
}
}
stop();
var debugmode = false;
var mylevel = 1;
_global.myGameTime = getTimer();
var baddie_array = new Array();
var object_array = new Array();
var hit_array = new Array();
var shot_array = new Array();
var wall_array = new Array();
var mg_array = new Array();
var mghit_array = new Array();
var shipbullet_array = new Array();
var fps = 0;
setInterval(refreshFPS, 1000);
setInterval(refreshSomeThings, 250);
var myangle = 0;
var roomenemies = 0;
var baddieLimit = 100;
var objectLimit = 10;
var bonusboxnum = 0;
var gotbonusbox = false;
var theship;
var mypause = false;
var myMouseIsDown = false;
_root.createEmptyMovieClip("shipMouseRapidFire", 2);
if (shipMouseListener == undefined) {
shipMouseListener = new Object();
pauseListener = new Object();
}
konamizedS = new Sound();
konamizedS.attachSound("konamized");
konamizedS.setVolume(100);
stratosphereS = new Sound();
stratosphereS.attachSound("stratosphere");
memoriesS = new Sound();
memoriesS.attachSound("sea of memories");
overdriveS = new Sound();
overdriveS.attachSound("overdrive");
gun1S = new Sound();
gun1S.attachSound("spacegun04");
gun2S = new Sound();
gun2S.attachSound("spacegun13");
bulletexplodeS = new Sound();
bulletexplodeS.attachSound("spacegun09");
clovitehitS = new Sound();
clovitehitS.attachSound("clovitehit");
megaclovitehitS = new Sound();
megaclovitehitS.attachSound("megaclovitehit");
goalbeepS = new Sound();
goalbeepS.attachSound("scifibeep01");
chompyhitS = new Sound();
chompyhitS.attachSound("chompyhit");
chompychompS = new Sound();
chompychompS.attachSound("chompychomp");
shiphitS = new Sound();
shiphitS.attachSound("shiphit");
shipexplodeS = new Sound();
shipexplodeS.attachSound("shipexplode");
enemydownS = new Sound();
enemydownS.attachSound("enemydown");
bubblepopS = new Sound();
bubblepopS.attachSound("bubblepop");
gloophitS = new Sound();
gloophitS.attachSound("boingshort");
puffitehitS = new Sound();
puffitehitS.attachSound("puffitehit");
blotchshootS = new Sound();
blotchshootS.attachSound("spacegun10");
blotchhitS = new Sound();
blotchhitS.attachSound("blotchhit");
switchhitS = new Sound();
switchhitS.attachSound("switchhit");
smb3_coinS = new Sound();
smb3_coinS.attachSound("smb3_coin");
enginerevS = new Sound();
enginerevS.attachSound("missile05");
startgame();
pauseListener.onKeyDown = function () {
if (Key.isDown(32)) {
pausegame();
} else if (Key.isDown(192)) {
pausegame();
removepausescreen();
}
};
shipMouseListener.onMouseDown = function () {
createBullet();
myMouseIsDown = true;
};
shipMouseListener.onMouseUp = function () {
myMouseIsDown = false;
};
shipMouseRapidFire.onEnterFrame = function () {
if ((rapidFireCount == undefined) || (!myMouseIsDown)) {
rapidFireCount = 0;
}
if (myMouseIsDown && (!mypause)) {
if (rapidFireCount > 30) {
if ((rapidFireCount % 15) == 0) {
createBullet();
rf = 0;
while (rf < baddie_array.length) {
if (baddie_array[rf].onMouseDown != undefined) {
baddie_array[rf].onMouseDown();
}
rf++;
}
}
}
}
rapidFireCount++;
};
onEnterFrame = function () {
if (prevMils == undefined) {
prevMils = 0;
}
totalMils = getTimer();
frameMils = totalMils - prevMils;
fps = 1000 / frameMils;
prevMils = totalMils;
};
Symbol 25 MovieClip Frame 1
_root.stop();
this.stop();
this.onEnterFrame = function () {
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded < 100) {
begin._xscale = PercentLoaded;
if (PercentLoaded > 25) {
loadtext._visible = false;
streambutton._visible = true;
streambutton.enabled = true;
}
} else {
_root.gotoAndStop("menu");
}
};
streambutton._visible = false;
streambutton.enabled = false;
streambutton.onRelease = function () {
trace("streaming");
_root.gotoAndStop("menu");
};
Symbol 36 MovieClip Frame 1
mybgdship.myshipflame.stop();
Symbol 42 MovieClip [bullet_gr_explode] Frame 5
this.removeMovieClip();
Symbol 55 MovieClip Frame 1
if (random(45) == 1) {
gotoAndPlay (3);
}
Symbol 55 MovieClip Frame 2
gotoAndPlay (1);
Symbol 66 MovieClip Frame 1
if (random(45) == 1) {
gotoAndPlay (3);
}
Symbol 66 MovieClip Frame 2
gotoAndPlay (1);
Symbol 79 MovieClip Frame 1
if (random(45) == 1) {
gotoAndPlay (3);
}
Symbol 79 MovieClip Frame 2
gotoAndPlay (1);
Symbol 97 MovieClip Frame 1
if (random(45) == 1) {
gotoAndPlay (3);
}
Symbol 97 MovieClip Frame 2
gotoAndPlay (1);
Symbol 104 MovieClip Frame 1
if (random(45) == 1) {
gotoAndPlay (3);
}
Symbol 104 MovieClip Frame 2
gotoAndPlay (1);
Symbol 109 MovieClip Frame 1
if (random(55) == 1) {
gotoAndPlay (3);
}
Symbol 109 MovieClip Frame 2
gotoAndPlay (1);
Symbol 114 MovieClip [GEC_gr8] Frame 1
if (random(55) == 1) {
gotoAndPlay (3);
}
Symbol 114 MovieClip [GEC_gr8] Frame 2
gotoAndPlay (1);
Symbol 131 MovieClip [blotch2] Frame 1
if (random(45) == 1) {
gotoAndPlay (3);
}
Symbol 131 MovieClip [blotch2] Frame 2
gotoAndPlay (1);
Symbol 135 MovieClip Frame 1
if (random(55) == 1) {
gotoAndPlay (3);
}
Symbol 135 MovieClip Frame 2
gotoAndStop (1);
Symbol 144 MovieClip [credits] Frame 1
this.onMouseUp = function () {
stopAllSounds();
this.removeMovieClip();
};
Symbol 144 MovieClip [credits] Frame 3043
myVol = 100;
onEnterFrame = function () {
_root.konamizedS.setVolume(myVol);
if (myVol == 0) {
this.onEnterFrame = null;
}
myVol--;
};
Symbol 144 MovieClip [credits] Frame 3151
stopAllSounds();
this.removeMovieClip();
Instance of Symbol 104 MovieClip in Symbol 147 MovieClip [asteroid3] Frame 1
onClipEvent (enterFrame) {
this._rotation = this._rotation + 1;
}
Instance of Symbol 104 MovieClip in Symbol 147 MovieClip [asteroid3] Frame 1
onClipEvent (enterFrame) {
this._rotation = this._rotation + 1;
}
Instance of Symbol 104 MovieClip in Symbol 147 MovieClip [asteroid3] Frame 1
onClipEvent (enterFrame) {
this._rotation = this._rotation + 1;
}
Symbol 154 MovieClip Frame 1
stop();
if (!_root.gotbonusbox) {
bb = _root.attachtoMGDHit("bonusbox");
bb._x = this._x;
bb._y = this._y;
bb.bullethitactions = _root.bonusboxhurt;
bb.myHP = 4;
}
Symbol 155 MovieClip Frame 1
stop();
cn = _root.attachtoHit("cannon1");
cn._x = this._x;
cn._y = this._y;
cn._rotation = this._rotation;
cn.shiphitactions = _root.cannon1bounce;
cn.bullethitactions = _root.ignorebullet;
Symbol 156 MovieClip Frame 1
stop();
cn = _root.attachtoHit("cannon2");
cn._x = this._x;
cn._y = this._y;
cn.onEnterFrame = _root.movecannon2;
cn.createEnemyBullet = _root.createEnemyBullet;
Symbol 157 MovieClip Frame 1
stop();
ch = _root.attachBaddie("chompy", this._x, this._y);
ch.px = 0;
ch.py = 0;
ch.onEnterFrame = _root.movechompy;
ch.shiphitactions = _root.chompybounce;
ch.bullethitactions = _root.chompyhurt;
ch.animationpause = _root.chompypause;
ch.myHP = 6;
Symbol 160 MovieClip Frame 1
_root.mymovelayer.theENV.onEnterFrame = _root.randomasteroid;
Symbol 163 MovieClip Frame 1
goal = _root.attachtoMGD("goal");
goal._x = this._x;
goal._y = this._y;
goal.pausemethod = _root.howtopause;
goal.animationpause = _root.goalpause;
Symbol 166 MovieClip Frame 1
stop();
gl = _root.attachtoMGDHit("gloopwall");
gl._x = this._x;
gl._y = this._y;
gl._xscale = this._xscale;
gl._yscale = this._yscale;
temp_rotation = this._rotation;
this._rotation = 0;
gl._width = this._width;
gl._height = this._height;
gl._rotation = temp_rotation;
gl.myHP = 10;
gl.shiphitactions = _root.gloopwallbounce;
gl.bullethitactions = _root.gloopwallhurt;
gl.pausemethod = _root.howtopause;
Symbol 167 MovieClip Frame 1
stop();
bl = _root.attachBaddie("blastite", this._x, this._y);
bl.bullethitactions = _root.blastitehurt;
bl.shiphitactions = _root.blastitebounce;
bl.animationpause = _root.blastitepause;
bl.myHP = 1;
Symbol 168 MovieClip Frame 1
stop();
cl = _root.attachBaddie("clovite", this._x, this._y);
cl.onEnterFrame = _root.moveclovite;
cl.shiphitactions = _root.clovitebounce;
cl.bullethitactions = _root.clovitehurt;
cl.myHP = 4;
Symbol 169 MovieClip Frame 1
stop();
bh = _root.attachBaddie("blotch", this._x, this._y);
bh.onEnterFrame = _root.moveblotch;
bh.onMouseDown = _root.blotchshoot;
bh.shiphitactions = _root.blotchbounce;
bh.bullethitactions = _root.blotchhurt;
bh.createEnemyBullet = _root.createEnemyBullet;
bh.myHP = 7;
Symbol 174 MovieClip Frame 1
stop();
cr = _root.attachtoMGDHit("linecurrent");
cr._x = this._x;
cr._y = this._y;
cr._xscale = this._xscale;
cr._yscale = this._yscale;
temp_rotation = this._rotation;
this._rotation = 0;
cr._width = this._width;
cr._height = this._height;
cr._rotation = temp_rotation;
cr.shiphitactions = _root.watercurrentbounce;
cr.bullethitactions = _root.ignorebullet;
cr.pausemethod = _root.howtopause;
cr.animationpause = _root.watercurrentpause;
Symbol 177 MovieClip Frame 1
stop();
gl = _root.attachtoHit("switch");
gl._x = this._x;
gl._y = this._y;
gl._xscale = (gl._yscale = this._xscale);
gl.onEnterFrame = _root.blowupwallswitch;
gl.bullethitactions = _root.blowupwallswitchhurt;
gl.pausemethod = _root.howtopause;
Symbol 180 MovieClip Frame 1
stop();
cw = _root.attachWall("cavewall");
cw._x = this._x;
cw._y = this._y;
cw._xscale = this._xscale;
cw._yscale = this._yscale;
temp_rotation = this._rotation;
this._rotation = 0;
cw._width = this._width;
cw._height = this._height;
cw._rotation = temp_rotation;
Symbol 182 MovieClip Frame 1
stop();
_root.setcoordinates(this._x, this._y);
Symbol 197 MovieClip Frame 1
stop();
gl = _root.attachtoMGDHit("gloop");
gl._x = this._x;
gl._y = this._y;
gl._xscale = this._xscale;
gl._yscale = this._yscale;
gl._rotation = 0;
gl._xscale = (gl._yscale = this._xscale);
gl.mydrop = "gloop_gr2";
gl.onEnterFrame = _root.gloop;
gl.createGloopDrop = _root.createGloopDrop;
gl.pausemethod = _root.howtopause;
Symbol 198 MovieClip Frame 1
stop();
bq = _root.attachBaddie("blotchqueen", this._x, this._y);
bq.onEnterFrame = _root.moveblotchqueen;
bq.onMouseDown = _root.blotchqueenshoot;
bq.shiphitactions = _root.blotchqueenbounce;
bq.bullethitactions = _root.blotchqueenhurt;
bq.blotchqueenattachblotch = _root.blotchqueenattachblotch;
bq.createEnemyBullet = _root.createEnemyBullet;
bq.pausemethod = _root.howtopause;
bq.animationpause = _root.blotchqueenpause;
bq.myHP = 200;
_root.attachHP();
Symbol 220 MovieClip Frame 25
_root.roomenemies--;
_parent.removeMovieClip();
Symbol 221 MovieClip [blotchqueen] Frame 1
stop();
Symbol 221 MovieClip [blotchqueen] Frame 2
stop();
Instance of Symbol 159 MovieClip in Symbol 224 MovieClip [asteroid2] Frame 1
onClipEvent (enterFrame) {
if (this._y > 400) {
this._x = 250 + random(250);
this._y = -100;
this._xscale = (this._yscale = 50 + random(100));
}
this._rotation = this._rotation + 2;
if (this._rotation == 360) {
this._rotation = 0;
}
if (this.px == undefined) {
this.px = -2;
this.py = 2;
}
this._x = this._x + Math.round(this.px);
this._y = this._y + Math.round(this.py);
}
Instance of Symbol 159 MovieClip in Symbol 224 MovieClip [asteroid2] Frame 1
onClipEvent (enterFrame) {
if (this._y > 400) {
this._x = 250 + random(250);
this._y = -100;
this._xscale = (this._yscale = 50 + random(100));
}
this._rotation = this._rotation + 2;
if (this._rotation == 360) {
this._rotation = 0;
}
if (this.px == undefined) {
this.px = -2;
this.py = 2;
}
this._x = this._x + Math.round(this.px);
this._y = this._y + Math.round(this.py);
}
Instance of Symbol 159 MovieClip in Symbol 248 MovieClip [asteroid1] Frame 1
onClipEvent (enterFrame) {
if (this._y > 400) {
this._x = 250 + random(250);
this._y = -100;
this._xscale = (this._yscale = 50 + random(100));
}
this._rotation = this._rotation + 2;
if (this._rotation == 360) {
this._rotation = 0;
}
if (this.px == undefined) {
this.px = -2;
this.py = 2;
}
this._x = this._x + Math.round(this.px);
this._y = this._y + Math.round(this.py);
}
Instance of Symbol 159 MovieClip in Symbol 248 MovieClip [asteroid1] Frame 1
onClipEvent (enterFrame) {
if (this._y > 400) {
this._x = 250 + random(250);
this._y = -100;
this._xscale = (this._yscale = 50 + random(100));
}
this._rotation = this._rotation + 2;
if (this._rotation == 360) {
this._rotation = 0;
}
if (this.px == undefined) {
this.px = -2;
this.py = 2;
}
this._x = this._x + Math.round(this.px);
this._y = this._y + Math.round(this.py);
}
Instance of Symbol 55 MovieClip in Symbol 248 MovieClip [asteroid1] Frame 1
onClipEvent (enterFrame) {
this._rotation = this._rotation + 1;
}
Instance of Symbol 55 MovieClip in Symbol 248 MovieClip [asteroid1] Frame 1
onClipEvent (enterFrame) {
this._rotation = this._rotation + 1;
}
Instance of Symbol 55 MovieClip in Symbol 248 MovieClip [asteroid1] Frame 1
onClipEvent (enterFrame) {
this._rotation = this._rotation + 1;
}
Symbol 262 MovieClip [cavewall_explode] Frame 10
this.removeMovieClip();
Symbol 272 MovieClip Frame 3
_parent.gotoAndStop("normal");
Symbol 276 MovieClip Frame 8
_parent.removeMovieClip();
Symbol 277 MovieClip [asteroid] Frame 1
stop();
Symbol 277 MovieClip [asteroid] Frame 2
stop();
Symbol 277 MovieClip [asteroid] Frame 3
stop();
Symbol 278 MovieClip [bulletclip] Frame 1
Symbol 288 MovieClip [theENVclip] Frame 1
Symbol 289 MovieClip [MGDHit] Frame 1
Symbol 292 MovieClip Frame 3
_parent.gotoAndStop("normal");
Symbol 294 MovieClip Frame 8
_root.roomenemies--;
_parent.removeMovieClip();
Symbol 295 MovieClip [blotch] Frame 1
stop();
Symbol 295 MovieClip [blotch] Frame 2
stop();
Symbol 295 MovieClip [blotch] Frame 3
stop();
Symbol 304 MovieClip [switch] Frame 1
stop();
Symbol 304 MovieClip [switch] Frame 2
stop();
Symbol 320 MovieClip Frame 25
_root.roomenemies--;
_parent.removeMovieClip();
Symbol 321 MovieClip [GEC] Frame 1
stop();
Symbol 321 MovieClip [GEC] Frame 2
stop();
Symbol 321 MovieClip [GEC] Frame 3
stop();
Symbol 321 MovieClip [GEC] Frame 4
stop();
Symbol 324 MovieClip Frame 1
stop();
cr = _root.attachtoMGDHit("watercurrent");
cr._x = this._x;
cr._y = this._y;
cr._xscale = this._xscale;
cr._yscale = this._yscale;
temp_rotation = this._rotation;
this._rotation = 0;
cr._width = this._width;
cr._height = this._height;
cr._rotation = temp_rotation;
cr.shiphitactions = _root.watercurrentbounce;
cr.bullethitactions = _root.ignorebullet;
cr.pausemethod = _root.howtopause;
cr.animationpause = _root.watercurrentpause;
Symbol 328 MovieClip Frame 1
stop();
gl = _root.attachtoMGDHit("bubblewall2");
gl._x = this._x;
gl._y = this._y;
gl._xscale = this._xscale;
gl._yscale = this._yscale;
temp_rotation = this._rotation;
this._rotation = 0;
gl._width = this._width;
gl._height = this._height;
gl._rotation = temp_rotation;
gl.myHP = 8;
gl.shiphitactions = _root.gloopwallbounce;
gl.bullethitactions = _root.gloopwallhurt;
gl.pausemethod = _root.howtopause;
Symbol 331 MovieClip Frame 1
_root.mymovelayer.theENV.onEnterFrame = _root.randombubble;
Symbol 332 MovieClip Frame 1
stop();
gl = _root.attachtoMGDHit("bubblewall");
gl._x = this._x;
gl._y = this._y;
gl._xscale = this._xscale;
gl._yscale = this._yscale;
temp_rotation = this._rotation;
this._rotation = 0;
gl._width = this._width;
gl._height = this._height;
gl._rotation = temp_rotation;
gl.myHP = 4;
gl.shiphitactions = _root.gloopwallbounce;
gl.bullethitactions = _root.gloopwallhurt;
gl.pausemethod = _root.howtopause;
Symbol 333 MovieClip Frame 1
stop();
gec = _root.attachBaddie("GEC", this._x, this._y);
gec.onEnterFrame = _root.moveGEC;
gec.createEnemyBullet = _root.createEnemyBullet;
gec.animationpause = _root.GECpause;
gec.shiphitactions = _root.GECbounce;
gec.bullethitactions = _root.GEChurt;
gec.myHP = 100;
gec.attachMovie("GEC_gr4", "crabbody", 1);
gec._xscale = (gec._yscale = 150);
_root.attachHP();
Symbol 343 MovieClip Frame 1
stop();
pf = _root.attachBaddie("puffite", this._x, this._y);
pf.onEnterFrame = _root.movepuffite;
pf.shiphitactions = _root.puffitebounce;
pf.bullethitactions = _root.puffitehurt;
pf.createEnemyBullet = _root.createEnemyBullet;
pf.myHP = 7;
Symbol 344 MovieClip Frame 1
stop();
sm = _root.attachBaddie("swimmy", this._x, this._y);
sm.onEnterFrame = _root.moveswimmy;
sm.shiphitactions = _root.swimmybounce;
sm.bullethitactions = _root.swimmyhurt;
sm.animationpause = _root.swimmypause;
sm.myHP = 6;
Symbol 345 MovieClip Frame 1
stop();
ch = _root.attachBaddie("sharky", this._x, this._y);
ch.px = 0;
ch.py = 0;
ch.onEnterFrame = _root.movechompy;
ch.shiphitactions = _root.chompybounce;
ch.bullethitactions = _root.chompyhurt;
ch.animationpause = _root.chompypause;
ch.myHP = 9;
Symbol 366 MovieClip Frame 8
if ((_root.chompychompS.position == 0) || (_root.chompychompS.position == _root.chompychompS.duration)) {
_root.chompychompS.start(0, 0);
}
Symbol 367 MovieClip Frame 3
_parent.gotoAndStop("chomping");
Symbol 369 MovieClip Frame 15
_root.roomenemies--;
_parent.removeMovieClip();
Symbol 370 MovieClip [sharky] Frame 1
stop();
Symbol 370 MovieClip [sharky] Frame 2
stop();
Symbol 370 MovieClip [sharky] Frame 3
stop();
Symbol 370 MovieClip [sharky] Frame 4
stop();
Symbol 389 MovieClip Frame 3
_parent.gotoAndStop("normal");
Symbol 394 MovieClip Frame 5
_parent._rotation = 0;
Symbol 394 MovieClip Frame 16
_parent.removeMovieClip();
Symbol 395 MovieClip [bubblewall2] Frame 1
stop();
Symbol 395 MovieClip [bubblewall2] Frame 2
stop();
Symbol 395 MovieClip [bubblewall2] Frame 3
stop();
Symbol 396 MovieClip Frame 3
_parent.gotoAndStop("normal");
Symbol 398 MovieClip Frame 5
_parent._rotation = 0;
Symbol 398 MovieClip Frame 16
_parent.removeMovieClip();
Symbol 399 MovieClip [bubblewall] Frame 1
stop();
Symbol 399 MovieClip [bubblewall] Frame 2
stop();
Symbol 399 MovieClip [bubblewall] Frame 3
stop();
Symbol 403 MovieClip [goal] Frame 1
stop();
this.onEnterFrame = _root.goalactions;
Symbol 403 MovieClip [goal] Frame 2
stop();
Instance of Symbol 330 MovieClip in Symbol 408 MovieClip [ocean1] Frame 1
onClipEvent (enterFrame) {
if ((this.px == undefined) || (this._y < -20)) {
this._x = random(400);
this._y = 320;
this._xscale = (this._yscale = 50 + random(100));
this.px = 0;
this.py = -3;
this.xwiggle = 1;
}
if ((this.px > 3) || (this.px < -3)) {
this.xwiggle = this.xwiggle * -1;
}
this.px = this.px + this.xwiggle;
this._x = this._x + Math.round(this.px);
this._y = this._y + Math.round(this.py);
}
Symbol 409 Button
on (release) {
_root.backtomenu();
}
Symbol 410 Button
on (release) {
_root.restart();
}
Symbol 411 Button
on (release) {
_root.forcepause(false);
}
Symbol 416 MovieClip Frame 3
_parent.gotoAndStop("normal");
Symbol 421 MovieClip Frame 14
_root.roomenemies--;
_parent.removeMovieClip();
Symbol 422 MovieClip [Puffite] Frame 1
stop();
Symbol 422 MovieClip [Puffite] Frame 2
stop();
Symbol 422 MovieClip [Puffite] Frame 3
stop();
Symbol 443 MovieClip Frame 3
_parent.gotoAndStop("normal");
Symbol 446 MovieClip Frame 8
_parent.removeMovieClip();
Symbol 447 MovieClip [gloopwall] Frame 1
stop();
Symbol 447 MovieClip [gloopwall] Frame 2
stop();
Symbol 447 MovieClip [gloopwall] Frame 3
stop();
Symbol 480 MovieClip Frame 1
stop();
Symbol 496 MovieClip Frame 1
stop();
mc = _root.attachBaddie("megaclovite", this._x, this._y);
mc.onEnterFrame = _root.movemegaclovite;
mc.shiphitactions = _root.megaclovitebounce;
mc.bullethitactions = _root.megaclovitehurt;
mc.myHP = 100;
_root.attachHP();
Symbol 505 MovieClip Frame 3
_parent.gotoAndStop("normal");
Symbol 506 MovieClip Frame 29
_root.roomenemies--;
_parent.removeMovieClip();
Symbol 507 MovieClip [megaclovite] Frame 1
stop();
Symbol 507 MovieClip [megaclovite] Frame 2
stop();
Symbol 507 MovieClip [megaclovite] Frame 3
stop();
Symbol 508 MovieClip Frame 3
_parent.gotoAndStop("normal");
Symbol 510 MovieClip Frame 15
_parent.removeMovieClip();
Symbol 511 MovieClip [bubble] Frame 1
stop();
Symbol 511 MovieClip [bubble] Frame 2
stop();
Symbol 511 MovieClip [bubble] Frame 3
stop();
Symbol 512 MovieClip [objectclip] Frame 1
Symbol 512 MovieClip [objectclip] Frame 2
if (_root.mypause) {
_root.forcepause(true);
}
removeMovieClip(_root.mymovelayer.currentENEMY);
gotoAndStop (1);
Symbol 513 MovieClip Frame 3
_parent.gotoAndStop("normal");
Symbol 514 MovieClip Frame 135
_parent.onEnterFrame = undefined;
_parent.beforepause = _parent.onEnterFrame;
_parent.shiphitactions = _root.blastitebounce3;
_parent.bullethitactions = _root.ignorebullet;
Symbol 514 MovieClip Frame 159
_root.roomenemies--;
_parent.removeMovieClip();
Symbol 515 MovieClip [blastite] Frame 1
stop();
Symbol 515 MovieClip [blastite] Frame 2
stop();
Symbol 515 MovieClip [blastite] Frame 3
stop();
Symbol 531 MovieClip [controls] Frame 1
this.onEnterFrame = function () {
if (_global.mouseOnly) {
myselect2._x = 26;
myselect2._y = 89;
} else {
myselect2._x = 197;
myselec2t._y = 89;
}
};
Symbol 546 MovieClip [cannon2] Frame 1
stop();
Symbol 547 MovieClip [cannon1] Frame 1
this.myrotation = 0;
this.onEnterFrame = _root.movecannon1;
Symbol 569 MovieClip Frame 3
_parent.gotoAndStop("normal");
Symbol 579 MovieClip Frame 12
_root.roomenemies--;
_parent.removeMovieClip();
Symbol 580 MovieClip [swimmy] Frame 1
stop();
Symbol 580 MovieClip [swimmy] Frame 4
stop();
if (myHP == 0) {
gotoAndStop ("explode");
} else {
gotoAndStop ("normal");
}
Symbol 580 MovieClip [swimmy] Frame 5
stop();
Symbol 581 MovieClip Frame 8
_root.chompychompS.start(0, 0);
Symbol 583 MovieClip Frame 3
_parent.gotoAndStop("chomping");
Symbol 585 MovieClip Frame 15
_root.roomenemies--;
_parent.removeMovieClip();
Symbol 586 MovieClip [chompy] Frame 1
stop();
Symbol 586 MovieClip [chompy] Frame 2
stop();
Symbol 586 MovieClip [chompy] Frame 3
stop();
Symbol 586 MovieClip [chompy] Frame 4
stop();
Symbol 614 MovieClip Frame 12
_root.roomenemies--;
_parent.removeMovieClip();
Symbol 615 MovieClip [clovite] Frame 1
stop();
Symbol 615 MovieClip [clovite] Frame 2
stop();
Symbol 615 MovieClip [clovite] Frame 3
stop();
Symbol 617 MovieClip Frame 1
_parent._alpha = 100;
Symbol 617 MovieClip Frame 28
_root.restart();
Symbol 618 MovieClip [ship] Frame 1
stop();
Symbol 618 MovieClip [ship] Frame 2
stop();
Symbol 621 Button
on (release) {
_root.gotoAndStop("credits");
}
Symbol 623 Button
on (release) {
_root.gotoAndStop("settings");
}
Symbol 625 Button
on (release) {
_root.gotoAndStop("main");
}
Symbol 638 Button
on (release) {
_root.gotoAndStop("menu");
}
Symbol 639 Button
on (press) {
_global.mouseOnly = true;
}
Symbol 640 Button
on (press) {
_global.mouseOnly = false;
}
Symbol 643 MovieClip Frame 1
this.onEnterFrame = function () {
if (_global.mouseOnly) {
myselect._x = 19;
myselect._y = 83;
} else {
myselect._x = 199;
myselect._y = 73;
}
};
Symbol 659 MovieClip Frame 1
stop();
Symbol 660 Button
on (release) {
_root.backtomenu();
}
Symbol 666 MovieClip Frame 1
time = getTimer();
totalGameTime = time - _global.myGameTime;
mils = totalGameTime % 1000;
seconds = Math.round(((totalGameTime - mils) / 1000) % 60);
minutes = Math.round((((totalGameTime - seconds) / 1000) / 60) % 60);
hours = Math.round(((((totalGameTime - minutes) / 1000) / 60) / 60) % 24);
time_txt.text = (((((("Time: " + hours) + ": ") + minutes) + ": ") + seconds) + ": ") + mils;
bonusbox_txt.text = ("found: " + _root.bonusboxnum) + "/18";
mybgdship.myshipflame.stop();