Frame 1
level = 1000;
hilevel = 1000000 /* 0x0F4240 */;
getUL("FSComman:fullscreen", tre);
stop();
Frame 2
stop();
_root.hud._visible = false;
_root.pgame._y = 500;
Frame 3
function register(iname, array) {
ina = eval ("_root." + iname);
ina.anum = array[array.length];
array[array.length] = ina;
}
function unregister(anum, array) {
var _local1 = array;
var _local2 = anum;
var _local3 = _root;
_local3.testtext.text = _local2;
i = _local2;
while (i < _local1) {
ina = _local1[i];
if (ina == _local3.blank) {
_local1.splice(_local2, 1);
ina.anum--;
}
i++;
}
}
function stopgame() {
i = 0;
while (i < _root.gob.length) {
ob = eval ("_root." + _root.gob[i]);
ob.removeMovieClip();
i++;
}
}
function spawnEnemy(x, y, t, r) {
ent = eval ("_root.enemy" + t);
duplicateMovieClip (ent, "enemy" + _root.level, _root.level);
en = eval ("_root.enemy" + _root.level);
en._rotation = r;
en._x = x;
en._y = y;
en.active = true;
_root.level++;
}
function spawnPowerup(x, y, t) {
duplicateMovieClip (_root.powerup, "powerup" + _root.level, _root.level);
pu = eval ("_root.powerup" + _root.level);
pu._x = x;
pu._y = y;
pu._rotation = random(360);
pu.gotoAndStop(t);
pu.active = true;
_root.level++;
}
gameover = false;
paused = false;
score = 0;
sco = 0;
clevel = 1;
_root.hud._visible = true;
_root.pgame.active = true;
enemies = new Array(_root.blank);
gob = new Array(_root.blank);
stop();
Instance of Symbol 55 MovieClip "ship" in Frame 3
onClipEvent (load) {
function moveForward() {
var _local1 = this;
rot = _local1._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
nrot = nrot * 0.017453;
speed = 10;
rot = _local1._rotation;
xmove = Math.sin(nrot) * speed;
ymove = Math.cos(nrot) * speed;
_local1._x = _local1._x + xmove;
_local1._y = _local1._y - ymove;
}
function rotate(dir) {
var _local1 = this;
rot = _local1._rotation;
nrot = rot * 0.017453;
if (dir == "left") {
_local1._rotation = _local1._rotation - 7;
} else if (dir == "right") {
_local1._rotation = _local1._rotation + 7;
}
}
function lightTrail(frame, wid, len) {
drawLine(_root.line, frame, currentPos, oldPos, wid, len);
}
function fire(weapon) {
if (weapon == "laser") {
if ((ltimer == 0) && (energy > 0)) {
if (lasgun == 0) {
duplicateMovieClip (_root.laser, "laser" + _root.level, _root.level);
las = eval ("_root.laser" + _root.level);
las._rotation = _rotation;
las._x = las1.x;
las._y = las1.y;
las.active = true;
las.ltype = "n";
las.active = true;
las.unregistered = true;
slas.start();
lasgun = 1;
_root.level++;
} else if (lasgun == 1) {
duplicateMovieClip (_root.laser, "laser" + _root.level, _root.level);
las = eval ("_root.laser" + _root.level);
las._rotation = _rotation;
las._x = las2.x;
las._y = las2.y;
las.active = true;
las.ltype = "n";
las.active = true;
las.unregistered = true;
slas.start();
lasgun = 0;
_root.level++;
}
ltimer = 2;
energy = energy - 0;
}
} else if (weapon == "amageddon") {
if ((atimer == 0) && (energy > 29)) {
i = 0;
while (i < 72) {
duplicateMovieClip (_root.laser, "laser" + _root.level, _root.level);
las = eval ("_root.laser" + _root.level);
las._width = 20;
las._rotation = i * 5;
las._x = this._x;
las._y = this._y;
las.active = true;
las.unregistered = true;
las.ltype = "a";
_root.level++;
i++;
}
atimer = 15;
energy = energy - 30;
ags.start();
}
} else if (weapon == "mssile") {
if ((mtimer == 0) && (missile > 1)) {
duplicateMovieClip (_root.missile, "missile" + _root.level, _root.level);
las = eval ("_root.missile" + _root.level);
las._rotation = _rotation;
las._x = las1.x;
las._y = las1.y;
las.active = true;
las.ltype = "n";
las.unregistered = true;
las.active = true;
_root.level++;
duplicateMovieClip (_root.missile, "missile" + _root.level, _root.level);
las = eval ("_root.missile" + _root.level);
las._rotation = _rotation;
las._x = las2.x;
las._y = las2.y;
las.active = true;
las.ltype = "n";
las.unregistered = true;
las.active = true;
_root.level++;
mtimer = 10;
missile = missile - 2;
mis.start();
}
} else if (weapon == "vlley") {
if ((vtimer == 0) && (missile > 1)) {
if (missile >= 8) {
av = 4;
} else {
av = Math.round(missile / 2);
}
i = 0;
while (i < av) {
duplicateMovieClip (_root.missile, "missile" + _root.level, _root.level);
las = eval ("_root.missile" + _root.level);
las._rotation = (_rotation + (i * 20)) + 10;
las._x = las1.x;
las._y = las1.y;
las.active = true;
las.ltype = "n";
las.unregistered = true;
las.active = true;
_root.level++;
i++;
}
i = 0;
while (i < av) {
duplicateMovieClip (_root.missile, "missile" + _root.level, _root.level);
las = eval ("_root.missile" + _root.level);
las._rotation = (_rotation - (i * 20)) - 10;
las._x = las2.x;
las._y = las2.y;
las.active = true;
las.ltype = "n";
las.unregistered = true;
las.active = true;
_root.level++;
i++;
}
vtimer = 30;
missile = missile - (av * 2);
mis.start();
}
}
}
function drawLine(iname, frame, p1, p2, width, len) {
duplicateMovieClip (iname, "line" + _root.level, _root.level);
nline = eval ("_root.line" + _root.level);
nline._x = p1[0];
nline._y = p1[1];
xdif = p2[0] - p1[0];
ydif = p2[1] - p1[1];
dist = Math.sqrt((xdif * xdif) + (ydif * ydif));
nline._xscale = dist;
nline._alpha = len * 5;
if (nline._xscale > 100) {
nline._alpha = 0;
}
nline._height = width;
rad = Math.asin(ydif / dist);
degcon = 57.29578;
nrad = rad * degcon;
if (xdif < 0) {
nrad = 180 - nrad;
}
nline._rotation = nrad;
nline.gotoAndStop(frame);
nline.unregistered = true;
nline.active = true;
_root.level++;
}
function detonate() {
duplicateMovieClip (_root.edet, "edet" + _root.level, _root.level);
det = eval ("_root.edet" + _root.level);
det._x = this._x;
det._y = this._y;
det._alpha = 100;
det.active = true;
det.gotoAndPlay(1);
_root.level++;
exp.start();
this.active = false;
this._x = 700;
_name = "deadship";
_root.gameover = true;
}
unregistered = true;
flame._visible = false;
ltimer = 0;
mtimer = 0;
atimer = 0;
vtimer = 0;
lasgun = 0;
mis = new Sound();
mis.attachSound("_missile");
slas = new Sound();
slas.attachSound("_laser");
ags = new Sound();
ags.attachSound("_armageddon");
nlv = new Sound();
nlv.attachSound("_nextlevel");
active = true;
this.getBounds(_root);
lvltimer = 0;
energy = 100;
sheild = 100;
missile = 40;
_x = 320;
_y = 240;
currentPos = new Array(this._x, this._y);
oldPos = new Array(this._x, this._y);
}
onClipEvent (enterFrame) {
if (active) {
if (unregistered) {
inum = _root.gob.length;
_root.gob[_root.gob.length] = this;
unregistered = false;
}
flame._visible = false;
lflame._visible = false;
rflame._visible = false;
if (Key.isDown(38)) {
moveForward();
flame._visible = true;
this.currentPos[0] = this._x;
this.currentPos[1] = this._y;
lightTrail(1, 1, 1);
this.oldPos[0] = this._x;
this.oldPos[1] = this._y;
}
if (Key.isDown(37)) {
rotate("left");
lflame._visible = true;
}
if (Key.isDown(39)) {
rotate("right");
rflame._visible = true;
}
if (this._y < -21) {
this._y = 500;
} else if (this._y > 501) {
this._y = -20;
}
if (this._x < -21) {
this._x = 660;
} else if (this._x > 661) {
this._x = -20;
}
if (Key.isDown(83)) {
fire("laser");
}
if (Key.isDown(32)) {
fire("laer");
}
if (Key.isDown(90)) {
fire("armageddon");
}
if (Key.isDown(88)) {
fire("volley");
}
if (ltimer > 0) {
ltimer--;
}
if (mtimer > 0) {
mtimer--;
}
if (atimer > 0) {
atimer--;
}
if (vtimer > 0) {
vtimer--;
}
if (energy < 100) {
energy = energy + 0.1;
}
if (sheild < 100) {
sheild = sheild + 0.1;
}
if (missile < 40) {
missile = missile + 0.005;
}
if (sheild < 0) {
detonate();
}
lvltimer++;
if (lvltimer > 899) {
_root.clevel++;
lvltimer = 0;
nlv.start();
}
}
}
Instance of Symbol 57 MovieClip "laser" in Frame 3
onClipEvent (load) {
function moveForward() {
var _local1 = this;
rot = _local1._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
nrot = nrot * 0.017453;
speed = 20;
rot = _local1._rotation;
xmove = Math.sin(nrot) * speed;
ymove = Math.cos(nrot) * speed;
_local1._x = _local1._x + xmove;
_local1._y = _local1._y - ymove;
}
function htest() {
i = 0;
while (i < _root.enemies.length) {
t = eval ("_root." + _root.enemies[i]);
hit = this.hitTest(t);
if (hit) {
detonate(t);
i = _root.enemies.length;
}
i++;
}
}
function detonate(target) {
duplicateMovieClip (_root.ldet, "ldet" + _root.level, _root.level);
det = eval ("_root.ldet" + _root.level);
det._rotation = this._rotation;
det._x = _x;
det._y = _y;
det._alpha = 100;
det.active = true;
ldt.start();
target.hp = target.hp - 1;
_root.level++;
blank = _root.blank;
_root.gob[inum] = blank;
this.removeMovieClip();
}
ldt = new Sound();
ldt.attachSound("_lasdeath");
inum = 0;
_alpha = 100;
}
onClipEvent (enterFrame) {
if (active) {
if (unregistered) {
inum = _root.gob.length;
_root.gob[_root.gob.length] = this;
unregistered = false;
}
moveForward();
htest();
if (this._y < -21) {
this._y = 500;
} else if (this._y > 501) {
this._y = -20;
}
if (this._x < -21) {
this._x = 660;
} else if (this._x > 661) {
this._x = -20;
}
if (ltype == "n") {
_alpha = (_alpha - 2);
} else if (ltype == "a") {
_alpha = (_alpha - 10);
}
if (_alpha < 0) {
blank = _root.blank;
_root.gob[inum] = blank;
this.removeMovieClip();
}
}
}
Instance of Symbol 60 MovieClip "line" in Frame 3
onClipEvent (load) {
}
onClipEvent (enterFrame) {
if (active) {
_alpha = (_alpha - 5);
if (_alpha < 0) {
this.removeMovieClip();
}
}
}
Instance of Symbol 40 MovieClip "enemy1" in Frame 3
onClipEvent (load) {
function seekTarget() {
ydif = _root.ship._y - _y;
xdif = _root.ship._x - _x;
dist = Math.sqrt((ydif * ydif) + (xdif * xdif));
degcon = 57.29578;
rad = Math.asin(ydif / dist);
rot = (rad * degcon) + 90;
if (xdif < 0) {
rot = 360 - rot;
}
crot = this._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
if (crot < 0) {
xrot = 0 + (360 - Math.abs(crot));
} else {
xrot = crot;
}
brot = 0;
zrot = xrot - nrot;
if (zrot < 0) {
zrot = zrot + 360;
}
if (zrot <= 180) {
rotate("left", Math.abs(zrot - brot));
} else if (zrot > 180) {
rotate("right", Math.abs(zrot - brot));
}
if (nrot > 180) {
rot = -180 + (nrot - 180);
} else {
rot = nrot;
}
moveForward(2);
}
function moveForward(speed) {
var _local1 = this;
rot = _local1._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
nrot = nrot * 0.017453;
if (speed > 10) {
var _local2 = 10;
}
if (_local2 < 1) {
var _local2 = 1;
}
rot = _local1._rotation;
xmove = Math.sin(nrot) * _local2;
ymove = Math.cos(nrot) * _local2;
_local1._x = _local1._x + xmove;
_local1._y = _local1._y - ymove;
}
function rotate(dir, need) {
var _local1 = this;
if (need > 4) {
var _local2 = 5;
}
if (dir == "left") {
_local1._rotation = _local1._rotation - _local2;
} else if (dir == "right") {
_local1._rotation = _local1._rotation + _local2;
}
}
function fire(weapon) {
if (weapon == "laser") {
if (ltimer == 0) {
duplicateMovieClip (_root.elaser, "elaser" + _root.level, _root.level);
las = eval ("_root.elaser" + _root.level);
las._x = _x;
las._y = _y;
las.active = true;
las.unregistered = true;
las._rotation = _rotation;
ltimer = 30;
_root.level++;
}
} else if (weapon == "") {
if (ltimer == 0) {
duplicateMovieClip (_root.emis, "" + _root.level, _root.level);
las = eval ("" + _root.level);
las._rotation = _rotation;
las._x = _x;
las._y = _y;
las.active = true;
las.unregistered = true;
_root.level++;
ltimer = 60;
}
}
}
function detonate() {
duplicateMovieClip (_root.edet, "edet" + _root.level, _root.level);
det = eval ("_root.edet" + _root.level);
det._x = this._x;
det._y = this._y;
det._alpha = 100;
det.active = true;
det.gotoAndPlay(1);
blank = _root.blank;
_root.enemies[anum] = blank;
blank = _root.blank;
_root.gob[inum] = blank;
_root.level++;
exp.start();
i = 0;
while (i < rp) {
ranp = random(3) + 1;
_root.spawnPowerup(_x, _y, ranp);
i++;
}
_root.score = _root.score + 100;
_root.level++;
this.removeMovieClip();
}
unregistered = true;
hp = 12;
this.getBounds(_root);
ltimer = 0;
ranp = 0;
exp = new Sound();
exp.attachSound("_explosion");
rp = 1;
anum = 0;
inum = 0;
}
onClipEvent (enterFrame) {
if (active) {
if (unregistered) {
anum = _root.enemies.length;
_root.enemies[_root.enemies.length] = this;
inum = _root.gob.length;
_root.gob[_root.gob.length] = this;
unregistered = false;
_root.testtext.text = _root.gob[inum];
}
seekTarget();
f = Math.random() * 100;
if ((f > 0) && (f < 80)) {
fire("laser");
} else if (f > 80) {
fire("");
}
if (this._y < -21) {
this._y = 500;
} else if (this._y > 501) {
this._y = -20;
}
if (this._x < -21) {
this._x = 660;
} else if (this._x > 661) {
this._x = -20;
}
if (ltimer > 0) {
ltimer--;
}
if (hp < 1) {
detonate();
}
}
}
Instance of Symbol 67 MovieClip "ldet" in Frame 3
onClipEvent (load) {
active = false;
}
onClipEvent (enterFrame) {
if (active) {
play();
}
}
Instance of Symbol 75 MovieClip "missile" in Frame 3
onClipEvent (load) {
function moveForward(speed) {
var _local1 = this;
rot = _local1._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
nrot = nrot * 0.017453;
if (speed > 15) {
var _local2 = 15;
}
if (_local2 < 1) {
var _local2 = 1;
}
rot = _local1._rotation;
xmove = Math.sin(nrot) * _local2;
ymove = Math.cos(nrot) * _local2;
_local1._x = _local1._x + xmove;
_local1._y = _local1._y - ymove;
_local1.currentPos[0] = _local1._x;
_local1.currentPos[1] = _local1._y;
lightTrail(1, 2, 20);
_local1.oldPos[0] = _local1._x;
_local1.oldPos[1] = _local1._y;
}
function htest() {
i = 0;
while (i < _root.enemies.length) {
t = eval ("_root." + _root.enemies[i]);
hit = this.hitTest(t);
if (hit) {
detonate(t);
i = _root.enemies.length;
}
i++;
}
}
function detonate(target) {
duplicateMovieClip (_root.mdet, "mdet" + _root.level, _root.level);
det = eval ("_root.mdet" + _root.level);
det._rotation = this._rotation;
det._x = _x;
det._y = _y;
det._alpha = 100;
det.active = true;
target.hp = target.hp - 5;
_root.level++;
mex.start();
blank = _root.blank;
_root.gob[inum] = blank;
this.removeMovieClip();
}
function rotate(dir, need) {
var _local1 = this;
if (need > 5) {
var _local2 = 5;
}
if (dir == "left") {
_local1._rotation = _local1._rotation - _local2;
} else if (dir == "right") {
_local1._rotation = _local1._rotation + _local2;
}
}
function lightTrail(frame, wid, len) {
drawLine(_root.line, frame, currentPos, oldPos, wid, len);
}
function drawLine(iname, frame, p1, p2, width, len) {
duplicateMovieClip (iname, "line" + _root.level, _root.level);
nline = eval ("_root.line" + _root.level);
nline._x = p1[0];
nline._y = p1[1];
xdif = p2[0] - p1[0];
ydif = p2[1] - p1[1];
dist = Math.sqrt((xdif * xdif) + (ydif * ydif));
nline._xscale = dist;
nline._alpha = len * 5;
if (nline._xscale > 100) {
nline._alpha = 0;
}
nline._height = width;
rad = Math.asin(ydif / dist);
degcon = 57.29578;
nrad = rad * degcon;
if (xdif < 0) {
nrad = 180 - nrad;
}
nline._rotation = nrad;
nline.gotoAndStop(frame);
nline.unregistered = true;
nline.active = true;
_root.level++;
}
function seekTarget() {
istarget = false;
shortest = 1000;
closest = "";
yshort = 1000;
xshort = 1000;
i = 0;
while (i < _root.enemies.length) {
en = eval ("_root." + _root.enemies[i]);
xdif = en._x - this._x;
ydif = en._y - this._y;
dist = Math.sqrt((xdif * xdif) + (ydif * ydif));
if (dist < shortest) {
shortest = dist;
closest = en;
yshort = ydif;
xshort = xdif;
istarget = true;
}
i++;
}
if (istarget) {
degcon = 57.29578;
rad = Math.asin(yshort / shortest);
rot = (rad * degcon) + 90;
if (xshort < 0) {
rot = 360 - rot;
}
crot = this._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
if (crot < 0) {
xrot = 0 + (360 - Math.abs(crot));
} else {
xrot = crot;
}
brot = 0;
zrot = xrot - nrot;
if (zrot < 0) {
zrot = zrot + 360;
}
if (zrot <= 180) {
rotate("left", Math.abs(zrot - brot));
} else if (zrot > 180) {
rotate("right", Math.abs(zrot - brot));
}
if (nrot > 180) {
rot = -180 + (nrot - 180);
} else {
rot = nrot;
}
}
moveForward(shortest);
}
etimer = 80 + random(20);
currentPos = new Array();
oldPos = new Array(_x, _y);
mex = new Sound();
mex.attachSound("_misexplode");
inum = 0;
_alpha = 100;
}
onClipEvent (enterFrame) {
if (active) {
if (unregistered) {
inum = _root.gob.length;
_root.gob[_root.gob.length] = this;
unregistered = false;
}
htest();
seekTarget();
etimer--;
if (etimer < 0) {
detonate(0);
}
if (this._y < -21) {
this._y = 500;
} else if (this._y > 501) {
this._y = -20;
}
if (this._x < -21) {
this._x = 660;
} else if (this._x > 661) {
this._x = -20;
}
}
}
Instance of Symbol 84 MovieClip "mdet" in Frame 3
onClipEvent (load) {
active = false;
unregistered = true;
inum = 0;
}
onClipEvent (enterFrame) {
if (active) {
gotoAndStop(_currentframe + 1);
}
}
Instance of Symbol 95 MovieClip "hud" in Frame 3
onClipEvent (enterFrame) {
this.swapDepths(_root.hilevel + 2);
}
Instance of Symbol 98 MovieClip "pgame" in Frame 3
onClipEvent (load) {
ptimer = 10;
active = true;
ctimer = 0;
stopped = false;
}
onClipEvent (enterFrame) {
if (active) {
if ((Key.isown(32) && (_root.paused == false)) && (ptimer == 0)) {
_root.paused = true;
ptimer = 10;
_y = 120;
i = 0;
while (i < _root.gob.length) {
ob = eval ("_root." + _root.gob[i]);
ob.active = false;
i++;
}
} else if ((Key.isDown(32) && (_root.paused == true)) && (ptimer == 0)) {
_root.paused = false;
ptimer = 10;
_y = 500;
i = 0;
while (i < _root.gob.length) {
ob = eval ("_root." + _root.gob[i]);
ob.active = true;
i++;
}
}
if (ptimer > 0) {
ptimer--;
}
this.swapDepths(_root.hilevel + 1);
}
if (_root.gameover) {
if (!stopped) {
_root.stopgame();
stopped = true;
_root.egen.active = false;
}
_root.pgame._y = 500;
ptimer = 10;
active = false;
_root.gover.active = true;
}
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i] == _level0.blank) {
_root.enemies.splice(i, 1);
x = i;
while (x < _root.enemies.length) {
_root.enemies[x].anum--;
x++;
}
}
i++;
}
_root.testtext.text = _root.paused;
}
Instance of Symbol 107 MovieClip "edet" in Frame 3
onClipEvent (load) {
unregistered = true;
inum = 0;
}
onClipEvent (enterFrame) {
if (active) {
gotoAndStop(_currentframe + 1);
if (unregistered) {
inum = _root.gob.length;
_root.gob[_root.gob.length] = this;
unregistered = false;
}
}
if (_alpha < 0) {
this.removeMovieClip();
}
}
Instance of Symbol 109 MovieClip "elaser" in Frame 3
onClipEvent (load) {
function moveForward() {
var _local1 = this;
rot = _local1._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
nrot = nrot * 0.017453;
speed = 20;
rot = _local1._rotation;
xmove = Math.sin(nrot) * speed;
ymove = Math.cos(nrot) * speed;
_local1._x = _local1._x + xmove;
_local1._y = _local1._y - ymove;
}
function htest() {
hit = this.hitTest(_root.ship);
if (hit) {
detonate(_root.ship);
}
}
function detonate(target) {
duplicateMovieClip (_root.ldet, "ldet" + _root.level, _root.level);
det = eval ("_root.ldet" + _root.level);
det._rotation = this._rotation;
det._x = _x;
det._y = _y;
det._alpha = 100;
det.active = true;
ldt.start();
target.sheild = target.sheild - 1;
_root.level++;
blank = _root.blank;
_root.gob[inum] = blank;
this.removeMovieClip();
}
ldt = new Sound();
ldt.attachSound("_lasdeath");
inum = 0;
_alpha = 100;
}
onClipEvent (enterFrame) {
if (active) {
if (unregistered) {
inum = _root.gob.length;
_root.gob[_root.gob.length] = this;
unregistered = false;
}
moveForward();
htest();
if (this._y < -21) {
this._y = 500;
} else if (this._y > 501) {
this._y = -20;
}
if (this._x < -21) {
this._x = 660;
} else if (this._x > 661) {
this._x = -20;
}
if ((ltype = "a")) {
_alpha = (_alpha - 5);
} else {
_alpha = (_alpha - 2);
}
if (_alpha < 0) {
blank = _root.blank;
_root.gob[inum] = blank;
this.removeMovieClip();
}
}
}
Instance of Symbol 112 MovieClip "emis" in Frame 3
onClipEvent (load) {
function moveForward(speed) {
var _local1 = this;
rot = _local1._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
nrot = nrot * 0.017453;
rot = _local1._rotation;
xmove = Math.sin(nrot) * speed;
ymove = Math.cos(nrot) * speed;
_local1._x = _local1._x + xmove;
_local1._y = _local1._y - ymove;
_local1.currentPos[0] = _local1._x;
_local1.currentPos[1] = _local1._y;
lightTrail(2, 2, 20);
_local1.oldPos[0] = _local1._x;
_local1.oldPos[1] = _local1._y;
}
function htest() {
hit = this.hitTest(_root.ship);
if (hit) {
detonate(_root.ship);
}
}
function detonate(target) {
duplicateMovieClip (_root.mdet, "mdet" + _root.level, _root.level);
det = eval ("_root.mdet" + _root.level);
det._rotation = this._rotation;
det._x = _x;
det._y = _y;
det._alpha = 100;
det.active = true;
target.sheild = target.sheild - 4;
_root.level++;
mex.start();
blank = _root.blank;
_root.gob[inum] = blank;
this.removeMovieClip();
}
function rotate(dir, need) {
var _local1 = this;
if (need > 4) {
var _local2 = 4;
}
if (dir == "left") {
_local1._rotation = _local1._rotation - _local2;
} else if (dir == "right") {
_local1._rotation = _local1._rotation + _local2;
}
}
function lightTrail(frame, wid, len) {
drawLine(_root.line, frame, currentPos, oldPos, wid, len);
}
function drawLine(iname, frame, p1, p2, width, len) {
duplicateMovieClip (iname, "line" + _root.level, _root.level);
nline = eval ("_root.line" + _root.level);
nline._x = p1[0];
nline._y = p1[1];
xdif = p2[0] - p1[0];
ydif = p2[1] - p1[1];
dist = Math.sqrt((xdif * xdif) + (ydif * ydif));
nline._xscale = dist;
nline._alpha = len * 5;
if (nline._xscale > 100) {
nline._alpha = 0;
}
nline._height = width;
rad = Math.asin(ydif / dist);
degcon = 57.29578;
nrad = rad * degcon;
if (xdif < 0) {
nrad = 180 - nrad;
}
nline._rotation = nrad;
nline.gotoAndStop(frame);
nline.unregistered = true;
nline.active = true;
_root.level++;
}
function seekTarget() {
ydif = _root.ship._y - _y;
xdif = _root.ship._x - _x;
dist = Math.sqrt((ydif * ydif) + (xdif * xdif));
degcon = 57.29578;
rad = Math.asin(ydif / dist);
rot = (rad * degcon) + 90;
if (xdif < 0) {
rot = 360 - rot;
}
crot = this._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
if (crot < 0) {
xrot = 0 + (360 - Math.abs(crot));
} else {
xrot = crot;
}
brot = 0;
zrot = xrot - nrot;
if (zrot < 0) {
zrot = zrot + 360;
}
if (zrot <= 180) {
rotate("left", Math.abs(zrot - brot));
} else if (zrot > 180) {
rotate("right", Math.abs(zrot - brot));
}
if (nrot > 180) {
rot = -180 + (nrot - 180);
} else {
rot = nrot;
}
moveForward(9);
}
etimer = 80 + random(20);
currentPos = new Array();
oldPos = new Array(_x, _y);
mex = new Sound();
mex.attachSound("_misexplode");
inum = 0;
}
onClipEvent (enterFrame) {
if (active) {
if (unregistered) {
inum = _root.gob.length;
_root.gob[_root.gob.length] = this;
unregistered = false;
}
htest();
seekTarget();
etimer--;
if (etimer < 0) {
detonate(0);
}
if (this._y < -21) {
this._y = 500;
} else if (this._y > 501) {
this._y = -20;
}
if (this._x < -21) {
this._x = 660;
} else if (this._x > 661) {
this._x = -20;
}
}
}
Instance of Symbol 119 MovieClip "gover" in Frame 3
onClipEvent (load) {
_alpha = 0;
active = false;
}
onClipEvent (enterFrame) {
if (active) {
if (_alpha < 101) {
this._x = 0;
this._y = 120;
this._alpha = this._alpha + 2;
}
if (Key.isDown(13)) {
_root.stopgame();
stopAllSounds();
_y = 500;
_root.gotoAndStop(2);
_root.gameover = false;
_root.paused = false;
}
}
if (Key.isDown(13) && (_root.paused == true)) {
_root.gameover = true;
}
}
Instance of Symbol 121 MovieClip "egen" in Frame 3
onClipEvent (load) {
function make() {
var _local1 = _root;
s = random(_local1.clevel) + 1;
if ((s > 0) && (s < 5)) {
p = random(8);
x = pos[p][0];
y = pos[p][1];
r = pos[p][2];
_local1.spawnEnemy(x, y, 1, r);
} else if ((s > 4) && (s < 10)) {
p = random(8);
x = pos[p][0];
y = pos[p][1];
r = pos[p][2];
_local1.spawnEnemy(x, y, 2, r);
} else if ((s > 9) && (s < 15)) {
p = random(8);
x = pos[p][0];
y = pos[p][1];
r = pos[p][2];
_local1.spawnEnemy(x, y, 3, r);
} else if ((s > 14) && (s < 20)) {
p = random(8);
x = pos[p][0];
y = pos[p][1];
r = pos[p][2];
_local1.spawnEnemy(x, y, 4, r);
} else if (s > 19) {
p = random(8);
x = pos[p][0];
y = pos[p][1];
r = pos[p][2];
_local1.spawnEnemy(x, y, 5, r);
}
}
unregistered = true;
mtimer = 0;
mt = 60;
active = true;
AW = new Sound();
AW.attachSound("_music");
AW.start();
pos = new Array();
pos[0] = new Array(-10, -10, 135);
pos[1] = new Array(650, -10, 225);
pos[2] = new Array(-10, 490, 45);
pos[3] = new Array(650, 490, 315);
pos[4] = new Array(320, -10, 180);
pos[5] = new Array(320, 490, 0);
pos[6] = new Array(-10, 240, 90);
pos[7] = new Array(650, 240, 270);
}
onClipEvent (enterFrame) {
if (active) {
if (unregistered) {
_root.register(this._name, _root.gob);
}
AW.onSoundComplete = function () {
AW.start();
};
mtimer++;
if (mtimer > mt) {
make();
mtimer = 0;
}
_root.sco = _root.sco + Math.ceil((_root.score - _root.sco) / 30);
_root.sco3 = _root.sco / 100000;
_root.sco2 = _root.sco3 - (_root.sco / 100);
_root.sco1 = _root.sco3 - _root.sco2;
}
}
Instance of Symbol 43 MovieClip "enemy2" in Frame 3
onClipEvent (load) {
function seekTarget() {
ydif = _root.ship._y - _y;
xdif = _root.ship._x - _x;
dist = Math.sqrt((ydif * ydif) + (xdif * xdif));
degcon = 57.29578;
rad = Math.asin(ydif / dist);
rot = (rad * degcon) + 90;
if (xdif < 0) {
rot = 360 - rot;
}
crot = this._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
if (crot < 0) {
xrot = 0 + (360 - Math.abs(crot));
} else {
xrot = crot;
}
brot = 0;
zrot = xrot - nrot;
if (zrot < 0) {
zrot = zrot + 360;
}
if (zrot <= 180) {
rotate("left", Math.abs(zrot - brot));
} else if (zrot > 180) {
rotate("right", Math.abs(zrot - brot));
}
if (nrot > 180) {
rot = -180 + (nrot - 180);
} else {
rot = nrot;
}
moveForward(1);
}
function moveForward(speed) {
var _local1 = this;
rot = _local1._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
nrot = nrot * 0.017453;
if (speed > 20) {
var _local2 = 20;
}
if (_local2 < 1) {
var _local2 = 1;
}
rot = _local1._rotation;
xmove = Math.sin(nrot) * _local2;
ymove = Math.cos(nrot) * _local2;
_local1._x = _local1._x + xmove;
_local1._y = _local1._y - ymove;
}
function rotate(dir, need) {
var _local1 = this;
if (need > 2) {
var _local2 = 2;
}
if (dir == "left") {
_local1._rotation = _local1._rotation - _local2;
} else if (dir == "right") {
_local1._rotation = _local1._rotation + _local2;
}
}
function fire(weapon) {
if (weapon == "laser") {
if (ltimer == 0) {
i = 0;
while (i < 3) {
duplicateMovieClip (_root.elaser, "elaser" + _root.level, _root.level);
las = eval ("_root.elaser" + _root.level);
las._x = _x;
las._y = _y;
las.active = true;
las.unregistered = true;
las._rotation = (_rotation - 10) + (i * 10);
ltimer = 30;
_root.level++;
i++;
}
}
} else if (weapon == "") {
if (ltimer == 0) {
duplicateMovieClip (_root.emis, "" + _root.level, _root.level);
las = eval ("" + _root.level);
las._rotation = _rotation - 30;
las._x = las1._x;
las._y = las1._y;
las.active = true;
las.unregistered = true;
_root.level++;
duplicateMovieClip (_root.emis, "" + _root.level, _root.level);
las = eval ("" + _root.level);
las._rotation = _rotation + 30;
las._x = las1._x;
las._y = las1._y;
las.active = true;
las.unregistered = true;
_root.level++;
ltimer = 60;
}
}
}
function detonate() {
duplicateMovieClip (_root.edet, "edet" + _root.level, _root.level);
det = eval ("_root.edet" + _root.level);
det._x = this._x;
det._y = this._y;
det._alpha = 100;
det.active = true;
det.gotoAndPlay(1);
blank = _root.blank;
_root.enemies[anum] = blank;
blank = _root.blank;
_root.gob[inum] = blank;
_root.level++;
exp.start();
ranp = random(3) + 1;
i = 0;
while (i < rp) {
ranp = random(3) + 1;
_root.spawnPowerup(_x, _y, ranp);
i++;
}
_root.score = _root.score + 400;
_root.level++;
this.removeMovieClip();
}
unregistered = true;
hp = 60;
this.getBounds(_root);
ltimer = 0;
ranp = 0;
exp = new Sound();
exp.attachSound("_explosion");
rp = 2;
}
onClipEvent (enterFrame) {
if (active) {
if (unregistered) {
anum = _root.enemies.length;
_root.enemies[_root.enemies.length] = this;
inum = _root.gob.length;
_root.gob[_root.gob.length] = this;
unregistered = false;
}
seekTarget();
f = Math.random() * 100;
if ((f > 0) && (f < 80)) {
fire("laser");
} else if (f > 80) {
fire("");
}
if (this._y < -21) {
this._y = 500;
} else if (this._y > 501) {
this._y = -20;
}
if (this._x < -21) {
this._x = 660;
} else if (this._x > 661) {
this._x = -20;
}
if (ltimer > 0) {
ltimer--;
}
if (hp < 1) {
detonate();
}
}
}
Instance of Symbol 45 MovieClip "enemy3" in Frame 3
onClipEvent (load) {
function seekTarget() {
ydif = _root.ship._y - _y;
xdif = _root.ship._x - _x;
dist = Math.sqrt((ydif * ydif) + (xdif * xdif));
degcon = 57.29578;
rad = Math.asin(ydif / dist);
rot = (rad * degcon) + 90;
if (xdif < 0) {
rot = 360 - rot;
}
crot = this._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
if (crot < 0) {
xrot = 0 + (360 - Math.abs(crot));
} else {
xrot = crot;
}
brot = 0;
zrot = xrot - nrot;
if (zrot < 0) {
zrot = zrot + 360;
}
if (zrot <= 180) {
rotate("left", Math.abs(zrot - brot));
} else if (zrot > 180) {
rotate("right", Math.abs(zrot - brot));
}
if (nrot > 180) {
rot = -180 + (nrot - 180);
} else {
rot = nrot;
}
moveForward(5);
}
function moveForward(speed) {
var _local1 = this;
rot = _local1._rotation;
if (rot < 0) {
nrot = 0 + (360 - Math.abs(rot));
} else {
nrot = rot;
}
nrot = nrot * 0.017453;
if (speed > 15) {
var _local2 = 15;
}
if (_local2 < 1) {
var _local2 = 1;
}
rot = _local1._rotation;
xmove = Math.sin(nrot) * _local2;
ymove = Math.cos(nrot) * _local2;
_local1._x = _local1._x + xmove;
_local1._y = _local1._y - ymove;
}
function rotate(dir, need) {
var _local1 = this;
if (need > 6) {
var _local2 = 6;
}
if (dir == "left") {
_local1._rotation = _local1._rotation - _local2;
} else if (dir == "right") {
_local1._rotation = _local1._rotation + _local2;
}
}
function fire(weapon) {
if (weapon == "laser") {
if (ltimer == 0) {
i = 0;
while (i < 3) {
duplicateMovieClip (_root.elaser, "elaser" + _root.level, _root.level);
las = eval ("_root.elaser" + _root.level);
las._x = _x;
las._y = _y;
las.active = true;
las.unregistered = true;
las._rotation = (_rotation - 10) + (i * 10);
ltimer = 10;
_root.level++;
i++;
}
}
} else if (weapon == "") {
if (ltimer == 0) {
duplicateMovieClip (_root.emis, "" + _root.level, _root.level);
las = eval ("" + _root.level);
las._rotation = _rotation - 30;
las._x = las1._x;
las._y = las1._y;
las.active = true;
las.unregistered = true;
_root.level++;
duplicateMovieClip (_root.emis, "" + _root.level, _root.level);
las = eval ("" + _root.level);
las._rotation = _rotation + 30;
las._x = las1._x;
las._y = las1._y;
las.active = true;
las.unregistered = true;
_root.level++;
ltimer = 20;
}
}
}
function detonate() {
duplicateMovieClip (_root.edet, "edet" + _root.level, _root.level);
det = eval ("_root.edet" + _root.level);
det._x = this._x;
det._y = this._y;
det._alpha = 100;
det.active = true;
det.gotoAndPlay(1);
blank = _root.blank;
_root.enemies[anum] = blank;
blank = _root.blank;
_root.gob[inum] = blank;
_root.level++;
exp.start();
ranp = random(3) + 1;
i = 0;
while (i < rp) {
ranp = random(3) + 1;
_root.spawnPowerup(_x, _y, ranp);
i++;
}
_root.score = _root.score + 600;
_root.level++;
this.removeMovieClip();
}
unregistered = true;
hp = 40;
this.getBounds(_root);
ltimer = 0;
ranp = 0;
exp = new Sound();
exp.attachSound("_explosion");
rp = 3;
inum = 0;
}
onClipEvent (enterFrame) {
if (active) {
if (unregistered) {
anum = _root.enemies.length;
_root.enemies[_root.enemies.length] = this;
inum = _root.gob.length;
_root.gob[_root.gob.length] = this;
unregistered = false;
}
seekTarget();
f = Math.random() * 100;
if ((f > 0) && (f < 80)) {
fire("laser");
} else if (f > 80) {
fire("");
}
if (this._y < -21) {
this._y = 500;
} else if (this._y > 501) {
this._y = -20;
}
if (this._x < -21) {
this._x = 660;
} else if (this._x > 661) {
this._x = -20;
}
if (ltimer > 0) {
ltimer--;
}
if (hp < 1) {
detonate();
}
}
}
Instance of Symbol 123 MovieClip "blank" in Frame 3
onClipEvent (load) {
anum = 100;
}
Symbol 18 Button
on (release) {
getURL ("http://www.pixelz.co.nr", _blank);
}
Symbol 34 Button
on (release) {
_root.play();
}
Symbol 35 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop ("loaded");
}
Symbol 35 MovieClip Frame 2
gotoAndPlay (1);
Instance of Symbol 42 MovieClip "las1" in Symbol 43 MovieClip Frame 1
onClipEvent (load) {
point = new Object();
}
onClipEvent (enterFrame) {
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
x = point.x;
y = point.y;
}
Instance of Symbol 42 MovieClip "las2" in Symbol 43 MovieClip Frame 1
onClipEvent (load) {
point = new Object();
}
onClipEvent (enterFrame) {
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
x = point.x;
y = point.y;
}
Instance of Symbol 42 MovieClip "las1" in Symbol 45 MovieClip Frame 1
onClipEvent (load) {
point = new Object();
}
onClipEvent (enterFrame) {
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
x = point.x;
y = point.y;
}
Instance of Symbol 42 MovieClip "las2" in Symbol 45 MovieClip Frame 1
onClipEvent (load) {
point = new Object();
}
onClipEvent (enterFrame) {
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
x = point.x;
y = point.y;
}
Symbol 51 Button
on (release) {
_root.gotoAndStop(3);
}
Instance of Symbol 53 MovieClip "lflame" in Symbol 55 MovieClip Frame 1
onClipEvent (enterFrame) {
if (thrust) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 53 MovieClip "rflame" in Symbol 55 MovieClip Frame 1
onClipEvent (enterFrame) {
if (thrust) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 42 MovieClip "las1" in Symbol 55 MovieClip Frame 1
onClipEvent (load) {
point = new Object();
}
onClipEvent (enterFrame) {
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
x = point.x;
y = point.y;
}
Instance of Symbol 42 MovieClip "las2" in Symbol 55 MovieClip Frame 1
onClipEvent (load) {
point = new Object();
}
onClipEvent (enterFrame) {
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
x = point.x;
y = point.y;
}
Symbol 60 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 8
this.removeMovieClip();
Symbol 84 MovieClip Frame 11
this.removeMovieClip();
Instance of Symbol 93 MovieClip "sbar" in Symbol 95 MovieClip Frame 1
onClipEvent (enterFrame) {
_xscale = _root.ship.sheild;
}
Symbol 107 MovieClip Frame 10
this.removeMovieClip();
Instance of Symbol 111 MovieClip in Symbol 112 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = this._rotation + 40;
}