Frame 1
function clearscreen() {
allowEnterFrame = false;
for (var i in _root) {
removeMovieClip(_root[i]);
}
}
function spawnenemy() {
eC = random(enemyFreq);
if (eC == 0) {
e = random(2) + 1;
switch (e) {
case 1 :
makebolt();
return;
case 2 :
makeblade();
}
}
}
function spawnpowerup() {
pC = random(100);
if (pC == 0) {
powerupType = random(4) + 1;
powerupsholder.attachMovie("powerup" + powerupType, "powerup" + z, z++, {n:powerupType, _x:random(450) + 150, _y:-50});
}
}
function overheatSmoke() {
smoke.attachMovie("smokeh", "smokeh" + _root.z, _root.z++, {_x:fighter._x - -40, _y:fighter._y});
smoke.attachMovie("smokeh", "smokeh" + _root.z, _root.z++, {_x:fighter._x - 40, _y:fighter._y});
}
function p2shoot() {
if (shotready) {
player2.turret.play();
}
}
function fire(s, r, projectile, x, y, d, n, sF) {
hazards.attachMovie(projectile, "h" + z, z++, {_x:x, _y:y, speed:s, remove:r, damage:d, n:n, shapeFlag:sF});
}
function makebolt() {
enemies.bolts.attachMovie("bolt", "bolt" + z, z++, {speed:(_root.mran() * 4) - -2, _x:random(450) + 150, _y:-50, n:z, HP:_root.boltHP, enemy:true});
}
function makeblade() {
enemies.blades.attachMovie("blade", "blade" + z, z++, {speed:(_root.mran() * 5) - -3, xspeed:_root.bsl, _x:random(450) + 150, _y:-50, n:z, HP:_root.bladeHP, enemy:true});
}
function damagePlayer(damage) {
if (sheild._currentframe == 2) {
hulnum = hulnum - damage;
}
}
function shoot() {
muzz.gotoAndPlay(2);
lasers.attachMovie("laser", "laser" + z, z++, {_x:fighter._x - 40, _y:fighter._y});
lasers.attachMovie("laser", "laser" + z, z++, {_x:fighter._x - -40, _y:fighter._y});
wait = 0;
}
function fireMissile() {
if (kisd(68)) {
if (missiles > 0) {
if (mwait >= mwaittime) {
missiles--;
missilemc.attachMovie("missile", "missile" + z, z++, {_x:fighter._x, _y:fighter._y + 50, n:z, speed:(accelspeed = 0), ease:5});
mwait = 0;
}
}
}
}
function explode(x, y, attach) {
kills++;
deadstuff.attachMovie(attach, "explosion" + z, z++, {_x:x, _y:y});
closest = 1000000 /* 0x0F4240 */;
}
function usepowerup(p) {
switch (p) {
case 1 :
sval = 81;
return;
case 2 :
hulnum = 100;
return;
case 3 :
rval = 81;
return;
case 4 :
missiles = ((missiles <= 15) ? (missiles - (-5)) : 20);
}
}
function makeboss() {
if (level == 2) {
enemies.attachMovie("miniboss", "boss", z++, {HP:100, maxHP:100, xspeed:0});
} else if (level == 4) {
enemies.attachMovie("mothership", "boss", z++, {HP:150, maxHP:150});
}
lockmovement = true;
noboss = false;
}
function setup() {
clearscreen();
minibosslaserspeed = 25;
minibossdamage = 10;
pMoveSpeed = 10;
smax = (sval = (rmax = (rval = 81)));
sincreasespeed = 0.45;
laserMoveSpeed = 50;
mAttack = 10;
mLaserSpeed = 25;
missiles = (mdamage = (bsl = 5));
mbsl = 6;
mspeed = (ldamage = (bsa = (sreducespeed = (rreducespeed = (mbsa = 1)))));
hulnum = 100;
rapfire = (shieldon = (overheating = (goingdown = (sP = (stopdistance = (mshooting = (lockmovement = false)))))));
limit = 15;
mwaittime = (boltDamage = 3);
boltHP = (bladeHP = (waittime = (bladeDamage = 4)));
canrap = (canshield = (begin = (xmissiles = (shotready = (noboss = true)))));
z = (_root.kills = (xspeed = (yspeed = (wait = (mwait = (overheat = (distance = (mshots = (frames = 0)))))))));
_root.createEmptyMovieClip("smoke", z++);
_root.createEmptyMovieClip("enemies", z++);
enemies.createEmptyMovieClip("bolts", z++);
enemies.createEmptyMovieClip("blades", z++);
_root.createEmptyMovieClip("lasers", z++);
_root.createEmptyMovieClip("missilemc", z++);
_root.createEmptyMovieClip("hazards", z++);
_root.createEmptyMovieClip("powerupsholder", z++);
_root.createEmptyMovieClip("bBs", z++);
if (level == 2) {
_root.createEmptyMovieClip("minibossbullets", z++);
}
if (level >= 3) {
turretbought = true;
}
_root.createEmptyMovieClip("deadstuff", z++);
attachMovie("crosshairs", "crosshair", z++, {_x:300});
attachMovie("makeSmoke", "makeSmoke", z++);
attachMovie("overheatmc", "heat", z++, {_xscale:30.4, _yscale:27.6, _x:529.5, _y:532.6});
attachMovie("thrusteh", "thrusters", z++, {_x:529.5, _y:532.6});
attachMovie("ship", "fighter", z++, {_xscale:30.4, _yscale:27.6, _x:529.5, _y:532.6});
attachMovie("muzzle", "muzz", z++, {_xscale:30.4, _yscale:27.6, _x:529.5, _y:532.6});
if (p2 || (turretbought)) {
attachMovie("player2", "player2", z++, {_x:fighter._x, _y:fighter._y(-p2offset)});
}
attachMovie("shield", "sheild", z++, {_x:592.5, _y:532.6, _yscale:110.4});
attachMovie("HUD", "HUD", z++, {_y:800, _x:700});
sheild.gotoAndStop(2);
endoflevel = levelLengthArray[level];
}
stop();
Mouse.hide();
allowEnterFrame = false;
attachMovie("cursor", "cursor", 10000000);
matan2 = Math.atan2;
mceil = Math.ceil;
mcos = Math.cos;
msin = Math.sin;
mran = Math.random;
kisd = Key.isDown;
kgc = Key.getCode;
kr = 39;
kl = 37;
ku = 38;
kd = 40;
ks = 32;
rt = Math.sqrt;
objective = (shots = (difficulty = 0));
p2offset = 35;
p2speed = 30;
rad = 0.0174532925199433 /* Math.PI/180 */;
bladeLaserSpeed = 45;
Stage.showMenu = false;
savefile = SharedObject.getLocal("WingCommander");
if (saveFile.data.pHchoice != undefined) {
phChoice = saveFile.data.pHchoice;
} else {
phChoice = (saveFile.data.phChoice = 1);
}
if (saveFile.data.enemyFreq != undefined) {
enemyFreq = saveFile.data.enemyFreq;
} else {
enemyFreq = (saveFile.data.enemyFreq = 40);
}
if (saveFile.data.quality != undefined) {
_quality = ((q = saveFile.data.quality));
} else {
_quality = ((q = (saveFile.data.quality = (saveFile.data.q = "MEDIUM"))));
}
if (saveFile.data.effects != undefined) {
effects = saveFile.data.effects;
effectsString = saveFile.data.effectsString;
} else {
effects = (saveFile.data.effects = 2);
effectsString = (saveFile.data.effectsString = "MEDIUM");
}
saveQuality = function () {
saveFile.data.quality = (saveFile.data.q = _quality);
saveFile.data.effects = effects;
saveFile.data.effectsString = effectsString;
saveFile.flush();
};
levelLengthArray = [null, 500, 750, 1000, 1000];
fscommand ("allowScale", true);
_root.onEnterFrame = function () {
cursor._x = _xmouse;
cursor._y = _ymouse;
if (_currentframe == 1) {
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = mceil(loadedbytes / 1024);
totalkbytes = mceil(totalbytes / 1024);
if (loadedbytes == totalbytes) {
gotoAndStop (2);
}
percentage = int(loadedbytes / (totalbytes / 100));
} else if (_currentframe == 3) {
if (allowEnterFrame) {
frames++;
wait++;
mwait++;
hud.rFire.gotoAndStop(((rapfire && (canrap)) ? 2 : 1));
if (campaignmode) {
if (distance >= endoflevel) {
stopdistance = true;
if (efound == 0) {
if (noboss) {
makeboss();
}
}
}
}
if (stopdistance == false) {
distance++;
spawnenemy();
} else if (stopdistance) {
if (frames > 30) {
if (level == 1) {
if (efound == 0) {
gotoAndStop (8);
clearscreen();
}
} else if (level == 2) {
if (!noboss) {
if (enemies.boss.HP != undefined) {
if (enemies.boss.HP <= 0) {
gotoAndStop (9);
clearscreen();
}
}
}
} else if (level == 3) {
if (efound == 0) {
gotoAndStop (10);
clearscreen();
}
} else if (level == 4) {
if (!noboss) {
if (enemies.boss.HP != undefined) {
if (enemies.boss.HP <= 0) {
gotoAndStop (11);
clearscreen();
}
}
}
}
}
}
spawnpowerup();
HUD.sh._xscale = (sval / smax) * 81;
if (HUD.sh._xscale > 0) {
canshield = true;
if (sheild._currentframe == 1) {
sval = sval - sreducespeed;
}
} else {
sheild.gotoAndStop(2);
canshield = false;
}
HUD.rap._xscale = (rval / rmax) * 81;
if (HUD.rap._xscale > 0) {
canrap = true;
if (rapfire) {
if (kisd(ks)) {
rval = rval - rreducespeed;
}
}
} else {
canrap = (rapfire = false);
}
i = 10;
while (i > 0) {
if ((hulnum <= (i * 10)) && (hulnum > ((i - 1) * 10))) {
HUD.hullinteg.gotoAndStop(11 - i);
}
i--;
}
if (hulnum <= 0) {
hulnum = 100;
if (frames > 10) {
_root.gotoAndStop(4);
}
}
HUD.hullbar.gotoAndStop(_root.hulnum + 1);
_root.hull = hulnum + "%";
for (var i in powerupsholder) {
p = powerupsholder[i];
p._y = p._y - (-pMoveSpeed);
if (fighter.hitTest(p)) {
usepowerup(p.n);
removeMovieClip(p);
}
if (p._y > 800) {
removeMovieClip(p);
}
}
for (var i in hazards) {
h = hazards[i];
h._y = h._y - (-h.speed);
if (h.shapeFlag) {
if (fighter.hitTest(h._x, h._y, true)) {
damagePlayer(h.damage);
if (h.remove) {
removeMovieClip(h);
}
}
} else if (fighter.hitTest(h)) {
damagePlayer(h.damage);
if (h.remove) {
removeMovieClip(h);
}
}
if (h._y > 800) {
removeMovieClip(h);
}
}
for (var i in minibossbullets) {
h = minibossbullets[i];
h._x = h._x - (-h.xspeed);
h._y = h._y - (-h.yspeed);
if (fighter.hitTest(h._x, h._y, true)) {
damagePlayer(h.damage);
removeMovieClip(h);
}
if (((h._y > 800) || (h._x > 700)) || (h._x < 0)) {
removeMovieClip(h);
}
}
if (noboss) {
closest = 1000000 /* 0x0F4240 */;
for (var i in enemies.bolts) {
eb = enemies.bolts[i];
eb._y = eb._y - (-eb.speed);
ydiff = eb._y - fighter._y;
xdiff = eb._x - fighter._x;
dist = (xdiff * xdiff) + (ydiff * ydiff);
if (dist < closest) {
closest = dist;
t1 = "bolts";
t2 = i;
}
if (eb._y > 900) {
for (var y in hazards) {
h = hazards[y];
if ((h.n = eb.n)) {
removeMovieClip(h);
}
}
removeMovieClip(eb);
}
}
for (var i in enemies.blades) {
eb = enemies.blades[i];
eb._y = eb._y - (-eb.speed);
ydiff = eb._y - fighter._y;
xdiff = eb._x - fighter._x;
dist = (xdiff * xdiff) + (ydiff * ydiff);
if (dist < closest) {
closest = dist;
t1 = "blades";
t2 = i;
}
if (xdiff > 0) {
eb.xspeed = ((eb.xspeed < bsl) ? (eb.xspeed - (-bsa)) : (eb.xspeed));
} else if (xdiff < 0) {
eb.xspeed = ((eb.xspeed > (-bsl)) ? (eb.xspeed - bsa) : (eb.xspeed));
}
eb._x = eb._x - eb.xspeed;
eb.gotoAndStop((((xdiff > -50) && (xdiff < 50)) ? 2 : 1));
if (enemies.blades[i]._y > 900) {
removeMovieClip(enemies.blades[i]);
}
}
crosshair._x = _root.enemies[t1][t2]._x;
crosshair._y = _root.enemies[t1][t2]._y;
} else if (level == 4) {
crosshair._x = eyehit._x;
crosshair._y = eyehit._y;
} else if (level == 2) {
if (enemies.boss._currentframe != 1) {
followBoss._x = (crosshair._x = bossCenter.x);
followBoss._y = (crosshair._y = bossCenter.y);
xdiff = bossCenter.x - fighter._x;
if (xdiff > 0) {
enemies.boss.xspeed = ((enemies.boss.xspeed < mbsl) ? (enemies.boss.xspeed - (-mbsa)) : enemies.boss.xspeed);
} else if (xdiff < 0) {
enemies.boss.xspeed = ((enemies.boss.xspeed > (-mbsl)) ? (enemies.boss.xspeed - mbsa) : enemies.boss.xspeed);
}
enemies.boss.body._x = enemies.boss.body._x - enemies.boss.xspeed;
}
}
for (var i in missilemc) {
mmc = missilemc[i];
if (crosshair._currentframe == 1) {
mcx = 0;
mcy = 300;
} else {
mcx = mmc._x - crosshair._x;
mcy = mmc._y - crosshair._y;
}
if ((!mmc.speed) == 0) {
if (mmc.speed < 25) {
mmc.accelspeed = mmc.accelspeed + 0.4;
mmc.speed = mmc.speed + (0.2 + mmc.accelspeed);
}
mmc.ease = Math.min(5, Math.ceil(rt((mcx * mcx) + (mcy * mcy)) / 100));
mmc._rotation = mmc._rotation + ((((-matan2(mcx, mcy)) / rad) - mmc._rotation) / mmc.ease);
}
mr = mmc._rotation * rad;
if (rt((mcx * mcx) + (mcy * mcy)) > mmc.speed) {
mmc._y = mmc._y - (mmc.speed * mcos(mr));
mmc._x = mmc._x - (-(mmc.speed * msin(mr)));
} else {
mmc._x = crosshair._x;
mmc._y = crosshair._y;
}
if ((mmc._y < -150) || (mmc._y > 900)) {
mmc.removeMovieClip();
}
if (mmc.hitTest(crosshair)) {
for (var j in enemies.blades) {
eb = enemies.blades[j];
if (eb.HP > 0) {
if (eb.hitTest(mmc)) {
eb.HP = eb.HP - mdamage;
if (eb.HP <= 0) {
explode(eb._x, eb._y, "bladex");
eb.removeMovieClip();
}
}
}
}
for (var j in enemies.bolts) {
eb = enemies.bolts[j];
if (eb.HP > 0) {
if (eb.hitTest(mmc)) {
eb.HP = eb.HP - mdamage;
if (eb.HP <= 0) {
explode(eb._x, eb._y, "boltex");
for (var y in hazards) {
h = hazards[y];
if ((h.n = eb.n)) {
removeMovieClip(h);
}
}
eb.removeMovieClip();
}
}
}
}
if (!noboss) {
if (level == 4) {
if (eyehit.hitTest(mmc._x, mmc._y, true)) {
if (enemies.boss.eye._currentframe != 1) {
if (enemies.boss.eye._currentframe != 2) {
if (enemies.boss.eye._currentframe != 79) {
enemies.boss.HP = enemies.boss.HP - mdamage;
enemies.boss.flash.gotoAndPlay(2);
}
}
}
}
} else if (level == 2) {
if (mmc._y > 50) {
enemies.boss.HP = enemies.boss.HP - mdamage;
}
}
}
mmc.removeMovieClip();
for (var x in missilemc) {
missilemc[x].ease = 4;
}
}
}
efound = 0;
for (var i in enemies) {
for (var j in enemies[i]) {
if (enemies[i][j].enemy) {
efound++;
}
}
}
if (!noboss) {
if (enemies.boss._currentframe > 1) {
efound++;
}
}
ms = 0;
for (var m in missilemc) {
ms++;
}
if (efound == 0) {
crosshair.gotoAndStop(1);
} else if (ms > 0) {
crosshair.play();
} else {
crosshair.gotoAndStop(1);
}
for (var i in bBs) {
b = bBs[i];
b._x = b._x + b.xspeed;
b._y = b._y + b.yspeed;
if ((((b._y < -10) || (b._y > 810)) || (b._x < -10)) || (b._x > 710)) {
b.removeMovieClip();
}
if (!noboss) {
if (level == 4) {
if (eyehit.hitTest(b._x, b._y, true)) {
enemies.boss.HP = enemies.boss.HP - ldamage;
enemies.boss.flash.gotoAndPlay(2);
b.removeMovieClip();
}
} else if (level == 2) {
if (b.hitTest(enemies.boss.body)) {
enemies.boss.HP = enemies.boss.HP - ldamage;
b.removeMovieClip();
}
}
}
for (var j in enemies.blades) {
eb = enemies.blades[j];
if (b.hitTest(eb)) {
eb.HP = eb.HP - ldamage;
if (eb.HP <= 0) {
explode(eb._x, eb._y, "bladex");
eb.removeMovieClip();
}
b.removeMovieClip();
}
}
for (var j in enemies.bolts) {
eb = enemies.bolts[j];
if (b.hitTest(eb)) {
eb.HP = eb.HP - ldamage;
if (eb.HP <= 0) {
for (var y in hazards) {
h = hazards[y];
if ((h.n = eb.n)) {
removeMovieClip(h);
}
}
explode(eb._x, eb._y, "boltex");
eb.removeMovieClip();
}
b.removeMovieClip();
}
}
}
for (var i in lasers) {
l = lasers[i];
l._y = l._y - laserMoveSpeed;
if (l._y < -10) {
l.removeMovieClip();
}
if (!noboss) {
if (level == 4) {
if (eyehit.hitTest(l._x, l._y, true)) {
enemies.boss.HP = enemies.boss.HP - ldamage;
enemies.boss.flash.gotoAndPlay(2);
l.removeMovieClip();
}
} else if (level == 2) {
if (l.hitTest(enemies.boss.body)) {
enemies.boss.HP = enemies.boss.HP - ldamage;
l.removeMovieClip();
}
}
}
for (var j in enemies.blades) {
eb = enemies.blades[j];
if (l.hitTest(eb)) {
eb.HP = eb.HP - ldamage;
if (eb.HP <= 0) {
explode(eb._x, eb._y, "bladex");
eb.removeMovieClip();
}
l.removeMovieClip();
}
}
for (var j in enemies.bolts) {
eb = enemies.bolts[j];
if (l.hitTest(eb)) {
eb.HP = eb.HP - ldamage;
if (eb.HP <= 0) {
for (var y in hazards) {
h = hazards[y];
if ((h.n = eb.n)) {
removeMovieClip(h);
}
}
explode(eb._x, eb._y, "boltex");
eb.removeMovieClip();
}
l.removeMovieClip();
}
}
}
if (kisd(ku)) {
thrusters.gotoAndStop("high");
} else if (kisd(kd)) {
thrusters.gotoAndStop("low");
} else if (kisd(kl)) {
thrusters.gotoAndStop("left");
} else if (kisd(kr)) {
thrusters.gotoAndStop("right");
}
fx = fighter._x - (-xspeed);
fy = fighter._y - (-yspeed);
if (fx >= 630) {
fighter._x = 630;
xspeed = 0;
}
if (fx <= 70) {
fighter._x = 70;
xspeed = 0;
}
if (fy <= 25) {
fighter._y = 25;
yspeed = 0;
}
if (fy >= 600) {
fighter._y = 600;
yspeed = 0;
}
fighter._y = fighter._y - (-yspeed);
fighter._x = fighter._x - (-xspeed);
if (lockmovement) {
if (level == 4) {
if (fighter._y < 300) {
if (enemies.boss._currentframe == 1) {
fighter._y = fighter._y + 6;
} else {
fighter._y = 300;
}
yspeed = 0;
}
} else if (level == 2) {
if (fighter._y < 200) {
if (enemies.boss._currentframe == 1) {
fighter._y = fighter._y - -6;
} else {
fighter._y = 200;
}
yspeed = 0;
}
}
}
if ((lastX == 1) && (xspeed <= limit)) {
xspeed++;
} else if ((lastX == -1) && (xspeed >= (-limit))) {
xspeed--;
}
if ((!kisd(kr)) && (xspeed > 0)) {
xspeed--;
} else if ((!kisd(kl)) && (xspeed < 0)) {
xspeed++;
}
if (kisd(ku) || (kisd(kd))) {
if ((lastY == 1) && (yspeed >= (-limit))) {
yspeed--;
} else if ((lastY == -1) && (yspeed <= limit)) {
yspeed++;
}
}
if ((!kisd(kd)) && (yspeed > 0)) {
yspeed--;
} else if ((!kisd(ku)) && (yspeed < 0)) {
yspeed++;
}
if (canshield) {
sheild.gotoAndStop((shieldon ? 1 : 2));
}
if (!overheating) {
if (kisd(ks)) {
if (rapfire) {
if (canrap) {
if (wait >= 2) {
HUD.heatbar.stop();
shoot();
}
}
} else if (!overheating) {
if (HUD.heatbar._currentframe > 61) {
if (!sP) {
HUD.heatbar.gotoAndPlay((120 - HUD.heatbar._currentframe) + 3);
sP = true;
}
} else {
HUD.heatbar.play();
}
goingdown = false;
if (wait >= waittime) {
shoot();
}
}
} else if (!goingdown) {
HUD.heatbar.gotoAndPlay((120 - HUD.heatbar._currentframe) + 3);
goingdown = true;
sP = false;
}
}
if (overheating) {
heat.gotoAndStop(2);
makeSmoke.play();
} else {
makeSmoke.gotoAndStop(1);
heat.gotoAndStop(1);
}
fireMissile();
if (!kisd(kr)) {
if (!kisd(kl)) {
if (!kisd(kd)) {
if (!kisd(ku)) {
thrusters.gotoAndStop("regular");
if (!kisd(ks)) {
fighter.gotoAndStop("idol");
}
}
}
}
}
if (mshooting) {
if (fighter.hitTest(mlaser)) {
if (sheild._currentframe == 2) {
hulnum = hulnum - 7;
}
}
}
thrusters._y = (sheild._y = (muzz._y = (heat._y = (player2._y = fighter._y))));
thrusters._x = (sheild._x = (muzz._x = (heat._x = (player2._x = fighter._x))));
if (p2) {
player2._x = fighter._x;
player2._y = fighter._y - (-p2offset);
var tRot = ((-matan2(player2._x - _xmouse, player2._y - _ymouse)) / rad);
player2._rotation = player2._rotation - ((player2._rotation - tROt) / 2);
} else if (turretbought) {
player2._x = fighter._x;
player2._y = fighter._y - (-p2offset);
var tRot = ((-matan2(player2._x - crosshair._x, player2._y - crosshair._y)) / rad);
player2._rotation = player2._rotation - ((player2._rotation - tROt) / 5);
if (efound > 0) {
if (!noboss) {
if (level == 4) {
if (eyehit._currentframe != 1) {
if (enemies.boss.eye._currentframe != 1) {
if (enemies.boss.eye._currentframe != 2) {
if (enemies.boss.eye._currentframe != 79) {
p2shoot();
}
}
}
}
} else if (enemies.boss._currentframe != 1) {
p2shoot();
}
} else {
p2shoot();
}
}
}
}
}
};
_root.onMouseDown = function () {
if (p2) {
p2shoot();
}
};
var k = {};
Key.addListener(k);
k.onKeyDown = function () {
var x = kgc();
if (x == 39) {
lastX = 1;
} else if (x == 37) {
lastX = -1;
} else if (x == 38) {
lastY = 1;
} else if (x == 40) {
lastY = -1;
}
};
k.onKeyUp = function () {
var x = kgc();
if (x == 83) {
rapfire = !rapfire;
}
if (x == 65) {
shieldon = !shieldon;
}
if (x == 39) {
lastX = -1;
} else if (x == 37) {
lastX = 1;
} else if (x == 38) {
lastY = -1;
} else if (x == 40) {
lastY = 1;
}
};
Frame 2
stop();
allowEnterFrame = false;
Frame 3
stopAllSounds();
clearscreen();
setup();
allowEnterFrame = true;
Instance of Symbol 461 MovieClip "aura" in Frame 3
onClipEvent (load) {
if (_root.effects == 1) {
gotoAndStop(_totalframes);
} else if (_root.effects == 2) {
gotoAndStop(_totalframes - 1);
}
}
Instance of Symbol 463 MovieClip "stars" in Frame 3
onClipEvent (load) {
switch (_root.effects) {
case 1 :
gotoAndStop(_totalframes);
break;
case 2 :
gotoAndStop(_totalframes - 1);
}
}
Frame 4
clearscreen();
if (!campaignmode) {
bestKills = saveFile.data.bestKills;
bestDistance = saveFile.data.bestDistance;
if (saveFile.data.bestKills == undefined) {
saveFile.data.bestKills = (bestKills = kills);
} else if (kills > saveFile.data.bestKills) {
saveFile.data.bestKills = (bestKills = kills);
}
if (saveFile.data.bestDistance == undefined) {
saveFile.data.bestDistance = (bestDistance = distance);
} else if (distance > saveFile.data.bestDistance) {
saveFile.data.bestDistance = (bestDistance = distance);
}
saveFile.flush();
}
Instance of Symbol 482 MovieClip in Frame 4
onClipEvent (load) {
gotoAndStop((_root.campaignmode ? 2 : 1));
}
Frame 5
function playerFunction(players) {
saveFile.data.pHchoice = (pHchoice = players);
pH.gotoAndStop(players);
p2 = ((players == 3) ? true : false);
turretbought = ((players == 1) ? false : true);
}
function sliderCallback() {
_root.enemyFreq = (saveFile.data.enemyFreq = mySlider.getValue());
saveFile.flush();
}
enemyFreq = saveFile.data.enemyFreq;
pH.gotoAndStop(pHchoice);
mySlider.slide._x = (75 - enemyFreq) * 1.53;
mySlider.setChangeHandler(sliderCallback);
playerFunction(1);
Instance of Symbol 490 MovieClip [SliderComponent] "mySlider" in Frame 5
//component parameters
onClipEvent (initialize) {
min = 75;
max = 10;
col = 6710886 /* 0x666666 */;
cchangeHandler = "";
}
Frame 6
welcome = (p2 ? "Welcome, recruits." : "Welcome, recruit.");
p2instructions = (p2 ? "Since you're on two-player campaign mode, player two is able to control the turret on your ship using the mouse." : "");
Frame 7
stop();
Frame 8
stop();
Frame 9
stop();
Frame 10
stop();
Frame 11
stop();
Symbol 7 MovieClip Frame 50
_root.createEmptyMovieClip("followBoss", z++, {_x:_parent._x, _y:_parent._y});
_parent.gotoAndStop(2);
Symbol 11 MovieClip Frame 1
Symbol 11 MovieClip Frame 2
_root.fire(_root.minibosslaserspeed, true, "minibossbullet", _root.minibossleftTurret.x, _root.minibossleftTurret.y, _root.minibossdamage, null, true);
Symbol 11 MovieClip Frame 16
_root.fire(_root.minibosslaserspeed, true, "minibossbullet", _root.minibossrightTurret.x, _root.minibossrightTurret.y, _root.minibossdamage, null, true);
Symbol 13 MovieClip Frame 1
_root.minibossmiddleturret = new Object();
_root.minibossmiddleturret.x = _x;
_root.minibossmiddleturret.y = _y;
localToGlobal(_root.minibossmiddleturret);
Symbol 13 MovieClip Frame 2
gotoAndPlay (1);
Symbol 17 MovieClip Frame 25
rotbyrad = (_rotation - -90) * _root.rad;
_root.minibossbullets.attachMovie("mbbluebullet", "mbbluebullet" + _root.z, _root.z++, {_x:_root.minibossmiddleTurret.x, _y:_root.minibossmiddleTurret.y, _rotation:_rotation - -90, xspeed:_root.msin(rotbyrad) * _root.minibosslaserspeed, yspeed:_root.mcos(rotbyrad) * (-_root.minibosslaserspeed), damage:_root.minibossdamage});
Symbol 18 MovieClip Frame 1
_root.bossCenter = new Object();
_root.bossCenter.x = _x;
_root.bossCenter.y = _y;
localToGlobal(_root.bossCenter);
Symbol 18 MovieClip Frame 2
gotoAndPlay (1);
Symbol 19 MovieClip Frame 1
_root.minibossleftTurret = new Object();
_root.minibossleftTurret.x = _x;
_root.minibossleftTurret.y = _y;
localToGlobal(_root.minibossleftTurret);
Symbol 19 MovieClip Frame 2
gotoAndPlay (1);
Symbol 20 MovieClip Frame 1
_root.minibossrightTurret = new Object();
_root.minibossrightTurret.x = _x;
_root.minibossrightTurret.y = _y;
localToGlobal(_root.minibossrightTurret);
Symbol 20 MovieClip Frame 2
gotoAndPlay (1);
Symbol 21 MovieClip Frame 1
_root.pivotpoint = new Object();
_root.pivotpoint.x = _x;
_root.pivotpoint.y = _y;
localToGlobal(_root.pivotpoint);
Symbol 21 MovieClip Frame 2
gotoAndPlay (1);
Instance of Symbol 17 MovieClip in Symbol 25 MovieClip Frame 1
onClipEvent (enterFrame) {
var targRot = (((-_root.matan2(_root.pivotpoint.x - _root.fighter._x, _root.pivotpoint.y - _root.fighter._y)) / _root.rad) - 90);
_rotation = targRot;
_parent.health._xscale = (_parent._parent.HP / _parent._parent.maxHP) * 100;
}
Symbol 26 MovieClip [miniboss] Frame 1
stop();
Symbol 32 MovieClip Frame 68
_parent.gotoAndStop(2);
Symbol 37 MovieClip Frame 53
_parent.gotoAndStop(3);
Symbol 51 MovieClip Frame 2
lpoint = new Object();
lpoint.x = lP._x;
lpoint.y = lP._y;
localToGlobal(lpoint);
_root.fire(_root.mLaserSpeed, true, "mLaser", lpoint.x, lpoint.y, _root.mAttack, null, true);
Symbol 51 MovieClip Frame 12
_root.mshots++;
if (_root.mshots < 11) {
gotoAndPlay (2);
} else {
stop();
}
Symbol 83 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 50
_root.eyehit.gotoAndStop(2);
_parent.gotoAndStop(3);
Symbol 97 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 5
gotoAndStop (1);
Symbol 108 MovieClip Frame 1
stop();
_parent.flash.gotoAndStop(1);
Symbol 108 MovieClip Frame 2
_parent.flash.gotoAndStop(1);
Symbol 108 MovieClip Frame 40
stop();
Symbol 108 MovieClip Frame 79
_parent.flash.gotoAndStop(1);
Symbol 137 MovieClip Frame 74
_parent.eye.gotoAndPlay(2);
Symbol 137 MovieClip Frame 178
_parent.gotoAndStop(4);
Symbol 163 MovieClip Frame 1
_root.mshooting = true;
_root.mlaser.gotoAndStop(2);
Symbol 163 MovieClip Frame 15
_parent.eye.gotoAndPlay(41);
Symbol 163 MovieClip Frame 43
_root.mshooting = false;
_root.mlaser.gotoAndStop(1);
Symbol 163 MovieClip Frame 205
_parent.gotoAndStop(5);
Symbol 164 MovieClip Frame 235
_root.mshots = 0;
_parent.gotoAndStop(3);
Symbol 165 MovieClip [mothership] Frame 1
stop();
Instance of Symbol 24 MovieClip in Symbol 165 MovieClip [mothership] Frame 2
onClipEvent (enterFrame) {
_xscale = ((_parent.HP / _parent.maxHP) * 100);
}
Symbol 167 MovieClip [cursor] Frame 1
stop();
Symbol 180 MovieClip Frame 1
_root.fire(_root.bladeLaserSpeed, true, "red", _parent._x - 25.6, _parent._y, _root.bladeDamage, _parent.name, false);
Symbol 180 MovieClip Frame 5
_root.fire(_root.bladeLaserSpeed, true, "red", _parent._x - -25.6, _parent._y, _root.bladeDamage, _parent.name, false);
Symbol 181 MovieClip [blade] Frame 1
stop();
Symbol 183 MovieClip Frame 18
_parent.gotoAndStop(2);
Symbol 187 MovieClip Frame 32
_root.fire(_parent.speed, false, "l1", _parent._x, _parent._y, _root.boltDamage, n, false);
Symbol 187 MovieClip Frame 34
_parent.gotoAndStop(1);
Symbol 188 MovieClip [bolt] Frame 1
stop();
Symbol 188 MovieClip [bolt] Frame 2
stop();
Symbol 205 MovieClip Frame 3
stop();
Symbol 206 MovieClip [thrusteh] Frame 1
stop();
Symbol 206 MovieClip [thrusteh] Frame 2
stop();
Symbol 206 MovieClip [thrusteh] Frame 3
stop();
Symbol 206 MovieClip [thrusteh] Frame 4
stop();
Symbol 206 MovieClip [thrusteh] Frame 5
stop();
Symbol 218 MovieClip [shield] Frame 1
stop();
Symbol 228 MovieClip [l1] Frame 16
removeMovieClip(this);
Symbol 231 MovieClip Frame 8
gotoAndPlay (1);
Symbol 236 MovieClip [missile] Frame 19
speed = _root.mspeed;
switch (_root.effects) {
case 1 :
this.stop();
break;
case 2 :
this.gotoAndPlay(29);
}
Symbol 236 MovieClip [missile] Frame 20
point = new Object();
point.x = rocket._x;
point.y = rocket._y;
localToGlobal(point);
_root.smoke.attachMovie("smokeh", "smokeh" + _root.z, _root.z++, {_x:point.x, _y:point.y});
Symbol 236 MovieClip [missile] Frame 21
gotoAndPlay (20);
Symbol 236 MovieClip [missile] Frame 28
removeMovieClip(_root.missilemc["missile" + name]);
Symbol 236 MovieClip [missile] Frame 29
point = new object();
point.x = rocket._x;
point.y = rocket._y;
localToGlobal(point);
_root.smoke.attachMovie("smokeh", "smokeh" + _root.z, _root.z++, {_x:point.x, _y:point.y});
Symbol 236 MovieClip [missile] Frame 31
gotoAndPlay (29);
Symbol 238 MovieClip [crosshairs] Frame 1
stop();
Symbol 238 MovieClip [crosshairs] Frame 11
stop();
Symbol 238 MovieClip [crosshairs] Frame 12
prevFrame();
Symbol 249 MovieClip Frame 10
removeMovieClip(_parent);
Symbol 259 MovieClip Frame 11
removeMovieClip(_parent);
Symbol 262 MovieClip [muzzle] Frame 1
stop();
Symbol 282 MovieClip Frame 1
stop();
Symbol 316 MovieClip Frame 1
stop();
Symbol 316 MovieClip Frame 60
_root.overheating = true;
Symbol 316 MovieClip Frame 61
_root.overheating = true;
Symbol 316 MovieClip Frame 121
_root.overheating = false;
gotoAndStop (1);
Symbol 318 MovieClip Frame 1
stop();
Instance of Symbol 269 MovieClip in Symbol 319 MovieClip [HUD] Frame 1
onClipEvent (load) {
_visible = (_root.distanceon ? true : false);
}
Instance of Symbol 292 MovieClip "hullbar" in Symbol 319 MovieClip [HUD] Frame 1
onClipEvent (load) {
gotoAndStop (101);
}
Symbol 321 MovieClip [smokeh] Frame 10
removeMovieClip(this);
Symbol 326 MovieClip [overheatmc] Frame 1
stop();
Symbol 327 MovieClip [makeSmoke] Frame 1
stop();
Symbol 327 MovieClip [makeSmoke] Frame 2
if (_root.effects == 3) {
play();
} else if (_root.effects == 2) {
gotoAndPlay (5);
} else {
gotoAndPlay (7);
}
Symbol 327 MovieClip [makeSmoke] Frame 3
_root.overheatSmoke();
Symbol 327 MovieClip [makeSmoke] Frame 4
gotoAndPlay (3);
Symbol 327 MovieClip [makeSmoke] Frame 5
_root.overheatSmoke();
Symbol 327 MovieClip [makeSmoke] Frame 7
gotoAndPlay (5);
Symbol 327 MovieClip [makeSmoke] Frame 8
_root.overheatSmoke();
Symbol 327 MovieClip [makeSmoke] Frame 11
gotoAndPlay (8);
Symbol 333 MovieClip Frame 1
_root.shotready = true;
stop();
Symbol 333 MovieClip Frame 2
p2byrad = _root.player2._rotation * _root.rad;
_root.bBs.attachMovie("bB", "bB" + _root.z, _root.z++, {_x:_root.p.x, _y:_root.p.y, _rotation:_root.player2._rotation, xspeed:_root.msin(p2byrad) * _root.p2speed, yspeed:_root.mcos(p2byrad) * (-_root.p2speed)});
_root.shotready = false;
Symbol 333 MovieClip Frame 5
this.gotoAndStop(1);
Symbol 334 MovieClip [player2] Frame 1
_root.p = new object();
_root.p.x = turret._x;
_root.p.y = turret._y;
localToGlobal(_root.p);
Symbol 334 MovieClip [player2] Frame 2
gotoAndPlay (1);
Symbol 348 Button
on (release) {
getURL ("http://www.gamesgamesgames.co.uk", "_blank");
}
Symbol 351 Button
on (release) {
getURL ("http://www.wildfiredesigns.net", "_blank");
}
Symbol 373 Button
on (press) {
_quality = ((_root.q = "LOW"));
}
Symbol 376 Button
on (press) {
_quality = ((_root.q = "MEDIUM"));
}
Symbol 379 Button
on (press) {
_quality = ((_root.q = "HIGH"));
}
Symbol 385 Button
on (press) {
_root.effects = 1;
_root.effectsString = "NONE";
}
Symbol 386 Button
on (press) {
_root.effects = 2;
_root.effectsString = "MEDIUM";
}
Symbol 387 Button
on (press) {
_root.effects = 3;
_root.effectsString = "HIGH";
}
Symbol 393 Button
on (press) {
gotoAndStop (1);
_root.bHolder.gotoAndStop(1);
_root.saveQuality();
}
Symbol 394 MovieClip Frame 1
stop();
Symbol 394 MovieClip Frame 2
_root.q = _quality;
_root.bHolder.gotoAndStop(2);
Symbol 402 Button
on (press) {
playMode.gotoAndPlay(2);
}
Symbol 406 Button
on (press) {
_root.info.gotoAndStop(2);
}
Symbol 412 Button
on (release) {
_root.gotoAndStop(5);
_root.campaignMode = false;
}
Symbol 414 Button
on (release) {
gotoAndStop (2);
}
Symbol 417 Button
on (release) {
if (_root.savefile.data.level != undefined) {
_root.campaignMode = true;
_root.level = _root.savefile.data.level;
_root.cash = _root.savefile.data.cash;
_root.p2 = _root.savefile.data.p2;
_root.gotoAndStop(6);
} else {
noSave.gotoAndPlay(2);
}
}
Symbol 419 Button
on (release) {
gotoAndStop (3);
}
Symbol 421 MovieClip Frame 1
stop();
Symbol 423 Button
on (release) {
_root.deleteSave();
_root.savefile.data.p2 = (_root.p2 = (_root.campaignMode = true));
_root.savefile.data.level = (_root.level = 1);
_root.savefile.flush();
_root.gotoAndStop(6);
}
Symbol 425 Button
on (release) {
_root.deleteSave();
_root.savefile.data.p2 = (_root.p2 = false);
_root.savefile.data.level = (_root.level = 1);
_root.savefile.flush();
_root.campaignMode = true;
_root.gotoAndStop(6);
}
Symbol 426 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 10
stop();
Symbol 431 Button
on (release) {
_root.graphicsOptions.gotoAndStop(2);
}
Symbol 432 MovieClip Frame 1
stop();
Symbol 447 Button
on (press) {
gotoAndStop (1);
_root.bHolder.gotoAndStop(1);
}
Symbol 448 MovieClip Frame 1
stop();
Symbol 448 MovieClip Frame 2
_root.bHolder.gotoAndStop(2);
Symbol 456 MovieClip Frame 33
stop();
Symbol 461 MovieClip Frame 151
gotoAndPlay (1);
Symbol 463 MovieClip Frame 251
gotoAndPlay (1);
Symbol 463 MovieClip Frame 253
stop();
Symbol 465 MovieClip Frame 1
stop();
Symbol 467 MovieClip Frame 1
stop();
Symbol 471 Button
on (release) {
gotoAndStop((campaignMode ? 6 : 5));
}
Symbol 482 MovieClip Frame 1
stop();
Symbol 490 MovieClip [SliderComponent] Frame 1
#initclip 1
function Slider() {
this.colObj = new Color(this.slide.slideColor);
this.colObj.setRGB(this.col);
}
Slider.prototype = new MovieClip();
Slider.prototype.changeHandler = null;
Slider.prototype.onLoad = function () {
this.slide.onPress = function () {
var r = this._parent.range._width;
this.startDrag(true, 0, 0, r, 0);
};
this.slide.onRelease = function () {
this.stopDrag();
if (this._parent.changeHandler != null) {
this._parent.changeHandler();
}
};
};
Slider.prototype.getValue = function () {
var r = (this.max - this.min);
var v = (((this.slide._x / this.range._width) * r) + this.min);
return(Math.round(v));
};
Slider.prototype.setMin = function (min) {
this.min = min;
};
Slider.prototype.setMax = function (max) {
this.max = max;
};
Slider.prototype.setColor = function (col) {
this.colObj.setRGB(col);
};
Slider.prototype.setChangeHandler = function (funct) {
this.changeHandler = funct;
};
Object.registerClass("SliderComponent", Slider);
#endinitclip
Symbol 496 MovieClip Frame 1
stop();
Symbol 498 Button
on (release) {
playerFunction(1);
}
Symbol 501 Button
on (release) {
p2 = ((phChoice == 3) ? true : false);
turretbought = ((phChoice == 1) ? false : true);
campaignmode = (stopdistance = false);
distanceon = true;
gotoAndStop (3);
}
Symbol 503 Button
on (release) {
gotoAndStop (2);
}
Symbol 504 Button
on (release) {
playerFunction(2);
}
Symbol 506 Button
on (release) {
playerFunction(3);
}
Symbol 513 Button
on (release) {
distanceon = true;
turretbought = (p2 ? true : (level > 2));
gotoAndStop(7 + (level - 1));
}
Symbol 517 MovieClip Frame 11
stop();
_root.level = (_root.savefile.data.level = 1);
_root.enemyFreq = 40;
_root.savefile.flush();
_root.gotoAndStop(3);
Symbol 519 MovieClip Frame 11
stop();
_root.level = (_root.savefile.data.level = 2);
_root.enemyFreq = 35;
_root.savefile.flush();
_root.gotoAndStop(3);
Symbol 521 MovieClip Frame 108
stop();
_root.setup();
_root.level = (_root.savefile.data.level = 3);
_root.enemyFreq = 32;
_root.savefile.flush();
_root.gotoAndStop(3);
Symbol 523 MovieClip Frame 18
stop();
_root.level = (_root.savefile.data.level = 4);
_root.savefile.flush();
_root.enemyFreq = 28;
_root.gotoAndStop(3);
Symbol 525 MovieClip Frame 35
stop();
_root.level = (_root.savefile.data.level = 1);
_root.savefile.flush();
_root.gotoAndStop(2);