Section 1
//AGteaser_mc (AGteaser_mc)
package {
import flash.events.*;
import flash.display.*;
public dynamic class AGteaser_mc extends MovieClip {
public function AGteaser_mc(){
addFrameScript(133, frame134);
}
function frame134(){
stop();
this.dispatchEvent(new Event(Event.COMPLETE));
}
}
}//package
Section 2
//Assests (Assests)
package {
import flash.display.*;
public dynamic class Assests extends MovieClip {
public function Assests(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 3
//BabySeaTurtle (BabySeaTurtle)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
public class BabySeaTurtle extends MovieClip {
private var frameTimer:Timer;
private var range:Number;
private var ySpeed:Number;
private var map:Map;
public var i:uint;
private var targetPoint:Point;
private var critterLayer:CritterLayer;
private var thisPoint:Point;
private var targetDistance:Number;
private var xSpeed:Number;
private var numTurns:uint;
private var extraPoint:Point;
private var numFrames:uint;
private var frameCounter:uint;
private var topSpeed:Number;
public function BabySeaTurtle(_arg1:uint){
map = Map.main;
critterLayer = map.critterLayer;
name = "babySeaTurtle";
x = (Math.floor((Math.random() * 460)) + 10);
y = 480;
thisPoint = new Point(x, y);
targetPoint = new Point();
topSpeed = 3;
range = 6;
numTurns = 4;
frameCounter = 1;
numFrames = 4;
gotoAndStop(frameCounter);
turn();
map.critterArray.push(this);
map.babySeaTurtleArray.push(this);
critterLayer.addChild(this);
frameTimer = new Timer(_arg1);
frameTimer.addEventListener(TimerEvent.TIMER, enterFrame);
enableThis();
}
private function moveTowardsTarget():void{
extraPoint = targetPoint.subtract(thisPoint);
extraPoint.normalize(topSpeed);
xSpeed = extraPoint.x;
ySpeed = extraPoint.y;
x = (x + xSpeed);
y = (y + ySpeed);
thisPoint.x = x;
thisPoint.y = y;
if (++frameCounter > numFrames){
frameCounter = 1;
};
gotoAndStop(frameCounter);
i = map.getMapIndex(x, y);
}
private function enterFrame(_arg1):void{
targetDistance = Point.distance(thisPoint, targetPoint);
if (targetDistance <= range){
if (--numTurns < 0){
kill();
} else {
turn();
};
} else {
moveTowardsTarget();
};
}
public function kill():void{
var _local1:uint;
disableThis();
frameTimer.removeEventListener(TimerEvent.TIMER, enterFrame);
_local1 = map.critterArray.indexOf(this);
map.critterArray.splice(_local1, 1);
_local1 = map.babySeaTurtleArray.indexOf(this);
map.babySeaTurtleArray.splice(_local1, 1);
critterLayer.removeChild(this);
}
private function turn(){
targetPoint.x = ((x)<241) ? 250 : 10;
targetPoint.x = (Math.floor((Math.random() * 220)) + targetPoint.x);
targetPoint.y = ((numTurns)>0) ? (Math.floor((Math.random() * 330)) + 120) : 480;
extraPoint = targetPoint.subtract(thisPoint);
extraPoint.normalize(topSpeed);
xSpeed = extraPoint.x;
ySpeed = extraPoint.y;
rotation = ((Math.atan2(ySpeed, xSpeed) * (180 / Math.PI)) + 90);
moveTowardsTarget();
}
public function disableThis():void{
frameTimer.reset();
}
public function enableThis():void{
frameTimer.start();
}
}
}//package
Section 4
//BabySeaTurtleDead (BabySeaTurtleDead)
package {
import flash.display.*;
public class BabySeaTurtleDead extends Sprite {
private var map:Map;
private var critterLayer:CritterLayer;
public function BabySeaTurtleDead(_arg1:Number, _arg2:Number){
map = Map.main;
critterLayer = map.critterLayer;
name = "babySeaTurtleDead";
x = _arg1;
y = _arg2;
rotation = (Math.floor((Math.random() * 2)) * 180);
critterLayer.addChild(this);
}
public function kill():void{
var _local1:int;
var _local2:uint;
_local2 = 0;
while (_local2 < 9) {
_local1 = map.critterNumCritterArray[_local2].indexOf(this);
if (_local1 > -1){
map.critterNumCritterArray[_local2].splice(_local1, 1);
};
_local2++;
};
critterLayer.removeChild(this);
}
public function disableThis():void{
}
public function enableThis():void{
}
}
}//package
Section 5
//BackgroundLayer (BackgroundLayer)
package {
import flash.display.*;
public dynamic class BackgroundLayer extends Sprite {
}
}//package
Section 6
//BackLabel (BackLabel)
package {
import flash.display.*;
public dynamic class BackLabel extends Sprite {
}
}//package
Section 7
//Boat (Boat)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
public class Boat extends Sprite {
public var netEnabled:Boolean;
private var checkPoints:Array;
private var xLimit:Number;
private var soundPlaying:String;
private var netHeight:Number;
private var checkTimer:Timer;
private var boatPoint:Point;
private var range:Number;
public var accelerationLevel:uint;
private var ySpeed:Number;
private var map:Map;
private var netDeceleration:Number;
private var extraPoint:Point;
private var motor;
private var xLimitTest:Boolean;
private var acceleration:Number;
private var motor2;
private var extraNumber:Number;
private var boatHeight:Number;
private var targetPoint:Point;
private var net;
private var targetDistance:Number;
public var netScale:uint;
private var xSpeed:Number;
public var topSpeedLevel:uint;
public var controller:Controller;
private var yLimit:Number;
public var costArray:Array;
private var extraPoint2:Point;
private var vacuumPoint:Point;
public var netLevel:uint;
private var boatLayer:BoatLayer;
private var topSpeed:Number;
public var numFireballs:uint;
public function Boat(_arg1:Number, _arg2:Number, _arg3:Number){
map = Map.main;
boatLayer = map.boatLayer;
x = _arg1;
y = _arg2;
boatHeight = height;
rotation = _arg3;
name = "boat";
accelerationLevel = (topSpeedLevel = (netLevel = (xSpeed = (ySpeed = 0))));
acceleration = 0.075;
topSpeed = 3;
range = 10;
numFireballs = 1;
costArray = [];
costArray[0] = new Array(750, 1000, 1250, 1500, 2000);
costArray[1] = new Array(1000, 1500, 2000, 2500, 3000);
costArray[2] = new Array(2000, 6000);
targetPoint = new Point();
boatPoint = new Point(x, y);
vacuumPoint = new Point(x, y);
extraPoint = new Point();
extraPoint2 = new Point();
motor = null;
motor2 = null;
netEnabled = false;
net = null;
changeNetLevel(0);
soundPlaying = null;
boatLayer.addChild(this);
checkTimer = new Timer(100);
checkTimer.addEventListener(TimerEvent.TIMER, checkTick);
}
public function changeAccelerationLevel(_arg1:uint):void{
accelerationLevel = _arg1;
acceleration = (0.075 + (accelerationLevel * 0.05));
addMotor();
}
private function playSound(_arg1:String):void{
if (_arg1 !== soundPlaying){
if (soundPlaying !== null){
controller.stopSound(soundPlaying);
};
controller.playSound(_arg1, 0, 200);
soundPlaying = _arg1;
};
}
private function moveTowardsTarget():void{
var _local1:Number;
extraPoint = targetPoint.subtract(boatPoint);
if (netDeceleration > 0){
extraPoint.normalize((topSpeed * (1 - (0.2 * (1 + netLevel)))));
} else {
extraPoint.normalize(topSpeed);
};
if (xSpeed > extraPoint.x){
extraNumber = (acceleration + netDeceleration);
if ((xSpeed - extraNumber) < extraPoint.x){
xSpeed = extraPoint.x;
} else {
xSpeed = (xSpeed - extraNumber);
};
} else {
xSpeed = (xSpeed + (acceleration - netDeceleration));
if (xSpeed > extraPoint.x){
xSpeed = extraPoint.x;
};
};
if (ySpeed > extraPoint.y){
extraNumber = (acceleration + netDeceleration);
if ((ySpeed - extraNumber) < extraPoint.y){
ySpeed = extraPoint.y;
} else {
ySpeed = (ySpeed - extraNumber);
};
} else {
ySpeed = (ySpeed + (acceleration - netDeceleration));
if (ySpeed > extraPoint.y){
ySpeed = extraPoint.y;
};
};
_local1 = rotation;
rotation = ((Math.atan2(ySpeed, xSpeed) * (180 / Math.PI)) + 90);
_local1 = (_local1 - rotation);
if (_local1 < -8){
_local1 = -8;
} else {
if (_local1 > 8){
_local1 = 8;
};
};
_local1 = (_local1 * 4);
if (motor !== null){
motor.rotation = _local1;
};
if (motor2 !== null){
motor2.rotation = _local1;
};
if (net !== null){
net.rotation = _local1;
};
y = (y + ySpeed);
if ((((x <= 82)) || ((((x >= 340)) && ((x < 426)))))){
yLimit = 78;
} else {
if ((((x > 82)) && ((x < 340)))){
yLimit = 100;
} else {
yLimit = 57;
};
};
if (y < yLimit){
y = yLimit;
ySpeed = 0;
};
x = (x + xSpeed);
xLimit = 0;
if (y < 78){
xLimit = 426;
} else {
if (y < 100){
if (x < (82 + topSpeed)){
xLimit = -81;
} else {
if (x > (339 - topSpeed)){
xLimit = 340;
};
};
};
};
if (xLimit < 0){
xLimitTest = (x > (-1 * xLimit));
} else {
if (xLimit > 0){
xLimitTest = (x < xLimit);
} else {
xLimitTest = false;
};
};
if (xLimitTest){
x = ((xLimit)<0) ? (-1 * xLimit) : xLimit;
xSpeed = 0;
};
boatPoint.x = x;
boatPoint.y = y;
}
private function addMotor():void{
if (motor !== null){
removeChild(motor);
};
if (motor2 !== null){
removeChild(motor2);
};
switch ((accelerationLevel + topSpeedLevel)){
case 1:
motor = new Motor1();
motor2 = null;
break;
case 2:
motor = new Motor1();
motor2 = new Motor1();
break;
case 3:
motor = new Motor3();
motor2 = null;
break;
case 4:
motor = new Motor3();
motor2 = new Motor3();
break;
case 5:
motor = new Motor5();
motor2 = null;
break;
case 6:
motor = new Motor5();
motor2 = new Motor5();
break;
case 7:
motor = new Motor7();
motor2 = null;
break;
case 8:
motor = new Motor7();
motor2 = new Motor7();
break;
case 9:
motor = new Motor9();
motor2 = null;
break;
case 10:
motor = new Motor9();
motor2 = new Motor9();
break;
default:
motor = null;
motor2 = null;
break;
};
if (motor !== null){
motor.name = "motor";
motor.y = ((boatHeight + motor.height) * 0.5);
addChild(motor);
};
if (motor2 !== null){
motor2.name = "motor2";
motor2.y = ((boatHeight + motor2.height) * 0.5);
addChild(motor2);
motor.x = -6.5;
motor2.x = 6.5;
};
}
private function coastToStop():void{
extraPoint.x = xSpeed;
extraPoint.y = ySpeed;
extraPoint.normalize((acceleration + netDeceleration));
if (xSpeed > 0){
if ((xSpeed - extraPoint.x) < 0){
xSpeed = 0;
} else {
xSpeed = (xSpeed - extraPoint.x);
};
} else {
if (xSpeed < 0){
if ((xSpeed - extraPoint.x) > 0){
xSpeed = 0;
} else {
xSpeed = (xSpeed - extraPoint.x);
};
};
};
if (ySpeed > 0){
if ((ySpeed - extraPoint.y) < 0){
ySpeed = 0;
} else {
ySpeed = (ySpeed - extraPoint.y);
};
} else {
if (ySpeed < 0){
if ((ySpeed - extraPoint.y) > 0){
ySpeed = 0;
} else {
ySpeed = (ySpeed - extraPoint.y);
};
};
};
x = (x + xSpeed);
y = (y + ySpeed);
boatPoint.x = x;
boatPoint.y = y;
if (motor !== null){
motor.rotation = 0;
};
if (motor2 !== null){
motor2.rotation = 0;
};
if (net !== null){
net.rotation = 0;
};
}
public function enableBoat():void{
addEventListener(Event.ENTER_FRAME, enterFrame);
checkTimer.start();
if (soundPlaying !== null){
controller.playSound(soundPlaying, 0, 200);
};
}
public function changeNetLevel(_arg1:uint):void{
netLevel = _arg1;
if (net !== null){
removeChild(net);
};
switch (netLevel){
case 1:
net = new Net1();
break;
case 2:
net = new Net2();
break;
default:
net = new Net0();
break;
};
if (net !== null){
net.name = "net";
netHeight = net.height;
net.y = ((boatHeight * 0.5) - 6);
if (netEnabled){
netScale = 10;
net.scaleY = 1;
netDeceleration = ((netLevel + 1) * 0.03);
} else {
netScale = 0;
net.scaleY = 0;
netDeceleration = 0;
};
addChild(net);
};
}
public function disableBoat():void{
removeEventListener(Event.ENTER_FRAME, enterFrame);
checkTimer.reset();
if (soundPlaying !== null){
controller.stopSound(soundPlaying);
};
}
private function checkTick(_arg1):void{
var _local2:int;
if (netEnabled){
if (netScale == 10){
checkPoints = [];
_local2 = Math.round(((rotation + 180) / 45));
if (_local2 < 2){
_local2 = (_local2 + 7);
} else {
_local2--;
};
if (((!((xSpeed === 0))) || (!((ySpeed === 0))))){
vacuumPoint.x = (0 - xSpeed);
vacuumPoint.y = (0 - ySpeed);
vacuumPoint.normalize((((boatHeight + netHeight) - 4) * 0.5));
vacuumPoint.x = (vacuumPoint.x + x);
vacuumPoint.y = (vacuumPoint.y + y);
};
if ((((((vacuumPoint.x > 0)) && ((vacuumPoint.x < map.widthPixels)))) && ((vacuumPoint.y < map.heightPixels)))){
checkPoints.push(vacuumPoint.clone());
};
extraPoint2 = vacuumPoint.clone();
switch (netLevel){
case 1:
switch (_local2){
case 1:
case 5:
if ((vacuumPoint.y % map.tileHeightPixels) > 5){
extraPoint2.y = (extraPoint2.y + map.tileHeightPixels);
} else {
extraPoint2.y = (extraPoint2.y - map.tileHeightPixels);
};
break;
case 2:
extraPoint2.y = (extraPoint2.y + map.tileHeightPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (extraPoint2.x + map.tileWidthPixels);
extraPoint2.y = vacuumPoint.y;
break;
case 3:
case 7:
if ((vacuumPoint.x % map.tileHeightPixels) > 5){
extraPoint2.x = (extraPoint2.x + map.tileWidthPixels);
} else {
extraPoint2.x = (extraPoint2.x - map.tileWidthPixels);
};
break;
case 4:
extraPoint2.y = (extraPoint2.y + map.tileHeightPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (extraPoint2.x - map.tileWidthPixels);
extraPoint2.y = vacuumPoint.y;
break;
case 6:
extraPoint2.y = (extraPoint2.y - map.tileHeightPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (extraPoint2.x - map.tileWidthPixels);
extraPoint2.y = vacuumPoint.y;
break;
case 8:
extraPoint2.y = (extraPoint2.y - map.tileHeightPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (extraPoint2.x + map.tileWidthPixels);
extraPoint2.y = vacuumPoint.y;
break;
};
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
break;
case 2:
switch (_local2){
case 1:
case 5:
extraPoint2.y = (extraPoint2.y + map.tileHeightPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.y = (vacuumPoint.y - map.tileHeightPixels);
break;
case 2:
extraPoint2.y = (extraPoint2.y + map.tileHeightPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (extraPoint2.x - map.tileWidthPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (vacuumPoint.x + map.tileWidthPixels);
extraPoint2.y = vacuumPoint.y;
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.y = (extraPoint2.y - map.tileHeightPixels);
break;
case 3:
case 7:
extraPoint2.x = (extraPoint2.x + map.tileWidthPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (vacuumPoint.x - map.tileWidthPixels);
break;
case 4:
extraPoint2.y = (extraPoint2.y + map.tileHeightPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (extraPoint2.x + map.tileWidthPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (vacuumPoint.x - map.tileWidthPixels);
extraPoint2.y = vacuumPoint.y;
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.y = (extraPoint2.y - map.tileHeightPixels);
break;
case 6:
extraPoint2.y = (extraPoint2.y - map.tileHeightPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (extraPoint2.x + map.tileWidthPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (vacuumPoint.x - map.tileWidthPixels);
extraPoint2.y = vacuumPoint.y;
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.y = (extraPoint2.y - map.tileHeightPixels);
break;
case 8:
extraPoint2.y = (extraPoint2.y - map.tileHeightPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (extraPoint2.x - map.tileWidthPixels);
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.x = (vacuumPoint.x + map.tileWidthPixels);
extraPoint2.y = vacuumPoint.y;
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
extraPoint2.y = (extraPoint2.y + map.tileHeightPixels);
break;
};
if ((((((extraPoint2.x > 0)) && ((extraPoint2.x < map.widthPixels)))) && ((extraPoint2.y < map.heightPixels)))){
checkPoints.push(extraPoint2.clone());
};
break;
};
if (checkPoints.length > 0){
map.checkBoatTile(checkPoints);
};
} else {
net.scaleY = (++netScale * 0.1);
};
} else {
if (netScale > 0){
net.scaleY = (--netScale * 0.1);
};
};
if (net.scaleY > 0.5){
netDeceleration = ((netLevel + 1) * 0.03);
} else {
netDeceleration = 0;
};
}
private function enterFrame(_arg1):void{
targetPoint.x = map.mouseX;
targetPoint.y = map.mouseY;
targetDistance = Point.distance(boatPoint, targetPoint);
if (targetDistance > range){
playSound((("motor" + (accelerationLevel + topSpeedLevel)) + "MP3"));
moveTowardsTarget();
} else {
playSound("motorIdleMP3");
if (((!((xSpeed === 0))) || (!((ySpeed === 0))))){
coastToStop();
};
};
}
public function changeTopSpeedLevel(_arg1:uint):void{
topSpeedLevel = _arg1;
topSpeed = (3 + (topSpeedLevel * 0.75));
addMotor();
}
}
}//package
Section 8
//BoatLayer (BoatLayer)
package {
import flash.display.*;
public dynamic class BoatLayer extends Sprite {
}
}//package
Section 9
//ButtonCancel (ButtonCancel)
package {
import flash.display.*;
public dynamic class ButtonCancel extends SimpleButton {
}
}//package
Section 10
//ButtonPause (ButtonPause)
package {
import flash.display.*;
public dynamic class ButtonPause extends SimpleButton {
}
}//package
Section 11
//CashRegister (CashRegister)
package {
public class CashRegister extends CustSound {
}
}//package
Section 12
//CheckMark (CheckMark)
package {
import flash.display.*;
public dynamic class CheckMark extends Sprite {
}
}//package
Section 13
//ClickHere (ClickHere)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class ClickHere extends MovieClip {
public function ClickHere(){
addEventListener(MouseEvent.CLICK, gotoSponsorWebsite);
}
private function gotoSponsorWebsite(_arg1){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.addictinggames.com");
navigateToURL(_local2, "_blank");
}
}
}//package
Section 14
//Controller (Controller)
package {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.net.*;
public class Controller extends Sprite {
private var difficultyScreen:DifficultyScreen;
private var motor9MP3:Motor9MP3;
private var schoolTimer:Timer;
private var finalScoreScreen:FinalScoreScreen;
private var motor4MP3:Motor4MP3;
private var realTitleScreen:Boolean;
private var motorIdleMP3:MotorIdleMP3;
private var turtlesGot:uint;
private var intro:IntroMusic;
private var flameLoop:FireOneSecond;
private var sharksGot:uint;
private var spillVille:SpillVille2;
private var motor5MP3:Motor5MP3;
private var aGteaser_mc:AGteaser_mc;
private var critterDeath:CritterDeath;
private var maxTurtles:uint;
private var motor0MP3:Motor0MP3;
private var totalTurtlesGot:uint;
private var totalTurtlePoints:int;
private var musicVolumeControl:MusicVolumeControl;
private var flareWhistleMP3:FlareWhistleMP3;
private var points:int;
private var motor6MP3:Motor6MP3;
private var titleScreen;
private var flameStart:FireStart;
private var cashRegister:CashRegister;
private var motor1MP3:Motor1MP3;
private var fishGot:uint;
private var motor10MP3:Motor10MP3;
public var uiLayer:UILayer;
private var sharkPoints:uint;
private var roundNum:uint;
private var secondTimer:Timer;
private var totalFishGot:uint;
private var fxVolumeControl:FXVolumeControl;
private var turtlePoints:int;
private var totalSharkPoints:uint;
private var totalPoints:int;
private var motor7MP3:Motor7MP3;
public var boat:Boat;
private var fishPoints:uint;
private var schoolTicks:uint;
private var map:Map;
private var ticksPerMove:uint;
private var flameSoundFlag:Boolean;
private var motor2MP3:Motor2MP3;
private var instructionDialog:InstructionDialog;
private var pixelsPerLayerMove:Number;
private var critterFrameTimerDelay:uint;
private var highestMultiplier:uint;
private var ticksPerMoveHalfway:uint;
private var totalSharksGot:uint;
private var scoreScreen:ScoreScreen;
private var hoursRemaining:int;
private var upgradeScreen:UpgradeScreen;
private var motor8MP3:Motor8MP3;
private var maxSharks:uint;
private var difficulty:uint;
public var multiplier:uint;
private var theme:ThemeMusic;
private var totalFishPoints:uint;
private var schoolTickCounter:uint;
private var motor3MP3:Motor3MP3;
private var minutesRemaining:int;
public static var main;
public function Controller(){
aGteaser_mc = new AGteaser_mc();
aGteaser_mc.x = -58;
aGteaser_mc.y = 30;
aGteaser_mc.width = 550;
aGteaser_mc.height = 520;
addChild(aGteaser_mc);
aGteaser_mc.addEventListener(Event.COMPLETE, initialLoad);
}
private function createUpgradeScreen():void{
var _local1:uint;
var _local2:uint;
var _local3:StartButton;
upgradeScreen = new UpgradeScreen();
upgradeScreen.startButton.alpha = 0;
upgradeScreen.dayDisplay.text = ("Day " + roundNum);
upgradeScreen.pointsRemaining.text = points.toString();
upgradeScreen.x = 235;
upgradeScreen.y = 235;
_local2 = 1;
while (_local2 <= 3) {
_local1 = 1;
while (_local1 <= 5) {
if ((((_local2 < 3)) || ((_local1 < 3)))){
upgradeScreen[(("price" + _local1) + _local2)].text = boat.costArray[(_local2 - 1)][(_local1 - 1)].toString();
};
_local1++;
};
_local2++;
};
if (boat.accelerationLevel > 0){
_local1 = 0;
while (_local1 < boat.accelerationLevel) {
upgradeScreen.addChild(newCheckMark(((_local1 * 48.5) - 102.5), -104));
_local1++;
};
};
if (boat.topSpeedLevel > 0){
_local1 = 0;
while (_local1 < boat.topSpeedLevel) {
upgradeScreen.addChild(newCheckMark(((_local1 * 48.5) - 102.5), -44));
_local1++;
};
};
if (boat.netLevel > 0){
_local1 = 0;
while (_local1 < boat.netLevel) {
switch (_local1){
case 0:
upgradeScreen.addChild(newCheckMark(-72.5, 37.5));
break;
case 1:
upgradeScreen.addChild(newCheckMark(55.5, 40.5));
break;
};
_local1++;
};
};
if ((((boat.accelerationLevel < 5)) && ((boat.costArray[0][boat.accelerationLevel] <= points)))){
upgradeScreen.addChild(newStartButton((-109.7 + (boat.accelerationLevel * 48.5)), -99, ("a" + boat.accelerationLevel)));
};
if ((((boat.topSpeedLevel < 5)) && ((boat.costArray[1][boat.topSpeedLevel] <= points)))){
upgradeScreen.addChild(newStartButton((-109.7 + (boat.topSpeedLevel * 48.5)), -39, ("t" + boat.topSpeedLevel)));
};
if ((((boat.netLevel < 2)) && ((boat.costArray[2][boat.netLevel] <= points)))){
switch (boat.netLevel){
case 0:
upgradeScreen.addChild(newStartButton(-72.5, 37.5, ("n" + boat.netLevel), 55, 55));
break;
case 1:
upgradeScreen.addChild(newStartButton(55.5, 40.5, ("n" + boat.netLevel), 71, 61));
break;
};
};
upgradeScreen.startButton.addEventListener(MouseEvent.CLICK, startRound);
uiLayer.addictingGames.visible = false;
uiLayer.addChild(upgradeScreen);
uiLayer.setChildIndex(musicVolumeControl, (uiLayer.numChildren - 1));
uiLayer.setChildIndex(fxVolumeControl, (uiLayer.numChildren - 2));
uiLayer.setChildIndex(uiLayer.addictingGames, (uiLayer.numChildren - 3));
}
public function stopSound(_arg1:String):void{
this[_arg1].stop();
}
private function newCheckMark(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:Number=1):CheckMark{
var _local5:CheckMark;
_local5 = new CheckMark();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.scaleX = _arg3;
_local5.scaleY = _arg4;
return (_local5);
}
public function playSound(_arg1:String, _arg2:Number=0, _arg3:int=0, _arg4:SoundTransform=null):void{
this[_arg1].play(_arg2, _arg3, _arg4);
}
private function initialLoad(_arg1){
var _local2:uint;
removeChild(aGteaser_mc);
aGteaser_mc.removeEventListener(Event.COMPLETE, initialLoad);
aGteaser_mc = null;
main = this;
spillVille = SpillVille2.main;
map = new Map();
map.name = "map";
spillVille.addChild(map);
uiLayer = new UILayer();
uiLayer.name = "uiLayer";
uiLayer.score.visible = false;
uiLayer.timeRemaining.visible = false;
uiLayer.multiplier.visible = false;
uiLayer.buttonPause.visible = false;
uiLayer.buttonPause.addEventListener(MouseEvent.CLICK, pauseGame);
spillVille.addChild(uiLayer);
instructionDialog = null;
realTitleScreen = true;
titleScreen = new TitleScreen();
titleScreen.startButton.alpha = 0;
titleScreen.instructionButton.alpha = 0;
titleScreen.authorWebsite.alpha = 0;
uiLayer.addChild(titleScreen);
map.controller = this;
schoolTimer = new Timer(100);
schoolTimer.addEventListener(TimerEvent.TIMER, schoolTimerTick);
secondTimer = new Timer(1000);
secondTimer.addEventListener(TimerEvent.TIMER, secondTimerTick);
musicVolumeControl = uiLayer.musicVolumeControl;
musicVolumeControl.buttonCancel.visible = false;
musicVolumeControl.musicalNote.addEventListener(MouseEvent.CLICK, muteMusic);
uiLayer.setChildIndex(musicVolumeControl, (uiLayer.numChildren - 1));
musicVolumeControl.volumeKnob.addEventListener(MouseEvent.MOUSE_DOWN, volumeKnobDown);
fxVolumeControl = uiLayer.fxVolumeControl;
fxVolumeControl.buttonCancel.visible = false;
fxVolumeControl.fxSymbol.addEventListener(MouseEvent.CLICK, muteFX);
uiLayer.setChildIndex(fxVolumeControl, (uiLayer.numChildren - 2));
fxVolumeControl.volumeKnob.addEventListener(MouseEvent.MOUSE_DOWN, volumeKnobDown);
uiLayer.addictingGames.addEventListener(MouseEvent.CLICK, gotoSponsorWebsite);
uiLayer.setChildIndex(uiLayer.addictingGames, (uiLayer.numChildren - 3));
intro = new IntroMusic();
intro.setVolume(0.5);
intro.play();
theme = new ThemeMusic();
theme.setVolume(0.5);
flameStart = new FireStart();
flameStart.setVolume(0.5);
flameLoop = new FireOneSecond();
flameLoop.setVolume(0.5);
flameSoundFlag = false;
critterDeath = new CritterDeath();
critterDeath.setVolume(0.5);
cashRegister = new CashRegister();
cashRegister.setVolume(0.5);
flareWhistleMP3 = new FlareWhistleMP3();
flareWhistleMP3.setVolume(0.5);
motorIdleMP3 = new MotorIdleMP3();
motorIdleMP3.setVolume(0.5);
motor0MP3 = new Motor0MP3();
motor1MP3 = new Motor1MP3();
motor2MP3 = new Motor2MP3();
motor3MP3 = new Motor3MP3();
motor4MP3 = new Motor4MP3();
motor5MP3 = new Motor5MP3();
motor6MP3 = new Motor6MP3();
motor7MP3 = new Motor7MP3();
motor8MP3 = new Motor8MP3();
motor9MP3 = new Motor9MP3();
motor10MP3 = new Motor10MP3();
_local2 = 0;
while (_local2 <= 10) {
this[(("motor" + _local2) + "MP3")].setVolume(0.5);
_local2++;
};
titleScreen.startButton.addEventListener(MouseEvent.CLICK, startGame);
titleScreen.instructionButton.addEventListener(MouseEvent.CLICK, instructions);
titleScreen.authorWebsite.addEventListener(MouseEvent.CLICK, gotoAuthorWebsite);
ticksPerMove = 10;
ticksPerMoveHalfway = 5;
pixelsPerLayerMove = 2;
schoolTickCounter = (ticksPerMove - 1);
}
private function startRound(_arg1):void{
upgradeScreen.startButton.removeEventListener(MouseEvent.CLICK, startRound);
uiLayer.buttonPause.visible = true;
uiLayer.removeChild(upgradeScreen);
upgradeScreen = null;
uiLayer.addictingGames.visible = true;
uiLayer.score.scoreDisplay.text = totalPoints.toString();
hoursRemaining = 8;
minutesRemaining = 0;
uiLayer.timeRemaining.timeDisplay.text = (((hoursRemaining + ":") + ((minutesRemaining)<10) ? ("0" + minutesRemaining) : minutesRemaining) + " hrs");
fishGot = (sharksGot = (turtlesGot = 0));
fishPoints = (sharkPoints = (turtlePoints = 0));
map.loadMap("242480808080C0");
multiplier = 1;
uiLayer.multiplier.multiplier.text = multiplier.toString();
map.pixelsPerLayerMove = 2;
map.maxNumSchoolsRound = 4;
schoolTicks = 0;
boat.enableBoat();
map.enableNetClick();
switch (roundNum){
case 1:
schoolTimer.delay = (100 - (difficulty * 10));
break;
case 2:
schoolTimer.delay = (95 - (difficulty * 10));
break;
case 3:
schoolTimer.delay = 91;
(-(difficulty) * 10);
break;
case 4:
schoolTimer.delay = (88 - (difficulty * 10));
break;
case 5:
schoolTimer.delay = (85 - (difficulty * 10));
break;
case 6:
schoolTimer.delay = (82 - (difficulty * 10));
break;
case 7:
schoolTimer.delay = (79 - (difficulty * 10));
break;
case 8:
schoolTimer.delay = (76 - (difficulty * 10));
break;
case 9:
schoolTimer.delay = (73 - (difficulty * 10));
break;
case 10:
schoolTimer.delay = (70 - (difficulty * 10));
break;
default:
break;
};
critterFrameTimerDelay = ((schoolTimer.delay * 2) - 50);
schoolTimer.start();
secondTimer.start();
if (!musicVolumeControl.buttonCancel.visible){
theme.setVolume(((musicVolumeControl.volumeKnob.x + 25) / 50));
};
theme.play();
}
private function scoreOKClicked(_arg1):void{
scoreScreen.okButton.removeEventListener(MouseEvent.CLICK, scoreOKClicked);
uiLayer.removeChild(scoreScreen);
scoreScreen = null;
if (roundNum > 10){
createFinalScoreScreen();
} else {
createUpgradeScreen();
};
}
private function gotoSponsorWebsite(_arg1){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.addictinggames.com");
navigateToURL(_local2, "_blank");
}
private function secondTimerTick(_arg1):void{
minutesRemaining = (minutesRemaining - 5);
if (minutesRemaining < 0){
minutesRemaining = 55;
hoursRemaining--;
};
uiLayer.timeRemaining.timeDisplay.text = (((hoursRemaining + ":") + ((minutesRemaining)<10) ? ("0" + minutesRemaining) : minutesRemaining) + " hrs");
if ((((hoursRemaining == 0)) && ((minutesRemaining == 0)))){
roundOver();
} else {
if (map.sharkArray.length < maxSharks){
new Shark(critterFrameTimerDelay);
};
if (map.babySeaTurtleArray.length < maxTurtles){
new BabySeaTurtle(critterFrameTimerDelay);
};
};
}
private function newStartButton(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Number=25, _arg5:Number=25, _arg6:Number=0, _arg7:uint=0){
var _local8:*;
_local8 = new StartButton();
_local8.addEventListener(MouseEvent.CLICK, upgradeBoatLevel);
_local8.width = _arg4;
_local8.height = _arg5;
_local8.x = _arg1;
_local8.y = _arg2;
_local8.name = _arg3;
_local8.alpha = _arg6;
return (_local8);
}
private function unmuteFX(_arg1):void{
var _local2:Number;
var _local3:uint;
fxVolumeControl.buttonCancel.removeEventListener(MouseEvent.CLICK, unmuteFX);
fxVolumeControl.fxSymbol.addEventListener(MouseEvent.CLICK, muteFX);
fxVolumeControl.buttonCancel.visible = false;
_local2 = ((fxVolumeControl.volumeKnob.x + 25) / 50);
flameStart.setVolume(_local2);
flameLoop.setVolume(_local2);
critterDeath.setVolume(_local2);
cashRegister.setVolume(_local2);
flareWhistleMP3.setVolume(_local2);
motorIdleMP3.setVolume(_local2);
_local3 = 0;
while (_local3 <= 10) {
this[(("motor" + _local3) + "MP3")].setVolume(_local2);
_local3++;
};
}
private function volumeKnobMove(_arg1:MouseEvent):void{
var _local2:*;
var _local3:Number;
var _local4:Number;
var _local5:uint;
_local2 = ((_arg1.target.name)=="volumeKnob") ? _arg1.target : _arg1.target.parent.volumeKnob;
_local3 = _local2.parent.mouseX;
if ((((_local3 > -25)) && ((_local3 < 25)))){
_local2.x = _local3;
if (_local2.parent.buttonCancel.visible == false){
_local4 = ((_local2.x + 25) / 50);
if (_local2.parent.name == "musicVolumeControl"){
intro.setVolume(_local4);
theme.setVolume(_local4);
} else {
flameStart.setVolume(_local4);
flameLoop.setVolume(_local4);
critterDeath.setVolume(_local4);
cashRegister.setVolume(_local4);
flareWhistleMP3.setVolume(_local4);
motorIdleMP3.setVolume(_local4);
_local5 = 0;
while (_local5 <= 10) {
this[(("motor" + _local5) + "MP3")].setVolume(_local4);
_local5++;
};
};
};
};
}
private function unpauseGame(_arg1):void{
titleScreen.startButton.removeEventListener(MouseEvent.ROLL_OVER, highlightButton);
titleScreen.startButton.removeEventListener(MouseEvent.ROLL_OUT, hideButton);
titleScreen.quitButton.removeEventListener(MouseEvent.ROLL_OVER, highlightButton);
titleScreen.quitButton.removeEventListener(MouseEvent.ROLL_OUT, hideButton);
titleScreen.startButton.removeEventListener(MouseEvent.CLICK, startGame);
titleScreen.quitButton.removeEventListener(MouseEvent.CLICK, quitGame);
titleScreen.unpauseButton.removeEventListener(MouseEvent.CLICK, unpauseGame);
uiLayer.removeChild(titleScreen);
titleScreen = null;
map.unpauseGame();
schoolTimer.start();
secondTimer.start();
boat.enableBoat();
theme.unpause();
if (flameSoundFlag){
flameLoop.unpause();
};
critterDeath.unpause();
motorIdleMP3.unpause();
this[(("motor" + (boat.accelerationLevel + boat.topSpeedLevel)) + "MP3")].unpause();
uiLayer.buttonPause.visible = true;
}
private function restartGame(_arg1):void{
titleScreen.startButton.removeEventListener(MouseEvent.CLICK, restartGame);
map.loadMap("242480808080C0");
map.boatLayer.removeChild(boat);
map.killAllCritters();
boat = null;
startGame(1);
}
private function muteFX(_arg1):void{
var _local2:uint;
fxVolumeControl.fxSymbol.removeEventListener(MouseEvent.CLICK, muteFX);
fxVolumeControl.buttonCancel.addEventListener(MouseEvent.CLICK, unmuteFX);
fxVolumeControl.buttonCancel.visible = true;
flameStart.mute();
flameLoop.mute();
critterDeath.mute();
cashRegister.mute();
flareWhistleMP3.mute();
motorIdleMP3.mute();
_local2 = 0;
while (_local2 <= 10) {
this[(("motor" + _local2) + "MP3")].mute();
_local2++;
};
}
private function quitGame(_arg1):void{
var _local2:uint;
if (titleScreen.startButton){
titleScreen.startButton.removeEventListener(MouseEvent.CLICK, quitGame);
titleScreen.startButton.removeEventListener(MouseEvent.CLICK, startGame);
titleScreen.startButton.removeEventListener(MouseEvent.ROLL_OVER, highlightButton);
titleScreen.startButton.removeEventListener(MouseEvent.ROLL_OUT, hideButton);
};
if (titleScreen.quitButton){
titleScreen.quitButton.removeEventListener(MouseEvent.ROLL_OVER, highlightButton);
titleScreen.quitButton.removeEventListener(MouseEvent.ROLL_OUT, hideButton);
titleScreen.quitButton.removeEventListener(MouseEvent.CLICK, quitGame);
};
if (titleScreen.unpauseButton){
titleScreen.unpauseButton.removeEventListener(MouseEvent.CLICK, unpauseGame);
};
uiLayer.removeChild(titleScreen);
titleScreen = null;
map.loadMap("242480808080C0");
map.boatLayer.removeChild(boat);
boat = null;
map.killAllCritters();
uiLayer.score.visible = false;
uiLayer.timeRemaining.visible = false;
uiLayer.multiplier.visible = false;
uiLayer.buttonPause.visible = false;
realTitleScreen = true;
titleScreen = new TitleScreen();
titleScreen.startButton.alpha = 0;
titleScreen.instructionButton.alpha = 0;
titleScreen.authorWebsite.alpha = 0;
uiLayer.addChild(titleScreen);
uiLayer.setChildIndex(musicVolumeControl, (uiLayer.numChildren - 1));
uiLayer.setChildIndex(fxVolumeControl, (uiLayer.numChildren - 2));
uiLayer.setChildIndex(uiLayer.addictingGames, (uiLayer.numChildren - 3));
theme.stop();
flameStart.stop();
flameLoop.stop();
flameSoundFlag = false;
critterDeath.stop();
cashRegister.stop();
flareWhistleMP3.stop();
motorIdleMP3.stop();
_local2 = 0;
while (_local2 <= 10) {
this[(("motor" + _local2) + "MP3")].stop();
_local2++;
};
intro.play();
titleScreen.startButton.addEventListener(MouseEvent.CLICK, startGame);
titleScreen.instructionButton.addEventListener(MouseEvent.CLICK, instructions);
titleScreen.authorWebsite.addEventListener(MouseEvent.CLICK, gotoAuthorWebsite);
}
private function createScoreScreen():void{
scoreScreen = new ScoreScreen();
scoreScreen.okButton.alpha = 0;
scoreScreen.x = 235;
scoreScreen.y = 235;
scoreScreen.scoreScreenTitle.text = (("Day " + roundNum) + " Totals");
scoreScreen.fishGot.text = fishGot.toString();
scoreScreen.sharksGot.text = sharksGot.toString();
scoreScreen.turtlesGot.text = turtlesGot.toString();
scoreScreen.pointMultiplier.text = multiplier.toString();
scoreScreen.fishPoints.text = fishPoints.toString();
scoreScreen.sharkPoints.text = sharkPoints.toString();
scoreScreen.turtlePoints.text = turtlePoints.toString();
scoreScreen.todaysPoints.text = ((fishPoints + sharkPoints) + turtlePoints).toString();
scoreScreen.previousPoints.text = (points - parseInt(scoreScreen.todaysPoints.text)).toString();
scoreScreen.remainingPoints.text = points.toString();
scoreScreen.okButton.addEventListener(MouseEvent.CLICK, scoreOKClicked);
if (multiplier > highestMultiplier){
highestMultiplier = multiplier;
};
uiLayer.addChild(scoreScreen);
uiLayer.setChildIndex(musicVolumeControl, (uiLayer.numChildren - 1));
uiLayer.setChildIndex(fxVolumeControl, (uiLayer.numChildren - 2));
uiLayer.setChildIndex(uiLayer.addictingGames, (uiLayer.numChildren - 3));
}
private function highlightButton(_arg1:MouseEvent):void{
_arg1.target.alpha = 0.2;
}
private function unmuteMusic(_arg1):void{
musicVolumeControl.buttonCancel.removeEventListener(MouseEvent.CLICK, unmuteMusic);
musicVolumeControl.musicalNote.addEventListener(MouseEvent.CLICK, muteMusic);
musicVolumeControl.buttonCancel.visible = false;
intro.setVolume(((musicVolumeControl.volumeKnob.x + 25) / 50));
theme.setVolume(((musicVolumeControl.volumeKnob.x + 25) / 50));
}
private function hideButton(_arg1:MouseEvent):void{
_arg1.target.alpha = 0;
}
public function gotFish():void{
points = (points + multiplier);
totalPoints = (totalPoints + multiplier);
fishPoints = (fishPoints + multiplier);
totalFishPoints = (totalFishPoints + multiplier);
uiLayer.score.scoreDisplay.text = totalPoints.toString();
fishGot++;
totalFishGot++;
}
private function pauseGame(_arg1):void{
uiLayer.buttonPause.visible = false;
map.pauseGame();
schoolTimer.stop();
secondTimer.stop();
boat.disableBoat();
theme.pause();
if (flameSoundFlag){
flameLoop.pause();
};
critterDeath.pause();
flareWhistleMP3.stop();
motorIdleMP3.pause();
this[(("motor" + (boat.accelerationLevel + boat.topSpeedLevel)) + "MP3")].pause();
titleScreen = new PauseMenu();
titleScreen.x = 235;
titleScreen.y = 235;
titleScreen.startButton.alpha = 0;
titleScreen.quitButton.alpha = 0;
titleScreen.unpauseButton.alpha = 0;
titleScreen.startButton.addEventListener(MouseEvent.ROLL_OVER, highlightButton);
titleScreen.startButton.addEventListener(MouseEvent.ROLL_OUT, hideButton);
titleScreen.quitButton.addEventListener(MouseEvent.ROLL_OVER, highlightButton);
titleScreen.quitButton.addEventListener(MouseEvent.ROLL_OUT, hideButton);
titleScreen.startButton.addEventListener(MouseEvent.CLICK, restartGame);
titleScreen.quitButton.addEventListener(MouseEvent.CLICK, quitGame);
titleScreen.unpauseButton.addEventListener(MouseEvent.CLICK, unpauseGame);
uiLayer.addChild(titleScreen);
}
private function createDifficultyScreen():void{
difficultyScreen = new DifficultyScreen();
difficultyScreen.easyButton.alpha = 0;
difficultyScreen.medButton.alpha = 0;
difficultyScreen.hardButton.alpha = 0;
difficultyScreen.x = 235;
difficultyScreen.y = 235;
difficultyScreen.easyButton.addEventListener(MouseEvent.CLICK, difficultySelected);
difficultyScreen.medButton.addEventListener(MouseEvent.CLICK, difficultySelected);
difficultyScreen.hardButton.addEventListener(MouseEvent.CLICK, difficultySelected);
uiLayer.addChild(difficultyScreen);
uiLayer.setChildIndex(musicVolumeControl, (uiLayer.numChildren - 1));
uiLayer.setChildIndex(fxVolumeControl, (uiLayer.numChildren - 2));
uiLayer.setChildIndex(uiLayer.addictingGames, (uiLayer.numChildren - 3));
}
public function stopFlameSound():void{
if (flameSoundFlag){
flameSoundFlag = false;
flameLoop.fadeStop(300);
};
}
public function flameStartSound():void{
flameStart.play();
}
private function volumeKnobUp(_arg1:MouseEvent):void{
var _local2:*;
switch (_arg1.target.name){
case "volumeKnob":
_local2 = _arg1.target;
break;
case "fxVolumeControl":
case "musicVolumeControl":
_local2 = _arg1.target.volumeKnob;
break;
default:
_local2 = _arg1.target.parent.volumeKnob;
break;
};
_local2.parent.removeEventListener(MouseEvent.MOUSE_UP, volumeKnobUp);
_local2.parent.removeEventListener(MouseEvent.ROLL_OUT, volumeKnobUp);
_local2.parent.removeEventListener(MouseEvent.MOUSE_MOVE, volumeKnobMove);
_local2.addEventListener(MouseEvent.MOUSE_DOWN, volumeKnobDown);
}
private function finalScoreOKClicked(_arg1):void{
finalScoreScreen.okButton.removeEventListener(MouseEvent.CLICK, finalScoreOKClicked);
uiLayer.removeChild(finalScoreScreen);
finalScoreScreen = null;
winGame();
}
private function startGame(_arg1):void{
intro.fadeStop(500);
roundNum = 1;
highestMultiplier = (points = (totalPoints = (totalFishGot = (totalSharksGot = (totalTurtlesGot = (totalFishPoints = (totalSharkPoints = (totalTurtlePoints = 0))))))));
map.resetCritterStatus();
uiLayer.score.visible = true;
uiLayer.timeRemaining.visible = true;
uiLayer.multiplier.visible = true;
if (instructionDialog !== null){
instructionDialog.startButton.removeEventListener(MouseEvent.CLICK, startGame);
instructionDialog.kill();
instructionDialog = null;
};
if (titleScreen.startButton){
titleScreen.startButton.removeEventListener(MouseEvent.CLICK, startGame);
titleScreen.startButton.removeEventListener(MouseEvent.ROLL_OVER, highlightButton);
titleScreen.startButton.removeEventListener(MouseEvent.ROLL_OUT, hideButton);
};
if (titleScreen.quitButton){
titleScreen.quitButton.removeEventListener(MouseEvent.ROLL_OVER, highlightButton);
titleScreen.quitButton.removeEventListener(MouseEvent.ROLL_OUT, hideButton);
titleScreen.quitButton.removeEventListener(MouseEvent.CLICK, quitGame);
};
if (titleScreen.unpauseButton){
titleScreen.unpauseButton.removeEventListener(MouseEvent.CLICK, unpauseGame);
};
if (titleScreen.instructionButton){
titleScreen.instructionButton.removeEventListener(MouseEvent.CLICK, instructions);
};
if (titleScreen.authorWebsite){
titleScreen.authorWebsite.removeEventListener(MouseEvent.CLICK, gotoAuthorWebsite);
};
if (realTitleScreen){
titleScreen.kill();
} else {
uiLayer.removeChild(titleScreen);
};
titleScreen = null;
realTitleScreen = false;
boat = new Boat(242, 109, -90);
boat.controller = this;
map.boat = boat;
createDifficultyScreen();
}
private function schoolTimerTick(_arg1):void{
switch (++schoolTickCounter){
case ticksPerMoveHalfway:
map.moveSchools();
map.createSchool(((Math.floor((Math.random() * 10)) + 10) + (((difficulty * 2) + roundNum) * 3)), (500 - (difficulty * 100)));
break;
case ticksPerMove:
schoolTickCounter = 0;
map.getNextSchoolMoveDirection();
break;
default:
map.schoolTick();
break;
};
}
private function upgradeBoatLevel(_arg1:MouseEvent):void{
var _local2:String;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local2 = _arg1.target.name.slice(0, 1);
_local3 = parseInt(_arg1.target.name.slice(1));
_local4 = 5;
switch (_local2){
case "a":
_local5 = 0;
break;
case "t":
_local5 = 1;
break;
case "n":
_local5 = 2;
break;
};
if (boat.costArray[_local5][_local3] <= points){
if (_local2 == "n"){
switch (_local3){
case 0:
upgradeScreen.addChild(newCheckMark(-72.5, 37.5));
break;
case 1:
upgradeScreen.addChild(newCheckMark(55.5, 40.5));
break;
};
} else {
upgradeScreen.addChild(newCheckMark(((_local3 * 48.5) - 102.5), (_arg1.target.y - 5)));
};
cashRegister.play();
var _temp1 = _local3;
_local3 = (_local3 + 1);
points = (points - boat.costArray[_local5][_temp1]);
_arg1.target.parent.pointsRemaining.text = points.toString();
uiLayer.score.scoreDisplay.text = totalPoints.toString();
switch (_local2){
case "a":
boat.changeAccelerationLevel(_local3);
break;
case "t":
boat.changeTopSpeedLevel(_local3);
break;
case "n":
boat.changeNetLevel(_local3);
_local4 = 2;
break;
};
if ((((_local3 < _local4)) && ((boat.costArray[_local5][_local3] <= points)))){
if (_local2 == "n"){
switch (_local3){
case 1:
_arg1.target.x = 55.5;
_arg1.target.y = 40.5;
_arg1.target.width = 71;
_arg1.target.height = 61;
break;
};
} else {
_arg1.target.x = (_arg1.target.x + 48.5);
};
_arg1.target.name = (_arg1.target.name.slice(0, 1) + _local3);
} else {
_arg1.target.removeEventListener(MouseEvent.CLICK, upgradeBoatLevel);
_arg1.target.parent.removeChild(_arg1.target);
};
};
}
private function volumeKnobDown(_arg1:MouseEvent):void{
_arg1.target.removeEventListener(MouseEvent.MOUSE_DOWN, volumeKnobDown);
_arg1.target.parent.addEventListener(MouseEvent.MOUSE_MOVE, volumeKnobMove);
_arg1.target.parent.addEventListener(MouseEvent.MOUSE_UP, volumeKnobUp);
_arg1.target.parent.addEventListener(MouseEvent.ROLL_OUT, volumeKnobUp);
}
private function roundOver():void{
schoolTimer.reset();
secondTimer.reset();
boat.disableBoat();
map.disableNetClick();
map.killAllCritters();
uiLayer.buttonPause.visible = false;
theme.fadeStop(500);
if (flameSoundFlag){
flameSoundFlag = false;
flameLoop.fadeStop(300);
};
uiLayer.score.scoreDisplay.text = totalPoints.toString();
createScoreScreen();
roundNum++;
}
private function difficultySelected(_arg1:MouseEvent):void{
difficultyScreen.easyButton.removeEventListener(MouseEvent.CLICK, difficultySelected);
difficultyScreen.medButton.removeEventListener(MouseEvent.CLICK, difficultySelected);
difficultyScreen.hardButton.removeEventListener(MouseEvent.CLICK, difficultySelected);
switch (_arg1.target.name){
case "easyButton":
difficulty = 0;
maxSharks = 2;
maxTurtles = 1;
break;
case "medButton":
difficulty = 1;
maxSharks = 2;
maxTurtles = 2;
break;
case "hardButton":
difficulty = 2;
maxSharks = 1;
maxTurtles = 3;
break;
default:
break;
};
uiLayer.removeChild(difficultyScreen);
createUpgradeScreen();
}
private function createFinalScoreScreen():void{
finalScoreScreen = new FinalScoreScreen();
finalScoreScreen.okButton.alpha = 0;
finalScoreScreen.x = 235;
finalScoreScreen.y = 235;
finalScoreScreen.scoreScreenTitle.text = "Game Totals";
finalScoreScreen.fishGot.text = totalFishGot.toString();
finalScoreScreen.sharksGot.text = totalSharksGot.toString();
finalScoreScreen.turtlesGot.text = totalTurtlesGot.toString();
finalScoreScreen.pointMultiplier.text = highestMultiplier.toString();
finalScoreScreen.fishPoints.text = totalFishPoints.toString();
finalScoreScreen.sharkPoints.text = totalSharkPoints.toString();
finalScoreScreen.turtlePoints.text = totalTurtlePoints.toString();
totalPoints = ((totalFishPoints + totalSharkPoints) + totalTurtlePoints);
finalScoreScreen.totalPoints.text = totalPoints.toString();
finalScoreScreen.okButton.addEventListener(MouseEvent.CLICK, finalScoreOKClicked);
uiLayer.addChild(finalScoreScreen);
uiLayer.setChildIndex(musicVolumeControl, (uiLayer.numChildren - 1));
uiLayer.setChildIndex(fxVolumeControl, (uiLayer.numChildren - 2));
uiLayer.setChildIndex(uiLayer.addictingGames, (uiLayer.numChildren - 3));
}
private function muteMusic(_arg1):void{
musicVolumeControl.musicalNote.removeEventListener(MouseEvent.CLICK, muteMusic);
musicVolumeControl.buttonCancel.addEventListener(MouseEvent.CLICK, unmuteMusic);
musicVolumeControl.buttonCancel.visible = true;
intro.mute();
theme.mute();
}
private function instructions(_arg1):void{
realTitleScreen = false;
intro.fadeStop(500);
titleScreen.startButton.removeEventListener(MouseEvent.CLICK, startGame);
titleScreen.instructionButton.removeEventListener(MouseEvent.CLICK, instructions);
titleScreen.authorWebsite.removeEventListener(MouseEvent.CLICK, gotoAuthorWebsite);
titleScreen.kill();
titleScreen = new InstructionScreen();
instructionDialog = new InstructionDialog(titleScreen);
instructionDialog.startButton.alpha = 0;
uiLayer.addChild(titleScreen);
instructionDialog.startButton.addEventListener(MouseEvent.CLICK, startGame);
}
public function startFlameSound():void{
if (!flameSoundFlag){
flameSoundFlag = true;
flameLoop.play(0, 200);
};
}
public function gotCritter(_arg1:String):void{
var _local2:int;
if (_arg1 == "shark"){
playSound("cashRegister", 0, 0);
_local2 = (multiplier * 10);
sharkPoints = (sharkPoints + _local2);
totalSharkPoints = (totalSharkPoints + _local2);
sharksGot++;
totalSharksGot++;
} else {
playSound("critterDeath", 0, 0);
_local2 = (multiplier * -10);
turtlePoints = (turtlePoints + _local2);
totalTurtlePoints = (totalTurtlePoints + _local2);
turtlesGot++;
totalTurtlesGot++;
};
points = (points + _local2);
totalPoints = (totalPoints + _local2);
uiLayer.score.scoreDisplay.text = totalPoints.toString();
}
private function gameOver():void{
schoolTimer.reset();
secondTimer.reset();
boat.disableBoat();
map.disableNetClick();
map.killAllCritters();
uiLayer.buttonPause.visible = false;
theme.fadeStop(500);
if (flameSoundFlag){
flameSoundFlag = false;
flameLoop.fadeStop(300);
};
titleScreen.x = 235;
titleScreen.y = 235;
titleScreen.startButton.alpha = 0;
titleScreen.startButton.addEventListener(MouseEvent.CLICK, quitGame);
uiLayer.addChild(titleScreen);
uiLayer.setChildIndex(musicVolumeControl, (uiLayer.numChildren - 1));
uiLayer.setChildIndex(fxVolumeControl, (uiLayer.numChildren - 2));
uiLayer.setChildIndex(uiLayer.addictingGames, (uiLayer.numChildren - 3));
}
private function gotoAuthorWebsite(_arg1){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.rr-games.com");
navigateToURL(_local2, "_blank");
}
private function winGame():void{
var _local1:String;
titleScreen = new WinScreen();
_local1 = "";
titleScreen.finalPoints.text = totalPoints.toString();
if ((((((totalFishGot == 0)) && ((totalSharksGot == 0)))) && ((totalTurtlesGot == 0)))){
_local1 = "Lazy Admiral";
} else {
if ((((totalSharksGot == 0)) && ((totalTurtlesGot == 0)))){
_local1 = (_local1 + "Conservationist\n");
} else {
if (totalSharksGot >= 300){
_local1 = (_local1 + "Shark Hunter\n");
} else {
if (totalSharksGot >= 200){
_local1 = (_local1 + "Shark Catcher\n");
} else {
if (totalSharksGot == 0){
_local1 = (_local1 + "Shark Lover\n");
} else {
if (totalFishGot == 0){
_local1 = (_local1 + "Shark Sniper\n");
};
};
};
};
if (totalTurtlesGot >= 100){
_local1 = (_local1 + "Turtle Hater\n");
} else {
if (totalTurtlesGot == 0){
_local1 = (_local1 + "Turtle Lover\n");
} else {
if (totalFishGot == 0){
_local1 = (_local1 + "Turtle Sniper\n");
};
};
};
};
if ((((((boat.accelerationLevel == 0)) && ((boat.topSpeedLevel == 0)))) && ((boat.netLevel == 0)))){
_local1 = (_local1 + "Frugal Captain\n");
};
if (totalPoints <= 0){
_local1 = (_local1 + "Drunken Fisherman");
} else {
if (totalPoints < 15000){
_local1 = (_local1 + "Novice Fisherman");
} else {
if (totalPoints < 30000){
_local1 = (_local1 + "Journeyman Fisherman");
} else {
if (totalPoints < 40000){
_local1 = (_local1 + "Expert Fisherman");
} else {
_local1 = (_local1 + "Master Fisherman");
};
};
};
};
};
titleScreen.finalTitle.text = _local1;
gameOver();
}
}
}//package
Section 15
//CritterDeath (CritterDeath)
package {
public class CritterDeath extends CustSound {
}
}//package
Section 16
//CritterLayer (CritterLayer)
package {
import flash.display.*;
public dynamic class CritterLayer extends Sprite {
}
}//package
Section 17
//CustSound (CustSound)
package {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
public class CustSound extends Sound {
private var globalLoops:int;
private var fadeStopTimer:Timer;
private var custSoundTransform:SoundTransform;
private var fadeStopDecreaseAmount:Number;
private var globalSndTransform:SoundTransform;
private var muteFlag:Boolean;
private var custSoundChannel:SoundChannel;
private var unmutedVolume:Number;
private var soundPosition:Number;
public function CustSound(){
custSoundChannel = new SoundChannel();
custSoundTransform = new SoundTransform();
muteFlag = false;
fadeStopTimer = new Timer(100);
fadeStopTimer.addEventListener(TimerEvent.TIMER, fadeStopTimerTick);
}
public function stop():void{
custSoundChannel.stop();
}
public function fadeStop(_arg1:uint):void{
fadeStopTimer.reset();
fadeStopDecreaseAmount = (unmutedVolume / (_arg1 / 100));
fadeStopTimer.start();
}
public function mute():void{
muteFlag = true;
custSoundTransform = custSoundChannel.soundTransform;
custSoundTransform.volume = 0;
custSoundChannel.soundTransform = custSoundTransform;
}
private function fadeStopTimerTick(_arg1):void{
custSoundTransform = custSoundChannel.soundTransform;
if (custSoundTransform.volume > fadeStopDecreaseAmount){
custSoundTransform.volume = (custSoundTransform.volume - fadeStopDecreaseAmount);
custSoundChannel.soundTransform = custSoundTransform;
} else {
stop();
fadeStopTimer.reset();
};
}
public function setVolume(_arg1:Number):void{
muteFlag = false;
custSoundTransform = custSoundChannel.soundTransform;
custSoundTransform.volume = (unmutedVolume = _arg1);
custSoundChannel.soundTransform = custSoundTransform;
}
public function unpause():void{
if (soundPosition > 1){
play(soundPosition, globalLoops, globalSndTransform);
};
}
public function umute():void{
setVolume(unmutedVolume);
}
override public function play(_arg1:Number=0, _arg2:int=0, _arg3:SoundTransform=null):SoundChannel{
if (fadeStopTimer.running){
stop();
fadeStopTimer.reset();
};
globalLoops = _arg2;
globalSndTransform = _arg3;
custSoundChannel = super.play(_arg1, _arg2, _arg3);
custSoundTransform = custSoundChannel.soundTransform;
custSoundTransform.volume = (muteFlag) ? 0 : unmutedVolume;
custSoundChannel.soundTransform = custSoundTransform;
return (custSoundChannel);
}
public function pause():void{
soundPosition = custSoundChannel.position;
stop();
}
}
}//package
Section 18
//DifficultyScreen (DifficultyScreen)
package {
import flash.display.*;
public dynamic class DifficultyScreen extends Sprite {
public var medButton:StartButton;
public var easyButton:StartButton;
public var hardButton:StartButton;
}
}//package
Section 19
//EmptyButton (EmptyButton)
package {
import flash.display.*;
public dynamic class EmptyButton extends Sprite {
}
}//package
Section 20
//EmptyScreen (EmptyScreen)
package {
import flash.display.*;
public dynamic class EmptyScreen extends Sprite {
}
}//package
Section 21
//FinalScoreScreen (FinalScoreScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class FinalScoreScreen extends Sprite {
public var fishGot:TextField;
public var okButton:StartButton;
public var turtlePoints:TextField;
public var fishPoints:TextField;
public var totalPoints:TextField;
public var scoreScreenTitle:TextField;
public var sharkPoints:TextField;
public var pointMultiplier:TextField;
public var turtlesGot:TextField;
public var sharksGot:TextField;
}
}//package
Section 22
//FireBall (FireBall)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class FireBall extends MovieClip {
private var fireBallPoint:Point;
private var ySpeed:Number;
private var map:Map;
private var targetPoint:Point;
private var extraPoint:Point;
private var targetDistance:Number;
private var xSpeed:Number;
private var boatLayer:BoatLayer;
private var topSpeed:Number;
public function FireBall(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
map = Map.main;
boatLayer = map.boatLayer;
name = "fireBall";
x = _arg1;
y = _arg2;
topSpeed = 10;
fireBallPoint = new Point(x, y);
targetPoint = new Point(_arg3, _arg4);
extraPoint = targetPoint.subtract(fireBallPoint);
extraPoint.normalize(topSpeed);
xSpeed = extraPoint.x;
ySpeed = extraPoint.y;
rotation = ((Math.atan2(ySpeed, xSpeed) * (180 / Math.PI)) + 90);
boatLayer.addChild(this);
enableFireBall();
}
private function moveTowardsTarget():void{
x = (x + xSpeed);
y = (y + ySpeed);
fireBallPoint.x = x;
fireBallPoint.y = y;
}
public function disableFireBall():void{
removeEventListener(Event.ENTER_FRAME, enterFrame);
}
private function enterFrame(_arg1):void{
targetDistance = Point.distance(fireBallPoint, targetPoint);
if (targetDistance < topSpeed){
explode();
} else {
moveTowardsTarget();
};
}
public function kill():void{
disableFireBall();
boatLayer.removeChild(this);
}
private function explode():void{
kill();
}
public function enableFireBall():void{
addEventListener(Event.ENTER_FRAME, enterFrame);
}
}
}//package
Section 23
//FireOneSecond (FireOneSecond)
package {
public class FireOneSecond extends CustSound {
}
}//package
Section 24
//FireStart (FireStart)
package {
public class FireStart extends CustSound {
}
}//package
Section 25
//FishDead1 (FishDead1)
package {
import flash.display.*;
public class FishDead1 extends Sprite {
private var map:Map;
private var critterLayer:CritterLayer;
public function FishDead1(_arg1:Number, _arg2:Number){
map = Map.main;
critterLayer = map.critterLayer;
name = "fishDead1";
x = _arg1;
y = _arg2;
critterLayer.addChild(this);
}
public function kill():void{
var _local1:int;
var _local2:uint;
_local2 = 0;
while (_local2 < 9) {
_local1 = map.critterNumCritterArray[_local2].indexOf(this);
if (_local1 > -1){
map.critterNumCritterArray[_local2].splice(_local1, 1);
};
_local2++;
};
critterLayer.removeChild(this);
}
public function disableThis():void{
}
public function enableThis():void{
}
}
}//package
Section 26
//FishDead2 (FishDead2)
package {
import flash.display.*;
public class FishDead2 extends Sprite {
private var map:Map;
private var critterLayer:CritterLayer;
public function FishDead2(_arg1:Number, _arg2:Number){
map = Map.main;
critterLayer = map.critterLayer;
name = "fishDead2";
x = _arg1;
y = _arg2;
critterLayer.addChild(this);
}
public function kill():void{
var _local1:int;
var _local2:uint;
_local2 = 0;
while (_local2 < 9) {
_local1 = map.critterNumCritterArray[_local2].indexOf(this);
if (_local1 > -1){
map.critterNumCritterArray[_local2].splice(_local1, 1);
};
_local2++;
};
critterLayer.removeChild(this);
}
public function disableThis():void{
}
public function enableThis():void{
}
}
}//package
Section 27
//FishTan (FishTan)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class FishTan extends Sprite {
private var ySpeed:Number;
private var map:Map;
private var gravity:Number;
private var splash;
private var critterLayer:CritterLayer;
private var xSpeed:Number;
private var style:uint;
private var frameCounter:uint;
private var frameTimer:Timer;
public function FishTan(_arg1:Number, _arg2:Number, _arg3:Number){
map = Map.main;
critterLayer = map.critterLayer;
name = "fishTan";
x = _arg1;
y = _arg2;
xSpeed = _arg3;
ySpeed = (Math.floor((Math.random() * 6)) - 10);
gravity = (ySpeed / -10);
frameCounter = 1;
style = (Math.floor((Math.random() * 2)) + 1);
splash = new SplashSmall();
splash.x = x;
splash.y = y;
splash.gotoAndStop(frameCounter);
critterLayer.addChild(splash);
map.critterArray.push(this);
critterLayer.addChild(this);
frameTimer = new Timer(70);
frameTimer.addEventListener(TimerEvent.TIMER, enterFrame);
enableThis();
}
private function moveTowardsTarget():void{
x = (x + xSpeed);
ySpeed = (ySpeed + gravity);
y = (y + ySpeed);
if (style == 1){
rotation = ((Math.atan2(ySpeed, xSpeed) * (180 / Math.PI)) + 90);
} else {
if (ySpeed > 0){
rotation = (rotation - 9);
};
};
}
private function enterFrame(_arg1):void{
frameCounter++;
switch (frameCounter){
case 2:
splash.gotoAndStop(frameCounter);
break;
case 3:
splash.visible = false;
break;
case 21:
if (style == 2){
critterLayer.removeChild(splash);
splash = new SplashBig();
};
splash.x = (x + xSpeed);
splash.y = ((y + ySpeed) + gravity);
splash.gotoAndStop(1);
splash.visible = true;
if (style == 2){
critterLayer.addChild(splash);
};
break;
case 22:
visible = false;
splash.gotoAndStop(2);
break;
case 23:
kill();
break;
default:
break;
};
moveTowardsTarget();
}
public function kill():void{
var _local1:int;
var _local2:uint;
disableThis();
critterLayer.removeChild(splash);
frameTimer.removeEventListener(TimerEvent.TIMER, enterFrame);
_local1 = map.critterArray.indexOf(this);
map.critterArray.splice(_local1, 1);
_local2 = 0;
while (_local2 < 9) {
_local1 = map.critterNumCritterArray[_local2].indexOf(this);
if (_local1 > -1){
map.critterNumCritterArray[_local2].splice(_local1, 1);
};
_local2++;
};
critterLayer.removeChild(this);
}
public function disableThis():void{
frameTimer.reset();
}
public function enableThis():void{
frameTimer.start();
}
}
}//package
Section 28
//FishTitle (FishTitle)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class FishTitle extends Sprite {
private var ySpeed:Number;
private var gravity:Number;
private var splash;
private var xSpeed:Number;
private var style:uint;
private var frameCounter:uint;
private var titleScreen:TitleScreen;
private var frameTimer:Timer;
public function FishTitle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:TitleScreen){
titleScreen = _arg4;
name = "fishTitle";
x = _arg1;
y = _arg2;
xSpeed = _arg3;
ySpeed = (Math.floor((Math.random() * 6)) - 10);
gravity = (ySpeed / -10);
frameCounter = 1;
style = (Math.floor((Math.random() * 2)) + 1);
splash = new SplashSmallTitle();
splash.x = x;
splash.y = y;
splash.gotoAndStop(frameCounter);
titleScreen.addChild(splash);
titleScreen.critterArray.push(this);
titleScreen.addChild(this);
frameTimer = new Timer(50);
frameTimer.addEventListener(TimerEvent.TIMER, enterFrame);
enableThis();
}
private function moveTowardsTarget():void{
x = (x + xSpeed);
ySpeed = (ySpeed + gravity);
y = (y + ySpeed);
if (style == 1){
rotation = ((Math.atan2(ySpeed, xSpeed) * (180 / Math.PI)) + 90);
} else {
if (ySpeed > 0){
rotation = (rotation - 9);
};
};
}
private function enterFrame(_arg1):void{
frameCounter++;
switch (frameCounter){
case 2:
splash.gotoAndStop(frameCounter);
break;
case 3:
splash.visible = false;
break;
case 21:
if (style == 2){
titleScreen.removeChild(splash);
splash = new SplashBigTitle();
};
splash.x = (x + xSpeed);
splash.y = ((y + ySpeed) + gravity);
splash.gotoAndStop(1);
splash.visible = true;
if (style == 2){
titleScreen.addChild(splash);
};
break;
case 22:
visible = false;
splash.gotoAndStop(2);
break;
case 23:
kill();
break;
default:
break;
};
moveTowardsTarget();
}
public function kill():void{
var _local1:int;
disableThis();
titleScreen.removeChild(splash);
frameTimer.removeEventListener(TimerEvent.TIMER, enterFrame);
_local1 = titleScreen.critterArray.indexOf(this);
titleScreen.critterArray.splice(_local1, 1);
titleScreen.removeChild(this);
}
public function disableThis():void{
frameTimer.reset();
}
public function enableThis():void{
frameTimer.start();
}
}
}//package
Section 29
//Flame (Flame)
package {
import flash.display.*;
public class Flame extends MovieClip {
private var schoolLayer;
private var map:Map;
private var controller:Controller;
private var numFrames:uint;
private var frameCounter:uint;
private var index:uint;
public function Flame(_arg1:uint, _arg2:Number, _arg3:Number){
map = Map.main;
controller = Controller.main;
schoolLayer = map.schoolLayer0;
index = _arg1;
x = _arg2;
y = _arg3;
numFrames = 6;
frameCounter = 1;
gotoAndStop(frameCounter);
switch (schoolLayer.numChildren){
case 1:
controller.startFlameSound();
break;
case 20:
case 40:
case 60:
case 80:
case 100:
controller.flameStartSound();
break;
default:
break;
};
schoolLayer.addChild(this);
}
public function kill():void{
var _local1:uint;
_local1 = map.schools[0].tiles.indexOf(this);
map.schools[0].tiles.splice(_local1, 1);
schoolLayer.removeChild(this);
if (schoolLayer.numChildren == 1){
controller.stopFlameSound();
};
}
public function tick():void{
if (++frameCounter > numFrames){
kill();
} else {
gotoAndStop(frameCounter);
};
}
}
}//package
Section 30
//FlareWhistleMP3 (FlareWhistleMP3)
package {
public class FlareWhistleMP3 extends CustSound {
}
}//package
Section 31
//FXSymbol (FXSymbol)
package {
import flash.display.*;
public dynamic class FXSymbol extends SimpleButton {
}
}//package
Section 32
//FXVolumeControl (FXVolumeControl)
package {
import flash.display.*;
public dynamic class FXVolumeControl extends Sprite {
public var fxSymbol:FXSymbol;
public var volumeSliderBackground:VolumeSliderBackground;
public var buttonCancel:ButtonCancel;
public var volumeKnob:VolumeKnob;
}
}//package
Section 33
//Grass (Grass)
package {
import flash.display.*;
public dynamic class Grass extends Sprite {
}
}//package
Section 34
//InstructionDialog (InstructionDialog)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class InstructionDialog extends Sprite {
public var nextButton:StartButton;
private var dialogData:Array;
public var background:EmptyScreen;
public var startButton:StartButton;
private var circleArray:Array;
private var textData:Array;
public var dialogText:TextField;
private var page:uint;
public var backLabel:BackLabel;
private var circleData:Array;
public var startLabel:StartLabel;
public var nextLabel:NextLabel;
private var numPages:uint;
public var emptyButton:EmptyButton;
public var dialogTitle:TextField;
public var backButton:StartButton;
public function InstructionDialog(_arg1){
backButton.visible = false;
backLabel.visible = false;
backButton.alpha = 0;
nextButton.alpha = 0;
name = "instructionDialog";
page = 1;
numPages = 6;
backButton.addEventListener(MouseEvent.CLICK, clickBackButton);
backButton.addEventListener(MouseEvent.MOUSE_OVER, highlightButton);
backButton.addEventListener(MouseEvent.MOUSE_OUT, hideButton);
nextButton.addEventListener(MouseEvent.CLICK, clickNextButton);
nextButton.addEventListener(MouseEvent.MOUSE_OVER, highlightButton);
nextButton.addEventListener(MouseEvent.MOUSE_OUT, hideButton);
loadDataArrays();
_arg1.addChild(this);
loadPage();
}
private function highlightButton(_arg1:MouseEvent):void{
_arg1.target.alpha = 0.2;
}
private function hideButton(_arg1:MouseEvent):void{
_arg1.target.alpha = 0;
}
private function loadDataArrays():void{
var _local1:uint;
circleArray = [];
dialogData = [];
textData = [];
circleData = [];
_local1 = 0;
while (_local1 < numPages) {
circleData[_local1] = [];
_local1++;
};
dialogData.push({x:300, y:237, width:270, height:270, title:"Ship"});
textData.push({width:240, height:190, text:"Your ship will attempt to move towards the mouse pointer, as long as you keep it within the game screen.\n\nThe motor can be upgraded to provide more power or speed."});
circleData[0].push({x:102.3, y:257.3, width:70, height:70});
dialogData.push({x:300, y:237, width:270, height:270, title:"Net"});
textData.push({width:240, height:190, text:"Click anywhere to drop your net in the water and start fishing! The net will slow down your ship while deployed. Click again to bring the net out of the water to speed up your ship, or to prevent catching baby sea turtles. Your net can be upgraded to a larger size. The larger the net, the more drag you will encounter."});
circleData[1].push({x:81.3, y:288.3, width:70, height:70});
dialogData.push({x:300, y:237, width:270, height:270, title:"Fish & Score Multiplier"});
textData.push({width:240, height:190, text:"Up to four schools of fish can be swimming around at any time. Each fish caught will give you one point. When an entire school is either caught, consumed by sharks, or swims off the screen, your score multiplier will increase by one for the rest of the day. If not caught, schools will fade away over time, and will not increase the score multiplier."});
circleData[2].push({x:126.3, y:163.3, width:60, height:120}, {x:363.3, y:428.3, width:80, height:80}, {x:144.3, y:428.3, width:100, height:80}, {x:368.3, y:56, width:45, height:30});
dialogData.push({x:300, y:237, width:270, height:270, title:"Sharks & Turtles"});
textData.push({width:240, height:190, text:"Sharks will swim around and eat fish. They are worth ten points if caught. This species doesn't eat turtles.\n\nYou will be penalized ten points for each baby sea turtle you catch. As with all points, this penalty is affected by the score multiplier. This species only eats plants, not fish."});
circleData[3].push({x:205.3, y:415.9, width:25, height:25}, {x:93.3, y:383.9, width:25, height:25}, {x:133.3, y:304.9, width:40, height:50}, {x:76.3, y:149.9, width:45, height:45});
dialogData.push({x:300, y:237, width:270, height:270, title:"Time & Upgrades"});
textData.push({width:240, height:190, text:"Your 8 hour shift will tick down towards the end of the day, when you will be able to buy ship upgrades with the points accumulated. Upgrades must be purchased in order; you can't save up and skip an upgrade. The game ends after ten days, at which point you will get your game totals and a title based on your game play!"});
circleData[4].push({x:439.3, y:14.9, width:60, height:20});
dialogData.push({x:300, y:237, width:270, height:270, title:"Volume & Pause"});
textData.push({width:240, height:190, text:"You can click on the music or sound effects (FX) symbols to mute either, or use the sliders to control the volume. The pause button will pause the game and bring up a menu, allowing you to restart, quit, or resume the game."});
circleData[5].push({x:45, y:26, width:90, height:75}, {x:107.3, y:27, width:30, height:30});
}
public function kill():void{
var _local1:WhiteCircle;
backButton.removeEventListener(MouseEvent.CLICK, clickBackButton);
backButton.removeEventListener(MouseEvent.MOUSE_OVER, highlightButton);
backButton.removeEventListener(MouseEvent.MOUSE_OUT, hideButton);
nextButton.removeEventListener(MouseEvent.CLICK, clickNextButton);
nextButton.removeEventListener(MouseEvent.MOUSE_OVER, highlightButton);
nextButton.removeEventListener(MouseEvent.MOUSE_OUT, hideButton);
if (circleArray.length > 0){
for each (_local1 in circleArray) {
parent.removeChild(_local1);
};
circleArray = [];
};
parent.removeChild(this);
}
private function loadPage():void{
var _local1:WhiteCircle;
var _local2:uint;
var _local3:*;
_local2 = (page - 1);
x = dialogData[_local2].x;
y = dialogData[_local2].y;
background.width = dialogData[_local2].width;
background.height = dialogData[_local2].height;
emptyButton.x = (startLabel.x = (startButton.x = 0));
emptyButton.y = (startLabel.y = (startButton.y = ((background.height * 0.5) - 17.5)));
backLabel.x = (backButton.x = (27.5 - (background.width * 0.5)));
nextLabel.x = (nextButton.x = (0 - backLabel.x));
backLabel.y = (backButton.y = (nextLabel.y = (nextButton.y = ((background.height * 0.5) - 12.3))));
dialogTitle.x = (dialogTitle.width * -0.5);
dialogTitle.y = ((background.height * -0.5) + 10);
dialogTitle.text = dialogData[_local2].title;
dialogText.width = textData[_local2].width;
dialogText.height = textData[_local2].height;
dialogText.x = (dialogText.width * -0.5);
dialogText.y = (dialogText.height * -0.5);
dialogText.text = textData[_local2].text;
if (circleArray.length > 0){
for each (_local1 in circleArray) {
parent.removeChild(_local1);
};
circleArray = [];
};
if (circleData[_local2].length > 0){
for each (_local3 in circleData[_local2]) {
_local1 = new WhiteCircle();
_local1.x = _local3.x;
_local1.y = _local3.y;
_local1.width = _local3.width;
_local1.height = _local3.height;
parent.addChild(_local1);
circleArray.push(_local1);
};
};
}
private function clickBackButton(_arg1):void{
if (--page == 1){
backButton.visible = false;
backLabel.visible = false;
};
nextButton.visible = true;
nextLabel.visible = true;
loadPage();
}
private function clickNextButton(_arg1):void{
if (++page == numPages){
nextButton.visible = false;
nextLabel.visible = false;
};
backButton.visible = true;
backLabel.visible = true;
loadPage();
}
}
}//package
Section 35
//InstructionScreen (InstructionScreen)
package {
import flash.display.*;
public dynamic class InstructionScreen extends Sprite {
}
}//package
Section 36
//IntroMusic (IntroMusic)
package {
public class IntroMusic extends CustSound {
}
}//package
Section 37
//LoaderBar (LoaderBar)
package {
import flash.display.*;
public dynamic class LoaderBar extends Sprite {
public var loadingMessage:LoadingMessage;
public var loaderBarMeter:LoaderBarMeter;
public var playButton:PlayButton;
}
}//package
Section 38
//LoaderBarMeter (LoaderBarMeter)
package {
import flash.display.*;
public dynamic class LoaderBarMeter extends MovieClip {
}
}//package
Section 39
//LoaderBarSchool (LoaderBarSchool)
package {
import flash.display.*;
public dynamic class LoaderBarSchool extends MovieClip {
}
}//package
Section 40
//LoadingMessage (LoadingMessage)
package {
import flash.display.*;
public dynamic class LoadingMessage extends Sprite {
}
}//package
Section 41
//LoseScreen (LoseScreen)
package {
import flash.display.*;
public dynamic class LoseScreen extends Sprite {
public var startButton:StartButton;
}
}//package
Section 42
//Map (Map)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Map extends MovieClip {
private var schoolMaxFrame:uint;
public var critterNumStatusArray:Array;
public var widthPixels:uint;
public var critterNumCritterArray:Array;
private var schoolFrameNum:uint;
public var tileWidthPixels:Number;
public var tileHeightPixels:Number;
public var critterArray:Array;
private var heightTiles:uint;
public var heightPixels:uint;
public var backgroundLayer:BackgroundLayer;
private var losingIndexArray:Array;
public var numCrittersAlive:uint;
public var babySeaTurtleArray:Array;
private var lastToggledTileType:String;
public var boat:Boat;
private var widthTiles:uint;
public var oilLayer0:OilLayer0;
public var oilLayer1:OilLayer1;
public var oilLayer2:OilLayer2;
public var pixelsPerLayerMove:Number;
public var oilLayer3:OilLayer3;
public var schools:Array;
public var sharkArray:Array;
private var tiles:Array;
public var critterLayer:CritterLayer;
public var schoolLayer0:SchoolLayer0;
public var schoolLayer2:SchoolLayer2;
public var controller:Controller;
public var schoolLayer3:SchoolLayer3;
private var numTiles:uint;
private var maxNumSchools:uint;
public var schoolLayer1:SchoolLayer1;
private var schoolCounter:uint;
public var maxNumSchoolsRound:uint;
public var boatLayer:BoatLayer;
public static var main;
public function Map(){
var _local1:uint;
super();
main = this;
oilLayer0.x = (oilLayer1.x = (oilLayer2.x = (oilLayer3.x = (boatLayer.x = -5))));
schoolLayer0.x = (schoolLayer1.x = (schoolLayer2.x = (schoolLayer3.x = (critterLayer.x = -5))));
_local1 = 0;
while (_local1 < 4) {
this[("oilLayer" + _local1)].removeChild(this[("oilLayer" + _local1)].getChildAt(0));
_local1++;
};
widthTiles = (heightTiles = (numTiles = (widthPixels = (heightPixels = 0))));
tileWidthPixels = 19.95;
tileHeightPixels = 19.95;
tiles = [];
schools = [];
schoolCounter = 0;
maxNumSchoolsRound = 4;
maxNumSchools = 4;
_local1 = 0;
while (_local1 < maxNumSchools) {
schools[_local1] = new Object();
schools[_local1].tiles = [];
schools[_local1].lifeSpan = 0;
schools[_local1].remLifeSpan = 0;
schools[_local1].moveDirection = 0;
schools[_local1].moveDirectionNext = 0;
schools[_local1].moveDirectionRem = 0;
_local1++;
};
critterArray = [];
babySeaTurtleArray = [];
sharkArray = [];
critterNumStatusArray = [];
losingIndexArray = populateLosingIndexArray();
critterNumCritterArray = [];
resetCritterNumCritterArray();
schoolFrameNum = 0;
schoolMaxFrame = 4;
}
public function newSchoolTile(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:uint){
var _local5:*;
switch (_arg4){
case 0:
_local5 = new SchoolTan(_arg3, _arg1, _arg2, schoolFrameNum, _arg4, schools[_arg4].lifeSpan, schools[_arg4].remLifeSpan, schools[_arg4].moveDirection);
break;
case 1:
_local5 = new SchoolRed(_arg3, _arg1, _arg2, schoolFrameNum, _arg4, schools[_arg4].lifeSpan, schools[_arg4].remLifeSpan, schools[_arg4].moveDirection);
break;
case 2:
_local5 = new SchoolYellow(_arg3, _arg1, _arg2, schoolFrameNum, _arg4, schools[_arg4].lifeSpan, schools[_arg4].remLifeSpan, schools[_arg4].moveDirection);
break;
case 3:
_local5 = new SchoolPurple(_arg3, _arg1, _arg2, schoolFrameNum, _arg4, schools[_arg4].lifeSpan, schools[_arg4].remLifeSpan, schools[_arg4].moveDirection);
break;
};
schools[_arg4].tiles.push(_local5);
return (_local5);
}
public function checkSharkTile(_arg1:Number, _arg2:Number):void{
var _local3:uint;
var _local4:int;
_local3 = getMapIndex(_arg1, _arg2);
if (_local3 < tiles.length){
_local4 = 0;
while (_local4 < maxNumSchools) {
if (tiles[_local3].tileTypes[_local4] == "W"){
toggleTile(_local3, true, _local4);
};
_local4++;
};
};
}
private function drawTile(_arg1:uint, _arg2:Number, _arg3:Number, _arg4:uint){
var _local5:Boolean;
var _local6:*;
var _local7:String;
var _local8:int;
_local5 = false;
_local8 = 0;
if (tiles[_arg1].tileTypes[_arg4] == "G"){
_local7 = "Grass";
} else {
_local7 = getWaterTileRotAndLibName(_arg1, _arg4);
_local8 = Number(_local7.slice(0, 3));
_local7 = _local7.slice(3);
};
switch (_local7){
case "Water":
_local6 = new Object();
_local5 = true;
_local6.numOilNeighors = 4;
break;
case "Shore1Sided":
_local6 = new Shore1Sided();
_local6.numOilNeighors = 3;
break;
case "Shore2Sided":
_local6 = new Shore2Sided();
_local6.numOilNeighors = 2;
break;
case "Shore3Sided":
_local6 = new Shore3Sided();
_local6.numOilNeighors = 1;
break;
case "Shore4Sided":
_local6 = new Shore4Sided();
_local6.numOilNeighors = 0;
break;
case "ShoreDiagonal":
_local6 = new ShoreDiagonal();
_local6.numOilNeighors = 2;
break;
case "Grass":
_local6 = new Object();
_local5 = true;
_local6.numOilNeighors = 0;
break;
};
if (((!((tiles[_arg1].oilTiles[_arg4] === null))) && (!(tiles[_arg1].oilTiles[_arg4].pointFlag)))){
this[("oilLayer" + _arg4)].removeChild(tiles[_arg1].oilTiles[_arg4]);
tiles[_arg1].oilTiles[_arg4] = null;
};
_local6.x = _arg2;
_local6.y = _arg3;
_local6.pointFlag = _local5;
if (_local5){
return (_local6);
};
_local6.name = ((("tile" + _arg4) + "-") + _arg1);
_local6.rotation = _local8;
return (this[("oilLayer" + _arg4)].addChild(_local6));
}
public function toggleTile(_arg1:uint, _arg2:Boolean, _arg3:uint, _arg4:Boolean=true):Boolean{
var _local5:*;
var _local6:int;
var _local7:uint;
var _local8:String;
var _local9:*;
_local5 = [];
_local8 = tiles[_arg1].tileTypes[_arg3];
if (_arg2){
tiles[_arg1].tileTypes[_arg3] = "G";
if (tiles[_arg1].schoolTiles[_arg3] != null){
tiles[_arg1].schoolTiles[_arg3].kill(_arg4);
tiles[_arg1].schoolTiles[_arg3] = null;
};
tiles[_arg1].oilTiles[_arg3] = drawTile(_arg1, tiles[_arg1].oilTiles[_arg3].x, tiles[_arg1].oilTiles[_arg3].y, _arg3);
} else {
if (_local8 == "G"){
tiles[_arg1].tileTypes[_arg3] = "W";
tiles[_arg1].oilTiles[_arg3] = drawTile(_arg1, tiles[_arg1].oilTiles[_arg3].x, tiles[_arg1].oilTiles[_arg3].y, _arg3);
tiles[_arg1].schoolTiles[_arg3] = newSchoolTile(tiles[_arg1].oilTiles[_arg3].x, tiles[_arg1].oilTiles[_arg3].y, _arg1, _arg3);
} else {
tiles[_arg1].tileTypes[_arg3] = "G";
if (tiles[_arg1].schoolTiles[_arg3] != null){
tiles[_arg1].schoolTiles[_arg3].kill(_arg4);
tiles[_arg1].schoolTiles[_arg3] = null;
};
};
};
if (tiles[_arg1].tileTypes[_arg3] !== _local8){
_local5 = tileWaterNeighbors(_arg1, _arg3);
if (_local5.length > 1){
_local7 = 1;
while (_local7 < _local5.length) {
_local6 = parseInt(_local5[_local7]);
tiles[_local6].oilTiles[_arg3] = drawTile(_local6, tiles[_local6].oilTiles[_arg3].x, tiles[_local6].oilTiles[_arg3].y, _arg3);
_local7++;
};
};
};
schoolCounter = 0;
_local7 = 0;
while (_local7 < maxNumSchools) {
if (schools[_local7].tiles.length > 0){
schoolCounter++;
};
_local7++;
};
return (false);
}
private function schoolTileInDirection(_arg1:uint, _arg2:uint, _arg3:uint):String{
var _local4:int;
_local4 = _arg1;
switch (_arg3){
case 1:
if ((_local4 % widthTiles) == 0){
_local4 = -1;
} else {
_local4--;
};
break;
case 2:
if ((((_local4 < 168)) || (((_local4 % widthTiles) == 0)))){
_local4 = -1;
} else {
_local4 = (_local4 - (widthTiles + 1));
};
break;
case 3:
if (_local4 < 168){
_local4 = -1;
} else {
_local4 = (_local4 - widthTiles);
};
break;
case 4:
if ((((_local4 < 168)) || ((((_local4 + 1) % widthTiles) == 0)))){
_local4 = -1;
} else {
_local4 = (_local4 - (widthTiles - 1));
};
break;
case 5:
if (((_local4 + 1) % widthTiles) == 0){
_local4 = -1;
} else {
_local4++;
};
break;
case 6:
if ((((_local4 > 551)) || ((((_local4 + 1) % widthTiles) == 0)))){
_local4 = -1;
} else {
_local4 = (_local4 + (widthTiles + 1));
};
break;
case 7:
if (_local4 > 551){
_local4 = -1;
} else {
_local4 = (_local4 + widthTiles);
};
break;
case 8:
if ((((_local4 > 551)) || (((_local4 % widthTiles) == 0)))){
_local4 = -1;
} else {
_local4 = (_local4 + (widthTiles - 1));
};
break;
default:
break;
};
if (_local4 == -1){
return ("X");
};
if (tiles[_local4].schoolTiles[_arg2] !== null){
return ("Y");
};
return ((_local4 + ""));
}
public function getMapIndex(_arg1:Number, _arg2:Number):uint{
var _local3:*;
var _local4:*;
_local3 = Math.floor((_arg1 / tileWidthPixels));
_local4 = Math.floor((_arg2 / tileHeightPixels));
return (((_local4 * widthTiles) + _local3));
}
private function resetCritterNumCritterArray():void{
var _local1:int;
if (critterNumCritterArray.length > 0){
_local1 = 0;
while (_local1 < 9) {
resetCritter(_local1);
_local1++;
};
} else {
critterNumCritterArray = [];
_local1 = 0;
while (_local1 < 9) {
critterNumCritterArray[_local1] = [];
_local1++;
};
};
}
public function moveSchools(){
var _local1:Array;
var _local2:String;
var _local3:int;
var _local4:uint;
var _local5:uint;
var _local6:uint;
_local6 = 0;
while (_local6 < maxNumSchools) {
_local5 = schools[_local6].tiles.length;
if (_local5 > 0){
_local1 = [];
_local3 = (_local5 - 1);
while (_local3 >= 0) {
_local2 = schoolTileInDirection(schools[_local6].tiles[_local3].index, _local6, schools[_local6].moveDirection);
if (((!((_local2 === "Y"))) && (!((_local2 === "X"))))){
toggleTile(parseInt(_local2), false, _local6);
};
if (schools[_local6].moveDirection > 4){
_local4 = (schools[_local6].moveDirection - 4);
} else {
_local4 = (schools[_local6].moveDirection + 4);
};
_local2 = schoolTileInDirection(schools[_local6].tiles[_local3].index, _local6, _local4);
if (_local2 !== "Y"){
_local1.push(schools[_local6].tiles[_local3].index);
};
_local3--;
};
_local5 = _local1.length;
if (_local5 > 0){
_local3 = (_local5 - 1);
while (_local3 >= 0) {
toggleTile(_local1[_local3], true, _local6);
_local3--;
};
};
switch (schools[_local6].moveDirection){
case 1:
this[("schoolLayer" + _local6)].x = (this[("schoolLayer" + _local6)].x + tileWidthPixels);
break;
case 2:
this[("schoolLayer" + _local6)].x = (this[("schoolLayer" + _local6)].x + tileWidthPixels);
this[("schoolLayer" + _local6)].y = (this[("schoolLayer" + _local6)].y + tileHeightPixels);
break;
case 3:
this[("schoolLayer" + _local6)].y = (this[("schoolLayer" + _local6)].y + tileHeightPixels);
break;
case 4:
this[("schoolLayer" + _local6)].x = (this[("schoolLayer" + _local6)].x - tileWidthPixels);
this[("schoolLayer" + _local6)].y = (this[("schoolLayer" + _local6)].y + tileHeightPixels);
break;
case 5:
this[("schoolLayer" + _local6)].x = (this[("schoolLayer" + _local6)].x - tileWidthPixels);
break;
case 6:
this[("schoolLayer" + _local6)].x = -(tileWidthPixels);
this[("schoolLayer" + _local6)].y = (this[("schoolLayer" + _local6)].y - tileHeightPixels);
break;
case 7:
this[("schoolLayer" + _local6)].y = (this[("schoolLayer" + _local6)].y - tileHeightPixels);
break;
case 8:
this[("schoolLayer" + _local6)].x = (this[("schoolLayer" + _local6)].x + tileWidthPixels);
this[("schoolLayer" + _local6)].y = (this[("schoolLayer" + _local6)].y - tileHeightPixels);
break;
};
this[("oilLayer" + _local6)].x = this[("schoolLayer" + _local6)].x;
this[("oilLayer" + _local6)].y = this[("schoolLayer" + _local6)].y;
};
_local6++;
};
schoolTick();
}
public function unpauseGame():void{
enableNetClick();
killAllCritters("enable");
}
public function enableNetClick():void{
addEventListener(MouseEvent.CLICK, netClick);
}
public function loadMap(_arg1:String):Boolean{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:uint;
var _local8:String;
var _local9:*;
if (_arg1.length < 6){
return (false);
};
_local9 = [];
_local3 = uint(_arg1.slice(0, 2));
if (_local3 == 0){
_local3 = 100;
};
_local4 = uint(_arg1.slice(2, 4));
if (_local4 == 0){
_local4 = 100;
};
if (((isNaN(_local3)) || (isNaN(_local4)))){
return (false);
};
if ((((((((_local3 < 10)) || ((_local3 > 100)))) || ((_local4 < 10)))) || ((_local4 > 100)))){
return (false);
};
_local5 = 4;
while (_local5 < _arg1.length) {
_local2 = parseInt(("0x" + _arg1.slice(_local5, (_local5 + 2))));
if (isNaN(_local2)){
return (false);
};
if (_local2 >= 128){
_local8 = "G";
_local2 = (_local2 - 128);
} else {
_local8 = "W";
};
if (_local2 == 0){
_local2 = 128;
};
_local6 = _local9.length;
_local7 = _local6;
while (_local7 < (_local6 + _local2)) {
_local9[_local7] = _local8;
_local7++;
};
_local5 = (_local5 + 2);
};
if ((_local3 * _local4) != _local9.length){
return (false);
};
widthTiles = _local3;
heightTiles = _local4;
numTiles = (widthTiles * heightTiles);
widthPixels = (widthTiles * tileWidthPixels);
heightPixels = (heightTiles * tileHeightPixels);
if (tiles.length > 0){
eraseAllTiles();
} else {
initializeTiles(_local9);
};
drawTiles();
return (true);
}
private function drawTiles():void{
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:Number;
var _local6:Number;
_local5 = (tileWidthPixels / -2);
_local6 = (tileHeightPixels / -2);
_local1 = 0;
while (_local1 < numTiles) {
_local4 = (Math.floor((_local1 / widthTiles)) + 1);
_local3 = ((_local1 + 1) - ((_local4 - 1) * widthTiles));
if ((((tiles.length > _local1)) && (!((tiles[_local1] === null))))){
_local2 = 0;
while (_local2 < maxNumSchools) {
tiles[_local1].oilTiles[_local2] = drawTile(_local1, ((_local3 * tileWidthPixels) + _local5), ((_local4 * tileHeightPixels) + _local6), _local2);
_local2++;
};
};
_local1++;
};
schoolCounter = 0;
}
private function getWaterTileRotAndLibName(_arg1:uint, _arg2:uint):String{
var _local3:*;
var _local4:String;
_local3 = [];
_local3 = tileWaterNeighbors(_arg1, _arg2);
switch (_local3[0].length){
case 4:
_local4 = "000Water";
break;
case 3:
switch (_local3[0]){
case "DLR":
_local4 = "000";
break;
case "UDL":
_local4 = "090";
break;
case "UDR":
_local4 = "-90";
break;
default:
_local4 = "180";
break;
};
_local4 = (_local4 + "Shore1Sided");
break;
case 2:
switch (_local3[0]){
case "LR":
_local4 = "000Shore2Sided";
break;
case "UD":
_local4 = "090Shore2Sided";
break;
case "DL":
_local4 = "000ShoreDiagonal";
break;
case "UL":
_local4 = "090ShoreDiagonal";
break;
case "DR":
_local4 = "-90ShoreDiagonal";
break;
default:
_local4 = "180ShoreDiagonal";
break;
};
break;
case 1:
switch (_local3[0]){
case "R":
_local4 = "000";
break;
case "D":
_local4 = "090";
break;
case "U":
_local4 = "-90";
break;
default:
_local4 = "180";
break;
};
_local4 = (_local4 + "Shore3Sided");
break;
default:
_local4 = "000Shore4Sided";
break;
};
return (_local4);
}
private function tileWaterNeighbors(_arg1:uint, _arg2:uint):Array{
var _local3:String;
var _local4:Array;
var _local5:*;
var _local6:uint;
_local4 = new Array("U", "D", "L", "R");
_local5 = [];
_local5[0] = "";
_local6 = 0;
while (_local6 < 4) {
_local3 = tileNeighbor(_arg1, _local4[_local6], _arg2);
if (_local3.slice(0, 1) != "G"){
_local5[0] = (_local5[0] + _local4[_local6]);
if (_local3.slice(0, 1) == "W"){
_local5.push(_local3.slice(1));
};
};
_local6++;
};
return (_local5);
}
private function killCritter(_arg1:uint):Boolean{
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:*;
if (critterNumStatusArray[_arg1].critterStatus == "D"){
return (false);
};
critterNumStatusArray[_arg1].critterStatus = "D";
controller.playSound("critterDeath");
_local6 = critterNumCritterArray[_arg1];
_local3 = _local6.length;
if (_local3 > 0){
_local2 = (_local3 - 1);
while (_local2 >= 0) {
_local6[_local2].kill();
_local2--;
};
};
_local4 = critterNumStatusArray[_arg1].critterX;
_local5 = critterNumStatusArray[_arg1].critterY;
switch (_arg1){
case 1:
case 2:
_local6.push(new BabySeaTurtleDead(_local4, _local5));
break;
case 3:
_local6.push(new FishDead2(_local4, _local5));
break;
case 5:
_local6.push(new FishDead1(_local4, _local5));
break;
default:
_local6.push(new SeaBirdDead2(_local4, _local5));
break;
};
if (--numCrittersAlive == 0){
return (true);
};
return (false);
}
private function checkForReachingShore(_arg1:uint):String{
if (_arg1 < losingIndexArray.length){
return (losingIndexArray[_arg1]);
};
return ("W");
}
public function pauseGame():void{
disableNetClick();
killAllCritters("disable");
}
public function disableNetClick():void{
removeEventListener(MouseEvent.CLICK, netClick);
}
private function eraseAllTiles():void{
var _local1:int;
var _local2:uint;
_local2 = 0;
while (_local2 < tiles.length) {
_local1 = 0;
while (_local1 < maxNumSchools) {
if (tiles[_local2].schoolTiles[_local1] != null){
tiles[_local2].schoolTiles[_local1].kill(false);
tiles[_local2].schoolTiles[_local1] = null;
if (!tiles[_local2].oilTiles[_local1].pointFlag){
this[("oilLayer" + _local1)].removeChild(tiles[_local2].oilTiles[_local1]);
};
};
_local1++;
};
tiles[_local2] = new Object();
tiles[_local2].schoolTiles = [];
tiles[_local2].oilTiles = [];
tiles[_local2].tileTypes = [];
_local1 = 0;
while (_local1 < maxNumSchools) {
tiles[_local2].schoolTiles[_local1] = null;
tiles[_local2].oilTiles[_local1] = null;
tiles[_local2].tileTypes[_local1] = "G";
_local1++;
};
_local2++;
};
schoolCounter = 0;
}
public function checkBoatTile(_arg1:Array):void{
var _local2:uint;
var _local3:int;
var _local4:int;
var _local5:Point;
for each (_local5 in _arg1) {
_local2 = getMapIndex(_local5.x, _local5.y);
_local3 = 0;
while (_local3 < maxNumSchools) {
if (tiles[_local2].tileTypes[_local3] == "W"){
toggleTile(_local2, true, _local3);
controller.gotFish();
};
_local3++;
};
_local4 = (critterArray.length - 1);
if (_local4 >= 0){
_local3 = _local4;
while (_local3 >= 0) {
if (critterArray[_local3].i == _local2){
controller.gotCritter(critterArray[_local3].name);
critterArray[_local3].kill();
};
_local3--;
};
};
};
}
public function schoolTick():void{
var _local1:uint;
var _local2:int;
var _local3:uint;
_local3 = 0;
while (_local3 < maxNumSchools) {
_local1 = schools[_local3].tiles.length;
if (_local1 > 0){
switch (schools[_local3].moveDirection){
case 1:
this[("schoolLayer" + _local3)].x = (this[("schoolLayer" + _local3)].x - pixelsPerLayerMove);
break;
case 2:
this[("schoolLayer" + _local3)].x = (this[("schoolLayer" + _local3)].x - pixelsPerLayerMove);
this[("schoolLayer" + _local3)].y = (this[("schoolLayer" + _local3)].y - pixelsPerLayerMove);
break;
case 3:
this[("schoolLayer" + _local3)].y = (this[("schoolLayer" + _local3)].y - pixelsPerLayerMove);
break;
case 4:
this[("schoolLayer" + _local3)].x = (this[("schoolLayer" + _local3)].x + pixelsPerLayerMove);
this[("schoolLayer" + _local3)].y = (this[("schoolLayer" + _local3)].y - pixelsPerLayerMove);
break;
case 5:
this[("schoolLayer" + _local3)].x = (this[("schoolLayer" + _local3)].x + pixelsPerLayerMove);
break;
case 6:
this[("schoolLayer" + _local3)].x = (this[("schoolLayer" + _local3)].x + pixelsPerLayerMove);
this[("schoolLayer" + _local3)].y = (this[("schoolLayer" + _local3)].y + pixelsPerLayerMove);
break;
case 7:
this[("schoolLayer" + _local3)].y = (this[("schoolLayer" + _local3)].y + pixelsPerLayerMove);
break;
case 8:
this[("schoolLayer" + _local3)].x = (this[("schoolLayer" + _local3)].x - pixelsPerLayerMove);
this[("schoolLayer" + _local3)].y = (this[("schoolLayer" + _local3)].y + pixelsPerLayerMove);
break;
};
this[("oilLayer" + _local3)].x = this[("schoolLayer" + _local3)].x;
this[("oilLayer" + _local3)].y = this[("schoolLayer" + _local3)].y;
_local2 = (_local1 - 1);
while (_local2 >= 0) {
schools[_local3].tiles[_local2].tick((schoolFrameNum + _local3), schools[_local3].moveDirection);
_local2--;
};
schools[_local3].remLifeSpan--;
};
_local3++;
};
if (++schoolFrameNum > schoolMaxFrame){
schoolFrameNum = 1;
};
}
private function calcNonSchoolNeighbors(_arg1:uint, _arg2:uint):Array{
var _local3:Array;
var _local4:int;
var _local5:String;
var _local6:Array;
var _local7:String;
_local3 = [];
_local6 = new Array("U", "D", "L", "R");
for each (_local7 in _local6) {
_local5 = tileNeighbor(_arg1, _local7, _arg2);
_local4 = parseInt(_local5.slice(1));
if ((((((_local4 >= 192)) && (!((_local5.slice(0, 1) === "X"))))) && ((tiles[_local4].schoolTiles[_arg2] == null)))){
_local3.push(_local4);
};
};
return (_local3);
}
public function getNextSchoolMoveDirection(){
var _local1:uint;
_local1 = 0;
while (_local1 < maxNumSchools) {
if (schools[_local1].tiles.length > 0){
if (--schools[_local1].moveDirectionRem == 0){
schools[_local1].moveDirection = schools[_local1].moveDirectionNext;
schools[_local1].moveDirectionNext = (Math.floor((Math.random() * 8)) + 1);
schools[_local1].moveDirectionRem = (Math.floor((Math.random() * 3)) + 2);
};
};
_local1++;
};
schoolTick();
}
public function createSchool(_arg1:uint, _arg2:int):void{
var _local3:uint;
var _local4:uint;
if (schoolCounter < maxNumSchoolsRound){
schoolCounter++;
_local3 = 0;
while (schools[_local3].tiles.length > 0) {
_local3++;
};
schools[_local3].lifeSpan = _arg2;
schools[_local3].remLifeSpan = _arg2;
schools[_local3].moveDirection = (Math.floor((Math.random() * 8)) + 1);
schools[_local3].moveDirectionNext = (Math.floor((Math.random() * 8)) + 1);
schools[_local3].moveDirectionRem = (Math.floor((Math.random() * 3)) + 3);
switch (schools[_local3].moveDirection){
case 1:
this[("schoolLayer" + _local3)].x = ((tileWidthPixels * 0.5) - 5);
break;
case 2:
this[("schoolLayer" + _local3)].x = ((tileWidthPixels * 0.5) - 5);
this[("schoolLayer" + _local3)].y = (tileHeightPixels * 0.5);
break;
case 3:
this[("schoolLayer" + _local3)].y = (tileHeightPixels * 0.5);
break;
case 4:
this[("schoolLayer" + _local3)].x = ((tileWidthPixels * -0.5) - 5);
this[("schoolLayer" + _local3)].y = (tileHeightPixels * 0.5);
break;
case 5:
this[("schoolLayer" + _local3)].x = ((tileWidthPixels * -0.5) - 5);
break;
case 6:
this[("schoolLayer" + _local3)].x = ((tileWidthPixels * -0.5) - 5);
this[("schoolLayer" + _local3)].y = (tileHeightPixels * -0.5);
break;
case 7:
this[("schoolLayer" + _local3)].y = (tileHeightPixels * -0.5);
break;
case 8:
this[("schoolLayer" + _local3)].x = ((tileWidthPixels * 0.5) - 5);
this[("schoolLayer" + _local3)].y = (tileHeightPixels * -0.5);
break;
};
this[("oilLayer" + _local3)].x = this[("schoolLayer" + _local3)].x;
this[("oilLayer" + _local3)].y = this[("schoolLayer" + _local3)].y;
_local4 = Math.floor((Math.random() * 216));
_local4 = (((_local4 % 18) + (Math.floor((_local4 / 18)) * widthTiles)) + 243);
growInDirection(0, _local4, _local3, _arg1);
while (schools[_local3].tiles.length < _arg1) {
_local4 = Math.floor((Math.random() * schools[_local3].tiles.length));
_local4 = schools[_local3].tiles[_local4].index;
growInDirection(0, _local4, _local3, _arg1);
};
};
}
private function tileNeighbor(_arg1:uint, _arg2:String, _arg3:uint):String{
var _local4:int;
switch (_arg2){
case "U":
_local4 = (_arg1 - widthTiles);
break;
case "D":
_local4 = (_arg1 + widthTiles);
break;
case "L":
if ((_arg1 % widthTiles) != 0){
_local4 = (_arg1 - 1);
} else {
_local4 = -1;
};
break;
default:
_local4 = (_arg1 + 1);
if ((_local4 % widthTiles) == 0){
_local4 = -1;
};
break;
};
if ((((_local4 >= 0)) && ((_local4 < numTiles)))){
return ((tiles[_local4].tileTypes[_arg3] + _local4));
};
return (("X" + _local4));
}
public function resetCritterStatus():void{
critterNumStatusArray = [];
critterNumStatusArray.push({critterStatus:"A", critterX:27, critterY:85}, {critterStatus:"A", critterX:114, critterY:133});
critterNumStatusArray.push({critterStatus:"A", critterX:170, critterY:132}, {critterStatus:"A", critterX:182, critterY:70});
critterNumStatusArray.push({critterStatus:"A", critterX:264, critterY:85}, {critterStatus:"A", critterX:315, critterY:65});
critterNumStatusArray.push({critterStatus:"A", critterX:365, critterY:85}, {critterStatus:"A", critterX:410, critterY:48});
critterNumStatusArray.push({critterStatus:"A", critterX:455, critterY:35});
numCrittersAlive = 9;
resetCritterNumCritterArray();
}
public function growInDirection(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint):Boolean{
var _local5:Array;
var _local6:uint;
var _local7:uint;
while (true) {
if (tiles[_arg2].tileTypes[_arg3] == "G"){
return (toggleTile(_arg2, false, _arg3, false));
};
_local5 = calcNonSchoolNeighbors(_arg2, _arg3);
if (_local5.length > 0){
_local6 = (_arg4 - schools[_arg3].length);
if (_local5.length > _local6){
_local5.slice(0, _local6);
};
for each (_local7 in _local5) {
toggleTile(_local7, false, _arg3, false);
};
return (false);
};
switch (_arg2){
case 144:
_arg1 = (Math.floor((Math.random() * 3)) + 5);
break;
case 167:
_arg1 = (Math.floor((Math.random() * 3)) + 7);
if (_arg1 > 8){
_arg1 = (_arg1 - 8);
};
break;
case 552:
_arg1 = (Math.floor((Math.random() * 3)) + 3);
break;
case 575:
_arg1 = (Math.floor((Math.random() * 3)) + 1);
break;
default:
if ((_arg2 % widthTiles) == 0){
_arg1 = (Math.floor((Math.random() * 5)) + 3);
} else {
if (((_arg2 + 1) % widthTiles) == 0){
_arg1 = (Math.floor((Math.random() * 5)) + 7);
if (_arg1 > 8){
_arg1 = (_arg1 - 8);
};
} else {
if (_arg2 > 551){
_arg1 = (Math.floor((Math.random() * 5)) + 1);
} else {
if (_arg2 < 168){
_arg1 = (Math.floor((Math.random() * 5)) + 5);
if (_arg1 > 8){
_arg1 = (_arg1 - 8);
};
};
};
};
};
break;
};
if (_arg1 == 0){
_arg1 = (Math.floor((Math.random() * 8)) + 1);
};
switch (_arg1){
case 1:
_arg2--;
break;
case 2:
_arg2 = (_arg2 - (widthTiles + 1));
break;
case 3:
_arg2 = (_arg2 - widthTiles);
break;
case 4:
_arg2 = (_arg2 - (widthTiles - 1));
break;
case 5:
_arg2++;
break;
case 6:
_arg2 = (_arg2 + (widthTiles + 1));
break;
case 7:
_arg2 = (_arg2 + widthTiles);
break;
case 8:
_arg2 = (_arg2 + (widthTiles - 1));
break;
default:
break;
};
};
return (false);
}
public function killAllCritters(_arg1:String="kill"):void{
var _local2:uint;
var _local3:int;
_local2 = critterArray.length;
if (_local2 > 0){
_local3 = (_local2 - 1);
while (_local3 >= 0) {
switch (_arg1){
case "disable":
critterArray[_local3].disableThis();
break;
case "enable":
critterArray[_local3].enableThis();
break;
default:
critterArray[_local3].kill();
break;
};
_local3--;
};
};
}
private function initializeTiles(_arg1:Array){
var _local2:uint;
var _local3:uint;
_local3 = 0;
while (_local3 < numTiles) {
tiles[_local3] = new Object();
tiles[_local3].schoolTiles = [];
tiles[_local3].oilTiles = [];
tiles[_local3].tileTypes = [];
_local2 = 0;
while (_local2 < maxNumSchools) {
tiles[_local3].schoolTiles[_local2] = null;
tiles[_local3].oilTiles[_local2] = null;
tiles[_local3].tileTypes[_local2] = _arg1[_local3];
_local2++;
};
_local3++;
};
}
public function resetCritter(_arg1:int):void{
var _local2:Array;
var _local3:uint;
_local2 = critterNumCritterArray[_arg1];
_local3 = _local2.length;
if (_local3 > 0){
_arg1 = (_local3 - 1);
while (_arg1 >= 0) {
_local2[_arg1].kill();
_arg1--;
};
};
}
private function populateLosingIndexArray():Array{
var _local1:Array;
var _local2:Array;
var _local3:uint;
var _local4:*;
_local1 = [];
_local1.push({critterIndex:96, critterNum:0}, {critterIndex:97, critterNum:0}, {critterIndex:98, critterNum:0}, {critterIndex:123, critterNum:1});
_local1.push({critterIndex:148, critterNum:1}, {critterIndex:173, critterNum:1}, {critterIndex:174, critterNum:1}, {critterIndex:175, critterNum:2});
_local1.push({critterIndex:176, critterNum:2}, {critterIndex:177, critterNum:2}, {critterIndex:153, critterNum:2}, {critterIndex:129, critterNum:3});
_local1.push({critterIndex:106, critterNum:3}, {critterIndex:107, critterNum:3}, {critterIndex:108, critterNum:4}, {critterIndex:133, critterNum:4});
_local1.push({critterIndex:110, critterNum:4}, {critterIndex:111, critterNum:5}, {critterIndex:112, critterNum:5}, {critterIndex:113, critterNum:6});
_local1.push({critterIndex:138, critterNum:6}, {critterIndex:115, critterNum:6}, {critterIndex:92, critterNum:7}, {critterIndex:93, critterNum:7});
_local1.push({critterIndex:70, critterNum:8}, {critterIndex:71, critterNum:8});
_local2 = [];
_local3 = 0;
while (_local3 <= 152) {
_local2[_local3] = "G";
_local3++;
};
_local2[94] = "W";
_local2[95] = "W";
_local3 = 116;
while (_local3 <= 122) {
_local2[_local3] = "W";
_local3++;
};
_local3 = 130;
while (_local3 <= 132) {
_local2[_local3] = "W";
_local3++;
};
_local3 = 134;
while (_local3 <= 137) {
_local2[_local3] = "W";
_local3++;
};
_local3 = 139;
while (_local3 <= 147) {
_local2[_local3] = "W";
_local3++;
};
_local3 = 154;
while (_local3 <= 172) {
_local2[_local3] = "W";
_local3++;
};
for each (_local4 in _local1) {
_local2[_local4.critterIndex] = (_local4.critterNum + "");
};
return (_local2);
}
private function netClick(_arg1):void{
if (controller.boat.netEnabled){
controller.boat.netEnabled = false;
} else {
controller.boat.netEnabled = true;
};
}
}
}//package
Section 43
//Motor0MP3 (Motor0MP3)
package {
public class Motor0MP3 extends CustSound {
}
}//package
Section 44
//Motor1 (Motor1)
package {
import flash.display.*;
public dynamic class Motor1 extends Sprite {
}
}//package
Section 45
//Motor10MP3 (Motor10MP3)
package {
public class Motor10MP3 extends CustSound {
}
}//package
Section 46
//Motor1MP3 (Motor1MP3)
package {
public class Motor1MP3 extends CustSound {
}
}//package
Section 47
//Motor2MP3 (Motor2MP3)
package {
public class Motor2MP3 extends CustSound {
}
}//package
Section 48
//Motor3 (Motor3)
package {
import flash.display.*;
public dynamic class Motor3 extends Sprite {
}
}//package
Section 49
//Motor3MP3 (Motor3MP3)
package {
public class Motor3MP3 extends CustSound {
}
}//package
Section 50
//Motor4MP3 (Motor4MP3)
package {
public class Motor4MP3 extends CustSound {
}
}//package
Section 51
//Motor5 (Motor5)
package {
import flash.display.*;
public dynamic class Motor5 extends Sprite {
}
}//package
Section 52
//Motor5MP3 (Motor5MP3)
package {
public class Motor5MP3 extends CustSound {
}
}//package
Section 53
//Motor6MP3 (Motor6MP3)
package {
public class Motor6MP3 extends CustSound {
}
}//package
Section 54
//Motor7 (Motor7)
package {
import flash.display.*;
public dynamic class Motor7 extends Sprite {
}
}//package
Section 55
//Motor7MP3 (Motor7MP3)
package {
public class Motor7MP3 extends CustSound {
}
}//package
Section 56
//Motor8MP3 (Motor8MP3)
package {
public class Motor8MP3 extends CustSound {
}
}//package
Section 57
//Motor9 (Motor9)
package {
import flash.display.*;
public dynamic class Motor9 extends Sprite {
}
}//package
Section 58
//Motor9MP3 (Motor9MP3)
package {
public class Motor9MP3 extends CustSound {
}
}//package
Section 59
//MotorIdleMP3 (MotorIdleMP3)
package {
public class MotorIdleMP3 extends CustSound {
}
}//package
Section 60
//Multiplier (Multiplier)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Multiplier extends Sprite {
public var multiplier:TextField;
}
}//package
Section 61
//MusicalNote (MusicalNote)
package {
import flash.display.*;
public dynamic class MusicalNote extends SimpleButton {
}
}//package
Section 62
//MusicVolumeControl (MusicVolumeControl)
package {
import flash.display.*;
public dynamic class MusicVolumeControl extends Sprite {
public var musicalNote:MusicalNote;
public var volumeSliderBackground:VolumeSliderBackground;
public var buttonCancel:ButtonCancel;
public var volumeKnob:VolumeKnob;
}
}//package
Section 63
//Net0 (Net0)
package {
import flash.display.*;
public dynamic class Net0 extends MovieClip {
}
}//package
Section 64
//Net1 (Net1)
package {
import flash.display.*;
public dynamic class Net1 extends Sprite {
}
}//package
Section 65
//Net2 (Net2)
package {
import flash.display.*;
public dynamic class Net2 extends Sprite {
}
}//package
Section 66
//NextLabel (NextLabel)
package {
import flash.display.*;
public dynamic class NextLabel extends Sprite {
}
}//package
Section 67
//OilLayer0 (OilLayer0)
package {
import flash.display.*;
public dynamic class OilLayer0 extends Sprite {
}
}//package
Section 68
//OilLayer1 (OilLayer1)
package {
import flash.display.*;
public dynamic class OilLayer1 extends Sprite {
}
}//package
Section 69
//OilLayer2 (OilLayer2)
package {
import flash.display.*;
public dynamic class OilLayer2 extends Sprite {
}
}//package
Section 70
//OilLayer3 (OilLayer3)
package {
import flash.display.*;
public dynamic class OilLayer3 extends Sprite {
}
}//package
Section 71
//PauseMenu (PauseMenu)
package {
import flash.display.*;
public dynamic class PauseMenu extends Sprite {
public var startButton:StartButton;
public var quitButton:StartButton;
public var unpauseButton:StartButton;
}
}//package
Section 72
//PlayButton (PlayButton)
package {
import flash.display.*;
public dynamic class PlayButton extends SimpleButton {
}
}//package
Section 73
//RoundButton (RoundButton)
package {
import flash.display.*;
public dynamic class RoundButton extends SimpleButton {
}
}//package
Section 74
//School (School)
package {
import flash.display.*;
public class School extends MovieClip {
protected var schoolLayer;
protected var map:Map;
protected var lifeSpan:uint;
protected var lifeNearBoundry:uint;
protected var remLifeSpan:int;
protected var frameOffset:uint;
protected var controller:Controller;
protected var schoolIndex:uint;
public var index:uint;
public function kill(_arg1:Boolean=true):void{
var _local2:uint;
_local2 = map.schools[schoolIndex].tiles.indexOf(this);
map.schools[schoolIndex].tiles.splice(_local2, 1);
schoolLayer.removeChild(this);
if (((_arg1) && ((map.schools[schoolIndex].tiles.length == 0)))){
controller.multiplier++;
controller.uiLayer.multiplier.multiplier.text = controller.multiplier.toString();
};
}
public function tick(_arg1:uint, _arg2:uint):void{
if (remLifeSpan > 0){
if (_arg1 > 4){
_arg1 = (_arg1 - 4);
};
switch (_arg2){
case 1:
scaleX = 1;
rotation = 0;
frameOffset = 0;
break;
case 2:
scaleX = 1;
rotation = 0;
frameOffset = 4;
break;
case 3:
scaleX = 1;
rotation = 90;
frameOffset = 0;
break;
case 4:
scaleX = -1;
rotation = 0;
frameOffset = 4;
break;
case 5:
scaleX = -1;
rotation = 0;
frameOffset = 0;
break;
case 6:
scaleX = -1;
rotation = 90;
frameOffset = 4;
break;
case 7:
scaleX = 1;
rotation = -90;
frameOffset = 0;
break;
case 8:
scaleX = 1;
rotation = -90;
frameOffset = 4;
break;
};
gotoAndStop((_arg1 + frameOffset));
if (remLifeSpan > 16){
lifeNearBoundry = (lifeSpan - remLifeSpan);
} else {
lifeNearBoundry = (remLifeSpan - 1);
};
if (lifeNearBoundry < 15){
alpha = ((lifeNearBoundry + 1) / 16);
} else {
alpha = 1;
};
remLifeSpan--;
} else {
map.toggleTile(index, true, schoolIndex, false);
};
}
public function SchoolConstructor(_arg1:uint, _arg2:Number, _arg3:Number, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:int, _arg8:uint){
map = Map.main;
controller = Controller.main;
schoolIndex = _arg5;
schoolLayer = map[("schoolLayer" + schoolIndex)];
index = _arg1;
x = _arg2;
y = _arg3;
lifeSpan = _arg6;
remLifeSpan = _arg7;
tick(_arg4, _arg8);
schoolLayer.addChild(this);
}
}
}//package
Section 75
//SchoolLayer0 (SchoolLayer0)
package {
import flash.display.*;
public dynamic class SchoolLayer0 extends Sprite {
}
}//package
Section 76
//SchoolLayer1 (SchoolLayer1)
package {
import flash.display.*;
public dynamic class SchoolLayer1 extends Sprite {
}
}//package
Section 77
//SchoolLayer2 (SchoolLayer2)
package {
import flash.display.*;
public dynamic class SchoolLayer2 extends Sprite {
}
}//package
Section 78
//SchoolLayer3 (SchoolLayer3)
package {
import flash.display.*;
public dynamic class SchoolLayer3 extends Sprite {
}
}//package
Section 79
//SchoolPurple (SchoolPurple)
package {
public class SchoolPurple extends School {
public function SchoolPurple(_arg1:uint, _arg2:Number, _arg3:Number, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:int, _arg8:uint){
super.SchoolConstructor(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
}
}//package
Section 80
//SchoolRed (SchoolRed)
package {
public class SchoolRed extends School {
public function SchoolRed(_arg1:uint, _arg2:Number, _arg3:Number, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:int, _arg8:uint){
super.SchoolConstructor(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
}
}//package
Section 81
//SchoolTan (SchoolTan)
package {
public class SchoolTan extends School {
public function SchoolTan(_arg1:uint, _arg2:Number, _arg3:Number, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:int, _arg8:uint){
super.SchoolConstructor(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
}
}//package
Section 82
//SchoolYellow (SchoolYellow)
package {
public class SchoolYellow extends School {
public function SchoolYellow(_arg1:uint, _arg2:Number, _arg3:Number, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:int, _arg8:uint){
super.SchoolConstructor(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
}
}//package
Section 83
//Score (Score)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Score extends Sprite {
public var scoreDisplay:TextField;
}
}//package
Section 84
//ScoreScreen (ScoreScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ScoreScreen extends Sprite {
public var fishGot:TextField;
public var okButton:StartButton;
public var turtlePoints:TextField;
public var fishPoints:TextField;
public var scoreScreenTitle:TextField;
public var sharkPoints:TextField;
public var pointMultiplier:TextField;
public var turtlesGot:TextField;
public var remainingPoints:TextField;
public var sharksGot:TextField;
public var previousPoints:TextField;
public var todaysPoints:TextField;
}
}//package
Section 85
//SeaBird (SeaBird)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class SeaBird extends MovieClip {
private var frameTimer:Timer;
private var maxSteps:uint;
private var action:uint;
private var map:Map;
private var critterLayer:CritterLayer;
private var xSpeed:Number;
private var actionTimer:Timer;
private var step:uint;
private var frameCounter:uint;
public function SeaBird(_arg1:Number, _arg2:Number, _arg3:int){
map = Map.main;
critterLayer = map.critterLayer;
name = "seaBird";
x = _arg1;
y = _arg2;
if (_arg3 > 0){
scaleX = -1;
xSpeed = 3;
} else {
xSpeed = -3;
};
maxSteps = Math.abs(_arg3);
step = 1;
frameCounter = 1;
gotoAndStop(frameCounter);
map.critterArray.push(this);
critterLayer.addChild(this);
frameTimer = new Timer(200);
frameTimer.addEventListener(TimerEvent.TIMER, enterFrame);
actionTimer = new Timer((Math.floor((Math.random() * 501)) + 500));
actionTimer.addEventListener(TimerEvent.TIMER, startAction);
enableThis();
}
private function startAction(_arg1):void{
action = (Math.floor((Math.random() * 3)) + 1);
if (action == 2){
if (step == maxSteps){
step = 0;
scaleX = (0 - scaleX);
xSpeed = (0 - xSpeed);
} else {
x = (x + xSpeed);
frameCounter = action;
gotoAndStop(frameCounter);
frameTimer.start();
};
} else {
if (action == 3){
frameCounter = action;
gotoAndStop(frameCounter);
frameTimer.start();
};
};
actionTimer.delay = (Math.floor((Math.random() * 501)) + 500);
}
private function enterFrame(_arg1):void{
if (action == 2){
x = (x + xSpeed);
step++;
};
frameCounter = 1;
gotoAndStop(frameCounter);
frameTimer.reset();
}
public function kill():void{
var _local1:uint;
var _local2:uint;
disableThis();
frameTimer.removeEventListener(TimerEvent.TIMER, enterFrame);
actionTimer.removeEventListener(TimerEvent.TIMER, startAction);
_local1 = map.critterArray.indexOf(this);
map.critterArray.splice(_local1, 1);
_local2 = 0;
while (_local2 < 9) {
_local1 = map.critterNumCritterArray[_local2].indexOf(this);
if (_local1 > -1){
map.critterNumCritterArray[_local2].splice(_local1, 1);
};
_local2++;
};
critterLayer.removeChild(this);
}
public function disableThis():void{
actionTimer.reset();
}
public function enableThis():void{
actionTimer.start();
}
}
}//package
Section 86
//SeaBirdDead2 (SeaBirdDead2)
package {
import flash.display.*;
public class SeaBirdDead2 extends Sprite {
private var map:Map;
private var critterLayer:CritterLayer;
public function SeaBirdDead2(_arg1:Number, _arg2:Number){
map = Map.main;
critterLayer = map.critterLayer;
name = "seaBirdDead2";
x = _arg1;
y = _arg2;
rotation = (Math.floor((Math.random() * 360)) - 179);
critterLayer.addChild(this);
}
public function kill():void{
var _local1:int;
var _local2:uint;
_local2 = 0;
while (_local2 < 9) {
_local1 = map.critterNumCritterArray[_local2].indexOf(this);
if (_local1 > -1){
map.critterNumCritterArray[_local2].splice(_local1, 1);
};
_local2++;
};
critterLayer.removeChild(this);
}
public function disableThis():void{
}
public function enableThis():void{
}
}
}//package
Section 87
//Shark (Shark)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
public class Shark extends MovieClip {
private var frameTimer:Timer;
private var range:Number;
private var ySpeed:Number;
private var map:Map;
public var i:uint;
private var targetPoint:Point;
private var critterLayer:CritterLayer;
private var thisPoint:Point;
private var targetDistance:Number;
private var xSpeed:Number;
private var numTurns:uint;
private var extraPoint:Point;
private var numFrames:uint;
private var frameCounter:uint;
private var topSpeed:Number;
public function Shark(_arg1:uint){
map = Map.main;
critterLayer = map.critterLayer;
name = "shark";
x = (Math.floor((Math.random() * 460)) + 10);
y = 480;
thisPoint = new Point(x, y);
targetPoint = new Point();
topSpeed = 5;
range = 10;
numTurns = 4;
frameCounter = 1;
numFrames = 4;
gotoAndStop(frameCounter);
turn();
map.critterArray.push(this);
map.sharkArray.push(this);
critterLayer.addChild(this);
frameTimer = new Timer(_arg1);
frameTimer.addEventListener(TimerEvent.TIMER, enterFrame);
enableThis();
}
private function moveTowardsTarget():void{
extraPoint = targetPoint.subtract(thisPoint);
extraPoint.normalize(topSpeed);
xSpeed = extraPoint.x;
ySpeed = extraPoint.y;
x = (x + xSpeed);
y = (y + ySpeed);
thisPoint.x = x;
thisPoint.y = y;
if (++frameCounter > numFrames){
frameCounter = 1;
};
gotoAndStop(frameCounter);
i = map.getMapIndex(x, y);
extraPoint = targetPoint.subtract(thisPoint);
extraPoint.normalize(10);
map.checkSharkTile((x + extraPoint.x), (y + extraPoint.y));
}
private function enterFrame(_arg1):void{
targetDistance = Point.distance(thisPoint, targetPoint);
if (targetDistance <= range){
if (--numTurns < 0){
kill();
} else {
turn();
};
} else {
moveTowardsTarget();
};
}
public function kill():void{
var _local1:uint;
disableThis();
frameTimer.removeEventListener(TimerEvent.TIMER, enterFrame);
_local1 = map.critterArray.indexOf(this);
map.critterArray.splice(_local1, 1);
_local1 = map.sharkArray.indexOf(this);
map.sharkArray.splice(_local1, 1);
critterLayer.removeChild(this);
}
private function turn(){
targetPoint.x = ((x)<241) ? 250 : 10;
targetPoint.x = (Math.floor((Math.random() * 220)) + targetPoint.x);
targetPoint.y = ((numTurns)>0) ? (Math.floor((Math.random() * 330)) + 120) : 480;
extraPoint = targetPoint.subtract(thisPoint);
extraPoint.normalize(topSpeed);
xSpeed = extraPoint.x;
ySpeed = extraPoint.y;
rotation = ((Math.atan2(ySpeed, xSpeed) * (180 / Math.PI)) + 90);
moveTowardsTarget();
}
public function disableThis():void{
frameTimer.reset();
}
public function enableThis():void{
frameTimer.start();
}
}
}//package
Section 88
//Shore1Sided (Shore1Sided)
package {
import flash.display.*;
public dynamic class Shore1Sided extends Sprite {
}
}//package
Section 89
//Shore2Sided (Shore2Sided)
package {
import flash.display.*;
public dynamic class Shore2Sided extends Sprite {
}
}//package
Section 90
//Shore3Sided (Shore3Sided)
package {
import flash.display.*;
public dynamic class Shore3Sided extends Sprite {
}
}//package
Section 91
//Shore4Sided (Shore4Sided)
package {
import flash.display.*;
public dynamic class Shore4Sided extends Sprite {
}
}//package
Section 92
//ShoreDiagonal (ShoreDiagonal)
package {
import flash.display.*;
public dynamic class ShoreDiagonal extends Sprite {
}
}//package
Section 93
//SpillVille2 (SpillVille2)
package {
import flash.events.*;
import flash.display.*;
public class SpillVille2 extends MovieClip {
private var loaderBar:LoaderBar;
private var loadedFrameOne:Number;
public static var main;
public function SpillVille2(){
addFrameScript(0, frame1, 2, frame3);
loadedFrameOne = loaderInfo.bytesLoaded;
main = this;
stage.scaleMode = StageScaleMode.EXACT_FIT;
stage.showDefaultContextMenu = false;
loaderBar = new LoaderBar();
loaderBar.x = 235;
loaderBar.y = 235;
addChild(loaderBar);
loaderBar.playButton.visible = false;
loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgressHandler);
loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
}
private function loadComplete(_arg1):void{
loaderBar.loaderBarMeter.visible = false;
loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadProgressHandler);
loaderInfo.removeEventListener(Event.COMPLETE, loadComplete);
loaderBar.loadingMessage.visible = false;
loaderBar.playButton.addEventListener(MouseEvent.CLICK, playClicked);
loaderBar.playButton.visible = true;
}
function frame3(){
stop();
}
private function playClicked(_arg1):void{
removeChild(loaderBar);
loaderBar = null;
play();
}
function frame1(){
stop();
}
private function loadProgressHandler(_arg1:ProgressEvent):void{
loaderBar.loaderBarMeter.scaleX = (1 - ((_arg1.bytesLoaded - loadedFrameOne) / (_arg1.bytesTotal - loadedFrameOne)));
}
}
}//package
Section 94
//SplashBig (SplashBig)
package {
import flash.display.*;
public dynamic class SplashBig extends MovieClip {
}
}//package
Section 95
//SplashBigTitle (SplashBigTitle)
package {
import flash.display.*;
public dynamic class SplashBigTitle extends MovieClip {
}
}//package
Section 96
//SplashSmall (SplashSmall)
package {
import flash.display.*;
public dynamic class SplashSmall extends MovieClip {
}
}//package
Section 97
//SplashSmallTitle (SplashSmallTitle)
package {
import flash.display.*;
public dynamic class SplashSmallTitle extends MovieClip {
}
}//package
Section 98
//StartButton (StartButton)
package {
import flash.display.*;
public dynamic class StartButton extends SimpleButton {
}
}//package
Section 99
//StartLabel (StartLabel)
package {
import flash.display.*;
public dynamic class StartLabel extends Sprite {
}
}//package
Section 100
//ThemeMusic (ThemeMusic)
package {
public class ThemeMusic extends CustSound {
}
}//package
Section 101
//TimeRemaining (TimeRemaining)
package {
import flash.display.*;
import flash.text.*;
public dynamic class TimeRemaining extends Sprite {
public var timeDisplay:TextField;
}
}//package
Section 102
//TitleBoat (TitleBoat)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
public class TitleBoat extends Sprite {
public var accelerationLevel:uint;
private var xLimit:Number;
private var soundPlaying:String;
private var checkTimer:Timer;
private var boatPoint:Point;
private var range:Number;
private var targetArray:Array;
private var ySpeed:Number;
private var map:TitleMap;
public var targetArrayIndex:uint;
private var extraPoint:Point;
private var motor;
private var xLimitTest:Boolean;
private var acceleration:Number;
private var motor2;
private var boatHeight:Number;
private var targetPoint:Point;
public var costArray:Array;
private var targetDistance:Number;
private var xSpeed:Number;
private var vacuum;
public var topSpeedLevel:uint;
public var controller:Controller;
private var yLimit:Number;
public var vacuumLevel:uint;
private var vacuumPoint:Point;
private var boatLayer:BoatLayer;
private var topSpeed:Number;
public var numFireballs:uint;
public function TitleBoat(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:TitleMap){
controller = Controller.main;
map = _arg5;
boatLayer = map.boatLayer;
x = _arg1;
y = _arg2;
rotation = _arg3;
name = "boat";
accelerationLevel = (topSpeedLevel = (vacuumLevel = (xSpeed = (ySpeed = 0))));
acceleration = 0.175;
topSpeed = 3;
range = 10;
numFireballs = 1;
boatHeight = 46;
costArray = [];
costArray[0] = new Array(750, 2000, 4000, 8000, 16000);
costArray[1] = new Array(1000, 2500, 5000, 10000, 20000);
costArray[2] = new Array(1500, 3000, 6000, 12000, 24000);
targetArray = _arg4;
targetArrayIndex = 0;
targetPoint = new Point(targetArray[targetArrayIndex].x, targetArray[targetArrayIndex].y);
boatPoint = new Point(x, y);
vacuumPoint = new Point(x, y);
extraPoint = new Point();
vacuum = null;
motor = null;
motor2 = null;
soundPlaying = null;
boatLayer.addChild(this);
checkTimer = new Timer(500);
checkTimer.addEventListener(TimerEvent.TIMER, checkTick);
}
public function changeAccelerationLevel(_arg1:uint):void{
accelerationLevel = _arg1;
acceleration = 0.175;
addMotor();
}
private function playSound(_arg1:String):void{
if (_arg1 !== soundPlaying){
if (soundPlaying !== null){
controller.stopSound(soundPlaying);
};
controller.playSound(_arg1, 0, 200);
soundPlaying = _arg1;
};
}
private function moveTowardsTarget():void{
var _local1:*;
extraPoint = targetPoint.subtract(boatPoint);
extraPoint.normalize(topSpeed);
if (extraPoint.x > 0){
if (xSpeed > extraPoint.x){
if ((xSpeed - acceleration) < extraPoint.x){
xSpeed = extraPoint.x;
} else {
xSpeed = (xSpeed - acceleration);
};
} else {
xSpeed = (xSpeed + acceleration);
if (xSpeed > extraPoint.x){
xSpeed = extraPoint.x;
};
};
} else {
if (xSpeed < extraPoint.x){
if ((xSpeed + acceleration) > extraPoint.x){
xSpeed = extraPoint.x;
} else {
xSpeed = (xSpeed + acceleration);
};
} else {
xSpeed = (xSpeed - acceleration);
if (xSpeed < extraPoint.x){
xSpeed = extraPoint.x;
};
};
};
if (extraPoint.y > 0){
if (ySpeed > extraPoint.y){
if ((ySpeed - acceleration) < extraPoint.y){
ySpeed = extraPoint.y;
} else {
ySpeed = (ySpeed - acceleration);
};
} else {
ySpeed = (ySpeed + acceleration);
if (ySpeed > extraPoint.y){
ySpeed = extraPoint.y;
};
};
} else {
if (ySpeed < extraPoint.y){
if ((ySpeed + acceleration) > extraPoint.y){
ySpeed = extraPoint.y;
} else {
ySpeed = (ySpeed + acceleration);
};
} else {
ySpeed = (ySpeed - acceleration);
if (ySpeed < extraPoint.y){
ySpeed = extraPoint.y;
};
};
};
_local1 = rotation;
rotation = ((Math.atan2(ySpeed, xSpeed) * (180 / Math.PI)) + 90);
if (motor !== null){
if (_local1 < rotation){
_local1 = (rotation - _local1);
if (_local1 > 8){
motor.rotation = -30;
} else {
if (_local1 > 5){
motor.rotation = -20;
} else {
if (_local1 > 3){
motor.rotation = -10;
} else {
motor.rotation = 0;
};
};
};
} else {
if (_local1 > rotation){
_local1 = (_local1 - rotation);
if (_local1 > 8){
motor.rotation = 30;
} else {
if (_local1 > 5){
motor.rotation = 20;
} else {
if (_local1 > 3){
motor.rotation = 10;
} else {
motor.rotation = 0;
};
};
};
} else {
motor.rotation = 0;
};
};
};
if (motor2 !== null){
motor2.rotation = motor.rotation;
};
y = (y + ySpeed);
x = (x + xSpeed);
boatPoint.x = x;
boatPoint.y = y;
}
public function disableBoat():void{
removeEventListener(Event.ENTER_FRAME, enterFrame);
checkTimer.reset();
if (soundPlaying !== null){
controller.stopSound(soundPlaying);
(soundPlaying == null);
};
}
private function addMotor():void{
if (motor !== null){
removeChild(motor);
};
if (motor2 !== null){
removeChild(motor2);
};
switch ((accelerationLevel + topSpeedLevel)){
case 1:
motor = new Motor1();
motor2 = null;
break;
case 2:
motor = new Motor1();
motor2 = new Motor1();
break;
case 3:
motor = new Motor3();
motor2 = null;
break;
case 4:
motor = new Motor3();
motor2 = new Motor3();
break;
case 5:
motor = new Motor5();
motor2 = null;
break;
case 6:
motor = new Motor5();
motor2 = new Motor5();
break;
case 7:
motor = new Motor7();
motor2 = null;
break;
case 8:
motor = new Motor7();
motor2 = new Motor7();
break;
case 9:
motor = new Motor9();
motor2 = null;
break;
case 10:
motor = new Motor9();
motor2 = new Motor9();
break;
default:
motor = null;
motor2 = null;
break;
};
if (motor !== null){
motor.name = "motor";
motor.y = ((boatHeight + motor.height) * 0.5);
addChild(motor);
};
if (motor2 !== null){
motor2.name = "motor2";
motor2.y = ((boatHeight + motor2.height) * 0.5);
addChild(motor2);
motor.x = -6.5;
motor2.x = 6.5;
};
}
public function changeVacuumLevel(_arg1:uint):void{
vacuumLevel = _arg1;
checkTimer.delay = (500 - (5 * 80));
acceleration = ((0.175 + (accelerationLevel * 0.06)) - (vacuumLevel * 0.03));
if (vacuum !== null){
removeChild(vacuum);
};
switch (vacuumLevel){
case 1:
vacuum = new Vacuum1();
break;
case 2:
vacuum = new Vacuum2();
break;
case 3:
vacuum = new Vacuum3();
break;
case 4:
vacuum = new Vacuum4();
break;
case 5:
vacuum = new Vacuum5();
break;
default:
vacuum = null;
break;
};
if (vacuum !== null){
vacuum.name = "vacuum";
vacuum.y = 15.5;
addChild(vacuum);
};
}
public function enableBoat():void{
addEventListener(Event.ENTER_FRAME, enterFrame);
checkTimer.start();
if (soundPlaying !== null){
controller.playSound(soundPlaying, 0, 200);
};
}
private function enterFrame(_arg1):void{
targetDistance = Point.distance(boatPoint, targetPoint);
if (targetDistance > range){
playSound((("motor" + (accelerationLevel + topSpeedLevel)) + "MP3"));
moveTowardsTarget();
} else {
if (++targetArrayIndex < targetArray.length){
targetPoint = new Point(targetArray[targetArrayIndex].x, targetArray[targetArrayIndex].y);
playSound((("motor" + (accelerationLevel + topSpeedLevel)) + "MP3"));
moveTowardsTarget();
} else {
disableBoat();
checkTimer.removeEventListener(TimerEvent.TIMER, checkTick);
};
};
}
private function coastToStop():void{
extraPoint.x = xSpeed;
extraPoint.y = ySpeed;
extraPoint.normalize(acceleration);
if (xSpeed > 0){
if ((xSpeed - extraPoint.x) < 0){
xSpeed = 0;
} else {
xSpeed = (xSpeed - extraPoint.x);
};
} else {
if (xSpeed < 0){
if ((xSpeed - extraPoint.x) > 0){
xSpeed = 0;
} else {
xSpeed = (xSpeed - extraPoint.x);
};
};
};
if (ySpeed > 0){
if ((ySpeed - extraPoint.y) < 0){
ySpeed = 0;
} else {
ySpeed = (ySpeed - extraPoint.y);
};
} else {
if (ySpeed < 0){
if ((ySpeed - extraPoint.y) > 0){
ySpeed = 0;
} else {
ySpeed = (ySpeed - extraPoint.y);
};
};
};
x = (x + xSpeed);
y = (y + ySpeed);
boatPoint.x = x;
boatPoint.y = y;
if (motor !== null){
motor.rotation = 0;
};
if (motor2 !== null){
motor2.rotation = 0;
};
}
public function kill():void{
disableBoat();
checkTimer.removeEventListener(TimerEvent.TIMER, checkTick);
parent.removeChild(this);
}
private function checkTick(_arg1):void{
if (((!((xSpeed === 0))) || (!((ySpeed === 0))))){
vacuumPoint.x = (0 - xSpeed);
vacuumPoint.y = (0 - ySpeed);
vacuumPoint.normalize(12);
vacuumPoint.x = (vacuumPoint.x + x);
vacuumPoint.y = (vacuumPoint.y + y);
};
if ((((vacuumPoint.x > 0)) && ((vacuumPoint.x < map.widthPixels)))){
map.checkBoatTile(vacuumPoint.x, vacuumPoint.y);
};
}
public function changeTopSpeedLevel(_arg1:uint):void{
topSpeedLevel = _arg1;
topSpeed = 4;
addMotor();
}
}
}//package
Section 103
//TitleMap (TitleMap)
package {
import flash.display.*;
public class TitleMap extends MovieClip {
public var critterNumStatusArray:Array;
public var flameTiles:Array;
public var widthPixels:uint;
public var critterNumCritterArray:Array;
private var widthTiles:uint;
private var tileTypes:Array;
private var lastToggledTileType:String;
public var numCrittersAlive:uint;
private var tileHeightPixels:Number;
public var critterArray:Array;
private var tileWidthPixels:Number;
public var oilLayer:OilLayer3;
private var numTiles:uint;
private var tiles:Array;
private var heightTiles:uint;
public var heightPixels:uint;
public var controller:Controller;
private var lastToggledTileIndex:uint;
private var losingIndexArray:Array;
public var flameLayer:SchoolLayer0;
public var boatLayer:BoatLayer;
public static var main;
public function TitleMap(_arg1:Number, _arg2:Number){
controller = Controller.main;
main = this;
x = _arg1;
y = _arg2;
oilLayer.x = (boatLayer.x = -5);
widthTiles = (heightTiles = (numTiles = (widthPixels = (heightPixels = 0))));
tileWidthPixels = 19.95;
tileHeightPixels = 19.95;
tileTypes = [];
tiles = [];
flameTiles = [];
critterArray = [];
critterNumStatusArray = [];
losingIndexArray = populateLosingIndexArray();
critterNumCritterArray = [];
resetCritterNumCritterArray();
lastToggledTileType = "G";
}
private function populateLosingIndexArray():Array{
var _local1:Array;
var _local2:Array;
var _local3:uint;
var _local4:*;
_local1 = [];
_local1.push({critterIndex:96, critterNum:0}, {critterIndex:97, critterNum:0}, {critterIndex:98, critterNum:0}, {critterIndex:123, critterNum:1});
_local1.push({critterIndex:148, critterNum:1}, {critterIndex:173, critterNum:1}, {critterIndex:174, critterNum:1}, {critterIndex:175, critterNum:2});
_local1.push({critterIndex:176, critterNum:2}, {critterIndex:177, critterNum:2}, {critterIndex:153, critterNum:2}, {critterIndex:129, critterNum:3});
_local1.push({critterIndex:106, critterNum:3}, {critterIndex:107, critterNum:3}, {critterIndex:108, critterNum:4}, {critterIndex:133, critterNum:4});
_local1.push({critterIndex:110, critterNum:4}, {critterIndex:111, critterNum:5}, {critterIndex:112, critterNum:5}, {critterIndex:113, critterNum:6});
_local1.push({critterIndex:138, critterNum:6}, {critterIndex:115, critterNum:6}, {critterIndex:92, critterNum:7}, {critterIndex:93, critterNum:7});
_local1.push({critterIndex:70, critterNum:8}, {critterIndex:71, critterNum:8});
_local2 = [];
_local3 = 0;
while (_local3 <= 152) {
_local2[_local3] = "G";
_local3++;
};
_local2[94] = "W";
_local2[95] = "W";
_local3 = 116;
while (_local3 <= 122) {
_local2[_local3] = "W";
_local3++;
};
_local3 = 130;
while (_local3 <= 132) {
_local2[_local3] = "W";
_local3++;
};
_local3 = 134;
while (_local3 <= 137) {
_local2[_local3] = "W";
_local3++;
};
_local3 = 139;
while (_local3 <= 147) {
_local2[_local3] = "W";
_local3++;
};
_local3 = 154;
while (_local3 <= 172) {
_local2[_local3] = "W";
_local3++;
};
for each (_local4 in _local1) {
_local2[_local4.critterIndex] = (_local4.critterNum + "");
};
return (_local2);
}
public function flameAllNeighbors(_arg1:uint):void{
var _local2:Array;
var _local3:uint;
_local2 = tileNeighborsOfType("W", _arg1);
_local2.push(_arg1);
for each (_local3 in _local2) {
newFlame(0, 0, _local3);
};
}
public function spillInDirection(_arg1:uint):Boolean{
var _local2:uint;
_local2 = Math.floor((Math.random() * 64));
_local2 = (((_local2 % 16) + (Math.floor((_local2 / 16)) * widthTiles)) + 462);
while (true) {
if (tileTypes[_local2] == "G"){
return (makeOilTile(_local2));
};
if (tiles[_local2].numOilNeighors < 4){
return (oilAllNeighbors(_local2));
};
if ((_local2 % widthTiles) == 0){
_arg1 = (Math.floor((Math.random() * 4)) + 3);
} else {
if (((_local2 + 1) % widthTiles) == 0){
_arg1 = (Math.floor((Math.random() * 4)) + 1);
};
};
switch (_arg1){
case 1:
_local2--;
break;
case 2:
_local2 = (_local2 - (widthTiles + 1));
break;
case 3:
case 4:
_local2 = (_local2 - widthTiles);
break;
case 5:
_local2 = (_local2 - (widthTiles - 1));
break;
case 6:
_local2++;
break;
default:
break;
};
};
return (false);
}
public function pauseGame():void{
killAllFireBalls("disable");
killAllCritters("disable");
}
private function flameClick(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
new FireBall(_arg1, _arg2, _arg3, _arg4);
}
public function killAllCritters(_arg1:String="kill"):void{
var _local2:uint;
var _local3:int;
_local2 = critterArray.length;
if (_local2 > 0){
_local3 = (_local2 - 1);
while (_local3 >= 0) {
switch (_arg1){
case "disable":
critterArray[_local3].disableThis();
break;
case "enable":
critterArray[_local3].enableThis();
break;
default:
critterArray[_local3].kill();
break;
};
_local3--;
};
};
}
private function toggleTile(_arg1:uint, _arg2:Boolean):void{
var _local3:*;
var _local4:int;
var _local5:uint;
_local3 = [];
if (_arg2){
tileTypes[_arg1] = lastToggledTileType;
} else {
if (tileTypes[_arg1] == "G"){
tileTypes[_arg1] = "W";
} else {
tileTypes[_arg1] = "G";
};
};
lastToggledTileType = "G";
tiles[_arg1] = drawTile(_arg1, tiles[_arg1].x, tiles[_arg1].y);
_local3 = tileWaterNeighbors(_arg1);
if (_local3.length > 1){
_local5 = 1;
while (_local5 < _local3.length) {
_local4 = parseInt(_local3[_local5]);
tiles[_local4] = drawTile(_local4, tiles[_local4].x, tiles[_local4].y);
_local5++;
};
};
}
public function checkBoatTile(_arg1:Number, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:int;
var _local7:int;
var _local8:uint;
var _local9:int;
var _local10:int;
_local5 = getMapIndex(_arg1, _arg2);
_local6 = -1;
while (_local6 <= 1) {
if (_local6 == 0){
_local9 = -1;
_local10 = 1;
} else {
_local10 = 0;
_local9 = _local10;
};
_local7 = _local9;
while (_local7 <= _local10) {
_local8 = ((_local5 + _local7) + (_local6 * widthTiles));
if ((((((((_local8 <= numTiles)) && ((tileTypes[_local8] == "W")))) && (!(((((_local5 % widthTiles) == 0)) && ((_local8 == (_local5 - 1)))))))) && (!((((((_local5 + 1) % widthTiles) == 0)) && ((_local8 == (_local5 + 1)))))))){
toggleTile(_local8, true);
};
_local7++;
};
_local6++;
};
}
private function drawTile(_arg1:uint, _arg2:Number, _arg3:Number){
var _local4:*;
var _local5:*;
var _local6:String;
var _local7:int;
_local7 = 0;
if (tileTypes[_arg1] == "G"){
_local6 = "Grass";
} else {
_local6 = getWaterTileRotAndLibName(_arg1);
_local7 = Number(_local6.slice(0, 3));
_local6 = _local6.slice(3);
};
switch (_local6){
case "Water":
_local4 = new Water();
_local4.numOilNeighors = 4;
break;
case "Shore1Sided":
_local4 = new Shore1Sided();
_local4.numOilNeighors = 3;
break;
case "Shore2Sided":
_local4 = new Shore2Sided();
_local4.numOilNeighors = 2;
break;
case "Shore3Sided":
_local4 = new Shore3Sided();
_local4.numOilNeighors = 1;
break;
case "Shore4Sided":
_local4 = new Shore4Sided();
_local4.numOilNeighors = 0;
break;
case "ShoreDiagonal":
_local4 = new ShoreDiagonal();
_local4.numOilNeighors = 2;
break;
case "Grass":
_local4 = new Grass();
_local4.numOilNeighors = 0;
break;
};
_local4.name = ("tile" + _arg1);
_local4.x = _arg2;
_local4.y = _arg3;
_local4.rotation = _local7;
if (_arg1 < oilLayer.numChildren){
_local5 = oilLayer.getChildAt(_arg1);
oilLayer.removeChild(_local5);
};
return (oilLayer.addChildAt(_local4, _arg1));
}
private function checkForReachingShore(_arg1:uint):String{
if (_arg1 < losingIndexArray.length){
return (losingIndexArray[_arg1]);
};
return ("W");
}
private function tileNeighborsOfType(_arg1:String, _arg2:uint):Array{
var _local3:String;
var _local4:Array;
var _local5:*;
var _local6:String;
_local4 = new Array("U", "D", "L", "R");
_local5 = [];
for each (_local6 in _local4) {
_local3 = tileNeighbor(_arg2, _local6);
if (_local3.slice(0, 1) == _arg1){
_local5.push(parseInt(_local3.slice(1)));
};
};
return (_local5);
}
private function eraseAllTiles():void{
var _local1:uint;
_local1 = 0;
while (_local1 < tiles.length) {
oilLayer.removeChild(tiles[_local1]);
tiles[_local1] = null;
_local1++;
};
}
private function getMapIndex(_arg1:Number, _arg2:Number):uint{
var _local3:*;
var _local4:*;
_local3 = Math.floor((_arg1 / tileWidthPixels));
_local4 = Math.floor((_arg2 / tileHeightPixels));
return (((_local4 * widthTiles) + _local3));
}
private function oilAllNeighbors(_arg1:uint):Boolean{
var _local2:Boolean;
var _local3:Array;
var _local4:uint;
_local2 = false;
_local3 = tileNeighborsOfType("G", _arg1);
for each (_local4 in _local3) {
if (makeOilTile(_local4)){
_local2 = true;
};
};
return (_local2);
}
public function flameTick():void{
var _local1:uint;
var _local2:int;
_local1 = flameTiles.length;
if (_local1 > 0){
_local2 = (_local1 - 1);
while (_local2 >= 0) {
flameTiles[_local2].tick();
_local2--;
};
};
}
public function newFlame(_arg1:Number, _arg2:Number, _arg3:int=-1):void{
var _local4:uint;
var _local5:Number;
var _local6:Number;
var _local7:Flame;
_local4 = ((_arg3)==-1) ? getMapIndex(_arg1, _arg2) : _arg3;
if (tileTypes[_local4] == "W"){
toggleTile(_local4, true);
_local5 = (((_local4 % widthTiles) * tileWidthPixels) + (tileWidthPixels * 0.5));
_local6 = ((Math.floor((_local4 / widthTiles)) * tileHeightPixels) + (tileHeightPixels * 0.5));
_local7 = new Flame(_local4, _local5, _local6);
flameTiles.push(_local7);
};
}
private function drawTiles():void{
var _local1:*;
var _local2:*;
var _local3:uint;
var _local4:*;
var _local5:Number;
_local4 = (tileWidthPixels / -2);
_local5 = (tileHeightPixels / -2);
_local1 = 0;
while (_local1 < numTiles) {
_local3 = (Math.floor((_local1 / widthTiles)) + 1);
_local2 = ((_local1 + 1) - ((_local3 - 1) * widthTiles));
tiles[_local1] = drawTile(_local1, ((_local2 * tileWidthPixels) + _local4), ((_local3 * tileHeightPixels) + _local5));
oilLayer.addChild(tiles[_local1]);
_local1++;
};
}
private function getWaterTileRotAndLibName(_arg1:uint):String{
var _local2:*;
var _local3:String;
_local2 = [];
_local2 = tileWaterNeighbors(_arg1);
switch (_local2[0].length){
case 4:
_local3 = "000Water";
break;
case 3:
switch (_local2[0]){
case "DLR":
_local3 = "000";
break;
case "UDL":
_local3 = "090";
break;
case "UDR":
_local3 = "-90";
break;
default:
_local3 = "180";
break;
};
_local3 = (_local3 + "Shore1Sided");
break;
case 2:
switch (_local2[0]){
case "LR":
_local3 = "000Shore2Sided";
break;
case "UD":
_local3 = "090Shore2Sided";
break;
case "DL":
_local3 = "000ShoreDiagonal";
break;
case "UL":
_local3 = "090ShoreDiagonal";
break;
case "DR":
_local3 = "-90ShoreDiagonal";
break;
default:
_local3 = "180ShoreDiagonal";
break;
};
break;
case 1:
switch (_local2[0]){
case "R":
_local3 = "000";
break;
case "D":
_local3 = "090";
break;
case "U":
_local3 = "-90";
break;
default:
_local3 = "180";
break;
};
_local3 = (_local3 + "Shore3Sided");
break;
default:
_local3 = "000Shore4Sided";
break;
};
return (_local3);
}
public function unpauseGame():void{
killAllFireBalls("enable");
killAllCritters("enable");
}
public function killAllFireBalls(_arg1:String="kill"):void{
var _local2:String;
var _local3:*;
if (boatLayer.getChildByName("fireBall")){
_local2 = "fireBall";
} else {
_local2 = "disabledFireBall";
};
_local3 = boatLayer.getChildByName(_local2);
while (_local3) {
switch (_arg1){
case "disable":
_local3.disableFireBall();
_local3.name = "disabledFireBall";
break;
case "enable":
_local3.enableFireBall();
_local3.name = "fireBall";
break;
default:
_local3.kill();
break;
};
_local3 = boatLayer.getChildByName(_local2);
};
}
private function killCritter(_arg1:uint):Boolean{
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:*;
if (critterNumStatusArray[_arg1].critterStatus == "D"){
return (false);
};
critterNumStatusArray[_arg1].critterStatus = "D";
controller.playSound("critterDeath");
_local6 = critterNumCritterArray[_arg1];
_local3 = _local6.length;
if (_local3 > 0){
_local2 = (_local3 - 1);
while (_local2 >= 0) {
_local6[_local2].kill();
_local2--;
};
};
_local4 = critterNumStatusArray[_arg1].critterX;
_local5 = critterNumStatusArray[_arg1].critterY;
switch (_arg1){
case 1:
case 2:
_local6.push(new BabySeaTurtleDead(_local4, _local5));
break;
case 3:
_local6.push(new FishDead2(_local4, _local5));
break;
case 5:
_local6.push(new FishDead1(_local4, _local5));
break;
default:
_local6.push(new SeaBirdDead2(_local4, _local5));
break;
};
if (--numCrittersAlive == 0){
return (true);
};
return (false);
}
public function loadMap(_arg1:String):Boolean{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:uint;
var _local8:String;
var _local9:*;
if (_arg1.length < 6){
return (false);
};
_local9 = [];
_local3 = uint(_arg1.slice(0, 2));
if (_local3 == 0){
_local3 = 100;
};
_local4 = uint(_arg1.slice(2, 4));
if (_local4 == 0){
_local4 = 100;
};
if (((isNaN(_local3)) || (isNaN(_local4)))){
return (false);
};
if ((((((((_local3 < 10)) || ((_local3 > 100)))) || ((_local4 < 10)))) || ((_local4 > 100)))){
return (false);
};
_local5 = 4;
while (_local5 < _arg1.length) {
_local2 = parseInt(("0x" + _arg1.slice(_local5, (_local5 + 2))));
if (isNaN(_local2)){
return (false);
};
if (_local2 >= 128){
_local8 = "G";
_local2 = (_local2 - 128);
} else {
_local8 = "W";
};
if (_local2 == 0){
_local2 = 128;
};
_local6 = _local9.length;
_local7 = _local6;
while (_local7 < (_local6 + _local2)) {
_local9[_local7] = _local8;
_local7++;
};
_local5 = (_local5 + 2);
};
if ((_local3 * _local4) != _local9.length){
return (false);
};
widthTiles = _local3;
heightTiles = _local4;
numTiles = (widthTiles * heightTiles);
widthPixels = (widthTiles * tileWidthPixels);
heightPixels = (heightTiles * tileHeightPixels);
if (tiles.length > 0){
eraseAllTiles();
};
if (tileTypes.length > numTiles){
tiles.splice(numTiles);
tileTypes.splice(numTiles);
};
_local7 = 0;
while (_local7 < numTiles) {
tileTypes[_local7] = _local9[_local7];
_local7++;
};
drawTiles();
return (true);
}
public function resetCritter(_arg1:int):void{
var _local2:Array;
var _local3:uint;
_local2 = critterNumCritterArray[_arg1];
_local3 = _local2.length;
if (_local3 > 0){
_arg1 = (_local3 - 1);
while (_arg1 >= 0) {
_local2[_arg1].kill();
_arg1--;
};
};
}
public function resetCritterStatus():void{
critterNumStatusArray = [];
critterNumStatusArray.push({critterStatus:"A", critterX:27, critterY:85}, {critterStatus:"A", critterX:114, critterY:133});
critterNumStatusArray.push({critterStatus:"A", critterX:170, critterY:132}, {critterStatus:"A", critterX:182, critterY:70});
critterNumStatusArray.push({critterStatus:"A", critterX:264, critterY:85}, {critterStatus:"A", critterX:315, critterY:65});
critterNumStatusArray.push({critterStatus:"A", critterX:365, critterY:85}, {critterStatus:"A", critterX:410, critterY:48});
critterNumStatusArray.push({critterStatus:"A", critterX:455, critterY:35});
numCrittersAlive = 9;
resetCritterNumCritterArray();
}
private function makeOilTile(_arg1:uint):Boolean{
var _local2:String;
_local2 = checkForReachingShore(_arg1);
switch (_local2){
case "W":
toggleTile(_arg1, false);
case "G":
return (false);
default:
toggleTile(_arg1, false);
return (killCritter(parseInt(_local2)));
};
}
private function resetCritterNumCritterArray():void{
var _local1:int;
if (critterNumCritterArray.length > 0){
_local1 = 0;
while (_local1 < 9) {
resetCritter(_local1);
_local1++;
};
} else {
critterNumCritterArray = [];
_local1 = 0;
while (_local1 < 9) {
critterNumCritterArray[_local1] = [];
_local1++;
};
};
}
public function killFlames():void{
var _local1:uint;
var _local2:int;
_local1 = flameTiles.length;
if (_local1 > 0){
_local2 = (_local1 - 1);
while (_local2 >= 0) {
flameTiles[_local2].kill();
_local2--;
};
};
}
private function tileWaterNeighbors(_arg1:uint):Array{
var _local2:String;
var _local3:Array;
var _local4:*;
var _local5:uint;
_local3 = new Array("U", "D", "L", "R");
_local4 = [];
_local4[0] = "";
_local5 = 0;
while (_local5 < 4) {
_local2 = tileNeighbor(_arg1, _local3[_local5]);
if (_local2.slice(0, 1) != "G"){
_local4[0] = (_local4[0] + _local3[_local5]);
if (_local2.slice(0, 1) == "W"){
_local4.push(_local2.slice(1));
};
};
_local5++;
};
return (_local4);
}
private function tileNeighbor(_arg1:uint, _arg2:String):String{
var _local3:int;
switch (_arg2){
case "U":
_local3 = (_arg1 - widthTiles);
break;
case "D":
_local3 = (_arg1 + widthTiles);
break;
case "L":
if ((_arg1 % widthTiles) != 0){
_local3 = (_arg1 - 1);
} else {
_local3 = -1;
};
break;
default:
_local3 = (_arg1 + 1);
if ((_local3 % widthTiles) == 0){
_local3 = -1;
};
break;
};
if ((((_local3 >= 0)) && ((_local3 < numTiles)))){
return ((tileTypes[_local3] + _local3));
};
return (("X" + _local3));
}
}
}//package
Section 104
//TitleScreen (TitleScreen)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class TitleScreen extends Sprite {
public var startButton:StartButton;
public var instructionButton:StartButton;
public var quitButton;
private var tenthTimer:Timer;
private var fishCounter:uint;
public var fishing:MovieClip;
public var authorWebsite:StartButton;
public var unpauseButton;
public var critterArray:Array;
public function TitleScreen(){
quitButton = null;
unpauseButton = null;
critterArray = [];
fishCounter = 0;
tenthTimer = new Timer(100);
tenthTimer.addEventListener(TimerEvent.TIMER, tenthTimerTick);
tenthTimer.start();
}
private function tenthTimerTick(_arg1):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (++fishCounter > 18){
fishCounter = 1;
};
switch (fishCounter){
case 1:
_local3 = (Math.floor((Math.random() * 320)) + 100);
_local2 = (Math.floor((Math.random() * 90)) + 10);
if (_local2 < 55){
_local4 = 1;
} else {
_local4 = -1;
};
new FishTitle(_local2, _local3, _local4, this);
break;
case 4:
_local3 = (Math.floor((Math.random() * 320)) + 100);
_local2 = (Math.floor((Math.random() * 90)) + 370);
if (_local2 < 415){
_local4 = 1;
} else {
_local4 = -1;
};
new FishTitle(_local2, _local3, _local4, this);
break;
case 9:
_local3 = (Math.floor((Math.random() * 40)) + 40);
_local2 = (Math.floor((Math.random() * 270)) + 100);
if (_local2 < 235){
_local4 = 1;
} else {
_local4 = -1;
};
new FishTitle(_local2, _local3, _local4, this);
break;
case 15:
_local3 = 300;
_local2 = (Math.floor((Math.random() * 270)) + 100);
if (_local2 < 235){
_local4 = 1;
} else {
_local4 = -1;
};
new FishTitle(_local2, _local3, _local4, this);
break;
};
}
public function kill():void{
var _local1:int;
tenthTimer.stop();
tenthTimer.removeEventListener(TimerEvent.TIMER, tenthTimerTick);
if (critterArray.length > 0){
_local1 = (critterArray.length - 1);
while (_local1 >= 0) {
critterArray[_local1].kill();
_local1--;
};
};
parent.removeChild(this);
}
}
}//package
Section 105
//UILayer (UILayer)
package {
import flash.display.*;
public dynamic class UILayer extends MovieClip {
public var buttonPause:ButtonPause;
public var fxVolumeControl:FXVolumeControl;
public var addictingGames:MovieClip;
public var score:Score;
public var timeRemaining:TimeRemaining;
public var musicVolumeControl:MusicVolumeControl;
public var multiplier:Multiplier;
}
}//package
Section 106
//UpgradeScreen (UpgradeScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class UpgradeScreen extends Sprite {
public var price11:TextField;
public var price13:TextField;
public var price12:TextField;
public var startButton:StartButton;
public var price21:TextField;
public var price22:TextField;
public var price31:TextField;
public var pointsRemaining:TextField;
public var price23:TextField;
public var price42:TextField;
public var price32:TextField;
public var price41:TextField;
public var price52:TextField;
public var dayDisplay:TextField;
public var price51:TextField;
}
}//package
Section 107
//Vacuum1 (Vacuum1)
package {
import flash.display.*;
public dynamic class Vacuum1 extends Sprite {
}
}//package
Section 108
//Vacuum2 (Vacuum2)
package {
import flash.display.*;
public dynamic class Vacuum2 extends Sprite {
}
}//package
Section 109
//Vacuum3 (Vacuum3)
package {
import flash.display.*;
public dynamic class Vacuum3 extends Sprite {
}
}//package
Section 110
//Vacuum4 (Vacuum4)
package {
import flash.display.*;
public dynamic class Vacuum4 extends Sprite {
}
}//package
Section 111
//Vacuum5 (Vacuum5)
package {
import flash.display.*;
public dynamic class Vacuum5 extends Sprite {
}
}//package
Section 112
//Water (Water)
package {
import flash.display.*;
public dynamic class Water extends Sprite {
}
}//package
Section 113
//WhiteCircle (WhiteCircle)
package {
import flash.display.*;
public dynamic class WhiteCircle extends Sprite {
}
}//package
Section 114
//WinScreen (WinScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class WinScreen extends Sprite {
public var startButton:StartButton;
public var finalTitle:TextField;
public var finalPoints:TextField;
}
}//package
Section 115
//VolumeKnob (VolumeKnob)
package {
import flash.display.*;
public dynamic class VolumeKnob extends Sprite {
}
}//package
Section 116
//VolumeSliderBackground (VolumeSliderBackground)
package {
import flash.display.*;
public dynamic class VolumeSliderBackground extends Sprite {
}
}//package