Frame 2
var ver = "0.1";
_global.frameRate = 30;
var localControl = "keyboard";
var localType = "shoot";
var localLevel = "1";
Frame 3
function startGame(difficulty) {
victory = (finished = 0);
init(difficulty);
gotoAndStop (4);
}
function endGame() {
Mouse.show();
_quality = qback;
return(victory);
}
function checkFinished() {
return(finished);
}
function end() {
clearInterval(upciq);
}
function createStarfield() {
var _local2 = 0;
while (_local2 < 400) {
var _local1 = bg.strfld.attachMovie("star", "starg" + scnt, scnt++);
_local1._xscale = (_local1._yscale = 2 + random(70));
_local1._x = random(450);
_local1._y = random(300);
_local2++;
}
}
function Blackhole(ob, met) {
var _local5 = 225 - ob._x;
var _local4 = 155 - ob._y;
var _local3 = (_local5 * _local5) + (_local4 * _local4);
var _local2 = sq(_local3);
if (_local2 < 400) {
var _local7 = _local5 / _local2;
var _local6 = _local4 / _local2;
if (met) {
ob.xmov = ob.xmov + ((_local7 * bforce) / _local3);
ob.ymov = ob.ymov + ((_local6 * bforce) / _local3);
if (_local2 < 90) {
if (ob._width > 2) {
ob._width = (ob._width / 90) * _local2;
ob._height = (ob._height / 90) * _local2;
} else {
ob.hp = -10;
}
}
} else {
ob.vx = ob.vx + (((-_local6) * bforce) / _local3);
ob.vy = ob.vy + ((_local7 * bforce) / _local3);
if (_local2 < 30) {
ob._xscale = 3.33333333333333 * _local2;
ob._yscale = 3.33333333333333 * _local2;
if (_local2 < 4) {
setOut(ob);
}
}
}
}
}
function setOut(ob) {
switch (random(4)) {
case 0 :
ob._x = 460;
ob._y = 155;
ob._rotation = -90;
break;
case 1 :
ob._x = -10;
ob._y = 155;
ob._rotation = 90;
break;
case 2 :
ob._x = 225;
ob._y = -10;
ob._rotation = 180;
break;
case 3 :
ob._x = 225;
ob._y = 320;
ob._rotation = 0;
}
ob.vx = 0;
ob.vy = 0;
ob._xscale = 100;
ob._yscale = 100;
}
function init(df) {
dif = df;
qback = _quality;
_quality = "LOW";
s = Math.sin;
c = Math.cos;
mr = Math.random;
ro = Math.round;
sq = Math.sqrt;
mf = Math.floor;
mp = Math.pow;
pi = Math.PI;
ma = Math.atan2;
aireset();
bforce = 400;
mtst = 40;
clearInterval(upciq);
mtoc = (scnt = (spc = (pac = (pstimeout = (bstimeout = (ag = (dc = (inpaimc = (mtpat = (evml = (evmb = (defensive = (catimer = (catting = (cattset = (canum = (to = (grav = (skc = 0)))))))))))))))))));
lsp = 10;
metpos = new Array(2);
var _local3 = (metpos[0] = new Object());
_local3.sx = 440;
_local3.sy = 300;
_local3.vx = -1;
_local3.vy = -1;
var _local2 = (metpos[1] = new Object());
_local2.sx = 120;
_local2.sy = -60;
_local2.vx = 1;
_local2.vy = 1;
ainodes = new Array(0);
cattacks = new Array(5);
cattacks[0] = new Array(0);
cattacks[0][0] = "s1";
cattacks[0][1] = "l1";
cattacks[0][2] = 50;
cattacks[0][3] = "s1";
cattacks[0][4] = "l1";
cattacks[0][5] = 30;
cattacks[0][6] = "s0";
cattacks[0][7] = "l1";
cattacks[0][8] = 60;
cattacks[0][9] = "s0";
cattacks[0][10] = "l1";
cattacks[0][11] = 30;
cattacks[0][12] = "s1";
cattacks[0][13] = "l0";
cattacks[0][14] = 40;
cattacks[0][15] = "a";
cattacks[0][16] = "s";
cattacks[0][17] = 20;
cattacks[0][18] = "s0";
cattacks[0][19] = "l0";
cattacks[0][20] = 40;
cattacks[0][21] = "a";
cattacks[0][22] = "s";
cattacks[0][23] = 60;
cattacks[1] = new Array(0);
cattacks[1][0] = "s1";
cattacks[1][1] = "l1";
cattacks[1][2] = 20;
cattacks[1][3] = "a";
cattacks[1][4] = "s";
cattacks[1][5] = 40;
cattacks[2] = new Array(0);
cattacks[2][0] = "s1";
cattacks[2][1] = "l1";
cattacks[2][2] = 30;
cattacks[2][3] = "a";
cattacks[2][4] = "s";
cattacks[2][5] = 30;
cattacks[3] = new Array(0);
cattacks[3][0] = "s1";
cattacks[3][1] = "s1";
cattacks[3][2] = 20;
cattacks[3][3] = "s1";
cattacks[3][4] = "a";
cattacks[3][5] = 30;
cattacks[3][3] = "s0";
cattacks[3][4] = "s";
cattacks[3][5] = 60;
cattacks[4] = new Array(0);
cattacks[4][0] = "s1";
cattacks[4][1] = "l1";
cattacks[4][2] = 30;
cattacks[4][3] = "s0";
cattacks[4][4] = "s1";
cattacks[4][5] = 50;
cattacks[4][6] = "s1";
cattacks[4][7] = "l0";
cattacks[4][8] = 20;
cattacks[4][9] = "a";
cattacks[4][10] = "s";
cattacks[4][11] = 60;
aireset();
sound_exp = new Sound();
sound_exp.attachSound("exp");
sound_hit = new Sound();
sound_hit.attachSound("hitsnd");
sound_exp.setVolume(20);
sound_hit.setVolume(20);
playerlaser = new Array(0);
baddielaser = new Array(0);
tsplints = new Array(0);
tsparks = new Array(0);
meteors = new Array(0);
decay = 0.999;
tan = (Math.PI/180);
tan2 = 565.486677646163;
msk = attachMovie("maskall", "maskit", 5000000);
this.setMask(msk);
clearInterval(upciq);
lasc = 20;
Mouse.hide();
bg = attachMovie("bkg", "bckg1", 3);
fg = attachMovie("fgr", "foreg1", 1000);
sp = attachMovie("space", "spacem", 50);
ps = sp.attachMovie("ship", "plship", 3);
bs = sp.attachMovie("ship", "bsship", 2);
bh = bg.mhold.attachMovie("blackhole", "bholeg", 1);
bh._x = 225;
bh._y = 155;
setShip(ps, 10 + ((3 - dif) * 5), 0.34, 4, 6, 1, 50 + random(100), 75 + random(100), 0);
setShip(bs, 10 + (dif * 5), 0.34, 4, 6, 2, 150 + random(200), 75 + random(100), 180);
fg.phpb.gotoAndStop(1);
fg.bhpb.gotoAndStop(1);
createStarfield();
upciq = setInterval(update, 30);
}
function splinters(ob) {
var _local2 = 0;
while (_local2 < 23) {
var _local1 = fg.pob.attachMovie("sp" + _local2, "spg" + spc, 20 + (spc++));
_local1._x = (ob._x - 15) + random(30);
_local1._y = (ob._y - 15) + random(30);
var _local6 = -1 * mf(mr() * 2);
var _local5 = -1 * mf(mr() * 2);
var _local4 = -1 * mf(mr() * 2);
_local1.xmov = (_local6 * 1) + random(3);
_local1.ymov = (_local5 * 1) + random(3);
_local1.rot = _local4 * (5 + random(10));
_local1._xscale = (_local1._yscale = 200 + random(200));
tsplints.push(_local1);
explosion(ob);
_local2++;
}
}
function explosion(ob) {
sound_exp.start();
var _local1 = bg.attachMovie("expl", "explog", 40000);
_local1._x = ob._x - 10;
_local1._y = ob._y - 10;
_local1._rotation = random(360);
_local1._xscale = (_local1._yscale = 150);
_local1._alpha = 40;
}
function cmeteors() {
var _local7 = metpos[1].sx;
var _local6 = metpos[1].sy;
var _local5 = metpos[1].vx;
var _local4 = metpos[1].vy;
if (mtpat) {
_local7 = metpos[0].sx;
_local6 = metpos[0].sy;
_local5 = metpos[0].vx;
_local4 = metpos[0].vy;
mtpat = 0;
} else {
mtpat = 1;
}
var _local2 = 0;
while (_local2 < (2 + random(5))) {
var _local1 = bg.mhold.attachMovie("meteor", "mtor" + mtoc, 20 + (mtoc++));
_local1._x = (_local7 - 50) + random(100);
_local1._y = (_local6 - 60) + random(120);
_local1.xmov = _local5 + ((1 + random(5)) / 10);
_local1.ymov = _local4 + ((1 + random(5)) / 10);
var _local3 = mp(-1, mf(mr() * 2));
_local1.rot = _local3 * (1 + random(2));
_local1._rotation = random(360);
_local1._xscale = (_local1._yscale = 20 + random(200));
_local1.hp = 50;
meteors.push(_local1);
_local2++;
}
}
function sparks(ob) {
var _local2 = 0;
while (_local2 < 30) {
var _local1 = fg.pob.attachMovie("spark", "skg" + skc, 2000 + (skc++));
_local1._x = (ob._x - 15) + random(30);
_local1._y = (ob._y - 15) + random(30);
n = mp(-1, mf(mr() * 2));
_local1.xmov = n * random(5);
_local1.ymov = n * random(5);
var _local3 = 50 + random(150);
_local1._xscale = (_local1._yscale = _local3);
tsparks[tsparks.length] = _local1;
_local2++;
}
}
function updateParticles() {
var _local6 = new Array(0);
var _local9 = tsplints.length;
var _local3 = 0;
while (_local3 < _local9) {
var _local1 = tsplints[_local3];
if ((((_local1._y < 400) && (_local1._x > 0)) && (_local1._x < 450)) && (_local1._y > -100)) {
_local1._x = _local1._x + _local1.xmov;
_local1._y = _local1._y + _local1.ymov;
_local1.xmov = _local1.xmov * 0.999;
_local1.ymov = _local1.ymov * 0.999;
_local1._rotation = _local1._rotation + _local1.rot;
_local6.push(_local1);
} else {
_local1.removeMovieClip();
}
_local3++;
}
tsplints = _local6;
var _local7 = new Array(0);
var _local10 = tsparks.length;
var _local4 = 0;
while (_local4 < _local10) {
var _local1 = tsparks[_local4];
if ((((_local1._y < 320) && (_local1._y > -100)) && (_local1._x > -50)) && (_local1._y <= 460)) {
_local1._x = _local1._x + _local1.xmov;
_local1._y = _local1._y + _local1.ymov;
_local1.xmov = _local1.xmov * 0.999;
_local1.ymov = _local1.ymov * 0.999;
if (_local1._alpha > 0) {
_local1._alpha = _local1._alpha - 10;
_local7.push(_local1);
} else {
_local1.removeMovieClip();
}
} else {
_local1.removeMovieClip();
}
_local4++;
}
tsparks = _local7;
var _local5 = new Array(0);
var _local8 = meteors.length;
var _local2 = 0;
while (_local2 < _local8) {
var _local1 = meteors[_local2];
if (_local1.hp > 0) {
if ((((_local1._y < 320) && (_local1._y > -100)) && (_local1._x > -50)) && (_local1._y <= 460)) {
_local1._x = _local1._x + _local1.xmov;
_local1._y = _local1._y + _local1.ymov;
_local1._rotation = _local1._rotation + _local1.rot;
Blackhole(_local1, 1);
_local5.push(_local1);
} else {
_local1.removeMovieClip();
}
} else {
explosion(_local1);
sparks(_local1);
_local1.removeMovieClip();
}
_local2++;
}
meteors = _local5;
}
function setShip(ob, hlp, thr, m, t, type, x, y, ro) {
ob.anim.gotoAndStop(1);
ob.thrust = 0;
ob.maxSpeed = m;
ob.ts = t;
ob.vx = 0;
ob.vy = 0;
ob._x = x;
ob._y = y;
ob.maxhp = hlp;
ob.hp = hlp;
ob.maxthrust = thr;
ob._rotation = ob._rotation + ro;
ob.anim.scht.gotoAndStop(type);
}
function ckb(ob) {
if (ob._x > 455) {
ob._x = -5;
} else if (ob._x < -5) {
ob._x = 455;
} else if (ob._y > 315) {
ob._y = -5;
} else if (ob._y < -5) {
ob._y = 315;
}
}
function setVel(ob) {
ob.vx = ob.vx * decay;
ob.vy = ob.vy * decay;
ob.vx = ob.vx + (ob.thrust * c(ob._rotation * tan));
ob.vy = ob.vy + (ob.thrust * s(ob._rotation * tan));
var _local2 = sq((ob.vx * ob.vx) + (ob.vy * ob.vy));
if (_local2 > ob.maxSpeed) {
ob.vx = ob.vx * (ob.maxSpeed / _local2);
ob.vy = ob.vy * (ob.maxSpeed / _local2);
}
ob._x = ob._x + ob.vy;
ob._y = ob._y - ob.vx;
}
function win(istrue) {
sallowed = 0;
wonan = fg.attachMovie("w", "won", 40000);
if (istrue) {
wonan.stop();
victory = 1;
} else {
wonan.gotoAndStop(2);
}
finished = 1;
}
function rlf(ob) {
ob.anim.gotoAndStop(5);
ob._rotation = ob._rotation - ob.ts;
}
function rrg(ob) {
ob.anim.gotoAndStop(4);
ob._rotation = ob._rotation + ob.ts;
}
function acc(ob) {
ob.thrust = ob.maxthrust;
ob.anim.gotoAndStop(2);
}
function rev(ob) {
ob.thrust = (-ob.maxthrust) / 2;
ob.anim.gotoAndStop(3);
}
function aim() {
var _local4 = bs._y - ps._y;
var _local3 = bs._x - ps._x;
var _local2 = ro((ma(-_local3, _local4) / pi) * 180);
var _local1 = bs._rotation - _local2;
if (_local1 > 0) {
rlf(bs);
} else {
rrg(bs);
}
}
function lockAn(pl, vis) {
if (vis) {
if (pl) {
fg.enlockan._visible = 1;
} else {
fg.enganim._visible = 1;
}
} else if (pl) {
fg.enlockan._visible = 0;
} else {
fg.enganim._visible = 0;
}
}
function aimTest() {
if (ps.aimzone.hitTest(bs._x, bs._y, 1)) {
ag++;
inpaimc++;
dg = dg - 30;
lockAn(1, 1);
} else {
lockAn(1, 0);
inpaimc = 0;
dg++;
}
if (bs.aimzone.hitTest(ps._x, ps._y, 1)) {
lockAn(0, 1);
aishoot();
dg++;
} else {
lockAn(0, 0);
}
}
function tco() {
if (ps.hitTest(bs)) {
var _local3 = ps._x - bs._x;
var _local2 = ps._y - bs._y;
var _local4 = (_local3 * _local3) + (_local2 * _local2);
if (_local4 < 324) {
to = 10;
ps._x = ps._x + _local3;
ps._y = ps._y + _local2;
bs._x = bs._x - _local3;
bs._y = bs._y - _local2;
bs.vx = -1 * ((ps.vx = ps.vx / 2));
bs.vy = -1 * ((ps.vy = ps.vy / 2));
ps.hp--;
bs.hp--;
sparks(ps);
sparks(bs);
sound_hit.start();
ps.shanim.gotoAndPlay(1);
bs.shanim.gotoAndPlay(1);
}
}
for (i in meteors) {
var _local1 = meteors[i];
mco(ps, _local1);
mco(bs, _local1);
}
}
function mco(ob, m) {
if (m.hitTest(ob)) {
var _local12 = ob._x;
var _local11 = ob._y;
var _local10 = m._x;
var _local9 = m._y;
var _local4 = _local12 - _local10;
var _local3 = _local11 - _local9;
var _local6 = _local4 / 4;
var _local5 = _local3 / 4;
var _local8 = (_local4 * _local4) + (_local3 * _local3);
var _local7 = (m._width / 2) + 10;
if (_local8 < (_local7 * _local7)) {
ob._x = ob._x + _local6;
ob._y = ob._y + _local5;
m._x = m._x - _local6;
m._y = m._y - _local5;
m.vx = -1 * ((ob.vx = ob.vx / -2));
m.vy = -1 * ((ob.vy = ob.vy / -2));
m.hp = m.hp - 26;
ob.hp--;
sparks(ob);
sound_hit.start();
ob.shanim.gotoAndPlay(1);
}
}
}
function evside(dir) {
if (evml || (!dir)) {
rlf(bs);
} else {
rrg(bs);
}
}
function evlong(dir) {
if (evmb || (dir)) {
rev(bs);
} else {
acc(bs);
}
}
function counterAttack() {
if (!cattset) {
var _local1 = cattacks.length;
canum = random(_local1);
catimer = cattacks[canum][2];
castep = 0;
evml = random(2);
evmb = random(2);
cattset = 1;
} else {
if (catimer == 0) {
if (cattacks[canum].length > (castep + 2)) {
castep = castep + 3;
} else {
catting = 0;
cattset = 0;
pac = 0;
}
}
if (catting) {
if (!(catimer % 2)) {
dcs(cattacks[canum][castep]);
} else if (catimer % 2) {
dcs(cattacks[canum][castep + 1]);
}
if (catimer > 0) {
catimer--;
}
}
}
}
function dcs(ob) {
if (ob.length == 1) {
switch (ob) {
case "a" :
aim();
break;
case "s" :
aishoot();
}
} else if (ob.length > 1) {
switch (ob) {
case "s0" :
evside(0);
break;
case "s1" :
evside(1);
break;
case "l0" :
evlong(0);
break;
case "l1" :
evlong(1);
}
}
}
function aiupd() {
var _local8 = 3;
var _local5 = 4;
if (defensive) {
_local8 = 1;
_local5 = 2;
}
if (catting) {
counterAttack();
}
if (((pac >= _local8) || (inpaimc >= _local5)) && (!catting)) {
pac = 0;
inpaimc = 0;
catting = 1;
}
if (ainodes.length > 0) {
var _local1 = 0;
var _local2 = 0;
var _local4 = 0;
for (i in ainodes) {
_local1 = _local1 + ainodes[i].ag;
_local2 = _local2 + ainodes[i].dg;
_local4++;
}
_local1 = _local1 / _local4;
_local2 = _local2 / _local4;
}
if ((_local2 == null) || (_local1 == null)) {
var _local1 = 0;
var _local2 = 0;
}
if (_local1 > _local2) {
defensive = 0;
var _local11 = (fg.agglvl = int(_local1 - _local2));
fg.agression.gotoAndStop(2);
} else {
defensive = 1;
var _local11 = (fg.agglvl = int(_local2 - _local1));
fg.agression.gotoAndStop(1);
}
fg.ai_g.dc.update(Math.min(25, Math.max(-25, Math.round(_local11))), Math.min(25, Math.max(-25, Math.round(_local1))), Math.min(25, Math.max(-25, Math.round(_local2))));
var _local7 = ps._x - bs._x;
var _local6 = ps._y - bs._y;
var _local3 = sq((_local7 * _local7) + (_local6 * _local6));
dsum = dsum + _local3;
avdc++;
avgd = dsum / avdc;
var _local10 = 0;
if (dstb <= _local3) {
_local10 = 1;
ag++;
} else {
dg++;
}
if (((!_local10) || (p_ml)) || (p_mr)) {
dg++;
} else {
ag++;
}
var _local9 = 0;
if (_local3 <= avgd) {
ag++;
_local9 = 1;
} else {
dg++;
}
if (_local9 && (p_mx)) {
ag++;
} else {
dg++;
}
aimTest();
if (!catting) {
aimTest();
if (ag < dg) {
if ((_local3 < 50) || (_local3 > 60)) {
acc(bs);
}
if ((_local3 > 50) && (_local3 < 60)) {
rev(bs);
}
aim();
} else {
aim();
rev(bs);
}
}
dstb = _local3;
p_mr = 0;
p_ml = 0;
p_ma = 0;
p_mb = 0;
p_mx = 0;
if (aic < 4) {
aic++;
} else {
aireset();
}
}
function aishoot() {
if (bstimeout == 0) {
if (fg.enganim._visible) {
crlas(1);
bstimeout = 5 + ((3 - dif) * 5);
}
}
}
function aireset() {
aic = 0;
if ((ag == -1) || (dg == -1)) {
ag = (dg = (pmlc = (pmrc = (pmac = (pmbc = (pmnc = (pmxc = (dstb = (dsum = (avgd = (avdc = 0)))))))))));
} else {
var _local1 = (ainodes[ainodes.length] = new Object());
_local1.ag = ag;
_local1.dg = dg;
ag = 0;
dg = 0;
}
}
function crlas(ai) {
var _local3 = playerlaser;
var _local2 = ps;
var _local5 = 1;
if (ai) {
_local5 = 2;
_local2 = bs;
_local3 = baddielaser;
}
var _local4 = _local2._rotation * (pi / 180);
var _local7 = s(_local4);
var _local6 = c(_local4) * -1;
var _local1 = sp.attachMovie("laser" + _local5, "las" + lasc, lasc++);
_local1.vx = _local7 * lsp;
_local1.vy = _local6 * lsp;
_local1._rotation = _local2._rotation;
_local1._x = _local2._x;
_local1._y = _local2._y;
_local3[_local3.length] = _local1;
}
function uplas() {
var _local9 = new Array(0);
var _local10 = playerlaser.length;
var _local4 = 0;
while (_local4 < _local10) {
var _local1 = playerlaser[_local4];
if (!_local1.hitTest(bs.hare)) {
if (((_local1._y < 400) && (_local1._x > 0)) && (_local1._x < 450)) {
var _local6 = 0;
for (i in meteors) {
var _local2 = meteors[i];
if (_local1.hitTest(_local2)) {
_local2.hp--;
explosion(_local1);
break;
}
}
if (!_local6) {
_local1._x = _local1._x + _local1.vx;
_local1._y = _local1._y + _local1.vy;
_local9.push(_local1);
} else {
_local1.removeMovieClip();
}
} else {
_local1.removeMovieClip();
}
} else {
var _local5 = _local1.vx;
var _local7 = _local1.vy;
bs.vx = bs.vx + (-_local7);
bs.vy = bs.vy + _local5;
_local1.removeMovieClip();
ag = ag + 70;
pac++;
bs.hp--;
sound_hit.start();
bs.shanim.hpshield._alpha = 20;
bs.hp;
sparks(bs);
bs.shanim.gotoAndPlay(1);
dg = dg - 150;
}
_local4++;
}
playerlaser = _local9;
var _local8 = new Array(0);
var _local11 = baddielaser.length;
var _local3 = 0;
while (_local3 < _local11) {
var _local1 = baddielaser[_local3];
if (!_local1.hitTest(ps.hare)) {
if (((_local1._y < 400) && (_local1._x > 0)) && (_local1._x < 450)) {
var _local6 = 0;
for (i in meteors) {
var _local2 = meteors[i];
if (_local1.hitTest(_local2)) {
_local2.hp--;
explosion(_local1);
break;
}
}
if (!_local6) {
_local1._x = _local1._x + _local1.vx;
_local1._y = _local1._y + _local1.vy;
_local8.push(_local1);
} else {
_local1.removeMovieClip();
}
} else {
_local1.removeMovieClip();
}
} else {
var _local5 = _local1.vx;
var _local7 = _local1.vy;
ps.vx = ps.vx + (-_local7);
ps.vy = ps.vy + _local5;
sound_hit.start();
_local1.removeMovieClip();
ps.shanim.gotoAndPlay(1);
ps.hp--;
ps.shanim.hpshield._alpha = 20;
ps.hp;
sparks(ps);
dg = dg + 50;
ag = ag - 20;
}
_local3++;
}
baddielaser = _local8;
}
function update() {
var _local1 = ainodes.length;
if (_local1 > 30) {
fg.ailper = "res";
ainodes = new Array(0);
} else {
fg.ailper = mf(3.33333333333333 * _local1);
}
if (mtst <= 0) {
cmeteors();
mtst = 400;
} else {
mtst--;
}
Blackhole(ps, 0);
Blackhole(bs, 0);
if (catting) {
fg.encattshow._visible = 1;
fg.encattshow.play();
} else {
fg.encattshow._visible = 0;
fg.encattshow.stop();
}
if (finished) {
if (tsplints.length == 0) {
end();
}
}
updateParticles();
var _local2 = ro((100 / ps.maxhp) * ps.hp);
var _local3 = ro((100 / bs.maxhp) * bs.hp);
fg.phpb.gotoAndStop(101 - (_local2 + 1));
fg.bhpb.gotoAndStop(101 - (_local3 + 1));
if (ps.hp <= 0) {
if (!finished) {
splinters(ps);
ps.removeMovieClip();
win(0);
}
}
if ((bs.hp <= 0) && (!finished)) {
splinters(bs);
bs.removeMovieClip();
if (!finished) {
win(1);
}
}
uplas();
tco();
ckb(ps);
ckb(bs);
ps.thrust = 0;
bs.thrust = 0;
aiupd();
ps.anim.gotoAndStop(1);
if (to <= 0) {
if (Key.isDown(39)) {
pmrc++;
p_mr = 1;
rrg(ps);
} else if (Key.isDown(37)) {
pmlc++;
p_ml = 1;
rlf(ps);
} else if (Key.isDown(38)) {
pmac++;
p_mu = 1;
acc(ps);
} else if (Key.isDown(40)) {
pmbc++;
p_mb = 1;
rev(ps);
} else {
pmnc++;
}
} else {
to--;
}
if (pstimeout > 0) {
pstimeout--;
}
if (bstimeout > 0) {
bstimeout--;
}
if (Key.isDown(32)) {
if (pstimeout == 0) {
crlas(0);
pstimeout = 6;
}
pmxc++;
ag++;
p_mx = 1;
}
setVel(bs);
setVel(ps);
}
gameInfo = {creator:"LeechMasterB", name:"Space Duel", info:"Destroy the Enemy", keyboard:1};
startGame(2);
stop();
Symbol 8 MovieClip [winanim] Frame 60
stop();
Mouse.show();
Instance of Symbol 7 MovieClip in Symbol 8 MovieClip [winanim] Frame 60
on (press) {
_root.startGame(2);
}
Symbol 11 MovieClip [loseanim] Frame 60
stop();
Mouse.show();
Instance of Symbol 7 MovieClip in Symbol 11 MovieClip [loseanim] Frame 60
on (press) {
_root.startGame(2);
}
Symbol 14 MovieClip [scrolllayer] Frame 1
#initclip 4
Object.registerClass("scrolllayer", Scob);
#endinitclip
Symbol 96 MovieClip [expl] Frame 1
cnt = 1;
Symbol 96 MovieClip [expl] Frame 12
if (cnt > 0) {
gotoAndPlay (2);
cnt--;
} else {
stop();
this.removeMovieClip();
}
Symbol 119 MovieClip [shield] Frame 10
stop();
Symbol 136 MovieClip [drawclip] Frame 1
#initclip 3
Object.registerClass("drawclip", DrawAI);
#endinitclip
Symbol 200 Button
on (release) {
getURL ("http://www.newgrounds.com", "blank");
}
Symbol 205 Button
on (release) {
_root.play();
}
Symbol 207 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
bar._xscale = PercentLoaded;
} else {
gotoAndStop ("loaded");
}
Symbol 207 MovieClip Frame 2
gotoAndPlay (1);
Symbol 210 MovieClip [__Packages.DrawAI] Frame 0
class DrawAI extends MovieClip
{
var attachMovie, dn;
function DrawAI () {
super();
init();
}
function init() {
attDN(0, 0);
}
function attDN(nb, nc, nd, nf) {
var _local2 = attachMovie("scrolllayer", "sclay" + scc, 10 + (scc++));
_local2.nb = nb;
_local2.nc = nc;
_local2.nd = nd;
_local2.nf = nf;
}
function update(tas, tds, avg) {
var _local12 = dn.length;
for (var _local11 in this) {
var _local2 = this[_local11];
var _local5 = _local2._x;
if (_local5 > -50) {
var _local4 = _local2._x;
var _local3 = -25 - tas;
var _local7 = -25 - tds;
var _local6 = -25 - avg;
_local2.upd(-_local4, _local3, _local7, _local6);
}
_local2._x--;
switch (_local5) {
case -50 :
attDN(_local4, _local3);
break;
case -250 :
_local2.removeMovieClip();
}
}
}
var thickness = 1;
var rgb = 16711680;
var alpha = 100;
var scc = 0;
}
Symbol 211 MovieClip [__Packages.Scob] Frame 0
class Scob extends MovieClip
{
var nb, nc, nd, nf;
function Scob () {
super();
}
function upd(x, y, z, q) {
drawLine(nb, nc, x, y, 16711680);
drawLine(nb, nd, x, z, 16776960);
drawLine(nb, nf, x, q, 16711935);
nb = x;
nc = y;
nd = z;
nf = q;
}
function drawLine(x1, y1, x2, y2, col) {
var c = this;
with (c) {
c.lineStyle(thickness, col, alpha);
c.moveTo(x1, y1);
c.lineTo(x2, y2);
}
}
var thickness = 1;
var rgb = 16711680;
var alpha = 100;
}