Frame 1
function initDemo() {
borderTop = 140;
borderBottom = 280;
borderLeft = 140;
borderRight = 470;
vX = 0;
pills = false;
toxic = false;
vY = 0;
underwater = false;
moving = false;
waveCount = 0;
moveSpeed = 0.5;
hippaul.swapDepths(200);
_root.onEnterFrame = function () {
handleKeys();
if (Key.isDown(39)) {
titley.rightKey.gotoAndStop(3);
} else {
titley.rightKey.gotoAndStop(1);
}
if (Key.isDown(40)) {
titley.downKey.gotoAndStop(3);
} else {
titley.downKey.gotoAndStop(1);
}
if (Key.isDown(37)) {
titley.leftKey.gotoAndStop(3);
} else {
titley.leftKey.gotoAndStop(1);
}
if (Key.isDown(38)) {
titley.upKey.gotoAndStop(3);
} else {
titley.upKey.gotoAndStop(1);
}
friction();
moveHippo();
checkBorders();
setAngle();
wave();
};
}
function initEngine() {
breath = 20;
hippaul.gotoAndStop(1);
borderTop = 70;
borderBottom = 400;
borderLeft = 40;
borderRight = 560;
level = 1;
vX = 0;
vY = 0;
fruitLeft = 5;
time = 20;
lives = 3;
score = 0;
livesContainer.life1._visible = true;
livesContainer.life2._visible = true;
livesContainer.life3._visible = true;
powerUp = "";
underwater = false;
pauseEngine = false;
moving = false;
waveCount = 0;
logCount = 0;
fruitCount = 0;
hippaul.swapDepths(200);
toxic = false;
pills = false;
logTimer = 0;
fruitTimer = 0;
powerupTimer = 0;
powerupCount = 0;
invul = false;
current = 3;
logs = new Array();
moveSpeed = 0.5;
_root.onEnterFrame = function () {
if (!pauseEngine) {
handleKeys();
friction();
moveHippo();
checkBorders();
setAngle();
wave();
log();
fruit();
powerUps();
drainOxy();
}
};
}
function handleKeys() {
yMoving = false;
xMoving = false;
moving = false;
if (Key.isDown(39)) {
if (vX < 5) {
vX = vX + moveSpeed;
} else if (!pills) {
vX = 5;
} else {
vX = 10;
}
xMoving = true;
moving = true;
}
if (Key.isDown(37)) {
if (vX > -5) {
vX = vX - moveSpeed;
} else if (!pills) {
vX = -5;
} else {
vX = -10;
}
xMoving = true;
moving = true;
}
if (Key.isDown(38)) {
if (vY > -5) {
vY = vY - moveSpeed;
} else if (!pills) {
vY = -5;
} else {
vY = -10;
}
yMoving = true;
moving = true;
}
if (Key.isDown(40)) {
if (vY < 5) {
vY = vY + moveSpeed;
} else if (!pills) {
vY = 5;
} else {
vY = 10;
}
yMoving = true;
moving = true;
}
}
function moveHippo() {
hippaul._x = hippaul._x + vX;
hippaul._y = hippaul._y + vY;
}
function friction() {
if (!xMoving) {
if (vX > 0) {
vX = vX - 0.5;
} else if (vX < 0) {
vX = vX + 0.5;
}
}
if (!yMoving) {
if (vY > 0) {
vY = vY - 0.5;
} else if (vY < 0) {
vY = vY + 0.5;
}
}
}
function checkBorders() {
if (hippaul._x > borderRight) {
hippaul._x = borderRight;
vX = 0;
} else if (hippaul._x < borderLeft) {
hippaul._x = borderLeft;
vX = 0;
}
if (hippaul._y > borderBottom) {
hippaul._y = borderBottom;
vY = 0;
} else if (hippaul._y < borderTop) {
hippaul._y = borderTop;
vY = 0;
}
}
function setAngle() {
if ((vX != 0) || (vY != 0)) {
hippaul._rotation = (Math.atan2(vY, vX) * 57.2957795130823) + 90;
}
}
function wave() {
var _local2 = _root;
if (moving) {
var _local1 = "wave" + waveCount;
_local2.attachMovie("waterWave", _local1, 50 + waveCount);
waveCount++;
if (waveCount > 19) {
waveCount = 0;
}
_local2[_local1]._x = hippaul._x;
_local2[_local1]._y = hippaul._y;
_local2[_local1]._rotation = (Math.atan2(vY, vX) * 57.2957795130823) + 90;
}
}
function log() {
var _local1 = this;
var _local2 = _root;
logTimer++;
if (logTimer > (100 - (level * 7))) {
k = 0;
while (k < (Math.floor(level / 5) + 1)) {
var name = ("log" + logCount);
logCount++;
if (logCount > 19) {
logCount = 0;
}
_local2.attachMovie("log", name, 71 + logCount);
addLog(name);
_local2[name]._x = -10;
_local2[name]._y = random(330) + borderTop;
_local2[name].name = name;
_local2[name].onEnterFrame = function () {
var _local1 = this;
_local1._x = _local1._x + current;
if ((!underwater) && (((((((((hippaul.body.hitTest(_local1._x - 170, _local1._y + 10, true) || (hippaul.body.hitTest(_local1._x - 127.5, _local1._y + 10, true))) || (hippaul.body.hitTest(_local1._x - 85, _local1._y + 10, true))) || (hippaul.body.hitTest(_local1._x - 42.5, _local1._y + 10, true))) || (hippaul.body.hitTest(_local1._x, _local1._y + 10, true))) || (hippaul.body.hitTest(_local1._x - 170, _local1._y - 10, true))) || (hippaul.body.hitTest(_local1._x - 127.5, _local1._y - 10, true))) || (hippaul.body.hitTest(_local1._x - 85, _local1._y - 10, true))) || (hippaul.body.hitTest(_local1._x - 42.5, _local1._y - 10, true))) || (hippaul.body.hitTest(_local1._x, _local1._y - 10, true)))) {
if (!toxic) {
getHit();
} else {
if (!submerging) {
hippaul.gotoAndPlay(2);
}
chomp.start();
removeLog(_local1.name);
_local1.removeMovieClip();
}
}
if (_local1._x > 790) {
removeLog(_local1.name);
_local1.removeMovieClip();
}
};
logTimer = 0;
k++;
}
}
}
function fruit() {
var _local1 = _root;
var _local3 = this;
fruitTimer++;
if (fruitTimer > (50 - level)) {
var _local2 = "fruit" + fruitCount;
fruitCount++;
if (fruitCount > 19) {
fruitCount = 0;
}
_local1.attachMovie("fruit", _local2, 91 + fruitCount);
_local1[_local2].gotoAndStop(random(_local1[_local2]._totalframes) + 1);
_local1[_local2]._x = -10;
_local1[_local2]._y = random(330) + borderTop;
i = 0;
while (i < logs.length) {
if (_local1[_local2].hitTest(_local1[logs[i]])) {
_local1[_local2]._y = random(330) + borderTop;
}
i++;
}
_local1[_local2].onEnterFrame = function () {
var _local1 = this;
_local1._x = _local1._x + current;
if ((_local1.hitTest(hippaul) && (!underwater)) && (!pauseEngine)) {
if (!submerging) {
hippaul.gotoAndPlay(2);
}
chomp.start();
score++;
fruitLeft--;
checkLevelUp();
_local1.removeMovieClip();
}
if (_local1._x > 700) {
_local1.removeMovieClip();
}
};
fruitTimer = 0;
}
}
function powerUps() {
var _local1 = _root;
var _local3 = this;
if (random(1000) == 0) {
var _local2 = "powerup" + powerupCount;
powerupCount++;
if (powerupCount > 9) {
powerupCount = 0;
}
_local1.attachMovie("powerup", _local2, 111 + powerupCount);
_local1[_local2].powerType = powerTypes[random(3)];
_local1[_local2].gotoAndStop(_local1[_local2].powerType);
_local1[_local2]._x = -10;
_local1[_local2]._y = random(330) + borderTop;
i = 0;
while (i < logs.length) {
if (_local1[_local2].hitTest(_local1[logs[i]])) {
_local1[_local2]._y = random(330) + borderTop;
}
i++;
}
_local1[_local2].onEnterFrame = function () {
var _local1 = this;
_local1._x = _local1._x + current;
if ((_local1.hitTest(hippaul) && (!pauseEngine)) && (!underwater)) {
_root["eat" + _local1.powerType]();
chomp.start();
score = score + 5;
_local1.removeMovieClip();
}
if (_local1._x > 700) {
_local1.removeMovieClip();
}
};
}
}
function checkLevelUp() {
if (fruitLeft <= 0) {
current = current + 0.5;
nextLevel.gotoAndPlay(2);
level++;
fruitLeft = 5 + (level * 2);
}
}
function getHit() {
if (!invul) {
invul = true;
lives--;
livesContainer["life" + (lives + 1)]._visible = false;
if (lives == 0) {
pauseEngine = true;
hippaul.gotoAndPlay("explode");
}
hitCount = 0;
hitInterval = setInterval(hitFunc, 87);
}
}
function hitFunc() {
hitCount++;
if (hippaul._visible) {
hippaul._visible = false;
} else {
hippaul._visible = true;
}
if (hitCount > 20) {
invul = false;
hippaul._visible = true;
clearInterval(hitInterval);
}
}
function addLog(name) {
logs.push(name);
}
function soundFaderOut(soundToFade) {
var _local1 = _root;
oVol = oVol - 10;
_local1[soundToFade].setVolume(oVol);
if (oVol <= 0) {
_local1[soundToFade].stop();
_local1.gameMusic.start(0, 9999);
_local1.gameMusic.setVolume(0);
_local1.iVol = 0;
_local1.faderIn = setInterval(_local1.soundFaderIn, 200, "gameMusic");
clearInterval(faderOut);
}
}
function soundFaderIn(soundToFade) {
iVol = iVol + 10;
_root[soundToFade].setVolume(iVol);
if (iVol >= 100) {
clearInterval(faderIn);
}
}
function removeLog(name) {
var _local1 = name;
i = 0;
while (i < logs.length) {
if (logs[i] == _local1) {
logs.splice(i, 1);
return;
}
i++;
}
}
function drainOxy() {
if (underwater) {
breath = breath - 0.1;
if (breath < 0) {
invul = true;
breath = 20;
underwater = false;
lives--;
livesContainer["life" + (lives + 1)]._visible = false;
if (lives == 0) {
pauseEngine = true;
hippaul.gotoAndPlay("explode");
} else {
hippaul.gotoAndStop(1);
}
hitCount = 0;
hitInterval = setInterval(hitFunc, 87);
}
} else if (breath < 20) {
breath = breath + 0.2;
} else {
breath = 20;
}
oxyMeter.gotoAndStop((20 - Math.round(breath)) + 1);
}
function eattoxicWaste() {
hippaul._xscale = 200;
hippaul._yscale = 200;
toxicColor = new Color(hippaul);
var _local1 = {ra:"0", rb:"0", ga:"100", gb:"100", ba:"0", bb:"0", aa:"100", ab:"255"};
toxicColor.setTransform(_local1);
tc = 0;
meow = 101;
cd = "up";
toxicInt = setInterval(toxicCount, 40);
toxic = true;
}
function toxicCount() {
tc++;
if ((tc >= 400) || (pauseEngine)) {
hippaul._xscale = 100;
hippaul._yscale = 100;
toxic = false;
clearInterval(toxicInt);
var _local1 = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
toxicColor.setTransform(_local1);
delete toxicColor;
} else {
if (meow == 200) {
cd = "down";
} else if (meow == 100) {
cd = "up";
}
if (cd == "up") {
meow++;
} else {
meow--;
}
var _local1 = {ra:"100", rb:"0", ga:"100", gb:meow, ba:"100", bb:"0", aa:"100", ab:"0"};
toxicColor.setTransform(_local1);
}
}
function eatdynamite() {
chomp.start();
if (!invul) {
invul = true;
lives--;
livesContainer["life" + (lives + 1)]._visible = false;
if (lives == 0) {
pauseEngine = true;
hippaul.gotoAndPlay("explode");
}
hitCount = 0;
hitInterval = setInterval(hitFunc, 87);
}
}
function eatpills() {
moveSpeed = 2.5;
pills = true;
pillsInt = setInterval(pillsCount, 10000);
}
function pillsCount() {
moveSpeed = 0.5;
pills = false;
clearInterval(pillsInt);
}
titleMusic = new Sound();
titleMusic.attachSound("title");
gameMusic = new Sound();
gameMusic.attachSound("inGame");
splash = new Sound();
splash.attachSound("splash");
chomp = new Sound();
chomp.attachSound("chomp");
powerTypes = new Array("toxicWaste", "dynamite", "pills");
_root.onEnterFrame = function () {
var _local1 = _root;
loadPercent = _local1.getBytesLoaded() / _local1.getBytesTotal();
_local1.lineStyle("2", "0x000000", 100);
_local1.clear();
_local1.moveTo(0, 0);
_local1.beginFill("0x0066CC", 50);
_local1.lineTo(0, 450);
_local1.lineTo(600 * loadPercent, 450);
_local1.lineTo(600 * loadPercent, 0);
_local1.lineTo(0, 0);
_local1.endFill();
if (loadPercent == 1) {
_local1.clear();
wonpwnTimer = 0;
gotoAndPlay ("wonpwnLogo");
_local1.onEnterFrame = "";
}
};
stop();
Frame 10
if (wonpwnTimer > 80) {
gotoAndStop ("game");
} else if (wonpwnTimer == 40) {
iVol = 0;
titleMusic.start(0, 1024);
titleMusic.setVolume(0);
faderIn = setInterval(soundFaderIn, 200, "titleMusic");
wonpwnTimer++;
} else {
wonpwnTimer++;
}
Frame 11
gotoAndPlay ("wonpwnLogo");
Frame 20
stop();
titley.gotoAndStop(2);
Instance of Symbol 135 MovieClip "titley" in Frame 20
onClipEvent (load) {
this.swapDepths(260);
}
Instance of Symbol 159 MovieClip "gameOver" in Frame 20
onClipEvent (load) {
this.swapDepths(250);
}
Instance of Symbol 164 MovieClip "oxyMeter" in Frame 20
onClipEvent (load) {
this.swapDepths(210);
}
Instance of Symbol 167 MovieClip "nextLevel" in Frame 20
onClipEvent (load) {
this.swapDepths(220);
}
Symbol 12 MovieClip [fruit] Frame 1
stop();
Symbol 18 MovieClip [powerup] Frame 1
stop();
Symbol 21 MovieClip [waterWave] Frame 15
this.removeMovieClip();
Symbol 31 MovieClip Frame 95
_root.play();
Symbol 59 MovieClip Frame 1
stop();
Symbol 59 MovieClip Frame 3
gotoAndStop (1);
Symbol 59 MovieClip Frame 12
stop();
_root.underwater = true;
_root.submerging = false;
this.swapDepths(70);
Symbol 59 MovieClip Frame 15
_root.underwater = false;
_root.submerging = false;
gotoAndStop ("normal");
this.swapDepths(200);
Symbol 59 MovieClip Frame 90
_root.gameOver.play();
stop();
Symbol 67 Button
on (keyPress "<Space>") {
if (!pauseEngine) {
if (underwater && (!submerging)) {
hippaul.gotoAndPlay("under2");
submerging = true;
splash.start();
} else if (!submerging) {
hippaul.gotoAndPlay("underwater");
submerging = true;
splash.start();
}
}
}
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 2
stop();
Symbol 80 Button
on (rollOver) {
hippo.gotoAndStop(2);
}
on (rollOut) {
hippo.gotoAndStop(1);
}
on (release) {
gotoAndStop (3);
}
Symbol 87 Button
on (release) {
getURL ("http://www.freeworldgroup.com/koalafiles.htm", "_blank");
}
Symbol 92 Button
on (release) {
getURL ("http://www.freeworldgroup.com", "_blank");
}
Symbol 98 Button
on (release) {
getURL ("http://www.ifungames.com/", "_blank");
}
Symbol 99 Button
on (release) {
getURL ("http://www.freeworldgroup.com", "_blank");
}
Symbol 107 MovieClip Frame 360
stop();
Symbol 109 Button
on (rollOver) {
hippo.gotoAndStop(2);
}
on (rollOut) {
hippo.gotoAndStop(1);
}
on (release) {
_parent.gotoAndStop(4);
}
Symbol 128 Button
on (release) {
gotoAndStop (1);
_root.initEngine();
_root.oVol = 100;
_root.faderOut = setInterval(_root.soundFaderOut, 200, "titleMusic", "gameMusic");
}
Symbol 135 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 2
stop();
_root.hippaul.gotoAndStop(1);
if (_global.highscore) {
scoreThing._visible = true;
scoreThing.score = _global.highscore;
} else {
scoreThing._visible = false;
}
Symbol 135 MovieClip Frame 4
_root.initDemo();
leftKey.stop();
rightKey.stop();
downKey.stop();
upKey.stop();
Symbol 146 Button
on (release) {
_root.titley.gotoAndStop(2);
this.gotoAndStop(1);
}
Symbol 156 Button
on (release) {
nextFrame();
}
Symbol 158 Button
on (release) {
_root.initEngine();
this.gotoAndStop(1);
}
Symbol 159 MovieClip Frame 1
stop();
Symbol 159 MovieClip Frame 45
function displayScores() {
_root.gameOver["name" + scoresTimer] = scores["n" + scoresTimer];
_root.gameOver["score" + scoresTimer] = scores["s" + scoresTimer];
scoresTimer++;
if (scoresTimer > 5) {
clearInterval(scoresInterval);
}
}
t = 1;
while (t < 6) {
_root["name" + t] = "";
_root["score" + t] = "";
t++;
}
inGame = false;
clearInterval(windInterval);
scoresLoading = "Loading Scores";
scores = new LoadVars();
scores.a = 3;
scores.onLoad = function () {
scoresLoading = "";
scoresLoading = scores.error;
scoresTimer = 1;
scoresInterval = setInterval(displayScores, 500);
};
Key.removeListener(keyTrack);
stop();
score = _root.score;
if (score > _global.highscore) {
_global.highscore = score;
}
Symbol 159 MovieClip Frame 47
function displayScores() {
_root.gameOver["name" + scoresTimer] = scores["n" + scoresTimer];
_root.gameOver["score" + scoresTimer] = scores["s" + scoresTimer];
scoresTimer++;
if (scoresTimer > 5) {
clearInterval(scoresInterval);
}
}
t = 1;
while (t < 6) {
_root["name" + t] = "";
_root["score" + t] = "";
t++;
}
inGame = false;
clearInterval(windInterval);
scoresLoading = "Loading Scores";
scores = new LoadVars();
scores.a = 3;
scores.b = playerName;
scores.c = _root.score;
scores.sendAndLoad("inc/getScores.php", scores, "POST");
scores.onLoad = function () {
scoresLoading = "";
scoresLoading = scores.error;
scoresTimer = 1;
scoresInterval = setInterval(displayScores, 500);
};
Key.removeListener(keyTrack);
Symbol 164 MovieClip Frame 1
stop();
Symbol 167 MovieClip Frame 1
stop();
Symbol 167 MovieClip Frame 40
gotoAndStop (1);