Frame 1
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
copyrightNotice.separatorBefore = true;
myMenu.customItems.push(mySiteLink, copyrightNotice);
_root.menu = myMenu;
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded / bytes_total;
_root.loadBar._width = getPercent * 100;
_root.loadText = Math.round(getPercent * 100) + "%";
if (bytes_loaded == bytes_total) {
_root.gotoAndPlay(4);
}
mochi.as2.MochiServices.connect("394d816a0504c2c6");
Frame 2
gotoAndPlay (1);
Frame 3
stopAllSounds();
Frame 4
redblue.onPress = function () {
getURL ("http://www.avgames.co.uk", "_blank");
};
Frame 5
logo.onPress = function () {
getURL ("http://www.minijuegos.com", "_blank");
};
Frame 6
stopAllSounds();
stop();
_root.attachMovie("sound_contr", "sound_contr", 3, {_x:470, _y:380});
_root.attachMovie("qualityControl", "qualityControl", 4, {_x:5, _y:382});
won = false;
score = 0;
gun = 0;
qset = 0;
num = 0;
qualityControl.qual.text = "High";
lives = 5;
mission = 1;
gameOn = false;
startG.onRelease = function () {
gotoAndStop ("stage1");
};
logoSmall.onPress = function () {
getURL ("http://www.minijuegos.com", "_blank");
};
Instance of Symbol 395 MovieClip in Frame 6
on (release) {
getURL ("http://www.myspace.com/mizkaz", "_blank");
}
Instance of Symbol 405 MovieClip "logoSmall" in Frame 6
on (release) {
getURL ("http://www.minijuegos.com", "_blank");
}
Frame 7
stop();
_root.gotoAndStop("title");
Frame 8
stop();
gun = 0;
if (lives > -1) {
if (mission == 1) {
_root.gotoAndPlay("stage1");
}
if (mission == 2) {
_root.gotoAndPlay("stage2");
}
if (mission == 3) {
_root.gotoAndPlay("stage3");
}
}
if (lives < 0) {
_root.gotoAndStop("game_done");
}
Frame 9
function removepowerbell() {
i = powerbell.length - 1;
while (i >= 0) {
powerbell[i].removeMovieClip();
powerbell.splice(i, 1);
i--;
}
}
function removebossHealth() {
i = bossHealth.length - 1;
while (i >= 0) {
bossHealth[i].removeMovieClip();
bossHealth.splice(i, 1);
i--;
}
}
function removeBoss() {
i = bosses.length - 1;
while (i >= 0) {
bosses[i].removeMovieClip();
bosses.splice(i, 1);
i--;
}
}
function removeEnemyBullets() {
i = enemyBullet.length - 1;
while (i >= 0) {
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
i--;
}
}
function removeBullets() {
i = bullets.length - 1;
while (i >= 0) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
i--;
}
}
function removeenemies() {
i = enemies.length - 1;
while (i >= 0) {
enemies[i].removeMovieClip();
enemies.splice(i, 1);
i--;
}
}
function removeenemyHealth() {
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth[i].removeMovieClip();
enemyHealth.splice(i, 1);
i--;
}
}
function removewaveNum() {
i = waveNum.length - 1;
while (i >= 0) {
waveNum[i].removeMovieClip();
waveNum.splice(i, 1);
i--;
}
}
function removespecial() {
i = special.length - 1;
while (i >= 0) {
special[i].removeMovieClip();
special.splice(i, 1);
i--;
}
}
function removepowerUp1() {
i = powerUp1.length - 1;
while (i >= 0) {
powerUp1[i].removeMovieClip();
powerUp1.splice(i, 1);
i--;
}
}
function playersHealthBar() {
healthBar._xscale = playerHealth;
if (playerHealth < 50) {
healthBar.gotoAndStop("normal");
} else {
healthBar.gotoAndStop("max");
}
}
function BossHealthBar() {
i = bosses.length - 1;
while (i >= 0) {
bossHealthBar._xscale = bossHealth[i];
if (bossHealth[i] < 25) {
bossHealthBar.gotoAndStop("normal");
} else {
bossHealthBar.gotoAndStop("max");
}
i--;
}
}
function death() {
if (playerHealth < 1) {
playerHealth = 0;
if (un == 1) {
lives--;
un = 0;
}
removeBullets();
removeenemies();
removeenemyHealth();
removewaveNum();
removespecial();
removepowerUp1();
removeEnemyBullets();
removeBoss();
removebossHealth();
removepowerbell();
gameOn = false;
alive = false;
player.gotoAndStop("dead");
stopAllSounds();
}
}
function collectPowerUp() {
i = powerUp1.length - 1;
while (i >= 0) {
powerUp1[i]._rotation = powerUp1[i]._rotation + 10;
if (powerUp1[i].hitTest(player)) {
collectPup_sound.start();
powerUpOnScreen = false;
randomNum++;
_root.attachMovie("explosion2", "explosion2" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun++;
if (gun > 4) {
gun = 4;
}
powerUp1[i].removeMovieClip();
powerUp1.splice(i, 1);
}
i--;
}
}
function collectBell() {
i = powerbell.length - 1;
while (i >= 0) {
if (powerbell[i].hitTest(player)) {
score = score + 300;
collectPup_sound.start();
randomNum++;
bellPop = _root.attachMovie("explosion_pup", "explosion_pup" + randomNum, _root.getNextHighestDepth(), {_x:powerbell[i]._x, _y:powerbell[i]._y});
bellPop._xscale = 170;
bellPop._yscale = 170;
randomNum++;
plusTen = _root.attachMovie("plusTen", "plusTen" + randomNum, _root.getNextHighestDepth(), {_x:powerbell[i]._x, _y:powerbell[i]._y});
powerbell[i].removeMovieClip();
powerbell.splice(i, 1);
}
i--;
}
}
function dropBell() {
randomNumber++;
bell = _root.attachMovie("bell", "bell" + randomNumber, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
powerbell.push(bell);
bell._xscale = 170;
bell._yscale = 170;
bell.onEnterFrame = function () {
endX = _root.player._x;
endY = _root.player._y;
this._x = this._x + ((endX - this._x) / 150);
this._y = this._y + ((endY - this._y) / 150);
};
}
function dropPowerUp() {
randomNumber++;
StarShot = _root.attachMovie("pup", "star" + randomNumber, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
powerUp1.push(StarShot);
StarShot.onEnterFrame = function () {
endX = _root.player._x;
endY = _root.player._y;
this._x = this._x + ((endX - this._x) / 30);
this._y = this._y + ((endY - this._y) / 30);
};
}
function playerHitByEnemyBullet() {
i = enemyBullet.length - 1;
while (i >= 0) {
if (enemyBullet[i].hitTest(player)) {
randomNum++;
_root.attachMovie("playerEffect", "playerEffect" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun--;
if (gun < 0) {
gun = 0;
}
taking_damage = true;
playerHealth = playerHealth - 10;
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
}
i--;
}
}
function playerHitByBoss() {
i = bosses.length - 1;
while (i >= 0) {
if (bosses[i].hitTest(player)) {
randomNum++;
_root.attachMovie("playerEffect", "playerEffect" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun--;
if (gun < 0) {
gun = 0;
}
taking_damage = true;
playerHealth = playerHealth - 10;
player._x = player._x - 10;
}
i--;
}
}
function playerHit() {
i = enemies.length - 1;
while (i >= 0) {
if (enemies[i].hitTest(player)) {
randomNum++;
_root.attachMovie("playerEffect", "playerEffect" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun--;
if (gun < 0) {
gun = 0;
}
taking_damage = true;
playerHealth = playerHealth - 10;
tango_sound.start();
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
explosion._xscale = enemies[i]._xscale;
explosion._yscale = enemies[i]._yscale;
enemies[i].removeMovieClip();
enemies.splice(i, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
i--;
}
}
function EnemyBulletHitBomb() {
i = enemyBullet.length - 1;
while (i >= 0) {
if (enemyBullet[i].hitTest(deathBomb)) {
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
}
i--;
}
}
function enemyHitBomb() {
i = enemies.length - 1;
while (i >= 0) {
if (enemies[i].hitTest(deathBomb)) {
enemies[i].gotoAndPlay("hit");
enemyHealth[i] = enemyHealth[i] - 10;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (enemyHealth[i] < 1) {
score = score + 10;
tango_sound.start();
if (!powerUpOnScreen) {
dir = ["drop", "dropBell", "dropBell2", "dropBell3", "null4", "null5", "null6", "null7", "null8", "null9", "null10"];
randNum = random(10);
setDir = dir[randNum];
switch (setDir) {
case "drop" :
if (gun < 4) {
dropPowerUp();
powerUpOnScreen = true;
}
break;
case "dropBell" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell2" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell3" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "null4" :
break;
case "null5" :
break;
case "null6" :
break;
case "null7" :
break;
case "null8" :
break;
case "null9" :
break;
case "null10" :
}
}
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
explosion._xscale = enemies[i]._xscale;
explosion._yscale = enemies[i]._yscale;
enemies[i].removeMovieClip();
enemies.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
}
i--;
}
}
function bossBombed() {
i = bosses.length - 1;
while (i >= 0) {
if (bosses[i].hitTest(deathBomb)) {
bosses[i].gotoAndPlay("hit");
bossHealth[i] = bossHealth[i] - 1;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (bossHealth[i] < 1) {
boom_sound.start();
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
explosion._xscale = 350;
explosion._yscale = 350;
bosses[i].removeMovieClip();
bosses.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
bossHealth.splice(i, 1);
completed = true;
_root.attachMovie("stageClear", "stageClear", _root.getNextHighestDepth(), {_x:125, _y:150});
target = score + 1000;
}
}
i--;
}
}
function bossSot() {
i = bosses.length - 1;
while (i >= 0) {
j = bullets.length - 1;
while (j >= 0) {
if (bosses[i].hitTest(bullets[j])) {
bosses[i].gotoAndPlay("hit");
bossHealth[i] = bossHealth[i] - 0.1;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (bossHealth[i] < 1) {
barBoarder2.removeMovieClip();
bossHealthBar.removeMovieClip();
boom_sound.start();
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
explosion._xscale = 350;
explosion._yscale = 350;
bosses[i].removeMovieClip();
bosses.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
bossHealth.splice(i, 1);
completed = true;
_root.attachMovie("stageClear", "stageClear", _root.getNextHighestDepth(), {_x:125, _y:150});
target = score + 1000;
}
}
j--;
}
i--;
}
}
function enemySot() {
i = enemies.length - 1;
while (i >= 0) {
j = bullets.length - 1;
while (j >= 0) {
if (enemies[i].hitTest(bullets[j]) or enemies[i].hitTest(deathBomb)) {
score = score + 5;
enemies[i].gotoAndPlay("hit");
enemyHealth[i] = enemyHealth[i] - 1;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (enemyHealth[i] < 1) {
score = score + 10;
tango_sound.start();
if (!powerUpOnScreen) {
dir = ["drop", "dropBell", "dropBell2", "dropBell3", "null4", "null5", "null6", "null7", "null8", "null9", "null10"];
randNum = random(10);
setDir = dir[randNum];
switch (setDir) {
case "drop" :
if (gun < 4) {
dropPowerUp();
powerUpOnScreen = true;
}
break;
case "dropBell" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell2" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell3" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "null4" :
break;
case "null5" :
break;
case "null6" :
break;
case "null7" :
break;
case "null8" :
break;
case "null9" :
break;
case "null10" :
}
}
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
explosion._xscale = enemies[i]._xscale;
explosion._yscale = enemies[i]._yscale;
enemies[i].removeMovieClip();
enemies.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
}
j--;
}
i--;
}
}
function enemyMovement() {
i = enemies.length - 1;
while (i >= 0) {
if (waveNum[i] == 1) {
endX = _root.player._x;
endY = _root.player._y;
enemies[i]._x = enemies[i]._x + ((endX - enemies[i]._x) / 60);
enemies[i]._y = enemies[i]._y + ((endY - enemies[i]._y) / 60);
if (player._x > enemies[i]._x) {
enemies[i]._xscale = -100;
} else {
enemies[i]._xscale = 100;
}
}
if (waveNum[i] == 2) {
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 3) {
enemies[i]._xscale = 250;
enemies[i]._yscale = 250;
enemies[i]._x = enemies[i]._x - (enemySpeed / 2);
}
if (waveNum[i] == 4) {
enemies[i]._rotation = -90;
enemies[i]._y = enemies[i]._y + enemySpeed;
}
if (waveNum[i] == 4.5) {
enemies[i]._rotation = 90;
enemies[i]._y = enemies[i]._y - enemySpeed;
}
if (waveNum[i] == 5) {
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 6) {
enemies[i]._y = enemies[i]._y + 8;
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 6.5) {
enemies[i]._y = enemies[i]._y - 8;
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 7) {
enemies[i]._xscale = -250;
enemies[i]._yscale = 250;
enemies[i]._x = enemies[i]._x + (enemySpeed / 1.5);
special[i]--;
if (special[i] == 0) {
shake++;
randomNum++;
_root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
randomNum++;
enemy1 = _root.attachMovie("tinyEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x + 15, _y:enemies[i]._y});
enemies.push(enemy1);
enemyHealth.push(1);
waveNum.push(1);
randomNum++;
enemy2 = _root.attachMovie("tinyEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x - 15, _y:enemies[i]._y});
enemies.push(enemy2);
waveNum.push(1);
enemyHealth.push(1);
randomNum++;
enemy3 = _root.attachMovie("tinyEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y - 15});
enemies.push(enemy3);
enemyHealth.push(1);
waveNum.push(1);
enemies[i].removeMovieClip();
enemies.splice(i, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
}
if (waveNum[i] == 9) {
special[i]--;
enemies[i]._xscale = 250;
enemies[i]._yscale = 250;
enemies[i]._x = enemies[i]._x - (enemySpeed / 2);
if (special[i] == 0) {
randomNum++;
eBullet = _root.attachMovie("enemy_shot", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - 7;
};
}
}
i--;
}
}
function attackTimers() {
if (Start) {
attackOneTimer--;
attackOneTimer2--;
attackOneTimer3--;
attackOneTimer4--;
attackOneTimer5--;
attackOneTimer6--;
attackOneTimer7--;
attackOneTimer8--;
attackOneTimer9--;
if (attackOneTimer == 1) {
attackOneTimer = 0;
position = 1;
minus = 3;
attackOneTimer2 = 160;
}
if (attackOneTimer2 == 1) {
attackOneTimer2 = 0;
position = 1;
minus = 3;
attackOneTimer3 = 640;
}
if (attackOneTimer3 == 1) {
attackOneTimer3 = 0;
position = 1;
minus = 3;
attackOneTimer4 = 960;
}
if (attackOneTimer4 == 1) {
attackOneTimer4 = 0;
position = 1;
minus = 3;
attackOneTimer5 = 320;
}
if (attackOneTimer5 == 1) {
attackOneTimer5 = 0;
position = 1;
minus = 3;
attackOneTimer6 = 320;
}
if (attackOneTimer6 == 1) {
attackOneTimer6 = 0;
position = 1;
minus = 3;
attackOneTimer7 = 960;
}
if (attackOneTimer7 == 1) {
attackOneTimer7 = 0;
position = 1;
minus = 3;
attackOneTimer8 = 320;
}
if (attackOneTimer8 == 1) {
attackOneTimer8 = 0;
position = 1;
minus = 3;
attackOneTimer9 = 960;
}
if (attackOneTimer9 == 1) {
attackOneTimer9 = 0;
position = 1;
minus = 3;
points.removeMovieClip();
_root.attachMovie("healthBar2", "bossHealthBar", _root.getNextHighestDepth(), {_x:400, _y:20});
_root.attachMovie("barBoarder2", "barBoarder2", _root.getNextHighestDepth(), {_x:400, _y:20});
FirstBoss = _root.attachMovie("bossOne", "bossOne", _root.getNextHighestDepth(), {_x:900, _y:200});
bosses.push(FirstBoss);
bossHealth.push(100);
FirstBoss.onEnterFrame = function () {
if (this._x > 400) {
this._x = this._x - 2;
}
if (goingUp) {
if (this._x == 400) {
this._y = this._y - 1;
}
}
if (goingDown) {
if (this._x == 400) {
this._y = this._y + 1;
}
}
if (this._y == 145) {
goingUp = false;
goingDown = true;
}
if (this._y == 250) {
goingUp = true;
goingDown = false;
}
if ((timeLastEnemyAttached + 500) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
eBullet = _root.attachMovie("bossBullet", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:FirstBoss._x, _y:FirstBoss._y - 100});
eBullet.onEnterFrame = function () {
this._x = this._x - 12;
};
}
if (position == 2) {
eBullet = _root.attachMovie("bossBullet", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:FirstBoss._x, _y:FirstBoss._y});
eBullet.onEnterFrame = function () {
this._x = this._x - 18;
};
}
if (position == 1) {
eBullet = _root.attachMovie("bossBullet", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:FirstBoss._x, _y:FirstBoss._y + 100});
eBullet.onEnterFrame = function () {
this._x = this._x - 12;
};
}
enemyBullet.push(eBullet);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
};
}
}
}
function attachEnemy() {
if (Start) {
if (attackOneTimer > 0) {
if ((timeLastEnemyAttached + 250) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
enemy = _root.attachMovie("smallEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:Math.round(Math.random() * 350) + 10});
enemies.push(enemy);
waveNum.push(1);
enemyHealth.push(1);
}
}
if (attackOneTimer2 > 0) {
if ((timeLastEnemyAttached + 80) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
enemy = _root.attachMovie("smallEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:Math.round(Math.random() * 350) + 10});
enemies.push(enemy);
waveNum.push(2);
enemyHealth.push(1);
}
}
if (attackOneTimer3 > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("enemy_one", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
}
if (position == 2) {
enemy = _root.attachMovie("enemy_one", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:300});
}
if (position == 1) {
enemy = _root.attachMovie("enemy_one", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:150});
}
enemies.push(enemy);
waveNum.push(3);
enemyHealth.push(30);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
if (attackOneTimer4 > 0) {
if ((timeLastEnemyAttached + 175) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 7) {
enemy = _root.attachMovie("strangeEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:425, _y:-30});
waveNum.push(4);
}
if (position == 6) {
enemy = _root.attachMovie("strangeEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:275, _y:570});
waveNum.push(4.5);
}
if (position == 5) {
enemy = _root.attachMovie("strangeEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:125, _y:-30});
waveNum.push(4);
}
if (position == 4) {
enemy = _root.attachMovie("strangeEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:450, _y:570});
waveNum.push(4.5);
}
if (position == 3) {
enemy = _root.attachMovie("strangeEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:350, _y:-30});
waveNum.push(4);
}
if (position == 2) {
enemy = _root.attachMovie("strangeEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:200, _y:570});
waveNum.push(4.5);
}
if (position == 1) {
enemy = _root.attachMovie("strangeEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:50, _y:-30});
waveNum.push(4);
}
enemies.push(enemy);
enemyHealth.push(6);
minus--;
if (minus == 0) {
position--;
minus = 5;
}
if (position == 0) {
position = 7;
}
}
}
if (attackOneTimer5 > 0) {
if ((timeLastEnemyAttached + 80) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
enemy = _root.attachMovie("smallEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:Math.round(Math.random() * 350) + 10});
enemies.push(enemy);
waveNum.push(5);
enemyHealth.push(3);
}
}
if (attackOneTimer6 > 0) {
if ((timeLastEnemyAttached + 175) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 2) {
enemy = _root.attachMovie("enemy_one", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:440});
waveNum.push(6.5);
}
if (position == 1) {
enemy = _root.attachMovie("enemy_one", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:-40});
waveNum.push(6);
}
enemies.push(enemy);
enemyHealth.push(5);
minus--;
if (minus == 0) {
position--;
minus = 5;
}
if (position == 0) {
position = 2;
}
}
}
if (attackOneTimer7 > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("enemy_one", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:-10, _y:225});
}
if (position == 2) {
enemy = _root.attachMovie("enemy_one", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:-10, _y:300});
}
if (position == 1) {
enemy = _root.attachMovie("enemy_one", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:-10, _y:150});
}
enemies.push(enemy);
waveNum.push(7);
special.push(32);
enemyHealth.push(15);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
}
if (attackOneTimer8 > 0) {
if ((timeLastEnemyAttached + 250) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
enemy = _root.attachMovie("smallEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:Math.round(Math.random() * 350) + 10});
enemies.push(enemy);
waveNum.push(1);
enemyHealth.push(3);
}
}
if (attackOneTimer9 > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("enemy_one", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
}
if (position == 2) {
enemy = _root.attachMovie("enemy_one", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:300});
}
if (position == 1) {
enemy = _root.attachMovie("enemy_one", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:150});
}
enemies.push(enemy);
waveNum.push(9);
enemyHealth.push(30);
special.push(Math.round(Math.random() * 17) + 15);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
}
function noOverLap() {
i = enemies.length - 1;
while (i >= 0) {
j = enemies.length - 1;
while (j >= 0) {
if (!(enemies[i] === enemies[j])) {
if (enemies[i].hitTest(enemies[j])) {
endX = _root.enemies[j]._x;
endY = _root.enemies[j]._y;
enemies[i]._x = enemies[i]._x - ((endX - enemies[i]._x) / 60);
enemies[i]._y = enemies[i]._y - ((endY - enemies[i]._y) / 60);
}
}
j--;
}
i--;
}
}
function ereaseEnemyBullets() {
i = enemyBullet.length - 1;
while (i >= 0) {
if ((((enemyBullet[i]._x > 550) or (enemyBullet[i]._x < 0)) or (enemyBullet[i]._y > 400)) or (enemyBullet[i]._y < 0)) {
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
}
i--;
}
}
function ereaseBullets() {
i = bullets.length - 1;
while (i >= 0) {
if ((((bullets[i]._x > 550) or (bullets[i]._x < 0)) or (bullets[i]._y > 400)) or (bullets[i]._y < 0)) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
i--;
}
}
function ereaseEnemies() {
i = enemies.length - 1;
while (i >= 0) {
if ((((enemies[i]._x > 750) or (enemies[i]._x < -100)) or (enemies[i]._y > 600)) or (enemies[i]._y < -100)) {
enemies[i].removeMovieClip();
enemies.splice(i, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
i--;
}
}
function beingHit() {
if (alive) {
if (taking_damage) {
ouch = ouch - 1;
player.gotoAndStop("hit");
if (ouch == 0) {
taking_damage = false;
ouch = 5;
}
}
}
}
function bomb() {
if (alive) {
if (dropBomb) {
boom = boom - 1;
player.gotoAndStop("bomb");
if (boom == 0) {
dropBomb = false;
canDrop = true;
boom = 18;
bombNum--;
}
}
}
}
function playerBounds() {
if (player._x > 510) {
player._x = 510;
}
if (player._x < 40) {
player._x = 40;
}
if (player._y > 370) {
player._y = 370;
}
if (player._y < 30) {
player._y = 30;
}
}
function playerMovement() {
if (alive) {
if (!taking_damage) {
if (!dropBomb) {
if (!shooting) {
player.gotoAndStop("normal");
}
if (shooting) {
player.gotoAndStop("shooting");
}
if (Key.isDown(38) or Key.isDown(87)) {
player._y = player._y - speed;
}
if (Key.isDown(39) or Key.isDown(68)) {
player._x = player._x + speed;
}
if (Key.isDown(37) or Key.isDown(65)) {
player._x = player._x - speed;
}
if (Key.isDown(40) or Key.isDown(83)) {
player._y = player._y + speed;
}
}
}
}
}
function shaker() {
if (shake == 0) {
_root._x = 0;
_root._y = 0;
} else if (shake == 1) {
shake = shake + 1;
_root._x = _root._x + 3;
_root._y = _root._y + 3;
} else if (shake == 2) {
shake = shake + 1;
_root._y = _root._y - 5;
_root._x = _root._x - 5;
} else if (shake > 2) {
shake = 0;
_root._x = _root._x + 2;
_root._y = _root._y + 2;
}
}
function fire() {
if (shooting) {
if (gun == 0) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bullet = _root.attachMovie("standard shot_mc", "standard shot_mc" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
}
if (gun == 1) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bullet = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU);
bulletU.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 5;
};
randomNum++;
bulletD = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD);
bulletD.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 5;
};
}
}
if (gun == 2) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bulletGD = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD);
bulletGD._rotation = 90;
bulletGD.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
};
randomNum++;
bulletGU = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU);
bulletGU._rotation = -90;
bulletGU.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
};
randomNum++;
bullet = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU);
bulletU.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 5;
};
randomNum++;
bulletD = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD);
bulletD.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 5;
};
}
}
if (gun == 3) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bulletGD = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD);
bulletGD._rotation = 90;
bulletGD.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
};
randomNum++;
bulletGU = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU);
bulletGU._rotation = -90;
bulletGU.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
};
randomNum++;
bullet = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU);
bulletU.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 5;
};
randomNum++;
bulletD = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD);
bulletD.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 5;
};
randomNum++;
bulletU2 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU2);
bulletU2.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 2.5;
};
randomNum++;
bulletD3 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD3);
bulletD3.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 2.5;
};
}
}
if (gun == 4) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bulletGD2 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD2);
bulletGD2._rotation = 90;
bulletGD2.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
this._x = this._x + 5;
};
randomNum++;
bulletGU3 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU3);
bulletGU3._rotation = -90;
bulletGU3.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
this._x = this._x + 5;
};
randomNum++;
bulletGD = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD);
bulletGD._rotation = 90;
bulletGD.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
};
randomNum++;
bulletGU = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU);
bulletGU._rotation = -90;
bulletGU.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
};
randomNum++;
bullet = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU2 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU2);
bulletU2.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 2.5;
};
randomNum++;
bulletD3 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD3);
bulletD3.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 2.5;
};
randomNum++;
bulletU4 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU4);
bulletU4.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 13;
};
randomNum++;
bulletD5 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD5);
bulletD5.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 13;
};
}
}
}
}
function firing() {
if (gameOn) {
if (canDrop) {
if (Key.isDown(88)) {
if (bombNum > 0) {
dropBomb = true;
_root.attachMovie("playerEffect", "playerEffect", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
_root.attachMovie("deathBomb", "deathBomb", 2);
dropDabomb_sound.start();
canDrop = false;
}
}
}
if (Key.isDown(90) or Key.isDown(80)) {
pullitfire_sound.start();
shooting = true;
} else {
shooting = false;
}
}
}
function showBombNumber() {
if (bombNum == 3) {
bombCounter.gotoAndStop("three");
}
if (bombNum == 2) {
bombCounter.gotoAndStop("two");
}
if (bombNum == 1) {
bombCounter.gotoAndStop("one");
}
if (bombNum == 0) {
bombCounter.gotoAndStop("zero");
}
}
function StaeCompleted() {
if (completed) {
stageClear.sc.text = score;
if (score < target) {
score = score + 4;
}
if (score == target) {
if (once == 0) {
_root.attachMovie("fade", "fade", _root.getNextHighestDepth());
once = 1;
}
completedTimer++;
}
if (completedTimer == 64) {
stopAllSounds();
gameOn = false;
removeBullets();
removeenemies();
removeenemyHealth();
removewaveNum();
removespecial();
removepowerUp1();
removeEnemyBullets();
removeBoss();
removebossHealth();
removepowerbell();
backdrop.removeMovieClip();
healthBar.removeMovieClip();
barBoarder.removeMovieClip();
bombCounter.removeMovieClip();
barBoarder2.removeMovieClip();
bossHealthBar.removeMovieClip();
stageClear.removeMovieClip();
player.removeMovieClip();
_root.gotoAndStop("stage2");
}
}
}
stop();
mission = 1;
pullitfire_sound = new Sound();
pullitfire_sound.attachSound("pullitfire");
dropDabomb_sound = new Sound();
dropDabomb_sound.attachSound("dropDabomb");
collectPup_sound = new Sound();
collectPup_sound.attachSound("collectPup");
tango_sound = new Sound();
tango_sound.attachSound("soundfoe");
boom_sound = new Sound();
boom_sound.attachSound("boom");
_root.attachMovie("backdrop", "backdrop", 1);
_root.attachMovie("points", "points", _root.getNextHighestDepth(), {_x:300, _y:0});
_root.attachMovie("bombCounter", "bombCounter", _root.getNextHighestDepth(), {_x:160, _y:28});
_root.attachMovie("healthBar", "healthBar", _root.getNextHighestDepth(), {_x:20, _y:20});
_root.attachMovie("barBoarder", "barBoarder", _root.getNextHighestDepth(), {_x:18, _y:20});
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:80, _y:200});
_root.attachMovie("st1_mc", "st1_mc", _root.getNextHighestDepth(), {_x:275, _y:200});
ready = 65;
barBoarder.lvs.text = lives;
un = 1;
target = 0;
once = 0;
goingUp = true;
goingDown = false;
alive = true;
gOt = 29;
speed = 7;
bombNum = 3;
pinkCombo = 0;
blueCombo = 0;
randomNum = 0;
randomNumber = 0;
canDrop = true;
Start = false;
StartTimer = 121;
taking_damage = false;
shootingBeam = false;
bulletSpeed = 25;
completed = false;
completedTimer = 0;
ouch = 5;
shake = 0;
beamTimer = 22;
enemySpeed = 10;
playerHealth = 100;
timeOfLastShot = 0;
dropBomb = false;
boom = 18;
timeLastEnemyAttached = 0;
powerUpOnScreen = false;
shooting = false;
var bullets = new Array();
var enemies = new Array();
var enemyBullet = new Array();
var enemyHealth = new Array();
var waveNum = new Array();
var special = new Array();
var powerUp1 = new Array();
var bosses = new Array();
var bossHealth = new Array();
var powerbell = new Array();
minus = 3;
position = 1;
attackOneTimer = 320;
attackOneTimer2 = 0;
attackOneTimer3 = 0;
attackOneTimer4 = 0;
attackOneTimer5 = 0;
attackOneTimer6 = 0;
attackOneTimer7 = 0;
attackOneTimer8 = 0;
attackOneTimer9 = 0;
crosshair.onEnterFrame = function () {
this._x = _xmouse;
this._y = _ymouse;
};
player.onEnterFrame = function () {
ready--;
if (ready == 1) {
_root.attachMovie("fadeIn", "fadeIn", _root.getNextHighestDepth());
_root.attachMovie("lvl1", "lvl1", _root.getNextHighestDepth(), {_x:125, _y:150});
gameOn = true;
}
if (ready < 0) {
ready = 0;
}
if (ready == 0) {
StartTimer--;
}
if (StartTimer == 0) {
Start = true;
StartTimer = 0;
}
if (!dropBomb) {
fire();
}
if (bombNum < 0) {
bombNum == 0;
}
points.pts.text = score;
playerMovement();
firing();
ereaseBullets();
playerBounds();
attachEnemy();
enemyMovement();
noOverLap();
enemySot();
shaker();
playerHit();
beingHit();
collectPowerUp();
attackTimers();
ereaseEnemies();
death();
playersHealthBar();
bomb();
enemyHitBomb();
showBombNumber();
playerHitByEnemyBullet();
ereaseEnemyBullets();
EnemyBulletHitBomb();
BossHealthBar();
bossSot();
bossBombed();
playerHitByBoss();
collectBell();
StaeCompleted();
};
sound_contr.onEnterFrame = function () {
if (!alive) {
gOt--;
}
if (gOt < 0) {
backdrop.removeMovieClip();
healthBar.removeMovieClip();
barBoarder.removeMovieClip();
bombCounter.removeMovieClip();
barBoarder2.removeMovieClip();
bossHealthBar.removeMovieClip();
points.removeMovieClip();
player.removeMovieClip();
_root.gotoAndStop("reset");
}
};
qualityControl.onEnterFrame = function () {
if (Key.isDown(81)) {
if (num == 0) {
qset++;
num = 1;
}
} else {
num = 0;
}
if (qset == 0) {
qualityControl.qual.text = "High";
_quality = "high";
}
if (qset == 1) {
qualityControl.qual.text = "Medium";
_quality = "medium";
}
if (qset == 2) {
qualityControl.qual.text = "Low";
_quality = "low";
}
if (qset > 2) {
qset = 0;
}
};
Frame 10
function removepowerbell() {
i = powerbell.length - 1;
while (i >= 0) {
powerbell[i].removeMovieClip();
powerbell.splice(i, 1);
i--;
}
}
function removebossHealth() {
i = bossHealth.length - 1;
while (i >= 0) {
bossHealth[i].removeMovieClip();
bossHealth.splice(i, 1);
i--;
}
}
function removeBoss() {
i = bosses.length - 1;
while (i >= 0) {
bosses[i].removeMovieClip();
bosses.splice(i, 1);
i--;
}
}
function removeEnemyBullets() {
i = enemyBullet.length - 1;
while (i >= 0) {
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
i--;
}
}
function removeBullets() {
i = bullets.length - 1;
while (i >= 0) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
i--;
}
}
function removeenemies() {
i = enemies.length - 1;
while (i >= 0) {
enemies[i].removeMovieClip();
enemies.splice(i, 1);
i--;
}
}
function removeenemyHealth() {
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth[i].removeMovieClip();
enemyHealth.splice(i, 1);
i--;
}
}
function removewaveNum() {
i = waveNum.length - 1;
while (i >= 0) {
waveNum[i].removeMovieClip();
waveNum.splice(i, 1);
i--;
}
}
function removespecial() {
i = special.length - 1;
while (i >= 0) {
special[i].removeMovieClip();
special.splice(i, 1);
i--;
}
}
function removepowerUp1() {
i = powerUp1.length - 1;
while (i >= 0) {
powerUp1[i].removeMovieClip();
powerUp1.splice(i, 1);
i--;
}
}
function playersHealthBar() {
healthBar._xscale = playerHealth;
if (playerHealth < 50) {
healthBar.gotoAndStop("normal");
} else {
healthBar.gotoAndStop("max");
}
}
function BossHealthBar() {
i = bosses.length - 1;
while (i >= 0) {
bossHealthBar._xscale = bossHealth[i];
if (bossHealth[i] < 25) {
bossHealthBar.gotoAndStop("normal");
} else {
bossHealthBar.gotoAndStop("max");
}
i--;
}
}
function death() {
if (playerHealth < 1) {
playerHealth = 0;
if (un == 1) {
lives--;
un = 0;
}
removeBullets();
removeenemies();
removeenemyHealth();
removewaveNum();
removespecial();
removepowerUp1();
removeEnemyBullets();
removeBoss();
removebossHealth();
removepowerbell();
gameOn = false;
alive = false;
player.gotoAndStop("dead");
stopAllSounds();
}
}
function collectPowerUp() {
i = powerUp1.length - 1;
while (i >= 0) {
powerUp1[i]._rotation = powerUp1[i]._rotation + 10;
if (powerUp1[i].hitTest(player)) {
collectPup_sound.start();
powerUpOnScreen = false;
randomNum++;
_root.attachMovie("explosion2", "explosion2" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun++;
if (gun > 4) {
gun = 4;
}
powerUp1[i].removeMovieClip();
powerUp1.splice(i, 1);
}
i--;
}
}
function collectBell() {
i = powerbell.length - 1;
while (i >= 0) {
if (powerbell[i].hitTest(player)) {
score = score + 300;
collectPup_sound.start();
randomNum++;
bellPop = _root.attachMovie("explosion_pup", "explosion_pup" + randomNum, _root.getNextHighestDepth(), {_x:powerbell[i]._x, _y:powerbell[i]._y});
bellPop._xscale = 170;
bellPop._yscale = 170;
randomNum++;
plusTen = _root.attachMovie("plusTen", "plusTen" + randomNum, _root.getNextHighestDepth(), {_x:powerbell[i]._x, _y:powerbell[i]._y});
powerbell[i].removeMovieClip();
powerbell.splice(i, 1);
}
i--;
}
}
function dropBell() {
randomNumber++;
bell = _root.attachMovie("bell", "bell" + randomNumber, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
powerbell.push(bell);
bell._xscale = 170;
bell._yscale = 170;
bell.onEnterFrame = function () {
endX = _root.player._x;
endY = _root.player._y;
this._x = this._x + ((endX - this._x) / 150);
this._y = this._y + ((endY - this._y) / 150);
};
}
function dropPowerUp() {
randomNumber++;
StarShot = _root.attachMovie("pup", "star" + randomNumber, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
powerUp1.push(StarShot);
StarShot.onEnterFrame = function () {
endX = _root.player._x;
endY = _root.player._y;
this._x = this._x + ((endX - this._x) / 30);
this._y = this._y + ((endY - this._y) / 30);
};
}
function playerHitByEnemyBullet() {
i = enemyBullet.length - 1;
while (i >= 0) {
if (enemyBullet[i].hitTest(player)) {
randomNum++;
_root.attachMovie("playerEffect", "playerEffect" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun--;
if (gun < 0) {
gun = 0;
}
taking_damage = true;
playerHealth = playerHealth - 10;
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
}
i--;
}
}
function playerHitByBoss() {
i = bosses.length - 1;
while (i >= 0) {
if (bosses[i].hitTest(player)) {
randomNum++;
_root.attachMovie("playerEffect", "playerEffect" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun--;
if (gun < 0) {
gun = 0;
}
taking_damage = true;
playerHealth = playerHealth - 10;
player._x = player._x - 10;
}
i--;
}
}
function playerHit() {
i = enemies.length - 1;
while (i >= 0) {
if (enemies[i].hitTest(player)) {
randomNum++;
_root.attachMovie("playerEffect", "playerEffect" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun--;
if (gun < 0) {
gun = 0;
}
taking_damage = true;
playerHealth = playerHealth - 10;
tango_sound.start();
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
explosion._xscale = enemies[i]._xscale;
explosion._yscale = enemies[i]._yscale;
enemies[i].removeMovieClip();
enemies.splice(i, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
i--;
}
}
function EnemyBulletHitBomb() {
i = enemyBullet.length - 1;
while (i >= 0) {
if (enemyBullet[i].hitTest(deathBomb)) {
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
}
i--;
}
}
function enemyHitBomb() {
i = enemies.length - 1;
while (i >= 0) {
if (enemies[i].hitTest(deathBomb)) {
enemies[i].gotoAndPlay("hit");
enemyHealth[i] = enemyHealth[i] - 10;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (enemyHealth[i] < 1) {
score = score + 10;
tango_sound.start();
if (!powerUpOnScreen) {
dir = ["drop", "dropBell", "dropBell2", "dropBell3", "null4", "null5", "null6", "null7", "null8", "null9", "null10"];
randNum = random(10);
setDir = dir[randNum];
switch (setDir) {
case "drop" :
if (gun < 4) {
dropPowerUp();
powerUpOnScreen = true;
}
break;
case "dropBell" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell2" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell3" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "null4" :
break;
case "null5" :
break;
case "null6" :
break;
case "null7" :
break;
case "null8" :
break;
case "null9" :
break;
case "null10" :
}
}
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
explosion._xscale = enemies[i]._xscale;
explosion._yscale = enemies[i]._yscale;
enemies[i].removeMovieClip();
enemies.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
}
i--;
}
}
function bossBombed() {
i = bosses.length - 1;
while (i >= 0) {
if (bosses[i].hitTest(deathBomb)) {
bosses[i].gotoAndPlay("hit");
bossHealth[i] = bossHealth[i] - 1;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (bossHealth[i] < 1) {
boom_sound.start();
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
explosion._xscale = 350;
explosion._yscale = 350;
bosses[i].removeMovieClip();
bosses.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
bossHealth.splice(i, 1);
completed = true;
_root.attachMovie("stageClear", "stageClear", _root.getNextHighestDepth(), {_x:125, _y:150});
target = score + 2000;
}
}
i--;
}
}
function bossSot() {
i = bosses.length - 1;
while (i >= 0) {
j = bullets.length - 1;
while (j >= 0) {
if (bosses[i].hitTest(bullets[j])) {
bosses[i].gotoAndPlay("hit");
bossHealth[i] = bossHealth[i] - 0.1;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (bossHealth[i] < 1) {
barBoarder2.removeMovieClip();
bossHealthBar.removeMovieClip();
boom_sound.start();
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
explosion._xscale = 350;
explosion._yscale = 350;
bosses[i].removeMovieClip();
bosses.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
bossHealth.splice(i, 1);
completed = true;
_root.attachMovie("stageClear", "stageClear", _root.getNextHighestDepth(), {_x:125, _y:150});
target = score + 2000;
}
}
j--;
}
i--;
}
}
function enemySot() {
i = enemies.length - 1;
while (i >= 0) {
j = bullets.length - 1;
while (j >= 0) {
if (enemies[i].hitTest(bullets[j]) or enemies[i].hitTest(deathBomb)) {
score = score + 5;
enemies[i].gotoAndPlay("hit");
enemyHealth[i] = enemyHealth[i] - 1;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (enemyHealth[i] < 1) {
score = score + 10;
tango_sound.start();
if (!powerUpOnScreen) {
dir = ["drop", "dropBell", "dropBell2", "dropBell3", "null4", "null5", "null6", "null7", "null8", "null9", "null10"];
randNum = random(10);
setDir = dir[randNum];
switch (setDir) {
case "drop" :
if (gun < 4) {
dropPowerUp();
powerUpOnScreen = true;
}
break;
case "dropBell" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell2" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell3" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "null4" :
break;
case "null5" :
break;
case "null6" :
break;
case "null7" :
break;
case "null8" :
break;
case "null9" :
break;
case "null10" :
}
}
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
explosion._xscale = enemies[i]._xscale;
explosion._yscale = enemies[i]._yscale;
enemies[i].removeMovieClip();
enemies.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
}
j--;
}
i--;
}
}
function enemyMovement() {
i = enemies.length - 1;
while (i >= 0) {
if (waveNum[i] == 1) {
endX = _root.player._x;
endY = _root.player._y;
enemies[i]._x = enemies[i]._x + ((endX - enemies[i]._x) / 60);
enemies[i]._y = enemies[i]._y + ((endY - enemies[i]._y) / 60);
if (player._x > enemies[i]._x) {
enemies[i]._xscale = -100;
} else {
enemies[i]._xscale = 100;
}
special[i]--;
if (special[i] == 0) {
randomNum++;
eBullet = _root.attachMovie("enemy_shot", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - 7;
};
}
}
if (waveNum[i] == 2) {
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 3) {
enemies[i]._x = enemies[i]._x - (enemySpeed / 2);
special[i]--;
if (special[i] == 0) {
randomNum++;
eBullet = _root.attachMovie("bossBullet", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - 15;
};
}
}
if (waveNum[i] == 4) {
enemies[i]._x = enemies[i]._x - (enemySpeed / 2);
special[i]--;
if (special[i] == 0) {
randomNum++;
eBullet = _root.attachMovie("enemy_shot", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - 7;
};
}
}
if (waveNum[i] == 4.5) {
enemies[i]._x = enemies[i]._x - (enemySpeed * 2);
}
if (waveNum[i] == 5) {
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 6) {
enemies[i]._y = enemies[i]._y + 8;
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 6.5) {
enemies[i]._y = enemies[i]._y - 8;
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 7) {
enemies[i]._xscale = -250;
enemies[i]._yscale = 250;
enemies[i]._x = enemies[i]._x + (enemySpeed / 1.5);
special[i]--;
if (special[i] == 0) {
shake++;
randomNum++;
_root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
randomNum++;
enemy1 = _root.attachMovie("tinyEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x + 15, _y:enemies[i]._y});
enemies.push(enemy1);
enemyHealth.push(1);
waveNum.push(1);
randomNum++;
enemy2 = _root.attachMovie("tinyEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x - 15, _y:enemies[i]._y});
enemies.push(enemy2);
waveNum.push(1);
enemyHealth.push(1);
randomNum++;
enemy3 = _root.attachMovie("tinyEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y - 15});
enemies.push(enemy3);
enemyHealth.push(1);
waveNum.push(1);
enemies[i].removeMovieClip();
enemies.splice(i, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
}
if (waveNum[i] == 9) {
special[i]--;
enemies[i]._x = enemies[i]._x - enemySpeed;
if (special[i] == 0) {
randomNum++;
eBullet = _root.attachMovie("bossBullet", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - 15;
};
}
}
i--;
}
}
function attackTimers() {
if (Start) {
attackOneTimer--;
attackOneTimer2--;
attackOneTimer3--;
attackOneTimer4--;
attackOneTimer5--;
attackOneTimer6--;
attackOneTimer7--;
attackOneTimer8--;
attackOneTimer9--;
if (attackOneTimer == 1) {
attackOneTimer = 0;
position = 1;
minus = 3;
attackOneTimer2 = 160;
}
if (attackOneTimer2 == 1) {
attackOneTimer2 = 0;
position = 1;
minus = 3;
attackOneTimer3 = 640;
}
if (attackOneTimer3 == 1) {
attackOneTimer3 = 0;
position = 1;
minus = 3;
attackOneTimer4 = 960;
}
if (attackOneTimer4 == 1) {
attackOneTimer4 = 0;
position = 1;
minus = 3;
attackOneTimer5 = 320;
}
if (attackOneTimer5 == 1) {
attackOneTimer5 = 0;
position = 1;
minus = 3;
attackOneTimer6 = 320;
}
if (attackOneTimer6 == 1) {
attackOneTimer6 = 0;
position = 1;
minus = 3;
attackOneTimer7 = 960;
}
if (attackOneTimer7 == 1) {
attackOneTimer7 = 0;
position = 1;
minus = 3;
attackOneTimer8 = 320;
}
if (attackOneTimer8 == 1) {
attackOneTimer8 = 0;
position = 1;
minus = 3;
attackOneTimer9 = 960;
}
if (attackOneTimer9 == 1) {
attackOneTimer9 = 0;
position = 1;
minus = 3;
points.removeMovieClip();
_root.attachMovie("healthBar2", "bossHealthBar", _root.getNextHighestDepth(), {_x:400, _y:20});
_root.attachMovie("barBoarder2", "barBoarder2", _root.getNextHighestDepth(), {_x:400, _y:20});
SecondBoss = _root.attachMovie("bossTwo", "bossTwo", _root.getNextHighestDepth(), {_x:900, _y:200});
bosses.push(SecondBoss);
bossHealth.push(100);
SecondBoss.onEnterFrame = function () {
if (this._x > 400) {
this._x = this._x - 2;
}
if (goingUp) {
if (this._x == 400) {
this._y = this._y - 1;
}
}
if (goingDown) {
if (this._x == 400) {
this._y = this._y + 1;
}
}
if (this._y == 145) {
goingUp = false;
goingDown = true;
}
if (this._y == 250) {
goingUp = true;
goingDown = false;
}
specialAttackTimer--;
if (specialAttackTimer < 0) {
if ((timeLastEnemyAttached + 100) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
eBullet = _root.attachMovie("bossBullet2", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:SecondBoss._x, _y:SecondBoss._y - 100});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - 12;
};
randomNum++;
eBullet = _root.attachMovie("bossBullet2", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:SecondBoss._x, _y:SecondBoss._y + 100});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - 12;
};
}
}
if (specialAttackTimer == -96) {
sickEmBoys();
specialAttackTimer = 64;
}
};
}
}
}
function sickEmBoys() {
i = bosses.length - 1;
while (i >= 0) {
randomNum++;
bulletGD2 = _root.attachMovie("bossBullet2", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
enemyBullet.push(bulletGD2);
bulletGD2._rotation = 90;
bulletGD2.onEnterFrame = function () {
this._y = this._y + 5;
this._x = this._x - 1;
};
randomNum++;
bulletGU3 = _root.attachMovie("bossBullet2", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
enemyBullet.push(bulletGU3);
bulletGU3._rotation = -90;
bulletGU3.onEnterFrame = function () {
this._y = this._y - 5;
this._x = this._x - 1;
};
randomNum++;
bulletU2 = _root.attachMovie("bossBullet2", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
enemyBullet.push(bulletU2);
bulletU2.onEnterFrame = function () {
this._x = this._x - 3;
this._y = this._y + 1;
};
randomNum++;
bulletD3 = _root.attachMovie("bossBullet2", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
enemyBullet.push(bulletD3);
bulletD3.onEnterFrame = function () {
this._x = this._x - 3;
this._y = this._y - 1;
};
randomNum++;
bulletU4 = _root.attachMovie("bossBullet2", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
enemyBullet.push(bulletU4);
bulletU4.onEnterFrame = function () {
this._x = this._x - 7;
this._y = this._y + 4;
};
randomNum++;
bulletD5 = _root.attachMovie("bossBullet2", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
enemyBullet.push(bulletD5);
bulletD5.onEnterFrame = function () {
this._x = this._x - 7;
this._y = this._y - 4;
};
i--;
}
}
function attachEnemy() {
if (Start) {
if (attackOneTimer > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("smallEnemy2", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
}
if (position == 2) {
enemy = _root.attachMovie("smallEnemy2", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:300});
}
if (position == 1) {
enemy = _root.attachMovie("smallEnemy2", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:150});
}
enemies.push(enemy);
waveNum.push(9);
enemyHealth.push(5);
special.push(Math.round(Math.random() * 17) + 15);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
if (attackOneTimer2 > 0) {
if ((timeLastEnemyAttached + 80) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
enemy = _root.attachMovie("midgetEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:Math.round(Math.random() * 350) + 10});
enemies.push(enemy);
waveNum.push(2);
enemyHealth.push(5);
special.push(Math.round(Math.random() * 17) + 15);
}
}
if (attackOneTimer3 > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("lineEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
}
if (position == 2) {
enemy = _root.attachMovie("lineEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:300});
}
if (position == 1) {
enemy = _root.attachMovie("lineEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:150});
}
enemies.push(enemy);
waveNum.push(3);
enemyHealth.push(30);
special.push(Math.round(Math.random() * 17) + 15);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
if (attackOneTimer4 > 0) {
if ((timeLastEnemyAttached + 175) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 7) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:280});
waveNum.push(4);
}
if (position == 6) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:200});
waveNum.push(4.5);
}
if (position == 5) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
waveNum.push(4);
}
if (position == 4) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:250});
waveNum.push(4.5);
}
if (position == 3) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:275});
waveNum.push(4);
}
if (position == 2) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:50});
waveNum.push(4.5);
}
if (position == 1) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:350});
waveNum.push(4);
}
special.push(Math.round(Math.random() * 17) + 15);
enemies.push(enemy);
enemyHealth.push(6);
minus--;
if (minus == 0) {
position--;
minus = 5;
}
if (position == 0) {
position = 7;
}
}
}
if (attackOneTimer5 > 0) {
if ((timeLastEnemyAttached + 80) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
enemy = _root.attachMovie("smallEnemy2", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:Math.round(Math.random() * 350) + 10});
enemies.push(enemy);
special.push(Math.round(Math.random() * 17) + 15);
waveNum.push(1);
enemyHealth.push(3);
}
}
if (attackOneTimer6 > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
}
if (position == 2) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:300});
}
if (position == 1) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:150});
}
enemy._xscale = 250;
enemy._yscale = 250;
enemies.push(enemy);
waveNum.push(3);
enemyHealth.push(30);
special.push(Math.round(Math.random() * 17) + 15);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
if (attackOneTimer7 > 0) {
if ((timeLastEnemyAttached + 250) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
enemy = _root.attachMovie("midgetEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:Math.round(Math.random() * 350) + 10});
enemies.push(enemy);
waveNum.push(4);
enemyHealth.push(5);
special.push(Math.round(Math.random() * 17) + 15);
}
}
}
if (attackOneTimer8 > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
}
if (position == 2) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:300});
}
if (position == 1) {
enemy = _root.attachMovie("redEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:150});
}
enemy._xscale = 250;
enemy._yscale = 250;
enemies.push(enemy);
waveNum.push(3);
enemyHealth.push(30);
special.push(Math.round(Math.random() * 17) + 15);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
if (attackOneTimer9 > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("lineEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
}
if (position == 2) {
enemy = _root.attachMovie("lineEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:300});
}
if (position == 1) {
enemy = _root.attachMovie("lineEnemy_mc", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:150});
}
enemies.push(enemy);
waveNum.push(9);
enemyHealth.push(30);
special.push(Math.round(Math.random() * 17) + 15);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
}
function noOverLap() {
i = enemies.length - 1;
while (i >= 0) {
j = enemies.length - 1;
while (j >= 0) {
if (!(enemies[i] === enemies[j])) {
if (enemies[i].hitTest(enemies[j])) {
endX = _root.enemies[j]._x;
endY = _root.enemies[j]._y;
enemies[i]._x = enemies[i]._x - ((endX - enemies[i]._x) / 60);
enemies[i]._y = enemies[i]._y - ((endY - enemies[i]._y) / 60);
}
}
j--;
}
i--;
}
}
function ereaseEnemyBullets() {
i = enemyBullet.length - 1;
while (i >= 0) {
if ((((enemyBullet[i]._x > 550) or (enemyBullet[i]._x < 0)) or (enemyBullet[i]._y > 400)) or (enemyBullet[i]._y < 0)) {
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
}
i--;
}
}
function ereaseBullets() {
i = bullets.length - 1;
while (i >= 0) {
if ((((bullets[i]._x > 550) or (bullets[i]._x < 0)) or (bullets[i]._y > 400)) or (bullets[i]._y < 0)) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
i--;
}
}
function ereaseEnemies() {
i = enemies.length - 1;
while (i >= 0) {
if ((((enemies[i]._x > 750) or (enemies[i]._x < -100)) or (enemies[i]._y > 600)) or (enemies[i]._y < -100)) {
enemies[i].removeMovieClip();
enemies.splice(i, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
i--;
}
}
function beingHit() {
if (alive) {
if (taking_damage) {
ouch = ouch - 1;
player.gotoAndStop("hit");
if (ouch == 0) {
taking_damage = false;
ouch = 5;
}
}
}
}
function bomb() {
if (alive) {
if (dropBomb) {
boom = boom - 1;
player.gotoAndStop("bomb");
if (boom == 0) {
dropBomb = false;
canDrop = true;
boom = 18;
bombNum--;
}
}
}
}
function playerBounds() {
if (player._x > 510) {
player._x = 510;
}
if (player._x < 40) {
player._x = 40;
}
if (player._y > 370) {
player._y = 370;
}
if (player._y < 30) {
player._y = 30;
}
}
function playerMovement() {
if (alive) {
if (!taking_damage) {
if (!dropBomb) {
if (!shooting) {
player.gotoAndStop("normal");
}
if (shooting) {
player.gotoAndStop("shooting");
}
if (Key.isDown(38)) {
player._y = player._y - speed;
}
if (Key.isDown(39)) {
player._x = player._x + speed;
}
if (Key.isDown(37)) {
player._x = player._x - speed;
}
if (Key.isDown(40)) {
player._y = player._y + speed;
}
}
}
}
}
function shaker() {
if (shake == 0) {
_root._x = 0;
_root._y = 0;
} else if (shake == 1) {
shake = shake + 1;
_root._x = _root._x + 3;
_root._y = _root._y + 3;
} else if (shake == 2) {
shake = shake + 1;
_root._y = _root._y - 5;
_root._x = _root._x - 5;
} else if (shake > 2) {
shake = 0;
_root._x = _root._x + 2;
_root._y = _root._y + 2;
}
}
function fire() {
if (shooting) {
if (gun == 0) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bullet = _root.attachMovie("standard shot_mc", "standard shot_mc" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
}
if (gun == 1) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bullet = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU);
bulletU.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 5;
};
randomNum++;
bulletD = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD);
bulletD.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 5;
};
}
}
if (gun == 2) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bulletGD = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD);
bulletGD._rotation = 90;
bulletGD.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
};
randomNum++;
bulletGU = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU);
bulletGU._rotation = -90;
bulletGU.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
};
randomNum++;
bullet = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU);
bulletU.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 5;
};
randomNum++;
bulletD = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD);
bulletD.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 5;
};
}
}
if (gun == 3) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bulletGD = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD);
bulletGD._rotation = 90;
bulletGD.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
};
randomNum++;
bulletGU = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU);
bulletGU._rotation = -90;
bulletGU.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
};
randomNum++;
bullet = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU);
bulletU.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 5;
};
randomNum++;
bulletD = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD);
bulletD.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 5;
};
randomNum++;
bulletU2 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU2);
bulletU2.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 2.5;
};
randomNum++;
bulletD3 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD3);
bulletD3.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 2.5;
};
}
}
if (gun == 4) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bulletGD2 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD2);
bulletGD2._rotation = 90;
bulletGD2.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
this._x = this._x + 5;
};
randomNum++;
bulletGU3 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU3);
bulletGU3._rotation = -90;
bulletGU3.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
this._x = this._x + 5;
};
randomNum++;
bulletGD = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD);
bulletGD._rotation = 90;
bulletGD.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
};
randomNum++;
bulletGU = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU);
bulletGU._rotation = -90;
bulletGU.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
};
randomNum++;
bullet = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU2 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU2);
bulletU2.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 2.5;
};
randomNum++;
bulletD3 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD3);
bulletD3.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 2.5;
};
randomNum++;
bulletU4 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU4);
bulletU4.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 13;
};
randomNum++;
bulletD5 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD5);
bulletD5.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 13;
};
}
}
}
}
function firing() {
if (gameOn) {
if (canDrop) {
if (Key.isDown(88)) {
if (bombNum > 0) {
dropBomb = true;
_root.attachMovie("playerEffect", "playerEffect", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
_root.attachMovie("deathBomb", "deathBomb", 2);
dropDabomb_sound.start();
canDrop = false;
}
}
}
if (Key.isDown(90)) {
pullitfire_sound.start();
shooting = true;
} else {
shooting = false;
}
}
}
function showBombNumber() {
if (bombNum == 3) {
bombCounter.gotoAndStop("three");
}
if (bombNum == 2) {
bombCounter.gotoAndStop("two");
}
if (bombNum == 1) {
bombCounter.gotoAndStop("one");
}
if (bombNum == 0) {
bombCounter.gotoAndStop("zero");
}
}
function StaeCompleted() {
if (completed) {
stageClear.sc.text = score;
if (score < target) {
score = score + 4;
}
if (score == target) {
if (once == 0) {
_root.attachMovie("fade", "fade", _root.getNextHighestDepth());
once = 1;
}
completedTimer++;
}
if (completedTimer == 64) {
stopAllSounds();
gameOn = false;
removeBullets();
removeenemies();
removeenemyHealth();
removewaveNum();
removespecial();
removepowerUp1();
removeEnemyBullets();
removeBoss();
removebossHealth();
removepowerbell();
background2.removeMovieClip();
healthBar.removeMovieClip();
barBoarder.removeMovieClip();
bombCounter.removeMovieClip();
barBoarder2.removeMovieClip();
bossHealthBar.removeMovieClip();
stageClear.removeMovieClip();
player.removeMovieClip();
_root.gotoAndStop("stage3");
}
}
}
stop();
mission = 2;
pullitfire_sound = new Sound();
pullitfire_sound.attachSound("pullitfire");
dropDabomb_sound = new Sound();
dropDabomb_sound.attachSound("dropDabomb");
collectPup_sound = new Sound();
collectPup_sound.attachSound("collectPup");
tango_sound = new Sound();
tango_sound.attachSound("soundfoe");
boom_sound = new Sound();
boom_sound.attachSound("boom");
_root.attachMovie("background2", "background2", 1);
_root.attachMovie("points", "points", _root.getNextHighestDepth(), {_x:300, _y:0});
_root.attachMovie("bombCounter", "bombCounter", _root.getNextHighestDepth(), {_x:160, _y:28});
_root.attachMovie("healthBar", "healthBar", _root.getNextHighestDepth(), {_x:20, _y:20});
_root.attachMovie("barBoarder", "barBoarder", _root.getNextHighestDepth(), {_x:18, _y:20});
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:80, _y:200});
_root.attachMovie("st2_mc", "st2_mc", _root.getNextHighestDepth(), {_x:275, _y:200});
ready = 65;
barBoarder.lvs.text = lives;
un = 1;
target = 0;
once = 0;
goingUp = true;
goingDown = false;
alive = true;
gOt = 29;
speed = 7;
bombNum = 3;
pinkCombo = 0;
blueCombo = 0;
randomNum = 0;
randomNumber = 0;
canDrop = true;
Start = false;
StartTimer = 121;
taking_damage = false;
shootingBeam = false;
bulletSpeed = 25;
completed = false;
completedTimer = 0;
ouch = 5;
shake = 0;
beamTimer = 22;
enemySpeed = 10;
playerHealth = 100;
timeOfLastShot = 0;
dropBomb = false;
boom = 18;
specialAttackTimer = 64;
timeLastEnemyAttached = 0;
powerUpOnScreen = false;
shooting = false;
var bullets = new Array();
var enemies = new Array();
var enemyBullet = new Array();
var enemyHealth = new Array();
var waveNum = new Array();
var special = new Array();
var powerUp1 = new Array();
var bosses = new Array();
var bossHealth = new Array();
var powerbell = new Array();
minus = 3;
position = 1;
attackOneTimer = 320;
attackOneTimer2 = 0;
attackOneTimer3 = 0;
attackOneTimer4 = 0;
attackOneTimer5 = 0;
attackOneTimer6 = 0;
attackOneTimer7 = 0;
attackOneTimer8 = 0;
attackOneTimer9 = 0;
crosshair.onEnterFrame = function () {
this._x = _xmouse;
this._y = _ymouse;
};
player.onEnterFrame = function () {
ready--;
if (ready == 1) {
_root.attachMovie("fadeIn", "fadeIn", _root.getNextHighestDepth());
_root.attachMovie("lvl2", "lvl2", _root.getNextHighestDepth(), {_x:125, _y:150});
gameOn = true;
}
if (ready < 0) {
ready = 0;
}
if (ready == 0) {
StartTimer--;
}
if (StartTimer == 0) {
Start = true;
StartTimer = 0;
}
if (!dropBomb) {
fire();
}
if (bombNum < 0) {
bombNum == 0;
}
points.pts.text = score;
playerMovement();
firing();
ereaseBullets();
playerBounds();
attachEnemy();
enemyMovement();
noOverLap();
enemySot();
shaker();
playerHit();
beingHit();
collectPowerUp();
attackTimers();
ereaseEnemies();
death();
playersHealthBar();
bomb();
enemyHitBomb();
showBombNumber();
playerHitByEnemyBullet();
ereaseEnemyBullets();
EnemyBulletHitBomb();
BossHealthBar();
bossSot();
bossBombed();
playerHitByBoss();
collectBell();
StaeCompleted();
};
sound_contr.onEnterFrame = function () {
if (!alive) {
gOt--;
}
if (gOt < 0) {
background2.removeMovieClip();
healthBar.removeMovieClip();
barBoarder.removeMovieClip();
bombCounter.removeMovieClip();
barBoarder2.removeMovieClip();
bossHealthBar.removeMovieClip();
points.removeMovieClip();
player.removeMovieClip();
_root.gotoAndPlay("reset");
}
};
qualityControl.onEnterFrame = function () {
if (Key.isDown(81)) {
if (num == 0) {
qset++;
num = 1;
}
} else {
num = 0;
}
if (qset == 0) {
qualityControl.qual.text = "High";
_quality = "high";
}
if (qset == 1) {
qualityControl.qual.text = "Medium";
_quality = "medium";
}
if (qset == 2) {
qualityControl.qual.text = "Low";
_quality = "low";
}
if (qset > 2) {
qset = 0;
}
};
Frame 11
function removepowerbell() {
i = powerbell.length - 1;
while (i >= 0) {
powerbell[i].removeMovieClip();
powerbell.splice(i, 1);
i--;
}
}
function removebossHealth() {
i = bossHealth.length - 1;
while (i >= 0) {
bossHealth[i].removeMovieClip();
bossHealth.splice(i, 1);
i--;
}
}
function removeBoss() {
i = bosses.length - 1;
while (i >= 0) {
bosses[i].removeMovieClip();
bosses.splice(i, 1);
i--;
}
}
function removeEnemyBullets() {
i = enemyBullet.length - 1;
while (i >= 0) {
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
i--;
}
}
function removeBullets() {
i = bullets.length - 1;
while (i >= 0) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
i--;
}
}
function removeenemies() {
i = enemies.length - 1;
while (i >= 0) {
enemies[i].removeMovieClip();
enemies.splice(i, 1);
i--;
}
}
function removeenemyHealth() {
i = enemyHealth.length - 1;
while (i >= 0) {
enemyHealth[i].removeMovieClip();
enemyHealth.splice(i, 1);
i--;
}
}
function removewaveNum() {
i = waveNum.length - 1;
while (i >= 0) {
waveNum[i].removeMovieClip();
waveNum.splice(i, 1);
i--;
}
}
function removespecial() {
i = special.length - 1;
while (i >= 0) {
special[i].removeMovieClip();
special.splice(i, 1);
i--;
}
}
function removepowerUp1() {
i = powerUp1.length - 1;
while (i >= 0) {
powerUp1[i].removeMovieClip();
powerUp1.splice(i, 1);
i--;
}
}
function playersHealthBar() {
healthBar._xscale = playerHealth;
if (playerHealth < 50) {
healthBar.gotoAndStop("normal");
} else {
healthBar.gotoAndStop("max");
}
}
function BossHealthBar() {
i = bosses.length - 1;
while (i >= 0) {
bossHealthBar._xscale = bossHealth[i];
if (bossHealth[i] < 25) {
bossHealthBar.gotoAndStop("normal");
} else {
bossHealthBar.gotoAndStop("max");
}
i--;
}
}
function death() {
if (playerHealth < 1) {
playerHealth = 0;
if (un == 1) {
lives--;
un = 0;
}
removeBullets();
removeenemies();
removeenemyHealth();
removewaveNum();
removespecial();
removepowerUp1();
removeEnemyBullets();
removeBoss();
removebossHealth();
removepowerbell();
gameOn = false;
alive = false;
player.gotoAndStop("dead");
stopAllSounds();
}
}
function collectPowerUp() {
i = powerUp1.length - 1;
while (i >= 0) {
powerUp1[i]._rotation = powerUp1[i]._rotation + 10;
if (powerUp1[i].hitTest(player)) {
collectPup_sound.start();
powerUpOnScreen = false;
randomNum++;
_root.attachMovie("explosion2", "explosion2" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun++;
if (gun > 4) {
gun = 4;
}
powerUp1[i].removeMovieClip();
powerUp1.splice(i, 1);
}
i--;
}
}
function collectBell() {
i = powerbell.length - 1;
while (i >= 0) {
if (powerbell[i].hitTest(player)) {
score = score + 300;
collectPup_sound.start();
randomNum++;
bellPop = _root.attachMovie("explosion_pup", "explosion_pup" + randomNum, _root.getNextHighestDepth(), {_x:powerbell[i]._x, _y:powerbell[i]._y});
bellPop._xscale = 170;
bellPop._yscale = 170;
randomNum++;
plusTen = _root.attachMovie("plusTen", "plusTen" + randomNum, _root.getNextHighestDepth(), {_x:powerbell[i]._x, _y:powerbell[i]._y});
powerbell[i].removeMovieClip();
powerbell.splice(i, 1);
}
i--;
}
}
function dropBell() {
randomNumber++;
bell = _root.attachMovie("bell", "bell" + randomNumber, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
powerbell.push(bell);
bell._xscale = 170;
bell._yscale = 170;
bell.onEnterFrame = function () {
endX = _root.player._x;
endY = _root.player._y;
this._x = this._x + ((endX - this._x) / 150);
this._y = this._y + ((endY - this._y) / 150);
};
}
function dropPowerUp() {
randomNumber++;
StarShot = _root.attachMovie("pup", "star" + randomNumber, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
powerUp1.push(StarShot);
StarShot.onEnterFrame = function () {
endX = _root.player._x;
endY = _root.player._y;
this._x = this._x + ((endX - this._x) / 30);
this._y = this._y + ((endY - this._y) / 30);
};
}
function playerHitByEnemyBullet() {
i = enemyBullet.length - 1;
while (i >= 0) {
if (enemyBullet[i].hitTest(player)) {
randomNum++;
_root.attachMovie("playerEffect", "playerEffect" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun--;
if (gun < 0) {
gun = 0;
}
taking_damage = true;
playerHealth = playerHealth - 10;
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
}
i--;
}
}
function playerHitByBoss() {
i = bosses.length - 1;
while (i >= 0) {
if (bosses[i].hitTest(player)) {
randomNum++;
_root.attachMovie("playerEffect", "playerEffect" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun--;
if (gun < 0) {
gun = 0;
}
taking_damage = true;
playerHealth = playerHealth - 10;
player._x = player._x - 10;
}
i--;
}
}
function playerHit() {
i = enemies.length - 1;
while (i >= 0) {
if (enemies[i].hitTest(player)) {
randomNum++;
_root.attachMovie("playerEffect", "playerEffect" + randomNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
gun--;
if (gun < 0) {
gun = 0;
}
taking_damage = true;
playerHealth = playerHealth - 10;
tango_sound.start();
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
explosion._xscale = enemies[i]._xscale;
explosion._yscale = enemies[i]._yscale;
enemies[i].removeMovieClip();
enemies.splice(i, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
i--;
}
}
function EnemyBulletHitBomb() {
i = enemyBullet.length - 1;
while (i >= 0) {
if (enemyBullet[i].hitTest(deathBomb)) {
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
}
i--;
}
}
function enemyHitBomb() {
i = enemies.length - 1;
while (i >= 0) {
if (enemies[i].hitTest(deathBomb)) {
enemies[i].gotoAndPlay("hit");
enemyHealth[i] = enemyHealth[i] - 10;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (enemyHealth[i] < 1) {
score = score + 10;
tango_sound.start();
if (!powerUpOnScreen) {
dir = ["drop", "dropBell", "dropBell2", "dropBell3", "null4", "null5", "null6", "null7", "null8", "null9", "null10"];
randNum = random(10);
setDir = dir[randNum];
switch (setDir) {
case "drop" :
if (gun < 4) {
dropPowerUp();
powerUpOnScreen = true;
}
break;
case "dropBell" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell2" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell3" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "null4" :
break;
case "null5" :
break;
case "null6" :
break;
case "null7" :
break;
case "null8" :
break;
case "null9" :
break;
case "null10" :
}
}
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
explosion._xscale = enemies[i]._xscale;
explosion._yscale = enemies[i]._yscale;
enemies[i].removeMovieClip();
enemies.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
}
i--;
}
}
function bossBombed() {
i = bosses.length - 1;
while (i >= 0) {
if (bosses[i].hitTest(deathBomb)) {
bosses[i].gotoAndPlay("hit");
bossHealth[i] = bossHealth[i] - 1;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (bossHealth[i] < 1) {
boom_sound.start();
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
explosion._xscale = 350;
explosion._yscale = 350;
bosses[i].removeMovieClip();
bosses.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
bossHealth.splice(i, 1);
completed = true;
_root.attachMovie("stageClear", "stageClear", _root.getNextHighestDepth(), {_x:125, _y:150});
target = score + 3500;
}
}
i--;
}
}
function bossSot() {
i = bosses.length - 1;
while (i >= 0) {
j = bullets.length - 1;
while (j >= 0) {
if (bosses[i].hitTest(bullets[j])) {
bosses[i].gotoAndPlay("hit");
bossHealth[i] = bossHealth[i] - 0.1;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (bossHealth[i] < 1) {
barBoarder2.removeMovieClip();
bossHealthBar.removeMovieClip();
boom_sound.start();
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y});
explosion._xscale = 350;
explosion._yscale = 350;
bosses[i].removeMovieClip();
bosses.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
bossHealth.splice(i, 1);
completed = true;
_root.attachMovie("stageClear", "stageClear", _root.getNextHighestDepth(), {_x:125, _y:150});
target = score + 3500;
}
}
j--;
}
i--;
}
}
function enemySot() {
i = enemies.length - 1;
while (i >= 0) {
j = bullets.length - 1;
while (j >= 0) {
if (enemies[i].hitTest(bullets[j]) or enemies[i].hitTest(deathBomb)) {
score = score + 5;
enemies[i].gotoAndPlay("hit");
enemyHealth[i] = enemyHealth[i] - 1;
bullets[j].removeMovieClip();
bullets.splice(j, 1);
if (enemyHealth[i] < 1) {
score = score + 10;
tango_sound.start();
if (!powerUpOnScreen) {
dir = ["drop", "dropBell", "dropBell2", "dropBell3", "null4", "null5", "null6", "null7", "null8", "null9", "null10"];
randNum = random(10);
setDir = dir[randNum];
switch (setDir) {
case "drop" :
if (gun < 4) {
dropPowerUp();
powerUpOnScreen = true;
}
break;
case "dropBell" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell2" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "dropBell3" :
if (enemies[i]._x < 400) {
dropBell();
}
break;
case "null4" :
break;
case "null5" :
break;
case "null6" :
break;
case "null7" :
break;
case "null8" :
break;
case "null9" :
break;
case "null10" :
}
}
shake++;
randomNum++;
explosion = _root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
explosion._xscale = enemies[i]._xscale;
explosion._yscale = enemies[i]._yscale;
enemies[i].removeMovieClip();
enemies.splice(i, 1);
bullets[j].removeMovieClip();
bullets.splice(j, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
}
j--;
}
i--;
}
}
function enemyMovement() {
i = enemies.length - 1;
while (i >= 0) {
if (waveNum[i] == 1) {
endX = _root.player._x;
endY = _root.player._y;
enemies[i]._x = enemies[i]._x + ((endX - enemies[i]._x) / 60);
enemies[i]._y = enemies[i]._y + ((endY - enemies[i]._y) / 60);
if (player._x > enemies[i]._x) {
enemies[i]._xscale = -100;
} else {
enemies[i]._xscale = 100;
}
special[i]--;
if (special[i] == 0) {
randomNum++;
eBullet = _root.attachMovie("bossBullet", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - 15;
};
}
}
if (waveNum[i] == 2) {
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 3) {
enemies[i]._x = enemies[i]._x - (enemySpeed / 2);
special[i]--;
if (special[i] == 0) {
randomNum++;
eBullet = _root.attachMovie("bossBullet", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - 15;
};
}
}
if (waveNum[i] == 4) {
enemies[i]._rotation = -90;
enemies[i]._y = enemies[i]._y + (enemySpeed / 0.5);
special[i]--;
if (special[i] == 0) {
randomNum++;
eBullet = _root.attachMovie("enemy_shot", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - (Math.round(Math.random() * 7) + 5);
};
}
}
if (waveNum[i] == 4.5) {
enemies[i]._rotation = 90;
enemies[i]._y = enemies[i]._y - (enemySpeed / 0.5);
special[i]--;
if (special[i] == 0) {
randomNum++;
eBullet = _root.attachMovie("enemy_shot", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - (Math.round(Math.random() * 7) + 5);
};
}
}
if (waveNum[i] == 5) {
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 6) {
enemies[i]._y = enemies[i]._y + 8;
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 6.5) {
enemies[i]._y = enemies[i]._y - 8;
enemies[i]._x = enemies[i]._x - enemySpeed;
}
if (waveNum[i] == 7) {
enemies[i]._xscale = 250;
enemies[i]._yscale = 250;
enemies[i]._x = enemies[i]._x - (enemySpeed / 1.5);
special[i]--;
if (special[i] == 0) {
shake++;
randomNum++;
_root.attachMovie("explosion", "explosion" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
randomNum++;
enemy1 = _root.attachMovie("smallBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x + 15, _y:enemies[i]._y});
enemies.push(enemy1);
special.push(Math.round(Math.random() * 17) + 15);
enemyHealth.push(1);
waveNum.push(1);
randomNum++;
enemy2 = _root.attachMovie("smallBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x - 15, _y:enemies[i]._y});
enemies.push(enemy2);
special.push(Math.round(Math.random() * 17) + 15);
waveNum.push(1);
enemyHealth.push(1);
randomNum++;
enemy3 = _root.attachMovie("smallBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y - 15});
enemies.push(enemy3);
special.push(Math.round(Math.random() * 17) + 15);
enemyHealth.push(1);
waveNum.push(1);
enemies[i].removeMovieClip();
enemies.splice(i, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
}
if (waveNum[i] == 9) {
special[i]--;
enemies[i]._x = enemies[i]._x - enemySpeed;
if (special[i] == 0) {
randomNum++;
eBullet = _root.attachMovie("bossBullet", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:enemies[i]._x, _y:enemies[i]._y});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - 15;
};
}
}
i--;
}
}
function attackTimers() {
if (Start) {
attackOneTimer--;
attackOneTimer2--;
attackOneTimer3--;
attackOneTimer4--;
attackOneTimer5--;
attackOneTimer6--;
attackOneTimer7--;
attackOneTimer8--;
attackOneTimer9--;
if (attackOneTimer == 1) {
attackOneTimer = 0;
position = 1;
minus = 3;
attackOneTimer2 = 160;
}
if (attackOneTimer2 == 1) {
attackOneTimer2 = 0;
position = 1;
minus = 3;
attackOneTimer3 = 640;
}
if (attackOneTimer3 == 1) {
attackOneTimer3 = 0;
position = 1;
minus = 3;
attackOneTimer4 = 320;
}
if (attackOneTimer4 == 1) {
attackOneTimer4 = 0;
position = 1;
minus = 3;
attackOneTimer5 = 320;
}
if (attackOneTimer5 == 1) {
attackOneTimer5 = 0;
position = 1;
minus = 3;
attackOneTimer6 = 320;
}
if (attackOneTimer6 == 1) {
attackOneTimer6 = 0;
position = 1;
minus = 3;
attackOneTimer7 = 960;
}
if (attackOneTimer7 == 1) {
attackOneTimer7 = 0;
position = 1;
minus = 3;
attackOneTimer8 = 320;
}
if (attackOneTimer8 == 1) {
attackOneTimer8 = 0;
position = 1;
minus = 3;
attackOneTimer9 = 960;
}
if (attackOneTimer9 == 1) {
attackOneTimer9 = 0;
position = 1;
minus = 3;
points.removeMovieClip();
_root.attachMovie("healthBar2", "bossHealthBar", _root.getNextHighestDepth(), {_x:400, _y:20});
_root.attachMovie("barBoarder2", "barBoarder2", _root.getNextHighestDepth(), {_x:400, _y:20});
FinalBoss = _root.attachMovie("bossThree", "bossThree", _root.getNextHighestDepth(), {_x:900, _y:200});
bosses.push(FinalBoss);
bossHealth.push(100);
FinalBoss.onEnterFrame = function () {
if (this._x > 400) {
this._x = this._x - 2;
}
if (goingUp) {
if (this._x == 400) {
this._y = this._y - 1;
}
}
if (goingDown) {
if (this._x == 400) {
this._y = this._y + 1;
}
}
if (this._y == 145) {
goingUp = false;
goingDown = true;
}
if (this._y == 250) {
goingUp = true;
goingDown = false;
}
specialAttackTimer--;
if (specialAttackTimer < 0) {
if ((timeLastEnemyAttached + 100) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
eBullet = _root.attachMovie("mBullet", "enemy_shot" + randomNum, _root.getNextHighestDepth(), {_x:FinalBoss._x, _y:(FinalBoss._y + Math.round(Math.random() * 45)) - 25});
enemyBullet.push(eBullet);
eBullet.onEnterFrame = function () {
this._x = this._x - 12;
};
}
}
if (specialAttackTimer == -96) {
sickEmBoys();
specialAttackTimer = 64;
}
};
}
}
}
function sickEmBoys() {
i = bosses.length - 1;
while (i >= 0) {
randomNum++;
bulletGD2 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y - 100});
enemyBullet.push(bulletGD2);
bulletGD2._rotation = 90;
bulletGD2.onEnterFrame = function () {
this._y = this._y + 5;
this._x = this._x - 1;
};
randomNum++;
bulletGU3 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y - 100});
enemyBullet.push(bulletGU3);
bulletGU3._rotation = -90;
bulletGU3.onEnterFrame = function () {
this._y = this._y - 5;
this._x = this._x - 1;
};
randomNum++;
bulletU2 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y - 100});
enemyBullet.push(bulletU2);
bulletU2.onEnterFrame = function () {
this._x = this._x - 3;
this._y = this._y + 1;
};
randomNum++;
bulletD3 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y - 100});
enemyBullet.push(bulletD3);
bulletD3.onEnterFrame = function () {
this._x = this._x - 3;
this._y = this._y - 1;
};
randomNum++;
bulletU4 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y - 100});
enemyBullet.push(bulletU4);
bulletU4.onEnterFrame = function () {
this._x = this._x - 7;
this._y = this._y + 4;
};
randomNum++;
bulletD5 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y - 100});
enemyBullet.push(bulletD5);
bulletD5.onEnterFrame = function () {
this._x = this._x - 7;
this._y = this._y - 4;
};
randomNum++;
bulletGD2 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y + 100});
enemyBullet.push(bulletGD2);
bulletGD2._rotation = 90;
bulletGD2.onEnterFrame = function () {
this._y = this._y + 5;
this._x = this._x - 1;
};
randomNum++;
bulletGU3 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y + 100});
enemyBullet.push(bulletGU3);
bulletGU3._rotation = -90;
bulletGU3.onEnterFrame = function () {
this._y = this._y - 5;
this._x = this._x - 1;
};
randomNum++;
bulletU2 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y + 100});
enemyBullet.push(bulletU2);
bulletU2.onEnterFrame = function () {
this._x = this._x - 3;
this._y = this._y + 1;
};
randomNum++;
bulletD3 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y + 100});
enemyBullet.push(bulletD3);
bulletD3.onEnterFrame = function () {
this._x = this._x - 3;
this._y = this._y - 1;
};
randomNum++;
bulletU4 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y + 100});
enemyBullet.push(bulletU4);
bulletU4.onEnterFrame = function () {
this._x = this._x - 7;
this._y = this._y + 4;
};
randomNum++;
bulletD5 = _root.attachMovie("bossBullet3", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:bosses[i]._x, _y:bosses[i]._y + 100});
enemyBullet.push(bulletD5);
bulletD5.onEnterFrame = function () {
this._x = this._x - 7;
this._y = this._y - 4;
};
i--;
}
}
function attachEnemy() {
if (Start) {
if (attackOneTimer > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("brownEnemylong", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
}
if (position == 2) {
enemy = _root.attachMovie("brownEnemylong", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:300});
}
if (position == 1) {
enemy = _root.attachMovie("brownEnemylong", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:150});
}
enemies.push(enemy);
waveNum.push(1);
enemyHealth.push(10);
special.push(Math.round(Math.random() * 17) + 15);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
if (attackOneTimer2 > 0) {
if ((timeLastEnemyAttached + 80) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 1) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:425, _y:-30});
waveNum.push(4);
}
if (position == 2) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:450, _y:570});
waveNum.push(4.5);
}
if (position == 3) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:350, _y:-30});
waveNum.push(4);
}
enemies.push(enemy);
special.push(Math.round(Math.random() * 17) + 15);
enemyHealth.push(6);
minus--;
if (minus == 0) {
position--;
minus = 5;
}
if (position == 0) {
position = 3;
}
}
}
if (attackOneTimer3 > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("brownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
waveNum.push(3);
}
if (position == 2) {
enemy = _root.attachMovie("brownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:300});
waveNum.push(1);
}
if (position == 1) {
enemy = _root.attachMovie("brownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:150});
waveNum.push(3);
}
enemies.push(enemy);
enemyHealth.push(30);
special.push(Math.round(Math.random() * 17) + 15);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
if (attackOneTimer4 > 0) {
if ((timeLastEnemyAttached + 80) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
enemy = _root.attachMovie("smallBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:Math.round(Math.random() * 350) + 10});
enemies.push(enemy);
waveNum.push(2);
enemyHealth.push(5);
special.push(Math.round(Math.random() * 17) + 15);
}
}
if (attackOneTimer5 > 0) {
if ((timeLastEnemyAttached + 250) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
enemy = _root.attachMovie("smallBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:Math.round(Math.random() * 350) + 10});
enemies.push(enemy);
special.push(Math.round(Math.random() * 17) + 15);
waveNum.push(1);
enemyHealth.push(3);
}
}
if (attackOneTimer6 > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
}
if (position == 2) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:330});
}
if (position == 1) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:100});
}
enemy._xscale = 250;
enemy._yscale = 250;
enemies.push(enemy);
waveNum.push(3);
enemyHealth.push(30);
special.push(Math.round(Math.random() * 17) + 15);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
if (attackOneTimer7 > 0) {
if ((timeLastEnemyAttached + 1000) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 3) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:225});
}
if (position == 2) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:330});
}
if (position == 1) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:100});
}
enemies.push(enemy);
waveNum.push(7);
enemyHealth.push(30);
special.push(Math.round(Math.random() * 17) + 15);
minus--;
if (minus == 0) {
position--;
minus = 3;
}
if (position == 0) {
position = 3;
}
}
}
}
if (attackOneTimer8 > 0) {
if ((timeLastEnemyAttached + 80) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
if (position == 1) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:425, _y:-30});
waveNum.push(4);
}
if (position == 2) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:450, _y:570});
waveNum.push(4.5);
}
if (position == 3) {
enemy = _root.attachMovie("strongBrownEnemy", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:350, _y:-30});
waveNum.push(4);
}
enemies.push(enemy);
special.push(Math.round(Math.random() * 17) + 15);
enemyHealth.push(6);
minus--;
if (minus == 0) {
position--;
minus = 5;
}
if (position == 0) {
position = 3;
}
}
}
if (attackOneTimer9 > 0) {
if ((timeLastEnemyAttached + 300) < getTimer()) {
timeLastEnemyAttached = getTimer();
randomNum++;
enemy = _root.attachMovie("brownEnemylong", "enemy_mc" + randomNum, _root.getNextHighestDepth(), {_x:570, _y:Math.round(Math.random() * 350) + 10});
enemies.push(enemy);
special.push(Math.round(Math.random() * 17) + 15);
waveNum.push(1);
enemyHealth.push(6);
}
}
}
function noOverLap() {
i = enemies.length - 1;
while (i >= 0) {
j = enemies.length - 1;
while (j >= 0) {
if (!(enemies[i] === enemies[j])) {
if (enemies[i].hitTest(enemies[j])) {
endX = _root.enemies[j]._x;
endY = _root.enemies[j]._y;
enemies[i]._x = enemies[i]._x - ((endX - enemies[i]._x) / 60);
enemies[i]._y = enemies[i]._y - ((endY - enemies[i]._y) / 60);
}
}
j--;
}
i--;
}
}
function ereaseEnemyBullets() {
i = enemyBullet.length - 1;
while (i >= 0) {
if ((((enemyBullet[i]._x > 550) or (enemyBullet[i]._x < 0)) or (enemyBullet[i]._y > 400)) or (enemyBullet[i]._y < 0)) {
enemyBullet[i].removeMovieClip();
enemyBullet.splice(i, 1);
}
i--;
}
}
function ereaseBullets() {
i = bullets.length - 1;
while (i >= 0) {
if ((((bullets[i]._x > 550) or (bullets[i]._x < 0)) or (bullets[i]._y > 400)) or (bullets[i]._y < 0)) {
bullets[i].removeMovieClip();
bullets.splice(i, 1);
}
i--;
}
}
function ereaseEnemies() {
i = enemies.length - 1;
while (i >= 0) {
if ((((enemies[i]._x > 750) or (enemies[i]._x < -100)) or (enemies[i]._y > 600)) or (enemies[i]._y < -100)) {
enemies[i].removeMovieClip();
enemies.splice(i, 1);
waveNum.splice(i, 1);
special.splice(i, 1);
enemyHealth.splice(i, 1);
}
i--;
}
}
function beingHit() {
if (alive) {
if (taking_damage) {
ouch = ouch - 1;
player.gotoAndStop("hit");
if (ouch == 0) {
taking_damage = false;
ouch = 5;
}
}
}
}
function bomb() {
if (alive) {
if (dropBomb) {
boom = boom - 1;
player.gotoAndStop("bomb");
if (boom == 0) {
dropBomb = false;
canDrop = true;
boom = 18;
bombNum--;
}
}
}
}
function playerBounds() {
if (player._x > 510) {
player._x = 510;
}
if (player._x < 40) {
player._x = 40;
}
if (player._y > 370) {
player._y = 370;
}
if (player._y < 30) {
player._y = 30;
}
}
function playerMovement() {
if (alive) {
if (!taking_damage) {
if (!dropBomb) {
if (!shooting) {
player.gotoAndStop("normal");
}
if (shooting) {
player.gotoAndStop("shooting");
}
if (Key.isDown(38)) {
player._y = player._y - speed;
}
if (Key.isDown(39)) {
player._x = player._x + speed;
}
if (Key.isDown(37)) {
player._x = player._x - speed;
}
if (Key.isDown(40)) {
player._y = player._y + speed;
}
}
}
}
}
function shaker() {
if (shake == 0) {
_root._x = 0;
_root._y = 0;
} else if (shake == 1) {
shake = shake + 1;
_root._x = _root._x + 3;
_root._y = _root._y + 3;
} else if (shake == 2) {
shake = shake + 1;
_root._y = _root._y - 5;
_root._x = _root._x - 5;
} else if (shake > 2) {
shake = 0;
_root._x = _root._x + 2;
_root._y = _root._y + 2;
}
}
function fire() {
if (shooting) {
if (gun == 0) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bullet = _root.attachMovie("standard shot_mc", "standard shot_mc" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
}
}
if (gun == 1) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bullet = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU);
bulletU.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 5;
};
randomNum++;
bulletD = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD);
bulletD.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 5;
};
}
}
if (gun == 2) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bulletGD = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD);
bulletGD._rotation = 90;
bulletGD.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
};
randomNum++;
bulletGU = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU);
bulletGU._rotation = -90;
bulletGU.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
};
randomNum++;
bullet = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU);
bulletU.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 5;
};
randomNum++;
bulletD = _root.attachMovie("standard shot_mc", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD);
bulletD.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 5;
};
}
}
if (gun == 3) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bulletGD = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD);
bulletGD._rotation = 90;
bulletGD.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
};
randomNum++;
bulletGU = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU);
bulletGU._rotation = -90;
bulletGU.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
};
randomNum++;
bullet = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU);
bulletU.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 5;
};
randomNum++;
bulletD = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD);
bulletD.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 5;
};
randomNum++;
bulletU2 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU2);
bulletU2.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 2.5;
};
randomNum++;
bulletD3 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD3);
bulletD3.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 2.5;
};
}
}
if (gun == 4) {
if ((timeOfLastShot + 100) < getTimer()) {
timeOfLastShot = getTimer();
randomNum++;
bulletGD2 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD2);
bulletGD2._rotation = 90;
bulletGD2.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
this._x = this._x + 5;
};
randomNum++;
bulletGU3 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU3);
bulletGU3._rotation = -90;
bulletGU3.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
this._x = this._x + 5;
};
randomNum++;
bulletGD = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGD);
bulletGD._rotation = 90;
bulletGD.onEnterFrame = function () {
this._y = this._y + bulletSpeed;
};
randomNum++;
bulletGU = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletGU);
bulletGU._rotation = -90;
bulletGU.onEnterFrame = function () {
this._y = this._y - bulletSpeed;
};
randomNum++;
bullet = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bullet);
bullet.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
};
randomNum++;
bulletU2 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU2);
bulletU2.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 2.5;
};
randomNum++;
bulletD3 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD3);
bulletD3.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 2.5;
};
randomNum++;
bulletU4 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletU4);
bulletU4.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y + 13;
};
randomNum++;
bulletD5 = _root.attachMovie("playerPowerShot", "starMC" + randomNum, _root.getNextHighestDepth(), {_x:player._x + 30, _y:player._y - 5});
bullets.push(bulletD5);
bulletD5.onEnterFrame = function () {
this._x = this._x + bulletSpeed;
this._y = this._y - 13;
};
}
}
}
}
function firing() {
if (gameOn) {
if (canDrop) {
if (Key.isDown(88)) {
if (bombNum > 0) {
dropBomb = true;
_root.attachMovie("playerEffect", "playerEffect", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
_root.attachMovie("deathBomb", "deathBomb", 2);
dropDabomb_sound.start();
canDrop = false;
}
}
}
if (Key.isDown(90)) {
pullitfire_sound.start();
shooting = true;
} else {
shooting = false;
}
}
}
function showBombNumber() {
if (bombNum == 3) {
bombCounter.gotoAndStop("three");
}
if (bombNum == 2) {
bombCounter.gotoAndStop("two");
}
if (bombNum == 1) {
bombCounter.gotoAndStop("one");
}
if (bombNum == 0) {
bombCounter.gotoAndStop("zero");
}
}
function StaeCompleted() {
if (completed) {
stageClear.sc.text = score;
if (score < target) {
score = score + 4;
}
if (score == target) {
if (once == 0) {
_root.attachMovie("fade", "fade", _root.getNextHighestDepth());
once = 1;
}
completedTimer++;
}
if (completedTimer == 64) {
stopAllSounds();
won = true;
gameOn = false;
removeBullets();
removeenemies();
removeenemyHealth();
removewaveNum();
removespecial();
removepowerUp1();
removeEnemyBullets();
removeBoss();
removebossHealth();
removepowerbell();
background3.removeMovieClip();
healthBar.removeMovieClip();
barBoarder.removeMovieClip();
bombCounter.removeMovieClip();
barBoarder2.removeMovieClip();
bossHealthBar.removeMovieClip();
stageClear.removeMovieClip();
player.removeMovieClip();
_root.gotoAndStop("game_done");
}
}
}
stop();
mission = 3;
pullitfire_sound = new Sound();
pullitfire_sound.attachSound("pullitfire");
dropDabomb_sound = new Sound();
dropDabomb_sound.attachSound("dropDabomb");
collectPup_sound = new Sound();
collectPup_sound.attachSound("collectPup");
tango_sound = new Sound();
tango_sound.attachSound("soundfoe");
boom_sound = new Sound();
boom_sound.attachSound("boom");
_root.attachMovie("background3", "background3", 1, {_x:0, _y:-115});
_root.attachMovie("points", "points", _root.getNextHighestDepth(), {_x:300, _y:0});
_root.attachMovie("bombCounter", "bombCounter", _root.getNextHighestDepth(), {_x:160, _y:28});
_root.attachMovie("healthBar", "healthBar", _root.getNextHighestDepth(), {_x:20, _y:20});
_root.attachMovie("barBoarder", "barBoarder", _root.getNextHighestDepth(), {_x:18, _y:20});
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:80, _y:200});
_root.attachMovie("st3_mc", "st3_mc", _root.getNextHighestDepth(), {_x:275, _y:200});
ready = 65;
barBoarder.lvs.text = lives;
un = 1;
target = 0;
once = 0;
goingUp = true;
goingDown = false;
alive = true;
gOt = 29;
speed = 7;
bombNum = 3;
pinkCombo = 0;
blueCombo = 0;
randomNum = 0;
randomNumber = 0;
canDrop = true;
Start = false;
StartTimer = 121;
taking_damage = false;
shootingBeam = false;
bulletSpeed = 25;
completed = false;
completedTimer = 0;
ouch = 5;
shake = 0;
beamTimer = 22;
enemySpeed = 10;
playerHealth = 100;
timeOfLastShot = 0;
dropBomb = false;
boom = 18;
specialAttackTimer = 64;
timeLastEnemyAttached = 0;
powerUpOnScreen = false;
shooting = false;
var bullets = new Array();
var enemies = new Array();
var enemyBullet = new Array();
var enemyHealth = new Array();
var waveNum = new Array();
var special = new Array();
var powerUp1 = new Array();
var bosses = new Array();
var bossHealth = new Array();
var powerbell = new Array();
minus = 3;
position = 1;
attackOneTimer = 320;
attackOneTimer2 = 0;
attackOneTimer3 = 0;
attackOneTimer4 = 0;
attackOneTimer5 = 0;
attackOneTimer6 = 0;
attackOneTimer7 = 0;
attackOneTimer8 = 0;
attackOneTimer9 = 0;
crosshair.onEnterFrame = function () {
this._x = _xmouse;
this._y = _ymouse;
};
player.onEnterFrame = function () {
ready--;
if (ready == 1) {
_root.attachMovie("fadeIn", "fadeIn", _root.getNextHighestDepth());
_root.attachMovie("lvl3", "lvl3", _root.getNextHighestDepth(), {_x:125, _y:150});
gameOn = true;
}
if (ready < 0) {
ready = 0;
}
if (ready == 0) {
StartTimer--;
}
if (StartTimer == 0) {
Start = true;
StartTimer = 0;
}
if (!dropBomb) {
fire();
}
if (bombNum < 0) {
bombNum == 0;
}
points.pts.text = score;
playerMovement();
firing();
ereaseBullets();
playerBounds();
attachEnemy();
enemyMovement();
noOverLap();
enemySot();
shaker();
playerHit();
beingHit();
collectPowerUp();
attackTimers();
ereaseEnemies();
death();
playersHealthBar();
bomb();
enemyHitBomb();
showBombNumber();
playerHitByEnemyBullet();
ereaseEnemyBullets();
EnemyBulletHitBomb();
BossHealthBar();
bossSot();
bossBombed();
playerHitByBoss();
collectBell();
StaeCompleted();
};
sound_contr.onEnterFrame = function () {
if (!alive) {
gOt--;
}
if (gOt < 0) {
background3.removeMovieClip();
healthBar.removeMovieClip();
barBoarder.removeMovieClip();
bombCounter.removeMovieClip();
barBoarder2.removeMovieClip();
bossHealthBar.removeMovieClip();
points.removeMovieClip();
player.removeMovieClip();
_root.gotoAndPlay("reset");
}
};
qualityControl.onEnterFrame = function () {
if (Key.isDown(81)) {
if (num == 0) {
qset++;
num = 1;
}
} else {
num = 0;
}
if (qset == 0) {
qualityControl.qual.text = "High";
_quality = "high";
}
if (qset == 1) {
qualityControl.qual.text = "Medium";
_quality = "medium";
}
if (qset == 2) {
qualityControl.qual.text = "Low";
_quality = "low";
}
if (qset > 2) {
qset = 0;
}
};
Frame 12
stop();
stopAllSounds();
gao.onEnterFrame = function () {
if (won) {
gao.gotoAndStop("win");
} else {
gao.gotoAndStop("lost");
}
};
var o = {n:[4, 0, 14, 11, 9, 1, 2, 1, 0, 13, 10, 0, 14, 10, 3, 9], 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:boardID, score:score});
Instance of Symbol 405 MovieClip "logoSmall" in Frame 12
on (release) {
getURL ("http://www.minijuegos.com", "_blank");
}
Symbol 418 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _loader, _loaderListener, _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.0");
}
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) {
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 _local3 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servicesURL != undefined) {
_servicesURL = urlOptions().servicesURL;
}
allowDomains(_servicesURL);
_clip = clip.createEmptyMovieClip(_local3, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip((((_servicesURL + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
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, clip:_clip, 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.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("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)) {
onError.apply(null, ["NotConnected"]);
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 = {};
if (_root.mochiad_options) {
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 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://x.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 var _servicesURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
}
Symbol 419 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if ((options.clip == null) || (options.clip == undefined)) {
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();
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;
}
}
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 420 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 19 MovieClip [fadeIn] Frame 6
this.removeMovieClip();
Symbol 20 MovieClip [fade] Frame 65
this.removeMovieClip();
Symbol 22 MovieClip [deathBomb] Frame 21
this.removeMovieClip();
Symbol 40 MovieClip [enemy_one] Frame 1
stop();
Symbol 40 MovieClip [enemy_one] Frame 2
play();
Symbol 57 MovieClip [explosion] Frame 17
this.removeMovieClip();
Symbol 62 MovieClip Frame 29
stop();
Symbol 63 MovieClip [explosion2] Frame 30
stop();
Symbol 66 MovieClip [healthBar] Frame 1
stop();
Symbol 66 MovieClip [healthBar] Frame 2
stop();
Symbol 77 MovieClip [lvl1] Frame 121
this.removeMovieClip();
Symbol 114 MovieClip [player] Frame 1
stop();
Symbol 114 MovieClip [player] Frame 2
stop();
Symbol 114 MovieClip [player] Frame 3
stop();
Symbol 114 MovieClip [player] Frame 4
stop();
Symbol 114 MovieClip [player] Frame 5
stop();
Symbol 118 MovieClip [smallEnemy] Frame 1
stop();
Symbol 118 MovieClip [smallEnemy] Frame 2
play();
Symbol 122 MovieClip [strangeEnemy_mc] Frame 1
stop();
Symbol 122 MovieClip [strangeEnemy_mc] Frame 2
play();
Symbol 126 MovieClip [tinyEnemy_mc] Frame 1
stop();
Symbol 126 MovieClip [tinyEnemy_mc] Frame 2
play();
Symbol 127 MovieClip [playerEffect] Frame 30
stop();
Symbol 134 MovieClip [bombCounter] Frame 1
stop();
Symbol 134 MovieClip [bombCounter] Frame 2
stop();
Symbol 134 MovieClip [bombCounter] Frame 3
stop();
Symbol 134 MovieClip [bombCounter] Frame 4
stop();
Symbol 142 MovieClip [bossOne] Frame 1
stop();
Symbol 142 MovieClip [bossOne] Frame 2
play();
Symbol 143 MovieClip [healthBar2] Frame 1
stop();
Symbol 143 MovieClip [healthBar2] Frame 2
stop();
Symbol 158 MovieClip Frame 12
stop();
Symbol 161 Button
on (release) {
gotoAndPlay (2);
_root.soundstatus = "off";
}
Symbol 162 MovieClip Frame 11
stop();
Symbol 164 Button
on (release) {
gotoAndPlay (1);
_root.soundstatus = "on";
}
Symbol 165 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 2
stop();
Instance of Symbol 169 MovieClip in Symbol 170 MovieClip [sound_contr] Frame 1
onClipEvent (load) {
_root.soundstatus = "on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
maxvolume = 100;
minvolume = 0;
}
onClipEvent (enterFrame) {
if (_root.soundstatus == "on") {
step = 5;
}
if (_root.soundstatus == "off") {
step = -5;
}
maxvolume = maxvolume + step;
if (maxvolume > 100) {
maxvolume = 100;
}
if (maxvolume < 0) {
maxvolume = 0;
}
_root.mySound.setVolume(maxvolume);
_root.mySound2.setVolume(maxvolume);
_root.mySound3.setVolume(maxvolume);
_root.mySound4.setVolume(maxvolume);
_root.mySound5.setVolume(maxvolume);
}
Symbol 185 MovieClip [explosion_pup] Frame 30
this.removeMovieClip();
Symbol 188 MovieClip [plusTen] Frame 41
this.removeMovieClip();
Symbol 194 MovieClip [stageClear] Frame 129
stop();
Symbol 201 MovieClip [smallEnemy2] Frame 1
stop();
Symbol 201 MovieClip [smallEnemy2] Frame 2
play();
Symbol 204 MovieClip [lvl2] Frame 121
this.removeMovieClip();
Symbol 208 MovieClip [midgetEnemy] Frame 1
stop();
Symbol 208 MovieClip [midgetEnemy] Frame 2
play();
Symbol 212 MovieClip [lineEnemy_mc] Frame 1
stop();
Symbol 212 MovieClip [lineEnemy_mc] Frame 2
play();
Symbol 216 MovieClip [redEnemy] Frame 1
stop();
Symbol 216 MovieClip [redEnemy] Frame 2
play();
Symbol 220 MovieClip [bossTwo] Frame 1
stop();
Symbol 220 MovieClip [bossTwo] Frame 2
play();
Symbol 232 MovieClip [lvl3] Frame 121
this.removeMovieClip();
Symbol 236 MovieClip [brownEnemy] Frame 1
stop();
Symbol 236 MovieClip [brownEnemy] Frame 2
play();
Symbol 240 MovieClip [brownEnemylong] Frame 1
stop();
Symbol 240 MovieClip [brownEnemylong] Frame 2
play();
Symbol 244 MovieClip [smallBrownEnemy] Frame 1
stop();
Symbol 244 MovieClip [smallBrownEnemy] Frame 2
play();
Symbol 248 MovieClip [strongBrownEnemy] Frame 1
stop();
Symbol 248 MovieClip [strongBrownEnemy] Frame 2
play();
Symbol 252 MovieClip [bossThree] Frame 1
stop();
Symbol 252 MovieClip [bossThree] Frame 2
play();
Symbol 267 MovieClip [st1_mc] Frame 65
this.removeMovieClip();
Symbol 270 MovieClip [st2_mc] Frame 65
this.removeMovieClip();
Symbol 273 MovieClip [st3_mc] Frame 65
this.removeMovieClip();
Symbol 288 MovieClip Frame 1
_root.stop();
Symbol 288 MovieClip Frame 290
_root.play();
Symbol 383 MovieClip Frame 1
_root.stop();
Symbol 383 MovieClip Frame 185
_root.play();
Symbol 407 Button
on (release) {
var o = {n:[4, 0, 14, 11, 9, 1, 2, 1, 0, 13, 10, 0, 14, 10, 3, 9], 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:boardID});
}
Symbol 408 Button
on (release) {
gotoAndStop ("title");
}
Symbol 415 Button
on (release) {
gotoAndStop ("title");
}
Symbol 416 MovieClip Frame 1
stop();
Symbol 416 MovieClip Frame 2
stop();
Symbol 417 Button
on (release) {
gotoAndStop ("title");
}