[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 2 (1.02 KiB) ●
stop();
_global.upgraded = false;
if (!_global.upgraded) {
_global.curShieldOre = 0;
_global.curWeaponOre = 0;
_global.curBulletOre = 0;
_global.curEngineOre = 0;
} else {
_global.curShieldOre = 850;
_global.curWeaponOre = 500;
_global.curBulletOre = 850;
_global.curEngineOre = 500;
}
_global.netShieldOre = 0;
_global.netWeaponOre = 0;
_global.netBulletOre = 0;
_global.netEngineOre = 0;
_global.pShieldsMax = 16;
_global.pWeaponsMax = 3;
_global.pBulletsMax = 3;
_global.pEnginesMax = 3;
_global.pShields = 8;
_global.pWeapons = 0;
_global.pBullets = 0;
_global.pEngines = 0;
_global.curLevel = -1;
_global.win = false;
_global.levelComplete = false;
_global.lostLevel = false;
_global.bossSlain = false;
_global.bossSpawned = false;
song = new Sound();
song.attachSound("acquire");
_root.startFighterButton.onRelease = function () {
stopAllSounds();
song.start();
gotoAndPlay (2);
};
_root.startHarvesterButton.onRelease = function () {
stopAllSounds();
song.start();
gotoAndPlay (4);
};
Instance of Symbol 61 MovieClip "mainStars" in Frame 2 (184 B)
onClipEvent (load) {
this._x = -50;
starsSpeed = 4;
}
onClipEvent (enterFrame) {
this._x = this._x - starsSpeed;
if (this._x <= ((-_width) - 50)) {
this._x = _width - 51;
}
}
Instance of Symbol 61 MovieClip "mainStars" in Frame 2 (192 B)
onClipEvent (load) {
this._x = _width - 51;
starsSpeed = 4;
}
onClipEvent (enterFrame) {
this._x = this._x - starsSpeed;
if (this._x <= ((-_width) - 50)) {
this._x = _width - 51;
}
}
Frame 3 (6.05 KiB) ● ●
function initPShields() {
i = 1;
while (i <= _global.pShieldsMax) {
if (i <= _global.pShields) {
_root["pShieldBubble" + i]._visible = true;
} else {
_root["pShieldBubble" + i]._visible = false;
}
i++;
}
}
function initPWeapons() {
i = 1;
while (i <= _global.pWeaponsMax) {
if (i <= _global.pWeapons) {
_root["pWeaponBubble" + i]._visible = true;
} else {
_root["pWeaponBubble" + i]._visible = false;
}
i++;
}
}
function initPBullets() {
i = 1;
while (i <= _global.pBulletsMax) {
if (i <= _global.pBullets) {
_root["pBulletBubble" + i]._visible = true;
} else {
_root["pBulletBubble" + i]._visible = false;
}
i++;
}
}
function initPEngines() {
i = 1;
while (i <= _global.pEnginesMax) {
if (i <= _global.pEngines) {
_root["pEngineBubble" + i]._visible = true;
} else {
_root["pEngineBubble" + i]._visible = false;
}
i++;
}
}
function initOreMeters() {
_root.curOreMeter1._width = (79 * _global.curShieldOre) / 100;
_root.curOreMeter2._x = _root.curOreMeter1._width + _root.curOreMeter1._x;
_root.curOreMeter2._width = (79 * _global.curBulletOre) / 100;
_root.curOreMeter3._x = _root.curOreMeter2._width + _root.curOreMeter2._x;
_root.curOreMeter3._width = (79 * _global.curEngineOre) / 100;
_root.curOreMeter4._x = _root.curOreMeter3._width + _root.curOreMeter3._x;
_root.curOreMeter4._width = (79 * _global.curWeaponOre) / 100;
_root.netOreMeter1._width = 260 * Math.min(1, _global.netShieldOre / shieldUp[_global.pShields]);
_root.netOreMeter2._width = 260 * Math.min(1, _global.netBulletOre / bulletUp[_global.pBullets]);
_root.netOreMeter3._width = 260 * Math.min(1, _global.netEngineOre / engineUp[_global.pEngines]);
_root.netOreMeter4._width = 260 * Math.min(1, _global.netWeaponOre / weaponUp[_global.pWeapons]);
}
function updateOreMeters() {
if (_global.netShieldOre >= shieldUp[_global.pShields]) {
_global.netShieldOre = 0;
_global.pShields++;
if (_global.pShields > _global.pShieldsMax) {
_global.pShields = _global.pShieldsMax;
}
initPShields();
}
if (_global.netWeaponOre >= weaponUp[_global.pWeapons]) {
_global.netWeaponOre = 0;
_global.pWeapons++;
if (_global.pWeapons > _global.pWeaponsMax) {
_global.pWeapons = _global.pWeaponsMax;
}
initPWeapons();
}
if (_global.netBulletOre >= bulletUp[_global.pBullets]) {
_global.netBulletOre = 0;
_global.pBullets++;
if (_global.pBullets > _global.pBulletsMax) {
_global.pBullets = _global.pBulletsMax;
}
initPBullets();
}
if (_global.netEngineOre >= engineUp[_global.pEngines]) {
_global.netEngineOre = 0;
_global.pEngines++;
if (_global.pEngines > _global.pEnginesMax) {
_global.pEngines = _global.pEnginesMax;
}
initPEngines();
}
initOreMeters();
}
stop();
_root.world._visible = false;
_root.continueButton._visible = false;
_root.quitButton._visible = false;
shieldUp = [25, 25, 25, 50, 50, 50, 50, 50, 75, 75, 75, 75, 75, 100, 100, 100, 100];
bulletUp = [100, 200, 300, 300];
engineUp = [60, 100, 200, 200];
weaponUp = [60, 100, 200, 200];
upgradeToLevel = [0, 0, 1, 1, 2, 2, 3, 3, 3, 4];
levelOffset = 2;
_global.levelComplete = false;
text = "";
newLevelText = ["Your instructors have told me that you're quite the pilot, but I won't believe it until I've seen you in action. There's a light alien infestation in the Altepa System. We want you to blast as many of them as you can, gathering their hulls so our scientists can research alien technology. Green Interceptor hulls can be used to patch up your shields. But remember that you'll have to return to base with a full hold to get any repairs or changes done.", "Excellent work in the Altepa System. We'll be moving in to protect Baraska Nine shortly.\n\nOur scientists can augment your ship with alien weaponry if you bring back enough hulls. Red Fighter hulls can enhance the strength of your weapons, blue Carrier hulls let us upgrade your engines, and purple Destroyer hulls will give you a spread shot.", "You've been doing well so far, but don't let that go to your head. We are now advancing into the Czennia, alien space, so you can expect harder combat to come.\n\nBe especially wary of the alien Carriers; their armor is thick, but even worse, they spawn Interceptors like there's no tomorrow.", "The Drekkar System houses one of the alien motherships and is particularly well defended.\n\nIt is your mission to eliminate the alien defenders and destroy that mothership! You should expect bitter resistance, but from what I've seen of you, that won't be a problem.", "Your success in battle has made you quite the hero. My superiors inform me that they intend to set up an advance research station in the Drekkar System in the near future. If you like flying and are interested in earning a few extra bucks, I'm sure they would appreciate having you aboard to help collect resources. \n\nYOU WIN"];
oldLevelText = ["Not bad, but there are still some aliens pestering Altepa. Before we can move on, you'll have to take a few more of 'em out.\n\nAlso, our scientists are requesting materials from the bigger ships. Be sure to collect a few hulls for them.", "Baraska Nine still needs your help.\n\nDon't forget to gather alien hulls.", "The Czennia is just the gateway to the alien territories.\n\nDon't waste too much time here; we need to press harder or the aliens will have time to counter attack.", "With more effort like that, the Drekkar threat will soon be no more.\n\nGood work out there, but it's not over yet."];
loseLevelText = ["Not bad for your first time out.\n\nLet's see if you can do better next time.", "Baraska Nine cannot hold the aliens off on their own!\n\nGet back out there, soldier.", "Don't let the Czennia get the best of you.\n\nIt's a twisted streach of space, but you can get through it.", "Understand that casualties are a part of war, but also that you must keep fighting in spite of them.\n\nKeep going. I know you can do it."];
newLevel = true;
loseLevel = true;
fillupSound = new Sound();
fillupSound.attachSound("power");
Instance of Symbol 88 MovieClip "world" in Frame 3 (2.65 KiB) ●
onClipEvent (load) {
done = false;
textdone = false;
soundstart = false;
curFrame = 0;
doneFrame = 0;
textdoneFrame = 0;
delay = 24;
if (!_global.upgraded) {
oreRate = 5;
} else {
oreRate = 10;
}
textdelay = 60;
textrate = 4;
curText = "";
_root.initPShields();
_root.initPWeapons();
_root.initPBullets();
_root.initPEngines();
_root.initOreMeters();
}
onClipEvent (enterFrame) {
curFrame++;
if ((curFrame > delay) and (!done)) {
if ((!soundstart) and (!((((_global.curShieldOre == 0) and (_global.curWeaponOre == 0)) and (_global.curBulletOre == 0)) and (_global.curEngineOre == 0)))) {
_root.fillupSound.start();
soundStart = true;
}
if (_global.curShieldOre > 0) {
_global.curShieldOre = _global.curShieldOre - oreRate;
_global.netShieldOre = _global.netShieldOre + oreRate;
}
if (_global.curWeaponOre > 0) {
_global.curWeaponOre = _global.curWeaponOre - oreRate;
_global.netWeaponOre = _global.netWeaponOre + oreRate;
}
if (_global.curBulletOre > 0) {
_global.curBulletOre = _global.curBulletOre - oreRate;
_global.netBulletOre = _global.netBulletOre + oreRate;
}
if (_global.curEngineOre > 0) {
_global.curEngineOre = _global.curEngineOre - oreRate;
_global.netEngineOre = _global.netEngineOre + oreRate;
}
_root.updateOreMeters();
if ((((_global.curShieldOre == 0) and (_global.curWeaponOre == 0)) and (_global.curBulletOre == 0)) and (_global.curEngineOre == 0)) {
done = true;
doneFrame = curFrame;
oldLevel = _global.curLevel;
_global.curLevel = _root.upgradeToLevel[(_global.pBullets + _global.pEngines) + _global.pWeapons];
if ((((!_global.bossSlain) and (_global.pBullets == 3)) and (_global.pEngines == 3)) and (_global.pWeapons == 3)) {
_global.curLevel--;
}
if (_global.curLevel == 4) {
_global.win = true;
curText = _root.newLevelText[4];
} else if (_global.lostLevel) {
curText = _root.loseLevelText[_global.curLevel];
} else if (oldLevel != _global.curLevel) {
curText = _root.newLevelText[_global.curLevel];
} else {
curText = _root.oldLevelText[_global.curLevel];
}
_global.bossSpawned = false;
_global.lostLevel = false;
}
} else if (done) {
if (soundstart) {
_root.fillupSound.stop();
soundStart = false;
}
_root.continueButton._visible = true;
_root.quitButton._visible = true;
if ((!textdone) and (((curFrame - doneFrame) * textrate) < curText.length)) {
i = 0;
while (i < textrate) {
_root.text = _root.text + curText.charAt((((curFrame - doneFrame) - 1) * textrate) + i);
i++;
}
} else if (!textdone) {
_root.text = curText;
textdone = true;
textdoneFrame = curFrame;
}
}
}
Frame 4 (6.78 KiB) ● ●
function spawnAlien(clip, x, y, rot) {
newEnemy = "alien_" + _root.curEnemy;
clip.duplicateMovieClip(newEnemy, _root.curEnemy + _root.enemyDepth);
_root[newEnemy]._x = x;
_root[newEnemy]._y = y;
_root[newEnemy]._rotation = rot;
_root.curEnemy++;
if (_root.curEnemy > _root.enemyMax) {
_root.curEnemy = 0;
}
}
function spawnAlienBoss(clip, x, y, rot) {
newEnemy = "alien_boss";
clip.duplicateMovieClip(newEnemy, _root.bossDepth);
_root[newEnemy]._x = x;
_root[newEnemy]._y = y;
_root[newEnemy]._rotation = rot;
}
function spawnPBullet(clip, x, y, rot) {
newBullet = "pBullet_" + _root.curPBullet;
clip.duplicateMovieClip(newBullet, _root.curPBullet + _root.pBulletDepth);
_root[newBullet]._x = x;
_root[newBullet]._y = y;
_root[newBullet]._rotation = rot;
_root.curPBullet++;
if (_root.curPBullet > _root.pBulletMax) {
_root.curPBullet = 0;
}
}
function spawnEBullet(clip, x, y, rot) {
newBullet = "eBullet_" + _root.curEBullet;
clip.duplicateMovieClip(newBullet, _root.curEBullet + _root.eBulletDepth);
_root[newBullet]._x = x;
_root[newBullet]._y = y;
_root[newBullet]._rotation = rot;
_root.curEBullet++;
if (_root.curEBullet > _root.eBulletMax) {
_root.curEBullet = 0;
}
}
function spawnOre(clip, x, y, rot) {
newOre = "ore_" + _root.curOre;
clip.duplicateMovieClip(newOre, _root.curOre + _root.oreDepth);
_root[newOre]._x = x;
_root[newOre]._y = y;
_root[newOre]._rotation = rot;
_root.curOre++;
if (_root.curOre > _root.oreMax) {
_root.curOre = 0;
}
}
function ellipticHitTest(e1, e2) {
deltaX = e2._x - e1._x;
deltaY = e2._y - e1._y;
dist = Math.sqrt((deltaX * deltaX) + (deltaY * deltaY));
theta = Math.atan2(deltaY, deltaX);
cosETheta = Math.cos(theta - ((e1._rotaion * Math.PI) / 180));
cosPTheta = Math.cos((theta - Math.PI) - ((e2._rotaion * Math.PI) / 180));
r1 = e1.a * Math.sqrt((1 - e1.e_sq) / (1 - ((e1.e_sq * cosETheta) * cosETheta)));
r2 = e2.a * Math.sqrt((1 - e2.e_sq) / (1 - ((e2.e_sq * cosPTheta) * cosPTheta)));
return((r1 + r2) > dist);
}
function initPShields() {
p = _root.activePlayer;
i = 1;
while (i <= _global.pShieldsMax) {
if (i <= p.shields) {
_root["pShieldBubble" + i]._visible = true;
} else {
_root["pShieldBubble" + i]._visible = false;
}
i++;
}
}
function updatePShields(delta) {
p = _root.activePlayer;
p.shields = p.shields + delta;
_root.initPShields();
p.gotoAndPlay(2);
if (p.shields <= 0) {
p.gotoAndPlay(p.deathAnim);
_root.scrollSpeed = -50;
_global.levelComplete = true;
_global.lostLevel = true;
}
}
function initPWeapons() {
p = _root.activePlayer;
i = 1;
while (i <= _global.pWeaponsMax) {
if (i <= p.weapons) {
_root["pWeaponBubble" + i]._visible = true;
} else {
_root["pWeaponBubble" + i]._visible = false;
}
i++;
}
}
function updatePWeapons(delta) {
p = _root.activePlayer;
p.weapons = p.weapons + delta;
_root.initPWeapons();
}
function initPBullets() {
p = _root.activePlayer;
i = 1;
while (i <= _global.pBulletsMax) {
if (i <= p.bullets) {
_root["pBulletBubble" + i]._visible = true;
} else {
_root["pBulletBubble" + i]._visible = false;
}
i++;
}
}
function updatePBullets(delta) {
p = _root.activePlayer;
p.bullets = p.bullets + delta;
_root.initPBullets();
}
function initPEngines() {
p = _root.activePlayer;
i = 1;
while (i <= _global.pEnginesMax) {
if (i <= p.engines) {
_root["pEngineBubble" + i]._visible = true;
} else {
_root["pEngineBubble" + i]._visible = false;
}
i++;
}
}
function updatePEngines(delta) {
p = _root.activePlayer;
p.engines = p.engines + delta;
_root.initPEngines();
}
function initPEnergy() {
p = _root.activePlayer;
_root.energy._width = (196 * p.energy) / 100;
}
function updatePEnergy(delta) {
p = _root.activePlayer;
p.energy = p.energy + delta;
if (p.energy > 100) {
p.energy = 100;
}
if (p.energy < 0) {
p.energy = 0;
}
_root.initPEnergy();
}
function updatePCooldown(delta) {
p = _root.activePlayer;
p.cooldown = p.cooldown + delta;
if (p.cooldown > 100) {
p.cooldown = 100;
}
if (p.cooldown < 0) {
p.cooldown = 0;
}
}
function initPOreMeters() {
p = _root.activePlayer;
_root.oreMeter1._width = (79 * p.ore1) / 100;
_root.oreMeter2._x = _root.oreMeter1._width + _root.oreMeter1._x;
_root.oreMeter2._width = (79 * p.ore2) / 100;
_root.oreMeter3._x = _root.oreMeter2._width + _root.oreMeter2._x;
_root.oreMeter3._width = (79 * p.ore3) / 100;
_root.oreMeter4._x = _root.oreMeter3._width + _root.oreMeter3._x;
_root.oreMeter4._width = (79 * p.ore4) / 100;
}
function updatePOre1(delta) {
p = _root.activePlayer;
p.ore1 = p.ore1 + delta;
if ((((p.ore1 + p.ore2) + p.ore3) + p.ore4) > _root.oreCapacity) {
p.ore1 = _root.oreCapacity - ((p.ore2 + p.ore3) + p.ore4);
}
if (p.ore1 < 0) {
p.ore1 = 0;
}
_root.initPOreMeters();
}
function updatePOre2(delta) {
p = _root.activePlayer;
p.ore2 = p.ore2 + delta;
if ((((p.ore1 + p.ore2) + p.ore3) + p.ore4) > _root.oreCapacity) {
p.ore2 = _root.oreCapacity - ((p.ore1 + p.ore3) + p.ore4);
}
if (p.ore2 < 0) {
p.ore2 = 0;
}
_root.initPOreMeters();
}
function updatePOre3(delta) {
p = _root.activePlayer;
p.ore3 = p.ore3 + delta;
if ((((p.ore1 + p.ore2) + p.ore3) + p.ore4) > _root.oreCapacity) {
p.ore3 = _root.oreCapacity - ((p.ore1 + p.ore2) + p.ore4);
}
if (p.ore3 < 0) {
p.ore3 = 0;
}
_root.initPOreMeters();
}
function updatePOre4(delta) {
p = _root.activePlayer;
p.ore4 = p.ore4 + delta;
if ((((p.ore1 + p.ore2) + p.ore3) + p.ore4) > _root.oreCapacity) {
p.ore4 = _root.oreCapacity - ((p.ore1 + p.ore2) + p.ore3);
}
if (p.ore4 < 0) {
p.ore4 = 0;
}
_root.initPOreMeters();
}
stop();
h = 400;
w = 550;
playerDepth = 0;
bossDepth = 1;
enemyDepth = 2;
enemyMax = 60;
curEnemy = 0;
pBulletDepth = enemyDepth + enemyMax;
pBulletMax = 60;
curPBullet = 0;
eBulletDepth = pBulletDepth + pBulletMax;
eBulletMax = 60;
curEBullet = 0;
oreDepth = eBulletDepth + eBulletmax;
oreMax = 60;
curOre = 0;
oreReward = 20;
oreCapacity = 400;
_root.world._visible = false;
_root.pauseText._visible = false;
_root.player._visible = false;
_root.pBullet1._visible = false;
_root.alien1._visible = false;
_root.alien2._visible = false;
_root.alien3._visible = false;
_root.alien4._visible = false;
_root.alienBoss._visible = false;
_root.eBullet1._visible = false;
_root.eBullet2._visible = false;
_root.ore1._visible = false;
_root.ore2._visible = false;
_root.ore3._visible = false;
_root.ore4._visible = false;
_root.player.duplicateMovieClip("activePlayer", 0);
_root.activePlayer._x = 50;
_root.activePlayer._y = h / 2;
_root.activePlayer._rotation = 0;
scrollSpeed = -5;
Instance of Symbol 88 MovieClip "world" in Frame 4 (8.78 KiB) ● ●
onClipEvent (load) {
function formation1() {
x = _root.w + 100;
y = ((_root.h / 2) + random(300)) - 150;
_root.spawnAlien(_root.alien1, x, y, 0);
}
function formation2() {
count = 3;
xs = [0, 50, 50];
ys = [0, -75, 75];
yrand = random(300) - 150;
i = 0;
while (i < count) {
x = (_root.w + 100) + xs[i];
y = ((_root.h / 2) + yrand) + ys[i];
_root.spawnAlien(_root.alien1, x, y, 0);
i++;
}
}
function formation3() {
count = 5;
xs = [0, 0, 0, 0, 0];
ys = [0, -100, 100, -200, 200];
yrand = 0;
i = 0;
while (i < count) {
x = (_root.w + 100) + xs[i];
y = ((_root.h / 2) + yrand) + ys[i];
_root.spawnAlien(_root.alien1, x, y, 0);
i++;
}
}
function formation4() {
count = 3;
xs = [0, 50, 100];
ys = [0, 0, 0];
yrand = random(300) - 150;
i = 0;
while (i < count) {
x = (_root.w + 100) + xs[i];
y = ((_root.h / 2) + yrand) + ys[i];
_root.spawnAlien(_root.alien1, x, y, 0);
i++;
}
}
function formation5() {
count = 4;
xs = [0, 50, 0, 50];
ys = [0, 0, 50, 50];
yrand = random(300) - 150;
i = 0;
while (i < count) {
x = (_root.w + 100) + xs[i];
y = ((_root.h / 2) + yrand) + ys[i];
_root.spawnAlien(_root.alien1, x, y, 0);
i++;
}
}
function formation6() {
x = ((2 * _root.w) / 3) + random(200);
topOrBot = random(2);
if (topOrBot < 1) {
y = (-random(100)) - 100;
rot = -30;
} else {
y = (_root.h + random(100)) + 100;
rot = 30;
}
_root.spawnAlien(_root.alien2, x, y, rot);
}
function formation7() {
x = ((2 * _root.w) / 3) + random(300);
yrand = random(100);
_root.spawnAlien(_root.alien2, x, (_root.h + yrand) + 100, 30);
_root.spawnAlien(_root.alien2, x, (-yrand) - 100, 30);
}
function formation8() {
x = ((2 * _root.w) / 3) + random(200);
topOrBot = random(2);
if (topOrBot < 1) {
y = (-random(100)) - 100;
rot = -30;
} else {
y = (_root.h + random(100)) + 100;
rot = 30;
}
_root.spawnAlien(_root.alien2, x, y, rot);
_root.spawnAlien(_root.alien2, x + 100, y + 25, rot);
_root.spawnAlien(_root.alien2, x + 50, y + 50, rot);
}
function formation9() {
x = _root.w + 100;
y = ((_root.h / 2) + random(300)) - 150;
_root.spawnAlien(_root.alien3, x, y, 0);
}
function formation10() {
x = _root.w + 100;
y = ((_root.h / 2) + random(300)) - 150;
_root.spawnAlien(_root.alien3, x, y - 50, 0);
_root.spawnAlien(_root.alien3, x, y + 50, 0);
}
function formation11() {
x = _root.w + 100;
y = ((_root.h / 2) + random(300)) - 150;
_root.spawnAlien(_root.alien3, x, y, 0);
_root.spawnAlien(_root.alien3, x + 75, y, 0);
_root.spawnAlien(_root.alien3, x + 150, y, 0);
}
function formation12() {
x = _root.w + 100;
y = ((_root.h / 2) + random(300)) - 150;
_root.spawnAlien(_root.alien4, x, y, 0);
}
function formation13() {
x = _root.w + 100;
y = ((_root.h / 2) + random(100)) - 50;
_root.spawnAlien(_root.alien4, x, y + 150, 0);
_root.spawnAlien(_root.alien4, x, y - 150, 0);
}
function formation14() {
x = _root.w + 100;
y = ((_root.h / 2) + random(200)) - 100;
_root.spawnAlien(_root.alien4, x, y, 0);
_root.spawnAlien(_root.alien4, x + 50, y - 100, 0);
_root.spawnAlien(_root.alien4, x + 50, y + 100, 0);
}
function formationBoss() {
x = _root.w + 200;
y = _root.h / 2;
_root.spawnAlienBoss(_root.alienBoss, x, y, 0);
}
curFrame = 0;
pauseFrame = 0;
f1s = [0, 0, 0, 0];
f1f = [21600, 1200, 600, 600];
f1p = [2, 1, 0.5, 0.5];
f2s = [0, 0, 0, 0];
f2f = [21600, 21600, 1200, 600];
f2p = [0.25, 0.25, 0.25, 0.25];
f3s = [1080, 720, 360, 0];
f3f = [21600, 21600, 21600, 21600];
f3p = [0.25, 0.125, 0.125, 0.125];
f4s = [540, 180, 0, 0];
f4f = [21600, 21600, 21600, 21600];
f4p = [0.125, 0.125, 0.125, 0.25];
f5s = [360, 180, 0, 0];
f5f = [21600, 21600, 21600, 21600];
f5p = [0.125, 0.125, 0.25, 0.125];
f6s = [0, 0, 0, 0];
f6f = [21600, 1200, 1200, 600];
f6p = [0.5, 0.5, 0.25, 0.25];
f7s = [720, 360, 0, 0];
f7f = [21600, 21600, 21600, 1200];
f7p = [0.125, 0.125, 0.25, 0.25];
f8s = [0, 1080, 720, 360];
f8f = [21600, 21600, 21600, 21600];
f8p = [0, 0.125, 0.125, 0.25];
f9s = [360, 0, 0, 0];
f9f = [21600, 21600, 21600, 1200];
f9p = [0.125, 0.25, 0.25, 0.25];
f10s = [0, 1080, 360, 0];
f10f = [21600, 21600, 21600, 21600];
f10p = [0, 0.0625, 0.125, 0.25];
f11s = [0, 0, 720, 360];
f11f = [21600, 21600, 21600, 21600];
f11p = [0, 0, 0.125, 0.125];
f12s = [540, 0, 0, 0];
f12f = [21600, 21600, 1200, 600];
f12p = [0.125, 0.25, 0.25, 0.25];
f13s = [0, 1440, 360, 0];
f13f = [21600, 21600, 21600, 21600];
f13p = [0, 0.0625, 0.125, 0.25];
f14s = [0, 0, 720, 0];
f14f = [21600, 21600, 21600, 21600];
f14p = [0, 0, 0.125, 0.125];
}
onClipEvent (enterFrame) {
if (!_global.levelComplete) {
p = _root.activePlayer;
curFrame++;
if (Key.isDown(32) and ((curFrame - 6) > pauseFrame)) {
pauseFrame = curFrame;
_root.pause = !_root.pause;
_root.pauseText._visible = _root.pause;
}
if (!_root.pause) {
if (((curFrame > 21600) or ((((p.ore1 + p.ore2) + p.ore3) + p.ore4) >= _root.oreCapacity)) or (_global.bossSpawned and _global.bossSlain)) {
_global.levelComplete = true;
stopAllSounds();
_global.curShieldOre = p.ore1;
_global.curBulletOre = p.ore2;
_global.curEngineOre = p.ore3;
_global.curWeaponOre = p.ore4;
_global.pShields = p.shields;
_global.pWeapons = p.weapons;
_global.pBullets = p.bullets;
_global.pEngines = p.engines;
p._rotation = 0;
p.gotoAndPlay(p.warpAnim);
_root.scrollSpeed = -50;
}
r = random(1000000) / 10000;
last = 0;
timeDif = 4 - (3 * Math.exp((-curFrame) / 10000));
lev = _global.curLevel;
spawned = false;
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f1s[lev])) and (curFrame < f1f[lev])) {
if (r < ((last = last + (timeDif * f1p[lev])))) {
formation1();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f2s[lev])) and (curFrame < f2f[lev])) {
if (r < ((last = last + (timeDif * f2p[lev])))) {
formation2();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f3s[lev])) and (curFrame < f3f[lev])) {
if (r < ((last = last + (timeDif * f3p[lev])))) {
formation3();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f4s[lev])) and (curFrame < f4f[lev])) {
if (r < ((last = last + (timeDif * f4p[lev])))) {
formation4();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f5s[lev])) and (curFrame < f5f[lev])) {
if (r < ((last = last + (timeDif * f5p[lev])))) {
formation5();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f6s[lev])) and (curFrame < f6f[lev])) {
if (r < ((last = last + (timeDif * f6p[lev])))) {
formation6();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f7s[lev])) and (curFrame < f7f[lev])) {
if (r < ((last = last + (timeDif * f7p[lev])))) {
formation7();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f8s[lev])) and (curFrame < f8f[lev])) {
if (r < ((last = last + (timeDif * f8p[lev])))) {
formation8();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f9s[lev])) and (curFrame < f9f[lev])) {
if (r < ((last = last + (timeDif * f9p[lev])))) {
formation9();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f10s[lev])) and (curFrame < f10f[lev])) {
if (r < ((last = last + (timeDif * f10p[lev])))) {
formation10();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f11s[lev])) and (curFrame < f11f[lev])) {
if (r < ((last = last + (timeDif * f11p[lev])))) {
formation11();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f12s[lev])) and (curFrame < f12f[lev])) {
if (r < ((last = last + (timeDif * f12p[lev])))) {
formation12();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f13s[lev])) and (curFrame < f13f[lev])) {
if (r < ((last = last + (timeDif * f13p[lev])))) {
formation13();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f14s[lev])) and (curFrame < f14f[lev])) {
if (r < ((last = last + (timeDif * f14p[lev])))) {
formation14();
spawned = true;
}
if ((((!_global.bossSpawned) and (_global.pBullets == 3)) and (_global.pEngines == 3)) and (_global.pWeapons == 3)) {
formationBoss();
_global.bossSpawned = true;
}
}
}
}
}
Instance of Symbol 120 MovieClip "ore2" in Frame 4 (536 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + _root.scrollSpeed);
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe <= 14) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre2(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Instance of Symbol 121 MovieClip "ore1" in Frame 4 (547 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
pickedup = 2;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + _root.scrollSpeed);
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre1(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Instance of Symbol 123 MovieClip "ore3" in Frame 4 (536 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + _root.scrollSpeed);
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe <= 14) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre3(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Instance of Symbol 125 MovieClip "ore4" in Frame 4 (536 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + _root.scrollSpeed);
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe <= 14) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre4(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Instance of Symbol 144 MovieClip "player" in Frame 4 (5.73 KiB) ● ●
onClipEvent (load) {
a = (_width - 3) / 2;
b = (_height - 3) / 2;
e_sq = 1 - ((b * b) / (a * a));
shot = new Sound();
shot.attachSound("shot4");
lastActiveFrame = 14;
deathAnim = 15;
deathEnd = 26;
warpAnim = 27;
warpEnd = 37;
shields = _global.pShields;
weapons = _global.pWeapons;
bullets = _global.pBullets;
engines = _global.pEngines;
vertCruize = 0;
vertSpeed = 0;
vertSpeedMax = 10 + ((10 / _global.pEnginesMax) * engines);
vertAccel = 2 + ((2 / _global.pEnginesMax) * engines);
vertDecel = 2;
vertAngleChange = 10 + ((10 / _global.pEnginesMax) * engines);
horizCruise = 0;
horizSpeed = 0;
horizSpeedMax = 15 + ((15 / _global.pEnginesMax) * engines);
horizAccel = 3 + ((3 / _global.pEnginesMax) * engines);
horizDecel = 2;
horizAngleChange = 3 + ((3 / _global.pEnginesMax) * engines);
angleMax = 30;
energy = 100;
cooldown = 100;
energyUsage = 10;
cooldownUsage = 100;
energyRegen = 2;
cooldownRegen = 50;
ore1 = 0;
ore2 = 0;
ore3 = 0;
ore4 = 0;
if (_visible) {
_root.initPShields();
_root.initPWeapons();
_root.initPBullets();
_root.initPEngines();
_root.initPEnergy();
_root.initPOreMeters();
}
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if ((_currentframe == deathEnd) or (_currentframe == warpEnd)) {
_root.gotoAndPlay(3);
this.removeMovieClip();
} else if (_visible and (_currentframe <= lastActiveFrame)) {
if (_global.levelComplete) {
_root.gotoAndPlay(3);
this.removeMovieClip();
}
if (Key.isDown(38)) {
vertSpeed = vertSpeed - vertAccel;
if (vertSpeed < (-vertSpeedMax)) {
vertSpeed = -vertSpeedMax;
}
_rotation = (_rotation - vertAngleChange);
if (_rotation < (-angleMax)) {
_rotation = (-angleMax);
}
} else if (vertSpeed < 0) {
vertSpeed = vertSpeed + vertDecel;
if (vertSpeed > 0) {
vertSpeed = 0;
}
}
if (Key.isDown(40)) {
vertSpeed = vertSpeed + vertAccel;
if (vertSpeed > vertSpeedMax) {
vertSpeed = vertSpeedMax;
}
_rotation = (_rotation + vertAngleChange);
if (_rotation > angleMax) {
_rotation = angleMax;
}
} else if (vertSpeed > 0) {
vertSpeed = vertSpeed - vertDecel;
if (vertSpeed < 0) {
vertSpeed = 0;
}
}
if (Key.isDown(37)) {
horizSpeed = horizSpeed - horizAccel;
if (horizSpeed < (-horizSpeedMax)) {
horizSpeed = -horizSpeedMax;
}
if (_rotation < 0) {
_rotation = (_rotation + horizAngleChange);
if (_rotation > 0) {
_rotation = 0;
}
} else if (_rotation > 0) {
_rotation = (_rotation - horizAngleChange);
if (_rotation < 0) {
_rotation = 0;
}
}
} else if (horizSpeed < 0) {
horizSpeed = horizSpeed + horizDecel;
if (horizSpeed > 0) {
horizSpeed = 0;
}
}
if (Key.isDown(39)) {
horizSpeed = horizSpeed + horizAccel;
if (horizSpeed > horizSpeedMax) {
horizSpeed = horizSpeedMax;
}
if (_rotation < 0) {
_rotation = (_rotation + horizAngleChange);
if (_rotation > 0) {
_rotation = 0;
}
} else if (_rotation > 0) {
_rotation = (_rotation - horizAngleChange);
if (_rotation < 0) {
_rotation = 0;
}
}
} else if (horizSpeed > 0) {
horizSpeed = horizSpeed - horizDecel;
if (horizSpeed < 0) {
horizSpeed = 0;
}
}
_x = (_x + (horizSpeed + horizCruise));
_y = (_y + (vertSpeed + vertCruise));
if (_x < 0) {
_x = 0;
}
if (_x > _root.w) {
_x = _root.w;
}
if (_y < 0) {
_y = 0;
}
if (_y > _root.h) {
_y = _root.h;
}
if (_global.bossSpawned and (_x > (_root.w - 100))) {
_x = (_root.w - 100);
}
if ((Key.isDown(17) and (energy > energyUsage)) and (cooldown == 100)) {
_root.updatePEnergy(-energyUsage);
_root.updatePCooldown(-cooldownUsage);
shot.start();
bullet1X = _x + ((_width / 2) * Math.cos(((_rotation + 8) * Math.PI) / 180));
bullet1Y = _y + ((_width / 2) * Math.sin(((_rotation + 8) * Math.PI) / 180));
bullet2X = _x + ((_width / 2) * Math.cos(((_rotation - 8) * Math.PI) / 180));
bullet2Y = _y + ((_width / 2) * Math.sin(((_rotation - 8) * Math.PI) / 180));
if (weapons == 0) {
_root.spawnPBullet(_root.pBullet1, bullet1X, bullet1Y, _rotation);
_root.spawnPBullet(_root.pBullet1, bullet2X, bullet2Y, _rotation);
} else if (weapons == 1) {
_root.spawnPBullet(_root.pBullet1, bullet1X, bullet1Y, _rotation);
_root.spawnPBullet(_root.pBullet1, bullet2X, bullet2Y, _rotation);
_root.spawnPBullet(_root.pBullet1, bullet1X, bullet1Y, _rotation + 10);
_root.spawnPBullet(_root.pBullet1, bullet2X, bullet2Y, _rotation - 10);
} else if (weapons == 2) {
_root.spawnPBullet(_root.pBullet1, bullet1X, bullet1Y, _rotation);
_root.spawnPBullet(_root.pBullet1, bullet2X, bullet2Y, _rotation);
_root.spawnPBullet(_root.pBullet1, bullet1X, bullet1Y, _rotation + 10);
_root.spawnPBullet(_root.pBullet1, bullet2X, bullet2Y, _rotation - 10);
_root.spawnPBullet(_root.pBullet1, bullet1X, bullet1Y, _rotation + 20);
_root.spawnPBullet(_root.pBullet1, bullet2X, bullet2Y, _rotation - 20);
} else if (weapons == 3) {
_root.spawnPBullet(_root.pBullet1, bullet1X, bullet1Y, _rotation);
_root.spawnPBullet(_root.pBullet1, bullet2X, bullet2Y, _rotation);
_root.spawnPBullet(_root.pBullet1, bullet1X, bullet1Y, _rotation + 10);
_root.spawnPBullet(_root.pBullet1, bullet2X, bullet2Y, _rotation - 10);
_root.spawnPBullet(_root.pBullet1, bullet1X, bullet1Y, _rotation + 20);
_root.spawnPBullet(_root.pBullet1, bullet2X, bullet2Y, _rotation - 20);
_root.spawnPBullet(_root.pBullet1, bullet1X, bullet1Y, _rotation + 30);
_root.spawnPBullet(_root.pBullet1, bullet2X, bullet2Y, _rotation - 30);
}
} else {
_root.updatePEnergy(energyRegen);
_root.updatePCooldown(cooldownRegen);
}
}
}
Instance of Symbol 152 MovieClip "alien1" in Frame 4 (2.14 KiB) ●
onClipEvent (load) {
a = (_width - 3) / 2;
b = (_height - 3) / 2;
e_sq = 1 - ((b * b) / (a * a));
lastActiveFrame = 1;
deathAnim = 2;
deathEnd = 16;
vertSpeed = 0;
vertSpeedMax = 10;
vertAccel = 0.5;
vertDecel = 0;
vertAngleChange = 1;
horizSpeed = -10;
horizSpeedMax = 10;
horizAccel = 0;
horizDecel = 0;
horizAngleChange = 2;
angleMax = 30;
shields = (_global.curLevel + 1) * 1;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_currentframe == deathEnd) {
this.removeMovieClip();
} else if (_visible and (_currentframe > lastActiveFrame)) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
} else if (_visible) {
p = _root.activePlayer;
if (p._y < _y) {
vertSpeed = vertSpeed - vertAccel;
if (vertSpeed < (-vertSpeedMax)) {
vertSpeed = -vertSpeedMax;
}
_rotation = (_rotation + vertAngleChange);
if (_rotation > angleMax) {
_rotation = angleMax;
}
} else if (vertSpeed < 0) {
vertSpeed = vertSpeed + vertDecel;
if (vertSpeed > 0) {
vertSpeed = 0;
}
}
if (p._y > _y) {
vertSpeed = vertSpeed + vertAccel;
if (vertSpeed > vertSpeedMax) {
vertSpeed = vertSpeedMax;
}
_rotation = (_rotation - vertAngleChange);
if (_rotation < (-angleMax)) {
_rotation = (-angleMax);
}
} else if (vertSpeed > 0) {
vertSpeed = vertSpeed - vertDecel;
if (vertSpeed < 0) {
vertSpeed = 0;
}
}
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
if (_x < -100) {
this.removeMovieClip();
}
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
this.gotoAndPlay(deathAnim);
}
}
i = 0;
while (i < _root.pBulletMax) {
b = _root["pBullet_" + i];
if ((b._currentframe == 1) and hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
b.gotoAndPlay(2);
shields = shields - b.power;
if (shields <= 0) {
if ((!_global.bossSpawned) and (random(2) == 0)) {
_root.spawnOre(_root.ore1, _x, _y, 0);
}
this.gotoAndPlay(deathAnim);
break;
}
}
}
i++;
}
}
}
Instance of Symbol 159 MovieClip "alien2" in Frame 4 (2.66 KiB) ●
onClipEvent (load) {
a = (_width - 3) / 2;
b = (_height - 3) / 2;
e_sq = 1 - ((b * b) / (a * a));
lastActiveFrame = 1;
deathAnim = 2;
deathEnd = 13;
if (_y < (_root.h / 2)) {
vertSpeed = 20;
vertSpeedMax = -10;
} else {
vertSpeed = -20;
vertSpeedMax = 10;
}
vertAccel = 0;
vertDecel = 0.5;
vertAngleChange = 3;
horizSpeed = 10;
horizSpeedMax = 10;
horizAccel = 1;
horizDecel = 0;
horizAngleChange = 2;
angleMax = 30;
shields = (_global.curLevel + 1) * 2;
cooldown = 50;
cooldownregen = 4;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_currentframe == deathEnd) {
this.removeMovieClip();
} else if (_visible and (_currentframe > lastActiveFrame)) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
} else if (_visible) {
p = _root.activePlayer;
if (vertSpeed < 0) {
vertSpeed = vertSpeed + vertDecel;
if (vertSpeed > 0) {
vertSpeed = 0;
}
}
if (vertSpeed > 0) {
vertSpeed = vertSpeed - vertDecel;
if (vertSpeed < 0) {
vertSpeed = 0;
}
}
horizSpeed = horizSpeed - horizAccel;
if (horizSpeed < (-horizSpeedMax)) {
horizSpeed = -horizSpeedMax;
}
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
desAngle = (Math.atan2(_y - p._y, _x - p._x) * 180) / Math.PI;
if (_rotation > desAngle) {
_rotation = (_rotation - vertAngleChange);
if (_rotation < desAngle) {
_rotation = desAngle;
}
if (_rotation < (-angleMax)) {
_rotation = (-angleMax);
}
}
if (_rotation < desAngle) {
_rotation = (_rotation + vertAngleChange);
if (_rotation > desAngle) {
_rotation = desAngle;
}
if (_rotation > angleMax) {
_rotation = angleMax;
}
}
if (_x < -100) {
this.removeMovieClip();
}
if (cooldown == 100) {
cooldown = 0;
bulletX = _x - ((_width / 2) * Math.cos((_rotation * Math.PI) / 180));
bulletY = _y - ((_width / 2) * Math.sin((_rotation * Math.PI) / 180));
_root.spawnEBullet(_root.eBullet1, bulletX, bulletY, _rotation);
} else {
cooldown = cooldown + cooldownregen;
if (cooldown > 100) {
cooldown = 100;
}
}
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
}
}
i = 0;
while (i < _root.pBulletMax) {
b = _root["pBullet_" + i];
if ((b._currentframe == 1) and hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
b.gotoAndPlay(2);
shields = shields - b.power;
if (shields <= 0) {
if (!_global.bossSpawned) {
_root.spawnOre(_root.ore2, _x, _y, 0);
}
this.gotoAndPlay(deathAnim);
break;
}
}
}
i++;
}
}
}
Instance of Symbol 166 MovieClip "alien4" in Frame 4 (1.88 KiB) ●
onClipEvent (load) {
a = (_width - 3) / 2;
b = (_height - 3) / 2;
e_sq = 1 - ((b * b) / (a * a));
lastActiveFrame = 1;
deathAnim = 2;
deathEnd = 13;
vertSpeed = 0;
vertSpeedMax = 5;
vertAccel = 0.5;
vertDecel = 0;
vertAngleChange = 1;
horizSpeed = -5;
horizSpeedMax = -5;
horizAccel = 0;
horizDecel = 0;
horizAngleChange = 2;
angleMax = 30;
shields = (_global.curLevel + 1) * 6;
cooldown = 100;
cooldownregen = 3;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_currentframe == deathEnd) {
this.removeMovieClip();
} else if (_visible and (_currentframe > lastActiveFrame)) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
} else if (_visible) {
p = _root.activePlayer;
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
if (_x < -100) {
this.removeMovieClip();
}
if (cooldown == 100) {
cooldown = 0;
bulletX = _x - ((_width / 2) * Math.cos((_rotation * Math.PI) / 180));
bulletY = _y - ((_width / 2) * Math.sin((_rotation * Math.PI) / 180));
_root.spawnEBullet(_root.eBullet2, bulletX, bulletY, _rotation);
_root.spawnEBullet(_root.eBullet2, bulletX, bulletY, _rotation + 30);
_root.spawnEBullet(_root.eBullet2, bulletX, bulletY, _rotation - 30);
} else {
cooldown = cooldown + cooldownregen;
if (cooldown > 100) {
cooldown = 100;
}
}
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
}
}
i = 0;
while (i < _root.pBulletMax) {
b = _root["pBullet_" + i];
if ((b._currentframe == 1) and hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
b.gotoAndPlay(2);
shields = shields - b.power;
if (shields <= 0) {
if (!_global.bossSpawned) {
_root.spawnOre(_root.ore4, _x, _y, 0);
}
this.gotoAndPlay(deathAnim);
break;
}
}
}
i++;
}
}
}
Instance of Symbol 176 MovieClip "alien3" in Frame 4 (1.77 KiB) ●
onClipEvent (load) {
a = (_width - 3) / 2;
b = (_height - 3) / 2;
e_sq = 1 - ((b * b) / (a * a));
lastActiveFrame = 1;
deathAnim = 2;
deathEnd = 14;
vertSpeed = 0;
vertSpeedMax = 5;
vertAccel = 0.5;
vertDecel = 0;
vertAngleChange = 1;
horizSpeed = 0;
horizSpeedMax = 0;
horizAccel = 0;
horizDecel = 0;
horizAngleChange = 2;
angleMax = 30;
shields = ((_global.curLevel + 1) * 15) - 5;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_currentframe == deathEnd) {
this.removeMovieClip();
} else if (_visible and (_currentframe > lastActiveFrame)) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
} else if (_visible) {
p = _root.activePlayer;
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
if (_x < -100) {
this.removeMovieClip();
}
if (cooldown == 100) {
cooldown = 0;
shipXoff = (_height / 2) * Math.sin((_rotation * Math.PI) / 180);
shipYoff = (_height / 2) * Math.cos((_rotation * Math.PI) / 180);
_root.spawnAlien(_root.alien1, _x + shipXoff, _y + shipYoff, _rotation);
_root.spawnAlien(_root.alien1, _x - shipXoff, _y - shipYoff, _rotation);
} else {
cooldown = cooldown + 3;
if (cooldown > 100) {
cooldown = 100;
}
}
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
}
}
i = 0;
while (i < _root.pBulletMax) {
b = _root["pBullet_" + i];
if ((b._currentframe == 1) and hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
b.gotoAndPlay(2);
shields = shields - b.power;
if (shields <= 0) {
if (!_global.bossSpawned) {
_root.spawnOre(_root.ore3, _x, _y, 0);
}
this.gotoAndPlay(deathAnim);
break;
}
}
}
i++;
}
}
}
Instance of Symbol 186 MovieClip "alienBoss" in Frame 4 (4.16 KiB) ●
onClipEvent (load) {
a = (_width - 3) / 2;
b = (_height - 3) / 2;
e_sq = 1 - ((b * b) / (a * a));
lastActiveFrame = 1;
deathAnim = 2;
deathEnd = 14;
vertSpeed = 0;
vertSpeedMax = 10;
vertAccel = 0.5;
vertDecel = 0;
vertAngleChange = 1;
horizSpeed = 5;
horizSpeedMax = 0;
horizAccel = 0;
horizDecel = 0;
horizAngleChange = 0;
angleMax = 30;
bcooldownregen = 6;
bcooldown = 100;
shields = 1000;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_currentframe == deathEnd) {
this.removeMovieClip();
} else if (_visible and (_currentframe > lastActiveFrame)) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
} else if (_visible) {
p = _root.activePlayer;
if (_x > (_root.w - 100)) {
horizSpeed = 0;
} else {
horizSpeed = 5;
}
if (p._y < _y) {
vertSpeed = vertSpeed - vertAccel;
if (vertSpeed < (-vertSpeedMax)) {
vertSpeed = -vertSpeedMax;
}
_rotation = (_rotation + vertAngleChange);
if (_rotation > angleMax) {
_rotation = angleMax;
}
} else if (vertSpeed < 0) {
vertSpeed = vertSpeed + vertDecel;
if (vertSpeed > 0) {
vertSpeed = 0;
}
}
if (p._y > _y) {
vertSpeed = vertSpeed + vertAccel;
if (vertSpeed > vertSpeedMax) {
vertSpeed = vertSpeedMax;
}
_rotation = (_rotation - vertAngleChange);
if (_rotation < (-angleMax)) {
_rotation = (-angleMax);
}
} else if (vertSpeed > 0) {
vertSpeed = vertSpeed - vertDecel;
if (vertSpeed < 0) {
vertSpeed = 0;
}
}
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
if (bcooldown == 100) {
bcooldown = 0;
bulletX = _x - ((_width / 2) * Math.cos((_rotation * Math.PI) / 180));
bulletY = _y - ((_width / 2) * Math.sin((_rotation * Math.PI) / 180));
_root.spawnEBullet(_root.eBullet2, bulletX, bulletY + 10, _rotation);
_root.spawnEBullet(_root.eBullet2, bulletX, bulletY - 10, _rotation);
_root.spawnEBullet(_root.eBullet2, bulletX, bulletY + 30, _rotation);
_root.spawnEBullet(_root.eBullet2, bulletX, bulletY - 30, _rotation);
_root.spawnEBullet(_root.eBullet2, bulletX, bulletY + 50, _rotation);
_root.spawnEBullet(_root.eBullet2, bulletX, bulletY - 50, _rotation);
} else {
bcooldown = bcooldown + bcooldownregen;
if (bcooldown > 100) {
bcooldown = 100;
}
}
if (cooldown == 50) {
cooldown = 0;
r = random(100);
if (r < 40) {
shipXoff = (_height / 2) * Math.sin((_rotation * Math.PI) / 180);
shipYoff = (_height / 2) * Math.cos((_rotation * Math.PI) / 180);
_root.spawnAlien(_root.alien1, _x + shipXoff, _y + shipYoff, _rotation);
_root.spawnAlien(_root.alien1, _x - shipXoff, _y - shipYoff, _rotation);
} else if (r < 70) {
shipXoff = (_height / 2) * Math.sin((_rotation * Math.PI) / 180);
shipYoff = (_height / 2) * Math.cos((_rotation * Math.PI) / 180);
_root.spawnAlien(_root.alien2, _x + shipXoff, _y + shipYoff, 0);
_root.spawnAlien(_root.alien2, _x - shipXoff, _y - shipYoff, 0);
} else if (r < 85) {
shipXoff = (_height / 2) * Math.sin((_rotation * Math.PI) / 180);
shipYoff = (_height / 2) * Math.cos((_rotation * Math.PI) / 180);
_root.spawnAlien(_root.alien3, _x + shipXoff, _y + shipYoff, 0);
_root.spawnAlien(_root.alien3, _x - shipXoff, _y - shipYoff, 0);
} else if (r < 100) {
shipXoff = (_height / 2) * Math.sin((_rotation * Math.PI) / 180);
shipYoff = (_height / 2) * Math.cos((_rotation * Math.PI) / 180);
_root.spawnAlien(_root.alien4, _x + shipXoff, _y + shipYoff, 0);
_root.spawnAlien(_root.alien4, _x - shipXoff, _y - shipYoff, 0);
}
} else {
cooldown = cooldown + 3;
if (cooldown > 50) {
cooldown = 50;
}
}
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
}
}
i = 0;
while (i < _root.pBulletMax) {
b = _root["pBullet_" + i];
if ((b._currentframe == 1) and hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
b.gotoAndPlay(2);
shields = shields - b.power;
if (shields <= 0) {
_global.bossSlain = true;
this.gotoAndPlay(deathAnim);
break;
}
}
}
i++;
}
}
}
Instance of Symbol 190 MovieClip "pBullet1" in Frame 4 (537 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
p = _root.activePlayer;
speed = 30;
powerAdv = [1, 2, 3, 5];
power = powerAdv[p.bullets];
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_currentframe == 5) {
this.removeMovieClip();
} else if (_visible and (_currentframe == 1)) {
_x = (_x + (speed * Math.cos((_rotation * Math.PI) / 180)));
_y = (_y + (speed * Math.sin((_rotation * Math.PI) / 180)));
if (_x > (_root.w + 100)) {
this.removeMovieClip();
}
}
}
Instance of Symbol 194 MovieClip "eBullet1" in Frame 4 (645 B)
onClipEvent (load) {
a = _width / 2;
b = _width / 2;
e_sq = 1 - ((b * b) / (a * a));
speed = -15;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_currentframe == 5) {
this.removeMovieClip();
} else if (_visible and (_currentframe == 1)) {
p = _root.activePlayer;
_x = (_x + ((speed * Math.cos((_rotation * Math.PI) / 180)) + _root.scrollSpeed));
_y = (_y + (speed * Math.sin((_rotation * Math.PI) / 180)));
if (_x < -100) {
this.removeMovieClip();
}
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
this.gotoAndPlay(2);
}
}
}
}
Instance of Symbol 198 MovieClip "eBullet2" in Frame 4 (724 B)
onClipEvent (load) {
a = _width / 2;
b = _width / 2;
e_sq = 1 - ((b * b) / (a * a));
speed = -15;
rotSpeed = 20;
direction = _rotation;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_currentframe == 5) {
this.removeMovieClip();
} else if (_visible and (_currentframe == 1)) {
p = _root.activePlayer;
_x = (_x + ((speed * Math.cos((direction * Math.PI) / 180)) + _root.scrollSpeed));
_y = (_y + (speed * Math.sin((direction * Math.PI) / 180)));
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
this.gotoAndPlay(2);
}
}
}
}
Frame 5 (6.29 KiB) ● ●
function initPShields() {
i = 1;
while (i <= _global.pShieldsMax) {
if (i <= _global.pShields) {
_root["pShieldBubble" + i]._visible = true;
} else {
_root["pShieldBubble" + i]._visible = false;
}
i++;
}
}
function initPWeapons() {
i = 1;
while (i <= _global.pWeaponsMax) {
if (i <= _global.pWeapons) {
_root["pWeaponBubble" + i]._visible = true;
} else {
_root["pWeaponBubble" + i]._visible = false;
}
i++;
}
}
function initPBullets() {
i = 1;
while (i <= _global.pBulletsMax) {
if (i <= _global.pBullets) {
_root["pBulletBubble" + i]._visible = true;
} else {
_root["pBulletBubble" + i]._visible = false;
}
i++;
}
}
function initPEngines() {
i = 1;
while (i <= _global.pEnginesMax) {
if (i <= _global.pEngines) {
_root["pEngineBubble" + i]._visible = true;
} else {
_root["pEngineBubble" + i]._visible = false;
}
i++;
}
}
function initOreMeters() {
_root.curOreMeter1._width = (79 * _global.curShieldOre) / 100;
_root.curOreMeter2._x = _root.curOreMeter1._width + _root.curOreMeter1._x;
_root.curOreMeter2._width = (79 * _global.curBulletOre) / 100;
_root.curOreMeter3._x = _root.curOreMeter2._width + _root.curOreMeter2._x;
_root.curOreMeter3._width = (79 * _global.curEngineOre) / 100;
_root.curOreMeter4._x = _root.curOreMeter3._width + _root.curOreMeter3._x;
_root.curOreMeter4._width = (79 * _global.curWeaponOre) / 100;
_root.netOreMeter1._width = 260 * Math.min(1, _global.netShieldOre / shieldUp[_global.pShields]);
_root.netOreMeter2._width = 260 * Math.min(1, _global.netBulletOre / bulletUp[_global.pBullets]);
_root.netOreMeter3._width = 260 * Math.min(1, _global.netEngineOre / engineUp[_global.pEngines]);
_root.netOreMeter4._width = 260 * Math.min(1, _global.netWeaponOre / weaponUp[_global.pWeapons]);
}
function updateOreMeters() {
if (_global.netShieldOre >= shieldUp[_global.pShields]) {
_global.netShieldOre = 0;
_global.pShields++;
if (_global.pShields > _global.pShieldsMax) {
_global.pShields = _global.pShieldsMax;
}
initPShields();
}
if (_global.netWeaponOre >= weaponUp[_global.pWeapons]) {
_global.netWeaponOre = 0;
_global.pWeapons++;
if (_global.pWeapons > _global.pWeaponsMax) {
_global.pWeapons = _global.pWeaponsMax;
}
initPWeapons();
}
if (_global.netBulletOre >= bulletUp[_global.pBullets]) {
_global.netBulletOre = 0;
_global.pBullets++;
if (_global.pBullets > _global.pBulletsMax) {
_global.pBullets = _global.pBulletsMax;
}
initPBullets();
}
if (_global.netEngineOre >= engineUp[_global.pEngines]) {
_global.netEngineOre = 0;
_global.pEngines++;
if (_global.pEngines > _global.pEnginesMax) {
_global.pEngines = _global.pEnginesMax;
}
initPEngines();
}
initOreMeters();
}
stop();
_root.world._visible = false;
_root.continueButton._visible = false;
_root.quitButton._visible = false;
shieldUp = [25, 25, 25, 50, 50, 50, 50, 50, 75, 75, 75, 75, 75, 100, 100, 100, 100];
bulletUp = [100, 200, 300, 300];
engineUp = [75, 100, 200, 200];
weaponUp = [75, 100, 200, 200];
upgradeToLevel = [0, 0, 1, 1, 2, 2, 3, 3, 3, 4];
levelOffset = 4;
_global.levelComplete = false;
text = "";
newLevelText = ["Welcome aboard, cadet. We could sure use your help in gathering ore for the construction of the space embassy.\n\nYou're new here, so you should know that the green ore, Durium, is used to reinforce your ship's shields, so you might want to focus on picking that up for now. You should be able to find plenty of it in the Acturian Belt, and don't forget to use your deflector if you need to.\n\nRemember that we can't repair or change your ship until you're back here at base, so fill up your cargo hold and be careful.", "Now that you've proven your worth, we're sending you to Barnar's Belt. The asteroids are a bit more tricky there, so be careful.\n\nBy the way, the rare ores that you collect allow us to make upgrades to your ship in addition to building the embassy. Arium, the red ore, is used to make more potent deflectors. Brezium, the blue ore, powers your ship's rockets. Lastly, Corbium, the purple ore, helps to make your fusion generator more efficient.", "Keep it up like this and you'll be up for a promotion in no time. Cerberous System is our next destination. You should watch out for the big asteroids in this area; some of them are highly unstable.\n\nGood luck.", "So here we are... Dnedor, one of the most brutal systems in known space. The ore here is very high quality; otherwise, we wouldn't bother coming.", "Thanks to you, we've been able to complete our embassy and the embassy is even safe from that meteor shower! You've done a great service for humanity.\n\nOh, and by the way, congratulations on your promotion to fleet coordinator. Now you can enjoy the relative safety of a desk-job... that is, unless you want to get out there and help our new allies defend themselves against some nasty invaders.\n\nYOU WIN"];
oldLevelText = ["Good job out there.\n\nBefore we're ready for you to move on to the next asteroid belt, we need you to gather some of the more rare ores. Don't forget to pick up more Durium if you need it.", "You're doing well, but we still need more ore out of this system.\n\nI hope that Barnar's asteroids aren't too tricky for you.", "You may think that Cerberous is a nasty place, but just wait until we get to Dnedor.\n\nI've got some stories to tell you from there...", "You're an excellent pilot and I have confidence in your abilities.\n\nNow get out there and show 'em what you've got.\n\nOh, and by the way, our meteorologist has reported a chance of showers in this area. Currently, the showers seem to be caused by some sort of radioactive material."];
loseLevelText = ["Don't worry, this kind of thing happens all the time.\n\nYou'll get the hang of it.", "This place is a bit rougher than Arcturus was, huh?\n\nWhy don't you give it another shot, eh?", "Even our best pilots have trouble in Cerberous.\n\nDon't let it get to you.", "Let me tell you about this one time...\n\nI swear, the asteroids had it in for me... So, I was out of energy, and there were five of 'em, you know, the big, fat, exploding kind, headed right at me..."];
newLevel = true;
loseLevel = true;
fillupSound = new Sound();
fillupSound.attachSound("power");
Instance of Symbol 88 MovieClip "world" in Frame 5 (2.65 KiB) ●
onClipEvent (load) {
done = false;
textdone = false;
soundstart = false;
curFrame = 0;
doneFrame = 0;
textdoneFrame = 0;
delay = 24;
if (!_global.upgraded) {
oreRate = 5;
} else {
oreRate = 10;
}
textdelay = 60;
textrate = 4;
curText = "";
_root.initPShields();
_root.initPWeapons();
_root.initPBullets();
_root.initPEngines();
_root.initOreMeters();
}
onClipEvent (enterFrame) {
curFrame++;
if ((curFrame > delay) and (!done)) {
if ((!soundstart) and (!((((_global.curShieldOre == 0) and (_global.curWeaponOre == 0)) and (_global.curBulletOre == 0)) and (_global.curEngineOre == 0)))) {
_root.fillupSound.start();
soundStart = true;
}
if (_global.curShieldOre > 0) {
_global.curShieldOre = _global.curShieldOre - oreRate;
_global.netShieldOre = _global.netShieldOre + oreRate;
}
if (_global.curWeaponOre > 0) {
_global.curWeaponOre = _global.curWeaponOre - oreRate;
_global.netWeaponOre = _global.netWeaponOre + oreRate;
}
if (_global.curBulletOre > 0) {
_global.curBulletOre = _global.curBulletOre - oreRate;
_global.netBulletOre = _global.netBulletOre + oreRate;
}
if (_global.curEngineOre > 0) {
_global.curEngineOre = _global.curEngineOre - oreRate;
_global.netEngineOre = _global.netEngineOre + oreRate;
}
_root.updateOreMeters();
if ((((_global.curShieldOre == 0) and (_global.curWeaponOre == 0)) and (_global.curBulletOre == 0)) and (_global.curEngineOre == 0)) {
done = true;
doneFrame = curFrame;
oldLevel = _global.curLevel;
_global.curLevel = _root.upgradeToLevel[(_global.pBullets + _global.pEngines) + _global.pWeapons];
if ((((!_global.bossSlain) and (_global.pBullets == 3)) and (_global.pEngines == 3)) and (_global.pWeapons == 3)) {
_global.curLevel--;
}
if (_global.curLevel == 4) {
_global.win = true;
curText = _root.newLevelText[4];
} else if (_global.lostLevel) {
curText = _root.loseLevelText[_global.curLevel];
} else if (oldLevel != _global.curLevel) {
curText = _root.newLevelText[_global.curLevel];
} else {
curText = _root.oldLevelText[_global.curLevel];
}
_global.bossSpawned = false;
_global.lostLevel = false;
}
} else if (done) {
if (soundstart) {
_root.fillupSound.stop();
soundStart = false;
}
_root.continueButton._visible = true;
_root.quitButton._visible = true;
if ((!textdone) and (((curFrame - doneFrame) * textrate) < curText.length)) {
i = 0;
while (i < textrate) {
_root.text = _root.text + curText.charAt((((curFrame - doneFrame) - 1) * textrate) + i);
i++;
}
} else if (!textdone) {
_root.text = curText;
textdone = true;
textdoneFrame = curFrame;
}
}
}
Frame 6 (6.99 KiB) ● ●
function spawnAsteroid(clip, x, y, xvel, yvel, rot) {
newEnemy = "asteroid_" + _root.curEnemy;
clip.duplicateMovieClip(newEnemy, _root.curEnemy + _root.enemyDepth);
_root[newEnemy]._x = x;
_root[newEnemy]._y = y;
_root[newEnemy].horizSpeed = xvel;
_root[newEnemy].vertSpeed = yvel;
_root[newEnemy]._rotation = rot;
_root.curEnemy++;
if (_root.curEnemy > _root.enemyMax) {
_root.curEnemy = 0;
}
}
function spawnAsteroidBoss(clip, x, y, xvel, yvel, rot) {
newEnemy = "asteroidBoss";
clip.duplicateMovieClip(newEnemy, _root.bossDepth);
_root[newEnemy]._x = x;
_root[newEnemy]._y = y;
_root[newEnemy].horizSpeed = xvel;
_root[newEnemy].vertSpeed = yvel;
_root[newEnemy]._rotation = rot;
}
function spawnPBullet(clip, x, y, rot) {
newBullet = "pBullet_" + _root.curPBullet;
clip.duplicateMovieClip(newBullet, _root.curPBullet + _root.pBulletDepth);
_root[newBullet]._x = x;
_root[newBullet]._y = y;
_root[newBullet]._rotation = rot;
_root.curPBullet++;
if (_root.curPBullet > _root.pBulletMax) {
_root.curPBullet = 0;
}
}
function spawnEBullet(clip, x, y, rot) {
newBullet = "eBullet_" + _root.curEBullet;
clip.duplicateMovieClip(newBullet, _root.curEBullet + _root.eBulletDepth);
_root[newBullet]._x = x;
_root[newBullet]._y = y;
_root[newBullet]._rotation = rot;
_root.curEBullet++;
if (_root.curEBullet > _root.eBulletMax) {
_root.curEBullet = 0;
}
}
function spawnOre(clip, x, y, rot) {
newOre = "ore_" + _root.curOre;
clip.duplicateMovieClip(newOre, _root.curOre + _root.oreDepth);
_root[newOre]._x = x;
_root[newOre]._y = y;
_root[newOre]._rotation = rot;
_root.curOre++;
if (_root.curOre > _root.oreMax) {
_root.curOre = 0;
}
}
function ellipticHitTest(e1, e2) {
deltaX = e2._x - e1._x;
deltaY = e2._y - e1._y;
dist = Math.sqrt((deltaX * deltaX) + (deltaY * deltaY));
theta = Math.atan2(deltaY, deltaX);
cosETheta = Math.cos(theta - ((e1._rotaion * Math.PI) / 180));
cosPTheta = Math.cos((theta - Math.PI) - ((e2._rotaion * Math.PI) / 180));
r1 = e1.a * Math.sqrt((1 - e1.e_sq) / (1 - ((e1.e_sq * cosETheta) * cosETheta)));
r2 = e2.a * Math.sqrt((1 - e2.e_sq) / (1 - ((e2.e_sq * cosPTheta) * cosPTheta)));
return((r1 + r2) > dist);
}
function initPShields() {
p = _root.activePlayer;
i = 1;
while (i <= _global.pShieldsMax) {
if (i <= p.shields) {
_root["pShieldBubble" + i]._visible = true;
} else {
_root["pShieldBubble" + i]._visible = false;
}
i++;
}
}
function updatePShields(delta) {
p = _root.activePlayer;
p.shields = p.shields + delta;
_root.initPShields();
p.gotoAndPlay(2);
if (p.shields <= 0) {
p.gotoAndPlay(p.deathAnim);
_root.scrollSpeed = -50;
_global.levelComplete = true;
_global.lostLevel = true;
}
}
function initPWeapons() {
p = _root.activePlayer;
i = 1;
while (i <= _global.pWeaponsMax) {
if (i <= p.weapons) {
_root["pWeaponBubble" + i]._visible = true;
} else {
_root["pWeaponBubble" + i]._visible = false;
}
i++;
}
}
function updatePWeapons(delta) {
p = _root.activePlayer;
p.weapons = p.weapons + delta;
_root.initPWeapons();
}
function initPBullets() {
p = _root.activePlayer;
i = 1;
while (i <= _global.pBulletsMax) {
if (i <= p.bullets) {
_root["pBulletBubble" + i]._visible = true;
} else {
_root["pBulletBubble" + i]._visible = false;
}
i++;
}
}
function updatePBullets(delta) {
p = _root.activePlayer;
p.bullets = p.bullets + delta;
_root.initPBullets();
}
function initPEngines() {
p = _root.activePlayer;
i = 1;
while (i <= _global.pEnginesMax) {
if (i <= p.engines) {
_root["pEngineBubble" + i]._visible = true;
} else {
_root["pEngineBubble" + i]._visible = false;
}
i++;
}
}
function updatePEngines(delta) {
p = _root.activePlayer;
p.engines = p.engines + delta;
_root.initPEngines();
}
function initPEnergy() {
p = _root.activePlayer;
_root.energy._width = (196 * p.energy) / 100;
}
function updatePEnergy(delta) {
p = _root.activePlayer;
p.energy = p.energy + delta;
if (p.energy > 100) {
p.energy = 100;
}
if (p.energy < 0) {
p.energy = 0;
}
_root.initPEnergy();
}
function updatePCooldown(delta) {
p = _root.activePlayer;
p.cooldown = p.cooldown + delta;
if (p.cooldown > 100) {
p.cooldown = 100;
}
if (p.cooldown < 0) {
p.cooldown = 0;
}
}
function initPOreMeters() {
p = _root.activePlayer;
_root.oreMeter1._width = (79 * p.ore1) / 100;
_root.oreMeter2._x = _root.oreMeter1._width + _root.oreMeter1._x;
_root.oreMeter2._width = (79 * p.ore2) / 100;
_root.oreMeter3._x = _root.oreMeter2._width + _root.oreMeter2._x;
_root.oreMeter3._width = (79 * p.ore3) / 100;
_root.oreMeter4._x = _root.oreMeter3._width + _root.oreMeter3._x;
_root.oreMeter4._width = (79 * p.ore4) / 100;
}
function updatePOre1(delta) {
p = _root.activePlayer;
p.ore1 = p.ore1 + delta;
if ((((p.ore1 + p.ore2) + p.ore3) + p.ore4) > _root.oreCapacity) {
p.ore1 = _root.oreCapacity - ((p.ore2 + p.ore3) + p.ore4);
}
if (p.ore1 < 0) {
p.ore1 = 0;
}
_root.initPOreMeters();
}
function updatePOre2(delta) {
p = _root.activePlayer;
p.ore2 = p.ore2 + delta;
if ((((p.ore1 + p.ore2) + p.ore3) + p.ore4) > _root.oreCapacity) {
p.ore2 = _root.oreCapacity - ((p.ore1 + p.ore3) + p.ore4);
}
if (p.ore2 < 0) {
p.ore2 = 0;
}
_root.initPOreMeters();
}
function updatePOre3(delta) {
p = _root.activePlayer;
p.ore3 = p.ore3 + delta;
if ((((p.ore1 + p.ore2) + p.ore3) + p.ore4) > _root.oreCapacity) {
p.ore3 = _root.oreCapacity - ((p.ore1 + p.ore2) + p.ore4);
}
if (p.ore3 < 0) {
p.ore3 = 0;
}
_root.initPOreMeters();
}
function updatePOre4(delta) {
p = _root.activePlayer;
p.ore4 = p.ore4 + delta;
if ((((p.ore1 + p.ore2) + p.ore3) + p.ore4) > _root.oreCapacity) {
p.ore4 = _root.oreCapacity - ((p.ore1 + p.ore2) + p.ore3);
}
if (p.ore4 < 0) {
p.ore4 = 0;
}
_root.initPOreMeters();
}
stop();
h = 400;
w = 550;
erosion = 5;
playerDepth = 0;
bossDepth = 1;
enemyDepth = 2;
enemyMax = 60;
curEnemy = 0;
pBulletDepth = enemyDepth + enemyMax;
pBulletMax = 60;
curPBullet = 0;
eBulletDepth = pBulletDepth + pBulletMax;
eBulletMax = 60;
curEBullet = 0;
oreDepth = eBulletDepth + eBulletmax;
oreMax = 60;
curOre = 0;
oreReward = 40;
oreCapacity = 400;
_root.world._visible = false;
_root.pauseText._visible = false;
_root.player._visible = false;
_root.pBullet2._visible = false;
_root.asteroid1._visible = false;
_root.asteroid2._visible = false;
_root.asteroid3._visible = false;
_root.asteroid4._visible = false;
_root.dangeroid1._visible = false;
_root.dangeroid2._visible = false;
_root.asteroidBoss._visible = false;
_root.ore1._visible = false;
_root.ore2._visible = false;
_root.ore3._visible = false;
_root.ore4._visible = false;
_root.player.duplicateMovieClip("activePlayer", 0);
_root.activePlayer._x = 50;
_root.activePlayer._y = h / 2;
_root.activePlayer._rotation = 0;
scrollSpeed = -5;
Instance of Symbol 88 MovieClip "world" in Frame 6 (6.95 KiB) ● ●
onClipEvent (load) {
function formation1() {
x = _root.w + 100;
y = random(_root.h);
xVel = -random(11);
yVel = random(11) - 5;
rot = random(360);
r = random(4) + 1;
_root.spawnAsteroid(_root["asteroid" + r], x, y, xVel, yVel, rot);
}
function formation2() {
x = ((_root.w / 2) + random(300)) - 150;
y = _root.h + 100;
xVel = random(11) - 5;
yVel = random(11) - 15;
rot = random(360);
r = random(4) + 1;
_root.spawnAsteroid(_root["asteroid" + r], x, y, xVel, yVel, rot);
}
function formation3() {
x = ((_root.w / 2) + random(300)) - 150;
y = -100;
xVel = random(11) - 5;
yVel = 15 - random(11);
rot = random(360);
r = random(4) + 1;
_root.spawnAsteroid(_root["asteroid" + r], x, y, xVel, yVel, rot);
}
function formation4() {
x = _root.w + 100;
y = random(_root.h);
xVel = -random(11);
yVel = random(11) - 5;
rot = random(360);
_root.spawnAsteroid(_root.dangeroid1, x, y, xVel, yVel, rot);
}
function formation5() {
x = _root.w + 100;
y = random(_root.h);
xVel = -random(11);
yVel = random(11) - 5;
rot = random(360);
_root.spawnAsteroid(_root.dangeroid2, x, y, xVel, yVel, rot);
}
function formation6() {
wallCount = 6;
spacing = _root.h / (wallCount - 1);
x = _root.w + 100;
y = 0;
xVel = -5;
yVel = 0;
rot = random(360);
wc = 0;
while (wc < wallCount) {
r = random(4) + 1;
_root.spawnAsteroid(_root["asteroid" + r], x, y + (wc * spacing), xVel, yVel, rot);
wc++;
}
}
function formation7() {
wallCount = 6;
spacing = _root.h / (wallCount - 1);
x = _root.w + 100;
y = 0;
xVel = -5;
yVel = 0;
rot = random(360);
wc = 0;
while (wc < wallCount) {
r = random(2) + 1;
_root.spawnAsteroid(_root["dangeroid" + r], x, y + (wc * spacing), xVel, yVel, rot);
wc++;
}
}
function formationBoss() {
x = _root.w - 100;
y = (_root.h * 3) / 4;
rot = random(360);
_root.spawnAsteroidBoss(_root.asteroidBoss, x, y, 0, 0, rot);
}
function formation8() {
oreX = _root.w + 100;
oreY = ((_root.h / 2) + random(400)) - 200;
_root.spawnOre(_root.ore1, oreX, oreY, 0);
}
function formation9() {
oreX = _root.w + 100;
oreY = ((_root.h / 2) + random(400)) - 200;
_root.spawnOre(_root.ore2, oreX, oreY, 0);
}
function formation10() {
oreX = _root.w + 100;
oreY = ((_root.h / 2) + random(400)) - 200;
_root.spawnOre(_root.ore3, oreX, oreY, 0);
}
function formation11() {
oreX = _root.w + 100;
oreY = ((_root.h / 2) + random(400)) - 200;
_root.spawnOre(_root.ore4, oreX, oreY, 0);
}
curFrame = 0;
f1s = [0, 0, 0, 0];
f1f = [21600, 21600, 21600, 21600];
f1p = [3.4, 4.4, 3.1, 2];
f2s = [0, 0, 0, 0];
f2f = [21600, 21600, 21600, 21600];
f2p = [0.25, 0.5, 1, 0.5];
f3s = [0, 0, 0, 0];
f3f = [21600, 21600, 21600, 21600];
f3p = [0.5, 1, 1, 0.5];
f4s = [1000, 500, 0, 0];
f4f = [21600, 21600, 21600, 21600];
f4p = [0.125, 0.25, 0.25, 0.125];
f5s = [0, 0, 0, 0];
f5f = [21600, 21600, 21600, 21600];
f5p = [0, 0, 0.125, 0.5];
f6s = [1000, 600, 0, 0];
f6f = [21600, 21600, 21600, 21600];
f6p = [0.125, 0.125, 0.25, 0.25];
f7s = [0, 0, 0, 300];
f7f = [21600, 21600, 21600, 21600];
f7p = [0, 0, 0, 0.125];
f8s = [0, 0, 0, 0];
f8f = [21600, 21600, 21600, 21600];
f8p = [0.5, 0.5, 0.35, 0.4];
f9s = [0, 0, 0, 0];
f9f = [21600, 21600, 21600, 21600];
f9p = [0.4, 0.3, 0.25, 0.25];
f10s = [0, 0, 0, 0];
f10f = [21600, 21600, 21600, 21600];
f10p = [0.05, 0.1, 0.25, 0.25];
f11s = [0, 0, 0, 0];
f11f = [21600, 21600, 21600, 21600];
f11p = [0.05, 0.1, 0.15, 0.25];
}
onClipEvent (enterFrame) {
if (!_global.levelComplete) {
p = _root.activePlayer;
curFrame++;
if (Key.isDown(32) and ((curFrame - 6) > pauseFrame)) {
pauseFrame = curFrame;
_root.pause = !_root.pause;
_root.pauseText._visible = _root.pause;
}
if (!_root.pause) {
if (((curFrame > 21600) or ((((p.ore1 + p.ore2) + p.ore3) + p.ore4) >= _root.oreCapacity)) or (_global.bossSpawned and _global.bossSlain)) {
_global.levelComplete = true;
_global.curShieldOre = p.ore1;
_global.curBulletOre = p.ore2;
_global.curEngineOre = p.ore3;
_global.curWeaponOre = p.ore4;
_global.pShields = p.shields;
_global.pWeapons = p.weapons;
_global.pBullets = p.bullets;
_global.pEngines = p.engines;
p._rotation = 0;
p.gotoAndPlay(p.warpAnim);
_root.scrollSpeed = -50;
}
r = random(1000000) / 10000;
last = 0;
timeDif = 10 - (9 * Math.exp((-curFrame) / 5000));
lev = _global.curLevel;
spawned = false;
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f1s[lev])) and (curFrame < f1f[lev])) {
if (r < ((last = last + (timeDif * f1p[lev])))) {
formation1();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f2s[lev])) and (curFrame < f2f[lev])) {
if (r < ((last = last + (timeDif * f2p[lev])))) {
formation2();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f3s[lev])) and (curFrame < f3f[lev])) {
if (r < ((last = last + (timeDif * f3p[lev])))) {
formation3();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f4s[lev])) and (curFrame < f4f[lev])) {
if (r < ((last = last + (timeDif * f4p[lev])))) {
formation4();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f5s[lev])) and (curFrame < f5f[lev])) {
if (r < ((last = last + (timeDif * f5p[lev])))) {
formation5();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f6s[lev])) and (curFrame < f6f[lev])) {
if (r < ((last = last + (timeDif * f6p[lev])))) {
formation6();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f7s[lev])) and (curFrame < f7f[lev])) {
if (r < ((last = last + (timeDif * f7p[lev])))) {
formation7();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f8s[lev])) and (curFrame < f8f[lev])) {
if (r < ((last = last + (timeDif * f8p[lev])))) {
formation8();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f9s[lev])) and (curFrame < f9f[lev])) {
if (r < ((last = last + (timeDif * f9p[lev])))) {
formation9();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f10s[lev])) and (curFrame < f10f[lev])) {
if (r < ((last = last + (timeDif * f10p[lev])))) {
formation10();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (!spawned)) and (curFrame >= f11s[lev])) and (curFrame < f11f[lev])) {
if (r < ((last = last + (timeDif * f11p[lev])))) {
formation11();
spawned = true;
}
}
if ((((!_global.bossSpawned) and (_global.pBullets == 3)) and (_global.pEngines == 3)) and (_global.pWeapons == 3)) {
formationBoss();
_global.bossSpawned = true;
}
}
}
}
Instance of Symbol 120 MovieClip "ore2" in Frame 6 (536 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + _root.scrollSpeed);
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe <= 14) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre2(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Instance of Symbol 121 MovieClip "ore1" in Frame 6 (547 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
pickedup = 2;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + _root.scrollSpeed);
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre1(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Instance of Symbol 123 MovieClip "ore3" in Frame 6 (536 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + _root.scrollSpeed);
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe <= 14) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre3(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Instance of Symbol 125 MovieClip "ore4" in Frame 6 (536 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + _root.scrollSpeed);
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe <= 14) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre4(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Instance of Symbol 217 MovieClip "player" in Frame 6 (3.77 KiB) ●
onClipEvent (load) {
a = (_width - 7) / 2;
b = (_height - 4) / 2;
e_sq = 1 - ((b * b) / (a * a));
lastActiveFrame = 14;
deathAnim = 15;
deathEnd = 26;
warpAnim = 27;
warpEnd = 37;
shields = _global.pShields;
weapons = _global.pWeapons;
bullets = _global.pBullets;
engines = _global.pEngines;
vertCruize = 0;
vertSpeed = 0;
vertSpeedMax = 10 + ((10 / _global.pEnginesMax) * engines);
vertAccel = 2 + ((2 / _global.pEnginesMax) * engines);
vertDecel = 2;
vertAngleChange = 10 + ((10 / _global.pEnginesMax) * engines);
horizCruise = 0;
horizSpeed = 0;
horizSpeedMax = 15 + ((15 / _global.pEnginesMax) * engines);
horizAccel = 3 + ((3 / _global.pEnginesMax) * engines);
horizDecel = 2;
horizAngleChange = 3 + ((3 / _global.pEnginesMax) * engines);
angleMax = 30;
energy = 100;
cooldown = 100;
energyUsage = 70 - (20 * weapons);
cooldownUsage = 100;
energyRegen = 0.5;
cooldownRegen = 10;
ore1 = 0;
ore2 = 0;
ore3 = 0;
ore4 = 0;
if (_visible) {
_root.initPShields();
_root.initPWeapons();
_root.initPBullets();
_root.initPEngines();
_root.initPEnergy();
_root.initPOreMeters();
}
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if ((_currentframe == deathEnd) or (_currentframe == warpEnd)) {
_root.gotoAndPlay(5);
this.removeMovieClip();
} else if (_visible and (_currentframe <= lastActiveFrame)) {
if (_global.levelComplete) {
_root.gotoAndPlay(3);
this.removeMovieClip();
}
if (Key.isDown(38)) {
vertSpeed = vertSpeed - vertAccel;
if (vertSpeed < (-vertSpeedMax)) {
vertSpeed = -vertSpeedMax;
}
_rotation = (_rotation - vertAngleChange);
if (_rotation < (-angleMax)) {
_rotation = (-angleMax);
}
} else if (vertSpeed < 0) {
vertSpeed = vertSpeed + vertDecel;
if (vertSpeed > 0) {
vertSpeed = 0;
}
}
if (Key.isDown(40)) {
vertSpeed = vertSpeed + vertAccel;
if (vertSpeed > vertSpeedMax) {
vertSpeed = vertSpeedMax;
}
_rotation = (_rotation + vertAngleChange);
if (_rotation > angleMax) {
_rotation = angleMax;
}
} else if (vertSpeed > 0) {
vertSpeed = vertSpeed - vertDecel;
if (vertSpeed < 0) {
vertSpeed = 0;
}
}
if (Key.isDown(37)) {
horizSpeed = horizSpeed - horizAccel;
if (horizSpeed < (-horizSpeedMax)) {
horizSpeed = -horizSpeedMax;
}
if (_rotation < 0) {
_rotation = (_rotation + horizAngleChange);
if (_rotation > 0) {
_rotation = 0;
}
} else if (_rotation > 0) {
_rotation = (_rotation - horizAngleChange);
if (_rotation < 0) {
_rotation = 0;
}
}
} else if (horizSpeed < 0) {
horizSpeed = horizSpeed + horizDecel;
if (horizSpeed > 0) {
horizSpeed = 0;
}
}
if (Key.isDown(39)) {
horizSpeed = horizSpeed + horizAccel;
if (horizSpeed > horizSpeedMax) {
horizSpeed = horizSpeedMax;
}
if (_rotation < 0) {
_rotation = (_rotation + horizAngleChange);
if (_rotation > 0) {
_rotation = 0;
}
} else if (_rotation > 0) {
_rotation = (_rotation - horizAngleChange);
if (_rotation < 0) {
_rotation = 0;
}
}
} else if (horizSpeed > 0) {
horizSpeed = horizSpeed - horizDecel;
if (horizSpeed < 0) {
horizSpeed = 0;
}
}
_x = (_x + (horizSpeed + horizCruise));
_y = (_y + (vertSpeed + vertCruise));
if (_x < 0) {
_x = 0;
}
if (_x > _root.w) {
_x = _root.w;
}
if (_y < 0) {
_y = 0;
}
if (_y > _root.h) {
_y = _root.h;
}
if ((Key.isDown(17) and (energy > energyUsage)) and (cooldown == 100)) {
_root.updatePEnergy(-energyUsage);
_root.updatePCooldown(-cooldownUsage);
_root.spawnPBullet(_root.pBullet2, _x, _y, 0);
} else {
_root.updatePEnergy(energyRegen);
_root.updatePCooldown(cooldownRegen);
}
}
}
Instance of Symbol 219 MovieClip "asteroid1" in Frame 6 (1.08 KiB) ●
onClipEvent (load) {
a = (_width - _root.erosion) / 2;
b = (_height - _root.erosion) / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(41) - 20;
mass = 2;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
_rotation = (_rotation + rotSpeed);
if ((((_x < -100) or (_x > (_root.w + 100))) or (_y < -100)) or (_y > (_root.h + 100))) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
}
}
i = 0;
while (i < _root.pBulletMax) {
b = _root["pBullet_" + i];
if (hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
dx = _x - b._x;
dy = _y - b._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
normx = dx / dist;
normy = dy / dist;
horizSpeed = horizSpeed + ((normx * b.power) / (mass * (_global.curLevel + 1)));
vertSpeed = vertSpeed + ((normy * b.power) / (mass * (_global.curLevel + 1)));
}
}
i++;
}
}
}
Instance of Symbol 221 MovieClip "asteroid2" in Frame 6 (1.08 KiB) ●
onClipEvent (load) {
a = (_width - _root.erosion) / 2;
b = (_height - _root.erosion) / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(41) - 20;
mass = 3;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
_rotation = (_rotation + rotSpeed);
if ((((_x < -100) or (_x > (_root.w + 100))) or (_y < -100)) or (_y > (_root.h + 100))) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
}
}
i = 0;
while (i < _root.pBulletMax) {
b = _root["pBullet_" + i];
if (hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
dx = _x - b._x;
dy = _y - b._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
normx = dx / dist;
normy = dy / dist;
horizSpeed = horizSpeed + ((normx * b.power) / (mass * (_global.curLevel + 1)));
vertSpeed = vertSpeed + ((normy * b.power) / (mass * (_global.curLevel + 1)));
}
}
i++;
}
}
}
Instance of Symbol 227 MovieClip "dangeroid2" in Frame 6 (1.88 KiB) ●
onClipEvent (load) {
a = (_width - _root.erosion) / 2;
b = (_height - _root.erosion) / 2;
e_sq = 1 - ((b * b) / (a * a));
lastActiveFrame = 1;
deathAnim = 2;
deathEnd = 5;
rotSpeed = random(41) - 20;
threshhold = 125;
mass = 3;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_currentframe == deathEnd) {
this.removeMovieClip();
} else if (_visible and (_currentframe > lastActiveFrame)) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
_rotation = (_rotation + rotSpeed);
} else if (_visible) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
_rotation = (_rotation + rotSpeed);
if ((((_x < -100) or (_x > (_root.w + 100))) or (_y < -100)) or (_y > (_root.h + 100))) {
this.removeMovieClip();
}
p = _root.activePlayer;
dx = _x - p._x;
dy = _y - p._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
if (dist < threshhold) {
pieces = random(3) + 3;
diffAng = 360 / pieces;
p = 0;
while (p < pieces) {
r = random(5);
if (r < 4) {
r = 4;
} else {
r = 3;
}
xVel = (random(18) - 5) + horizSpeed;
yVel = (random(18) - 5) + vertSpeed;
_root.spawnAsteroid(_root["asteroid" + r], _x, _y, xVel, yVel, random(360));
p++;
}
this.gotoAndPlay(deathAnim);
}
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
}
}
i = 0;
while (i < _root.pBulletMax) {
b = _root["pBullet_" + i];
if (hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
dx = _x - b._x;
dy = _y - b._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
normx = dx / dist;
normy = dy / dist;
horizSpeed = horizSpeed + ((normx * b.power) / (mass * (_global.curLevel + 1)));
vertSpeed = vertSpeed + ((normy * b.power) / (mass * (_global.curLevel + 1)));
}
}
i++;
}
}
}
Instance of Symbol 229 MovieClip "asteroid3" in Frame 6 (1.08 KiB) ●
onClipEvent (load) {
a = (_width - _root.erosion) / 2;
b = (_height - _root.erosion) / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(41) - 20;
mass = 2;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
_rotation = (_rotation + rotSpeed);
if ((((_x < -100) or (_x > (_root.w + 100))) or (_y < -100)) or (_y > (_root.h + 100))) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
}
}
i = 0;
while (i < _root.pBulletMax) {
b = _root["pBullet_" + i];
if (hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
dx = _x - b._x;
dy = _y - b._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
normx = dx / dist;
normy = dy / dist;
horizSpeed = horizSpeed + ((normx * b.power) / (mass * (_global.curLevel + 1)));
vertSpeed = vertSpeed + ((normy * b.power) / (mass * (_global.curLevel + 1)));
}
}
i++;
}
}
}
Instance of Symbol 227 MovieClip "dangeroid1" in Frame 6 (1.08 KiB) ●
onClipEvent (load) {
a = (_width - _root.erosion) / 2;
b = (_height - _root.erosion) / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(41) - 20;
mass = 3;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
_rotation = (_rotation + rotSpeed);
if ((((_x < -100) or (_x > (_root.w + 100))) or (_y < -100)) or (_y > (_root.h + 100))) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
}
}
i = 0;
while (i < _root.pBulletMax) {
b = _root["pBullet_" + i];
if (hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
dx = _x - b._x;
dy = _y - b._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
normx = dx / dist;
normy = dy / dist;
horizSpeed = horizSpeed + ((normx * b.power) / (mass * (_global.curLevel + 1)));
vertSpeed = vertSpeed + ((normy * b.power) / (mass * (_global.curLevel + 1)));
}
}
i++;
}
}
}
Instance of Symbol 234 MovieClip "asteroidBoss" in Frame 6 (1.36 KiB) ●
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(41) - 20;
mass = 1000;
toughness = 5;
lastActiveFrame = 1;
deathAnim = 2;
deathEnd = 5;
cooldown = 100;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_currentframe == deathEnd) {
this.removeMovieClip();
} else if (_visible) {
_x = (_x + (5 + _root.scrollSpeed));
_y = (_y + 0);
_rotation = (_rotation + rotSpeed);
if ((((_x < -100) or (_x > (_root.w + 100))) or (_y < -100)) or (_y > (_root.h + 100))) {
this.removeMovieClip();
}
if (cooldown == 100) {
cooldown = 0;
x = random(_root.w);
y = -50;
xvel = random(3) + 2;
yvel = random(8) + 7;
_root.spawnAsteroid(_root.asteroid4, x, y, -xvel, yvel, _rotation);
} else {
cooldown = cooldown + 50;
if (cooldown > 100) {
cooldown = 100;
}
}
p = _root.activePlayer;
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
}
}
i = 0;
while (i < _root.enemyMax) {
b = _root["asteroid_" + i];
if ((b._currentframe == 1) and hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
b.gotoAndPlay(2);
toughness--;
if (toughness <= 0) {
_global.bossSlain = true;
this.gotoAndPlay(deathAnim);
break;
}
}
}
i++;
}
}
}
Instance of Symbol 238 MovieClip "asteroid4" in Frame 6 (1.08 KiB) ●
onClipEvent (load) {
a = (_width - _root.erosion) / 2;
b = (_height - _root.erosion) / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(41) - 20;
mass = 1;
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + (horizSpeed + _root.scrollSpeed));
_y = (_y + vertSpeed);
_rotation = (_rotation + rotSpeed);
if ((((_x < -100) or (_x > (_root.w + 200))) or (_y < -100)) or (_y > (_root.h + 100))) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe == 1) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
_root.updatePShields(-1);
}
}
i = 0;
while (i < _root.pBulletMax) {
b = _root["pBullet_" + i];
if (hitTest(b)) {
if (_root.ellipticHitTest(this, b)) {
dx = _x - b._x;
dy = _y - b._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
normx = dx / dist;
normy = dy / dist;
horizSpeed = horizSpeed + ((normx * b.power) / (mass * (_global.curLevel + 1)));
vertSpeed = vertSpeed + ((normy * b.power) / (mass * (_global.curLevel + 1)));
}
}
i++;
}
}
}
Instance of Symbol 242 MovieClip "pBullet2" in Frame 6 (522 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
if (_visible) {
this.gotoAndPlay(6);
this.gotoAndPlay(1);
}
p = _root.activePlayer;
speed = 70;
powerAdv = [6, 15, 27, 42];
power = powerAdv[p.bullets];
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_currentframe == 5) {
this.removeMovieClip();
} else if (_visible) {
_width = (_width + speed);
_height = (_height + speed);
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
}
}
Frame 7 (8 B)
stop();
Frame 8 (8 B)
stop();
Instance of Symbol 120 MovieClip "ore2" in Frame 8 (542 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + (_root.scrollSpeed * 0));
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe <= 14) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre2(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Instance of Symbol 121 MovieClip "ore1" in Frame 8 (542 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + (_root.scrollSpeed * 0));
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe <= 14) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre1(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Instance of Symbol 123 MovieClip "ore3" in Frame 8 (542 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + (_root.scrollSpeed * 0));
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe <= 14) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre3(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Instance of Symbol 125 MovieClip "ore4" in Frame 8 (542 B)
onClipEvent (load) {
a = _width / 2;
b = _height / 2;
e_sq = 1 - ((b * b) / (a * a));
rotSpeed = random(30);
}
onClipEvent (enterFrame) {
if (_root.pause) {
} else if (_visible) {
_x = (_x + (_root.scrollSpeed * 0));
_rotation = (_rotation + rotSpeed);
if (_x < -100) {
this.removeMovieClip();
}
p = _root.activePlayer;
if ((p._currentframe <= 14) and hitTest(p)) {
if (_root.ellipticHitTest(this, p)) {
this.gotoAndPlay(2);
_root.updatePOre4(_root.oreReward);
this.removeMovieClip();
}
}
}
}
Frame 9 (8 B)
stop();
Symbol 8 MovieClip [FLabelSymbol] Frame 1 (1.38 KiB) ●
#initclip 2
_global.FLabelClass = function () {
if (this.hostComponent == undefined) {
this.hostComponent = ((this._parent.controller == undefined) ? (this._parent) : (this._parent.controller));
}
if (this.customTextStyle == undefined) {
if (this.hostComponent.textStyle == undefined) {
this.hostComponent.textStyle = new TextFormat();
}
this.textStyle = this.hostComponent.textStyle;
this.enable = true;
}
};
FLabelClass.prototype = new MovieClip();
Object.registerClass("FLabelSymbol", FLabelClass);
FLabelClass.prototype.setLabel = function (label) {
var val = this.hostComponent.styleTable.embedFonts.value;
if (val != undefined) {
this.labelField.embedFonts = val;
}
this.labelField.setNewTextFormat(this.textStyle);
this.labelField.text = label;
this.labelField._height = this.labelField.textHeight + 2;
};
FLabelClass.prototype.setSize = function (width) {
this.labelField._width = width;
};
FLabelClass.prototype.setEnabled = function (enable) {
this.enable = enable;
var tmpColor = this.hostComponent.styleTable[(enable ? "textColor" : "textDisabled")].value;
if (tmpColor == undefined) {
tmpColor = (enable ? 0 : 8947848);
}
this.setColor(tmpColor);
};
FLabelClass.prototype.getLabel = function () {
return(this.labelField.text);
};
FLabelClass.prototype.setColor = function (col) {
this.labelField.textColor = col;
};
#endinitclip
Symbol 17 MovieClip Frame 1 (293 B)
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame3, "shadow");
component.registerSkinElement(frame1, "darkshadow");
component.registerSkinElement(frame4, "highlight");
component.registerSkinElement(frame2, "highlight3D");
Symbol 23 MovieClip Frame 1 (293 B)
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame3, "shadow");
component.registerSkinElement(frame1, "darkshadow");
component.registerSkinElement(frame4, "highlight");
component.registerSkinElement(frame2, "highlight3D");
Symbol 29 MovieClip Frame 1 (293 B)
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame4, "shadow");
component.registerSkinElement(frame2, "darkshadow");
component.registerSkinElement(frame3, "highlight");
component.registerSkinElement(frame1, "highlight3D");
Symbol 35 MovieClip Frame 1 (293 B)
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame3, "shadow");
component.registerSkinElement(frame1, "darkshadow");
component.registerSkinElement(frame4, "highlight");
component.registerSkinElement(frame2, "highlight3D");
Symbol 36 MovieClip [fpb_states] Frame 1 (8 B)
stop();
Symbol 36 MovieClip [fpb_states] Frame 2 (8 B)
stop();
Symbol 36 MovieClip [fpb_states] Frame 3 (8 B)
stop();
Symbol 36 MovieClip [fpb_states] Frame 4 (8 B)
stop();
Symbol 37 MovieClip [FUIComponentSymbol] Frame 1 (7.92 KiB) ● ●
#initclip 1
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
this.enable = true;
this.focused = false;
this.useHandCursor = false;
this._accImpl = new Object();
this._accImpl.stub = true;
this.styleTable = new Array();
if (_global.globalStyleFormat == undefined) {
_global.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_global._focusControl = new Object();
_global._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_global._focusControl);
}
if (this._name != undefined) {
this._focusrect = false;
this.tabEnabled = true;
this.focusEnabled = true;
this.tabChildren = false;
this.tabFocused = true;
if (this.hostStyle == undefined) {
globalStyleFormat.addListener(this);
} else {
this.styleTable = this.hostStyle;
}
this.deadPreview._visible = false;
this.deadPreview._width = (this.deadPreview._height = 1);
this.methodTable = new Object();
this.keyListener = new Object();
this.keyListener.controller = this;
this.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
this.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var i in this.styleFormat_prm) {
this.setStyleProperty(i, this.styleFormat_prm[i]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
this.enable = ((arguments.length > 0) ? (enabledFlag) : true);
this.tabEnabled = (this.focusEnabled = enabledFlag);
if ((!this.enable) && (this.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
this.width = w;
this.height = h;
this.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
this.handlerObj = ((obj == undefined) ? (this._parent) : (obj));
this.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
this.methodTable[methodName] = true;
this.onEnterFrame = this.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
if (this.methodTable.setSize) {
this.setSize(this.width, this.height);
} else {
this.cleanUINotSize();
}
this.methodTable = new Object();
delete this.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
for (var funct in this.methodTable) {
this[funct]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var inner = this.styleTable.focusRectInner.value;
var outer = this.styleTable.focusRectOuter.value;
if (inner == undefined) {
inner = 16777215 /* 0xFFFFFF */;
}
if (outer == undefined) {
outer = 0;
}
this.createEmptyMovieClip("focusRect", 1000);
this.focusRect.controller = this;
this.focusRect.lineStyle(1, outer);
this.focusRect.moveTo(x, y);
this.focusRect.lineTo(x + w, y);
this.focusRect.lineTo(x + w, y + h);
this.focusRect.lineTo(x, y + h);
this.focusRect.lineTo(x, y);
this.focusRect.lineStyle(1, inner);
this.focusRect.moveTo(x + 1, y + 1);
this.focusRect.lineTo((x + w) - 1, y + 1);
this.focusRect.lineTo((x + w) - 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, y + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
this.tabFocused = false;
this.focusRect.removeMovieClip();
Selection.setFocus(this);
};
FUIComponentClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
this.focused = true;
Key.addListener(this.keyListener);
if (this.tabFocused) {
this.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
this.tabFocused = true;
this.focused = false;
this.focusRect.removeMovieClip();
Key.removeListener(this.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
if (value == "") {
return(undefined);
}
var tmpValue = parseInt(value);
if (!isNaN(tmpValue)) {
value = tmpValue;
}
var global = ((arguments.length > 2) ? (isGlobal) : false);
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].useGlobal || (!global)) {
this.styleTable[propName].value = value;
if (this.setCustomStyleProperty(propName, value)) {
} else if (propName == "embedFonts") {
this.invalidate("setSize");
} else if (propName.subString(0, 4) == "text") {
if (this.textStyle == undefined) {
this.textStyle = new TextFormat();
}
var textProp = propName.subString(4, propName.length);
this.textStyle[textProp] = value;
this.invalidate("setSize");
} else {
for (var j in this.styleTable[propName].coloredMCs) {
var myColor = new Color(this.styleTable[propName].coloredMCs[j]);
if (this.styleTable[propName].value == undefined) {
var myTObj = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
myColor.setTransform(myTObj);
} else {
myColor.setRGB(value);
}
}
}
this.styleTable[propName].useGlobal = global;
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].coloredMCs == undefined) {
this.styleTable[propName].coloredMCs = new Object();
}
this.styleTable[propName].coloredMCs[skinMCRef] = skinMCRef;
if (this.styleTable[propName].value != undefined) {
var myColor = new Color(skinMCRef);
myColor.setRGB(this.styleTable[propName].value);
}
};
_global.FStyleFormat = function () {
this.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
this.listeners = new Object();
this.isGlobal = false;
if (arguments.length > 0) {
for (var i in arguments[0]) {
this[i] = arguments[0][i];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var arg = 0;
while (arg < arguments.length) {
var mcRef = arguments[arg];
this.listeners[arguments[arg]] = mcRef;
for (var i in this) {
if (this.isAStyle(i)) {
mcRef.updateStyleProperty(this, i.toString());
}
}
arg++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
this.listeners[component] = undefined;
for (var prop in this) {
if (this.isAStyle(prop)) {
if (component.styleTable[prop].useGlobal == this.isGlobal) {
component.styleTable[prop].useGlobal = true;
var value = (this.isGlobal ? undefined : (globalStyleFormat[prop]));
component.setStyleProperty(prop, value, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var count = 0;
for (var i in this.listeners) {
var component = this.listeners[i];
if (arguments.length > 0) {
var j = 0;
while (j < arguments.length) {
if (this.isAStyle(arguments[j])) {
component.updateStyleProperty(this, arguments[j]);
}
j++;
}
} else {
for (var j in this) {
if (this.isAStyle(j)) {
component.updateStyleProperty(this, j.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 41 MovieClip [FBoundingBoxSymbol] Frame 1 (93 B)
var component = _parent;
component.registerSkinElement(boundingBox, "background");
stop();
Symbol 41 MovieClip [FBoundingBoxSymbol] Frame 2 (76 B)
component.registerSkinElement(boundingBox2, "backgroundDisabled");
stop();
Symbol 44 MovieClip [FPushButtonSymbol] Frame 1 (7.42 KiB) ● ●
#initclip 3
function FPushButtonClass() {
this.init();
}
FPushButtonClass.prototype = new FUIComponentClass();
Object.registerClass("FPushButtonSymbol", FPushButtonClass);
FPushButtonClass.prototype.init = function () {
super.setSize(this._width, this._height);
this.boundingBox_mc.unloadMovie();
this.attachMovie("fpb_states", "fpbState_mc", 1);
this.attachMovie("FLabelSymbol", "fLabel_mc", 2);
this.attachMovie("fpb_hitArea", "fpb_hitArea_mc", 3);
super.init();
this.btnState = false;
this.setClickHandler(this.clickHandler);
this._xscale = 100;
this._yscale = 100;
this.setSize(this.width, this.height);
if (this.label != undefined) {
this.setLabel(this.label);
}
this.ROLE_SYSTEM_PUSHBUTTON = 43;
this.STATE_SYSTEM_PRESSED = 8;
this.EVENT_OBJECT_STATECHANGE = 32778;
this.EVENT_OBJECT_NAMECHANGE = 32780;
this._accImpl.master = this;
this._accImpl.stub = false;
this._accImpl.get_accRole = this.get_accRole;
this._accImpl.get_accName = this.get_accName;
this._accImpl.get_accState = this.get_accState;
this._accImpl.get_accDefaultAction = this.get_accDefaultAction;
this._accImpl.accDoDefaultAction = this.accDoDefaultAction;
};
FPushButtonClass.prototype.setHitArea = function (w, h) {
var hit = this.fpb_hitArea_mc;
this.hitArea = hit;
hit._visible = false;
hit._width = w;
hit._height = ((arguments.length > 1) ? (h) : (hit._height));
};
FPushButtonClass.prototype.setSize = function (w, h) {
w = ((w < 6) ? 6 : (w));
if (arguments.length > 1) {
if (h < 6) {
h = 6;
}
}
super.setSize(w, h);
this.setLabel(this.getLabel());
this.arrangeLabel();
this.setHitArea(w, h);
this.boundingBox_mc._width = w;
this.boundingBox_mc._height = h;
this.drawFrame();
if (this.focused) {
super.myOnSetFocus();
}
this.initContentPos("fLabel_mc");
};
FPushButtonClass.prototype.arrangeLabel = function () {
var label = this.fLabel_mc;
var h = this.height;
var w = (this.width - 2);
var b = 1;
this.fLabel_mc.setSize(w - (b * 4));
label._x = b * 3;
label._y = (h / 2) - (label._height / 2);
};
FPushButtonClass.prototype.getLabel = function () {
return(this.fLabel_mc.labelField.text);
};
FPushButtonClass.prototype.setLabel = function (label) {
this.fLabel_mc.setLabel(label);
this.txtFormat();
this.arrangeLabel();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_NAMECHANGE);
}
};
FPushButtonClass.prototype.getEnabled = function () {
return(this.enabled);
};
FPushButtonClass.prototype.setEnabled = function (enable) {
if (enable || (enable == undefined)) {
this.gotoFrame(1);
this.drawFrame();
this.flabel_mc.setEnabled(true);
this.enabled = true;
super.setEnabled(true);
} else {
this.gotoFrame(4);
this.drawFrame();
this.flabel_mc.setEnabled(false);
this.enabled = false;
super.setEnabled(false);
}
};
FPushButtonClass.prototype.txtFormat = function () {
var txtS = this.textStyle;
var sTbl = this.styleTable;
txtS.align = ((sTbl.textAlign.value == undefined) ? ((txtS.align = "center")) : undefined);
txtS.leftMargin = ((sTbl.textLeftMargin.value == undefined) ? ((txtS.leftMargin = 1)) : undefined);
txtS.rightMargin = ((sTbl.textRightMargin.value == undefined) ? ((txtS.rightMargin = 1)) : undefined);
if (this.fLabel_mc._height > this.height) {
super.setSize(this.width, this.fLabel_mc._height);
} else {
super.setSize(this.width, this.height);
}
this.fLabel_mc.labelField.setTextFormat(this.textStyle);
this.setEnabled(this.enable);
};
FPushButtonClass.prototype.drawFrame = function () {
var b = 1;
var x1 = 0;
var y1 = 0;
var x2 = this.width;
var y2 = this.height;
var mc_array = ["up_mc", "over_mc", "down_mc", "disabled_mc"];
var frame = mc_array[this.fpbState_mc._currentframe - 1];
var mc = "frame";
var i = 0;
while (i < 6) {
x1 = x1 + ((i % 2) * b);
y1 = y1 + ((i % 2) * b);
x2 = x2 - (((i + 1) % 2) * b);
y2 = y2 - (((i + 1) % 2) * b);
var w = (Math.abs(x1 - x2) + (2 * b));
var h = (Math.abs(y1 - y2) + (2 * b));
this.fpbState_mc[frame][mc + i]._width = w;
this.fpbState_mc[frame][mc + i]._height = h;
this.fpbState_mc[frame][mc + i]._x = x1 - b;
this.fpbState_mc[frame][mc + i]._y = y1 - b;
i++;
}
};
FPushButtonClass.prototype.setClickHandler = function (chng, obj) {
this.handlerObj = ((arguments.length < 2) ? (this._parent) : (obj));
this.clickHandler = chng;
};
FPushButtonClass.prototype.executeCallBack = function () {
this.handlerObj[this.clickHandler](this);
};
FPushButtonClass.prototype.initContentPos = function (mc) {
this.incrVal = 1;
this.initx = this[mc]._x - (this.getBtnState() * this.incrVal);
this.inity = this[mc]._y - (this.getBtnState() * this.incrVal);
this.togx = this.initx + this.incrVal;
this.togy = this.inity + this.incrVal;
};
FPushButtonClass.prototype.setBtnState = function (state) {
this.btnState = state;
if (state) {
this.fLabel_mc._x = this.togx;
this.fLabel_mc._y = this.togy;
} else {
this.fLabel_mc._x = this.initx;
this.fLabel_mc._y = this.inity;
}
};
FPushButtonClass.prototype.getBtnState = function () {
return(this.btnState);
};
FPushButtonClass.prototype.myOnSetFocus = function () {
this.focused = true;
super.myOnSetFocus();
};
FPushButtonClass.prototype.onPress = function () {
this.pressFocus();
this.fpbState_mc.gotoAndStop(3);
this.drawFrame();
this.setBtnState(true);
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_STATECHANGE, true);
}
};
FPushButtonClass.prototype.onRelease = function () {
this.fpbState_mc.gotoAndStop(2);
this.drawFrame();
this.executeCallBack();
this.setBtnState(false);
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_STATECHANGE, true);
}
};
FPushButtonClass.prototype.onRollOver = function () {
this.fpbState_mc.gotoAndStop(2);
this.drawFrame();
};
FPushButtonClass.prototype.onRollOut = function () {
this.fpbState_mc.gotoAndStop(1);
this.drawFrame();
};
FPushButtonClass.prototype.onReleaseOutside = function () {
this.setBtnState(false);
this.fpbState_mc.gotoAndStop(1);
this.drawFrame();
};
FPushButtonClass.prototype.onDragOut = function () {
this.setBtnState(false);
this.fpbState_mc.gotoAndStop(1);
this.drawFrame();
};
FPushButtonClass.prototype.onDragOver = function () {
this.setBtnState(true);
this.fpbState_mc.gotoAndStop(3);
this.drawFrame();
};
FPushButtonClass.prototype.myOnKeyDown = function () {
if ((Key.getCode() == 32) && (this.pressOnce == undefined)) {
this.onPress();
this.pressOnce = 1;
}
};
FPushButtonClass.prototype.myOnKeyUp = function () {
if (Key.getCode() == 32) {
this.onRelease();
this.pressOnce = undefined;
}
};
FPushButtonClass.prototype.get_accRole = function (childId) {
return(this.master.ROLE_SYSTEM_PUSHBUTTON);
};
FPushButtonClass.prototype.get_accName = function (childId) {
return(this.master.getLabel());
};
FPushButtonClass.prototype.get_accState = function (childId) {
if (this.pressOnce) {
return(this.master.STATE_SYSTEM_PRESSED);
}
return(this.master.STATE_SYSTEM_DEFAULT);
};
FPushButtonClass.prototype.get_accDefaultAction = function (childId) {
return("Press");
};
FPushButtonClass.prototype.accDoDefaultAction = function (childId) {
this.master.onPress();
this.master.onRelease();
};
#endinitclip
boundingBox_mc._visible = false;
deadPreview._visible = false;
Symbol 57 Button (31 B)
on (release) {
_root.play();
}
Symbol 58 MovieClip Frame 1 (193 B)
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop (3);
}
Symbol 58 MovieClip Frame 2 (17 B)
gotoAndPlay (1);
Symbol 58 MovieClip Frame 3 (14 B)
_root.play();
Symbol 71 Button (67 B)
on (release) {
stopAllSounds();
song.start();
gotoAndPlay (3);
}
Symbol 77 Button (67 B)
on (release) {
stopAllSounds();
song.start();
gotoAndStop (7);
}
Symbol 83 Button (67 B)
on (release) {
stopAllSounds();
song.start();
gotoAndPlay (5);
}
Symbol 85 Button (34 B)
on (release) {
gotoAndStop (9);
}
Symbol 88 MovieClip Frame 1 (8 B)
stop();
Symbol 88 MovieClip Frame 2 (17 B)
stopAllSounds();
Symbol 110 Button (165 B)
on (release) {
if (_global.win) {
_root.gotoAndPlay(2);
world.gotoAndPlay(2);
} else {
_root.gotoAndPlay(_root.levelOffset + 1);
world.gotoAndPlay(2);
}
}
Symbol 113 Button (67 B)
on (release) {
stopAllSounds();
song.start();
gotoAndPlay (2);
}
Symbol 120 MovieClip Frame 1 (8 B)
stop();
Symbol 121 MovieClip Frame 1 (8 B)
stop();
Symbol 123 MovieClip Frame 1 (8 B)
stop();
Symbol 125 MovieClip Frame 1 (8 B)
stop();
Symbol 144 MovieClip Frame 1 (8 B)
stop();
Symbol 144 MovieClip Frame 14 (17 B)
gotoAndStop (1);
Symbol 144 MovieClip Frame 26 (8 B)
stop();
Symbol 144 MovieClip Frame 37 (8 B)
stop();
Symbol 152 MovieClip Frame 1 (8 B)
stop();
Symbol 152 MovieClip Frame 16 (8 B)
stop();
Symbol 159 MovieClip Frame 1 (8 B)
stop();
Symbol 159 MovieClip Frame 13 (8 B)
stop();
Symbol 166 MovieClip Frame 1 (8 B)
stop();
Symbol 166 MovieClip Frame 13 (8 B)
stop();
Symbol 176 MovieClip Frame 1 (8 B)
stop();
Symbol 176 MovieClip Frame 14 (8 B)
stop();
Symbol 186 MovieClip Frame 1 (8 B)
stop();
Symbol 186 MovieClip Frame 14 (8 B)
stop();
Symbol 190 MovieClip Frame 1 (8 B)
stop();
Symbol 190 MovieClip Frame 4 (8 B)
stop();
Symbol 194 MovieClip Frame 1 (8 B)
stop();
Symbol 194 MovieClip Frame 4 (8 B)
stop();
Symbol 198 MovieClip Frame 1 (8 B)
stop();
Symbol 217 MovieClip Frame 1 (8 B)
stop();
Symbol 217 MovieClip Frame 14 (17 B)
gotoAndPlay (1);
Symbol 217 MovieClip Frame 26 (17 B)
gotoAndPlay (1);
Symbol 217 MovieClip Frame 37 (8 B)
stop();
Symbol 227 MovieClip Frame 1 (8 B)
stop();
Symbol 227 MovieClip Frame 6 (8 B)
stop();
Symbol 234 MovieClip Frame 1 (8 B)
stop();
Symbol 234 MovieClip Frame 11 (8 B)
stop();
Symbol 238 MovieClip Frame 1 (8 B)
stop();
Symbol 238 MovieClip Frame 18 (8 B)
stop();
Symbol 242 MovieClip Frame 5 (8 B)
stop();
Symbol 263 Button (34 B)
on (release) {
gotoAndStop (2);
}
Symbol 265 Button (34 B)
on (release) {
gotoAndStop (8);
}
Symbol 284 Button (34 B)
on (release) {
gotoAndStop (2);
}
Symbol 285 Button (34 B)
on (release) {
gotoAndStop (7);
}