Frame 1
_quality = "MEDIUM";
Stage.scaleMode = "noScale";
fscommand ("trapallkeys", true);
fscommand ("showmenu", "false");
_root.main_link = "http://www.2DPlay.com/index.php?gameid=794&gamename=Cosmic Defender";
_root.download_link = "http://www.2DPlay.com/downloadgame.php?gameid=794&gamename=Cosmic Defender";
_root.get_game_link = "http://www.2DPlay.com/freecontent.htm";
_root.scores_link = "http://www.2dplay.com/highscores.php?gameid=794&hiscore=";
_root.viewscores_link = "http://www.2dplay.com/showscores.php?gameid=794";
Frame 2
stop();
Frame 3
prevFrame();
Frame 10
function Swarmer() {
}
function Pod() {
}
function Bomber() {
}
function Baiter() {
}
function Mutant() {
}
function Lander() {
}
function Man() {
}
_root.tip_array = new Array("Tip: Press 'P' to pause the game and access the menu whilst the game is playing.", "Tip: Press 'S' to activate the smart bomb and destroy everything on the screen (you have limited bombs).", "Tip: Press 'D' to activate hyperspace and get out of trouble (you have unlimited hyperspaces).", "Tip: Keep an eye on the radar for alien abductions. If they get to the top they become mutants.", "Tip: Press and hold down the 'A' button for constant fire.", "Tip: Catch falling comrades mid-air and land them safely for maximum points.");
_root.extra_points = 7500;
_root.extra_bombs = 5000;
_root.enemies_to_kill = 10;
_root.max_enemies = 10;
_root.en_shot_speed = 1;
_root.en_appear_time = 15;
_root.sound_on = true;
_root.splash_music = new Sound(this);
_root.splash_music.attachSound("splash_music");
_root.extra_life_sfx = new Sound(this);
_root.extra_life_sfx.attachSound("extra_life_sfx");
_root.blast_sfx = new Sound(this);
_root.blast_sfx.attachSound("blast_sfx");
_root.hyperjump = new Sound(this);
_root.hyperjump.attachSound("hyper_sfx");
_root.ship_appear = new Sound();
_root.ship_appear.attachSound("ship_appear_sfx");
_root.en_shot_sfx = new Sound();
_root.en_shot_sfx.attachSound("enemy_shot_sfx");
_root.pl_shot_sfx = new Sound();
_root.pl_shot_sfx.attachSound("pl_shot_sfx");
_root.smart_sfx = new Sound();
_root.smart_sfx.attachSound("smart_bomb_sfx");
_root.man_captured_sfx = new Sound();
_root.man_captured_sfx.attachSound("man_captured_sfx");
_root.man_taken_sfx = new Sound();
_root.man_taken_sfx.attachSound("man_taken_sfx");
Swarmer.prototype = new MovieClip();
Swarmer.prototype.onLoad = function () {
_root.enemies_on = _root.enemies_on + 1;
_root.locator.attachMovie("radar_dot", this._name, Number(this._name.slice(5)) + 30);
eval ("_root.locator." + this._name).gotoAndStop(7);
if (this.dx < 0) {
this._xscale = -100;
}
};
Swarmer.prototype.Destroy = function () {
removeMovieClip(eval ("_root.locator." + this._name));
_root.AttachBang(this._x, this._y);
_root.Scoring(this._x, this._y, 150);
_root.CheckLevelFin();
removeMovieClip(this);
};
Swarmer.prototype.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
if (_local2.player_on && (!_local2.paused)) {
if (_local1.hitTest(_local2.ship_0.hot_spot_en)) {
_local2.PlayerHitted();
}
if (Math.random() < (0.02 * _local2.en_shooting)) {
_local2.EnShooting(_local1.x, _local1._y, _local1._x);
}
_local1.y1 = _local1._y + (_local1.dy * _local2.enemy_speed);
if (((_local1.y1 > 330) || (_local1.y1 < 80)) || (Math.random() < 0.01)) {
_local1.dy = -_local1.dy;
} else {
_local1._y = _local1.y1;
}
_local1.x = _local2.ToNewX(_local1.x, _local1.dx * _local2.enemy_speed);
_local1._x = _local2.ToGlobal(_local1.x);
}
};
Object.registerClass("swarmer", Swarmer);
Pod.prototype = new MovieClip();
Pod.prototype.onLoad = function () {
_root.enemies_on = _root.enemies_on + 1;
_root.locator.attachMovie("radar_dot", this._name, Number(this._name.slice(5)) + 30);
eval ("_root.locator." + this._name).gotoAndStop(6);
this.dx = ((Math.random() < 0.5) ? (4 * _root.enemy_speed) : (-4 * _root.enemy_speed));
this.dy = ((Math.random() < 0.5) ? (1 * _root.enemy_speed) : (-1 * _root.enemy_speed));
};
Pod.prototype.Destroy = function (bang) {
if (!bang) {
this.swarmers = 4;
s = 1;
while (s < 16) {
if (!_root.EnemyAr[s]) {
_root.EnemyAr[s] = true;
_root.attachMovie("swarmer", "ship_" + s, s + 30);
this.ship = eval ("_root.ship_" + s);
this.ship.x = this.x;
this.ship._y = this._y;
this.ship.dx = this.dx * 1.5;
this.ship.dy = ((this.swarmers - 3) * 2) + 1;
this.swarmers = this.swarmers - 1;
if (this.swarmers == 0) {
s = 16;
}
}
s++;
}
}
removeMovieClip(eval ("_root.locator." + this._name));
_root.AttachBang(this._x, this._y);
_root.Scoring(this._x, this._y, 1000);
_root.CheckLevelFin();
removeMovieClip(this);
};
Pod.prototype.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
if (_local2.player_on && (!_local2.paused)) {
if (_local1.hitTest(_local2.ship_0.hot_spot_en)) {
_local2.PlayerHitted();
}
if (Math.random() < (0.02 * _local2.en_shooting)) {
_local2.EnShooting(_local1.x, _local1._y, _local1._x);
}
_local1.y1 = _local1._y + _local1.dy;
if (((_local1.y1 > 330) || (_local1.y1 < 80)) || (Math.random() < 0.01)) {
_local1.dy = -_local1.dy;
} else {
_local1._y = _local1.y1;
}
_local1.x = _local2.ToNewX(_local1.x, _local1.dx);
_local1._x = _local2.ToGlobal(_local1.x);
}
};
Object.registerClass("pod", Pod);
Bomber.prototype = new MovieClip();
Bomber.prototype.onLoad = function () {
_root.enemies_on = _root.enemies_on + 1;
_root.locator.attachMovie("radar_dot", this._name, Number(this._name.slice(5)) + 30);
eval ("_root.locator." + this._name).gotoAndStop(5);
this.dx = ((Math.random() < 0.5) ? (4 * _root.enemy_speed) : (-4 * _root.enemy_speed));
this.dy = ((Math.random() < 0.5) ? (1 * _root.enemy_speed) : (-1 * _root.enemy_speed));
this.timr = 15;
this.mines = 4;
};
Bomber.prototype.Destroy = function () {
removeMovieClip(eval ("_root.locator." + this._name));
_root.AttachBang(this._x, this._y);
_root.Scoring(this._x, this._y, 250);
_root.CheckLevelFin();
removeMovieClip(this);
};
Bomber.prototype.onEnterFrame = function () {
if (_root.player_on && (!_root.paused)) {
if (this.hitTest(_root.ship_0.hot_spot_en)) {
_root.PlayerHitted();
}
if ((this.timr <= 0) && (this.mines > 0)) {
this.timr = 15;
this.mines = this.mines - 1;
if (this._x < 700) {
_root.attachMovie("mine", "mine_" + _root.mines_count, _root.mines_count);
eval ("_root.mine_" + _root.mines_count).x = this.x;
eval ("_root.mine_" + _root.mines_count)._y = this._y;
_root.mines_count = _root.mines_count + 1;
if (_root.mines_count == 20) {
_root.mines_count = 0;
}
}
} else {
this.timr = this.timr - 1;
}
this.y1 = this._y + this.dy;
if ((this.y1 > 330) || (this.y1 < 80)) {
if (this.mines <= 0) {
this.timr = 15;
this.mines = 4;
}
this.dy = -this.dy;
} else {
this._y = this.y1;
}
this.x = _root.ToNewX(this.x, this.dx);
this._x = _root.ToGlobal(this.x);
}
};
Object.registerClass("bomber", Bomber);
Baiter.prototype = new MovieClip();
Baiter.prototype.onLoad = function () {
_root.enemies_on = _root.enemies_on + 1;
_root.locator.attachMovie("radar_dot", this._name, Number(this._name.slice(5)) + 30);
eval ("_root.locator." + this._name).gotoAndStop(4);
this.to_x = Math.random() * _root.x_dimension;
this.y_init = this._y;
this.sinus = 0;
};
Baiter.prototype.Destroy = function () {
removeMovieClip(eval ("_root.locator." + this._name));
_root.AttachBang(this._x, this._y);
_root.Scoring(this._x, this._y, 200);
_root.CheckLevelFin();
removeMovieClip(this);
};
Baiter.prototype.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
if (_local2.player_on && (!_local2.paused)) {
if (_local1.hitTest(_local2.ship_0.hot_spot_en)) {
_local2.PlayerHitted();
}
_local1.distance = _local1.to_x - _local1.x;
if (Math.abs(_local1.distance) < 40) {
_local1.to_x = Math.random() * _local2.x_dimension;
_local1.y_amp = 2 * (Math.random() * 10);
}
_local1.dx = ((_local1.to_x > _local1.x) ? (14 * _local2.enemy_speed) : (-14 * _local2.enemy_speed));
_local1.x = _local2.ToNewX(_local1.x, _local1.dx);
_local1._y = _local1.y_init + ((Math.sin(_local1.sinus) * 20) * _local2.enemy_speed);
_local1.sinus = _local1.sinus + 0.1;
_local1._x = _local2.ToGlobal(_local1.x);
if (Math.random() < (0.04 * _local2.en_shooting)) {
_local2.EnShooting(_local1.x, _local1._y, _local1._x);
}
}
};
Object.registerClass("baiter", Baiter);
Mutant.prototype = new MovieClip();
Mutant.prototype.onLoad = function () {
_root.enemies_on = _root.enemies_on + 1;
_root.locator.attachMovie("radar_dot", this._name, Number(this._name.slice(5)) + 30);
eval ("_root.locator." + this._name).gotoAndStop(2);
this.sinus = 0;
};
Mutant.prototype.Destroy = function () {
removeMovieClip(eval ("_root.locator." + this._name));
_root.AttachBang(this._x, this._y);
_root.Scoring(this._x, this._y, 150);
_root.CheckLevelFin();
removeMovieClip(this);
};
Mutant.prototype.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
if (_local2.player_on && (!_local2.paused)) {
if (_local1.hitTest(_local2.ship_0.hot_spot_en)) {
_local2.PlayerHitted();
}
_local1.x_incr = _local2.ship_0._x - _local1._x;
_local1.ang = Math.atan2(_local2.ship_0._y - _local1._y, _local1.x_incr);
_local1._y = _local1._y + (((Math.sin(_local1.ang) * 8) * _local2.enemy_speed) + (Math.sin(_local1.sinus) * 5));
_local1.sinus = _local1.sinus + 0.2;
_local1.dx = (Math.cos(_local1.ang) * 8) * _local2.enemy_speed;
if (Math.abs(_local1.x_incr) > (_local2.x_dimension / 2)) {
_local1.dx = -_local1.dx;
}
_local1.x = _local2.ToNewX(_local1.x, _local1.dx);
_local1._x = _local2.ToGlobal(_local1.x);
if (Math.random() < (0.02 * _local2.en_shooting)) {
_local2.EnShooting(_local1.x, _local1._y, _local1._x);
}
}
};
Object.registerClass("mutant", Mutant);
Lander.prototype = new MovieClip();
Lander.prototype.onLoad = function () {
_root.enemies_on = _root.enemies_on + 1;
this.action = 0;
this.dx = ((Math.random() < 0.5) ? (-4 * _root.enemy_speed) : (4 * _root.enemy_speed));
this.dy = ((Math.random() * 4) - 2) * _root.enemy_speed;
_root.locator.attachMovie("radar_dot", this._name, Number(this._name.slice(5)) + 30);
eval ("_root.locator." + this._name).gotoAndStop(3);
};
Lander.prototype.Destroy = function () {
this.victim.action = 2;
this.action = 0;
_root.ShowMessage(false);
removeMovieClip(eval ("_root.locator." + this._name));
_root.AttachBang(this._x, this._y);
_root.Scoring(this._x, this._y, 150);
_root.CheckLevelFin();
removeMovieClip(this);
};
Lander.prototype.onEnterFrame = function () {
if (_root.player_on && (!_root.paused)) {
if (this.hitTest(_root.ship_0.hot_spot_en)) {
_root.PlayerHitted();
}
switch (this.action) {
case 0 :
this.victim = undefined;
this.y1 = this._y + this.dy;
if ((this.y1 > 80) && (this.y1 < 330)) {
this._y = this.y1;
}
if (Math.random() < 0.02) {
this.dy = ((Math.random() * 4) - 2) * _root.enemy_speed;
if (Math.random() < (0.5 * _root.en_shooting)) {
_root.EnShooting(this.x, this._y, this._x);
}
}
if (Math.random() < (0.004 * _root.pick_up_man)) {
this.ind = Math.floor(Math.random() * 10) + 1;
this.victim = eval ("_root.man_" + this.ind);
if (_root.AstroAr[this.ind] && (this.victim.action == 0)) {
_root.AstroAr[this.ind] = false;
this.action = 1;
}
}
this.x = _root.ToNewX(this.x, this.dx);
this._x = _root.ToGlobal(this.x);
return;
case 1 :
if (Math.random() < 0.01) {
_root.EnShooting(this.x, this._y, this._x);
}
this.ang = Math.atan2((this.victim._y - 15) - this._y, this.victim.x - this.x);
this._y = this._y + ((Math.sin(this.ang) * 4) * _root.enemy_speed);
this.dx = (Math.cos(this.ang) * 4) * _root.enemy_speed;
if (this.victim.action != 0) {
this.action = 0;
}
if (this.hitTest(this.victim)) {
_root.ShowMessage(true);
this.action = 2;
this.victim.action = 1;
this.victim.x = this.x;
if (_root.sound_on) {
_root.man_captured_sfx.start(0, 1);
}
}
this.x = _root.ToNewX(this.x, this.dx);
this._x = _root.ToGlobal(this.x);
return;
case 2 :
this.x = _root.ToNewX(this.x, 0);
this._x = _root.ToGlobal(this.x);
this._y = this._y - (2 * _root.enemy_speed);
if (this.victim._y < 20) {
this.action = 0;
_root.ShowMessage(false);
this.dx = ((Math.random() < 0.5) ? (-4 * _root.enemy_speed) : (4 * _root.enemy_speed));
}
if (this._y > 80) {
break;
}
removeMovieClip(eval ("_root.locator." + this._name));
this.victim.Destroy();
_root.EnemyAr[Number(this._name.slice(5))] = false;
_root.enemies_on = _root.enemies_on - 1;
_root.EnemyAttach(2, false, this.x, this._y);
this.action = 0;
_root.ShowMessage(false);
removeMovieClip(this);
}
}
};
Object.registerClass("lander", Lander);
Man.prototype = new MovieClip();
Man.prototype.Destroy = function () {
if (this.action == 1) {
_root.ShowMessage(false);
}
_root.max_astronauts = _root.max_astronauts - 1;
_root.astronauts = _root.astronauts - 1;
if (_root.astronauts <= 0) {
_root.PlanetDestroy();
}
removeMovieClip(eval ("_root.locator." + this._name));
_root.AttachBang(this._x, this._y);
removeMovieClip(this);
};
Man.prototype.onLoad = function () {
_root.astronauts = _root.astronauts + 1;
this.action = 0;
this.gotoAndPlay(Math.floor(Math.random() * 26));
if (Math.random() < 0.5) {
this.dx = -0.3;
} else {
this.dx = 0.3;
this._xscale = -100;
}
this._y = 370;
this.x = Math.random() * _root.x_dimension;
_root.locator.attachMovie("radar_dot", this._name, 2 + Number(this._name.slice(4)));
eval ("_root.locator." + this._name).gotoAndStop(8);
};
Man.prototype.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
if (!_local2.paused) {
switch (_local1.action) {
case 0 :
if (_local2.player_on) {
_local1.x = _local2.ToNewX(_local1.x, _local1.dx);
}
_local1._x = _local2.ToGlobal(_local1.x);
_local1.fall_from = 300;
return;
case 1 :
if (_local2.player_on) {
_local1.x = _local2.ToNewX(_local1.x, 0);
_local1._x = _local2.ToGlobal(_local1.x);
_local1._y = _local1._y - (2 * _local2.enemy_speed);
_local1.fall_from = _local1._y;
_local1.dy = 0;
}
return;
case 2 :
if (_local2.player_on) {
_local1.x = _local2.ToNewX(_local1.x, 0);
_local1._x = _local2.ToGlobal(_local1.x);
_local1._y = _local1._y + _local1.dy;
_local1.dy = _local1.dy + 0.05;
if (_local1.hitTest(_local2.ship_0)) {
_local2.Scoring(_local1._x, _local1._y, 500);
_local1.action = 3;
if (_local2.sound_on) {
_local2.man_taken_sfx.start(0, 1);
}
}
if (_local1._y >= 370) {
if (_local1.fall_from < 260) {
_local1.Destroy();
}
_local2.Scoring(_local1._x, _local1._y, 250);
_local1._y = 370;
_local1.action = 0;
_local2.AstroAr[Number(_local1._name.slice(4))] = true;
}
}
return;
case 3 :
if (!_local2.player_on) {
break;
}
_local1.x = _local2.ship_x + _local2.ship_0._x;
_local1._x = _local2.ship_0._x;
_local1._y = _local2.ship_0._y + 15;
if (_local1._y < 365) {
break;
}
_local2.Scoring(_local1._x, _local1._y, 500);
_local1._y = 370;
_local1.action = 0;
_local2.AstroAr[Number(_local1._name.slice(4))] = true;
}
}
};
Object.registerClass("man", Man);
Instance of Symbol 218 MovieClip in Frame 10
onClipEvent (load) {
this.swapDepths(10000);
}
Frame 11
function ShowMessage(abduction) {
if (abduction) {
_root.message.gotoAndStop(2);
} else {
var remove = true;
var i = 1;
while (i < 10) {
if (eval ("_root.ship_" + i).action == 2) {
remove = false;
i = 10;
}
i++;
}
if (remove) {
_root.message.gotoAndStop(1);
}
}
}
function CheckLevelFin() {
var _local1 = _root;
_local1.enemies_on = _local1.enemies_on - 1;
_local1.enemies_to_kill = ((_local1.enemies_to_kill == 0) ? 0 : (--_local1.enemies_to_kill));
if ((_local1.enemies_on <= 0) && (_local1.enemies_to_kill <= 0)) {
_local1.ship_0.turbine.stop();
_local1.gotoAndPlay("next_level");
}
}
function ExtraBomb() {
var _local1 = _root;
var _local2 = Math.floor(_local1.score / _local1.extra_bombs);
if (((_local2 + 1) >= (_local1.score / _local1.extra_bombs)) && (!_local1.ex_bomb_array[_local2])) {
_local1.ex_bomb_array[_local2] = true;
_local1.smartbombs = _local1.smartbombs + 1;
if (_local1.sound_on) {
_local1.extra_life_sfx.start(0, 1);
}
}
}
function ExtraLife() {
var _local1 = _root;
var _local2 = Math.floor(_local1.score / _local1.extra_points);
if (((_local2 + 1) >= (_local1.score / _local1.extra_points)) && (!_local1.ex_lives_array[_local2])) {
_local1.ex_lives_array[_local2] = true;
_local1.lives = _local1.lives + 1;
if (_local1.sound_on) {
_local1.extra_life_sfx.start(0, 1);
}
}
}
function RemoveAll() {
var s = 0;
while (s < 21) {
removeMovieClip(eval ("_root.comp_" + s));
removeMovieClip(eval ("_root.ship_" + s));
removeMovieClip(eval ("_root.shot_" + s));
removeMovieClip(eval ("_root.ensh_" + s));
removeMovieClip(eval ("_root.man_" + s));
removeMovieClip(eval ("_root.b_" + s));
removeMovieClip(eval ("_root.mine_" + s));
s++;
}
_root.ship_speed = 0;
_root.colTrans = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
_root.bigBangColor.setTransform(_root.colTrans);
}
function PlanetDestroy() {
var s = 1;
while (s < 10) {
eval ("_root.main_backgr.star_" + s)._y = 70 + (Math.random() * 290);
s++;
}
_root.globalBang = 30;
_root.planet_destroyed = true;
_root.mountain._visible = false;
_root.radar_1._visible = false;
_root.radar_2._visible = false;
var i = 0;
while (i < 6) {
_root.AttachBang((Math.random() * 400) + 75, (Math.random() * 250) + 100);
i++;
}
}
function LevelInit() {
var _local1 = _root;
_local1.level = _local1.level + 1;
_local1.EnemyAr = new Array(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
_local1.enemy_shots = 0;
_local1.bangs_count = 0;
_local1.mines_count = 0;
_local1.score_counter = 0;
_local1.ship_x = 0;
_local1.ship_speed = 0;
_local1.baiters_time = 800;
_local1.enemies_on = 0;
_local1.player_on = false;
_local1.hyperspace = false;
_local1.globalBang = 0;
_local1.EnemyAttach(0, false, 275, 210);
_local1.timer_enemy = 20;
_local1.enemies_to_kill = ((_local1.level - 1) * 5) + 15;
_local1.paused = false;
}
function GameInit() {
var _local1 = _root;
_local1.track_play = false;
_local1.splash_music.stop();
_local1.pick_up_man = 0.9;
_local1.enemy_speed = 1;
_local1.en_shooting = 1;
_local1.planet_destroyed = false;
_local1.max_speed = 24;
_local1.x_dimension = 2357.6;
_local1.smartbombs = 3;
_local1.lives = 3;
_local1.score = 0;
_local1.level = 0;
_local1.AstroAr = new Array(true, true, true, true, true, true, true, true, true, true, true);
_local1.ex_lives_array = new Array(true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
_local1.ex_bomb_array = new Array(true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
_local1.max_astronauts = 11;
}
function Scoring(x, y, score_inc) {
var _local1 = _root;
_local1.score = _local1.score + score_inc;
_local1.bubble = attachMovie("score_bubble", "sc_b_" + _local1.score_counter, _local1.score_counter + 70);
_local1.bubble._x = x;
_local1.bubble._y = y;
_local1.bubble.score = score_inc;
_local1.score_counter = _local1.score_counter + 1;
if (_local1.score_counter == 10) {
_local1.score_counter = 0;
}
_local1.ExtraLife();
_local1.ExtraBomb();
}
function RemoveAmmo() {
_root.colTrans = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
_root.bigBangColor.setTransform(_root.colTrans);
var a = 1;
while (a < 20) {
removeMovieClip(eval ("_root.ensh_" + a));
removeMovieClip(eval ("_root.mine_" + a));
a++;
}
var a = 1;
while (a < 16) {
var man = eval ("_root.man_" + a);
man._y = 370;
man.action = 0;
var ship = eval ("_root.ship_" + a);
if (ship.action > 0) {
ship.action = 0;
}
var dx = ((Math.random() < 0.5) ? (((-Math.random()) * 300) - 500) : ((Math.random() * 300) + 1000));
var x = _root.ToNewX(0, dx);
ship.x = x;
ship._y = (Math.random() * 100) + 100;
ship._x = 1000;
a++;
}
}
function PlBang() {
}
function PlayerHitted() {
var _local1 = _root;
if (_local1.player_on && (!_local1.hyperspace)) {
_local1.player_on = false;
_local1.ship_speed = 0;
_local1.message.gotoAndStop(1);
_local1.attachMovie("player_bang", "player_bang", 5);
_local1.player_bang._x = _local1.ship_0._x;
_local1.player_bang._y = _local1.ship_0._y;
_local1.ship_0._y = 210;
_local1.ship_0._x = 275;
_local1.ship_0.dy = 0;
if (_local1.sound_on) {
_local1.smart_sfx.start(0, 1);
}
_local1.lives = _local1.lives - 1;
if (_local1.lives == 0) {
delete _local1.onEnterFrame;
_local1.ship_0.turbine.stop();
_local1.gotoAndPlay("game_over");
}
}
}
function AttachBang(x, y) {
if (_root.sound_on) {
_root.blast_sfx.start(0, 1);
}
_root.attachMovie("bang", "b_" + _root.bangs_count, _root.bangs_count + 100);
eval ("_root.b_" + _root.bangs_count)._x = x;
eval ("_root.b_" + _root.bangs_count)._y = y;
_root.bangs_count = _root.bangs_count + 1;
if (_root.bangs_count > 19) {
_root.bangs_count = 0;
}
}
function AttachOnLevel(level) {
var _local1 = _root;
var _local2 = Math.random();
switch (level) {
case 0 :
_local1.EnemyAttach(3, true);
return;
case 1 :
if (!_local1.planet_destroyed) {
_local1.EnemyAttach(1, true);
} else {
_local1.EnemyAttach(2, true);
}
return;
case 2 :
if (_local2 < 0.7) {
if (!_local1.planet_destroyed) {
_local1.EnemyAttach(1, true);
} else {
_local1.EnemyAttach(2, true);
}
} else {
_local1.EnemyAttach(4, true);
}
return;
case 3 :
case 4 :
if (_local2 < 0.7) {
if (!_local1.planet_destroyed) {
_local1.EnemyAttach(1, true);
} else {
_local1.EnemyAttach(2, true);
}
} else if (_local2 < 0.85) {
_local1.EnemyAttach(4, true);
} else {
_local1.EnemyAttach(5, true);
}
return;
default :
if (_local2 < 0.6) {
if (!_local1.planet_destroyed) {
_local1.EnemyAttach(1, true);
} else {
_local1.EnemyAttach(2, true);
}
} else if (_local2 < 0.75) {
_local1.EnemyAttach(4, true);
} else if (_local2 < 0.9) {
_local1.EnemyAttach(5, true);
} else {
_local1.EnemyAttach(3, true);
}
}
}
function Mine() {
}
function EnemyAttach(type_enemy, randomly, x, y) {
if (type_enemy == 0) {
_root.locator.ship_0._visible = false;
_root.attachMovie("compile", "comp_" + j, 50 + j);
eval ("_root.comp_" + j).type_enemy = type_enemy;
eval ("_root.comp_" + j).ship_index = j;
eval ("_root.comp_" + j).x = x;
eval ("_root.comp_" + j).y = y;
}
if ((type_enemy > 0) && ((_root.enemies_to_kill > 0) || ((type_enemy == 2) && (!_root.planet_destroyed)))) {
var j = 1;
while (j < (_root.max_enemies + 1)) {
if (!_root.EnemyAr[j]) {
_root.EnemyAr[j] = true;
_root.attachMovie("compile", "comp_" + j, 50 + j);
eval ("_root.comp_" + j).type_enemy = type_enemy;
eval ("_root.comp_" + j).ship_index = j;
if (randomly) {
eval ("_root.comp_" + j).x = -10;
} else {
eval ("_root.comp_" + j).x = x;
eval ("_root.comp_" + j).y = y;
}
j = 20;
}
j++;
}
}
}
function Compile() {
}
function CompilePart() {
}
function EnShooting(x, y, screen_x) {
if ((screen_x > -10) && (screen_x < 560)) {
if (_root.sound_on) {
_root.en_shot_sfx.start(0, 1);
}
_root.attachMovie("enemy_shot", "ensh_" + _root.enemy_shots, _root.enemy_shots + 5000);
this.shoot = eval ("_root.ensh_" + _root.enemy_shots);
this.shoot.x = x;
this.shoot._y = y;
this.ang = Math.atan2(_root.ship_0._y - y, _root.ship_0._x - screen_x);
this.shoot.dx = 5 * Math.cos(this.ang);
this.shoot.dy = 5 * Math.sin(this.ang);
_root.enemy_shots = _root.enemy_shots + 1;
if (_root.enemy_shots == 20) {
_root.enemy_shots = 0;
}
}
}
function EnShot() {
}
function Bang() {
}
function BangPart() {
}
function PlShot() {
}
function SingleStar() {
}
PlBang.prototype = new MovieClip();
PlBang.prototype.onLoad = function () {
_root.locator.ship_0._visible = false;
_root.globalBang = 110;
var j = 1;
while (j < 10) {
this.attachMovie("bang_part", "bp_" + j, j);
if (eval ("_root.comp_" + j) != undefined) {
_root.EnemyAr[j] = false;
removeMovieClip(eval ("_root.comp_" + j));
}
j++;
}
};
PlBang.prototype.onEnterFrame = function () {
this._alpha = this._alpha - 4;
};
Object.registerClass("player_bang", PlBang);
Mine.prototype = new MovieClip();
Mine.prototype.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
if (!_local2.paused) {
if (_local1.hitTest(_local2.ship_0)) {
_local2.PlayerHitted();
}
_local1.x = _local2.ToNewX(_local1.x, 0);
_local1._x = _local2.ToGlobal(_local1.x);
}
};
Object.registerClass("mine", Mine);
Compile.prototype = new MovieClip();
Compile.prototype.onLoad = function () {
var _local1 = this;
var _local2 = _root;
if (_local1.x < 0) {
_local1.x = Math.random() * _local2.x_dimension;
_local1._y = (Math.random() * 100) + 100;
} else {
_local1._y = _local1.y;
}
_local1._alpha = 0;
j = 1;
while (j < 4) {
_local1.attachMovie("compile_part", "cp_" + j, j);
j++;
}
if ((_local2.ToGlobal(_local1.x) < 560) && (_local2.sound_on)) {
_local2.ship_appear.start(0, 1);
}
};
Compile.prototype.onEnterFrame = function () {
var _local1 = this;
_local1.x = _root.ToNewX(_local1.x, 0);
_local1._x = _root.ToGlobal(_local1.x);
_local1._alpha = _local1._alpha + 5;
};
Object.registerClass("compile", Compile);
CompilePart.prototype = new MovieClip();
CompilePart.prototype.onLoad = function () {
var _local1 = this;
_local1.rad = (Math.random() * 30) + 90;
_local1.ang = Math.random() * 6.28;
_local1._x = Math.cos(_local1.ang) * _local1.rad;
_local1._y = Math.sin(_local1.ang) * _local1.rad;
_local1.dv = (Math.random() * 8) + 16;
};
CompilePart.prototype.onEnterFrame = function () {
var _local1 = this;
if (!_root.paused) {
_local1.dx = _local1._x;
_local1.dy = _local1._y;
_local1._x = _local1._x - (_local1.dx / _local1.dv);
_local1._y = _local1._y - (_local1.dy / _local1.dv);
}
};
Object.registerClass("compile_part", CompilePart);
EnShot.prototype = new MovieClip();
EnShot.prototype.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
if (!_local2.paused) {
if (_local2.ship_0.hot_spot.hitTest(_local1._x, _local1._y, true)) {
_local2.PlayerHitted();
}
_local1.x = _local2.ToNewX(_local1.x, _local1.dx * _local2.en_shot_speed);
_local1._x = _local2.ToGlobal(_local1.x);
_local1._y = _local1._y + (_local1.dy * _local2.en_shot_speed);
if ((((_local1._x > 600) || (_local1._x < -50)) || (_local1._y > 410)) || (_local1._y < 60)) {
removeMovieClip(_local1);
}
}
};
Object.registerClass("enemy_shot", EnShot);
Bang.prototype = new MovieClip();
Bang.prototype.onLoad = function () {
var _local2 = this;
var _local1 = 1;
while (_local1 < 5) {
_local2.attachMovie("bang_part", "bp_" + _local1, _local1);
_local1++;
}
};
Bang.prototype.onEnterFrame = function () {
this._x = this._x - _root.ship_speed;
this._alpha = this._alpha - 4;
};
Object.registerClass("bang", Bang);
BangPart.prototype = new MovieClip();
BangPart.prototype.onLoad = function () {
var _local1 = this;
_local1.rad = (Math.random() * 8) + 8;
_local1.ang = Math.random() * 6.28;
_local1.dx = Math.cos(_local1.ang) * _local1.rad;
_local1.dy = Math.sin(_local1.ang) * _local1.rad;
};
BangPart.prototype.onEnterFrame = function () {
var _local1 = this;
if (!_root.paused) {
_local1._x = _local1._x + _local1.dx;
_local1._y = _local1._y + _local1.dy;
_local1.dx = _local1.dx * 0.9;
_local1.dy = (_local1.dy + 0.3) * 0.9;
}
};
Object.registerClass("bang_part", BangPart);
PlShot.prototype = new MovieClip();
PlShot.prototype.onLoad = function () {
var _local1 = this;
var _local2 = _root;
_local1.clr = new Color(_local1);
_local1.clr_trans = new Object();
_local1.clr_trig = Math.floor(Math.random() * 4);
switch (_local1.clr_trig) {
case 0 :
_local1.clr.setRGB(65535);
break;
case 1 :
_local1.clr.setRGB(65280);
break;
case 2 :
_local1.clr.setRGB(16776960);
break;
case 3 :
_local1.clr.setRGB(16755455);
}
if (_local2.ship_0._xscale < 0) {
_local1.dx = -30;
} else {
_local1.dx = 30;
}
_local1._x = _local2.ship_0._x - _local1.dx;
_local1._y = _local2.ship_0._y;
_local1._xscale = 0;
};
PlShot.prototype.onEnterFrame = function () {
if (!_root.paused) {
var i = 1;
while (i < 16) {
this.ship = eval ("_root.ship_" + i);
if (this.hitTest(this.ship)) {
this.ship.Destroy(false);
_root.EnemyAr[i] = false;
removeMovieClip(this);
}
this.man = eval ("_root.man_" + i);
if (this.hitTest(this.man)) {
this.man.Destroy();
removeMovieClip(this);
}
i++;
}
this._x = this._x + this.dx;
if ((this._x > 600) || (this._x < -50)) {
removeMovieClip(this);
}
if (this._width <= 100) {
this._xscale = this._xscale + this.dx;
}
}
};
Object.registerClass("player_shot", PlShot);
ToNewX = function (x, dx) {
var _local2 = _root;
var _local1 = x + dx;
if (_local1 < 0) {
_local1 = _local2.x_dimension + _local1;
}
if (_local1 > _local2.x_dimension) {
_local1 = _local1 - _local2.x_dimension;
}
return(_local1);
};
ToGlobal = function (local_x) {
var _local1 = (-_root.ship_x) + local_x;
if (_local1 < 0) {
var _local2 = _root.x_dimension + _local1;
} else {
var _local2 = _local1;
}
return(_local2);
};
ToRadarCoords = function (local_x) {
var _local3 = _root;
var _local1 = (((-_local3.ship_x) + local_x) / 10) + 245;
if (_local1 < 157) {
var _local2 = (_local3.x_dimension / 10) + _local1;
} else if (_local1 > 393) {
var _local2 = ((-_local3.x_dimension) / 10) + _local1;
} else {
var _local2 = _local1;
}
return(_local2);
};
SingleStar.prototype = new MovieClip();
SingleStar.prototype.onLoad = function () {
var _local1 = this;
_local1.gotoAndStop(Math.floor((Math.random() * 5) + 1));
_local1.ax = Math.random() + 1.2;
_local1._y = (Math.random() * 170) + 70;
_local1._x = (Math.random() * 500) + 25;
};
SingleStar.prototype.onEnterFrame = function () {
var _local1 = this;
if (!_root.paused) {
_local1._x = _local1._x - ((_local1.ax * _root.ship_speed) / 16);
if (_local1._x > 560) {
_local1._x = -5;
}
if (_local1._x < -10) {
_local1._x = 555;
}
}
};
Object.registerClass("star", SingleStar);
Frame 12
function hex_md5(s) {
return(binl2hex(core_md5(str2binl(s), s.length * chrsz)));
}
function b64_md5(s) {
return(binl2b64(core_md5(str2binl(s), s.length * chrsz)));
}
function str_md5(s) {
return(binl2str(core_md5(str2binl(s), s.length * chrsz)));
}
function hex_hmac_md5(key, data) {
return(binl2hex(core_hmac_md5(key, data)));
}
function b64_hmac_md5(key, data) {
return(binl2b64(core_hmac_md5(key, data)));
}
function str_hmac_md5(key, data) {
return(binl2str(core_hmac_md5(key, data)));
}
function md5_vm_test() {
return(hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72");
}
function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var i = 0;
while (i < x.length) {
var olda = a;
var oldb = _local3;
var oldc = _local2;
var oldd = _local1;
a = md5_ff(a, _local3, _local2, _local1, x[i + 0], 7, -680876936);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 1], 12, -389564586);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 2], 17, 606105819);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 3], 22, -1044525330);
a = md5_ff(a, _local3, _local2, _local1, x[i + 4], 7, -176418897);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 5], 12, 1200080426);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 6], 17, -1473231341);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 7], 22, -45705983);
a = md5_ff(a, _local3, _local2, _local1, x[i + 8], 7, 1770035416);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 9], 12, -1958414417);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 10], 17, -42063);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 11], 22, -1990404162);
a = md5_ff(a, _local3, _local2, _local1, x[i + 12], 7, 1804603682);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 13], 12, -40341101);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 14], 17, -1502002290);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 15], 22, 1236535329);
a = md5_gg(a, _local3, _local2, _local1, x[i + 1], 5, -165796510);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 6], 9, -1069501632);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 11], 14, 643717713);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 0], 20, -373897302);
a = md5_gg(a, _local3, _local2, _local1, x[i + 5], 5, -701558691);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 10], 9, 38016083);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 15], 14, -660478335);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 4], 20, -405537848);
a = md5_gg(a, _local3, _local2, _local1, x[i + 9], 5, 568446438);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 14], 9, -1019803690);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 3], 14, -187363961);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 8], 20, 1163531501);
a = md5_gg(a, _local3, _local2, _local1, x[i + 13], 5, -1444681467);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 2], 9, -51403784);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 7], 14, 1735328473);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 12], 20, -1926607734);
a = md5_hh(a, _local3, _local2, _local1, x[i + 5], 4, -378558);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 8], 11, -2022574463);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 11], 16, 1839030562);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 14], 23, -35309556);
a = md5_hh(a, _local3, _local2, _local1, x[i + 1], 4, -1530992060);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 4], 11, 1272893353);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 7], 16, -155497632);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 10], 23, -1094730640);
a = md5_hh(a, _local3, _local2, _local1, x[i + 13], 4, 681279174);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 0], 11, -358537222);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 3], 16, -722521979);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 6], 23, 76029189);
a = md5_hh(a, _local3, _local2, _local1, x[i + 9], 4, -640364487);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 12], 11, -421815835);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 15], 16, 530742520);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 2], 23, -995338651);
a = md5_ii(a, _local3, _local2, _local1, x[i + 0], 6, -198630844);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 7], 10, 1126891415);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 14], 15, -1416354905);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 5], 21, -57434055);
a = md5_ii(a, _local3, _local2, _local1, x[i + 12], 6, 1700485571);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 3], 10, -1894986606);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 10], 15, -1051523);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 1], 21, -2054922799);
a = md5_ii(a, _local3, _local2, _local1, x[i + 8], 6, 1873313359);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 15], 10, -30611744);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 6], 15, -1560198380);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 13], 21, 1309151649);
a = md5_ii(a, _local3, _local2, _local1, x[i + 4], 6, -145523070);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 11], 10, -1120210379);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 2], 15, 718787259);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 9], 21, -343485551);
a = safe_add(a, olda);
_local3 = safe_add(_local3, oldb);
_local2 = safe_add(_local2, oldc);
_local1 = safe_add(_local1, oldd);
i = i + 16;
}
return(Array(a, _local3, _local2, _local1));
}
function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
function md5_ff(a, b, c, d, x, s, t) {
var _local1 = b;
return(md5_cmn((_local1 & c) | ((~_local1) & d), a, _local1, x, s, t));
}
function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
function core_hmac_md5(key, data) {
var _local2 = str2binl(key);
if (_local2.length > 16) {
_local2 = core_md5(_local2, key.length * chrsz);
}
var _local3 = Array(16);
var opad = Array(16);
var _local1 = 0;
while (_local1 < 16) {
_local3[_local1] = _local2[_local1] ^ 909522486;
opad[_local1] = _local2[_local1] ^ 1549556828;
_local1++;
}
var hash = core_md5(_local3.concat(str2binl(data)), 512 + (data.length * chrsz));
return(core_md5(opad.concat(hash), 640));
}
function safe_add(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function str2binl(str) {
var _local2 = str;
var _local3 = Array();
var mask = ((1 << chrsz) - 1);
var _local1 = 0;
while (_local1 < (_local2.length * chrsz)) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((_local2.charCodeAt(_local1 / chrsz) & mask) << (_local1 % 32));
_local1 = _local1 + chrsz;
}
return(_local3);
}
function binl2str(bin) {
var _local2 = bin;
var _local3 = "";
var mask = ((1 << chrsz) - 1);
var _local1 = 0;
while (_local1 < (_local2.length * 32)) {
_local3 = _local3 + String.fromCharCode((_local2[_local1 >> 5] >>> (_local1 % 32)) & mask);
_local1 = _local1 + chrsz;
}
return(_local3);
}
function binl2hex(binarray) {
var _local2 = binarray;
var _local3 = (hexcase ? "0123456789ABCDEF" : "0123456789abcdef");
var str = "";
var _local1 = 0;
while (_local1 < (_local2.length * 4)) {
str = str + (_local3.charAt((_local2[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((_local2[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(str);
}
function binl2b64(binarray) {
var _local3 = binarray;
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str = "";
var _local2 = 0;
while (_local2 < (_local3.length * 4)) {
var triplet = (((((_local3[_local2 >> 2] >> (8 * (_local2 % 4))) & 255) << 16) | (((_local3[(_local2 + 1) >> 2] >> (8 * ((_local2 + 1) % 4))) & 255) << 8)) | ((_local3[(_local2 + 2) >> 2] >> (8 * ((_local2 + 2) % 4))) & 255));
var _local1 = 0;
while (_local1 < 4) {
if (((_local2 * 8) + (_local1 * 6)) > (_local3.length * 32)) {
str = str + b64pad;
} else {
str = str + tab.charAt((triplet >> (6 * (3 - _local1))) & 63);
}
_local1++;
}
_local2 = _local2 + 3;
}
return(str);
}
_root.score = 0;
if ((!_root.track_play) && (_root.sound_on)) {
_root.track_play = true;
_root.splash_music.start(0, 99999);
}
stop();
var hexcase = 0;
var b64pad = "";
var chrsz = 8;
first_play = SharedObject.getLocal("cosmic_defender");
if (first_play.data.played != "true") {
first_play.data.played = "true";
first_play.flush();
_root.gotoAndPlay("instructions");
}
Frame 13
stop();
Frame 14
stop();
Frame 19
stop();
Instance of Symbol 116 MovieClip in Frame 19
onClipEvent (enterFrame) {
if (_root.sound_on) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 128 MovieClip in Frame 19
onClipEvent (enterFrame) {
if (_quality == "LOW") {
gotoAndStop (1);
} else if (_quality == "MEDIUM") {
gotoAndStop (2);
} else {
gotoAndStop (3);
}
}
Frame 22
_root.GameInit();
Frame 23
_root.LevelInit();
_root.astronauts = 0;
i = 1;
while (i < _root.max_astronauts) {
_root.attachMovie("man", "man_" + i, i + 10);
i++;
}
_root.onEnterFrame = function () {
if (!_root.paused) {
if ((_root.baiters_time < 0) && (_root.player_on)) {
_root.AttachOnLevel(0);
_root.baiters_time = 400;
} else {
_root.baiters_time = _root.baiters_time - 1;
}
if (_root.hyperspace) {
_root.ship_speed = 0;
_root.hyper_d = _root.ship_x - _root.hyper_x;
_root.ship_0._x = 275;
_root.ship_0._xscale = (-_root.hyper_d) * 5;
_root.ship_0._alpha = 20000 / Math.abs(_root.hyper_d * 5);
_root.ship_x = _root.ship_x - (_root.hyper_d / 6);
if (Math.abs(_root.hyper_d) < 20) {
_root.ship_0._xscale = ((_root.hyper_d < 0) ? 100 : -100);
_root.ship_0._alpha = 100;
_root.ship_0.to_y = _root.ship_0._y;
_root.hyperspace = false;
if (!_root.player_on) {
_root.EnemyAttach(0, false, 275, 210);
}
}
}
if (_root.globalBang > 0) {
if (_root.globalBang < 100) {
_root.bigBangColor = new Color(_root);
_root.colTrans = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
_root.colTrans.rb = _root.globalBang * 25;
_root.bigBangColor.setTransform(_root.colTrans);
_root._x = (Math.random() - 0.5) * _root.globalBang;
_root._y = (Math.random() - 0.5) * _root.globalBang;
_root.globalBang = _root.globalBang - 1;
if (_root.globalBang == 0) {
_root._x = 0;
_root._y = 0;
_root.colTrans = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
_root.bigBangColor.setTransform(_root.colTrans);
}
} else {
_root._x = (Math.random() - 0.5) * (_root.globalBang - 100);
_root._y = (Math.random() - 0.5) * (_root.globalBang - 100);
_root.globalBang = _root.globalBang - 1;
if (_root.globalBang == 100) {
_root._x = 0;
_root._y = 0;
_root.globalBang = 0;
}
}
}
if (_root.timer_enemy <= 0) {
if (_root.player_on) {
_root.AttachOnLevel(_root.level);
}
_root.timer_enemy = (Math.random() * 30) + _root.en_appear_time;
} else {
_root.timer_enemy = _root.timer_enemy - 1;
}
j = 0;
while (j < 16) {
dot = eval ("_root.locator.man_" + j);
dot._x = _root.ToRadarCoords(eval ("_root.man_" + j).x);
dot._y = (eval ("_root.man_" + j)._y / 10) + 7;
dot = eval ("_root.locator.ship_" + j);
dot._x = _root.ToRadarCoords(eval ("_root.ship_" + j).x);
dot._y = (eval ("_root.ship_" + j)._y / 10) + 7;
j++;
}
_root.mountain._x = -_root.ship_x;
_root.radar_1._x = (-(_root.ship_x - 130)) / 10;
_root.radar_2._x = (-(_root.ship_x - 4845)) / 10;
}
};
stop();
Instance of Symbol 280 MovieClip "main_backgr" in Frame 23
onClipEvent (load) {
i = 1;
while (i < 10) {
this.attachMovie("star", "star_" + i, i);
i++;
}
}
Instance of Symbol 282 MovieClip "mountain" in Frame 23
onClipEvent (load) {
if (_root.planet_destroyed) {
this._visible = false;
}
}
Instance of Symbol 282 MovieClip "radar_1" in Frame 23
onClipEvent (load) {
if (_root.planet_destroyed) {
this._visible = false;
}
}
Instance of Symbol 282 MovieClip "radar_2" in Frame 23
onClipEvent (load) {
if (_root.planet_destroyed) {
this._visible = false;
}
}
Instance of Symbol 287 MovieClip "ship_0" in Frame 23
onClipEvent (load) {
this.turbine.stop();
this.turbine = new Sound(this);
this.turbine.attachSound("turbine_sfx");
this.turbine.setVolume(0);
this.turbine.start(0, 18000);
this._visible = false;
this.dy = 0;
this.to_y = this._y;
this.bullets = 0;
_root.locator.attachMovie("radar_dot", "ship_0", 0);
_root.locator.ship_0.gotoAndStop(9);
}
onClipEvent (enterFrame) {
if ((!_root.paused) && (_root.sound_on)) {
this.turbine.setVolume(Math.abs(_root.ship_speed * 2) + 4);
} else {
this.turbine.setVolume(0);
}
if ((_root.player_on && (!_root.hyperspace)) && (!_root.paused)) {
this._visible = true;
if (Key.isDown(68)) {
if (_root.sound_on) {
_root.hyperjump.start(0, 1);
}
this.hyper_dx = (Math.random() * 500) + 700;
this.hyper_dx = ((Math.random() < 0.5) ? (this.hyper_dx) : (-this.hyper_dx));
_root.hyper_x = _root.ToNewX(_root.ship_x, this.hyper_dx);
_root.hyperspace = true;
}
if ((Key.isDown(83) && (_root.globalBang == 0)) && (_root.smartbombs > 0)) {
_root.globalBang = 13;
if (_root.sound_on) {
_root.smart_sfx.start(0, 1);
}
_root.smartbombs = _root.smartbombs - 1;
_root.bombs.gotoAndStop(_root.smartbombs + 1);
i = 1;
while (i < 16) {
this.ship = eval ("_root.ship_" + i);
if (this.ship && (this.ship._x < 550)) {
this.ship.Destroy(true);
_root.EnemyAr[i] = false;
}
i++;
}
}
if ((Key.isDown(65) || (Key.isDown(32))) && (this.glow._currentframe == 1)) {
this.glow.play();
if (_root.sound_on) {
_root.pl_shot_sfx.start(0, 1);
}
_root.attachMovie("player_shot", "shot_" + this.bullets, this.bullets + 3000);
this.bullets = this.bullets + 1;
if (this.bullets > 9) {
this.bullets = 0;
}
}
this.flame._alpha = Math.abs(_root.ship_speed) * 5;
this.flame._xscale = Math.abs(_root.ship_speed) * 8;
_root.ship_x = _root.ship_x + _root.ship_speed;
_root.ship_speed = _root.ship_speed * 0.98;
this.to_x = ((-_root.ship_speed) * 10) + 275;
this.x = (_root.ship_x + 30) + this.to_x;
if (_root.ship_x < 0) {
_root.temp_dx = _root.x_dimension % _root.ship_speed;
_root.ship_x = _root.x_dimension - _root.temp_dx;
}
if (_root.ship_x > _root.x_dimension) {
_root.temp_dx = _root.x_dimension % _root.ship_speed;
_root.ship_x = _root.temp_dx;
}
if (Key.isDown(37)) {
_root.ship_speed = _root.ship_speed - 2;
this._xscale = -100;
}
if (Key.isDown(39)) {
_root.ship_speed = _root.ship_speed + 2;
this._xscale = 100;
}
if (_root.ship_speed > _root.max_speed) {
_root.ship_speed = _root.max_speed;
}
if (_root.ship_speed < (-_root.max_speed)) {
_root.ship_speed = -_root.max_speed;
}
this.to_y = this.to_y + (12 * (Key.isDown(40) - Key.isDown(38)));
if (this.to_y > 370) {
this.to_y = 370;
}
if (this.to_y < 80) {
this.to_y = 80;
}
this._y = this._y - ((this._y - this.to_y) / 3);
this._x = this._x - ((this._x - this.to_x) / 7);
} else if ((!_root.hyperspace) && (!_root.paused)) {
this._visible = false;
}
}
onClipEvent (keyDown) {
if (Key.isDown(80)) {
if (!_root.paused) {
_root.paused = true;
s = 1;
while (s < 16) {
this.compile_stop = eval ("_root.comp_" + s).stop();
s++;
}
s = 0;
while (s < 20) {
this.ship_stop = eval ("_root.ship_" + s).stop();
this.shot_stop = eval ("_root.shot_" + s).stop();
this.man_stop = eval ("_root.man_" + s).stop();
this.bang_stop = eval ("_root.b_" + s).stop();
this.mine_stop = eval ("_root.mine_" + s).stop();
s++;
}
_root.attachMovie("pause_clip", "pause_clip", 9999);
_root.pause_clip._x = 275;
_root.pause_clip._y = 200;
} else {
removeMovieClip("_root.pause_clip");
s = 1;
while (s < 20) {
eval ("_root.comp_" + s).play();
eval ("_root.ship_" + s).gotoAndPlay(2);
eval ("_root.shot_" + s).gotoAndPlay(2);
eval ("_root.man_" + s).play();
eval ("_root.b_" + s).play();
eval ("_root.mine_" + s).gotoAndPlay(2);
s++;
}
_root.paused = false;
}
}
}
Frame 24
delete _root.onEnterFrame;
_root.RemoveAll();
_root.tip_str = _root.tip_array[Math.floor(Math.random() * tip_array.length)];
stop();
Frame 25
prevFrame();
Frame 26
delete _root.onEnterFrame;
_root.ShowMessage(false);
_root.RemoveAll();
_root.enemy_speed = _root.enemy_speed + 0.1;
_root.en_shooting = _root.en_shooting + 0.1;
_root.pick_up_man = _root.pick_up_man + 0.1;
if (_root.astronauts > 0) {
_root.bonus_txt = "BONUS x100";
} else {
_root.bonus_txt = "NO BONUS";
}
stop();
Symbol 7 MovieClip Frame 1
var gameBytesTotal = 0;
var gameBytesLoaded = 0;
var percent = 0;
Symbol 7 MovieClip Frame 3
gameBytesTotal = _root.getBytesTotal();
gameBytesLoaded = _root.getBytesLoaded();
percent = Math.round((gameBytesLoaded / gameBytesTotal) * 100);
bar.loadbar._xscale = percent;
if (((gameBytesLoaded >= gameBytesTotal) && (gameBytesTotal > 0)) && (_root.logo._currentframe >= _root.logo._totalframes)) {
_root.gotoAndPlay("startgame");
stop();
} else {
gotoAndPlay ("preload");
}
Symbol 10 Button
on (press) {
getURL (_root.main_link, "_blank");
}
Symbol 80 MovieClip Frame 1
_root.loading._visible = false;
Symbol 80 MovieClip Frame 207
_root.loading._visible = true;
stop();
Symbol 93 Button
on (press) {
delete _root.onEnterFrame;
_root.ship_0.turbine.stop();
_root.RemoveAll();
_root.gotoAndPlay("main_menu");
removeMovieClip(this);
}
Symbol 97 Button
on (press) {
s = 1;
while (s < 20) {
this.compile_stop = eval ("_root.comp_" + s).play();
this.ship_stop = eval ("_root.ship_" + s).play();
this.shot_stop = eval ("_root.shot_" + s).play();
this.man_stop = eval ("_root.man_" + s).play();
this.bang_stop = eval ("_root.b_" + s).play();
this.mine_stop = eval ("_root.mine_" + s).play();
s++;
}
_root.paused = false;
removeMovieClip(this);
}
Symbol 101 Button
on (press) {
getURL (_root.main_link, "_blank");
}
Symbol 105 Button
on (press) {
getURL (_root.get_game_link, "_blank");
}
Symbol 109 Button
on (press) {
getURL (_root.download_link, "_blank");
}
Symbol 113 Button
on (press) {
getURL (_root.viewscores_link, "_blank");
}
Symbol 120 Button
on (press) {
if (_root.sound_on) {
_root.sound_on = false;
} else {
_root.sound_on = true;
}
}
Symbol 124 Button
on (press) {
if (_quality == "HIGH") {
_quality = "LOW";
} else if (_quality == "MEDIUM") {
_quality = "HIGH";
} else {
_quality = "MEDIUM";
}
}
Instance of Symbol 116 MovieClip in Symbol 129 MovieClip [pause_clip] Frame 1
onClipEvent (enterFrame) {
if (_root.sound_on) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 128 MovieClip in Symbol 129 MovieClip [pause_clip] Frame 1
onClipEvent (enterFrame) {
if (_quality == "LOW") {
gotoAndStop (1);
} else if (_quality == "MEDIUM") {
gotoAndStop (2);
} else {
gotoAndStop (3);
}
}
Symbol 144 MovieClip [bomber] Frame 2
stop();
Symbol 148 MovieClip [baiter] Frame 16
gotoAndPlay (2);
Symbol 155 MovieClip [lander] Frame 21
gotoAndPlay (2);
Symbol 164 MovieClip [mutant] Frame 21
gotoAndPlay (2);
Symbol 166 MovieClip [pod] Frame 114
gotoAndPlay (2);
Symbol 173 MovieClip [swarmer] Frame 2
stop();
Symbol 177 MovieClip [enemy_shot] Frame 7
gotoAndPlay (2);
Symbol 182 MovieClip [mine] Frame 150
if (this._x < 560) {
_root.AttachBang(this._x, this._y);
if (_root.sound_on) {
_root.blast_sfx.start(0, 1);
}
}
removeMovieClip(this);
Symbol 191 MovieClip [bang] Frame 29
removeMovieClip(this);
Symbol 195 MovieClip [compile] Frame 44
switch (this.type_enemy) {
case 0 :
_root.locator.ship_0._visible = true;
_root.player_on = true;
_root.hyperspace = false;
break;
case 1 :
this.type_of_ship = "lander";
break;
case 2 :
this.type_of_ship = "mutant";
break;
case 3 :
this.type_of_ship = "baiter";
break;
case 4 :
this.type_of_ship = "bomber";
break;
case 5 :
this.type_of_ship = "pod";
}
_root.attachMovie(this.type_of_ship, "ship_" + this.ship_index, this.ship_index + 30);
this.ship = eval ("_root.ship_" + this.ship_index);
this.ship.x = this.x;
this.ship._y = this._y;
removeMovieClip(this);
Symbol 197 MovieClip [player_bang] Frame 55
_root.RemoveAmmo();
_root.hyper_x = 0;
_root.hyperspace = true;
removeMovieClip(this);
Symbol 200 MovieClip [score_bubble] Frame 21
removeMovieClip(this);
Symbol 226 Button
on (press, keyPress "<Enter>") {
_root.gotoAndPlay("game_start");
}
Symbol 230 Button
on (press) {
_root.gotoAndPlay("instructions");
}
Symbol 232 Button
on (press) {
getURL (_root.main_link, "_blank");
}
Symbol 236 Button
on (press) {
_root.gotoAndPlay("options");
}
Symbol 240 Button
on (press) {
_root.gotoAndPlay("credits");
}
Symbol 248 Button
on (press) {
_root.gotoAndPlay("main_menu");
}
Symbol 254 Button
on (press) {
getURL (_root.main_link, "_blank");
}
Symbol 255 MovieClip Frame 1
stop();
Symbol 274 Button
on (press) {
_root.nextFrame();
}
Symbol 278 Button
on (press) {
_root.prevFrame();
}
Symbol 279 Button
on (press) {
if (_root.sound_on) {
_root.splash_music.stop();
_root.sound_on = false;
} else {
_root.track_play = true;
_root.splash_music.start(0, 99999);
_root.sound_on = true;
}
}
Symbol 286 MovieClip Frame 1
stop();
Symbol 290 Button
on (press) {
_root.paused = true;
s = 1;
while (s < 16) {
this.compile_stop = eval ("_root.comp_" + s).stop();
s++;
}
s = 0;
while (s < 20) {
this.ship_stop = eval ("_root.ship_" + s).stop();
this.shot_stop = eval ("_root.shot_" + s).stop();
this.man_stop = eval ("_root.man_" + s).stop();
this.bang_stop = eval ("_root.b_" + s).stop();
this.mine_stop = eval ("_root.mine_" + s).stop();
s++;
}
_root.attachMovie("pause_clip", "pause_clip", 9999);
_root.pause_clip._x = 275;
_root.pause_clip._y = 200;
}
Symbol 297 Button
on (press) {
getURL (_root.main_link, "_blank");
}
Symbol 301 MovieClip Frame 1
stop();
Symbol 301 MovieClip Frame 2
stop();
Symbol 330 Button
on (press) {
var hashkey = hex_md5(("gameid=794&hiscore=" + _root.score) + "2DPlay.com/");
getURL (String(((_root.scores_link + _root.score) + "&hash=") + hashkey), "_blank");
}
Symbol 334 Button
on (press) {
_root.GameInit();
_root.gotoAndPlay("game_start");
}
Symbol 342 Button
on (press, keyPress "<Enter>") {
_root.gotoAndPlay("start_level");
}
Symbol 343 MovieClip Frame 1
counter = 0;
_root.man_score = "";
if (_root.astronauts > 0) {
gotoAndPlay (2);
} else {
gotoAndStop (26);
}
Symbol 343 MovieClip Frame 20
this.attachMovie("man_end_wave", "man_" + counter, counter);
eval ("this.man_" + counter)._x = counter * 17;
_root.score = _root.score + 100;
_root.ExtraLife();
_root.ExtraBomb();
_root.man_score = _root.score;
if (_root.sound_on) {
_root.man_captured_sfx.start(0, 1);
}
Symbol 343 MovieClip Frame 25
if (counter == (_root.max_astronauts - 2)) {
gotoAndStop (26);
} else {
counter = counter + 1;
gotoAndPlay (20);
}
Symbol 343 MovieClip Frame 26
stop();