Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
function sitelock(url_to_lock) {
domain_parts = _url.split("://");
real_domain = domain_parts[1].split("/");
domain.text = real_domain[0];
if (real_domain[0] != url_to_lock) {
_root._alpha = 0;
}
}
function clearLevel() {
s_gamemusic.stop();
removeMovieClip(mcMadeby);
removeMovieClip(mcBonusBeat);
removeMovieClip(mcMute);
removeMovieClip(mcMainMenu);
removeMovieClip(mcUpgrade);
removeMovieClip(mcBgLayer6);
removeMovieClip(mcBgLayer5);
removeMovieClip(mcBgLayer4);
removeMovieClip(mcBgLayer3);
removeMovieClip(mcBgLayer2);
removeMovieClip(mcBgLayer1);
removeMovieClip(mcPlayer);
removeMovieClip(mcHud);
removeMovieClip(mcBomb);
removeMovieClip(mcBombExplosion);
removeMovieClip(mcFinal);
removeMovieClip(mcCutscene);
if (turretcount != undefined) {
i = 0;
while (i <= turretcount) {
removeMovieClip(_root["mcEnemy" + i]);
i++;
}
i = 0;
while (i <= bulletcount) {
removeMovieClip(_root["mcBullet" + i]);
i++;
}
i = 0;
while (i <= popcount) {
removeMovieClip(_root["mcPop" + i]);
i++;
}
turretcount = 0;
popcount = 0;
bulletcount = 0;
}
}
__com_mochibot__("c7bcf75c", this, 10301, true);
if (firsttime == undefined) {
firsttime = true;
}
if (bonuslevel == undefined) {
bonuslevel = false;
}
if (invincibility == undefined) {
invincibility = false;
}
clearLevel();
attachMovie("mainmenu", "mcMainMenu", _root.getNextHighestDepth());
stop();
fscommand ("showmenu", "false");
onEnterFrame = function () {
};
mcMainMenu.mcSite.onRelease = function () {
getURL ("http://www.jeux-internet.com/");
};
mcMainMenu.mcPlay.onRollOver = function () {
if (firsttime == false) {
_root.s_beep.start(0, 0);
}
};
mcMainMenu.mcPlay.onRelease = function () {
if (firsttime == false) {
nextFrame();
}
};
mcMainMenu.mcBonus.onRelease = function () {
if (bonuslevel == false) {
mcMainMenu.mcNoBonus.play();
} else {
levelfinished = true;
skiptobonus = true;
gotoAndStop (3);
}
};
if (s_shoot == undefined) {
s_shoot = new Sound();
s_shoot.attachSound("shoot.mp3");
s_shoot2 = new Sound();
s_shoot2.attachSound("shoot2.mp3");
s_rocket = new Sound();
s_rocket.attachSound("rocket.mp3");
s_rocket2 = new Sound();
s_rocket2.attachSound("rocket2.mp3");
s_rocket3 = new Sound();
s_rocket3.attachSound("rocket3.mp3");
s_explosion = new Sound();
s_explosion.attachSound("explosion.mp3");
s_explosion2 = new Sound();
s_explosion2.attachSound("explosion2.mp3");
s_explosion3 = new Sound();
s_explosion3.attachSound("explosion3.mp3");
s_hit = new Sound();
s_hit.attachSound("hit.mp3");
s_laser = new Sound();
s_laser.attachSound("laser.mp3");
s_lasercharge = new Sound();
s_lasercharge.attachSound("lasercharge.mp3");
s_beep = new Sound();
s_beep.attachSound("beep.mp3");
s_cashregister = new Sound();
s_cashregister.attachSound("cashregister.mp3");
s_repair = new Sound();
s_repair.attachSound("repair.mp3");
s_victory = new Sound();
s_victory.attachSound("victory.wav");
s_mainmenu = new Sound();
s_mainmenu.attachSound("mainmenu.mp3");
s_upgrade = new Sound();
s_upgrade.attachSound("upgrade.mp3");
s_gamemusic = new Sound();
s_gamemusic.attachSound("gamemusic.mp3");
}
s_mainmenu.stop();
if (firsttime == false) {
s_mainmenu.start(0, 99999999);
}
if (mcMute == undefined) {
attachMovie("mute", "mcMute", _root.getNextHighestDepth());
}
mcMute._x = 563;
mcMute._y = 283;
mcMute.swapDepths(_root.getNextHighestDepth());
_root.muted = false;
_root.mcMute.onRelease = function () {
if (firsttime == false) {
if (_root.muted == false) {
_root.muted = true;
_root.s_mainmenu.setVolume(0);
} else {
_root.muted = false;
_root.s_mainmenu.setVolume(100);
}
}
};
if (firsttime == true) {
attachMovie("madeby", "mcMadeby", _root.getNextHighestDepth());
}
Frame 2
clearLevel();
attachMovie("cutscene", "mcCutscene", _root.getNextHighestDepth());
stop();
Frame 3
function startGame() {
ppp = false;
hitpoints = 100;
parts = 0;
power1unlocked = 0;
power2unlocked = 0;
power3unlocked = 0;
}
function turretstart(type, xx) {
if (type == -3) {
movie = "mcEnemy" + turretcount;
attachMovie("crateEight", movie, _root.getNextHighestDepth());
_root[movie].payout = false;
_root[movie]._x = xx;
_root[movie]._y = 270;
_root[movie]._xscale = _root[movie]._xscale * 0.6;
_root[movie]._yscale = _root[movie]._yscale * 0.6;
_root[movie].onEnterFrame = function () {
if ((startmovetimer < 0) && (ppp == false)) {
this._x = this._x - enemyspeed;
}
if ((this.hitTest(mcPlayer.mc) == true) && (this.payout == false)) {
parts = parts + 750;
partsgained = partsgained + 750;
this.play();
this.payout = true;
}
};
turretcount = turretcount + 1;
}
if (type == -2) {
movie = "mcEnemy" + turretcount;
attachMovie("crateThree", movie, _root.getNextHighestDepth());
_root[movie].payout = false;
_root[movie]._x = xx;
_root[movie]._y = 270;
_root[movie]._xscale = _root[movie]._xscale * 0.7;
_root[movie]._yscale = _root[movie]._yscale * 0.7;
_root[movie].onEnterFrame = function () {
if ((startmovetimer < 0) && (ppp == false)) {
this._x = this._x - enemyspeed;
}
if ((this.hitTest(mcPlayer.mc) == true) && (this.payout == false)) {
parts = parts + 400;
partsgained = partsgained + 400;
this.play();
this.payout = true;
}
};
turretcount = turretcount + 1;
}
if (type == -1) {
movie = "mcEnemy" + turretcount;
attachMovie("crateOne", movie, _root.getNextHighestDepth());
_root[movie].payout = false;
_root[movie]._x = xx;
_root[movie]._y = 270;
_root[movie]._xscale = _root[movie]._xscale * 0.8;
_root[movie]._yscale = _root[movie]._yscale * 0.8;
_root[movie].onEnterFrame = function () {
if ((startmovetimer < 0) && (ppp == false)) {
this._x = this._x - enemyspeed;
}
if ((this.hitTest(mcPlayer.mc) == true) && (this.payout == false)) {
parts = parts + 150;
partsgained = partsgained + 150;
this.play();
this.payout = true;
}
};
turretcount = turretcount + 1;
}
if (type == 0) {
movie = "mcEnemy" + turretcount;
attachMovie("endlevel", movie, _root.getNextHighestDepth());
_root[movie]._x = xx;
_root[movie]._y = 270;
_root[movie].started = false;
_root[movie].onEnterFrame = function () {
if ((startmovetimer < 0) && (ppp == false)) {
this._x = this._x - enemyspeed;
}
if ((mcPlayer._x > this._x) && (this.started == false)) {
_root.s_gamemusic.stop();
_root.s_victory.start(0, 0);
this.started = true;
}
if (((this.started == true) && (startmovetimer < -2)) && (ppp == false)) {
startmovetimer = 80;
this.currenthp = hitpoints;
}
if ((this.started == true) && (startmovetimer < 80)) {
hitpoints = this.currenthp;
mcPlayer._rotation = mcPlayer._rotation * 0.9;
}
if ((this.started == true) && (startmovetimer <= 0)) {
endLevel();
}
};
turretcount = turretcount + 1;
}
if (type == 1) {
movie = "mcEnemy" + turretcount;
attachMovie("enemyturret", movie, _root.getNextHighestDepth());
_root[movie]._x = xx;
_root[movie]._y = 270;
_root[movie].timermax = 6;
_root[movie].timer = random(_root[movie].timermax);
_root[movie].timer = _root[movie].timer + (_root[movie].timermax * 15);
_root[movie].onEnterFrame = function () {
if (ppp == false) {
this.timer = this.timer - 1;
if (((this.timer <= 0) && (this._x < 590)) && (hitpoints > 0)) {
shoot(1, this._x, this._y - 22);
this.mc.play();
this.swapDepths(_root.getNextHighestDepth());
this.timer = this.timermax;
if (random(100) > 80) {
this.timer = this.timermax * 15;
}
}
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
if ((this.timer < 7) || (this.timer > (this.timermax - 7))) {
this.mc._rotation = (Math.atan2(mcPlayer._y - this._y, (mcPlayer._x + 55) - this._x) * 180) / Math.PI;
}
this.mc._yscale = -100;
if ((this.mc._rotation > -180) && (this.mc._rotation < -90)) {
this.mc._yscale = 100;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this.hitTest(mcBombExplosion.mc) == true) {
pop(2, this._x, this._y, 1);
this.removeMovieClip(this);
}
}
};
turretcount = turretcount + 1;
}
if (type == 2) {
movie = "mcEnemy" + turretcount;
attachMovie("enemysam", movie, _root.getNextHighestDepth());
_root[movie]._x = xx;
_root[movie]._y = 270;
_root[movie].timermax = 140;
_root[movie].timer = random(_root[movie].timermax);
_root[movie].timer = _root[movie].timer + _root[movie].timermax;
_root[movie].onEnterFrame = function () {
if (ppp == false) {
this.timer = this.timer - 1;
if (((this.timer <= 0) && (this._x < 590)) && (hitpoints > 0)) {
shoot(2, this._x, this._y - 32);
shoot(2, this._x, this._y - 35);
this.mc.play();
this.swapDepths(_root.getNextHighestDepth());
this.timer = this.timermax + random(70);
}
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this.mc._rotation = (Math.atan2(mcPlayer._y - this._y, (mcPlayer._x + 55) - this._x) * 180) / Math.PI;
this.mc._yscale = -100;
if ((this.mc._rotation > -180) && (this.mc._rotation < -90)) {
this.mc._yscale = 100;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this.hitTest(mcBombExplosion.mc) == true) {
pop(2, this._x, this._y, 1);
this.removeMovieClip(this);
}
}
};
turretcount = turretcount + 1;
}
if (type == 3) {
movie = "mcEnemy" + turretcount;
attachMovie("enemylaser", movie, _root.getNextHighestDepth());
_root[movie].named = movie;
_root[movie]._x = xx;
_root[movie]._y = 273;
_root[movie].timermax = 130;
_root[movie].timer = 29;
_root[movie].timer = _root[movie].timer + _root[movie].timermax;
_root[movie].onEnterFrame = function () {
if (ppp == false) {
this.timer = this.timer - 1;
if (this._x > 605) {
this.timer = this.timermax;
}
if ((this.timer == 28) && (hitpoints > 0)) {
_root.s_lasercharge.start(0, 0);
this.mc.play();
this.swapDepths(_root.getNextHighestDepth());
}
if (this.timer <= 0) {
if ((this._x < 590) && (hitpoints > 0)) {
shoot(3, this._x, this._y - 15);
_root["mcBullet" + (bulletcount - 1)].own = this.named;
}
this.timer = this.timermax + random(70);
this.swapDepths(_root.getNextHighestDepth());
}
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
if (((this.timer > 20) && (this.timer < (this.timermax - 29))) && (hitpoints > 0)) {
this.dir = (Math.atan2(mcPlayer._y - this._y, (mcPlayer._x + 20) - this._x) * 180) / Math.PI;
this.mc._rotation = this.dir;
}
this.mc._yscale = -100;
if ((this.mc._rotation > -180) && (this.mc._rotation < -90)) {
this.mc._yscale = 100;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this.hitTest(mcBombExplosion.mc) == true) {
pop(2, this._x, this._y, 1);
this.removeMovieClip(this);
}
}
};
supersize = (Math.random() / 6) + 1;
_root[nm]._xscale = _root[nm]._xscale * supersize;
_root[nm]._yscale = _root[nm]._yscale * supersize;
turretcount = turretcount + 1;
}
if (type == 4) {
movie = "mcEnemy" + turretcount;
attachMovie("enemystorm", movie, _root.getNextHighestDepth());
_root[movie]._x = xx;
_root[movie]._y = 275;
_root[movie].timermax = 5;
_root[movie].timer = random(_root[movie].timermax);
_root[movie].timer = _root[movie].timer + (_root[movie].timermax * 15);
_root[movie].onEnterFrame = function () {
if (ppp == false) {
this.timer = this.timer - 1;
if (((this.timer <= 0) && (this._x < 590)) && (hitpoints > 0)) {
shoot(4, this._x + (random(10) - 5), this._y - 22);
this.body.play();
this.swapDepths(_root.getNextHighestDepth());
this.timer = this.timermax;
if (random(100) > 90) {
this.timer = this.timermax * 20;
}
}
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this.hitTest(mcBombExplosion.mc) == true) {
pop(2, this._x, this._y, 1);
this.removeMovieClip(this);
}
}
};
turretcount = turretcount + 1;
}
if (type == 5) {
movie = "mcEnemy" + turretcount;
attachMovie("enemysoldier", movie, _root.getNextHighestDepth());
_root[movie]._x = xx;
_root[movie]._y = 270;
_root[movie].timermax = 45;
_root[movie].timer = random(_root[movie].timermax);
_root[movie].timer = _root[movie].timer + (_root[movie].timermax * 2);
_root[movie].onEnterFrame = function () {
if (ppp == false) {
this.timer = this.timer - 1;
if (((this.timer <= 0) && (this._x < 590)) && (hitpoints > 0)) {
shoot(5, this._x, this._y - 10);
this.mc.play();
this.swapDepths(_root.getNextHighestDepth());
this.timer = this.timermax;
if (random(100) > 95) {
this.timer = this.timermax * 3;
}
}
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
if ((this.timer < 7) || (this.timer > (this.timermax - 7))) {
this.mc._rotation = (Math.atan2(mcPlayer._y - this._y, (mcPlayer._x + 55) - this._x) * 180) / Math.PI;
}
this.mc._yscale = -100;
this.body._xscale = -100;
if ((this.mc._rotation > -180) && (this.mc._rotation < -90)) {
this.mc._yscale = 100;
this.body._xscale = 100;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this.hitTest(mcBombExplosion.mc) == true) {
this.removeMovieClip(this);
}
}
};
turretcount = turretcount + 1;
}
if (type == 6) {
movie = "mcEnemy" + turretcount;
attachMovie("enemyrocketman", movie, _root.getNextHighestDepth());
_root[movie]._x = xx;
_root[movie]._y = 270;
_root[movie].timermax = 80;
_root[movie].timer = random(_root[movie].timermax);
_root[movie].timer = _root[movie].timer + (_root[movie].timermax * 2);
_root[movie].onEnterFrame = function () {
if (ppp == false) {
this.timer = this.timer - 1;
if (((this.timer <= 0) && (this._x < 590)) && (hitpoints > 0)) {
shoot(6, this._x, this._y - 10);
this.mc.play();
this.swapDepths(_root.getNextHighestDepth());
this.timer = this.timermax;
if (random(100) > 95) {
this.timer = this.timermax * 3;
}
}
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
if ((this.timer < 7) || (this.timer > (this.timermax - 7))) {
this.mc._rotation = (Math.atan2(mcPlayer._y - this._y, (mcPlayer._x + 55) - this._x) * 180) / Math.PI;
}
this.mc._yscale = -100;
this.body._xscale = -100;
if ((this.mc._rotation > -180) && (this.mc._rotation < -90)) {
this.mc._yscale = 100;
this.body._xscale = 100;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this.hitTest(mcBombExplosion.mc) == true) {
pop(2, this._x, this._y, 0.4);
this.removeMovieClip(this);
}
}
};
turretcount = turretcount + 1;
}
if (type == 7) {
movie = "mcEnemy" + turretcount;
attachMovie("enemygrenadier", movie, _root.getNextHighestDepth());
_root[movie]._x = xx;
_root[movie]._y = 270;
_root[movie].timermax = 90;
_root[movie].timer = _root[movie].timermax;
_root[movie].timer = _root[movie].timer + _root[movie].timermax;
_root[movie].onEnterFrame = function () {
if (ppp == false) {
this.timer = this.timer - 1;
if (this._x > 605) {
this.timer = this.timermax;
}
if ((this.timer == 15) && (hitpoints > 0)) {
this.mc.play();
this.swapDepths(_root.getNextHighestDepth());
}
if (this.timer <= 0) {
if ((this._x < 590) && (hitpoints > 0)) {
shoot(7, this._x, this._y - 6);
}
this.timer = this.timermax + random(20);
this.swapDepths(_root.getNextHighestDepth());
}
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this.dir = (Math.atan2(mcPlayer._y - this._y, (mcPlayer._x + 30) - this._x) * 180) / Math.PI;
this.mc._rotation = this.dir;
this.mc._yscale = -100;
this.body._xscale = -100;
if ((this.mc._rotation > -180) && (this.mc._rotation < -90)) {
this.mc._yscale = 100;
this.body._xscale = 100;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this.hitTest(mcBombExplosion.mc) == true) {
pop(2, this._x, this._y, 0.2);
this.removeMovieClip(this);
}
}
};
turretcount = turretcount + 1;
}
if (type == 8) {
movie = "mcEnemy" + turretcount;
attachMovie("enemylauncher", movie, _root.getNextHighestDepth());
_root[movie]._x = xx;
_root[movie]._y = 270;
_root[movie].timermax = 90;
_root[movie].timer = 90;
_root[movie].timer = _root[movie].timer + _root[movie].timermax;
_root[movie].onEnterFrame = function () {
if (ppp == false) {
this.timer = this.timer - 1;
if (this._x > 605) {
this.timer = this.timermax;
}
if (this.timer == 15) {
if ((this._x < 590) && (hitpoints > 0)) {
shoot(8, this._x, this._y - 14);
this.mc.play();
}
this.swapDepths(_root.getNextHighestDepth());
}
if (this.timer <= 0) {
if ((this._x < 590) && (hitpoints > 0)) {
shoot(8, this._x, this._y - 19);
}
this.timer = this.timermax + random(20);
this.swapDepths(_root.getNextHighestDepth());
}
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this.dir = (Math.atan2(mcPlayer._y - this._y, (mcPlayer._x + 30) - this._x) * 180) / Math.PI;
this.mc._rotation = this.dir;
this.mc._yscale = -100;
if ((this.mc._rotation > -180) && (this.mc._rotation < -90)) {
this.mc._yscale = 100;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this.hitTest(mcBombExplosion.mc) == true) {
hitpoints = hitpoints - 3;
pop(2, this._x, this._y, 0.9);
this.removeMovieClip(this);
}
}
};
turretcount = turretcount + 1;
}
}
function shoot(type, xx, yy) {
if (type == 1) {
_root.s_shoot2.start(0, 0);
nm = "mcBullet" + bulletcount;
attachMovie("bullets", nm, _root.getNextHighestDepth());
_root[nm]._x = xx;
_root[nm]._y = yy;
_root[nm]._xscale = _root[nm]._xscale * 0.75;
_root[nm]._yscale = _root[nm]._yscale * 0.75;
_root[nm].dir = (random(10) - 5) + ((Math.atan2(mcPlayer._y - _root[nm]._y, (mcPlayer._x + 55) - _root[nm]._x) * 180) / Math.PI);
_root[nm]._rotation = _root[nm].dir;
_root[nm].spd = 6;
_root[nm].xspeed = _root[nm].spd * Math.cos((_root[nm].dir * Math.PI) / 180);
_root[nm].yspeed = _root[nm].spd * Math.sin((_root[nm].dir * Math.PI) / 180);
_root[nm].onEnterFrame = function () {
if (ppp == false) {
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this.xspeed = this.xspeed * 1.01;
this.yspeed = this.yspeed * 1.01;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this._x > 630) {
this.removeMovieClip(this);
}
if (this._y < -30) {
this.removeMovieClip(this);
}
if (this._y > 280) {
this.removeMovieClip(this);
}
if (this.hitTest(mcPlayer.mc) == true) {
pop(1, this._x, this._y, 1);
hitpoints = hitpoints - 3;
this.removeMovieClip(this);
}
};
}
if (type == 2) {
_root.s_rocket3.start(0, 0);
nm = "mcBullet" + bulletcount;
attachMovie("enemysammissile", nm, _root.getNextHighestDepth());
_root[nm]._x = xx;
_root[nm]._y = yy;
_root[nm]._xscale = _root[nm]._xscale * 0.65;
_root[nm]._yscale = _root[nm]._yscale * 0.5;
_root[nm].dir = (random(10) - 5) + ((Math.atan2(mcPlayer._y - _root[nm]._y, (mcPlayer._x + 55) - _root[nm]._x) * 180) / Math.PI);
_root[nm]._rotation = _root[nm].dir;
_root[nm].spd = 6;
_root[nm].xspeed = _root[nm].spd * Math.cos((_root[nm].dir * Math.PI) / 180);
_root[nm].yspeed = _root[nm].spd * Math.sin((_root[nm].dir * Math.PI) / 180);
_root[nm].onEnterFrame = function () {
if (ppp == false) {
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this.xspeed = this.xspeed * 1.01;
this.yspeed = this.yspeed * 1.01;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this._x > 630) {
this.removeMovieClip(this);
}
if (this._y < -30) {
this.removeMovieClip(this);
}
if (this._y > 280) {
pop(2, this._x, this._y, 0.8);
this.removeMovieClip(this);
}
if (this.hitTest(mcPlayer.mc) == true) {
_root.s_explosion.start(0, 0);
pop(2, this._x, this._y, 0.7);
hitpoints = hitpoints - 3;
this.removeMovieClip(this);
}
};
}
if (type == 3) {
_root.s_laser.start(0, 0);
nm = "mcBullet" + bulletcount;
attachMovie("laser", nm, _root.getNextHighestDepth());
_root[nm]._x = xx;
_root[nm]._y = yy;
_root[nm]._xscale = _root[nm]._xscale * 1;
_root[nm]._yscale = _root[nm]._yscale * 1;
_root[nm].spd = 0;
_root[nm].xspeed = _root[nm].spd * Math.cos((_root[nm].dir * Math.PI) / 180);
_root[nm].yspeed = _root[nm].spd * Math.sin((_root[nm].dir * Math.PI) / 180);
_root[nm].onEnterFrame = function () {
if (ppp == true) {
this.stop();
}
if (ppp == false) {
this.play();
this.dir = _root[this.own].dir;
this._rotation = this.dir;
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
}
if (this._x < -80) {
this.removeMovieClip(this);
}
if (this._x > 630) {
this.removeMovieClip(this);
}
if (this._y < -30) {
this.removeMovieClip(this);
}
if (this._y > 280) {
this.removeMovieClip(this);
}
if ((this.mc.hitTest(mcPlayer._x, mcPlayer._y, true) == true) && (ppp == false)) {
hitpoints = hitpoints - 0.75;
pop(1, mcPlayer._x + (random(25) - 12.5), mcPlayer._y + (random(10) - 5), 1);
}
};
}
if (type == 4) {
_root.s_rocket2.start(0, 0);
nm = "mcBullet" + bulletcount;
attachMovie("enemysammissile", nm, _root.getNextHighestDepth());
_root[nm]._x = xx;
_root[nm]._y = yy;
_root[nm]._xscale = _root[nm]._xscale * 0.4;
_root[nm]._yscale = _root[nm]._yscale * 0.4;
_root[nm].dir = -90;
_root[nm].leftright = (Math.random() * 2) - 1;
_root[nm]._rotation = _root[nm].dir;
_root[nm].spd = 6;
_root[nm].xspeed = _root[nm].spd * Math.cos((_root[nm].dir * Math.PI) / 180);
_root[nm].yspeed = _root[nm].spd * Math.sin((_root[nm].dir * Math.PI) / 180);
_root[nm].onEnterFrame = function () {
if (ppp == false) {
this.xspeed = this.spd * Math.cos((this.dir * Math.PI) / 180);
this.yspeed = this.spd * Math.sin((this.dir * Math.PI) / 180);
this.dir = this.dir + ((random(50) / 10) * this.leftright);
this._rotation = this.dir;
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this.xspeed = this.xspeed * 1.007;
this.yspeed = this.yspeed * 1.007;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this._x > 630) {
this.removeMovieClip(this);
}
if (this._y < -30) {
this.removeMovieClip(this);
}
if (this._y > 280) {
pop(2, this._x, this._y, 0.4);
this.removeMovieClip(this);
}
if (this.hitTest(mcPlayer.mc) == true) {
_root.s_explosion2.start(0, 0);
pop(2, this._x, this._y, 0.4);
hitpoints = hitpoints - 2;
this.removeMovieClip(this);
}
};
}
if (type == 5) {
_root.s_shoot.start(0, 0);
nm = "mcBullet" + bulletcount;
attachMovie("bullets", nm, _root.getNextHighestDepth());
_root[nm]._x = xx;
_root[nm]._y = yy;
_root[nm]._xscale = _root[nm]._xscale * 0.55;
_root[nm]._yscale = _root[nm]._yscale * 0.55;
_root[nm].dir = (random(15) - 7.5) + ((Math.atan2(mcPlayer._y - _root[nm]._y, (mcPlayer._x + 55) - _root[nm]._x) * 180) / Math.PI);
_root[nm]._rotation = _root[nm].dir;
_root[nm].spd = 5;
_root[nm].xspeed = _root[nm].spd * Math.cos((_root[nm].dir * Math.PI) / 180);
_root[nm].yspeed = _root[nm].spd * Math.sin((_root[nm].dir * Math.PI) / 180);
_root[nm].onEnterFrame = function () {
if (ppp == false) {
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this.xspeed = this.xspeed * 1.01;
this.yspeed = this.yspeed * 1.01;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this._x > 630) {
this.removeMovieClip(this);
}
if (this._y < -30) {
this.removeMovieClip(this);
}
if (this._y > 280) {
this.removeMovieClip(this);
}
if (this.hitTest(mcPlayer.mc) == true) {
pop(1, this._x, this._y, 0.8);
hitpoints = hitpoints - 2;
this.removeMovieClip(this);
}
};
}
if (type == 6) {
_root.s_rocket3.start(0, 0);
nm = "mcBullet" + bulletcount;
attachMovie("enemyrocket", nm, _root.getNextHighestDepth());
_root[nm]._x = xx;
_root[nm]._y = yy;
_root[nm]._xscale = _root[nm]._xscale * 1;
_root[nm]._yscale = _root[nm]._yscale * 1;
_root[nm].dir = (random(10) - 5) + ((Math.atan2(mcPlayer._y - _root[nm]._y, (mcPlayer._x + 55) - _root[nm]._x) * 180) / Math.PI);
_root[nm]._rotation = _root[nm].dir;
_root[nm].spd = 4;
_root[nm].xspeed = _root[nm].spd * Math.cos((_root[nm].dir * Math.PI) / 180);
_root[nm].yspeed = _root[nm].spd * Math.sin((_root[nm].dir * Math.PI) / 180);
_root[nm].onEnterFrame = function () {
if (ppp == false) {
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this.xspeed = this.xspeed * 1.02;
this.yspeed = this.yspeed * 1.02;
}
if (this._x < -30) {
this.removeMovieClip(this);
}
if (this._x > 630) {
this.removeMovieClip(this);
}
if (this._y < -30) {
this.removeMovieClip(this);
}
if (this._y > 280) {
this.removeMovieClip(this);
}
if (this.hitTest(mcPlayer.mc) == true) {
_root.s_explosion.start(0, 0);
pop(2, this._x, this._y, 0.3);
hitpoints = hitpoints - 2.5;
this.removeMovieClip(this);
}
};
}
if (type == 7) {
nm = "mcBullet" + bulletcount;
attachMovie("enemygrenade", nm, _root.getNextHighestDepth());
_root[nm].timer = 37;
_root[nm]._x = xx;
_root[nm]._y = yy;
_root[nm]._xscale = _root[nm]._xscale * 0.35;
_root[nm]._yscale = _root[nm]._yscale * 0.35;
_root[nm].dir = ((Math.atan2((mcPlayer._y - 30) - _root[nm]._y, mcPlayer._x - _root[nm]._x) * 180) / Math.PI) + ((Math.asin(0.3 * Math.sin(((-((Math.atan2((mcPlayer._y - 30) - _root[nm]._y, mcPlayer._x - _root[nm]._x) * 180) / Math.PI)) * Math.PI) / 180)) * 180) / Math.PI);
_root[nm]._rotation = random(360);
_root[nm].spd = 11;
_root[nm].xspeed = _root[nm].spd * Math.cos((_root[nm].dir * Math.PI) / 180);
_root[nm].yspeed = _root[nm].spd * Math.sin((_root[nm].dir * Math.PI) / 180);
_root[nm].onEnterFrame = function () {
if (ppp == false) {
this.timer = this.timer - 1;
this._rotation = this._rotation + 5;
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
this.yspeed = this.yspeed + 0.25;
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this.xspeed = this.xspeed * 1;
this.yspeed = this.yspeed * 1;
}
if (this.hitTest(mcPlayer.mc) == true) {
this.yspeed = this.yspeed * -1;
}
if (this._y >= 270) {
this.yspeed = this.yspeed * -1;
}
if (this.timer <= 0) {
_root.s_explosion.start(0, 0);
pop(2, this._x, this._y, 1.2);
this.removeMovieClip(this);
}
};
}
if (type == 8) {
_root.s_rocket.start(0, 0);
nm = "mcBullet" + bulletcount;
attachMovie("enemygrenade2", nm, _root.getNextHighestDepth());
_root[nm]._x = xx;
_root[nm]._y = yy;
_root[nm]._xscale = _root[nm]._xscale * 0.5;
_root[nm]._yscale = _root[nm]._yscale * 0.5;
_root[nm].dir = ((Math.atan2((mcPlayer._y - 30) - _root[nm]._y, mcPlayer._x - _root[nm]._x) * 180) / Math.PI) + ((Math.asin(0.3 * Math.sin(((-((Math.atan2((mcPlayer._y - 30) - _root[nm]._y, mcPlayer._x - _root[nm]._x) * 180) / Math.PI)) * Math.PI) / 180)) * 180) / Math.PI);
_root[nm]._rotation = _root[nm].dir;
_root[nm].spd = 10;
_root[nm].xspeed = _root[nm].spd * Math.cos((_root[nm].dir * Math.PI) / 180);
_root[nm].yspeed = _root[nm].spd * Math.sin((_root[nm].dir * Math.PI) / 180);
_root[nm].onEnterFrame = function () {
if (ppp == false) {
this.timer = this.timer - 1;
this._rotation = (Math.atan2((this._y + this.yspeed) - this._y, (this._x + this.xspeed) - this._x) * 180) / Math.PI;
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
this.yspeed = this.yspeed + 0.15;
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
}
if (this._y > 270) {
pop(2, this._x, this._y, 1);
this.removeMovieClip(this);
}
if (this.hitTest(mcPlayer.mc) == true) {
this.yspeed = this.yspeed * -1;
_root.s_explosion2.start(0, 0);
pop(2, this._x, this._y, 1);
this.removeMovieClip(this);
}
};
}
bulletcount = bulletcount + 1;
}
function pop(type, xx, yy, size) {
jk = "mcPop" + popcount;
if (type == 1) {
_root.s_hit.start(0, 0);
attachMovie("spark", jk, _root.getNextHighestDepth());
}
if (type == 2) {
attachMovie("explosion", jk, _root.getNextHighestDepth());
}
_root[jk].which = type;
_root[jk]._x = xx;
_root[jk]._y = yy;
_root[jk]._xscale = _root[jk]._xscale * size;
_root[jk]._yscale = _root[jk]._yscale * size;
_root[jk].sizescale = size;
_root[jk]._rotation = random(360);
_root[jk].onEnterFrame = function () {
if (ppp == false) {
this.play();
} else {
this.stop();
}
if (ppp == false) {
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
if ((this.which == 2) && (this.mc.hitTest(mcPlayer.mc) == true)) {
hitpoints = hitpoints - (0.23 * this.sizescale);
}
}
};
popcount = popcount + 1;
}
function startLevel() {
s_gamemusic.start(0, 99999);
partsgained = 0;
dead = false;
deadtimer = -1;
turretcount = 0;
bulletcount = 0;
attachMovie("missileDrawing", "mcPlayer", _root.getNextHighestDepth());
attachMovie("gamehud", "mcHud", _root.getNextHighestDepth());
mcPlayer.mcDamage._alpha = 0;
playerscale = 0.5;
enemyspeedbase = 2;
enemyspeed = enemyspeedbase;
xmaxspeedbase = 4.2;
xmaxspeed = xmaxspeedbase;
ymaxspeedbase = 3.3;
ymaxspeed = ymaxspeedbase;
mcPlayer._xscale = mcPlayer._xscale * playerscale;
mcPlayer._yscale = mcPlayer._yscale * playerscale;
mcPlayer._x = -60;
mcPlayer._y = 60;
mcPlayer.xspeed = 0;
mcPlayer.yspeed = 0;
mcPlayer.bluefire._alpha = 0;
startmovetimer = 80;
mcHud.mcMenu.stop();
mcHud.mcMenu.onRelease = function () {
if (this._currentframe != 1) {
_root.gotoAndStop(1);
} else {
this.play();
}
};
mcHud.onEnterFrame = function () {
if (Key.isDown("1".charCodeAt(0)) == true) {
if ((box1time < 0) && (power1unlocked == 1)) {
box1time = box1timebase;
}
}
if (Key.isDown("2".charCodeAt(0)) == true) {
if ((box2time < 0) && (power2unlocked == 1)) {
box2time = box2timebase;
shieldhp = hitpoints;
}
}
if (Key.isDown("3".charCodeAt(0)) == true) {
if ((box3time < 0) && (power3unlocked == 1)) {
box3time = box3timebase;
attachMovie("hud3bomb", "mcBomb", _root.getNextHighestDepth());
mcBomb.swapDepths(mcPlayer);
mcBomb._x = mcPlayer._x;
mcBomb._y = mcPlayer._y + 3;
mcBomb.yspeed = 1;
mcBomb._xscale = mcBomb._xscale * 0.5;
mcBomb._yscale = mcBomb._yscale * 0.4;
mcBomb.timer = 24;
mcPlayer.missile.play();
mcBomb.onEnterFrame = function () {
if (ppp == false) {
this.play();
} else {
this.stop();
}
if (ppp == false) {
this.timer = this.timer - 1;
if (this.timer < 0) {
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this.yspeed = this.yspeed + 0.04;
this._y = this._y + this.yspeed;
} else {
this._rotation = -1 * (this.timer * 1.875);
this._x = mcPlayer._x;
this._y = (mcPlayer._y - (this.timer * 0.2)) + 7;
}
}
if (this._y > 270) {
_root.s_explosion3.start(0, 0);
attachMovie("explosion", "mcBombExplosion", _root.getNextHighestDepth());
mcBombExplosion._x = this._x;
mcBombExplosion._y = this._y;
mcBombExplosion._xscale = mcBombExplosion._xscale * 1.6;
mcBombExplosion._yscale = mcBombExplosion._yscale * 1.4;
mcBombExplosion.onEnterFrame = function () {
if (startgametimer < 0) {
if (ppp == false) {
this._x = this._x - enemyspeed;
}
}
};
this.removeMovieClip(this);
}
};
}
}
this.mcMute.onRelease = function () {
if (_root.muted == false) {
_root.muted = true;
_root.s_mainmenu.setVolume(0);
} else {
_root.muted = false;
_root.s_mainmenu.setVolume(100);
}
};
this.mcLevel.text = "level " + level;
this.mcParts.text = "parts: " + String(parts);
if ((dead == true) && (deadtimer == -1)) {
deadtimer = 80;
}
if (deadtimer != -1) {
if (ppp == false) {
deadtimer = deadtimer - 1;
}
}
if ((deadtimer == 0) && (ppp == false)) {
parts = parts - partsgained;
levelfinished = false;
hitpoints = 100;
parts = parts - 500;
if (parts < 0) {
parts = 0;
}
nextFrame();
}
if (power1unlocked == 0) {
this.box1._alpha = 15;
}
if (power2unlocked == 0) {
this.box2._alpha = 15;
}
if (power3unlocked == 0) {
this.box3._alpha = 15;
}
if (box1time > 700) {
xmaxspeed = xmaxspeedbase + 2;
} else {
xmaxspeed = xmaxspeedbase;
}
if ((mcPlayer._x > 30) && (startmovetimer < 0)) {
this.hp._width = hitpoints;
}
if (hitpoints <= 0) {
this.hp._alpha = 0;
} else {
this.hp._alpha = 100;
}
if (ppp == false) {
if (box1time >= 0) {
this.box1timer._yscale = box1time / 10;
}
box1time = box1time - 1;
if (box2time >= 0) {
this.box2timer._yscale = box2time / 14;
}
box2time = box2time - 1;
if (box3time >= 0) {
this.box3timer._yscale = box3time / 5;
}
box3time = box3time - 1;
}
};
box1timebase = 1000;
box1time = 0;
mcHud.box1.box1fire.stop();
mcHud.box1.onRollOver = function () {
this.box1fire.play();
};
mcHud.box1.onRollOut = function () {
this.box1fire.gotoAndStop(1);
};
mcHud.box1.onPress = function () {
if ((box1time < 0) && (power1unlocked == 1)) {
box1time = box1timebase;
}
};
box2timebase = 1400;
box2time = 0;
mcHud.box2.box2missile.stop();
mcHud.box2.onRollOver = function () {
this.box2missile.play();
};
mcHud.box2.onRollOut = function () {
this.box2missile.gotoAndStop(1);
};
mcHud.box2.onPress = function () {
if ((box2time < 0) && (power2unlocked == 1)) {
box2time = box2timebase;
shieldhp = hitpoints;
}
};
box3timebase = 500;
box3time = 0;
mcHud.box3.onPress = function () {
if ((box3time < 0) && (power3unlocked == 1)) {
box3time = box3timebase;
attachMovie("hud3bomb", "mcBomb", _root.getNextHighestDepth());
mcBomb.swapDepths(mcPlayer);
mcBomb._x = mcPlayer._x;
mcBomb._y = mcPlayer._y + 3;
mcBomb.yspeed = 1;
mcBomb._xscale = mcBomb._xscale * 0.5;
mcBomb._yscale = mcBomb._yscale * 0.4;
mcBomb.timer = 24;
mcPlayer.missile.play();
mcBomb.onEnterFrame = function () {
if (ppp == false) {
this.play();
} else {
this.stop();
}
if (ppp == false) {
this.timer = this.timer - 1;
if (this.timer < 0) {
if (startmovetimer < 0) {
this._x = this._x - enemyspeed;
}
this.yspeed = this.yspeed + 0.04;
this._y = this._y + this.yspeed;
} else {
this._rotation = -1 * (this.timer * 1.875);
this._x = mcPlayer._x;
this._y = (mcPlayer._y - (this.timer * 0.2)) + 7;
}
}
if (this._y > 270) {
_root.s_explosion3.start(0, 0);
attachMovie("explosion", "mcBombExplosion", _root.getNextHighestDepth());
mcBombExplosion._x = this._x;
mcBombExplosion._y = this._y;
mcBombExplosion._xscale = mcBombExplosion._xscale * 1.6;
mcBombExplosion._yscale = mcBombExplosion._yscale * 1.4;
mcBombExplosion.onEnterFrame = function () {
if (startgametimer < 0) {
if (ppp == false) {
this._x = this._x - enemyspeed;
}
}
};
this.removeMovieClip(this);
}
};
}
};
mcHud.mcPause.onRelease = function () {
if (ppp == true) {
ppp = false;
} else {
ppp = true;
}
};
mcHud.hp._width = hitpoints;
mcPlayer.onEnterFrame = function () {
if (this._y < 50) {
mcHud._alpha = mcHud._alpha - 4;
} else {
mcHud._alpha = mcHud._alpha + 4;
}
if (mcHud._alpha < 40) {
mcHud._alpha = 40;
}
if (mcHud._alpha > 100) {
mcHud._alpha = 100;
}
if (Key.isDown(32) == true) {
if (invincibility == true) {
hitpoints = 100;
}
}
if (ppp == false) {
this.fire.play();
this.bluefire.play();
} else {
this.fire.stop();
this.bluefire.stop();
}
if ((box2time > 1000) && (hitpoints <= shieldhp)) {
hitpoints = shieldhp;
}
if (box2time > 1000) {
this.shield._alpha = 100;
} else {
this.shield._alpha = 0;
}
if (hitpoints <= 0) {
_root.s_explosion3.start(0, 0);
pop(2, this._x, this._y, 3);
pop(2, this._x + 60, this._y, 2);
pop(2, this._x - 60, this._y, 2);
enemyspeed = 0;
dead = true;
this.removeMovieClip(this);
}
if (ppp == false) {
startmovetimer = startmovetimer - 1;
}
if (startmovetimer > 0) {
if (ppp == false) {
mcPlayer._x = mcPlayer._x + (1.7 - (startmovetimer / 160));
}
} else if ((hitpoints > 0) && (ppp == false)) {
mcBgLayer1._x = mcBgLayer1._x - enemyspeed;
mcBgLayer2._x = mcBgLayer2._x - (enemyspeed / 4);
mcBgLayer5._x = mcBgLayer5._x - (enemyspeed / 6);
mcBgLayer4._x = mcBgLayer4._x - (enemyspeed / 2);
mcBgLayer6._x = mcBgLayer6._x - (enemyspeed / 3);
this.xspeed = this.xspeed * 0.96;
this.yspeed = this.yspeed * 0.93;
if (box1time > 700) {
enemyspeed = enemyspeedbase * 1.7;
} else {
enemyspeed = enemyspeedbase;
}
if (this.xspeed >= 0) {
this.fire._xscale = 100 + (this.xspeed * 25);
this.bluefire._xscale = 100 + (this.xspeed * 25);
this.bluefire._alpha = 0;
if (box1time > 700) {
this.bluefire._alpha = (this.xspeed * 35) - 5;
} else {
enemyspeed = enemyspeedbase;
}
} else {
this.fire._xscale = 100;
}
if ((Key.isDown("W".charCodeAt(0)) == true) || (Key.isDown(38) == true)) {
this.yspeed = this.yspeed - 0.3;
if (box1time > 700) {
this.yspeed = this.yspeed - 0.3;
}
}
if ((Key.isDown("A".charCodeAt(0)) == true) || (Key.isDown(37) == true)) {
this.xspeed = this.xspeed - 0.5;
if (box1time > 700) {
this.xspeed = this.xspeed - 0.5;
}
}
if ((Key.isDown("S".charCodeAt(0)) == true) || (Key.isDown(40) == true)) {
this.yspeed = this.yspeed + 0.3;
if (box1time > 700) {
this.yspeed = this.yspeed + 0.3;
}
}
if ((Key.isDown("D".charCodeAt(0)) == true) || (Key.isDown(39) == true)) {
this.xspeed = this.xspeed + 0.5;
if (box1time > 700) {
this.xspeed = this.xspeed + 0.5;
}
}
if (this.xspeed > xmaxspeed) {
this.xspeed = xmaxspeed;
}
if (this.xspeed < (-1 * xmaxspeed)) {
this.xspeed = -1 * xmaxspeed;
}
if (this.yspeed > ymaxspeed) {
this.yspeed = ymaxspeed;
}
if (this.yspeed < (-1 * ymaxspeed)) {
this.yspeed = -1 * ymaxspeed;
}
if (this._x < 30) {
this._x = 30.5;
}
if (this._x > 560) {
this._x = 559.5;
}
if (this._y > 260) {
this._y = 259.5;
this.yspeed = this.yspeed * -0.5;
hitpoints = hitpoints - 1;
pop(1, this._x, this._y + 5, 1);
}
if (this._y < 10) {
this._y = 10.5;
}
if (this.xspeed > 0) {
this._rotation = this.yspeed * 4;
} else {
this._rotation = this.yspeed * 1.5;
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if ((box2time > 1000) && (hitpoints <= shieldhp)) {
hitpoints = shieldhp;
}
this.mcDamage._alpha = Math.abs(100 - hitpoints);
}
};
}
function endLevel() {
clearLevel();
levelfinished = true;
nextFrame();
}
s_mainmenu.stop();
removeMovieClip(mcMainMenu);
ppp = false;
clearLevel();
levelfinished = false;
startGame();
attachMovie("bgLayer3-1", "mcBgLayer3", _root.getNextHighestDepth());
attachMovie("bgLayer5-1", "mcBgLayer5", _root.getNextHighestDepth());
attachMovie("bgLayer2-1", "mcBgLayer2", _root.getNextHighestDepth());
attachMovie("bgLayer1-1", "mcBgLayer1", _root.getNextHighestDepth());
attachMovie("bgLayer6-1", "mcBgLayer6", _root.getNextHighestDepth());
attachMovie("bgLayer4-1", "mcBgLayer4", _root.getNextHighestDepth());
startLevel();
level = 1;
turretstart(5, 700);
turretstart(-1, 800);
turretstart(5, 1000);
turretstart(-2, 1200);
turretstart(1, 1400);
turretstart(5, 1800);
turretstart(-2, 1850);
turretstart(1, 1900);
turretstart(2, 2200);
turretstart(-2, 2250);
turretstart(5, 2600);
turretstart(0, 3000);
popcount = 0;
if (skiptobonus == true) {
skiptobonus = false;
levelfinished = true;
gotoAndStop (15);
}
stop();
Frame 4
clearLevel();
ppp = false;
stop();
attachMovie("upgradeScreen", "mcUpgrade", _root.getNextHighestDepth());
if (levelfinished == false) {
prevFrame();
}
Frame 5
clearLevel();
ppp = false;
levelfinished = false;
attachMovie("bgLayer3-2", "mcBgLayer3", _root.getNextHighestDepth());
attachMovie("bgLayer5-2", "mcBgLayer5", _root.getNextHighestDepth());
attachMovie("bgLayer2-2", "mcBgLayer2", _root.getNextHighestDepth());
attachMovie("bgLayer1-2", "mcBgLayer1", _root.getNextHighestDepth());
attachMovie("bgLayer6-1", "mcBgLayer6", _root.getNextHighestDepth());
attachMovie("bgLayer4-1", "mcBgLayer4", _root.getNextHighestDepth());
startLevel();
level = 2;
turretstart(7, 690);
turretstart(2, 900);
turretstart(1, 1250);
turretstart(-2, 1300);
turretstart(7, 1400);
turretstart(6, 1770);
turretstart(5, 1800);
turretstart(-1, 1840);
turretstart(5, 1870);
turretstart(6, 1910);
turretstart(-3, 1960);
turretstart(6, 2020);
turretstart(2, 2300);
turretstart(1, 2600);
turretstart(-2, 2670);
turretstart(1, 2950);
turretstart(0, 3100);
stop();
Frame 6
clearLevel();
ppp = false;
stop();
attachMovie("upgradeScreen", "mcUpgrade", _root.getNextHighestDepth());
if (levelfinished == false) {
prevFrame();
}
Frame 7
clearLevel();
ppp = false;
levelfinished = false;
attachMovie("bgLayer3-3", "mcBgLayer3", _root.getNextHighestDepth());
attachMovie("bgLayer5-3", "mcBgLayer5", _root.getNextHighestDepth());
attachMovie("bgLayer2-3", "mcBgLayer2", _root.getNextHighestDepth());
attachMovie("bgLayer1-3", "mcBgLayer1", _root.getNextHighestDepth());
attachMovie("bgLayer6-1", "mcBgLayer6", _root.getNextHighestDepth());
attachMovie("bgLayer4-1", "mcBgLayer4", _root.getNextHighestDepth());
startLevel();
level = 3;
turretstart(2, 630);
turretstart(-2, 680);
turretstart(5, 700);
turretstart(5, 1400);
turretstart(6, 1450);
turretstart(1, 1500);
turretstart(2, 1750);
turretstart(-2, 1850);
turretstart(3, 2000);
turretstart(5, 2100);
turretstart(7, 2200);
turretstart(1, 2250);
turretstart(2, 2600);
turretstart(-3, 2750);
turretstart(3, 2800);
turretstart(2, 3000);
turretstart(0, 3200);
stop();
Frame 8
clearLevel();
ppp = false;
stop();
attachMovie("upgradeScreen", "mcUpgrade", _root.getNextHighestDepth());
if (levelfinished == false) {
prevFrame();
}
Frame 9
clearLevel();
ppp = false;
levelfinished = false;
attachMovie("bgLayer3-2", "mcBgLayer3", _root.getNextHighestDepth());
attachMovie("bgLayer5-1", "mcBgLayer5", _root.getNextHighestDepth());
attachMovie("bgLayer2-1", "mcBgLayer2", _root.getNextHighestDepth());
attachMovie("bgLayer1-1", "mcBgLayer1", _root.getNextHighestDepth());
attachMovie("bgLayer6-1", "mcBgLayer6", _root.getNextHighestDepth());
attachMovie("bgLayer4-1", "mcBgLayer4", _root.getNextHighestDepth());
startLevel();
level = 4;
turretstart(1, 630);
turretstart(5, 660);
turretstart(-3, 690);
turretstart(5, 720);
turretstart(5, 810);
turretstart(4, 1250);
turretstart(-1, 1300);
turretstart(7, 1280);
turretstart(-1, 1350);
turretstart(3, 1500);
turretstart(2, 1900);
turretstart(-2, 1950);
turretstart(2, 1990);
turretstart(1, 2100);
turretstart(6, 2200);
turretstart(-3, 2250);
turretstart(8, 2500);
turretstart(3, 2600);
turretstart(4, 2700);
turretstart(0, 3100);
stop();
Frame 10
clearLevel();
ppp = false;
stop();
attachMovie("upgradeScreen", "mcUpgrade", _root.getNextHighestDepth());
if (levelfinished == false) {
prevFrame();
}
Frame 11
clearLevel();
ppp = false;
levelfinished = false;
attachMovie("bgLayer3-1", "mcBgLayer3", _root.getNextHighestDepth());
attachMovie("bgLayer5-2", "mcBgLayer5", _root.getNextHighestDepth());
attachMovie("bgLayer2-2", "mcBgLayer2", _root.getNextHighestDepth());
attachMovie("bgLayer1-2", "mcBgLayer1", _root.getNextHighestDepth());
attachMovie("bgLayer6-1", "mcBgLayer6", _root.getNextHighestDepth());
attachMovie("bgLayer4-1", "mcBgLayer4", _root.getNextHighestDepth());
startLevel();
level = 5;
turretstart(3, 600);
turretstart(3, 650);
turretstart(3, 700);
turretstart(-3, 850);
turretstart(8, 900);
turretstart(5, 1200);
turretstart(5, 1230);
turretstart(-1, 1250);
turretstart(6, 1260);
turretstart(7, 1280);
turretstart(6, 1300);
turretstart(5, 1330);
turretstart(4, 1360);
turretstart(-3, 1400);
turretstart(8, 1500);
turretstart(7, 1530);
turretstart(2, 1700);
turretstart(8, 2200);
turretstart(-1, 2250);
turretstart(6, 2250);
turretstart(8, 2400);
turretstart(3, 2500);
turretstart(4, 2600);
turretstart(0, 2900);
stop();
Frame 12
clearLevel();
ppp = false;
stop();
attachMovie("upgradeScreen", "mcUpgrade", _root.getNextHighestDepth());
if (levelfinished == false) {
prevFrame();
}
Frame 13
clearLevel();
ppp = false;
levelfinished = false;
attachMovie("bgLayer3-2", "mcBgLayer3", _root.getNextHighestDepth());
attachMovie("bgLayer5-3", "mcBgLayer5", _root.getNextHighestDepth());
attachMovie("bgLayer2-3", "mcBgLayer2", _root.getNextHighestDepth());
attachMovie("bgLayer1-3", "mcBgLayer1", _root.getNextHighestDepth());
attachMovie("bgLayer6-1", "mcBgLayer6", _root.getNextHighestDepth());
attachMovie("bgLayer4-1", "mcBgLayer4", _root.getNextHighestDepth());
startLevel();
level = 6;
turretstart(-1, 630);
turretstart(-2, 650);
turretstart(8, 780);
turretstart(-1, 810);
turretstart(3, 840);
turretstart(4, 1000);
turretstart(5, 1150);
turretstart(2, 1100);
turretstart(-2, 1200);
turretstart(6, 1300);
turretstart(7, 1350);
turretstart(6, 1400);
turretstart(1, 1600);
turretstart(-3, 1650);
turretstart(5, 1700);
turretstart(5, 1750);
turretstart(3, 1850);
turretstart(7, 2000);
turretstart(7, 2050);
turretstart(7, 2100);
turretstart(1, 2300);
turretstart(-3, 2400);
turretstart(5, 2600);
turretstart(5, 2640);
turretstart(5, 2680);
turretstart(5, 2720);
turretstart(3, 2800);
turretstart(0, 2900);
stop();
Frame 14
clearLevel();
ppp = false;
stop();
if (levelfinished == false) {
prevFrame();
} else {
attachMovie("finalcutscene", "mcFinal", _root.getNextHighestDepth());
}
bonuslevel = true;
Frame 15
clearLevel();
ppp = false;
if (levelfinished == false) {
gotoAndStop (1);
}
levelfinished = false;
attachMovie("bgLayer3-2", "mcBgLayer3", _root.getNextHighestDepth());
attachMovie("bgLayer5-2", "mcBgLayer5", _root.getNextHighestDepth());
attachMovie("bgLayer2-2", "mcBgLayer2", _root.getNextHighestDepth());
attachMovie("bgLayer1-2", "mcBgLayer1", _root.getNextHighestDepth());
attachMovie("bgLayer6-1", "mcBgLayer6", _root.getNextHighestDepth());
attachMovie("bgLayer4-1", "mcBgLayer4", _root.getNextHighestDepth());
startLevel();
level = "X";
turretstart(6, 650);
turretstart(6, 670);
turretstart(5, 690);
turretstart(3, 750);
turretstart(4, 900);
turretstart(4, 950);
turretstart(1, 990);
turretstart(2, 1150);
turretstart(1, 1300);
turretstart(1, 1350);
turretstart(5, 1450);
turretstart(1, 1500);
turretstart(1, 1550);
turretstart(8, 1700);
turretstart(4, 1900);
turretstart(3, 2000);
turretstart(3, 2100);
turretstart(8, 2200);
turretstart(4, 2300);
turretstart(3, 2500);
turretstart(3, 2550);
turretstart(7, 2600);
turretstart(7, 2650);
turretstart(7, 2700);
turretstart(7, 2750);
turretstart(7, 2800);
turretstart(7, 2850);
turretstart(3, 2900);
turretstart(3, 2950);
turretstart(1, 3000);
turretstart(2, 3050);
turretstart(6, 3100);
turretstart(7, 3400);
turretstart(0, 3500);
stop();
Frame 16
clearLevel();
attachMovie("bonusbeat", "mcBonusBeat", _root.getNextHighestDepth());
mcBonusBeat.mcBack.onRelease = function () {
invincibility = true;
gotoAndStop (1);
};
if (levelfinished == false) {
gotoAndStop (1);
}
Symbol 43 MovieClip [missileFire] Frame 1
stop();
Symbol 53 MovieClip Frame 1
stop();
Symbol 85 MovieClip [menu] Frame 1
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 113 MovieClip [enemysamhead] Frame 1
stop();
Symbol 121 MovieClip [spark] Frame 14
this.removeMovieClip(this);
Symbol 134 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 1
stop();
Symbol 152 MovieClip [enemylaserhead] Frame 1
stop();
Symbol 163 MovieClip [enemystormbody] Frame 1
stop();
Symbol 175 MovieClip [enemysoldierhead] Frame 1
stop();
Symbol 190 MovieClip [enemyrocketmanhead] Frame 1
stop();
Symbol 201 MovieClip Frame 30
stop();
Symbol 239 MovieClip Frame 1
stop();
Symbol 242 MovieClip [upgradeScreen] Frame 1
stop();
nextbutton.onRelease = function () {
nextFrame();
};
Symbol 242 MovieClip [upgradeScreen] Frame 2
stop();
_root.s_upgrade.start(0, 999999);
_root.up4cost = Math.round(0.5 * (100 - _root.hitpoints)) * 10;
_root.up4coststring = "cost: " + _root.up4cost;
hp._width = _root.hitpoints;
cheatcheck = _root.parts + 1;
cheatcheck2 = _root.parts + 2;
cheatcheck3 = _root.parts + 3;
cheatcheck4 = _root.parts + 4;
mcGo.onRelease = function () {
_root.s_upgrade.stop();
_root.nextFrame();
};
if (_root.power1unlocked == 1) {
mcUpgrade1._alpha = 20;
}
if (_root.power2unlocked == 1) {
mcUpgrade2._alpha = 20;
}
if (_root.power3unlocked == 1) {
mcUpgrade3._alpha = 20;
}
mcUpgrade1.onRollOver = function () {
_root.s_beep.start(0, 0);
};
mcUpgrade2.onRollOver = function () {
_root.s_beep.start(0, 0);
};
mcUpgrade3.onRollOver = function () {
_root.s_beep.start(0, 0);
};
mcUpgrade4.onRollOver = function () {
_root.s_beep.start(0, 0);
};
mcUpgrade1.onRelease = function () {
if (cheatcheck != (_root.parts + 1)) {
_root.parts = 0;
}
if ((_root.parts < 1000) && (_root.power1unlocked == 0)) {
mcNeed.gotoAndPlay(2);
}
if ((_root.power1unlocked == 0) && (_root.parts >= 1000)) {
_root.power1unlocked = 1;
_root.parts = _root.parts - 1000;
mcUpgrade1._alpha = 20;
_root.s_cashregister.start(0, 0);
}
cheatcheck = _root.parts + 1;
cheatcheck2 = _root.parts + 2;
cheatcheck3 = _root.parts + 3;
cheatcheck4 = _root.parts + 4;
};
mcUpgrade2.onRelease = function () {
if (cheatcheck2 != (_root.parts + 2)) {
_root.parts = 0;
}
if ((_root.parts < 1500) && (_root.power2unlocked == 0)) {
mcNeed.gotoAndPlay(2);
}
if ((_root.power2unlocked == 0) && (_root.parts >= 1500)) {
_root.power2unlocked = 1;
_root.parts = _root.parts - 1500;
mcUpgrade2._alpha = 20;
_root.s_cashregister.start(0, 0);
}
cheatcheck = _root.parts + 1;
cheatcheck2 = _root.parts + 2;
cheatcheck3 = _root.parts + 3;
cheatcheck4 = _root.parts + 4;
};
mcUpgrade3.onRelease = function () {
if (cheatcheck3 != (_root.parts + 3)) {
_root.parts = 0;
}
if ((_root.parts < 2500) && (_root.power3unlocked == 0)) {
mcNeed.gotoAndPlay(2);
}
if ((_root.power3unlocked == 0) && (_root.parts >= 2500)) {
_root.power3unlocked = 1;
_root.parts = _root.parts - 2500;
mcUpgrade3._alpha = 20;
_root.s_cashregister.start(0, 0);
}
cheatcheck = _root.parts + 1;
cheatcheck2 = _root.parts + 2;
cheatcheck3 = _root.parts + 3;
cheatcheck4 = _root.parts + 4;
};
mcUpgrade4.onRelease = function () {
if (cheatcheck4 != (_root.parts + 4)) {
_root.parts = 0;
}
if (_root.parts < 300) {
mcNeed.gotoAndPlay(2);
}
if ((_root.parts >= _root.up4cost) && (_root.hitpoints < 100)) {
_root.hitpoints = 100;
_root.parts = _root.parts - _root.up4cost;
_root.s_repair.start(0, 0);
}
cheatcheck = _root.parts + 1;
cheatcheck2 = _root.parts + 2;
cheatcheck3 = _root.parts + 3;
cheatcheck4 = _root.parts + 4;
hp._width = _root.hitpoints;
};
this.mcMute.onRelease = function () {
if (_root.muted == false) {
_root.muted = true;
_root.s_mainmenu.setVolume(0);
} else {
_root.muted = false;
_root.s_mainmenu.setVolume(100);
}
};
Symbol 251 MovieClip Frame 1
stop();
Symbol 259 MovieClip Frame 40
stop();
Symbol 289 MovieClip Frame 1
stop();
Symbol 310 MovieClip Frame 1
stop();
Symbol 367 MovieClip [explosion] Frame 24
this.removeMovieClip(this);
Symbol 379 MovieClip [finalcutscene] Frame 797
stop();
mcBack.onRelease = function () {
_root.gotoAndStop(1);
};
Symbol 385 MovieClip [crateOne] Frame 1
stop();
Symbol 385 MovieClip [crateOne] Frame 20
this.removeMovieClip(this);
Symbol 388 MovieClip [crateThree] Frame 1
stop();
Symbol 388 MovieClip [crateThree] Frame 20
this.removeMovieClip(this);
Symbol 390 MovieClip [crateEight] Frame 1
stop();
Symbol 390 MovieClip [crateEight] Frame 20
this.removeMovieClip(this);
Symbol 399 MovieClip [laser] Frame 29
this.removeMovieClip(this);
Symbol 450 MovieClip [cutscene] Frame 2
mcSkip.onRelease = function () {
gotoAndPlay (1059);
};
Symbol 450 MovieClip [cutscene] Frame 1103
stop();
mcGo.onPress = function () {
_root.nextFrame();
};
Symbol 458 MovieClip [madeby] Frame 127
_root.s_mainmenu.start(0, 99999999);
_root.firsttime = false;
this.removeMovieClip(this);