Frame 1
stop();
Yumtastic.onRelease = function () {
getURL ("http://www.YumtasticGames.com", "_blank");
};
Frame 2
playGame.onRelease = function () {
gotoAndStop ("PlayGame");
};
instructions.onRelease = function () {
gotoAndStop ("Instructions");
};
credits.onRelease = function () {
gotoAndStop ("Credits");
};
stop();
Frame 3
mainMenu.onRelease = function () {
gotoAndStop ("MainMenu");
};
Frame 4
mainMenu.onRelease = function () {
gotoAndStop ("MainMenu");
};
yumtastic.onRelease = function () {
getURL ("http://www.YumtasticGames.com", _blank);
};
Frame 5
function moveStuff() {
if ((((fishStartXPos > fishLeft) and (fishStartXPos < fishRight)) and (fishStartYPos > fishTop)) and (fishStartYPos < fishBottom)) {
if (Key.isDown(37)) {
fish.fishInside._xscale = -100;
bubbleMouthSide = -bubbleMove;
fishStartXPos = fishStartXPos - moveSpeed;
}
if (Key.isDown(39)) {
fish.fishInside._xscale = 100;
bubbleMouthSide = bubbleMove;
fishStartXPos = fishStartXPos + moveSpeed;
}
if (Key.isDown(38)) {
fishStartYPos = fishStartYPos - moveSpeed;
}
if (Key.isDown(40)) {
fishStartYPos = fishStartYPos + moveSpeed;
}
}
}
function keepFishInBounds() {
if (fishStartXPos < fishLeft) {
fishStartXPos = fishLeft + 1;
}
if (fishStartXPos > fishRight) {
fishStartXPos = fishRight - 1;
}
if (fishStartYPos < fishTop) {
fishStartYPos = fishTop + 1;
}
if (fishStartYPos > fishBottom) {
fishStartYPos = fishBottom - 1;
}
}
function checkIfGameWon() {
if (fish._xscale >= 105) {
win();
}
}
function checkIfGameOver() {
if (fishLivesLeft == 0) {
GameOver();
}
}
function openMouthPellet() {
fish.fishInside.gotoAndPlay("eat");
eatingSound.start();
}
function openMouthFish() {
fish.fishInside.gotoAndPlay("eatFish");
eatingSound.start();
}
function fishScore(eatenFishSize) {
switch (eatenFishSize) {
case 0 :
totalScore = totalScore + 110;
break;
case 10 :
totalScore = totalScore + 10;
break;
case 20 :
totalScore = totalScore + 20;
break;
case 30 :
totalScore = totalScore + 30;
break;
case 40 :
totalScore = totalScore + 40;
break;
case 50 :
totalScore = totalScore + 50;
break;
case 60 :
totalScore = totalScore + 60;
break;
case 70 :
totalScore = totalScore + 70;
break;
case 80 :
totalScore = totalScore + 80;
break;
case 90 :
totalScore = totalScore + 90;
break;
case 100 :
totalScore = totalScore + 100;
break;
default :
totalScore = totalScore + 0;
}
totalScoreDisplay = "score: " + totalScore;
untilExtraScore = (extraLifeScore - totalScore) + " points until extra life";
if (totalScore >= extraLifeScore) {
extraLifeScore = extraLifeScore + (1000 + extraLifeScoredificculty);
extraLifeScoredificculty = extraLifeScoredificculty + 500;
extraLife();
totalScoreDisplay = "score: " + totalScore;
untilExtraScore = (extraLifeScore - totalScore) + " points until extra life";
}
}
function fishGrowHungry() {
if (fishHungerStart == "yes") {
if (FishHunger.FishHungerLevel._xscale == 0) {
stomachEmptyTimer++;
if (stomachEmptyTimer >= 7) {
FishHunger.HungerSign.gotoAndPlay("Hungry");
}
if (stomachEmptyTimer == 14) {
stomachEmptyTimer = 0;
minusLife();
}
} else {
stomachEmptyTimer++;
if (stomachEmptyTimer == 14) {
FishHunger.FishHungerLevel._xscale = FishHunger.FishHungerLevel._xscale - 20;
stomachEmptyTimer = 0;
}
}
}
}
function fishGrow() {
fishHungerStart = "yes";
FishHunger.HungerSign.gotoAndStop("notHungry");
FishHunger.FishHungerLevel._xscale = FishHunger.FishHungerLevel._xscale + 20;
stomachEmptyTimer = 0;
if (FishHunger.FishHungerLevel._xscale == 100) {
FishHunger.FishHungerLevel._xscale = 0;
fish._xscale = fish._xscale + fishGrowWidthAmount;
fish._yscale = fish._yscale + fishGrowHeightAmount;
fishWidth = fish._width;
fishHeight = fish._height;
bubbleMove = bubbleMove + 1.5;
}
}
function feedFood() {
food = attachMovie("Food", "Food" + foodNumber, getNextHighestDepth());
foodPosRan = random(650) + 25;
food._x = foodPosRan;
food._y = 10;
movingFood = setInterval(moveFood, 50);
}
function moveFood() {
food._y = food._y + foodSpeed;
if (food._y > 510) {
foodGone = "Gone";
removeMovieClip(food);
clearInterval(movingFood);
}
}
function createBubbles() {
bubble = attachMovie("Bubble", "Bubble" + foodNumber, getNextHighestDepth());
bubble._x = fish._x + bubbleMouthSide;
bubble._y = fish._y;
if (bubbleMouthSide == -50) {
bubble._xscale = -100;
}
movingBubbles = setInterval(moveBubbles, 50);
}
function moveBubbles() {
bubble._y = bubble._y - bubbleSpeed;
if (bubble._y < -10) {
bubbleGone = "Gone";
removeMovieClip(bubble);
clearInterval(movingBubbles);
}
}
function colorOfFish(fishSize) {
switch (fishSize) {
case 0 :
badFish.badFish.gotoAndPlay("BrownFish");
break;
case 10 :
badFish.badFish.gotoAndPlay("BrownFish");
break;
case 20 :
badFish.badFish.gotoAndPlay("GreenFish");
break;
case 30 :
badFish.badFish.gotoAndPlay("RedFish");
break;
case 40 :
badFish.badFish.gotoAndPlay("BrownFish");
break;
case 50 :
badFish.badFish.gotoAndPlay("GreenFish");
break;
case 60 :
badFish.badFish.gotoAndPlay("RedFish");
break;
case 70 :
badFish.badFish.gotoAndPlay("BrownFish");
break;
case 80 :
badFish.badFish.gotoAndPlay("GreenFish");
break;
case 90 :
badFish.badFish.gotoAndPlay("RedFish");
break;
case 100 :
badFish.badFish.gotoAndPlay("BrownFish");
break;
default :
totalScore = totalScore + 0;
}
}
function openMouthColorFish(fishSize) {
switch (fishSize) {
case 0 :
fish.fishInside.fishEaten.gotoAndPlay("brownFish");
break;
case 10 :
fish.fishInside.fishEaten.gotoAndPlay("brownFish");
break;
case 20 :
fish.fishInside.fishEaten.gotoAndPlay("greenFish");
break;
case 30 :
fish.fishInside.fishEaten.gotoAndPlay("redFish");
break;
case 40 :
fish.fishInside.fishEaten.gotoAndPlay("brownFish");
break;
case 50 :
fish.fishInside.fishEaten.gotoAndPlay("greenFish");
break;
case 60 :
fish.fishInside.fishEaten.gotoAndPlay("redFish");
break;
case 70 :
fish.fishInside.fishEaten.gotoAndPlay("brownFish");
break;
case 80 :
fish.fishInside.fishEaten.gotoAndPlay("greenFish");
break;
case 90 :
fish.fishInside.fishEaten.gotoAndPlay("redFish");
break;
case 100 :
fish.fishInside.fishEaten.gotoAndPlay("brownFish");
break;
default :
fish.fishInside.fishEaten.gotoAndPlay("brownFish");
}
}
function newFish() {
if (getTimer() > nextFishTime) {
attachMovie("badFish", "badFish" + nextFish, getNextHighestDepth());
if (Math.random() < 0.5) {
_root["badFish" + nextFish]._x = -100;
fishDir = -100;
dx = int(Math.random(3)) + 3;
} else {
_root["badFish" + nextFish]._x = 770;
fishDir = 100;
dx = -(int(Math.random(3)) + 3);
}
fishSize = Math.round(Math.random() * 10) * 10;
_root["badFish" + nextFish]._y = int(Math.random() * 480) + 20;
enemyFishArray.push({clip:"badFish" + nextFish, d:dx, fishDirection:fishDir, fishScale:fishSize});
nextFish++;
nextFishTime = getTimer() + 2000;
}
}
function moveEnemyFishs() {
i = enemyFishArray.length - 1;
while (i >= 0) {
sizeOfFish = enemyFishArray[i].fishScale;
fishSpeed = enemyFishArray[i].d;
fishFaces = enemyFishArray[i].fishDirection;
badFish = _root[enemyFishArray[i].clip];
badFish._x = badFish._x + fishSpeed;
badFish.badFish._xscale = fishFaces;
badFish._xscale = sizeOfFish;
badFish._yscale = sizeOfFish;
if (bad) {
badFish.removeMovieClip();
enemyFishArray.splice(i, 1);
}
if ((dx < 0) and (badFish._x < -70)) {
badFish.removeMovieClip();
enemyFishArray.splice(i, 1);
} else if ((dx > 0) and (badFish._x > 740)) {
badFish.removeMovieClip();
enemyFishArray.splice(i, 1);
}
colorOfFish(sizeOfFish);
yourFishSize = fish._width;
badFishSize = badFish._width;
if (yourFishSize > badFishSize) {
if (fish.fishInside.FishMouth.hitTest(badFish)) {
fishScore(sizeOfFish);
openMouthFish();
badFish.removeMovieClip();
enemyFishArray.splice(i, 1);
fishGrow();
openMouthColorFish(sizeOfFish);
}
}
if (yourFishSize < badFishSize) {
if (badFish.badFish.FishMouth.hitTest(fish.fishInside.EatArea)) {
FishHunger.FishHungerLevel._xscale = 0;
minusLife();
eatingSound.start();
stomachEmptyTimer = 0;
}
}
i--;
}
}
function extraLife() {
fishLivesLeft++;
lives = "lives: " + fishLivesLeft;
}
function minusLife() {
fishHungerStart = "no";
fish._x = 267.2;
fish._y = -126.1;
fishStartXPos = 277.2;
fishStartYPos = 203.9;
fishLivesLeft--;
lives = "lives: " + fishLivesLeft;
splashingSound.start();
FishHunger.HungerSign.gotoAndStop("notHungry");
}
function win() {
i = enemyFishArray.length;
while (i >= 0) {
clearInterval(newFishs);
clearInterval(moveEnemyFish);
badFish = _root[enemyFishArray[i].clip];
badFish.removeMovieClip();
enemyFishArray.splice(i, 1);
i--;
}
clearInterval(movingFood);
clearInterval(fishInBounds);
clearInterval(newFishs);
clearInterval(moveEnemyFish);
clearInterval(movingBubbles);
clearInterval(fishHungerGrow);
clearInterval(gameLost);
clearInterval(gameWin);
bubble.removeMovieClip();
food.removeMovieClip();
gotoAndStop ("Win");
}
function GameOver() {
i = enemyFishArray.length;
while (i >= 0) {
clearInterval(newFishs);
clearInterval(moveEnemyFish);
badFish = _root[enemyFishArray[i].clip];
badFish.removeMovieClip();
enemyFishArray.splice(i, 1);
i--;
}
clearInterval(movingFood);
clearInterval(fishInBounds);
clearInterval(newFishs);
clearInterval(moveEnemyFish);
clearInterval(movingBubbles);
clearInterval(fishHungerGrow);
clearInterval(gameLost);
clearInterval(gameWin);
bubble.removeMovieClip();
food.removeMovieClip();
gotoAndStop ("GameOver");
}
foodSpeed = 1;
foodGone = "Gone";
bubbleSpeed = 2;
bubbleGone = "Gone";
bubbleMouthSide = 10;
fishGrowWidthAmount = 5;
fishGrowHeightAmount = 5;
bubbleMove = 10;
fishRight = 671;
fishLeft = 25;
fishTop = 25;
fishBottom = 470;
extraLifeScore = 1000;
extraLifeScoredificculty = 500;
totalScore = 0;
totalScoreDisplay = "score: " + totalScore;
untilExtraScore = (extraLifeScore - totalScore) + " points until extra life";
sizeOfTheFish = 20;
fish._xscale = sizeOfTheFish;
fish._yscale = sizeOfTheFish;
originalFishScale = 10;
fishLivesLeft = 3;
lives = "lives: " + fishLivesLeft;
stomachEmptyTimer = 0;
FishHunger.FishHungerLevel._xscale = 0;
fishHungerStart = "no";
eatingSound = new Sound();
eatingSound.attachSound("Eating");
eatingSound.setVolume(5);
splashingSound = new Sound();
splashingSound.attachSound("DropInWater");
splashingSound.setVolume(5);
splashingSound.start();
div = 10;
moveSpeed = 7.25;
foodTimeElapsed = 0;
fishStartXPos = 277.2;
fishStartYPos = 203.9;
getKeys = new Object();
getKeys.onKeyDown = function () {
};
Key.addListener(getKeys);
fishInBounds = setInterval(keepFishInBounds, 200);
gameWin = setInterval(checkIfGameWon, 200);
gameLost = setInterval(checkIfGameOver, 200);
onEnterFrame = function () {
fish._x = fish._x + ((fishStartXPos - fish._x) / div);
fish._y = fish._y + ((fishStartYPos - fish._y) / div);
if (foodTimeElapsed == 0) {
randomFoodTime = random(90) + 36;
}
foodTimeElapsed++;
if (foodTimeElapsed == randomFoodTime) {
foodTimeElapsed = 0;
if (foodGone == "Gone") {
feedFood();
foodGone = "Not Gone";
}
}
if (fish.fishInside.FishMouth.hitTest(food)) {
removeMovieClip(food);
foodGone = "Gone";
clearInterval(movingFood);
fishGrow();
openMouthPellet();
}
if (bubbleGone == "Gone") {
createBubbles();
bubbleGone = "Not Gone";
}
};
fish.onEnterFrame = moveStuff;
fishHungerGrow = setInterval(fishGrowHungry, 1000);
nextFishTime = 0;
nextFish = 0;
enemyFishArray = [];
numenemyFishArray = 10;
newFishs = setInterval(newFish, 50);
moveEnemyFish = setInterval(moveEnemyFishs, 20);
stop();
Frame 6
tryAgain.onRelease = function () {
clearInterval(movingFood);
clearInterval(fishInBounds);
clearInterval(newFishs);
clearInterval(moveEnemyFish);
clearInterval(movingBubbles);
clearInterval(fishHungerGrow);
clearInterval(gameLost);
clearInterval(gameWin);
gotoAndStop ("PlayGame");
};
mainMenu.onRelease = function () {
clearInterval(movingFood);
clearInterval(fishInBounds);
clearInterval(newFishs);
clearInterval(moveEnemyFish);
clearInterval(movingBubbles);
clearInterval(fishHungerGrow);
clearInterval(gameLost);
clearInterval(gameWin);
gotoAndStop ("MainMenu");
};
foodGone = "Not Gone";
stop();
Frame 7
playAgain.onRelease = function () {
clearInterval(movingFood);
clearInterval(fishInBounds);
clearInterval(newFishs);
clearInterval(moveEnemyFish);
clearInterval(movingBubbles);
clearInterval(fishHungerGrow);
clearInterval(gameLost);
clearInterval(gameWin);
gotoAndStop ("PlayGame");
};
mainMenu.onRelease = function () {
clearInterval(movingFood);
clearInterval(fishInBounds);
clearInterval(newFishs);
clearInterval(moveEnemyFish);
clearInterval(movingBubbles);
clearInterval(fishHungerGrow);
clearInterval(gameLost);
clearInterval(gameWin);
gotoAndStop ("MainMenu");
};
foodGone = "Not Gone";
stop();
Symbol 29 MovieClip Frame 10
gotoAndPlay ("BrownFish");
Symbol 29 MovieClip Frame 12
gotoAndPlay ("BrownFish");
Symbol 29 MovieClip Frame 24
gotoAndPlay ("GreenFish");
Symbol 29 MovieClip Frame 26
gotoAndPlay ("GreenFish");
Symbol 29 MovieClip Frame 39
gotoAndPlay ("RedFish");
Symbol 29 MovieClip Frame 41
gotoAndPlay ("RedFish");
Symbol 42 MovieClip Frame 40
stop();
_root.gotoAndPlay("MainMenu");
Symbol 54 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 5
stop();
Symbol 54 MovieClip Frame 10
stop();
Symbol 73 MovieClip Frame 1
stop();
Symbol 73 MovieClip Frame 30
gotoAndPlay ("Hungry");
Symbol 124 MovieClip Frame 14
gotoAndPlay ("swim");
Symbol 124 MovieClip Frame 16
gotoAndPlay ("swim");
Symbol 124 MovieClip Frame 20
gotoAndPlay ("swim");