Frame 1
gameLoaded = 0;
stop();
Frame 2
function creatureActions() {
creaturesFighting = false;
creaturesBuilding = false;
var myLoop = 0;
while (myLoop < counter_Egg) {
if (creaturesEgg[myLoop] != -1) {
doEggActions(creaturesEgg[myLoop]);
}
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Baby) {
if (creaturesBaby[myLoop] != -1) {
if (!creaturesBaby[myLoop].onboat) {
doBabyActions(creaturesBaby[myLoop]);
}
if (draggingID == creaturesBaby[myLoop].mclip.id) {
showInfo(creaturesBaby[myLoop]);
}
}
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Adult) {
if (creaturesAdult[myLoop] != -1) {
if (!creaturesAdult[myLoop].onboat) {
doAdultActions(creaturesAdult[myLoop]);
}
if (draggingID == creaturesAdult[myLoop].mclip.id) {
showInfo(creaturesAdult[myLoop]);
}
}
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Warrior) {
if (creaturesWarrior[myLoop] != -1) {
doWarriorActions(creaturesWarrior[myLoop]);
if (draggingID == creaturesWarrior[myLoop].mclip.id) {
showInfo(creaturesWarrior[myLoop]);
}
}
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Predator) {
if (creaturesPredator[myLoop] != -1) {
doPredatorActions(creaturesPredator[myLoop]);
}
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Dead) {
if (creaturesDead[myLoop] != -1) {
doDeadActions(creaturesDead[myLoop]);
}
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Food) {
if (foodArray[myLoop] != -1) {
doFoodActions(foodArray[myLoop]);
}
myLoop++;
}
if (creaturesFighting) {
playSound("fighting");
} else {
stopSound("fighting");
}
if (creaturesBuilding) {
playSound("building");
} else {
stopSound("building");
}
}
function gameRoutine() {
levelTimer++;
if (((currentLevel == 1) && (helpState == 0)) && (150 < levelTimer)) {
helpState = 1;
helpClip.gotoAndStop(2);
}
if (thisLevel.createHome) {
homeFoodCounter = homeFoodCounter + thisLevel.foodTimerSpeed;
if (homeFoodCounter >= homeFoodCounterReady) {
createFoodBowl((baseArray[0].x + 15) - random(30), (baseArray[0].y + 15) - random(30));
homeFoodCounter = 0;
}
}
if (creatingDrop != -1) {
var _local1 = 2;
switch (creatingDrop) {
case _local1 :
dropCounter++;
if (dropCounterReadyBaby < dropCounter) {
setDropReady(2);
} else {
dropReadyPercent = Math.floor((dropCounter * 100) / dropCounterReadyBaby);
}
break;
case 4 :
dropCounter++;
if (dropCounterReadyWarrior < dropCounter) {
setDropReady(4);
} else {
dropReadyPercent = Math.floor((dropCounter * 100) / dropCounterReadyWarrior);
}
break;
case 7 :
dropCounter = dropCounter + thisLevel.foodTimerSpeed;
if (dropCounterReadyFood < dropCounter) {
setDropReady(7);
} else {
dropReadyPercent = Math.floor((dropCounter * 100) / dropCounterReadyFood);
}
}
}
if (thisLevel.levelDisasters) {
processDisaster();
}
if ((predatorMadeCount < thisLevel.levelPredatorCount) && (thisLevel.levelMultiPredators || (counter_Predator == 0))) {
createPredators();
}
}
function processDisaster() {
disasterCounter++;
var _local1 = 0;
switch (disasterActive) {
case _local1 :
if (disasterCounterWarn < disasterCounter) {
setDisasterWarning();
}
return;
case 1 :
if (disasterCounterActivate < disasterCounter) {
setDisasterOn();
}
return;
case 2 :
if (disasterCounterDeactivate >= disasterCounter) {
break;
}
setDisasterOff();
}
}
function createPredators() {
predatorMakeCounter++;
if (predatorMakeCounterReady < predatorMakeCounter) {
playSound("predator");
createCreature(550, 20, 5);
predatorMakeCounter = 0;
predatorMadeCount++;
}
}
function takeEgg(eggID) {
playSound("eggcollect");
creaturesEgg[eggID].mclip.removeMovieClip();
delete creaturesEgg[eggID];
creaturesEgg[eggID] = -1;
myMoney = myMoney + moneyFromEgg;
arraysNeedRebuilding = true;
resetDropIcons();
}
function doEggActions(creatureObj) {
if (creatureObj.mclip.id == draggingID) {
stopMyDrag();
}
checkDisaster(creatureObj);
updateAgeAndFood(creatureObj);
}
function doBabyActions(creatureObj) {
checkDisaster(creatureObj);
updateAgeAndFood(creatureObj);
if (creatureObj.ctype == 2) {
if (creatureObj.mclip.id == draggingID) {
dragMe(creatureObj);
checkHealing(creatureObj);
} else {
if ((0 < counter_Predator) && (thisLevel.createHome)) {
setMyState(creatureObj, 2);
} else {
if (creatureObj.state == 2) {
setMyState(creatureObj, 1);
}
checkHealing(creatureObj);
if ((creatureObj.foodlevel < hungryLevel) && (creatureObj.state != 4)) {
setMyState(creatureObj, 7);
} else {
checkBuilding(creatureObj);
if (boatActive) {
checkOnBoard(creatureObj);
}
}
}
if (!creatureObj.onboat) {
var _local1 = 1;
switch (creatureObj.state) {
case _local1 :
doMoveRandomly(creatureObj);
break;
case 2 :
if (!checkNearby(creatureObj, baseArray[0], baseProxHome)) {
turnTo(creatureObj, baseArray[0]);
moveMe(creatureObj);
}
break;
case 7 :
doFoodHunting(creatureObj, true);
}
}
}
if (creatureObj.state == 4) {
doHealing(creatureObj);
}
if (creatureObj.state == 6) {
doBuilding(creatureObj);
}
}
}
function doAdultActions(creatureObj) {
checkDisaster(creatureObj);
updateAgeAndFood(creatureObj);
if (creatureObj.ctype == 3) {
if (creatureObj.mclip.id == draggingID) {
dragMe(creatureObj);
checkHealing(creatureObj);
} else {
checkHealing(creatureObj);
if ((creatureObj.foodlevel < hungryLevel) && (creatureObj.state != 4)) {
setMyState(creatureObj, 7);
} else {
checkTraining(creatureObj);
if (boatActive) {
checkOnBoard(creatureObj);
}
}
if (!creatureObj.onboat) {
var _local1 = 1;
switch (creatureObj.state) {
case _local1 :
var myNearestPredator = findNearest(creatureObj, 5, creatureProxSee[3], false);
if (myNearestPredator != -1) {
doMoveAndAttack(creatureObj, myNearestPredator, false);
} else {
doMoveRandomly(creatureObj);
}
if ((((ageGiveBirth < creatureObj.birthcounter) && (creatureObj.age < ageAdultsGetOld)) && ((counter_Total + counter_Egg) < populationCap)) && (random(150) == 1)) {
playSound("layegg");
createCreature(creatureObj.x, creatureObj.y, 1);
creatureObj.birthcounter = 0;
}
break;
case 7 :
doFoodHunting(creatureObj, false);
if (creatureObj.state != 1) {
break;
}
var myNearestPredator = findNearest(creatureObj, 5, creatureProxSee[3], false);
if (myNearestPredator != -1) {
doMoveAndAttack(creatureObj, myNearestPredator, false);
} else {
doMoveRandomly(creatureObj);
}
}
}
}
if (creatureObj.state == 3) {
doFighting(creatureObj);
}
if (creatureObj.state == 4) {
doHealing(creatureObj);
}
if (creatureObj.state == 5) {
doTraining(creatureObj);
}
}
}
function doWarriorActions(creatureObj) {
checkDisaster(creatureObj);
updateAgeAndFood(creatureObj);
if (creatureObj.ctype == 4) {
if (creatureObj.mclip.id == draggingID) {
dragMe(creatureObj);
checkHealing(creatureObj);
} else {
var _local1 = 1;
switch (creatureObj.state) {
case _local1 :
var myNearestPredator = findNearest(creatureObj, 5, creatureProxSee[4] * 2, false);
if (myNearestPredator != -1) {
doMoveAndAttack(creatureObj, myNearestPredator, false);
} else {
checkHealing(creatureObj);
if ((creatureObj.foodlevel < hungryLevel) && (creatureObj.state != 4)) {
setMyState(creatureObj, 7);
}
if (creatureObj.state == 1) {
if ((((!checkNearby(creatureObj, baseArray[0], baseProxHome * 2)) && (!checkNearby(creatureObj, baseArray[1], baseProxTrain * 2))) && (!checkNearby(creatureObj, baseArray[2], baseProxHeal * 2))) && (!checkNearby(creatureObj, baseArray[3], baseProxBoat * 2))) {
var myNearestAdult = findNearest(creatureObj, 3, creatureProxSee[4], false);
if (myNearestAdult != -1) {
doMoveAndAttack(creatureObj, myNearestAdult, false);
} else {
doMoveRandomly(creatureObj);
}
} else {
doMoveRandomly(creatureObj);
}
}
}
break;
case 7 :
var myNearestPredator = findNearest(creatureObj, 5, creatureProxSee[4] * 2, false);
if (myNearestPredator != -1) {
doMoveAndAttack(creatureObj, myNearestPredator, false);
} else {
checkHealing(creatureObj);
if (creatureObj.state != 7) {
break;
}
doFoodHunting(creatureObj, true);
}
}
}
if (creatureObj.state == 3) {
doFighting(creatureObj);
}
if (creatureObj.state == 4) {
doHealing(creatureObj);
}
}
}
function doPredatorActions(creatureObj) {
if (creatureObj.mclip.id == draggingID) {
stopMyDrag();
}
checkDisaster(creatureObj);
if (creatureObj.ctype == 5) {
var _local1 = 1;
switch (creatureObj.state) {
case _local1 :
var myNearestBaby = findNearest(creatureObj, 2, -1, false);
if (myNearestBaby != -1) {
doMoveAndAttack(creatureObj, myNearestBaby, true);
} else {
var myNearestAdult = findNearest(creatureObj, 3, creatureProxAttack[5], false);
if (myNearestAdult != -1) {
attackCreature(creatureObj, myNearestAdult);
} else {
doMoveRandomly(creatureObj);
}
}
break;
case 3 :
doFighting(creatureObj);
}
if (creatureObj.health < 0) {
creatureDie(creatureObj);
}
}
}
function doDeadActions(creatureObj) {
if (creatureObj.mclip.id == draggingID) {
stopMyDrag();
}
creatureObj.age++;
if (ageRemoveDead < creatureObj.age) {
removeCreature(creatureObj);
}
}
function doFoodActions(creatureObj) {
if (creatureObj.mclip.id == draggingID) {
dragMe(creatureObj);
}
creatureObj.age++;
if ((ageRemoveFood < creatureObj.age) || (creatureObj.foodlevel < 0)) {
removeCreature(creatureObj);
}
}
function doMoveRandomly(myObj) {
myObj.targetx = -1;
myObj.targety = -1;
if (random(4) == 1) {
myObj.direction = fixDegrees((myObj.direction + 45) - random(90));
}
moveMe(myObj);
}
function doMoveAndAttack(myObj, attackObj, oneHitKill) {
var myType = myObj.ctype;
if (checkNearby(myObj, attackObj, creatureProxAttack[myType])) {
if (oneHitKill) {
removeCreature(attackObj);
playSound("caught");
} else {
attackCreature(myObj, attackObj);
}
} else {
turnTo(myObj, attackObj);
moveMe(myObj);
}
}
function doFoodHunting(myObj, wanderRandomly) {
var myType = myObj.ctype;
var myNearestFood = findNearest(myObj, 7, -1, false);
if (myNearestFood == -1) {
setMyState(myObj, 1);
if (wanderRandomly) {
doMoveRandomly(myObj);
}
} else if (checkNearby(myObj, myNearestFood, creatureProxAttack[myType])) {
myNearestFood.foodlevel = myNearestFood.foodlevel - foodEatPerFrame;
myObj.foodlevel = myObj.foodlevel + foodEatPerFrame;
if (myObj.foodlevel >= maxFoodLevel) {
myObj.foodlevel = maxFoodLevel;
setMyState(myObj, 1);
}
} else {
turnTo(myObj, myNearestFood);
moveMe(myObj);
}
}
function doHealing(myObj) {
var myType = myObj.ctype;
if (((myType != 3) || (myObj.age < ageAdultsGetOld)) && (checkNearby(myObj, baseArray[2], baseProxHeal))) {
myObj.timetoheal--;
if (myObj.health < creatureMaxHealth[myType]) {
myObj.health = myObj.health + 10;
if (creatureMaxHealth[myType] < myObj.health) {
myObj.health = creatureMaxHealth[myType];
}
}
if (myObj.timetoheal < 0) {
myObj.sickstate = false;
myObj.sicknesscounter = 0;
setMyState(myObj, 1);
if (myObj.foodlevel < startFoodLevel) {
myObj.foodlevel = startFoodLevel;
}
playSound("healingdone");
}
} else {
setMyState(myObj, 1);
}
}
function doBuilding(myObj) {
var myType = myObj.ctype;
if (boatActive || (myObj.sickstate)) {
setMyState(myObj, 1);
} else if (checkNearby(myObj, baseArray[3], baseProxBoat)) {
boatMadeCounter++;
creaturesBuilding = true;
checkBoatBuilt();
} else {
setMyState(myObj, 1);
}
}
function doTraining(myObj) {
var myType = myObj.ctype;
if (((myType != 3) || (myObj.age < ageAdultsGetOld)) && (checkNearby(myObj, baseArray[1], baseProxTrain))) {
myObj.timetotrain--;
if (myObj.timetotrain < 0) {
updateCreatureType(myObj, 4);
playSound("trainingdone");
}
} else {
setMyState(myObj, 1);
}
}
function doFighting(myObj) {
var myType = myObj.ctype;
var myTarget = myObj.fighttarget;
if (myTarget == -1) {
setMyState(myObj, 1);
myObj.fighttarget = -1;
} else if (checkNearby(myObj, myTarget, creatureProxAttack[myType])) {
myTarget.health = myTarget.health - creatureAttackPower[myType];
creaturesFighting = true;
} else {
setMyState(myObj, 1);
myObj.fighttarget = -1;
}
}
function checkHealing(myObj) {
var myType = myObj.ctype;
if (thisLevel.createMedic && ((myType != 3) || (myObj.age < ageAdultsGetOld))) {
if ((((myObj.health < (creatureMaxHealth[myType] * 0.8)) || (myObj.sickstate)) && (counterHealing < baseMaxHealing)) && (myObj.state != 4)) {
if (checkNearby(myObj, baseArray[2], baseProxHeal)) {
setMyState(myObj, 4);
myObj.timetoheal = Math.floor((creatureMaxHealth[myType] - myObj.health) / 10);
if (myObj.sickstate) {
myObj.timetoheal = myObj.timetoheal + timeToHealIllness;
}
myObj.timermax = myObj.timetoheal;
}
}
}
}
function checkTraining(myObj) {
var myType = myObj.ctype;
if ((thisLevel.createTraining && (myType == 3)) && (myObj.age < ageAdultsGetOld)) {
if ((((counterTraining < baseMaxTraining) && (!myObj.sickstate)) && (ageCanTrain < myObj.age)) && (myObj.state != 5)) {
if (checkNearby(myObj, baseArray[1], baseProxTrain)) {
setMyState(myObj, 5);
myObj.timetotrain = timetotrain;
myObj.timermax = myObj.timetotrain;
}
}
}
}
function checkBuilding(myObj) {
var myType = myObj.ctype;
if (thisLevel.createBoat) {
if ((((((myObj.state == 1) && (counterBuilding < baseMaxBuilding)) && (!boatActive)) && (!myObj.sickstate)) && (ageCanBuild < myObj.age)) && ((creatureMaxHealth[myType] * 0.75) < myObj.health)) {
if (checkNearby(myObj, baseArray[3], baseProxBoat)) {
setMyState(myObj, 6);
}
}
}
}
function checkOnBoard(myObj) {
var myType = myObj.ctype;
if (boatActive && (!myObj.sickstate)) {
if (((myType == 2) && (boatOnBoardKids < boatOnBoardKidsNeeded)) || ((myType == 3) && (boatOnBoardAdults < boatOnBoardAdultsNeeded))) {
if (checkNearby(myObj, baseArray[3], baseProxBoat)) {
putCreatureOnBoat(myObj);
}
}
}
}
function updateAgeAndFood(myObj) {
var myType = myObj.ctype;
if (myType != 6) {
if ((myType == 3) && (ageAdultsGetOld < myObj.age)) {
myObj.health = myObj.health - healthSubtractOld;
myObj.speed = creatureSpeeds[3] * 0.75;
}
if (((myObj.state != 4) && (myObj.state != 5)) && (1 < myType)) {
if (0 < myObj.foodlevel) {
myObj.foodlevel--;
}
if (myObj.sickstate && (myObj.state != 4)) {
myObj.sicknesscounter++;
myObj.health = myObj.health - healthSubtractSick;
if (sicknessContagiousLevel < myObj.sicknesscounter) {
var passOnSickness = findNearest(myObj, myType, contagiousProx, true);
if (passOnSickness != -1) {
myObj.sicknesscounter = 0;
passOnSickness.sickstate = true;
}
}
} else if ((thisLevel.levelSickness && (random(sicknessChance) == 1)) && (ageCanGetSick < myObj.age)) {
playSound("sickness");
myObj.sickstate = true;
}
if (myObj.foodlevel < veryHungryLevel) {
myObj.health = myObj.health - healthSubtractVeryHungry;
} else if (myObj.foodlevel < hungryLevel) {
myObj.health = myObj.health - healthSubtractHungry;
}
}
if (myType == 2) {
if (babyGrowHungerLevel < myObj.foodlevel) {
myObj.age = myObj.age + babyGrowNotHungry;
} else {
myObj.age = myObj.age + babyGrowNotHungry;
}
} else {
myObj.age++;
}
if (myType == 3) {
myObj.birthcounter++;
}
if (((myType == 2) && (ageGrowToAdult < myObj.age)) && (random(100) == 1)) {
playSound("growup");
updateCreatureType(myObj, 3);
}
if (((myType == 1) && (ageGrowToBaby < myObj.age)) && (random(100) == 1)) {
playSound("growup");
updateCreatureType(myObj, 2);
}
if (myObj.health < 0) {
creatureDie(myObj);
}
}
}
function checkDisaster(myObj) {
if ((disasterActive == 2) && (myObj.mclip.id != draggingID)) {
if (((disasterArea - (disasterWidth / 2)) < myObj.x) && (myObj.x < (disasterArea + (disasterWidth / 2)))) {
creatureDie(myObj);
}
}
}
function putCreatureOnBoat(myObj) {
var arrayPos = myObj.mclip.arrayID;
if (draggingID == myObj.mclip.id) {
stopMyDrag();
}
removeAttackers(myObj);
setMyState(myObj, 1);
var myType = myObj.ctype;
var myNewX = 0;
var myNewY = 0;
var _local1 = 2;
switch (myType) {
case _local1 :
_local1 = 0;
switch (boatOnBoardKids) {
case _local1 :
myNewX = -19;
myNewY = -8;
break;
case 1 :
myNewX = -19;
myNewY = 0;
break;
case 2 :
myNewX = -19;
myNewY = 8;
break;
case 3 :
myNewX = -13;
myNewY = -4;
break;
case 4 :
myNewX = -13;
myNewY = 4;
}
boatOnBoardKids++;
creaturesBaby[arrayPos] = -1;
break;
case 3 :
_local1 = 0;
switch (boatOnBoardAdults) {
case _local1 :
myNewX = 8;
myNewY = -10;
break;
case 1 :
myNewX = 8;
myNewY = 0;
break;
case 2 :
myNewX = 8;
myNewY = 10;
break;
case 3 :
myNewX = 16;
myNewY = -5;
break;
case 4 :
myNewX = 16;
myNewY = 5;
}
boatOnBoardAdults++;
creaturesAdult[arrayPos] = -1;
}
myObj.x = baseArray[3].x + myNewX;
myObj.y = baseArray[3].y + myNewY;
myObj.onboat = true;
myObj.direction = 270;
myObj.mclip._xscale = 60;
myObj.mclip._yscale = 60;
myObj.mclip.swapDepths(60 + myObj.mclip.id);
creaturesOnBoat[counter_OnBoat] = myObj;
myObj.mclip.arrayID = counter_OnBoat;
counter_OnBoat++;
arraysNeedRebuilding = true;
}
function createCreature(x, y, ctype) {
if (ctype == 1) {
_root.attachMovie("creature", "creature" + counter_Layer, 1000 + counter_Layer);
} else {
_root.attachMovie("creature", "creature" + counter_Layer, 5000 + counter_Layer);
}
_root["creature" + counter_Layer].gotoAndStop(ctype);
_root["creature" + counter_Layer].id = counter_Layer;
var mySpeed = creatureSpeeds[ctype];
var myHealth = creatureMaxHealth[ctype];
var myCreature = new Creature(x, y, myHealth, (startFoodLevel + 100) - random(50), mySpeed, ctype, _root["creature" + counter_Layer]);
counter_Layer++;
var _local1 = 1;
switch (ctype) {
case _local1 :
creaturesEgg[counter_Egg] = myCreature;
myCreature.mclip.arrayID = counter_Egg;
counter_Egg++;
break;
case 2 :
creaturesBaby[counter_Baby] = myCreature;
myCreature.mclip.arrayID = counter_Baby;
counter_Baby++;
counter_Total++;
break;
case 3 :
creaturesAdult[counter_Adult] = myCreature;
myCreature.mclip.arrayID = counter_Adult;
counter_Adult++;
counter_Total++;
break;
case 4 :
creaturesWarrior[counter_Warrior] = myCreature;
myCreature.mclip.arrayID = counter_Warrior;
counter_Warrior++;
counter_Total++;
break;
case 5 :
creaturesPredator[counter_Predator] = myCreature;
myCreature.mclip.arrayID = counter_Predator;
counter_Predator++;
break;
case 6 :
creaturesDead[counter_Dead] = myCreature;
myCreature.mclip.arrayID = counter_Dead;
counter_Dead++;
}
return(myCreature);
}
function createFoodBowl(x, y) {
_root.attachMovie("foodbowl", "food" + counter_Layer, 100 + counter_Layer);
_root["food" + counter_Layer].id = counter_Layer;
var myFood = new FoodBowl(x, y, _root["food" + counter_Layer]);
counter_Layer++;
foodArray[counter_Food] = myFood;
myFood.mclip.arrayID = counter_Food;
counter_Food++;
return(myFood);
}
function createBases() {
if (thisLevel.createHome) {
_root.attachMovie("base", "base_home", 50);
_root.base_home.gotoAndStop(1);
var myBase = new CreatureBase(50, 350, _root.base_home);
baseArray[0] = myBase;
} else {
baseArray[0] = -1;
}
if (thisLevel.createTraining) {
_root.attachMovie("base", "base_training", 51);
_root.base_training.gotoAndStop(2);
var myBase = new CreatureBase(50, 70, _root.base_training);
baseArray[1] = myBase;
} else {
baseArray[1] = -1;
}
if (thisLevel.createMedic) {
_root.attachMovie("base", "base_medic", 52);
_root.base_medic.gotoAndStop(3);
var myBase = new CreatureBase(70, 210, _root.base_medic);
baseArray[2] = myBase;
} else {
baseArray[2] = -1;
}
if (thisLevel.createBoat) {
_root.attachMovie("base", "base_boat", 53);
_root.base_boat.gotoAndStop(4);
var myBase = new CreatureBase(175, 325, _root.base_boat);
baseArray[3] = myBase;
} else {
baseArray[3] = -1;
}
}
function Creature(x, y, health, foodlevel, speed, ctype, mclip) {
this.x = x;
this.y = y;
this.direction = 0;
this.state = 1;
this.health = health;
this.foodlevel = foodlevel;
this.birthcounter = 0;
this.sickstate = false;
this.sicknesscounter = 0;
this.fighttarget = -1;
this.age = 0;
this.timetoheal = 0;
this.timetotrain = 0;
this.timermax = 0;
this.speed = speed;
this.ctype = ctype;
this.mclip.ctype = ctype;
this.onboat = false;
this.mclip = mclip;
this.showingState = 0;
this.targetx = -1;
this.targety = -1;
mclip._x = x;
mclip._y = y;
}
function FoodBowl(x, y, mclip) {
this.x = x;
this.y = y;
this.foodlevel = foodBowlAmount;
this.mclip = mclip;
this.mclip.ctype = 7;
this.ctype = 7;
this.age = 0;
this.onboat = false;
mclip._x = x;
mclip._y = y;
}
function CreatureBase(x, y, mclip) {
this.x = x;
this.y = y;
this.mclip = mclip;
mclip._x = x;
mclip._y = y;
}
function cleanUp(removeGameScreens, killAllSound) {
var myLoop = 0;
while (myLoop < counter_Egg) {
creaturesEgg[myLoop].mclip.removeMovieClip();
delete creaturesEgg[myLoop];
creaturesEgg[myLoop] = -1;
myLoop++;
}
counter_Egg = 0;
var myLoop = 0;
while (myLoop < counter_Baby) {
creaturesBaby[myLoop].mclip.removeMovieClip();
delete creaturesBaby[myLoop];
creaturesBaby[myLoop] = -1;
myLoop++;
}
counter_Baby = 0;
var myLoop = 0;
while (myLoop < counter_Adult) {
creaturesAdult[myLoop].mclip.removeMovieClip();
delete creaturesAdult[myLoop];
creaturesAdult[myLoop] = -1;
myLoop++;
}
counter_Adult = 0;
var myLoop = 0;
while (myLoop < counter_Warrior) {
creaturesWarrior[myLoop].mclip.removeMovieClip();
delete creaturesWarrior[myLoop];
creaturesWarrior[myLoop] = -1;
myLoop++;
}
counter_Warrior = 0;
var myLoop = 0;
while (myLoop < counter_Predator) {
creaturesPredator[myLoop].mclip.removeMovieClip();
delete creaturesPredator[myLoop];
creaturesPredator[myLoop] = -1;
myLoop++;
}
counter_Predator = 0;
var myLoop = 0;
while (myLoop < counter_Dead) {
creaturesDead[myLoop].mclip.removeMovieClip();
delete creaturesDead[myLoop];
creaturesDead[myLoop] = -1;
myLoop++;
}
counter_Dead = 0;
var myLoop = 0;
while (myLoop < counter_Food) {
foodArray[myLoop].mclip.removeMovieClip();
delete foodArray[myLoop];
foodArray[myLoop] = -1;
myLoop++;
}
counter_Food = 0;
var myLoop = 0;
while (myLoop < counter_OnBoat) {
creaturesOnBoat[myLoop].mclip.removeMovieClip();
delete creaturesOnBoat[myLoop];
creaturesOnBoat[myLoop] = -1;
myLoop++;
}
counter_OnBoat = 0;
counter_Layer = 0;
counter_Total = 0;
var myLoop = 0;
while (myLoop < 4) {
if (baseArray[myLoop] != -1) {
baseArray[myLoop].mclip.removeMovieClip();
delete baseArray[myLoop];
}
myLoop++;
}
if (removeGameScreens) {
gamescreens.removeMovieClip();
helpclip.removeMovieClip();
} else {
gameScreens.gotoAndStop("clear");
helpclip.gotoAndStop(1);
}
if (playingFightSounds) {
stopSound("fighting");
}
if (playingBuildSounds) {
stopSound("building");
}
if (killAllSound) {
stopSounds();
globalSounds.setVolume(gameMaxVolume);
soundFade = 0;
} else {
soundFade = 2;
}
}
function removeCreature(myObj) {
var arrayPos = myObj.mclip.arrayID;
var myType = myObj.ctype;
myObj.mclip.removeMovieClip();
var _local1 = 1;
switch (myType) {
case _local1 :
delete creaturesEgg[arrayPos];
creaturesEgg[arrayPos] = -1;
break;
case 2 :
delete creaturesBaby[arrayPos];
creaturesBaby[arrayPos] = -1;
counter_Total--;
break;
case 3 :
delete creaturesAdult[arrayPos];
creaturesAdult[arrayPos] = -1;
counter_Total--;
break;
case 4 :
delete creaturesWarrior[arrayPos];
creaturesWarrior[arrayPos] = -1;
counter_Total--;
break;
case 5 :
delete creaturesPredator[arrayPos];
creaturesPredator[arrayPos] = -1;
break;
case 6 :
delete creaturesDead[arrayPos];
creaturesDead[arrayPos] = -1;
break;
case 7 :
delete foodArray[arrayPos];
foodArray[arrayPos] = -1;
}
arraysNeedRebuilding = true;
}
function editableGameVars() {
baseMaxTraining = 5;
baseMaxHealing = 5;
baseMaxBuilding = 5;
baseProxHome = 35;
baseProxHeal = 35;
baseProxTrain = 35;
baseProxBoat = 45;
ageGrowToBaby = 200;
ageGrowToAdult = 1250;
ageRemoveDead = 25;
ageGiveBirth = 1000;
ageCanTrain = 100;
ageCanBuild = 100;
ageCanGetSick = 100;
ageRemoveFood = 1000;
ageAdultsGetOld = 3200;
sicknessContagiousLevel = 400;
gameLastLevel = 10;
sicknessChance = 5000;
contagiousProx = 30;
moneyFromEgg = 100;
populationCap = 9999;
foodBowlAmount = 2000;
foodEatPerFrame = 20;
startFoodLevel = 1000;
maxFoodLevel = 1500;
hungryLevel = 500;
veryHungryLevel = 50;
healthSubtractHungry = 1;
healthSubtractVeryHungry = 3;
healthSubtractSick = 2;
healthSubtractOld = 2;
timeToHealIllness = 100;
timeToTrain = 250;
babyGrowHungry = 2;
babyGrowNotHungry = 3;
babyGrowHungerLevel = 500;
dropCounterReadyFood = 100;
dropCounterReadyBaby = 150;
dropCounterReadyWarrior = 200;
dropFoodPrice = 100;
dropBabyPrice = 150;
dropWarriorPrice = 400;
homeFoodCounterReady = 1500;
boatBuiltReady = new Array();
boatBuiltReady[0] = 500;
boatBuiltReady[1] = 1200;
boatBuiltReady[2] = 2000;
boatBuiltReady[3] = 3000;
boatMaxState = 3;
boatOnBoardKidsNeeded = 5;
boatOnBoardAdultsNeeded = 5;
disasterCounterWarn = 1900;
disasterCounterActivate = 2000;
disasterCounterDeactivate = 150;
}
function initGameVars() {
buildLookupTables();
creaturesEgg = new Array();
creaturesBaby = new Array();
creaturesAdult = new Array();
creaturesWarrior = new Array();
creaturesPredator = new Array();
creaturesDead = new Array();
foodArray = new Array();
baseArray = new Array();
creaturesOnBoat = new Array();
counter_Egg = 0;
counter_Baby = 0;
counter_Adult = 0;
counter_Warrior = 0;
counter_Predator = 0;
counter_Dead = 0;
counter_Food = 0;
counter_OnBoat = 0;
counter_Total = 0;
counter_Layer = 0;
screenLeft = 15;
screenRight = 465;
screenTop = 30;
screenBottom = 380;
disasterWidth = 70;
disasterArea = 370;
counterTraining = 0;
counterHealing = 0;
counterBuilding = 0;
creatureProxSee = new Array();
creatureProxAttack = new Array();
creatureSpeeds = new Array();
creatureMaxHealth = new Array();
creatureAttackPower = new Array();
creatureProxSee[1] = 0;
creatureProxAttack[1] = 0;
creatureAttackPower[1] = 0;
creatureSpeeds[1] = 0;
creatureMaxHealth[1] = 1;
creatureProxSee[2] = 25;
creatureProxAttack[2] = 10;
creatureAttackPower[2] = 0;
creatureSpeeds[2] = 0.5;
creatureMaxHealth[2] = 1000;
creatureProxSee[3] = 35;
creatureProxAttack[3] = 15;
creatureAttackPower[3] = 5;
creatureSpeeds[3] = 0.75;
creatureMaxHealth[3] = 2000;
creatureProxSee[4] = 45;
creatureProxAttack[4] = 15;
creatureAttackPower[4] = 10;
creatureSpeeds[4] = 1;
creatureMaxHealth[4] = 4000;
creatureProxSee[6] = 0;
creatureProxAttack[6] = 0;
creatureAttackPower[6] = 0;
creatureSpeeds[6] = 0;
creatureMaxHealth[6] = 1;
editableGameVars();
levelPassword = "";
creaturesFighting = false;
creaturesBuilding = false;
gameState = 0;
currentLevel = 1;
thisLevel = new Object();
frameRate = 0;
lastFrameTime = getTimer();
justCompletedLevel = false;
waitForCompleted = 40;
dropFoodPriceTxt = "FOOD " + dropFoodPrice;
dropBabyPriceTxt = "INFANT " + dropBabyPrice;
dropWarriorPriceTxt = "DEFENDER " + dropWarriorPrice;
}
function checkBoatBuilt() {
if (!boatActive) {
var newState = 0;
var myLoop = boatCurrentState;
while (boatMaxState >= myLoop) {
if (boatMadeCounter >= boatBuiltReady[myLoop]) {
newState = myLoop;
}
myLoop++;
}
if (boatCurrentState < newState) {
baseArray[3].mclip.base.gotoAndStop(newState + 2);
boatCurrentState = newState;
if (boatCurrentState >= boatMaxState) {
boatActive = true;
playSound("boatmade");
}
}
}
}
function setMyState(myObj, myNewState) {
if (myObj.state == 4) {
counterHealing--;
}
if (myObj.state == 5) {
counterTraining--;
}
if (myObj.state == 6) {
counterBuilding--;
}
if (myNewState == 4) {
counterHealing++;
}
if (myNewState == 5) {
counterTraining++;
}
if (myNewState == 6) {
counterBuilding++;
}
myObj.state = myNewState;
}
function findNearest(myObject, lookingFor, proximity, onlyHealthy) {
var nearestDistance = proximity;
var nearestID = -1;
var _local1 = 1;
switch (lookingFor) {
case _local1 :
var lookingArray = creaturesEgg;
var lookingArraySize = counter_Egg;
break;
case 2 :
var lookingArray = creaturesBaby;
var lookingArraySize = counter_Baby;
break;
case 3 :
var lookingArray = creaturesAdult;
var lookingArraySize = counter_Adult;
break;
case 4 :
var lookingArray = creaturesWarrior;
var lookingArraySize = counter_Warrior;
break;
case 5 :
var lookingArray = creaturesPredator;
var lookingArraySize = counter_Predator;
break;
case 6 :
var lookingArray = creaturesDead;
var lookingArraySize = counter_Dead;
break;
case 7 :
var lookingArray = foodArray;
var lookingArraySize = counter_Food;
}
_local1 = 0;
switch (lookingArraySize) {
case _local1 :
case 1 :
var testObject = lookingArray[0];
if ((((testObject != -1) && (!testObject.onboat)) && (testObject.mclip.id != draggingID)) && ((!onlyHealthy) || (!testObject.sickstate))) {
if (nearestDistance == -1) {
nearestID = testObject;
} else if (checkNearby(testObject, myObject, nearestDistance)) {
nearestID = testObject;
}
}
break;
default :
var myLoop = 0;
for(;;){
if (myLoop >= lookingArraySize) {
break;
}
var testObject = lookingArray[myLoop];
if ((((testObject != -1) && (!testObject.onboat)) && (testObject.mclip.id != draggingID)) && ((!onlyHealthy) || (!testObject.sickstate))) {
if (nearestDistance == -1) {
nearestDistance = getDistance(testObject, myObject);
nearestID = testObject;
} else if (checkNearby(testObject, myObject, nearestDistance)) {
nearestDistance = getDistance(testObject, myObject);
nearestID = testObject;
}
}
myLoop++;
};
}
return(nearestID);
}
function turnTo(myObj, lookatObj) {
if ((myObj.targetx != lookatObj.x) || (myObj.targety != lookatObj.y)) {
myObj.direction = findAngle(myObj, lookatObj);
myObj.targetx = lookatObj.x;
myObj.targety = lookatObj.y;
}
}
function attackCreature(objAttacker, objAttackee) {
if (objAttacker != objAttackee) {
setMyState(objAttacker, 3);
setMyState(objAttackee, 3);
objAttacker.fighttarget = objAttackee;
objAttackee.fighttarget = objAttacker;
}
}
function removeAttackers(removingObj) {
var myLoop = 0;
while (myLoop < counter_Adult) {
if (creaturesAdult[myLoop] != -1) {
if (removingObj == creaturesAdult[myLoop].fighttarget) {
creaturesAdult[myLoop].fighttarget = -1;
}
}
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Warrior) {
if (creaturesWarrior[myLoop] != -1) {
if (removingObj == creaturesWarrior[myLoop].fighttarget) {
creaturesWarrior[myLoop].fighttarget = -1;
}
}
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Predator) {
if (creaturesPredator[myLoop] != -1) {
if (removingObj == creaturesPredator[myLoop].fighttarget) {
creaturesPredator[myLoop].fighttarget = -1;
}
}
myLoop++;
}
}
function checkNearby(obj1, obj2, checkDistance) {
if ((obj1 == -1) || (obj2 == -1)) {
return(false);
}
var deltaX = (obj2.x - obj1.x);
var deltaY = (obj2.y - obj1.y);
if ((checkDistance < Math.abs(deltaX)) || (checkDistance < Math.abs(deltaY))) {
return(false);
}
if ((checkDistance * checkDistance) < ((deltaX * deltaX) + (deltaY * deltaY))) {
return(false);
}
return(true);
}
function getDistance(obj1, obj2) {
var deltaX = (obj2.x - obj1.x);
var deltaY = (obj2.y - obj1.y);
return(Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)));
}
function findAngle(myObject, seekObject) {
var deltaX = (seekObject.x - myObject.x);
var deltaY = (myObject.y - seekObject.y);
return(fixDegrees(degrees(Math.atan2(deltaX, deltaY))));
}
function updateCreatureType(creatureObj, convertTo) {
var arrayPos = creatureObj.mclip.arrayID;
if (draggingID == creatureObj.mclip.id) {
stopMyDrag();
}
removeAttackers(creatureObj);
setMyState(creatureObj, 1);
var _local1 = 1;
switch (creatureObj.ctype) {
case _local1 :
creaturesEgg[arrayPos] = -1;
creatureObj.mclip.swapDepths(5000 + creatureObj.mclip.id);
break;
case 2 :
creaturesBaby[arrayPos] = -1;
counter_Total--;
break;
case 3 :
creaturesAdult[arrayPos] = -1;
counter_Total--;
break;
case 4 :
creaturesWarrior[arrayPos] = -1;
counter_Total--;
break;
case 5 :
creaturesPredator[arrayPos] = -1;
break;
case 6 :
creaturesDead[arrayPos] = -1;
}
_local1 = 1;
switch (convertTo) {
case _local1 :
creaturesEgg[counter_Egg] = creatureObj;
creatureObj.mclip.arrayID = counter_Egg;
counter_Egg++;
break;
case 2 :
creaturesBaby[counter_Baby] = creatureObj;
creatureObj.mclip.arrayID = counter_Baby;
counter_Total++;
counter_Baby++;
break;
case 3 :
creaturesAdult[counter_Adult] = creatureObj;
creatureObj.mclip.arrayID = counter_Adult;
counter_Total++;
counter_Adult++;
break;
case 4 :
creaturesWarrior[counter_Warrior] = creatureObj;
creatureObj.mclip.arrayID = counter_Warrior;
counter_Total++;
counter_Warrior++;
break;
case 5 :
creaturesPredator[counter_Predator] = creatureObj;
creatureObj.mclip.arrayID = counter_Predator;
counter_Predator++;
break;
case 6 :
creaturesDead[counter_Dead] = creatureObj;
creatureObj.mclip.arrayID = counter_Dead;
counter_Dead++;
}
creatureObj.speed = creatureSpeeds[convertTo];
creatureObj.health = Math.floor((creatureObj.health * creatureMaxHealth[convertTo]) / creatureMaxHealth[creatureObj.ctype]);
creatureObj.age = 0;
creatureObj.birthcounter = 0;
creatureObj.fighttarget = -1;
creatureObj.timetotrain = 0;
creatureObj.ctype = convertTo;
showCreatureState(creatureObj);
arraysNeedRebuilding = true;
}
function showCreatures() {
var myLoop = 0;
while (myLoop < counter_Egg) {
showMyCreature(creaturesEgg[myLoop]);
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Baby) {
showMyCreature(creaturesBaby[myLoop]);
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Adult) {
showMyCreature(creaturesAdult[myLoop]);
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Warrior) {
showMyCreature(creaturesWarrior[myLoop]);
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Predator) {
showMyCreature(creaturesPredator[myLoop]);
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Dead) {
showMyCreature(creaturesDead[myLoop]);
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_Food) {
showMyCreature(foodArray[myLoop]);
myLoop++;
}
var myLoop = 0;
while (myLoop < counter_OnBoat) {
showMyCreature(creaturesOnBoat[myLoop]);
myLoop++;
}
}
function showMyCreature(creatureObj) {
var showState = 1;
creatureObj.mclip._x = creatureObj.x;
creatureObj.mclip._y = creatureObj.y;
creatureObj.mclip._rotation = creatureObj.direction;
if (!creatureObj.onboat) {
showCreatureState(creatureObj);
}
}
function showCreatureState(myObj) {
var showState = myObj.ctype;
if ((myObj.ctype < 6) && (1 < myObj.ctype)) {
if ((myObj.ctype == 3) && (ageAdultsGetOld < myObj.age)) {
showState = showState + 18;
} else if (myObj.health < (creatureMaxHealth[myObj.ctype] * 0.5)) {
showState = showState + 12;
} else if (myObj.sickstate) {
showState = showState + 6;
}
}
if (myObj.showingState != showState) {
myObj.mclip.gotoAndStop(showState);
myObj.showingState = showState;
}
}
function moveMe(moveObj) {
var currentX = moveObj.x;
var currentY = moveObj.y;
var currentDir = moveObj.direction;
var currentSpeed = moveObj.speed;
var newX = (currentX + (sinTable[currentDir] * currentSpeed));
var newY = (currentY - (cosTable[currentDir] * currentSpeed));
if (newX < screenLeft) {
newX = screenLeft;
currentDir = 360 - currentDir;
}
if (screenRight < newX) {
newX = screenRight;
currentDir = 360 - currentDir;
}
if (newY < screenTop) {
newY = screenTop;
currentDir = 180 - currentDir;
}
if (screenBottom < newY) {
newY = screenBottom;
currentDir = 180 - currentDir;
}
moveObj.x = newX;
moveObj.y = newY;
moveObj.direction = fixDegrees(currentDir);
}
function fixDegrees(degIn) {
degIn = Math.floor(degIn);
if (degIn < 0) {
degIn = degIn + 360;
}
if (359 < degIn) {
degIn = degIn - 360;
}
return(degIn);
}
function radians(degrees) {
return(degrees * (Math.PI/180));
}
function degrees(radians) {
return(radians / (Math.PI/180));
}
function rebuildThisArray(objArray, objArrayCount) {
var myMoveToPos = 0;
var myNewArrayCount = objArrayCount;
var myLoop = 0;
while (myLoop < objArrayCount) {
if (myMoveToPos != myLoop) {
if (objArray[myLoop] != -1) {
objArray[myMoveToPos] = objArray[myLoop];
objArray[myMoveToPos].mclip.arrayID = myMoveToPos;
myMoveToPos++;
} else {
myNewArrayCount--;
}
} else if (objArray[myLoop] != -1) {
myMoveToPos++;
} else {
myNewArrayCount--;
}
myLoop++;
}
return(myNewArrayCount);
}
function rebuildArrays() {
if (arraysNeedRebuilding) {
counter_Egg = rebuildThisArray(creaturesEgg, counter_Egg);
counter_Baby = rebuildThisArray(creaturesBaby, counter_Baby);
counter_Adult = rebuildThisArray(creaturesAdult, counter_Adult);
counter_Warrior = rebuildThisArray(creaturesWarrior, counter_Warrior);
counter_Predator = rebuildThisArray(creaturesPredator, counter_Predator);
counter_Dead = rebuildThisArray(creaturesDead, counter_Dead);
counter_Food = rebuildThisArray(arrayFood, counter_Food);
counter_OnBoat = rebuildThisArray(creaturesOnBoat, counter_OnBoat);
counter_Total = ((counter_Baby + counter_Adult) + counter_Warrior) + counter_OnBoat;
arraysNeedRebuilding = false;
}
}
function buildLookupTables() {
sinTable = new Array();
cosTable = new Array();
var myLoop = 0;
while (myLoop < 360) {
sinTable[myLoop] = Math.sin(radians(myLoop));
cosTable[myLoop] = Math.cos(radians(myLoop));
myLoop++;
}
}
function setDisasterOn() {
disaster.gotoAndStop("on");
playSound("disaster");
disasterActive = 2;
disasterCounter = 0;
}
function setDisasterWarning() {
disaster.gotoAndStop("warning");
disasterActive = 1;
}
function setDisasterOff() {
disaster.gotoAndStop("leaving");
stopSound("disaster");
disasterActive = 0;
disasterCounter = 0;
}
function creatureDie(myObj) {
playSound("dead");
var myType = myObj.ctype;
if (myType == 5) {
predatorsKilled++;
}
if (myType != 6) {
updateCreatureType(myObj, 6);
}
myObj.direction = 0;
}
function setGameState(newState) {
var _local1 = 0;
switch (newState) {
case _local1 :
_local1 = 4;
switch (gameState) {
case _local1 :
currentLevel++;
missionBar.gotoAndStop(currentLevel);
stopSounds();
initLevel(currentLevel);
gamescreens.gotoAndStop("levelgoals");
gamescreens.mygoals.goalplayback.gotoAndStop("intro");
gamescreens.mygoals.goallevel.gotoAndStop(currentLevel);
newState = 3;
break;
case 5 :
stopSounds();
missionBar.gotoAndStop(currentLevel);
initLevel(currentLevel);
gamescreens.gotoAndStop("levelgoals");
gamescreen.mygoals.goalplayback.gotoAndStop("intro");
gamescreen.mygoals.goallevel.gotoAndStop(currentLevel);
newState = 3;
break;
default :
gamescreens.gotoAndStop("clear");
}
soundFade = 1;
break;
case 1 :
gamescreens.gotoAndStop("levelgoals");
missionBar.gotoAndStop(currentLevel);
gamescreens.mygoals.goalplayback.gotoAndStop("paused");
gamescreens.mygoals.goallevel.gotoAndStop(currentLevel);
soundFade = 2;
break;
case 2 :
gamescreens.gotoAndStop("quitting");
soundFade = 2;
break;
case 3 :
gamescreens.gotoAndStop("levelgoals");
missionBar.gotoAndStop(currentLevel);
gamescreens.mygoals.goalplayback.gotoAndStop("intro");
gamescreens.mygoals.goallevel.gotoAndStop(currentLevel);
break;
case 4 :
cleanUp(false, false);
gamescreens.gotoAndStop("nextlevel");
break;
case 5 :
cleanUp(false, false);
gamescreens.gotoAndStop("restart");
break;
case 6 :
gamescreens.gotoAndStop("howtoplay");
soundFade = 2;
}
if (playingFightSounds) {
stopSound("fighting");
}
if (playingBuildSounds) {
stopSound("building");
}
gameState = newState;
}
function newGame() {
cleanUp(true, true);
_root.gotoAndStop("load");
}
function setGameCompleted() {
cleanUp(true, true);
_root.gotoAndStop("endgame");
}
function startMyDrag(dragClip) {
draggingID = dragClip.id;
draggingClip = dragClip;
dragClip._alpha = 40;
if (dragClip.ctype != 7) {
_root.infobar.infoPopup.gotoAndStop(2);
}
}
function stopMyDrag() {
if (draggingID != -1) {
draggingClip._alpha = 100;
draggingID = -1;
draggingClip = -1;
_root.infobar.infoPopup.gotoAndStop(1);
}
}
function dragMe(myObj) {
myObj.x = _root._xmouse;
myObj.y = _root._ymouse;
myObj.targetx = -1;
myObj.targety = -1;
if (myObj.x < screenLeft) {
myObj.x = screenLeft;
}
if (screenRight < myObj.x) {
myObj.x = screenRight;
}
if (myObj.y < screenTop) {
myObj.y = screenTop;
}
if (screenBottom < myObj.y) {
myObj.y = screenBottom;
}
}
function setMaking(makeType) {
if ((creatingDrop == -1) && (droppingItem == -1)) {
var _local1 = 2;
switch (makeType) {
case _local1 :
if (myMoney >= dropBabyPrice) {
if (thisLevel.canCreateFood) {
infobar.dropFood.gotoAndStop("unavail");
}
infobar.dropBaby.gotoAndStop("making");
if (thisLevel.canCreateWarrior) {
infobar.dropWarrior.gotoAndStop("unavail");
}
creatingDrop = makeType;
dropCounter = 0;
myMoney = myMoney - dropBabyPrice;
playSound("button");
}
return;
case 4 :
if (myMoney >= dropWarriorPrice) {
if (thisLevel.canCreateFood) {
infobar.dropFood.gotoAndStop("unavail");
}
if (thisLevel.canCreateBaby) {
infobar.dropBaby.gotoAndStop("unavail");
}
infobar.dropWarrior.gotoAndStop("making");
creatingDrop = makeType;
myMoney = myMoney - dropWarriorPrice;
dropCounter = 0;
playSound("button");
}
return;
case 7 :
if (myMoney < dropFoodPrice) {
break;
}
infobar.dropFood.gotoAndStop("making");
if (thisLevel.canCreateBaby) {
infobar.dropBaby.gotoAndStop("unavail");
}
if (thisLevel.canCreateWarrior) {
infobar.dropWarrior.gotoAndStop("unavail");
}
creatingDrop = makeType;
myMoney = myMoney - dropFoodPrice;
dropCounter = 0;
playSound("button");
if ((currentLevel == 1) && (helpState == 1)) {
helpState = 2;
helpClip.gotoAndStop(1);
}
if (!((currentLevel == 1) && (helpState < 1))) {
break;
}
helpState = 4;
helpClip.gotoAndStop(1);
}
}
}
function setDropReady(createdType) {
droppingItem = createdType;
creatingDrop = -1;
dropCounter = 0;
dropReadyPercent = 100;
playSound("complete");
var _local1 = 2;
switch (createdType) {
case _local1 :
infobar.dropBaby.gotoAndStop("made");
return;
case 4 :
infobar.dropWarrior.gotoAndStop("made");
return;
case 7 :
infobar.dropFood.gotoAndStop("made");
if (!((currentLevel == 1) && (helpState == 2))) {
break;
}
helpState = 3;
helpClip.gotoAndStop(3);
}
}
function setDropping(dropType) {
var _local1 = 2;
switch (dropType) {
case _local1 :
var justMade = createCreature(_root._xmouse, _root._ymouse, 2);
break;
case 4 :
var justMade = createCreature(_root._xmouse, _root._ymouse, 4);
break;
case 7 :
var justMade = createFoodBowl(_root._xmouse, _root._ymouse);
}
startMyDrag(justMade.mclip);
dragMe(justMade);
droppingItem = -1;
dropReadyPercent = 0;
resetDropIcons();
if ((currentLevel == 1) && (helpState == 3)) {
helpState = 4;
helpClip.gotoAndStop(1);
}
}
function resetDropIcons() {
if ((droppingItem == -1) && (creatingDrop == -1)) {
if (thisLevel.canCreateFood) {
if (myMoney >= dropFoodPrice) {
infobar.dropFood.gotoAndStop("avail");
} else {
infobar.dropFood.gotoAndStop("unavail");
}
} else {
infobar.dropFood.gotoAndStop("clear");
}
if (thisLevel.canCreateBaby) {
if (myMoney >= dropBabyPrice) {
infobar.dropBaby.gotoAndStop("avail");
} else {
infobar.dropBaby.gotoAndStop("unavail");
}
} else {
infobar.dropBaby.gotoAndStop("clear");
}
if (thisLevel.canCreateWarrior) {
if (myMoney >= dropWarriorPrice) {
infobar.dropWarrior.gotoAndStop("avail");
} else {
infobar.dropWarrior.gotoAndStop("unavail");
}
} else {
infobar.dropWarrior.gotoAndStop("clear");
}
}
}
function showInfo(creatureObj) {
_root.draggedState = "";
if (creatureObj.foodlevel < hungryLevel) {
_root.draggedState = "hungry";
}
if (creatureObj.sickstate) {
_root.draggedState = "sick";
}
if (creatureObj.onboat) {
_root.draggedState = "on boat";
}
if ((creatureObj.ctype == 3) && (ageAdultsGetOld < creatureObj.age)) {
_root.draggedState = "elderly";
}
var _local1 = 1;
switch (creatureObj.state) {
case _local1 :
if (_root.draggedState == "") {
_root.draggedState = "normal";
}
break;
case 2 :
_root.draggedState = "scared";
break;
case 3 :
_root.draggedState = "fighting";
break;
case 4 :
_root.draggedState = "healing";
break;
case 5 :
_root.draggedState = "training";
break;
case 6 :
_root.draggedState = "building";
break;
case 7 :
if (_root.draggedState != "") {
break;
}
_root.draggedState = "hungry";
}
_root.draggedTimeLeft = "0%";
if (creatureObj.state == 4) {
_root.draggedTimeLeft = Math.floor(((creatureObj.timermax - creatureObj.timetoheal) * 100) / creatureObj.timermax) + "%";
}
if (creatureObj.state == 5) {
_root.draggedTimeLeft = Math.floor(((creatureObj.timermax - creatureObj.timetotrain) * 100) / creatureObj.timermax) + "%";
}
if (creatureObj.state == 6) {
_root.draggedTimeLeft = Math.floor((boatMadeCounter * 100) / boatBuiltReady[boatMaxState]) + "%";
}
_root.draggedAge = Math.floor(creatureObj.age / 100);
_root.draggedHealth = Math.floor((creatureObj.health * 100) / creatureMaxHealth[creatureObj.ctype]) + "%";
_root.draggedFood = Math.floor((creatureObj.foodlevel * 100) / maxFoodLevel) + "%";
}
function initLevel(myLevel) {
var _local1 = 1;
switch (myLevel) {
case _local1 :
thisLevel.createHome = false;
thisLevel.createTraining = false;
thisLevel.createMedic = false;
thisLevel.createBoat = false;
thisLevel.canCreateFood = true;
thisLevel.canCreateBaby = false;
thisLevel.canCreateWarrior = false;
thisLevel.levelPredatorCount = 0;
thisLevel.levelMultiPredators = false;
thisLevel.levelDisasters = false;
thisLevel.levelSickness = false;
creatureProxSee[5] = 60;
creatureProxAttack[5] = 15;
creatureAttackPower[5] = 5;
creatureSpeeds[5] = 1;
creatureMaxHealth[5] = 1000;
predatorMakeCounterReady = 1000;
thisLevel.foodTimerSpeed = 1;
thisLevel.isComplete = function () {
if (counter_Adult >= 5) {
return(true);
}
return(false);
};
myMoney = 1000;
eggCount = 0;
babyCount = 3;
adultCount = 0;
break;
case 2 :
thisLevel.createHome = true;
thisLevel.createTraining = false;
thisLevel.createMedic = false;
thisLevel.createBoat = false;
thisLevel.canCreateFood = true;
thisLevel.canCreateBaby = true;
thisLevel.canCreateWarrior = false;
thisLevel.levelPredatorCount = 1;
thisLevel.levelMultiPredators = false;
thisLevel.levelDisasters = false;
thisLevel.levelSickness = false;
creatureProxSee[5] = 60;
creatureProxAttack[5] = 15;
creatureAttackPower[5] = 5;
creatureSpeeds[5] = 1;
creatureMaxHealth[5] = 1000;
predatorMakeCounterReady = 1000;
thisLevel.foodTimerSpeed = 1;
thisLevel.isComplete = function () {
if (0 < predatorsKilled) {
return(true);
}
return(false);
};
myMoney = 1000;
eggCount = 0;
babyCount = 4;
adultCount = 0;
break;
case 3 :
thisLevel.createHome = true;
thisLevel.createTraining = true;
thisLevel.createMedic = false;
thisLevel.createBoat = false;
thisLevel.canCreateFood = true;
thisLevel.canCreateBaby = true;
thisLevel.canCreateWarrior = false;
thisLevel.levelPredatorCount = 0;
thisLevel.levelMultiPredators = false;
thisLevel.levelDisasters = false;
thisLevel.levelSickness = false;
creatureProxSee[5] = 60;
creatureProxAttack[5] = 15;
creatureAttackPower[5] = 10;
creatureSpeeds[5] = 1.2;
creatureMaxHealth[5] = 1500;
predatorMakeCounterReady = 500;
thisLevel.foodTimerSpeed = 2;
thisLevel.isComplete = function () {
if (4 < counter_Warrior) {
return(true);
}
return(false);
};
myMoney = 1000;
eggCount = 0;
babyCount = 4;
adultCount = 0;
break;
case 4 :
thisLevel.createHome = true;
thisLevel.createTraining = true;
thisLevel.createMedic = false;
thisLevel.createBoat = false;
thisLevel.canCreateFood = true;
thisLevel.canCreateBaby = true;
thisLevel.canCreateWarrior = true;
thisLevel.levelPredatorCount = 2;
thisLevel.levelMultiPredators = false;
thisLevel.levelDisasters = false;
thisLevel.levelSickness = false;
creatureProxSee[5] = 60;
creatureProxAttack[5] = 15;
creatureAttackPower[5] = 10;
creatureSpeeds[5] = 1.2;
creatureMaxHealth[5] = 2000;
predatorMakeCounterReady = 1000;
thisLevel.foodTimerSpeed = 2;
thisLevel.isComplete = function () {
if (1 < predatorsKilled) {
return(true);
}
return(false);
};
myMoney = 1000;
eggCount = 0;
babyCount = 6;
adultCount = 0;
break;
case 5 :
thisLevel.createHome = true;
thisLevel.createTraining = true;
thisLevel.createMedic = true;
thisLevel.createBoat = false;
thisLevel.canCreateFood = true;
thisLevel.canCreateBaby = true;
thisLevel.canCreateWarrior = true;
thisLevel.levelPredatorCount = 3;
thisLevel.levelMultiPredators = false;
thisLevel.levelDisasters = false;
thisLevel.levelSickness = false;
creatureProxSee[5] = 60;
creatureProxAttack[5] = 15;
creatureAttackPower[5] = 10;
creatureSpeeds[5] = 1.2;
creatureMaxHealth[5] = 2500;
predatorMakeCounterReady = 750;
thisLevel.foodTimerSpeed = 2;
thisLevel.isComplete = function () {
if (2 < predatorsKilled) {
return(true);
}
return(false);
};
myMoney = 1000;
eggCount = 0;
babyCount = 6;
adultCount = 0;
break;
case 6 :
thisLevel.createHome = true;
thisLevel.createTraining = true;
thisLevel.createMedic = true;
thisLevel.createBoat = false;
thisLevel.canCreateFood = true;
thisLevel.canCreateBaby = true;
thisLevel.canCreateWarrior = true;
thisLevel.levelPredatorCount = 3;
thisLevel.levelMultiPredators = false;
thisLevel.levelDisasters = false;
thisLevel.levelSickness = true;
creatureProxSee[5] = 60;
creatureProxAttack[5] = 15;
creatureAttackPower[5] = 10;
creatureSpeeds[5] = 1.2;
creatureMaxHealth[5] = 2500;
predatorMakeCounterReady = 750;
thisLevel.foodTimerSpeed = 3;
thisLevel.isComplete = function () {
if (2 < predatorsKilled) {
return(true);
}
return(false);
};
myMoney = 1000;
eggCount = 0;
babyCount = 7;
adultCount = 0;
break;
case 7 :
thisLevel.createHome = true;
thisLevel.createTraining = true;
thisLevel.createMedic = true;
thisLevel.createBoat = false;
thisLevel.canCreateFood = true;
thisLevel.canCreateBaby = true;
thisLevel.canCreateWarrior = true;
thisLevel.levelPredatorCount = 4;
thisLevel.levelMultiPredators = false;
thisLevel.levelDisasters = false;
thisLevel.levelSickness = true;
creatureProxSee[5] = 60;
creatureProxAttack[5] = 15;
creatureAttackPower[5] = 12;
creatureSpeeds[5] = 1.2;
creatureMaxHealth[5] = 3000;
predatorMakeCounterReady = 750;
thisLevel.foodTimerSpeed = 3;
thisLevel.isComplete = function () {
if (3 < predatorsKilled) {
return(true);
}
return(false);
};
myMoney = 1000;
eggCount = 0;
babyCount = 7;
adultCount = 0;
break;
case 8 :
thisLevel.createHome = true;
thisLevel.createTraining = true;
thisLevel.createMedic = true;
thisLevel.createBoat = false;
thisLevel.canCreateFood = true;
thisLevel.canCreateBaby = true;
thisLevel.canCreateWarrior = true;
thisLevel.levelPredatorCount = 4;
thisLevel.levelMultiPredators = false;
thisLevel.levelDisasters = true;
thisLevel.levelSickness = true;
creatureProxSee[5] = 60;
creatureProxAttack[5] = 15;
creatureAttackPower[5] = 12;
creatureSpeeds[5] = 1.2;
creatureMaxHealth[5] = 4000;
predatorMakeCounterReady = 750;
thisLevel.foodTimerSpeed = 3;
thisLevel.isComplete = function () {
if (3 < predatorsKilled) {
return(true);
}
return(false);
};
myMoney = 1000;
eggCount = 0;
babyCount = 8;
adultCount = 0;
break;
case 9 :
thisLevel.createHome = true;
thisLevel.createTraining = true;
thisLevel.createMedic = true;
thisLevel.createBoat = false;
thisLevel.canCreateFood = true;
thisLevel.canCreateBaby = true;
thisLevel.canCreateWarrior = true;
thisLevel.levelPredatorCount = 5;
thisLevel.levelMultiPredators = true;
thisLevel.levelDisasters = true;
thisLevel.levelSickness = true;
creatureProxSee[5] = 60;
creatureProxAttack[5] = 15;
creatureAttackPower[5] = 15;
creatureSpeeds[5] = 1.2;
creatureMaxHealth[5] = 5000;
predatorMakeCounterReady = 650;
thisLevel.foodTimerSpeed = 4;
thisLevel.isComplete = function () {
if (4 < predatorsKilled) {
return(true);
}
return(false);
};
myMoney = 1000;
eggCount = 0;
babyCount = 6;
adultCount = 2;
break;
case 10 :
thisLevel.createHome = true;
thisLevel.createTraining = true;
thisLevel.createMedic = true;
thisLevel.createBoat = true;
thisLevel.canCreateFood = true;
thisLevel.canCreateBaby = true;
thisLevel.canCreateWarrior = true;
thisLevel.levelPredatorCount = 999;
thisLevel.levelMultiPredators = true;
thisLevel.levelDisasters = true;
thisLevel.levelSickness = true;
thisLevel.foodTimerSpeed = 4;
thisLevel.isComplete = function () {
if ((boatOnBoardKids >= boatOnBoardKidsNeeded) && (boatOnBoardAdults >= boatOnBoardAdultsNeeded)) {
return(true);
}
return(false);
};
creatureProxSee[5] = 60;
creatureProxAttack[5] = 15;
creatureAttackPower[5] = 15;
creatureSpeeds[5] = 1.2;
creatureMaxHealth[5] = 5000;
predatorMakeCounterReady = 600;
myMoney = 1000;
eggCount = 0;
babyCount = 2;
adultCount = 6;
break;
case 11 :
thisLevel.createHome = true;
thisLevel.createTraining = true;
thisLevel.createMedic = true;
thisLevel.createBoat = false;
thisLevel.canCreateFood = true;
thisLevel.canCreateBaby = true;
thisLevel.canCreateWarrior = true;
thisLevel.levelPredatorCount = 9999;
thisLevel.levelMultiPredators = true;
thisLevel.levelDisasters = true;
thisLevel.levelSickness = true;
thisLevel.foodTimerSpeed = 4;
thisLevel.isComplete = function () {
return(false);
};
creatureProxSee[5] = 60;
creatureProxAttack[5] = 15;
creatureAttackPower[5] = 15;
creatureSpeeds[5] = 1.2;
creatureMaxHealth[5] = 5000;
predatorMakeCounterReady = 600;
myMoney = 5000;
eggCount = 0;
babyCount = 4;
adultCount = 4;
}
levelGoalText = "";
if (justCompletedLevel) {
levelGoalText = "level password is " + passwords[myLevel];
levelPassword = passwords[myLevel];
}
predatorsKilled = 0;
boatMadeCounter = 0;
boatCurrentState = -1;
boatActive = false;
predatorMakeCounter = 0;
predatorMadeCount = 0;
homeFoodCounter = 0;
disasterActive = 0;
counterTraining = 0;
counterHealing = 0;
counterBuilding = 0;
boatOnBoardKids = 0;
boatOnBoardAdults = 0;
draggingID = -1;
draggingClip = -1;
arraysNeedRebuilding = true;
creatingDrop = -1;
droppingItem = -1;
dropReadyPercent = 0;
levelTimer = 0;
helpState = 0;
dropCounter = 0;
completeCounter = 0;
completeState = 0;
createBases();
resetDropIcons();
globalSounds.setVolume(0);
disaster.gotoAndStop("off");
if (gameSound) {
infobar.soundbutton.gotoAndStop("on");
soundBackground.start(0, 99999);
} else {
infobar.soundbutton.gotoAndStop("off");
}
var myLoop = 1;
while (eggCount >= myLoop) {
createCreature(screenLeft + (random(screenRight - screenLeft) / 2), screenBottom - (random(screenBottom - screenTop) / 2), 1);
myLoop++;
}
var myLoop = 1;
while (babyCount >= myLoop) {
createCreature(screenLeft + (random(screenRight - screenLeft) / 2), screenBottom - (random(screenBottom - screenTop) / 2), 2);
myLoop++;
}
var myLoop = 1;
while (adultCount >= myLoop) {
createCreature(screenLeft + (random(screenRight - screenLeft) / 2), screenBottom - (random(screenBottom - screenTop) / 2), 3);
myLoop++;
}
soundFade = 1;
justCompletedLevel = false;
showCreatures();
}
function checkComplete() {
if (0 < completeCounter) {
completeCounter++;
if (waitForCompleted < completeCounter) {
var _local1 = 1;
switch (completeState) {
case _local1 :
if (currentLevel == gameLastLevel) {
setGameCompleted();
} else {
setGameState(4);
}
justCompletedLevel = true;
break;
case 2 :
setGameState(5);
}
}
} else if (thisLevel.isComplete()) {
playSound("leveldone");
completeCounter = 1;
completeState = 1;
soundFade = 2;
} else if ((counter_Total + counter_Egg) < 1) {
playSound("levelfailed");
completeCounter = 1;
completeState = 2;
soundFade = 2;
}
}
function initLevelPasswords() {
passwords = new Array();
passwords[1] = "";
passwords[2] = "virtual";
passwords[3] = "curve";
passwords[4] = "orange";
passwords[5] = "atomic";
passwords[6] = "internal";
passwords[7] = "expiry";
passwords[8] = "autumn";
passwords[9] = "lattice";
passwords[10] = "unlimited";
passwords[11] = "freeplay";
}
function checkPassword(inStr) {
var myLoop = 1;
while (myLoop < passwords.length) {
if (passwords[myLoop].toLowerCase() == inStr.toLowerCase()) {
return(myLoop);
}
myLoop++;
}
return(-1);
}
function initSounds() {
gameSound = true;
soundFade = 0;
fadeSoundAmount = 2;
gameMaxVolume = 70;
playingFightSounds = false;
playingBuildSounds = false;
globalSounds = new Sound();
globalSounds.setVolume(0);
soundLayEgg = new Sound(_root.sounds);
soundLayEgg.attachSound("sound_layegg");
soundEggCollect = new Sound(_root.sounds);
soundEggCollect.attachSound("sound_eggcollect");
soundGrowUp = new Sound(_root.sounds);
soundGrowUp.attachSound("sound_growup");
soundComplete = new Sound(_root.sounds);
soundComplete.attachSound("sound_complete");
soundPredator = new Sound(_root.sounds);
soundPredator.attachSound("sound_predator");
soundDead = new Sound(_root.sounds);
soundDead.attachSound("sound_dead");
soundLevelDone = new Sound(_root.sounds);
soundLevelDone.attachSound("sound_leveldone");
soundLevelFailed = new Sound(_root.sounds);
soundLevelFailed.attachSound("sound_levelfailed");
soundSickness = new Sound(_root.sounds);
soundSickness.attachSound("sound_sickness");
soundFighting = new Sound(_root.sounds);
soundFighting.attachSound("sound_fighting");
soundDisaster = new Sound(_root.sounds);
soundDisaster.attachSound("sound_disaster");
soundBackground = new Sound(_root.sounds);
soundBackground.attachSound("sound_background");
soundButton = new Sound(_root.sounds);
soundButton.attachSound("sound_button");
soundCaught = new Sound(_root.sounds);
soundCaught.attachSound("sound_caught");
soundTrainingDone = new Sound(_root.sounds);
soundTrainingDone.attachSound("sound_trainingdone");
soundHealingDone = new Sound(_root.sounds);
soundHealingDone.attachSound("sound_healingdone");
soundBoatMade = new Sound(_root.sounds);
soundBoatMade.attachSound("sound_boatmade");
soundBuilding = new Sound(_root.sounds);
soundBuilding.attachSound("sound_building");
}
function soundOff() {
globalSounds.setVolume(0);
stopSounds();
infobar.soundbutton.gotoAndStop("off");
gameSound = false;
soundFade = 0;
}
function soundOn() {
stopSounds();
infobar.soundbutton.gotoAndStop("on");
gameSound = true;
soundBackground.start(0, 9999);
soundFade = 1;
}
function playSound(soundID) {
if (gameSound) {
var _local1 = "layegg";
switch (soundID) {
case _local1 :
soundLayEgg.start();
return;
case "boatmade" :
soundBoatMade.start();
return;
case "eggcollect" :
soundEggCollect.start();
return;
case "growup" :
soundGrowUp.start();
return;
case "complete" :
soundComplete.start();
return;
case "predator" :
soundPredator.start();
return;
case "dead" :
soundDead.start();
return;
case "leveldone" :
soundLevelDone.start();
return;
case "levelfailed" :
soundLevelFailed.start();
return;
case "button" :
soundButton.start();
return;
case "caught" :
soundCaught.start();
return;
case "sickness" :
soundSickness.start();
return;
case "trainingdone" :
soundTrainingDone.start();
return;
case "healingdone" :
soundHealingDone.start();
return;
case "fighting" :
if (!playingFightSounds) {
soundFighting.start(0, 9999);
playingFightSounds = true;
}
return;
case "building" :
if (!playingBuildSounds) {
soundBuilding.start(0, 9999);
playingBuildSounds = true;
}
return;
case "disaster" :
soundDisaster.start(0, 9999);
}
}
}
function stopSound(soundID) {
var _local1 = "fighting";
switch (soundID) {
case _local1 :
soundFighting.stop("sound_fighting");
playingFightSounds = false;
return;
case "building" :
soundBuilding.stop("sound_building");
playingBuildSounds = false;
return;
case "disaster" :
soundDisaster.stop("sound_disaster");
}
}
function stopSounds() {
globalSounds.stop();
}
function doSoundFade() {
var _local1 = 1;
switch (soundFade) {
case _local1 :
var myVolume = (globalSounds.getVolume() + fadeSoundAmount);
if (myVolume >= gameMaxVolume) {
myVolume = gameMaxVolume;
soundFade = 0;
}
break;
case 2 :
var myVolume = (globalSounds.getVolume() - fadeSoundAmount);
if (0 < myVolume) {
break;
}
myVolume = 0;
soundFade = 0;
}
globalSounds.setVolume(myVolume);
}
if (_root.gameLoaded == 1) {
initGameVars();
initSounds();
initLevelPasswords();
_root.gameLoaded = 2;
}
stop();
Instance of Symbol 178 MovieClip "sounds" in Frame 2
onClipEvent (enterFrame) {
if (_root.soundFade != 0) {
_root.doSoundFade();
}
}
Frame 3
stop();
Frame 4
stop();
Instance of Symbol 441 MovieClip "control" in Frame 4
onClipEvent (load) {
_root.initLevel(_root.currentLevel);
_root.setGameState(3);
}
onClipEvent (enterFrame) {
_root.frameRate = Math.Floor(1000 / (getTimer() - _root.lastFrameTime));
_root.lastFrameTime = getTimer();
if (_root.gameState == 0) {
_root.gameRoutine();
_root.creatureActions();
_root.rebuildArrays();
_root.showCreatures();
_root.checkComplete();
}
}
onClipEvent (mouseUp) {
_root.stopMyDrag();
}
Instance of Symbol 497 MovieClip "gamescreens" in Frame 4
onClipEvent (load) {
this.swapDepths(9500);
}
Instance of Symbol 502 MovieClip "helpclip" in Frame 4
onClipEvent (load) {
this.swapDepths(9000);
}
Frame 5
stop();
Symbol 5 Button
on (press) {
_root.takeEgg(arrayID);
}
Symbol 7 MovieClip Frame 1
stop();
Symbol 8 Button
on (press) {
_root.startMyDrag(this);
}
Symbol 10 MovieClip Frame 1
stop();
Symbol 11 Button
on (press) {
_root.startMyDrag(this);
}
Symbol 13 MovieClip Frame 1
stop();
Symbol 14 Button
on (press) {
_root.startMyDrag(this);
}
Symbol 19 MovieClip Frame 16
stop();
Symbol 21 Button
on (press) {
_root.startMyDrag(this);
}
Symbol 23 Button
on (press) {
_root.startMyDrag(this);
}
Symbol 24 MovieClip Frame 1
stop();
Symbol 25 Button
on (press) {
_root.startMyDrag(this);
}
Symbol 27 Button
on (press) {
_root.startMyDrag(this);
}
Symbol 29 Button
on (press) {
_root.startMyDrag(this);
}
Symbol 31 Button
on (press) {
_root.startMyDrag(this);
}
Symbol 35 Button
on (press) {
_root.startMyDrag(this);
}
Symbol 36 MovieClip [creature] Frame 1
stop();
Symbol 36 MovieClip [creature] Frame 2
stop();
Symbol 36 MovieClip [creature] Frame 3
stop();
Symbol 36 MovieClip [creature] Frame 4
stop();
Symbol 36 MovieClip [creature] Frame 5
stop();
Symbol 36 MovieClip [creature] Frame 6
stop();
Symbol 36 MovieClip [creature] Frame 7
stop();
Symbol 36 MovieClip [creature] Frame 8
stop();
Symbol 36 MovieClip [creature] Frame 9
stop();
Symbol 36 MovieClip [creature] Frame 10
stop();
Symbol 36 MovieClip [creature] Frame 11
stop();
Symbol 36 MovieClip [creature] Frame 12
stop();
Symbol 36 MovieClip [creature] Frame 13
stop();
Symbol 36 MovieClip [creature] Frame 14
stop();
Symbol 36 MovieClip [creature] Frame 15
stop();
Symbol 36 MovieClip [creature] Frame 16
stop();
Symbol 36 MovieClip [creature] Frame 17
stop();
Symbol 36 MovieClip [creature] Frame 18
stop();
Symbol 36 MovieClip [creature] Frame 19
stop();
Symbol 36 MovieClip [creature] Frame 20
stop();
Symbol 36 MovieClip [creature] Frame 21
stop();
Symbol 36 MovieClip [creature] Frame 22
stop();
Symbol 36 MovieClip [creature] Frame 23
stop();
Symbol 36 MovieClip [creature] Frame 24
stop();
Symbol 58 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 2
stop();
Symbol 58 MovieClip Frame 3
stop();
Symbol 58 MovieClip Frame 4
stop();
Symbol 58 MovieClip Frame 5
stop();
Symbol 59 MovieClip [base] Frame 1
stop();
Symbol 59 MovieClip [base] Frame 2
stop();
Symbol 59 MovieClip [base] Frame 3
stop();
Symbol 59 MovieClip [base] Frame 4
stop();
Symbol 96 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 101
play();
Symbol 96 MovieClip Frame 120
stop();
_root.gotoAndStop("load");
Instance of Symbol 96 MovieClip "preloader" in Symbol 97 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.gameLoaded == 0) {
var myPercent = Math.floor((_root.getBytesLoaded() * 100) / _root.getBytesTotal());
if (myPercent >= 100) {
_root.gameLoaded = 1;
this.gotoAndPlay("final");
} else {
this.gotoAndStop(myPercent);
}
}
}
Symbol 123 Button
on (press) {
gotoAndStop (2);
}
Symbol 129 Button
on (press) {
_root.gotoAndStop("instruct");
}
Symbol 135 Button
on (press) {
_root.currentLevel = 1;
_root.gotoAndStop("game");
}
Symbol 139 Button
on (press) {
gotoAndStop (3);
}
Symbol 155 Button
on (press) {
gotoAndStop (2);
}
Symbol 156 Button
on (press) {
var skipToLevel = _root.checkPassword(_root.levelPassword);
if (skipToLevel == -1) {
_root.levelPassword = "";
} else {
_root.currentLevel = skipToLevel;
_root.gotoAndStop("game");
}
}
Symbol 157 MovieClip Frame 1
stop();
Symbol 157 MovieClip Frame 2
stop();
Symbol 157 MovieClip Frame 3
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 2
stop();
Symbol 231 Button
on (press) {
gotoAndStop (2);
}
Symbol 341 MovieClip Frame 1
stop();
Symbol 341 MovieClip Frame 2
stop();
Symbol 342 Button
on (press) {
_root.gotoAndStop("load");
}
Symbol 352 MovieClip Frame 36
stop();
Symbol 363 MovieClip Frame 36
stop();
Symbol 369 MovieClip Frame 27
_parent.gotoAndStop("off");
stop();
Symbol 370 MovieClip Frame 1
stop();
Symbol 370 MovieClip Frame 2
stop();
Symbol 370 MovieClip Frame 3
stop();
Symbol 370 MovieClip Frame 4
stop();
Symbol 377 Button
on (press) {
_root.setMaking(7);
}
Symbol 379 Button
on (press) {
_root.setDropping(7);
}
Symbol 380 MovieClip Frame 1
stop();
Symbol 380 MovieClip Frame 2
stop();
Symbol 380 MovieClip Frame 3
stop();
Symbol 380 MovieClip Frame 4
stop();
Symbol 380 MovieClip Frame 5
stop();
Symbol 386 Button
on (press) {
_root.setGameState(2);
}
on (keyPress "N") {
_root.setGameState(2);
}
on (keyPress "n") {
_root.setGameState(2);
}
Symbol 390 Button
on (press) {
_root.setGameState(6);
}
on (keyPress "I") {
_root.setGameState(6);
}
on (keyPress "i") {
_root.setGameState(6);
}
Symbol 403 MovieClip Frame 1
stop();
Symbol 410 Button
on (press) {
_root.setMaking(2);
}
Symbol 413 Button
on (press) {
_root.setDropping(2);
}
Symbol 414 MovieClip Frame 1
stop();
Symbol 414 MovieClip Frame 2
stop();
Symbol 414 MovieClip Frame 3
stop();
Symbol 414 MovieClip Frame 4
stop();
Symbol 414 MovieClip Frame 5
stop();
Symbol 418 Button
on (press) {
_root.setGameState(1);
}
on (keyPress "P") {
_root.setGameState(1);
}
on (keyPress "p") {
_root.setGameState(1);
}
Symbol 424 Button
on (press) {
_root.soundOff();
}
on (keyPress "S") {
_root.soundOff();
}
on (keyPress "s") {
_root.soundOff();
}
Symbol 429 Button
on (press) {
_root.soundOn();
}
on (keyPress "S") {
_root.soundOn();
}
on (keyPress "s") {
_root.soundOn();
}
Symbol 430 MovieClip Frame 1
stop();
Symbol 430 MovieClip Frame 2
stop();
Symbol 436 Button
on (press) {
_root.setMaking(4);
}
Symbol 437 Button
on (press) {
_root.setDropping(4);
}
Symbol 438 MovieClip Frame 1
stop();
Symbol 438 MovieClip Frame 2
stop();
Symbol 438 MovieClip Frame 3
stop();
Symbol 438 MovieClip Frame 4
stop();
Symbol 438 MovieClip Frame 5
stop();
Symbol 470 MovieClip Frame 1
stop();
Symbol 470 MovieClip Frame 2
stop();
Symbol 470 MovieClip Frame 3
stop();
Symbol 470 MovieClip Frame 4
stop();
Symbol 470 MovieClip Frame 5
stop();
Symbol 470 MovieClip Frame 6
stop();
Symbol 470 MovieClip Frame 7
stop();
Symbol 470 MovieClip Frame 8
stop();
Symbol 470 MovieClip Frame 9
stop();
Symbol 470 MovieClip Frame 10
stop();
Symbol 470 MovieClip Frame 11
stop();
Symbol 472 Button
on (press) {
_root.setGameState(0);
}
Symbol 475 Button
on (press) {
_root.setGameState(0);
}
Symbol 476 MovieClip Frame 1
stop();
Symbol 476 MovieClip Frame 2
stop();
Symbol 481 Button
on (press) {
_root.newGame();
}
Symbol 485 Button
on (press) {
_root.setGameState(0);
}
Symbol 488 Button
on (press) {
_root.setGameState(0);
}
Symbol 489 Button
on (press) {
_root.newGame();
}
Symbol 496 Button
on (press) {
_root.newGame();
}
Symbol 497 MovieClip Frame 1
stop();
Symbol 497 MovieClip Frame 2
stop();
Symbol 497 MovieClip Frame 3
stop();
Symbol 497 MovieClip Frame 4
stop();
Symbol 497 MovieClip Frame 5
stop();
Symbol 497 MovieClip Frame 6
stop();
Symbol 497 MovieClip Frame 7
stop();
Symbol 502 MovieClip Frame 1
stop();
Symbol 502 MovieClip Frame 2
stop();
Symbol 502 MovieClip Frame 3
stop();
Symbol 512 MovieClip Frame 1
stop();
Symbol 512 MovieClip Frame 2
stop();
Symbol 512 MovieClip Frame 3
stop();
Symbol 512 MovieClip Frame 4
stop();
Symbol 512 MovieClip Frame 5
stop();
Symbol 512 MovieClip Frame 6
stop();
Symbol 512 MovieClip Frame 7
stop();
Symbol 512 MovieClip Frame 8
stop();
Symbol 512 MovieClip Frame 9
stop();
Symbol 512 MovieClip Frame 10
stop();
Symbol 512 MovieClip Frame 11
stop();
Symbol 519 MovieClip Frame 26
stop();
Symbol 546 Button
on (press) {
gotoAndPlay (168);
}
Symbol 547 MovieClip Frame 167
stop();
Symbol 547 MovieClip Frame 174
stop();
_root.newGame();