Frame 1
function gameControl() {
switch (gameState) {
case 0 :
break;
case 1 :
gameState = 3;
rfoIdle = 10;
rfoLeft = 30;
rfoRight = 50;
roddy._x = 378;
roddy._y = 300;
roddyOrientation = 0;
roddyAngle = 0;
roddyVA = 0;
roddyVX = 0;
roddyVY = 0;
roddyState = 0;
break;
case 2 :
break;
case 3 :
if (((Key.isDown(37) && (Key.isDown(39))) || (Key.isDown(38))) && ((roddyState == 0) || (roddyState == 3))) {
if (roddyOrientation == 1) {
roddyForward(2);
roddyState = 1;
roddyOrientation = 0;
_root.roddy.gotoAndStop(4);
} else {
roddyForward(2);
roddyState = 2;
roddyOrientation = 1;
_root.roddy.gotoAndStop(5);
}
} else if (Key.isDown(37) && (roddyState == 0)) {
roddyState = 5;
_root.roddy.gotoAndStop(3);
} else if (Key.isDown(39) && (roddyState == 0)) {
roddyAngle = roddyAngle + 22.5;
if (roddyAngle > 360) {
roddyAngle = roddyAngle - 360;
}
roddyState = 5;
_root.roddy.gotoAndStop(2);
}
roddy._rotation = roddy._rotation + roddyVA;
roddy._x = roddy._x + roddyVX;
river._y = river._y - roddyVY;
if ((roddyVY > 0.2) || (roddyVY < -0.2)) {
roddyVY = roddyVY - ((roddyVY / Math.abs(roddyVY)) * 0.02);
}
if (!((roddyVA > 0.2) || (roddyVA < -0.2))) {
break;
}
roddyVA = roddyVA - ((roddyVA / Math.abs(roddyVA)) * 0.01);
break;
}
}
function roddyForward(v) {
roddyVX = roddyVX + (zSin[Math.round(roddyAngle)] * v);
if (Math.abs(roddyVX) > 4) {
roddyVX = 4 * (roddyVX / Math.abs(roddyVX));
}
roddyVY = roddyVY - (zCos[Math.round(roddyAngle)] * v);
if (Math.abs(roddyVY) > 4) {
roddyVY = 4 * (roddyVY / Math.abs(roddyVY));
}
}
function restoreFromLeftPaddle() {
_root.roddy.gotoAndStop(1);
roddyState = 0;
}
function restoreFromRightPaddle() {
_root.roddy.gotoAndStop(1);
roddyState = 0;
}
function restoreFromLeftTurn() {
_root.roddy.gotoAndStop(1);
roddyState = 0;
}
function restoreFromRightTurn() {
_root.roddy.gotoAndStop(1);
roddyState = 0;
}
function pointAt(obj1x, obj1y, obj2x, obj2y) {
angle = Math.atan2(obj1x - obj2x, -(obj1y - obj2y));
return(angle);
}
function deRad(val) {
return(Math.round((val * 180) / Math.PI));
}
function rangeFrom(x0, y0, x1, y1) {
return(Math.round(Math.sqrt(Math.pow(x0 - x1, 2) + Math.pow(y0 - y1, 2))));
}
function replayGame() {
trace("restarting game");
_root.gotoAndPlay("intro");
}
function paddleSplash() {
psLoc.x = roddy.frames.splashPoint._x;
psLoc.y = roddy.frames.splashPoint._y;
roddy.frames.localToGlobal(psLoc);
paddleRipples.attachMovie("pSplash", "ps" + psCount, 10 + psCount, {_x:psLoc.x, _y:psLoc.y, _rotation:_root.roddy._rotation});
psCount++;
if (psCount >= 10) {
psCount = 0;
}
}
function gameControl() {
switch (gameState) {
case 0 :
break;
case 1 :
feedback.gotoAndPlay("go");
gameState = 3;
rfoIdle = 10;
rfoLeft = 30;
rfoRight = 50;
roddy._x = 378;
roddy._y = 300;
roddyOrientation = 0;
roddyAngle = 0;
roddyVA = 0;
roddyVX = 0;
roddyVY = 0;
roddyState = 0;
gameScore = 0;
rubyCount = 0;
startTime = new Date();
maxSpeed = 5;
rVX = 0;
rVY = 0;
wpVX = 0;
wpVY = 0;
wpRange = 200;
stroke = 0;
strokePower = 1;
riverLength = 9660;
numBricks = riverLength / 460;
i = 0;
while (i < numBricks) {
walls.attachMovie("bricks", "b" + i, 10 + i, {_y:-460 * i});
i++;
}
numWP = 31;
numRubies = 45;
numLP = 46;
river.buoy1._y = -1932;
river.buoy2._y = -3864;
river.buoy3._y = -5796;
river.buoy4._y = -7728;
river.buoy5._y = -8960;
overlay.life1._alpha = 100;
overlay.life2._alpha = 100;
overlay.life3._alpha = 100;
marker1 = 0;
marker2 = 0;
marker3 = 0;
marker4 = 0;
currentLevel = 0;
lives = 3;
wpc = 4;
wpn = 0;
i = 0;
while (i < numLP) {
river["lp" + i]._x = random(400) - 199;
river["lp" + i]._y = (200 - (200 * i)) + (random(50) - 25);
trace((("lilypad " + river["lp" + i]._y) + " at ") + i);
if (((((i == 11) || (i == 20)) || (i == 30)) || (i == 40)) && (Math.abs(river["lp" + i]._x) < 50)) {
river["lp" + i]._x = 150;
}
if (i >= 1) {
if (river["ruby" + (i - 1)] != null) {
river["ruby" + (i - 1)]._x = river["lp" + (i - 1)]._x + ((river["lp" + i]._x - river["lp" + (i - 1)]._x) / 2);
river["ruby" + (i - 1)]._y = 300 - (200 * i);
}
}
wpc--;
if (wpc <= 0) {
trace((("placing whirlpool " + wpn) + " at ") + (100 - (200 * i)));
if (i < 14) {
wpc = 4;
} else if (i < 28) {
wpc = 3;
} else {
wpc = 2;
}
poolX = random(300) - 150;
while ((Math.abs(poolX - river["ruby" + (i - 1)]._x) < 30) || (Math.abs(poolX) < 40)) {
trace("shifting whirlpool " + i);
poolX = random(300) - 150;
}
_root.river["whirlpool" + wpn]._x = poolX;
_root.river["whirlpool" + wpn]._y = 300 - (200 * i);
wpn++;
}
i++;
}
break;
case 2 :
break;
case 3 :
meterPct = river._y / (riverLength - 460);
if (meterPct >= 1) {
meterPct = 1;
}
meter.marker._x = 85 + (550 * meterPct);
pMouse = pointAt(roddy._x, roddy._y, _root._xmouse, _root._ymouse) - (Math.PI/180);
angleRoddy = deRad(pMouse);
if (angleRoddy < 0) {
angleRoddy = 360 + angleRoddy;
}
angleRoddy = angleRoddy - 180;
roddy._rotation = angleRoddy;
if (stroke == 1) {
if (roddyOrientation == 0) {
paddleLeft.snd.attachSound("stroke" + (random(3) + 1));
paddleLeft.snd.start();
roddyOrientation = 1;
roddy.gotoAndStop(4);
} else {
paddleRight.snd.attachSound("stroke" + (random(3) + 1));
paddleRight.snd.start();
roddyOrientation = 0;
roddy.gotoAndStop(5);
}
rVX = Math.sin(pMouse) * (-strokePower);
rVY = Math.cos(pMouse) * strokePower;
stroke = 0;
}
i = 0;
while (i < numRubies) {
rbY = _root.river["ruby" + i]._y + _root.river._y;
if ((rbY > -150) && (rbY < 610)) {
_root.river["ruby" + i]._visible = true;
rbLoc.x = _root.river["ruby" + i]._x;
rbLoc.y = _root.river["ruby" + i]._y;
_root.river.localToGlobal(rbLoc);
rbDist = rangeFrom(rbLoc.x, rbLoc.y, roddy._x, roddy._y);
if (rbDist < 40) {
rubyCount++;
powerup.snd.start();
gameScore = gameScore + 100;
_root.river["ruby" + i]._y = 500;
trace("got ruby " + i);
}
} else {
_root.river["ruby" + i]._visible = false;
}
i++;
}
i = 0;
while (i < numWP) {
wpY = _root.river["whirlpool" + i]._y + _root.river._y;
if ((wpY > -150) && (wpY < 610)) {
_root.river["whirlpool" + i]._visible = true;
wpLoc.x = _root.river["whirlpool" + i]._x;
wpLoc.y = _root.river["whirlpool" + i]._y;
_root.river.localToGlobal(wpLoc);
wpDist = rangeFrom(wpLoc.x, wpLoc.y, roddy._x, roddy._y);
if (wpDist < 20) {
song.snd.stop();
song.snd.attachSound("whirlpooled");
song.snd.start();
killerWhirlpool = i;
kwpLocX = wpLoc.x;
kwpLocY = wpLoc.y;
gameState = 5;
roddyAngular = 10;
} else if (wpDist < wpRange) {
wpAngle = pointAt(roddy._x, roddy._y, wpLoc.x, wpLoc.y);
wpVX = -(Math.sin(wpAngle) * (0.3 * ((wpRange - wpDist) / wpRange)));
wpVY = Math.cos(wpAngle) * (0.3 * ((wpRange - wpDist) / wpRange));
whirlpool.snd.setVolume(Math.round(((wpRange - wpDist) * 100) / wpRange));
} else {
whirlpool.snd.setVolume(0);
}
} else {
_root.river["whirlpool" + i]._visible = false;
}
i++;
}
i = 0;
while (i < numLP) {
lpY = _root.river["lp" + i]._y + _root.river._y;
if ((lpY > -150) && (lpY < 610)) {
_root.river["lp" + i]._visible = true;
lpLoc.x = _root.river["lp" + i]._x;
lpLoc.y = _root.river["lp" + i]._y;
_root.river.localToGlobal(lpLoc);
lpDist = rangeFrom(roddy._x, roddy._y, lpLoc.x, lpLoc.y);
if (lpDist < 45) {
duckBump();
lpAngle = pointAt(lpLoc.x, lpLoc.y, roddy._x, roddy._y);
totalForce = Math.sqrt(Math.pow(roddyVX, 2) + Math.pow(roddyVY, 2));
appliedForce = totalForce * 0.5;
if (appliedForce < 0.5) {
appliedForce = 0.5;
}
roddyVX = (-Math.sin(lpAngle)) * appliedForce;
roddyVY = Math.cos(lpAngle) * appliedForce;
}
} else {
_root.river["lp" + i]._visible = false;
}
i++;
}
roddyVX = roddyVX + (rVX + wpVX);
roddyVY = roddyVY + (rVY + wpVY);
if (Math.abs(roddyVY) > maxSpeed) {
roddyVY = maxSpeed * (roddyVY / Math.abs(roddyVY));
}
if (Math.abs(roddyVX) > maxSpeed) {
roddyVX = maxSpeed * (roddyVX / Math.abs(roddyVX));
}
roddy._x = roddy._x + roddyVX;
if ((river._y - roddyVY) < 0) {
river._y = 0;
walls._y = 0;
roddyVY = 0;
} else if ((river._y - roddyVY) > (riverLength - 460)) {
river._y = riverLength - 460;
walls._y = riverLength - 460;
gameState = 4;
gameScore = gameScore + 2000;
gotoAndPlay ("tier3");
} else {
river._y = river._y - roddyVY;
walls._y = walls._y - roddyVY;
}
if (roddy._x < 140) {
duckBump();
roddy._x = 140 + (140 - roddy._x);
appliedForce = (-roddyVX) * 0.8;
if (appliedForce < 0.5) {
appliedForce = 0.5;
}
roddyVX = appliedForce;
} else if (roddy._x > 616) {
duckBump();
roddy._x = 616 + (roddy._x - 616);
appliedForce = (-roddyVX) * 0.8;
if (appliedForce > -0.5) {
appliedForce = -0.5;
}
roddyVX = appliedForce;
}
rVX = 0;
rVY = 0;
wpVX = 0;
wpVY = 0;
i = 0;
while (i <= 5) {
_root["ripple" + i]._y = _root["ripple" + i]._y - roddyVY;
i++;
}
if ((roddyVX > 0.3) || (roddyVX < -0.3)) {
roddyVX = roddyVX - ((roddyVX / Math.abs(roddyVX)) * 0.005);
}
if ((roddyVY > 0.3) || (roddyVY < -0.3)) {
roddyVY = roddyVY - ((roddyVY / Math.abs(roddyVY)) * 0.005);
}
if ((marker1 == 0) && (river._y > 2192)) {
gameScore = gameScore + 1000;
marker1 = 1;
currentLevel = 1;
trace("marker 1");
river.buoy1.gotoAndPlay("hide");
feedback.gotoAndPlay("checkPoint");
}
if ((marker2 == 0) && (river._y > 4124)) {
gameScore = gameScore + 1000;
marker2 = 1;
currentLevel = 2;
trace("marker 2");
river.buoy2.gotoAndPlay("hide");
feedback.gotoAndPlay("checkPoint");
}
if ((marker3 == 0) && (river._y > 6056)) {
gameScore = gameScore + 1000;
marker3 = 1;
currentLevel = 3;
trace("marker 3");
river.buoy3.gotoAndPlay("hide");
feedback.gotoAndPlay("checkPoint");
}
if ((marker4 == 0) && (river._y > 7985)) {
gameScore = gameScore + 1000;
marker4 = 1;
currentLevel = 4;
trace("marker 4");
river.buoy4.gotoAndPlay("hide");
feedback.gotoAndPlay("checkPoint");
}
currentTime = new Date();
elapsedTime = currentTime - startTime;
elapsedTime = Math.round(elapsedTime / 1000);
minutes = Math.floor(elapsedTime / 60);
seconds = elapsedTime - (minutes * 60);
if (minutes < 10) {
minTxt = "0" + minutes;
} else {
minTxt = minutes;
}
if (seconds < 10) {
secTxt = "0" + seconds;
} else {
secTxt = seconds;
}
overlay.timeElapsed.text = (minTxt + ":") + secTxt;
overlay.score.text = gameScore;
overlay.rubies.text = rubyCount;
break;
case 4 :
break;
case 5 :
roddy._x = roddy._x + (kwpLocX - roddy._x);
roddy._y = roddy._y + (kwpLocY - roddy._y);
roddy._rotation = roddy._rotation + roddyAngular;
roddyAngular = roddyAngular + 0.5;
roddy._xscale = roddy._xscale - 1;
roddy._yscale = roddy._yscale - 1;
if (roddy._xscale < 50) {
roddy._alpha = roddy._alpha - 1.2;
}
if (Math.round(roddy._xscale) <= 0) {
duck.snd.setVolume(100);
duck.snd.attachSound("deadduck");
duck.snd.start();
gameState = 6;
}
break;
case 6 :
overlay["life" + lives]._alpha = 15;
lives--;
if (lives == 0) {
gotoAndPlay ("gameOver");
} else {
if (marker4 == 1) {
riverReset = 8028;
currentLevel = 4;
} else if (marker3 == 1) {
riverReset = 6096;
currentLevel = 3;
} else if (marker2 == 1) {
riverReset = 4164;
currentLevel = 2;
} else if (marker1 == 1) {
currentLevel = 1;
riverReset = 2232;
} else {
currentLevel = 0;
riverReset = 0;
}
roddyVX = 0;
roddyVY = 0;
roddyState = 0;
rVX = 0;
rVY = 0;
wpVX = 0;
wpVY = 0;
roddy._x = 378;
roddy._y = 300;
roddy._rotation = 0;
roddy._xscale = 100;
roddy._yscale = 100;
roddy._alpha = 0;
i = 0;
while (i < numRubies) {
if (_root.river["rb" + i]._y > (-_root.river._y)) {
_root.river["rb" + i]._visible = true;
}
i++;
}
i = 0;
while (i < numLP) {
if (_root.river["lp" + i]._y > (-_root.river._y)) {
_root.river["lp" + i]._visible = true;
}
i++;
}
i = 0;
while (i < numWP) {
if (_root.river["whirlpool" + i]._y > (-_root.river._y)) {
_root.river["whirlpool" + i]._visible = true;
}
i++;
}
whirlpool.snd.setVolume(0);
gameState = 7;
}
break;
case 7 :
if (Math.round(river._y) != riverReset) {
river._y = river._y + ((riverReset - river._y) * 0.2);
walls._y = river._y;
} else {
trace(river._y);
gameState = 0;
roddy.gotoAndPlay("reset");
roddy._alpha = 100;
}
meterPct = river._y / (riverLength - 460);
if (meterPct >= 1) {
meterPct = 1;
}
break;
case 8 :
whirlpool.snd.setVolume(0);
}
}
function duckBump() {
duck.snd.attachSound("bump" + (random(2) + 1));
duck.snd.start();
}
function roddyForward(v) {
roddyVX = roddyVX + (zSin[Math.round(roddyAngle)] * v);
if (Math.abs(roddyVX) > 4) {
roddyVX = 4 * (roddyVX / Math.abs(roddyVX));
}
roddyVY = roddyVY - (zCos[Math.round(roddyAngle)] * v);
if (Math.abs(roddyVY) > 4) {
roddyVY = 4 * (roddyVY / Math.abs(roddyVY));
}
}
function restoreFromLeftPaddle() {
_root.roddy.gotoAndStop(1);
}
function restoreFromRightPaddle() {
_root.roddy.gotoAndStop(1);
}
function restoreFromLeftTurn() {
_root.roddy.gotoAndStop(1);
}
function restoreFromRightTurn() {
_root.roddy.gotoAndStop(1);
}
_root.turnStep = 3;
zSin = new Array(0, 0.017, 0.035, 0.052, 0.07, 0.087, 0.105, 0.122, 0.139, 0.156, 0.174, 0.191, 0.208, 0.225, 0.242, 0.259, 0.276, 0.292, 0.309, 0.326, 0.342, 0.358, 0.375, 0.391, 0.407, 0.423, 0.438, 0.454, 0.469, 0.485, 0.5, 0.515, 0.53, 0.545, 0.559, 0.574, 0.588, 0.602, 0.616, 0.629, 0.643, 0.656, 0.669, 0.682, 0.695, 0.707, 0.719, 0.731, 0.743, 0.755, 0.766, 0.777, 0.788, 0.799, 0.809, 0.819, 0.829, 0.839, 0.848, 0.857, 0.866, 0.875, 0.883, 0.891, 0.899, 0.906, 0.914, 0.921, 0.927, 0.934, 0.94, 0.946, 0.951, 0.956, 0.961, 0.966, 0.97, 0.974, 0.978, 0.982, 0.985, 0.988, 0.99, 0.993, 0.995, 0.996, 0.998, 0.999, 0.999, 1, 1, 1, 0.999, 0.999, 0.998, 0.996, 0.995, 0.993, 0.99, 0.988, 0.985, 0.982, 0.978, 0.974, 0.97, 0.966, 0.961, 0.956, 0.951, 0.946, 0.94, 0.934, 0.927, 0.921, 0.914, 0.906, 0.899, 0.891, 0.883, 0.875, 0.866, 0.857, 0.848, 0.839, 0.829, 0.819, 0.809, 0.799, 0.788, 0.777, 0.766, 0.755, 0.743, 0.731, 0.719, 0.707, 0.695, 0.682, 0.669, 0.656, 0.643, 0.629, 0.616, 0.602, 0.588, 0.574, 0.559, 0.545, 0.53, 0.515, 0.5, 0.485, 0.469, 0.454, 0.438, 0.423, 0.407, 0.391, 0.375, 0.358, 0.342, 0.326, 0.309, 0.292, 0.276, 0.259, 0.242, 0.225, 0.208, 0.191, 0.174, 0.156, 0.139, 0.122, 0.105, 0.087, 0.07, 0.052, 0.035, 0.017, 0, -0.017, -0.035, -0.052, -0.07, -0.087, -0.105, -0.122, -0.139, -0.156, -0.174, -0.191, -0.208, -0.225, -0.242, -0.259, -0.276, -0.292, -0.309, -0.326, -0.342, -0.358, -0.375, -0.391, -0.407, -0.423, -0.438, -0.454, -0.469, -0.485, -0.5, -0.515, -0.53, -0.545, -0.559, -0.574, -0.588, -0.602, -0.616, -0.629, -0.643, -0.656, -0.669, -0.682, -0.695, -0.707, -0.719, -0.731, -0.743, -0.755, -0.766, -0.777, -0.788, -0.799, -0.809, -0.819, -0.829, -0.839, -0.848, -0.857, -0.866, -0.875, -0.883, -0.891, -0.899, -0.906, -0.914, -0.921, -0.927, -0.934, -0.94, -0.946, -0.951, -0.956, -0.961, -0.966, -0.97, -0.974, -0.978, -0.982, -0.985, -0.988, -0.99, -0.993, -0.995, -0.996, -0.998, -0.999, -0.999, -1, -1, -1, -0.999, -0.999, -0.998, -0.996, -0.995, -0.993, -0.99, -0.988, -0.985, -0.982, -0.978, -0.974, -0.97, -0.966, -0.961, -0.956, -0.951, -0.946, -0.94, -0.934, -0.927, -0.921, -0.914, -0.906, -0.899, -0.891, -0.883, -0.875, -0.866, -0.857, -0.848, -0.839, -0.829, -0.819, -0.809, -0.799, -0.788, -0.777, -0.766, -0.755, -0.743, -0.731, -0.719, -0.707, -0.695, -0.682, -0.669, -0.656, -0.643, -0.629, -0.616, -0.602, -0.588, -0.574, -0.559, -0.545, -0.53, -0.515, -0.5, -0.485, -0.469, -0.454, -0.438, -0.423, -0.407, -0.391, -0.375, -0.358, -0.342, -0.326, -0.309, -0.292, -0.276, -0.259, -0.242, -0.225, -0.208, -0.191, -0.174, -0.156, -0.139, -0.122, -0.105, -0.087, -0.07, -0.052, -0.035, -0.017);
zCos = new Array(1, 1, 0.999, 0.999, 0.998, 0.996, 0.995, 0.993, 0.99, 0.988, 0.985, 0.982, 0.978, 0.974, 0.97, 0.966, 0.961, 0.956, 0.951, 0.946, 0.94, 0.934, 0.927, 0.921, 0.914, 0.906, 0.899, 0.891, 0.883, 0.875, 0.866, 0.857, 0.848, 0.839, 0.829, 0.819, 0.809, 0.799, 0.788, 0.777, 0.766, 0.755, 0.743, 0.731, 0.719, 0.707, 0.695, 0.682, 0.669, 0.656, 0.643, 0.629, 0.616, 0.602, 0.588, 0.574, 0.559, 0.545, 0.53, 0.515, 0.5, 0.485, 0.469, 0.454, 0.438, 0.423, 0.407, 0.391, 0.375, 0.358, 0.342, 0.326, 0.309, 0.292, 0.276, 0.259, 0.242, 0.225, 0.208, 0.191, 0.174, 0.156, 0.139, 0.122, 0.105, 0.087, 0.07, 0.052, 0.035, 0.017, 0, -0.017, -0.035, -0.052, -0.07, -0.087, -0.105, -0.122, -0.139, -0.156, -0.174, -0.191, -0.208, -0.225, -0.242, -0.259, -0.276, -0.292, -0.309, -0.326, -0.342, -0.358, -0.375, -0.391, -0.407, -0.423, -0.438, -0.454, -0.469, -0.485, -0.5, -0.515, -0.53, -0.545, -0.559, -0.574, -0.588, -0.602, -0.616, -0.629, -0.643, -0.656, -0.669, -0.682, -0.695, -0.707, -0.719, -0.731, -0.743, -0.755, -0.766, -0.777, -0.788, -0.799, -0.809, -0.819, -0.829, -0.839, -0.848, -0.857, -0.866, -0.875, -0.883, -0.891, -0.899, -0.906, -0.914, -0.921, -0.927, -0.934, -0.94, -0.946, -0.951, -0.956, -0.961, -0.966, -0.97, -0.974, -0.978, -0.982, -0.985, -0.988, -0.99, -0.993, -0.995, -0.996, -0.998, -0.999, -0.999, -1, -1, -1, -0.999, -0.999, -0.998, -0.996, -0.995, -0.993, -0.99, -0.988, -0.985, -0.982, -0.978, -0.974, -0.97, -0.966, -0.961, -0.956, -0.951, -0.946, -0.94, -0.934, -0.927, -0.921, -0.914, -0.906, -0.899, -0.891, -0.883, -0.875, -0.866, -0.857, -0.848, -0.839, -0.829, -0.819, -0.809, -0.799, -0.788, -0.777, -0.766, -0.755, -0.743, -0.731, -0.719, -0.707, -0.695, -0.682, -0.669, -0.656, -0.643, -0.629, -0.616, -0.602, -0.588, -0.574, -0.559, -0.545, -0.53, -0.515, -0.5, -0.485, -0.469, -0.454, -0.438, -0.423, -0.407, -0.391, -0.375, -0.358, -0.342, -0.326, -0.309, -0.292, -0.276, -0.259, -0.242, -0.225, -0.208, -0.191, -0.174, -0.156, -0.139, -0.122, -0.105, -0.087, -0.07, -0.052, -0.035, -0.017, 0, 0.017, 0.035, 0.052, 0.07, 0.087, 0.105, 0.122, 0.139, 0.156, 0.174, 0.191, 0.208, 0.225, 0.242, 0.259, 0.276, 0.292, 0.309, 0.326, 0.342, 0.358, 0.375, 0.391, 0.407, 0.423, 0.438, 0.454, 0.469, 0.485, 0.5, 0.515, 0.53, 0.545, 0.559, 0.574, 0.588, 0.602, 0.616, 0.629, 0.643, 0.656, 0.669, 0.682, 0.695, 0.707, 0.719, 0.731, 0.743, 0.755, 0.766, 0.777, 0.788, 0.799, 0.809, 0.819, 0.829, 0.839, 0.848, 0.857, 0.866, 0.875, 0.883, 0.891, 0.899, 0.906, 0.914, 0.921, 0.927, 0.934, 0.94, 0.946, 0.951, 0.956, 0.961, 0.966, 0.97, 0.974, 0.978, 0.982, 0.985, 0.988, 0.99, 0.993, 0.995, 0.996, 0.998, 0.999, 0.999, 1);
padsX = new Array(230, 450, 500, 350, 260, 400, 340);
padsY = new Array(400, 800, 1200, 1350, 1600, 1800, 2100);
whirlpools = new Array("whirlpool1", "whirlpool2");
_root.turnStep = 3;
var roddyVA;
wpLoc = new Object();
lpLoc = new Object();
psLoc = new Object();
rbLoc = new Object();
psCount = 0;
Key.addListener(keyTracker);
createEmptyMovieClip("song", 26);
song.snd = new Sound(song);
song.snd.attachSound("loop");
createEmptyMovieClip("water", 27);
water.snd = new Sound(water);
water.snd.attachSound("water_loop");
water.snd.setVolume(50);
roddy.snd = new Sound(roddy);
createEmptyMovieClip("paddleLeft", 28);
createEmptyMovieClip("paddleRight", 29);
paddleLeft.snd = new Sound("paddleLeft");
paddleRight.snd = new Sound("paddleRight");
createEmptyMovieClip("duck", 30);
duck.snd = new Sound(duck);
duck.snd.attachSound("deadduck");
createEmptyMovieClip("powerup", 31);
powerup.snd = new Sound(powerup);
powerup.snd.attachSound("ruby");
createEmptyMovieClip("whirlpool", 32);
whirlpool.snd = new Sound(whirlpool);
whirlpool.snd.attachSound("ragingwater");
whirlpool.snd.setVolume(0);
whirlpool.snd.start(0, 99999);
Frame 3
loadMax = this.getBytesTotal();
loadCurr = this.getBytesLoaded();
loadPct = Math.round((loadCurr / loadMax) * 100);
loadbar1.gotoAndStop(loadPct);
loadbar1.percent = loadPct;
if (loadCurr == loadMax) {
gotoAndPlay ("intro");
} else {
gotoAndPlay(_currentframe - 1);
}
Frame 5
function checkPHPLoginX() {
if (phpLoginObject.__get__myDone() == true) {
clearInterval(this.aa);
phpDATA = phpLoginObject.myData;
evaluatePhp();
delete phpLoginObject;
}
}
function evaluatePhp() {
var _local1 = Number(phpDATA.section0.gamecount0.value.toString());
totalPlays = Number(_local1);
if (phpDATA.success0.value.toString() == "true") {
gotoAndPlay ("intro");
} else {
getURL (phpDATA.redirect0.value.toString());
}
ctaFlag = phpDATA.section0.gamecompletion0.value.toString();
}
function checkPHPBubbleX() {
if (phpBubblePost.__get__myDone() == true) {
clearInterval(this.aa);
bubbleDATA = phpBubblePost.myData;
if (bubbleDATA.success0.value.toString() != "true") {
getURL (bubbleDATA.redirect0.value.toString());
} else {
messaging();
movingForward();
}
delete phpBubblePost;
}
}
function checkPHPPostX() {
if (phpPostObject.__get__myDone() == true) {
clearInterval(this.aa);
postDATA = phpPostObject.myData;
if (postDATA.success0.value.toString() != "true") {
getURL (postDATA.redirect0.value.toString());
} else if (savingBubbles == true) {
bubbleCall();
} else {
movingForward();
}
delete phpPostObject;
}
}
function bubbleCall() {
phpBubblePost.phpSendLoad(((postphp + "?gid=") + gid) + "&property[gamecompletion]=true");
this.aa = setInterval(this, "checkPHPBubbleX", 40);
}
function postCall() {
phpPostObject.phpSendLoad((((((postphp + "?gid=") + gid) + "&property[personalbestscore]=") + _root.gameScore) + "&property[gamecount]=") + totalPlays);
this.aa = setInterval(this, "checkPHPPostX", 40);
}
function evalIfToSaveBubbles() {
savingBubbles = false;
if (phpDATA.section0.gamecompletion0.value.toString() == "false") {
if ((totalPlays >= 3) || (_root.currentLevel >= 2)) {
savingBubbles = true;
}
}
}
function messaging() {
var _local1 = "New bubbles available<br>at the Think Tank!";
getURL (("javascript:updateFlashObject('gnav','/msgobject:alert', '" + _local1) + "')");
}
function continueRedirectThinktank() {
stopAllSounds();
var _local1 = "";
if (ctaFlag.toString() == "false") {
_local1 = "&cta=true";
}
getURL (((contlinkwin + "?deeplink=") + gid) + _local1);
}
function continueRedirectPipemap() {
getURL (contlinklose);
}
function callDigitalDownload() {
getURL (("javascript:callDigitalDownloadPopup('" + digidownload.toString()) + "');");
}
function movingForward() {
gotoAndPlay(_currentframe + 1);
}
var contlinkwin;
var contlinklose;
var loginphp;
var postphp;
var gid;
var digidownload;
var ctaFlag = false;
var savingBubbles = false;
var totalPlays = new Number(0);
var phpLoginObject = new phpCallClass();
var phpBubblePost = new phpCallClass();
var phpPostObject = new phpCallClass();
var phpDATA = {};
var postDATA = {};
var bubbleDATA = {};
phpLoginObject.phpSendLoad((loginphp + "?gid=") + gid);
this.aa = setInterval(this, "checkPHPLoginX", 40);
stop();
Frame 10
play();
fireCreateTag("Game Intro", "Play The Game", "duckboat", "registered", "", "");
song.snd.stop();
song.snd.attachSound("loop");
song.snd.start(0, 9999);
Frame 19
stop();
Frame 20
_root.fireCreateTag("instructions", "Play The Game", "tadpole", "registered", "", "");
Frame 29
stop();
Frame 30
Key.addListener(keyTracker);
Mouse.addListener(mouseTracker);
gc = setInterval(_root, "gameControl", 10);
gameState = 1;
i = 0;
while (i <= 6) {
_root["ripple" + i].gotoAndPlay(2 + (i * 5));
i++;
}
water.snd.start(0, 9999);
fireCreateTag("Game Play", "Play The Game", "duckboat", "registered", "", "");
song.snd.stop();
song.snd.attachSound("loop");
song.snd.start(0, 9999);
Frame 34
stop();
Frame 35
whirlpool.snd.setVolume(0);
if (_root.gameScore < 0) {
_root.gameScore = 0;
}
clearInterval(gc);
Frame 89
Frame 90
stop();
fireCreateTag("Game Over", "Play The Game", "duckboat", "registered", "", "");
switch (currentLevel) {
case 0 :
gotoAndPlay ("tier0");
break;
case 1 :
gotoAndPlay ("tier0");
break;
case 2 :
gotoAndPlay ("tier1");
break;
case 3 :
gotoAndPlay ("tier1");
break;
case 4 :
gotoAndPlay ("tier2");
}
Frame 99
stop();
Frame 109
stop();
Frame 119
stop();
Frame 120
whirlpool.snd.setVolume(0);
timeBonus = 2500;
totalSecs = (minutes * 60) + seconds;
overSecs = totalSecs - 60;
if (overSecs > 0) {
timeBonus = timeBonus - (overSecs * 50);
}
if (timeBonus > -500) {
_root.gameScore = _root.gameScore + timeBonus;
}
if (_root.gameScore < 0) {
_root.gameScore = 0;
}
clearInterval(gc);
Frame 130
Frame 131
play();
_root.fireCreateTag("Game Over", "Play The Game", "duckboat", "registered", "", "");
Frame 135
stop();
Symbol 22 MovieClip Frame 1
stop();
Symbol 23 MovieClip Frame 1
moss1.gotoAndStop(random(6) + 1);
moss2.gotoAndStop(random(6) + 1);
moss1._y = 115 + random(205);
moss2._y = 115 + random(205);
stop();
Symbol 26 MovieClip [pSplash] Frame 41
removeMovieClip(this);
Symbol 33 MovieClip [lilypad] Frame 1
gotoAndStop(random(2) + 1);
_rotation = (random(4) * 90);
stop();
Symbol 43 MovieClip Frame 1
stop();
Symbol 245 MovieClip [__Packages.phpCallClass] Frame 0
class phpCallClass
{
var myData, errormsg, sendVars, sendXML, resultXML, timerFunct, target, toString, myTimer, checkint, myXmlLoadClass, done;
function phpCallClass () {
myData = new Object();
errormsg = new String();
sendVars = new LoadVars();
sendXML = new XML();
resultXML = new XML();
sendXML.ignoreWhite = true;
resultXML.ignoreWhite = true;
sendXML.target = this;
resultXML.target = this;
myDone = (false);
timerFunct = mx.utils.Delegate.create(this, handleTimerConstruct);
}
function phpLoad(path) {
setTimer();
var _local2 = appendrnd(path);
sendXML.load(_local2);
sendXML.onLoad = myOnLoad;
}
function phpSendLoad(path) {
setTimer();
var _local5 = path.lastIndexOf("?");
if (_local5 == -1) {
trace("no variables being passed");
} else {
var _local2 = new Array();
var _local7 = path.slice(_local5 + 1, path.length);
var _local9 = path.slice(0, _local5);
_local2 = _local7.split("&");
var _local4 = 0;
while (_local4 < _local2.length) {
var _local3 = _local2[_local4].lastIndexOf("=");
sendVars[_local2[_local4].slice(0, _local3)] = _local2[_local4].slice(_local3 + 1, _local2[_local4].length);
_local4++;
}
}
for (var _local4 in sendVars) {
trace((_local4 + " = ") + sendVars[_local4]);
}
var _local8 = appendrnd(_local9);
sendVars.sendAndLoad(_local8, resultXML, "POST");
resultXML.onLoad = myOnLoad;
}
function myOnLoad(success) {
if (success) {
target.clearTimer();
var _local2 = new String();
_local2 = toString();
target.myXmlLoadClass = new XmlLoadClass(_local2);
target.setcheck();
} else {
errormsg = "Unable to Load";
trace(errormsg);
}
}
function appendrnd(str) {
var _local3 = randRangeQueryAdd(1, 999999);
if (str.lastIndexOf(".php") == (str.length - 4)) {
str = str + ("?rnd=" + _local3);
} else if (str.lastIndexOf(".xml") == (str.length - 4)) {
} else if (str.lastIndexOf("?") == (str.length - 1)) {
str = str + ("rnd=" + _local3);
} else {
str = str + ("&rnd=" + _local3);
}
return(str);
}
function setTimer() {
myTimer = new Timer(25000);
myTimer.addEventListener("timeout", timerFunct);
}
function clearTimer() {
myTimer.clearMe();
myTimer.removeEventListener("timeout", timerFunct);
}
function handleTimerConstruct(evt) {
clearTimer();
}
function setcheck() {
checkint = setInterval(this, "XmlLoadClassOnLoad", 100, this);
}
function clearcheck() {
clearInterval(checkint);
}
function XmlLoadClassOnLoad(targ) {
if (myXmlLoadClass.__get__myDone() == true) {
targ.clearcheck();
targ.myData = myXmlLoadClass.myData;
targ.myDone = true;
}
}
function get myDone() {
return(done);
}
function set myDone(amI) {
done = amI;
//return(myDone);
}
function randRangeQueryAdd(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
}
Symbol 246 MovieClip [__Packages.XmlLoadClass] Frame 0
class XmlLoadClass extends XML
{
var onLoad, ignoreWhite, topLength, myData, load, parseXML, firstChild, done;
function XmlLoadClass (url) {
super();
onLoad = _onLoad;
ignoreWhite = true;
topLength = 0;
myDone = (false);
myData = new MyObjects();
if (url.toLowerCase().substring(url.length - 4, url.length) == ".xml") {
load(url);
} else {
parseXML(url);
_onLoad();
}
}
function _onLoad() {
var _local3 = 0;
var _local4 = {};
var _local2 = firstChild;
while (_local3 < _local2.childNodes.length) {
_local4[_local2.nodeName] = new Number(0);
_local4[_local2.childNodes[_local3].nodeName] = new Number(0);
_local3++;
}
_local3 = 0;
while (_local3 < _local2.childNodes.length) {
if (_local2.childNodes[_local3].nodeType == 3) {
myData.addData(_local2.nodeName + _local3, _local2.childNodes[_local3].nodeValue);
myData.addAttribute(_local2.nodeName + _local3, _local2.attributes);
_local4[_local2.nodeName]++;
} else if (_local2.childNodes[_local3].nodeType == 1) {
myData.addWrapper(_local2.childNodes[_local3].nodeName + _local4[_local2.childNodes[_local3].nodeName]);
myData.addAttribute(_local2.childNodes[_local3].nodeName + _local4[_local2.childNodes[_local3].nodeName], _local2.childNodes[_local3].attributes);
if (_local2.childNodes[_local3].childNodes.length > 0) {
_goLoop(_local2.childNodes[_local3], myData[_local2.childNodes[_local3].nodeName + _local4[_local2.childNodes[_local3].nodeName]]);
}
_local4[_local2.childNodes[_local3].nodeName]++;
topLength++;
}
_local3++;
}
myDone = (true);
trace(topLength);
}
function _goLoop(obj, dat) {
var _local3 = 0;
var _local4 = {};
while (_local3 < obj.childNodes.length) {
_local4[obj.nodeName] = new Number(0);
_local4[obj.childNodes[_local3].nodeName] = new Number(0);
_local3++;
}
_local3 = 0;
while (_local3 < obj.childNodes.length) {
if (obj.childNodes[_local3].nodeType == 3) {
dat.addDataStr("value", obj.childNodes[_local3].nodeValue);
} else if (obj.childNodes[_local3].nodeType == 1) {
dat.addWrapper(obj.childNodes[_local3].nodeName + _local4[obj.childNodes[_local3].nodeName]);
dat.addAttribute(obj.childNodes[_local3].nodeName + _local4[obj.childNodes[_local3].nodeName], obj.childNodes[_local3].attributes);
if (obj.childNodes[_local3].childNodes.length > 0) {
_goLoop(obj.childNodes[_local3], dat[obj.childNodes[_local3].nodeName + _local4[obj.childNodes[_local3].nodeName]]);
}
_local4[obj.childNodes[_local3].nodeName]++;
}
_local3++;
}
}
function get myDone() {
return(done);
}
function set myDone(amI) {
done = amI;
//return(myDone);
}
function get gsMyData() {
return(myData);
}
function set gsMyData(amI) {
myData = amI;
//return(gsMyData);
}
}
Symbol 247 MovieClip [__Packages.MyObjects] Frame 0
class MyObjects extends Object
{
function MyObjects () {
super();
}
function addWrapper(str) {
this[str] = new MyObjects();
}
function addData(str, nm, d) {
this[str][nm] = d;
}
function addDataStr(nm, d) {
this[nm] = d;
}
function addAttribute(str, d) {
this[str].attr = d;
}
}
Symbol 248 MovieClip [__Packages.Timer] Frame 0
class Timer
{
var timeInt, dispatchEvent;
function Timer (len) {
mx.events.EventDispatcher.initialize(this);
timeInt = setInterval(mx.utils.Delegate.create(this, handleTimer), len);
}
function handleTimer() {
dispatchEvent({type:"timeout", target:this, time:getTimer()});
clearMe();
}
function clearMe() {
clearInterval(timeInt);
}
}
Symbol 249 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 250 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 50 Button
on (release) {
gotoAndPlay ("instructions");
}
Symbol 53 Button
on (release) {
gotoAndPlay ("startGame");
}
Symbol 57 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 2
this._x = _root.roddy._x;
this._y = _root.roddy._y;
newAngle = _root.pointAt(0, 0, _root.roddyVX, _root.roddyVY) + Math.PI;
rangeFrom = _root.rangeFrom(0, 0, _root.roddyVX, _root.roddyVY);
if (rangeFrom < 1) {
type.gotoAndStop(1);
} else {
type.gotoAndStop(2);
}
this._rotation = _root.deRad(newAngle);
Symbol 58 MovieClip Frame 32
if (_root.gameState == 5) {
stop();
} else {
gotoAndPlay ("reset");
}
Symbol 68 MovieClip Frame 4
stop();
Symbol 68 MovieClip Frame 20
_visible = false;
stop();
Symbol 72 MovieClip Frame 1
stop();
Symbol 137 MovieClip Frame 7
if (_root.roddyVA < -0.2) {
_root.roddyVA = 0;
} else {
_root.roddyVA = _root.roddyVA + _root.turnStep;
if (_root.roddyVA > (2 * root.turnStep)) {
_root.roddyVA = 2 * root.turnStep;
}
}
Symbol 137 MovieClip Frame 30
_root.restoreFromLeftTurn();
stop();
Symbol 198 MovieClip Frame 8
if (_root.roddyVA > 0.2) {
_root.roddyVA = 0;
} else {
_root.roddyVA = _root.roddyVA - _root.turnStep;
if (_root.roddyVA < ((-root.turnStep) * 2)) {
_root.roddyVA = (-root.turnStep) * 2;
}
}
Symbol 198 MovieClip Frame 30
_root.restoreFromRightTurn();
stop();
Symbol 200 MovieClip Frame 1
_root.paddleSplash();
Symbol 200 MovieClip Frame 15
_root.restoreFromLeftPaddle();
stop();
Symbol 201 MovieClip Frame 1
_root.paddleSplash();
Symbol 201 MovieClip Frame 15
_root.restoreFromRightPaddle();
stop();
Symbol 203 MovieClip Frame 1
stop();
Symbol 203 MovieClip Frame 54
_root.feedback.gotoAndPlay("go");
_root.gameState = 3;
i = 0;
while (i <= 5) {
_root["ripple" + i]._x = _root.roddy._x;
_root["ripple" + i].gotoAndPlay(1 + (5 * i));
i++;
}
gotoAndStop (1);
_root.song.snd.attachSound("loop");
_root.song.snd.start(0, 9999);
Symbol 216 MovieClip Frame 4
stop();
Symbol 216 MovieClip Frame 43
gotoAndPlay ("reset");
Symbol 216 MovieClip Frame 70
gotoAndPlay ("reset");
Symbol 230 Button
on (press) {
_root.x1 = _root._xmouse;
_root.y1 = _root._ymouse;
_root.stroke = 1;
}
Symbol 236 Button
on (release) {
_root.replayGame();
}