Frame 1
function preloadSite() {
var _local3 = _root.getBytesLoaded();
var _local2 = _root.getBytesTotal();
var _local4 = Math.round((_local3 / _local2) * 100);
loadingBar._xscale = _local4;
percentClip.percentDisplay.text = _local4 + "%";
percentClip._x = loadingBar._x + loadingBar._width;
bytesDisplay.text = ((("loaded " + _local3) + " of ") + _local2) + " bytes";
if (_local3 >= _local2) {
c++;
if (c > 20) {
clearInterval(loadingCall);
gotoAndPlay(_root._currentframe + 1);
}
}
}
stop();
c = 0;
loadingBar._xscale = 1;
var loadingCall = setInterval(preloadSite, 50);
Frame 3
stop();
Instance of Symbol 127 MovieClip in Frame 3
onClipEvent (enterFrame) {
this.onRelease = function () {
getURL ("http://www.armorgames.com", "_blank");
};
}
Frame 4
stop();
Instance of Symbol 139 MovieClip in Frame 4
on (release) {
getURL ("http://www.mkprogramming.com/games.htm", "_BLANK");
}
Frame 5
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("ae4df543", this, 10301, true);
stop();
_root.kongregateServices.connect();
for (var i in _root) {
if (typeof(_root[i]) == "movieclip") {
_root[i].removeMovieClip();
}
}
attachMovie("newmouse", "newmouse", _root.getNextHighestDepth());
attachMovie("circle", "circle", _root.getNextHighestDepth(), {_x:300, _y:350});
attachMovie("base", "base", _root.getNextHighestDepth(), {_x:250, _y:200});
attachMovie("crosshair", "crosshair", _root.getNextHighestDepth());
attachMovie("ball", "ball", _root.getNextHighestDepth(), {_x:250, _y:200});
Frame 6
stop();
sound.stop();
sound = new Sound(this);
sound.attachSound("song");
sound.start(0, 99);
function addEnemy(num) {
switch (num) {
case 1 :
var _local2 = random(360);
var _local4 = _root.circle._x + (300 * Math.cos(_local2));
var _local3 = _root.circle._y + (300 * Math.sin(_local2));
enemy.push(_root.attachMovie("eball", "ball_" + balls, _root.getNextHighestDepth(), {_x:_local4, _y:_local3, id:enemy.length}));
balls++;
break;
case 2 :
_local2 = random(360);
_local4 = _root.circle._x + (300 * Math.cos(_local2));
_local3 = _root.circle._y + (300 * Math.sin(_local2));
enemy.push(_root.attachMovie("eballmiss", "ball_" + balls, _root.getNextHighestDepth(), {_x:_local4, _y:_local3, id:enemy.length}));
balls++;
break;
case 3 :
_local2 = random(360);
_local4 = _root.circle._x + (300 * Math.cos(_local2));
_local3 = _root.circle._y + (300 * Math.sin(_local2));
enemy.push(_root.attachMovie("eballshoot", "ball_" + balls, _root.getNextHighestDepth(), {_x:_local4, _y:_local3, id:enemy.length}));
balls++;
break;
case 4 :
_local2 = random(360);
_local4 = _root.circle._x + (300 * Math.cos(_local2));
_local3 = _root.circle._y + (300 * Math.sin(_local2));
enemy.push(_root.attachMovie("eball_2", "ball_" + balls, _root.getNextHighestDepth(), {_x:_local4, _y:_local3, id:enemy.length}));
balls++;
break;
case 5 :
_local2 = random(360);
_local4 = _root.circle._x + (300 * Math.cos(_local2));
_local3 = _root.circle._y + (300 * Math.sin(_local2));
enemy.push(_root.attachMovie("eballmiss_2", "ball_" + balls, _root.getNextHighestDepth(), {_x:_local4, _y:_local3, id:enemy.length}));
balls++;
}
}
function checkLevel() {
var _local2 = 0;
x = 0;
while (x < _root.enemy.length) {
trace(x);
if (_root.enemy[x] != undefined) {
if (!_root.enemy[x].dead) {
_local2++;
}
}
x++;
}
if (_local2 < 1) {
if (enemySpot >= _root.level[1].length) {
trace("NEXT LEVEL");
nextLevel();
} else {
trace("enemySpot is smaller");
}
}
}
function nextLevel() {
_root.attachMovie("nicejob", "nice", _root.getNextHighestDepth(), {_x:300, _y:300});
nice.gotoAndStop(random(5) + 1);
levelnum++;
switch (levelnum) {
case 2 :
level[0] = new Array(60, 70, 140, 200, 210, 290, 300, 330, 430, 500);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
break;
case 3 :
level[0] = new Array(60, 70, 140, 200, 250, 290, 300, 330, 430, 500, 550, 600, 680, 770);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
break;
case 4 :
level[0] = new Array(60, 70, 140, 200, 210, 290, 300, 330, 430, 500, 550, 680, 770, 780);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 1, 1, 1);
break;
case 5 :
level[0] = new Array(60, 70, 140, 200, 210, 290, 300, 330, 430, 500, 550, 680, 770, 780, 800, 810, 820, 830, 840, 850);
level[1] = new Array(1, 1, 1, 1, 1, 1, 5, 1, 1, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1);
break;
case 6 :
level[0] = new Array(50, 100, 150, 180, 200, 220, 300, 350, 355, 400, 450, 500, 550, 570);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 1, 1, 1);
break;
case 7 :
level[0] = new Array(60, 70, 140, 200, 210, 290, 300, 330, 430, 500, 550, 680, 770, 780);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1);
break;
case 8 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 5, 2, 2, 1, 1, 1);
break;
case 9 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(1, 1, 2, 1, 1, 1, 1, 1, 5, 2, 2, 1, 1, 1);
break;
case 10 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(1, 2, 2, 2, 5, 1, 1, 1, 1, 2, 2, 1, 1, 1);
break;
case 11 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420, 422, 426, 450);
level[1] = new Array(1, 1, 1, 3, 3, 1, 1, 1, 5, 2, 2, 1, 1, 1, 2, 5, 1);
break;
case 12 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(3, 3, 1, 1, 1, 1, 4, 1, 1, 2, 2, 1, 1, 5);
break;
case 13 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420, 430, 440, 450);
level[1] = new Array(1, 5, 5, 5, 1, 3, 5, 5, 2, 2, 2, 1, 1, 1, 1, 1, 1);
break;
case 14 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(3, 3, 1, 1, 5, 1, 1, 4, 1, 2, 2, 1, 1, 5);
break;
case 15 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(1, 1, 4, 4, 4, 1, 1, 1, 1, 2, 2, 5, 1, 1);
break;
case 16 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(2, 2, 4, 3, 2, 1, 4, 3, 1, 2, 2, 1, 1, 1);
break;
case 17 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(1, 1, 4, 5, 4, 3, 2, 1, 1, 2, 2, 1, 1, 1);
break;
case 18 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420, 425, 430);
level[1] = new Array(1, 1, 1, 3, 1, 1, 3, 4, 3, 2, 2, 5, 1, 1, 4, 4);
break;
case 19 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420, 440);
level[1] = new Array(1, 1, 3, 3, 1, 1, 1, 1, 1, 2, 2, 5, 5, 5, 4);
break;
case 20 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420, 425, 430, 435, 440, 445, 450);
level[1] = new Array(3, 3, 3, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 5, 2, 5, 2, 4, 5);
break;
case 21 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(5, 5, 5, 5, 5, 5, 2, 5, 5, 2, 2, 2, 2, 5);
break;
case 22 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(5, 5, 5, 2, 3, 1, 1, 1, 1, 2, 2, 1, 3, 1);
break;
case 23 :
level[0] = new Array(60, 70, 100, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4, 5, 1);
break;
case 24 :
level[0] = new Array(60, 80, 120, 150, 170, 190, 200, 230, 230, 300, 350, 380, 400, 420);
level[1] = new Array(4, 4, 4, 3, 3, 4, 4, 1, 1, 2, 2, 1, 3, 4);
break;
case 25 :
youwin();
default :
youwin();
}
}
function upgrades() {
if (!gpaused) {
gpaused = true;
upgraded = false;
x = 0;
while (x < _root.enemy.length) {
_root.enemy[x].removeMovieClip();
x++;
}
_root.enemy = new Array();
enemySpot = 0;
timer = 0;
_root.attachMovie("upgrades", "upgrades", _root.getNextHighestDepth());
}
}
function startagain() {
_root.circle.reset();
gpaused = false;
}
function youwin() {
gpaused = true;
_root.attachMovie("youwin", "youwin", _root.getNextHighestDepth(), {_x:300, _y:300});
}
upgraded = false;
score = 0;
mscore = 0;
level = new Array();
level[0] = new Array(60, 120, 200, 280, 380, 450, 500, 600, 630, 660);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
gpaused = false;
levelnum = 1;
powered = false;
balls = 0;
ss = 0.001;
timer = 0;
enemySpot = 0;
enemy = new Array();
enemys = "";
attached = false;
this.onEnterFrame = function () {
if (Key.isDown(80)) {
gpaused = true;
if (!attached) {
_root.attachMovie("paused", "paused", _root.getNextHighestDepth(), {_x:300, _y:300});
attached = true;
}
}
trace(gpaused);
if (!gpaused) {
timer++;
if (timer == level[0][enemySpot]) {
addEnemy(level[1][enemySpot]);
enemySpot++;
}
if ((timer % 100) == 0) {
trace("next?");
checkLevel();
}
if (score < mscore) {
score = score + random(10);
}
}
};
Frame 7
stop();
sound.stop();
sound = new Sound(this);
sound.attachSound("song");
sound.start(0, 99);
function addEnemy(num) {
trace(num);
switch (num) {
case 1 :
var _local4 = random(360);
var _local3 = _root.circle._x + (300 * Math.cos(_local4));
var _local2 = _root.circle._y + (300 * Math.sin(_local4));
trace(_local3);
trace(_local2);
enemy.push(_root.attachMovie("eball", "ball_" + balls, _root.getNextHighestDepth(), {_x:_local3, _y:_local2, id:enemy.length}));
balls++;
break;
case 2 :
_local4 = random(360);
_local3 = _root.circle._x + (300 * Math.cos(_local4));
_local2 = _root.circle._y + (300 * Math.sin(_local4));
trace(_local3);
trace(_local2);
enemy.push(_root.attachMovie("eballmiss", "ball_" + balls, _root.getNextHighestDepth(), {_x:_local3, _y:_local2, id:enemy.length}));
balls++;
break;
case 3 :
_local4 = random(360);
_local3 = _root.circle._x + (300 * Math.cos(_local4));
_local2 = _root.circle._y + (300 * Math.sin(_local4));
trace(_local3);
trace(_local2);
enemy.push(_root.attachMovie("eballshoot", "ball_" + balls, _root.getNextHighestDepth(), {_x:_local3, _y:_local2, id:enemy.length}));
balls++;
}
trace("added" + enemy[enemy.length]);
}
function checkLevel() {
var _local2 = 0;
x = 0;
while (x < _root.enemy.length) {
trace(x);
if (_root.enemy[x] != undefined) {
if (!_root.enemy[x].dead) {
_local2++;
}
}
x++;
}
if (_local2 < 1) {
trace("NEXT LEVEL");
nextLevel();
}
}
function nextLevel() {
_root.attachMovie("nicejob", "nice", _root.getNextHighestDepth(), {_x:300, _y:300});
nice.gotoAndStop(random(5) + 1);
startagain();
levelnum++;
switch (levelnum) {
case 2 :
level[0] = new Array(60, 70, 140, 200, 210, 290, 300, 330, 430, 500);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
break;
case 3 :
level[0] = new Array(60, 70, 140, 200, 210, 290, 300, 330, 430, 500, 550, 600, 650, 700);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
break;
case 4 :
level[0] = new Array(60, 70, 140, 200, 210, 290, 300, 330, 430, 500, 550, 600, 650, 700);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1);
}
}
function startagain() {
_root.circle.reset();
gpaused = false;
}
function clearall() {
x = 0;
while (x < _root.enemy.length) {
_root.enemy[x].removeMovieClip();
x++;
}
_root.enemy = new Array();
}
function youwin() {
gpaused = true;
_root.attachMovie("youwin", "youwin", _root.getNextHighestDepth(), {_x:300, _y:300});
}
upgraded = false;
score = 0;
mscore = 0;
level = new Array();
level[0] = new Array(60, 120, 200, 280, 380, 450, 500, 600, 630, 660);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
gpaused = false;
levelnum = 1;
powered = false;
balls = 0;
ss = 0.001;
timer = 0;
enemySpot = 0;
Mouse.hide();
enemy = new Array();
_root.ship.shoot = true;
_root.ship.sspeed = 15;
_root.crosshair.cmdist = 15;
_root.crosshair.mdist = 5;
sendmore = 100;
number = 1;
time = 0;
attached = false;
this.onEnterFrame = function () {
if (Key.isDown(80)) {
gpaused = true;
if (!attached) {
_root.attachMovie("paused", "paused", _root.getNextHighestDepth(), {_x:300, _y:300});
attached = true;
}
}
if (!gpaused) {
if (score < mscore) {
score = score + random(10);
}
timer++;
if ((timer % 30) == 0) {
time++;
}
if ((timer % sendmore) == 0) {
var _local2 = random(number) + 1;
sendmore--;
trace(sendmore);
addEnemy(_local2);
if (sendmore < 75) {
addEnemy(_local2);
} else if (sendmore < 50) {
addEnemy(_local2);
}
if (sendmore == 70) {
number++;
}
if (sendmore == 50) {
number++;
}
if (sendmore == 0) {
sendmore = 100;
number = 1;
clearall();
}
timer = 0;
}
}
};
Symbol 12 Button
on (release) {
getURL ("http://mkprogramming.com", "_blank");
}
Symbol 21 Button
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 23 Button
on (release) {
_root.gpaused = false;
_root.attached = false;
this.removeMovieClip();
}
Symbol 25 Button
on (release) {
upgraded = false;
score = 0;
mscore = 0;
level = new Array();
level[0] = new Array(60, 120, 200, 280, 380, 450, 500, 600, 630, 660);
level[1] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
gpaused = true;
levelnum = 1;
powered = false;
balls = 0;
ss = 0.0009;
timer = 0;
enemySpot = 0;
enemy = new Array();
enemys = "";
_root.gotoAndStop(5);
}
Symbol 26 MovieClip [paused] Frame 10
stop();
this._x = 300;
this._y = 300;
_root.gpaused = true;
_root.kongregateStats.submit("HighScore", _root.score);
_root.kongregateStats.submit("HighestLevel", _root.levelnum);
Symbol 31 MovieClip [youwin] Frame 10
stop();
this._x = 300;
this._y = 300;
_root.gpaused = true;
_root.kongregateStats.submit("HighScore", _root.score);
_root.kongregateStats.submit("HighestLevel", _root.levelnum);
Symbol 33 MovieClip [eball] Frame 1
function implode() {
if (!added) {
_root.mscore = _root.mscore + 100;
added = true;
}
dead = true;
this.xspeed = 0;
this.yspeed = 0;
this._x = -123;
}
var dropShad = (new flash.filters.DropShadowFilter(10, 120, 0, 10, 15, 15, 0.25, 3));
this.filters = [dropShad];
dead = false;
xspeed = 0;
yspeed = 0;
mass = 10;
collision = 0;
friction = 0.9;
added = false;
speed_scale = _root.ss;
dist_x = (_root.circle._x - this._x) * speed_scale;
dist_y = (_root.circle._y - this._y) * speed_scale;
hit = false;
this.onEnterFrame = function () {
if (!_root.gpaused) {
if (!hit) {
xspeed = xspeed + dist_x;
yspeed = yspeed + dist_y;
xspeed = xspeed * friction;
yspeed = yspeed * friction;
}
this._x = this._x + xspeed;
this._y = this._y + yspeed;
if (hit || (onscreen)) {
if (this._x < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._x > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
if (this._y < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._y > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
}
}
};
Symbol 43 MovieClip [ball] Frame 1
function checkHits() {
x = 0;
while (x < _root.enemy.length) {
if (_root.enemy[x] != undefined) {
var _local3 = ((this._width / 2) + 2) + ((_root.enemy[x]._width / 2) + 2);
distance_x = Math.abs(_root.enemy[x]._x - this._x);
distance_y = Math.abs(_root.enemy[x]._y - this._y);
distance = Math.sqrt((distance_x * distance_x) + (distance_y * distance_y));
if ((distance <= _local3) && ((_root.enemy[x].collision == 0) or (this.collision == 0))) {
_root.enemy[x].collision = 1;
_root.enemy[x].hit = true;
this.collision = 1;
manage_bounce(this, _root.enemy[x]);
} else if (distance > _local3) {
_root.enemy[x].collision = 0;
this.collision = 0;
}
}
x++;
}
}
function manage_bounce(ball, ball2) {
dx = ball._x - ball2._x;
dy = ball._y - ball2._y;
collisionision_angle = Math.atan2(dy, dx);
magnitude_1 = Math.sqrt((ball.xspeed * ball.xspeed) + (ball.yspeed * ball.yspeed));
magnitude_2 = Math.sqrt((ball2.xspeed * ball2.xspeed) + (ball2.yspeed * ball2.yspeed));
direction_1 = Math.atan2(ball.yspeed, ball.xspeed);
direction_2 = Math.atan2(ball2.yspeed, ball2.xspeed);
new_xspeed_1 = magnitude_1 * Math.cos(direction_1 - collisionision_angle);
new_yspeed_1 = magnitude_1 * Math.sin(direction_1 - collisionision_angle);
new_xspeed_2 = magnitude_2 * Math.cos(direction_2 - collisionision_angle);
new_yspeed_2 = magnitude_2 * Math.sin(direction_2 - collisionision_angle);
final_xspeed_1 = (((ball.mass - ball2.mass) * new_xspeed_1) + ((ball2.mass + ball2.mass) * new_xspeed_2)) / (ball.mass + ball2.mass);
final_xspeed_2 = (((ball.mass + ball.mass) * new_xspeed_1) + ((ball2.mass - ball.mass) * new_xspeed_2)) / (ball.mass + ball2.mass);
final_yspeed_1 = new_yspeed_1;
final_yspeed_2 = new_yspeed_2;
ball.xspeed = (Math.cos(collisionision_angle) * final_xspeed_1) + (Math.cos(collisionision_angle + (Math.PI/2)) * final_yspeed_1);
ball.yspeed = (Math.sin(collisionision_angle) * final_xspeed_1) + (Math.sin(collisionision_angle + (Math.PI/2)) * final_yspeed_1);
ball2.xspeed = (Math.cos(collisionision_angle) * final_xspeed_2) + (Math.cos(collisionision_angle + (Math.PI/2)) * final_yspeed_2);
ball2.yspeed = (Math.sin(collisionision_angle) * final_xspeed_2) + (Math.sin(collisionision_angle + (Math.PI/2)) * final_yspeed_2);
if ((Math.abs(ball2.xspeed) < 1) || (Math.abs(ball2.yspeed) < 1)) {
ball2.xspeed = ball2.xspeed * 3;
ball2.yspeed = ball2.yspeed * 3;
}
if ((Math.abs(ball2.xspeed) > 150) || (Math.abs(ball2.yspeed) > 150)) {
ball2.implode();
}
}
var dropShad = (new flash.filters.DropShadowFilter(10, 120, 0, 10, 15, 15, 0.5, 3));
this.filters = [dropShad];
xspeed = 0;
yspeed = 0;
friction = 0.9;
collision = 0;
speed_scale = 0.08;
sx = 0;
sy = 0;
mass = 4;
this.drawline = _root.createEmptyMovieClip("drawline_" + _root.balls, _root.getNextHighestDepth());
drawline.dead = false;
drawline.lineStyle(1, 3355443, 100);
drawline.moveTo(this._x, this._y);
drawline.onEnterFrame = function () {
if (this.dead) {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.removeMovieClip();
}
}
};
drawline.die = function () {
this._alpha = this._alpha - 5;
this.dead = true;
};
this.onEnterFrame = function () {
if (!_root.gpaused) {
var _local5 = (_root.crosshair._x - this._x) * speed_scale;
var _local3 = (_root.crosshair._y - this._y) * speed_scale;
xspeed = xspeed + _local5;
yspeed = yspeed + _local3;
xspeed = xspeed * friction;
yspeed = yspeed * friction;
this._x = this._x + xspeed;
this._y = this._y + yspeed;
drawline.clear();
drawline.lineStyle(2, 0, 100);
var _local9 = _root.circle._x;
var _local7 = _root.circle._y;
var _local6 = this._x;
var _local4 = this._y;
var _local10 = _root.crosshair._x;
var _local8 = _root.crosshair._y;
drawline.moveTo(_local9, _local7);
drawline.curveTo(_local10, _local8, _local6, _local4);
checkHits();
if (this._x < 15) {
this._x = 15;
this.xspeed = this.xspeed * -1;
} else if (this._x > 585) {
this._x = 585;
this.xspeed = this.xspeed * -1;
}
if (this._y < 15) {
this._y = 15;
this.yspeed = this.yspeed * -1;
} else if (this._y > 585) {
this._y = 585;
this.yspeed = this.yspeed * -1;
}
}
};
Symbol 44 MovieClip [circle] Frame 1
function shrink(num) {
this.maxwidth = this.maxwidth - (num * 2);
this.maxheight = this.maxheight - (num * 2);
this.mass--;
}
function checkHits() {
x = 0;
while (x < _root.enemy.length) {
if (_root.enemy[x] != undefined) {
var _local3 = ((this._width / 2) + 1) + ((_root.enemy[x]._width / 2) + 1);
distance_x = Math.abs(_root.enemy[x]._x - this._x);
distance_y = Math.abs(_root.enemy[x]._y - this._y);
distance = Math.sqrt((distance_x * distance_x) + (distance_y * distance_y));
if ((distance <= _local3) && ((_root.enemy[x].collision == 0) || (this.collision == 0))) {
_root.enemy[x].collision = 1;
if (!_root.enemy[x].hit) {
this.shrink(_root.enemy[x].mass);
}
_root.enemy[x].hit = true;
this.collision = 1;
manage_bounce(this, _root.enemy[x]);
} else if (distance > _local3) {
_root.enemy[x].collision = 0;
this.collision = 0;
}
}
x++;
}
}
function manage_bounce(ball, ball2) {
dx = ball._x - ball2._x;
dy = ball._y - ball2._y;
collisionision_angle = Math.atan2(dy, dx);
magnitude_1 = Math.sqrt((ball.xspeed * ball.xspeed) + (ball.yspeed * ball.yspeed));
magnitude_2 = Math.sqrt((ball2.xspeed * ball2.xspeed) + (ball2.yspeed * ball2.yspeed));
direction_1 = Math.atan2(ball.yspeed, ball.xspeed);
direction_2 = Math.atan2(ball2.yspeed, ball2.xspeed);
new_xspeed_1 = magnitude_1 * Math.cos(direction_1 - collisionision_angle);
new_yspeed_1 = magnitude_1 * Math.sin(direction_1 - collisionision_angle);
new_xspeed_2 = magnitude_2 * Math.cos(direction_2 - collisionision_angle);
new_yspeed_2 = magnitude_2 * Math.sin(direction_2 - collisionision_angle);
final_xspeed_1 = (((ball.mass - ball2.mass) * new_xspeed_1) + ((ball2.mass + ball2.mass) * new_xspeed_2)) / (ball.mass + ball2.mass);
final_xspeed_2 = (((ball.mass + ball.mass) * new_xspeed_1) + ((ball2.mass - ball.mass) * new_xspeed_2)) / (ball.mass + ball2.mass);
final_yspeed_1 = new_yspeed_1;
final_yspeed_2 = new_yspeed_2;
ball.xspeed = ((Math.cos(collisionision_angle) * final_xspeed_1) + (Math.cos(collisionision_angle + (Math.PI/2)) * final_yspeed_1)) * 2;
ball.yspeed = ((Math.sin(collisionision_angle) * final_xspeed_1) + (Math.sin(collisionision_angle + (Math.PI/2)) * final_yspeed_1)) * 2;
ball2.xspeed = (Math.cos(collisionision_angle) * final_xspeed_2) + (Math.cos(collisionision_angle + (Math.PI/2)) * final_yspeed_2);
ball2.yspeed = (Math.sin(collisionision_angle) * final_xspeed_2) + (Math.sin(collisionision_angle + (Math.PI/2)) * final_yspeed_2);
if ((Math.abs(ball2.xspeed) < 1) || (Math.abs(ball2.yspeed) < 1)) {
ball2.xspeed = ball2.xspeed * 3;
ball2.yspeed = ball2.yspeed * 3;
}
if ((Math.abs(ball2.xspeed) > 150) || (Math.abs(ball2.yspeed) > 150)) {
ball2.implode();
}
}
function reset() {
trace("resized");
mass = 100;
maxwidth = startsize;
maxheight = startsize;
this._height = startsize;
this._width = startsize;
}
function die() {
if (!_root.gpaused) {
_root.gpaused = true;
_root.attachMovie("gameover", "gameover", _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
}
}
stop();
var dropShad = (new flash.filters.DropShadowFilter(10, 120, 0, 10, 15, 15, 0.25, 3));
this.filters = [dropShad];
_root.attachMovie("ship", "ship", _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
startsize = 100;
xspeed = 0;
yspeed = 0;
friction = 0.9;
collision = 0;
speed_scale = 0.08;
mass = 100;
maxwidth = startsize;
maxheight = startsize;
x = 0;
while (x < 1) {
x++;
}
this.onEnterFrame = function () {
if ((this._width < 35) || (this.maxwidth < 35)) {
trace("ahh");
die();
}
if (!_root.gpaused) {
xspeed = xspeed * friction;
yspeed = yspeed * friction;
this._x = this._x + xspeed;
this._y = this._y + yspeed;
checkHits();
if (this._width > maxwidth) {
this._width = this._width - 0.5;
}
if (this._height > maxheight) {
this._height = this._height - 0.5;
}
}
if ((Math.abs(this.xspeed) > 20) || (Math.abs(this.yspeed) > 20)) {
this.xspeed = 0;
this.yspeed = 0;
}
};
Symbol 46 MovieClip [crosshair] Frame 1
dist_x = 0;
dist_y = 0;
distance = 0;
time = 0;
mdist = 2;
cmdist = 30;
this.onEnterFrame = function () {
if (!gpaused) {
this._x = _root._xmouse;
this._y = _root._ymouse;
dist_x = this._x - _root.circle._x;
dist_y = this._y - _root.circle._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (!_root.powered) {
if (distance > 45) {
angle = Math.atan2(dist_y, dist_x);
this._x = _root.circle._x + (45 * Math.cos(angle));
this._y = _root.circle._y + (45 * Math.sin(angle));
}
} else {
angle = Math.atan2(dist_y, dist_x);
this._x = _root.circle._x + ((45 * mdist) * Math.cos(angle));
this._y = _root.circle._y + ((45 * mdist) * Math.sin(angle));
time++;
if (time >= 10) {
_root.powered = false;
time = 0;
}
}
var dist_x = (_root.ball._x - _root.circle._x);
var dist_y = (_root.ball._y - _root.circle._y);
var distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
var angle = Math.atan2(dist_y, dist_x);
if (distance > 50) {
_root.circle._x = _root.circle._x + (Math.cos(angle) * ((distance * cmdist) / (_root.circle.mass * 10)));
_root.circle._y = _root.circle._y + (Math.sin(angle) * ((distance * cmdist) / (_root.circle.mass * 10)));
}
}
};
Symbol 48 MovieClip [eball_2] Frame 1
function implode() {
if (!added) {
_root.mscore = _root.mscore + 100;
added = true;
}
dead = true;
this.xspeed = 0;
this.yspeed = 0;
this._x = -123;
}
var dropShad = (new flash.filters.DropShadowFilter(10, 120, 0, 10, 15, 15, 0.25, 3));
this.filters = [dropShad];
dead = false;
xspeed = 0;
yspeed = 0;
mass = 10;
collision = 0;
friction = 0.9;
added = false;
speed_scale = _root.ss;
dist_x = (_root.circle._x - this._x) * speed_scale;
dist_y = (_root.circle._y - this._y) * speed_scale;
hit = false;
c = 0;
gone = false;
this.onEnterFrame = function () {
if (!_root.gpaused) {
c++;
if (!hit) {
xspeed = xspeed + dist_x;
yspeed = yspeed + dist_y;
xspeed = xspeed * friction;
yspeed = yspeed * friction;
}
if ((c % 30) == 0) {
dist_x = dist_x + (xspeed * 2);
dist_y = dist_y + (yspeed * 2);
gone = true;
}
this._x = this._x + xspeed;
this._y = this._y + yspeed;
if ((hit || (gone)) || (onscreen)) {
if (this._x < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._x > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
if (this._y < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._y > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
}
}
};
Symbol 51 MovieClip [eballmiss] Frame 1
function blowup() {
x = 1;
while (x < 6) {
var _local5 = Math.atan2(_root.circle._y - this._y, _root.circle._x - this._x);
var _local6 = Math.round((_local5 * 180) / Math.PI);
var _local9 = _local6 + 90;
var _local3 = _local9 + ((Math.random() * 40) - 20);
var _local4 = 6;
var _local8 = Math.sin(_local3 * (Math.PI/180)) * _local4;
var _local7 = (-Math.cos(_local3 * (Math.PI/180))) * _local4;
_root.enemy.push(_root.attachMovie("eballsm", "ball_" + _root.balls, _root.getNextHighestDepth(), {_x:this._x, _y:this._y, xspeed:_local8, yspeed:_local7, id:_root.enemy.length}));
_root.balls++;
x++;
}
implode();
}
function implode() {
if (!added) {
_root.mscore = _root.mscore + 200;
added = true;
}
dead = true;
this.xspeed = 0;
this.yspeed = 0;
this._x = -123;
}
var dropShad = (new flash.filters.DropShadowFilter(10, 120, 0, 10, 15, 15, 0.25, 3));
this.filters = [dropShad];
xspeed = 0;
added = false;
yspeed = 0;
dc = 0;
mass = 2;
timer = "";
dead = false;
collision = 0;
friction = 0.9;
speed_scale = _root.ss;
dist_x = (_root.circle._x - this._x) * speed_scale;
dist_y = (_root.circle._y - this._y) * speed_scale;
hit = false;
c = 90;
countdown = false;
dontmove = false;
this.onEnterFrame = function () {
if (!_root.gpaused) {
if (!hit) {
xspeed = xspeed + dist_x;
yspeed = yspeed + dist_y;
xspeed = xspeed * friction;
yspeed = yspeed * friction;
}
var _local4 = Math.abs(_root.circle._x - this._x);
var _local3 = Math.abs(_root.circle._y - this._y);
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if ((_local5 < 200) && (!countdown)) {
countdown = true;
dontmove = true;
}
this._x = this._x + xspeed;
this._y = this._y + yspeed;
if (dontmove && (!hit)) {
this._x = this._x - xspeed;
this._y = this._y - yspeed;
}
if (countdown) {
c--;
if ((c % 30) == 0) {
timer = "" + (c / 30);
}
if (c == 0) {
blowup();
countdown = false;
}
}
if (hit || (onscreen)) {
if (this._x < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._x > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
if (this._y < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._y > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
dc++;
}
}
if (dc > 120) {
implode();
}
};
Symbol 54 MovieClip [eballmiss_2] Frame 1
function blowup() {
var _local12 = 36;
x = 0;
while (x < 10) {
var _local3 = _local12 * x;
var _local4 = random(6) + 2;
var _local6 = Math.sin(_local3 * (Math.PI/180)) * _local4;
var _local5 = (-Math.cos(_local3 * (Math.PI/180))) * _local4;
_root.enemy.push(_root.attachMovie("eballsm", "ball_" + _root.balls, _root.getNextHighestDepth(), {_x:this._x, _y:this._y, xspeed:_local6, yspeed:_local5, id:_root.enemy.length}));
_root.balls++;
x++;
}
implode();
}
function implode() {
if (!added) {
_root.mscore = _root.mscore + 200;
added = true;
}
dead = true;
this.xspeed = 0;
this.yspeed = 0;
this._x = -123;
}
var dropShad = (new flash.filters.DropShadowFilter(10, 120, 0, 10, 15, 15, 0.25, 3));
this.filters = [dropShad];
xspeed = 0;
added = false;
yspeed = 0;
mass = 2;
timer = "";
dc = 0;
dead = false;
collision = 0;
friction = 0.9;
speed_scale = _root.ss;
dist_x = (_root.circle._x - this._x) * speed_scale;
dist_y = (_root.circle._y - this._y) * speed_scale;
hit = false;
c = 90;
countdown = false;
dontmove = false;
this.onEnterFrame = function () {
if (!_root.gpaused) {
if (!hit) {
xspeed = xspeed + dist_x;
yspeed = yspeed + dist_y;
xspeed = xspeed * friction;
yspeed = yspeed * friction;
}
var _local4 = Math.abs(_root.circle._x - this._x);
var _local3 = Math.abs(_root.circle._y - this._y);
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if ((_local5 < 200) && (!countdown)) {
countdown = true;
dontmove = true;
}
this._x = this._x + xspeed;
this._y = this._y + yspeed;
if (dontmove && (!hit)) {
this._x = this._x - xspeed;
this._y = this._y - yspeed;
}
if (countdown) {
c--;
if ((c % 30) == 0) {
timer = "" + (c / 30);
}
if (c == 0) {
blowup();
countdown = false;
}
}
if (hit || (onscreen)) {
if (this._x < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._x > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
if (this._y < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._y > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
dc++;
}
}
if (dc > 120) {
implode();
}
};
Symbol 56 MovieClip [eballshoot] Frame 1
function blowup() {
x = 0;
while (x < 2) {
var _local5 = Math.atan2(_root.circle._y - this._y, _root.circle._x - this._x);
var _local6 = Math.round((_local5 * 180) / Math.PI);
var _local9 = _local6 + 90;
var _local3 = (_local9 + (Math.random() * 15)) - 7.5;
var _local4 = 5;
var _local8 = Math.sin(_local3 * (Math.PI/180)) * _local4;
var _local7 = (-Math.cos(_local3 * (Math.PI/180))) * _local4;
_root.enemy.push(_root.attachMovie("eballspawn", "ball_" + _root.balls, _root.getNextHighestDepth(), {_x:this._x, _y:this._y, xspeed:_local8, yspeed:_local7, id:_root.enemy.length}));
_root.balls++;
x++;
}
implode();
}
function implode() {
if (!added) {
_root.mscore = _root.mscore + 200;
added = true;
}
dead = true;
this.xspeed = 0;
this.yspeed = 0;
this._x = -123;
}
var dropShad = (new flash.filters.DropShadowFilter(10, 120, 0, 10, 15, 15, 0.25, 3));
this.filters = [dropShad];
xspeed = 0;
added = false;
yspeed = 0;
mass = 2;
timer = "";
dead = false;
collision = 0;
friction = 0.9;
speed_scale = _root.ss;
dist_x = (_root.circle._x - this._x) * speed_scale;
dist_y = (_root.circle._y - this._y) * speed_scale;
hit = false;
c = 90;
countdown = false;
dontmove = false;
this.onEnterFrame = function () {
if (!_root.gpaused) {
if (!hit) {
xspeed = xspeed + dist_x;
yspeed = yspeed + dist_y;
xspeed = xspeed * friction;
yspeed = yspeed * friction;
}
var _local4 = Math.abs(_root.circle._x - this._x);
var _local3 = Math.abs(_root.circle._y - this._y);
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if ((_local5 < 200) && (!countdown)) {
countdown = true;
dontmove = true;
}
this._x = this._x + xspeed;
this._y = this._y + yspeed;
if (dontmove && (!hit)) {
this._x = this._x - xspeed;
this._y = this._y - yspeed;
}
if (countdown) {
blowup();
countdown = false;
}
if (hit || (onscreen)) {
if (this._x < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._x > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
if (this._y < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._y > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
}
}
};
Symbol 58 MovieClip [eballsm] Frame 1
function implode() {
dead = true;
this.xspeed = 0;
this.yspeed = 0;
this._x = -123;
}
mass = 2;
collision = 0;
dead = false;
hit = false;
this.onEnterFrame = function () {
if (!_root.gpaused) {
this._x = this._x + xspeed;
this._y = this._y + yspeed;
if (this._x < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._x > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
if (this._y < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._y > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
}
};
Symbol 60 MovieClip [eballspawn] Frame 1
function implode() {
dead = true;
this.xspeed = 0;
this.yspeed = 0;
this._x = -123;
}
mass = 2;
collision = 0;
dead = false;
hit = false;
this.onEnterFrame = function () {
if (!_root.gpaused) {
this._x = this._x + xspeed;
this._y = this._y + yspeed;
if (this._x < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._x > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
if (this._y < -20) {
this.yspeed = 0;
this.xspeed = 0;
implode();
} else if (this._y > 620) {
this.yspeed = 0;
this.xspeed = 0;
implode();
}
}
};
Symbol 65 MovieClip [gameover] Frame 14
stop();
this._x = 300;
this._y = 300;
_root.gpaused = true;
_root.kongregateStats.submit("HighScore", _root.score);
_root.kongregateStats.submit("HighestLevel", _root.levelnum);
Symbol 71 MovieClip [nicejob] Frame 1
stop();
c = 0;
this.onEnterFrame = function () {
c++;
if (c > 50) {
this._alpha = this._alpha - 5;
}
if (this._alpha < 0) {
_root.upgrades();
this.removeMovieClip();
}
};
Symbol 73 MovieClip [newmouse] Frame 1
this.onEnterFrame = function () {
this._x = _root._xmouse;
this._y = _root._ymouse;
};
this.onMouseDown = function () {
_root.powered = true;
};
this.onMouseUp = function () {
_root.powered = false;
};
Symbol 83 Button
on (release) {
trace(_root.upgraded);
if (!_root.upgraded) {
if (!_root.ship.shoot) {
_root.ship.shoot = true;
_root.upgraded = true;
this.fade = true;
} else {
if (_root.ship.sspeed > 15) {
_root.ship.sspeed = _root.ship.sspeed - 5;
} else {
attachMovie("max", "max", _root.getNextHighestDepth(), {_x:_root._xmouse, _y:_root._ymouse});
}
_root.upgraded = true;
this.fade = true;
}
}
if (_root.upgraded) {
this.fade = true;
}
}
Symbol 86 Button
on (release) {
trace(_root.upgraded);
if (!_root.upgraded) {
if (_root.crosshair.cmdist > 5) {
_root.crosshair.cmdist = _root.crosshair.cmdist - 7.5;
_root.upgraded = true;
this.fade = true;
} else {
attachMovie("max", "max", _root.getNextHighestDepth(), {_x:_root._xmouse, _y:_root._ymouse});
}
}
if (_root.upgraded) {
this.fade = true;
}
}
Symbol 89 Button
on (release) {
trace(_root.upgraded);
if (!_root.upgraded) {
if ((!_root.circle.startsize) < 200) {
_root.circle.startsize = _root.circle.startsize + 20;
_root.upgraded = true;
this.fade = true;
} else {
attachMovie("max", "max", _root.getNextHighestDepth(), {_x:_root._xmouse, _y:_root._ymouse});
}
}
if (_root.upgraded) {
this.fade = true;
}
}
Symbol 92 Button
on (release) {
trace(_root.upgraded);
if (!_root.upgraded) {
if ((!_root.crosshair.mdist) < 4) {
_root.crosshair.mdist = _root.crosshair.mdist + 0.25;
_root.upgraded = true;
this.fade = true;
} else {
attachMovie("max", "max", _root.getNextHighestDepth(), {_x:_root._xmouse, _y:_root._ymouse});
}
}
if (_root.upgraded) {
this.fade = true;
}
}
Symbol 94 Button
on (release) {
this.fade = true;
}
Symbol 95 MovieClip [upgrades] Frame 1
Mouse.show();
fade = false;
this.onEnterFrame = function () {
trace(fade);
if (fade) {
this._alpha = this._alpha - 4;
if (this._alpha < 0) {
_root.startagain();
this.removeMovieClip();
}
}
};
Symbol 97 MovieClip [wep] Frame 1
function checkHits() {
x = 0;
while (x < _root.enemy.length) {
if (_root.enemy[x] != undefined) {
var _local3 = ((this._width / 2) + 2) + ((_root.enemy[x]._width / 2) + 1);
distance_x = Math.abs(_root.enemy[x]._x - this._x);
distance_y = Math.abs(_root.enemy[x]._y - this._y);
distance = Math.sqrt((distance_x * distance_x) + (distance_y * distance_y));
if ((distance <= _local3) && ((_root.enemy[x].collision == 0) or (this.collision == 0))) {
_root.enemy[x].collision = 1;
_root.enemy[x].hit = true;
this.collision = 1;
manage_bounce(this, _root.enemy[x]);
} else if (distance > _local3) {
_root.enemy[x].collision = 0;
this.collision = 0;
}
}
x++;
}
}
function manage_bounce(ball, ball2) {
dx = ball._x - ball2._x;
dy = ball._y - ball2._y;
collisionision_angle = Math.atan2(dy, dx);
magnitude_1 = Math.sqrt((ball.xspeed * ball.xspeed) + (ball.yspeed * ball.yspeed));
magnitude_2 = Math.sqrt((ball2.xspeed * ball2.xspeed) + (ball2.yspeed * ball2.yspeed));
direction_1 = Math.atan2(ball.yspeed, ball.xspeed);
direction_2 = Math.atan2(ball2.yspeed, ball2.xspeed);
new_xspeed_1 = magnitude_1 * Math.cos(direction_1 - collisionision_angle);
new_yspeed_1 = magnitude_1 * Math.sin(direction_1 - collisionision_angle);
new_xspeed_2 = magnitude_2 * Math.cos(direction_2 - collisionision_angle);
new_yspeed_2 = magnitude_2 * Math.sin(direction_2 - collisionision_angle);
final_xspeed_1 = (((ball.mass - ball2.mass) * new_xspeed_1) + ((ball2.mass + ball2.mass) * new_xspeed_2)) / (ball.mass + ball2.mass);
final_xspeed_2 = (((ball.mass + ball.mass) * new_xspeed_1) + ((ball2.mass - ball.mass) * new_xspeed_2)) / (ball.mass + ball2.mass);
final_yspeed_1 = new_yspeed_1;
final_yspeed_2 = new_yspeed_2;
ball.xspeed = (Math.cos(collisionision_angle) * final_xspeed_1) + (Math.cos(collisionision_angle + (Math.PI/2)) * final_yspeed_1);
ball.yspeed = (Math.sin(collisionision_angle) * final_xspeed_1) + (Math.sin(collisionision_angle + (Math.PI/2)) * final_yspeed_1);
ball2.xspeed = (Math.cos(collisionision_angle) * final_xspeed_2) + (Math.cos(collisionision_angle + (Math.PI/2)) * final_yspeed_2);
ball2.yspeed = (Math.sin(collisionision_angle) * final_xspeed_2) + (Math.sin(collisionision_angle + (Math.PI/2)) * final_yspeed_2);
if ((Math.abs(ball2.xspeed) < 0.5) || (Math.abs(ball2.yspeed) < 0.5)) {
ball2.xspeed = ball2.xspeed * 2;
ball2.yspeed = ball2.yspeed * 2;
}
if ((Math.abs(ball2.xspeed) > 150) || (Math.abs(ball2.yspeed) > 150)) {
ball2.implode();
}
}
function die() {
this.removeMovieClip();
}
stop();
if (_root.sound) {
sound = new Sound(this);
sound.attachSound("shot_las");
sound.start(0, 1);
}
hit = false;
mass = 1;
this.onEnterFrame = function () {
if (!_root.gpaused) {
this._x = this._x + xspeed;
this._y = this._y + yspeed;
checkHits();
if (this._x < (this._height / 2)) {
this.die();
}
if ((this._x + (this._width / 2)) > 600) {
this.die();
}
if (this._y > 600) {
this.die();
}
if (this._y < 0) {
this.die();
}
}
};
Symbol 127 MovieClip Frame 126
_root.nextFrame();
Symbol 139 MovieClip Frame 120
_root.gotoAndPlay(_root._currentframe + 1);
Symbol 141 MovieClip [ship] Frame 1
speed = 30;
shoot = false;
diex = (Math.random() * 4) - 2;
diey = (Math.random() * 8) - 4;
c = 0;
spd = 4;
var dropShad = (new flash.filters.DropShadowFilter(10, 120, 0, 10, 15, 15, 1, 3));
this.filters = [dropShad];
life = 180;
alive = true;
mtime = 100;
time = random(50) + mtime;
grows = 0.5;
maxs = 200;
startx = this._x;
starty = this._y;
endx = (startx._x + (Math.random() * 20)) - 10;
endy = (starty._y + (Math.random() * 20)) - 10;
sspeed = 30;
this.onEnterFrame = function () {
if (!_root.gpaused) {
c++;
if (alive) {
_x = (_x + ((endx - _x) / speed));
_y = (_y + ((endy - _y) / speed));
} else {
this._alpha = this._alpha - 20;
_x = (_x + diex);
_y = (_y + diey);
diey = diey + Math.random();
}
if ((c % time) == 0) {
c = 0;
time = random(50) + mtime;
x = 0;
while (x < _root.balls) {
if (_root.enemy[x]._x > 0) {
target = x;
break;
}
x++;
}
endx = (_root.circle._x + (Math.random() * 200)) - 100;
endy = (_root.circle._y + (Math.random() * 200)) - 100;
}
if (shoot) {
x = 0;
while (x < _root.balls) {
if (_root.enemy[x]._x > 0) {
user_x = _root.enemy[x]._x;
user_y = _root.enemy[x]._y;
break;
}
x++;
}
myRadians = Math.atan2(user_y - this._y, user_x - this._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
this._rotation = myDegrees + 90;
if ((c % sspeed) == 0) {
k = 0;
while (k < 1) {
temp = _root.attachMovie("wep", "w_" + wnum, _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
wnum++;
temp.xspeed = ((Math.sin(this._rotation * (Math.PI/180)) * spd) + (Math.random() * 1)) - 0.5;
temp.yspeed = ((-(Math.cos(this._rotation * (Math.PI/180)) * spd)) + (Math.random() * 1)) - 0.5;
temp.dmg = spd * 2;
temp.gotoAndStop(2);
k++;
}
}
}
}
};
Symbol 147 Button
on (release) {
_root.gotoAndStop(6);
}
Symbol 148 Button
on (release) {
_root.gotoAndStop(7);
}
Symbol 191 Button
on (release) {
getURL ("http://www.armorblog.com", "_blank");
}
Symbol 193 Button
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 202 MovieClip Frame 1
this.onEnterFrame = function () {
x = 0;
while (x < _root.enemy.length) {
if (this.hitTest(_root.enemy[x]._x, _root.enemy[x]._y)) {
_root.enemy[x].onscreen = true;
}
x++;
}
};