Frame 1
stop();
stopAllSounds();
bombNum = 0;
lives = 3;
score = 0;
speed = 10;
_global.initAliens = function (mc) {
var _local3 = mc;
depth = 0;
var _local2 = 0;
while (_local2 < 3) {
var _local1 = 0;
while (_local1 < 10) {
attachMovie(_local3, ((_local3 + _local2) + "_") + _local1, 100 + depth);
_root[((_local3 + _local2) + "_") + _local1]._x = _local1 * 40;
_root[((_local3 + _local2) + "_") + _local1]._y = (_local2 * 40) - 80;
depth++;
_local1++;
}
_local2++;
}
};
_global.moveAliens = function (mc, frame, alspeed) {
_root.deadcount = 0;
var i = 0;
while (i < 3) {
var j = 0;
while (j < 10) {
_root[((mc + i) + "_") + j]._x = _root[((mc + i) + "_") + j]._x + speed;
if (_root[((mc + i) + "_") + j].hitTest(_root.defender)) {
cleanup(mc);
_root.gotoAndStop(4);
}
if (_root[((mc + i) + "_") + j] != null) {
_root.deadcount++;
}
bulleti = 6;
while ((--bulleti) > 0) {
if (_root[((mc + i) + "_") + j].hittest(eval ("_root.bullet" + bulleti))) {
_root[((mc + i) + "_") + j].removeMovieClip();
eval ("_root.bullet" + bulleti).removeMovieClip();
_root.score = _root.score + 1;
}
}
if (_root[((mc + i) + "_") + j]._x < 0) {
speed = alspeed;
dropdown = true;
break;
}
if (_root[((mc + i) + "_") + j]._x > Stage.width) {
speed = -alspeed;
dropdown = true;
break;
}
j++;
}
i++;
}
if (dropdown) {
var i = 0;
while (i < 3) {
var j = 0;
while (j < 10) {
_root[((mc + i) + "_") + j]._y = _root[((mc + i) + "_") + j]._y + 20;
j++;
}
i++;
}
}
dropdown = false;
if (_root.deadcount == 0) {
_root.bombspeed = 0;
_root.gotoAndStop(3);
}
};
_global.initBombs = function (bombspeed) {
if (Math.random() < bombspeed) {
attachMovie("bomb", "bomb" + bombNum, 200 + bombNum);
eval ("_root.bomb" + bombNum)._x = random(700);
eval ("_root.bomb" + bombNum)._y = 300 * Math.random();
bombNum++;
if (bombNum > 10) {
bombNum = 0;
}
}
};
_global.moveBombs = function (mc) {
var _local2 = _root;
var bombi = 0;
while (bombi < 11) {
_local2["bomb" + bombi]._y = _local2["bomb" + bombi]._y + 5;
if (_local2["bomb" + bombi].hittest(_local2.defender)) {
_local2["bomb" + bombi].removeMovieClip();
_local2.lives = _local2.lives - 1;
if (_local2.lives <= 0) {
Mouse.show();
_local2.bombspeed = 0;
_local2.gotoAndStop(1);
var _local3 = 0;
while (_local3 < 3) {
var _local1 = 0;
while (_local1 < 10) {
_local2[((mc + _local3) + "_") + _local1]._visible = false;
_local1++;
}
_local3++;
}
return;
}
}
if (_local2["bomb" + bombi]._y > Stage.height) {
_local2["bomb" + bombi].removeMovieClip();
}
bombi++;
}
};
_global.cleanup = function (mc) {
var _local3 = _root;
_local3.bombspeed = 0;
var _local2 = 0;
while (_local2 < 3) {
var _local1 = 0;
while (_local1 < 10) {
_local3[((mc + _local2) + "_") + _local1]._visible = false;
_local1++;
}
_local2++;
}
};
Frame 2
stop();
bulletNum = 0;
dropdown = false;
speed = 15;
_root.bombspeed = 0.1;
initAliens("bug");
_root.onLoad = function () {
Mouse.hide();
};
_root.onEnterFrame = function () {
_root.defender._x = _root._xmouse;
_root.defender._y = 385;
var y = 0;
while (y < 6) {
eval ("_root.bullet" + y)._y = eval ("_root.bullet" + y)._y - 30;
y++;
}
moveBombs("bug");
moveAliens("bug", 4, 12);
initBombs(_root.bombspeed);
};
_root.onMouseDown = function () {
attachMovie("bullet", "bullet" + bulletNum, bulletNum);
var my_sound:Sound = new Sound();
my_sound.loadSound("sscifi009.mp3", true);
eval ("_root.bullet" + bulletNum)._x = _root.defender._x;
eval ("_root.bullet" + bulletNum)._y = _root.defender._y;
bulletNum++;
if (bulletNum > 5) {
bulletNum = 0;
}
};
Frame 3
stop();
gotoAndStop (5);
bombNum = 0;
lives = 3;
score = 0;
speed = 10;
_global.initAliens = function (mc) {
var _local3 = mc;
depth = 0;
var _local2 = 0;
while (_local2 < 3) {
var _local1 = 0;
while (_local1 < 10) {
attachMovie(_local3, ((_local3 + _local2) + "_") + _local1, 100 + depth);
_root[((_local3 + _local2) + "_") + _local1]._x = _local1 * 40;
_root[((_local3 + _local2) + "_") + _local1]._y = (_local2 * 40) - 80;
depth++;
_local1++;
}
_local2++;
}
};
_global.moveAliens = function (mc, frame, alspeed) {
_root.deadcount = 0;
var i = 0;
while (i < 3) {
var j = 0;
while (j < 10) {
_root[((mc + i) + "_") + j]._x = _root[((mc + i) + "_") + j]._x + speed;
if (_root[((mc + i) + "_") + j].hitTest(_root.defender)) {
cleanup(mc);
_root.gotoAndStop(2);
}
if (_root[((mc + i) + "_") + j] != null) {
_root.deadcount++;
}
bulleti = 6;
while ((--bulleti) > 0) {
if (_root[((mc + i) + "_") + j].hittest(eval ("_root.bullet" + bulleti))) {
_root[((mc + i) + "_") + j].removeMovieClip();
eval ("_root.bullet" + bulleti).removeMovieClip();
_root.score = _root.score + 1;
}
}
if (_root[((mc + i) + "_") + j]._x < 0) {
speed = alspeed;
dropdown = true;
break;
}
if (_root[((mc + i) + "_") + j]._x > Stage.width) {
speed = -alspeed;
dropdown = true;
break;
}
j++;
}
i++;
}
if (dropdown) {
var i = 0;
while (i < 3) {
var j = 0;
while (j < 10) {
_root[((mc + i) + "_") + j]._y = _root[((mc + i) + "_") + j]._y + 20;
j++;
}
i++;
}
}
dropdown = false;
if (_root.deadcount == 0) {
_root.bombspeed = 0;
_root.gotoAndStop(4);
}
};
_global.initBombs = function (bombspeed) {
if (Math.random() < bombspeed) {
attachMovie("bomb", "bomb" + bombNum, 200 + bombNum);
eval ("_root.bomb" + bombNum)._x = random(700);
eval ("_root.bomb" + bombNum)._y = 300 * Math.random();
bombNum++;
if (bombNum > 10) {
bombNum = 0;
}
}
};
_global.moveBombs = function (mc) {
var _local2 = _root;
var bombi = 0;
while (bombi < 11) {
_local2["bomb" + bombi]._y = _local2["bomb" + bombi]._y + 5;
if (_local2["bomb" + bombi].hittest(_local2.defender)) {
_local2["bomb" + bombi].removeMovieClip();
_local2.lives = _local2.lives - 1;
if (_local2.lives <= 0) {
Mouse.show();
_local2.bombspeed = 0;
_local2.gotoAndStop(1);
var _local3 = 0;
while (_local3 < 3) {
var _local1 = 0;
while (_local1 < 10) {
_local2[((mc + _local3) + "_") + _local1]._visible = false;
_local1++;
}
_local3++;
}
return;
}
}
if (_local2["bomb" + bombi]._y > Stage.height) {
_local2["bomb" + bombi].removeMovieClip();
}
bombi++;
}
};
_global.cleanup = function (mc) {
var _local3 = _root;
_local3.bombspeed = 0;
var _local2 = 0;
while (_local2 < 3) {
var _local1 = 0;
while (_local1 < 10) {
_local3[((mc + _local2) + "_") + _local1]._visible = false;
_local1++;
}
_local2++;
}
};
Frame 4
stop();
bulletNum = 0;
dropdown = false;
speed = 15;
_root.bombspeed = 0.1;
initAliens("alien");
_root.onLoad = function () {
Mouse.hide();
};
_root.onEnterFrame = function () {
_root.defender._x = _root._xmouse;
_root.defender._y = 385;
var y = 0;
while (y < 6) {
eval ("_root.bullet" + y)._y = eval ("_root.bullet" + y)._y - 30;
y++;
}
moveBombs("alien");
moveAliens("alien", 4, 12);
initBombs(_root.bombspeed);
};
_root.onMouseDown = function () {
attachMovie("bullet", "bullet" + bulletNum, bulletNum);
eval ("_root.bullet" + bulletNum)._x = _root.defender._x;
eval ("_root.bullet" + bulletNum)._y = _root.defender._y;
bulletNum++;
if (bulletNum > 5) {
bulletNum = 0;
}
};
Frame 5
stop();
bulletNum = 0;
dropdown = false;
speed = 15;
_root.bombspeed = 0.1;
initAliens("bug");
_root.onLoad = function () {
Mouse.hide();
};
_root.onEnterFrame = function () {
_root.defender._x = _root._xmouse;
_root.defender._y = 385;
var y = 0;
while (y < 6) {
eval ("_root.bullet" + y)._y = eval ("_root.bullet" + y)._y - 30;
y++;
}
moveBombs("bug");
moveAliens("bug", 4, 12);
initBombs(_root.bombspeed);
};
_root.onMouseDown = function () {
attachMovie("bullet", "bullet" + bulletNum, bulletNum);
eval ("_root.bullet" + bulletNum)._x = _root.defender._x;
eval ("_root.bullet" + bulletNum)._y = _root.defender._y;
bulletNum++;
if (bulletNum > 5) {
bulletNum = 0;
}
};
Frame 6
stop();
stop();
bulletNum = 0;
dropdown = false;
speed = 20;
_root.bombspeed = 0.1;
initAliens("skull");
_root.onLoad = function () {
Mouse.hide();
};
_root.onEnterFrame = function () {
_root.defender._x = _root._xmouse;
_root.defender._y = 385;
var y = 0;
while (y < 6) {
eval ("_root.bullet" + y)._y = eval ("_root.bullet" + y)._y - 30;
y++;
}
moveBombs("skull");
moveAliens("skull", 4, 12);
initBombs(_root.bombspeed);
};
_root.onMouseDown = function () {
attachMovie("bullet", "bullet" + bulletNum, bulletNum);
eval ("_root.bullet" + bulletNum)._x = _root.defender._x;
eval ("_root.bullet" + bulletNum)._y = _root.defender._y;
bulletNum++;
if (bulletNum > 5) {
bulletNum = 0;
}
};
Frame 7
stop();
Symbol 29 MovieClip Frame 7
stop();
Symbol 35 Button
on (release) {
_root.gotoAndStop(2);
}
Symbol 74 Button
on (release) {
_root.lives = 3;
_root.score = 0;
_root.gotoAndStop(2);
}