Frame 2
stop();
stopAllSounds();
var gameLevel = 1;
gameScore = 0;
viniCheat = false;
_quality = "HIGH";
sndKing = new Sound();
sndKing.attachSound("iwKing.mp3");
sndBonus = new Sound();
sndBonus.attachSound("iwBonus.mp3");
sndButton = new Sound();
sndButton.attachSound("iwButton.mp3");
sndEnemy = new Sound();
sndEnemy.attachSound("iwEnemy.mp3");
sndFreezy = new Sound();
sndFreezy.attachSound("iwFreezy.mp3");
sndHit = new Sound();
sndHit.attachSound("iwHit.mp3");
sndJump = new Sound();
sndJump.attachSound("iwJump.mp3");
sndKing = new Sound();
sndKing.attachSound("iwKing.mp3");
sndLevel = new Sound();
sndLevel.attachSound("iwLevel.mp3");
sndLose = new Sound();
sndLose.attachSound("iwLose.mp3");
sndWin = new Sound();
sndWin.attachSound("iwWin.mp3");
sndMusic = new Sound();
sndMusic.attachSound("iwMusic.mp3");
sndShoot = new Sound();
sndShoot.attachSound("iwShoot.mp3");
sndSnow = new Sound();
sndSnow.attachSound("iwSnow.mp3");
sndMusic.start(0, 50000);
btnPlay.onPress = function () {
sndButton.start(0, 1);
_root.gotoAndStop("help");
};
btnCredit.onPress = function () {
sndButton.start(0, 1);
_root.gotoAndStop("credit");
};
btnMoreGames.onPress = function () {
sndButton.start(0, 1);
getURL ("http://www.gamesnow.biz", "blank");
};
Instance of Symbol 354 MovieClip in Frame 2
on (release) {
getURL ("http://www.toonarcades.com/mario", "_blank");
}
Instance of Symbol 296 MovieClip in Frame 2
on (release) {
getURL ("http://www.toonarcades.com/", "_blank");
}
Frame 3
stop();
btnBack.onPress = function () {
sndButton.start(0, 1);
_root.gotoAndStop("menu");
};
Frame 5
function createBonus(posX, posY) {
bonusCount++;
attachMovie("refBonus", "bonus" + bonusCount, this.getNextHighestDepth());
mcBonus = _root["bonus" + bonusCount];
mcBonus._x = posX;
mcBonus._y = posY;
randTyp = Math.floor(Math.random() * 7) + 1;
if (randTyp == 1) {
mcBonus.typ = "playerLife";
mcBonus.gotoAndStop(1);
} else if (randTyp == 2) {
mcBonus.typ = "playerSpeed";
mcBonus.gotoAndStop(2);
} else if (randTyp == 3) {
mcBonus.typ = "ammoDistance";
mcBonus.gotoAndStop(3);
} else if (randTyp == 4) {
mcBonus.typ = "shield";
mcBonus.gotoAndStop(4);
} else if (randTyp == 5) {
mcBonus.typ = "score1";
mcBonus.gotoAndStop(5);
} else if (randTyp == 6) {
mcBonus.typ = "score2";
mcBonus.gotoAndStop(6);
} else if (randTyp == 7) {
mcBonus.typ = "score3";
mcBonus.gotoAndStop(7);
}
mcBonus.friction = 0.98;
mcBonus.bounce = -0.7;
mcBonus.gravity = 0.5;
mcBonus.vx = (Math.random() * 10) - 5;
mcBonus.vy = (Math.random() * 40) - 24;
mcBonus.vy = mcBonus.vy * -1;
}
function bonusLoop(Void) {
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 5)) == "bonus")) {
mcBonus = _root[i];
mcBonus.vy = mcBonus.vy + mcBonus.gravity;
mcBonus.vx = mcBonus.vx * mcBonus.friction;
mcBonus.vy = mcBonus.vy * mcBonus.friction;
mcBonus._x = mcBonus._x + mcBonus.vx;
mcBonus._y = mcBonus._y + mcBonus.vy;
if (arena.hitTest((mcBonus._x - (mcBonus._width / 2)) - 2, mcBonus._y, true)) {
while (arena.hitTest(mcBonus._x - (mcBonus._width / 2), mcBonus._y, true)) {
mcBonus._x = mcBonus._x + 0.1;
}
mcBonus.vx = mcBonus.vx * mcBonus.bounce;
}
if (arena.hitTest((mcBonus._x + (mcBonus._width / 2)) + 2, mcBonus._y, true)) {
while (arena.hitTest(mcBonus._x + (mcBonus._width / 2), mcBonus._y, true)) {
mcBonus._x = mcBonus._x - 0.1;
}
mcBonus.vx = mcBonus.vx * mcBonus.bounce;
}
if (arena.hitTest(mcBonus._x, (mcBonus._y - (mcBonus._height / 2)) - 2, true)) {
while (arena.hitTest(mcBonus._x, mcBonus._y - (mcBonus._height / 2), true)) {
mcBonus._y = mcBonus._y + 0.1;
}
mcBonus.vy = mcBonus.vy * mcBonus.bounce;
}
if (arena.hitTest(mcBonus._x, (mcBonus._y + (mcBonus._height / 2)) + 2, true)) {
while (arena.hitTest(mcBonus._x, mcBonus._y + (mcBonus._height / 2), true)) {
mcBonus._y = mcBonus._y - 0.1;
}
mcBonus.vy = mcBonus.vy * mcBonus.bounce;
}
if (player.hitTest(mcBonus)) {
if (mcBonus.typ == "playerLife") {
lifeInfo(1);
} else if (mcBonus.typ == "playerSpeed") {
speedInfo();
} else if (mcBonus.typ == "ammoDistance") {
ammoDistanceInfo();
} else if (mcBonus.typ == "score1") {
scoreAdd(5);
} else if (mcBonus.typ == "score2") {
scoreAdd(10);
} else if (mcBonus.typ == "score3") {
scoreAdd(15);
} else if (mcBonus.typ == "shield") {
prince.gotoAndStop(3);
prince._alpha = 100;
playerSta = "shield";
}
mcBonus.sta = "die";
}
if (mcBonus._y >= 800) {
mcBonus.sta = "die";
}
if (mcBonus.sta == "die") {
sndBonus.start(0, 1);
mcBonus.removeMovieClip();
}
}
}
}
function lifeInfo(num) {
playerLife = playerLife + num;
if ((playerLife > 0) && (playerLife <= 5)) {
guiLife.gotoAndStop(playerLife);
} else if (playerLife == 0) {
guiLife.gotoAndStop(6);
} else if (playerLife >= 5) {
playerLife = 5;
guiLife.gotoAndStop(5);
} else if (playerLife < 0) {
delayLose.gotoAndPlay(2);
}
}
function speedInfo() {
if (playerSpeedHor < 1.2) {
playerSpeedHor = playerSpeedHor + 0.2;
}
trace(playerSpeedHor);
}
function ammoDistanceInfo() {
if (ammoDistance < 160) {
ammoDistance = ammoDistance + 20;
}
trace(ammoDistance);
}
function ammoScreenInfo() {
if (ammoScreenAllow < 5) {
ammoScreenAllow = ammoScreenAllow + 1;
}
trace(ammoScreenMax);
}
function playerLoop(Void) {
if (playerSta == "stunt") {
if (prince._alpha > 0) {
prince._alpha = prince._alpha - 10;
} else if (prince._alpha <= 0) {
prince._alpha = 100;
}
}
if ((playerSta == "play") || (playerSta == "freezy")) {
if (viniCheat == false) {
if (design.razor.hitTest(player._x, player._y, true)) {
if (player._xscale == 100) {
playerSpeedX = -5;
} else if (player._xscale == -100) {
playerSpeedX = 5;
}
player._y = player._y - 6;
playerSpeedY = -13;
playerJump = true;
playerSta = "stunt";
playerStuntTime = 6;
lifeInfo(-1);
sndHit.start(0, 1);
}
}
}
if (design.ice.hitTest(player._x, player._y, true)) {
if (player._xscale == 100) {
playerSpeedX = playerSpeedX + 0.25;
} else if (player._xscale == -100) {
playerSpeedX = playerSpeedX - 0.25;
}
prince.foot.gotoAndStop(1);
}
if (gameSta != "lose") {
if (arena.hitTest((player._x - (player._width / 2)) - 2, player._y, true)) {
playerSpeedX = 0;
while (arena.hitTest(player._x - (player._width / 2), player._y, true)) {
player._x = player._x + 0.1;
}
hitLeft = true;
} else {
hitLeft = false;
}
if (arena.hitTest((player._x + (player._width / 2)) + 2, player._y, true)) {
playerSpeedX = 0;
while (arena.hitTest(player._x + (player._width / 2), player._y, true)) {
player._x = player._x - 0.1;
}
hitRight = true;
} else {
hitRight = false;
}
if (arena.hitTest(player._x, (player._y - (player._height / 2)) - 2, true)) {
playerSpeed = 0;
playerJump = false;
while (arena.hitTest(player._x, player._y - (player._height / 2), true)) {
player._y = player._y + 0.1;
}
playerSpeedY = playerSpeedY * -0.25;
hitTop = true;
} else {
hitTop = false;
}
if (arena.hitTest(player._x, (player._y + (player._height / 2)) + 2, true)) {
playerSpeedY = 0;
playerJump = false;
while (arena.hitTest(player._x, player._y + (player._height / 2), true)) {
player._y = player._y - 0.1;
}
hitBottom = true;
} else {
hitBottom = false;
}
}
if (playerSta != "freezy") {
if (hitLeft == false) {
if (Key.isDown(37)) {
player._xscale = -100;
if (playerJump == true) {
playerSpeedX = playerSpeedX - 0.6;
} else {
playerSpeedX = playerSpeedX - playerSpeedHor;
}
}
}
if (hitRight == false) {
if (Key.isDown(39)) {
player._xscale = 100;
if (playerJump == true) {
playerSpeedX = playerSpeedX + 0.6;
} else {
playerSpeedX = playerSpeedX + playerSpeedHor;
}
}
}
if (hitTop == false) {
if (Key.isDown(38)) {
if ((playerJump == false) && (hitBottom == true)) {
sndJump.start(0, 1);
playerSpeedY = -13;
playerJump = true;
}
}
}
}
playerSpeedX = playerSpeedX * 0.9;
if (hitBottom == false) {
playerSpeedY = playerSpeedY + gravitation;
}
if (playerSpeedY > 10) {
playerSpeedY = 10;
}
if (playerSpeedX < 0) {
if (player._x > 120) {
player._x = player._x + playerSpeedX;
} else {
worldMove();
arena._x = arena._x - playerSpeedX;
}
} else if (player._x < 360) {
player._x = player._x + playerSpeedX;
} else {
worldMove();
arena._x = arena._x - playerSpeedX;
}
player._y = player._y + playerSpeedY;
}
function worldMove(Void) {
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 5)) == "enemy")) {
mcEnemy = _root[i];
mcEnemy._x = mcEnemy._x - playerSpeedX;
}
}
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 4)) == "ammo")) {
mcAmmo = _root[i];
mcAmmo._x = mcAmmo._x - playerSpeedX;
}
}
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 8)) == "particle")) {
mcParticle = _root[i];
mcParticle._x = mcParticle._x - playerSpeedX;
}
}
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 5)) == "bonus")) {
mcBonus = _root[i];
mcBonus._x = mcBonus._x - playerSpeedX;
}
}
}
function createAmmoPlayer(typ, posX, posY, pow, spdX) {
ammoCount++;
ammoScreenCount++;
if (typ == "ice") {
attachMovie("refIce", "ammo" + ammoCount, this.getNextHighestDepth());
}
mcAmmo = _root["ammo" + ammoCount];
mcAmmo.typ = typ;
mcAmmo._x = posX;
mcAmmo._y = posY;
mcAmmo.power = pow;
if (typ == "ice") {
mcAmmo.speedX = spdX;
}
mcAmmo.from = "player";
}
function createAmmoEnemy(typ, posX, posY, pow, spdX) {
ammoCount++;
if (typ == "fire") {
attachMovie("refFire", "ammo" + ammoCount, this.getNextHighestDepth());
} else if (typ == "frooze") {
attachMovie("refFrooze", "ammo" + ammoCount, this.getNextHighestDepth());
}
mcAmmo = _root["ammo" + ammoCount];
mcAmmo.typ = typ;
mcAmmo._x = posX;
mcAmmo._y = posY;
mcAmmo.power = pow;
if (((((gameLevel == 1) || (gameLevel == 2)) || (gameLevel == 3)) || (gameLevel == 4)) || (gameLevel == 5)) {
mcAmmo.playTime = 2;
} else if (((gameLevel == 6) || (gameLevel == 7)) || (gameLevel == 8)) {
mcAmmo.playTime = 2;
}
if (spdX > 0) {
mcAmmo.speedX = spdX;
} else if (spdX < 0) {
mcAmmo.speedX = spdX;
mcAmmo._xscale = mcAmmo._xscale * -1;
}
mcAmmo.from = "enemy";
}
function createAmmoDeflect(typ, posX, posY, pow, spdX) {
ammoCount++;
if (typ == "deflect") {
attachMovie("refDeflect", "ammo" + ammoCount, this.getNextHighestDepth());
}
mcAmmo = _root["ammo" + ammoCount];
mcAmmo.typ = typ;
mcAmmo._x = posX;
mcAmmo._y = posY;
mcAmmo.power = pow;
if (((gameLevel == 1) || (gameLevel == 2)) || (gameLevel == 3)) {
mcAmmo.playTime = 2;
} else if (((gameLevel == 4) || (gameLevel == 5)) || (gameLevel == 6)) {
mcAmmo.playTime = 3;
} else if (gameLevel == 7) {
mcAmmo.playTime = 4;
}
if (typ == "deflect") {
mcAmmo.speedX = spdX;
}
mcAmmo.from = "deflect";
trace("deflect: " + mcAmmo);
}
function ammoLoop(Void) {
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 4)) == "ammo")) {
mcAmmo = _root[i];
mcAmmo.speedX = mcAmmo.speedX * ammoAcc;
mcAmmo._x = mcAmmo._x + mcAmmo.speedX;
if (mcAmmo.from == "player") {
for (j in this) {
if ((typeof(eval (j)) == "movieclip") && ((substring(j, 1, 5)) == "enemy")) {
mcEnemy = _root[j];
if (mcEnemy.typ != "enemy10") {
if ((mcEnemy.sta == "play") || (mcEnemy.sta == "freezy")) {
if (mcEnemy.hitTest(mcAmmo._x, mcAmmo._y, true)) {
mcEnemy.sta = "freezy";
mcEnemy.free = false;
mcEnemy.speedX = 0;
mcEnemy.ball = mcEnemy.ball + 1;
mcEnemy.wing.gotoAndStop(2);
if (mcEnemy.ball < 6) {
mcEnemy.ice.gotoAndStop(mcEnemy.ball);
} else if (mcEnemy.ball >= 6) {
mcEnemy.ice.gotoAndStop(6);
mcEnemy.sta = "ball";
}
sndSnow.start(0, 1);
mcAmmo.sta = "die";
}
}
if ((mcEnemy.sta == "hide") && (mcAmmo.sta != "dieDiflect")) {
if (mcEnemy.hitTest(mcAmmo._x, mcAmmo._y, true)) {
sndSnow.start(0, 1);
mcAmmo.sta = "dieDiflect";
if (mcAmmo.speedX > 0) {
createAmmoDeflect("deflect", mcEnemy._x, mcEnemy._y, 1, -4);
} else if (mcAmmo.speedX < 0) {
createAmmoDeflect("deflect", mcEnemy._x, mcEnemy._y, 1, 4);
}
}
}
}
}
}
}
if (mcAmmo.from == "enemy") {
if ((playerSta == "play") || (playerSta == "freezy")) {
if (viniCheat == false) {
if (player.hitTest(mcAmmo._x, mcAmmo._y, true)) {
if (mcAmmo.typ == "fire") {
if (player._xscale == 100) {
playerSpeedX = -5;
} else if (player._xscale == -100) {
playerSpeedX = 5;
}
player._y = player._y - 6;
playerSpeedY = -13;
playerJump = true;
playerSta = "stunt";
playerStuntTime = 6;
lifeInfo(-1);
sndHit.start(0, 1);
mcAmmo.sta = "die";
} else if (mcAmmo.typ == "frooze") {
playerSta = "freezy";
sndFreezy.start(0, 1);
prince.gotoAndStop(2);
mcAmmo.sta = "die";
}
}
}
}
}
if (mcAmmo.from == "deflect") {
if ((playerSta == "play") || (playerSta == "freezy")) {
if (viniCheat == false) {
if (player.hitTest(mcAmmo._x, mcAmmo._y, true)) {
playerSta = "freezy";
prince.gotoAndStop(2);
mcAmmo.sta = "die";
}
}
}
}
if (mcAmmo.from == "player") {
distX = mcAmmo._x - player._x;
distY = mcAmmo._y - player._y;
dist = Math.sqrt((distX * distX) + (distY * distY));
if (dist >= ammoDistance) {
mcAmmo.sta = "die";
}
} else if (mcAmmo.from == "enemy") {
distX = mcAmmo._x - 240;
distY = mcAmmo._y - 240;
dist = Math.sqrt((distX * distX) + (distY * distY));
if (dist >= 1000) {
mcAmmo.sta = "die";
}
}
if (arena.hitTest(mcAmmo._x, mcAmmo._y, true)) {
mcAmmo.sta = "die";
}
if (mcAmmo.sta == "die") {
if (mcAmmo.from == "player") {
createParticleSparkIce(mcAmmo._x, mcAmmo._y);
} else if (mcAmmo.from == "enemy") {
if (mcAmmo.typ == "fire") {
createParticleSparkFire(mcAmmo._x, mcAmmo._y);
} else if (mcAmmo.typ == "frooze") {
createParticleSparkIce(mcAmmo._x, mcAmmo._y);
}
}
if (mcAmmo.from == "player") {
ammoScreenCount--;
}
mcAmmo.removeMovieClip();
} else if (mcAmmo.sta == "dieDeflect") {
if (mcAmmo.from == "player") {
createParticleSparkIce(mcAmmo._x, mcAmmo._y);
} else if (mcAmmo.from == "enemy") {
createParticleSparkFire(mcAmmo._x, mcAmmo._y);
}
if (mcAmmo.from == "player") {
ammoScreenCount--;
}
mcAmmo.removeMovieClip();
}
}
}
}
function createParticleSparkIce(posX, posY) {
particleCount++;
attachMovie("refSparkIce", "particle" + particleCount, this.getNextHighestDepth());
mcParticle = _root["particle" + particleCount];
mcParticle.typ = "sparkIce";
mcParticle.sta = "play";
mcParticle._x = posX;
mcParticle._y = posY;
}
function createParticleSparkFire(posX, posY) {
particleCount++;
attachMovie("refSparkFire", "particle" + particleCount, this.getNextHighestDepth());
mcParticle = _root["particle" + particleCount];
mcParticle.typ = "sparkFire";
mcParticle.sta = "play";
mcParticle._x = posX;
mcParticle._y = posY;
}
function createParticleSparkDust(posX, posY) {
particleCount++;
attachMovie("refSparkDust", "particle" + particleCount, this.getNextHighestDepth());
mcParticle = _root["particle" + particleCount];
mcParticle.typ = "sparkDust";
mcParticle.sta = "play";
mcParticle._x = posX;
mcParticle._y = posY;
}
function createParticleExplode(posX, posY) {
z = 1;
while (z < 16) {
particleCount++;
attachMovie("refDust", "particle" + particleCount, this.getNextHighestDepth());
mcParticle = _root["particle" + particleCount];
mcParticle.sta = "play";
mcParticle.typ = "explode";
mcParticle._x = posX;
mcParticle._y = posY;
randSize = Math.floor(Math.random() * 11) + 8;
mcParticle._width = randSize;
mcParticle._height = randSize;
randRot = Math.floor(Math.random() * 360) + 1;
mcParticle._rotation = randRot;
mcParticle.speedX = (Math.random() * 5) + 2;
randX = Math.floor((Math.random() * 2) + 1);
if (randX == 1) {
mcParticle.speedX = mcParticle.speedX * -1;
}
mcParticle.speedY = ((Math.random() * 3) + 14) * -1;
z++;
}
}
function createParticleFree(posX, posY) {
z = 1;
while (z < 12) {
particleCount++;
attachMovie("refFree", "particle" + particleCount, this.getNextHighestDepth());
mcParticle = _root["particle" + particleCount];
mcParticle.sta = "play";
mcParticle.typ = "free";
mcParticle._x = posX;
mcParticle._y = posY;
randSize = Math.floor(Math.random() * 9) + 6;
mcParticle._width = randSize;
mcParticle._height = randSize;
randRot = Math.floor(Math.random() * 360) + 1;
mcParticle._rotation = randRot;
mcParticle.speedX = (Math.random() * 3) + 2;
randX = Math.floor((Math.random() * 2) + 1);
if (randX == 1) {
mcParticle.speedX = mcParticle.speedX * -1;
}
mcParticle.speedY = ((Math.random() * 5) + 10) * -1;
z++;
}
}
function particleLoop() {
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 8)) == "particle")) {
mcParticle = _root[i];
mcParticle.speedY = mcParticle.speedY + 0.98;
mcParticle._x = mcParticle._x + mcParticle.speedX;
mcParticle._y = mcParticle._y + mcParticle.speedY;
mcParticle._rotation = mcParticle._rotation + 32;
if (mcParticle._y > 480) {
mcParticle.sta = "die";
} else if (mcParticle._x < 0) {
mcParticle.sta = "die";
}
if (mcParticle.sta == "die") {
mcParticle.removeMovieClip();
}
}
}
}
function createEnemy1(loc, patL, patR) {
enemyScreen++;
enemyCount++;
attachMovie("refEnemy1", "enemy" + enemyCount, this.getNextHighestDepth());
mcEnemy = _root["enemy" + enemyCount];
mcEnemy.sta = "play";
mcEnemy.ball = 1;
mcEnemy.rollTime = 20;
mcEnemy.typ = "enemy1";
mcEnemy.free = false;
posConv = new Object();
posConv.x = loc._x;
posConv.y = loc._y;
design.localToGlobal(posConv);
mcEnemy._x = posConv.x;
mcEnemy._y = posConv.y;
mcEnemy.Jump = true;
randDirX = Math.floor(Math.random() * 2) + 1;
if (randDirX == 1) {
mcEnemy.avgX = 1.5;
} else {
mcEnemy._xscale = mcEnemy._xscale * -1;
mcEnemy.avgX = -1.5;
}
mcEnemy.avgY = 0;
mcEnemy.speedX = 0;
mcEnemy.speedY = 0;
mcEnemy.patLeft = patL;
mcEnemy.patRight = patR;
mcEnemy.hitLeft = false;
mcEnemy.hitRight = false;
mcEnemy.hitTop = false;
mcEnemy.hitBottom = false;
}
function createEnemy2(loc, patL, patR) {
enemyScreen++;
enemyCount++;
attachMovie("refEnemy2", "enemy" + enemyCount, this.getNextHighestDepth());
mcEnemy = _root["enemy" + enemyCount];
mcEnemy.sta = "play";
mcEnemy.ball = 1;
mcEnemy.rollTime = 12;
mcEnemy.typ = "enemy2";
mcEnemy.free = false;
posConv = new Object();
posConv.x = loc._x;
posConv.y = loc._y;
design.localToGlobal(posConv);
mcEnemy._x = posConv.x;
mcEnemy._y = posConv.y;
mcEnemy.Jump = true;
randDirX = Math.floor(Math.random() * 2) + 1;
if (randDirX == 1) {
mcEnemy.avgX = 2;
} else {
mcEnemy._xscale = mcEnemy._xscale * -1;
mcEnemy.avgX = -2;
}
mcEnemy.avgY = 0;
mcEnemy.speedX = 0;
mcEnemy.speedY = 0;
mcEnemy.patLeft = patL;
mcEnemy.patRight = patR;
mcEnemy.hitLeft = false;
mcEnemy.hitRight = false;
mcEnemy.hitTop = false;
mcEnemy.hitBottom = false;
}
function createEnemy3(loc) {
enemyScreen++;
enemyCount++;
attachMovie("refEnemy3", "enemy" + enemyCount, this.getNextHighestDepth());
mcEnemy = _root["enemy" + enemyCount];
mcEnemy.sta = "play";
mcEnemy.ball = 1;
mcEnemy.rollTime = 12;
mcEnemy.typ = "enemy3";
mcEnemy.free = true;
posConv = new Object();
posConv.x = loc._x;
posConv.y = loc._y;
design.localToGlobal(posConv);
mcEnemy._x = posConv.x;
mcEnemy._y = posConv.y;
mcEnemy.Jump = true;
randDirX = Math.floor(Math.random() * 2) + 1;
if (randDirX == 1) {
mcEnemy.avgX = 2.5;
} else {
mcEnemy._xscale = mcEnemy._xscale * -1;
mcEnemy.avgX = -2.5;
}
randDirY = Math.floor(Math.random() * 2) + 1;
if (randDirY == 1) {
mcEnemy.avgY = 2.5;
} else {
mcEnemy.avgY = -2.5;
}
mcEnemy.speedX = 0;
mcEnemy.speedY = 0;
mcEnemy.hitLeft = false;
mcEnemy.hitRight = false;
mcEnemy.hitTop = false;
mcEnemy.hitBottom = false;
}
function createEnemy4(loc, patL, patR) {
enemyScreen++;
enemyCount++;
attachMovie("refEnemy4", "enemy" + enemyCount, this.getNextHighestDepth());
mcEnemy = _root["enemy" + enemyCount];
mcEnemy.sta = "play";
mcEnemy.ball = 1;
mcEnemy.rollTime = 12;
mcEnemy.shootTime = 3;
mcEnemy.typ = "enemy4";
mcEnemy.free = false;
posConv = new Object();
posConv.x = loc._x;
posConv.y = loc._y;
design.localToGlobal(posConv);
mcEnemy._x = posConv.x;
mcEnemy._y = posConv.y;
mcEnemy.Jump = true;
randDirX = Math.floor(Math.random() * 2) + 1;
if (randDirX == 1) {
mcEnemy.avgX = 2.5;
} else {
mcEnemy._xscale = mcEnemy._xscale * -1;
mcEnemy.avgX = -2.5;
}
mcEnemy.avgY = 0;
mcEnemy.speedX = 0;
mcEnemy.speedY = 0;
mcEnemy.patLeft = patL;
mcEnemy.patRight = patR;
mcEnemy.hitLeft = false;
mcEnemy.hitRight = false;
mcEnemy.hitTop = false;
mcEnemy.hitBottom = false;
}
function createEnemy5(loc, patL, patR) {
enemyScreen++;
enemyCount++;
attachMovie("refEnemy5", "enemy" + enemyCount, this.getNextHighestDepth());
mcEnemy = _root["enemy" + enemyCount];
mcEnemy.sta = "play";
mcEnemy.ball = 1;
mcEnemy.rollTime = 12;
mcEnemy.shootTime = 3;
mcEnemy.hideTime = 6;
mcEnemy.hideFor = 4;
mcEnemy.typ = "enemy5";
mcEnemy.free = false;
posConv = new Object();
posConv.x = loc._x;
posConv.y = loc._y;
design.localToGlobal(posConv);
mcEnemy._x = posConv.x;
mcEnemy._y = posConv.y;
mcEnemy.Jump = true;
randDirX = Math.floor(Math.random() * 2) + 1;
if (randDirX == 1) {
mcEnemy.avgX = 2;
} else {
mcEnemy._xscale = mcEnemy._xscale * -1;
mcEnemy.avgX = -2;
}
mcEnemy.avgY = 0;
mcEnemy.speedX = 0;
mcEnemy.speedY = 0;
mcEnemy.patLeft = patL;
mcEnemy.patRight = patR;
mcEnemy.hitLeft = false;
mcEnemy.hitRight = false;
mcEnemy.hitTop = false;
mcEnemy.hitBottom = false;
}
function createEnemy6(loc, patL, patR) {
enemyScreen++;
enemyCount++;
attachMovie("refEnemy6", "enemy" + enemyCount, this.getNextHighestDepth());
mcEnemy = _root["enemy" + enemyCount];
mcEnemy.sta = "play";
mcEnemy.ball = 1;
mcEnemy.rollTime = 12;
mcEnemy.shootTime = 3;
mcEnemy.hideTime = 4;
mcEnemy.hideFor = 8;
mcEnemy.typ = "enemy6";
mcEnemy.free = false;
posConv = new Object();
posConv.x = loc._x;
posConv.y = loc._y;
design.localToGlobal(posConv);
mcEnemy._x = posConv.x;
mcEnemy._y = posConv.y;
mcEnemy.Jump = true;
randDirX = Math.floor(Math.random() * 2) + 1;
if (randDirX == 1) {
mcEnemy.avgX = 2;
} else {
mcEnemy._xscale = mcEnemy._xscale * -1;
mcEnemy.avgX = -2;
}
mcEnemy.avgY = 0;
mcEnemy.speedX = 0;
mcEnemy.speedY = 0;
mcEnemy.patLeft = patL;
mcEnemy.patRight = patR;
mcEnemy.hitLeft = false;
mcEnemy.hitRight = false;
mcEnemy.hitTop = false;
mcEnemy.hitBottom = false;
}
function createEnemy7(loc) {
enemyScreen++;
enemyCount++;
attachMovie("refEnemy7", "enemy" + enemyCount, this.getNextHighestDepth());
mcEnemy = _root["enemy" + enemyCount];
mcEnemy.sta = "play";
mcEnemy.ball = 1;
mcEnemy.rollTime = 12;
mcEnemy.typ = "enemy7";
mcEnemy.free = true;
posConv = new Object();
posConv.x = loc._x;
posConv.y = loc._y;
design.localToGlobal(posConv);
mcEnemy._x = posConv.x;
mcEnemy._y = posConv.y;
mcEnemy.Jump = true;
randDirX = Math.floor(Math.random() * 2) + 1;
if (randDirX == 1) {
mcEnemy.avgX = 2.5;
} else {
mcEnemy._xscale = mcEnemy._xscale * -1;
mcEnemy.avgX = -2.5;
}
randDirY = Math.floor(Math.random() * 2) + 1;
if (randDirY == 1) {
mcEnemy.avgY = 2.5;
} else {
mcEnemy.avgY = -2.5;
}
mcEnemy.speedX = 0;
mcEnemy.speedY = 0;
mcEnemy.hitLeft = false;
mcEnemy.hitRight = false;
mcEnemy.hitTop = false;
mcEnemy.hitBottom = false;
}
function createEnemy8(loc, patL, patR) {
enemyScreen++;
enemyCount++;
attachMovie("refEnemy8", "enemy" + enemyCount, this.getNextHighestDepth());
mcEnemy = _root["enemy" + enemyCount];
mcEnemy.sta = "play";
mcEnemy.ball = 1;
mcEnemy.rollTime = 12;
mcEnemy.shootTime = 3;
mcEnemy.typ = "enemy8";
mcEnemy.free = false;
posConv = new Object();
posConv.x = loc._x;
posConv.y = loc._y;
design.localToGlobal(posConv);
mcEnemy._x = posConv.x;
mcEnemy._y = posConv.y;
mcEnemy.Jump = true;
randDirX = Math.floor(Math.random() * 2) + 1;
if (randDirX == 1) {
mcEnemy.avgX = 2.5;
} else {
mcEnemy._xscale = mcEnemy._xscale * -1;
mcEnemy.avgX = -2.5;
}
mcEnemy.avgY = 0;
mcEnemy.speedX = 0;
mcEnemy.speedY = 0;
mcEnemy.patLeft = patL;
mcEnemy.patRight = patR;
mcEnemy.hitLeft = false;
mcEnemy.hitRight = false;
mcEnemy.hitTop = false;
mcEnemy.hitBottom = false;
}
function createEnemy9(loc, patL, patR) {
enemyScreen++;
enemyCount++;
attachMovie("refEnemy9", "enemy" + enemyCount, this.getNextHighestDepth());
mcEnemy = _root["enemy" + enemyCount];
mcEnemy.sta = "play";
mcEnemy.ball = 1;
mcEnemy.rollTime = 12;
mcEnemy.typ = "enemy9";
mcEnemy.free = false;
posConv = new Object();
posConv.x = loc._x;
posConv.y = loc._y;
design.localToGlobal(posConv);
mcEnemy._x = posConv.x;
mcEnemy._y = posConv.y;
mcEnemy.Jump = true;
randDirX = Math.floor(Math.random() * 2) + 1;
if (randDirX == 1) {
mcEnemy.avgX = 3;
} else {
mcEnemy._xscale = mcEnemy._xscale * -1;
mcEnemy.avgX = -3;
}
mcEnemy.avgY = 0;
mcEnemy.speedX = 0;
mcEnemy.speedY = 0;
mcEnemy.patLeft = patL;
mcEnemy.patRight = patR;
mcEnemy.hitLeft = false;
mcEnemy.hitRight = false;
mcEnemy.hitTop = false;
mcEnemy.hitBottom = false;
}
function createEnemy10(loc, patL, patR) {
enemyCount++;
attachMovie("refEnemy10", "enemy" + enemyCount, this.getNextHighestDepth());
mcEnemy = _root["enemy" + enemyCount];
mcEnemy.sta = "play";
mcEnemy.rollTime = 12;
mcEnemy.shootTime = 3;
mcEnemy.typ = "enemy10";
mcEnemy.kingLife = enemyKing;
mcEnemy.free = false;
posConv = new Object();
posConv.x = loc._x;
posConv.y = loc._y;
design.localToGlobal(posConv);
mcEnemy._x = posConv.x;
mcEnemy._y = posConv.y;
mcEnemy.Jump = true;
if (randDirX == 4) {
mcEnemy.avgX = 3;
} else {
mcEnemy._xscale = mcEnemy._xscale * -1;
mcEnemy.avgX = -3;
}
mcEnemy.avgY = 0;
mcEnemy.speedX = 0;
mcEnemy.speedY = 0;
mcEnemy.patLeft = patL;
mcEnemy.patRight = patR;
mcEnemy.hitLeft = false;
mcEnemy.hitRight = false;
mcEnemy.hitTop = false;
mcEnemy.hitBottom = false;
}
function enemyLoop(Void) {
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 5)) == "enemy")) {
mcEnemy = _root[i];
if (mcEnemy.free == false) {
if (arena.hitTest((mcEnemy._x - (mcEnemy._width / 2)) - 2, mcEnemy._y, true)) {
if (mcEnemy.sta == "roll") {
mcEnemy.avgX = mcEnemy.avgX * -1;
} else {
mcEnemy.speedX = 0;
}
while (arena.hitTest(mcEnemy._x - (mcEnemy._width / 2), mcEnemy._y, true)) {
mcEnemy._x = mcEnemy._x + 1;
}
mcEnemy.hitLeft = true;
} else {
mcEnemy.hitLeft = false;
}
if (arena.hitTest((mcEnemy._x + (mcEnemy._width / 2)) + 2, mcEnemy._y, true)) {
if (mcEnemy.sta == "roll") {
mcEnemy.avgX = mcEnemy.avgX * -1;
} else {
mcEnemy.speedX = 0;
}
while (arena.hitTest(mcEnemy._x + (mcEnemy._width / 2), mcEnemy._y, true)) {
mcEnemy._x = mcEnemy._x - 1;
}
mcEnemy.hitRight = true;
} else {
mcEnemy.hitRight = false;
}
if (arena.hitTest(mcEnemy._x, (mcEnemy._y - (mcEnemy._height / 2)) - 2, true)) {
mcEnemy.Speed = 0;
mcEnemy.Jump = false;
while (arena.hitTest(mcEnemy._x, mcEnemy._y - (mcEnemy._height / 2), true)) {
mcEnemy._y = mcEnemy._y + 1;
}
mcEnemy.hitTop = true;
} else {
mcEnemy.hitTop = false;
}
if (arena.hitTest(mcEnemy._x, (mcEnemy._y + (mcEnemy._height / 2)) + 2, true)) {
mcEnemy.speedY = 0;
mcEnemy.Jump = false;
while (arena.hitTest(mcEnemy._x, mcEnemy._y + (mcEnemy._height / 2), true)) {
mcEnemy._y = mcEnemy._y - 1;
}
mcEnemy.hitBottom = true;
} else {
mcEnemy.hitBottom = false;
}
} else if (mcEnemy.free == true) {
if (design.bound.hitTest((mcEnemy._x - (mcEnemy._width / 2)) - 2, mcEnemy._y, true)) {
while (design.bound.hitTest(mcEnemy._x - (mcEnemy._width / 2), mcEnemy._y, true)) {
mcEnemy._x = mcEnemy._x + 1;
}
mcEnemy.avgX = mcEnemy.avgX * -1;
mcEnemy._xscale = mcEnemy._xscale * -1;
}
if (design.bound.hitTest((mcEnemy._x + (mcEnemy._width / 2)) + 2, mcEnemy._y, true)) {
while (design.bound.hitTest(mcEnemy._x + (mcEnemy._width / 2), mcEnemy._y, true)) {
mcEnemy._x = mcEnemy._x - 1;
}
mcEnemy.avgX = mcEnemy.avgX * -1;
mcEnemy._xscale = mcEnemy._xscale * -1;
}
if (design.bound.hitTest(mcEnemy._x, (mcEnemy._y - (mcEnemy._height / 2)) - 2, true)) {
while (design.bound.hitTest(mcEnemy._x, mcEnemy._y - (mcEnemy._height / 2), true)) {
mcEnemy._y = mcEnemy._y + 1;
}
mcEnemy.avgY = mcEnemy.avgY * -1;
}
if (design.bound.hitTest(mcEnemy._x, (mcEnemy._y + (mcEnemy._height / 2)) + 2, true)) {
while (design.bound.hitTest(mcEnemy._x, mcEnemy._y + (mcEnemy._height / 2), true)) {
mcEnemy._y = mcEnemy._y - 1;
}
mcEnemy.avgY = mcEnemy.avgY * -1;
}
}
if (((mcEnemy.sta == "play") || (mcEnemy.sta == "freezy")) || (mcEnemy.sta == "hide")) {
if ((playerSta == "play") || (playerSta == "freezy")) {
if (viniCheat == false) {
if (mcEnemy.hitTest(player)) {
if ((((((((mcEnemy.typ == "enemy1") || (mcEnemy.typ == "enemy2")) || (mcEnemy.typ == "enemy3")) || (mcEnemy.typ == "enemy4")) || (mcEnemy.typ == "enemy5")) || (mcEnemy.typ == "enemy6")) || (mcEnemy.typ == "enemy9")) || (mcEnemy.typ == "enemy10")) {
if (playerSta == "freezy") {
createParticleFree(player._x, player._y);
}
if (mcEnemy._x > player._x) {
playerSpeedX = -5;
} else if (mcEnemy._x < player._x) {
playerSpeedX = 5;
}
player._y = player._y - 6;
playerSpeedY = -13;
playerJump = true;
playerSta = "stunt";
playerStuntTime = 6;
lifeInfo(-1);
sndHit.start(0, 1);
} else if ((mcEnemy.typ == "enemy7") || (mcEnemy.typ == "enemy8")) {
if (playerSta != "freezy") {
playerSta = "freezy";
sndFreezy.start(0, 1);
prince.gotoAndStop(2);
}
}
}
}
}
}
if (mcEnemy.sta == "play") {
if (mcEnemy.hitTest(mcEnemy.patLeft)) {
mcEnemy._x = mcEnemy._x + 2;
mcEnemy.avgX = mcEnemy.avgX * -1;
mcEnemy._xscale = mcEnemy._xscale * -1;
}
if (mcEnemy.hitTest(mcEnemy.patRight)) {
mcEnemy._x = mcEnemy._x - 2;
mcEnemy.avgX = mcEnemy.avgX * -1;
mcEnemy._xscale = mcEnemy._xscale * -1;
}
if ((mcEnemy.hitLeft == false) || (mcEnemy.hitRight == false)) {
mcEnemy.foot.gotoAndStop(2);
mcEnemy.speedX = mcEnemy.avgX;
}
} else if (mcEnemy.sta == "freezy") {
mcEnemy.foot.gotoAndStop(1);
} else if (mcEnemy.sta == "roll") {
for (j in this) {
if ((typeof(eval (j)) == "movieclip") && ((substring(j, 1, 5)) == "enemy")) {
mcEnemy2 = _root[j];
if (mcEnemy != mcEnemy2) {
if (mcEnemy.hitTest(mcEnemy2)) {
if (mcEnemy2.typ != "enemy10") {
mcEnemy.sta = "dieRoll";
mcEnemy2.sta = "dieRoll";
guiCombo.gotoAndStop(1);
guiCombo.gotoAndPlay(2);
scoreAdd(20);
} else if (mcEnemy2.typ == "enemy10") {
mcEnemy.sta = "dieRoll";
mcEnemy2.kingLife = mcEnemy2.kingLife - 1;
scoreAdd(20);
if (mcEnemy2.kingLife <= 0) {
mcEnemy2.sta = "dieRoll";
mcEnemy2.kingLife = 0;
}
trace("KING: " + mcEnemy2.kingLife);
}
}
}
}
}
mcEnemy.foot.gotoAndStop(1);
if (mcEnemy.avgX > 0) {
mcEnemy._rotation = mcEnemy._rotation + 8;
} else {
mcEnemy._rotation = mcEnemy._rotation - 8;
}
if ((mcEnemy.hitLeft == false) || (mcEnemy.hitRight == false)) {
mcEnemy.speedX = mcEnemy.avgX;
}
}
if (mcEnemy.sta == "play") {
if ((((mcEnemy.typ != "enemy2") && (mcEnemy.typ != "enemy3")) && (mcEnemy.typ != "enemy7")) && (mcEnemy.typ != "enemy9")) {
if (mcEnemy.hitBottom == false) {
mcEnemy.speedY = mcEnemy.speedY + enemyGrav;
}
}
} else if (mcEnemy.hitBottom == false) {
mcEnemy.speedY = mcEnemy.speedY + enemyGrav;
}
if (mcEnemy.free == true) {
mcEnemy.speedY = mcEnemy.avgY;
}
if (mcEnemy.speedY > 10) {
mcEnemy.speedY = 10;
}
if (mcEnemy.sta != "hide") {
mcEnemy._x = mcEnemy._x + mcEnemy.speedX;
mcEnemy._y = mcEnemy._y + mcEnemy.speedY;
}
if (mcEnemy.sta == "dieRoll") {
createParticleExplode(mcEnemy._x, mcEnemy._y);
createParticleSparkDust(mcEnemy._x, mcEnemy._y);
if (mcEnemy.typ == "enemy10") {
delayLose.gotoAndPlay(2);
}
createBonus(mcEnemy._x, mcEnemy._y);
scoreAdd(10);
sndEnemy.start(0, 1);
mcEnemy.removeMovieClip();
enemyScreen--;
}
}
}
}
function levelBuilder(Void) {
if ((gameLevel == 1) && (gameSta == "play")) {
if ((enemyScreen == 0) && (enemySpawn == 1)) {
createEnemy1(design.box7, design.box6, design.box8);
createEnemy1(design.box3, design.box2, design.box4);
createEnemy1(design.box12, design.box11, design.box13);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 2)) {
createEnemy2(design.box18, design.box17, design.box19);
createEnemy2(design.box15, design.box14, design.box16);
createEnemy2(design.box21, design.box20, design.box22);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 3)) {
createEnemy8(design.box3, design.box2, design.box4);
createEnemy8(design.box24, design.box23, design.box25);
trace("Chain: " + enemySpawn);
trace("3");
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 4)) {
createEnemy2(design.box3, design.box1, design.box5);
createEnemy2(design.box7, design.box6, design.box9);
createEnemy2(design.box12, design.box10, design.box13);
trace("Chain: " + enemySpawn);
trace("4");
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 5)) {
delayWin.gotoAndPlay(2);
enemySpawn++;
}
} else if ((gameLevel == 2) && (gameSta == "play")) {
if ((enemyScreen == 0) && (enemySpawn == 1)) {
createEnemy1(design.box12, design.box11, design.box13);
createEnemy1(design.box20, design.box9, design.box11);
createEnemy1(design.box21, design.box13, design.box15);
createEnemy3(design.spawn1);
createEnemy3(design.spawn8);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 2)) {
createEnemy8(design.box17, design.box16, design.box36);
createEnemy8(design.box18, design.box37, design.box19);
createEnemy8(design.box22, design.box9, design.box15);
createEnemy8(design.box23, design.box9, design.box15);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 3)) {
createEnemy2(design.box3, design.box1, design.box5);
createEnemy2(design.box6, design.box4, design.box8);
createEnemy2(design.box17, design.box9, design.box11);
createEnemy2(design.box18, design.box13, design.box19);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 4)) {
createEnemy3(design.box17);
createEnemy3(design.box36);
createEnemy3(design.box37);
createEnemy3(design.box18);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 5)) {
createEnemy4(design.box10, design.box9, design.box2);
createEnemy4(design.box14, design.box7, design.box15);
createEnemy4(design.box20, design.box9, design.box11);
createEnemy4(design.box21, design.box13, design.box15);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 6)) {
createEnemy1(design.box12, design.box11, design.box13);
createEnemy1(design.box20, design.box9, design.box11);
createEnemy1(design.box21, design.box13, design.box15);
createEnemy3(design.spawn1);
createEnemy3(design.spawn8);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 7)) {
delayWin.gotoAndPlay(2);
enemySpawn++;
}
} else if ((gameLevel == 3) && (gameSta == "play")) {
if ((enemyScreen == 0) && (enemySpawn == 1)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 2)) {
createEnemy2(design.box5, design.box3, design.box100);
createEnemy2(design.box7, design.box100, design.box9);
createEnemy2(design.box13, design.box1, design.box101);
createEnemy2(design.box16, design.box102, design.box11);
createEnemy2(design.box25, design.box24, design.box35);
createEnemy2(design.box281, design.box27, design.box30);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 3)) {
createEnemy1(design.box5, design.box4, design.box6);
createEnemy1(design.box7, design.box6, design.box8);
createEnemy1(design.box25, design.box24, design.box35);
createEnemy1(design.box281, design.box27, design.box30);
createEnemy3(design.box28);
createEnemy3(design.box29);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 4)) {
createEnemy8(design.box2, design.box1, design.box3);
createEnemy8(design.box10, design.box9, design.box11);
createEnemy8(design.box18, design.box1, design.box23);
createEnemy8(design.box33, design.box31, design.box11);
createEnemy8(design.box34, design.box1, design.box35);
createEnemy8(design.box37, design.box36, design.box11);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 5)) {
createEnemy7(design.box4);
createEnemy7(design.box8);
createEnemy2(design.box13, design.box1, design.box14);
createEnemy2(design.box16, design.box102, design.box11);
createEnemy7(design.box28);
createEnemy7(design.box29);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 6)) {
createEnemy1(design.box5, design.box4, design.box6);
createEnemy1(design.box7, design.box6, design.box8);
createEnemy1(design.box25, design.box24, design.box35);
createEnemy1(design.box281, design.box27, design.box30);
createEnemy3(design.box28);
createEnemy3(design.box29);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 7)) {
createEnemy7(design.box28);
createEnemy7(design.box29);
createEnemy4(design.box13, design.box12, design.box101);
createEnemy4(design.box16, design.box102, design.box17);
createEnemy4(design.box25, design.box24, design.box35);
createEnemy4(design.box281, design.box27, design.box30);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 8)) {
createEnemy1(design.box5, design.box4, design.box6);
createEnemy1(design.box7, design.box6, design.box8);
createEnemy1(design.box25, design.box24, design.box35);
createEnemy1(design.box281, design.box27, design.box30);
createEnemy3(design.box28);
createEnemy3(design.box29);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 9)) {
delayWin.gotoAndPlay(2);
enemySpawn++;
}
} else if ((gameLevel == 4) && (gameSta == "play")) {
if ((enemyScreen == 0) && (enemySpawn == 1)) {
createEnemy5(design.box16, design.box15, design.box17);
createEnemy5(design.box18, design.box17, design.box19);
createEnemy8(design.box22, design.box21, design.box23);
createEnemy8(design.box26, design.box25, design.box27);
createEnemy1(design.box14, design.box1, design.box3);
createEnemy1(design.box20, design.box11, design.box13);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 2)) {
createEnemy4(design.box2, design.box1, design.box3);
createEnemy4(design.box5, design.box4, design.box6);
createEnemy4(design.box9, design.box8, design.box10);
createEnemy4(design.box12, design.box11, design.box13);
createEnemy3(design.box22);
createEnemy3(design.box26);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 3)) {
createEnemy7(design.box5);
createEnemy7(design.box9);
createEnemy7(design.box22);
createEnemy7(design.box26);
createEnemy5(design.box28, design.box1, design.box29);
createEnemy5(design.box31, design.box30, design.box13);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 4)) {
createEnemy2(design.box22, design.box21, design.box17);
createEnemy2(design.box26, design.box17, design.box27);
createEnemy2(design.box5, design.box3, design.box7);
createEnemy2(design.box9, design.box7, design.box11);
createEnemy2(design.box14, design.box1, design.box15);
createEnemy2(design.box20, design.box19, design.box13);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 5)) {
createEnemy5(design.box14, design.box1, design.box3);
createEnemy5(design.box20, design.box11, design.box13);
createEnemy5(design.box9, design.box8, design.box10);
createEnemy5(design.box5, design.box4, design.box6);
createEnemy7(design.box22);
createEnemy7(design.box26);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 6)) {
createEnemy5(design.box16, design.box15, design.box17);
createEnemy5(design.box18, design.box17, design.box19);
createEnemy8(design.box22, design.box21, design.box23);
createEnemy8(design.box26, design.box25, design.box27);
createEnemy1(design.box14, design.box1, design.box3);
createEnemy1(design.box20, design.box11, design.box13);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 7)) {
createEnemy7(design.box5);
createEnemy7(design.box9);
createEnemy7(design.box22);
createEnemy7(design.box26);
createEnemy5(design.box28, design.box1, design.box29);
createEnemy5(design.box31, design.box30, design.box13);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 8)) {
createEnemy4(design.box2, design.box1, design.box3);
createEnemy4(design.box5, design.box4, design.box6);
createEnemy4(design.box9, design.box8, design.box10);
createEnemy4(design.box12, design.box11, design.box13);
createEnemy3(design.box22);
createEnemy3(design.box26);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 9)) {
createEnemy5(design.box22, design.box21, design.box23);
createEnemy5(design.box26, design.box25, design.box27);
createEnemy5(design.box2, design.box1, design.box3);
createEnemy5(design.box12, design.box11, design.box13);
createEnemy2(design.box22, design.box21, design.box17);
createEnemy2(design.box26, design.box17, design.box27);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 10)) {
createEnemy5(design.box5, design.box4, design.box6);
createEnemy5(design.box9, design.box8, design.box10);
createEnemy5(design.box16, design.box15, design.box17);
createEnemy5(design.box18, design.box17, design.box19);
createEnemy7(design.box5);
createEnemy7(design.box9);
createEnemy7(design.box22);
createEnemy7(design.box26);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 11)) {
delayWin.gotoAndPlay(2);
enemySpawn++;
}
} else if ((gameLevel == 5) && (gameSta == "play")) {
if ((enemyScreen == 0) && (enemySpawn == 1)) {
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 2)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 3)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 4)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 5)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 6)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 7)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 8)) {
createEnemy8(design.box28, design.box1, design.box29);
createEnemy8(design.box32, design.box31, design.box11);
createEnemy3(design.box103);
createEnemy3(design.box104);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 9)) {
createEnemy9(design.box24, design.box101, design.box102);
createEnemy9(design.box6, design.box5, design.box7);
createEnemy9(design.box21, design.box1, design.box22);
createEnemy9(design.box27, design.box26, design.box11);
createEnemy7(design.box103);
createEnemy7(design.box104);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 10)) {
createEnemy6(design.box103, design.box33, design.box30);
createEnemy6(design.box104, design.box30, design.box34);
createEnemy5(design.box15, design.box14, design.box16);
createEnemy5(design.box18, design.box17, design.box19);
createEnemy5(design.box2, design.box1, design.box3);
createEnemy5(design.box10, design.box9, design.box11);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 11)) {
delayWin.gotoAndPlay(2);
enemySpawn++;
}
} else if ((gameLevel == 6) && (gameSta == "play")) {
if ((enemyScreen == 0) && (enemySpawn == 1)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 2)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 3)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 4)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 5)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 6)) {
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 7)) {
createEnemy3(design.box3);
createEnemy3(design.box8);
createEnemy3(design.box24);
createEnemy3(design.box26);
createEnemy2(design.box13, design.box12, design.box14);
createEnemy2(design.box20, design.box12, design.box14);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 8)) {
createEnemy8(design.box13, design.box12, design.box14);
createEnemy4(design.box18, design.box9, design.box19);
createEnemy4(design.box23, design.box21, design.box17);
createEnemy4(design.box3, design.box2, design.box5);
createEnemy4(design.box8, design.box6, design.box91);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 9)) {
createEnemy9(design.box10, design.box9, design.box11);
createEnemy9(design.box16, design.box15, design.box17);
createEnemy9(design.box20, design.box12, design.box14);
createEnemy2(design.box13, design.box12, design.box14);
createEnemy2(design.box18, design.box9, design.box12);
createEnemy2(design.box23, design.box14, design.box17);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 10)) {
createEnemy7(design.box3);
createEnemy7(design.box8);
createEnemy7(design.box24);
createEnemy7(design.box26);
createEnemy3(design.box10);
createEnemy3(design.box60);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 11)) {
createEnemy2(design.box10, design.box9, design.box11);
createEnemy2(design.box16, design.box15, design.box17);
createEnemy2(design.box20, design.box12, design.box14);
createEnemy9(design.box13, design.box12, design.box14);
createEnemy9(design.box18, design.box9, design.box12);
createEnemy9(design.box23, design.box14, design.box17);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 12)) {
createEnemy5(design.box13, design.box12, design.box14);
createEnemy6(design.box18, design.box9, design.box19);
createEnemy6(design.box23, design.box21, design.box17);
createEnemy6(design.box3, design.box2, design.box5);
createEnemy6(design.box8, design.box6, design.box91);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 13)) {
delayWin.gotoAndPlay(2);
enemySpawn++;
}
} else if ((gameLevel == 7) && (gameSta == "play")) {
if ((enemyScreen == 0) && (enemySpawn == 1)) {
createEnemy5(design.box17, design.box7, design.box9);
createEnemy6(design.box27, design.box26, design.box28);
createEnemy6(design.box16, design.box4, design.box6);
createEnemy6(design.box18, design.box10, design.box12);
createEnemy6(design.box8, design.box7, design.box9);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 2)) {
createEnemy8(design.box21, design.box4, design.box6);
createEnemy8(design.box23, design.box10, design.box12);
createEnemy4(design.box20, design.box1, design.box3);
createEnemy4(design.box24, design.box100, design.box14);
createEnemy4(design.box15, design.box1, design.box3);
createEnemy4(design.box19, design.box100, design.box14);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 3)) {
createEnemy1(design.box16, design.box4, design.box6);
createEnemy1(design.box18, design.box10, design.box12);
createEnemy7(design.box2);
createEnemy7(design.box13);
createEnemy3(design.box25);
createEnemy3(design.box29);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 4)) {
createEnemy9(design.box2, design.box1, design.box4);
createEnemy9(design.box13, design.box12, design.box14);
createEnemy2(design.box8, design.box7, design.box9);
createEnemy2(design.box17, design.box7, design.box9);
createEnemy9(design.box25, design.box1, design.box3);
createEnemy9(design.box29, design.box100, design.box14);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 5)) {
createEnemy8(design.box17, design.box7, design.box9);
createEnemy8(design.box27, design.box26, design.box28);
createEnemy8(design.box16, design.box4, design.box6);
createEnemy4(design.box18, design.box10, design.box12);
createEnemy4(design.box8, design.box7, design.box9);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 6)) {
createEnemy5(design.box21, design.box4, design.box6);
createEnemy5(design.box23, design.box10, design.box12);
createEnemy6(design.box20, design.box1, design.box3);
createEnemy6(design.box24, design.box100, design.box14);
createEnemy6(design.box15, design.box1, design.box3);
createEnemy6(design.box19, design.box100, design.box14);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 7)) {
createEnemy2(design.box2, design.box1, design.box4);
createEnemy2(design.box13, design.box12, design.box14);
createEnemy9(design.box8, design.box7, design.box9);
createEnemy9(design.box17, design.box7, design.box9);
createEnemy9(design.box25, design.box1, design.box3);
createEnemy9(design.box29, design.box100, design.box14);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 8)) {
createEnemy5(design.box16, design.box4, design.box6);
createEnemy5(design.box18, design.box10, design.box12);
createEnemy7(design.box2);
createEnemy7(design.box13);
createEnemy7(design.box25);
createEnemy7(design.box29);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 9)) {
createEnemy6(design.box21, design.box4, design.box6);
createEnemy6(design.box23, design.box10, design.box12);
createEnemy6(design.box20, design.box1, design.box3);
createEnemy6(design.box24, design.box100, design.box14);
createEnemy6(design.box15, design.box1, design.box3);
createEnemy6(design.box19, design.box100, design.box14);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 10)) {
createEnemy6(design.box16, design.box4, design.box6);
createEnemy6(design.box18, design.box10, design.box12);
createEnemy7(design.box2);
createEnemy7(design.box13);
createEnemy7(design.box25);
createEnemy7(design.box29);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 11)) {
createEnemy8(design.box16, design.box4, design.box6);
createEnemy8(design.box18, design.box10, design.box12);
createEnemy7(design.box2);
createEnemy7(design.box13);
createEnemy7(design.box25);
createEnemy7(design.box29);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 12)) {
delayWin.gotoAndPlay(2);
enemySpawn++;
}
} else if ((gameLevel == 8) && (gameSta == "play")) {
if ((enemyScreen == 0) && (enemySpawn == 1)) {
createEnemy9(design.box12, design.box11, design.box13);
createEnemy9(design.box10, design.box1, design.box4);
createEnemy9(design.box16, design.box15, design.box18);
createEnemy9(design.box22, design.box20, design.box23);
createEnemy8(design.box24, design.box15, design.box17);
createEnemy8(design.box26, design.box21, design.box23);
createEnemy10(design.box12, design.box15, design.box23);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 2)) {
createEnemy6(design.box19, design.box18, design.box20);
createEnemy6(design.box2, design.box1, design.box4);
createEnemy6(design.box8, design.box6, design.box9);
createEnemy5(design.box10, design.box1, design.box4);
createEnemy5(design.box14, design.box6, design.box9);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 3)) {
createEnemy4(design.box16, design.box15, design.box17);
createEnemy4(design.box22, design.box21, design.box23);
createEnemy4(design.box24, design.box15, design.box17);
createEnemy4(design.box26, design.box21, design.box23);
createEnemy7(design.box5);
createEnemy7(design.box16);
createEnemy7(design.box22);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 4)) {
createEnemy4(design.box19, design.box18, design.box20);
createEnemy4(design.box2, design.box1, design.box4);
createEnemy4(design.box8, design.box6, design.box9);
createEnemy1(design.box10, design.box1, design.box4);
createEnemy1(design.box14, design.box6, design.box9);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 5)) {
createEnemy5(design.box10, design.box1, design.box11);
createEnemy5(design.box14, design.box13, design.box9);
createEnemy9(design.box19, design.box18, design.box20);
createEnemy9(design.box25, design.box18, design.box20);
createEnemy7(design.box5);
createEnemy7(design.box16);
createEnemy7(design.box22);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 6)) {
createEnemy2(design.box5, design.box4, design.box6);
createEnemy4(design.box2, design.box1, design.box4);
createEnemy4(design.box8, design.box6, design.box9);
createEnemy2(design.box10, design.box1, design.box4);
createEnemy2(design.box14, design.box6, design.box9);
trace("Chain: " + enemySpawn);
enemySpawn++;
} else if ((enemyScreen == 0) && (enemySpawn == 7)) {
enemySpawn = 1;
}
}
if (gameLevel == 0) {
if ((enemyScreen == 0) && (enemySpawn == 4)) {
createEnemy10(design.spawn1, design.wall11, design.wall12);
} else if ((enemyScreen == 0) && (gameSpawn == 3)) {
createEnemy("2", design.spawn1, design.wall3, design.wall4);
createEnemy("2", design.spawn2, design.wall1, design.wall2);
createEnemy("2", design.spawn3, design.wall5, design.wall6);
}
}
}
stopAllSounds();
sndMusic.start(0, 50000);
stop();
var gameSta = "pause";
_quality = "MEDIUM";
playerSta = "play";
playerStuntTime = 6;
playerFreezyTime = 6;
playerShieldTime = 12;
guiLife.gotoAndStop(5);
gravitation = 0.98;
particleCount = 0;
playerSpeedX = 0;
playerSpeedY = 0;
playerJump = false;
hitLeft = false;
hitRight = false;
hitTop = false;
hitBottom = false;
playerLife = 5;
playerSpeedHor = 0.8;
ammoDistance = 100;
ammoScreenCount = 0;
var ammoScreenAllow = 3;
ammoCount = 0;
ammoScreen = 0;
ammoScreenMax = 3;
ammoAcc = 1.07;
bonusCount = 0;
var enemyCount = 0;
enemyScreen = 0;
enemySpawn = 1;
enemyKing = 30;
enemyGrav = 0.98;
if (gameLevel == 1) {
arena.gotoAndStop(1);
design.gotoAndStop(1);
gameSpawn = 4;
} else if (gameLevel == 2) {
arena.gotoAndStop(2);
design.gotoAndStop(2);
} else if (gameLevel == 3) {
arena.gotoAndStop(3);
design.gotoAndStop(3);
} else if (gameLevel == 4) {
arena.gotoAndStop(4);
design.gotoAndStop(4);
} else if (gameLevel == 5) {
arena.gotoAndStop(5);
design.gotoAndStop(5);
} else if (gameLevel == 6) {
arena.gotoAndStop(6);
design.gotoAndStop(6);
} else if (gameLevel == 7) {
arena.gotoAndStop(7);
design.gotoAndStop(7);
} else if (gameLevel == 8) {
arena.gotoAndStop(8);
design.gotoAndStop(8);
}
function onEnterFrame(Void) {
if (gameSta == "play") {
playerLoop();
ammoLoop();
particleLoop();
enemyLoop();
fixLoop();
bonusLoop();
levelBuilder();
} else if (gameSta == "win") {
playerLoop();
ammoLoop();
particleLoop();
enemyLoop();
fixLoop();
bonusLoop();
levelBuilder();
} else if (gameSta == "lose") {
playerLoop();
ammoLoop();
particleLoop();
enemyLoop();
fixLoop();
bonusLoop();
}
}
function scoreAdd(num) {
gameScore = gameScore + num;
guiScore.textScore.text = gameScore;
}
function rollEnemy(Void) {
for (j in this) {
if ((typeof(eval (j)) == "movieclip") && ((substring(j, 1, 5)) == "enemy")) {
mcEnemy = _root[j];
if (mcEnemy.sta == "ball") {
if (mcEnemy.hitTest(player)) {
mcEnemy.sta = "roll";
if (player._xscale == 100) {
mcEnemy.avgX = 10;
} else {
mcEnemy.avgX = -10;
}
}
}
}
}
}
function fixLoop(Void) {
design._x = arena._x;
design._y = arena._y;
prince._x = player._x;
prince._y = player._y;
if (player._xscale == 100) {
prince._xscale = 100;
} else if (player._xscale == -100) {
prince._xscale = -100;
}
if (playerJump == false) {
if ((playerSpeedX > 1) || (playerSpeedX < -1)) {
prince.foot.gotoAndStop(2);
} else {
prince.foot.gotoAndStop(1);
}
} else {
prince.hand.gotoAndStop(2);
prince.foot.gotoAndStop(3);
}
}
function timeIntPlayer() {
if (playerSta == "stunt") {
prince.gotoAndStop(1);
if (playerStuntTime > 0) {
playerStuntTime = playerStuntTime - 1;
} else if (playerStuntTime <= 0) {
playerSta = "play";
prince._alpha = 100;
playerStuntTime = 6;
}
} else if (playerSta == "shield") {
if (playerShieldTime > 0) {
playerShieldTime = playerShieldTime - 1;
} else if (playerShieldTime <= 0) {
playerShieldTime = 10;
prince.gotoAndStop(1);
playerSta = "play";
}
} else if (playerSta == "freezy") {
if (playerFreezyTime > 0) {
playerFreezyTime = playerFreezyTime - 1;
} else if (playerFreezyTime <= 0) {
if (mcEnemy._x > player._x) {
playerSpeedX = -5;
} else if (mcEnemy._x < player._x) {
playerSpeedX = 5;
}
player._y = player._y - 6;
playerSpeedY = -13;
playerJump = true;
playerSta = "stunt";
playerStuntTime = 6;
lifeInfo(-1);
createParticleFree(player._x, player._y);
playerFreezyTime = 6;
}
}
}
function timeIntEnemy() {
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 5)) == "enemy")) {
mcEnemy = _root[i];
if (mcEnemy.sta == "roll") {
mcEnemy.rollTime = mcEnemy.rollTime - 1;
if (mcEnemy.rollTime <= 0) {
mcEnemy.sta = "dieRoll";
}
}
if (mcEnemy.sta == "play") {
if (((mcEnemy.typ == "enemy4") || (mcEnemy.typ == "enemy9")) || (mcEnemy.typ == "enemy10")) {
mcEnemy.body.gotoAndStop(1);
mcEnemy.shootTime = mcEnemy.shootTime - 1;
if (mcEnemy.shootTime <= 0) {
if (mcEnemy._xscale == 100) {
createAmmoEnemy("fire", mcEnemy._x, mcEnemy._y, 1, 4);
} else if (mcEnemy._xscale == -100) {
createAmmoEnemy("fire", mcEnemy._x, mcEnemy._y, 1, -4);
}
mcEnemy.body.gotoAndStop(2);
mcEnemy.shootTime = 3;
}
} else if (mcEnemy.typ == "enemy8") {
mcEnemy.body.gotoAndStop(1);
mcEnemy.shootTime = mcEnemy.shootTime - 1;
if (mcEnemy.shootTime <= 0) {
if (mcEnemy._xscale == 100) {
createAmmoEnemy("frooze", mcEnemy._x, mcEnemy._y, 1, 4);
} else if (mcEnemy._xscale == -100) {
createAmmoEnemy("frooze", mcEnemy._x, mcEnemy._y, 1, -4);
}
mcEnemy.body.gotoAndStop(2);
mcEnemy.shootTime = 3;
}
} else if (mcEnemy.typ == "enemy11") {
mcEnemy.body.gotoAndStop(1);
mcEnemy.shootTime = mcEnemy.shootTime - 1;
if (mcEnemy.shootTime <= 0) {
if (mcEnemy._xscale == 100) {
createAmmoEnemy("fire", mcEnemy._x, mcEnemy._y, 1, 4);
} else if (mcEnemy._xscale == -100) {
createAmmoEnemy("fire", mcEnemy._x, mcEnemy._y, 1, -4);
}
mcEnemy.body.gotoAndStop(2);
mcEnemy.shootTime = 3;
}
} else if ((mcEnemy.typ == "enemy5") || (mcEnemy.typ == "enemy6")) {
mcEnemy.body.gotoAndStop(1);
mcEnemy.shootTime = mcEnemy.shootTime - 1;
if (mcEnemy.shootTime <= 0) {
if (mcEnemy._xscale == 100) {
createAmmoEnemy("fire", mcEnemy._x, mcEnemy._y, 1, 4);
} else if (mcEnemy._xscale == -100) {
createAmmoEnemy("fire", mcEnemy._x, mcEnemy._y, 1, -4);
}
mcEnemy.body.gotoAndStop(2);
mcEnemy.shootTime = 3;
}
mcEnemy.hideTime = mcEnemy.hideTime - 1;
if (mcEnemy.hideTime <= 0) {
mcEnemy.sta = "hide";
mcEnemy.foot.gotoAndStop(1);
mcEnemy.body.gotoAndStop(3);
mcEnemy.hideTime = 6;
}
}
} else if (mcEnemy.sta == "hide") {
mcEnemy.hideFor = mcEnemy.hideFor - 1;
if (mcEnemy.hideFor <= 0) {
mcEnemy.sta = "play";
mcEnemy.body.gotoAndStop(4);
mcEnemy.hideTime = 6;
mcEnemy.hideFor = 4;
}
}
}
}
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 4)) == "ammo")) {
mcAmmo = _root[i];
if (mcAmmo.from == "enemy") {
mcAmmo.playTime = mcAmmo.playTime - 1;
if (mcAmmo.playTime <= 0) {
mcAmmo.playTime = 0;
mcAmmo.sta = "die";
}
}
}
}
}
function cleanUp() {
trace("CLEAN UP");
stopAllSounds();
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 5)) == "enemy")) {
mcAmmo = _root[i];
mcAmmo.removeMovieClip();
}
}
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 4)) == "ammo")) {
mcAmmo = _root[i];
mcAmmo.removeMovieClip();
}
}
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 8)) == "particle")) {
mcAmmo = _root[i];
mcAmmo.removeMovieClip();
}
}
for (i in this) {
if ((typeof(eval (i)) == "movieclip") && ((substring(i, 1, 5)) == "bonus")) {
mcAmmo = _root[i];
mcAmmo.removeMovieClip();
}
}
clearInterval(intPlayer);
clearInterval(intEnemy);
Key.removeListener(gameKey);
}
var gameKey = new Object();
gameKey.onKeyDown = function () {
if ((Key.getCode() == "80") || (Key.getCode() == "122")) {
if (gameSta == "play") {
gameSta = "pause";
} else if (gameSta == "pause") {
gameSta = "play";
}
}
if (gameSta == "play") {
if (Key.getCode() == 32) {
if (ammoScreenCount < ammoScreenAllow) {
if (playerSta != "freezy") {
if (player._xscale == 100) {
createAmmoPlayer("ice", player._x, player._y, 1, 4);
sndShoot.start(0, 1);
} else if (player._xscale == -100) {
createAmmoPlayer("ice", player._x, player._y, 1, -4);
sndShoot.start(0, 1);
}
rollEnemy();
}
}
}
}
};
Key.addListener(gameKey);
intPlayer = setInterval(this, "timeIntPlayer", 500);
intEnemy = setInterval(this, "timeIntEnemy", 500);
Instance of Symbol 354 MovieClip in Frame 5
on (release) {
getURL ("http://playedoff.com/mario", "_blank");
}
Frame 6
stop();
if (cond == "win") {
gameLevel++;
trace("Reset: " + gameLevel);
if ((gameLevel > 0) && (gameLevel <= 8)) {
trace("gl: " + gameLevel);
_root.gotoAndStop("level");
} else if (gameLevel >= 9) {
_root.gotoAndStop("end");
}
} else if (cond == "lose") {
_root.gotoAndStop("level");
}
Frame 7
stop();
btnBack.onPress = function () {
sndButton.start(0, 1);
_root.gotoAndStop("menu");
};
Symbol 46 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 110 MovieClip Frame 1
stop();
Symbol 137 MovieClip [refSparkFire] Frame 10
sta = "die";
Symbol 140 MovieClip [refSparkDust] Frame 10
sta = "die";
Symbol 165 MovieClip [refBonus] Frame 1
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 199 MovieClip Frame 10
stop();
Symbol 200 MovieClip Frame 11
_parent.gotoAndStop(1);
Symbol 201 MovieClip Frame 1
stop();
Symbol 207 MovieClip Frame 1
stop();
Symbol 214 MovieClip [refSparkIce] Frame 10
sta = "die";
Symbol 223 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 10
stop();
Symbol 246 MovieClip Frame 11
_parent.gotoAndStop(1);
Symbol 247 MovieClip Frame 1
stop();
Symbol 251 MovieClip Frame 1
stepp = 0;
Symbol 272 MovieClip Frame 40
stop();
Symbol 286 Button
on (press) {
tellTarget (_root) {
nextFrame();
};
}
Symbol 287 Button
on (press) {
gotoAndStop ("check");
_root.play();
}
Symbol 288 Button
on (release) {
gotoAndPlay ("menu");
}
Instance of Symbol 262 MovieClip in Symbol 289 MovieClip Frame 1
onClipEvent (load) {
_root.stop();
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndStop("lastframe");
}
}
onClipEvent (enterFrame) {
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndPlay("loaded");
}
}
Symbol 289 MovieClip Frame 101
play();
Symbol 289 MovieClip Frame 165
stop();
Symbol 297 MovieClip Frame 1
function startAd(ngad_url) {
var ngads_redirect = new XML();
ngads_redirect.ignoreWhite = true;
ngads_redirect.onLoad = function (success) {
trace("[NEWGROUNDS FLASH ADS] :: You may get a 'Security Sandbox Violation' ... this is normal, do not freak out!");
if (success) {
ng_ad.loadMovie(ngads_redirect.toString(), "GET");
}
};
ngads_redirect.load(ngad_url);
}
if (NewgroundsAPI.getAdURL()) {
startAd(NewgroundsAPI.getAdURL());
}
NewgroundsAPI.onAdsApproved = function (ad_url) {
startAd(ad_url);
};
stop();
Instance of Symbol 293 MovieClip in Symbol 297 MovieClip Frame 1
on (release) {
getURL ("http://www.toonarcades.com/", "_blank");
}
Instance of Symbol 296 MovieClip in Symbol 297 MovieClip Frame 1
on (release) {
getURL ("http://www.toonarcades.com/", "_blank");
}
Symbol 335 Button
on (release) {
getURL ("http://www.toonarcades.com/", "_blank");
}
Symbol 340 Button
on (release) {
getURL ("http://www.toonarcades.com/mario", "_blank");
}
Symbol 343 Button
on (release) {
getURL ("http://www.toonarcades.com/mario", "_blank");
}
Symbol 352 MovieClip Frame 42
stop();
Symbol 375 MovieClip Frame 30
stop();
Symbol 376 MovieClip Frame 1
stop();
Symbol 390 MovieClip Frame 30
_parent.gotoAndStop(1);
Symbol 391 MovieClip Frame 1
stop();
Symbol 490 MovieClip Frame 1
stop();
Symbol 529 MovieClip Frame 1
stop();
Symbol 530 MovieClip Frame 146
_root.sndKing.start(0, 1);
Symbol 530 MovieClip Frame 245
stop();
Symbol 531 MovieClip Frame 1
stop();
btnNext.onPress = function () {
_root.sndButton.start(0, 1);
nextFrame();
};
Symbol 531 MovieClip Frame 2
stop();
btnNext.onPress = function () {
_root.sndButton.start(0, 1);
nextFrame();
};
Symbol 531 MovieClip Frame 3
stop();
btnNext.onPress = function () {
_root.sndButton.start(0, 1);
nextFrame();
};
Symbol 531 MovieClip Frame 4
stop();
btnNext.onPress = function () {
_root.sndButton.start(0, 1);
_root.gotoAndStop("level");
};
Symbol 559 MovieClip Frame 1
stop();
Symbol 688 MovieClip Frame 1
stop();
Symbol 698 MovieClip Frame 1
stop();
Symbol 701 MovieClip Frame 1
stop();
Symbol 701 MovieClip Frame 60
stop();
_root.cleanUp();
_root.gameSta = "pause";
_root.sndLose.start(0, 1);
_root.guiControl.gotoAndStop("lose");
Symbol 702 MovieClip Frame 1
stop();
Symbol 702 MovieClip Frame 60
stop();
_root.cleanUp();
_root.gameSta = "pause";
_root.guiControl.gotoAndStop("win");
_root.sndWin.start(0, 1);
Symbol 709 MovieClip Frame 1
stop();
Symbol 734 MovieClip Frame 1
stop();
Symbol 752 MovieClip Frame 1
stop();
Symbol 761 MovieClip Frame 1
stop();
Symbol 765 MovieClip Frame 1
stop();
if ((_root.gameLevel == 1) || (_root.gameLevel == 2)) {
btnMoreGames._visible = false;
} else {
btnMoreGames._visible = true;
}
if (_root.gameLevel <= 8) {
guiLevel.gotoAndStop(_root.gameLevel);
}
btnStart.onPress = function () {
_root.sndButton.start(0, 1);
_root.gameSta = "play";
_root.guiControl.gotoAndStop("hide");
};
Symbol 765 MovieClip Frame 2
stop();
if (_root.gameLevel == 1) {
btnMoreGames._visible = false;
} else {
btnMoreGames._visible = true;
}
btnRetry.onPress = function () {
_root.cond = "lose";
_root.gotoAndStop("restart");
};
Symbol 765 MovieClip Frame 3
stop();
if (_root.gameLevel == 1) {
btnMoreGames._visible = false;
} else {
btnMoreGames._visible = true;
}
btnOk.onPress = function () {
_root.cond = "win";
_root.gotoAndStop("restart");
};
Instance of Symbol 296 MovieClip in Symbol 779 MovieClip Frame 1
on (release) {
getURL ("http://playcow.com", "_blank");
}
Symbol 784 Button
on (release) {
getURL ("http://www.toonarcades.com/", "_blank");
}
Symbol 790 Button
on (release) {
getURL ("http://www.gamesnow.biz/free_website_games.html", "_blank");
}