Frame 1
function chooseGameEndProcedure() {
if (tKey == undefined) {
tKey = "sjri5jf85jdor560";
}
gameEndSubmitUrl = "http://freeplay.gamedek.com/gameend.aspx";
if (params == undefined) {
myVariables.load("config.txt");
} else {
decryptParams(params);
crypto = 2;
}
}
function t_fLoadGameEnd() {
mcResign.removeMovieClip();
mcGameOver.removeMovieClip();
if (mcGameEnd != undefined) {
mcGameEnd.removeMovieClip();
}
endContainer.createEmptyMovieClip("mcGameEnd", 100);
endContainer.createEmptyMovieClip("mcGameEndBack", 99);
with (endContainer.mcGameEndBack) {
var backColor = 0;
beginFill(backColor, 100);
lineStyle(1, backColor, 100);
moveTo(0, 0);
lineTo(g_numGameWidth, 0);
lineTo(g_numGameWidth, g_numGameHeight);
lineTo(0, g_numGameHeight);
lineTo(0, 0);
endFill();
}
if (freeplayid != undefined) {
downloadURL = downloadURL + affiliateId;
}
var endUrlArray = new Array();
endUrlArray = endURL.split(".");
var subString = endUrlArray[endUrlArray.length - 1];
if ((subString == "aspx") || (subString == "html")) {
getURL (endURL, "_self");
} else {
endContainer.mcGameEnd.loadMovie(endURL, mcGameEnd);
endContainer.playAgain = playAgain;
}
}
function postGameLog() {
if (gameLogEnabled == 1) {
var _local1 = new LoadVars();
var _local2 = TEAEncrypt((("freeplayid=" + freeplayid) + "&gameLog=") + gameLog, tKey);
_local1.params = _local2;
_local1.sendAndLoad(gameEndSubmitUrl, result_lv, "POST");
gameLog = "";
}
}
function addToLog(myAddition) {
if (gameLogEnabled == 1) {
gameLog = gameLog + myAddition;
}
}
function trc(theString) {
trace((theString + ": ") + eval (theString));
}
function TEAEncrypt(src, key) {
var _local2 = charsToLongs(strToChars(src));
var k = charsToLongs(strToChars(key));
var n = _local2.length;
if (n == 0) {
return("");
}
if (n == 1) {
_local2[n++] = 0;
}
var _local3 = _local2[n - 1];
var y = _local2[0];
var delta = 2654435769;
var max32 = 4294967295;
var mx;
var e;
var q = Math.floor(6 + (52 / n));
var sum = 0;
var sum2 = 0;
while ((q--) > 0) {
sum = sum + delta;
sum = sum >>> 0;
e = (sum >>> 2) & 3;
var _local1 = 0;
while (_local1 < (n - 1)) {
y = _local2[_local1 + 1];
mx = (((_local3 >>> 5) ^ (y << 2)) + ((y >>> 3) ^ (_local3 << 4))) ^ ((sum ^ y) + (k[(_local1 & 3) ^ e] ^ _local3));
mx = mx >>> 0;
_local2[_local1] = _local2[_local1] + mx;
_local2[_local1] = _local2[_local1] >>> 0;
_local3 = _local2[_local1];
_local1++;
}
y = _local2[0];
mx = (((_local3 >>> 5) ^ (y << 2)) + ((y >>> 3) ^ (_local3 << 4))) ^ ((sum ^ y) + (k[(_local1 & 3) ^ e] ^ _local3));
mx = mx >>> 0;
_local2[n - 1] = _local2[n - 1] + mx;
_local2[n - 1] = _local2[n - 1] >>> 0;
_local3 = _local2[n - 1];
}
return(charsToHex(longsToChars(_local2)));
}
function TEADecrypt(src, key) {
var v = charsToLongs(hexToChars(src));
var k = charsToLongs(strToChars(key));
var n = v.length;
if (n == 0) {
return("");
}
var _local2 = v[n - 1];
var _local3 = v[0];
var delta = 2654435769;
var mx;
var e;
var q = Math.floor(6 + (52 / n));
var sum = (q * delta);
while (sum != 0) {
e = (sum >>> 2) & 3;
var _local1 = n - 1;
while (_local1 > 0) {
_local2 = v[_local1 - 1];
mx = (((_local2 >>> 5) ^ (_local3 << 2)) + ((_local3 >>> 3) ^ (_local2 << 4))) ^ ((sum ^ _local3) + (k[(_local1 & 3) ^ e] ^ _local2));
_local3 = (v[_local1] = v[_local1] - mx);
_local1--;
}
_local2 = v[n - 1];
mx = (((_local2 >>> 5) ^ (_local3 << 2)) + ((_local3 >>> 3) ^ (_local2 << 4))) ^ ((sum ^ _local3) + (k[(_local1 & 3) ^ e] ^ _local2));
_local3 = (v[0] = v[0] - mx);
sum = sum - delta;
}
return(charsToStr(longsToChars(v)));
}
function charsToLongs(chars) {
var _local2 = chars;
var _local3 = new Array(Math.ceil(_local2.length / 4));
var _local1 = 0;
while (_local1 < _local3.length) {
_local3[_local1] = ((_local2[_local1 * 4] + (_local2[(_local1 * 4) + 1] << 8)) + (_local2[(_local1 * 4) + 2] << 16)) + (_local2[(_local1 * 4) + 3] << 24);
_local1++;
}
return(_local3);
}
function longsToChars(longs) {
var _local2 = longs;
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.length) {
_local3.push(_local2[_local1] & 255, (_local2[_local1] >>> 8) & 255, (_local2[_local1] >>> 16) & 255, (_local2[_local1] >>> 24) & 255);
_local1++;
}
return(_local3);
}
function charsToHex(chars) {
var _local2 = chars;
var result = new String("");
var _local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local1 = 0;
while (_local1 < _local2.length) {
result = result + (_local3[_local2[_local1] >> 4] + _local3[_local2[_local1] & 15]);
_local1++;
}
return(result);
}
function hexToChars(hex) {
var _local2 = hex;
var _local3 = new Array();
var _local1 = ((_local2.substr(0, 2) == "0x") ? 2 : 0);
while (_local1 < _local2.length) {
_local3.push(parseInt(_local2.substr(_local1, 2), 16));
_local1 = _local1 + 2;
}
return(_local3);
}
function charsToStr(chars) {
var _local2 = chars;
var _local3 = new String("");
var _local1 = 0;
while (_local1 < _local2.length) {
_local3 = _local3 + String.fromCharCode(_local2[_local1]);
_local1++;
}
return(_local3);
}
function strToChars(str) {
var _local2 = str;
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.length) {
_local3.push(_local2.charCodeAt(_local1));
_local1++;
}
return(_local3);
}
function decryptParams(myParams) {
decPar = TEADecrypt(myParams, tKey);
arrayOfVars = new Array();
arrayOfVars = decPar.split("&");
count = 0;
while (count < arrayOfVars.length) {
varHolder = new Array();
varHolder = arrayOfVars[count].split("=");
Set(varHolder[0], varHolder[1]);
count++;
}
}
function Vector2d(ax, ay) {
this.x = ax;
this.y = ay;
}
function Add(v1, v2) {
return(new Vector2d(v1.x + v2.x, v1.y + v2.y));
}
function Sub(v1, v2) {
return(new Vector2d(v1.x - v2.x, v1.y - v2.y));
}
function Nrm(v) {
var _local1 = v;
return(Math.sqrt((_local1.x * _local1.x) + (_local1.y * _local1.y)));
}
function Normz(v) {
var _local1 = v;
return(new Vector2d(_local1.x / Nrm(_local1), _local1.y / Nrm(_local1)));
}
function Mul(num, v) {
return(new Vector2d(num * v.x, num * v.y));
}
function Scal(v1, v2) {
return((v1.x * v2.x) + (v1.y * v2.y));
}
function RtoD(x) {
return((x * 180) / 3.141593);
}
function DtoR(x) {
return((x * 3.141593) / 180);
}
function drawTime() {
if (!pauseF) {
if (blnPlayTimer) {
currentDate = new Date();
var _local3 = (currentDate.getTime() - firstDate) + fDate;
delete fDate;
if (_local3 <= _level0.scoreTime) {
var _local2 = String(Math.floor((_level0.scoreTime - _local3) / 1000) % 60);
var _local1 = String(Math.floor((_level0.scoreTime - _local3) / 60000) % 60);
gl_minutes = Number(_local1);
gl_secundes = Number(_local2);
if (Number(_local1) < 10) {
_local1 = "0" + _local1;
}
if (Number(_local2) < 10) {
_local2 = "0" + _local2;
}
_root.Inter.txtUserTimer = (_local1 + ":") + _local2;
} else {
_level0.ProcessLogout();
}
delete currentDate;
}
}
}
function restart(n) {
interv = 275 - (10 * n);
monsterShootRand = monsterShootRand + 0.02;
bullASpeedMonster = bullASpeedMonster + 0.5;
num_level++;
bln_fire = false;
tottal = ((height_a + height_b) + height_c) * width;
if (shipSpeed != 15) {
shipSpeed++;
} else {
shipSpeed = 15;
}
var jpgCout = (random(8) + 2);
mcBackGround.gotoAndStop(jpgCout);
delete jpgCout;
if (blnPlayTimer) {
points = points + (gl_minutes * 4);
if (gl_secundes > 30) {
points = points + 2;
}
_level0.scoreTime = _level0.scoreTime - 20000;
}
_level0.blnPlayTimer = true;
beginDate = new Date();
_level0.firstDate = beginDate.getTime();
delete beginDate;
leftSide = 0;
rightSide = width - 1;
level = n;
dt = dt_n;
gameOver_w._x = -200;
gameOver_w._y = -200;
ship._visible = true;
protectionFail = false;
ship.sphera.play();
ship.gotoAndStop(1);
matrix = new Array(width);
monsterCounter = new Array(width);
startPosition = new Vector2d(((660 - (width * dl_x)) - (nSteps * stepX)) / 2, 110);
var i = 0;
while (i < width) {
var j = 0;
while (j < height_a) {
removeMovieClip(eval (("dm1.m" + (i * 100)) + j));
dm1.attachMovie("monster0", ("m" + (i * 100)) + j, depth++);
var v = getCrd(new Vector2d(i, j));
eval (("dm1.m" + (i * 100)) + j)._x = v.x;
eval (("dm1.m" + (i * 100)) + j)._y = v.y - 10;
alien.push(eval (("dm1.m" + (i * 100)) + j));
matrix[i][j] = "full";
eval (("dm1.m" + (i * 100)) + j)._visible = true;
eval (("dm1.m" + (i * 100)) + j).gotoAndStop(15);
eval (("dm1.m" + (i * 100)) + j).b.gotoAndStop(1);
j++;
}
var j = height_a;
while (j < (height_a + height_b)) {
removeMovieClip(eval (("dm1.m" + (i * 100)) + j));
dm1.attachMovie("monster1", ("m" + (i * 100)) + j, depth++);
var v = getCrd(new Vector2d(i, j));
eval (("dm1.m" + (i * 100)) + j)._x = v.x;
eval (("dm1.m" + (i * 100)) + j)._y = v.y - 10;
alien.push(eval (("dm1.m" + (i * 100)) + j));
matrix[i][j] = "full";
eval (("dm1.m" + (i * 100)) + j)._visible = true;
eval (("dm1.m" + (i * 100)) + j).gotoAndStop(15);
eval (("dm1.m" + (i * 100)) + j).b.gotoAndStop(1);
j++;
}
var j = (height_a + height_b);
while (j < ((height_a + height_b) + height_c)) {
removeMovieClip(eval (("dm1.m" + (i * 100)) + j));
dm1.attachMovie("monster2", ("m" + (i * 100)) + j, depth++);
var v = getCrd(new Vector2d(i, j));
eval (("dm1.m" + (i * 100)) + j)._x = v.x;
eval (("dm1.m" + (i * 100)) + j)._y = v.y - 10;
alien.push(eval (("dm1.m" + (i * 100)) + j));
matrix[i][j] = "full";
eval (("dm1.m" + (i * 100)) + j)._visible = true;
eval (("dm1.m" + (i * 100)) + j).gotoAndStop(15);
eval (("dm1.m" + (i * 100)) + j).b.gotoAndStop(1);
j++;
}
i++;
}
crd.x = startPosition.x;
crd.y = startPosition.y;
sinhronize_1();
var i = 0;
while (i < bulletsM.length) {
removeMovieClip(bulletsM[i].name);
bulletsM.splice(i, 1);
i--;
i++;
}
var i = 0;
while (i < bulletsA.length) {
removeMovieClip(bulletsA[i].name);
bulletsA.splice(i, 1);
i--;
i++;
}
shoot = false;
_clearInterval(tD1);
tD1 = _setInterval(sideways, (interv - (n * 3)) * dt);
right = true;
stepCounter = 0;
setLives();
monstersKilled = 0;
var i = 0;
while (i < monsterCounter.length) {
monsterCounter[i] = (height_a + height_b) + height_c;
i++;
}
var i = 0;
while (i < monsterCounter_1.length) {
monsterCounter_1[i] = width;
i++;
}
STOP = false;
fighter_die = false;
ship.gotoAndStop(1);
showUFO();
}
function getCrd(v) {
return(new Vector2d((v.x + 0.5) * dl_x, (v.y + 0.5) * dl_y));
}
function getSqare(v) {
return(new Vector2d(Math.floor(v.x / dl_x), Math.floor(v.y / dl_y)));
}
function synhronize_1() {
dm1._x = crd.x;
dm1._y = crd.y;
}
function synhronize_2() {
ship._x = shipCrd.x;
ship._y = shipCrd.y;
}
function synhronize_3() {
var i = 0;
while (i < bulletsA.length) {
eval (bulletsA[i].name)._x = bulletsA[i].crd.x;
eval (bulletsA[i].name)._y = bulletsA[i].crd.y;
i++;
}
var i = 0;
while (i < bulletsM.length) {
eval (bulletsM[i].name)._x = bulletsM[i].crd.x;
eval (bulletsM[i].name)._y = bulletsM[i].crd.y;
i++;
}
}
function synhronize_4() {
ufo._x = crdUFO.x;
ufo._y = crdUFO.y;
}
function sideways() {
if (STOP) {
return(undefined);
}
if (!down) {
if (right) {
crd.x = crd.x + stepX;
var v = new Vector2d(rightSide, 0);
v = getCrd(v);
dm1.localToGlobal(v);
if (v.x > ((660 - buffer) - (dl_x / 2))) {
right = !right;
down = true;
}
} else {
crd.x = crd.x - stepX;
var v = new Vector2d(leftSide, 0);
v = getCrd(v);
dm1.localToGlobal(v);
if (v.x < (buffer + (dl_x / 2))) {
right = !right;
down = true;
}
var i = monsterCounter_1.length;
while (i >= 0) {
if (monsterCounter_1[i] > 0) {
var v = getCrd(new Vector2d(0, i));
dm1.localToGlobal(v);
if (v.y > (shipCrd.y - 20)) {
GameOver();
return(undefined);
}
break;
}
i--;
}
}
} else {
crd.y = crd.y + stepY;
_clearInterval(tD1);
if (dt > ((0.05 + timeStep) + (level * 0.02))) {
dt = dt - (timeStep + (level * 0.02));
interv = interv - (5 * numLevel);
} else {
dt = 0.05;
}
tD1 = _setInterval(sideways, (interv - (n * 3)) * dt);
down = false;
}
var i = 0;
while (i < width) {
var j = (((height_a + height_b) + height_c) - 1);
while (j >= 0) {
if (eval (("dm1.m" + (i * 100)) + j)._visible) {
break;
}
j--;
}
if (j >= 0) {
if ((Math.random() > (1 - monsterShootRand)) && (!fighter_die)) {
var obj = new Object();
var v = new Vector2d(dm1[("m" + (i * 100)) + j].b._x, dm1[("m" + (i * 100)) + j].b._y);
dm1[("m" + (i * 100)) + j].localToGlobal(v);
obj.name = "mBullet" + bulletDepth;
obj.crd = new Vector2d(v.x, v.y + 20);
_root.attachMovie("grMonsterShoot", "mBullet" + bulletDepth, bulletDepth);
bulletsM.push(obj);
bulletDepth++;
fire_ufo_alien_s.start();
delete obj;
delete v;
}
}
i++;
}
if (num_level >= 3) {
var i = 0;
while (i < width) {
var j = (((height_a + height_b) + height_c) - 1);
while (j >= 0) {
if ((((Math.random() > fly_ver) && (!fighter_die)) && (dm1[("m" + (i * 100)) + j]._currentframe == 15)) && (dm1[("m" + (i * 100)) + j].b._currentframe == 1)) {
trace("The Monster Flygint");
switch (SpeedAMonsters) {
case 1 :
dm1[("m" + (i * 100)) + j].gotoAndPlay(15);
break;
case 2 :
dm1[("m" + (i * 100)) + j].gotoAndPlay(210);
break;
case 3 :
dm1[("m" + (i * 100)) + j].gotoAndPlay(210);
break;
default :
dm1[("m" + (i * 100)) + j].gotoAndPlay(285);
}
}
j--;
}
i++;
}
}
}
function fire() {
if (bulletsA.length < num_shot) {
total_shot++;
addToLog(((("Shot: " + total_shot) + " CurrentScore: ") + points) + newline);
_level0.numOfBull++;
fire_fighter_s.start();
var _local1 = new Object();
var _local2 = new Vector2d(shipCrd.x, shipCrd.y - 13);
_local1.name = "bulletA" + numOfBull;
_local1.crd = new Vector2d(_local2.x, _local2.y + 20);
_root.attachMovie("grFighterShoot", "bulletA" + numOfBull, bulletDepth);
bulletsA.push(_local1);
bulletDepth++;
shoot = true;
blnFire = true;
bln_fire = false;
}
}
function bullets() {
if (STOP) {
return(undefined);
}
if (bulletsA.length == 0) {
blnFire = false;
}
if (blnFire == true) {
var bb = 0;
while (bb < bulletsA.length) {
var crdA = new Vector2d(bulletsA[bb].crd.x, bulletsA[bb].crd.y);
var name_1 = bulletsA[bb].name;
crdA.y = crdA.y - bullASpeedShip;
var v = new Vector2d(crdA.x, crdA.y);
dm1.globalToLocal(v);
var i = 0;
while (i < width) {
var j = 0;
while (j < ((height_a + height_b) + height_c)) {
if (matrix[i][j] != "empty") {
if ((eval (("dm1.m" + (i * 100)) + j).hitTest(crdA.x, crdA.y) && (eval (("dm1.m" + (i * 100)) + j)._visible)) && (dm1[("m" + (i * 100)) + j].b._currentframe == 1)) {
dm1[("m" + (i * 100)) + j].gotoAndStop(dm1[("m" + (i * 100)) + j]._currentframe);
dm1[("m" + (i * 100)) + j].b.gotoAndStop(2);
matrix[i][j] = "empty";
crdA.x = -100;
crdA.y = -100;
dead_alien_s.start();
shoot = false;
if (j == 4) {
addScore(10);
sc = true;
}
if ((j == 3) || (j == 2)) {
addScore(20);
sc = true;
}
if ((j == 1) || (j == 0)) {
addScore(30);
sc = true;
}
popal_shot++;
monstersKilled++;
monsterCounter[i]--;
monsterCounter_1[j]--;
var k = 0;
while (k < monsterCounter.length) {
if (monsterCounter[k] > 0) {
leftSide = k;
break;
}
k++;
}
var k = (monsterCounter.length - 1);
while (k >= 0) {
if (monsterCounter[k] > 0) {
rightSide = k;
break;
}
k--;
}
if (monstersKilled == tottal) {
interv = interv + 50;
if (num_level >= 3) {
fly_ver = fly_ver - 0.005;
}
restart(level + 1);
break;
}
break;
}
}
j++;
}
i++;
}
if (ufo.hitTest(crdA.x, crdA.y) && (ufo_flag)) {
crdA.x = -100;
crdA.y = -100;
sc = true;
ufoDown();
addScore(200);
}
if (crdA.y < 2) {
removeMovieClip(name_1);
bulletsA.splice(bb, 1);
bb--;
if (sc != true) {
addScore(-30);
}
sc = false;
itogo();
break;
}
bulletsA[bb].crd.x = crdA.x;
bulletsA[bb].crd.y = crdA.y;
bb++;
}
}
var i = 0;
while (i < bulletsM.length) {
bulletsM[i].crd.y = bulletsM[i].crd.y + bullASpeedMonster;
if (bulletsM[i].crd.y > 450) {
removeMovieClip(bulletsM[i].name);
bulletsM.splice(i, 1);
i--;
break;
}
if (ship.hitTest(bulletsM[i].crd.x, bulletsM[i].crd.y, true) && (protectionFail)) {
removeMovieClip(bulletsM[i].name);
bulletsM.splice(i, 1);
minusLife();
break;
}
i++;
}
var i = 0;
while (i < width) {
var j = (((height_a + height_b) + height_c) - 1);
while (j >= 0) {
if (dm1[("m" + (i * 100)) + j]._currentframe != 15) {
if (((ship.hitTest(dm1[("m" + (i * 100)) + j].b) && (!fighter_die)) && (dm1[("m" + (i * 100)) + j].b._currentframe == 1)) && (protectionFail)) {
minusLife();
break;
}
}
j--;
}
i++;
}
if (bulletsA.length == 0) {
itogo();
}
}
function itogo() {
if (checkR != true) {
num_proc = 100;
checkR = true;
} else {
num_proc = (popal_shot * 100) / total_shot;
}
if (num_proc > 90) {
num_shot = 5;
} else if ((num_proc > 80) && (num_proc <= 90)) {
num_shot = 4;
} else if ((num_proc > 70) && (num_proc <= 80)) {
num_shot = 3;
} else if ((num_proc > 30) && (num_proc <= 70)) {
num_shot = 2;
} else if (num_proc < 30) {
num_shot = 1;
}
i = 1;
while (i < 6) {
inter["r_" + i]._visible = false;
i++;
}
i = 1;
while (i < (num_shot + 1)) {
inter["r_" + i]._visible = true;
i++;
}
}
function showUFO() {
if (STOP) {
return(undefined);
}
ufo.gotoAndStop(1);
crdUFO = new Vector2d(startUFO.x, startUFO.y);
_clearInterval(tID3);
tID3 = _setInterval(ufoMove, 20);
ufo_flag = true;
ufo_fly_s.start();
}
function ufoMove() {
if (STOP) {
return(undefined);
}
crdUFO.x = crdUFO.x - ufoSpeed;
if (crdUFO.x < -50) {
ufo_flag = false;
_clearInterval(tId3);
tID3 = _setInterval(showUFO, 15000 + (Math.random() * 10));
}
}
function ufoDown() {
ufo_flag = false;
ufo_fly_s.stop();
ufo_dead_s.start();
_clearInterval(tId3);
tID3 = _setInterval(showUFO, 15000 + (Math.random() * 10));
ufo.gotoAndStop(2);
ufo.burningUfo.gotoAndPlay(1);
}
function ufoDie() {
ufo.gotoAndStop(1);
crdUFO = new Vector2d(startUFO.x, startUFO.y);
}
function minusLife() {
lives--;
setLives();
protectionFail = false;
ship.gotoAndStop(2);
babah_s.start();
fighter_die = true;
}
function setLives() {
var i = 1;
while (i <= lives) {
eval ("mcLife.lf" + i)._visible = true;
i++;
}
var j = i;
while (j <= 6) {
eval ("mcLife.lf" + j)._visible = false;
j++;
}
}
function gameOver() {
trace("game is over");
g_blnGameOver = true;
Mouse.show();
removeAllClips();
ship._visible = false;
stopAllSounds();
gotoAndStop ("gameOverFrame");
STOP = true;
}
function fighterRecovery() {
if (lives == 0) {
gameOver();
return(undefined);
}
fighter_die = false;
ship.gotoAndStop(1);
}
function _setInterval(a_proc, a_time) {
var _local1 = 0;
while (_local1 < myT_arr.length) {
if (myT_arr == undefined) {
break;
}
_local1++;
}
var _local2 = new Object();
_local2.proc = a_proc;
_local2.interval = a_time;
_local2.counter = a_time;
myT_arr[_local1] = _local2;
return(_local1);
}
function _clearInterval(n) {
myT_arr[n] = undefined;
}
function myTimer() {
if (!pauseF) {
var _local1 = 0;
while (_local1 < myT_arr.length) {
if (myT_arr[_local1] != undefined) {
myT_arr[_local1].counter = myT_arr[_local1].counter - timerQ;
if (myT_arr[_local1].counter <= 0) {
myT_arr[_local1].proc();
myT_arr[_local1].counter = myT_arr[_local1].interval;
}
}
_local1++;
}
}
}
function addLife() {
if (lives == 6) {
lives = 6;
} else {
lives++;
}
setLives();
}
function addScore(n) {
points = points + n;
if (points < 0) {
points = 0;
}
add_l = add_l + n;
if (add_l >= add_l_sc) {
add_l = add_l - add_l_sc;
addLife();
}
}
function remove_mc() {
i = 0;
while (i <= alien.length) {
removeMovieClip(alien[i]);
i++;
}
removeMovieClip(mBullet);
i = 0;
while (i <= alien.length) {
removeMovieClip("bulletA" + i);
i++;
}
}
function restartGame() {
if (gameOver_w._visible) {
Mouse.show();
mcQuitDialog._visible = false;
gameOver_w.removeMovieClip();
points = 0;
lives = 3;
gotoAndStop (2);
}
}
function removeAllClips() {
var i = 0;
while (i < width) {
var j = 0;
while (j < height_a) {
removeMovieClip(eval (("dm1.m" + (i * 100)) + j));
j++;
}
var j = height_a;
while (j < (height_a + height_b)) {
removeMovieClip(eval (("dm1.m" + (i * 100)) + j));
j++;
}
var j = (height_a + height_b);
while (j < ((height_a + height_b) + height_c)) {
removeMovieClip(eval (("dm1.m" + (i * 100)) + j));
j++;
}
i++;
}
var i = 0;
while (i < bulletsM.length) {
removeMovieClip(bulletsM[i].name);
i++;
}
var i = 0;
while (i < bulletsA.length) {
removeMovieClip(bulletsA[i].name);
i++;
}
ufo.removeMovieClip();
ship.removeMovieClip();
mcLife.removeMovieClip();
}
function myFire() {
if (mc_t._currentframe == 3) {
mc_t.gotoAndPlay(1);
cnt_dwn++;
bln_fire = true;
fire();
}
}
_quality = "BEST";
_root.menu.hide();
fscommand ("showmenu", "false");
System.security.allowDomain(domainToAllow);
System.security.allowDomain("http://freeplay.gamedek.com/");
var crypto = 0;
var gameLog = "";
myVariables = new LoadVars();
myVariables.onLoad = function (success) {
if (success) {
crypto = 1;
_root.decryptParams(this.params);
} else {
crypto = 0;
}
};
_root.xmlGameEnd = new XML();
_root.xmlGameEnd.onLoad = function (success) {
var _local1 = _root;
if (success) {
_local1.decryptParams(this.firstChild.firstChild.nodeValue);
_local1.endURL = _local1.gameEndUrl;
_local1.t_fLoadGameEnd();
delete this.onLoad;
}
};
var result_lv = new LoadVars();
result_lv.onLoad = function (success) {
if (success) {
trace("whatAmI" + this);
} else {
trace("Error receiving from server.");
}
};
chooseGameEndProcedure();
stop();
var scoreTime = 180000;
var soundControl = true;
var points = 0;
keyEvent = new Object();
Key.addListener(keyEvent);
keyEvent.onKeyDown = function () {
var _local1 = _root;
var _local2 = Key.getCode();
trace(_local2);
switch (_local2) {
case 82 :
if (!STOP) {
return;
}
restartGame();
return;
case 78 :
if (!STOP) {
} else {
if (mcQuitDialog._visible) {
Mouse.hide();
mcQuitDialog._visible = false;
_local1.STOP = false;
}
ship._visible = true;
return;
if (_local1._currentframe != 2) {
break;
}
Mouse.hide();
_local1.play();
mcQuitDialog._visible = false;
gameOver_w._visible = false;
}
case 13 :
if (_local1._currentframe != 2) {
break;
}
Mouse.hide();
_local1.play();
mcQuitDialog._visible = false;
gameOver_w._visible = false;
}
};
Frame 2
play();
Frame 3
stop();
_root.inter.visible = true;
_root.inter._alpha = 0;
function g_fSetGameSize(a_numWidth, a_numHeight) {
g_numGameWidth = a_numWidth;
g_numGameHeight = a_numHeight;
}
function playAgain() {
restartGame();
gotoAndStop (2);
}
g_fSetGameSize(660, 550);
endContainer.playAgain = function () {
restartGame();
gotoAndStop (2);
};
Frame 4
mcQuitDialog._visible = false;
pauseWnd._visible = false;
_root._quality = "BEST";
_root.mcLife.visible = true;
_root.mcSoundOffOn._alpha = 0;
_root.mcTips._alpha = 0;
timerQ = 10;
total_shot = 0;
popal_shot = 0;
num_level = 0;
interv = 275;
num_shot = 50;
num_shot_ok = 0;
i = 1;
while (i < 6) {
inter["r_" + i]._visible = true;
i++;
}
tmID = setInterval(myTimer, timerQ);
var myT_arr = new Array();
stop();
leaveGame_btn.onRelease = leave_game;
help_btn.onRelease = help;
var alien_move_s = new Sound();
var babah_s = new Sound(_root);
var dead_alien_s = new Sound(_root);
var fire_fighter_s = new Sound(_root);
var fire_ufo_alien_s = new Sound(_root);
var the_end_s = new Sound(_root);
var ufo_dead_s = new Sound(_root);
var ufo_fly_s = new Sound(_root);
var babah_s = new Sound(_root);
alien_move_s.attachSound("alien_move");
babah_s.attachSound("babah");
dead_alien_s.attachSound("dead_alien");
fire_fighter_s.attachSound("fire_fighter");
fire_ufo_alien_s.attachSound("fire_ufo_alien");
the_end_s.attachSound("the_end");
ufo_dead_s.attachSound("ufo_dead");
ufo_fly_s.attachSound("ufo_fly");
babah_s.attachSound("babah");
var height_a = 2;
var height_b = 2;
var height_c = 1;
width = 10;
var dl_x = 48;
var dl_y = 33;
var stepX = 6;
var stepY = 15;
var right = new Boolean();
var right = true;
var crd = new Vector2d(0, 0);
var stepCounter = 0.6;
var dt_n = 1;
var dt = dt_n;
var down = new Boolean();
down = false;
var timeStep = 0.1;
var shipCrd = new Vector2d(ship._x, ship._y);
shipSpeed = 10;
bullASpeedShip = 10;
bullASpeedMonster = 7;
SpeedAMonsters = 1;
var numOfBull = 0;
var gl_minutes = 0;
var gl_secundes = 0;
var shoot = new Boolean();
shoot = false;
var ufoSpeed = 4;
var crdA = new Vector2d(0, 0);
ship.swapDepths(100002);
dm1.swapDepths(80000);
pauseWnd.swapDepths(100001);
var bulletsM = new Array();
var bulletsA = new Array();
var lives = 3;
tID2 = _setInterval(bullets, 20);
tID3 = _setInterval(showUFO, 20000);
monsterShootRand = 0.001;
var monstersDepth = 90000;
var bulletDepth = 1;
var startUFO = new Vector2d(ufo._x, ufo._y);
var crdUFO = new Vector2d(startUFO.x, startUFO.y);
var ufo_flag = false;
var leftSide = 0;
var bottom = ((height_a + height_b) + height_c);
var monsterCounter_1 = new Array((height_a + height_b) + height_c);
var STOP = new Boolean();
STOP = false;
fly_ver_s = 0.999;
fly_ver = fly_ver_s;
var buffer = 20;
var fighter_die = new Boolean();
fighter_die = false;
mcLife.swapDepths(90005);
ufo.swapDepths(89991);
inter.swapDepths(90000);
mcSoundOffOn.swapDepths(911111);
mcTips.swapDepths(11111111);
mcBorderShark.swapDepths(90001);
alien = new Array();
var blnPlayTimer = false;
g_blnGameOver = false;
var i = 0;
while (i < matrix.length) {
matrix[i] = new Array((height_a + height_b) + height_c);
i++;
}
var monstersKilled = 0;
var depth = 0;
gameOver_w.swapDepths(95000);
l = 5;
d = 2;
restart(0);
var level;
var cnt_dwn = 0;
_root.onEnterFrame = function () {
synhronize_1();
synhronize_2();
synhronize_3();
synhronize_4();
if (STOP) {
return(undefined);
}
if (pauseF) {
return(undefined);
}
if (fighter_die) {
return(undefined);
}
};
ufo_fly_s.onSoundComplete = function () {
if (ufo_flag) {
ufo_fly_s.start();
}
};
add_l_sc = 1500;
add_l = 0;
_root.onEnterFrame = function () {
synhronize_1();
synhronize_2();
synhronize_3();
synhronize_4();
if (STOP) {
return(undefined);
}
if (pauseF) {
return(undefined);
}
if (fighter_die) {
return(undefined);
}
if (Key.isDown(37)) {
if (shipCrd.x > 37) {
shipCrd.x = shipCrd.x - (shipSpeed + 5);
}
}
if (Key.isDown(39)) {
if (shipCrd.x < 620) {
shipCrd.x = shipCrd.x + (shipSpeed + 5);
}
}
if (Key.isDown(32)) {
if (mc_t._currentframe == 3) {
mc_t.gotoAndPlay(1);
cnt_dwn++;
bln_fire = true;
fire();
}
}
};
Instance of Symbol 175 MovieClip "inter" in Frame 4
onClipEvent (enterFrame) {
_level0.drawTime();
}
onClipEvent (keyDown) {
if (Key.isDown(80)) {
_root.pause();
}
}
onClipEvent (enterFrame) {
if (_root.STOP) {
Mouse.show();
} else if (_ymouse > 195) {
Mouse.show();
} else if (!_parent.STOP) {
Mouse.hide();
}
}
Instance of Symbol 181 MovieClip "mcSoundOffOn" in Frame 4
onClipEvent (enterFrame) {
if (Key.isDown(83)) {
this.play();
}
}
Instance of Symbol 220 MovieClip "mcQuitDialog" in Frame 4
onClipEvent (load) {
this.swapDepths(100000);
}
Frame 5
endContainer.g_numScore = points;
trace("at game over screen");
_root.inter._alpha = 0;
_root.mcSoundOffOn._alpha = 0;
_root.mcTips._alpha = 0;
_root.mcLife.visible = false;
if ((crypto == 2) || (crypto == 0)) {
postGameLog();
_root.xmlGameEnd.load((gameEndSubmitUrl + "?params=") + TEAEncrypt((((("freePlayID=" + freeplayid) + "&score=") + endContainer.g_numScore) + "&timeStamp=") + timeStamp, tKey));
} else {
_root.t_fLoadGameEnd();
}
Symbol 24 MovieClip [mcBackGround] Frame 1
stop();
Symbol 24 MovieClip [mcBackGround] Frame 2
stop();
Symbol 24 MovieClip [mcBackGround] Frame 3
stop();
Symbol 24 MovieClip [mcBackGround] Frame 4
stop();
Symbol 24 MovieClip [mcBackGround] Frame 5
stop();
Symbol 24 MovieClip [mcBackGround] Frame 6
stop();
Symbol 24 MovieClip [mcBackGround] Frame 7
stop();
Symbol 24 MovieClip [mcBackGround] Frame 8
stop();
Symbol 24 MovieClip [mcBackGround] Frame 9
stop();
Symbol 45 MovieClip Frame 5
_parent._parent.removeMovieClip();
Symbol 46 MovieClip [mon0] Frame 1
stop();
Symbol 74 MovieClip Frame 5
_parent._parent.removeMovieClip();
Symbol 75 MovieClip [mon1] Frame 1
stop();
Symbol 92 MovieClip Frame 5
_parent._parent.removeMovieClip();
Symbol 93 MovieClip [mon2] Frame 1
stop();
Symbol 94 MovieClip Frame 1
stop();
Symbol 95 MovieClip [monster2] Frame 1
function pause() {
if ((b._currentframe != 2) && (_currentframe != 15)) {
stop();
}
}
function contin() {
if ((b._currentframe != 2) && (_currentframe != 15)) {
play();
}
}
Symbol 95 MovieClip [monster2] Frame 15
stop();
Symbol 95 MovieClip [monster2] Frame 119
gotoAndPlay (1);
Symbol 95 MovieClip [monster2] Frame 209
gotoAndPlay (1);
Symbol 95 MovieClip [monster2] Frame 284
gotoAndPlay (1);
Symbol 96 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 1
stop();
Symbol 98 MovieClip [monster1] Frame 1
function pause() {
if ((b._currentframe != 2) && (_currentframe != 15)) {
stop();
}
}
function contin() {
if ((b._currentframe != 2) && (_currentframe != 15)) {
play();
}
}
Symbol 98 MovieClip [monster1] Frame 15
stop();
Symbol 98 MovieClip [monster1] Frame 119
gotoAndPlay (1);
Symbol 98 MovieClip [monster1] Frame 209
gotoAndPlay (1);
Symbol 98 MovieClip [monster1] Frame 284
gotoAndPlay (1);
Symbol 99 MovieClip [monster0] Frame 1
function pause() {
if ((b._currentframe != 2) && (_currentframe != 15)) {
stop();
}
}
function contin() {
if ((b._currentframe != 2) && (_currentframe != 15)) {
play();
}
}
Symbol 99 MovieClip [monster0] Frame 15
stop();
Symbol 99 MovieClip [monster0] Frame 119
gotoAndPlay (1);
Symbol 99 MovieClip [monster0] Frame 209
gotoAndPlay (1);
Symbol 99 MovieClip [monster0] Frame 284
gotoAndPlay (1);
Symbol 108 MovieClip Frame 1
num_loaded = _root.getBytesLoaded();
num_total = _root.getBytesTotal();
num_percent = int((num_loaded / num_total) * 100);
setProperty("_root.loading.line", _xscale , num_percent);
if (num_percent >= 99) {
_root.play();
}
Symbol 108 MovieClip Frame 2
gotoAndPlay (1);
Symbol 120 Button
on (release) {
getURL ("http://www.arkadium.com", "_blank");
}
Symbol 121 MovieClip Frame 1
if (_root.logoUrl == undefined) {
play();
} else {
loadBrandMov.loadMovie(_root.logoUrl);
stop();
}
Symbol 121 MovieClip Frame 2
stop();
Symbol 123 MovieClip Frame 1
stop();
Symbol 123 MovieClip Frame 2
stop();
Symbol 123 MovieClip Frame 3
stop();
Symbol 123 MovieClip Frame 4
stop();
Symbol 123 MovieClip Frame 5
stop();
Symbol 123 MovieClip Frame 6
stop();
Symbol 123 MovieClip Frame 7
stop();
Symbol 123 MovieClip Frame 8
stop();
Symbol 123 MovieClip Frame 9
stop();
Symbol 130 Button
on (press) {
_root.gotoAndStop(4);
}
on (release) {
_root.enterClip._x = 5000;
}
Symbol 138 MovieClip Frame 1
stop();
myListener = new Object();
myListener.onKeyUp = function () {
if (Key.getCode() == 145) {
play();
}
};
Key.addListener(myListener);
Symbol 149 MovieClip Frame 89
stop();
_level0.protectionFail = true;
Symbol 162 MovieClip Frame 26
stop();
_parent._parent.fighterRecovery();
Symbol 163 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 2
function pause() {
crh.stop();
}
function contin() {
crh.play();
}
crh.gotoAndPlay(1);
Symbol 176 Button
on (release) {
gotoAndStop (2);
}
Symbol 179 Button
on (release) {
gotoAndStop (1);
}
Symbol 181 MovieClip Frame 1
stop();
_root.soundControl = true;
_root.babah_s.setVolume(100);
Symbol 181 MovieClip Frame 2
stop();
_root.soundControl = false;
_root.babah_s.setVolume(0);
Symbol 195 MovieClip Frame 1
function pause() {
stop();
}
function contin() {
play();
}
Symbol 195 MovieClip Frame 26
stop();
Symbol 196 MovieClip Frame 75
_parent.ufoDie();
Symbol 197 MovieClip Frame 1
function ufoDie() {
_parent.ufoDie();
}
function pause() {
if (_root.ufo_flag) {
_root.ufo_fly_s.stop();
}
}
function contin() {
if (_root.ufo_flag) {
_root.ufo_fly_s.start();
}
}
stop();
Symbol 197 MovieClip Frame 2
function pause() {
body.stop();
body.sm1.pause();
body.sm2.pause();
body.sm3.pause();
body.sm4.pause();
_root.ufo_dead_s.stop();
}
function contin() {
body.play();
body.sm1.contin();
body.sm2.contin();
body.sm3.contin();
body.sm4.contin();
_root.ufo_dead_s.play();
}
Symbol 201 Button
on (release) {
_root.pause();
}
Symbol 206 MovieClip Frame 3
stop();
Symbol 208 Button
on (release) {
if (!STOP) {
return(undefined);
}
_parent.restartGame();
_parent.gotoAndStop(2);
}
Symbol 211 Button
on (release) {
fscommand ("quit");
}
Symbol 217 Button
on (release) {
if (!STOP) {
return(undefined);
}
_parent.restartGame();
_root.gotoAndPlay(2);
}