Frame 1
function setStatus() {
pl_status.b_l = _root.getBytesLoaded();
pl_status.b_t = _root.getBytesTotal();
pl_status.pc_l = (100 / pl_status.b_t) * pl_status.b_l;
_root.loader.sub_loader._width = Math.round(pl_status.pc_l * 2);
_root.loader.sub_loader._x = -100 + Math.round(pl_status.pc_l);
status_txt.text = ((((("(" + pl_status.b_l) + " \\") + pl_status.b_t) + ") - (") + pl_status.pc_l) + "%)";
if ((Math.round(pl_status.pc_l) == 100) && (!pl_status.isset)) {
_root.loading_show.text = "Completed! Click anywhere to continue...";
pl_status.loaded_ = true;
pl_status.isset = true;
}
}
function getClick() {
if (pl_status.loaded_) {
gotoAndStop (2);
} else {
_root.loading_show.text = "Please wait for ready...";
}
}
stop();
pl_status = {b_l:0, b_t:0, pc_l:0, loaded_:false, isset:false};
Instance of Symbol 192 MovieClip [background] in Frame 1
on (release) {
_root.getClick();
}
Instance of Symbol 190 MovieClip [loader] "loader" in Frame 1
onClipEvent (enterFrame) {
if (!_root.pl_status.loaded_) {
_root.setStatus();
}
}
Frame 2
function gameSetup() {
_root.attachMovie("pointer", "pointer", 1000);
_root.pointer._x = 100;
_root.pointer._y = 100;
}
function updateMultiple() {
if (radar.active) {
radar.rbuf = (((radar.rotation >= 80) || (radar.rotation <= -20)) ? (((radar.rbuf == 1) ? -1 : 1)) : (radar.rbuf));
radar.rotation = radar.rotation + radar.rbuf;
_root.main_base.radar_station.sourcer._rotation = radar.rotation;
}
gCloud = Math.random() * 100;
if (gCloud > 98.5) {
_root.cloud_layer.attachMovie("clouds", "cloud_" + cCloud, 1000 + cCloud);
_root.cloud_layer["cloud_" + cCloud].gotoAndStop(Math.round(Math.random * 2) + 1);
_root.cloud_layer["cloud_" + cCloud]._x = -150;
_root.cloud_layer["cloud_" + cCloud]._y = 10 + (Math.random() * 50);
_root.cloud_layer["cloud_" + cCloud]._xscale = 30 + (Math.random() * 70);
_root.cloud_layer["cloud_" + cCloud]._yscale = 30 + (Math.random() * 70);
_root.cloud_layer["cloud_" + cCloud]._alpha = 30 + (Math.random() * 70);
cCloud++;
}
for (a in _root.cloud_layer) {
_root.cloud_layer[a]._x = _root.cloud_layer[a]._x + game.wind;
if ((_root.cloud_layer[a]._x < (game.ml - 150)) || (_root.cloud_layer[a]._x > (game.mr + 150))) {
_root.cloud_layer[a].removeMovieClip();
}
}
}
function updatePGun() {
player.aim = false;
if (((player.rotation >= 0) && (player.rotation <= 90)) && (player.active)) {
player.rotation = (_ymouse - 250) * -1;
player.aim = true;
}
if (player.active && ((player.rotation < 0) || (player.rotation > 90))) {
player.rotation = ((player.rotation < 0) ? 0 : 90);
player.aim = true;
}
if (player.aim) {
_root.p_gun.gun_turret._rotation = player.rotation;
}
_root.pointer._x = 526 + (((100 * Math.cos(player.rotation / 59)) * 2) * -1);
_root.pointer._y = 324 + (((100 * Math.sin(player.rotation / 59)) * 2) * -1);
_root.pointer._rotation = player.rotation - 45;
}
function fireGun() {
_root.bullet_clip.attachMovie(["bullet_" + player.gunmode], ["bullet_" + cb], cb);
_root.bullet_clip["bullet_" + cb]._x = (520 - ((player.lastfired == 2) ? 6.4 : 0)) + (((17 * Math.cos(player.rotation / 59)) * 2) * -1);
_root.bullet_clip["bullet_" + cb]._y = (324 - ((player.lastfired == 2) ? 0 : 4)) + (((17 * Math.sin(player.rotation / 59)) * 2) * -1);
gf[cb] = new gunFire(["bullet_" + cb], cb, ((player.lastfired == 2) ? 0.05 : 0) + (Math.cos(player.rotation / 57.5) * -1), ((player.lastfired == 2) ? 0 : 0.02) + (Math.sin(player.rotation / 57.5) * -1), player.damage, 10);
_root.bullet_clip["bullet_" + cb]._rotation = player.rotation;
stats.fired++;
countB++;
cb++;
}
function moveObjects() {
for (a in _root.enemy_layer) {
if (((_root.enemy_layer[a]._x > enemy[a.substr(5, 6)].dCoord) && (enemy[a.substr(5, 6)].dropped == false)) && (enemy[a.substr(5, 6)].active)) {
getBomb(_root.enemy_layer[a]._x, _root.enemy_layer[a]._y, enemy[a.substr(5, 6)].weapon, enemy[a.substr(5, 6)].wSpeed);
enemy[a.substr(5, 6)].dropped = true;
}
if (!enemy[a.substr(5, 6)].active) {
if (_root.enemy_layer[a].explosion._currentframe == _root.enemy_layer[a].explosion._totalframes) {
_root.enemy_layer[a].removeMovieClip();
}
}
_root.enemy_layer[a]._x = _root.enemy_layer[a]._x + enemy[a.substr(5, 6)].speed;
if ((_root.enemy_layer[a]._x < (game.ml - 150)) || (_root.enemy_layer[a]._x > (game.mr + 150))) {
_root.enemy_layer[a].removeMovieClip();
escapes++;
}
}
for (b in _root.bullet_clip) {
if (!gf[b.substr(7, 8)].active) {
_root.bullet_clip[b].removeMovieClip();
}
if (gf[b.substr(7, 8)].active) {
_root.bullet_clip[b]._x = _root.bullet_clip[b]._x + (gf[b.substr(7, 8)].speed * gf[b.substr(7, 8)].dirX);
_root.bullet_clip[b]._y = _root.bullet_clip[b]._y + (gf[b.substr(7, 8)].speed * gf[b.substr(7, 8)].dirY);
if ((((_root.bullet_clip[b]._x < game.ml) || (_root.bullet_clip[b]._x > game.mr)) || (_root.bullet_clip[b]._y < game.mt)) || (_root.bullet_clip[b]._y > game.mb)) {
_root.bullet_clip[b].removeMovieClip();
stats.missed++;
countB--;
}
for (c in _root.bomb_layer) {
if (_root.bomb_layer[c].hitTest(Math.round(_root.bullet_clip[b]._x + (gf[b.substr(7, 8)].dirX * gf[b.substr(7, 8)].speed)), Math.round(_root.bullet_clip[b]._y + (gf[b.substr(7, 8)].dirY * gf[b.substr(7, 8)].speed)), true)) {
_root.bomb_layer[c].gotoAndStop(2);
gf[b.substr(7, 8)].active = false;
bomb[c.substr(5, 6)].life = bomb[c.substr(5, 6)].life - gf[b.substr(7, 8)].damage;
if ((bomb[c.substr(5, 6)].life <= 0) && (bomb[c.substr(5, 6)].active == true)) {
bomb[c.substr(5, 6)].active = false;
_root.bomb_layer[c].attachMovie("explosion_1", "explosion", 100);
_root.bomb_layer[c].gotoAndPlay(2);
stats.score = stats.score + bomb[c.substr(5, 6)].score;
showScore(bomb[c.substr(5, 6)].score, _root.bomb_layer[c]._x, _root.bomb_layer[c]._y);
stats.bombs++;
}
}
}
for (a in _root.enemy_layer) {
if (_root.enemy_layer[a].hitTest(Math.round(_root.bullet_clip[b]._x + (gf[b.substr(7, 8)].dirX * gf[b.substr(7, 8)].speed)), Math.round(_root.bullet_clip[b]._y + (gf[b.substr(7, 8)].dirY * gf[b.substr(7, 8)].speed)), true)) {
_root.bullet_clip[b].gotoAndStop(2);
gf[b.substr(7, 8)].active = false;
enemy[a.substr(5, 6)].life = enemy[a.substr(5, 6)].life - gf[b.substr(7, 8)].damage;
if ((enemy[a.substr(5, 6)].life <= 0) && (enemy[a.substr(5, 6)].active == true)) {
enemy[a.substr(5, 6)].active = false;
_root.enemy_layer[a].attachMovie("explosion_1", "explosion", 100);
_root.enemy_layer[a].gotoAndPlay(2);
stats.score = stats.score + (enemy[a.substr(5, 6)].score + ((enemy[a.substr(5, 6)].dropped == false) ? 50 : 0));
showScore(enemy[a.substr(5, 6)].score + ((enemy[a.substr(5, 6)].dropped == false) ? 50 : 0), _root.enemy_layer[a]._x, _root.enemy_layer[a]._y);
stats.veh++;
}
}
}
}
}
for (c in _root.bomb_layer) {
if (!bomb[c.substr(5, 6)].active) {
if (_root.bomb_layer[c].explosion._currentframe == _root.bomb_layer[c].explosion._totalframes) {
_root.bomb_layer[c].removeMovieClip();
}
}
if (bomb[c.substr(5, 6)].active) {
_root.bomb_layer[c]._rotation = _root.bomb_layer[c]._rotation + ((_root.bomb_layer[c]._rotation < 0) ? 1 : 0);
_root.bomb_layer[c]._x = _root.bomb_layer[c]._x + ((_root.bomb_layer[c]._rotation * -1) / 25);
_root.bomb_layer[c]._y = _root.bomb_layer[c]._y + (bomb[c.substr(5, 6)].speed / 3);
bomb[c.substr(5, 6)].cx = _root.bomb_layer[c]._x;
bomb[c.substr(5, 6)].cy = _root.bomb_layer[c]._y;
bomb[c.substr(5, 6)].cLevel = Math.round(_root.bomb_layer[c]._x / 40);
if (bomb[c.substr(5, 6)].speed < 30) {
bomb[c.substr(5, 6)].speed = bomb[c.substr(5, 6)].speed + bomb[c.substr(5, 6)].gravity;
}
if (_root.bomb_layer[c]._y > (bomb[c.substr(5, 6)].iCoord + (bomb[c.substr(5, 6)].level * 35))) {
bomb[c.substr(5, 6)].active = false;
getBaseDmg(bomb[c.substr(5, 6)], hitZone[bomb[c.substr(5, 6)].level][bomb[c.substr(5, 6)].cLevel]);
_root.crater_clip.attachMovie("crater", ["crater_" + ci], cs + ci);
_root.bomb_layer[c].attachMovie("impact_" + bomb[c.substr(5, 6)].num, "explosion", 100);
_root.crater_clip["crater_" + ci]._x = Math.round(bomb[c.substr(5, 6)].cx);
_root.crater_clip["crater_" + ci]._y = Math.round(bomb[c.substr(5, 6)].cy);
_root.bomb_layer[c].gotoAndStop(2);
bHit++;
ci++;
}
}
}
}
function getEnemies() {
rndSpawn = Math.random() * 100;
rndDrop = -30 + Math.round(Math.random() * 400);
rndPick = Math.round(Math.random() * (game.level - 1));
if (rndSpawn > game.sFreq) {
_root.enemy_layer.attachMovie(eType[rndPick], ["unit_" + ce], 1000 + ce);
_root.enemy_layer["unit_" + ce]._x = -150;
_root.enemy_layer["unit_" + ce]._y = 10 + (Math.random() * 200);
enemy[ce] = new spawnEnemy(["enemy_" + ce], ce, eSpeed[rndPick], rndPick + 1, Math.round(1 + (Math.random() * 3)), eLife[rndPick], rndDrop, bSpeed[rndPick], eScore[rndPick]);
if (radar.active) {
_root.attachMovie("incoming", ["incoming"], 100);
_root.incoming._x = 0;
_root.incoming._y = _root.enemy_layer["unit_" + ce]._y;
blip = 3;
}
ce++;
}
}
function getBomb(cx, cy, bType, bSpeed) {
_root.bomb_layer.attachMovie(["bomb_" + bType], ["bomb_" + cd], cd);
_root.bomb_layer["bomb_" + cd]._x = cx;
_root.bomb_layer["bomb_" + cd]._y = cy + 20;
_root.bomb_layer["bomb_" + cd]._rotation = 270;
bomb[cd] = new dropBomb(["bomb_" + cd], bType, pSpeed[bType - 1], bDamage[bType - 1], bGrav[bType - 1], bScore[bType - 1], Math.round(Math.random() * 2), Math.round(cx / 40), cx, cy);
cd++;
}
function showStats() {
_root.sb_.score_.text = "Score: " + stats.score;
_root.sb_.time_.text = ("Time: " + stats.timec) + " sec";
_root.sb_.bombs_.text = "Bombs: " + stats.bombs;
_root.sb_.vehicles_.text = "Vehicles: " + stats.veh;
stats.timec++;
}
function showScore(points, cx, cy) {
_root.attachMovie("f_score", ["f_score" + cs], cs);
_root["f_score" + cs].sTxt.textColor = ((points <= 50) ? "0xff0000" : ((((points > 50) && (points < 200)) ? "0x0000ff" : "0xff7700")));
_root["f_score" + cs].sTxt.text = points;
_root["f_score" + cs]._x = cx;
_root["f_score" + cs]._y = cy;
cs++;
}
function getBaseDmg(projectile, target) {
switch (target) {
case "tower_1" :
if (tower1.active) {
tower1.life = tower1.life - projectile.damage;
tower1.active = ((tower1.life > 0) ? 1 : 0);
if (!tower1.active) {
_root.smoke_clip.attachMovie("smoke", ["smoke" + cb], 100 + ci);
_root.smoke_clip["smoke" + ci]._x = 60;
_root.smoke_clip["smoke" + ci]._y = 400;
}
}
return;
case "tower_2" :
if (tower2.active) {
tower2.life = tower2.life - projectile.damage;
tower2.active = ((tower2.life > 0) ? 1 : 0);
if (!tower2.active) {
_root.smoke_clip.attachMovie("smoke", ["smoke" + ci], 100 + ci);
_root.smoke_clip["smoke" + ci]._x = 350;
_root.smoke_clip["smoke" + ci]._y = 400;
}
}
return;
case "gate_" :
if (gate.active) {
gate.life = gate.life - projectile.damage;
gate.active = ((gate.life > 0) ? 1 : 0);
}
return;
case "munition_" :
if (munition.active) {
munition.life = munition.life - projectile.damage;
munition.active = ((munition.life > 0) ? 1 : 0);
if ((!munition.active) && (!game.nuked)) {
game.nuked = true;
_root.main_base.attachMovie("nuke_exp", "nuke_exp", 100000);
_root.main_base.nuke_exp._x = -130;
_root.main_base.nuke_exp._y = 200;
}
}
return;
case "radar_" :
if (radar.active) {
radar.life = radar.life - projectile.damage;
radar.active = ((radar.life > 0) ? 1 : 0);
if (!radar.active) {
_root.smoke_clip.attachMovie("smoke", ["smoke" + ci], 100 + ci);
_root.smoke_clip["smoke" + ci]._x = 395;
_root.smoke_clip["smoke" + ci]._y = 455;
with (main_base.radar_station) {
gotoAndStop(2);
}
}
}
return;
}
}
function endTest() {
gotoAndStop (3);
}
function checkFps(arg) {
switch (arg) {
case 0 :
fCount++;
break;
case 1 :
_root.sb_.fps_.text = "Fps: " + fCount;
fCount = 0;
game.sFreq = game.sFreq - 0.0005;
}
}
function resetGame() {
for (a in _root) {
removeMovieClip(a);
}
clearInterval(fci);
clearInterval(ssi);
clearInterval(uli);
}
stop();
game = {ml:-20, mr:600, mt:-10, mb:550, wind:2, level:2, sFreq:99.4, nuked:false};
gf = {};
bomb = {};
enemy = {};
gunFire = {};
dropBomb = {};
player = {life:500, active:true, gunmode:1, aim:true, interval:50, rotation:0, lastfired:2, firing:false, damage:5};
stats = {score:0, fScore:0, veh:0, bombs:0, timec:0, fired:0, missed:0, accuracy:0};
radar = {life:200, active:true, rotation:0, rbuf:1};
gate = {life:500, active:true};
tower1 = {life:100, active:true};
tower2 = {life:100, active:true};
munition = {life:100, active:true};
var cb = ((cd = (ce = (db = (a = (udInt = (ci = (cs = (escapes = (bHit = 0))))))))));
var rndSpawn = ((rndPick = (rndDrop = 0)));
var cCloud = ((gCloud = 0));
var efCount = 0;
var countB = 0;
var csVar = ((sVar = ""));
var fci;
var ssi;
var uli;
var stopped = false;
var blip = 0;
var eType = new Array("jet_1", "jet_2", "bomber_1", "bomber_2", "heli_1", "scud_1", "para_1", "nuke_1");
var eScore = new Array(100, 200, 300, 400, 500, 600, 700);
var eSpeed = new Array(6, 5, 3, 3, 2, 6, 1, 2);
var eLife = new Array(10, 15, 70, 110, 80, 5, 20, 20);
var bDamage = new Array(100, 200, 300, 400, 500, 600, 700, 800);
var bScore = new Array(50, 50, 150, 200, 250, 300, 350);
var bGrav = new Array(0.15, 0.25, 0.1, 0.1, 0.1, 0.1, 0.1);
var pSpeed = new Array(0.1, 1, 1, 1, 1, 1, 1, 1);
var hitZone = new Array(["tower_1", "tower_1", "tower_1", "", "", "gate_", "gate_", "gate_", "tower_2", "tower_2", "tower_2", "", "", "", ""], ["", "munition_", "munition_", "munition_", "munition_", "munition_", "munition_", "munition_", "", "radar_", "radar_", "radar_", "", "", ""], ["", "munition_", "munition_", "munition_", "munition_", "munition_", "munition_", "munition_", "", "radar_", "radar_", "radar_", "", "", ""]);
var bType = new Array();
Mouse.hide();
gameSetup();
gunFire = function (newId, newNum, newDirX, newDirY, newDamage, newSpeed) {
this.id = newId;
this.num = newNum;
this.dirX = newDirX;
this.dirY = newDirY;
this.damage = newDamage;
this.speed = newSpeed;
};
gunFire.prototype.active = true;
spawnEnemy = function (newId, newNum, newSpeed, newWeapon, newFrequency, newLife, newCoord, newWSpeed, newScore) {
this.id = newId;
this.num = newNum;
this.speed = newSpeed;
this.weapon = newWeapon;
this.dFrequency = newFrequency;
this.life = newLife;
this.dCoord = newCoord;
this.wSpeed = newWSpeed;
this.score = newScore;
};
spawnEnemy.prototype.active = true;
spawnEnemy.prototype.dropped = false;
dropBomb = function (newId, newNum, newSpeed, newDamage, newGravity, newScore, newLevel, newCLevel, newCx, newCy) {
this.id = newId;
this.num = newNum;
this.speed = newSpeed;
this.damage = newDamage;
this.gravity = newGravity;
this.score = newScore;
this.level = newLevel;
this.cLevel = newCLevel;
this.cx = newCx;
this.cy = newCy;
};
dropBomb.prototype.active = true;
dropBomb.prototype.iCoord = 420;
ssi = setInterval(showStats, 1000, null);
var fCount = 0;
fci = setInterval(checkFps, 1000, 1);
Instance of Symbol 182 MovieClip [level_1] "main_base" in Frame 2
on (press) {
Mouse.hide();
_root.player.firing = true;
_root.player.lastfired = ((_root.player.lastfired == 2) ? 1 : 2);
with (_root.p_gun.gun_turret) {
gotoAndPlay(((_root.player.lastfired == 2) ? 5 : 12));
}
with (_root.pointer) {
gotoAndPlay(2);
}
}
on (release, releaseOutside) {
_root.player.firing = false;
with (_root.p_gun.gun_turret) {
gotoAndStop(1);
}
with (_root.pointer) {
gotoAndPlay(16);
}
}
Instance of Symbol 164 MovieClip [get_frames] in Frame 2
onClipEvent (enterFrame) {
if (_root.stopped == false) {
_root.updatePGun();
_root.checkFps(0);
_root.moveObjects();
_root.getEnemies();
_root.udInt++;
if (_root.udInt == 5) {
_root.updateMultiple();
_root.udInt = 0;
}
_root.m_pointer._x = ((_ymouse > 400) ? (_xmouse) : (_root.m_pointer._x));
_root.m_pointer._y = ((_ymouse > 400) ? (_ymouse) : 400);
}
}
Frame 3
stop();
var playerRank = "";
var ranking = new Array("Ultra n00b", "Semi-ultra noob", "Newbie", "Below average", "Average", "Pretty good", "Very good", "Damn good", "Dominating", "Godlike");
stats.accuracy = Math.round((100 / stats.fired) * (stats.fired - stats.missed));
stats.fScore = ((stats.score * Math.ceil(stats.timec / 30)) + (stats.accuracy * 3)) - ((bHit * 10) + (escapes * 10));
csVar = ((((((((("Score: " + stats.score) + "\nTime: ") + stats.timec) + " seconds\nAccuracy: ") + stats.accuracy) + "%\nEscaped enemies: ") + escapes) + "\nTimes hit: ") + bHit) + "\n_______________";
stopped = true;
playerRank = ((stats.fScore < 40000) ? (ranking[Math.round(stats.fScore / 4000)]) : "Unstoppable");
_root.attachMovie("defeat", "defeat", 5000);
_root.defeat._x = 300;
_root.defeat._y = 250;
_root.defeat.calc_score.text = csVar;
_root.defeat.final_results.text = "Final score: " + stats.fScore;
_root.defeat.ranking_txt.text = "| Your ranking: " + playerRank;
Mouse.show();
_root.resetGame();
Symbol 8 MovieClip [pointer] Frame 1
stop();
Symbol 8 MovieClip [pointer] Frame 15
stop();
Symbol 8 MovieClip [pointer] Frame 30
gotoAndStop (1);
Symbol 11 MovieClip [bullet_1] Frame 1
stop();
Symbol 14 MovieClip [clouds] Frame 1
stop();
Symbol 14 MovieClip [clouds] Frame 2
stop();
Symbol 21 MovieClip [jet_1] Frame 1
stop();
Symbol 21 MovieClip [jet_1] Frame 2
stop();
Symbol 23 MovieClip [jet_2] Frame 1
stop();
Symbol 23 MovieClip [jet_2] Frame 2
stop();
Symbol 40 MovieClip [explosion_1] Frame 12
stop();
Symbol 42 MovieClip [bomb_1] Frame 1
stop();
Symbol 42 MovieClip [bomb_1] Frame 2
stop();
Symbol 49 MovieClip [incoming] Frame 13
if (_root.blip > 0) {
_root.blip--;
gotoAndPlay (1);
} else if (_root.blip == 0) {
stop();
}
Symbol 57 MovieClip [bomb_2] Frame 1
stop();
Symbol 57 MovieClip [bomb_2] Frame 2
stop();
Symbol 69 MovieClip [impact_2] Frame 15
stop();
Symbol 81 MovieClip [impact_1] Frame 15
stop();
Symbol 95 MovieClip [nuke_exp] Frame 69
stop();
_root.endTest();
Symbol 99 MovieClip [f_score] Frame 20
removeMovieClip(this);
Symbol 117 MovieClip [smoke] Frame 62
gotoAndPlay (25);
Symbol 118 Button [retry]
on (release) {
gotoAndStop (2);
}
Symbol 126 MovieClip [defeat_] Frame 1
stop();
Symbol 162 MovieClip [rotating_half] Frame 1
stop();
stop();
stop();
Symbol 162 MovieClip [rotating_half] Frame 5
_root.fireGun();
Symbol 162 MovieClip [rotating_half] Frame 12
_root.player.lastfired = 1;
_root.fireGun();
Symbol 162 MovieClip [rotating_half] Frame 19
gotoAndPlay (5);
_root.player.lastfired = 2;
Symbol 175 MovieClip [radio_antenna] Frame 1
stop();
Symbol 175 MovieClip [radio_antenna] Frame 2
stop();