Frame 1
stop();
Stage.showMenu = false;
this.onEnterFrame = function () {
sofar = this.getBytesLoaded();
total = this.getBytesTotal();
PcTxt.text = int((sofar / total) * 100) + "%";
if (sofar == total) {
delete this.onEnterFrame;
nextFrame();
}
};
Instance of Symbol 6 MovieClip [Alien3] "Alien" in Frame 1
onClipEvent (enterFrame) {
i = i + 0.25;
i = i % 2;
gotoAndStop(i + 1);
}
Frame 2
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);
};
so = SharedObject.getLocal("neaveInvaders");
if (!playerName.length) {
playerName = so.data.playerName;
}
score = 0;
gameOver = true;
this.onKeyDown = function () {
if (Over._visible) {
return(undefined);
}
if (Key.isDown(83)) {
if (_xscale == 100) {
_yscale = 50;
_xscale = 50;
_x = 125;
_y = 100;
} else {
_yscale = 100;
_xscale = 100;
_y = 0;
_x = 0;
}
}
if (gameOver) {
return(undefined);
}
if (Key.isDown(80)) {
if (Quitter._visible) {
return(undefined);
}
paused = !paused;
if (paused) {
Pause.play();
} else {
Pause.stop();
}
Pause._visible = paused;
Alien._alpha = (paused ? 15 : 100);
if (UFO._visible) {
SndUFO.gotoAndStop(Number(!paused) + 1);
}
}
if (Key.isDown(81)) {
Pause.stop();
Pause._visible = false;
Quitter._visible = (paused = true);
Alien._alpha = 15;
SndUFO.gotoAndStop(1);
}
if (!Quitter._visible) {
return(undefined);
}
if (Key.isDown(78)) {
Quitter._visible = (paused = false);
Alien._alpha = 100;
if (UFO._visible) {
SndUFO.gotoAndStop(2);
}
}
if (Key.isDown(89)) {
gotoAndStop (2);
}
};
Key.addListener(this);
Frame 3
function setLives() {
var i = 8;
while (i > 0) {
_root["Life" + i]._visible = lives >= i;
i--;
}
}
function setScore() {
ScoreTxt.text = String(score).addCommas();
}
function resetLaser() {
tellTarget ("Laser") {
_visible = false;
_y = yPos;
};
}
function makeAlien(i) {
Alien.createEmptyMovieClip(i, i);
Alien[i]._y = ((i * 30) + playTop) + 1;
var n = Math.ceil((i / 2) + 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) {
Alien[i].attachMovie("Alien" + n, j, j, {_x:((j * 30) + playMin) + 83, val:val});
j++;
}
}
rnd = Math.random;
lives = 3;
setLives();
score = 0;
moveDown = false;
setScore();
playMax = 480;
playMin = 20;
playTop = 64;
playBtm = 176;
Instance of Symbol 50 MovieClip "Pause" in Frame 3
onClipEvent (load) {
stop();
_visible = false;
}
Instance of Symbol 52 MovieClip "Quitter" in Frame 3
onClipEvent (load) {
stop();
_visible = false;
}
Instance of Symbol 65 MovieClip "Base" in Frame 3
onClipEvent (enterFrame) {
if (((_root.paused || (_root.newLife)) || (_root.gameOver)) || (_currentframe > 1)) {
return(undefined);
}
if (Key.isDown(39) && (_x < 480)) {
_x = (_x + 6);
} else if (Key.isDown(37) && (_x > 20)) {
_x = (_x - 6);
}
if (Key.isDown(32) && (!_root.Laser._visible)) {
_root.SndFire.play();
_root.Laser._x = _x;
_root.Laser._y = _root.Laser.yPos;
_root.Laser._visible = true;
}
}
Instance of Symbol 84 MovieClip "Fire1" in Frame 3
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 84 MovieClip "Fire2" in Frame 3
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 84 MovieClip "Fire3" in Frame 3
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 88 MovieClip "Fire4" in Frame 3
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 89 MovieClip "Laser" in Frame 3
onClipEvent (load) {
_visible = false;
yPos = _y;
}
onClipEvent (enterFrame) {
if (_root.paused) {
return(undefined);
}
if (_visible) {
if (_y < 50) {
_visible = false;
}
_y = (_y - 12);
}
}
Frame 9
i = 5;
this.onEnterFrame = function () {
i--;
makeAlien(i);
if (!i) {
delete this.onEnterFrame;
}
};
Instance of Symbol 109 MovieClip "UFO" in Frame 9
onClipEvent (load) {
rnd = Math.random;
dir = 1;
}
onClipEvent (enterFrame) {
if (_root.paused || (_root.newLife)) {
return(undefined);
}
if (_visible) {
if (_currentframe == 1) {
if ((_x > 550) || (_x < -50)) {
_visible = false;
_root.SndUFO.gotoAndStop(1);
}
_x = (_x + (dir * 3));
}
} else if ((rnd() < 0.002) && (_root.Alien[1]._y > 108)) {
dir = (int(rnd() * 2) * 2) - 1;
_x = (250 - (dir * 300));
_visible = true;
_root.SndUFO.gotoAndStop(2);
}
}
Frame 23
stop();
dir = 4;
dead = (time = (tonePos = 0));
paused = (gameOver = (newLife = false));
if (playTop < playBtm) {
playTop = playTop + 14;
}
speed = (playTop + 120) * 2;
this.onEnterFrame = function () {
if (paused || (newLife)) {
return(undefined);
}
for (var i in Alien) {
for (var j in Alien[i]) {
var A = Alien[i][j];
if ((typeof(A) == "movieclip") && (A.hitTest(Laser))) {
Explode._x = Number(A._x) + Number(A._parent._x);
Explode._y = Number(A._y) + Number(A._parent._y);
Explode.gotoAndPlay(2);
score = score + A.val;
setScore();
dead++;
A.removeMovieClip();
resetLaser();
break;
}
}
}
if (Laser._visible) {
for (var i in Brk) {
var B = Brk[i];
if (B._visible) {
if (B.hitTest(Laser)) {
if (B._currentframe == 4) {
B._visible = false;
} else {
B.nextFrame();
}
resetLaser();
break;
}
}
}
}
if (UFO._visible && (UFO._currentframe == 1)) {
if (UFO.hitTest(Laser)) {
SndUFO.gotoAndStop(1);
UFO.gotoAndPlay(2);
resetLaser();
}
}
rate = (1000 - speed) - (dead * 4);
if (rate < 0) {
rate = 0;
}
var n = 4;
while (n > 0) {
var F = _root["Fire" + n];
if (F._visible) {
with (F) {
if (n < 4) {
_y = _y + 6;
}
if (_y > 390) {
_visible = false;
}
}
if (F._y > 275) {
for (var i in Brk) {
var B = Brk[i];
if (B._visible) {
if (B.hitTest(F)) {
F._visible = false;
if (B._currentframe == 4) {
B._visible = false;
} else {
B.nextFrame();
}
break;
}
}
}
if (Base.hitTest(F)) {
F._visible = (Laser._visible = (UFO._visible = false));
resetLaser();
UFO.gotoAndStop(1);
SndUFO.gotoAndStop(1);
var n = 4;
while (n > 0) {
_root["Fire" + n]._visible = false;
n--;
}
Base.gotoAndPlay(2);
newLife = true;
lives--;
if (!lives) {
gameOver = true;
delete this.onEnterFrame;
gotoAndStop (24);
return(undefined);
}
}
}
}
if (((rate + 8) * rnd()) < 4) {
var j = int(rnd() * 11);
for (var i in Alien) {
var A = Alien[i][j];
if (((typeof(A) == "movieclip") && (A._visible)) && (!F._visible)) {
F._x = Number(A._x) + Number(A._parent._x);
F._y = (Number(A._y) + Number(A._parent._y)) + 16;
F._visible = true;
if (n == 4) {
F.gotoAndPlay(2);
}
break;
}
}
}
n--;
}
if ((getTimer() - time) < rate) {
return(undefined);
}
time = getTimer();
Tone.gotoAndStop(tonePos + 2);
tonePos++;
tonePos = tonePos % 4;
xMax = playMin;
xMin = playMax;
allGone = true;
for (var i in Alien) {
if (moveDown) {
Alien[i]._y = Alien[i]._y + 14;
} else {
Alien[i]._x = Alien[i]._x + dir;
}
for (var j in Alien[i]) {
if (typeof(Alien[i][j]) != "movieclip") {
continue;
}
allGone = false;
Alien[i][j].nextFrame();
var x = (Number(Alien[i]._x) + Number(Alien[i][j]._x));
if (x < xMin) {
xMin = x;
}
if (x > xMax) {
xMax = x;
}
if (moveDown) {
if ((Number(Alien[i]._y) + Number(Alien[i][j]._y)) > 320) {
lives = 0;
newLife = (gameOver = true);
SndUFO.gotoAndStop(1);
Base.gotoAndPlay(2);
delete this.onEnterFrame;
gotoAndStop (24);
return(undefined);
}
}
}
}
if ((!moveDown) && ((xMax > playMax) || (xMin < playMin))) {
dir = dir * -1;
speed = speed + 30;
moveDown = true;
} else {
moveDown = false;
}
if (allGone) {
score = score + 1000;
setScore();
if (lives < 9) {
lives++;
setLives();
}
SndUFO.gotoAndStop(1);
delete this.onEnterFrame;
gotoAndPlay (4);
}
};
Symbol 2 MovieClip [Alien1] Frame 1
stop();
Symbol 2 MovieClip [Alien1] Frame 3
gotoAndStop (1);
Symbol 4 MovieClip [Alien2] Frame 1
stop();
Symbol 4 MovieClip [Alien2] Frame 3
gotoAndStop (1);
Symbol 6 MovieClip [Alien3] Frame 1
stop();
Symbol 6 MovieClip [Alien3] Frame 3
gotoAndStop (1);
Symbol 20 MovieClip Frame 70
stop();
Symbol 25 Button
on (release) {
play();
}
Symbol 39 MovieClip Frame 11
stopAllSounds();
Symbol 39 MovieClip Frame 100
stop();
Symbol 65 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 2
_root.setLives();
Symbol 65 MovieClip Frame 26
if (_root.gameOver) {
stop();
}
Symbol 65 MovieClip Frame 36
_x = 85;
Symbol 65 MovieClip Frame 45
_root.newLife = false;
Symbol 70 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 2
play();
Symbol 88 MovieClip Frame 6
if (_visible) {
if (_root.paused) {
gotoAndPlay (5);
} else {
_y = (_y + 32);
gotoAndPlay (2);
}
} else {
gotoAndStop (1);
}
Symbol 98 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 1
stop();
Symbol 105 MovieClip Frame 1
stop();
Symbol 107 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 1
stop();
_visible = false;
Symbol 109 MovieClip Frame 2
ufoScore = (int(Math.random() * 6) * 50) + 50;
_root.score = _root.score + ufoScore;
_root.setScore();
Symbol 111 MovieClip Frame 32
stop();