Frame 1
function draw(targ, xp, yp, arr) {
y = 0;
while (y < arr.length) {
x = 0;
while (x < arr[y].length) {
if (arr[y][x] != 0) {
mc = targ.attachMovie("drawdot", "d" + drawLevel, drawLevel++);
mc._x = xp + (x * 5);
mc._y = yp + (y * 5);
mc.gotoAndStop(arr[y][x]);
}
x++;
}
y++;
}
}
function rect(targ, xp, yp, w, h, c) {
var _local1 = 0;
while (_local1 < w) {
mc = targ.attachMovie("drawdot", "d" + drawLevel, drawLevel++);
mc._x = xp + (_local1 * 5);
mc._y = yp;
mc.gotoAndStop(c);
_local1++;
}
_local1 = 0;
while (_local1 < w) {
mc = targ.attachMovie("drawdot", "d" + drawLevel, drawLevel++);
mc._x = xp + (_local1 * 5);
mc._y = yp + ((h - 1) * 5);
mc.gotoAndStop(c);
_local1++;
}
_local1 = 0;
while (_local1 < h) {
mc = targ.attachMovie("drawdot", "d" + drawLevel, drawLevel++);
mc._x = xp;
mc._y = yp + (_local1 * 5);
mc.gotoAndStop(c);
_local1++;
}
_local1 = 0;
while (_local1 < h) {
mc = targ.attachMovie("drawdot", "d" + drawLevel, drawLevel++);
mc._x = xp + ((w - 1) * 5);
mc._y = yp + (_local1 * 5);
mc.gotoAndStop(c);
_local1++;
}
}
function write(targ, xp, yp, clr, str) {
i = 0;
while (i < str.length) {
c = str.charAt(i);
v = str.charCodeAt(i) - 97;
if (c == " ") {
} else {
if (c == ".") {
v = 26;
} else if (c == "-") {
v = 27;
} else if (c == "!") {
v = 28;
}
arr = chrs[v];
y = 0;
while (y < arr.length) {
x = 0;
while (x < arr[y].length) {
if (arr[y][x] != 0) {
arr[y][x] = clr;
}
x++;
}
y++;
}
_root.draw(targ, xp + (i * 20), yp, chrs[v]);
}
i++;
}
}
function setBar(bar, val) {
if (val >= 100) {
bar.gotoAndStop(22);
} else if (val <= 0) {
bar.gotoAndStop(1);
} else {
bar.gotoAndStop(Math.round(val / 5) + 1);
}
}
function reset() {
for (m in _root) {
m.swapDepths(0);
m.removeMovieClip();
}
}
drawLevel = 0;
_quality = "MEDIUM";
key = new Object();
key.onKeyDown = function () {
k = Key.getCode();
if (k == 32) {
psd = !psd;
} else if (k == 77) {
if (mus) {
stopMusic();
} else {
startMusic();
}
}
};
Key.addListener(key);
chrs = new Array(new Array(new Array(0, 1, 0), new Array(1, 0, 1), new Array(1, 1, 1), new Array(1, 0, 1), new Array(1, 0, 1)), new Array(new Array(1, 1, 0), new Array(1, 0, 1), new Array(1, 1, 1), new Array(1, 0, 1), new Array(1, 1, 1)), new Array(new Array(1, 1, 1), new Array(1, 0, 0), new Array(1, 0, 0), new Array(1, 0, 0), new Array(1, 1, 1)), new Array(new Array(1, 1, 0), new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 1, 1)), new Array(new Array(1, 1, 1), new Array(1, 0, 0), new Array(1, 1, 1), new Array(1, 0, 0), new Array(1, 1, 1)), new Array(new Array(1, 1, 1), new Array(1, 0, 0), new Array(1, 1, 1), new Array(1, 0, 0), new Array(1, 0, 0)), new Array(new Array(1, 1, 1), new Array(1, 0, 0), new Array(1, 1, 1), new Array(1, 0, 1), new Array(1, 1, 1)), new Array(new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 1, 1), new Array(1, 0, 1), new Array(1, 0, 1)), new Array(new Array(1, 1, 1), new Array(0, 1, 0), new Array(0, 1, 0), new Array(0, 1, 0), new Array(1, 1, 1)), new Array(new Array(0, 0, 1), new Array(0, 0, 1), new Array(0, 0, 1), new Array(1, 0, 1), new Array(1, 1, 1)), new Array(new Array(1, 0, 1), new Array(1, 1, 0), new Array(1, 1, 0), new Array(1, 0, 1), new Array(1, 0, 1)), new Array(new Array(1, 0, 0), new Array(1, 0, 0), new Array(1, 0, 0), new Array(1, 0, 0), new Array(1, 1, 1)), new Array(new Array(1, 0, 1), new Array(1, 1, 1), new Array(1, 1, 1), new Array(1, 0, 1), new Array(1, 0, 1)), new Array(new Array(0, 0, 1), new Array(1, 0, 1), new Array(1, 1, 1), new Array(1, 1, 1), new Array(1, 0, 1)), new Array(new Array(1, 1, 1), new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 1, 1)), new Array(new Array(1, 1, 1), new Array(1, 0, 1), new Array(1, 1, 1), new Array(1, 0, 0), new Array(1, 0, 0)), new Array(new Array(0, 1, 0), new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 1, 1), new Array(0, 1, 1)), new Array(new Array(1, 1, 0), new Array(1, 0, 1), new Array(1, 1, 1), new Array(1, 0, 1), new Array(1, 0, 1)), new Array(new Array(1, 1, 1), new Array(1, 0, 0), new Array(1, 1, 1), new Array(0, 0, 1), new Array(1, 1, 1)), new Array(new Array(1, 1, 1), new Array(0, 1, 0), new Array(0, 1, 0), new Array(0, 1, 0), new Array(0, 1, 0)), new Array(new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 1, 1)), new Array(new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 0, 1), new Array(0, 1, 0)), new Array(new Array(1, 0, 1), new Array(1, 0, 1), new Array(1, 1, 1), new Array(1, 1, 1), new Array(1, 0, 1)), new Array(new Array(1, 0, 1), new Array(1, 0, 1), new Array(0, 1, 0), new Array(1, 0, 1), new Array(1, 0, 1)), new Array(new Array(1, 0, 1), new Array(1, 0, 1), new Array(0, 1, 0), new Array(0, 1, 0), new Array(0, 1, 0)), new Array(new Array(1, 1, 1), new Array(0, 0, 1), new Array(1, 1, 1), new Array(1, 0, 0), new Array(1, 1, 1)), new Array(new Array(0, 0, 0), new Array(0, 0, 0), new Array(0, 0, 0), new Array(0, 0, 0), new Array(0, 1, 0)), new Array(new Array(0, 0, 0), new Array(0, 0, 0), new Array(1, 1, 1), new Array(0, 0, 0), new Array(0, 0, 0)), new Array(new Array(0, 1, 0), new Array(0, 1, 0), new Array(0, 1, 0), new Array(0, 0, 0), new Array(0, 1, 0)));
ixil = new Array(new Array(1, 1, 1, 1, 1, 1, 1, 1, 2), new Array(1, 1, 1, 1, 1, 1, 1, 1, 2), new Array(0, 0, 0, 1, 1, 2, 0, 0, 0, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 1, 2), new Array(0, 0, 0, 1, 1, 2, 0, 0, 0, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 1, 2), new Array(0, 0, 0, 1, 1, 2, 0, 0, 0, 0, 0, 1, 2, 1, 2, 0, 0, 0, 0, 0, 1, 2), new Array(0, 0, 0, 1, 1, 2, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 1, 2, 0, 1, 2), new Array(0, 0, 0, 1, 1, 2, 0, 0, 0, 0, 0, 1, 2, 1, 2, 0, 0, 1, 2, 0, 1, 2), new Array(1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 1, 2), new Array(1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 1, 2), new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), new Array(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2));
_root.write(_root.preloader, 150, 330, 1, "loading...");
_root.write(_root.preloader, 20, 430, 2, "tim defrag-armor games");
_root.draw(_root.preloader, 185, 20, ixil);
onEnterFrame = function () {
nl = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
v1 = nl * 4;
nl = nl - 25;
v2 = nl * 4;
nl = nl - 25;
v3 = nl * 4;
nl = nl - 25;
v4 = nl * 4;
nl = nl - 25;
setBar(_root.a1, v1);
setBar(_root.a2, v1);
setBar(_root.b1, v2);
setBar(_root.b2, v2);
setBar(_root.c1, v3);
setBar(_root.c2, v3);
setBar(_root.d1, v4);
setBar(_root.d2, v4);
if (nl == 0) {
_root.gotoAndStop(2);
}
};
stop();
Instance of Symbol 37 MovieClip in Frame 1
onClipEvent (load) {
turrets = new Array();
life = 0;
r = 0;
i = 0;
while (i < 6) {
mc = _root["leg" + i];
turrets.push(mc);
turrets[i].owner = this;
turrets[i].offset = i;
i++;
}
}
onClipEvent (enterFrame) {
i = 0;
while (i < turrets.length) {
turrets[i]._x = _x + (Math.sin(((i * Math.PI) * 0.33) + r) * 90);
turrets[i]._y = _y + (Math.cos(((i * Math.PI) * 0.33) + r) * 90);
i++;
}
r = r + 0.0314159265358979;
if (r > (Math.PI*2)) {
r = r - (Math.PI*2);
}
}
Instance of Symbol 42 MovieClip "leg2" in Frame 1
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x, _y, 1, 20);
this.removeMovieClip();
}
health = 40;
life = 0;
targetable = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 1;
while (i < 3) {
body["p" + i]._x = (i * 5) * Math.sin(rot);
body["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if ((life % ((owner.c * 10) + (offset * 3))) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
if (health <= 0) {
detonate();
}
life++;
}
}
Instance of Symbol 42 MovieClip "leg5" in Frame 1
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x, _y, 1, 20);
this.removeMovieClip();
}
health = 40;
life = 0;
targetable = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 1;
while (i < 3) {
body["p" + i]._x = (i * 5) * Math.sin(rot);
body["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if ((life % ((owner.c * 10) + (offset * 3))) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
if (health <= 0) {
detonate();
}
life++;
}
}
Instance of Symbol 42 MovieClip "leg1" in Frame 1
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x, _y, 1, 20);
this.removeMovieClip();
}
health = 40;
life = 0;
targetable = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 1;
while (i < 3) {
body["p" + i]._x = (i * 5) * Math.sin(rot);
body["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if ((life % ((owner.c * 10) + (offset * 3))) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
if (health <= 0) {
detonate();
}
life++;
}
}
Instance of Symbol 42 MovieClip "leg4" in Frame 1
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x, _y, 1, 20);
this.removeMovieClip();
}
health = 40;
life = 0;
targetable = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 1;
while (i < 3) {
body["p" + i]._x = (i * 5) * Math.sin(rot);
body["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if ((life % ((owner.c * 10) + (offset * 3))) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
if (health <= 0) {
detonate();
}
life++;
}
}
Instance of Symbol 42 MovieClip "leg0" in Frame 1
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x, _y, 1, 20);
this.removeMovieClip();
}
health = 40;
life = 0;
targetable = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 1;
while (i < 3) {
body["p" + i]._x = (i * 5) * Math.sin(rot);
body["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if ((life % ((owner.c * 10) + (offset * 3))) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
if (health <= 0) {
detonate();
}
life++;
}
}
Instance of Symbol 42 MovieClip "leg3" in Frame 1
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x, _y, 1, 20);
this.removeMovieClip();
}
health = 40;
life = 0;
targetable = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 1;
while (i < 3) {
body["p" + i]._x = (i * 5) * Math.sin(rot);
body["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if ((life % ((owner.c * 10) + (offset * 3))) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
if (health <= 0) {
detonate();
}
life++;
}
}
Frame 2
onEnterFrame = null;
Frame 3
stopAllSounds();
function addStrafer() {
if (stcount == 0) {
strf.start();
}
stcount++;
}
function loseStrafer() {
stcount--;
}
function startMusic() {
mus = true;
msnd.start();
}
function stopMusic() {
mus = false;
msnd.stop();
}
Mouse.hide();
stop();
mus = true;
var msnd = new Sound();
msnd.attachSound("music");
var shoot = new Sound();
shoot.attachSound("pew");
var death = new Sound();
death.attachSound("die");
var pwrup = new Sound();
pwrup.attachSound("powerup");
var strf = new Sound();
strf.attachSound("strafer");
_root.rect(_root.menu, 72, 180, 67, 13, 1);
_root.write(_root.sm1, 20, 20, 2, "play!");
_root.write(_root.sm2, 20, 20, 1, "play!");
_root.rect(_root.menu, 72, 340, 67, 13, 1);
_root.write(_root.pmg1, 20, 20, 2, "play more games");
_root.write(_root.pmg2, 20, 20, 1, "play more games");
_root.draw(_root.menu, 185, 60, _root.ixil);
stcount = 0;
strf.onSoundComplete = function () {
if (stcount > 0) {
strf.start();
}
};
msnd.onSoundComplete = function () {
if (mus) {
startMusic();
}
};
startMusic();
Instance of Symbol 56 MovieClip in Frame 3
onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
}
Frame 4
function clearAll() {
for (mc in _root) {
d = _root[mc].getDepth();
if ((d > -1) && (d < 1000000)) {
_root[mc].removeMovieClip();
}
}
}
function gotoMenu() {
for (mc in _root) {
_root[mc].swapDepths(0);
_root[mc].removeMovieClip();
}
gotoAndStop (3);
}
function reset() {
nextSpawn = 0;
stcount = 0;
time = 0;
edepth = 0;
enemies = new Array();
psd = false;
tgt = true;
deadtimer = 0;
isboss = false;
bossnum = 0;
evalue = 0;
_root.tank.reset();
}
function spawnEnemy(x, y, t) {
spawnEnemyAt((x * 520) - 20, (y * 520) - 20, t);
}
function spawnEnemyAt(x, y, t) {
duplicateMovieClip (t, "e" + edepth, edepth);
mc = _root["e" + edepth];
mc._x = x;
mc._y = y;
mc.alive = true;
enemies.push(mc);
edepth++;
return(mc);
}
function spawnPowerup(x, y, t, a) {
spawnPowerupAt((x * 520) - 20, (y * 520) - 20, t, a);
}
function spawnPowerupAt(x, y, t, a) {
duplicateMovieClip (_root.powerup, "p" + edepth, edepth);
mc = _root["p" + edepth];
mc._x = x;
mc._y = y;
if (t == 0) {
mc.mc.gotoAndStop(1);
} else if (t >= 10) {
mc.mc.gotoAndStop(t + 2);
} else {
mc.mc.gotoAndStop(t * 2);
}
mc.type = t;
mc.alive = true;
mc.amt = a;
xd = 240 - x;
yd = 240 - y;
d = Math.sqrt((xd * xd) + (yd * yd));
mc.vx = (xd / d) * 1.5;
mc.vy = (yd / d) * 1.5;
edepth++;
}
function doLevel(lev) {
if (lev <= 10) {
if (lev == 1) {
spawnEnemy(0, 0.5, "drone");
spawnEnemy(1, 0.5, "drone");
} else if (lev == 2) {
spawnEnemy(0, 0.25, "drone");
spawnEnemy(1, 0.25, "drone");
spawnEnemy(0, 0.75, "drone");
spawnEnemy(1, 0.75, "drone");
} else if (lev == 3) {
spawnEnemy(0, 0.25, "drone");
spawnEnemy(1, 0.25, "drone");
spawnEnemy(0.5, 1, "grunt");
} else if (lev == 4) {
spawnEnemy(0, 0.25, "grunt");
spawnEnemy(1, 0.25, "drone");
spawnEnemy(0, 0.75, "drone");
spawnEnemy(1, 0.75, "grunt");
} else if (lev == 5) {
spawnEnemy(0, 0.25, "drone");
spawnEnemy(1, 0.25, "drone");
spawnEnemy(0, 0.75, "drone");
spawnEnemy(1, 0.75, "drone");
spawnEnemy(0.5, 0, "drone");
spawnEnemy(0.5, 1, "drone");
spawnEnemy(1, 1, "grunt");
} else if (lev == 6) {
spawnEnemy(0, 0.25, "grunt");
spawnEnemy(1, 0.25, "grunt");
spawnEnemy(0.5, 1, "grunt");
} else if (lev == 7) {
spawnEnemy(0.5, 0, "grunt");
spawnEnemy(0.5, 1, "enforcer");
} else if (lev == 8) {
spawnEnemy(0, 0.25, "grunt");
spawnEnemy(1, 0.25, "grunt");
spawnEnemy(0.5, 1, "enforcer");
} else if (lev == 9) {
spawnEnemy(0, 0, "enforcer");
spawnEnemy(1, 0, "enforcer");
spawnEnemy(0.5, 0, "enforcer");
} else if (lev == 10) {
spawnPowerup(0.5, 1, 12, 100);
_root.bonus.life = 100;
spawnEnemy(0, 0, "enforcer");
spawnEnemy(1, 0, "enforcer");
spawnEnemy(0.5, 0, "enforcer");
spawnEnemy(0, 1, "enforcer");
spawnEnemy(1, 1, "enforcer");
spawnEnemy(0, 0.5, "enforcer");
spawnEnemy(1, 0.5, "enforcer");
spawnEnemy(0.25, 0, "grunt");
spawnEnemy(0.75, 0, "grunt");
spawnEnemy(0.25, 1, "grunt");
spawnEnemy(0.75, 1, "grunt");
}
} else if (lev <= 20) {
if (lev == 11) {
spawnEnemy(0, 0.25, "grunt");
spawnEnemy(0, 0.75, "grunt");
spawnEnemy(1, 0.25, "grunt");
spawnEnemy(1, 0.75, "grunt");
spawnEnemy(0.5, 0, "enforcer");
} else if (lev == 12) {
spawnEnemy(0.25, 1, "enforcer");
spawnEnemy(0.75, 1, "enforcer");
spawnEnemy(0.2, 0, "drone");
spawnEnemy(0.4, 0, "drone");
spawnEnemy(0.5, 0, "drone");
spawnEnemy(0.6, 0, "drone");
spawnEnemy(0.8, 0, "drone");
spawnPowerup(0, 0.5, 0, 25);
} else if (lev == 13) {
spawnEnemy(0.5, 0, "enforcer");
spawnEnemy(0, 0.3, "drone");
spawnEnemy(0, 0.5, "grunt");
spawnEnemy(0, 0.7, "drone");
spawnEnemy(1, 0.3, "drone");
spawnEnemy(1, 0.5, "grunt");
spawnEnemy(1, 0.7, "drone");
} else if (lev == 14) {
spawnEnemy(0.2, 1, "grunt");
spawnEnemy(0.4, 1, "grunt");
spawnEnemy(0.6, 1, "grunt");
spawnEnemy(0.8, 1, "grunt");
spawnEnemy(0.25, 0, "enforcer");
spawnEnemy(0.75, 0, "enforcer");
spawnPowerup(0, 0.5, 0, 40);
} else if (lev == 15) {
spawnEnemy(0.5, 0, "enforcer");
spawnEnemy(0, 0.3, "grunt");
spawnEnemy(0, 0.5, "drone");
spawnEnemy(0, 0.7, "grunt");
spawnEnemy(1, 0.3, "grunt");
spawnEnemy(1, 0.5, "drone");
spawnEnemy(1, 0.7, "grunt");
} else if (lev == 16) {
spawnEnemy(0.3, 1, "enforcer");
spawnEnemy(0.7, 1, "enforcer");
spawnEnemy(0.3, 0, "enforcer");
spawnEnemy(0.7, 0, "enforcer");
spawnEnemy(1, 0.5, "enforcer");
spawnPowerup(0, 0.5, 0, 40);
} else if (lev == 17) {
spawnEnemy(1, 0.75, "grunt");
spawnEnemy(1, 1, "grunt");
spawnEnemy(0.75, 1, "grunt");
spawnEnemy(0, 0.25, "enforcer");
spawnEnemy(0.25, 0, "enforcer");
spawnEnemy(0, 1, "drone");
spawnEnemy(1, 0, "drone");
} else if (lev == 18) {
spawnEnemy(0.25, 1, "grunt");
spawnEnemy(0.75, 0, "grunt");
spawnEnemy(1, 0.25, "grunt");
spawnEnemy(0, 0.75, "grunt");
spawnEnemy(0.5, 1, "enforcer");
spawnEnemy(0.5, 0, "enforcer");
spawnEnemy(1, 0.5, "enforcer");
spawnEnemy(0, 0.5, "enforcer");
spawnPowerup(0, 0.5, 0, 40);
} else if (lev == 19) {
spawnEnemy(0.25, 0, "drone");
spawnEnemy(0.5, 0, "drone");
spawnEnemy(0.75, 0, "drone");
spawnEnemy(0.25, 1, "drone");
spawnEnemy(0.5, 1, "drone");
spawnEnemy(0.75, 1, "drone");
spawnEnemy(0, 0.25, "drone");
spawnEnemy(0, 0.5, "drone");
spawnEnemy(0, 0.75, "drone");
spawnEnemy(1, 0.25, "drone");
spawnEnemy(1, 0.5, "drone");
spawnEnemy(1, 0.75, "drone");
} else if (lev == 20) {
spawnPowerup(0.5, 1, 0, 50);
spawnEnemy(0.5, -0.25, "boss1");
_root.boss.life = 100;
}
} else if (lev <= 30) {
if (lev == 21) {
spawnEnemy(0.25, 0, "grunt");
spawnEnemy(0.5, 0, "grunt");
spawnEnemy(0.75, 0, "grunt");
spawnEnemy(0, 1, "enforcer");
spawnEnemy(1, 1, "enforcer");
spawnPowerup(0.5, 1, 2, 25);
} else if (lev == 22) {
spawnEnemy(0.25, 0, "grunt");
spawnEnemy(0.75, 0, "grunt");
spawnEnemy(0, 0.75, "corvette");
} else if (lev == 23) {
spawnEnemy(0.5, 0, "enforcer");
spawnEnemy(0, 0.25, "corvette");
spawnEnemy(1, 0.75, "corvette");
} else if (lev == 24) {
spawnEnemy(0.25, 0, "grunt");
spawnEnemy(0.5, 0, "grunt");
spawnEnemy(0.75, 0, "grunt");
spawnEnemy(1, 0.9, "corvette");
} else if (lev == 25) {
spawnEnemy(0.25, 0, "drone");
spawnEnemy(0.5, 0, "drone");
spawnEnemy(0.75, 0, "drone");
spawnEnemy(0.25, 1, "drone");
spawnEnemy(0.5, 1, "drone");
spawnEnemy(0.75, 1, "drone");
spawnEnemy(1, 0.2, "corvette");
spawnEnemy(0, 0.8, "corvette");
} else if (lev == 26) {
spawnEnemy(1, 0.2, "corvette");
spawnEnemy(0, 0.8, "corvette");
spawnEnemy(0, 0.25, "grunt");
spawnEnemy(1, 0.25, "enforcer");
spawnEnemy(0, 0.75, "grunt");
spawnEnemy(1, 0.75, "enforcer");
spawnPowerup(0.5, 1, 10, 40);
} else if (lev == 27) {
spawnEnemy(0.25, 0, "dronefactory");
spawnEnemy(1, 0.25, "enforcer");
spawnEnemy(1, 1, "enforcer");
spawnEnemy(1, 0.5, "corvette");
} else if (lev == 28) {
spawnEnemy(0.25, 0, "dronefactory");
spawnEnemy(0.75, 1, "dronefactory");
spawnEnemy(1, 0.2, "corvette");
spawnEnemy(0, 0.8, "corvette");
} else if (lev == 29) {
spawnEnemy(1, 0.4, "dronefactory");
spawnEnemy(0, 0.6, "dronefactory");
spawnEnemy(1, 0.5, "corvette");
spawnEnemy(1, 0.75, "enforcer");
spawnEnemy(0, 0.25, "enforcer");
spawnEnemy(0.25, 0, "enforcer");
spawnEnemy(0.75, 1, "enforcer");
spawnPowerup(0.5, 0, 0, 40);
spawnPowerup(0.5, 1, 2, 40);
} else if (lev == 30) {
spawnPowerup(0.5, 1, 12, 100);
_root.bonus.life = 100;
spawnEnemy(1, 0.1, "corvette");
spawnEnemy(1, 0.2, "corvette");
spawnEnemy(1, 0.3, "corvette");
spawnEnemy(0, 0.9, "corvette");
spawnEnemy(0, 0.8, "corvette");
spawnEnemy(0, 0.7, "corvette");
spawnEnemy(0.4, 0, "dronefactory");
spawnEnemy(0.6, 1, "dronefactory");
spawnEnemy(0.9, 1, "enforcer");
spawnEnemy(0.8, 1, "enforcer");
spawnEnemy(0.1, 0, "enforcer");
spawnEnemy(0.2, 0, "enforcer");
}
} else if (lev <= 40) {
if (lev == 31) {
spawnEnemy(1, 0.2, "dronefactory");
spawnEnemy(0, 0.6, "corvette");
spawnEnemy(0, 0.8, "corvette");
spawnEnemy(1, 0.75, "grunt");
spawnEnemy(1, 1, "grunt");
} else if (lev == 32) {
spawnEnemy(0, 0, "grunt");
spawnEnemy(0, 0.25, "grunt");
spawnEnemy(0.25, 0, "grunt");
spawnEnemy(0.25, 1, "enforcer");
spawnEnemy(0, 0.6, "corvette");
spawnEnemy(1, 0.8, "corvette");
} else if (lev == 33) {
spawnEnemy(0, 0.1, "corvette");
spawnEnemy(0, 0.2, "corvette");
spawnEnemy(0, 0.3, "corvette");
spawnEnemy(0.25, 1, "dronefactory");
spawnEnemy(0.75, 1, "dronefactory");
} else if (lev == 34) {
spawnEnemy(0.25, 0, "enforcer");
spawnEnemy(0, 0.25, "enforcer");
spawnEnemy(0.75, 0, "enforcer");
spawnEnemy(0, 0.75, "enforcer");
spawnEnemy(0.5, 0, "dronefactory");
spawnEnemy(0.5, 1, "dronefactory");
} else if (lev == 35) {
spawnEnemy(0, 0.25, "corvette");
spawnEnemy(1, 0.75, "corvette");
spawnEnemy(0.2, 1, "grunt");
spawnEnemy(0.4, 1, "grunt");
spawnEnemy(0.6, 1, "grunt");
spawnEnemy(0.8, 1, "grunt");
spawnEnemy(0, 0, "dronefactory");
} else if (lev == 36) {
spawnEnemy(0, 0.2, "enforcer");
spawnEnemy(0, 0.4, "enforcer");
spawnEnemy(0, 0.6, "enforcer");
spawnEnemy(0, 0.8, "enforcer");
spawnEnemy(1, 0.25, "grunt");
spawnEnemy(1, 0.75, "grunt");
spawnEnemy(0, 0.5, "dronefactory");
} else if (lev == 37) {
spawnEnemy(0, 0.4, "dronefactory");
spawnEnemy(1, 0.6, "dronefactory");
spawnEnemy(0.4, 1, "dronefactory");
spawnEnemy(0.6, 0, "dronefactory");
} else if (lev == 38) {
spawnEnemy(0, 0.2, "enforcer");
spawnEnemy(0, 0.4, "enforcer");
spawnEnemy(0, 0.6, "enforcer");
spawnEnemy(0, 0.8, "enforcer");
spawnEnemy(1, 0.2, "grunt");
spawnEnemy(1, 0.4, "grunt");
spawnEnemy(1, 0.6, "grunt");
spawnEnemy(1, 0.8, "grunt");
spawnPowerup(0.5, 1, 2, 100);
} else if (lev == 39) {
spawnEnemy(0, 0.1, "corvette");
spawnEnemy(1, 0.3, "corvette");
spawnEnemy(0, 0.5, "corvette");
spawnEnemy(1, 0.7, "corvette");
spawnEnemy(0, 0.9, "corvette");
} else if (lev == 40) {
spawnEnemy(0.5, -0.25, "boss2");
spawnPowerup(0.5, 1, 2, 100);
_root.boss.life = 100;
}
} else if (lev <= 50) {
if (lev == 41) {
spawnEnemy(1, 0, "enforcer");
spawnEnemy(0.5, 0, "enforcer");
spawnEnemy(0, 0, "enforcer");
spawnEnemy(1, 0.25, "corvette");
spawnEnemy(0, 0.8, "dronefactory");
spawnPowerup(0.5, 1, 3, 25);
spawnPowerup(0.5, 0, 11, 50);
} else if (lev == 42) {
spawnEnemy(0.25, 0, "strafer");
spawnEnemy(1, 0.25, "corvette");
spawnEnemy(1, 0.5, "enforcer");
} else if (lev == 43) {
spawnEnemy(0.25, 1, "strafer");
spawnEnemy(0.75, 0, "strafer");
spawnEnemy(1, 0.25, "corvette");
spawnEnemy(0, 0.75, "corvette");
spawnEnemy(0, 0.8, "dronefactory");
spawnEnemy(1, 0.6, "enforcer");
spawnEnemy(1, 0.8, "enforcer");
spawnPowerup(0.5, 0, 0, 25);
} else if (lev == 44) {
spawnEnemy(0.2, 1, "strafer");
spawnEnemy(0.6, 1, "strafer");
spawnEnemy(0.4, 0, "strafer");
spawnEnemy(0.8, 0, "strafer");
spawnEnemy(0, 0.6, "dronefactory");
spawnEnemy(1, 0.4, "dronefactory");
spawnPowerup(0.5, 0, 11, 50);
} else if (lev == 45) {
spawnEnemy(0.5, 0, "frigate");
spawnEnemy(0.25, 1, "strafer");
spawnEnemy(0.75, 0, "strafer");
spawnEnemy(0, 0.75, "corvette");
} else if (lev == 46) {
spawnEnemy(0.6, 0, "frigate");
spawnEnemy(0, 0.6, "frigate");
spawnEnemy(0.75, 1, "strafer");
spawnEnemy(0.25, 0, "strafer");
spawnEnemy(0, 0.75, "corvette");
spawnEnemy(1, 0.25, "corvette");
spawnPowerup(0.5, 0, 11, 50);
spawnPowerup(0.5, 1, 0, 25);
} else if (lev == 47) {
spawnEnemy(0.6, 0, "frigate");
spawnEnemy(0, 0.6, "frigate");
spawnEnemy(1, 0.4, "dronefactory");
spawnEnemy(0.4, 1, "dronefactory");
spawnEnemy(1, 0.25, "corvette");
spawnEnemy(1, 0.75, "corvette");
} else if (lev == 48) {
spawnEnemy(0.6, 0, "frigate");
spawnEnemy(0, 0.6, "frigate");
spawnEnemy(1, 0.4, "frigate");
spawnEnemy(0.4, 1, "frigate");
spawnEnemy(1, 0.25, "corvette");
spawnEnemy(0.75, 1, "strafer");
spawnEnemy(0.25, 0, "strafer");
spawnPowerup(0.5, 1, 11, 50);
spawnPowerup(0.5, 0, 10, 25);
} else if (lev == 49) {
spawnEnemy(1, 0.2, "corvette");
spawnEnemy(1, 0.6, "corvette");
spawnEnemy(0, 0.4, "corvette");
spawnEnemy(0, 0.8, "corvette");
spawnEnemy(0.2, 0, "strafer");
spawnEnemy(0.6, 0, "strafer");
spawnEnemy(0.4, 1, "strafer");
spawnEnemy(0.8, 1, "strafer");
} else if (lev == 50) {
spawnPowerup(0.5, 1, 12, 60);
_root.bonus.life = 100;
}
} else if (lev <= 60) {
if (lev == 51) {
} else if (lev == 52) {
} else if (lev == 53) {
} else if (lev == 54) {
} else if (lev == 55) {
} else if (lev == 56) {
} else if (lev == 57) {
} else if (lev == 58) {
} else if (lev == 59) {
} else if (lev == 60) {
_root.boss.life = 100;
}
} else if (lev <= 70) {
if (lev == 61) {
spawnPowerup(0.5, 1, 12, 100);
spawnEnemy(1, 0.25, "triad");
spawnEnemy(0, 0.75, "triad");
spawnEnemy(0.25, 0, "warship");
spawnEnemy(0.75, 1, "warship");
} else if (lev == 62) {
} else if (lev == 63) {
} else if (lev == 64) {
} else if (lev == 65) {
} else if (lev == 66) {
} else if (lev == 67) {
} else if (lev == 68) {
} else if (lev == 69) {
} else if (lev == 70) {
spawnPowerup(0.5, 1, 12, 60);
_root.bonus.life = 100;
}
} else if (lev <= 80) {
if (lev == 71) {
} else if (lev == 72) {
} else if (lev == 73) {
} else if (lev == 74) {
} else if (lev == 75) {
} else if (lev == 76) {
} else if (lev == 77) {
} else if (lev == 78) {
} else if (lev == 79) {
} else if (lev == 80) {
_root.boss.life = 100;
}
}
}
stop();
reset();
arw = new Array(new Array(2, 0, 0, 0, 0, 0, 2), new Array(2, 2, 0, 0, 0, 2, 2), new Array(0, 2, 2, 0, 2, 2), new Array(0, 0, 2, 2, 2), new Array(0, 0, 0, 2));
arw2 = new Array(new Array(0, 0, 0, 2), new Array(0, 0, 2, 2, 2), new Array(0, 2, 2, 0, 2, 2), new Array(2, 2, 0, 0, 0, 2, 2), new Array(2, 0, 0, 0, 0, 0, 2));
_root.rect(_root.bonus, 0, 0, 23, 9, 2);
_root.write(_root.bonus, 10, 10, 2, "bonus");
_root.rect(_root.boss, 0, 0, 20, 9, 2);
_root.write(_root.boss, 10, 10, 2, "boss");
_root.bonus._x = 240 - (_root.bonus._width / 2);
_root.bonus._y = 240 - (_root.bonus._height / 2);
_root.boss._x = 240 - (_root.boss._width / 2);
_root.boss._y = 240 - (_root.boss._height / 2);
i = 0;
while (i < 3) {
nmc = _root.bonus.attachMovie("arrow", "a" + i, i);
nmc._x = 25;
nmc._y = 40 + (40 * i);
_root.draw(nmc, 20, 20, arw);
nmc._alpha = 100 - (i * 20);
nmc.onEnterFrame = function () {
this._alpha = this._alpha + 10;
if (this._alpha >= 100) {
this._alpha = 20;
}
};
i++;
}
i = 0;
while (i < 3) {
nmc = _root.boss.attachMovie("arrow", "a" + i, i);
nmc._x = 12;
nmc._y = -60 - (40 * i);
_root.draw(nmc, 20, 20, arw2);
nmc._alpha = 100 - (i * 20);
nmc.onEnterFrame = function () {
this._alpha = this._alpha + 10;
if (this._alpha >= 100) {
this._alpha = 20;
}
};
i++;
}
ename = new Array("drone", "grunt", "enforcer", "corvette", "dronefactory", "strafer", "frigate", "triad", "warship");
onEnterFrame = function () {
if ((!psd) && (_root.tank.alive)) {
if (!spawned) {
val = (evalue / ((time / 500) + 1)) * 100;
if (val == 100) {
bossbar.gotoAndStop(22);
} else {
bossbar.gotoAndStop(Math.round(val / 5) + 1);
}
}
if ((!isboss) && (evalue < ((time / 500) + 1))) {
if (time == nextSpawn) {
locx = 0;
locy = 0;
num = 0;
en = ename[(num = Math.min(Math.floor(Math.random() * (time / 1300)), ename.length - 1))];
if (en == "corvette") {
locx = Math.round(Math.random());
locy = (Math.random() * 0.6) + 0.2;
} else if (en == "strafer") {
locx = (Math.random() * 0.6) + 0.2;
locy = Math.round(Math.random());
} else if (Math.random() < 0.5) {
locx = Math.round(Math.random());
locy = (Math.random() * 0.6) + 0.2;
} else {
locx = (Math.random() * 0.6) + 0.2;
locy = Math.round(Math.random());
}
spawnEnemy(locx, locy, en);
enemies[enemies.length - 1].val = num + 1;
evalue = evalue + (num + 1);
nextSpawn = time + Math.max(30 + Math.round(((num + 1) * 30) - (time / 100)), 1);
}
time++;
if ((time % 5000) == 0) {
bossnum++;
isboss = true;
spawned = false;
}
if ((time % 1000) == 0) {
spawnPowerup(0.5, 1, 0, 50);
}
} else if (!spawned) {
if (enemies.length == 0) {
spawnEnemy(0.5, -0.25, "boss" + bossnum);
_root.boss.life = 100;
spawned = true;
}
}
}
};
Instance of Symbol 93 MovieClip "tank" in Frame 4
onClipEvent (load) {
function reset() {
vx = 0;
vy = 0;
max = 9;
health = 100;
ammo = 0;
rot = 0;
firing = false;
ftimer = 0;
weapon = 1;
shield = 0;
damage = 0;
lastMove = 0;
newTurrets = 0;
turrets = new Array();
trot = 0;
cloak = 0;
alive = true;
dead = 0;
_y = 240;
_x = 240;
_alpha = 100;
_root.dm._x = 1000;
_root.dm._y = 0;
}
function setBar(bar, val) {
if (val == 100) {
bar.gotoAndStop(22);
} else {
bar.gotoAndStop(Math.round(val / 5) + 1);
}
}
function detonate() {
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 2000);
mc._x = _x;
mc._y = _y;
_root.death.start();
alive = false;
dead = 30;
_y = -1000;
_x = -1000;
}
reset();
mouse = new Object();
mouse.onMouseDown = function () {
firing = true;
};
mouse.onMouseUp = function () {
firing = false;
};
Mouse.addListener(mouse);
_x = 240;
_y = 240;
}
onClipEvent (enterFrame) {
if ((!_root.psd) && (alive)) {
if (Key.isDown(87)) {
vy = vy + ((max - vy) / 3);
} else if (Key.isDown(83)) {
vy = vy + (((-max) - vy) / 3);
}
if (Key.isDown(68)) {
vx = vx + ((max - vx) / 3);
} else if (Key.isDown(65)) {
vx = vx + (((-max) - vx) / 3);
}
vy = vy - (vy / 10);
vx = vx - (vx / 10);
if (_x < 25) {
_x = 25;
} else if (_x > 455) {
_x = 455;
}
if (_y < 25) {
_y = 25;
} else if (_y > 455) {
_y = 455;
}
rot = Math.atan2(_root._xmouse - _x, _root._ymouse - _y);
i = 1;
while (i < 4) {
this["p" + i]._x = (i * 5) * Math.sin(rot);
this["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if (firing) {
if (ftimer == 0) {
if (ammo == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
ftimer = 12;
_root.edepth++;
} else if (weapon == 1) {
duplicateMovieClip (_root.bomb, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
ammo = ammo - 10;
if (ammo < 0) {
ammo = 0;
}
ftimer = 20;
_root.edepth++;
} else if (weapon == 2) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.random() * 0.261799387799149) - 0.130899693899575;
mc._x = _x + (20 * ((mc.vx = Math.sin(rot + r))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot + r))));
mc.alive = true;
mc.vx = mc.vx * 9;
mc.vy = mc.vy * 9;
mc.owner = this;
mc.machine = true;
mc._xscale = (mc._yscale = 65);
ammo = ammo - 1;
if (ammo < 0) {
ammo = 0;
}
ftimer = 2;
_root.edepth++;
} else if (weapon == 3) {
duplicateMovieClip (_root.rocket, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.random() * 0.314159265358979) - 0.15707963267949;
mc._x = _x + (20 * ((mc.vx = Math.sin(rot + r))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot + r))));
mc.trot = rot;
mc.gotoAndStop(1);
mc.alive = true;
mc.owner = this;
ammo = ammo - 4;
if (ammo < 0) {
ammo = 0;
}
ftimer = 12;
_root.edepth++;
} else if (weapon == 4) {
s = Math.sin(rot);
c = Math.cos(rot);
duplicateMovieClip (_root.laserclip, "s" + _root.edepth, _root.edepth);
clip = _root["s" + _root.edepth];
clip._x = _x;
clip._y = _y;
clip.alive = true;
clip.lineStyle(60, 16711680, 0);
clip.moveTo(0, 0);
clip.lineTo(s * 500, c * 500);
i = 0;
while (i < 50) {
mc = clip.body.attachMovie("lasdot", "l" + i, i, {_x:(10 * i) * s, _y:(10 * i) * c});
i++;
}
ammo = ammo - 10;
if (ammo < 0) {
ammo = 0;
}
ftimer = 16;
_root.edepth++;
}
_root.shoot.start();
}
}
if (damage > 0) {
if (shield > 0) {
shield = shield - (damage / 2);
damage = damage / 2;
}
if (turrets.length > 0) {
turrets[0].health = turrets[0].health - (damage / 2);
damage = damage / 2;
if (turrets[0].health <= 0) {
turrets[0].removeMovieClip();
turrets.splice(0, 1);
}
}
health = health - damage;
damage = 0;
}
i = 0;
while (i < turrets.length) {
if (turrets[i].health < 50) {
h = Math.min(50 - turrets[i].health, newTurrets);
turrets[i].health = turrets[i].health + h;
newTurrets = newTurrets - h;
}
i++;
}
while ((newTurrets > 0) && (turrets.length < 3)) {
h = Math.min(50, newTurrets);
newTurrets = newTurrets - h;
duplicateMovieClip (_root.sentry, "e" + _root.edepth, _root.edepth);
mc = _root["e" + _root.edepth];
mc.alive = true;
mc.body.gotoAndStop(1);
turrets.push(mc);
mc.owner = this;
mc.health = h;
_root.edepth++;
}
newTurrets = 0;
i = 0;
while (i < turrets.length) {
turrets[i]._x = (Math.sin(trot + (((Math.PI*2) / turrets.length) * i)) * 25) + _x;
turrets[i]._y = (Math.cos(trot + (((Math.PI*2) / turrets.length) * i)) * 25) + _y;
i++;
}
if (shield <= 0) {
shld._alpha = 0;
} else {
shld._alpha = 25 + ((shield / 100) * 75);
}
Mouse.hide();
if (ftimer > 0) {
ftimer--;
}
if (stimer > 0) {
stimer--;
}
setBar(_root.healthbar, health);
bpos = 30.5;
if (cloak > 0) {
_alpha = 50;
cloak = cloak - 0.1;
} else {
_alpha = 100;
}
if (ammo > 0) {
_root.ammobar._visible = (_root.wep._visible = true);
_root.ammobar._y = bpos;
_root.wep._y = bpos + 5;
bpos = bpos + 20;
_root.wep.gotoAndStop(weapon * 2);
setBar(_root.ammobar, ammo);
} else {
_root.ammobar._visible = (_root.wep._visible = false);
}
if (shield > 0) {
_root.shieldbar._visible = (_root.shld._visible = true);
_root.shieldbar._y = bpos;
_root.shld._y = bpos + 5;
bpos = bpos + 20;
setBar(_root.shieldbar, shield);
} else {
_root.shieldbar._visible = (_root.shld._visible = false);
}
if (turrets.length > 0) {
_root.sentrybar._visible = (_root.snt._visible = true);
_root.sentrybar._y = bpos;
_root.snt._y = bpos + 5;
bpos = bpos + 20;
h = 0;
i = 0;
while (i < turrets.length) {
h = h + ((turrets[i].health / 50) * 33.33);
i++;
}
setBar(_root.sentrybar, h);
} else {
_root.sentrybar._visible = (_root.snt._visible = false);
}
if (cloak > 0) {
_root.cloakbar._visible = (_root.clk._visible = true);
_root.cloakbar._y = bpos;
_root.clk._y = bpos + 5;
bpos = bpos + 20;
setBar(_root.cloakbar, cloak);
} else {
_root.cloakbar._visible = (_root.clk._visible = false);
}
if (health <= 0) {
detonate();
}
_x = (_x + vx);
_y = (_y - vy);
trot = trot + 0.10471975511966;
if (trot > (Math.PI*2)) {
trot = trot - (Math.PI*2);
}
}
if ((!_root.psd) && (!alive)) {
if ((--dead) == 0) {
_root.clearAll();
_root.dm._x = 0;
_root.dm._y = 0;
}
}
}
Instance of Symbol 34 MovieClip "healthbar" in Frame 4
onClipEvent (load) {
this.swapDepths(1000010);
}
Instance of Symbol 34 MovieClip "ammobar" in Frame 4
onClipEvent (load) {
this.swapDepths(1000011);
}
Instance of Symbol 108 MovieClip "wep" in Frame 4
onClipEvent (load) {
this.swapDepths(1000013);
}
Instance of Symbol 112 MovieClip "shot" in Frame 4
onClipEvent (load) {
function detonate(target) {
if (machine) {
if (owner == _root.tank) {
target.health = target.health - 2;
} else {
target.damage = target.damage + 2;
}
} else if (owner == _root.tank) {
target.health = target.health - 5;
} else {
target.damage = target.damage + 3;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 200);
mc._x = _x;
mc._y = _y;
if (owner != _root.tank) {
mc.gotoAndPlay(10);
}
_root.edepth++;
this.removeMovieClip();
}
life = 60;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
_x = (_x + (vx * 1.25));
_y = (_y + (vy * 1.25));
if (_x < 0) {
vx = -vx;
} else if (_x > 480) {
vx = -vx;
}
if (_y < 0) {
vy = -vy;
} else if (_y > 480) {
vy = -vy;
}
if (owner == _root.tank) {
i = 0;
while (i < _root.enemies.length) {
if (hitTest(_root.enemies[i])) {
detonate(_root.enemies[i]);
}
i++;
}
} else if (hitTest(_root.tank) && (_root.tank.cloak <= 0)) {
detonate(_root.tank);
}
if ((life--) == 0) {
detonate(null);
}
}
}
Instance of Symbol 76 MovieClip "drone" in Frame 4
onClipEvent (load) {
function detonate(target) {
target.damage = target.damage + 10;
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 250);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.evalue = _root.evalue - val;
_root.death.start();
this.removeMovieClip();
}
health = 10;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + ((xd / d) * 1.5));
_y = (_y + ((yd / d) * 1.5));
if (hitTest(_root.tank) && (_root.tank.cloak <= 0)) {
detonate(_root.tank);
}
if (health <= 0) {
detonate(null);
}
}
}
Instance of Symbol 124 MovieClip "grunt" in Frame 4
onClipEvent (load) {
function detonate(target) {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 350);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.evalue = _root.evalue - val;
_root.spawnPowerupAt(_x - 10, _y, 1, 10);
_root.spawnPowerupAt(_x + 10, _y, 0, 5);
_root.death.start();
this.removeMovieClip();
}
health = 15;
life = 0;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + ((xd / d) * 0.5));
_y = (_y + ((yd / d) * 0.5));
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 1;
while (i < 3) {
body["p" + i]._x = (i * 5) * Math.sin(rot);
body["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if ((life % 45) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 5;
mc.vy = mc.vy * 5;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
if (health <= 0) {
detonate(null);
}
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xd) < Math.abs(yd)) {
if (yd > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xd > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
}
}
Instance of Symbol 125 MovieClip "powerup" in Frame 4
onClipEvent (load) {
active = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
life++;
_x = (_x + vx);
_y = (_y + vy);
if (!active) {
if ((((_x > 0) && (_x < 480)) && (_y > 0)) && (_y < 480)) {
active = true;
}
} else {
if (_x < 0) {
vx = -vx;
} else if (_x > 480) {
vx = -vx;
}
if (_y < 0) {
vy = -vy;
} else if (_y > 480) {
vy = -vy;
}
}
if (hitTest(_root.tank)) {
if (type == 0) {
_root.tank.health = _root.tank.health + amt;
if (_root.tank.health > 100) {
_root.tank.health = 100;
}
} else if (type == 10) {
_root.tank.shield = _root.tank.shield + amt;
if (_root.tank.shield > 100) {
_root.tank.shield = 100;
}
} else if (type == 11) {
_root.tank.newTurrets = _root.tank.newTurrets + amt;
} else if (type == 12) {
_root.tank.cloak = _root.tank.cloak + amt;
if (_root.tank.cloak > 100) {
_root.tank.cloak = 100;
}
} else {
_root.tank.weapon = type;
_root.tank.ammo = _root.tank.ammo + amt;
if (_root.tank.ammo > 100) {
_root.tank.ammo = 100;
}
}
_root.pwrup.start();
this.removeMovieClip();
}
}
}
Instance of Symbol 73 MovieClip "enforcer" in Frame 4
onClipEvent (load) {
function detonate(target) {
target.health = target.health - 15;
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 400);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x - 10, _y, 1, 20);
_root.spawnPowerupAt(_x + 10, _y, 0, 10);
_root.death.start();
_root.evalue = _root.evalue - val;
this.removeMovieClip();
}
health = 25;
life = 0;
gun = true;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + ((xd / d) * 0.5));
_y = (_y + ((yd / d) * 0.5));
rot1 = Math.atan2(_root.tank._x - (_x - 10), _root.tank._y - _y);
i = 1;
while (i < 3) {
body["a" + i]._x = ((i * 5) * Math.sin(rot1)) - 10;
body["a" + i]._y = (i * 5) * Math.cos(rot1);
i++;
}
rot2 = Math.atan2(_root.tank._x - (_x + 10), _root.tank._y - _y);
i = 1;
while (i < 3) {
body["b" + i]._x = ((i * 5) * Math.sin(rot2)) + 10;
body["b" + i]._y = (i * 5) * Math.cos(rot2);
i++;
}
if ((life % 24) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
if (gun) {
mc._x = (_x + (20 * ((mc.vx = Math.sin(rot1))))) - 10;
mc._y = _y + (20 * ((mc.vy = Math.cos(rot1))));
gun = false;
} else {
mc._x = (_x + (20 * ((mc.vx = Math.sin(rot2))))) + 10;
mc._y = _y + (20 * ((mc.vy = Math.cos(rot2))));
gun = true;
}
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
if (health <= 0) {
detonate(null);
}
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xd) < Math.abs(yd)) {
if (yd > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xd > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
}
}
Instance of Symbol 108 MovieClip "hp" in Frame 4
onClipEvent (load) {
gotoAndStop (1);
this.swapDepths(1000014);
}
Instance of Symbol 130 MovieClip "bomb" in Frame 4
onClipEvent (load) {
function detonate(target) {
if (owner == _root.tank) {
target.health = target.health - 20;
} else {
target.damage = target.damage + 10;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 750);
mc._x = _x;
mc._y = _y;
if (owner != _root.tank) {
mc.gotoAndPlay(10);
}
_root.edepth++;
this.removeMovieClip();
}
life = 100;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
_x = (_x + vx);
_y = (_y + vy);
if (_x < 0) {
vx = -vx;
} else if (_x > 480) {
vx = -vx;
}
if (_y < 0) {
vy = -vy;
} else if (_y > 480) {
vy = -vy;
}
if (owner == _root.tank) {
i = 0;
while (i < _root.enemies.length) {
if (hitTest(_root.enemies[i])) {
detonate(_root.enemies[i]);
}
i++;
}
} else if (hitTest(_root.tank) && (_root.tank.cloak <= 0)) {
detonate(_root.tank);
}
if ((life--) == 0) {
detonate(null);
}
}
}
Instance of Symbol 37 MovieClip "boss1" in Frame 4
onClipEvent (load) {
function detonate(target) {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 1000);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
i = 0;
while (i < 6) {
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x + (Math.sin((i * Math.PI) * 0.33) * 100);
mc._y = _y + (Math.cos((i * Math.PI) * 0.33) * 100);
mc.gotoAndPlay(10);
_root.edepth++;
i++;
}
_root.isboss = false;
_root.spawned = false;
_root.spawnPowerupAt(_x, _y + 15, 0, 100);
_root.spawnPowerupAt(_x, _y - 15, 10, 40);
_root.death.start();
this.removeMovieClip();
}
function setBar(bar, val) {
if (val == 100) {
bar.gotoAndStop(22);
} else {
bar.gotoAndStop(Math.round(val / 5) + 1);
}
}
health = 240;
turrets = new Array();
life = 0;
r = 0;
c = 6;
exHealth = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
i = 0;
while (i < 6) {
turrets.push(_root.spawnEnemyAt(_x + (Math.sin((i * Math.PI) * 0.33) * 60), _y + (Math.cos((i * Math.PI) * 0.33) * 60), "boss1Leg"));
turrets[i].owner = this;
turrets[i].offset = i;
i++;
}
}
c = 6;
h = 0;
i = 0;
while (i < turrets.length) {
if (turrets[i]._x == undefined) {
c--;
} else {
h = h + turrets[i].health;
turrets[i]._x = _x + (Math.sin(((i * Math.PI) * 0.33) + r) * 75);
turrets[i]._y = _y + (Math.cos(((i * Math.PI) * 0.33) + r) * 75);
}
i++;
}
setBar(_root.bossbar, (h + health) / 4.8);
if (c > 0) {
xd = 240 - _x;
yd = 240 - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + (xd / d));
_y = (_y + (yd / d));
health = 240;
} else {
if (!exHealth) {
_root.spawnPowerup(0.5, 0, 0, 50);
exHealth = true;
}
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + (xd / d));
_y = (_y + (yd / d));
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
if ((life % 5) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
rnd = (Math.random() * (Math.PI/2)) - (Math.PI/4);
mc._x = _x + (20 * ((mc.vx = Math.sin(rot + rnd))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot + rnd))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
if (health <= 0) {
detonate(null);
}
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
r = r + 0.0314159265358979;
if (r > (Math.PI*2)) {
r = r - (Math.PI*2);
}
}
}
Instance of Symbol 42 MovieClip "boss1Leg" in Frame 4
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x, _y, 1, 20);
_root.death.start();
this.removeMovieClip();
}
health = 40;
life = 0;
targetable = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 1;
while (i < 3) {
body["p" + i]._x = (i * 5) * Math.sin(rot);
body["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if ((life % ((owner.c * 7) + (offset * 2))) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
if (health <= 0) {
detonate();
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
}
}
Instance of Symbol 134 MovieClip "cursor" in Frame 4
onClipEvent (load) {
this.swapDepths(1000002);
hit = null;
}
onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
if (_root.tank.alive) {
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
rot = Math.atan2(xd, yd);
d = Math.sqrt((xd * xd) + (yd * yd));
s = Math.sin(rot);
c = Math.cos(rot);
i = 3;
while (i < 8) {
body["p" + i]._x = (((d / 3) - (d / i)) * s) + (20 * s);
body["p" + i]._y = (((d / 3) - (d / i)) * c) + (20 * c);
i++;
}
} else {
i = 3;
while (i < 8) {
body["p" + i]._x = (body["p" + i]._y = -1000);
i++;
}
}
}
Instance of Symbol 34 MovieClip "bossbar" in Frame 4
onClipEvent (load) {
this.swapDepths(1000041);
}
Instance of Symbol 137 MovieClip "corvette" in Frame 4
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x, _y - 15, 2, 25);
_root.spawnPowerupAt(_x, _y + 15, 0, 15);
_root.death.start();
_root.evalue = _root.evalue - val;
_root.loseStrafer();
this.removeMovieClip();
}
health = 30;
life = 0;
xd = 0;
targetable = true;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
if (_x > 240) {
xd = -2;
} else {
xd = 2;
}
_root.addStrafer();
}
_x = (_x + xd);
if (_x > 490) {
_x = (_x - 500);
} else if (_x < -10) {
_x = (_x + 500);
}
rot1 = Math.atan2(_root.tank._x - _x, _root.tank._y - (_y + 10));
i = 1;
while (i < 3) {
body["a" + i]._x = (i * 5) * Math.sin(rot1);
body["a" + i]._y = ((i * 5) * Math.cos(rot1)) + 10;
i++;
}
rot2 = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 1;
while (i < 3) {
body["b" + i]._x = (i * 5) * Math.sin(rot2);
body["b" + i]._y = (i * 5) * Math.cos(rot2);
i++;
}
if ((life % 25) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot1))));
mc._y = (_y + (20 * ((mc.vy = Math.cos(rot1))))) + 10;
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
if ((life % 80) == 0) {
duplicateMovieClip (_root.bomb, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot2))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot2))));
mc.alive = true;
mc.vx = mc.vx * 5;
mc.vy = mc.vy * 5;
mc.owner = this;
mc.gotoAndPlay(2);
_root.edepth++;
}
if (health <= 0) {
detonate();
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
}
}
Instance of Symbol 61 MovieClip "dronefactory" in Frame 4
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 800);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x + 15, _y + 10, 2, 25);
_root.spawnPowerupAt(_x - 15, _y + 10, 10, 10);
_root.spawnPowerupAt(_x, _y - 10, 0, 25);
_root.loseStrafer();
_root.evalue = _root.evalue - val;
_root.death.start();
this.removeMovieClip();
}
health = 40;
life = 0;
pnt = 0;
burst = false;
wait = 0;
gun = true;
px = new Array(40, 440, 440, 40);
py = new Array(40, 40, 440, 440);
targetable = true;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
_root.addStrafer();
dst = Infinity;
i = 0;
while (i < px.length) {
d = Math.pow(px[i] - _x, 2) + Math.pow(py[i] - _y, 2);
if (d < dst) {
dst = d;
pnt = i;
}
i++;
}
}
xd = px[pnt] - _x;
yd = py[pnt] - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + (xd / d));
_y = (_y + (yd / d));
if (d < 20) {
pnt++;
}
if (pnt >= px.length) {
pnt = pnt - px.length;
}
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 0;
while (i < 4) {
body["p" + i]._x = ((i - 1.5) * 5) * Math.sin(rot);
body["p" + i]._y = ((i - 1.5) * 5) * Math.cos(rot);
i++;
}
if ((life % 200) == 0) {
_root.spawnEnemyAt((Math.sin(rot) * 20) + _x, (Math.cos(rot) * 20) + _y, "drone");
_root.enemies[_root.enemies.length - 1].val = 1;
}
if (burst) {
if ((life % 4) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.random() * 0.628318530717959) - 0.314159265358979;
if (gun) {
mc._x = _x + (20 * ((mc.vx = Math.sin(rot + r))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot + r))));
gun = false;
} else {
mc._x = _x + (20 * ((mc.vx = -Math.sin(rot + r))));
mc._y = _y + (20 * ((mc.vy = -Math.cos(rot + r))));
gun = true;
}
mc.machine = true;
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
wait--;
if (wait == 0) {
burst = false;
wait = 40;
}
} else if (wait == 0) {
burst = true;
wait = 16;
} else {
wait--;
}
if (health <= 0) {
detonate();
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
}
}
Instance of Symbol 143 MovieClip "boss2old" in Frame 4
onClipEvent (load) {
function detonate(target) {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
_root.bossbar._visible = false;
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 1000);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
i = 0;
while (i < 6) {
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x + (Math.sin((i * Math.PI) * 0.33) * 100);
mc._y = _y + (Math.cos((i * Math.PI) * 0.33) * 100);
mc.gotoAndPlay(10);
_root.edepth++;
i++;
}
_root.spawnPowerupAt(_x, _y + 15, 0, 100);
_root.spawnPowerupAt(_x, _y - 15, 10, 40);
this.removeMovieClip();
}
life = 0;
i = 0;
while (i < 3) {
j = 0;
while (j < 3) {
mc = body[(("t" + i) + "") + j];
mc._x = (i * 75) - 75;
mc._y = (j * 75) - 75;
j++;
}
i++;
}
body.s1._x = -75;
body.s1._y = -75;
body.s2._x = 0;
body.s2._y = -75;
body.s3._x = -75;
body.s3._y = 0;
body.s4._x = 0;
body.s4._y = 0;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
_root.bossbar._visible = true;
}
xd = 240 - _x;
yd = 240 - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + (xd / d));
_y = (_y + (yd / d));
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
s = Math.sin(rot) * 5;
c = Math.cos(rot) * 5;
i = 0;
while (i < 3) {
j = 0;
while (j < 3) {
if (!((i == 1) && (j == 1))) {
x = (i * 75) - 75;
y = (j * 75) - 75;
k = 0;
while (k < 3) {
mc = body[(((i + "") + j) + "") + k];
mc._x = x + (k * s);
mc._y = y + (k * c);
k++;
}
}
j++;
}
i++;
}
}
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xd) < Math.abs(yd)) {
if (yd > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xd > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
}
Instance of Symbol 146 MovieClip "boss2Armor" in Frame 4
onClipEvent (load) {
function detonate(target) {
target.damage = target.damage + 10;
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 250);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
this.removeMovieClip();
}
health = 10;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (health <= 0) {
detonate(null);
}
}
}
Instance of Symbol 152 MovieClip "sentry" in Frame 4
onClipEvent (load) {
targ = undefined;
life = 0;
oldx = (oldy = -1000);
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
_alpha = (60 + ((health / 50) * 40));
life++;
if (owner == _root.tank) {
if (((life % 40) == 0) || (targ == undefined)) {
small = Infinity;
i = 0;
while (i < _root.enemies.length) {
xd = _root.enemies[i]._x - _x;
yd = _root.enemies[i]._y - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
if (d < small) {
small = d;
targ = _root.enemies[i];
}
i++;
}
}
} else {
targ = _root.tank;
}
if (targ != undefined) {
if (!((oldx == oldy) && (oldx == -1000))) {
xd = targ._x - _x;
yd = targ._y - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
xd = xd / d;
yd = yd / d;
xm = targ._x - oldx;
ym = targ._y - oldy;
tx = targ._x + (xm * (d / 7));
ty = targ._y + (ym * (d / 7));
rot = Math.atan2(tx - _x, ty - _y);
i = 1;
while (i < 2) {
body["p" + i]._x = (i * 5) * Math.sin(rot);
body["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if ((life % 30) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (10 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (10 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
if (owner != _root.tank) {
mc.gotoAndPlay(10);
}
mc.owner = owner;
_root.edepth++;
}
}
oldx = targ._x;
oldy = targ._y;
}
}
}
Instance of Symbol 155 MovieClip "rocket" in Frame 4
onClipEvent (load) {
function detonate(target) {
if (owner == _root.tank) {
target.health = target.health - 8;
} else {
target.damage = target.damage + 5;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 300);
mc._x = _x;
mc._y = _y;
if (owner != _root.tank) {
mc.gotoAndPlay(10);
}
_root.edepth++;
this.removeMovieClip();
}
life = 80;
targ = undefined;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (owner == _root.tank) {
if (((life % 40) == 0) || (targ._x == undefined)) {
small = Infinity;
i = 0;
while (i < _root.enemies.length) {
d = Math.abs(Math.atan2(_root.enemies[i]._x - _x, _root.enemies[i]._y - _y) - trot);
if (d < small) {
small = d;
targ = _root.enemies[i];
}
i++;
}
}
} else {
targ = _root.tank;
}
if (targ != undefined) {
rot = Math.atan2(targ._x - _x, targ._y - _y);
rot = ((rot < 0) ? ((Math.PI*2) - Math.abs(rot)) : (rot));
rot = trot - rot;
if (rot < 0) {
rot = rot + (Math.PI*2);
}
if (rot > (Math.PI*2)) {
rot = rot - (Math.PI*2);
}
if (owner == _root.tank) {
if (rot < Math.PI) {
trot = trot - 0.10471975511966;
} else {
trot = trot + 0.10471975511966;
}
} else if (rot < Math.PI) {
trot = trot - 0.0392699081698724;
} else {
trot = trot + 0.0392699081698724;
}
i = 0;
while (i < 2) {
body["p" + i]._x = (Math.sin(trot) * i) * 5;
body["p" + i]._y = (Math.cos(trot) * i) * 5;
i++;
}
}
duplicateMovieClip (_root.exhaust, "x" + _root.edepth, _root.edepth);
mc = _root["x" + _root.edepth];
mc._x = _x;
mc._y = _y;
if (owner == _root.tank) {
mc.gotoAndStop(1);
} else {
mc.gotoAndStop(2);
}
mc.alive = true;
_root.edepth++;
if (trot > (Math.PI*2)) {
trot = trot - (Math.PI*2);
}
if (trot < 0) {
trot = trot + (Math.PI*2);
}
_x = (_x + (Math.sin(trot) * 10));
_y = (_y + (Math.cos(trot) * 10));
if (_x < 0) {
trot = trot + (Math.PI/2);
_x = 0;
} else if (_x > 480) {
trot = trot + (Math.PI/2);
_x = 480;
}
if (_y < 0) {
trot = trot + (Math.PI/2);
_y = 0;
} else if (_y > 480) {
trot = trot + (Math.PI/2);
_y = 480;
}
if (owner == _root.tank) {
i = 0;
while (i < _root.enemies.length) {
if (hitTest(_root.enemies[i])) {
detonate(_root.enemies[i]);
}
i++;
}
} else if (hitTest(_root.tank) && (_root.tank.cloak <= 0)) {
detonate(_root.tank);
}
if ((life--) == 0) {
detonate(null);
}
}
}
Instance of Symbol 157 MovieClip "exhaust" in Frame 4
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
_alpha = (_alpha - 20);
if (_alpha <= 0) {
this.removeMovieClip();
}
}
}
Instance of Symbol 160 MovieClip "strafer" in Frame 4
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x + 20, _y, 3, 25);
_root.spawnPowerupAt(_x - 20, _y, 0, 20);
_root.loseStrafer();
_root.evalue = _root.evalue - val;
_root.death.start();
this.removeMovieClip();
}
health = 30;
life = 0;
yd = 0;
burst = false;
wait = 0;
gun = true;
targetable = true;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
if (_y > 240) {
yd = -3;
} else {
yd = 3;
}
_root.addStrafer();
}
_y = (_y + yd);
if (_y > 490) {
_y = (_y - 500);
} else if (_y < -10) {
_y = (_y + 500);
}
rot1 = Math.atan2(_root.tank._x - (_x - 5), _root.tank._y - _y);
i = 1;
while (i < 3) {
body["a" + i]._x = ((i * 5) * Math.sin(rot1)) - 5;
body["a" + i]._y = (i * 5) * Math.cos(rot1);
i++;
}
rot2 = Math.atan2(_root.tank._x - (_x + 5), _root.tank._y - _y);
i = 1;
while (i < 3) {
body["b" + i]._x = ((i * 5) * Math.sin(rot2)) + 5;
body["b" + i]._y = (i * 5) * Math.cos(rot2);
i++;
}
if (burst) {
if ((life % 4) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.random() * 0.628318530717959) - 0.314159265358979;
if (gun) {
mc._x = (_x + (20 * ((mc.vx = Math.sin(rot1 + r))))) - 5;
mc._y = _y + (20 * ((mc.vy = Math.cos(rot1 + r))));
gun = false;
} else {
mc._x = (_x + (20 * ((mc.vx = Math.sin(rot2 + r))))) + 5;
mc._y = _y + (20 * ((mc.vy = Math.cos(rot2 + r))));
gun = true;
}
mc.machine = true;
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
wait--;
if (wait == 0) {
burst = false;
wait = 40;
}
} else if (wait == 0) {
burst = true;
wait = 16;
} else {
wait--;
}
if (health <= 0) {
detonate();
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
}
}
Instance of Symbol 65 MovieClip "frigate" in Frame 4
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 1000);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x + 20, _y - 10, 0, 25);
_root.spawnPowerupAt(_x - 20, _y - 10, 10, 10);
_root.spawnPowerupAt(_x, _y + 10, 3, 25);
_root.evalue = _root.evalue - val;
_root.death.start();
this.removeMovieClip();
}
health = 50;
life = 0;
xd = (yd = 0);
burst = false;
wait = 0;
gun = 0;
tx = (ty = 0);
targetable = true;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
gun = Math.round(Math.random() * 3);
tx = _root.tank._x;
ty = _root.tank._y;
}
if (((life % 40) == 0) && (Math.floor(Math.random() * 3) == 0)) {
tx = _root.tank._x;
ty = _root.tank._y;
}
xd = tx - _x;
yd = ty - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + ((xd / d) * 0.5));
_y = (_y + ((yd / d) * 0.5));
rot1 = Math.atan2(_root.tank._x - (_x - 7.5), _root.tank._y - (_y - 5));
i = 1;
while (i < 3) {
body["a" + i]._x = ((i * 5) * Math.sin(rot1)) - 7.5;
body["a" + i]._y = ((i * 5) * Math.cos(rot1)) - 5;
i++;
}
rot2 = Math.atan2(_root.tank._x - (_x + 7.5), _root.tank._y - (_y - 5));
i = 1;
while (i < 3) {
body["b" + i]._x = ((i * 5) * Math.sin(rot2)) + 7.5;
body["b" + i]._y = ((i * 5) * Math.cos(rot2)) - 5;
i++;
}
rot3 = Math.atan2(_root.tank._x - _x, _root.tank._y - (_y + 10));
i = 1;
while (i < 3) {
body["c" + i]._x = (i * 5) * Math.sin(rot3);
body["c" + i]._y = ((i * 5) * Math.cos(rot3)) + 10;
i++;
}
if (burst) {
if (gun == 0) {
if ((life % 4) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.random() * 0.314159265358979) - 0.15707963267949;
mc._x = (_x + (20 * ((mc.vx = Math.sin(rot1 + r))))) - 7.5;
mc._y = (_y + (20 * ((mc.vy = Math.cos(rot1 + r))))) - 5;
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
} else if (gun == 1) {
if ((life % 16) == 0) {
duplicateMovieClip (_root.bomb, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = (_x + (20 * ((mc.vx = Math.sin(rot2))))) + 7.5;
mc._y = (_y + (20 * ((mc.vy = Math.cos(rot2))))) - 5;
mc.alive = true;
mc.vx = mc.vx * 5;
mc.vy = mc.vy * 5;
mc.owner = this;
mc.gotoAndPlay(2);
_root.edepth++;
}
} else if (gun == 2) {
if ((life % 16) == 0) {
duplicateMovieClip (_root.rocket, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.random() * 0.314159265358979) - 0.15707963267949;
mc._x = _x + (20 * ((mc.vx = Math.sin(rot3 + r))));
mc._y = (_y + (20 * ((mc.vy = Math.cos(rot3 + r))))) + 5;
mc.gotoAndStop(2);
mc.trot = rot3;
mc.alive = true;
mc.owner = this;
_root.edepth++;
}
}
wait--;
if (wait == 0) {
burst = false;
wait = 40;
}
} else if (wait == 0) {
burst = true;
gun++;
if (gun > 2) {
gun = 0;
}
wait = 30;
} else {
wait--;
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
if (health <= 0) {
detonate();
}
life++;
}
}
Instance of Symbol 163 MovieClip "aimer" in Frame 4
/* no clip actions */
Instance of Symbol 167 MovieClip "triad" in Frame 4
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
i = 0;
while (i < 3) {
turrets[i].removeMovieClip();
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 1000);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x - 20, _y - 10, 4, 40);
_root.spawnPowerupAt(_x, _y + 10, 0, 40);
_root.spawnPowerupAt(_x + 20, _y - 10, 10, 25);
_root.evalue = _root.evalue - val;
_root.death.start();
this.removeMovieClip();
}
health = 50;
life = 0;
xd = (yd = 0);
burst = false;
wait = 0;
gun = 1;
tx = (ty = 0);
targetable = false;
cycle = 0;
active = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
gun = Math.round(Math.random() * 3);
tx = _root.tank._x;
ty = _root.tank._y;
i = 0;
while (i < 3) {
duplicateMovieClip (_root.sentry, "e" + _root.edepth, _root.edepth);
mc = _root["e" + _root.edepth];
mc.alive = true;
mc.body.gotoAndStop(2);
turrets.push(mc);
mc.owner = this;
_root.edepth++;
i++;
}
cycle = (Math.random() * Math.PI) * 2;
}
xd = (_root.tank._x + (Math.sin(cycle) * 200)) - _x;
yd = (_root.tank._y + (Math.cos(cycle) * 200)) - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + ((xd / d) * 5));
_y = (_y + ((yd / d) * 5));
if (_x < -10) {
_x = -10;
} else if (_x > 490) {
_x = 490;
}
if (_y < -10) {
_y = -10;
} else if (_y > 490) {
_y = 490;
}
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
s = Math.sin(rot);
c = Math.cos(rot);
body.seg2._x = Math.sin((rot + (cycle * 2)) + (Math.PI/4)) * 30;
body.seg2._y = Math.cos((rot + (cycle * 2)) + (Math.PI/4)) * 30;
body.seg3._x = Math.sin((rot + (cycle * 2)) - (Math.PI/4)) * 30;
body.seg3._y = Math.cos((rot + (cycle * 2)) - (Math.PI/4)) * 30;
i = 0;
while (i < 3) {
body["a" + i]._x = (i * 5) * s;
body["a" + i]._y = (i * 5) * c;
i++;
}
i = 0;
while (i < 3) {
body["b" + i]._x = body.seg2._x + ((i * 5) * s);
body["b" + i]._y = body.seg2._y + ((i * 5) * c);
i++;
}
i = 0;
while (i < 3) {
body["c" + i]._x = body.seg3._x + ((i * 5) * s);
body["c" + i]._y = body.seg3._y + ((i * 5) * c);
i++;
}
if ((life % 5) == 0) {
if (gun == 1) {
duplicateMovieClip (_root.rocket, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.random() * 0.628318530717959) - 0.314159265358979;
mc._x = (_x + body["seg" + gun]._x) + (20 * ((mc.vx = Math.sin(rot + rnd))));
mc._y = (_y + body["seg" + gun]._y) + (20 * ((mc.vy = Math.cos(rot + rnd))));
mc.gotoAndStop(2);
mc.trot = rot;
mc.alive = true;
mc.owner = this;
_root.edepth++;
} else {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
rnd = (Math.random() * (Math.PI/2)) - (Math.PI/4);
mc._x = (_x + body["seg" + gun]._x) + (20 * ((mc.vx = Math.sin(rot + rnd))));
mc._y = (_y + body["seg" + gun]._y) + (20 * ((mc.vy = Math.cos(rot + rnd))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
}
_root.edepth++;
if ((++gun) > 3) {
gun = gun - 3;
}
}
if (health <= 0) {
detonate();
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
trot = trot + 0.0785398163397448;
if (trot > (Math.PI*2)) {
trot = trot - (Math.PI*2);
}
cycle = cycle + 0.0392699081698724;
if (cycle > (Math.PI*2)) {
cycle = cycle - (Math.PI*2);
}
life++;
}
}
Instance of Symbol 70 MovieClip "warship" in Frame 4
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
i = 0;
while (i < 3) {
turrets[i].removeMovieClip();
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 1000);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x + 20, _y - 10, 11, 25);
_root.spawnPowerupAt(_x - 20, _y - 10, 4, 80);
_root.spawnPowerupAt(_x, _y + 10, 0, 40);
_root.death.start();
_root.evalue = _root.evalue - val;
this.removeMovieClip();
}
health = 75;
life = 0;
xd = (yd = 0);
burst = false;
wait = 0;
gun = 0;
tx = (ty = 0);
targetable = false;
trot = 0;
turrets = new Array();
offx = 0;
offy = 0;
cycle = 0;
active = false;
x = 0;
y = 0;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
x = _x;
y = _y;
gun = Math.round(Math.random() * 3);
tx = _root.tank._x;
ty = _root.tank._y;
i = 0;
while (i < 3) {
duplicateMovieClip (_root.sentry, "e" + _root.edepth, _root.edepth);
mc = _root["e" + _root.edepth];
mc.alive = true;
mc.body.gotoAndStop(2);
turrets.push(mc);
mc.owner = this;
_root.edepth++;
i++;
}
xd = _root.tank._y - _x;
yd = _root.tank._x - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
offx = (xd / d) * 200;
offy = (yd / d) * 200;
}
xd = (_root.tank._x - offx) - _x;
yd = (_root.tank._y - offy) - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
x = x + ((xd / d) * 1.5);
y = y + ((yd / d) * 1.5);
_x = (x + (Math.sin(cycle) * 30));
_y = (y + (Math.cos(cycle) * 30));
if (_x < -10) {
_x = -10;
} else if (_x > 490) {
_x = 490;
}
if (_y < -10) {
_y = -10;
} else if (_y > 490) {
_y = 490;
}
rot1 = Math.atan2(_root.tank._x - (_x - 7.5), _root.tank._y - (_y - 5));
i = 1;
while (i < 3) {
body["a" + i]._x = ((i * 5) * Math.sin(rot1)) - 7.5;
body["a" + i]._y = ((i * 5) * Math.cos(rot1)) - 5;
i++;
}
rot2 = Math.atan2(_root.tank._x - (_x + 7.5), _root.tank._y - (_y - 5));
i = 1;
while (i < 3) {
body["b" + i]._x = ((i * 5) * Math.sin(rot2)) + 7.5;
body["b" + i]._y = ((i * 5) * Math.cos(rot2)) - 5;
i++;
}
rot3 = Math.atan2(_root.tank._x - _x, _root.tank._y - (_y + 10));
i = 1;
while (i < 3) {
body["c" + i]._x = (i * 5) * Math.sin(rot3);
body["c" + i]._y = ((i * 5) * Math.cos(rot3)) + 10;
i++;
}
if ((life % 15) == 0) {
duplicateMovieClip (_root.rocket, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.random() * 0.628318530717959) - 0.314159265358979;
mc._x = _x + (20 * ((mc.vx = Math.sin(rot3 + r))));
mc._y = (_y + (20 * ((mc.vy = Math.cos(rot3 + r))))) + 5;
mc.gotoAndStop(2);
mc.trot = rot3;
mc.alive = true;
mc.owner = this;
_root.edepth++;
}
i = 0;
while (i < turrets.length) {
turrets[i]._x = (Math.sin(trot + (((Math.PI*2) / turrets.length) * i)) * 25) + _x;
turrets[i]._y = (Math.cos(trot + (((Math.PI*2) / turrets.length) * i)) * 25) + _y;
i++;
}
if (health <= 0) {
detonate();
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
trot = trot + 0.0785398163397448;
if (trot > (Math.PI*2)) {
trot = trot - (Math.PI*2);
}
cycle = cycle + 0.10471975511966;
if (cycle > (Math.PI*2)) {
cycle = cycle - (Math.PI*2);
}
life++;
}
}
Instance of Symbol 169 MovieClip "laserclip" in Frame 4
onClipEvent (load) {
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (_alpha == 100) {
i = 0;
while (i < _root.enemies.length) {
if (hitTest(_root.enemies[i]._x, _root.enemies[i]._y, true)) {
_root.enemies[i].health = _root.enemies[i].health - 15;
}
i++;
}
}
_alpha = (_alpha - 15);
if (_alpha <= 0) {
this.removeMovieClip();
}
}
}
Instance of Symbol 34 MovieClip "shieldbar" in Frame 4
onClipEvent (load) {
this.swapDepths(1000017);
}
Instance of Symbol 108 MovieClip "shld" in Frame 4
onClipEvent (load) {
gotoAndStop (12);
this.swapDepths(1000015);
}
Instance of Symbol 34 MovieClip "sentrybar" in Frame 4
onClipEvent (load) {
this.swapDepths(1000018);
}
Instance of Symbol 108 MovieClip "snt" in Frame 4
onClipEvent (load) {
gotoAndStop (13);
this.swapDepths(1000016);
}
Instance of Symbol 172 MovieClip in Frame 4
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 200);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
this.removeMovieClip();
}
health = 20;
life = 0;
xd = 0;
targetable = true;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
_x = (_x + vx);
_y = (_y + vy);
if (((((_x < -20) || (_x > 500)) || (_y < -20)) || (_y > 500)) || (health <= 0)) {
detonate();
}
life++;
}
}
Instance of Symbol 175 MovieClip in Frame 4
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
i = 0;
while (i < 4) {
s = Math.sin((Math.PI/2) * i);
c = -Math.cos((Math.PI/2) * i);
mc = _root.spawnEnemyAt(_x + (20 * s), _y + (20 * c), "bonuspod");
mc.vx = s * 4;
mc.vy = c * 4;
mc._rotation = i * 90;
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 1500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
this.removeMovieClip();
}
health = 60;
life = 0;
xd = 0;
yd = 0;
targetable = true;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
if (_x > 0) {
xd = 3;
yd = 0;
} else if (_x > 480) {
xd = -3;
yd = 0;
}
if (_y < 0) {
yd = 3;
xd = 0;
} else if (_y > 480) {
yd = -3;
xd = 0;
}
}
_x = (_x + xd);
_y = (_y + yd);
if (_x < 0) {
_x = (_x + 480);
} else if (_x > 480) {
_x = (_x - 480);
}
if (_y < 0) {
_y = (_y + 480);
} else if (_y > 480) {
_y = (_y - 480);
}
if (health <= 0) {
detonate();
}
life++;
}
}
Instance of Symbol 34 MovieClip "cloakbar" in Frame 4
onClipEvent (load) {
this.swapDepths(1000018);
}
Instance of Symbol 108 MovieClip "clk" in Frame 4
onClipEvent (load) {
gotoAndStop (14);
this.swapDepths(1000030);
}
Instance of Symbol 176 MovieClip "bonus" in Frame 4
onClipEvent (load) {
life = 0;
}
onClipEvent (enterFrame) {
if (life > 0) {
if (life == 10) {
_alpha = 100;
} else if (life < 10) {
_alpha = (_alpha - 10);
} else {
_alpha = (_alpha - 5);
if (_alpha <= 40) {
_alpha = 100;
}
}
_visible = true;
life--;
} else {
_visible = false;
}
}
Instance of Symbol 179 MovieClip "boss2" in Frame 4
onClipEvent (load) {
function detonate(target) {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 1000);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
i = 0;
while (i < 6) {
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x + (Math.sin((i * Math.PI) * 0.33) * 100);
mc._y = _y + (Math.cos((i * Math.PI) * 0.33) * 100);
mc.gotoAndPlay(10);
_root.edepth++;
i++;
}
_root.isboss = false;
_root.spawned = false;
_root.spawnPowerupAt(_x, _y + 15, 0, 100);
_root.spawnPowerupAt(_x, _y - 15, 10, 40);
_root.death.start();
this.removeMovieClip();
}
function setBar(bar, val) {
if (val == 100) {
bar.gotoAndStop(22);
} else {
bar.gotoAndStop(Math.round(val / 5) + 1);
}
}
health = 280;
turrets = new Array();
life = 0;
r = 0;
c = 6;
exHealth = false;
closest = null;
cdist = Infinity;
rt = 0;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
i = 0;
while (i < 3) {
turrets.push(_root.spawnEnemyAt(_x + (Math.sin((i * Math.PI) * 0.66) * 120), _y + (Math.cos((i * Math.PI) * 0.66) * 120), "boss2Leg"));
turrets[i].owner = this;
turrets[i].offset = i;
i++;
}
}
c = 3;
h = 0;
cdist = Infinity;
i = 0;
while (i < turrets.length) {
if (turrets[i]._x == undefined) {
c--;
} else {
h = h + turrets[i].hp;
turrets[i]._x = _x + (Math.sin(((i * Math.PI) * 0.66) + r) * 100);
turrets[i]._y = _y + (Math.cos(((i * Math.PI) * 0.66) + r) * 100);
x = turrets[i]._x - _root.tank._x;
y = turrets[i]._y - _root.tank._y;
if (((x * x) + (y * y)) < cdist) {
cdist = (x * x) + (y * y);
closest = turrets[i];
}
}
i++;
}
if (!isNaN(h)) {
setBar(_root.bossbar, (h + health) / 10);
} else {
setBar(_root.bossbar, 100);
}
if (c > 0) {
xd = 240 - _x;
yd = 240 - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + (xd / d));
_y = (_y + (yd / d));
health = 280;
} else {
if (!exHealth) {
_root.spawnPowerup(0.5, 0, 0, 50);
exHealth = true;
}
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + (xd / d));
_y = (_y + (yd / d));
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
if ((life % 12) == 0) {
duplicateMovieClip (_root.rocket, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = -0.785398163397448 + ((Math.PI/4) * rt);
if ((++rt) > 2) {
rt = 0;
}
mc._x = _x + (20 * ((mc.vx = Math.sin(rot + r))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot + r))));
mc.gotoAndStop(2);
mc.trot = rot + r;
mc.alive = true;
mc.owner = this;
_root.edepth++;
}
if (health <= 0) {
detonate(null);
}
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
r = r + 0.0314159265358979;
if (r > (Math.PI*2)) {
r = r - (Math.PI*2);
}
}
}
Instance of Symbol 182 MovieClip "boss3" in Frame 4
onClipEvent (load) {
function detonate(target) {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 1000);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
i = 0;
while (i < 6) {
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x + (Math.sin((i * Math.PI) * 0.33) * 100);
mc._y = _y + (Math.cos((i * Math.PI) * 0.33) * 100);
mc.gotoAndPlay(10);
_root.edepth++;
i++;
}
_root.isboss = false;
_root.spawned = false;
_root.spawnPowerupAt(_x + 15, _y + 10, 4, 100);
_root.spawnPowerupAt(_x - 15, _y + 10, 10, 100);
_root.spawnPowerupAt(_x + 15, _y - 10, 0, 100);
_root.spawnPowerupAt(_x - 15, _y - 10, 11, 150);
_root.death.start();
this.removeMovieClip();
}
function setBar(bar, val) {
if (val == 100) {
bar.gotoAndStop(22);
} else {
bar.gotoAndStop(Math.round(val / 5) + 1);
}
}
health = 300;
turrets = new Array();
life = 0;
r = 0;
c = 6;
exHealth = false;
closest = null;
cdist = Infinity;
rt = 0;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
i = 0;
while (i < 3) {
turrets.push(_root.spawnEnemyAt(_x + (Math.sin((i * Math.PI) * 0.66) * 120), _y + (Math.cos((i * Math.PI) * 0.66) * 120), "boss3Leg"));
turrets[i].owner = this;
turrets[i].offset = i;
i++;
}
_root.spawnPowerup(0.2, 1, 0, 100);
_root.spawnPowerup(0.4, 1, 10, 100);
_root.spawnPowerup(0.6, 1, 11, 150);
_root.spawnPowerup(0.8, 1, 2, 100);
}
c = 3;
h = 0;
cdist = Infinity;
i = 0;
while (i < turrets.length) {
if (turrets[i]._x == undefined) {
c--;
} else {
h = h + turrets[i].hp;
turrets[i]._x = _x + (Math.sin(((i * Math.PI) * 0.66) + r) * 150);
turrets[i]._y = _y + (Math.cos(((i * Math.PI) * 0.66) + r) * 150);
x = turrets[i]._x - _root.tank._x;
y = turrets[i]._y - _root.tank._y;
if (((x * x) + (y * y)) < cdist) {
cdist = (x * x) + (y * y);
closest = turrets[i];
}
}
i++;
}
if (!isNaN(h)) {
setBar(_root.bossbar, (h + health) / 10);
} else {
setBar(_root.bossbar, 100);
}
if (c > 0) {
xd = 240 - _x;
yd = 240 - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + (xd / d));
_y = (_y + (yd / d));
health = 280;
} else {
if (!exHealth) {
_root.spawnPowerup(0.5, 0, 0, 50);
exHealth = true;
}
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + (xd / d));
_y = (_y + (yd / d));
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
if ((life % 12) == 0) {
duplicateMovieClip (_root.rocket, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = -0.785398163397448 + ((Math.PI/4) * rt);
if ((++rt) > 2) {
rt = 0;
}
mc._x = _x + (20 * ((mc.vx = Math.sin(rot + r))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot + r))));
mc.gotoAndStop(2);
mc.trot = rot + r;
mc.alive = true;
mc.owner = this;
_root.edepth++;
}
if (health <= 0) {
detonate(null);
}
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
r = r + 0.015707963267949;
if (r > (Math.PI*2)) {
r = r - (Math.PI*2);
}
}
}
Instance of Symbol 186 MovieClip "boss2Leg" in Frame 4
onClipEvent (load) {
function detonate(target) {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 1000);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
i = 0;
while (i < 6) {
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x + (Math.sin((i * Math.PI) * 0.33) * 100);
mc._y = _y + (Math.cos((i * Math.PI) * 0.33) * 100);
mc.gotoAndPlay(10);
_root.edepth++;
i++;
}
_root.death.start();
_root.spawnPowerupAt(_x + 15, _y + 10, 2, 50);
_root.spawnPowerupAt(_x - 15, _y + 10, 10, 30);
_root.spawnPowerupAt(_x, _y - 10, 0, 50);
this.removeMovieClip();
}
health = 120;
turrets = new Array();
life = 0;
r = 0;
c = 6;
exHealth = false;
hp = 0;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
i = 0;
while (i < 3) {
turrets.push(_root.spawnEnemyAt(_x + (Math.sin((i * Math.PI) * 0.66) * 60), _y + (Math.cos((i * Math.PI) * 0.66) * 60), "boss2Leg2"));
turrets[i].owner = this;
turrets[i].offset = i;
turrets[i].wait = i * 15;
i++;
}
}
c = 3;
h = 0;
i = 0;
while (i < turrets.length) {
if (turrets[i]._x == undefined) {
c--;
} else {
h = h + turrets[i].health;
turrets[i]._x = _x + (Math.sin(((i * Math.PI) * 0.66) + r) * 60);
turrets[i]._y = _y + (Math.cos(((i * Math.PI) * 0.66) + r) * 60);
}
i++;
}
hp = h + health;
if (c > 0) {
health = 120;
} else {
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + (xd / d));
_y = (_y + (yd / d));
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
if (((life % 15) == 0) && (owner.closest == this)) {
duplicateMovieClip (_root.rocket, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.random() * 1.0471975511966) - 0.523598775598299;
mc._x = _x + (20 * ((mc.vx = Math.sin(rot + r))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot + r))));
mc.gotoAndStop(2);
mc.trot = rot;
mc.alive = true;
mc.owner = this;
_root.edepth++;
}
if (health <= 0) {
detonate(null);
}
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
r = r - 0.0418879020478639;
if (r > (Math.PI*2)) {
r = r - (Math.PI*2);
}
}
}
Instance of Symbol 191 MovieClip "boss2Leg2" in Frame 4
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.death.start();
_root.spawnPowerupAt(_x, _y - 15, 2, 25);
_root.spawnPowerupAt(_x, _y + 15, 0, 20);
this.removeMovieClip();
}
health = 40;
life = 0;
burst = false;
targetable = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 1;
while (i < 3) {
body["p" + i]._x = (i * 5) * Math.sin(rot);
body["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if (owner.owner.closest == owner) {
if (burst) {
if ((life % 3) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.random() * 0.523598775598299) - 0.261799387799149;
mc._x = (_x + (20 * ((mc.vx = Math.sin(rot + r))))) + 5;
mc._y = _y + (20 * ((mc.vy = Math.cos(rot + r))));
mc.machine = true;
mc.alive = true;
mc.vx = mc.vx * 6;
mc.vy = mc.vy * 6;
mc.owner = this;
mc.gotoAndPlay(10);
_root.edepth++;
}
wait--;
if (wait == 0) {
burst = false;
wait = 60;
}
} else if (wait == 0) {
burst = true;
wait = 20;
} else {
wait--;
}
}
if (health <= 0) {
detonate();
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
_alpha = (60 + health);
life++;
}
}
Instance of Symbol 194 MovieClip "dm" in Frame 4
onClipEvent (load) {
_root.write(am1, 20, 20, 2, "game over!");
_root.write(am2, 20, 20, 2, "victory!");
_root.rect(this, 72, 180, 67, 13, 1);
_root.write(sm1, 20, 20, 2, "continue");
_root.write(sm2, 20, 20, 1, "continue");
_root.rect(this, 72, 260, 67, 13, 1);
_root.write(ins1, 20, 20, 2, "restart");
_root.write(ins2, 20, 20, 1, "restart");
_root.rect(this, 72, 340, 67, 13, 1);
_root.write(pmg1, 20, 20, 2, "play more games");
_root.write(pmg2, 20, 20, 1, "play more games");
}
Instance of Symbol 176 MovieClip "boss" in Frame 4
onClipEvent (load) {
life = 0;
}
onClipEvent (enterFrame) {
if (life > 0) {
if (life == 10) {
_alpha = 100;
} else if (life < 10) {
_alpha = (_alpha - 10);
} else {
_alpha = (_alpha - 5);
if (_alpha <= 40) {
_alpha = 100;
}
}
_visible = true;
life--;
} else {
_visible = false;
}
}
Instance of Symbol 108 MovieClip "hp" in Frame 4
onClipEvent (load) {
gotoAndStop (1);
this.swapDepths(1000040);
}
Instance of Symbol 179 MovieClip "boss3Leg" in Frame 4
onClipEvent (load) {
function detonate(target) {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 1000);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
i = 0;
while (i < 6) {
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x + (Math.sin((i * Math.PI) * 0.33) * 100);
mc._y = _y + (Math.cos((i * Math.PI) * 0.33) * 100);
mc.gotoAndPlay(10);
_root.edepth++;
i++;
}
_root.spawnPowerupAt(_x + 15, _y + 10, Math.floor(Math.random() * 3) + 1, 70);
_root.spawnPowerupAt(_x - 15, _y + 10, 10, 30);
_root.spawnPowerupAt(_x + 15, _y - 10, 0, 50);
_root.spawnPowerupAt(_x - 15, _y - 10, 11, 50);
_root.death.start();
this.removeMovieClip();
}
health = 120;
turrets = new Array();
life = 0;
r = 0;
c = 6;
exHealth = false;
hp = 0;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
i = 0;
while (i < 3) {
turrets.push(_root.spawnEnemyAt(_x + (Math.sin((i * Math.PI) * 0.66) * 60), _y + (Math.cos((i * Math.PI) * 0.66) * 60), "boss3Leg2"));
turrets[i].owner = this;
turrets[i].offset = i;
turrets[i].wait = i * 15;
i++;
}
}
c = 3;
h = 0;
i = 0;
while (i < turrets.length) {
if (turrets[i]._x == undefined) {
c--;
} else {
h = h + turrets[i].health;
turrets[i]._x = _x + (Math.sin(((i * Math.PI) * 0.66) + r) * 80);
turrets[i]._y = _y + (Math.cos(((i * Math.PI) * 0.66) + r) * 80);
}
i++;
}
hp = h + health;
if (c > 0) {
health = 120;
} else {
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + (xd / d));
_y = (_y + (yd / d));
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
if ((life % 30) == 0) {
i = -1;
while (i < 2) {
duplicateMovieClip (_root.rocket, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.PI * i) / 2;
mc._x = _x + (20 * ((mc.vx = Math.sin(rot + r))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot + r))));
mc.gotoAndStop(2);
mc.trot = rot + r;
mc.alive = true;
mc.owner = this;
_root.edepth++;
i++;
}
}
if (health <= 0) {
detonate(null);
}
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
r = r - 0.020943951023932;
if (r > (Math.PI*2)) {
r = r - (Math.PI*2);
}
}
}
Instance of Symbol 37 MovieClip "boss3Leg2" in Frame 4
onClipEvent (load) {
function detonate(target) {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 1000);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
i = 0;
while (i < 6) {
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x + (Math.sin((i * Math.PI) * 0.33) * 100);
mc._y = _y + (Math.cos((i * Math.PI) * 0.33) * 100);
mc.gotoAndPlay(10);
_root.edepth++;
i++;
}
_root.spawnPowerupAt(_x + 15, _y + 10, Math.floor(Math.random() * 3) + 1, 40);
_root.spawnPowerupAt(_x - 15, _y + 10, 10, 20);
_root.spawnPowerupAt(_x + 15, _y - 10, 0, 25);
_root.spawnPowerupAt(_x - 15, _y - 10, 11, 25);
_root.death.start();
this.removeMovieClip();
}
health = 60;
turrets = new Array();
life = 0;
r = 0;
c = 6;
exHealth = false;
hp = 0;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
if (life == 0) {
i = 0;
while (i < 3) {
turrets.push(_root.spawnEnemyAt(_x + (Math.sin((i * Math.PI) * 0.66) * 60), _y + (Math.cos((i * Math.PI) * 0.66) * 60), "boss3Leg3"));
turrets[i].owner = this;
turrets[i].offset = i;
turrets[i].wait = i * 15;
i++;
}
}
c = 3;
h = 0;
i = 0;
while (i < turrets.length) {
if (turrets[i]._x == undefined) {
c--;
} else {
h = h + turrets[i].health;
turrets[i]._x = _x + (Math.sin(((i * Math.PI) * 0.66) + r) * 100);
turrets[i]._y = _y + (Math.cos(((i * Math.PI) * 0.66) + r) * 100);
}
i++;
}
hp = h + health;
if (c > 0) {
health = 60;
} else {
xd = _root.tank._x - _x;
yd = _root.tank._y - _y;
d = Math.sqrt((xd * xd) + (yd * yd));
_x = (_x + (xd / d));
_y = (_y + (yd / d));
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
if ((life % 25) == 0) {
duplicateMovieClip (_root.rocket, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
r = (Math.random() * 1.0471975511966) - 0.523598775598299;
mc._x = _x + (20 * ((mc.vx = Math.sin(rot + r))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot + r))));
mc.gotoAndStop(2);
mc.trot = rot;
mc.alive = true;
mc.owner = this;
_root.edepth++;
}
if (health <= 0) {
detonate(null);
}
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
r = r + 0.020943951023932;
if (r > (Math.PI*2)) {
r = r - (Math.PI*2);
}
}
}
Instance of Symbol 197 MovieClip "boss3Leg3" in Frame 4
onClipEvent (load) {
function detonate() {
i = 0;
while (i < _root.enemies.length) {
if (_root.enemies[i]._name == _name) {
_root.enemies.splice(i, 1);
}
i++;
}
duplicateMovieClip (_root.shotExp, (("exp" + owner) + "_") + _root.edepth, _root.edepth);
mc = _root[(("exp" + owner) + "_") + _root.edepth];
mc._xscale = (mc._yscale = 500);
mc._x = _x;
mc._y = _y;
mc.gotoAndPlay(10);
_root.edepth++;
_root.spawnPowerupAt(_x - 10, _y - 10, Math.floor(Math.random() * 3) + 1, 25);
_root.spawnPowerupAt(_x - 10, _y + 10, 0, 25);
_root.spawnPowerupAt(_x + 10, _y, 10, 15);
this.removeMovieClip();
}
health = 25;
life = 0;
targetable = false;
}
onClipEvent (enterFrame) {
if (alive && (!_root.psd)) {
rot = Math.atan2(_root.tank._x - _x, _root.tank._y - _y);
i = 1;
while (i < 3) {
body["p" + i]._x = (i * 5) * Math.sin(rot);
body["p" + i]._y = (i * 5) * Math.cos(rot);
i++;
}
if ((life % 50) == 0) {
duplicateMovieClip (_root.shot, "s" + _root.edepth, _root.edepth);
mc = _root["s" + _root.edepth];
mc._x = _x + (20 * ((mc.vx = Math.sin(rot))));
mc._y = _y + (20 * ((mc.vy = Math.cos(rot))));
mc.alive = true;
mc.vx = mc.vx * 7;
mc.vy = mc.vy * 7;
mc.owner = this;
mc.gotoAndPlay(10);
_root.death.start();
_root.edepth++;
}
if (health <= 0) {
detonate();
}
xdf = _root.tank._x - _x;
ydf = _root.tank._y - _y;
if (_root.tank.hitTest(this)) {
if (Math.abs(xdf) < Math.abs(ydf)) {
if (ydf > 0) {
_root.tank._y = (_y + (_height / 2)) + (_root.tank._height / 2);
} else {
_root.tank._y = (_y - (_height / 2)) - (_root.tank._height / 2);
}
} else if (xdf > 0) {
_root.tank._x = (_x + (_width / 2)) + (_root.tank._width / 2);
} else {
_root.tank._x = (_x - (_width / 2)) - (_root.tank._width / 2);
}
}
life++;
}
}
Symbol 47 Button
on (release) {
getURL ("http://www.armorgames.com", "blank");
}
Symbol 54 MovieClip Frame 140
_root.gotoAndStop(3);
Symbol 57 Button
on (rollOver) {
sm1._y = 1000;
sm2._y = 180;
}
on (rollOut) {
sm2._y = 1000;
sm1._y = 180;
}
on (release) {
_root.gotoAndStop(4);
}
Symbol 58 Button
on (rollOver) {
pmg1._y = 1000;
pmg2._y = 340;
}
on (rollOut) {
pmg2._y = 1000;
pmg1._y = 340;
}
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 112 MovieClip Frame 9
gotoAndPlay (1);
Symbol 112 MovieClip Frame 18
gotoAndPlay (10);
Symbol 122 MovieClip Frame 9
this.removeMovieClip();
Symbol 122 MovieClip Frame 18
this.removeMovieClip();
Symbol 130 MovieClip Frame 1
stop();
Symbol 192 Button
on (rollOver) {
sm1._y = 1000;
sm2._y = 180;
}
on (rollOut) {
sm2._y = 1000;
sm1._y = 180;
}
on (release) {
lev = Math.floor(_root.time / 1000) * 1000;
bn = Math.floor(_root.time / 5000);
_root.reset();
_root.time = lev;
_root.nextSpawn = lev;
_root.bossnum = bn;
_y = 1000;
}
Symbol 193 Button
on (rollOver) {
ins1._y = 1000;
ins2._y = 260;
}
on (rollOut) {
ins2._y = 1000;
ins1._y = 260;
}
on (release) {
_root.reset();
_x = 1000;
}