Frame 3
stop();
Frame 8
if (getBytesLoaded() < getBytesTotal()) {
gotoAndPlay (4);
}
Frame 12
stop();
Frame 18
stop();
Frame 19
function Choose(vName) {
trace("Character: " + vName);
gCharacter = vName;
gotoAndPlay (33);
}
var gCharacter;
var gScore = 0;
var gState = 1;
var gfPlaying = false;
Frame 32
stop();
Frame 38
function Move(vDir) {
Game.Radar.Move(vDir);
}
function Turn(vDir) {
Game.Character.MoveArms(vDir);
Game.Radar.ChangeQuads(vDir);
Game.Screen.Turn(vDir);
}
function ClickArrow(vDir) {
Turn(vDir);
}
function Shift(vDir) {
gState = vDir;
Move(vDir);
}
function CheckKeys() {
if (Key.isDown(Key.RIGHT)) {
Turn(1);
} else if (Key.isDown(Key.LEFT)) {
Turn(-1);
} else if (Key.isDown(Key.UP)) {
Game.Lever.Shift(1);
} else if (Key.isDown(Key.DOWN)) {
Game.Lever.Shift(-1);
}
}
function EndGame(vFrame) {
gState = 0;
gfPlaying = false;
Game.Radar.removeMovieClip();
Game.Screen.removeMovieClip();
trace("root.EndGame:" + vFrame);
gotoAndPlay(vFrame);
}
gScore = 0;
Game.ResetGame();
Frame 43
if (gState != 0) {
Move(gState);
CheckKeys();
if (gState != 0) {
gotoAndPlay (42);
}
}
Frame 45
stop();
Frame 58
trace("END");
play();
Frame 89
Frame 98
stop();
Frame 107
Frame 137
Frame 155
stop();
Frame 157
stop();
Symbol 6 MovieClip Frame 104
_root.gotoAndPlay("Help");
Symbol 9 Button
on (rollOver) {
play();
}
Symbol 10 MovieClip Frame 1
stop();
Symbol 12 MovieClip Frame 1
function CheckLoad() {
bytesLoaded = _root.getBytesLoaded();
bytesTotal = _root.getBytesTotal();
frames = frames + 1;
if ((bytesLoaded >= (bytesTotal * 0.9)) && (fNickLoad == true)) {
_parent.gotoAndPlay("Load");
} else {
loadbar.gotoAndStop(Math.min(Math.round((bytesLoaded / bytesTotal) * 100), frames));
}
}
var bytesLoaded;
var bytesTotal;
var frames;
Symbol 12 MovieClip Frame 2
CheckLoad();
Symbol 12 MovieClip Frame 3
CheckLoad();
Symbol 12 MovieClip Frame 4
CheckLoad();
Symbol 12 MovieClip Frame 5
CheckLoad();
Symbol 12 MovieClip Frame 6
CheckLoad();
Symbol 12 MovieClip Frame 7
CheckLoad();
Symbol 12 MovieClip Frame 8
CheckLoad();
Symbol 12 MovieClip Frame 9
CheckLoad();
Symbol 12 MovieClip Frame 10
CheckLoad();
Symbol 12 MovieClip Frame 11
CheckLoad();
Symbol 12 MovieClip Frame 12
CheckLoad();
Symbol 12 MovieClip Frame 13
CheckLoad();
Symbol 12 MovieClip Frame 14
CheckLoad();
Symbol 12 MovieClip Frame 15
CheckLoad();
Symbol 12 MovieClip Frame 16
CheckLoad();
Symbol 12 MovieClip Frame 17
CheckLoad();
Symbol 12 MovieClip Frame 18
CheckLoad();
Symbol 12 MovieClip Frame 19
CheckLoad();
Symbol 12 MovieClip Frame 20
CheckLoad();
Symbol 12 MovieClip Frame 21
CheckLoad();
Symbol 12 MovieClip Frame 22
CheckLoad();
Symbol 12 MovieClip Frame 23
CheckLoad();
Symbol 12 MovieClip Frame 24
CheckLoad();
Symbol 12 MovieClip Frame 25
CheckLoad();
Symbol 12 MovieClip Frame 26
CheckLoad();
Symbol 12 MovieClip Frame 27
CheckLoad();
Symbol 12 MovieClip Frame 28
CheckLoad();
Symbol 12 MovieClip Frame 29
CheckLoad();
Symbol 12 MovieClip Frame 30
CheckLoad();
Symbol 12 MovieClip Frame 31
CheckLoad();
Symbol 12 MovieClip Frame 32
CheckLoad();
Symbol 12 MovieClip Frame 33
CheckLoad();
Symbol 12 MovieClip Frame 34
CheckLoad();
Symbol 12 MovieClip Frame 35
CheckLoad();
Symbol 12 MovieClip Frame 36
CheckLoad();
Symbol 12 MovieClip Frame 37
CheckLoad();
Symbol 12 MovieClip Frame 38
CheckLoad();
Symbol 12 MovieClip Frame 39
CheckLoad();
Symbol 12 MovieClip Frame 40
CheckLoad();
Symbol 12 MovieClip Frame 41
CheckLoad();
Symbol 12 MovieClip Frame 42
CheckLoad();
Symbol 12 MovieClip Frame 43
CheckLoad();
Symbol 12 MovieClip Frame 44
CheckLoad();
Symbol 12 MovieClip Frame 45
CheckLoad();
Symbol 12 MovieClip Frame 46
CheckLoad();
Symbol 12 MovieClip Frame 47
CheckLoad();
Symbol 12 MovieClip Frame 48
CheckLoad();
Symbol 12 MovieClip Frame 49
CheckLoad();
Symbol 12 MovieClip Frame 50
CheckLoad();
Symbol 12 MovieClip Frame 51
CheckLoad();
Symbol 12 MovieClip Frame 52
CheckLoad();
Symbol 12 MovieClip Frame 53
CheckLoad();
Symbol 12 MovieClip Frame 54
CheckLoad();
Symbol 12 MovieClip Frame 55
CheckLoad();
Symbol 12 MovieClip Frame 56
CheckLoad();
Symbol 12 MovieClip Frame 57
CheckLoad();
Symbol 12 MovieClip Frame 58
CheckLoad();
Symbol 12 MovieClip Frame 59
CheckLoad();
Symbol 12 MovieClip Frame 60
CheckLoad();
Symbol 12 MovieClip Frame 61
CheckLoad();
Symbol 12 MovieClip Frame 62
fNickLoad = true;
CheckLoad();
gotoAndPlay (2);
Symbol 32 Button
on (release) {
gotoAndPlay (15);
}
Symbol 65 Button
on (release) {
if (gfPlaying == true) {
gotoAndPlay (42);
} else {
gotoAndPlay (19);
}
}
Symbol 75 MovieClip Frame 1
function Update(x, y) {
myLoc.x = myLoc.x + x;
myLoc.y = myLoc.y + y;
var fWrap = false;
var vRect = _parent.myRect;
if (myLoc.x < vRect.xMin) {
myLoc.x = vRect.xMax - 3;
fWrap = true;
} else if (vRect.xMax < myLoc.x) {
myLoc.x = vRect.xMin + 3;
fWrap = true;
}
if (myLoc.y < vRect.yMin) {
myLoc.y = vRect.yMax - 3;
fWrap = true;
} else if (vRect.yMax < myLoc.y) {
myLoc.y = vRect.yMin + 3;
fWrap = true;
}
this._x = myLoc.x;
this._y = myLoc.y;
if (_parent.Screen.hitTest(this)) {
CheckCollision();
}
if ((fWrap == true) && (fWaitToShow == true)) {
fWaitToShow = false;
gotoAndPlay (3);
}
}
function CheckCollision() {
if (_parent.Boat.Nose.hitTest(this.Body)) {
_root.Game.Hit(_name);
myLoc.y = random(2) * _parent.myDiameter;
myLoc.x = random(2) * _parent.myDiameter;
}
}
function getDist() {
var d = Math.sqrt((myLoc.x * myLoc.x) + (myLoc.y * myLoc.y));
return(d);
}
function enable() {
fWaitToShow = true;
}
var myLoc = new Object();
var point = new Object();
myLoc.x = this._x;
myLoc.y = this._y;
fWaitToShow = false;
gotoAndStop (8);
Symbol 75 MovieClip Frame 7
gotoAndPlay (3);
Symbol 75 MovieClip Frame 8
Symbol 109 Button
on (release) {
Choose("Squidward");
}
Symbol 121 Button
on (release) {
Choose("Sandy");
}
Symbol 129 Button
on (release) {
Choose("Patrick");
}
Symbol 145 Button
on (release) {
Choose("SpongeBob");
}
Symbol 157 Button
on (release) {
Choose("Krabs");
}
Symbol 172 MovieClip Frame 1
var gState = "AddJelly";
var gLoop = 5;
var loop = 0;
var gJelly = 0;
var gWhale = 1;
Symbol 172 MovieClip Frame 22
if (loop >= gLoop) {
gotoAndPlay(gState);
} else {
loop = loop + 1;
gotoAndPlay (10);
}
Symbol 172 MovieClip Frame 26
_parent.AddJelly(gJelly);
gJelly = gJelly + 1;
loop = 0;
if (gJelly >= _parent.JELLYFISH) {
gState = "AddWhale";
gLoop = 90;
} else if (gJelly == (_parent.JELLYFISH / 4)) {
gState = "AddWhale";
gLoop = 15;
} else if (gJelly < (_parent.JELLYFISH / 4)) {
gLoop = 5;
}
gotoAndPlay (10);
Symbol 172 MovieClip Frame 36
_parent.AddWhale(gWhale);
if (gWhale >= 2) {
gState = "Park";
gLoop = 0;
loop = 0;
} else {
gWhale = gWhale + 1;
gLoop = 10;
gState = "AddJelly";
loop = 0;
}
gotoAndPlay (10);
Symbol 172 MovieClip Frame 47
Symbol 182 Button
on (release) {
clickLever();
}
Symbol 188 Button
on (release) {
clickLever();
}
Symbol 189 MovieClip Frame 1
function clickLever() {
myState = myState * -1;
if (myState < 0) {
gotoAndStop (5);
} else {
gotoAndStop (2);
}
}
function Shift(vDir) {
if (vDir != myState) {
clickLever();
}
}
var myState = 1;
Symbol 189 MovieClip Frame 2
_root.Shift(1);
Symbol 189 MovieClip Frame 4
stop();
Symbol 189 MovieClip Frame 5
_root.Shift(-1);
Symbol 189 MovieClip Frame 7
stop();
Symbol 191 MovieClip Frame 1
function Update(x, y, fNoCheck) {
if (fUpdate == true) {
if (myIndex == "W") {
myLoc.x = myLoc.x + myInc.x;
myLoc.y = myLoc.y + myInc.y;
}
myLoc.x = myLoc.x + x;
myLoc.y = myLoc.y + y;
var fWrap = false;
var vRect = _parent.myRect;
if (myLoc.x < vRect.xMin) {
myLoc.x = vRect.xMax - 3;
myLoc.y = 0;
fWrap = true;
} else if (vRect.xMax < myLoc.x) {
myLoc.x = vRect.xMin + 3;
myLoc.y = 0;
fWrap = true;
}
if (myLoc.y < vRect.yMin) {
myLoc.y = vRect.yMax - 3;
myLoc.x = 0;
fWrap = true;
} else if (vRect.yMax < myLoc.y) {
myLoc.y = vRect.yMin + 3;
myLoc.x = 0;
fWrap = true;
}
if ((myInc.x == 0) && (myInc.y == 0)) {
ChangeDir(0);
}
this._x = myLoc.x;
this._y = myLoc.y;
if ((fNoCheck != true) && (_parent.Screen.hitTest(this))) {
CheckCollision();
}
}
}
function CheckCollision() {
if (_parent.Boat.Nose.hitTest(this.Nose)) {
HitMe();
}
}
function StartFromEdge() {
if (myQuad >= 4) {
myLoc.x = 50;
if ((myQuad == 1) || (myQuad == 4)) {
myLoc.x = 25;
}
} else {
myLoc.x = -50;
if ((myQuad == 8) || (myQuad == 5)) {
myLoc.x = -25;
}
}
if ((myQuad == 1) || (myQuad == 8)) {
myLoc.y = -50;
} else if ((myQuad == 5) || (myQuad == 4)) {
myLoc.y = 50;
} else if ((myQuad == 2) || (myQuad == 7)) {
myLoc.y = -25;
} else {
myLoc.y = 25;
}
var r = (random(3) - 1);
myLoc.x = myLoc.x + (10 * r);
r = random(3) - 1;
myLoc.y = myLoc.y + (10 * r);
}
function HitMe() {
trace("HIT SUB " + _name);
var num = this._name.charAt(3);
if (num == "W") {
_root.Game.Hit("Whale");
} else {
_root.Game.Screen.HitScope(num);
fUpdate = false;
gotoAndPlay (11);
StartFromEdge();
}
}
function getDist() {
if (fUpdate == false) {
var d = 10000;
} else {
var d = Math.sqrt((myLoc.x * myLoc.x) + (myLoc.y * myLoc.y));
}
return(d);
}
function getFacing() {
vOpposite = (15 - _parent.myQuad) % 8;
if (vOpposite == myQuad) {
vFace = "F";
} else if (vOpposite == ((myQuad + 1) % 8)) {
vFace = "F";
} else if (vOpposite == ((myQuad + 2) % 8)) {
vFace = "R";
} else if (vOpposite == ((myQuad + 6) % 8)) {
vFace = "L";
} else if (vOpposite == ((myQuad + 7) % 8)) {
vFace = "F";
} else if (vOpposite == ((myQuad + 3) % 8)) {
vFace = "BR";
} else if (vOpposite == ((myQuad + 5) % 8)) {
vFace = "BL";
} else if (vOpposite == ((myQuad + 4) % 8)) {
vFace = "B";
}
return(vFace);
}
function Bounce(vMyDir, vOtherDir, vOtherQuad) {
if (fUpdate == true) {
if (vOtherDir == -1) {
vOtherQuad = vOtherQuad + 4;
}
if (vOtherQuad == myQuad) {
var vQuad = ((myIndex + myQuad) % 8);
vSlope = _parent.SlopeOf(((10 - vQuad) % 8) + 1);
} else {
vSlope = _parent.SlopeOf(((10 - vOtherQuad) % 8) + 1);
}
myInc.x = myInc.x * (vMyDir / 2);
myInc.y = myInc.y * (vMyDir / 2);
myInc.x = myInc.x + (vSlope.x / 2);
myInc.y = myInc.y + (vSlope.y / 2);
Update((-myInc.x) * 2, (-myInc.y) * 2, true);
fUpdate = false;
gotoAndPlay (6);
}
}
function ChangeDir(vChange) {
var vAngle = myAngle;
if (vChange == 0) {
myQuad = ((((myQuad + 7) + random(3)) - 1) % 8) + 1;
} else if (vChange == -1) {
myQuad = ((myQuad + 3) % 8) + 1;
}
vAngle = (myQuad * 45) - 22.5;
var vSlope = _parent.SlopeOf(((10 - myQuad) % 8) + 1);
myInc.x = -vSlope.x;
myInc.y = -vSlope.y;
this._rotation = vAngle;
}
function enable() {
fUpdate = true;
gotoAndPlay (3);
StartFromEdge();
}
var fUpdate = true;
var myInc = new Object();
var myLoc = new Object();
var point = new Object();
var myQuad = random(8);
var myAngle = (22.5 * myQuad);
var myIndex = _name.charAt(3);
var myChangeTimer = 40;
if (myIndex == "W") {
myChangeTimer = 5;
fUpdate = false;
}
myLoc.x = this._x;
myLoc.y = this._y;
ChangeDir(0);
Symbol 191 MovieClip Frame 5
loop = loop + 1;
myLoc.x = myLoc.x + myInc.x;
myLoc.y = myLoc.y + myInc.y;
if (myChangeTimer < loop) {
ChangeDir(random(4));
loop = 0;
}
gotoAndPlay (3);
Symbol 191 MovieClip Frame 8
fUpdate = true;
myLoc.x = myLoc.x - myInc.x;
myLoc.y = myLoc.y - myInc.y;
Symbol 191 MovieClip Frame 10
myLoc.x = myLoc.x - (myInc.x / 2);
myLoc.y = myLoc.y - (myInc.y / 2);
ChangeDir(0);
gotoAndPlay (3);
Symbol 191 MovieClip Frame 25
fUpdate = true;
gotoAndPlay (3);
Symbol 191 MovieClip Frame 26
stop();
Symbol 202 MovieClip Frame 1
function Update(x, y, fNoCheck) {
if (fUpdate == true) {
myLoc.x = myLoc.x + myInc.x;
myLoc.y = myLoc.y + myInc.y;
myLoc.x = myLoc.x + x;
myLoc.y = myLoc.y + y;
var fWrap = false;
var vRect = _parent.myRect;
if (myLoc.x < vRect.xMin) {
myLoc.x = vRect.xMax - 3;
myLoc.y = 0;
fWrap = true;
} else if (vRect.xMax < myLoc.x) {
myLoc.x = vRect.xMin + 3;
myLoc.y = 0;
fWrap = true;
}
if (myLoc.y < vRect.yMin) {
myLoc.y = vRect.yMax - 3;
myLoc.x = 0;
fWrap = true;
} else if (vRect.yMax < myLoc.y) {
myLoc.y = vRect.yMin + 3;
myLoc.x = 0;
fWrap = true;
}
if ((myInc.x == 0) && (myInc.y == 0)) {
ChangeDir(0);
}
this._x = myLoc.x;
this._y = myLoc.y;
if ((fNoCheck != true) && (_parent.Screen.hitTest(this))) {
CheckCollision();
}
}
}
function CheckCollision() {
if (_parent.Boat.Nose.hitTest(this.Nose)) {
HitMe();
}
}
function StartFromEdge() {
if (myQuad >= 4) {
myLoc.x = 50;
if ((myQuad == 1) || (myQuad == 4)) {
myLoc.x = 25;
}
} else {
myLoc.x = -50;
if ((myQuad == 8) || (myQuad == 5)) {
myLoc.x = -25;
}
}
if ((myQuad == 1) || (myQuad == 8)) {
myLoc.y = -50;
} else if ((myQuad == 5) || (myQuad == 4)) {
myLoc.y = 50;
} else if ((myQuad == 2) || (myQuad == 7)) {
myLoc.y = -25;
} else {
myLoc.y = 25;
}
var r = (random(3) - 1);
myLoc.x = myLoc.x + (10 * r);
r = random(3) - 1;
myLoc.y = myLoc.y + (10 * r);
}
function HitMe() {
_root.Game.Hit("Whale");
}
function getDist() {
if (fUpdate == false) {
var d = 10000;
} else {
var d = Math.sqrt((myLoc.x * myLoc.x) + (myLoc.y * myLoc.y));
}
return(d);
}
function getFacing() {
vOpposite = (15 - _parent.myQuad) % 8;
if (vOpposite == myQuad) {
vFace = "F";
} else if (vOpposite == ((myQuad + 1) % 8)) {
vFace = "F";
} else if (vOpposite == ((myQuad + 2) % 8)) {
vFace = "R";
} else if (vOpposite == ((myQuad + 6) % 8)) {
vFace = "L";
} else if (vOpposite == ((myQuad + 7) % 8)) {
vFace = "F";
} else if (vOpposite == ((myQuad + 3) % 8)) {
vFace = "BR";
} else if (vOpposite == ((myQuad + 5) % 8)) {
vFace = "BL";
} else if (vOpposite == ((myQuad + 4) % 8)) {
vFace = "B";
}
return(vFace);
}
function Bounce(vMyDir, vOtherDir, vOtherQuad) {
if (fUpdate == true) {
if (vOtherDir == -1) {
vOtherQuad = vOtherQuad + 4;
}
if (vOtherQuad == myQuad) {
var vQuad = ((myIndex + myQuad) % 8);
vSlope = _parent.SlopeOf(((10 - vQuad) % 8) + 1);
} else {
vSlope = _parent.SlopeOf(((10 - vOtherQuad) % 8) + 1);
}
myInc.x = myInc.x * (vMyDir / 2);
myInc.y = myInc.y * (vMyDir / 2);
myInc.x = myInc.x + (vSlope.x / 2);
myInc.y = myInc.y + (vSlope.y / 2);
Update((-myInc.x) * 2, (-myInc.y) * 2, true);
fUpdate = false;
gotoAndPlay (1);
}
}
function ChangeDir(vChange) {
var vAngle = myAngle;
if (vChange == 0) {
myQuad = ((((myQuad + 7) + random(3)) - 1) % 8) + 1;
} else if (vChange == -1) {
myQuad = ((myQuad + 3) % 8) + 1;
}
vAngle = (myQuad * 45) - 22.5;
var vSlope = _parent.SlopeOf(((10 - myQuad) % 8) + 1);
myInc.x = -vSlope.x;
myInc.y = -vSlope.y;
this._rotation = vAngle;
}
function enable() {
fUpdate = true;
gotoAndPlay (2);
StartFromEdge();
}
var myInc = new Object();
var myLoc = new Object();
var point = new Object();
var myQuad = random(8);
var myAngle = (22.5 * myQuad);
var myIndex = _name.charAt(3);
var myChangeTimer = 5;
var fUpdate = false;
myLoc.x = this._x;
myLoc.y = this._y;
ChangeDir(0);
Symbol 202 MovieClip Frame 4
loop = loop + 1;
myLoc.x = myLoc.x + myInc.x;
myLoc.y = myLoc.y + myInc.y;
if (myChangeTimer < loop) {
ChangeDir(random(4));
loop = 0;
}
Symbol 202 MovieClip Frame 7
loop = loop + 1;
myLoc.x = myLoc.x + myInc.x;
myLoc.y = myLoc.y + myInc.y;
if (myChangeTimer < loop) {
ChangeDir(random(4));
loop = 0;
}
Symbol 202 MovieClip Frame 10
loop = loop + 1;
myLoc.x = myLoc.x + myInc.x;
myLoc.y = myLoc.y + myInc.y;
if (myChangeTimer < loop) {
ChangeDir(random(4));
loop = 0;
}
gotoAndPlay (2);
Symbol 203 MovieClip Frame 1
function Update(x, y) {
myLoc.x = myLoc.x + x;
myLoc.y = myLoc.y + y;
var fWrap = false;
var vRect = _parent.myRect;
if (myLoc.x < vRect.xMin) {
myLoc.x = vRect.xMax - 3;
fWrap = true;
} else if (vRect.xMax < myLoc.x) {
myLoc.x = vRect.xMin + 3;
fWrap = true;
}
if (myLoc.y < vRect.yMin) {
myLoc.y = vRect.yMax - 3;
fWrap = true;
} else if (vRect.yMax < myLoc.y) {
myLoc.y = vRect.yMin + 3;
fWrap = true;
}
this._x = myLoc.x;
this._y = myLoc.y;
if (_parent.Screen.hitTest(this)) {
CheckCollision();
}
if ((fWrap == true) && (fWaitToShow == true)) {
fWaitToShow = false;
gotoAndPlay (3);
}
}
function CheckCollision() {
if (_parent.Boat.Nose.hitTest(this.Body)) {
_root.Game.Hit(_name);
myLoc.y = random(2) * _parent.myDiameter;
myLoc.x = random(2) * _parent.myDiameter;
}
}
function getDist() {
var d = Math.sqrt((myLoc.x * myLoc.x) + (myLoc.y * myLoc.y));
return(d);
}
function enable() {
fWaitToShow = true;
}
var myLoc = new Object();
var point = new Object();
myLoc.x = this._x;
myLoc.y = this._y;
fWaitToShow = false;
gotoAndStop (8);
Symbol 203 MovieClip Frame 7
gotoAndPlay (3);
Symbol 203 MovieClip Frame 8
Symbol 204 MovieClip Frame 1
function Update(x, y) {
myLoc.x = myLoc.x + x;
myLoc.y = myLoc.y + y;
var fWrap = false;
var vRect = _parent.myRect;
if (myLoc.x < vRect.xMin) {
myLoc.x = vRect.xMax - 3;
fWrap = true;
} else if (vRect.xMax < myLoc.x) {
myLoc.x = vRect.xMin + 3;
fWrap = true;
}
if (myLoc.y < vRect.yMin) {
myLoc.y = vRect.yMax - 3;
fWrap = true;
} else if (vRect.yMax < myLoc.y) {
myLoc.y = vRect.yMin + 3;
fWrap = true;
}
this._x = myLoc.x;
this._y = myLoc.y;
if (_parent.Screen.hitTest(this)) {
CheckCollision();
}
if ((fWrap == true) && (fWaitToShow == true)) {
fWaitToShow = false;
gotoAndPlay (3);
}
}
function CheckCollision() {
if (_parent.Boat.Nose.hitTest(this.Body)) {
_root.Game.Hit(_name);
myLoc.y = random(2) * _parent.myDiameter;
myLoc.x = random(2) * _parent.myDiameter;
}
}
function getDist() {
var d = Math.sqrt((myLoc.x * myLoc.x) + (myLoc.y * myLoc.y));
return(d);
}
function enable() {
fWaitToShow = true;
}
var myLoc = new Object();
var point = new Object();
myLoc.x = this._x;
myLoc.y = this._y;
fWaitToShow = false;
gotoAndStop (8);
Symbol 204 MovieClip Frame 7
gotoAndPlay (3);
Symbol 204 MovieClip Frame 8
Symbol 209 MovieClip Frame 1
function ChangeQuads(vDir) {
var vFrame = ((myQuad - (0.25 * vDir)) * 100);
myQuad = myQuad - vDir;
if (8 < myQuad) {
myQuad = 1;
} else if (myQuad < 1) {
myQuad = 8;
}
getSlope();
gotoAndPlay("Quad" + vFrame);
}
function Move(vDir) {
Update(mySlope.x * vDir, mySlope.y * vDir);
}
function Update(x, y) {
var i = 0;
while (i < _parent.SUBS) {
eval ("sub" + i).Update(x, y);
if (_root.gState == 0) {
break;
}
i++;
}
if (_root.gState != 0) {
CheckSubCollisions();
var j = 0;
while (j < _parent.JELLYFISH) {
eval ("jelly" + j).Update(x, y);
j++;
}
subWhale1.Update(x, y);
subWhale2.Update(x, y);
}
}
function CheckSubCollisions() {
var i = 0;
while (i < _parent.SUBS) {
var vCheckSub = eval ("sub" + i);
var j = (i + 1);
while (j < _parent.SUBS) {
var vOtherSub = eval ("sub" + j);
if (vCheckSub.hitTest(vOtherSub)) {
var vMyDir;
var vOtherDir;
if (vCheckSub.hitTest(vOtherSub.Nose)) {
vOtherDir = 1;
} else {
vOtherDir = -1;
}
if (vOtherSub.hitTest(vCheckSub.Nose)) {
vMyDir = 1;
} else {
vMyDir = -1;
}
vCheckSub.Bounce(vMyDir, vOtherDir, vOtherSub.myQuad);
vOtherSub.Bounce(vOtherDir, vMyDir, vCheckSub.myQuad);
}
j++;
}
i++;
}
}
function GetLoc(i) {
var info = new Object();
var path = eval ("sub" + i);
var x = path.myLoc.x;
var y = path.myLoc.y;
info.x = x;
info.y = y;
info.dist = path.getDist();
info.max = myDiameter / 2;
var point = new Object();
point.x = x;
point.y = y;
localToGlobal(point);
info.inQuad = Viewer.hitTest(point.x, point.y, true);
if (info.inQuad == true) {
info.quad = myQuad;
var vAngle;
if (0 < x) {
var vQuad = 1;
vAngle = Math.acos(x / info.dist);
if (0 < y) {
vQuad = 4;
vAngle = (Math.PI*2) - vAngle;
}
} else if (0 < info.y) {
vAngle = Math.atan((-y) / x) + Math.PI;
} else if (y < 0) {
vAngle = Math.PI - Math.asin((-y) / info.dist);
}
info.angle = vAngle;
info.face = path.getFacing();
}
return(info);
}
function getSlope() {
mySlope = SlopeOf(myQuad);
}
function SlopeOf(vQuad) {
var vSlope = new Object();
if ((vQuad == 1) || (vQuad == 4)) {
yDist = SIN2;
xDist = COS2;
} else if ((vQuad == 8) || (vQuad == 5)) {
yDist = -SIN2;
xDist = COS2;
} else if ((vQuad == 2) || (vQuad == 3)) {
yDist = SIN1;
xDist = COS1;
} else if ((vQuad == 6) || (vQuad == 7)) {
xDist = COS1;
yDist = -SIN1;
}
if ((vQuad < 3) || (6 < vQuad)) {
xDist = xDist * -1;
}
vSlope.x = xDist;
vSlope.y = yDist;
return(vSlope);
}
var myQuad = 2;
var mySlope = new Object();
var myDiameter = Screen._width;
var myRect = this.getBounds(this);
var SIN2 = 0.38268343236509;
var SIN1 = 0.923879532511287;
var COS2 = 0.923879532511287;
var COS1 = 0.38268343236509;
getSlope();
Symbol 209 MovieClip Frame 4
stop();
Symbol 209 MovieClip Frame 10
stop();
Symbol 209 MovieClip Frame 15
stop();
Symbol 209 MovieClip Frame 20
stop();
Symbol 209 MovieClip Frame 25
stop();
Symbol 209 MovieClip Frame 30
stop();
Symbol 209 MovieClip Frame 35
stop();
Symbol 209 MovieClip Frame 41
stop();
Symbol 209 MovieClip Frame 45
gotoAndPlay("Quad" + myQuad);
Symbol 209 MovieClip Frame 49
gotoAndPlay("Quad" + myQuad);
Symbol 209 MovieClip Frame 53
gotoAndPlay("Quad" + myQuad);
Symbol 209 MovieClip Frame 57
gotoAndPlay("Quad" + myQuad);
Symbol 209 MovieClip Frame 61
gotoAndPlay("Quad" + myQuad);
Symbol 209 MovieClip Frame 66
gotoAndPlay("Quad" + myQuad);
Symbol 209 MovieClip Frame 70
gotoAndPlay("Quad" + myQuad);
Symbol 209 MovieClip Frame 74
gotoAndPlay("Quad" + myQuad);
Symbol 209 MovieClip Frame 78
gotoAndPlay("Quad" + myQuad);
Symbol 238 MovieClip Frame 1
function Update() {
sub = _root.Game.Radar.GetLoc(myIndex);
if ((sub.inQuad == true) && (fHit == false)) {
myZ = sub.dist;
var vSize = GetSize(sub.dist, sub.max);
var yDist = (((_parent.myRect.yMax - _parent.myHeight) + 5) + (vSize * _parent.myHeight));
var vArcLen = (sub.angle * sub.dist);
var vViewArc = ((Math.PI/4) * sub.dist);
var vArcL = (vViewArc * sub.quad);
var vArcR = (vViewArc * (sub.quad - 1));
var vRelativeLen = 0;
if ((vArcR < vArcLen) && (vArcLen < (vViewArc * (sub.quad + 2)))) {
vRelativeLen = (vArcL - vArcLen) / vViewArc;
} else if ((vArcLen < vArcR) && ((vViewArc * (sub.quad - 2)) < vArcLen)) {
vRelativeLen = ((vArcR - vArcLen) / vViewArc) + 1;
} else if ((sub.quad == 1) and ((vViewArc * 7) < vArcLen)) {
var vAngle = ((Math.PI*2) - sub.angle);
vArcLen = vAngle * sub.dist;
vRelativeLen = (vArcLen / vViewArc) + 1;
} else {
trace("Not in view???");
}
var xDist = ((vRelativeLen * _parent.myWidth) + _parent.myRect.xMin);
myFrame = "Scope" + sub.face;
this._alpha = 100;
this._xscale = vSize * 100;
this._yscale = vSize * 100;
this._y = yDist;
this._x = xDist;
} else if (fHit == false) {
this._xscale = 0;
this._yscale = 0;
this._x = 0;
this._y = 0;
this._alpha = 0;
myZ = 0;
}
}
function HitScope() {
fHit = true;
myFrame = "loop";
gotoAndPlay (21);
_root.Game.Shake(getPoints());
}
function GetSize(vDist, vMax) {
var vSize = (1 - (vDist / vMax));
return(Math.max(vSize, 0));
}
function GetPoints() {
return(myPoints);
}
function ShowMyPoints() {
var vPoints = GetPoints();
Points.ShowPoints(vPoints);
}
var myFrame = "ScopeF";
var myPoints = 20;
var myZ = 0;
var myIndex = this._name.charAt(5);
var fHit = false;
Update();
Symbol 238 MovieClip Frame 2
Update();
gotoAndPlay(myFrame);
Symbol 238 MovieClip Frame 3
Update();
Symbol 238 MovieClip Frame 4
Update();
gotoAndPlay(myFrame);
Symbol 238 MovieClip Frame 5
Update();
Symbol 238 MovieClip Frame 6
Update();
gotoAndPlay(myFrame);
Symbol 238 MovieClip Frame 7
Update();
Symbol 238 MovieClip Frame 8
Update();
gotoAndPlay(myFrame);
Symbol 238 MovieClip Frame 10
Update();
gotoAndPlay(myFrame);
Symbol 238 MovieClip Frame 11
Update();
Symbol 238 MovieClip Frame 12
Update();
gotoAndPlay(myFrame);
Symbol 238 MovieClip Frame 13
Update();
Symbol 238 MovieClip Frame 14
Update();
gotoAndPlay(myFrame);
Symbol 238 MovieClip Frame 15
Update();
Symbol 238 MovieClip Frame 16
Update();
gotoAndPlay(myFrame);
Symbol 238 MovieClip Frame 17
Update();
Symbol 238 MovieClip Frame 18
Update();
gotoAndPlay(myFrame);
Symbol 238 MovieClip Frame 19
Update();
Symbol 238 MovieClip Frame 20
Update();
gotoAndPlay(myFrame);
Symbol 238 MovieClip Frame 32
fHit = false;
Symbol 238 MovieClip Frame 34
Update();
gotoAndPlay(myFrame);
Symbol 258 MovieClip Frame 1
function Update() {
sub = _root.Game.Radar.GetLoc(this._name);
var vSize = GetSize(sub.dist, sub.max);
if ((sub.inQuad == true) && (fHit == false)) {
myZ = sub.dist;
var yDist = (((_parent.myRect.yMax - _parent.myHeight) + 5) + (vSize * _parent.myHeight));
var vArcLen = (sub.angle * sub.dist);
var vViewArc = ((Math.PI/4) * sub.dist);
var vArcL = (vViewArc * sub.quad);
var vArcR = (vViewArc * (sub.quad - 1));
var vRelativeLen = 0;
if ((vArcR < vArcLen) && (vArcLen < (vViewArc * (sub.quad + 2)))) {
vRelativeLen = (vArcL - vArcLen) / vViewArc;
} else if ((vArcLen < vArcR) && ((vViewArc * (sub.quad - 2)) < vArcLen)) {
vRelativeLen = ((vArcR - vArcLen) / vViewArc) + 1;
} else if ((sub.quad == 1) and ((vViewArc * 7) < vArcLen)) {
var vAngle = ((Math.PI*2) - sub.angle);
vArcLen = vAngle * sub.dist;
vRelativeLen = (vArcLen / vViewArc) + 1;
} else {
trace(_name + " Not in view???");
}
var xDist = ((vRelativeLen * _parent.myWidth) + _parent.myRect.xMin);
myFrame = sub.face;
this._alpha = 100;
this._xscale = vSize * 100;
this._yscale = vSize * 100;
this._y = yDist;
this._x = xDist;
} else if (fHit == false) {
this._xscale = 0;
this._yscale = 0;
this._x = 0;
this._y = 0;
this._alpha = 0;
myZ = 0;
}
if (vSize >= 0.3) {
_root.Game.WhaleAlert(true);
fAlerting = true;
} else if (fAlerting == true) {
_root.Game.WhaleAlert(false);
fAlerting = false;
}
}
function HitWhale() {
fHit = true;
myFrame = "loop";
gotoAndPlay (1);
}
function GetSize(vDist, vMax) {
var vSize = (1 - (vDist / vMax));
return(Math.max(vSize, 0));
}
var myFrame;
var myPoints;
var myZ = 0;
var fHit = false;
var fAlerting = false;
Update();
Symbol 258 MovieClip Frame 2
Update();
gotoAndPlay(myFrame);
Symbol 258 MovieClip Frame 3
Update();
Symbol 258 MovieClip Frame 4
Update();
gotoAndPlay(myFrame);
Symbol 258 MovieClip Frame 5
Update();
Symbol 258 MovieClip Frame 6
Update();
gotoAndPlay(myFrame);
Symbol 258 MovieClip Frame 7
Update();
Symbol 258 MovieClip Frame 8
Update();
gotoAndPlay(myFrame);
Symbol 258 MovieClip Frame 9
Update();
Symbol 258 MovieClip Frame 10
Update();
gotoAndPlay(myFrame);
Symbol 258 MovieClip Frame 11
Update();
Symbol 258 MovieClip Frame 12
Update();
gotoAndPlay(myFrame);
Symbol 258 MovieClip Frame 13
Update();
Symbol 258 MovieClip Frame 14
Update();
gotoAndPlay(myFrame);
Symbol 258 MovieClip Frame 16
Update();
Symbol 258 MovieClip Frame 17
Update();
gotoAndPlay(myFrame);
Symbol 259 MovieClip Frame 1
function Turn(vDir) {
var vSide = "R";
if (vDir == -1) {
vSide = "L";
}
gotoAndPlay("Turn" + vSide);
}
function HitScope(vIndex) {
if (vIndex == "W") {
_parent.Hit("Whale");
} else {
eval ("Scope" + vIndex).HitScope();
}
}
function SetClouds() {
var r = random(200);
var x = (random(100) - 50);
Cloud1._x = Cloud1._x + x;
Cloud1.gotoAndPlay(r);
r = random(200);
x = random(100) - 50;
Cloud2._x = Cloud2._x + x;
Cloud2.gotoAndPlay(r);
}
function CheckZOrder(vSub, z) {
var z = 0;
var n;
var m;
var checkZ;
var checkSub;
var thisSub = sub0;
var i = TOTALSUBS;
while (i >= 0) {
n = myZOrder[i];
thisSub = GetSub(n);
z = thisSub.myZ;
var j = 0;
while (j < i) {
m = myZOrder[j];
checkSub = GetSub(m);
checkZ = checkSub.myZ;
if (checkZ < z) {
thisSub.swapDepths(checkSub);
myZOrder[j] = n;
myZOrder[i] = m;
i++;
break;
}
j++;
}
i--;
}
}
function InitZStack() {
var i = 0;
while (_parent.SUBS >= i) {
myZOrder[i] = i;
vSub = GetSub(i);
vSub._level = i + 10;
i++;
}
}
function GetSub(i) {
var vSub;
if (i == _parent.SUBS) {
vSub = Whale;
} else {
vSub = eval ("Scope" + i);
}
return(vSub);
}
var myRect = getBounds(this);
var myWidth = (myRect.yMax - myRect.yMin);
var myHeight = ((myRect.xMax - myRect.xMin) / 4);
var myZOrder = new Array();
InitZStack();
Symbol 259 MovieClip Frame 2
SetClouds();
Symbol 259 MovieClip Frame 4
CheckZOrder();
gotoAndPlay (3);
Symbol 259 MovieClip Frame 7
gotoAndPlay (2);
Symbol 259 MovieClip Frame 11
gotoAndPlay (2);
Symbol 266 MovieClip Frame 2
stop();
Symbol 266 MovieClip Frame 6
gotoAndPlay (1);
Symbol 266 MovieClip Frame 9
gotoAndPlay (1);
Symbol 275 MovieClip Frame 1
function DoIdle() {
_parent.Idle();
myIdle = random(3) + 1;
ResetIdle();
}
function ResetIdle() {
gotoAndPlay("Idle" + myIdle);
}
var myIdle = 1;
Symbol 275 MovieClip Frame 50
DoIdle();
Symbol 275 MovieClip Frame 80
DoIdle();
Symbol 275 MovieClip Frame 154
DoIdle();
Symbol 281 MovieClip Frame 1
function Idle() {
gotoAndPlay (5);
}
Symbol 281 MovieClip Frame 4
stop();
Symbol 285 MovieClip Frame 2
stop();
Symbol 285 MovieClip Frame 6
gotoAndPlay (1);
Symbol 285 MovieClip Frame 9
gotoAndPlay (1);
Symbol 289 MovieClip Frame 1
function Idle() {
gotoAndPlay (5);
}
Symbol 289 MovieClip Frame 4
stop();
Symbol 293 MovieClip Frame 2
stop();
Symbol 293 MovieClip Frame 6
gotoAndPlay (1);
Symbol 293 MovieClip Frame 9
gotoAndPlay (1);
Symbol 298 MovieClip Frame 1
function Idle() {
gotoAndPlay (5);
}
Symbol 298 MovieClip Frame 4
stop();
Symbol 302 MovieClip Frame 2
stop();
Symbol 302 MovieClip Frame 6
gotoAndPlay (1);
Symbol 302 MovieClip Frame 9
gotoAndPlay (1);
Symbol 307 MovieClip Frame 1
function Idle() {
gotoAndPlay (5);
}
Symbol 307 MovieClip Frame 4
stop();
Symbol 310 MovieClip Frame 2
stop();
Symbol 310 MovieClip Frame 6
gotoAndPlay (1);
Symbol 310 MovieClip Frame 9
gotoAndPlay (1);
Symbol 316 MovieClip Frame 1
function Idle() {
gotoAndPlay (5);
}
Symbol 316 MovieClip Frame 4
stop();
Symbol 317 MovieClip Frame 1
function MoveArms(vDir) {
if (vDir == -1) {
ArmL.gotoAndPlay("Down");
ArmR.gotoAndPlay("Up");
} else if (vDir == 1) {
ArmR.gotoAndPlay("Down");
ArmL.gotoAndPlay("Up");
} else {
ArmR.gotoAndStop("Center");
ArmL.gotoAndStop("Center");
}
}
gotoAndPlay(_root.gCharacter);
Symbol 317 MovieClip Frame 5
stop();
Symbol 317 MovieClip Frame 9
stop();
Symbol 317 MovieClip Frame 13
stop();
Symbol 317 MovieClip Frame 18
stop();
Symbol 317 MovieClip Frame 23
stop();
Symbol 325 MovieClip Frame 1
function Update() {
if (lastScore != _root.gScore) {
CalcScore(_root.gScore);
}
}
function CalcScore(vScore) {
if (0 < vScore) {
char10000 = Math.floor(vScore / 10000);
char1000 = Math.floor((vScore - (char10000 * 10000)) / 1000);
char100 = Math.floor(((vScore - (char10000 * 10000)) - (char1000 * 1000)) / 100);
char10 = Math.floor((((vScore - (char10000 * 10000)) - (char1000 * 1000)) - (char100 * 100)) / 10);
char1 = Math.floor(vScore % 10);
} else {
_root.gScore = 0;
char10000 = 0;
char1000 = 0;
char100 = 0;
char10 = 0;
char1 = 0;
}
lastScore = vScore;
}
var lastScore;
var char1;
var char10;
var char100;
var char1000;
var vchar10000;
Symbol 325 MovieClip Frame 4
Update();
gotoAndPlay (1);
Symbol 337 MovieClip Frame 1
function Alert() {
if (myFrame != "Alert") {
myFrame = "Alert";
play();
}
}
function EndAlert() {
myFrame = "None";
gotoAndStop(myFrame);
}
var myFrame;
stop();
Symbol 337 MovieClip Frame 16
stop();
Symbol 337 MovieClip Frame 17
myFrame = "Alert";
Symbol 337 MovieClip Frame 80
trace("Horn End");
_root.EndGame("End");
stop();
Symbol 340 MovieClip Frame 1
stop();
Symbol 340 MovieClip Frame 3
stop();
Symbol 340 MovieClip Frame 9
stop();
Symbol 340 MovieClip Frame 21
_parent.EndGame("End");
stop();
Symbol 340 MovieClip Frame 22
gotoAndPlay (15);
Symbol 341 MovieClip Frame 1
function MoveArms(vDir) {
if (vDir == -1) {
ArmL.gotoAndPlay("Down");
ArmR.gotoAndPlay("Up");
} else if (vDir == 1) {
ArmR.gotoAndPlay("Down");
ArmL.gotoAndPlay("Up");
} else {
ArmR.gotoAndStop("Center");
ArmL.gotoAndStop("Center");
}
}
gotoAndPlay(_root.gCharacter);
Symbol 341 MovieClip Frame 5
stop();
Symbol 341 MovieClip Frame 9
stop();
Symbol 341 MovieClip Frame 13
stop();
Symbol 341 MovieClip Frame 18
stop();
Symbol 341 MovieClip Frame 23
stop();
Symbol 343 MovieClip Frame 1
function Alert() {
if (myFrame != "Alert") {
myFrame = "Alert";
play();
}
}
function EndAlert() {
myFrame = "None";
gotoAndStop(myFrame);
}
var myFrame;
stop();
Symbol 343 MovieClip Frame 16
stop();
Symbol 343 MovieClip Frame 17
myFrame = "Alert";
Symbol 343 MovieClip Frame 80
trace("Horn End");
_root.EndGame("End");
stop();
Symbol 348 MovieClip Frame 1
function Hit(vName) {
if (vName.charAt(0) == "j") {
Score(-50);
gHits = gHits + 1;
gotoAndPlay (20);
if (gHits >= 3) {
myEndFrame = "End";
}
} else if (vName.charAt(0) == "W") {
if (_root.gState != 0) {
gotoAndPlay (15);
myEndFrame = "Whale";
}
}
}
function Shake(vPoints) {
Score(vPoints);
gotoAndPlay (6);
}
function Score(vPoints) {
_root.gScore = Math.max(vPoints + _root.gScore, 0);
}
function EndGame() {
trace("EndGame");
_root.gState = 0;
_root.gPlaying = false;
Horn.gotoAndPlay("GameOver");
_root.Alert.gotoAndPlay("GameOver");
}
function ResetGame() {
trace("NEW GAME");
gHits = 0;
_root.gScore = 0;
myEndFrame = "Still";
}
function WhaleAlert(fOn) {
if (fOn == true) {
Horn.Alert();
} else {
Horn.EndAlert();
}
}
function AddJelly(vNum) {
if (vNum < JELLYFISH) {
path = eval ("Radar.jelly" + vNum);
path.enable();
trace((("Add Jellyfish " + vNum) + " ") + path);
}
}
function AddWhale(vNum) {
path = eval ("Radar.subWhale" + vNum);
path.enable();
trace((("Add Whale " + vNum) + " ") + path);
}
var SUBS = 8;
var JELLYFISH = 16;
var gHits;
var myEndFrame = "Still";
stop();
Symbol 348 MovieClip Frame 2
stop();
Symbol 348 MovieClip Frame 14
gotoAndStop (2);
Symbol 348 MovieClip Frame 19
_root.EndGame(myEndFrame);
gotoAndStop (2);
Symbol 348 MovieClip Frame 25
Water.play();
gotoAndStop (2);
Symbol 351 Button
on (release) {
ClickArrow(-1);
}
Symbol 352 Button
on (release) {
ClickArrow(1);
}
Symbol 354 MovieClip Frame 1
stop();
Symbol 354 MovieClip Frame 2
Symbol 354 MovieClip Frame 18
_root.EndGame("End");
stop();
Symbol 357 Button
on (release) {
gotoAndPlay (157);
}
Symbol 359 Button
on (release) {
gfPlaying = true;
gotoAndPlay (15);
}
Symbol 384 Button
on (release) {
_root.gotoAndPlay("ChooseCharacter");
}
Symbol 410 Button
on (release) {
gotoAndPlay (15);
}