Frame 1
stop();
Stage.showMenu = false;
this.onEnterFrame = function () {
sofar = this.getBytesLoaded();
total = this.getBytesTotal();
pc_txt.text = int((sofar / total) * 100) + "%";
if (sofar == total) {
delete this.onEnterFrame;
gotoAndStop (2);
}
};
Instance of Symbol 32 MovieClip in Frame 2
onClipEvent (load) {
var a = 0;
this._alpha = a;
time1 = 0;
achange = 2;
}
onClipEvent (enterFrame) {
a = a + achange;
this._alpha = a;
if (a >= 95) {
if (time1 == 0) {
time1 = getTimer();
achange = 0;
} else if ((getTimer() - time1) > 2000) {
achange = -2;
}
}
if ((a <= 0) and (time1 != 0)) {
_root.play();
}
}
Frame 4
currentLevel = 1;
stop();
String.prototype.addCommas = function () {
var len = this.length;
var str = "";
var i = 0;
while (i <= len) {
str = this.charAt(len - i) + str;
if ((((i % 3) == 0) && (i > 0)) && (i < len)) {
str = "," + str;
}
i++;
}
return(str);
};
score = 0;
gameOver = true;
rnd = Math.random;
play_btn.onRelease = function () {
play();
};
neave_btn.onRelease = function () {
getURL ("http://www.endbossgames.com", "_blank");
};
Key.removeListener(keyListener);
keyListener = new Object();
keyListener.onKeyDown = function () {
if (gameOver_mc._visible) {
return(undefined);
}
if (gameOver) {
return(undefined);
}
if (Key.isDown(80)) {
if (quitGame_mc._visible) {
return(undefined);
}
paused = !paused;
if (paused) {
pause_mc.play();
var n = 4;
while (n > 0) {
_root[("fire" + n) + "_mc"].stop();
n--;
}
} else {
pause_mc.stop();
var n = 4;
while (n > 0) {
_root[("fire" + n) + "_mc"].play();
n--;
}
}
pause_mc._visible = paused;
alien_mc._alpha = (paused ? 15 : 100);
if (ufo_mc._visible) {
ufoSound_mc.gotoAndStop(Number(!paused) + 1);
}
}
if (Key.isDown(81)) {
var n = 4;
while (n > 0) {
_root[("fire" + n) + "_mc"].stop();
n--;
}
pause_mc.stop();
pause_mc._visible = false;
quitGame_mc._visible = (paused = true);
alien_mc._alpha = 15;
ufoSound_mc.gotoAndStop(1);
}
if (!quitGame_mc._visible) {
return(undefined);
}
if (Key.isDown(78)) {
quitGame_mc._visible = (paused = false);
alien_mc._alpha = 100;
if (ufo_mc._visible) {
ufoSound_mc.gotoAndStop(2);
}
var n = 4;
while (n > 0) {
_root[("fire" + n) + "_mc"].play();
n--;
}
}
if (Key.isDown(89)) {
gotoAndStop (2);
}
};
Key.addListener(keyListener);
Frame 5
map1 = [[1, 1, 2, 2, 3, 3, 2, 2, 1, 1], [0, 1, 1, 2, 2, 2, 2, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1, 1, 0, 0, 0], [0, 0, 0, 0, 1, 1, 0, 0, 0, 0]];
map2 = [[0, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 2, 2, 2, 2, 2, 2, 1, 0], [0, 1, 2, 3, 3, 3, 3, 2, 1, 0], [1, 1, 2, 2, 2, 2, 2, 2, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
map4 = [[0, 3, 0, 3, 0, 0, 3, 0, 3, 0], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 1, 0, 1, 1, 0, 1, 0, 1]];
map5 = [[3, 0, 0, 3, 0, 0, 3, 0, 0, 3], [0, 3, 3, 0, 3, 3, 0, 3, 3, 0], [0, 0, 2, 1, 0, 0, 1, 2, 0, 0], [2, 1, 2, 1, 2, 2, 1, 2, 1, 2], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
map6 = [[0, 0, 0, 0, 3, 3, 0, 0, 0, 0], [2, 2, 2, 3, 3, 3, 3, 2, 2, 2], [0, 0, 3, 3, 1, 1, 3, 3, 0, 0], [0, 3, 3, 1, 1, 1, 1, 3, 3, 0], [3, 3, 0, 0, 0, 0, 0, 0, 3, 3]];
map7 = [[3, 1, 2, 1, 3, 3, 1, 2, 1, 3], [2, 3, 1, 3, 2, 2, 3, 1, 3, 2], [1, 2, 3, 2, 1, 1, 2, 3, 2, 1], [0, 1, 2, 1, 0, 0, 1, 2, 1, 0], [0, 0, 1, 0, 0, 0, 0, 1, 0, 0]];
map8 = [[1, 3, 3, 1, 1, 1, 1, 3, 3, 1], [1, 3, 3, 1, 0, 0, 1, 3, 3, 1], [1, 2, 2, 1, 0, 0, 1, 2, 2, 1], [1, 2, 2, 1, 0, 0, 1, 2, 2, 1], [1, 1, 1, 1, 0, 0, 1, 1, 1, 1]];
map9 = [[3, 1, 3, 3, 2, 2, 3, 3, 1, 3], [0, 1, 0, 0, 2, 2, 0, 0, 1, 0], [3, 1, 3, 3, 1, 1, 3, 3, 1, 3], [0, 1, 0, 0, 1, 1, 0, 0, 1, 0], [3, 1, 0, 0, 1, 1, 0, 0, 1, 3]];
map10 = [[0, 3, 3, 0, 3, 3, 0, 3, 3, 0], [1, 3, 3, 0, 3, 3, 0, 3, 3, 1], [1, 0, 0, 3, 2, 2, 3, 0, 0, 1], [1, 3, 3, 0, 3, 3, 0, 3, 3, 1], [0, 3, 3, 0, 3, 3, 0, 3, 3, 0]];
map0 = [[2, 3, 3, 2, 2, 2, 2, 3, 3, 2], [0, 3, 3, 0, 0, 0, 0, 3, 3, 0], [1, 0, 1, 1, 1, 1, 1, 1, 0, 1], [1, 1, 0, 1, 1, 1, 1, 0, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
_root.totalLevels = 10;
_root.base_speed = 6;
_root.laser_speed = 12;
setLives = function () {
var i = 8;
while (i > 0) {
_root[("life" + i) + "_mc"]._visible = lives >= i;
i--;
}
};
setScore = function () {
score_txt.text = String(score).addCommas();
};
resetLaser = function () {
laser_mc._visible = false;
laser_mc._y = laser_mc.yPos;
};
makeAlien = function (i) {
alien_mc.createEmptyMovieClip(i, i);
alien_mc[i]._y = ((i * 36) + playTop) + 1;
switch (n) {
case 1 :
var val = 40;
break;
case 2 :
var val = 20;
break;
default :
var val = 10;
}
var j = 0;
while (j < 11) {
n = _root["map" + (_root.currentLevel % _root.totalLevels)][i][j];
if (n >= 1) {
var val = (10 * n);
if ((n > 1) and (_root.currentLevel > 5)) {
var lives = 1;
if (_root.currentLevel > 10) {
if (n == 3) {
lives = int(_root.currentLevel / 5);
}
}
} else {
var lives = 0;
}
alien_mc[i].attachMovie("alien" + n, j, j, {_x:((j * 36) + playMin) + 53, val:val, lives:lives});
}
j++;
}
};
laser_mc.onEnterFrame = function () {
if (paused) {
return(undefined);
}
if (this._visible) {
if (this._y < 50) {
this._visible = false;
}
this._y = this._y - laser_speed;
}
};
base_mc.onEnterFrame = function () {
if (((paused || (newLife)) || (gameOver)) || (this._currentframe > 1)) {
return(undefined);
}
if (Key.isDown(39) && (this._x < 480)) {
this._x = this._x + _root.base_speed;
} else if (Key.isDown(37) && (this._x > 20)) {
this._x = this._x - _root.base_speed;
}
if (Key.isDown(32) && (!laser_mc._visible)) {
fireSound_mc.play();
laser_mc._x = this._x;
laser_mc._y = laser_mc.yPos;
laser_mc._visible = true;
}
};
fire1_mc._visible = (fire2_mc._visible = (fire3_mc._visible = (fire4_mc._visible = false)));
laser_mc.yPos = laser_mc._y;
laser_mc._visible = false;
quitGame_mc._visible = false;
pause_mc._visible = false;
pause_mc.stop();
moveDown = false;
downSpeed = 14;
lives = 3;
setLives();
score = 0;
setScore();
playMax = 480;
playMin = 20;
playTop = 90;
playBtm = 64 + (downSpeed * 8);
loopy = function () {
if (paused || (newLife)) {
return(undefined);
}
if ((_root.base_speed == 12) and ((getTimer() - _root.base_speed_timer) > 8000)) {
_root.base_speed = 6;
}
if ((_root.laser_speed == 24) and ((getTimer() - _root.laser_speed_timer) > 8000)) {
_root.laser_speed = 12;
}
for (var i in alien_mc) {
for (var j in alien_mc[i]) {
var a_mc = alien_mc[i][j];
if ((typeof(a_mc) == "movieclip") && (a_mc.hitTest(laser_mc))) {
a_mc.lives--;
if (a_mc.lives < 0) {
explode_mc._x = Number(a_mc._x) + Number(a_mc._parent._x);
explode_mc._y = Number(a_mc._y) + Number(a_mc._parent._y);
explode_mc.gotoAndPlay(2);
if (random(10) > 8) {
var f_mc = _root.fire4_mc;
if (!f_mc._visible) {
f_mc._x = Number(a_mc._x) + Number(a_mc._parent._x);
f_mc._y = (Number(a_mc._y) + Number(a_mc._parent._y)) + 8;
f_mc._visible = true;
f_mc.bonus.gotoAndStop(random(4) + 1);
f_mc.gotoAndPlay(2);
}
}
score = score + a_mc.val;
setScore();
dead++;
a_mc.removeMovieClip();
} else {
a_mc.shot.gotoAndPlay(15);
}
resetLaser();
break;
}
}
}
if (ufo_mc._visible && (ufo_mc._currentframe == 1)) {
if (ufo_mc.hitTest(laser_mc)) {
ufoSound_mc.gotoAndStop(1);
ufo_mc.gotoAndPlay(2);
resetLaser();
}
}
rate = (1000 - speed) - dead;
if (rate < 0) {
rate = 0;
}
var n = 4;
while (n > 0) {
var f_mc = _root[("fire" + n) + "_mc"];
if (f_mc._visible) {
with (f_mc) {
_y = _y + 6;
if (_y > 420) {
_visible = false;
}
}
if (f_mc._y > 320) {
if (base_mc.hitTest(f_mc)) {
if (n < 4) {
f_mc._visible = (laser_mc._visible = (ufo_mc._visible = false));
fire1_mc._visible = (fire2_mc._visible = (fire3_mc._visible = (fire4_mc._visible = false)));
resetLaser();
ufo_mc.gotoAndStop(1);
ufoSound_mc.gotoAndStop(1);
base_mc.gotoAndPlay(2);
newLife = true;
lives--;
if (lives < 1) {
gameOver = true;
gotoAndStop (43);
delete this.onEnterFrame;
return(undefined);
}
} else {
f_mc._visible = false;
if (f_mc.bonus._currentframe == 1) {
_root.score = _root.score + 300;
_root.setScore();
_root.bonus_score._x = f_mc._x;
_root.bonus_score._y = _root.base_mc._y + 8;
_root.bonus_score.gotoAndPlay(2);
} else if (f_mc.bonus._currentframe == 3) {
speed = speed - 100;
_root.bonus_slowdown._x = f_mc._x;
_root.bonus_slowdown._y = _root.base_mc._y + 8;
_root.bonus_slowdown.gotoAndPlay(2);
} else if (f_mc.bonus._currentframe == 4) {
_root.base_speed = 12;
_root.bonus_speed._x = f_mc._x;
_root.bonus_speed._y = _root.base_mc._y + 8;
_root.bonus_speed.gotoAndPlay(2);
_root.base_speed_timer = getTimer();
} else if (f_mc.bonus._currentframe == 2) {
_root.laser_speed = 24;
_root.bonus_speed_laser._x = f_mc._x;
_root.bonus_speed_laser._y = _root.base_mc._y + 8;
_root.bonus_speed_laser.gotoAndPlay(2);
_root.laser_speed_timer = getTimer();
}
}
}
}
}
n--;
}
var n = 3;
while (n > 0) {
if (((rate + 8) * rnd()) < 4) {
var j = int(rnd() * 11);
for (var i in alien_mc) {
var a_mc = alien_mc[i][j];
if (((typeof(a_mc) == "movieclip") && (a_mc._visible)) && (!f_mc._visible)) {
f_mc._x = Number(a_mc._x) + Number(a_mc._parent._x);
f_mc._y = (Number(a_mc._y) + Number(a_mc._parent._y)) + 16;
f_mc._visible = true;
f_mc.gotoAndPlay(2);
break;
}
}
}
n--;
}
if ((getTimer() - time) < rate) {
return(undefined);
}
time = getTimer();
alienSound_mc.play();
xMax = playMin;
xMin = playMax;
allGone = true;
for (var i in alien_mc) {
if (moveDown) {
alien_mc[i]._y = alien_mc[i]._y + downSpeed;
} else {
alien_mc[i]._x = alien_mc[i]._x + dir;
}
for (var j in alien_mc[i]) {
if (typeof(alien_mc[i][j]) != "movieclip") {
continue;
}
allGone = false;
alien_mc[i][j].nextFrame();
var x = (Number(alien_mc[i]._x) + Number(alien_mc[i][j]._x));
if (x < xMin) {
xMin = x;
}
if (x > xMax) {
xMax = x;
}
if (moveDown) {
if ((Number(alien_mc[i]._y) + Number(alien_mc[i][j]._y)) > 335) {
f_mc._visible = (laser_mc._visible = (ufo_mc._visible = false));
fire1_mc._visible = (fire2_mc._visible = (fire3_mc._visible = (fire4_mc._visible = false)));
resetLaser();
ufo_mc.gotoAndStop(1);
ufoSound_mc.gotoAndStop(1);
base_mc.gotoAndPlay(2);
newLife = true;
lives--;
if (lives < 1) {
gameOver = true;
gotoAndStop (43);
delete this.onEnterFrame;
return(undefined);
}
gotoAndPlay (6);
delete this.onEnterFrame;
}
}
}
}
if ((!moveDown) && ((xMax > playMax) || (xMin < playMin))) {
dir = dir * -1;
speed = speed + 20;
moveDown = true;
} else {
moveDown = false;
}
if (allGone) {
currentLevel++;
score = score + 1000;
setScore();
fire1_mc._visible = (fire2_mc._visible = (fire3_mc._visible = (fire4_mc._visible = false)));
laser_mc._visible = false;
ufoSound_mc.gotoAndStop(1);
gotoAndPlay (6);
delete this.onEnterFrame;
}
};
Frame 11
i = 5;
this.onEnterFrame = function () {
i--;
makeAlien(i);
if (!i) {
delete this.onEnterFrame;
}
};
ufo_mc.dir = 1;
ufo_mc.onEnterFrame = function () {
if (paused || (newLife)) {
return(undefined);
}
if (this._visible) {
if (this._currentframe == 1) {
if ((this._x > 550) || (this._x < -50)) {
this._visible = false;
ufoSound_mc.gotoAndStop(1);
}
this._x = this._x + (this.dir * 3);
}
} else if ((rnd() < 0.002) && (alien_mc[1]._y > 108)) {
this.dir = (int(rnd() * 2) * 2) - 1;
this._x = 250 - (this.dir * 300);
this._visible = true;
ufoSound_mc.gotoAndStop(2);
}
};
Frame 42
stop();
dir = 4;
dead = (time = (tonePos = 0));
paused = (gameOver = (newLife = false));
speed = ((currentLevel * 32) + 120) * 2;
this.onEnterFrame = loopy;
Symbol 5 MovieClip Frame 30
stop();
Symbol 9 MovieClip Frame 1
stop();
Symbol 12 MovieClip [alien1] Frame 32
gotoAndStop (30);
Symbol 16 MovieClip Frame 30
stop();
Symbol 19 MovieClip [alien2] Frame 32
gotoAndStop (30);
Symbol 23 MovieClip Frame 30
stop();
Symbol 26 MovieClip [alien3] Frame 32
gotoAndStop (30);
Symbol 41 MovieClip Frame 63
stop();
Symbol 50 Button
on (release) {
this.gotoAndPlay(2);
}
Symbol 55 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 70 MovieClip Frame 1
stop();
Symbol 73 MovieClip Frame 1
stop();
Symbol 87 MovieClip Frame 1
stop();
Symbol 87 MovieClip Frame 2
_root.setLives();
Symbol 87 MovieClip Frame 36
_x = 85;
if (_root.gameOver) {
stop();
}
Symbol 87 MovieClip Frame 45
_root.newLife = false;
Symbol 91 MovieClip Frame 1
stop();
Symbol 91 MovieClip Frame 14
if (_visible) {
gotoAndPlay (2);
}
Symbol 101 MovieClip Frame 1
stop();
Symbol 101 MovieClip Frame 2
play();
Symbol 101 MovieClip Frame 4
if (_visible) {
if (_root.paused) {
gotoAndPlay (3);
} else {
_y = (_y + 1);
gotoAndPlay (2);
}
} else {
gotoAndStop (1);
}
Symbol 107 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 10
stop();
Symbol 110 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 114 MovieClip Frame 1
stop();
_visible = false;
Symbol 114 MovieClip Frame 2
ufoScore = (int(Math.random() * 6) * 50) + 50;
_root.score = _root.score + ufoScore;
_root.setScore();
Symbol 120 Button
on (release) {
getURL ("http://www.endbossgames.com/arcade/", "_blank");
}
Symbol 121 MovieClip Frame 33
stop();
name_txt.restrict = "A-Z 0-9.:\\-";
name_txt.text = _root.game_so.data.playerName;
Selection.setFocus(name_txt);
Selection.setSelection(name_txt.length, name_txt.length);
newGame_btn.onRelease = function () {
_root.gotoAndStop(2);
};