Frame 1
mochi.as2.MochiServices.connect("ac35aa93b5c00eb6");
stop();
Stage.showMenu = false;
total = _root.getBytesTotal();
this.onEnterFrame = function () {
loaded = _root.getBytesLoaded();
asdfpercent = int((loaded / total) * 100);
if (loaded == total) {
total = 0;
gotoAndPlay (2);
delete this.onEnterFrame;
}
};
Frame 2
stop();
logo.onRelease = function () {
getURL ("http://www.ugotgames.com/", _blank);
};
Frame 8
function createParticle(ob, obx, oby, obr) {
pDEPTH = pDEPTH + 1;
if (pDEPTH >= (pHIGH - 100)) {
pDEPTH = pLOW;
}
tempmc = _root.attachMovie(ob, "particle" + pDEPTH, pDEPTH);
tempmc._x = obx;
tempmc._y = oby;
tempmc._rotation = obr;
}
function createEnemy(ob, obx, oby, obr) {
eDEPTH = eDEPTH + 1;
if (eDEPTH >= (eHIGH - 100)) {
eDEPTH = eLOW;
}
tempmc = _root.attachMovie(ob, "particle" + eDEPTH, eDEPTH);
tempmc._x = obx;
tempmc._y = oby;
tempmc._rotation = obr;
}
function getFPS() {
fps_t = getTimer();
framerate = Math.round(1000 / (fps_t - fps_o));
if (framerate > 30) {
if (fps1 != 40) {
_quality = "HIGH";
}
fps1 = 40;
}
if (framerate <= 30) {
if (fps1 == 40) {
fps1 = framerate;
} else {
_quality = "LOW";
}
}
fps_o = fps_t;
}
function playsound(sounds) {
if (_root.soundeffects) {
_root.soundnumber = _root.soundnumber + 1;
asdfsound = _root.createEmptyMovieClip("sound" + soundnumber, soundnumber);
qwersound = new Sound(asdfsound);
qwersound.attachSound(sounds);
qwersound.setVolume(50);
qwersound.start(0, 0);
}
}
function ricochet() {
tempnumber = random(4);
if (tempnumber == 0) {
playsound("ricochet");
}
if (tempnumber == 1) {
playsound("ricochet2");
}
if (tempnumber == 2) {
playsound("ricochet3");
}
if (tempnumber == 3) {
playsound("ricochet4");
}
}
function explosion() {
tempnumber = random(4);
if (tempnumber == 0) {
playsound("weapon4explosion");
}
if (tempnumber == 1) {
playsound("weapon4explosion2");
}
if (tempnumber == 2) {
playsound("explosion3");
}
if (tempnumber == 3) {
playsound("explosion4");
}
if (tempnumber == 4) {
playsound("explosion5");
}
if (tempnumber == 5) {
playsound("explosion6");
}
if (tempnumber == 6) {
playsound("explosion7");
}
if (tempnumber == 7) {
playsound("explosion8");
}
}
pLOW = 10000;
pHIGH = pLOW + 10000;
pDEPTH = pLOW;
eLOW = 20000;
eHIGH = eLOW + 10000;
eDEPTH = eLOW;
laserdepth = 19990;
bossdepth = 30000;
playerdepth = 30001;
huddepth = 30002;
pausedepth = 30003;
cursordepth = 30004;
fadedepth = 30005;
tempdepth = 40000;
fps1 = 40;
fps2 = 40;
gamePaused = true;
soundeffects = true;
musiceffects = true;
soundnumber = 50000;
_root.soundnumber = _root.soundnumber + 1;
music123 = _root.createEmptyMovieClip("sound" + soundnumber, soundnumber);
music111 = new Sound(music123);
music111.attachSound("music111");
music1playing = false;
_root.soundnumber = _root.soundnumber + 1;
music456 = _root.createEmptyMovieClip("sound" + soundnumber, soundnumber);
music222 = new Sound(music456);
music222.attachSound("music222");
music2playing = false;
_root.soundnumber = _root.soundnumber + 1;
music789 = _root.createEmptyMovieClip("sound" + soundnumber, soundnumber);
music333 = new Sound(music789);
music333.attachSound("music333");
music3playing = false;
_root.soundnumber = _root.soundnumber + 1;
music101 = _root.createEmptyMovieClip("sound" + soundnumber, soundnumber);
music444 = new Sound(music101);
music444.attachSound("music444");
music4playing = false;
Frame 9
stop();
if (!gamePaused) {
attachMovie("menu_fade2", "menu_fade2", fadedepth);
}
music222.stop();
music333.stop();
music444.stop();
music2playing = false;
music3playing = false;
music4playing = false;
if (!music1playing) {
music1playing = true;
music111.start(0, 100);
}
btn_creds.tabEnabled = false;
btn_creds.useHandCursor = false;
btn_more.tabEnabled = false;
btn_more.useHandCursor = false;
btn_wave.tabEnabled = false;
btn_wave.useHandCursor = false;
btn_inf.tabEnabled = false;
btn_inf.useHandCursor = false;
btn_100.tabEnabled = false;
btn_100.useHandCursor = false;
btn_creds.onRelease = function () {
if (creds._currentframe == 1) {
creds.gotoAndPlay(2);
}
};
btn_more.onRelease = function () {
if (creds._currentframe == 1) {
getURL ("http://www.ugotgames.com/shooting/polygon-apocalypse.php", _blank);
}
};
btn_wave.onRelease = function () {
if (creds._currentframe == 1) {
gamemode = 1;
fade.gotoAndPlay(2);
}
};
btn_inf.onRelease = function () {
if (creds._currentframe == 1) {
gamemode = 2;
fade.gotoAndPlay(2);
}
};
btn_100.onRelease = function () {
if (creds._currentframe == 1) {
gamemode = 3;
fade.gotoAndPlay(2);
}
};
btn_score1.onRelease = function () {
if (creds._currentframe == 1) {
playerscore = null;
gotoAndStop (15);
}
};
btn_score2.onRelease = function () {
if (creds._currentframe == 1) {
playerscore = null;
gotoAndStop (17);
}
};
Frame 10
function spawnpentagon() {
createEnemy("pentagon", -100, -100, 0);
createEnemy("pentagon", -100, -100, 0);
createEnemy("pentagon", -100, -100, 0);
_root["particle" + eDEPTH].friend = _root["particle" + (eDEPTH - 1)];
_root["particle" + (eDEPTH - 1)].friend = _root["particle" + (eDEPTH - 2)];
_root["particle" + (eDEPTH - 2)].friend = _root["particle" + eDEPTH];
}
stop();
music111.stop();
music1playing = false;
if (gamemode == 1) {
music2playing = true;
music222.start(0, 100);
} else if (gamemode == 2) {
music3playing = true;
music333.start(0, 100);
} else if (gamemode == 3) {
music4playing = true;
music444.start(0, 100);
}
Bullet = new Array();
deleteall = false;
slowmotion = false;
gamePaused = true;
playerscore = 0;
playerhealth = 1000;
playertime = 1000;
attachMovie("menu_fade2", "menu_fade2", fadedepth);
attachMovie("cannon", "cannon", playerdepth);
attachMovie("cursor", "cursor", cursordepth);
attachMovie("hud", "hud", huddepth);
spawntime = 0;
killed = 0;
killed2 = 0;
powercollect = 0;
infNumber = 4;
weaponswitched = false;
timeburned = false;
asdfwave = 1;
asdfcreated = 0;
qwercreated = 20;
qwerlimit = 0;
wavenumber.wavenumber = asdfwave;
keyisup = false;
slowmotion = false;
this.onEnterFrame = function () {
_x = (_x + Math.round((-_x) / 5));
_y = (_y + Math.round((-_y) / 5));
if (!gamePaused) {
if ((Key.isDown(32) && (keyisup)) || (Key.isDown(16) && (keyisup))) {
if (((!slowmotion) && (keyisup)) && (playertime >= 50)) {
slowmotion = true;
keyisup = false;
}
if (slowmotion && (keyisup)) {
slowmotion = false;
keyisup = false;
}
}
if ((!Key.isDown(32)) && (!Key.isDown(16))) {
keyisup = true;
}
if (slowmotion) {
playertime = playertime - 6;
if (playertime <= 0) {
slowmotion = false;
}
}
if (playertime < 1000) {
playertime = playertime + 1;
} else {
playertime = 1000;
}
healthbar._xscale = healthbar._xscale + (((playerhealth / 10) - healthbar._xscale) / 5);
if (playerhealth < 1000) {
if (gamemode == 1) {
playerhealth = playerhealth + 1;
}
if (playerhealth <= 0) {
healthbar._xscale = 0;
}
} else {
playerhealth = 1000;
}
hud_danger._alpha = 0;
if (playerhealth <= 200) {
hud_danger._alpha = 80;
}
if ((Key.isDown(80) && (!gamePaused)) && (!pausemenu)) {
attachMovie("pauseMenu", "pausemenu", pausedepth);
gamePaused = true;
}
if (!slowmotion) {
spawntime = spawntime + 5;
} else {
spawntime = spawntime + 1;
}
hud_infinity._alpha = 0;
if (gamemode == 1) {
switch (asdfwave) {
case 1 :
qwercreated = 30;
qwerlimit = 5;
break;
case 2 :
qwercreated = 20;
qwerlimit = 5;
break;
case 3 :
qwercreated = 30;
qwerlimit = 6;
break;
case 4 :
qwercreated = 30;
qwerlimit = 6;
break;
case 5 :
qwercreated = 20;
qwerlimit = 8;
break;
case 6 :
qwercreated = 30;
qwerlimit = 8;
break;
case 7 :
qwercreated = 1;
qwerlimit = 1;
break;
case 8 :
qwercreated = 30;
qwerlimit = 5;
break;
case 9 :
qwercreated = 36;
qwerlimit = 9;
break;
case 10 :
qwercreated = 32;
qwerlimit = 8;
break;
case 11 :
qwercreated = 1;
qwerlimit = 1;
break;
case 12 :
qwercreated = 20;
qwerlimit = 10;
break;
case 13 :
qwercreated = 36;
qwerlimit = 15;
break;
case 14 :
qwercreated = 36;
qwerlimit = 15;
break;
case 15 :
qwercreated = 20;
qwerlimit = 15;
break;
case 16 :
qwercreated = 1000;
qwerlimit = 30;
break;
case 17 :
qwercreated = 30;
qwerlimit = 20;
break;
case 18 :
qwercreated = 25;
qwerlimit = 20;
break;
case 19 :
qwercreated = 25;
qwerlimit = 5;
break;
case 20 :
qwercreated = 20;
qwerlimit = 10;
break;
case 21 :
qwercreated = 20;
qwerlimit = 20;
break;
case 22 :
qwercreated = 20;
qwerlimit = 20;
break;
case 23 :
qwercreated = 1;
qwerlimit = 1;
}
if (((((!cannon.dead) && (spawntime >= 100)) && (Bullet.length < 5)) && (asdfcreated < qwercreated)) && (wavenumber._currentframe >= 80)) {
spawntime = 0;
switch (asdfwave) {
case 1 :
createEnemy("square", -100, -100, 0);
break;
case 2 :
createEnemy("triangle", -100, -100, 0);
break;
case 3 :
createEnemy("triangle", -100, -100, 0);
createEnemy("square", -100, -100, 0);
break;
case 4 :
spawnpentagon();
break;
case 5 :
spawnpentagon();
createEnemy("square", -100, -100, 0);
break;
case 6 :
spawnpentagon();
createEnemy("triangle", -100, -100, 0);
break;
case 7 :
if (!_root.boss) {
attachMovie("boss1", "boss", bossdepth);
}
break;
case 8 :
createEnemy("shooter", -100, -100, 0);
break;
case 9 :
createEnemy("shooter", -100, -100, 0);
createEnemy("square", -100, -100, 0);
createEnemy("triangle", -100, -100, 0);
break;
case 10 :
createEnemy("shooter", -100, -100, 0);
spawnpentagon();
break;
case 11 :
if (!_root.boss) {
attachMovie("boss2", "boss", bossdepth);
}
break;
case 12 :
createEnemy("hexagon", -100, -100, 0);
break;
case 13 :
createEnemy("triangle", -100, -100, 0);
createEnemy("square", -100, -100, 0);
createEnemy("hexagon", -100, -100, 0);
break;
case 14 :
createEnemy("hexagon", -100, -100, 0);
spawnpentagon();
break;
case 15 :
createEnemy("star", -100, -100, 0);
break;
case 16 :
if (!_root.boss) {
attachMovie("boss1", "boss", bossdepth);
}
createEnemy("star", -100, -100, 0);
break;
case 17 :
createEnemy("triangle", -100, -100, 0);
createEnemy("square", -100, -100, 0);
spawnpentagon();
createEnemy("star", -100, -100, 0);
break;
case 18 :
createEnemy("shooter", -100, -100, 0);
createEnemy("square", -100, -100, 0);
createEnemy("star", -100, -100, 0);
break;
case 19 :
createEnemy("octagon", -100, -100, 0);
break;
case 20 :
createEnemy("octagon", -100, -100, 0);
createEnemy("octagon", -100, -100, 0);
createEnemy("octagon", -100, -100, 0);
createEnemy("hexagon", -100, -100, 0);
createEnemy("square", -100, -100, 0);
break;
case 21 :
createEnemy("octagon", -100, -100, 0);
createEnemy("octagon", -100, -100, 0);
createEnemy("octagon", -100, -100, 0);
spawnpentagon();
createEnemy("hexagon", -100, -100, 0);
break;
case 22 :
createEnemy("square", -100, -100, 0);
createEnemy("triangle", -100, -100, 0);
createEnemy("hexagon", -100, -100, 0);
createEnemy("shooter", -100, -100, 0);
createEnemy("octagon", -100, -100, 0);
createEnemy("octagon", -100, -100, 0);
createEnemy("star", -100, -100, 0);
spawnpentagon();
break;
case 23 :
if (_root.boss) {
break;
}
attachMovie("boss3", "boss", bossdepth);
}
asdfcreated = asdfcreated + 1;
}
if (((asdfcreated >= qwercreated) && (Bullet.length == 0)) && (!_root.boss)) {
asdfwave = asdfwave + 1;
asdfcreated = 0;
wavenumber.wavenumber = asdfwave;
if (asdfwave <= 23) {
wavenumber.gotoAndPlay(2);
}
}
} else if (gamemode == 2) {
hud_infinity._alpha = 30;
if (((!cannon.dead) && (spawntime >= 50)) && (Bullet.length < infNumber)) {
spawntime = 0;
if (killed < 20) {
createEnemy("square", -100, -100, 0);
} else if (killed < 40) {
createEnemy("pentagon", -100, -100, 0);
createEnemy("pentagon", -100, -100, 0);
createEnemy("pentagon", -100, -100, 0);
_root["particle" + eDEPTH].friend = _root["particle" + (eDEPTH - 1)];
_root["particle" + (eDEPTH - 1)].friend = _root["particle" + (eDEPTH - 2)];
_root["particle" + (eDEPTH - 2)].friend = _root["particle" + eDEPTH];
} else if (killed < 60) {
createEnemy("star", -100, -100, 0);
} else if (killed < 80) {
createEnemy("shooter", -100, -100, 0);
} else if (killed < 100) {
createEnemy("hexagon", -100, -100, 0);
} else if (killed < 120) {
createEnemy("triangle", -100, -100, 0);
} else if (killed < 140) {
createEnemy("octagon", -100, -100, 0);
} else {
infNumber = infNumber + 2;
killed = 0;
}
}
} else if (gamemode == 3) {
if (Key.isDown(69) && (!weaponswitched)) {
weaponswitched = true;
cannon.weaponNumber = cannon.weaponNumber + 1;
if (cannon.weaponNumber > 12) {
cannon.weaponNumber = 1;
}
} else if ((!Key.isDown(69)) && (weaponswitched)) {
weaponswitched = false;
}
if ((spawntime >= 50) && (Bullet.length < 10)) {
spawntime = 0;
createEnemy("square_inf", -100, -100, 0);
}
}
cursor._alpha = 100;
} else {
Mouse.show();
cursor._alpha = 0;
}
getFPS();
};
onMouseMove = function () {
if (!gamePaused) {
Mouse.hide();
}
};
Frame 11
gamemode = 1;
fade.gotoAndPlay(2);
Frame 15
stop();
gamePaused = true;
Mouse.show();
var o = {n:[5, 15, 2, 13, 9, 14, 13, 10, 8, 15, 7, 14, 11, 9, 8, 2], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var boardID = o.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:"6e9195973beb1bdb", score:playerscore});
Frame 16
gotoAndPlay (9);
Frame 17
stop();
gamePaused = true;
Mouse.show();
var o = {n:[5, 15, 2, 13, 9, 14, 13, 10, 8, 15, 7, 14, 11, 9, 8, 2], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var boardID = o.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:"5f2d9eda8f7eb982", score:playerscore});
Frame 18
gotoAndPlay (9);
Symbol 3 MovieClip [boss_hit_5] Frame 20
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 6 MovieClip [boss_hit_3] Frame 20
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 9 MovieClip [boss_hit_2] Frame 20
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 12 MovieClip [boss_hit_1] Frame 20
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 15 MovieClip [boss_hit_4] Frame 20
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 53 MovieClip [finalscreen1] Frame 1
_x = 0;
_y = 0;
Symbol 53 MovieClip [finalscreen1] Frame 99
stop();
asdf._alpha = 100;
_alpha = 100;
rank = 0;
destination = 8;
_root.gamePaused = true;
btn_exit.onRelease = function () {
_root.attachMovie("menu_fade3", "menu_fade3", _root.tempdepth + 1);
};
btn_submit.onRelease = function () {
_root.attachMovie("menu_fade6", "menu_fade6", _root.tempdepth + 1);
};
this.onEnterFrame = function () {
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 60 MovieClip [finalscreen2] Frame 1
_x = 0;
_y = 0;
Symbol 60 MovieClip [finalscreen2] Frame 50
stop();
asdf._alpha = 100;
_alpha = 100;
rank = 0;
destination = 8;
_root.gamePaused = true;
btn_submit.onRelease = function () {
_root.attachMovie("menu_fade6", "menu_fade6", _root.tempdepth + 1);
};
btn_exit.onRelease = function () {
_root.attachMovie("menu_fade3", "menu_fade3", _root.tempdepth + 1);
};
this.onEnterFrame = function () {
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 69 MovieClip Frame 1
this.onEnterFrame = function () {
stop();
if (_currentframe != _parent.destination) {
play();
}
};
Symbol 69 MovieClip Frame 8
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 16
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 24
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 32
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 39
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 47
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 55
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 63
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 71
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 78
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 86
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 94
_parent.rank = _parent.rank + 1;
Symbol 69 MovieClip Frame 100
_parent.rank = _parent.rank + 1;
Symbol 72 MovieClip [finalscreen4] Frame 1
_x = 0;
_y = 0;
Symbol 72 MovieClip [finalscreen4] Frame 50
stop();
asdf._alpha = 100;
_alpha = 100;
rank = 0;
destination = 8;
_root.gamePaused = true;
if (_root.playerscore > 1000) {
destination = 8;
}
if (_root.playerscore > 3000) {
destination = 16;
}
if (_root.playerscore > 5000) {
destination = 24;
}
if (_root.playerscore > 7000) {
destination = 32;
}
if (_root.playerscore > 10000) {
destination = 39;
}
if (_root.playerscore > 20000) {
destination = 47;
}
if (_root.playerscore > 50000) {
destination = 55;
}
if (_root.playerscore > 70000) {
destination = 63;
}
if (_root.playerscore > 100000) {
destination = 71;
}
if (_root.playerscore > 150000) {
destination = 78;
}
if (_root.playerscore > 200000) {
destination = 86;
}
if (_root.playerscore > 300000) {
destination = 94;
}
if (_root.playerscore > 400000) {
destination = 100;
}
btn_exit.onRelease = function () {
_root.attachMovie("menu_fade3", "menu_fade3", _root.tempdepth + 1);
};
btn_submit.onRelease = function () {
_root.attachMovie("menu_fade5", "menu_fade5", _root.tempdepth + 1);
};
this.onEnterFrame = function () {
switch (rank) {
case 0 :
meterrating = "";
break;
case 1 :
meterrating = "NOOB";
break;
case 2 :
meterrating = "BEGINNER";
break;
case 3 :
meterrating = "ADEPT";
break;
case 4 :
meterrating = "BELOW AVERAGE";
break;
case 5 :
meterrating = "AVERAGE";
break;
case 6 :
meterrating = "ABOVE AVERAGE";
break;
case 7 :
meterrating = "EXPERIENCED";
break;
case 8 :
meterrating = "SKILLFUL";
break;
case 9 :
meterrating = "PROFESSIONAL";
break;
case 10 :
meterrating = "MASTER";
break;
case 11 :
meterrating = "BETTER THAN PROGRAMMER";
break;
case 12 :
meterrating = "IMPOSSIBLE";
break;
case 13 :
meterrating = "YOUR AWESOMENESS CANNOT BE MEASURED";
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 74 MovieClip Frame 1
function destroyed() {
this.swapDepths(1);
removeMovieClip(this);
delete this.onEnterFrame;
}
Symbol 77 MovieClip [enemylightning] Frame 1
_alpha = ((Math.random() * 80) + 20);
alphafade = 100;
lightning._yscale = (Math.random() * 200) + 10;
this.onEnterFrame = function () {
if (this.hitTest(_root.cannon._x, _root.cannon._y, true)) {
_root.playerhealth = _root.playerhealth - 40;
i = 0;
while (i < 3) {
_root.createParticle("cannonspark", _root.cannon._x, _root.cannon._y, 0);
i++;
}
}
_alpha = (_alpha - alphafade);
if (_alpha <= 1) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 94 MovieClip Frame 1
_alpha = 0;
Symbol 97 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 1
btn_resume.tabEnabled = false;
btn_exit.tabEnabled = false;
this.onEnterFrame = function () {
if (Key.isDown(80)) {
_parent.play();
}
if (_root.deleteall) {
removeMovieClip(_root.pausemenu);
delete this.onEnterFrame;
}
if (_root.soundeffects) {
check1.gotoAndStop(1);
} else {
check1.gotoAndStop(2);
}
if (_root.musiceffects) {
check2.gotoAndStop(1);
} else {
check2.gotoAndStop(2);
}
check1.onRelease = function () {
if (_root.soundeffects) {
_root.soundeffects = false;
} else {
_root.soundeffects = true;
}
};
check2.onRelease = function () {
if (_root.musiceffects) {
_root.musiceffects = false;
_root.music111.setVolume(0);
_root.music222.setVolume(0);
_root.music333.setVolume(0);
_root.music444.setVolume(0);
} else {
_root.musiceffects = true;
_root.music111.setVolume(100);
_root.music222.setVolume(100);
_root.music333.setVolume(100);
_root.music444.setVolume(100);
}
};
};
btn_exit.onRelease = function () {
_root.attachMovie("menu_fade3", "menu_fade3", _root.tempdepth);
};
btn_resume.onRelease = function () {
_parent.play();
};
Symbol 99 MovieClip [pauseMenu] Frame 1
_x = 300;
_y = 300;
Symbol 99 MovieClip [pauseMenu] Frame 30
stop();
Symbol 99 MovieClip [pauseMenu] Frame 60
_root.gamePaused = false;
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 102 MovieClip [menu_fade2] Frame 1
this.swapDepths(_root.fadedepth);
Symbol 102 MovieClip [menu_fade2] Frame 10
_root.gamePaused = true;
Mouse.show();
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 103 MovieClip [menu_fade4] Frame 1
_x = -600;
Symbol 103 MovieClip [menu_fade4] Frame 10
_root.gamePaused = false;
Symbol 103 MovieClip [menu_fade4] Frame 14
_root.deleteall = true;
_root.gotoAndStop(11);
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 104 MovieClip [menu_fade6] Frame 1
_x = -600;
Symbol 104 MovieClip [menu_fade6] Frame 10
_root.gamePaused = false;
Symbol 104 MovieClip [menu_fade6] Frame 14
_root.deleteall = true;
_root.gotoAndStop(15);
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 105 MovieClip [menu_fade5] Frame 1
_x = -600;
Symbol 105 MovieClip [menu_fade5] Frame 10
_root.gamePaused = false;
Symbol 105 MovieClip [menu_fade5] Frame 14
_root.deleteall = true;
_root.gotoAndStop(17);
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 106 MovieClip [menu_fade3] Frame 1
_x = -600;
Symbol 106 MovieClip [menu_fade3] Frame 10
_root.gamePaused = false;
Symbol 106 MovieClip [menu_fade3] Frame 14
_root.deleteall = true;
_root.gotoAndStop(9);
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 111 MovieClip [hud] Frame 1
this.onEnterFrame = function () {
if (_root.slowmotion == false) {
if (slomofilter._alpha > 0) {
slomofilter._alpha = slomofilter._alpha - 5;
timebar._alpha = timebar._alpha - 5;
}
} else if (slomofilter._alpha < 100) {
slomofilter._alpha = slomofilter._alpha + 5;
timebar._alpha = timebar._alpha + 5;
}
timebar._xscale = _root.playertime / 10;
};
Symbol 115 MovieClip [wave] Frame 1
_name = "wave";
_xscale = 10;
_yscale = 10;
this.onEnterFrame = function () {
if (_root.gamePaused == false) {
if (_root.slowmotion == false) {
_xscale = (_xscale + 25);
_yscale = (_yscale + 25);
this._alpha = this._alpha - 1.7;
} else {
_xscale = (_xscale + 5);
_yscale = (_yscale + 5);
this._alpha = this._alpha - 0.2;
}
if (this._alpha <= 1) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 118 MovieClip [bullet1_spark] Frame 1
stop();
_alpha = 100;
this._xscale = (Math.random() * 50) + 50;
this._yscale = this._xscale;
alphafade = Math.random() + 12;
dir = _rotation;
speed = random(20) + 4;
if (dir == 1) {
angle = random(180) - 90;
}
if (dir == 2) {
angle = random(180) + 90;
}
if (dir == 3) {
angle = random(180);
}
if (dir == 4) {
angle = random(180) + 180;
}
_rotation = angle;
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
}
if ((this._alpha <= 1) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 477 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 478 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.9.1 as2");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
disconnect();
onError.apply(null, [errorCode]);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case "services" :
mochi.as2.MochiServices.triggerEvent(pkg.event, pkg.args);
break;
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "social" :
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
var _local6;
if (_root._url.indexOf("mochiad_options") != -1) {
var _local2 = (_root._url.indexOf("mochiad_options") + "mochiad_options".length) + 1;
_local6 = _root._url.substr(_local2, _root._url.length);
} else if (_root.mochiad_options) {
_local6 = _root.mochiad_options;
}
if (_local6) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace(("WARNING: " + (leaderboard ? "board" : "game")) + " ID is not the appropriate length");
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
trace("WARNING: Board ID contains illegal characters: " + bid);
return(undefined);
}
_local1++;
}
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://link.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static var CONNECTED = "onConnected";
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 479 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function setNotifications(clip, style) {
var _local2 = {};
for (var _local3 in style) {
_local2[_local3] = style[_local3];
}
_local2.clip = clip;
mochi.as2.MochiServices.send("events_setNotifications", _local2, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startPlay(tag) {
if (tag == undefined) {
tag = "gameplay";
}
mochi.as2.MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
static function endPlay() {
mochi.as2.MochiServices.send("events_clearRoundID", null, null, null);
}
static function trackEvent(tag, value) {
mochi.as2.MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
static var ACHIEVEMENT_RECEIVED = "AchievementReceived";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 480 MovieClip [__Packages.mochi.as2.MochiCoins] Frame 0
class mochi.as2.MochiCoins
{
function MochiCoins () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showStore(options) {
mochi.as2.MochiServices.send("coins_showStore", {options:options}, null, null);
}
static function showItem(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showItem call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showItem", {options:options}, null, null);
}
static function showVideo(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showVideo call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showVideo", {options:options}, null, null);
}
static function getStoreItems() {
mochi.as2.MochiServices.send("coins_getStoreItems");
}
static function requestFunding(properties) {
mochi.as2.MochiServices.send("social_requestFunding", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var STORE_SHOW = "StoreShow";
static var STORE_HIDE = "StoreHide";
static var ITEM_OWNED = "ItemOwned";
static var ITEM_NEW = "ItemNew";
static var STORE_ITEMS = "StoreItems";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 481 MovieClip [__Packages.mochi.as2.MochiSocial] Frame 0
class mochi.as2.MochiSocial
{
function MochiSocial () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("social_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("social_hideLoginWidget");
}
static function requestLogin(properties) {
mochi.as2.MochiServices.send("social_requestLogin", properties);
}
static function getFriendsList(properties) {
mochi.as2.MochiServices.send("social_getFriendsList", properties);
}
static function postToStream(properties) {
mochi.as2.MochiServices.send("social_postToStream", properties);
}
static function inviteFriends(properties) {
mochi.as2.MochiServices.send("social_inviteFriends", properties);
}
static function requestFan(properties) {
mochi.as2.MochiServices.send("social_requestFan", properties);
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("social_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var LOGIN_SHOWN = "LoginShown";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var FRIEND_LIST = "FriendsList";
static var PROFILE_DATA = "ProfileData";
static var GAMEPLAY_DATA = "GameplayData";
static var ACTION_CANCELED = "onCancel";
static var ACTION_COMPLETE = "onComplete";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 482 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiServices.warnID(boardID, true);
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
options.clip = mochi.as2.MochiServices.clip;
if ((options.clip != mochi.as2.MochiServices.__get__clip()) || (mochi.as2.MochiServices.__get__childClip()._target == undefined)) {
mochi.as2.MochiServices.disconnect();
trace("WARNING! This application is attempting to connect to MochiServices inside a showLeaderboard call!");
trace("make sure MochiServices.connect is called as early in the application runtime as possible.");
mochi.as2.MochiServices.connect(mochi.as2.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.as2.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.as2.MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 483 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 134 MovieClip Frame 60
stop();
stoptime = 0;
this.onEnterFrame = function () {
stoptime = stoptime + 1;
if (stoptime > 120) {
play();
}
};
Symbol 134 MovieClip Frame 85
delete this.onEnterFrame;
_root.gotoAndPlay(8);
Symbol 137 MovieClip [cannon_trail] Frame 1
_alpha = 40;
this.onEnterFrame = function () {
_alpha = (_alpha - 5);
if ((_alpha <= 0) || (!_root.slowmotion)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 140 MovieClip Frame 6
gotoAndStop (1);
Symbol 142 MovieClip Frame 1
stop();
Symbol 143 MovieClip [cannon] Frame 1
_x = 300;
_y = 300;
vx = 0;
vy = 0;
friction = 0.7;
speed = 3.5;
time = 0;
weaponNumber = 1;
_alpha = 0;
weaponAmmo = 0;
dead = false;
this.onEnterFrame = function () {
if ((!_root.gamePaused) && (!dead)) {
radians = Math.atan2(_root.cursor._y - this._y, _root.cursor._x - this._x);
degrees = Math.round((radians * 180) / Math.PI);
_rotation = degrees;
vx = vx * friction;
vy = vy * friction;
_x = (_x + vx);
_y = (_y + vy);
if (Key.isDown(65) || (Key.isDown(81))) {
vx = vx - speed;
}
if (Key.isDown(68)) {
vx = vx + speed;
}
if (Key.isDown(87) || (Key.isDown(90))) {
vy = vy - speed;
}
if (Key.isDown(83)) {
vy = vy + speed;
}
if (_x < 15) {
vx = 0;
_x = 15;
}
if (_x > 588) {
vx = 0;
_x = 588;
}
if (_y < 15) {
vy = 0;
_y = 15;
}
if (_y > 588) {
vy = 0;
_y = 588;
}
if (_root.laser) {
_root.laser._x = _x + (Math.cos((degrees * Math.PI) / 180) * 10);
_root.laser._y = _y + (Math.sin((degrees * Math.PI) / 180) * 10);
}
if (_root.playerhealth <= 0) {
_root.playsound("playerexplode");
if (!_root.wave) {
_root.createParticle("wave", _x, _y, 0);
}
if (_root.gamemode == 1) {
_root.attachMovie("finalscreen2", "finalscreen2", _root.tempdepth);
} else {
_root.attachMovie("finalscreen4", "finalscreen4", _root.tempdepth);
}
_alpha = 0;
dead = true;
}
if (time > 0) {
time = time - 1;
}
if (clicked) {
if (time <= 0) {
turret.gotoAndPlay(2);
switch (weaponNumber) {
case 1 :
_root.createParticle("bullet1", _x, _y, _rotation);
_root.playsound("gun3");
break;
case 2 :
_root.createParticle("bullet22", _x, _y, _rotation);
_root.createParticle("bullet22", _x, _y, _rotation + 10);
_root.createParticle("bullet22", _x, _y, _rotation - 10);
_root.playsound("gun3");
break;
case 3 :
i = 0;
while (i < 5) {
_root.createParticle("bullet6", _x, _y, _rotation);
i++;
}
_root.playsound("swish2");
break;
case 4 :
_root.createParticle("rocket", _x, _y, _rotation);
_root.playsound("swish2");
break;
case 5 :
_root.createParticle("bullet9", _x, _y, _rotation);
_root.playsound("wep7sound");
break;
case 6 :
_root.createParticle("bullet2", _x, _y, _rotation);
_root.playsound("fizz2");
break;
case 7 :
_root.createParticle("bullet4", _x, _y, _rotation);
_root.playsound("weapon4sound");
break;
case 8 :
_root.createParticle("bullet5", _x, _y, _rotation);
randomsound = random(2);
if (randomsound == 0) {
_root.playsound("flame");
}
if (randomsound == 1) {
_root.playsound("flame5");
}
break;
case 9 :
_root.createParticle("bullet6.6", _x, _y, _rotation);
_root.playsound("wacky");
break;
case 10 :
_root.createParticle("rocket3", _x, _y, _rotation);
_root.playsound("swish2");
break;
case 11 :
_root.createParticle("swirl", _x, _y, _rotation);
_root.playsound("wacky");
break;
case 12 :
if (_root.laser) {
break;
}
_root.attachMovie("laser", "laser", _root.laserdepth);
}
if (weaponNumber != 1) {
weaponAmmo = weaponAmmo - 1;
}
}
}
if ((_root.gamemode == 2) || (_root.gamemode == 1)) {
if ((weaponAmmo <= 0) && (!_root.laser)) {
weaponNumber = 1;
}
if ((weaponNumber == 1) || (weaponNumber == 12)) {
_root.cursor.cursorammo._alpha = 0;
} else {
_root.cursor.cursorammo._alpha = 80;
_root.cursor.cursorammo.ammo = weaponAmmo;
}
} else {
_root.cursor.cursorammo._alpha = 0;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
onMouseDown = function () {
clicked = true;
};
onMouseUp = function () {
clicked = false;
};
Symbol 148 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if (_root.slowmotion) {
_rotation = (_rotation + 1);
} else {
_rotation = (_rotation + 5);
}
};
Symbol 151 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if (_root.slowmotion) {
_rotation = (_rotation + 1);
} else {
_rotation = (_rotation + 5);
}
};
Symbol 154 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if (_root.slowmotion) {
_rotation = (_rotation + 1);
} else {
_rotation = (_rotation + 5);
}
};
Symbol 156 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.slowmotion) {
_rotation = (_rotation + 1);
} else {
_rotation = (_rotation + 5);
}
};
Symbol 160 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if (_root.slowmotion) {
_rotation = (_rotation + 1);
} else {
_rotation = (_rotation + 5);
}
};
Symbol 165 MovieClip Frame 1
this.onEnterFrame = function () {
radians = Math.atan2(_root.cannon._y - _root.cursor._y, _root.cannon._x - _root.cursor._x);
degrees = (radians * 180) / Math.PI;
_rotation = degrees;
};
Symbol 166 MovieClip [cursor] Frame 1
myColor = 16777215 /* 0xFFFFFF */;
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
this.onEnterFrame = function () {
_x = (_x + ((_root._xmouse - _x) / 2));
_y = (_y + ((_root._ymouse - _y) / 2));
gotoAndStop(_root.cannon.weaponNumber);
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 171 MovieClip [bullet1] Frame 1
function createSpark(dir) {
_root.ricochet();
sparked = true;
i = 0;
while (i < 3) {
if (dir == 1) {
_root.createParticle("bullet1_spark", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("bullet1_spark", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("bullet1_spark", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("bullet1_spark", _x, 600, dir);
}
i++;
}
}
_root.cannon.time = 4;
angle = _rotation;
firepower = 20;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 1.2);
this._y = this._y + (diry * 1.2);
time = 0;
sparked = false;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
trail._xscale = trail._xscale + 5;
time = time + 1;
time2 = time2 + 1;
} else {
_x = (_x + dirx);
_y = (_y + diry);
trail._xscale = trail._xscale + 25;
time = time + 5;
time2 = time2 + 5;
}
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i].frame.hitTest(_x, _y, true)) {
_root.Bullet[i].destroyed();
deletion = true;
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
_root.createParticle("boss_hit_4", _x, _y, 0);
_root.boss.bosshealth = _root.boss.bosshealth - 10;
deletion = true;
}
}
if ((time >= 250) || (deletion)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (!sparked) {
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 172 MovieClip Frame 1
function destroyed() {
this.swapDepths(1);
removeMovieClip(this);
delete this.onEnterFrame;
}
Symbol 174 MovieClip [square] Frame 1
function destroyed() {
_root.explosion();
_root.killed = _root.killed + 1;
_root.killed2 = _root.killed2 + 1;
i = 0;
while (i < 10) {
_root.createParticle("shatter", _x, _y, 1);
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
i++;
}
myColoredObject = new Color(_root.score);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.healthbar);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.hud_infinity);
myColoredObject.setRGB(myColor);
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
_root.playerscore = _root.playerscore + 100;
if (random(10) == 0) {
_root.createParticle("powerup", _x, _y, 0);
}
removeMovieClip(this);
delete this.onEnterFrame;
}
if (random(2) == 0) {
this._x = random(Stage.width);
if (random(2) == 0) {
this._y = -50;
} else {
this._y = Stage.height + 50;
}
} else {
this._y = random(Stage.height);
if (random(2) == 0) {
this._x = -50;
} else {
this._x = Stage.width + 50;
}
}
R = random(200) + 45;
G = random(200) + 45;
B = random(200) + 45;
myColor = (("0x" + R.toString(16)) + G.toString(16)) + B.toString(16);
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
hp = 100;
speed = Math.random() + 3.5;
randomrotation = (Math.random() * 20) - 10;
time = 0;
firetime = 0;
burntime = random(200) + 100;
_root.Bullet[_root.Bullet.length] = this;
this.onEnterFrame = function () {
if ((!_root.gamePaused) && (!freeze)) {
if (hp <= 1) {
destroyed();
}
dx = _x - _root.cannon._x;
dy = _y - _root.cannon._y;
radians = Math.atan2(dy, dx);
angle = Math.round((radians * 180) / Math.PI);
dirx = Math.cos((angle * Math.PI) / 180) * speed;
diry = Math.sin((angle * Math.PI) / 180) * speed;
if (_root.slowmotion == true) {
_x = (_x - (dirx / 5));
_y = (_y - (diry / 5));
_rotation = (_rotation + (randomrotation / 5));
if (onFire) {
time = time + 1;
firetime = firetime + 1;
}
} else {
_x = (_x - dirx);
_y = (_y - diry);
_rotation = (_rotation + randomrotation);
if (onFire) {
time = time + 5;
firetime = firetime + 5;
}
}
if (onFire) {
if (firetime >= burntime) {
destroyed();
}
if (time >= 15) {
time = 0;
_root.createParticle("fire", _x, _y, 0);
}
}
if (this.hitTest(_root.cannon._x, _root.cannon._y, true)) {
_root.playerhealth = _root.playerhealth - 75;
destroyed();
}
if (_root.wave.hitTest(this._x, this._y, true)) {
destroyed();
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 183 MovieClip [shatter] Frame 1
gotoAndStop(_rotation);
_alpha = 70;
this._xscale = (Math.random() * 200) + 50;
this._yscale = this._xscale;
rotationspeed = random(30) - 15;
alphafade = Math.random() + 1;
speed = (Math.random() * 20) + 4;
angle = random(360);
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
this._rotation = this._rotation + rotationspeed;
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
} else {
this._rotation = this._rotation + (rotationspeed / 5);
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
}
if ((this._alpha < alphafade) || (_root.deleteall)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 185 MovieClip [bullet6] Frame 1
function createSpark(dir) {
_root.ricochet();
sparked = true;
i = 0;
while (i < 3) {
if (dir == 1) {
_root.createParticle("bullet6_spark", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("bullet6_spark", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("bullet6_spark", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("bullet6_spark", _x, 600, dir);
}
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
_root.cannon.time = 20;
_rotation = (_rotation + ((Math.random() * 40) - 20));
angle = _rotation;
firepower = 20 - (Math.random() * 5);
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 1.2);
this._y = this._y + (diry * 1.2);
time = 0;
time2 = 0;
sparked = false;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
trail._xscale = trail._xscale + 5;
time = time + 1;
time2 = time2 + 1;
} else {
_x = (_x + dirx);
_y = (_y + diry);
trail._xscale = trail._xscale + 25;
time = time + 5;
time2 = time2 + 5;
}
if (time2 >= 5) {
time2 = 0;
_root.createParticle("rocket_fire", _x - dirx, _y - diry, 0);
}
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i].frame.hitTest(_x, _y, true)) {
_root.Bullet[i].destroyed();
deletion = true;
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
_root.createParticle("boss_hit_1", _x, _y, 0);
_root.boss.bosshealth = _root.boss.bosshealth - 20;
deletion = true;
}
}
if ((time >= 250) || (deletion)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (!sparked) {
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 189 MovieClip [rocket_fire] Frame 1
alphafade = 15;
vx = Math.random() * 2;
vy = Math.random() * 2;
_rotation = (random(360) + 1);
xshrink = 5;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
colorchange._alpha = colorchange._alpha + 10;
_xscale = (_xscale - xshrink);
_yscale = (_yscale - xshrink);
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - alphafade);
} else {
colorchange._alpha = colorchange._alpha + 2;
_xscale = (_xscale - (xshrink / 5));
_yscale = (_yscale - (xshrink / 5));
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 2) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 195 MovieClip [rocket] Frame 1
function createSpark(dir) {
_root.ricochet();
i = 0;
while (i < 3) {
if (dir == 1) {
_root.createParticle("bullet7_spark", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("bullet7_spark", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("bullet7_spark", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("bullet7_spark", _x, 600, dir);
}
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
_root.cannon.time = 10;
angle = _root.cannon._rotation;
firepower = 12;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 2);
this._y = this._y + (diry * 2);
Missile_speed = 10 + (Math.random() * 4);
Missile_turning_1 = 0.75 + (Math.random() / 4);
missilevx = 0;
missilevy = 0;
time = 0;
time2 = 0;
time3 = 0;
weaponType = 7;
lockon = false;
deployed = false;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (!_root.slowmotion) {
this._rotation = this._rotation + ((angle2 - this._rotation) / 5);
time = time + 5;
time2 = time2 + 5;
time3 = time3 + 5;
if (time3 <= 50) {
_x = (_x + dirx);
_y = (_y + diry);
} else {
lockit = true;
_x = (_x + missilevx);
_y = (_y + missilevy);
}
Missile_turning = 1;
} else {
this._rotation = this._rotation + ((angle2 - this._rotation) / 30);
time = time + 1;
time2 = time2 + 1;
time3 = time3 + 1;
if (time3 <= 50) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
} else {
lockit = true;
_x = (_x + (missilevx / 5));
_y = (_y + (missilevy / 5));
}
Missile_turning = 0.5;
}
closest = 10000;
if (lockit) {
i = 0;
while (i < _root.Bullet.length) {
distance = Math.sqrt(Math.pow(_x - _root.Bullet[i]._x, 2) + Math.pow(_y - _root.Bullet[i]._y, 2));
if (distance < closest) {
closest = distance;
dx = _root.Bullet[i]._x - _x;
dy = _root.Bullet[i]._y - _y;
lockon = true;
}
i++;
}
}
if (!lockon) {
if (!deployed) {
deployed = true;
}
dx = dirx;
dy = diry;
}
if (lockon) {
lockon = false;
}
radians2 = Math.atan2(dy, dx);
angle2 = Math.round((radians2 * 180) / Math.PI);
difference = _rotation - angle2;
if (difference > 180) {
angle2 = angle2 + 360;
}
if (difference < -180) {
angle2 = angle2 - 360;
}
distance = Math.sqrt((dx * dx) + (dy * dy));
dx = dx / distance;
dy = dy / distance;
missilevx = missilevx + (dx * Missile_turning);
missilevy = missilevy + (dy * Missile_turning);
velocity = Math.sqrt((missilevx * missilevx) + (missilevy * missilevy));
if (velocity > Missile_speed) {
missilevx = (missilevx * Missile_speed) / velocity;
missilevy = (missilevy * Missile_speed) / velocity;
}
if (time2 >= 5) {
time2 = 0;
_root.createParticle("rocket_fire2", _x - missilevx, _y - missilevy, 0);
}
if (time >= 1000) {
detonation = true;
}
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i].frame.hitTest(_x, _y, true)) {
_root.Bullet[i].destroyed();
detonation = true;
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
_root.createParticle("boss_hit_3", _x, _y, 0);
_root.boss.bosshealth = _root.boss.bosshealth - 30;
detonation = true;
}
}
if (this.detonation == true) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 199 MovieClip [rocket_fire2] Frame 1
alphafade = 15;
vx = Math.random();
vy = Math.random();
_rotation = (random(360) + 1);
xshrink = 5;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
colorchange._alpha = colorchange._alpha + 10;
_xscale = (_xscale - xshrink);
_yscale = (_yscale - xshrink);
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - alphafade);
} else {
colorchange._alpha = colorchange._alpha + 2;
_xscale = (_xscale - (xshrink / 5));
_yscale = (_yscale - (xshrink / 5));
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 2) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 206 MovieClip Frame 40
Symbol 206 MovieClip Frame 80
gotoAndPlay (1);
Symbol 207 MovieClip [bullet9] Frame 1
function createSpark(dir) {
_root.playsound("shock2");
i = 0;
while (i < 5) {
if (dir == 1) {
_root.createParticle("bullet9_spark", 0, _y, dir);
_root.createParticle("bullet9_splosion", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("bullet9_spark", 600, _y, dir);
_root.createParticle("bullet9_splosion", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("bullet9_spark", _x, 0, dir);
_root.createParticle("bullet9_splosion", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("bullet9_spark", _x, 600, dir);
_root.createParticle("bullet9_splosion", _x, 600, dir);
}
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
_root.cannon.time = 10;
this._x = _root.cannon._x;
this._y = _root.cannon._y;
this._rotation = _root.cannon._rotation;
rotationspeed = (Math.random() * 5) + 2;
if (random(2) == 0) {
rotationspeed = rotationspeed * -1;
}
angle = _rotation;
firepower = 6 + (Math.random() * 4);
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 3);
this._y = this._y + (diry * 3);
time = 0;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
ball.center._alpha = random(75) + 25;
ball.center._xscale = 80 + random(40);
ball.center._yscale = ball.center._xscale;
if (_root.slowmotion == true) {
_rotation = (_rotation + rotationspeed);
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
time = time + 1;
time2 = time2 + 1;
} else {
_rotation = (_rotation + rotationspeed);
_x = (_x + dirx);
_y = (_y + diry);
time = time + 5;
time2 = time2 + 5;
}
closest = 150;
if (time2 >= 5) {
_root.createParticle("lightningtrail", _x, _y, lightningrotation);
time2 = 0;
i = 0;
while (i < _root.Bullet.length) {
distance = Math.sqrt(Math.pow(_x - _root.Bullet[i]._x, 2) + Math.pow(_y - _root.Bullet[i]._y, 2));
if (distance < closest) {
closest = distance;
dx = _root.Bullet[i]._x - _x;
dy = _root.Bullet[i]._y - _y;
_root.Bullet[i].hp = _root.Bullet[i].hp - 3;
lightningrotation = (Math.atan2(dy, dx) * 180) / Math.PI;
_root.createParticle("lightning", _x, _y, lightningrotation);
_root["particle" + _root.pDEPTH]._xscale = distance + 40;
}
i++;
}
if (_root.boss) {
distance = Math.sqrt(Math.pow(_x - _root.boss._x, 2) + Math.pow(_y - _root.boss._y, 2));
if (distance < closest) {
closest = distance;
dx = _root.boss._x - _x;
dy = _root.boss._y - _y;
_root.boss.bosshealth = _root.boss.bosshealth - 1;
lightningrotation = (Math.atan2(dy, dx) * 180) / Math.PI;
_root.createParticle("lightning", _x, _y, lightningrotation);
_root["particle" + _root.pDEPTH]._xscale = distance + 40;
}
}
}
if ((time >= 700) || (deletion)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 215 MovieClip [lightning] Frame 1
gotoAndStop(random(_totalframes) + 1);
_alpha = (random(75) + 25);
alphafade = 25;
originalheight = _height;
this.onEnterFrame = function () {
_height = originalheight;
if (!_root.slowmotion) {
_alpha = (_alpha - alphafade);
} else {
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 1) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 219 MovieClip [lightningtrail] Frame 1
alphafade = 10;
vx = Math.random() * 2;
vy = Math.random() * 2;
_rotation = (random(360) + 1);
xshrink = 5;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
colorchange._alpha = colorchange._alpha + 10;
_xscale = (_xscale - xshrink);
_yscale = (_yscale - xshrink);
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - alphafade);
} else {
colorchange._alpha = colorchange._alpha + 2;
_xscale = (_xscale - (xshrink / 5));
_yscale = (_yscale - (xshrink / 5));
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 2) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 221 MovieClip [bullet2] Frame 1
function createSpark(dir) {
_root.playsound("fizz");
i = 0;
while (i < 3) {
if (dir == 1) {
_root.createParticle("bullet2_spark", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("bullet2_spark", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("bullet2_spark", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("bullet2_spark", _x, 600, dir);
}
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
_root.cannon.time = 9;
this._x = _root.cannon._x;
this._y = _root.cannon._y;
this._rotation = _root.cannon._rotation;
weaponType = 2;
angle = _root.cannon._rotation;
firepower = 8;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 2);
this._y = this._y + (diry * 2);
time = 0;
time2 = 0;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
time = time + 1;
time2 = time2 + 1;
_rotation = (_rotation + 2);
} else {
_x = (_x + dirx);
_y = (_y + diry);
time = time + 5;
time2 = time2 + 5;
_rotation = (_rotation + 10);
}
if (time >= 5) {
_root.createParticle("b2_trail", _x, _y, 0);
time = 0;
}
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i].frame.hitTest(_x, _y, true)) {
_root.Bullet[i].destroyed();
deletion = true;
Z = 0;
while (Z < 3) {
_root.bulleti = _root.bulleti + 1;
_root.createParticle("bullet2_2", _x, _y, random(360));
Z++;
}
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
_root.createParticle("boss_hit_2", _x, _y, 0);
_root.boss.bosshealth = _root.boss.bosshealth - 10;
deletion = true;
}
}
if ((time2 >= 600) || (deletion)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 222 MovieClip [bullet2_2] Frame 1
function createSpark(dir) {
_root.playsound("fizz");
i = 0;
while (i < 3) {
if (dir == 1) {
_root.createParticle("bullet2_spark", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("bullet2_spark", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("bullet2_spark", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("bullet2_spark", _x, 600, dir);
}
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
_root.cannon.time = 9;
weaponType = 2;
angle = _rotation;
firepower = 8;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 2);
this._y = this._y + (diry * 2);
time = 0;
time2 = 0;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
time = time + 1;
time2 = time2 + 1;
_rotation = (_rotation + 2);
} else {
_x = (_x + dirx);
_y = (_y + diry);
time = time + 5;
time2 = time2 + 5;
_rotation = (_rotation + 10);
}
if (time >= 5) {
_root.createParticle("b2_trail", _x, _y, 0);
time = 0;
}
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i].frame.hitTest(_x, _y, true)) {
_root.Bullet[i].destroyed();
deletion = true;
Z = 0;
while (Z < 3) {
_root.bulleti = _root.bulleti + 1;
_root.createParticle("bullet2_2", _x, _y, random(360));
Z++;
}
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
_root.createParticle("boss_hit_2", _x, _y, 0);
_root.boss.bosshealth = _root.boss.bosshealth - 20;
deletion = true;
}
}
if ((time2 >= 600) || (deletion)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 224 MovieClip [bullet2_spark] Frame 1
stop();
_alpha = 100;
this._xscale = (Math.random() * 50) + 50;
this._yscale = this._xscale;
alphafade = Math.random() + 4;
speed = (Math.random() * 4) + 1;
dir = _rotation;
if (dir == 1) {
angle = random(180) - 90;
}
if (dir == 2) {
angle = random(180) + 90;
}
if (dir == 3) {
angle = random(180);
}
if (dir == 4) {
angle = random(180) + 180;
}
_rotation = angle;
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
}
if ((this._alpha <= 1) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 225 MovieClip [b2_trail] Frame 1
alphafade = 8;
angle = _root.cannon._rotation;
firepower = 8;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
vx = (Math.random() * 4) - 2;
vy = (Math.random() * 4) - 2;
_rotation = (random(360) + 1);
xshrink = 5;
this.onEnterFrame = function () {
if (_root.slowmotion == false) {
_xscale = (_xscale - xshrink);
_yscale = (_yscale - xshrink);
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - alphafade);
} else {
_xscale = (_xscale - (xshrink / 5));
_yscale = (_yscale - (xshrink / 5));
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 2) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 227 MovieClip [bullet4] Frame 1
function BlowItUp() {
_root.explosion();
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
i = 0;
while (i < 10) {
_root.createParticle("bullet4_bullet", _x, _y, 0);
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
_root.cannon.time = 20;
this._x = _root.cannon._x;
this._y = _root.cannon._y;
this._rotation = _root.cannon._rotation;
rotationspeed = (Math.random() * 5) + 5;
if (random(2) == 0) {
rotationspeed = rotationspeed * -1;
}
weaponType = 4;
angle = _root.cannon._rotation;
firepower = 15;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 1.5);
this._y = this._y + (diry * 1.5);
time = 0;
detonation = false;
fadeaway = 0;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
time = time + 1;
_rotation = (_rotation + (rotationspeed / 5));
fadeaway = fadeaway + 1;
} else {
_x = (_x + dirx);
_y = (_y + diry);
time = time + 5;
_rotation = (_rotation + rotationspeed);
fadeaway = fadeaway + 5;
}
if (detonation) {
BlowItUp();
}
if (time >= 5) {
_root.createParticle("b4_trail", _x, _y, 0);
time = 0;
}
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i].frame.hitTest(_x, _y, true)) {
_root.Bullet[i].destroyed();
BlowItUp();
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
BlowItUp();
_root.boss.bosshealth = _root.boss.bosshealth - 20;
deletion = true;
}
}
if ((fadeaway >= 350) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_x < 0) {
BlowItUp();
}
if (_x > 600) {
BlowItUp();
}
if (_y < 0) {
BlowItUp();
}
if (_y > 600) {
BlowItUp();
}
}
};
Symbol 231 MovieClip Frame 1
gotoAndStop(random(3) + 1);
Symbol 232 MovieClip [bullet4_bullet] Frame 1
function createSpark(dir) {
i = 0;
while (i < 3) {
if (dir == 1) {
_root.createParticle("bullet4_spark", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("bullet4_spark", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("bullet4_spark", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("bullet4_spark", _x, 600, dir);
}
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
weaponType = 1;
this._rotation = random(360) + 1;
randomrotation = (Math.random() * 10) + 1;
angle = _rotation;
firepower = (Math.random() * 5) + 10;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
time = 0;
sparked = false;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
time = time + 1;
_rotation = (_rotation + (randomrotation / 5));
} else {
_x = (_x + dirx);
_y = (_y + diry);
time = time + 5;
_rotation = (_rotation + randomrotation);
}
if (time >= 5) {
time = 0;
_root.createParticle("b4_trail2", _x - dirx, _y - diry, 0);
}
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i].frame.hitTest(_x, _y, true)) {
_root.Bullet[i].destroyed();
deletion = true;
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
_root.createParticle("boss_hit_1", _x, _y, 0);
_root.boss.bosshealth = _root.boss.bosshealth - 10;
deletion = true;
}
}
if ((this._alpha < 2) || (deletion)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 234 MovieClip [bullet4_spark] Frame 1
stop();
_alpha = 100;
this._xscale = (Math.random() * 50) + 50;
this._yscale = this._xscale;
alphafade = Math.random() + 6;
speed = (Math.random() * 10) + 4;
dir = _rotation;
if (dir == 1) {
angle = random(180) - 90;
}
if (dir == 2) {
angle = random(180) + 90;
}
if (dir == 3) {
angle = random(180);
}
if (dir == 4) {
angle = random(180) + 180;
}
_rotation = angle;
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
}
if ((this._alpha <= 1) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 236 MovieClip [b4_trail] Frame 1
alphafade = 16;
angle = _root.cannon._rotation;
firepower = 8;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
vx = (Math.random() * 4) - 2;
vy = (Math.random() * 4) - 2;
_rotation = (random(360) + 1);
this.onEnterFrame = function () {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - alphafade);
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 2) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 237 MovieClip [b4_trail2] Frame 1
alphafade = 34;
angle = _root.cannon._rotation;
firepower = 8;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
vx = (Math.random() * 4) - 2;
vy = (Math.random() * 4) - 2;
_rotation = (random(360) + 1);
this.onEnterFrame = function () {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - alphafade);
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 2) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 240 MovieClip [bullet6_spark] Frame 1
stop();
_alpha = 100;
this._xscale = (Math.random() * 50) + 50;
this._yscale = this._xscale;
alphafade = Math.random() + 1;
speed = (Math.random() * 10) + 1;
dir = _rotation;
if (dir == 1) {
angle = random(180) - 90;
}
if (dir == 2) {
angle = random(180) + 90;
}
if (dir == 3) {
angle = random(180);
}
if (dir == 4) {
angle = random(180) + 180;
}
_rotation = angle;
rotationspeed = (Math.random() * 5) + 2;
if (random(2) == 0) {
rotationspeed = rotationspeed * -1;
}
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
_rotation = (_rotation + rotationspeed);
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
_rotation = (_rotation + (rotationspeed / 5));
}
if ((this._alpha <= 1) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 241 MovieClip [bullet7_spark] Frame 1
stop();
_alpha = 100;
this._xscale = (Math.random() * 50) + 50;
this._yscale = this._xscale;
alphafade = Math.random() + 1;
speed = (Math.random() * 10) + 1;
dir = _rotation;
if (dir == 1) {
angle = random(180) - 90;
}
if (dir == 2) {
angle = random(180) + 90;
}
if (dir == 3) {
angle = random(180);
}
if (dir == 4) {
angle = random(180) + 180;
}
_rotation = angle;
rotationspeed = (Math.random() * 5) + 2;
if (random(2) == 0) {
rotationspeed = rotationspeed * -1;
}
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
_rotation = (_rotation + rotationspeed);
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
_rotation = (_rotation + (rotationspeed / 5));
}
if ((this._alpha <= 1) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 244 MovieClip [bullet9_spark] Frame 1
gotoAndStop(random(_totalframes) + 1);
_alpha = 100;
this._xscale = (Math.random() * 50) + 50;
this._yscale = this._xscale;
alphafade = Math.random() + 6;
if (_currentframe == 1) {
speed = random(20) + 4;
} else {
speed = random(10) + 1;
}
dir = _rotation;
if (dir == 1) {
angle = random(180) - 90;
}
if (dir == 2) {
angle = random(180) + 90;
}
if (dir == 3) {
angle = random(180);
}
if (dir == 4) {
angle = random(180) + 180;
}
_rotation = angle;
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
}
if ((this._alpha <= 1) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 246 MovieClip [bullet9_splosion] Frame 1
alphafade = 5;
_alpha = 30;
this.onEnterFrame = function () {
if (!_root.slowmotion) {
_alpha = (_alpha - alphafade);
} else {
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 5) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 259 MovieClip Frame 1
frame._alpha = 0;
gotoAndStop(random(10) + 1);
Symbol 260 MovieClip [bullet5] Frame 1
_root.cannon.time = 2;
_rotation = random(360);
alphafade = 0.4;
angle = _root.cannon._rotation;
firepower = Math.random() + 5;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
xscale = (Math.random() * 4) + 4;
yscale = (Math.random() * 4) + 4;
this._x = this._x + (dirx * 5);
this._y = this._y + (diry * 5);
time = 0;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_xscale = (_xscale + xscale);
_yscale = (_yscale + yscale);
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
trail._xscale = trail._xscale + 4;
this._alpha = this._alpha - alphafade;
time = time + 1;
} else {
_xscale = (_xscale + (xscale * 5));
_yscale = (_yscale + (yscale * 5));
_x = (_x + dirx);
_y = (_y + diry);
trail._xscale = trail._xscale + 20;
this._alpha = this._alpha - (alphafade * 5);
time = time + 5;
}
if (time >= 5) {
time = 0;
nextFrame();
gotoAndStop;
}
i = 0;
while (i <= _root.Bullet.length) {
if (this.hitTest(_root.Bullet[i]._x, _root.Bullet[i]._y, true)) {
_root.Bullet[i].onFire = true;
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
_root.boss.bosshealth = _root.boss.bosshealth - 2;
}
}
if ((this._alpha < 2) || (deletion)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 260 MovieClip [bullet5] Frame 50
stop();
Symbol 265 MovieClip Frame 1
gotoAndStop(random(3) + 1);
Symbol 266 MovieClip [fire] Frame 1
stop();
this._rotation = random(360);
_x = (_x + ((Math.random() * 30) - 15));
_y = (_y + ((Math.random() * 30) - 15));
alphafade = 1;
xscale = (Math.random() * 3) + 5;
yscale = (Math.random() * 3) + 5;
time = 0;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_xscale = (_xscale + xscale);
_yscale = (_yscale + yscale);
trail._xscale = trail._xscale + 4;
this._alpha = this._alpha - alphafade;
time = time + 1;
} else {
_xscale = (_xscale + (xscale * 5));
_yscale = (_yscale + (yscale * 5));
trail._xscale = trail._xscale + 20;
this._alpha = this._alpha - (alphafade * 5);
time = time + 5;
}
if (time >= 5) {
time = 0;
nextFrame();
gotoAndStop;
}
if ((this._alpha < 2) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 266 MovieClip [fire] Frame 35
stop();
Symbol 268 MovieClip [bullet6.6] Frame 1
function createSpark(dir) {
if (dir == 1) {
dirx = dirx * -1;
_rotation = (_rotation + (180 - (_rotation * 2)));
}
if (dir == 2) {
dirx = dirx * -1;
_rotation = (_rotation + (180 - (_rotation * 2)));
}
if (dir == 3) {
diry = diry * -1;
_rotation = (_rotation - (_rotation * 2));
}
if (dir == 4) {
diry = diry * -1;
_rotation = (_rotation - (_rotation * 2));
}
}
_root.cannon.time = 5;
this._x = _root.cannon._x;
this._y = _root.cannon._y;
this._rotation = _root.cannon._rotation;
angle = _rotation;
firepower = 15;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 2);
this._y = this._y + (diry * 2);
time = 0;
alphafade = 0.1;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
time = time + 1;
time2 = time2 + 1;
_alpha = (_alpha - alphafade);
} else {
_x = (_x + dirx);
_y = (_y + diry);
time = time + 5;
time2 = time2 + 5;
_alpha = (_alpha - (alphafade * 5));
}
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i].frame.hitTest(_x, _y, true)) {
_root.Bullet[i].destroyed();
deletion = true;
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
_root.createParticle("boss_hit_5", _x, _y, 0);
_root.boss.bosshealth = _root.boss.bosshealth - 20;
deletion = true;
}
}
if (((time >= 500) || (deletion)) || (_alpha <= 1)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_x < 8) {
createSpark(1);
}
if (_x > 592) {
createSpark(2);
}
if (_y < 8) {
createSpark(3);
}
if (_y > 592) {
createSpark(4);
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 270 MovieClip [rocket3] Frame 1
function createSpark(dir) {
_root.ricochet();
sparked = true;
i = 0;
while (i < 3) {
if (dir == 1) {
_root.createParticle("bullet6_spark", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("bullet6_spark", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("bullet6_spark", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("bullet6_spark", _x, 600, dir);
}
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
_root.cannon.time = 4;
_rotation = (_rotation + ((Math.random() * 40) - 20));
angle = _rotation;
firepower = 15 - (Math.random() * 5);
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 1.2);
this._y = this._y + (diry * 1.2);
time = 0;
time2 = 0;
sparked = false;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
trail._xscale = trail._xscale + 5;
time = time + 1;
time2 = time2 + 1;
} else {
_x = (_x + dirx);
_y = (_y + diry);
trail._xscale = trail._xscale + 25;
time = time + 5;
time2 = time2 + 5;
}
if (time2 >= 5) {
time2 = 0;
_root.createParticle("rocket_fire3", _x - dirx, _y - diry, 0);
angle = angle + ((random(3) - 1) * 10);
_rotation = (_rotation + ((angle - _rotation) / 3));
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
}
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i].frame.hitTest(_x, _y, true)) {
_root.Bullet[i].destroyed();
deletion = true;
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
_root.createParticle("boss_hit_1", _x, _y, 0);
_root.boss.bosshealth = _root.boss.bosshealth - 20;
deletion = true;
}
}
if ((time >= 250) || (deletion)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (!sparked) {
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 274 MovieClip [rocket_fire3] Frame 1
alphafade = 15;
vx = Math.random();
vy = Math.random();
_rotation = (random(360) + 1);
xshrink = 5;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
colorchange._alpha = colorchange._alpha + 10;
_xscale = (_xscale - xshrink);
_yscale = (_yscale - xshrink);
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - alphafade);
} else {
colorchange._alpha = colorchange._alpha + 2;
_xscale = (_xscale - (xshrink / 5));
_yscale = (_yscale - (xshrink / 5));
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 2) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 275 MovieClip [bullet22] Frame 1
function createSpark(dir) {
_root.ricochet();
sparked = true;
i = 0;
while (i < 3) {
if (dir == 1) {
_root.createParticle("bullet22_spark", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("bullet22_spark", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("bullet22_spark", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("bullet22_spark", _x, 600, dir);
}
i++;
}
}
_root.cannon.time = 6;
angle = _rotation;
firepower = 20;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 1.2);
this._y = this._y + (diry * 1.2);
time = 0;
sparked = false;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
trail._xscale = trail._xscale + 5;
time = time + 1;
time2 = time2 + 1;
} else {
_x = (_x + dirx);
_y = (_y + diry);
trail._xscale = trail._xscale + 25;
time = time + 5;
time2 = time2 + 5;
}
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i].frame.hitTest(_x, _y, true)) {
_root.Bullet[i].destroyed();
deletion = true;
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
_root.createParticle("boss_hit_1", _x, _y, 0);
_root.boss.bosshealth = _root.boss.bosshealth - 10;
deletion = true;
}
}
if ((time >= 250) || (deletion)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (!sparked) {
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 278 MovieClip [bullet22_spark] Frame 1
stop();
_alpha = 100;
this._xscale = (Math.random() * 50) + 50;
this._yscale = this._xscale;
alphafade = Math.random() + 12;
dir = _rotation;
speed = random(20) + 4;
if (dir == 1) {
angle = random(180) - 90;
}
if (dir == 2) {
angle = random(180) + 90;
}
if (dir == 3) {
angle = random(180);
}
if (dir == 4) {
angle = random(180) + 180;
}
_rotation = angle;
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
}
if ((this._alpha <= 1) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 280 MovieClip [swirl] Frame 1
function createSpark(dir) {
sparked = true;
i = 0;
while (i < 3) {
if (dir == 1) {
_root.createParticle("swirl_spark", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("swirl_spark", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("swirl_spark", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("swirl_spark", _x, 600, dir);
}
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
_root.cannon.time = 4;
_rotation = (_rotation + ((Math.random() * 40) - 20));
angle = _rotation;
firepower = 15 - (Math.random() * 5);
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 1.2);
this._y = this._y + (diry * 1.2);
time = 0;
time2 = 0;
sparked = false;
rotational = 1;
if (random(2) == 1) {
rotational = -1;
}
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (time < 100) {
if (_root.slowmotion) {
angle = angle + (2 * rotational);
} else {
angle = angle + (10 * rotational);
}
} else if (_root.slowmotion) {
angle = angle + (1 * rotational);
} else {
angle = angle + (5 * rotational);
}
_rotation = (_rotation + ((angle - _rotation) / 3));
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
trail._xscale = trail._xscale + 5;
time = time + 1;
time2 = time2 + 1;
} else {
_x = (_x + dirx);
_y = (_y + diry);
trail._xscale = trail._xscale + 25;
time = time + 5;
time2 = time2 + 5;
}
if (time2 >= 5) {
time2 = 0;
_root.createParticle("swirltrail", _x - dirx, _y - diry, 0);
}
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i].frame.hitTest(_x, _y, true)) {
_root.Bullet[i].destroyed();
deletion = true;
}
i++;
}
if (_root.boss) {
if (_root.boss.hitTest(_x, _y, true)) {
_root.createParticle("boss_hit_2", _x, _y, 0);
_root.boss.bosshealth = _root.boss.bosshealth - 30;
deletion = true;
}
}
if ((time >= 450) || (deletion)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (!sparked) {
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 283 MovieClip [swirltrail] Frame 1
alphafade = 20;
vx = Math.random();
vy = Math.random();
_rotation = (random(360) + 1);
xshrink = 5;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
colorchange._alpha = colorchange._alpha + 10;
_xscale = (_xscale - xshrink);
_yscale = (_yscale - xshrink);
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - alphafade);
} else {
colorchange._alpha = colorchange._alpha + 2;
_xscale = (_xscale - (xshrink / 5));
_yscale = (_yscale - (xshrink / 5));
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 2) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 284 MovieClip [swirl_spark] Frame 1
stop();
_alpha = 100;
this._xscale = (Math.random() * 50) + 50;
this._yscale = this._xscale;
alphafade = Math.random() + 1;
speed = (Math.random() * 10) + 1;
dir = _rotation;
if (dir == 1) {
angle = random(180) - 90;
}
if (dir == 2) {
angle = random(180) + 90;
}
if (dir == 3) {
angle = random(180);
}
if (dir == 4) {
angle = random(180) + 180;
}
_rotation = angle;
rotationspeed = (Math.random() * 5) + 2;
if (random(2) == 0) {
rotationspeed = rotationspeed * -1;
}
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
_rotation = (_rotation + rotationspeed);
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
_rotation = (_rotation + (rotationspeed / 5));
}
if ((this._alpha <= 1) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 291 MovieClip [laser] Frame 1
function createSpark(direction) {
_root.enemypieceI = _root.enemypieceI + 1;
_root.enemypiecedepth = _root.enemypiecedepth + 1;
_root.attachMovie("laser_spark", "enemy_piece" + _root.enemypieceI, _root.enemypiecedepth);
_root["enemy_piece" + _root.enemypieceI]._alpha = _alpha;
if (direction == "right") {
radians = (_root.cannon._rotation * Math.PI) / 180;
_root["enemy_piece" + _root.enemypieceI].dir = 2;
_root["enemy_piece" + _root.enemypieceI]._x = _root.bounds.right + 20;
_root["enemy_piece" + _root.enemypieceI]._y = _root.cannon._y + (((_root.bounds.right + 20) - _root.cannon._x) * Math.tan(radians));
}
if (direction == "left") {
radians = (_root.cannon._rotation * Math.PI) / 180;
_root["enemy_piece" + _root.enemypieceI].dir = 1;
_root["enemy_piece" + _root.enemypieceI]._x = _root.bounds.left - 20;
_root["enemy_piece" + _root.enemypieceI]._y = _root.cannon._y + (((_root.bounds.left - 20) - _root.cannon._x) * Math.tan(radians));
}
if (direction == "down") {
radians = ((_root.cannon._rotation + 90) * Math.PI) / 180;
_root["enemy_piece" + _root.enemypieceI].dir = 4;
_root["enemy_piece" + _root.enemypieceI]._y = _root.bounds.down + 20;
_root["enemy_piece" + _root.enemypieceI]._x = _root.cannon._x + ((_root.cannon._y - (_root.bounds.down + 20)) * Math.tan(radians));
}
if (direction == "top") {
radians = ((_root.cannon._rotation - 90) * Math.PI) / 180;
_root["enemy_piece" + _root.enemypieceI].dir = 3;
_root["enemy_piece" + _root.enemypieceI]._y = _root.bounds.up - 20;
_root["enemy_piece" + _root.enemypieceI]._x = _root.cannon._x + ((_root.cannon._y - (_root.bounds.up - 20)) * Math.tan(radians));
}
}
function createSurplus() {
_root.createParticle("laser_surplus", _x, _y, 0);
}
stop();
lasertype = 1;
laserframe._alpha = 0;
_x = _root.cannon._x;
_y = _root.cannon._y;
surplusI = 0;
surplustime = 0;
lasertime = 50;
laserduration = 0;
time = 0;
time2 = 0;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_currentframe == 1) {
if (_root.slowmotion == false) {
time = time + 1;
} else {
time = time + 0.2;
}
if (time >= 20) {
gotoAndPlay (2);
}
}
this._yscale = 75 + (Math.random() * 100);
this._rotation = _root.cannon._rotation;
if (_root.slowmotion == false) {
surplustime = 0;
createSurplus();
laserduration = laserduration + 1;
} else {
surplustime = surplustime + 1;
if (surplustime == 5) {
surplustime = 0;
createSurplus();
}
laserduration = laserduration + 0.2;
}
if (laserduration > lasertime) {
if (_root.slowmotion == false) {
_alpha = (_alpha - 5);
} else {
_alpha = (_alpha - 1);
}
if (_alpha <= 5) {
_root.cannon.weaponNumber = 1;
removeMovieClip(this);
delete this.onEnterFrame;
}
} else {
_alpha = (50 + (Math.random() * 50));
}
if (detonation) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 291 MovieClip [laser] Frame 2
_root.cannon.gotoAndPlay(2);
_root.playsound("laserfire");
_root._x = _root._x - ((Math.random() * 10) + 5);
_root._y = _root._y - ((Math.random() * 10) + 5);
Symbol 291 MovieClip [laser] Frame 10
stop();
Symbol 293 MovieClip [laser_spark] Frame 1
gotoAndStop(random(_totalframes) + 1);
this._xscale = (Math.random() * 50) + 50;
this._yscale = this._xscale;
alphafade = Math.random() + 1;
speed = (Math.random() * 10) + 2;
if (dir == 1) {
angle = random(180) - 90;
}
if (dir == 2) {
angle = random(180) + 90;
}
if (dir == 3) {
angle = random(180);
}
if (dir == 4) {
angle = random(180) + 180;
}
_rotation = angle;
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
}
if ((this._alpha <= 1) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 295 MovieClip [laser_surplus] Frame 1
alphafade = (Math.random() * 4) + 3;
_x = _root.cannon._x;
_y = _root.cannon._y;
angle = _root.cannon._rotation;
firepower = 8;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 4);
this._y = this._y + (diry * 4);
angle2 = (_root.cannon._rotation + (Math.random() * 180)) - 90;
firepower = (Math.random() * 8) + 2;
vx = Math.cos((angle2 * Math.PI) / 180) * firepower;
vy = Math.sin((angle2 * Math.PI) / 180) * firepower;
_xscale = ((Math.random() * 150) + 1);
_yscale = _xscale;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - alphafade);
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 1) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 296 MovieClip [laser_trail] Frame 1
alphafade = 10;
_alpha = 30;
this.onEnterFrame = function () {
if (_root.slowmotion == false) {
_alpha = (_alpha - alphafade);
} else {
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 2) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 299 MovieClip Frame 1
stop();
Symbol 299 MovieClip Frame 20
stop();
Symbol 302 MovieClip Frame 1
stop();
Symbol 302 MovieClip Frame 20
removeMovieClip(_parent);
delete _parent.onEnterFrame;
Symbol 318 MovieClip [powerup] Frame 1
stop();
vert = 0;
color0 = 16751052 /* 0xFF99CC */;
color1 = 39423;
color2 = 16750848 /* 0xFF9900 */;
color6 = 65280;
color3 = 3355443 /* 0x333333 */;
color10 = 13421772 /* 0xCCCCCC */;
color7 = 16737792 /* 0xFF6600 */;
color11 = 39219;
color8 = 16763904 /* 0xFFCC00 */;
color9 = 10040217 /* 0x993399 */;
color4 = 65433;
color5 = 255;
color12 = 16711680 /* 0xFF0000 */;
goodie = random(11) + 1;
if (_root.boss) {
goodie = random(10) + 1;
}
_xscale = 50;
_yscale = 50;
if (_root.playerhealth <= 300) {
goodie = 0;
}
color = black;
switch (goodie) {
case 0 :
color = color0;
break;
case 1 :
color = color2;
break;
case 2 :
color = color3;
break;
case 3 :
color = color4;
break;
case 4 :
color = color5;
break;
case 5 :
color = color6;
break;
case 6 :
color = color7;
break;
case 7 :
color = color8;
break;
case 8 :
color = color9;
break;
case 9 :
color = color10;
break;
case 10 :
color = color11;
break;
case 11 :
color = color12;
}
labellabel.gotoAndStop(goodie + 1);
asdf = new Color(this);
asdf.setRGB(color);
pickedup = false;
if ((((_x < 20) || (_x > 580)) || (_y < 20)) || (_y > 580)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
time = 0;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (box.hitTest(_root.cannon) && (!pickedup)) {
_root.playerscore = _root.playerscore + 1000;
_root.powercollect = _root.powercollect + 1;
pickedup = true;
i = 0;
while (i < 10) {
_root.createParticle("powerupburst", _x, _y, 0);
qwer = new Color(_root["particle" + _root.pDEPTH]);
qwer.setRGB(color);
i++;
}
switch (goodie) {
case 0 :
_root.playerhealth = _root.playerhealth + 1000;
break;
case 1 :
_root.cannon.weaponNumber = 2;
_root.cannon.weaponAmmo = 50;
break;
case 2 :
_root.cannon.weaponNumber = 3;
_root.cannon.weaponAmmo = 30;
break;
case 3 :
_root.cannon.weaponNumber = 4;
_root.cannon.weaponAmmo = 50;
break;
case 4 :
_root.cannon.weaponNumber = 5;
_root.cannon.weaponAmmo = 30;
break;
case 5 :
_root.cannon.weaponNumber = 6;
_root.cannon.weaponAmmo = 20;
break;
case 6 :
_root.cannon.weaponNumber = 7;
_root.cannon.weaponAmmo = 10;
break;
case 7 :
_root.cannon.weaponNumber = 8;
_root.cannon.weaponAmmo = 150;
break;
case 8 :
_root.cannon.weaponNumber = 9;
_root.cannon.weaponAmmo = 100;
break;
case 9 :
_root.cannon.weaponNumber = 10;
_root.cannon.weaponAmmo = 80;
break;
case 10 :
_root.cannon.weaponNumber = 11;
_root.cannon.weaponAmmo = 80;
break;
case 11 :
_root.cannon.weaponNumber = 12;
_root.cannon.weaponAmmo = 1;
}
ring.gotoAndPlay(2);
glow.gotoAndPlay(2);
box._alpha = 0;
}
if (time > 700) {
pickedup = true;
time = 0;
box._alpha = 0;
labellabel._alpha = 0;
ring.gotoAndPlay(2);
glow.gotoAndPlay(2);
}
if (!_root.slowmotion) {
if (vert == 0) {
box._xscale = box._xscale + 1;
} else {
box._xscale = box._xscale - 1;
}
box._rotation = box._rotation + 2.5;
ring._rotation = ring._rotation - 2.5;
time = time + 5;
} else {
if (vert == 0) {
box._xscale = box._xscale + 0.2;
} else {
box._xscale = box._xscale - 0.2;
}
box._rotation = box._rotation + 0.5;
ring._rotation = ring._rotation - 0.5;
time = time + 1;
}
box._yscale = box._xscale;
glow._xscale = box._xscale;
glow._yscale = box._yscale;
if (box._xscale <= 90) {
vert = 0;
}
if (box._xscale >= 130) {
vert = 1;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 320 MovieClip [powerupburst] Frame 1
stop();
_alpha = 30;
this._xscale = (Math.random() * 200) + 50;
this._yscale = this._xscale;
rotationspeed = random(30) - 15;
alphafade = Math.random() + 1;
speed = (Math.random() * 4) + 3;
angle = random(360);
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
this._rotation = this._rotation + rotationspeed;
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
} else {
this._rotation = this._rotation + (rotationspeed / 5);
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
}
if ((this._alpha < alphafade) || (_root.deleteALL == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 322 MovieClip [triangle] Frame 1
function destroyed() {
_root.explosion();
_root.killed = _root.killed + 1;
_root.killed2 = _root.killed2 + 1;
i = 0;
while (i < 10) {
_root.createParticle("shatter", _x, _y, 2);
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
i++;
}
myColoredObject = new Color(_root.score);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.healthbar);
myColoredObject.setRGB(myColor);
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
_root.playerscore = _root.playerscore + 200;
if (random(10) == 0) {
_root.createParticle("powerup", _x, _y, 0);
}
removeMovieClip(this);
delete this.onEnterFrame;
}
function getAngles() {
distance = Math.sqrt(Math.pow(_x - _root.cannon._x, 2) + Math.pow(_y - _root.cannon._y, 2));
closest = distance;
radians = Math.atan2(this._y - _root.cannon._y, this._x - _root.cannon._x);
angle = Math.round((radians * 180) / Math.PI);
dirx = Math.cos((angle * Math.PI) / 180) * speed;
diry = Math.sin((angle * Math.PI) / 180) * speed;
}
function createTrail() {
_root.createParticle("triangle_line", _x, _y, 1);
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
}
if (random(2) == 0) {
this._x = random(Stage.width);
if (random(2) == 0) {
this._y = -50;
} else {
this._y = Stage.height + 50;
}
} else {
this._y = random(Stage.height);
if (random(2) == 0) {
this._x = -50;
} else {
this._x = Stage.width + 50;
}
}
R = random(200) + 55;
G = random(200) + 55;
B = random(200) + 55;
myColor = (("0x" + R.toString(16)) + G.toString(16)) + B.toString(16);
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
speed = 11;
piecenumber = _root.piecenumber;
aiming = true;
time2 = 0;
firetime = 0;
burntime = random(200) + 100;
hp = 80;
_root.Bullet[_root.Bullet.length] = this;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
time = time + 1;
if (onFire) {
time2 = time2 + 5;
firetime = firetime + 5;
}
} else {
time = time + 0.2;
if (onFire) {
time2 = time2 + 1;
firetime = firetime + 1;
}
}
if (hp <= 1) {
destroyed();
}
if ((time >= 10) && (aiming == true)) {
time = 0;
aiming = false;
}
if ((time >= 30) && (aiming == false)) {
removeMovieClip("_root.line" + this._name);
time = 0;
aiming = true;
}
if (onFire) {
if (firetime >= burntime) {
destroyed();
}
if (time2 >= 15) {
time2 = 0;
_root.createParticle("fire", _x, _y, 0);
}
}
if (aiming == true) {
getAngles();
difference = _rotation - angle;
if (difference > 180) {
angle = angle + 360;
}
if (difference < -180) {
angle = angle - 360;
}
if (_root.slowmotion == true) {
this._rotation = this._rotation + ((angle - this._rotation) / 30);
_x = (_x - (dirx / 25));
_y = (_y - (diry / 25));
} else {
this._rotation = this._rotation + ((angle - this._rotation) / 5);
_x = (_x - (dirx / 10));
_y = (_y - (diry / 10));
}
} else {
if (time == 0) {
getAngles();
speedfade = 1;
}
if (_root.slowmotion == true) {
if (Math.round(time % 3) == 0) {
createTrail();
}
speedfade = speedfade - 0.001;
this._rotation = this._rotation + ((angle - this._rotation) / 30);
_x = (_x - ((dirx * speedfade) / 5));
_y = (_y - ((diry * speedfade) / 5));
} else {
createTrail();
speedfade = speedfade - 0.005;
this._rotation = this._rotation + ((angle - this._rotation) / 5);
_x = (_x - (dirx * speedfade));
_y = (_y - (diry * speedfade));
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (this.hitTest(_root.cannon._x, _root.cannon._y, true)) {
_root.playerhealth = _root.playerhealth - 150;
destroyed();
}
if (_root.wave.hitTest(this._x, this._y, true)) {
destroyed();
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
}
};
Symbol 323 MovieClip [triangle_line] Frame 1
alphafade = 20;
angle = _root.cannon._rotation;
firepower = 8;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
vx = (Math.random() * 2) - 1;
vy = (Math.random() * 2) - 1;
_rotation = (random(360) + 1);
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - alphafade);
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
_alpha = (_alpha - (alphafade / 5));
}
if (_alpha <= 2) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 326 MovieClip [pentagon] Frame 1
function destroyed() {
_root.explosion();
_root.killed = _root.killed + 1;
_root.killed2 = _root.killed2 + 1;
i = 0;
while (i < 10) {
_root.createParticle("shatter", _x, _y, 3);
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
i++;
}
myColoredObject = new Color(_root.score);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.healthbar);
myColoredObject.setRGB(myColor);
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
_root.playerscore = _root.playerscore + 300;
if (random(10) == 0) {
_root.createParticle("powerup", _x, _y, 0);
}
removeMovieClip(this);
delete this.onEnterFrame;
}
function createBarrier() {
distance = Math.sqrt(Math.pow(_x - friend._x, 2) + Math.pow(_y - friend._y, 2));
dx = friend._x - _x;
dy = friend._y - _y;
lightningrotation = (Math.atan2(dy, dx) * 180) / Math.PI;
_root.createParticle("enemylightning", _x, _y, lightningrotation);
_root["particle" + _root.pDEPTH]._xscale = distance;
}
function createLine() {
distance = Math.sqrt(Math.pow(_x - friend._x, 2) + Math.pow(_y - friend._y, 2));
dx = friend._x - _x;
dy = friend._y - _y;
lightningrotation = (Math.atan2(dy, dx) * 180) / Math.PI;
_root.createParticle("enemyline", _x, _y, lightningrotation);
_root["particle" + _root.pDEPTH]._xscale = distance;
}
if (random(2) == 0) {
this._x = random(Stage.width);
if (random(2) == 0) {
this._y = -50;
} else {
this._y = Stage.height + 50;
}
} else {
this._y = random(Stage.height);
if (random(2) == 0) {
this._x = -50;
} else {
this._x = Stage.width + 50;
}
}
pointworth = 20;
enemytype = 3;
R = random(200) + 55;
G = random(200) + 55;
B = random(200) + 55;
myColor = (("0x" + R.toString(16)) + G.toString(16)) + B.toString(16);
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
randomrotation = (Math.random() * 10) - 5;
piecenumber = _root.piecenumber;
health = 2;
vx = (Math.random() * 2) + 1;
vy = (Math.random() * 2) + 1;
time = 0;
time2 = 0;
time3 = 0;
firetime = 0;
burntime = random(400) + 200;
hp = 200;
activated = false;
_root.Bullet[_root.Bullet.length] = this;
if (_x > 600) {
vx = vx * -1;
}
if (_y > 600) {
vy = vy * -1;
}
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (friend._alpha > 0) {
if (time2 > 250) {
createBarrier();
} else {
createLine();
}
}
if (_root.slowmotion == true) {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
_rotation = (_rotation + (randomrotation / 5));
if (onFire) {
time = time + 1;
firetime = firetime + 1;
}
if (!activated) {
time3 = time3 + 1;
}
time2 = time2 + 1;
} else {
_x = (_x + vx);
_y = (_y + vy);
_rotation = (_rotation + randomrotation);
if (onFire) {
time = time + 5;
firetime = firetime + 5;
}
if (!activated) {
time3 = time3 + 5;
}
time2 = time2 + 5;
}
if ((((_x >= 10) && (_x <= 590)) && (_y >= 10)) && (_y <= 590)) {
activated = true;
}
if (hp <= 1) {
destroyed();
}
if (onFire) {
if (firetime >= burntime) {
destroyed();
}
if (time >= 15) {
time = 0;
_root.createParticle("fire", _x, _y, 0);
}
}
if (activated) {
if (_x < 10) {
vx = vx * -1;
}
_x + 3;
if (_x > 590) {
vx = vx * -1;
}
_x - 3;
if (_y < 10) {
vy = vy * -1;
}
_y + 3;
if (_y > 590) {
vy = vy * -1;
}
_y - 3;
}
if ((time3 > 300) && (!activated)) {
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (this.hitTest(_root.cannon._x, _root.cannon._y, true)) {
_root.playerhealth = _root.playerhealth - 100;
destroyed();
}
if (_root.wave.hitTest(this._x, this._y, true)) {
destroyed();
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
}
};
Symbol 328 MovieClip [enemyline] Frame 1
_alpha = 50;
alphafade = 100;
this.onEnterFrame = function () {
_alpha = (_alpha - alphafade);
if (_alpha <= 1) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
Symbol 330 MovieClip [cannonspark] Frame 1
_alpha = 80;
this._xscale = (Math.random() * 100) + 50;
this._yscale = this._xscale;
rotationspeed = random(30) - 15;
alphafade = Math.random() + 1;
speed = (Math.random() * 20) + 10;
angle = random(360);
_rotation = angle;
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
}
if ((this._alpha < alphafade) || (_root.deleteall)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 335 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 10
_parent.shootlaser = true;
Symbol 335 MovieClip Frame 11
_parent.shootlaser = false;
Symbol 335 MovieClip Frame 25
gotoAndStop (1);
Symbol 336 MovieClip [hexagon] Frame 1
function firelaser() {
_root.playsound("badlaser");
_root.createParticle("enemylaser", _x, _y, _rotation - 180);
}
function destroyed() {
_root.explosion();
_root.killed = _root.killed + 1;
_root.killed2 = _root.killed2 + 1;
i = 0;
while (i < 10) {
_root.createParticle("shatter", _x, _y, 5);
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
i++;
}
myColoredObject = new Color(_root.score);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.healthbar);
myColoredObject.setRGB(myColor);
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
_root.playerscore = _root.playerscore + 500;
if (random(10) == 0) {
_root.createParticle("powerup", _x, _y, 0);
}
removeMovieClip(this);
delete this.onEnterFrame;
}
if (random(2) == 0) {
this._x = random(Stage.width);
if (random(2) == 0) {
this._y = -50;
} else {
this._y = Stage.height + 50;
}
} else {
this._y = random(Stage.height);
if (random(2) == 0) {
this._x = -50;
} else {
this._x = Stage.width + 50;
}
}
R = random(200) + 55;
G = random(200) + 55;
B = random(200) + 55;
myColor = (("0x" + R.toString(16)) + G.toString(16)) + B.toString(16);
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
hp = 100;
speed = Math.random() + 1;
time = 0;
time2 = random(300);
firetime = 0;
burntime = random(200) + 100;
safezone = 170 + (Math.random() * 40);
_root.Bullet[_root.Bullet.length] = this;
this.onEnterFrame = function () {
if ((!_root.gamePaused) && (!freeze)) {
if (shootlaser) {
firelaser();
}
radians = Math.atan2(this._y - _root.cannon._y, this._x - _root.cannon._x);
angle = Math.round((radians * 180) / Math.PI);
dirx = Math.cos((angle * Math.PI) / 180) * speed;
diry = Math.sin((angle * Math.PI) / 180) * speed;
difference = _rotation - angle;
if (difference > 180) {
angle = angle + 360;
}
if (difference < -180) {
angle = angle - 360;
}
if (_root.slowmotion == true) {
if (anim._currentframe == 1) {
this._rotation = this._rotation + ((angle - this._rotation) / 30);
}
_x = (_x + (((_root.cannon._x + (dirx * safezone)) - _x) / 250));
_y = (_y + (((_root.cannon._y + (diry * safezone)) - _y) / 250));
} else {
if (anim._currentframe == 1) {
this._rotation = this._rotation + ((angle - this._rotation) / 6);
}
_x = (_x + (((_root.cannon._x + (dirx * safezone)) - _x) / 50));
_y = (_y + (((_root.cannon._y + (diry * safezone)) - _y) / 50));
}
if (hp <= 1) {
destroyed();
}
if (_root.slowmotion == true) {
_x = (_x - (dirx / 5));
_y = (_y - (diry / 5));
_rotation = (_rotation + (randomrotation / 5));
if (onFire) {
time = time + 1;
firetime = firetime + 1;
}
time2 = time2 + 1;
} else {
time2 = time2 + 5;
_x = (_x - dirx);
_y = (_y - diry);
_rotation = (_rotation + randomrotation);
if (onFire) {
time = time + 5;
firetime = firetime + 5;
}
}
if (time2 >= 400) {
time2 = 0;
anim.gotoAndPlay(2);
}
if (onFire) {
if (firetime >= burntime) {
destroyed();
}
if (time >= 15) {
time = 0;
_root.createParticle("fire", _x, _y, 0);
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (this.frame.hitTest(_root.cannon._x, _root.cannon._y, true)) {
_root.playerhealth = _root.playerhealth - 100;
destroyed();
}
if (_root.wave.hitTest(this._x, this._y, true)) {
destroyed();
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
}
};
Symbol 338 MovieClip [cannonspark2] Frame 1
gotoAndStop(random(2) + 4);
_alpha = 80;
this._xscale = (Math.random() * 100) + 50;
this._yscale = this._xscale;
rotationspeed = random(30) - 15;
alphafade = Math.random() + 1;
speed = (Math.random() * 20) + 10;
angle = random(360);
_rotation = angle;
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == false) {
_x = (_x + vx);
_y = (_y + vy);
this._alpha = this._alpha - alphafade;
} else {
_x = (_x + (vx / 5));
_y = (_y + (vy / 5));
this._alpha = this._alpha - (alphafade / 5);
}
if ((this._alpha < alphafade) || (_root.deleteall == true)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 341 MovieClip Frame 9
stop();
Symbol 343 MovieClip [enemylaser] Frame 1
gotoAndStop(random(_totalframes) + 1);
_alpha = 60;
alphafade = 2;
lightning._yscale = (Math.random() * 250) + 50;
this.onEnterFrame = function () {
_alpha = (_alpha - alphafade);
if (_alpha <= 1) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (this.hitTest(_root.cannon._x, _root.cannon._y, true)) {
_root.playerhealth = _root.playerhealth - 30;
i = 0;
while (i < 3) {
_root.createParticle("cannonspark2", _root.cannon._x, _root.cannon._y, 0);
i++;
}
}
};
Symbol 345 MovieClip [shooter] Frame 1
function destroyed() {
_root.explosion();
_root.killed = _root.killed + 1;
_root.killed2 = _root.killed2 + 1;
i = 0;
while (i < 10) {
_root.createParticle("shatter", _x, _y, 5);
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
i++;
}
myColoredObject = new Color(_root.score);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.healthbar);
myColoredObject.setRGB(myColor);
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
_root.playerscore = _root.playerscore + 500;
if (random(10) == 0) {
_root.createParticle("powerup", _x, _y, 0);
}
removeMovieClip(this);
delete this.onEnterFrame;
}
if (random(2) == 0) {
this._x = random(Stage.width);
if (random(2) == 0) {
this._y = -50;
} else {
this._y = Stage.height + 50;
}
} else {
this._y = random(Stage.height);
if (random(2) == 0) {
this._x = -50;
} else {
this._x = Stage.width + 50;
}
}
R = random(200) + 55;
G = random(200) + 55;
B = random(200) + 55;
myColor = (("0x" + R.toString(16)) + G.toString(16)) + B.toString(16);
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
hp = 100;
speed = Math.random() + 1;
time = 0;
time2 = random(300);
firetime = 0;
burntime = random(200) + 100;
safezone = 170 + (Math.random() * 40);
_root.Bullet[_root.Bullet.length] = this;
this.onEnterFrame = function () {
if ((!_root.gamePaused) && (!freeze)) {
radians = Math.atan2(this._y - _root.cannon._y, this._x - _root.cannon._x);
angle = Math.round((radians * 180) / Math.PI);
dirx = Math.cos((angle * Math.PI) / 180) * speed;
diry = Math.sin((angle * Math.PI) / 180) * speed;
difference = _rotation - angle;
if (difference > 180) {
angle = angle + 360;
}
if (difference < -180) {
angle = angle - 360;
}
if (_root.slowmotion == true) {
this._rotation = this._rotation + ((angle - this._rotation) / 30);
_x = (_x + (((_root.cannon._x + (dirx * safezone)) - _x) / 250));
_y = (_y + (((_root.cannon._y + (diry * safezone)) - _y) / 250));
} else {
this._rotation = this._rotation + ((angle - this._rotation) / 6);
_x = (_x + (((_root.cannon._x + (dirx * safezone)) - _x) / 50));
_y = (_y + (((_root.cannon._y + (diry * safezone)) - _y) / 50));
}
if (hp <= 1) {
destroyed();
}
if (_root.slowmotion == true) {
_x = (_x - (dirx / 5));
_y = (_y - (diry / 5));
_rotation = (_rotation + (randomrotation / 5));
if (onFire) {
time = time + 1;
firetime = firetime + 1;
}
time2 = time2 + 1;
} else {
time2 = time2 + 5;
_x = (_x - dirx);
_y = (_y - diry);
_rotation = (_rotation + randomrotation);
if (onFire) {
time = time + 5;
firetime = firetime + 5;
}
}
if (time2 >= 100) {
time2 = 0;
_root.playsound("bossshot");
_root.createParticle("bulletE", _x, _y, _rotation + 180);
}
if (onFire) {
if (firetime >= burntime) {
destroyed();
}
if (time >= 15) {
time = 0;
_root.createParticle("fire", _x, _y, 0);
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (this.frame.hitTest(_root.cannon._x, _root.cannon._y, true)) {
_root.playerhealth = _root.playerhealth - 100;
destroyed();
}
if (_root.wave.hitTest(this._x, this._y, true)) {
destroyed();
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
}
};
Symbol 347 MovieClip [bulletE] Frame 1
angle = _rotation;
firepower = 7;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 1.2);
this._y = this._y + (diry * 1.2);
time = 0;
sparked = false;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
trail._xscale = trail._xscale + 0.1;
time = time + 1;
time2 = time2 + 1;
} else {
_x = (_x + dirx);
_y = (_y + diry);
trail._xscale = trail._xscale + 0.5;
time = time + 5;
time2 = time2 + 5;
}
if (_root.cannon.hitTest(_x, _y, true)) {
deletion = true;
_root.playerhealth = _root.playerhealth - 75;
_root.createParticle("playerhit", _x, _y, 0);
}
if ((((((time >= 1000) || (deletion)) || (_x < -20)) || (_x > 620)) || (_y < -20)) || (_y > 620)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 350 MovieClip [playerhit] Frame 20
removeMovieClip(this);
delete this.onEnterFrame;
Symbol 353 MovieClip [octagon] Frame 1
function destroyed() {
_root.explosion();
_root.killed = _root.killed + 1;
_root.killed2 = _root.killed2 + 1;
i = 0;
while (i < 10) {
_root.createParticle("shatter", _x, _y, 7);
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
i++;
}
myColoredObject = new Color(_root.score);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.healthbar);
myColoredObject.setRGB(myColor);
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
_root.playerscore = _root.playerscore + 100;
if (random(10) == 0) {
_root.createParticle("powerup", _x, _y, 0);
}
removeMovieClip(this);
delete this.onEnterFrame;
}
if (random(2) == 0) {
this._x = random(Stage.width);
if (random(2) == 0) {
this._y = -50;
} else {
this._y = Stage.height + 50;
}
} else {
this._y = random(Stage.height);
if (random(2) == 0) {
this._x = -50;
} else {
this._x = Stage.width + 50;
}
}
R = random(200) + 45;
G = random(200) + 45;
B = random(200) + 45;
myColor = (("0x" + R.toString(16)) + G.toString(16)) + B.toString(16);
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
hp = 100;
speed = Math.random() + 1;
randomrotation = (Math.random() * 20) - 10;
time = 0;
firetime = 0;
burntime = random(200) + 100;
_root.Bullet[_root.Bullet.length] = this;
this.onEnterFrame = function () {
if ((!_root.gamePaused) && (!freeze)) {
expand._xscale = expand._xscale + 5;
expand._yscale = expand._xscale;
if (hp <= 1) {
destroyed();
}
dx = _x - _root.cannon._x;
dy = _y - _root.cannon._y;
radians = Math.atan2(dy, dx);
angle = Math.round((radians * 180) / Math.PI);
dirx = Math.cos((angle * Math.PI) / 180) * speed;
diry = Math.sin((angle * Math.PI) / 180) * speed;
if (_root.slowmotion == true) {
_x = (_x - (dirx / 5));
_y = (_y - (diry / 5));
_rotation = (_rotation + (randomrotation / 5));
if (onFire) {
time = time + 1;
firetime = firetime + 1;
}
} else {
_x = (_x - dirx);
_y = (_y - diry);
_rotation = (_rotation + randomrotation);
if (onFire) {
time = time + 5;
firetime = firetime + 5;
}
}
if (onFire) {
if (firetime >= burntime) {
destroyed();
}
if (time >= 15) {
time = 0;
_root.createParticle("fire", _x, _y, 0);
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (this.hitTest(_root.cannon._x, _root.cannon._y, true)) {
_root.playerhealth = _root.playerhealth - 150;
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
destroyed();
}
if (_root.wave.hitTest(this._x, this._y, true)) {
destroyed();
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 355 MovieClip [star] Frame 1
function destroyed() {
_root.explosion();
_root.killed = _root.killed + 1;
_root.killed2 = _root.killed2 + 1;
i = 0;
while (i < 10) {
_root.createParticle("shatter", _x, _y, 6);
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
i++;
}
myColoredObject = new Color(_root.score);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.healthbar);
myColoredObject.setRGB(myColor);
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
_root.playerscore = _root.playerscore + 100;
if (random(10) == 0) {
_root.createParticle("powerup", _x, _y, 0);
}
removeMovieClip(this);
delete this.onEnterFrame;
}
if (random(2) == 0) {
this._x = random(Stage.width);
if (random(2) == 0) {
this._y = -50;
} else {
this._y = Stage.height + 50;
}
} else {
this._y = random(Stage.height);
if (random(2) == 0) {
this._x = -50;
} else {
this._x = Stage.width + 50;
}
}
R = random(200) + 45;
G = random(200) + 45;
B = random(200) + 45;
myColor = (("0x" + R.toString(16)) + G.toString(16)) + B.toString(16);
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
hp = 100;
speed = Math.random() + 4;
randomrotation = (Math.random() * 20) - 10;
time = 0;
time2 = random(200);
firetime = 0;
burntime = random(200) + 100;
movetime = false;
_root.Bullet[_root.Bullet.length] = this;
this.onEnterFrame = function () {
if ((!_root.gamePaused) && (!freeze)) {
if (hp <= 1) {
destroyed();
}
dx = _x - _root.cannon._x;
dy = _y - _root.cannon._y;
radians = Math.atan2(dy, dx);
angle = Math.round((radians * 180) / Math.PI);
dirx = Math.cos((angle * Math.PI) / 180) * speed;
diry = Math.sin((angle * Math.PI) / 180) * speed;
if (time2 > 200) {
movetime = true;
if (time2 > 400) {
movetime = false;
time2 = 0;
}
}
_alpha = 30;
frame._name = "frame2";
if (movetime) {
_alpha = 100;
frame2._name = "frame";
}
if (_root.slowmotion == true) {
if (movetime) {
_x = (_x - (dirx / 5));
_y = (_y - (diry / 5));
_rotation = (_rotation + (randomrotation / 5));
}
time2 = time2 + 1;
if (onFire) {
time = time + 1;
firetime = firetime + 1;
}
} else {
if (movetime) {
_x = (_x - dirx);
_y = (_y - diry);
_rotation = (_rotation + randomrotation);
}
time2 = time2 + 5;
if (onFire) {
time = time + 5;
firetime = firetime + 5;
}
}
if (onFire) {
if (firetime >= burntime) {
destroyed();
}
if (time >= 15) {
time = 0;
_root.createParticle("fire", _x, _y, 0);
}
}
if (movetime && (this.hitTest(_root.cannon._x, _root.cannon._y, true))) {
_root.playerhealth = _root.playerhealth - 100;
destroyed();
}
if (_root.wave.hitTest(this._x, this._y, true)) {
destroyed();
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 356 MovieClip [square_inf] Frame 1
function destroyed() {
_root.explosion();
_root.killed = _root.killed + 1;
_root.killed2 = _root.killed2 + 1;
i = 0;
while (i < 10) {
_root.createParticle("shatter", _x, _y, 1);
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
i++;
}
myColoredObject = new Color(_root.score);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.healthbar);
myColoredObject.setRGB(myColor);
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
_root.playerscore = _root.playerscore + 100;
removeMovieClip(this);
delete this.onEnterFrame;
}
if (random(2) == 0) {
this._x = random(Stage.width);
if (random(2) == 0) {
this._y = -50;
} else {
this._y = Stage.height + 50;
}
} else {
this._y = random(Stage.height);
if (random(2) == 0) {
this._x = -50;
} else {
this._x = Stage.width + 50;
}
}
R = random(200) + 45;
G = random(200) + 45;
B = random(200) + 45;
myColor = (("0x" + R.toString(16)) + G.toString(16)) + B.toString(16);
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
hp = 100;
speed = Math.random() + 3.5;
randomrotation = (Math.random() * 20) - 10;
time = 0;
firetime = 0;
burntime = random(200) + 100;
_root.Bullet[_root.Bullet.length] = this;
this.onEnterFrame = function () {
if ((!_root.gamePaused) && (!freeze)) {
if (hp <= 1) {
destroyed();
}
dx = _x - _root.cannon._x;
dy = _y - _root.cannon._y;
radians = Math.atan2(dy, dx);
angle = Math.round((radians * 180) / Math.PI);
dirx = Math.cos((angle * Math.PI) / 180) * speed;
diry = Math.sin((angle * Math.PI) / 180) * speed;
if (_root.slowmotion == true) {
_x = (_x - (dirx / 5));
_y = (_y - (diry / 5));
_rotation = (_rotation + (randomrotation / 5));
if (onFire) {
time = time + 1;
firetime = firetime + 1;
}
} else {
_x = (_x - dirx);
_y = (_y - diry);
_rotation = (_rotation + randomrotation);
if (onFire) {
time = time + 5;
firetime = firetime + 5;
}
}
if (onFire) {
if (firetime >= burntime) {
destroyed();
}
if (time >= 15) {
time = 0;
_root.createParticle("fire", _x, _y, 0);
}
}
if (this.hitTest(_root.cannon._x, _root.cannon._y, true)) {
destroyed();
}
if (_root.wave.hitTest(this._x, this._y, true)) {
destroyed();
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 361 MovieClip [boss1] Frame 1
function destroyed() {
_root.explosion();
if (!_root.wave) {
_root.createParticle("wave", _x, _y, 0);
}
_root.asdfwave = _root.asdfwave + 1;
_root.asdfcreated = 0;
_root.wavenumber.wavenumber = _root.asdfwave;
_root.wavenumber.gotoAndPlay(2);
_root.playerscore = _root.playerscore + 100000;
i = 0;
while (i < 5) {
_root.createEnemy("squareboss", _x, _y, 0);
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
_x = 300;
_y = -250;
pointworth = 10000;
bosshealth = 2000;
_root.bossbar = true;
if (random(2) == 0) {
this._x = random(Stage.width);
if (random(2) == 0) {
this._y = -150;
} else {
this._y = Stage.height + 150;
}
} else {
this._y = random(Stage.height);
if (random(2) == 0) {
this._x = -150;
} else {
this._x = Stage.width + 150;
}
}
myColor = 26367;
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
speed = Math.random() + 1;
piecenumber = _root.piecenumber;
time = 0;
time2 = 0;
time3 = -200;
rotationspeed = 8;
isBoss = true;
firemode = 2;
safezone = 190;
this.onEnterFrame = function () {
if ((!_root.gamePaused) && (!freeze)) {
bosspercent._rotation = -_rotation;
healthpercent = Math.round((bosshealth / 1000) * 100) + "%";
radians = Math.atan2(this._y - _root.cannon._y, this._x - _root.cannon._x);
angle = Math.round((radians * 180) / Math.PI);
dirx = Math.cos((angle * Math.PI) / 180) * speed;
diry = Math.sin((angle * Math.PI) / 180) * speed;
difference = _rotation - angle;
if (difference > 180) {
angle = angle + 360;
}
if (difference < -180) {
angle = angle - 360;
}
if (_root.slowmotion == true) {
if (firemode == 1) {
this._rotation = this._rotation + (rotationspeed / 5);
} else {
this._rotation = this._rotation + ((angle - this._rotation) / 50);
}
_x = (_x + (((_root.cannon._x + (dirx * safezone)) - _x) / 50));
_y = (_y + (((_root.cannon._y + (diry * safezone)) - _y) / 50));
_x = (_x + ((300 - _x) / 150));
_y = (_y + ((300 - _y) / 150));
time2 = time2 + 1;
time3 = time3 + 1;
} else {
if (firemode == 1) {
this._rotation = this._rotation + rotationspeed;
} else {
this._rotation = this._rotation + ((angle - this._rotation) / 10);
}
_x = (_x + (((_root.cannon._x + (dirx * safezone)) - _x) / 10));
_y = (_y + (((_root.cannon._y + (diry * safezone)) - _y) / 10));
_x = (_x + ((300 - _x) / 50));
_y = (_y + ((300 - _y) / 50));
time2 = time2 + 5;
time3 = time3 + 5;
}
if (bosshealth <= 1) {
destroyed();
}
if ((time3 < 800) && (time3 >= 0)) {
if (time2 >= 30) {
time2 = 0;
if (_root.Bullet.length < 20) {
_root.createEnemy("squareboss", _x, _y, 0);
}
firemode = 1;
}
}
if ((time3 > 800) && (time3 < 1200)) {
if (time2 >= 50) {
time2 = 0;
firemode = 2;
}
}
if (time3 > 1400) {
time3 = 0;
}
if (onFire) {
if (!_root.slowmotion) {
_root.bosshealth = _root.bosshealth - 2;
} else {
_root.bosshealth = _root.bosshealth - 0.4;
}
onFire = false;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
}
};
Symbol 362 MovieClip [squareboss] Frame 1
function destroyed() {
_root.explosion();
_root.killed = _root.killed + 1;
_root.killed2 = _root.killed2 + 1;
i = 0;
while (i < 10) {
_root.createParticle("shatter", _x, _y, 1);
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
i++;
}
myColoredObject = new Color(_root.score);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.healthbar);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.hud_infinity);
myColoredObject.setRGB(myColor);
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
_root.playerscore = _root.playerscore + 100;
if (random(10) == 0) {
_root.createParticle("powerup", _x, _y, 0);
}
removeMovieClip(this);
delete this.onEnterFrame;
}
R = random(200) + 45;
G = random(200) + 45;
B = random(200) + 45;
myColor = (("0x" + R.toString(16)) + G.toString(16)) + B.toString(16);
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
hp = 100;
speed = (Math.random() * 20) + 10;
speed2 = Math.random() + 6;
randomrotation = (Math.random() * 20) - 10;
time = 0;
time2 = 0;
firetime = 0;
burntime = random(200) + 100;
burstrotation = random(360);
_root.Bullet[_root.Bullet.length] = this;
this.onEnterFrame = function () {
if ((!_root.gamePaused) && (!freeze)) {
if (hp <= 1) {
destroyed();
}
if (time2 > 100) {
speed = speed2;
dx = _x - _root.cannon._x;
dy = _y - _root.cannon._y;
radians = Math.atan2(dy, dx);
angle = Math.round((radians * 180) / Math.PI);
} else {
if (!_root.slowmotion) {
speed = speed * 0.9;
} else {
speed = speed * 0.98;
}
angle = burstrotation;
}
dirx = Math.cos((angle * Math.PI) / 180) * speed;
diry = Math.sin((angle * Math.PI) / 180) * speed;
if (_root.slowmotion == true) {
_x = (_x - (dirx / 5));
_y = (_y - (diry / 5));
_rotation = (_rotation + (randomrotation / 5));
time2 = time2 + 1;
if (onFire) {
time = time + 1;
firetime = firetime + 1;
}
} else {
_x = (_x - dirx);
_y = (_y - diry);
_rotation = (_rotation + randomrotation);
time2 = time2 + 5;
if (onFire) {
time = time + 5;
firetime = firetime + 5;
}
}
if (onFire) {
if (firetime >= burntime) {
destroyed();
}
if (time >= 15) {
time = 0;
_root.createParticle("fire", _x, _y, 0);
}
}
if (this.hitTest(_root.cannon._x, _root.cannon._y, true) || (_root.deleteALL == true)) {
_root.playerhealth = _root.playerhealth - 75;
destroyed();
}
if (_root.wave.hitTest(this._x, this._y, true)) {
destroyed();
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 364 MovieClip [boss2] Frame 1
function destroyed() {
_root.explosion();
_root.playerscore = _root.playerscore + 200000;
_root.createEnemy("pentagonboss", (_x + random(20)) - 10, (_y + random(20)) - 10, 0);
_root.createEnemy("pentagonboss", (_x + random(20)) - 10, (_y + random(20)) - 10, 0);
_root.createEnemy("pentagonboss", (_x + random(20)) - 10, (_y + random(20)) - 10, 0);
_root.createEnemy("pentagonboss", (_x + random(20)) - 10, (_y + random(20)) - 10, 0);
removeMovieClip(this);
delete this.onEnterFrame;
}
_x = 300;
_y = -250;
pointworth = 10000;
bosshealth = 2000;
_root.bossbar = true;
if (random(2) == 0) {
this._x = random(Stage.width);
if (random(2) == 0) {
this._y = -150;
} else {
this._y = Stage.height + 150;
}
} else {
this._y = random(Stage.height);
if (random(2) == 0) {
this._x = -150;
} else {
this._x = Stage.width + 150;
}
}
myColor = 16750848 /* 0xFF9900 */;
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
speed = Math.random() + 1;
piecenumber = _root.piecenumber;
time = 0;
time2 = 0;
time3 = 200;
rotationspeed = 8;
isBoss = true;
firemode = 2;
safezone = 190;
this.onEnterFrame = function () {
if ((!_root.gamePaused) && (!freeze)) {
bosspercent._rotation = -_rotation;
healthpercent = Math.round((bosshealth / 1000) * 100) + "%";
radians = Math.atan2(this._y - _root.cannon._y, this._x - _root.cannon._x);
angle = Math.round((radians * 180) / Math.PI);
dirx = Math.cos((angle * Math.PI) / 180) * speed;
diry = Math.sin((angle * Math.PI) / 180) * speed;
difference = _rotation - angle;
if (difference > 180) {
angle = angle + 360;
}
if (difference < -180) {
angle = angle - 360;
}
if (_root.slowmotion == true) {
if (firemode == 1) {
this._rotation = this._rotation + (rotationspeed / 5);
} else {
this._rotation = this._rotation + ((angle - this._rotation) / 50);
}
_x = (_x + (((_root.cannon._x + (dirx * safezone)) - _x) / 50));
_y = (_y + (((_root.cannon._y + (diry * safezone)) - _y) / 50));
_x = (_x + ((300 - _x) / 150));
_y = (_y + ((300 - _y) / 150));
time2 = time2 + 1;
time3 = time3 + 1;
} else {
if (firemode == 1) {
this._rotation = this._rotation + rotationspeed;
} else {
this._rotation = this._rotation + ((angle - this._rotation) / 10);
}
_x = (_x + (((_root.cannon._x + (dirx * safezone)) - _x) / 10));
_y = (_y + (((_root.cannon._y + (diry * safezone)) - _y) / 10));
_x = (_x + ((300 - _x) / 50));
_y = (_y + ((300 - _y) / 50));
time2 = time2 + 5;
time3 = time3 + 5;
}
if (bosshealth <= 1) {
destroyed();
}
if (time3 > 400) {
time3 = 0;
if (_root.Bullet.length < 7) {
_root.playsound("shock2");
i = 0;
while (i < 3) {
_root.createEnemy("pentagonboss", (_x + random(20)) - 10, (_y + random(20)) - 10, 0);
_root.createEnemy("pentagonboss", (_x + random(20)) - 10, (_y + random(20)) - 10, 0);
_root.createEnemy("pentagonboss", (_x + random(20)) - 10, (_y + random(20)) - 10, 0);
_root["particle" + _root.eDEPTH].friend = _root["particle" + (_root.eDEPTH - 1)];
_root["particle" + (_root.eDEPTH - 1)].friend = _root["particle" + (_root.eDEPTH - 2)];
_root["particle" + (_root.eDEPTH - 2)].friend = _root["particle" + _root.eDEPTH];
i++;
}
}
}
if (onFire) {
if (!_root.slowmotion) {
_root.bosshealth = _root.bosshealth - 2;
} else {
_root.bosshealth = _root.bosshealth - 0.4;
}
onFire = false;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
}
};
Symbol 365 MovieClip [pentagonboss] Frame 1
function destroyed() {
_root.explosion();
_root.killed = _root.killed + 1;
_root.killed2 = _root.killed2 + 1;
i = 0;
while (i < 10) {
_root.createParticle("shatter", _x, _y, 3);
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
i++;
}
myColoredObject = new Color(_root.score);
myColoredObject.setRGB(myColor);
myColoredObject = new Color(_root.healthbar);
myColoredObject.setRGB(myColor);
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
_root.playerscore = _root.playerscore + 300;
if (random(10) == 0) {
_root.createParticle("powerup", _x, _y, 0);
}
removeMovieClip(this);
delete this.onEnterFrame;
}
function createBarrier() {
distance = Math.sqrt(Math.pow(_x - friend._x, 2) + Math.pow(_y - friend._y, 2));
dx = friend._x - _x;
dy = friend._y - _y;
lightningrotation = (Math.atan2(dy, dx) * 180) / Math.PI;
_root.createParticle("enemylightning", _x, _y, lightningrotation);
_root["particle" + _root.pDEPTH]._xscale = distance;
}
function createLine() {
distance = Math.sqrt(Math.pow(_x - friend._x, 2) + Math.pow(_y - friend._y, 2));
dx = friend._x - _x;
dy = friend._y - _y;
lightningrotation = (Math.atan2(dy, dx) * 180) / Math.PI;
_root.createParticle("enemyline", _x, _y, lightningrotation);
_root["particle" + _root.pDEPTH]._xscale = distance;
}
pointworth = 20;
enemytype = 3;
R = random(200) + 55;
G = random(200) + 55;
B = random(200) + 55;
myColor = (("0x" + R.toString(16)) + G.toString(16)) + B.toString(16);
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
randomrotation = (Math.random() * 10) - 5;
piecenumber = _root.piecenumber;
health = 2;
dirmulti = 1;
if (random(2) == 1) {
dirmulti = -1;
}
vx = Math.random() * 20;
vy = Math.random() * 20;
vx2 = Math.random() * 6;
vy2 = Math.random() * 6;
time = 0;
time2 = 500;
time3 = 0;
firetime = 0;
burntime = random(400) + 200;
hp = 200;
activated = true;
_root.Bullet[_root.Bullet.length] = this;
if (_x > 600) {
vx = vx * -1;
}
if (_y > 600) {
vy = vy * -1;
}
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (friend._alpha > 0) {
if (time2 > 250) {
createBarrier();
} else {
createLine();
}
}
if (_root.slowmotion == true) {
if (vx > vx2) {
vx = vx * 0.98;
}
if (vy > vy2) {
vy = vy * 0.98;
}
_x = (_x + ((vx / 5) * dirmulti));
_y = (_y + ((vy / 5) * dirmulti));
_rotation = (_rotation + (randomrotation / 5));
if (onFire) {
time = time + 1;
firetime = firetime + 1;
}
if (!activated) {
time3 = time3 + 1;
}
time2 = time2 + 1;
} else {
if (vx > vx2) {
vx = vx * 0.9;
}
if (vy > vy2) {
vy = vy * 0.9;
}
_x = (_x + (vx * dirmulti));
_y = (_y + (vy * dirmulti));
_rotation = (_rotation + randomrotation);
if (onFire) {
time = time + 5;
firetime = firetime + 5;
}
if (!activated) {
time3 = time3 + 5;
}
time2 = time2 + 5;
}
if ((((_x >= 10) && (_x <= 590)) && (_y >= 10)) && (_y <= 590)) {
activated = true;
}
if (hp <= 1) {
destroyed();
}
if (onFire) {
if (firetime >= burntime) {
destroyed();
}
if (time >= 15) {
time = 0;
_root.createParticle("fire", _x, _y, 0);
}
}
if (activated) {
if (_x < 10) {
vx = vx * -1;
}
_x + 3;
if (_x > 590) {
vx = vx * -1;
}
_x - 3;
if (_y < 10) {
vy = vy * -1;
}
_y + 3;
if (_y > 590) {
vy = vy * -1;
}
_y - 3;
}
if ((time3 > 300) && (!activated)) {
i = 0;
while (i < _root.Bullet.length) {
if (_root.Bullet[i] == this) {
_root.Bullet.splice(i, 1);
}
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (this.hitTest(_root.cannon._x, _root.cannon._y, true)) {
_root.playerhealth = _root.playerhealth - 100;
destroyed();
}
if (_root.wave.hitTest(this._x, this._y, true)) {
destroyed();
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
}
};
Symbol 369 MovieClip Frame 1
stop();
Symbol 370 MovieClip [boss3] Frame 1
function destroyed() {
_root.explosion();
if (!_root.wave) {
_root.createParticle("wave", _x, _y, 0);
}
_root.attachMovie("finalscreen1", "finalscreen1", _root.tempdepth);
_root.playerscore = _root.playerscore + 300000;
i = 0;
while (i < 15) {
_root.createEnemy("squareboss", _x, _y, 0);
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
_x = 300;
_y = -250;
pointworth = 10000;
bosshealth = 3000;
_root.bossbar = true;
if (random(2) == 0) {
this._x = random(Stage.width);
if (random(2) == 0) {
this._y = -150;
} else {
this._y = Stage.height + 150;
}
} else {
this._y = random(Stage.height);
if (random(2) == 0) {
this._x = -150;
} else {
this._x = Stage.width + 150;
}
}
myColor = 16711680 /* 0xFF0000 */;
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
speed = Math.random() + 1;
piecenumber = _root.piecenumber;
time = 0;
time2 = 0;
time3 = -200;
rotationspeed = 8;
isBoss = true;
firemode = 2;
safezone = 190;
this.onEnterFrame = function () {
if ((!_root.gamePaused) && (!freeze)) {
bosspercent._rotation = -_rotation;
healthpercent = Math.round((bosshealth / 1000) * 100) + "%";
radians = Math.atan2(this._y - _root.cannon._y, this._x - _root.cannon._x);
angle = Math.round((radians * 180) / Math.PI);
dirx = Math.cos((angle * Math.PI) / 180) * speed;
diry = Math.sin((angle * Math.PI) / 180) * speed;
difference = _rotation - angle;
if (difference > 180) {
angle = angle + 360;
}
if (difference < -180) {
angle = angle - 360;
}
if (_root.slowmotion == true) {
_x = (_x + (((_root.cannon._x + (dirx * safezone)) - _x) / 50));
_y = (_y + (((_root.cannon._y + (diry * safezone)) - _y) / 50));
_x = (_x + ((300 - _x) / 150));
_y = (_y + ((300 - _y) / 150));
time2 = time2 + 1;
time3 = time3 + 1;
} else {
_x = (_x + (((_root.cannon._x + (dirx * safezone)) - _x) / 10));
_y = (_y + (((_root.cannon._y + (diry * safezone)) - _y) / 10));
_x = (_x + ((300 - _x) / 50));
_y = (_y + ((300 - _y) / 50));
time2 = time2 + 5;
time3 = time3 + 5;
}
if (bosshealth <= 1) {
destroyed();
}
if ((time3 < 400) && (time3 >= 0)) {
if (time2 >= 20) {
bossface.gotoAndPlay(2);
time2 = 0;
_root.createParticle("boss3bullet", _x, _y, angle + 180);
playsound("wacky");
firemode = 1;
}
}
if ((time3 > 400) && (time3 < 800)) {
if (time2 >= 20) {
bossface.gotoAndPlay(2);
time2 = 0;
_root.createParticle("bossrocket", _x, _y, angle + 180);
playsound("swish2");
firemode = 3;
}
}
if ((time3 > 800) && (time3 < 1200)) {
if (time2 >= 50) {
bossface.gotoAndPlay(2);
time2 = 0;
_root.createParticle("bosslaser", _x, _y, angle + 180);
playsound("bossshot");
firemode = 2;
}
}
if (time3 > 1400) {
time3 = 0;
}
if (onFire) {
if (!_root.slowmotion) {
_root.bosshealth = _root.bosshealth - 2;
} else {
_root.bosshealth = _root.bosshealth - 0.4;
}
onFire = false;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.laser) {
if (_root.laser.hitTest(this._x, this._y, true)) {
destroyed();
}
}
}
};
Symbol 372 MovieClip [boss3bullet] Frame 1
function createSpark(dir) {
i = 0;
while (i < 3) {
if (dir == 1) {
_root.createParticle("bullet1_spark", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("bullet1_spark", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("bullet1_spark", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("bullet1_spark", _x, 600, dir);
}
myColoredObject = new Color("_root.particle" + _root.pDEPTH);
myColoredObject.setRGB(myColor);
i++;
}
}
R = random(200) + 45;
G = random(200) + 45;
B = random(200) + 45;
myColor = (("0x" + R.toString(16)) + G.toString(16)) + B.toString(16);
myColoredObject = new Color(this);
myColoredObject.setRGB(myColor);
_rotation = (_rotation + ((Math.random() * 14) - 7));
angle = _rotation;
firepower = 15;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 1.2);
this._y = this._y + (diry * 1.2);
time = 0;
sparked = false;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (_alpha < 100) {
_alpha = (_alpha + 100);
}
if (_root.slowmotion == true) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
trail._xscale = trail._xscale + 0.1;
time = time + 1;
time2 = time2 + 1;
} else {
_x = (_x + dirx);
_y = (_y + diry);
trail._xscale = trail._xscale + 0.5;
time = time + 5;
time2 = time2 + 5;
}
if (_root.cannon.hitTest(_x, _y, true)) {
deletion = true;
_root.playerhealth = _root.playerhealth - 75;
_root.createParticle("playerhit", _x, _y, 0);
}
if ((((((time >= 1000) || (deletion)) || (_x < -20)) || (_x > 620)) || (_y < -20)) || (_y > 620)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
}
};
Symbol 373 MovieClip [bosslaser] Frame 1
gotoAndStop(random(_totalframes) + 1);
_alpha = 60;
alphafade = 2;
lightning._yscale = (Math.random() * 250) + 50;
this.onEnterFrame = function () {
_alpha = (_alpha - alphafade);
if (_alpha <= 1) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (this.hitTest(_root.cannon._x, _root.cannon._y, true)) {
_root.playerhealth = _root.playerhealth - 30;
i = 0;
while (i < 3) {
_root.createParticle("cannonspark2", _root.cannon._x, _root.cannon._y, 0);
i++;
}
}
};
Symbol 375 MovieClip [bossrocket] Frame 1
function createSpark(dir) {
i = 0;
while (i < 3) {
if (dir == 1) {
_root.createParticle("bullet6_spark", 0, _y, dir);
}
if (dir == 2) {
_root.createParticle("bullet6_spark", 600, _y, dir);
}
if (dir == 3) {
_root.createParticle("bullet6_spark", _x, 0, dir);
}
if (dir == 4) {
_root.createParticle("bullet6_spark", _x, 600, dir);
}
i++;
}
removeMovieClip(this);
delete this.onEnterFrame;
}
angle = random(360);
firepower = 12;
dirx = Math.cos((angle * Math.PI) / 180) * firepower;
diry = Math.sin((angle * Math.PI) / 180) * firepower;
this._x = this._x + (dirx * 2);
this._y = this._y + (diry * 2);
Missile_speed = 10 + (Math.random() * 4);
Missile_turning_1 = 0.75 + (Math.random() / 4);
missilevx = 0;
missilevy = 0;
time = 0;
time2 = 0;
time3 = 0;
weaponType = 7;
lockon = false;
deployed = false;
this.onEnterFrame = function () {
if (!_root.gamePaused) {
if (!_root.slowmotion) {
this._rotation = this._rotation + ((angle2 - this._rotation) / 5);
time = time + 5;
time2 = time2 + 5;
time3 = time3 + 5;
if (time3 <= 50) {
_x = (_x + dirx);
_y = (_y + diry);
} else {
lockit = true;
_x = (_x + missilevx);
_y = (_y + missilevy);
}
Missile_turning = 1;
} else {
this._rotation = this._rotation + ((angle2 - this._rotation) / 30);
time = time + 1;
time2 = time2 + 1;
time3 = time3 + 1;
if (time3 <= 50) {
_x = (_x + (dirx / 5));
_y = (_y + (diry / 5));
} else {
lockit = true;
_x = (_x + (missilevx / 5));
_y = (_y + (missilevy / 5));
}
Missile_turning = 0.5;
}
closest = 10000;
if (lockit) {
closest = distance;
dx = _root.cannon._x - _x;
dy = _root.cannon._y - _y;
lockon = true;
}
if (!lockon) {
if (!deployed) {
deployed = true;
}
dx = dirx;
dy = diry;
}
if (lockon) {
lockon = false;
}
radians2 = Math.atan2(dy, dx);
angle2 = Math.round((radians2 * 180) / Math.PI);
difference = _rotation - angle2;
if (difference > 180) {
angle2 = angle2 + 360;
}
if (difference < -180) {
angle2 = angle2 - 360;
}
distance = Math.sqrt((dx * dx) + (dy * dy));
dx = dx / distance;
dy = dy / distance;
missilevx = missilevx + (dx * Missile_turning);
missilevy = missilevy + (dy * Missile_turning);
velocity = Math.sqrt((missilevx * missilevx) + (missilevy * missilevy));
if (velocity > Missile_speed) {
missilevx = (missilevx * Missile_speed) / velocity;
missilevy = (missilevy * Missile_speed) / velocity;
}
if (time2 >= 5) {
time2 = 0;
_root.createParticle("rocket_fire", _x - missilevx, _y - missilevy, 0);
}
if (time >= 1000) {
detonation = true;
}
if (_root.cannon.hitTest(_x, _y, true)) {
_root.createParticle("boss_hit_1", _x, _y, 0);
_root._x = _root._x - ((Math.random() * 4) + 2);
_root._y = _root._y - ((Math.random() * 4) + 2);
_root.playerhealth = _root.playerhealth - 50;
detonation = true;
}
if (this.detonation == true) {
removeMovieClip(this);
delete this.onEnterFrame;
}
if (_x < 0) {
createSpark(1);
}
if (_x > 600) {
createSpark(2);
}
if (_y < 0) {
createSpark(3);
}
if (_y > 600) {
createSpark(4);
}
if (_root.deleteall) {
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 416 MovieClip Frame 1
stop();
Symbol 416 MovieClip Frame 2
stopAllSounds();
Symbol 417 MovieClip Frame 1
stop();
Symbol 417 MovieClip Frame 3
stopAllSounds();
Symbol 454 MovieClip Frame 1
btn_back.tabEnabled = false;
btn_back.useHandCursor = false;
btn_back.onRelease = function () {
if (_parent._currentframe == 15) {
_parent.play();
}
};
btn_link.onRelease = function () {
getURL ("http://www.thekevingu.com", _blank);
};
link2.onRelease = function () {
getURL ("http://music.crystalcloak.com", _blank);
};
Symbol 455 MovieClip Frame 1
stop();
Symbol 455 MovieClip Frame 15
stop();
Symbol 455 MovieClip Frame 25
gotoAndStop (1);
Symbol 456 MovieClip Frame 1
stop();
Symbol 456 MovieClip Frame 10
stop();
_root.gotoAndPlay(10);
Symbol 458 MovieClip Frame 1
this.onEnterFrame = function () {
score2 = _root.playerscore;
};
Symbol 468 MovieClip Frame 1
gotoAndStop(_root.gamemode);
btn_confirm.onRelease = function () {
_root.gamePaused = false;
this.enabled = false;
Mouse.hide();
};
this.onEnterFrame = function () {
if (btn_confirm.enabled == false) {
_root.cannon._alpha = _root.cannon._alpha + 10;
_alpha = (_alpha - 10);
if (_alpha <= 0) {
_root.cannon._alpha = 100;
if (_root.gamemode == 1) {
_root.wavenumber.gotoAndPlay(2);
}
this.swapDepths(_root.tempdepth);
removeMovieClip(this);
delete this.onEnterFrame;
}
}
};
Symbol 476 MovieClip Frame 1
stop();
Symbol 476 MovieClip Frame 100
stop();