Instance of Symbol 5 MovieClip in Frame 2
on (press) {
getURL (this._parent.outURL, "_blank");
}
Instance of Symbol 12 MovieClip in Frame 2
on (press) {
getURL (this._parent.outURL, "_blank");
}
Frame 3
stot = this.getBytesTotal();
sloa = this.getBytesLoaded();
if (stot != 0) {
per = Math.floor((sloa / stot) * 100);
} else {
per = 0;
}
mc_bar.mc._x = mc_bar.mc._width * (-1 + (sloa / stot));
txtPer = String(per) + "%";
if (((sloa >= 1) && (stot >= 1)) && (sloa == stot)) {
gotoAndStop ("main");
inMenuFirst();
} else {
gotoAndPlay (2);
}
Instance of Symbol 138 MovieClip in Frame 5
onClipEvent (enterFrame) {
this._parent.moveBack();
}
Instance of Symbol 156 MovieClip "mc_sloop" in Frame 5
onClipEvent (load) {
var soundControl = new Sound(this);
}
Instance of Symbol 161 MovieClip "btn_sound" in Frame 5
onClipEvent (load) {
if (this._parent.stopSoundFlag) {
this.gotoAndStop(2);
}
}
Frame 8
this.stop();
Instance of Symbol 138 MovieClip "mc_control" in Frame 8
onClipEvent (load) {
tellTarget (this._parent) {
levelStartInit();
};
}
onClipEvent (enterFrame) {
tellTarget (this._parent) {
newTimer = getTimer();
dTime = newTimer - lastTimer;
txtFps = 1 / (dTime / 1000);
lastTimer = newTimer;
processGame(dTime, lastTimer);
back2.move(dTime);
back3.move(dTime);
if (!stopSoundFlag) {
if (sndHeroExp) {
sndBonus = false;
sndEnemyExp = false;
sndGun1 = false;
sndGun2 = false;
sndHeroExp = false;
playSnd("lib_snd_hero_exp");
} else if (sndBonus) {
sndBonus = false;
sndEnemyExp = false;
sndGun1 = false;
sndGun2 = false;
playSnd("lib_snd_bonpick");
} else if (sndEnemyExp) {
sndEnemyExp = false;
sndGun1 = false;
sndGun2 = false;
playSnd("lib_snd_enemy_exp");
} else if (sndGun1) {
sndGun1 = false;
sndGun2 = false;
playSnd("lib_snd_gun01");
} else if (sndGun2) {
sndGun2 = false;
playSnd("lib_snd_gun02");
}
}
};
}
onClipEvent (mouseUp) {
tellTarget (_parent) {
if ((gameState == 4) || (gameState == 6)) {
playSnd("lib_snd_menuEnter");
newGame();
}
};
updateAfterEvent();
}
Symbol 1 MovieClip Frame 1
#initclip 8
function moveBack() {
newTimer = getTimer();
dTime = newTimer - lastTimer;
lastTimer = newTimer;
back2.move(dTime);
back3.move(dTime);
}
function soundOff() {
mc_sloop.gotoAndStop(3);
stopSoundFlag = true;
}
function soundOn() {
mc_sloop.gotoAndStop(2);
stopSoundFlag = false;
}
function new_game_pressed() {
this.gotoAndStop("choice");
}
function how_to_play_pressed() {
this.gotoAndStop("rules");
}
function more_pressed() {
getURL (outURL, "_blank");
}
function back_pressed() {
this.gotoAndStop("main");
}
function select1_pressed() {
curPlayerNum = 1;
gameStart();
}
function select2_pressed() {
curPlayerNum = 2;
gameStart();
}
function select3_pressed() {
curPlayerNum = 3;
gameStart();
}
function inMenuFirst() {
mc_sloop.gotoAndStop(2);
lastTimer = getTimer();
back2.init(mc_b2_1, mc_b2_2);
back3.init(mc_b3_1, mc_b3_2);
}
function gameStart() {
level = 0;
lifeCount = startLifeCount;
scores = 0;
bonusScores = 0;
nextLevel();
}
function nextLevel() {
if (level == maxLevel) {
newGame();
return(undefined);
}
level++;
enemiesOnLevel = 30 + Math.round(((level - 1) / (maxLevel - 1)) * 20);
sKoeff = 1 + (((level - 1) / (maxLevel - 1)) * 0.4);
vKoeff = 1 + (((level - 1) / (maxLevel - 1)) * 0.5);
fKoeff = 1.2 - (((level - 1) / (maxLevel - 1)) * 0.3);
bonusEnemies = 3 + Math.round(((level - 1) / (maxLevel - 1)) * 5);
curBaseInd = base_array[level - 1];
this.gotoAndStop("reset");
this.gotoAndStop("game");
}
function newGame() {
this.gotoAndStop("main");
}
function playSnd(lib_snd) {
s = new Sound(this);
s.attachSound(lib_snd);
s.start();
}
function levelStartInit() {
sndBonus = false;
sndEnemyExp = false;
sndGun1 = false;
sndGun2 = false;
sndHeroExp = false;
eCounter = 0;
sCounter = 0;
mc_player.init(pSpeed_array[curPlayerNum - 1], pShield_array[curPlayerNum - 1]);
mc_player.setNum(curPlayerNum);
mc_face.gotoAndStop(curPlayerNum);
updateShieldScreen();
updateLifeScreen();
txtScores = scores;
txtEnemies = enemiesOnLevel;
curBonusEnemies = 0;
var _local1 = 0;
_local1 = 0;
while (_local1 < eTypeCount) {
curIncrease_array[_local1] = increase_array[level - 1][_local1];
if ((curIncrease_array[_local1] != 1) && (curIncrease_array[_local1] != 0)) {
curIncrease_array[_local1] = 1.5 * Math.random();
}
_local1++;
}
curEOnScreen = 0;
lastTimer = getTimer();
mc_b_cross._visible = false;
mc_b_back._visible = false;
mc_b_double._visible = false;
mc_level.mc.mc1.txt = level;
mc_level.mc.mc2.txt = level;
mc_level.mc.mc3.txt = level;
mc_level.mc.mc4.txt = level;
mc_level.mc.mc5.txt = level;
mc_player.toInFly();
gameState = 1;
}
function processGame(fTime, curTime) {
var _local2;
var _local4;
var _local3;
if (gameState == 1) {
mc_player.move(fTime, 0, 0);
if (mc_player.state == 1) {
mc_level.gotoAndStop("st0");
lastAddETime = getTimer();
gameState = 2;
}
} else if (gameState == 2) {
if ((curEOnScreen < maxEOnScreen) && ((curTime - lastAddTime) >= addETime)) {
addEnemy(curTime);
}
for (_local4 in mc_e) {
_local2 = mc_e[_local4];
_local2.move(fTime);
if (_local2.canShot()) {
doEnemyShot(_local2, mc_es);
}
_local3 = 1;
while (_local3 <= 3) {
if (_local2["he" + _local3].hitTest(mc_player.he)) {
addHitPlaneScpores();
doBoom(_local2._x, _local2._y);
_local2.destroy();
removeEnemy();
if (!mc_player.migFlag) {
if (mc_player.applyShot()) {
killPlayer();
}
updateShieldScreen();
}
break;
}
_local3++;
}
}
mc_player.move(fTime, _xmouse, _ymouse);
if (Key.isDown(1)) {
if (mc_player.canShot(curTime)) {
doPlayerShot(mc_player, mc_ps, curTime);
}
}
processPlayerShots(mc_ps, mc_e, fTime, curTime);
processEnemyShots(mc_es, mc_player, fTime);
processBonuses(mc_bonus, mc_player, fTime, curTime);
var _local7;
if (mc_b_cross._visible) {
_local7 = bonusTime - ((curTime - crossStartT) / 1000);
if (_local7 < 0) {
mc_b_cross._visible = false;
} else {
mc_b_cross.mc_txt.txt = Math.round(_local7);
}
}
if (mc_b_back._visible) {
_local7 = bonusTime - ((curTime - backStartT) / 1000);
if (_local7 < 0) {
mc_b_back._visible = false;
} else {
mc_b_back.mc_txt.txt = Math.round(_local7);
}
}
if (mc_b_double._visible) {
_local7 = bonusTime - ((curTime - doubleStartT) / 1000);
if (_local7 < 0) {
mc_b_double._visible = false;
} else {
mc_b_double.mc_txt.txt = Math.round(_local7);
}
}
} else {
for (_local4 in mc_e) {
mc_e[_local4].move(fTime);
}
processPlayerShots(mc_ps, mc_e, fTime, curTime);
processEnemyShots(mc_es, mc_player, fTime);
processBonuses(mc_bonus, mc_player, fTime, curTime);
if (gameState == 3) {
if ((curTime - killTime) >= killPauseTime) {
if (lifeCount > 0) {
this.gotoAndStop("reset");
this.gotoAndStop("game");
} else {
gameState = 4;
mc_level._visible = true;
mc_level.gotoAndStop("over");
}
return(undefined);
}
} else if (gameState == 4) {
} else if (gameState == 5) {
mc_player.move(fTime, 0, 0);
if (mc_player.state == 0) {
if (level == maxLevel) {
gameState = 6;
mc_level._visible = true;
mc_level.gotoAndStop("win");
} else {
nextLevel();
return(undefined);
}
}
} else if (gameState == 6) {
}
}
}
function addEnemy(curTime) {
var _local4;
var _local2 = 0;
var _local3 = -1;
var _local1 = 0;
_local1 = 0;
while (_local1 < eTypeCount) {
if ((_local1 != curBaseInd) && (curIncrease_array[_local1] > _local2)) {
_local2 = curIncrease_array[_local1];
_local3 = _local1;
}
_local1++;
}
if (_local2 >= 1) {
_local4 = mc_e.attachMovie("lib_e" + (_local3 + 1), String(eCounter), eCounter);
eCounter++;
if (eCounter >= 1000) {
eCounter = 0;
}
_local4.init();
_local4.setParams(s_array[_local3] * sKoeff, v_array[_local3] * vKoeff, f_array[_local3] * fKoeff);
curIncrease_array[_local3] = -1;
} else {
_local4 = mc_e.attachMovie("lib_e" + (curBaseInd + 1), String(eCounter), eCounter);
eCounter++;
_local4.init();
_local4.setParams(s_array[curBaseInd] * sKoeff, v_array[curBaseInd] * vKoeff, f_array[curBaseInd] * fKoeff);
_local1 = 0;
while (_local1 < eTypeCount) {
if (_local1 != curBaseInd) {
curIncrease_array[_local1] = curIncrease_array[_local1] + increase_array[level - 1][_local1];
}
_local1++;
}
}
curEOnScreen++;
lastAddTime = curTime;
}
function removeEnemy() {
if (!stopSoundFlag) {
sndEnemyExp = true;
}
enemiesOnLevel--;
curEOnScreen--;
if (enemiesOnLevel <= 0) {
enemiesOnLevel = 0;
gameState = 5;
mc_player.toOutFly();
var _local1;
for (_local1 in mc_e) {
doBoom(mc_e[_local1]._x, mc_e[_local1]._y);
mc_e[_local1].destroy();
}
for (_local1 in mc_es) {
mc_es[_local1].destroy();
}
}
txtEnemies = enemiesOnLevel;
}
function doPlayerShot(player, mc_ps, curTime) {
var _local1;
if ((mc_b_double._visible || (mc_b_cross._visible)) || (mc_b_back._visible)) {
if (!stopSoundFlag) {
sndGun2 = true;
}
} else if (!stopSoundFlag) {
sndGun1 = true;
}
if (mc_b_double._visible) {
_local1 = mc_ps.attachMovie("lib_ps", String(sCounter), sCounter);
_local1.init(player._x - 5, player._y - 5, 0, -1, playerShotSpeed);
sCounter++;
_local1 = mc_ps.attachMovie("lib_ps", String(sCounter), sCounter);
_local1.init(player._x + 5, player._y - 5, 0, -1, playerShotSpeed);
sCounter++;
} else {
_local1 = mc_ps.attachMovie("lib_ps", String(sCounter), sCounter);
_local1.init(player._x, player._y - 5, 0, -1, playerShotSpeed);
sCounter++;
}
if (mc_b_back._visible) {
_local1 = mc_ps.attachMovie("lib_ps", String(sCounter), sCounter);
_local1.init(player._x - 3.5, player._y + 3.5, 0.70711, 0.70711, playerShotSpeed);
sCounter++;
_local1 = mc_ps.attachMovie("lib_ps", String(sCounter), sCounter);
_local1.init(player._x + 3.5, player._y + 3.5, -0.70711, 0.70711, playerShotSpeed);
sCounter++;
}
if (mc_b_cross._visible) {
_local1 = mc_ps.attachMovie("lib_ps", String(sCounter), sCounter);
_local1.init(player._x - 3.5, player._y - 3.5, 0.70711, -0.70711, playerShotSpeed);
sCounter++;
_local1 = mc_ps.attachMovie("lib_ps", String(sCounter), sCounter);
_local1.init(player._x + 3.5, player._y - 3.5, -0.70711, -0.70711, playerShotSpeed);
sCounter++;
}
if (sCounter >= 1000) {
sCounter = 0;
}
player.shot(curTime);
}
function doEnemyShot(mc_enemy, mc_es) {
var _local5;
var _local2;
var _local1;
var _local4;
_local2 = mc_player._x - mc_enemy._x;
_local1 = mc_player._y - mc_enemy._y;
_local4 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
_local2 = _local2 / _local4;
_local1 = _local1 / _local4;
_local5 = mc_es.attachMovie("lib_es", String(sCounter), sCounter);
sCounter++;
if (sCounter >= 1000) {
sCounter = 0;
}
_local5.init(mc_enemy._x + (_local2 * 20), mc_enemy._y + (_local1 * 20), _local2, _local1, enemyShotSpeed);
mc_enemy.shot();
}
function processPlayerShots(mc_ps, mc_e, fTime, curTime) {
var _local7;
var _local4;
var _local3;
var _local1;
var _local2 = {x:0, y:0};
for (_local7 in mc_ps) {
_local3 = mc_ps[_local7];
if (!_local3.move(fTime)) {
continue;
}
_local2.x = _local3._x;
_local2.y = _local3._y;
mc_ps.localToGlobal(_local2);
for (_local4 in mc_e) {
_local1 = mc_e[_local4];
if (_local1.h.hitTest(_local2.x, _local2.y, true) || (_local1.h.hitTest(_local2.x - (10 * _local3.vx), _local2.y - (10 * _local3.vy), true))) {
_local3.destroy();
addHitPlaneScpores();
if (_local1.applyShot()) {
curBonusEnemies++;
if (curBonusEnemies >= bonusEnemies) {
curBonusEnemies = 0;
addBonus(_local1._x, _local1._y, curTime);
}
doBoom(_local1._x, _local1._y);
_local1.destroy();
removeEnemy();
} else {
doSmallBoom(_local1._x, _local1._y);
}
}
}
}
}
function processEnemyShots(mc_es, mc_player, fTime) {
var _local5;
var _local2;
var _local1 = {x:0, y:0};
for (_local5 in mc_es) {
_local2 = mc_es[_local5];
if (!_local2.move(fTime)) {
continue;
}
_local1.x = _local2._x;
_local1.y = _local2._y;
mc_es.localToGlobal(_local1);
if ((!mc_player.migFlag) && (mc_player.h.hitTest(_local1.x, _local1.y, true) || (mc_player.h.hitTest(_local1.x - (10 * _local2.vx), _local1.y - (10 * _local2.vy), true)))) {
_local2.destroy();
if (mc_player.applyShot()) {
killPlayer();
}
updateShieldScreen();
}
}
}
function processBonuses(mc_b, mc_p, fTime, curTime) {
var _local4;
var _local1;
var _local3;
var _local2;
for (_local4 in mc_b) {
_local1 = mc_b[_local4];
_local1.move(fTime, curTime);
_local3 = mc_player._x - _local1._x;
_local2 = mc_player._y - _local1._y;
if (((_local3 * _local3) + (_local2 * _local2)) < 1600) {
applyBonus(_local1, curTime);
}
}
}
function applyBonus(mc, curTime) {
if (!stopSoundFlag) {
sndBonus = true;
}
if (mc.bonusNum != 1) {
addScores(scrGetBonus);
}
switch (mc.bonusNum) {
case 1 :
addScores(scrBonus);
break;
case 2 :
mc_player.addShield();
updateShieldScreen();
break;
case 3 :
mc_player.restoreShield();
updateShieldScreen();
break;
case 4 :
incrementLife();
break;
case 5 :
activateBackBonus(curTime);
break;
case 6 :
activateCrossBonus(curTime);
break;
case 7 :
activateDoubleBonus(curTime);
break;
case 8 :
activateSphereBonus(mc, curTime);
break;
default :
trace("BUG! BUG! BUG!");
}
mc.destroy();
}
function doBoom(x, y) {
var _local1 = mc_booms.attachMovie("lib_boom", String(boomCounter), boomCounter);
_local1._x = x;
_local1._y = y;
boomCounter++;
if (boomCounter >= 1000) {
boomCounter = 0;
}
}
function doSmallBoom(x, y) {
var _local1 = mc_booms.attachMovie("lib_boom", String(boomCounter), boomCounter);
_local1._x = x;
_local1._y = y;
_local1._xscale = (_local1._yscale = 30);
boomCounter++;
if (boomCounter >= 1000) {
boomCounter = 0;
}
}
function addBonus(x, y, curTime) {
var _local2;
var _local1;
if (bonusScores >= lifeScores) {
bonusScores = bonusScores - lifeScores;
if (lifeCount < maxLifeCount) {
_local1 = 4;
} else {
_local1 = getBonusNum();
}
} else {
_local1 = getBonusNum();
}
_local2 = mc_bonus.attachMovie("lib_bonus", String(bonusCounter), bonusCounter);
bonusCounter++;
if (bonusCounter >= 1000) {
bonusCounter = 0;
}
_local2.init(x, y, _local1, curTime);
lastBonusNum = _local1;
}
function getBonusNum() {
var _local1;
if (mc_player.shield == 1) {
_local1 = Math.random();
if ((_local1 <= 0.25) && (lastBonusNum != 3)) {
return(3);
}
if ((_local1 <= 0.45) && (lastBonusNum != 2)) {
return(2);
}
_local1 = Math.ceil((8 * Math.random()) + 0.0001);
var _local2;
_local2 = 0;
while (_local2 < 8) {
if ((((_local1 != 2) && (_local1 != 3)) && (_local1 != 4)) && (_local1 != lastBonusNum)) {
break;
}
_local1++;
if (_local1 > 8) {
_local1 = 1;
}
_local2++;
}
return(_local1);
}
_local1 = Math.ceil((8 * Math.random()) + 0.0001);
if (_local1 == 4) {
_local1 = 4 + Math.ceil((5 * Math.random()) + 0.0001);
if (_local1 == 9) {
_local1 = 1;
}
if (_local1 == lastBonusNum) {
if (_local1 == 1) {
_local1 = 4 + Math.ceil((4 * Math.random()) + 0.0001);
} else {
_local1++;
if (_local1 > 8) {
_local1 = 1;
}
}
}
return(_local1);
}
if ((_local1 == 2) || (_local1 == 3)) {
if (mc_player.isMaxShield()) {
_local1 = 4 + Math.ceil((5 * Math.random()) + 0.0001);
if (_local1 == 9) {
_local1 = 1;
}
if (_local1 == lastBonusNum) {
if (_local1 == 1) {
_local1 = 4 + Math.ceil((4 * Math.random()) + 0.0001);
} else {
_local1++;
if (_local1 > 8) {
_local1 = 1;
}
}
}
}
}
if (_local1 == lastBonusNum) {
if (_local1 == 1) {
_local1 = 4 + Math.ceil((4 * Math.random()) + 0.0001);
} else {
_local1++;
if (_local1 > 8) {
_local1 = 1;
}
}
}
return(_local1);
}
function addHitPlaneScpores() {
addScores(scrHit);
}
function updateShieldScreen() {
var _local1;
var _local2 = mc_player.shield;
_local1 = 1;
while (_local1 <= _local2) {
mc_armors["arm" + _local1]._visible = true;
_local1++;
}
_local1 = _local2 + 1;
while (_local1 <= 7) {
mc_armors["arm" + _local1]._visible = false;
_local1++;
}
}
function activateBackBonus(curTime) {
mc_b_back._visible = true;
mc_b_back.mc_txt.txt = 15;
backStartT = curTime;
}
function activateCrossBonus(curTime) {
mc_b_cross._visible = true;
mc_b_cross.mc_txt.txt = 15;
crossStartT = curTime;
}
function activateDoubleBonus(curTime) {
mc_b_double._visible = true;
mc_b_double.mc_txt.txt = 15;
doubleStartT = curTime;
}
function activateSphereBonus(mc_b, curTime) {
var _local1;
var _local3 = 0;
var _local2 = 1;
var _local4;
var _local5;
_local1 = 0;
while (_local1 < 16) {
_local4 = ((0.5 + _local1) * Math.PI) / 8;
_local3 = -Math.sin(_local4);
_local2 = Math.cos(_local4);
_local5 = mc_ps.attachMovie("lib_ps", String(sCounter), sCounter);
_local5.init(mc_b._x - (5 * _local3), mc_b._y + (5 * _local2), _local3, _local2, playerShotSpeed);
sCounter++;
_local1++;
}
if (sCounter >= 1000) {
sCounter = 0;
}
player.shot(curTime);
}
function addScores(scr) {
scores = scores + scr;
bonusScores = bonusScores + scr;
txtScores = scores;
}
function killPlayer() {
if (!stopSoundFlag) {
sndHeroExp = true;
}
doBoom(mc_player._x, mc_player._y);
mc_player.toDisable();
lifeCount--;
updateLifeScreen();
gameState = 3;
killTime = getTimer();
}
function incrementLife() {
lifeCount++;
if (lifeCount > maxLifeCount) {
lifeCount = maxLifeCount;
}
updateLifeScreen();
}
function updateLifeScreen() {
var _local1;
var _local2 = lifeCount;
_local1 = 1;
while (_local1 <= _local2) {
mc_lifes["star" + _local1]._visible = true;
_local1++;
}
_local1 = _local2 + 1;
while (_local1 <= maxLifeCount) {
mc_lifes["star" + _local1]._visible = false;
_local1++;
}
}
_quality = "MEDIUM";
var author = "Galimov Ruslan";
var outURL = "http://www.justfreegames.com?r1=F&r2=SF&WT.mc_id=FlashSkyFire";
var i;
var gameState;
var level;
var maxLevel = 10;
var stopSoundFlag = false;
var sndBonus;
var sndEnemyExp;
var sndGun1;
var sndGun2;
var sndHeroExp;
var lastTimer;
var dTime;
var newTimer;
var killTime;
var killPauseTime = 3000;
var eCounter = 0;
var boomCounter = 0;
var sCounter = 0;
var bonusCounter = 0;
var lastBonusNum = -1;
var bonusEnemies;
var curBonusEnemies;
var doubleStartT;
var crossStartT;
var backStartT;
var bonusTime = 15;
var scores = 0;
var bonusScores = 0;
var lifeScores = 4000;
var scrBonus = 100;
var scrGetBonus = 20;
var scrHit = 10;
var playerShotSpeed = 220;
var enemyShotSpeed = 100;
var lifeCount = 3;
var startLifeCount = 3;
var maxLifeCount = 7;
var curPlayerNum = 1;
var pSpeed_array = [210, 245, 175];
var pShield_array = [5, 3, 7];
var back2 = new CBack(108);
var back3 = new CBack(54);
var eTypeCount = 8;
var curEOnScreen;
var lastAddETime;
var addETime = 2000;
var maxEOnScreen = 6;
var enemiesOnLevel;
var sKoeff;
var vKoeff;
var fKoeff;
var increase_array = [[0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0.34, 1, 0, 0, 0], [0, 0, 0.34, 1, 0.9, 0, 0, 0], [0, 0.34, 1, 0.7, 0.8, 0, 0, 0], [0, 1, 0.6, 0.7, 0.7, 0, 0, 0.34], [0, 0.45, 0.7, 0.6, 0.55, 0.34, 0, 1], [0.34, 0.55, 0.5, 0.5, 0.55, 1, 0, 0.45], [1, 0.5, 0.4, 0.45, 0.5, 0.4, 0.34, 0.55], [0.45, 0.4, 0.4, 0.4, 0.45, 0.5, 1, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1, 0.5]];
var base_array = [4, 4, 3, 2, 1, 7, 5, 0, 6, 6];
var curBaseInd;
var curIncrease_array = [0, 0, 0, 0, 0, 0, 0, 0];
var s_array = [3, 1, 2, 3, 2, 4, 4, 3];
var v_array = [32, 48, 40, 28, 36, 28, 24, 32];
var f_array = [8, 8, 6, 7, 9, 5, 7, 7];
#endinitclip
Symbol 260 MovieClip [__Packages.CBack] Frame 0
class CBack
{
var speed, b1_mc, b2_mc;
function CBack (s) {
speed = s;
}
function init(b1, b2) {
b1_mc = b1;
b2_mc = b2;
b2_mc._y = (b1_mc._y - b1_mc._height) + 1;
}
function move(fTime) {
b1_mc._y = b1_mc._y + (speed * (fTime / 1000));
if ((b1_mc._y - b1_mc._height) >= 0) {
b1_mc._y = b1_mc._y - b1_mc._height;
}
b2_mc._y = (b1_mc._y - b1_mc._height) + 1;
}
}
Symbol 261 MovieClip [__Packages.CPlayer] Frame 0
class CPlayer extends MovieClip
{
var speed, shield, maxShield, shotLastTime, migFlag, state, _visible, mc_my, _x, _y, _height, gotoAndStop, migTime, _width;
function CPlayer () {
super();
}
function init(speed_, shield_) {
speed = speed_;
shield = (maxShield = shield_);
shotLastTime = 0;
migFlag = false;
toDisable();
}
function toGame() {
state = 1;
_visible = true;
mc_my.gotoAndStop(1);
}
function toDisable() {
state = 0;
_visible = false;
mc_my.gotoAndStop(1);
}
function toInFly() {
_visible = true;
mc_my.gotoAndStop(2);
_x = rWidth / 2;
_y = rHeight + _height;
state = 2;
}
function toOutFly() {
mc_my.gotoAndStop(1);
state = 3;
}
function setNum(num) {
gotoAndStop(num);
}
function shot(curTime) {
shotLastTime = curTime;
}
function canShot(curTime) {
return((state == 1) && ((curTime - shotLastTime) >= shotDTime));
}
function applyShot() {
shield--;
migFlag = true;
migTime = 0;
mc_my.gotoAndStop(2);
return(shield <= 0);
}
function isMaxShield() {
return(shield == maxShield);
}
function restoreShield() {
shield = maxShield;
}
function addShield() {
shield++;
if (shield > maxShield) {
shield = maxShield;
}
}
function move(fTime, newX, newY) {
if (state == 1) {
var _local3 = newX - _x;
var _local2 = newY - _y;
var _local5 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_local3 = _local3 / _local5;
_local2 = _local2 / _local5;
var _local4 = (speed * fTime) / 1000;
if (_local5 < _local4) {
_x = newX;
_y = newY;
} else {
_x = _x + (_local3 * _local4);
_y = _y + (_local2 * _local4);
}
if (_x < (_width / 2)) {
_x = _width / 2;
}
if (_x > (rWidth - (_width / 2))) {
_x = rWidth - (_width / 2);
}
if (_y < (_height / 2)) {
_y = _height / 2;
}
if (_y > (rHeight - (_height / 2))) {
_y = rHeight - (_height / 2);
}
if (migFlag) {
migTime = migTime + fTime;
if (migTime >= migMaxTime) {
migFlag = false;
mc_my.gotoAndStop(1);
}
}
} else if (state == 2) {
_y = _y - (((speed / 2) * fTime) / 1000);
if (_y <= (rHeight / 2)) {
_y = rHeight / 2;
toGame();
}
} else if (state == 3) {
_y = _y - ((speed * fTime) / 1000);
if (_y < ((-_height) / 2)) {
toDisable();
}
}
}
static var rWidth = 575;
static var rHeight = 435;
var shotDTime = 350;
static var migMaxTime = 1500;
}
Symbol 262 MovieClip [__Packages.CEnemyPlane] Frame 0
class CEnemyPlane extends MovieClip
{
var removeMovieClip, fSpeed, myRad, _width, _height, startFlag, trajectNum, sX, _x, sY, _y, s_param, constShotTime, shotTime, withoutShotTime, vx, vy, _rotation, fA, fB, fC, iDir, yBase;
function CEnemyPlane () {
super();
}
function destroy() {
removeMovieClip();
}
function init() {
fSpeed = 100;
myRad = Math.max(_width / 2, _height / 2);
startFlag = true;
trajectNum = random(5);
switch (trajectNum) {
case 0 :
initLine();
break;
case 1 :
initParabolaX();
break;
case 2 :
initParabolaY();
break;
case 3 :
initSinX();
break;
case 4 :
initSinY();
}
move(0);
sX = _x;
sY = _y;
}
function setParams(s, v, f) {
s_param = Math.round(s);
fSpeed = v;
constShotTime = (f / 2) * 1000;
shotTime = constShotTime * (1 + (0.3 * Math.random()));
withoutShotTime = 0;
}
function applyShot() {
s_param--;
return(s_param <= 0);
}
function move(fTime) {
if (trajectNum == 0) {
moveByLine(fTime);
} else if (trajectNum == 1) {
moveByParabolaX(fTime);
} else if (trajectNum == 2) {
moveByParabolaY(fTime);
} else if (trajectNum == 3) {
moveBySinX(fTime);
} else if (trajectNum == 4) {
moveBySinY(fTime);
}
checkRestart();
addShotTime(fTime);
}
function addShotTime(fTime) {
withoutShotTime = withoutShotTime + fTime;
}
function canShot() {
return(withoutShotTime >= shotTime);
}
function shot() {
withoutShotTime = withoutShotTime - shotTime;
shotTime = constShotTime * (1 + (0.3 * Math.random()));
}
function restartTraject() {
_x = sX;
_y = sY;
startFlag = true;
}
function checkRestart() {
if ((((_x < (-myRad)) || (_x > (rWidth + myRad))) || (_y < (-myRad))) || (_y > (rHeight + myRad))) {
if (!startFlag) {
restartTraject();
}
} else {
startFlag = false;
}
}
function initLine() {
var _local4 = random(4);
var _local3;
var _local2;
switch (_local4) {
case 0 :
_x = (_width / 2) + ((rWidth - (_width / 2)) * Math.random());
_y = -myRad;
_local3 = (_width / 2) + ((rWidth - (_width / 2)) * Math.random());
_local2 = rHeight + (_height / 2);
break;
case 1 :
_x = (_width / 2) + ((rWidth - (_width / 2)) * Math.random());
_y = rHeight + myRad;
_local3 = (_width / 2) + ((rWidth - (_width / 2)) * Math.random());
_local2 = (-_height) / 2;
break;
case 2 :
_x = -myRad;
_y = (_width / 2) + ((rHeight - (_width / 2)) * Math.random());
_local3 = rWidth + (_width / 2);
if (_y > ((rHeight / 3) * 2)) {
_local2 = (_width / 2) + (((rHeight - (_width / 2)) - ((rHeight / 3) * 2)) * Math.random());
} else {
_local2 = (_width / 2) + ((rHeight - (_width / 2)) * Math.random());
}
break;
case 3 :
_x = rWidth + myRad;
_y = (_width / 2) + ((rHeight - (_width / 2)) * Math.random());
_local3 = (-_width) / 2;
if (_y > ((rHeight / 3) * 2)) {
_local2 = (_width / 2) + (((rHeight - (_width / 2)) - ((rHeight / 3) * 2)) * Math.random());
} else {
_local2 = (_width / 2) + ((rHeight - (_width / 2)) * Math.random());
}
}
vx = _local3 - _x;
vy = _local2 - _y;
_local4 = Math.sqrt((vx * vx) + (vy * vy));
vx = vx / _local4;
vy = vy / _local4;
_rotation = (Math.atan2(vy, vx) * 180) / Math.PI;
}
function moveByLine(fTime) {
var _local2 = fSpeed * (fTime / 1000);
_x = _x + (vx * _local2);
_y = _y + (vy * _local2);
}
function nX(x) {
return((x - rWidth2) / rWidth2);
}
function nY(y) {
return((y - rHeight2) / rHeight2);
}
function rX(nX) {
return((nX * rWidth2) + rWidth2);
}
function rY(nY) {
return((nY * rHeight2) + rHeight2);
}
function initParabolaX() {
fA = (1 + (1.3 * Math.random())) - 0.9;
fB = 0.2 - (0.4 * Math.random());
fC = -(Math.random() - 0.3);
var _local2 = random(2);
if (_local2 == 0) {
fA = -fA;
fC = -fC;
}
iDir = random(2);
if (iDir == 1) {
_x = -myRad;
} else {
iDir = -1;
_x = rWidth + myRad;
}
}
function moveByParabolaX(fTime) {
_x = _x + ((fSpeed * (fTime / 1000)) * iDir);
_y = rY(formParabX(nX(_x)));
_rotation = ugolParabX(nX(_x));
}
function formParabX(x) {
return(((fA * (x - fB)) * (x - fB)) + fC);
}
function ugolParabX(x) {
if (iDir == 1) {
return((Math.atan((2 * fA) * (x - fB)) * 180) / Math.PI);
}
return(((Math.atan((2 * fA) * (x - fB)) * 180) / Math.PI) - 180);
}
function initParabolaY() {
fA = 1 - (0.6 * Math.random());
fB = 0.2 - (0.4 * Math.random());
fC = -((0.7 * Math.random()) - 0.45);
var _local2 = random(2);
if (_local2 == 0) {
fA = -fA;
fC = -fC;
}
iDir = random(2);
if (iDir == 1) {
_y = -myRad;
} else {
iDir = -1;
_y = rHeight + myRad;
}
}
function moveByParabolaY(fTime) {
_y = _y + ((fSpeed * (fTime / 1000)) * iDir);
_x = rX(formParabX(nY(_y)));
_rotation = 90 - ugolParabX(nY(_y));
}
function initSinX() {
fA = (rHeight2 / 2) - random(rHeight2 / 3.6);
fB = 0.4 + (1.1 * Math.random());
fC = random(180);
yBase = (15 + fA) + random(((rHeight - (fA * 2)) - (rHeight * 0.2)) - 15);
iDir = random(2);
if (iDir == 1) {
_x = -myRad;
} else {
iDir = -1;
_x = rWidth + myRad;
}
}
function moveBySinX(fTime) {
_x = _x + ((fSpeed * (fTime / 1000)) * iDir);
_y = formSinX(_x);
_rotation = ugolSinX(_x);
}
function formSinX(x) {
return((fA * Math.sin((((fB * x) + fC) / 180) * Math.PI)) + yBase);
}
function ugolSinX(x) {
if (iDir == 1) {
return((Math.atan((((fA * fB) / 180) * Math.PI) * Math.cos((((fB * x) + fC) / 180) * Math.PI)) * 180) / Math.PI);
}
return(((Math.atan((((fA * fB) / 180) * Math.PI) * Math.cos((((fB * x) + fC) / 180) * Math.PI)) * 180) / Math.PI) - 180);
}
function initSinY() {
fA = (rHeight2 / 2) - random(rHeight2 / 3.6);
fB = 0.4 + (0.9 * Math.random());
fC = random(180);
yBase = (15 + fA) + random(rWidth - ((15 + fA) * 2));
iDir = random(2);
if (iDir == 1) {
_y = -myRad;
} else {
iDir = -1;
_y = rHeight + myRad;
}
}
function moveBySinY(fTime) {
_y = _y + ((fSpeed * (fTime / 1000)) * iDir);
_x = formSinX(_y);
_rotation = 90 - ugolSinX(_y);
}
static var rWidth = 575;
static var rHeight = 435;
static var rWidth2 = 287.5;
static var rHeight2 = 217.5;
}
Symbol 263 MovieClip [__Packages.COscillPlane] Frame 0
class COscillPlane extends CEnemyPlane
{
var fSpeed, trajectNum, myRad, _width, _height, fA, fB, fC, maxDx, _x, xBase, _y, yBase, _rotation, iDir, formSinX, addShotTime;
function COscillPlane () {
super();
}
function init() {
fSpeed = 100;
trajectNum = 0;
myRad = Math.max(_width / 2, _height / 2);
fA = 30;
fB = 2.5;
fC = 0;
maxDx = _width * (1.5 + Math.random());
_x = (xBase = myRad + ((CEnemyPlane.rWidth - (myRad * 2)) * Math.random()));
_y = (-_height) / 2;
yBase = myRad + (((CEnemyPlane.rHeight2 / 2) * 1.5) * Math.random());
_rotation = 90;
}
function move(fTime) {
if (trajectNum == 0) {
_y = _y + (fSpeed * (fTime / 1000));
if (_y >= yBase) {
_y = yBase;
trajectNum = 3;
iDir = Math.random() - 0.5;
if (iDir > 0) {
iDir = 1;
} else {
iDir = -1;
}
}
} else if (trajectNum == 3) {
if (iDir > 0) {
_x = _x + (fSpeed * (fTime / 1000));
if ((_x - xBase) >= maxDx) {
_x = xBase + maxDx;
iDir = -1;
} else if (_x >= (CEnemyPlane.rWidth - (_width / 2))) {
_x = CEnemyPlane.rWidth - (_width / 2);
iDir = -1;
}
} else {
_x = _x - (fSpeed * (fTime / 1000));
if ((xBase - _x) >= maxDx) {
_x = xBase - maxDx;
iDir = 1;
} else if (_x <= (_width / 2)) {
_x = _width / 2;
iDir = 1;
}
}
_y = formSinX(_x - xBase);
}
addShotTime(fTime);
}
}
Symbol 264 MovieClip [__Packages.CRandomPlane] Frame 0
class CRandomPlane extends CEnemyPlane
{
var fSpeed, myRad, _width, _height, startFlag, initLine, ostTime, _x, _y, moveByLine, vx, vy, addShotTime, _rotation;
function CRandomPlane () {
super();
}
function init() {
fSpeed = 100;
myRad = Math.max(_width / 2, _height / 2);
resetOstTime();
startFlag = true;
initLine();
}
function resetOstTime() {
ostTime = 2 + (2 * Math.random());
}
function move(fTime) {
ostTime = ostTime - (fTime / 1000);
if (ostTime <= 0) {
if ((!startFlag) || ((((_x >= myRad) && (_y >= myRad)) && (_x <= (CEnemyPlane.rWidth - myRad))) && (_y <= (CEnemyPlane.rHeight - myRad)))) {
resetOstTime();
randUgol();
}
}
var _local2 = fSpeed * (fTime / 1000);
moveByLine(fTime);
if (!startFlag) {
if (_x <= myRad) {
_x = _x - (vx * _local2);
_y = _y - (vy * _local2);
vx = -vx;
randUgol();
} else if (_x >= (CEnemyPlane.rWidth - myRad)) {
_x = _x - (vx * _local2);
_y = _y - (vy * _local2);
vx = -vx;
randUgol();
} else if (_y <= myRad) {
_x = _x - (vx * _local2);
_y = _y - (vy * _local2);
vy = -vy;
randUgol();
} else if (_y >= (CEnemyPlane.rHeight - myRad)) {
_x = _x - (vx * _local2);
_y = _y - (vy * _local2);
vy = -vy;
randUgol();
}
}
addShotTime(fTime);
}
function randUgol() {
var _local2 = ((-40 + (80 * Math.random())) / 180) * Math.PI;
var _local4 = vx;
var _local3 = vy;
vx = (_local4 * Math.cos(_local2)) - (_local3 * Math.sin(_local2));
vy = (_local4 * Math.sin(_local2)) + (_local3 * Math.cos(_local2));
_rotation = (Math.atan2(vy, vx) * 180) / Math.PI;
startFlag = false;
}
}
Symbol 265 MovieClip [__Packages.CShot] Frame 0
class CShot extends MovieClip
{
var _x, _y, vx, vy, speed, _rotation, removeMovieClip;
function CShot () {
super();
}
function init(x, y, dx, dy, speed_) {
_x = x;
_y = y;
vx = dx;
vy = dy;
speed = speed_;
_rotation = ((Math.atan2(vy, vx) * 180) / Math.PI) + 90;
}
function move(fTime) {
_x = _x + (((speed * vx) * fTime) / 1000);
_y = _y + (((speed * vy) * fTime) / 1000);
if ((((_x < 10) || (_x > 585)) || (_y < 10)) || (_y > 445)) {
destroy();
return(false);
}
return(true);
}
function destroy() {
removeMovieClip();
}
}
Symbol 266 MovieClip [__Packages.CBonus] Frame 0
class CBonus extends MovieClip
{
var _x, _y, bonusNum, startTime, gotoAndStop, state, _width, _xscale, _yscale, _height, removeMovieClip;
function CBonus () {
super();
}
function init(x, y, bonusNum_, curTime) {
_x = x;
_y = y;
bonusNum = bonusNum_;
startTime = curTime;
gotoAndStop(bonusNum);
scaleDir = 1;
state = 1;
}
function move(fTime, curTime) {
var _local2;
if (state == 1) {
_local2 = startSpeed + ((acc * (curTime - startTime)) / 1000);
if (_local2 >= maxSpeed) {
_local2 = maxSpeed;
state = 2;
}
} else if (state == 2) {
_local2 = (maxSpeed * fTime) / 1000;
}
_y = _y + _local2;
if (_x < (_width / 2)) {
_x = _x + ((maxSpeed * fTime) / 1000);
} else if (_x > (rWidth - (_width / 2))) {
_x = _x - ((maxSpeed * fTime) / 1000);
}
if (scaleDir == 1) {
_xscale = (_yscale = _yscale + 3);
if (_xscale >= 105) {
_xscale = (_yscale = 105);
scaleDir = -1;
}
} else {
_xscale = (_yscale = _yscale - 3);
if (_xscale <= 95) {
_xscale = (_yscale = 95);
scaleDir = 1;
}
}
if (_y > (rHeight + (_height / 2))) {
destroy();
}
}
function destroy() {
removeMovieClip();
}
static var rWidth = 575;
static var rHeight = 435;
static var maxSpeed = 30;
static var startSpeed = -5;
static var acc = 3;
static var myRad = 14;
var scaleDir = 0;
}
Symbol 22 MovieClip [lib_e1] Frame 1
#initclip 19
Object.registerClass("lib_e1", CEnemyPlane);
#endinitclip
Instance of Symbol 21 MovieClip "he2" in Symbol 22 MovieClip [lib_e1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 21 MovieClip "he1" in Symbol 22 MovieClip [lib_e1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 21 MovieClip "he3" in Symbol 22 MovieClip [lib_e1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 27 MovieClip [lib_e2] Frame 1
#initclip 9
Object.registerClass("lib_e2", CEnemyPlane);
#endinitclip
Instance of Symbol 21 MovieClip "he2" in Symbol 27 MovieClip [lib_e2] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 21 MovieClip "he1" in Symbol 27 MovieClip [lib_e2] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 21 MovieClip "he3" in Symbol 27 MovieClip [lib_e2] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 32 MovieClip [lib_e3] Frame 1
#initclip 10
Object.registerClass("lib_e3", CEnemyPlane);
#endinitclip
Instance of Symbol 21 MovieClip "he1" in Symbol 32 MovieClip [lib_e3] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 37 MovieClip [lib_e4] Frame 1
#initclip 11
Object.registerClass("lib_e4", CEnemyPlane);
#endinitclip
Instance of Symbol 21 MovieClip "he1" in Symbol 37 MovieClip [lib_e4] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 43 MovieClip [lib_e5] Frame 1
#initclip 12
Object.registerClass("lib_e5", CEnemyPlane);
#endinitclip
Instance of Symbol 21 MovieClip "he1" in Symbol 43 MovieClip [lib_e5] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 48 MovieClip [lib_e6] Frame 1
#initclip 13
Object.registerClass("lib_e6", COscillPlane);
#endinitclip
Instance of Symbol 21 MovieClip "he2" in Symbol 48 MovieClip [lib_e6] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 21 MovieClip "he1" in Symbol 48 MovieClip [lib_e6] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 21 MovieClip "he3" in Symbol 48 MovieClip [lib_e6] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 53 MovieClip [lib_e7] Frame 1
#initclip 14
Object.registerClass("lib_e7", CEnemyPlane);
#endinitclip
Instance of Symbol 21 MovieClip "he1" in Symbol 53 MovieClip [lib_e7] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 58 MovieClip [lib_e8] Frame 1
#initclip 15
Object.registerClass("lib_e8", CRandomPlane);
#endinitclip
Instance of Symbol 21 MovieClip "he1" in Symbol 58 MovieClip [lib_e8] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 21 MovieClip "he3" in Symbol 58 MovieClip [lib_e8] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 21 MovieClip "he2" in Symbol 58 MovieClip [lib_e8] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 61 MovieClip [lib_es] Frame 1
#initclip 16
Object.registerClass("lib_es", CShot);
#endinitclip
Symbol 64 MovieClip [lib_ps] Frame 1
#initclip 17
Object.registerClass("lib_ps", CShot);
#endinitclip
Symbol 106 MovieClip [lib_boom] Frame 23
this.removeMovieClip();
Symbol 123 MovieClip [lib_bonus] Frame 1
#initclip 18
Object.registerClass("lib_bonus", CBonus);
#endinitclip
Symbol 134 MovieClip [lib_back3] Frame 1
#initclip 21
Object.registerClass("lib_back3", CBack);
#endinitclip
Symbol 137 MovieClip [lib_back2] Frame 1
#initclip 20
Object.registerClass("lib_back2", CBack);
#endinitclip
Symbol 143 Button
on (release) {
new_game_pressed();
}
Symbol 146 Button
on (release) {
how_to_play_pressed();
}
Symbol 149 Button
on (release) {
more_pressed();
}
Symbol 156 MovieClip Frame 1
stop();
Symbol 158 Button
on (press) {
this._parent.soundOff();
this.gotoAndStop(2);
}
Symbol 160 Button
on (press) {
this._parent.soundOn();
this.gotoAndStop(1);
}
Symbol 161 MovieClip Frame 1
this.stop();
Symbol 164 Button
on (release) {
back_pressed();
}
Symbol 179 Button
on (press) {
select3_pressed();
}
Symbol 185 Button
on (press) {
select1_pressed();
}
Symbol 191 Button
on (press) {
select2_pressed();
}
Symbol 197 MovieClip Frame 1
this.stop();
Symbol 203 MovieClip Frame 1
this.stop();
Symbol 209 MovieClip Frame 1
this.stop();
Symbol 210 MovieClip [mc_player] Frame 1
#initclip 22
Object.registerClass("mc_player", CPlayer);
#endinitclip
this.stop();
Instance of Symbol 21 MovieClip "he" in Symbol 210 MovieClip [mc_player] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 236 MovieClip Frame 1
this.stop();
Symbol 249 Button
on (press) {
this._parent.more_pressed();
}
Symbol 259 MovieClip Frame 1
this.stop();