Frame 1
function gotoMenu() {
gotoAndStop ("menu");
}
function gotoPicker() {
_root.charNum = 0;
_root.level = 1;
_root.lives = 5;
_root.part = 0;
gotoAndStop ("picker");
}
function goDebug() {
trace("=====DEBUG====");
_root.charNum = 0;
_root.level = 99;
_root.lives = 0;
_root.part = 0;
gotoAndStop ("game");
}
function handleMute() {
muted = !muted;
if (muted) {
globalSound.setVolume(0);
} else {
globalSound.setVolume(100);
}
}
function handlePause() {
gamePaused = !gamePaused;
if (gamePaused) {
hud.pausedScene._visible = true;
} else {
hud.pausedScene._visible = false;
}
}
stop();
var debug = false;
Stage.showMenu = false;
var muted = false;
var gamePaused = false;
var globalSound = new Sound();
Frame 2
stop();
Frame 3
function gotoMiniIntro() {
gotoAndStop ("miniIntro");
}
function getMyGame() {
gotoAndStop ("game");
}
charNum = 0;
level = 1;
lives = 5;
part = 0;
var levelDisp = ("LEVEL " + level);
var livesDisp = ("LIVES x" + lives);
var fromMenu = true;
Frame 4
stop();
fruitCollected = 0;
stopAllSounds();
var funky = new Sound(this);
funky.attachSound("funkLoop");
funky.start(0, 999);
cheatPanel._visible = false;
cheat = false;
onEnterFrame = function () {
if ((Key.isDown(8) && (Key.isDown(16))) && (Key.isDown(32))) {
cheatPanel._visible = true;
cheat = true;
}
};
Frame 5
stopAllSounds();
function addBox(mov) {
boxCounter++;
boxes.push(boxCounter);
mov._name = "box" + boxCounter;
mov.thrown = false;
mov.xVel = 0;
mov.yVel = 0;
mov.xMax = 200;
mov.yMax = 200;
mov.xF = 0;
mov.fallThrough = false;
}
function colorKeys(str) {
switch (str) {
case "A" :
return(13408512);
case "B" :
return(11737733);
case "C" :
return(2402353);
case "D" :
return(16448056);
case "E" :
return(10066329);
case "F" :
return(3368550);
case "G" :
return(16711680);
case "H" :
return(15517692);
case "I" :
return(65280);
case "J" :
return(10092288);
case "K" :
return(16777215);
}
}
function moveBoxes() {
i = 0;
while (i < boxes.length) {
curBox = tiles["box" + boxes[i]];
enemyVertical(curBox);
if (!curBox.fallThrough) {
bounding(curBox);
}
if (curBox.xVel == 0) {
}
if ((Math.abs(curBox.xVel) < 0.2) && (Math.abs(curBox.yVel) < 1)) {
curBox.idleCounter++;
if (curBox.idleCounter > 5) {
curBox._y = Math.floor(curBox._y / 40) * 40;
curBox._x = Math.floor(curBox._x / 40) * 40;
curBox.thrown = false;
curBox._name = (("tile" + (curBox._x / 40)) + "x") + (curBox._y / 40);
boxes.splice(i, 1);
}
} else {
curBox.idleCounter = 0;
}
if (curBox.thrown) {
} else if (curBox.hitTest(tiles.player)) {
}
i++;
}
}
function boxItem(mc, mc2, xMove, yMove) {
if (mc.mMode != 8) {
if (xMove < 0) {
if (checkCoords(mc, mc._x + xMove, mc._y, 3)) {
mc._x = mc._x + xMove;
} else {
mc._x = (mc.bl._x + tileSize) + (mc._width / 2);
}
}
if (xMove > 0) {
if (checkCoords(mc, mc._x + xMove, mc._y, 2)) {
mc._x = mc._x + xMove;
} else {
mc._x = mc.br._x - (mc._width / 2);
}
}
mc.yVel = 0;
mc.yLove = 0;
if ((mc.yVel > 1) && (yMove >= 0)) {
while (mc.hitTest(mc2.helder)) {
mc._y--;
}
mc._y--;
}
}
}
function mainReset() {
hurt = false;
levelDisp = "LEVEL " + level;
livesDisp = "LIVES x" + lives;
size = "a";
cStatus = 0;
hud._visible = false;
totalFruit = 0;
fruitCollected = 0;
holding = false;
item = null;
shel = highUp.attachMovie("levelTween", "levelTween", k++);
shel._x = 0;
shel._y = 0;
loadChar();
depths();
}
function mainLoader() {
hud.roboStats.gotoAndStop(1);
hud.roboStats._visible = false;
tiles.removeMovieClip();
highUp.removeMovieClip();
bg.removeMovieClip();
bg1.removeMovieClip();
bg2.removeMovieClip();
_root.createEmptyMovieClip("highUp", k++);
_root.createEmptyMovieClip("bg", k++);
_root.createEmptyMovieClip("bg1", k++);
_root.createEmptyMovieClip("bg2", k++);
if ((level == 1) || (level == 2)) {
i = 0;
while (i < 5) {
if (((level == 2) && (part == 1)) || ((level == 1) && (part == 0))) {
shel = bg.attachMovie("bg2", "bg" + i, k++);
} else {
shel = bg.attachMovie("bg", "bg" + i, k++);
}
shel._x = (-1 + i) * 1500;
shel._y = -1300;
i++;
}
}
if (level == 3) {
i = 0;
while (i < 5) {
shel = bg.attachMovie("specBG1", "bg" + i, k++);
shel._x = (-1 + i) * 1500;
shel._y = -700;
i++;
}
shel = bg1.attachMovie("moonClip", "bg" + i, k++);
shel._x = 0;
shel._y = -200;
i = 0;
while (i < 5) {
shel = bg2.attachMovie("cloudsApart", "bg" + i, k++);
shel._x = (-1 + i) * 1500;
shel._y = -700;
i++;
}
}
_root._x = 0;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
backgroundInstances.splice(0, backgroundInstances.length);
logs.splice(0, logs.length);
enemiesList.splice(0, enemiesList.length);
plantsList.splice(0, plantsList.length);
birds.splice(0, birds.length);
turnipWaiters.splice(0, turnipWaiters.length);
bombs.splice(0, bombs.length);
bombsList.splice(0, bombsList.length);
bees.splice(0, bees.length);
turnips.splice(0, turnips.length);
boxes.splice(0, boxes.length);
fruit.splice(0, fruit.length);
sandList.splice(0, sandList.length);
phantos.splice(0, phantos.length);
shel = attachMovie((("l" + level) + "-") + part, "tiles", k++);
shel._x = 0;
shel._y = 0;
loadChar();
}
function loadChar() {
tiles.player.removeMovieClip();
shel = tiles.attachMovie("player", "player", k++);
shel._x = tiles.startDoor._x;
shel._y = tiles.startDoor._y;
tiles[("character" + charNum) + "a"].removeMovieClip();
tiles[("character" + charNum) + "b"].removeMovieClip();
shel = tiles.attachMovie(("character" + charNum) + "a", ("character" + charNum) + "a", k++);
if (charNum == 1) {
shel._width = 100;
} else {
shel._width = 80;
}
shel._yscale = shel._xscale;
if (size == "b") {
shel2 = tiles.attachMovie(("character" + charNum) + size, ("character" + charNum) + size, k++);
shel2._xscale = shel._xscale;
shel2._yscale = shel._yscale;
shel.removeMovieClip();
}
tiles.player.xVel = 0;
tiles.player.xF = 0.7;
tiles.player.yVel = 0;
tiles.player.yLove = 0;
tiles.player.mMode = 5;
tiles.player.yMax = 40;
}
function addFruit(mov) {
fruitCounter++;
fruit.push(fruitCounter);
mov._name = "fruit" + fruitCounter;
mov.sprite.gotoAndStop((fruitCounter % 6) + 1);
totalFruit++;
}
function charStats() {
if (charNum == 0) {
pickUpSpeed = 20;
hops = -25;
madHops = -35;
grav = 1.2;
xS = 3.5;
xSx = 4;
xMax = 4;
yS = 2;
}
if (charNum == 1) {
pickUpSpeed = 10;
hops = -20;
madHops = -30;
grav = 1.2;
xS = 3.5;
xSx = 4;
xMax = 5;
yS = 2;
}
if (charNum == 2) {
pickUpSpeed = 30;
hops = -20;
madHops = -30;
grav = 1.2;
xS = 3.5;
xSx = 4;
xMax = 5;
yS = 2;
}
}
function levelTweenScreen() {
}
function musicalDoor(dds) {
trace("MUSIC!");
if (level == 1) {
if ((musicChoice != 1) && (dds == tiles.doorE1)) {
loadMain();
}
if (((musicChoice != 1) && (dds == tiles.endDoor)) && (part == 1)) {
loadMain();
}
if ((musicChoice != 1) && (dds == tiles.doorA2)) {
loadMain();
}
if ((musicChoice != 2) && (dds == tiles.doorA1)) {
loadCave();
}
if ((musicChoice != 2) && (dds == tiles.doorE2)) {
loadCave();
}
if (((musicChoice != 2) && (dds == tiles.startDoor)) && (part == 2)) {
loadCave();
}
}
if (level == 2) {
if ((musicChoice != 1) && (dds == tiles.doorA2)) {
loadMain();
}
if ((musicChoice != 1) && (dds == tiles.doorB2)) {
loadMain();
}
if ((musicChoice != 2) && (dds == tiles.doorA1)) {
loadCave();
}
if ((musicChoice != 2) && (dds == tiles.doorB1)) {
loadCave();
}
}
}
function loadCave() {
stopAllSounds();
caveSoundTrack.start(0, 500);
musicChoice = 2;
trace("LOADING CAVE MUSIC");
}
function loadMiniGame() {
stopAllSounds();
miniTrack.start(0, 500);
musicChoice = 8;
}
function loadMain() {
stopAllSounds();
mainSoundTrack.start(0, 500);
musicChoice = 1;
trace("LOADING MAIN MUSIC");
}
function loadTwilight() {
stopAllSounds();
twilightSoundTrack.start(0, 500);
musicChoice = 3;
}
function loadBoss() {
stopAllSounds();
bossSoundTrack.start(0, 500);
musicChoice = 4;
}
function loadGameOver() {
stopAllSounds();
gameOverTrack.start(0, 1);
musicChoice = 5;
}
function loadLosing() {
losingSoundTrack.start(0, 1);
musicChoice = 6;
}
function loadWinning() {
stopAllSounds();
winnerTrack.start(0, 1);
musicChoice = 7;
}
function executeLevel() {
cStatus = 1;
specCamera();
callDoorStart();
if (((musicChoice != 2) && (level == 1)) && (part == 0)) {
loadCave();
} else if (((musicChoice != 1) && (level == 1)) && (part == 1)) {
loadMain();
} else if (((musicChoice != 1) && (level == 1)) && (part == 2)) {
loadMain();
}
if (((musicChoice == 1) && (level == 1)) && (part == 1)) {
loadCave();
}
if (((musicChoice != 1) && (level == 2)) && (part == 0)) {
loadMain();
} else if (((musicChoice != 2) && (level == 2)) && (part == 1)) {
loadCave();
}
if (((musicChoice != 3) && (level == 3)) && (part == 0)) {
loadTwilight();
}
}
function garbageCollection() {
u = 0;
while (u < enemiesList.length) {
curMess = tiles["enemy" + enemiesList[u]];
if (curMess._y > (tiles.bb._y + 100)) {
enemiesList.splice(u, 1);
curMess.swapDepths(k++);
if (curMess.type == "enemy-miniBlob") {
blobsLeft--;
}
curMess.removeMovieClip();
break;
}
u++;
}
u = 0;
while (u < turnips.length) {
curMess = tiles["turnip" + turnips[u]];
if (curMess._y > (tiles.bb._y + 100)) {
turnips.splice(u, 1);
curMess.swapDepths(k++);
curMess.removeMovieClip();
break;
}
u++;
}
u = 0;
while (u < bombs.length) {
curMess = tiles["bomb" + bombs[u]];
if (curMess._y > (tiles.bb._y + 100)) {
bombs.splice(u, 1);
curMess.swapDepths(k++);
curMess.removeMovieClip();
break;
}
u++;
}
if ((blobsLeft <= 0) && (player.mMode != 20)) {
blobsLeft = 1000;
hud.roboStats._visible = false;
addOrb(tiles.player._x, tiles.player._y - 200);
}
}
function controlWorld(mov) {
partCounter++;
worldParts.push(partCounter);
mov._name = "part" + partCOunter;
}
function fruitControl() {
i = 0;
while (i < fruit.length) {
curFruit = tiles["fruit" + fruit[i]];
if (Math.abs(curFruit._x - tiles.player._x) < 100) {
if (curFruit.hitTest(tiles.player)) {
fruit.splice(i, 1);
j = 0;
while (j < 15) {
shel = tiles.attachMovie("fruit_myStar", "star" + k, k++);
shel.xVel = (random(16) - 8) + tiles.player.xVel;
shel.yVel = (-5 - random(10)) + tiles.player.yVel;
shel._x = curFruit._x;
shel._y = curFruit._y;
shel._xscale = 50 + random(350);
shel._yscale = shel._xscale;
shel._alpha = random(50);
j++;
}
if (size == "b") {
growing = true;
hurt = true;
shrinkCounter = 0;
}
fruitCollected++;
fruitSounder.start(0, 1);
hud.fruit.gotoAndPlay(1);
curFruit.swapDepths(k++);
curFruit.removeMovieClip();
}
}
i++;
}
}
function addKey(mov) {
keys.push(mov.letter);
mov.xVel = 0;
mov.yVel = 0;
mov.xMax = 20;
mov.yMax = 20;
mov.thrown = false;
mov.fallThrough = false;
mov.xF = 0.7;
mov.mMode = 1;
mov.yLove = 0;
mov.live = true;
}
function keyControl() {
i = 0;
while (i < keys.length) {
curKey = tiles["key" + keys[i]];
if (curKey.live) {
curKey.yVel = curKey.yVel + grav;
if (!curKey.fallThrough) {
bounding(curKey);
} else {
curKey._x = curKey._x + curKey.xVel;
curKey._y = curKey._y + curKey.yVel;
}
if (curKey.thrown) {
} else {
curKey.xVel = 0;
if (curKey.hitTest(tiles.player)) {
if (tiles.player._y < (curKey._y - (curKey._height / 4))) {
if ((tiles.player.mMode != 8) && (tiles.player.mMode != 4)) {
if (xMove < 0) {
if (checkCoords(mc, mc._x + xMove, mc._y, 3)) {
mc._x = mc._x + xMove;
} else {
mc._x = (mc.bl._x + tileSize) + (mc._width / 2);
}
}
if (xMove > 0) {
if (checkCoords(mc, mc._x + xMove, mc._y, 2)) {
mc._x = mc._x + xMove;
} else {
mc._x = mc.br._x - (mc._width / 2);
}
}
while (tiles.player.hitTest(curKey.helder)) {
tiles.player._y--;
}
if (playerJump == true) {
playerJump = false;
}
tiles.player.yVel = 0;
tiles.player.yLove = 0;
}
}
}
}
}
i++;
}
}
function executeLevelWin() {
tiles.player.mMode = 20;
shel = attachMovie("pizzaTransition", "pizza", k++);
shel._xscale = defaultCameraSize;
shel._yscale = defaultCameraSize;
shel._x = -(_root._x * (defaultCameraSize / 100));
shel._y = -(_root._y * (defaultCameraSize / 100));
trapWin = true;
}
function addOrb(xPos, yPos) {
if ((level == 3) && (blobsLeft != 1000)) {
shel = tiles.attachMovie("keyPickUP", "keyC", k++);
shel._x = xPos;
shel._y = yPos;
shel.xVel = 0;
shel.yVel = -20;
shel.yMax = 30;
shel.xMax = 30;
shel.fallThrough = false;
} else {
shel = tiles.attachMovie("ball", "orb", k++);
shel._x = xPos;
shel._y = yPos;
shel.xVel = 0;
shel.yVel = -20;
shel.yMax = 30;
shel.xMax = 30;
shel.type = "orb";
shel.fallThrough = false;
shel.xF = 0.7;
shel.bounceCount = 0;
shel.live = true;
shel.thrown = false;
}
}
function orbs() {
if (tiles.orb != undefined) {
curEnemy = tiles.orb;
if (curEnemy.live) {
enemyVertical(curEnemy);
if (!curEnemy.fallThrough) {
bounding(curEnemy);
} else {
curEnemy._x = curEnemy._x + curEnemy.xVel;
curEnemy._y = curEnemy._y + curEnemy.yVel;
}
if (curEnemy.thrown) {
} else if (curEnemy.hitTest(tiles.player)) {
moveMC(tiles.player, curEnemy.xVel, 0);
}
}
}
}
function backgroundHandler() {
bg._x = (-_root._x) - (_root._x / 5);
if (level == 3) {
bg1._x = (-_root._x) - (_root._x / 6);
bg2._x = (-_root._x) - (_root._x / 8);
}
ranger = tiles.bb._y - tiles.tb._y;
if (level == 1) {
bg._y = (-_root._y) - (_root._y / 5);
}
if (level == 2) {
bg._y = (-_root._y) - (_root._y / 3);
}
if (level == 3) {
bg._y = (-_root._y) - (_root._y / 10);
bg1._y = (-_root._y) - (_root._y / 11);
bg2._y = (-_root._y) - (_root._y / 12);
}
}
function inc() {
betaWarning.frameRate.text = "Framerate: " + aad;
nmbr = aad;
aad = 0;
}
function offScreen() {
if (tiles.player._y > tiles.bb._y) {
death();
}
}
function specCamera() {
if (_root.player.mMode != 8) {
var _local2 = sX / camFrame._width;
var _local3 = sY / camFrame._height;
_root._x = cX - (tiles.player._x * _local2);
_root._y = cY - (tiles.player._y * _local3);
_root._xscale = 100 * _local2;
_root._yscale = 100 * _local3;
}
camFrame._xscale = (camFrame._yscale = defaultCameraSize);
if ((((!Key.isDown(38)) && (!Key.isDown(39))) && (!Key.isDown(37))) && (!Key.isDown(aKey))) {
boringCounter++;
activeCounter = 0;
} else {
boringCounter = 0;
activeCounter++;
}
if (boringCounter > 70) {
}
}
function boundCamera() {
rbVal = (tiles.rb._x - camFrame._width) * (_root._xscale / 100);
if (_root._x < (-rbVal)) {
_root._x = -rbVal;
}
lbVal = tiles.lb._x * (_root._xscale / 100);
if (_root._x > (-lbVal)) {
_root._x = -lbVal;
}
bbVal = (tiles.bb._y - camFrame._height) * (_root._yscale / 100);
if (_root._y < (-bbVal)) {
_root._y = -bbVal;
}
tbVal = tiles.tb._y * (_root._yscale / 100);
if (_root._y > (-tbVal)) {
_root._y = -tbVal;
}
}
function addLog(mov) {
logCounter++;
mov.yVel = 0;
mov.step = 1;
mov.orgX = mov._x;
mov.orgY = mov._y;
mov._name = "log" + logCounter;
logs.push(logCounter);
}
function logControl() {
i = 0;
while (i < logs.length) {
curLog = tiles["log" + logs[i]];
if (curLog.step == 2) {
if (curLog.yVel < 12) {
curLog.yVel = curLog.yVel + 0.5;
}
curLog._y = curLog._y + curLog.yVel;
if (((tiles.player.mMode != 2) && (tiles.player.hitTest(curLog))) && (tiles.player.yLove == 0)) {
curEnemy._y = curEnemy._y + curEnemy.yVel;
tiles.player._y = curLog._y - ((curLog._height * 3) / 4);
} else {
curLog._y = curLog._y + curLog.yVel;
}
curLog.sprite._yscale = -(100 * curLog.dir);
if (curLog.hitTest(tiles.player)) {
if (!Key.isDown(38)) {
moveMC(tiles.player, curLog.xVel, curLog.yVel);
}
}
if (Math.abs(tiles.player._y - curLog._y) > 700) {
curLog._x = curLog.orgX;
curLog._y = curLog.orgY;
curLog.yVel = 0;
curLog.step = 1;
curLog.gotoAndStop(2);
}
}
i++;
}
}
function dropLog(wt) {
wt.step = 2;
wt.gotoAndStop(3);
}
function doors() {
if ((!doorReady) && (!Key.isDown(38))) {
doorReady = true;
}
foundNoDoor = true;
if (((((doorReady && (tiles.player.yLove == 0)) && (Key.isDown(38))) && (!Key.isDown(37))) && (!Key.isDown(39))) && (!Key.isDown(40))) {
if (tiles.player.hitTest(tiles.endDoor)) {
trace("OPENED ENDDOOR");
targetDoor = tiles.endDoor;
tiles.player.mMode = 5;
tiles.player._x = (tiles._x + targetDoor._x) - 4;
tiles.player._y = tiles._y + targetDoor._y;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
targetDoor.play();
olDoor = targetDoor;
foundNoDoor = false;
} else if (tiles.player.hitTest(tiles.startDoor)) {
trace("OPENED STARTDOOR");
if (part != 0) {
targetDoor = tiles.startDoor;
tiles.player.mMode = 5;
tiles.player._x = (tiles._x + targetDoor._x) - 20;
tiles.player._y = tiles._y + targetDoor._y;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
targetDoor.play();
olDoor = targetDoor;
foundNoDoor = false;
}
}
if (foundNoDoor) {
i = 0;
while (i < letters.length) {
targetLetter = letters[i];
j = 1;
while (j < 3) {
targetDoor = tiles[("door" + targetLetter) + j];
if (targetDoor.locked == false) {
if (tiles.player.hitTest(targetDoor)) {
if (Number(targetDoor._name.substr(5, 1)) == 1) {
tempDoor = tiles[("door" + targetDoor._name.substr(4, 1)) + "2"];
} else {
tempDoor = tiles[("door" + targetDoor._name.substr(4, 1)) + "1"];
}
if (tempDoor.locked) {
} else {
tiles.player.mMode = 5;
tiles.player._x = (tiles._x + targetDoor._x) - 20;
tiles.player._y = tiles._y + targetDoor._y;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
sniffLock = false;
targetDoor.play();
olDoor = targetDoor;
break;
}
}
} else if (((tiles.player.hitTest(targetDoor) && (holding)) && (item.type == "key")) && (item.letter == targetLetter)) {
tempStr = ("door" + targetLetter) + j;
tempX = targetDoor._x;
tempY = targetDoor._y;
targetDoor.swapDepths(k++);
targetDoor.removeMovieClip();
sniffLock = true;
targetDoor = tiles.attachMovie("door", tempStr, k++);
tiles.currentChar.swapDepths(k++);
targetDoor._x = tempX;
targetDoor._y = tempY;
targetDoor.gotoAndPlay(5);
targetDoor.onEnterFrame = function () {
this.play();
if (this._currentframe > 1) {
this.onEnterFrame = null;
}
};
tiles.player.mMode = 5;
j = 0;
while (j < 15) {
shel = tiles.attachMovie("fruit_myStar", "star" + k, k++);
shel.xVel = random(16) - 8;
shel.yVel = -5 - random(10);
shel._x = (targetDoor._x + (random(targetDoor._width) / 2)) - random(targetDoor._width);
shel._y = targetDoor._y - random(targetDoor._height);
shel._xscale = 150 + random(350);
shel._yscale = shel._xscale;
j++;
}
tiles.player._x = targetDoor._x - 20;
tiles.player._y = targetDoor._y;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
item.removeMovieClip();
holding = false;
olDoor = targetDoor;
break;
}
j++;
}
i++;
}
}
}
}
function holdDoorItem() {
if (holding) {
trace("==FOUND ITEM HOLDING, WILL RETREIEVE==");
trace(item);
saveDoorItem = item.type;
retrieve = true;
} else {
retrieve = false;
}
}
function getDoorItem() {
if (retrieve) {
holding = true;
pickUpReady = false;
trace(saveDoorItem);
switch (saveDoorItem) {
case "bomb" :
bombCounter++;
bombs.push(bombCounter);
item = tiles.attachMovie("bomb", "bomb" + bombCounter, k++);
item.thrown = false;
item.type = "bomb";
item.bounced = false;
item.gotoAndStop(2);
item.counter = 0;
item.bombPlant = true;
break;
case "turnip" :
turnipCounter++;
turnips.push(turnipCounter);
curPlant._visible = false;
item = tiles.attachMovie("turnip", "turnip" + turnipCounter, k++);
item.thrown = false;
item.type = "turnip";
item.bounced = false;
item._x = curPlant._x;
item._y = curPlant._y;
item.gotoAndStop(1);
sprites();
break;
case "enemy-red" :
item = tiles.attachMovie("enemy-red", "tempRed", k++);
item.thrown = false;
item.bounced = false;
item.orgX = player._x;
item.orgY = (player._y - item._height) + 25;
break;
case "enemy-turnip" :
item = tiles.attachMovie("enemy-turnip", "tempTurn", k++);
item.thrown = false;
item.bounced = false;
item.orgX = player._x;
item.orgY = (player._y - item._height) + 25;
break;
case "enemy-ladyBug" :
item = tiles.attachMovie("enemy-ladyBug", "tempTurn", k++);
item.thrown = false;
item.bounced = false;
item.orgX = player._x;
item.orgY = (player._y - item._height) + 25;
}
item.live = false;
item.xVel = 0;
item.yVel = 0;
item._x = player._x;
item._y = player._y;
item.miniTimer = 0;
item.onEnterFrame = function () {
this.live = false;
this.xVel = 0;
this.yVel = 0;
this.thrown = false;
this.bounced = false;
this.miniTimer++;
_root.sprites();
if (this.miniTimer > 5) {
this.onEnterFrame = null;
}
};
sprites();
}
}
function callDoor() {
olDoor.stop();
shel = highUp.attachMovie("doorClose", "doorClose", k++);
shel._x = tiles._x + olDoor._x;
shel._y = tiles._y + olDoor._y;
}
function callDoor2() {
if (olDoor == tiles.endDoor) {
trace("endDoor");
holdDoorItem();
tiles.removeMovieClip();
part++;
lastDoor = tiles.startDoor;
specCall = "startDoor";
levelDisp = "LEVEL " + level;
livesDisp = "LIVES x" + lives;
highUp.doorClose.removeMovieClip();
mainLoader();
executeLevel();
} else if (olDoor == tiles.startDoor) {
trace("startDoor");
holdDoorItem();
tiles.removeMovieClip();
part--;
lastDoor = tiles.endDoor;
specCall = "endDoor";
levelDisp = "LEVEL " + level;
livesDisp = "LIVES x" + lives;
highUp.doorClose.removeMovieClip();
mainLoader();
executeLevel();
} else {
retrieve = false;
specCall = "none";
if (Number(olDoor._name.substr(5, 1)) == 1) {
neDoor = tiles[("door" + olDoor._name.substr(4, 1)) + "2"];
} else {
neDoor = tiles[("door" + olDoor._name.substr(4, 1)) + "1"];
}
}
tiles.player._x = tiles._x + neDoor._x;
tiles.player._y = tiles._y + neDoor._y;
highUp.doorClose._x = tiles._x + neDoor._x;
highUp.doorClose._y = tiles._y + neDoor._y;
br = 0;
while (br < bombsList.length) {
if (!tiles["b" + bombsList[br]]._visible) {
tiles["b" + bombsList[br]]._visible = true;
}
br++;
}
br = 0;
while (br < sandList.length) {
if (!tiles[sandList[br]]._visible) {
tiles[sandList[br]]._visible = true;
tiles[sandList[br]].type = 5;
}
br++;
}
sandList.splice(0, sandList.length);
olDoor.gotoAndStop(1);
musicalDoor(olDoor);
neDoor.gotoAndStop(12);
}
function callDoorStart() {
trace("myLastDoor" + lastDoor);
if (specCall == "endDoor") {
neDoor = tiles.endDoor;
getDoorItem();
trace("specCall startDoor");
} else if (specCall == "startDoor") {
neDoor = tiles.startDoor;
trace("specCall endDoor");
getDoorItem();
} else if (lastDoor == undefined) {
neDoor = tiles.startDoor;
trace("lostdoor");
} else {
if (lastDoor.locked) {
trace("EWF");
if (Number(neDoor._name.substr(5, 1)) == 1) {
lastDoor = tiles[("door" + lastDoor._name.substr(4, 1)) + "2"];
} else {
lastDoor = tiles[("door" + lastDoor._name.substr(4, 1)) + "1"];
}
}
neDoor = lastDoor;
}
shel = highUp.attachMovie("doorClose", "doorClose", k++);
shel._x = tiles._x + neDoor._x;
shel._y = tiles._y + neDoor._y;
shel.gotoAndPlay(11);
tiles.player._x = tiles._x + neDoor._x;
tiles.player._y = tiles._y + neDoor._y;
tiles.player.mMode = 5;
neDoor.gotoAndStop(12);
}
function callDoor3() {
highUp.doorClose.removeMovieClip();
neDoor.nextFrame();
neDoor.play();
}
function callDoor4() {
tiles.player.mMode = 1;
lastDoor = neDoor;
neDoor.gotoAndStop(1);
doorReady = false;
}
function naming(mov) {
if (mov.type == 5) {
mov._x = Math.round(mov._x);
mov._y = Math.round(mov._y);
mov.posX = Math.floor(mov._x / _root.tileSize);
mov.posY = Math.floor(mov._y / _root.tileSize);
mov._name = (("tile" + mov.posX) + "x") + mov.posY;
} else {
mov._x = Math.round(mov._x);
mov._y = Math.round(mov._y);
mov.posX = Math.floor(mov._x / _root.tileSize);
mov.posY = Math.floor(mov._y / _root.tileSize);
mov._visible = false;
switch (mov.type) {
case 1 :
mov._name = (("tile" + mov.posX) + "x") + mov.posY;
break;
case 2 :
mov._name = (("tile" + mov.posX) + "x") + mov.posY;
break;
case 3 :
mov._name = (("ladder" + mov.posX) + "x") + mov.posY;
break;
case 4 :
mov._name = (("ladder" + mov.posX) + "x") + mov.posY;
break;
case 5 :
mov._name = (("tile" + mov.posX) + "x") + mov.posY;
mov._visible = true;
break;
case 6 :
mov._name = (("tile" + mov.posX) + "x") + mov.posY;
mov._visible = true;
}
if (mov.explodable) {
mov._visible = true;
}
if (mov.pickUpReady) {
mov._visible = true;
mov.xVel = 0;
mov.yVel = 0;
mov.thrown = false;
mov.xMax = (mov.yMax = 30);
mov.xF = 0.7;
mov.fallThrough = false;
}
}
}
function depths() {
i = 0;
while (i < enemiesList.length) {
tiles["enemy" + enemiesList[i]].swapDepths(k++);
i++;
}
i = 0;
while (i < plantsList.length) {
tiles["plant" + plantsList[i]].swapDepths(k++);
i++;
}
currentChar.swapDepths(k++);
item.swapDepths(k++);
lastItem.swapDepths(k++);
i = 0;
while (i < thrownItems.length) {
tiles["tr" + thrownItems[i]].swapDepths(k++);
i++;
}
bar.swapDepths(k++);
highUp.swapDepths(k++);
hud.swapDepths(k++);
}
function hudHandler() {
if (cStatus == 1) {
hud._visible = true;
} else {
hud._visible = false;
}
hud._xscale = defaultCameraSize;
hud._yscale = defaultCameraSize;
hud._x = -(_root._x * (defaultCameraSize / 100));
hud._y = -(_root._y * (defaultCameraSize / 100));
fruitCount = fruitCollected;
headCount = lives;
hud.heads.gotoAndStop(charNum + 1);
}
function pickingUp() {
pickCounter++;
easing("x", tiles.player, item.orgX, 0.3);
item._x = (item.orgX + 1) - random(2);
item._y = (item.orgY + 1) - random(2);
if (((item.type == "bomb") && (item.bombPlant == false)) || (item.type == "enemy-egg")) {
item.gotoAndStop(3);
} else {
item.gotoAndStop(2);
}
if (pickCounter == (pickUpSpeed - 1)) {
item._y = item._y - 30;
}
if (pickCounter == Math.floor(pickUpSpeed / 2)) {
pickUpSound.start(0, 1);
}
if (pickCounter >= pickUpSpeed) {
if (item.type == "bomb") {
item.caught = true;
}
if (item.type == "orb") {
executeLevelWin();
}
tiles.player.mMode = 1;
holding = true;
throwOkay = false;
if (item.type == "turnip") {
item.play();
}
item._y = tiles.player._height;
}
}
function pickingUpSand() {
pickCounter++;
if (pickCounter > 3) {
item._visible = false;
}
if (pickCounter == 5) {
pickUpSound.start(0, 1);
}
if (pickCounter >= 11) {
item.type = 10;
item._visible = false;
pickUpOkay = false;
sandList.push(item._name);
tiles.player.mMode = 1;
holding = false;
}
}
function moveThrowingItems() {
i = 0;
while (i < turnips.length) {
curTurnip = tiles["turnip" + turnips[i]];
if (curTurnip.thrown) {
curTurnip._x = curTurnip._x + curTurnip.xVel;
curTurnip._y = curTurnip._y + curTurnip.yVel;
curTurnip.yVel = curTurnip.yVel + grav;
}
i++;
}
i = 0;
while (i < bombs.length) {
curBomb = tiles["bomb" + bombs[i]];
if ((((((Math.abs(curBomb.xVel) > 0) && (tiles.player.mMode == 1)) && (curBomb.hitTest(tiles.player))) && (!holding)) && (curBomb.thrown)) && (!curBomb.caught)) {
if (curBomb._y < (tiles.player._y - ((tiles.player._height * 1) / 2))) {
holding = true;
throwOkay = false;
curBomb.xVel = 0;
curBomb.yVel = 0;
curBomb.caught = true;
curBomb.thrown = false;
curBomb.fallThrough = false;
item = curBomb;
} else {
damagePlayer(curBomb);
}
}
if (curBomb.thrown) {
curBomb.yVel = curBomb.yVel + grav;
bounding(curBomb);
}
curBomb.counter++;
curBomb._xscale = 100;
if (curBomb.counter > 75) {
curBomb.bombSprite.play();
}
if (curBomb.counter == 100) {
explodeBomb(curBomb, i);
} else if (curBomb.thrown) {
if (curBomb.live) {
curBomb.gotoAndStop(3);
curBomb.yVel = curBomb.yVel + grav;
if (!curBomb.fallThrough) {
} else {
curBomb._x = curBomb._x + curBomb.xVel;
curBomb._y = curBomb._y + curBomb.yVel;
}
}
}
i++;
}
}
function removeEnemy(ewf) {
u = 0;
while (u < enemiesList.length) {
if (tiles["enemy" + enemiesList[u]] == ewf) {
enemiesList.splice(u, 1);
ewf.removeMovieClip();
break;
}
u++;
}
}
function explodeBomb(targetBomb, splicePoint) {
shel = tiles.attachMovie("splode", "splode" + k, k++);
shel._x = targetBomb._x;
shel._xscale = 200;
shel._yscale = 200;
shel._y = targetBomb._y;
targetBomb._xscale = 300;
targetBomb._yscale = 300;
bombSounder.start(0, 1);
g = 0;
while (g < enemiesList.length) {
curTarget = tiles["enemy" + enemiesList[g]];
if (targetBomb.hitTest(curTarget)) {
if (curTarget == item) {
holding = false;
throwOkay = true;
curTarget._xscale = 200;
curTarget.xVel = 1;
curTarget.yVel = 1;
curTarget.live = true;
curTarget.yLove = 0;
trace("TETETE =" + curTarget);
} else {
trace("NONONO =" + curTarget);
}
if ((curTarget.type == "enemy-blob") && (!curTarget.ouchie)) {
curTarget.holdParentFrame = curTarget._currentframe;
curTarget.holdFrame = curTarget.boss._currentframe;
curTarget.ouchie = true;
curTarget.hits--;
hud.roboStats.gotoAndStop(6 - curTarget.hits);
if (curTarget.hits == 0) {
ty = 0;
while (ty < blobsLaunched) {
shel = tiles.attachMovie("miniBlob", "m" + k, k++);
shel._x = (curTarget._x - (curTarget._width / 2)) + random(Math.floor(curTarget._width));
shel._y = curTarget._y - random(Math.floor(curTarget._height));
shel.type = "enemy-miniBlob";
addEnemy(shel);
ty++;
}
removeEnemy(curTarget);
}
} else if (curTarget.type != "enemy-miniBlob") {
curTarget.bounceCount = 0;
curTarget.thrown = true;
curTarget.hitBirdo = true;
curTarget.xVel = curTarget.xVel / 2;
curTarget.yVel = -12;
curTarget.sprite._yscale = -100;
curTarget.sprite._y = -curTarget.sprite._height;
curTarget.fallThrough = true;
}
}
g++;
}
blastRadius = 3;
if (tiles.player.hitTest(targetBomb)) {
damagePlayer(tiles.player);
}
xTile = Math.round(targetBomb._x / tileSize);
yTile = Math.round(targetBomb._y / tileSize);
addSetTile(xTile, yTile, 0);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if ((mox.type == 1) && (mox.explodable)) {
mox.play();
mox.type = 10;
}
y = 0;
while (y < blastRadius) {
z = 0;
while (z < blastRadius) {
xTile = Math.round(targetBomb._x / tileSize) - (y - Math.floor(blastRadius / 2));
yTile = (Math.round(targetBomb._y / tileSize) - z) - 2;
addSetTile(xTile, yTile, 0);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if (((mox.type == 1) && (mox.explodable)) && (myTopLimt >= yTile)) {
mox.play();
mox.type = 10;
}
xTile = Math.round(targetBomb._x / tileSize) - (y - Math.floor(blastRadius / 2));
yTile = Math.round(targetBomb._y / tileSize) + z;
addSetTile(xTile, yTile, 1);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if ((mox.type == 1) && (mox.explodable)) {
mox.play();
mox.type = 10;
}
xTile = (Math.round(targetBomb._x / tileSize) + z) + 1;
yTile = (Math.round(targetBomb._y / tileSize) - (y - Math.floor(blastRadius / 2))) - 1;
addSetTile(xTile, yTile, 3);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if ((mox.type == 1) && (mox.explodable)) {
mox.play();
mox.type = 10;
}
xTile = (Math.round(targetBomb._x / tileSize) - z) - 1;
yTile = (Math.round(targetBomb._y / tileSize) - (y - Math.floor(blastRadius / 2))) - 1;
addSetTile(xTile, yTile, 2);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if ((mox.type == 1) && (mox.explodable)) {
mox.play();
mox.type = 10;
}
z++;
}
y++;
}
if (!mox.thrown) {
triggerHitting(targetBomb);
holding = false;
}
bombs.splice(splicePoint, 1);
targetBomb.removeMovieClip();
}
function addSetTile(xP, yP, ga) {
shel = attachMovie("setTileIn5", "s" + k, k++);
shel._x = xP * tileSize;
shel._y = yP * tileSize;
}
function pickUp() {
foundTarget = false;
if (((((!pickUpOkay) && (!holding)) && (!Key.isDown(aKey))) && (!Key.isDown(37))) && (!Key.isDown(39))) {
pickUpOkay = true;
}
if (Key.isDown(37) || (Key.isDown(39))) {
pickUpOkay = false;
}
if (((((pickUpOkay && (!holding)) && (Key.isDown(aKey))) && (!Key.isDown(37))) && (!Key.isDown(39))) && (((tiles.player.mMode == 1) || (tiles.player.mMode == 6)) || (tiles.player.mMode == 7))) {
if (pickUpChecks()) {
i = 0;
while (i < bombsList.length) {
curBomb = tiles["b" + bombsList[i]];
if ((curBomb._visible && (tiles.player.hitTest(curBomb))) && (tiles.player.yLove == 0)) {
curBomb._visible = false;
bombCounter++;
bombs.push(bombCounter);
item = tiles.attachMovie("bomb", "bomb" + bombCounter, k++);
item.thrown = false;
item.type = "bomb";
item.bounced = false;
item.orgX = curBomb._x;
item.orgY = curBomb._y;
item.gotoAndStop(2);
item.counter = 0;
item.bombPlant = true;
tiles.player.mMode = 4;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
item.yMax = 30;
item.xMax = 30;
item.xF = 0.7;
pickCounter = 0;
foundTarget = true;
break;
}
i++;
}
}
if (pickUpChecks()) {
xTile = Math.round(tiles.player._x / tileSize) - 1;
yTile = Math.round(tiles.player._y / tileSize);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if (tiles.player.yVel == 0) {
if ((mox.pickUpReady && (mox.type == 1)) && (mox.hitTest(tiles.player))) {
item = mox;
tiles.player._x = mox._x + (tileSize / 2);
tiles.player.mMode = 4;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
boxCounter++;
mox._name = "carryTile" + boxCounter;
pickCounter = 0;
} else {
xTile = Math.round(tiles.player._x / tileSize);
yTile = Math.round(tiles.player._y / tileSize);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if (mox.pickUpReady && (mox.type == 1)) {
item = mox;
tiles.player._x = mox._x;
tiles.player.mMode = 4;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
boxCounter++;
mox._name = "carryTile" + boxCounter;
pickCounter = 0;
}
}
}
}
if (pickUpChecks()) {
curThing = tiles.orb;
if (tiles.player.hitTest(curThing) && (tiles.player.yLove == 0)) {
item = curThing;
item.thrown = false;
item.type = "orb";
item.bounced = false;
item.orgX = curThing._x;
item.orgY = curThing._y;
tiles.player.mMode = 4;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
item.yMax = 30;
item.xMax = 30;
item.xF = 0.7;
pickCounter = 0;
foundTarget = true;
}
}
if (pickUpChecks()) {
i = 0;
while (i < bombs.length) {
curBomb = tiles["bomb" + bombs[i]];
if (tiles.player.hitTest(curBomb) && (tiles.player.yLove == 0)) {
item = curBomb;
item.thrown = false;
item.type = "bomb";
item.bounced = false;
item.bombPlant = false;
item.orgX = curBomb._x;
item.orgY = curBomb._y;
tiles.player.mMode = 4;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
item.yMax = 30;
item.xMax = 30;
item.xF = 0.7;
pickCounter = 0;
foundTarget = true;
break;
}
i++;
}
}
if (pickUpChecks()) {
i = 0;
while (i < plantsList.length) {
curPlant = tiles["plant" + plantsList[i]];
if ((curPlant._visible && (tiles.player.hitTest(curPlant))) && (tiles.player.yLove == 0)) {
turnipCounter++;
turnips.push(turnipCounter);
curPlant._visible = false;
item = tiles.attachMovie("turnip", "turnip" + turnipCounter, k++);
item.thrown = false;
item.type = "turnip";
item.bounced = false;
item.orgX = curPlant._x;
item.orgY = curPlant._y;
item._x = curPlant._x;
item._y = curPlant._y;
item.gotoAndStop(2);
tiles.player.mMode = 4;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
pickCounter = 0;
foundTarget = true;
break;
}
i++;
}
}
if (pickUpChecks()) {
i = 0;
while (i < enemiesList.length) {
curEnemy = tiles["enemy" + enemiesList[i]];
if ((((curEnemy.type != "enemy-birdo") && (tiles.player._y < (curEnemy._y - (curEnemy._height / 2)))) && (curEnemy == tiles.player.enemyTarget)) && (tiles.player.yLove == 0)) {
tiles.player.enemyTarget = null;
curEnemy.live = false;
item = curEnemy;
item.thrown = false;
item.bounced = false;
item.orgX = curEnemy._x;
item.orgY = (curEnemy._y - curEnemy._height) + 25;
if (item.type == "enemy-egg") {
item.gotoAndStop(3);
}
tiles.player.mMode = 4;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
pickCounter = 0;
foundTarget = true;
break;
}
i++;
}
}
if (pickUpChecks()) {
i = 0;
while (i < keys.length) {
curKey = tiles["key" + keys[i]];
if (curKey.hitTest(tiles.player)) {
tiles.player.enemyTarget = null;
curKey.live = false;
item = curKey;
item.thrown = false;
item.bounced = false;
item.orgX = curKey._x;
item.orgY = (curKey._y - curKey._height) + 25;
tiles.player.mMode = 4;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
pickCounter = 0;
foundTarget = true;
break;
}
i++;
}
}
if (pickUpChecks()) {
xTile = Math.round(tiles.player._x / tileSize) - 1;
yTile = Math.round(tiles.player._y / tileSize);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if (tiles.player.yVel == 0) {
if ((mox.type == 5) && (mox.hitTest(tiles.player))) {
item = mox;
tiles.player._x = mox._x + (tileSize / 2);
tiles.player.mMode = 4.1;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
pickCounter = 0;
} else {
xTile = Math.round(tiles.player._x / tileSize);
yTile = Math.round(tiles.player._y / tileSize);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if (mox.type == 5) {
item = mox;
tiles.player._x = mox._x;
tiles.player.mMode = 4.1;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
pickCounter = 0;
}
}
}
}
if (pickUpChecks()) {
xTile = Math.round(tiles.player._x / tileSize) - 1;
yTile = Math.round(tiles.player._y / tileSize);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if (tiles.player.yVel == 0) {
if ((mox.type == 5) && (mox.hitTest(tiles.player))) {
item = mox;
tiles.player._x = mox._x + (tileSize / 2);
tiles.player.mMode = 4.1;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
pickCounter = 0;
} else {
xTile = Math.round(tiles.player._x / tileSize);
yTile = Math.round(tiles.player._y / tileSize);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if (mox.type == 5) {
item = mox;
tiles.player._x = mox._x;
tiles.player.mMode = 4.1;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
pickCounter = 0;
}
}
}
}
}
}
function addSingleBomb(setX, setY, setXVel, setYVel) {
bombCounter++;
bombs.push(bombCounter);
ploop = tiles.attachMovie("bombBig", "bomb" + bombCounter, k++);
ploop.thrown = true;
ploop.live = true;
ploop.type = "bomb";
ploop.bounced = false;
ploop.orgX = setX;
ploop.orgY = setY;
ploop._x = setX;
ploop._y = setY;
ploop.fallThrough = true;
ploop.gotoAndStop(3);
ploop.counter = 0;
ploop.xVel = setXVel;
ploop.yVel = setYVel;
ploop.yMax = 30;
ploop.xMax = 30;
ploop.xF = 0.7;
}
function pickUpChecks() {
if ((!holding) && (!foundTarget)) {
return(true);
}
}
function enemies() {
i = 0;
while (i < phantos.length) {
curPhanto = tiles[phantos[i]];
if (holding && (tiles["key" + curPhanto.keyType] == item)) {
curPhanto._alpha = curPhanto._alpha + 10;
if (curPhanto._alpha >= 100) {
curPhanto._alpha = 100;
easing("x", curPhanto, tiles.player._x, 0.05);
easing("y", curPhanto, tiles.player._y, 0.05);
if (curPhanto.hitTest(tiles.player)) {
triggerHitting(curPhanto);
}
}
} else {
curPhanto._alpha = curPhanto._alpha - 10;
if (curPhanto._alpha <= 0) {
curPhanto._alpha = 0;
}
}
i++;
}
tiles.player.enemyTarget = null;
i = 0;
while (i < enemiesList.length) {
curEnemy = tiles["enemy" + enemiesList[i]];
j = 0;
while (j < turnips.length) {
curTurnip = tiles["turnip" + turnips[j]];
if ((curEnemy.hitTest(curTurnip) && (curEnemy.fallThrough == false)) && (curTurnip.thrown)) {
curTurnip.xVel = curTurnip.xVel / 2;
curTurnip.yVel = -12;
curEnemy.xVel = curTurnip.xVel / 2;
curEnemy.yVel = -10;
curEnemy.sprite._yscale = -100;
curEnemy.sprite._y = -curEnemy.sprite._height;
curEnemy.fallThrough = true;
curEnemy.thrown = true;
collisionNoise.start(0, 1);
}
j++;
}
j = 0;
while (j < enemiesList.length) {
curEnemy2 = tiles["enemy" + enemiesList[j]];
if ((((((i != j) && (curEnemy2.type != "enemy-egg")) && (curEnemy.thrown)) && (!curEnemy2.thrown)) && (curEnemy.hitTest(curEnemy2))) && (!(curEnemy.fallThrough && (curEnemy2.fallThrough)))) {
if ((curEnemy.type == "enemy-miniBlob") && (!curEnemy.hitBirdo)) {
curEnemy.thrown = true;
curEnemy2.thrown = true;
shel = highUp.attachMovie("miniblob_splat", "bb" + k, k++);
shel._x = curEnemy._x;
shel._y = curEnemy._y;
shel._xscale = -100;
shel = highUp.attachMovie("miniblob_splat", "bb" + k, k++);
shel._x = curEnemy2._x;
shel._y = curEnemy2._y;
curEnemy.removeMovieClip();
curEnemy2.removeMovieClip();
collisionNoise.start(0, 1);
blobsLeft = blobsLeft - 2;
break;
}
if ((((!curEnemy.hitBirdo) && (((curEnemy.type == "enemy-egg") || (curEnemy.type == "enemy-turnip")) || (curEnemy.type == "enemy-red"))) && (curEnemy2.type == "enemy-birdo")) && (curEnemy2.hurt == false)) {
curEnemy2.gotoAndStop(5);
curEnemy2.step = 5;
curEnemy2.xVel = 0;
curEnemy2.hits--;
curEnemy2.hurt = true;
curEnemy2.counter = 0;
curEnemy.hitBirdo = true;
collisionNoise.start(0, 1);
curEnemy.thrown = true;
curEnemy.xVel = curEnemy.xVel / 2;
curEnemy.yVel = -12;
curEnemy.fallThrough = true;
if (curEnemy2.hits <= 0) {
curEnemy2.gotoAndStop(6);
curEnemy2.fallThrough = true;
curEnemy2.xVel = curEnemy2.xVel / 2;
curEnemy2.yVel = -10;
curEnemy2.thrown = true;
addOrb(curEnemy2._x, curEnemy2._y);
}
} else if ((((curEnemy2.type != "enemy-birdo") && (curEnemy.type != "enemy-birdo")) && (curEnemy2.type != "enemy-miniBlob")) && (curEnemy.type != "enemy-miniBlob")) {
curEnemy.thrown = true;
curEnemy2.thrown = true;
collisionNoise.start(0, 1);
curEnemy.hitBirdo = true;
curEnemy2.hitBirdo = true;
curEnemy.xVel = curEnemy.xVel / 2;
curEnemy.yVel = -12;
curEnemy2.xVel = curEnemy.xVel / 2;
curEnemy2.yVel = -10;
curEnemy2.sprite._yscale = -100;
curEnemy2.sprite._y = -curEnemy2.sprite._height;
curEnemy.fallThrough = true;
curEnemy2.fallThrough = true;
}
}
j++;
}
if (curEnemy.type == "enemy-red") {
if (curEnemy.live) {
enemyVertical(curEnemy);
if (!curEnemy.fallThrough) {
bounding(curEnemy);
} else {
curEnemy._x = curEnemy._x + curEnemy.xVel;
curEnemy._y = curEnemy._y + curEnemy.yVel;
}
if (curEnemy.xVel == 0) {
curEnemy.dir = curEnemy.dir * -1;
}
if (curEnemy.thrown) {
} else {
curEnemy.xVel = curEnemy.speed * curEnemy.dir;
curEnemy._xscale = 100 * curEnemy.dir;
if (curEnemy.hitTest(tiles.player)) {
triggerHitting(curEnemy);
moveMC(tiles.player, curEnemy.xVel, 0);
}
}
}
}
if (curEnemy.type == "enemy-ladyBug") {
if (curEnemy.live) {
if (!curEnemy.fallThrough) {
} else {
enemyVertical(curEnemy);
curEnemy._x = curEnemy._x + curEnemy.xVel;
curEnemy._y = curEnemy._y + curEnemy.yVel;
}
if (curEnemy.thrown) {
} else {
if ((((tiles.player.mMode != 2) && (curEnemy.dir == 1)) && (tiles.player.hitTest(curEnemy))) && (tiles.player.yLove == 0)) {
curEnemy._y = curEnemy._y + curEnemy.yVel;
tiles.player._y = curEnemy._y - ((curEnemy._height * 3) / 4);
} else {
curEnemy._y = curEnemy._y + curEnemy.yVel;
}
xTile = Math.round(curEnemy._x / tileSize);
yTile = Math.round(curEnemy._y / tileSize);
mox = tiles[(("ladder" + xTile) + "x") + yTile];
if (mox.type != 3) {
curEnemy.dir = curEnemy.dir * -1;
}
if (curEnemy.dir == 1) {
curEnemy.yVel = 2;
} else {
curEnemy.yVel = -2;
}
if (Math.abs(curEnemy._x - tiles.player._x) < 200) {
curEnemy.yVel = curEnemy.yVel * 2;
}
if (curEnemy.dir > 0) {
curEnemy.sprite._yscale = -100;
curEnemy.sprite._y = -curEnemy.sprite._height;
} else {
curEnemy.sprite._yscale = 100;
curEnemy.sprite._y = 0;
}
curEnemy.xVel = 0;
if (curEnemy.hitTest(tiles.player)) {
resetSuperJump();
triggerHitting(curEnemy);
if (!Key.isDown(38)) {
moveMC(tiles.player, curEnemy.xVel, curEnemy.yVel);
}
}
}
}
}
if (curEnemy.type == "enemy-turnip") {
if (curEnemy.live) {
enemyVertical(curEnemy);
if (!curEnemy.fallThrough) {
bounding(curEnemy);
} else {
curEnemy._x = curEnemy._x + curEnemy.xVel;
curEnemy._y = curEnemy._y + curEnemy.yVel;
}
if (curEnemy.xVel == 0) {
}
if (curEnemy._x > tiles.player._x) {
curEnemy._xscale = 100;
} else {
curEnemy._xscale = -100;
}
if (curEnemy.thrown) {
} else {
if (curEnemy._x < tiles.player._x) {
curEnemy.xVel++;
} else {
curEnemy.xVel--;
}
if (curEnemy.xVel > 20) {
curEnemy.xVel = 20;
}
if (curEnemy.xVel < -20) {
curEnemy.xVel = -20;
}
if (curEnemy.hitGround == false) {
curEnemy.xVel = 0;
}
if (curEnemy.hitTest(tiles.player)) {
triggerHitting(curEnemy);
moveMC(tiles.player, curEnemy.xVel, 0);
}
}
}
}
if (curEnemy.type == "enemy-sparky") {
if (curEnemy.live) {
if (!curEnemy.fallThrough) {
} else {
curEnemy._x = curEnemy._x + curEnemy.xVel;
curEnemy._y = curEnemy._y + curEnemy.yVel;
}
if (curEnemy.thrown) {
curEnemy._x = curEnemy._x + curEnemy.xVel;
curEnemy._y = curEnemy._y + curEnemy.yVel;
curEnemy.yVel = curEnemy.yVel + grav;
curEnemy.sprite._xscale = -100;
curEnemy.sprite._yscale = -100;
curEnemy.sprite._x = curEnemy.sprite._width;
curEnemy.sprite._y = curEnemy.sprite._height;
} else {
sparkSpeed = 5;
moveSparky(curEnemy);
if (curEnemy.hitTest(tiles.player)) {
triggerHitting(curEnemy);
}
}
}
}
if (curEnemy.type == "enemy-egg") {
if (curEnemy.live) {
if (!curEnemy.fallThrough) {
curEnemy._x = curEnemy._x + curEnemy.xVel;
bounding(curEnemy);
} else {
curEnemy._x = curEnemy._x + curEnemy.xVel;
curEnemy._y = curEnemy._y + curEnemy.yVel;
}
if (curEnemy.thrown) {
enemyVertical(curEnemy);
curEnemy.fallThrough = true;
} else if (curEnemy.hitTest(tiles.player)) {
triggerHitting(curEnemy);
moveMC(tiles.player, curEnemy.xVel, 0);
}
}
}
if (curEnemy.type == "enemy-miniBlob") {
if (curEnemy.live) {
enemyVertical(curEnemy);
if (!curEnemy.fallThrough) {
bounding(curEnemy);
} else {
curEnemy._x = curEnemy._x + curEnemy.xVel;
curEnemy._y = curEnemy._y + curEnemy.yVel;
}
if (curEnemy.thrown) {
} else {
if (curEnemy.counter >= 0) {
if (curEnemy._x < tiles.player._x) {
curEnemy.xVel = curEnemy.speedSet;
} else {
curEnemy.xVel = -curEnemy.speedSet;
}
}
curEnemy.counter++;
if (curEnemy.counter >= curEnemy.counterGoal) {
switch (random(2)) {
case 0 :
curEnemy.yVel = curEnemy.yVel - random(15);
curEnemy.counter = 0;
break;
case 1 :
curEnemy.yVel = 0;
curEnemy.counter = -40;
}
}
if (curEnemy.hitTest(tiles.player)) {
triggerHitting(curEnemy);
moveMC(tiles.player, curEnemy.xVel, 0);
}
}
}
}
if (curEnemy.type == "enemy-birdo") {
if (curEnemy.live) {
if ((!curEnemy.activated) && (dist(tiles.player._x, tiles.player._y, curEnemy._x, curEnemy._y) < 700)) {
curEnemy.activated = true;
loadBoss();
}
if (curEnemy.activated) {
enemyVertical(curEnemy);
if (!curEnemy.fallThrough) {
bounding(curEnemy);
} else {
curEnemy._x = curEnemy._x + curEnemy.xVel;
curEnemy._y = curEnemy._y + curEnemy.yVel;
}
if (curEnemy.thrown) {
} else {
if (curEnemy._x > tiles.player._x) {
curEnemy._xscale = 100;
} else {
curEnemy._xscale = -100;
}
if (curEnemy.hurt) {
curEnemy.gotoAndStop(5);
var _local1 = new flash.geom.Transform(curEnemy);
if ((curEnemy.birdoLoad._currentframe % 2) == 0) {
_local1.colorTransform = colorTrans2;
} else {
_local1.colorTransform = colorTrans;
}
} else {
if (curEnemy.step != 4) {
if (curEnemy.eggCounter == curEnemy.eggGoal) {
curEnemy.eggCounter = 0;
curEnemy.eggGoal = getEggGoal();
saveBirdo(curEnemy);
curEnemy.step = 4;
} else {
curEnemy.counter++;
curEnemy.eggCounter++;
}
}
if (curEnemy.step == 1) {
curEnemy.xVel = 0;
curEnemy.gotoAndStop(2);
if (curEnemy.counter == 30) {
curEnemy.step = 3;
if (curEnemy._x <= curEnemy.limitLeft) {
curEnemy.xVel = 5;
} else {
curEnemy.xVel = -5;
}
}
} else if (curEnemy.step == 3) {
curEnemy.counter = 0;
curEnemy.gotoAndStop(3);
if ((curEnemy.xVel < 0) && (curEnemy._x <= curEnemy.limitLeft)) {
curEnemy.step = 1;
} else if ((curEnemy.xVel >= 0) && (curEnemy._x >= curEnemy.limitRight)) {
curEnemy.step = 1;
}
} else if (curEnemy.step == 4) {
curEnemy.xVel = 0;
curEnemy.gotoAndStop(4);
}
if (curEnemy.hitTest(tiles.player)) {
triggerHitting(curEnemy);
moveMC(tiles.player, curEnemy.xVel, 0);
}
}
}
}
}
}
if (curEnemy.type == "enemy-blob") {
if ((curEnemy.activated == false) && (dist(tiles.player._x, tiles.player._y, curEnemy._x, curEnemy._y) < 400)) {
curEnemy.activated = true;
blobsLeft = blobsLaunched;
loadBoss();
hud.roboStats._visible = true;
}
if (curEnemy.activated) {
if (curEnemy.live) {
enemyVertical(curEnemy);
bounding(curEnemy);
if (curEnemy.hitTest(tiles.player)) {
triggerHitting(curEnemy);
}
if (curEnemy.ouchie) {
curEnemy.gotoAndStop(11);
if ((curEnemy.counter % 2) == 0) {
}
} else {
if (Key.isDown(16)) {
}
if (curEnemy._x > tiles.player._x) {
curEnemy._xscale = 100;
} else {
curEnemy._xscale = -100;
}
curEnemy.counter++;
switch (curEnemy.patternStep) {
case 1 :
curEnemy.step = 1;
break;
case 2 :
curEnemy.step = 2;
break;
case 3 :
curEnemy.step = 3;
break;
case 4 :
curEnemy.step = 2;
break;
case 5 :
curEnemy.step = 3;
break;
case 6 :
curEnemy.step = 4;
break;
case 7 :
curEnemy.step = 3;
}
if (curEnemy.step == 1) {
curEnemy.xVel = 0;
curEnemy.gotoAndStop(2);
if (curEnemy.counter == 40) {
nextPatternStep(curEnemy);
}
}
if (curEnemy.step == 2) {
curEnemy.gotoAndStop(3);
if (curEnemy.patternStep == 2) {
curEnemy.xVel = -5;
if (curEnemy._x < curEnemy.limitLeft) {
nextPatternStep(curEnemy);
}
} else if (curEnemy.patternStep == 4) {
curEnemy.xVel = 5;
if (curEnemy._x >= curEnemy.startPoint) {
nextPatternStep(curEnemy);
}
}
}
if (curEnemy.step == 3) {
curEnemy.xVel = 0;
if (!curEnemy.firing) {
curEnemy.firing = true;
if (curEnemy.patternStep == 3) {
curEnemy.gotoAndStop(4 + random(2));
} else {
curEnemy.gotoAndStop(4 + random(3));
}
}
}
if (curEnemy.step == 4) {
curEnemy.xVel = 0;
if (curEnemy.patternStep == 6) {
if (curEnemy.hoverStep == 0) {
curEnemy.gotoAndStop(7);
if (curEnemy.counter >= 10) {
curEnemy.hoverStep = 1;
}
} else if (curEnemy.hoverStep == 1) {
curEnemy.gotoAndStop(8);
curEnemy.yVel = curEnemy.yVel - 2;
if ((curEnemy.startHeight - curEnemy._y) > 300) {
curEnemy.hoverStep = 2;
}
} else if (curEnemy.hoverStep == 2) {
if (curEnemy.yVel < 0) {
curEnemy.yVel = curEnemy.yVel + 2;
} else {
curEnemy.yVel = -grav;
curEnemy.hoverStep = 3;
curEnemy.counter = 0;
}
} else if (curEnemy.hoverStep == 3) {
curEnemy.yVel = -grav;
easing("x", curEnemy, tiles.player._x, 0.2);
if (curEnemy.counter > 60) {
curEnemy.hoverStep = 4;
}
} else if (curEnemy.hoverStep == 4) {
curEnemy.gotoAndStop(9);
if (curEnemy._y >= curEnemy.startHeight) {
curEnemy._y = curEnemy.startHeight;
curEnemy.counter = 0;
curEnemy.hoverStep = 5;
}
} else if (curEnemy.hoverStep == 5) {
curEnemy.gotoAndStop(10);
if (curEnemy.counter == 20) {
curEnemy.hoverStep = 6;
curEnemy.counter = 0;
}
} else if (curEnemy.hoverStep == 6) {
curEnemy.gotoAndStop(7);
if (curEnemy.counter >= 10) {
curEnemy.hoverStep = 7;
curEnemy.counter = 0;
}
} else if (curEnemy.hoverStep == 7) {
curEnemy.gotoAndStop(8);
curEnemy.yVel = curEnemy.yVel - 2;
if ((curEnemy.startHeight - curEnemy._y) > 300) {
curEnemy.hoverStep = 8;
}
} else if (curEnemy.hoverStep == 8) {
if (curEnemy.yVel < 0) {
curEnemy.yVel = curEnemy.yVel + 2;
} else {
curEnemy.yVel = -grav;
curEnemy.hoverStep = 9;
curEnemy.counter = 0;
}
} else if (curEnemy.hoverStep == 9) {
curEnemy.yVel = -grav;
easing("x", curEnemy, curEnemy.startPoint, 0.2);
if (Math.abs(curEnemy._x - curEnemy.startPoint) < 20) {
curEnemy.hoverStep = 10;
}
} else if (curEnemy.hoverStep == 10) {
curEnemy.gotoAndStop(9);
if (curEnemy._y >= curEnemy.startHeight) {
curEnemy._y = curEnemy.startHeight;
curEnemy.counter = 0;
curEnemy.hoverStep = 11;
}
} else if (curEnemy.hoverStep == 11) {
curEnemy.gotoAndStop(10);
if (curEnemy.counter == 20) {
curEnemy.hoverStep = 0;
curEnemy.counter = 0;
nextPatternStep(curEnemy);
}
}
}
}
}
}
}
}
i++;
}
}
function revertBlob(stre) {
var _local2 = new flash.geom.Transform(stre);
_local2.colorTransform = colorTrans;
stre.ouchie = false;
stre.gotoAndStop(stre.holdParentFrame);
stre.boss.gotoAndPlay(stre.holdFrame);
}
function blobFire(stre, stre2, amount) {
we = 1;
while (we <= amount) {
tempMov = stre2["bD" + we];
if (stre._xscale > 0) {
tempX = (stre._x + stre2._x) + tempMov._x;
tempY = (stre._y + stre2._y) + tempMov._y;
tempXVel = 20 * Math.cos(degToRad(tempMov._rotation));
tempYVel = 20 * Math.sin(degToRad(tempMov._rotation));
} else {
tempX = (stre._x + stre2._x) + tempMov._x;
tempY = (stre._y + stre2._y) + tempMov._y;
if (amount > 1) {
tempX = (stre._x + stre2._x) - tempMov._x;
tempY = (stre._y + stre2._y) + tempMov._y;
}
tempXVel = -(20 * Math.cos(degToRad(tempMov._rotation)));
tempYVel = 20 * Math.sin(degToRad(tempMov._rotation));
}
addSingleBomb(tempX, tempY, tempXVel, tempYVel);
we++;
}
}
function degToRad(num) {
return(num * (Math.PI/180));
}
function endBlobFire(stres) {
stres.firing = false;
nextPatternStep(stres);
}
function nextPatternStep(stre) {
stre.patternStep++;
stre.hoverStep = 0;
stre.counter = 0;
if (stre.patternStep == 8) {
stre.patternStep = 1;
}
}
function getEggGoal() {
return(random(40) + 70);
}
function saveBirdo(spec) {
spec.oldXVel = spec.xVel;
spec.oldStep = spec.step;
spec.birdoPos = spec._currentframe;
spec.birdoPos2 = spec.birdoLoad._currentframe;
}
function birdoBackToSenses(stre) {
var _local1 = new flash.geom.Transform(stre);
_local1.colorTransform = colorTrans;
stre.hurt = false;
revertBirdo(stre);
}
function revertBirdo(spec) {
spec.xVel = spec.oldXVel;
spec.step = spec.oldStep;
spec.gotoAndStop(spec.birdoPos);
spec.birdoLoad.gotoAndPlay(spec.birdoPos2);
}
function birdoReload(spec, spec2) {
if (((level == 3) && (spec.hits <= 3)) && (spec.rapidFire != 0)) {
spec2.gotoAndPlay(1);
spec.rapidFire--;
} else {
spec.rapidFire = 2;
}
}
function birdoEgg(spec, spec2) {
if ((level == 3) || (level == 2)) {
switch (random(3)) {
case 0 :
shel = tiles.attachMovie("egg", "tempEgg", k++);
if (spec._xscale > 0) {
shel.tempX = -eggVel;
} else {
shel.tempX = eggVel;
}
break;
case 1 :
shel = tiles.attachMovie("enemy-red", "tempRed", k++);
shel.fromEgg = true;
shel.fromEggVel = eggVel;
break;
case 2 :
shel = tiles.attachMovie("enemy-turnip", "tempTurn", k++);
shel.fromEgg = true;
shel.fromEggVel = eggVel;
}
} else {
shel = tiles.attachMovie("egg", "tempEgg", k++);
if (spec._xscale > 0) {
shel.tempX = -eggVel;
} else {
shel.tempX = eggVel;
}
}
shel._xscale = spec._xscale;
if (spec._xscale > 0) {
shel._x = spec._x - 60;
} else {
shel._x = spec._x + 60;
}
shel._y = spec._y - 60;
}
function checkBottom(spec) {
xTile = Math.round(spec._x / tileSize);
yTile = Math.round(spec._y / tileSize) + 1;
mox = tiles[(("tile" + xTile) + "x") + yTile];
if ((mox.type == 1) || (mox.type == 2)) {
spec.lastWall = 1;
return(true);
}
return(false);
}
function checkTop(spec) {
xTile = Math.round(spec._x / tileSize);
yTile = Math.round(spec._y / tileSize) - 1;
mox = tiles[(("tile" + xTile) + "x") + yTile];
if ((mox.type == 1) || (mox.type == 2)) {
spec.lastWall = 0;
return(true);
}
return(false);
}
function checkLeft(spec) {
xTile = Math.round(spec._x / tileSize) - 1;
yTile = Math.round(spec._y / tileSize);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if ((mox.type == 1) || (mox.type == 2)) {
spec.lastWall = 3;
return(true);
}
return(false);
}
function checkRight(spec) {
xTile = Math.round(spec._x / tileSize) + 1;
yTile = Math.round(spec._y / tileSize);
mox = tiles[(("tile" + xTile) + "x") + yTile];
if ((mox.type == 1) || (mox.type == 2)) {
spec.lastWall = 2;
return(true);
}
return(false);
}
function moveSparky(mc) {
sparkSpeed = 10;
if (mc.dir == 3) {
if (((((!checkTop(mc)) && (!checkBottom(mc))) && (!checkLeft(mc))) && (!checkRight(mc))) && (!mc.lost)) {
if (mc.lastWall == 1) {
mc.dir = 1;
}
if (mc.lastWall == 0) {
mc.dir = 0;
}
mc.lost = true;
} else if (checkLeft(mc)) {
if (checkBottom(mc) && (!checkTop(mc))) {
mc.dir = 0;
} else if ((!checkBottom(mc)) && (checkTop(mc))) {
mc.dir = 1;
} else {
mc.dir = mc.lastWall;
}
} else {
mc._x = mc._x - sparkSpeed;
}
}
if (mc.dir == 2) {
if (((((!checkTop(mc)) && (!checkBottom(mc))) && (!checkLeft(mc))) && (!checkRight(mc))) && (!mc.lost)) {
if (mc.lastWall == 1) {
mc.dir = 1;
}
if (mc.lastWall == 0) {
mc.dir = 0;
}
mc.lost = true;
} else if (checkRight(mc)) {
if (checkBottom(mc) && (!checkTop(mc))) {
mc.dir = 0;
} else if ((!checkBottom(mc)) && (checkTop(mc))) {
mc.dir = 1;
} else {
mc.dir = mc.lastWall;
}
} else {
mc._x = mc._x + sparkSpeed;
}
}
if (mc.dir == 0) {
if (((((!checkTop(mc)) && (!checkBottom(mc))) && (!checkLeft(mc))) && (!checkRight(mc))) && (!mc.lost)) {
if (mc.lastWall == 2) {
mc.dir = 2;
}
if (mc.lastWall == 3) {
mc.dir = 3;
}
mc.lost = true;
} else if (checkTop(mc)) {
if (checkLeft(mc) && (!checkRight(mc))) {
mc.dir = 2;
} else if ((!checkLeft(mc)) && (checkRight(mc))) {
mc.dir = 3;
} else {
mc.dir = mc.lastWall;
}
} else {
mc._y = mc._y - sparkSpeed;
}
}
if (mc.dir == 1) {
if (((((!checkTop(mc)) && (!checkBottom(mc))) && (!checkLeft(mc))) && (!checkRight(mc))) && (!mc.lost)) {
if (mc.lastWall == 2) {
mc.dir = 2;
}
if (mc.lastWall == 3) {
mc.dir = 3;
}
mc.lost = true;
} else if (checkBottom(mc)) {
if (checkLeft(mc) && (!checkRight(mc))) {
mc.dir = 2;
} else if ((!checkLeft(mc)) && (checkRight(mc))) {
mc.dir = 3;
} else {
mc.dir = mc.lastWall;
}
} else {
mc._y = mc._y + sparkSpeed;
}
}
if (((checkTop(mc) || (checkBottom(mc))) || (checkLeft(mc))) || (checkRight(mc))) {
mc.lost = false;
}
}
function triggerHitting(curMov) {
if (((!hurt) && (tiles.player.mMode != 8)) && (tiles.player.mMode != 5)) {
if (tiles.player.hitTest(curMov)) {
if (tiles.player._y > (curMov._y - (curMov._height / 3))) {
damagePlayer(curMov);
}
}
if (((tiles.player.yVel <= 0) && (tiles.player.hitTest(curMov))) || ((tiles.player._y > curMov._y) && (tiles.player.hitTest(curMov)))) {
}
}
}
function damagePlayer(tarCur) {
if (tiles.player.mMode != 4) {
if (size == "a") {
if (!hurt) {
hurt = true;
shrinkCounter = 0;
tiles.player.yLove = 1;
tiles.player.yVel = -12;
if (tiles.player._x > tarCur._x) {
tiles.player.xVel = tiles.player.xVel + 10;
} else {
tiles.player.xVel = tiles.player.xVel - 10;
}
}
} else if (!hurt) {
death();
}
}
}
function death() {
hurt = true;
trace("DIEDIEDIE");
currentChar._visible = true;
loadGameOver();
var _local1 = new flash.geom.Transform(currentChar);
_local1.colorTransform = colorTrans;
shrinkCounter = 0;
tiles.player.mMode = 8;
tiles.player.yVel = -20;
}
function shrinkPlayer() {
if ((hurt && (!growing)) && (tiles.player.mMode != 8)) {
shrinkCounter++;
currentChar = tiles[("character" + charNum) + size];
var _local1 = new flash.geom.Transform(currentChar);
if (shrinkCounter == 2) {
smallenSound.start(0, 1);
}
if (shrinkCounter == 5) {
size = "b";
shel = tiles.attachMovie(("character" + charNum) + size, "tempChar", k++);
shel._x = currentChar._x;
shel._y = currentChar._y;
shel._xscale = currentChar._xscale;
shel._yscale = currentChar._yscale;
currentChar = tiles.tempChar;
tiles.tempChar._name = ("character" + charNum) + size;
tiles[("character" + charNum) + "a"].removeMovieClip();
_local1 = new flash.geom.Transform(tiles[("character" + charNum) + size]);
}
if (shrinkCounter < 16) {
if ((shrinkCounter % 2) == 0) {
_local1.colorTransform = colorTrans2;
} else {
_local1.colorTransform = colorTrans;
}
}
if (shrinkCounter > 15) {
if ((shrinkCounter % 2) == 0) {
currentChar._alpha = 100;
} else {
currentChar._alpha = 0;
}
}
if (shrinkCounter == 100) {
shrinkCounter = 0;
hurt = false;
}
}
}
function growPlayer() {
if ((hurt && (growing)) && (tiles.player.mMode != 8)) {
shrinkCounter++;
if (shrinkCounter == 2) {
embiggenSound.start(0, 1);
}
currentChar = tiles[("character" + charNum) + size];
var _local1 = new flash.geom.Transform(currentChar);
if (shrinkCounter == 5) {
size = "a";
shel = tiles.attachMovie(("character" + charNum) + size, "tempChar", k++);
shel._x = currentChar._x;
shel._y = currentChar._y;
shel._xscale = currentChar._xscale;
shel._yscale = currentChar._yscale;
currentChar = tiles.tempChar;
tiles.tempChar._name = ("character" + charNum) + size;
tiles[("character" + charNum) + "b"].removeMovieClip();
_local1 = new flash.geom.Transform(tiles[("character" + charNum) + size]);
}
if (shrinkCounter < 16) {
if ((shrinkCounter % 2) == 0) {
_local1.colorTransform = colorTrans2;
} else {
_local1.colorTransform = colorTrans;
}
}
if (shrinkCounter > 15) {
if ((shrinkCounter % 2) == 0) {
currentChar._alpha = 100;
} else {
currentChar._alpha = 0;
}
}
if (shrinkCounter == 20) {
shrinkCounter = 0;
hurt = false;
growing = false;
}
}
}
function gotoPicker() {
gotoAndStop ("picker");
}
function gotoOutcome() {
gotoAndStop ("outcome");
}
function killSwitch() {
for (i in _root) {
if ((typeof(_root[i]) == "movieClip") && (_root[i] != pizza)) {
_root[i].removeMovieClip();
}
}
}
function stageReset() {
_root._x = 0;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
cStatus = 0;
}
function loadChange() {
removeStageStuff();
pizza._xscale = 100;
pizza._yscale = 100;
pizza._x = 0;
pizza._y = 0;
if (level == 3) {
gotoAndStop ("win");
} else {
level++;
part = 0;
gotoAndStop ("miniGame");
}
}
function removeStageStuff() {
stageReset();
killSwitch();
tiles.removeMovieClip();
highUp.removeMovieClip();
bg.removeMovieClip();
bg1.removeMovieClip();
bg2.removeMovieClip();
hud.swapDepths(k++);
hud.removeMovieClip();
}
function killPlayer() {
tiles.player._y = tiles.player._y + tiles.player.yVel;
tiles.player.yVel = tiles.player.yVel + grav;
tiles.player.xVel = 0;
currentChar.gotoAndStop(11);
currentChar._x = tiles.player._x;
currentChar._y = tiles.player._y;
deathCounter++;
if (deathCounter == 50) {
lives--;
deathCounter = 0;
cStatus = 0;
if (lives < 0) {
removeStageStuff();
loadLosing();
gotoAndStop ("lose");
} else {
mainLoader();
mainReset();
}
}
}
function moveMC(mc, xMove, yMove) {
if ((tiles.player.mMode != 5) && (tiles.player._y < (curEnemy._y - (curEnemy._height / 4)))) {
if ((tiles.player.mMode != 8) && (tiles.player.mMode != 4)) {
if (xMove < 0) {
if (checkCoords(mc, mc._x + xMove, mc._y, 3)) {
mc._x = mc._x + xMove;
} else {
mc._x = (mc.bl._x + tileSize) + (mc._width / 2);
}
}
if (xMove > 0) {
if (checkCoords(mc, mc._x + xMove, mc._y, 2)) {
mc._x = mc._x + xMove;
} else {
mc._x = mc.br._x - (mc._width / 2);
}
}
tiles.player.yVel = 0;
tiles.player.yLove = 0;
tiles.player.enemyTarget = curEnemy;
jumpLevel = true;
playerJump = false;
if ((tiles.player.mMode == 2) && (curEnemy.type == "enemy-ladyBug")) {
tiles.player.mMode = 1;
}
while (tiles.player.hitTest(curEnemy.helder)) {
tiles.player._y--;
}
if (curEnemy.type == "enemy-red") {
}
if (curEnemy.type == "enemy-turnip") {
tiles.player._y--;
}
if (curBox.type == "box") {
tiles.player._y--;
}
if (curEnemy.type == "enemy-bird") {
tiles.player._y--;
}
if (curEnemy.type == "birdo") {
tiles.player._y--;
}
if (curEnemy.type == "enemy-egg") {
tiles.player._y--;
}
if (curEnemy.type == "enemy-blob") {
tiles.player._y--;
}
if (curEnemy.type == "enemy-miniBlob") {
tiles.player._y--;
}
if (curEnemy.type == "enemy-ladyBug") {
tiles.player._y--;
}
}
}
}
function moveMCItem(mc, mc2, xMove, yMove) {
if (mc.mMode != 8) {
if (xMove < 0) {
if (checkCoords(mc, mc._x + xMove, mc._y, 3)) {
mc._x = mc._x + xMove;
} else {
mc._x = (mc.bl._x + tileSize) + (mc._width / 2);
}
}
if (xMove > 0) {
if (checkCoords(mc, mc._x + xMove, mc._y, 2)) {
mc._x = mc._x + xMove;
} else {
mc._x = mc.br._x - (mc._width / 2);
}
}
mc.yVel = 0;
mc.yLove = 0;
while (mc.hitTest(mc2.helder)) {
mc._y--;
}
mc._y--;
}
}
function addPlant(mov) {
plantCounter++;
plantsList.push(plantCounter);
mov._name = "plant" + plantCounter;
}
function addBomb(mov) {
bombCounter++;
bombsList.push(bombCounter);
mov._name = "b" + bombCounter;
}
function addBird(mov) {
birdCounter++;
birds.push(birdCounter);
mov._name = "bird" + birdCounter;
mov.orgX = mov._x;
mov.orgY = mov._y;
mov.type = "enemy-bird";
}
function addTurnipWaiter(mov) {
turnipWaiterCounter++;
turnipWaiters.push(turnipWaiterCounter);
mov._name = "turnipWaiter" + turnipWaiterCounter;
}
function addBee() {
beeCounter++;
bees.push(beeCounter);
shel = tiles.attachMovie("bee", "bee" + beeCounter, k++);
shel._x = tiles.player._x + 670;
shel._y = (tiles.player._y + 100) - random(200);
}
function beeControl() {
if (beeOn) {
beeSpawnCounter++;
if (beeSpawnCounter > 50) {
addBee();
beeSpawnCounter = 0;
}
i = 0;
while (i < bees.length) {
curBee = tiles["bee" + bees[i]];
curBee._x = curBee._x - 15;
if (curBee.hitTest(tiles.player)) {
triggerHitting(curBee);
}
if ((tiles.player._x - curBee._x) > 670) {
bees.splice(i, 1);
trace("BEEGONE");
curBee.removeMovieClip();
}
i++;
}
}
}
function birdControl() {
i = 0;
while (i < birds.length) {
curBird = tiles["bird" + birds[i]];
if (curBird.facing == "left") {
if ((curBird._x - tiles.player._x) > 750) {
curBird.xVel = 0;
curBird._x = curBird.orgX;
} else {
curBird.xVel = -8;
if (((curBird._x + 750) < tiles.player._x) && (Math.abs(curBird.orgX - tiles.player._x) > 540)) {
curBird._x = curBird.orgX;
}
}
}
if (curBird.facing == "right") {
curBird.xVel = 8;
if ((curBird._x > (750 + tiles.player._x)) && (Math.abs(curBird.orgX - tiles.player._x) > 540)) {
curBird._x = curBird.orgX;
}
if (((tiles.player._x - curBird.orgX) > 2000) && (Math.abs(tiles.player._x - curBird._x) > 600)) {
birds.splice(i, 1);
curBird.swapDepths(k++);
curBird.removeMovieClip();
return;
}
}
curBird._x = curBird._x + curBird.xVel;
if (curBird.hitTest(tiles.player)) {
triggerHitting(curBird);
curEnemy = curBird;
moveMC(tiles.player, curBird.xVel, 0);
}
i++;
}
}
function enemyTriggers() {
i = 0;
while (i < turnipWaiters.length) {
curTurnipWaiter = tiles["turnipWaiter" + turnipWaiters[i]];
if (dist(tiles.player._x, tiles.player._y, curTurnipWaiter._x, curTurnipWaiter._y) < 300) {
shel = tiles.attachMovie("enemy-turnip", "wfwe", k++);
shel._x = curTurnipWaiter._x;
shel._y = curTurnipWaiter._y;
shel.addEnemy(shel);
curTurnipWaiter._visible = false;
turnipWaiters.splice(i, 1);
}
i++;
}
}
function addPhanto(mov) {
phantos.push(mov._name);
}
function addEnemy(mov) {
enemyCounter++;
enemiesList.push(enemyCounter);
mov._name = "enemy" + enemyCounter;
mov.type = mov.type;
mov.fallThrough = false;
mov.xVel = 4;
mov.yVel = 0;
if (mov.type == "enemy-ladyBug") {
mov.yVel = -5;
mov.hitGround = false;
}
if (mov.type == "enemy-turnip") {
mov.yVel = -5;
mov.xVel = 0;
mov.dir = 1;
}
if (mov.type == "enemy-birdo") {
mov.hits = 4;
mov.rapidFire = 2;
mov.step = 1;
mov.counter = 0;
mov.hurt = false;
mov.activated = false;
mov.eggCounter = 0;
mov.eggGoal = getEggGoal();
mov.limitRight = mov._x + 200;
mov.limitLeft = mov._x - 200;
}
if (mov.type == "enemy-blob") {
mov.hits = 5;
mov.rapidFire = 3;
mov.step = 1;
mov.patternStep = 1;
mov.firing = false;
mov.ouchie = false;
mov.activated = false;
mov.counter = 0;
mov.attackCounter = 0;
mov.hoverStep = 0;
mov.limitLeft = mov._x - 200;
mov.startPoint = mov._x;
mov.startHeight = mov._y;
}
if (mov.type == "enemy-egg") {
mov.xVel = mov.tempX;
mov.hitBirdo = false;
}
if (mov.type == "enemy-miniBlob") {
mov.xVel = 5 - random(10);
mov.yVel = -15;
mov.speedSet = 1 + random(10);
mov.counterGoal = 50 + random(10);
mov.counter = random(mov.counterGoal);
}
if (mov.type == "enemy-red") {
mov.speed = 3;
mov.dir = 1;
}
if (mov.fromEgg) {
mov.speed = mov.fromEggVel / 2;
if (mov._xscale > 0) {
mov.dir = -1;
mov.xVel = -mov.fromEggVel;
} else {
mov.dir = 1;
mov.xVel = mov.fromEggVel;
}
mov.hitGround = true;
} else {
mov.dir = -1;
}
mov.xF = 0.7;
mov.xMax = 500;
mov.yMax = 20;
mov.acc = 0.4;
mov.mMode = 1;
if (mov.type == "enemy-sparky") {
mov.dir = 2;
mov.lastWall = 1;
}
mov.yLove = 0;
mov.live = true;
}
function enemyVertical(mc) {
mc.yVel = mc.yVel + grav;
}
function detectToss() {
if (holding && (!Key.isDown(aKey))) {
throwOkay = true;
}
if ((holding && (Key.isDown(aKey))) && (throwOkay)) {
throwOkay = false;
pickUpOkay = false;
holding = false;
throwSound.start(0, 1);
item.xVel = tiles.player.xVel + (10 * (Math.abs(currentChar._xscale) / currentChar._xscale));
if ((item.type == "bomb") && (tiles.player.xVel == 0)) {
item.xVel = 0;
if (currentChar._xscale > 0) {
}
}
if (item.type == 1) {
boxCounter++;
boxes.push(boxCounter);
item._name = "box" + boxCounter;
if (tiles.player.xVel == 0) {
item.xVel = 0;
}
}
if (item.type == "enemy-ladyBug") {
item.fallThrough = true;
}
item.yVel = 0;
item.thrown = true;
item.live = true;
item.bounceCount = 0;
emptyBound(item);
lastItem = item;
item = randomTarget;
}
}
function checkBounce(mov) {
mov.bounceCount++;
if (mov.bounceCount >= 2) {
mov.sprite._xscale = 100;
mov.sprite._yscale = 100;
mov.sprite._y = 0;
if (mov.type == 1) {
mov._xscale = 100;
mov._yscale = 100;
mov.xVel = 0;
mov.yVel = 0;
mov.thrown = false;
mov._y = mov._y - 40;
curBox._y = Math.floor(curBox._y / 40) * 40;
curBox._x = Math.floor(curBox._x / 40) * 40;
curBox.thrown = false;
curBox._name = (("tile" + (curBox._x / 40)) + "x") + (curBox._y / 40);
while (tiles.player.hitTest(curBox)) {
tiles.player._y--;
}
} else {
if (mov._x < tiles.player._x) {
mov._xscale = -100;
mov.dir = 1;
} else {
mov._xscale = 100;
mov.dir = -1;
}
if (mov.type != "bomb") {
mov.thrown = false;
} else {
mov.xVel = 0;
}
}
} else {
mov.xVel = mov.xVel * mov.xF;
mov.yVel = mov.yVel * -0.5;
}
}
function sprites() {
currentChar = tiles[("character" + charNum) + size];
currentChar._x = tiles.player._x;
currentChar._y = tiles.player._y;
if ((tiles.player.mMode != 4) && (tiles.player.mMode != 4.1)) {
if (tiles.player.mMode == 2) {
currentChar.gotoAndStop(4);
if (Key.isDown(38)) {
currentChar.climb.play();
} else {
currentChar.climb.stop();
}
} else if (!playerJump) {
if (Key.isDown(40)) {
if (holding) {
currentChar.gotoAndStop(10);
} else {
currentChar.gotoAndStop(3);
}
} else if (Key.isDown(39)) {
if (holding) {
currentChar.gotoAndStop(8);
} else {
currentChar.gotoAndStop(2);
}
currentChar._xscale = Math.abs(currentChar._xscale);
} else if (Key.isDown(37)) {
if (holding) {
currentChar.gotoAndStop(8);
} else {
currentChar.gotoAndStop(2);
}
currentChar._xscale = -Math.abs(currentChar._xscale);
} else if (holding) {
currentChar.gotoAndStop(7);
} else {
currentChar.gotoAndStop(1);
}
} else if (playerJump) {
if (holding) {
currentChar.gotoAndStop(9);
} else {
currentChar.gotoAndStop(5);
}
if (Key.isDown(37)) {
currentChar._xscale = -Math.abs(currentChar._xscale);
} else if (Key.isDown(39)) {
currentChar._xscale = Math.abs(currentChar._xscale);
}
} else if (holding) {
currentChar.gotoAndStop(7);
} else {
currentChar.gotoAndStop(1);
}
} else if (item.type == 5) {
currentChar.gotoAndStop(12);
} else {
currentChar.gotoAndStop(6);
}
if (holding) {
if (item.type == "turnip") {
item.sprite._xscale = -100;
item.sprite._yscale = -100;
item.sprite._y = (-item.sprite._height) - 200;
}
if (item.type == "enemy-turnip") {
item.sprite._xscale = -100;
item.sprite._yscale = -100;
item.sprite._y = -item.sprite._height;
}
if (item.type == "enemy-red") {
item.sprite._xscale = -100;
item.sprite._yscale = -100;
item.sprite._y = -item.sprite._height;
}
if (item.type == "orb") {
item.sprite._xscale = -100;
item.sprite._yscale = -100;
item.sprite._y = (-item.sprite._height) - 30;
}
if (item.type == "enemy-ladyBug") {
item.sprite._xscale = -100;
item.sprite._yscale = -100;
item.sprite._y = -item.sprite._height;
item.sprite._x = 0;
}
if (item.type == "bomb") {
item.sprite._xscale = -100;
item.sprite._yscale = -100;
item.sprite._y = -item.sprite._height;
item.gotoAndStop(1);
}
if (item.type == 1) {
item.sprite._xscale = -100;
item.sprite._yscale = -100;
item.sprite._y = (-item.sprite._height) + 30;
item.sprite._x = 0 + (item.sprite._width / 2);
item.gotoAndStop(1);
}
if (item.type == "enemy-spark") {
item.sprite._xscale = -100;
item.sprite._yscale = -100;
item.sprite._y = -item.sprite._height;
item.gotoAndStop(1);
}
item._x = tiles.player._x;
item._y = (tiles.player._y - tiles.player._height) + 20;
if ((item.type == "turnip") || (item.type == "bomb")) {
item._y = (tiles.player._y - tiles.player._height) - 60;
}
if (size == "b") {
item._y = item._y + 20;
}
if (charNum == 2) {
item._y = item._y - 10;
}
if (charNum == 1) {
item._y = item._y - 20;
}
if (currentChar._xscale < 0) {
item._xscale = Math.abs(item._xscale) * -1;
} else {
item._xscale = Math.abs(item._xscale);
}
} else if (tiles.player.mMode == 5) {
currentChar.gotoAndStop(1);
}
}
function rideLog(mc) {
mc._y = logFocus._y + logFocus.log._y;
mc.yLove = 0;
mc.xVel = 0;
mc.yVel = 0;
}
function climb(mc) {
playerJump = false;
if (Key.isDown(38)) {
mc.yVel = climbSpeed;
easing("x", mc, mc.middle._x + 20, 0.33);
} else if (Key.isDown(40)) {
mc.yVel = slideSpeed;
easing("x", mc, mc.middle._x + 20, 0.33);
} else {
mc.yVel = 0;
}
if (Key.isDown(37)) {
mc.xVel = -shiftSpeed;
} else if (Key.isDown(39)) {
mc.xVel = shiftSpeed;
}
mc._y = mc._y + mc.yVel;
mc._x = mc._x + mc.xVel;
}
function normalVertical(mc) {
mc.yVel = mc.yVel + grav;
if (mc.yLove == 1) {
if (!holdUp) {
mc.yVel++;
}
if (mc.yVel >= 0) {
mc.yLove = 2;
mc.yVel = 0;
}
}
if ((mc.yLove == 2) || (mc.yLove == 3)) {
if (((holdCounter < 40) && (charNum == 2)) && (holdUp)) {
if ((mc.yLove == 2) && (holdCounter >= 40)) {
mc.yLove = 3;
} else {
mc.yVel = 0;
holdCounter++;
}
}
if (mc.yVel > 0) {
mc.yLove = 3;
}
}
if (((mc.yLove == 3) && (mc.yVel == 0)) && (!holdUp)) {
mc.yLove = 0;
holdCounter = 0;
}
if ((mc.yLove == 0) && (mc.yVel > 1.5)) {
mc.yLove = 3;
}
if (mc.yLove == 0) {
holdCounter = 0;
}
if (mc == tiles.player) {
}
}
function bounding(mc) {
mc.yVel = Math.floor(mc.yVel);
if ((mc.xVel < 0.5) && (mc.xVel > -0.5)) {
mc.xVel = 0;
}
if (mc.yVel < 0) {
if (checkCoords(mc, mc._x, mc._y + mc.yVel, 0)) {
mc._y = mc._y + mc.yVel;
} else {
mc.yVel = 0;
mc._y = (mc.tr._y + tileSize) + mc._height;
}
}
if (mc.yVel > 0) {
if (checkCoords(mc, mc._x, mc._y + mc.yVel, 1)) {
mc._y = mc._y + mc.yVel;
} else {
mc._y = mc.br._y;
if (mc == tiles.player) {
playerJump = false;
}
if (curEnemy.type == "enemy-turnip") {
curEnemy.hitGround = true;
}
if ((mc != tiles.player) && (mc.thrown)) {
checkBounce(mc);
} else {
mc.yVel = 0;
}
}
}
if (mc == tiles.player) {
mc.xVel = mc.xVel * mc.xF;
}
if (mc.xVel < 0) {
if (checkCoords(mc, mc._x + mc.xVel, mc._y, 3)) {
mc._x = mc._x + mc.xVel;
} else {
mc._x = (mc.bl._x + tileSize) + (mc._width / 2);
if (mc.type == "enemy-egg") {
mc.thrown = true;
mc.fallThrough = true;
mc.hitBirdo = true;
}
if (mc.type == "bomb") {
mc.xVel = mc.xVel * -0.2;
} else if ((mc != tiles.player) && (mc.thrown)) {
mc.xVel = mc.xVel * -0.5;
} else {
mc.xVel = 0;
}
}
}
if (mc.xVel > 0) {
if (checkCoords(mc, mc._x + mc.xVel, mc._y, 2)) {
mc._x = mc._x + mc.xVel;
} else {
mc._x = mc.br._x - (mc._width / 2);
if (mc.type == "enemy-egg") {
mc.thrown = true;
mc.fallThrough = true;
mc.hitBirdo = true;
}
if (mc.type == "bomb") {
mc.xVel = mc.xVel * -0.2;
} else if ((mc != tiles.player) && (mc.thrown)) {
mc.xVel = mc.xVel * -0.5;
} else {
mc.xVel = 0;
}
}
}
if (mc.xVel > mc.xMax) {
mc.xVel = mc.xMax;
}
if (mc.xVel < (-mc.xMax)) {
mc.xVel = -mc.xMax;
}
if (mc.yVel > mc.yMax) {
mc.yVel = mc.yMax;
}
if (mc.yVel < (-mc.yMax)) {
mc.yVel = -mc.yMax;
}
}
function emptyBound(mc) {
if (checkCoords(mc, mc._x, mc._y, 0) == false) {
mc._y = (mc.tr._y + tileSize) + mc._height;
}
if (checkCoords(mc, mc._x, mc._y, 1) == false) {
mc._y = mc.br._y;
if (curEnemy.type == "enemy-turnip") {
curEnemy.hitGround = true;
}
if ((mc != tiles.player) && (mc.thrown)) {
checkBounce(mc);
} else {
mc.yVel = 0;
}
}
if (checkCoords(mc, mc._x, mc._y, 3) == false) {
mc._x = (mc.bl._x + tileSize) + (mc._width / 2);
if (mc.type == "enemy-egg") {
mc.thrown = true;
mc.fallThrough = true;
mc.hitBirdo = true;
}
if (mc.type == "bomb") {
mc.xVel = mc.xVel * -0.2;
} else if ((mc != tiles.player) && (mc.thrown)) {
mc.xVel = mc.xVel * -0.5;
} else {
mc.xVel = 0;
}
}
if (checkCoords(mc, mc._x, mc._y, 2) == false) {
mc._x = mc.br._x - (mc._width / 2);
if (mc.type == "enemy-egg") {
mc.thrown = true;
mc.fallThrough = true;
mc.hitBirdo = true;
}
if (mc.type == "bomb") {
mc.xVel = mc.xVel * -0.2;
} else if ((mc != tiles.player) && (mc.thrown)) {
mc.xVel = mc.xVel * -0.5;
} else {
mc.xVel = 0;
}
}
}
function checkCoords(mc, x, y, direction) {
mc.ctlx = (x - (mc._width / 2)) + 1;
mc.ctly = (y - mc._height) + 1;
mc.ctrx = (x + (mc._width / 2)) - 1;
mc.ctry = (y - mc._height) + 1;
mc.cbrx = (x + (mc._width / 2)) - 1;
mc.cbry = (y + (mc._height * 0)) - 1;
mc.cblx = (x - (mc._width / 2)) + 1;
mc.cbly = (y + (mc._height * 0)) - 1;
mc.clmx = (x - (mc._width / 2)) + 1;
mc.clmy = (y - (mc._height / 2)) + 1;
mc.ctmx = x + 1;
mc.ctmy = (y - mc._height) + 1;
mc.crmx = (x + (mc._width / 2)) - 1;
mc.crmy = (y - (mc._height / 2)) + 1;
mc.cbmx = x + 1;
mc.cbmy = (y + (mc._height * 0)) - 1;
mc.cbmx = x + 1;
mc.cmx = x + 1;
mc.cmy = (y - (mc._height / 2)) + 1;
mc.middle = tiles[(("ladder" + Math.floor(mc.cmx / tileSize)) + "x") + Math.floor(mc.cmy / tileSize)];
mc.tl = tiles[(("tile" + Math.floor(mc.ctlx / tileSize)) + "x") + Math.floor(mc.ctly / tileSize)];
mc.tr = tiles[(("tile" + Math.floor(mc.ctrx / tileSize)) + "x") + Math.floor(mc.ctry / tileSize)];
mc.br = tiles[(("tile" + Math.floor(mc.cbrx / tileSize)) + "x") + Math.floor(mc.cbry / tileSize)];
mc.bl = tiles[(("tile" + Math.floor(mc.cblx / tileSize)) + "x") + Math.floor(mc.cbly / tileSize)];
mc.tm = tiles[(("tile" + Math.floor(mc.ctmx / tileSize)) + "x") + Math.floor(mc.ctmy / tileSize)];
mc.lm = tiles[(("tile" + Math.floor(mc.clmx / tileSize)) + "x") + Math.floor(mc.clmy / tileSize)];
mc.bm = tiles[(("tile" + Math.floor(mc.cbmx / tileSize)) + "x") + Math.floor(mc.cbmy / tileSize)];
mc.rm = tiles[(("tile" + Math.floor(mc.crmx / tileSize)) + "x") + Math.floor(mc.crmy / tileSize)];
mc.mb = tiles[(("tile" + Math.floor(mc.cbmx / tileSize)) + "x") + Math.floor(mc.cbly / tileSize)];
if (mc == tiles.player) {
tmDot._x = mc.ctmx;
tmDot._y = mc.ctmy;
lmDot._x = mc.clmx;
lmDot._y = mc.clmy;
rmDot._x = mc.crmx;
rmDot._y = mc.crmy;
bmDot._x = mc.cbmx;
bmDot._y = mc.cbmy;
blDot._x = mc.cblx;
blDot._y = mc.cbly;
brDot._x = mc.cbrx;
brDot._y = mc.cbry;
tlDot._x = mc.ctlx;
tlDot._y = mc.ctly;
trDot._x = mc.ctrx;
trDot._y = mc.ctry;
mDot._x = mc.cmx;
mDot._y = mc.cmy;
}
tiles.player._visible = false;
if (mc.mMode == 3) {
mc.mMode = 1;
}
if ((mc.tl.type == 1) || (mc.stl.type == 1)) {
guyTL = true;
if (mc == tiles.player) {
testBar.TL.gotoAndStop(2);
}
} else {
guyTL = false;
if (mc == tiles.player) {
testBar.TL.gotoAndStop(1);
}
}
if ((mc.tr.type == 1) || (mc.str.type == 1)) {
guyTR = true;
if (mc == tiles.player) {
testBar.TR.gotoAndStop(2);
}
} else {
guyTR = false;
if (mc == tiles.player) {
testBar.TR.gotoAndStop(1);
}
}
if ((mc.br.type == 1) || (mc.sbr.type == 1)) {
guyBR = true;
if (mc == tiles.player) {
testBar.BR.gotoAndStop(2);
}
} else if ((((mc.br.type == 2) || (mc.br.type == 5)) || (mc.br.type == 6)) && (mc.yVel > 0)) {
if (mc == tiles.player) {
}
} else {
guyBR = false;
if (mc == tiles.player) {
testBar.BR.gotoAndStop(1);
}
}
if ((mc.bl.type == 1) || (mc.sbl.type == 1)) {
guyBL = true;
if (mc == tiles.player) {
testBar.BL.gotoAndStop(2);
}
} else if ((((mc.bl.type == 2) || (mc.bl.type == 5)) || (mc.bl.type == 6)) && (mc.yVel > 0)) {
if (mc == tiles.player) {
}
} else {
guyBL = false;
if (mc == tiles.player) {
testBar.BL.gotoAndStop(1);
}
}
if ((mc.tm.type == 1) || (mc.stm.type == 1)) {
guyTM = true;
if (mc == tiles.player) {
testBar.TM.gotoAndStop(2);
}
} else {
guyTM = false;
if (mc == tiles.player) {
testBar.TM.gotoAndStop(1);
}
}
if ((mc.bm.type == 1) || (mc.sbm.type == 1)) {
guyBM = true;
if (mc == tiles.player) {
testBar.BM.gotoAndStop(2);
}
} else if ((((mc.bm.type == 2) || (mc.bm.type == 5)) || (mc.br.type == 6)) && (mc.yVel > 0)) {
if (mc == tiles.player) {
guyBM = true;
} else {
guyBM = true;
}
} else {
guyBM = false;
if (mc == tiles.player) {
testBar.BM.gotoAndStop(1);
}
}
if ((mc.lm.type == 1) || (mc.slm.type == 1)) {
guyLM = true;
if (mc == tiles.player) {
testBar.LM.gotoAndStop(2);
} else {
guyLM = false;
if (mc == tiles.player) {
testBar.LM.gotoAndStop(1);
}
}
} else {
guyLM = false;
}
if ((mc.rm.type == 1) || (mc.srm.type == 1)) {
guyRM = true;
if (mc == tiles.player) {
testBar.RM.gotoAndStop(2);
}
} else {
guyRM = false;
if (mc == tiles.player) {
testBar.RM.gotoAndStop(1);
}
}
if ((guyBM || (guyBL)) || (guyBR)) {
mc.yLove = 0;
}
if (!Key.isDown(38)) {
if ((tiles.player == mc) && ((guyBM && (guyBL)) || (guyBM && (guyBR)))) {
jumpLevel = true;
}
if ((((mc.br.type == 2) || (mc.br.type == 5)) || (mc.br.type == 6)) && (guyBM)) {
jumpLevel = true;
}
}
if ((((!holding) && (mc.middle.type == 3)) && (Key.isDown(38))) && (mc.mMode == 1)) {
mc._x = mc._x + mc.xVel;
initializeLadder(mc);
}
if ((((!holding) && (mc.middle.type == 3)) && (Key.isDown(40))) && (mc.mMode == 1)) {
mc._x = mc._x + mc.xVel;
initializeLadder(mc);
}
if ((mc.middle.type == 4) && (mc.mMode == 2)) {
mc._y = mc._y - (mc.yVel * 2);
} else if ((mc.middle.type == undefined) && (mc.mMode == 2)) {
initializeFall(mc);
}
switch (direction) {
case 0 :
if ((guyTL || (guyTR)) || (guyTM)) {
return(false);
}
case 1 :
if ((guyBR || (guyBL)) || (guyBM)) {
return(false);
}
case 2 :
if ((guyTR || (guyBR)) || (guyRM)) {
return(false);
}
case 3 :
if (!((guyTL || (guyBL)) || (guyLM))) {
break;
}
return(false);
}
return(true);
}
function initializeLadder(mc) {
mc.mMode = 2;
mc.xVel = 0;
mc.yVel = 0;
}
function initializeFall(mc) {
mc.mMode = 1;
mc.xVel = 0;
mc.yVel = 0;
}
function resetSuperJump() {
var _local1 = new flash.geom.Transform(tiles[("character" + charNum) + size]);
_local1.colorTransform = colorTrans;
holdDuck = 0;
}
function superJump() {
if (holdDuck == timeDuck) {
sweepSound.start(0, 1);
}
if (holdDuck > timeDuck) {
holdDuck++;
var _local1 = new flash.geom.Transform(tiles[("character" + charNum) + size]);
if ((holdDuck % 2) == 0) {
_local1.colorTransform = colorTrans2;
} else {
_local1.colorTransform = colorTrans;
}
}
}
function normalKeys() {
if (Key.isDown(38)) {
holdUp = true;
if ((tiles.player.yLove == 0) && (jumpLevel)) {
playerJump = true;
jumpLevel = false;
jumper.start(0, 1);
if (holdDuck > 40) {
tiles.player.yVel = madHops;
tiles.player.gotoAndStop(2);
} else {
tiles.player.yVel = hops;
}
resetSuperJump();
tiles.player.yLove = 1;
}
} else {
holdUp = false;
}
if (Key.isDown(40)) {
if (tiles.player.yLove == 0) {
tiles.player.gotoAndStop(1);
if (holdDuck <= timeDuck) {
holdDuck++;
}
}
} else {
if (tiles.player.yLove == 0) {
tiles.player.gotoAndStop(2);
}
if (Key.isDown(37)) {
resetSuperJump();
tiles.player.xVel = tiles.player.xVel - xS;
if (Key.isDown(aKey)) {
tiles.player.xVel = tiles.player.xVel - xSx;
}
}
if (Key.isDown(39)) {
resetSuperJump();
tiles.player.xVel = tiles.player.xVel + xS;
if (Key.isDown(aKey)) {
tiles.player.xVel = tiles.player.xVel + xSx;
}
}
}
}
function dist(x1, y1, x2, y2) {
return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
}
function xDist(x1, x2) {
return(Math.abs(x1 - x2));
}
function easing(pro, mov1, mov2, drift) {
switch (pro) {
case "x" :
mov1._x = mov1._x - (drift * ((mov1._x - mov2) / 2));
break;
case "y" :
mov1._y = mov1._y - (drift * ((mov1._y - mov2) / 2));
break;
case "xscale" :
mov1._xscale = mov1._xscale - (drift * ((mov1._xscale - mov2) / 2));
break;
case "yscale" :
mov1._yscale = mov1._yscale - (drift * ((mov1._yscale - mov2) / 2));
break;
case "width" :
mov1._width = mov1._width - (drift * ((mov1._width - mov2) / 2));
break;
case "height" :
mov1._height = mov1._height - (drift * ((mov1._height - mov2) / 2));
break;
case "alpha" :
mov1._alpha = mov1._alpha - (drift * ((mov1._alpha - mov2) / 2));
break;
case "rotation" :
mov1._rotation = mov1._rotation - (drift * ((mov1._rotation - mov2) / 2));
}
}
function elasticScale(mc, targt, accel, friction) {
if (mc.qxScale == undefined) {
mc.qxScale = 0;
}
mc.qxScale = mc.qxScale + ((targt - mc._xscale) * accel);
mc.qxScale = mc.qxScale * friction;
mc._xscale = (mc._yscale = mc._yscale + mc.qxScale);
}
function elasticX(mc, targt, accel, friction) {
if (mc.qxSpeed == undefined) {
mc.qxSpeed = 0;
}
mc.qxSpeed = mc.qxSpeed + ((targt - mc._x) * accel);
mc.qxSpeed = mc.qxSpeed * friction;
mc._x = mc._x + mc.qxSpeed;
}
function elasticY(mc, targt, accel, friction) {
if (mc.qySpeed == undefined) {
mc.qySpeed = 0;
}
mc.qySpeed = mc.qySpeed + ((targt - mc._y) * accel);
mc.qySpeed = mc.qySpeed * friction;
mc._y = mc._y + mc.qySpeed;
}
function elasticH(mc, targt, accel, friction) {
if (mc.qhSpeed == undefined) {
mc.qhSpeed = 0;
}
mc.qhSpeed = mc.qhSpeed + ((targt - mc._height) * accel);
mc.qhSpeed = mc.qhSpeed * friction;
mc._height = mc._height + mc.qhSpeed;
}
function elasticW(mc, targt, accel, friction) {
if (mc.qwSpeed == undefined) {
mc.qwSpeed = 0;
}
mc.qwSpeed = mc.qwSpeed + ((targt - mc._width) * accel);
mc.qwSpeed = mc.qwSpeed * friction;
mc._width = mc._width + mc.qwSpeed;
}
var size = "a";
var k = 0;
var fruitCollected = 0;
var blobsLaunched = 4;
lastDoor = undefined;
trace(lastDoor);
var boxes = new Array();
var boxCounter = 0;
mainLoader();
mainReset();
var logs = new Array();
var enemiesList = new Array();
var plantsList = new Array();
var birds = new Array();
var turnipWaiters = new Array();
var bombs = new Array();
var bombsList = new Array();
var bees = new Array();
var turnips = new Array();
var fruit = new Array();
var sandList = new Array();
var phantos = new Array();
var hurt = false;
var aKey = 65;
var fruitCounter = 0;
var totalFruit = 0;
var holdUp = false;
var holding = false;
var tileSize = 40;
hyper = false;
if (hyper) {
var hops = -100;
var madHops = -200;
var grav = 1.2;
var xS = 10;
var xSx = 20;
var xMax = 20;
var yS = 2;
} else {
var hops = -20;
var madHops = -30;
var grav = 1.2;
var xS = 3;
var xSx = 3.2;
var xMax = 5;
var yS = 2;
}
var holdCounter = 0;
var usedPJump = false;
var holdDuck = 0;
var timeDuck = 40;
var climbSpeed = -3;
var slideSpeed = (Math.abs(climbSpeed) * 4);
var shiftSpeed = 2;
var character = "mario";
var life = 0;
var pickUpSpeed = 100;
trace(pickUpSpeed);
var colorTrans = (new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0));
var colorTrans2 = (new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 255, 0));
var trans = (new flash.geom.Transform(tiles[("character" + charNum) + size]));
var musicChoice = 0;
var sweepSound = new Sound(this);
sweepSound.attachSound("sweep");
var embiggenSound = new Sound(this);
embiggenSound.attachSound("embiggen");
var smallenSound = new Sound(this);
smallenSound.attachSound("smallen");
var throwSound = new Sound(this);
throwSound.attachSound("throw");
var bombSounder = new Sound(this);
bombSounder.attachSound("bombSound");
var mainSoundTrack = new Sound(this);
mainSoundTrack.attachSound("mainLoop");
var losingSoundTrack = new Sound(this);
losingSoundTrack.attachSound("losingLoop");
var caveSoundTrack = new Sound(this);
caveSoundTrack.attachSound("caveLoop");
var twilightSoundTrack = new Sound(this);
twilightSoundTrack.attachSound("twilightLoop");
var bossSoundTrack = new Sound(this);
bossSoundTrack.attachSound("bossLoop");
var gameOverTrack = new Sound(this);
gameOverTrack.attachSound("gameOverLoop");
var winnerTrack = new Sound(this);
winnerTrack.attachSound("winnerLoop");
var miniTrack = new Sound(this);
miniTrack.attachSound("miniGameLoop");
var fruitSounder = new Sound(this);
fruitSounder.attachSound("fruitSound");
var chestNoise = new Sound(this);
chestNoise.attachSound("pickChest");
var collisionNoise = new Sound(this);
collisionNoise.attachSound("collisionSound");
var jumper = new Sound(this);
jumper.attachSound("jumpSound");
var pickUpSound = new Sound(this);
pickUpSound.attachSound("pickup");
onEnterFrame = function () {
if (cStatus == 0) {
levelTweenScreen();
}
if (cStatus == 1) {
if (!gamePaused) {
keyListen();
if (tiles.player.mMode != 20) {
if (tiles.player.mMode == 1) {
doors();
}
if (tiles.player.mMode == 1) {
normalKeys();
normalVertical(tiles.player);
ducking();
superJump();
}
detectToss();
if (tiles.player.mMode == 2) {
climb(tiles.player);
}
if (tiles.player.mMode == 3) {
rideLog(tiles.player);
normalKeys();
}
if (tiles.player.mMode == 4) {
pickingUp();
}
if (tiles.player.mMode == 4.1) {
pickingUpSand();
}
if (tiles.player.mMode == 8) {
killPlayer();
}
if (tiles.player.mMode != 8) {
bounding(tiles.player);
offScreen();
sprites();
}
if (tiles.player.mMode == 20) {
}
keyControl();
charStats();
fruitControl();
enemies();
moveBoxes();
orbs();
logControl();
beeControl();
birdControl();
enemyTriggers();
moveThrowingItems();
} else {
trace(tiles.player.mMode);
}
}
if (tiles.player.mMode != 8) {
pickUp();
specCamera();
boundCamera();
}
shrinkPlayer();
growPlayer();
trackInafo._x = tiles.player._x;
trackInfo._y = tiles.player._y - 50;
depths();
testBar._x = -_root._x;
testBar._y = -_root._y;
if (cStatus == 0) {
_root._x = 0;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
}
betaWarning._x = tiles.player._x;
betaWarning._y = tiles.player._y;
hudHandler();
backgroundHandler();
garbageCollection();
if (trapWin) {
tiles.player.mMode = 20;
}
}
aad++;
};
onMouseDown = function () {
if (_root.cheat) {
tiles.player._x = _xmouse;
tiles.player._y = _ymouse;
tiles.player.xVel = 0;
tiles.player.yVel = 0;
if (Key.isDown(32)) {
addOrb(_xmouse, _ymouse);
}
}
};
var backgroundInstances = new Array();
var curQuad = 0;
var slowRate2 = 2;
var slowRate = 10;
var keys = new Array();
var keyCounter = 0;
var worldParts = new Array();
var partCounter = 0;
var trapWin = false;
nmbr = 0;
aad = 0;
setInterval(inc, 1000);
var logCounter = 0;
var defaultCameraSize = 150;
var boringCounter = 0;
var activeCounter = 0;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var hitPop = -5;
thrownItemCounter = 0;
var letters = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L");
var targetDoor;
var sniffLock = false;
var doorReady = true;
var pickCounter = 0;
var turnipCounter = 0;
var blobsLeft = 10;
var eggVel = 8;
var growing = false;
var deathCounter = 0;
var enemyCounter = 0;
var plantCounter = 0;
var turnipWaiterCounter = 0;
var beeCounter = 0;
var beeSpawnCounter = 0;
var birdCounter = 0;
var bombCounter = 0;
var beeOn = false;
var pickUpOkay = false;
playerJump = false;
jumpLevel = true;
stop();
_quality = "HIGH";
Frame 6
stop();
onEnterFrame = null;
loadMiniGame();
Frame 7
onEnterFrame = null;
gotoAndStop ("picker");
Frame 8
stop();
loadWinning();
Frame 9
stop();
Symbol 24 MovieClip [bird] Frame 1
facing = "right";
_root.addBird(this);
Symbol 34 MovieClip [enemy-ladyBug] Frame 1
this.type = "enemy-ladyBug";
_root.addEnemy(this);
Symbol 49 MovieClip [enemy-turnip] Frame 1
type = "enemy-turnip";
_root.addEnemy(this);
Symbol 53 MovieClip Frame 1
function colorMe(col) {
this.c = new Color(this.fill);
c.setRGB(col);
}
colorMe(_root.colorKeys(_parent._parent.letter));
Symbol 55 MovieClip [keyPickUP] Frame 1
this.letter = _name.substr(3, 1);
this.type = "key";
_root.addKey(this);
Symbol 63 MovieClip [egg] Frame 1
type = "enemy-egg";
_root.addEnemy(this);
Symbol 63 MovieClip [egg] Frame 2
stop();
Symbol 73 MovieClip [enemy-red] Frame 1
type = "enemy-red";
_root.addEnemy(this);
Symbol 94 Button
on (release) {
play();
}
Symbol 101 Button
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}
Symbol 108 MovieClip Frame 1
function killAd() {
removeMovieClip(adBox);
}
stop();
var CPMStarPoolID = 1052;
var CPMStarSubPoolID = 27;
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie((("http://server.cpmstar.com/adviewas2.swf?poolid=" + CPMStarPoolID) + "&subpoolid=") + CPMStarSubPoolID);
Symbol 109 MovieClip Frame 1
function setMe(who) {
who.speed = random(8) + 3;
who.onEnterFrame = function () {
this._y = this._y - this.speed;
if (this._y < ((-this._height) / 2)) {
this._y = (480 + (this._height / 2)) + random(50);
}
};
}
stop();
this.onEnterFrame = function () {
bt = _root.getBytesTotal();
bl = _root.getBytesLoaded();
this.perc = Math.round((bl / bt) * 100);
this.sho = perc + "%";
pizza.gotoAndStop(perc);
if (perc >= 100) {
pb._visible = true;
if (_root.debug == true) {
_root.goDebug();
}
delete this.onEnterFrame;
}
};
pb._visible = false;
Symbol 109 MovieClip Frame 24
_root.nextFrame();
Symbol 117 Button
on (press) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 121 MovieClip Frame 1
_root.stop();
gotoAndPlay (2);
Symbol 121 MovieClip Frame 148
_parent.play();
Symbol 131 MovieClip Frame 1
var wd1 = new Sound();
wd1.attachSound("Anaconda");
wd1.start(0, 99);
Symbol 131 MovieClip Frame 92
_parent.play();
Symbol 188 MovieClip Frame 154
_parent.play();
Symbol 189 MovieClip Frame 1
stop();
Symbol 189 MovieClip Frame 2
stop();
Symbol 189 MovieClip Frame 3
stop();
Symbol 189 MovieClip Frame 4
_root.nextFrame();
Symbol 195 MovieClip [turnip] Frame 1
stop();
Symbol 214 MovieClip [splode] Frame 35
this.removeMovieClip();
Symbol 220 MovieClip [player] Frame 1
stop();
Symbol 229 MovieClip [setTileIn5] Frame 5
this.removeMovieClip();
Symbol 235 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 237 MovieClip [pizzaTransition] Frame 20
_root.loadChange();
trace("loadChange");
Symbol 237 MovieClip [pizzaTransition] Frame 40
this.removeMovieClip();
Symbol 246 MovieClip [miniBlob] Frame 1
stop();
Symbol 256 MovieClip [miniblob_splat] Frame 17
this.removeMovieClip();
Symbol 266 MovieClip [levelTween] Frame 60
_root.executeLevel();
this.removeMovieClip();
Symbol 270 MovieClip Frame 20
_root.dropLog(this._parent);
Symbol 271 MovieClip [log_] Frame 1
_root.addLog(this);
Symbol 271 MovieClip [log_] Frame 2
stop();
Symbol 271 MovieClip [log_] Frame 3
stop();
Symbol 275 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 293 MovieClip [door] Frame 1
stop();
locked = false;
Symbol 293 MovieClip [door] Frame 11
_root.callDoor();
Symbol 293 MovieClip [door] Frame 21
_root.callDoor4();
Symbol 299 MovieClip Frame 1
type = 1;
_root.naming(this);
Symbol 299 MovieClip Frame 2
stop();
Symbol 307 MovieClip Frame 1
_root.addPlant(this);
Symbol 308 MovieClip Frame 1
_root.addBomb(this);
Symbol 311 MovieClip Frame 1
type = 1;
pickUpReady = true;
_root.naming(this);
Symbol 313 MovieClip Frame 1
this._name = "rb";
this._visible = false;
Symbol 315 MovieClip Frame 1
this._name = "lb";
this._visible = false;
Symbol 318 MovieClip Frame 1
this._name = "tb";
this._visible = false;
Symbol 321 MovieClip Frame 1
this._name = "bb";
this._visible = false;
Symbol 323 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 324 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 352 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 356 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 365 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 366 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 368 MovieClip Frame 1
this.cacheAsBitmap = true;
_visible;
Symbol 379 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 381 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 387 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 389 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 391 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 392 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 394 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 396 MovieClip Frame 1
_root.addTurnipWaiter(this);
Symbol 398 MovieClip Frame 1
type = 2;
_root.naming(this);
Symbol 400 MovieClip Frame 1
this.type = 3;
_root.naming(this);
Symbol 402 MovieClip Frame 1
this.type = 4;
_root.naming(this);
Symbol 405 MovieClip Frame 1
type = 1;
explodable = true;
_root.naming(this);
stop();
Symbol 405 MovieClip Frame 5
stop();
Symbol 412 MovieClip Frame 1
this._visible = false;
Symbol 413 MovieClip Frame 1
type = "enemy-sparky";
_root.addEnemy(this);
Symbol 439 MovieClip Frame 22
_root.birdoEgg(_parent, this);
Symbol 439 MovieClip Frame 28
_root.birdoReload(_parent, this);
Symbol 439 MovieClip Frame 44
_root.revertBirdo(_parent);
Symbol 445 MovieClip Frame 15
_root.birdoBackToSenses(this._parent);
Symbol 449 MovieClip Frame 15
stop();
Symbol 450 MovieClip Frame 1
type = "enemy-birdo";
_root.addEnemy(this);
stop();
Symbol 450 MovieClip Frame 2
stop();
Symbol 466 MovieClip Frame 1
stop();
Symbol 467 MovieClip Frame 1
_root.addFruit(this);
Symbol 470 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 471 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 474 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 476 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 479 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 481 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 482 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 488 MovieClip Frame 1
lockedLetter = this._name.substr(4, 1);
trace(lockedLetter);
this.c = new Color(this.fill);
c.setRGB(_root.colorKeys(lockedLetter));
locked = true;
Symbol 489 MovieClip Frame 1
facing = "left";
_root.addBird(this);
Symbol 503 MovieClip Frame 1
this._visible = false;
Symbol 514 MovieClip Frame 18
_root.blobFire(_parent, this, 1);
Symbol 514 MovieClip Frame 45
_root.endBlobFire(_parent);
Symbol 515 MovieClip Frame 18
_root.blobFire(_parent, this, 1);
Symbol 515 MovieClip Frame 33
_root.endBlobFire(_parent);
Symbol 522 MovieClip Frame 19
_root.blobFire(_parent, this, 2);
Symbol 522 MovieClip Frame 40
_root.blobFire(_parent, this, 2);
Symbol 522 MovieClip Frame 65
_root.endBlobFire(_parent);
Symbol 533 MovieClip Frame 10
stop();
Symbol 542 MovieClip Frame 7
stop();
Symbol 550 MovieClip Frame 15
stop();
Symbol 554 MovieClip Frame 5
stop();
Symbol 557 MovieClip Frame 9
_root.revertBlob(this._parent);
Symbol 558 MovieClip Frame 1
type = "enemy-blob";
_root.addEnemy(this);
Symbol 558 MovieClip Frame 2
stop();
Symbol 562 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 563 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 569 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 570 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 571 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 572 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 573 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 574 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 575 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 576 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 577 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 581 MovieClip Frame 1
type = 5;
_root.naming(this);
Symbol 585 MovieClip Frame 1
type = "enemy-birdo";
_root.addEnemy(this);
stop();
Symbol 585 MovieClip Frame 2
stop();
Symbol 587 MovieClip Frame 1
type = "phanto";
keyType = this._name.substr(6, 1);
_root.addPhanto(this);
Symbol 594 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 596 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 598 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 600 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 601 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 602 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 603 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 622 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 625 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 626 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 627 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 628 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 629 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 631 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 633 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 636 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 653 MovieClip Frame 1
this.onPress = function () {
};
Symbol 658 MovieClip [inst] Frame 1
but_ok.onPress = function () {
this._parent.unloadMovie();
this._parent.removeMovieClip();
};
Symbol 660 MovieClip [fruit_myStar] Frame 1
this.cacheAsBitmap = true;
this.counter = 0;
onEnterFrame = function () {
this._x = this._x + this.xVel;
this._y = this._y + this.yVel;
this.yVel = this.yVel + 0.7;
counter++;
if (counter > 200) {
this.removeMovieClip();
}
};
Symbol 661 MovieClip [doorClose] Frame 10
_root.callDoor2();
Symbol 661 MovieClip [doorClose] Frame 23
_root.callDoor3();
Symbol 702 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 704 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 706 MovieClip [endscreen] Frame 340
stop();
scrolla.cacheAsBitmap = true;
scrolla.onEnterFrame = function () {
this._y = this._y - 2;
if (this._y < ((-this._height) - 100)) {
_root.gotoMenu();
delete this.onEnterFrame;
}
};
Symbol 767 MovieClip [character0a] Frame 1
stop();
Symbol 810 MovieClip [character0b] Frame 1
stop();
Symbol 863 MovieClip [character1a] Frame 1
stop();
Symbol 905 MovieClip [character1b] Frame 1
stop();
Symbol 948 MovieClip [character2a] Frame 1
stop();
Symbol 955 MovieClip [character2b] Frame 1
stop();
Symbol 970 MovieClip [bonusicon_wrapper] Frame 35
onEnterFrame = function () {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
stop();
Symbol 982 MovieClip Frame 1
stop();
Symbol 999 MovieClip Frame 1
stop();
Symbol 999 MovieClip Frame 15
gotoAndStop (2);
Symbol 1001 MovieClip [bomb] Frame 1
stop();
Symbol 1002 MovieClip [bombBig] Frame 1
stop();
Symbol 1010 MovieClip Frame 1
stop();
Symbol 1020 MovieClip Frame 1
this._parent.setMe(this);
Symbol 1025 Button
on (release) {
_root.play();
}
Symbol 1030 Button
on (release) {
getURL ("http://armorgames.com", "_blank");
}
Symbol 1036 Button
on (release) {
getURL ("http://bomtoons.com/", "_blank");
}
Symbol 1042 MovieClip Frame 15
but_play.onPress = function () {
this._parent.gotoAndStop("charselect");
};
but_inst.onPress = function () {
_root.attachMovie("inst", "inst", 99);
};
but_moregames.onPress = function () {
getURL ("http://www.armorgames.com", "_blank");
};
but_bom.onPress = function () {
getURL ("http://www.bomtoons.com", "_blank");
};
but_jmtb.onPress = function () {
getURL ("http://www.jmtb02.com", "_blank");
};
Symbol 1042 MovieClip Frame 44
stop();
Symbol 1065 Button
on (release) {
_root.gotoMenu();
}
Symbol 1068 Button
on (release) {
_root.onEnterFrame = null;
if (_root.level > 1) {
_root.play();
} else {
_root.gotoMiniIntro();
}
}
Symbol 1069 MovieClip Frame 1
pick1.onRelease = function () {
menuArrow._x = pick1._x + (pick1._width / 2);
_root.charNum = 0;
};
pick2.onRelease = function () {
menuArrow._x = (pick2._x + (pick2._width / 2)) - 5;
_root.charNum = 1;
};
pick3.onRelease = function () {
menuArrow._x = pick3._x + (pick3._width / 2);
_root.charNum = 2;
};
Symbol 1074 MovieClip Frame 1
this._visible = false;
Symbol 1080 MovieClip Frame 5
stop();
Symbol 1084 MovieClip Frame 1
stop();
Symbol 1087 Button
on (release) {
_root.handlePause();
}
Symbol 1090 Button
on (release) {
if (_quality == "HIGH") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "LOW";
} else if (_quality == "LOW") {
_quality = "HIGH";
}
}
Symbol 1093 Button
on (release) {
_root.handleMute();
}
Symbol 1097 MovieClip Frame 1
stop();
Symbol 1098 MovieClip Frame 1
roboStats._visible = false;
pausedScene._visible = false;
stop();
Symbol 1114 MovieClip Frame 6
stop();
Symbol 1123 MovieClip Frame 1
this.gotoAndPlay(random(5));
Symbol 1124 MovieClip Frame 68
stop();
Symbol 1125 MovieClip Frame 1
stop();
Symbol 1125 MovieClip Frame 50
stop();
Symbol 1126 MovieClip Frame 1
_parent.resetChests();
Symbol 1126 MovieClip Frame 10
stop();
_parent.ready = true;
_parent.gotone = false;
Symbol 1126 MovieClip Frame 34
_parent.revealOthers();
Symbol 1129 Button
on (release) {
_root.gotoOutcome();
}
Symbol 1135 MovieClip Frame 1
function init() {
pick0 = random(6);
pick1 = random(6);
while (pick0 == pick1) {
pick1 = random(6);
}
trace("P0=" + pick0);
trace("P1=" + pick1);
var _local4 = 0;
while (_local4 < 6) {
var _local3 = chests["c" + _local4];
_local3.gotoAndStop(1);
if ((_local4 == pick0) || (_local4 == pick1)) {
_local3.prize = prizes[random(prizes.length)];
trace(_local3.prize);
} else {
_local3.prize = 0;
}
_local3.num = _local4;
_local3.onPress = function () {
if (!this._parent._parent.gotone) {
_root.fruitCollected--;
_root.chestNoise.start(0, 1);
this._parent._parent.choice = this.num;
this._parent._parent.fruit.play();
trace(this.prize);
this.play();
this._parent._parent.livesThisRound = this._parent._parent.livesThisRound + this.prize;
_root.lives = _root.lives + this.prize;
this._parent._parent.gotone = true;
this._parent._parent.runCoin(this);
this._parent.play();
}
};
_local4++;
}
}
function revealOthers() {
var _local1 = 0;
while (_local1 < 6) {
var _local2 = chests["c" + _local1];
if (_local1 != choice) {
runCoin(_local2);
_local2.gotoAndStop(2);
}
_local1++;
}
}
function resetChests() {
if (_root.fruitCollected >= 1) {
init();
} else {
var _local2 = 0;
while (_local2 < 6) {
var _local3 = chests["c" + _local2];
_local3.gotoAndStop(1);
_local2++;
}
chests.stop();
}
}
function runCoin(who) {
var _local3 = this.attachMovie("bonusicon_wrapper", "coin", k++);
_local3._x = (chests._x + who._x) - 7;
_local3._y = (chests._y + who._y) - 60;
_local3._alpha = 0;
_local3.goaly = _local3._y - 50;
i = 0;
while (i < 5) {
var _local2 = _local3["ike" + i];
_local2._visible = false;
i++;
}
var _local4 = _local3["ike" + who.prize];
_local4._visible = true;
_local3.onEnterFrame = function () {
this.dist = this.goaly - this._y;
this._y = this._y + (this.dist / 7);
this.absy = Math.abs(this.dist);
this._alpha = this._alpha + 5;
if (this.absy < 1) {
this._alpha = 100;
this._parent.but_continue._visible = true;
this._parent.words._visible = true;
this._parent.but_continue.onPress = function () {
trace("go on!");
};
}
};
}
var prizes = new Array(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4);
ready = false;
var k = 0;
var livesThisRound = 0;
gotone = false;
onEnterFrame = function () {
if (ready) {
ready = false;
init();
}
bones = "LIVES + " + livesThisRound;
fruitStuff = "x " + _root.fruitCollected;
};
Symbol 1135 MovieClip Frame 21
stop();
Symbol 1161 Button
on (release) {
_root.gotoAndStop("menu");
}
Symbol 1163 Button
on (release) {
getURL ("http://armorgames.com/", "_blank");
}
Symbol 1171 Button
on (release) {
getURL ("http://bomtoons.com", "_blank");
}
Symbol 1173 MovieClip Frame 60
stop();
Symbol 1177 MovieClip Frame 1
var globalSound = new Sound();
onEnterFrame = function () {
globalSound.setVolume(100 - this._currentframe);
if (this._currentframe >= 100) {
globalSound.setVolume(100);
stopAllSounds();
onEnterFrame = null;
}
};
Symbol 1177 MovieClip Frame 110
_root.getMyGame();