Frame 1
gameName = "superfishing";
version = "040624";
Frame 2
if (_level0.getBytesLoaded() < _level0.getBytesTotal()) {
gotoAndPlay (1);
title = ("loading " + int(_level0.getBytesTotal() / 1024)) + " kbyte...";
percent = int((_level0.getBytesLoaded() / _level0.getBytesTotal()) * 100) + " %";
}
Frame 4
this.timer = createEmptyMovieClip("timer", 99);
this.timer.running = false;
this.timer.speed = 6;
timer.init = function (timeTotal) {
var _local1 = this;
_local1.maxTime = 100000 /* 0x0186A0 */;
_local1.timeTotal = timeTotal * 1000;
_local1.timeStart = getTimer();
_root.timeLeft = _local1.timeTotal;
_local1.running = false;
_local1.update();
};
timer.onEnterFrame = function () {
var _local1 = this;
var _local2 = _global;
if (_root.paused) {
_local1.timestamp = getTimer();
} else {
_local2.dt = (((getTimer() - _local1.timestamp) / 33) * 0.3) + (_local2.dt * 0.7);
_local1.timestamp = getTimer();
if (_local1.running) {
_root.timeLeft = _root.timeLeft - ((_local2.dt * 33) * _local1.speed);
}
_local1.update();
}
};
timer.update = function () {
var _local1 = _root;
var _local2 = this;
if (_local1.paused) {
} else {
_local1.timeLeftDisplay = int(_local1.timeLeft / 1000);
var _local3 = int((_local1.timeLeft / _local2.maxTime) * 200) + 1;
_local1.timeMc.gotoAndStop(_local3);
if ((_local1.timeLeft < 30000) && (_local1.timeLeft > 0)) {
_local1.snd.playLoop("sndTicking", 1);
} else {
_local1.snd.stop("sndTicking");
}
if ((_local1.timeLeft <= -0.5) && (_local2.running)) {
_local1.snd.stop("sndTicking");
_local2.running = false;
_local1.timeOut();
}
}
};
timer.alter = function (d) {
_root.timeLeft = Math.min(this.maxTime, Math.max(0, _root.timeLeft + d));
this.update();
};
timer.timestamp = getTimer();
snd = new Object();
snd.lib = new Array();
snd.libMc = new Array();
snd.mcCount = 0;
snd.active = 1;
snd.mc = _root.createEmptyMovieClip("sndMc", 97);
s = new Sound();
s.setVolume(100);
snd.load = function (id) {
var _local1 = this;
var _local2 = id;
_local1.libMc[_local2] = _local1.mc.createEmptyMovieClip("snd" + _local1.mcCount, 15 + _local1.mcCount);
_local1.mcCount++;
_local1.lib[_local2] = new Sound(_local1.libMc[_local2]);
_local1.lib[_local2].attachSound(_local2);
};
snd.play = function (id, volume) {
var _local1 = volume;
var _local2 = id;
if (_local1 === undefined) {
_local1 = 1;
}
_local1 = Math.max(0, Math.min(1, _local1));
this.lib[_local2].start(_local2);
this.lib[_local2].setVolume(_local1 * 100);
};
snd.playLoop = function (id, volume) {
var _local1 = id;
var _local2 = volume;
var _local3 = this;
if (_root.snd.libMc[_local1].playing == 1) {
} else {
if (_local2 === undefined) {
_local2 = 1;
}
_local2 = Math.max(0, Math.min(1, _local2));
_local3.lib[_local1].start(_local1, 99999);
_local3.lib[_local1].setVolume(_local2 * 100);
_local3.libMc[_local1].playing = 1;
}
};
snd.playEvent = function (id, volume) {
var _local2 = volume;
if (_local2 === undefined) {
_local2 = 1;
}
_local2 = Math.max(0, Math.min(1, _local2));
var _local1 = new Sound();
_local1.attachSound(id);
_local1.setVolume(_local2 * 100);
_local1.start();
};
snd.stop = function (id) {
this.lib[id].stop();
this.libMc[id].playing = 0;
};
snd.load("sndWater");
snd.load("sndIntake");
snd.load("sndThunder");
snd.load("sndScore");
snd.load("sndBonus");
snd.load("sndMalus");
snd.load("sndTicking");
snd.load("sndBell");
hook = new Object();
hook.init = function () {
var _local1 = this;
_local1.x = 0;
_local1.vy = 8;
_local1.maxY = 370;
_local1.minY = 60;
_local1.y = _local1.minY;
_local1.mc = _root.hookMc;
};
hook.redraw = function () {
var _local1 = this;
_local1.mc._x = _local1.x;
_local1.mc._y = _local1.y;
};
hook.move = function () {
var _local1 = this;
if (_root.mouseIsDown) {
_local1.y = _local1.y + (_local1.vy * _global.dt);
if (_local1.y > _local1.maxY) {
_local1.y = _local1.maxY;
_root.handlerMouseUp();
}
} else {
_local1.y = _local1.y - (_local1.vy * _global.dt);
}
if (_local1.y <= _local1.minY) {
_local1.y = _local1.minY;
_local1.clearFish = true;
} else {
_local1.clearFish = false;
}
};
boat = new Object();
boat.init = function () {
var _local1 = this;
_local1.mc = _root.boatMc;
_local1.vx = 7;
_local1.x = 275;
_local1.maxX = 560;
_local1.minX = 30;
_root.hook.init();
};
boat.move = function () {
var _local1 = this;
var _local2 = _root;
if ((Key.isDown(37) || (Key.isDown(39))) || (Key.isDown(32))) {
_local2.osd.gotoAndPlay("quickhelp");
}
if (Math.abs(_local1.x - _local2._xmouse) < _local1.vx) {
_local1.x = _local2._xmouse;
} else {
if (_local1.x < _local2._xmouse) {
_local1.x = _local1.x + (_local1.vx * _global.dt);
}
if (_local1.x > _local2._xmouse) {
_local1.x = _local1.x - (_local1.vx * _global.dt);
}
if (_local1.x > _local1.maxX) {
_local1.x = _local1.maxX;
}
if (_local1.x < _local1.minX) {
_local1.x = _local1.minX;
}
}
};
boat.redraw = function () {
var _local1 = this;
_local1.mc._x = _local1.x;
_local1.mc._y = _local1.y;
var _local3 = {x:_local1.mc.boatMc.rod._x, y:_local1.mc.boatMc.rod._y};
_local1.mc.boatMc.localToGlobal(_local3);
_root.hook.x = _local3.x;
_root.hook.redraw();
var _local2 = _root.threadMc;
_local2.clear();
_local2.lineStyle(1, 16777215, 100);
_local2.moveTo(_local3.x, _local3.y);
_local2.lineTo(hook.x, hook.y);
};
fish = new Object();
fish.protos = new Array();
fish.protos[0] = {vMax:5, vMin:2, score:2.1};
fish.protos[1] = {vMax:5, vMin:2, score:1.9};
fish.protos[2] = {vMax:5, vMin:2, score:1.5};
fish.protos[3] = {vMax:5, vMin:2, score:1.7};
fish.protos[4] = {vMax:5, vMin:2, score:2.3};
fish.protos[5] = {vMax:5, vMin:2, score:2.5, ground:1};
fish.protos[6] = {vMax:2.5, vMin:1, score:-2.5};
fish.protos[7] = {vMax:2, vMin:0.5, score:-2.5};
fish.typesAmount = fish.protos.length;
fish.borderX0 = -100;
fish.borderX1 = 650;
fish.init = function () {
var _local2 = this;
_local2.mc = _root.fishMc;
_local2.mc.clear();
for (var _local1 in _local2.mc) {
_local2.mc[_local1].removeMovieClip();
}
_local2.fishCount = 0;
_local2.bubbleCount = 0;
var amount = (5 + random(3));
var _local1 = 0;
while (_local1 < amount) {
_local2.create({freePos:1});
_local1++;
}
};
fish.create = function (params) {
var _local2 = this;
var id = random(_local2.typesAmount);
var _local3 = _local2.protos[id];
var _local1 = _local2.mc.attachMovie("fish" + id, "fish" + _local2.fishCount, _local2.fishCount);
_local1.proto = _local3;
_local1.proto.id = id;
_local1.onEnterFrame = _root.fishMover;
_local1.speed = ((Math.random() * (_local3.vMax - _local3.vMin)) + _local3.vMin) * ((Math.random() > 0.5) ? 1 : -1);
var scale = ((Math.random() * 50) + 50);
_local1._xscale = scale * ((_local1.speed > 0) ? -1 : 1);
_local1._yscale = scale;
if (_local3.score < 0) {
_local1._rotation = random(360);
} else {
_root.fishAmount++;
}
_local1.hookRotation = ((_local1.speed > 0) ? -10 : 10);
_local1.hookRotationSteps = 9;
_local2.fishCount++;
_local1._y = 130 + (Math.random() * 220);
if (_local3.ground) {
_local1._y = 370;
}
if (params.freePos) {
_local1._x = Math.random() * 550;
} else {
_local1._x = ((_local1.speed > 0) ? (_local2.borderX0) : (_local2.borderX1));
}
};
fishMover = function () {
var _local1 = this;
var _local2 = _root;
if (_local1.hooked) {
_local1._x = _local2.hook.x;
_local1._y = _local2.hook.y + 10;
if ((_local1.hookRotationSteps--) > 0) {
_local1._rotation = _local1._rotation + _local1.hookRotation;
}
if (_local2.hook.clearFish) {
_local2.score(int(_local1.proto.score * Math.abs(_local1._xscale)), _local1.proto.id);
if (_local1.proto.score > 0) {
_local2.fishAmount--;
}
_local1.removeMovieClip();
}
} else {
if ((_local1.proto.score > 0) && (Math.random() < 0.02)) {
var _local3 = _local2.bubblesMc.attachMovie("bubble", "bubble" + _local2.fish.bubbleCount, _local2.fish.bubbleCount);
_local3._x = _local1._x + (_local1.vx * 3);
_local3._y = _local1._y;
_local3.onEnterFrame = _local2.bubbleMover;
_local3._xscale = 50 + random(50);
_local3._yscale = _local3._xscale;
_local3.x = _local3._x;
_local3.actAge = 0;
_local2.fish.bubbleCount++;
}
_local1._x = _local1._x + _local1.speed;
if ((_local1._x > _local2.fish.borderX1) || (_local1._x < _local2.fish.borderX0)) {
_local1.removeMovieClip();
if (_local1.proto.score > 0) {
_local2.fishAmount--;
}
}
}
};
bubbleMover = function () {
var _local1 = this;
_local1.actAge = _local1.actAge + _global.dt;
_local1._y = _local1._y - (_local1._xscale / 30);
_local1._x = _local1.x + (((Math.sin((_local1.actAge * 10) / _local1._xscale) * 2) * _local1._xscale) / 50);
if (_local1._y < 100) {
_local1.removeMovieClip();
}
};
cloud = new Object();
cloud.init = function () {
var _local1 = this;
_local1.mc = _root.cloudMc;
_local1.x = _local1.mc._x;
_local1.y = _local1.mc._y;
_local1.randomizeTarget();
_local1.vx = 0;
_local1.ax = 0.2;
_local1.fx = 0.9;
_local1.power = 0;
};
cloud.randomizeTarget = function () {
this.tx = Math.random() * 550;
};
cloud.move = function () {
var _local1 = this;
var _local2 = _root;
if (_local1.tx > _local1.x) {
_local1.vx = _local1.vx + _local1.ax;
} else {
_local1.vx = _local1.vx - _local1.ax;
}
if (Math.abs(_local1.x - _local1.tx) < _local1.vx) {
_local1.randomizeTarget();
}
_local1.vx = _local1.vx * _local1.fx;
_local1.x = _local1.x + _local1.vx;
_local1.mc._x = _local1.x;
if (Math.abs(_local2.boat.x - _local1.x) < 35) {
_local1.power = Math.min(1, _local1.power + 0.05);
} else {
_local1.power = Math.max(-1, _local1.power - 0.05);
}
if (Math.random() < _local1.power) {
_local1.power = -1;
_local1.mc.gotoAndPlay("flash");
_local2.boat.mc.gotoAndPlay("flash");
_local2.snd.play("sndThunder", 0.7);
_local2.timer.alter(-10000);
}
};
score = function (points, id) {
var _local1 = _root;
var _local2 = points;
_local1.actScore = _local1.actScore + _local2;
_local1.actCatch = _local1.actCatch + _local2;
if (id ne "") {
_local1.actCatchHistory.push(id);
}
_local1.timer.alter(_local2 * 100);
_local1.actScoreDisplay = _local1.actScore;
};
init = function () {
var _local1 = this;
_local1.boat.init();
_local1.fish.init();
_local1.cloud.init();
_local1.showMenu();
_root.snd.playLoop("sndWater");
};
resetGame = function () {
trace("reset game");
_root.actScore = 0;
this.score(0);
this.timer.init(100);
};
showMenu = function () {
this.resetGame();
_root.osd.gotoAndStop("menu");
};
submitScore = function () {
_global.api.highscore.submit(_root.gameName, "", _root.actScore, 0);
};
startGame = function () {
var _local1 = this;
var _local2 = _root;
_local1.resetGame();
_local1.cleanUp();
_local1.boat.init();
_local2.osd.gotoAndStop("invisible");
_local1.actScore = 0;
_local2.actCatch = 0;
_local2.actCatchHistory = new Array();
_local1.timer.running = true;
_local1.onEnterFrame = stepMain;
_local1.onMouseDown = handlerMouseDown;
_local1.onMouseUp = handlerMouseUp;
};
stepMain = function () {
var _local1 = _root;
var _local2 = this;
_local2.cloud.move();
_local2.boat.move();
_local2.hook.move();
_local2.boat.redraw();
if ((!_local1.mouseIsDown) && (_local1.fishMc.hitTest(_local2.hook.x, _local2.hook.y + 10, true))) {
for (var i in _local1.fishMc) {
if ((_local1.fishMc[i].hitTest(_local2.hook.x, _local2.hook.y + 10, true) || (_local1.fishMc[i].hitTest(_local2.hook.x, _local2.hook.y + 8, true))) || (_local1.fishMc[i].hitTest(_local2.hook.x, _local2.hook.y + 6, true))) {
var _local3 = _local1.fishMc[i];
_local3.hooked = true;
}
}
}
if (int(_local1.actCatch) != 0) {
trace("? " + _local1.actCatchHistory.length);
var multicatch = (_local1.actCatchHistory.length > 1);
var i = 1;
while (i < _local1.actCatchHistory.length) {
if (_local1.actCatchHistory[i] != _local1.actCatchHistory[i - 1]) {
multicatch = 0;
break;
}
i++;
}
_local1.actCatchDisplay = _local1.actCatch;
if (_local1.actCatch > 0) {
if (multicatch) {
_local1.actMultiCatchDisplay = _local1.actCatchHistory.length;
_local1.catchDisplay.gotoAndPlay("multicatch");
_local1.actScore = _local1.actScore + (_local1.actCatch * (_local1.actCatchHistory.length - 1));
_local1.actScoreDisplay = _local1.actScore;
_local1.snd.play("sndBonus", 0.7);
} else {
_local1.catchDisplay.gotoAndPlay("goodcatch");
_local1.snd.play("sndScore", 0.4);
}
} else {
_local1.snd.play("sndMalus", 0.5);
}
if (_local1.actCatch < 0) {
_local1.catchDisplay.gotoAndPlay("badcatch");
}
_local1.actCatch = 0;
_local1.actCatchHistory = new Array();
_local1.catchDisplay._x = _local1.boatMc._x;
}
var resource = 0;
for (var i in _local1.fishMc) {
if (_local1.fishMc[i].proto.score > 0) {
resource++;
}
}
if ((Math.random() < 0.04) || (resource < 3)) {
_local2.fish.create();
}
};
timeOut = function () {
var _local1 = _root;
_local1.snd.stop("sndIntake");
_local1.snd.stop("sndTicking");
_local1.snd.play("sndBell", 1);
_local1.onEnterFrame = undefined;
_local1.osd.gotoAndPlay("gameover");
};
cleanUp = function () {
var _local2 = _root;
for (var _local3 in _local2.fishMc) {
var _local1 = _local2.fishMc[_local3];
if (_local1.hooked) {
_local1.removeMovieClip();
}
}
};
handlerMouseDown = function () {
var _local1 = _root;
if (_local1.onEnterFrame == _local1.stepMain) {
_local1.snd.playLoop("sndIntake", 0.3);
}
_local1.mouseIsDown = true;
};
handlerMouseUp = function () {
var _local1 = _root;
if (_local1.onEnterFrame == _local1.stepMain) {
_local1.snd.stop("sndIntake");
}
_local1.mouseIsDown = false;
};
startPhase = function (f) {
var _local1 = this;
f.init();
_local1.onEnterFrame = f;
_local1.phase = 0;
_local1.phaseDelay = 0;
};
stop();
init();
Symbol 8 MovieClip Frame 1
#initclip 1
_global.api = new Object();
_global.api.highscore = new Object();
_global.api.highscore.initSession = function () {
var _local1 = this;
_local1.session = "";
while (_local1.session.length < 20) {
_local1.session = _local1.session + _local1.charTable.charAt(Math.round(Math.random() * (_local1.charTable.length - 1)));
}
_local1.charTableIndex = new Array();
var _local2 = 0;
while (_local2 < _local1.charTable.length) {
_local1.charTableIndex[_local1.charTable.charCodeAt(_local2)] = _local2;
_local2++;
}
};
_global.api.highscore.submit = function (pGame, pDisciple, pScore0, pScore1) {
var _local2 = this;
var _local1 = ("g=" + pGame) + "&";
_local1 = _local1 + (("d=" + pDisciple) + "&");
_local1 = _local1 + (("s0=" + pScore0) + "&");
_local1 = _local1 + (("s1=" + pScore1) + "&");
_local1 = _local1 + ("se=" + escape(session));
_local1 = _local1 + "&c=42";
var _local3 = (_local2.urlSubmit + "?s=") + escape(_local2.encrypt(_local2.encrypt(_local1, _local2.keystring), _local2.keystring2));
getURL (_local3, "_blank");
};
_global.api.highscore.encrypt = function (text, pKey) {
var _local2 = this;
var crypt = "";
var checkSum = 0;
var shift;
var _local3;
var _local1 = 0;
while (_local1 < text.length) {
char = _local2.charTableIndex[text.charCodeAt(_local1)];
shift = _local2.charTableIndex[pKey.charCodeAt(_local1 % pKey.length)];
_local3 = (char + shift) + checkSum;
_local3 = _local3 % _local2.charTable.length;
crypt = crypt + _local2.charTable.charAt(_local3);
checkSum = checkSum + _local3;
_local1++;
}
checkSum = checkSum % _local2.charTable.length;
return((crypt + "") + _local2.charTable.charAt(checkSum));
};
_global.api.highscore.charTable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&=.";
_global.api.highscore.keystring = "whytheheckdoyouwasteyourtimehackingthishighscorelist";
_global.api.highscore.keystring2 = "AnotherKey4You2FindOut4815jiagIOm30JK";
_global.api.highscore.urlSubmit = "http://www.neodelight.com/v4/high_enter.php";
_global.api.highscore.initSession();
#endinitclip
_visible = false;
Symbol 69 MovieClip Frame 1
stop();
Symbol 73 Button
on (release) {
getURL ("http://www.happytree.com", "_blank");
}
Symbol 77 MovieClip Frame 1
_parent.stop();
Symbol 77 MovieClip Frame 123
stop();
_parent.play();
Symbol 103 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 20
gotoAndStop ("default");
Symbol 115 MovieClip Frame 1
stop();
Symbol 115 MovieClip Frame 20
gotoAndStop ("default");
Symbol 131 MovieClip Frame 2
stop();
Symbol 131 MovieClip Frame 8
play();
display = "+" + _root.actCatchDisplay;
Symbol 131 MovieClip Frame 20
gotoAndStop ("default");
Symbol 131 MovieClip Frame 21
play();
display = _root.actCatchDisplay;
Symbol 131 MovieClip Frame 33
gotoAndStop ("default");
Symbol 131 MovieClip Frame 34
play();
display = "+" + _root.actCatchDisplay;
display2 = "X" + _root.actMultiCatchDisplay;
Symbol 131 MovieClip Frame 59
gotoAndStop ("default");
Symbol 146 Button
on (release) {
_root.startGame();
}
Symbol 150 Button
on (release) {
getURL ("http://www.happytree.com/games/superfishing/superfishing.exe");
}
Symbol 153 Button
on (release) {
getURL ((((("http://www.happytree.nl/games/" + _root.gameName) + "/") + _root.gameName) + "score.php?site=") + _root.site, "_TOP");
}
Symbol 156 Button
on (release) {
if (_url.indexOf("http://www.happytree.nl") != -1) {
getURL ("http://www.happytree.nl", "_TOP");
} else {
getURL ("http://www.happytree.com", "_TOP");
}
}
Symbol 167 Button
on (release) {
_root.showMenu();
}
Symbol 171 Button
on (release) {
gotoAndStop ("submitScore");
}
Symbol 174 Button
on (release) {
_root.showMenu();
}
Symbol 175 Button
on (release) {
if ((this.username.length > 0) && (this.useremail.length > 0)) {
trace("blah!!");
this.nextFrame();
} else {
trace("baddate");
}
}
Symbol 182 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 2
pinacletop.removeMovieClip();
this.scorea = _root.actScore + "a";
scorelength = this.scorea.length;
scorelength--;
a = 0;
while (a < scorelength) {
this["scorenum" + a] = this.scorea.substr(a, 1);
if (this["scorenum" + a] == 0) {
this["scorenum" + a] = "z";
} else if (this["scorenum" + a] == 1) {
this["scorenum" + a] = 7;
} else if (this["scorenum" + a] == 2) {
this["scorenum" + a] = 3;
} else if (this["scorenum" + a] == 3) {
this["scorenum" + a] = "p";
} else if (this["scorenum" + a] == 4) {
this["scorenum" + a] = "j";
} else if (this["scorenum" + a] == 5) {
this["scorenum" + a] = 5;
} else if (this["scorenum" + a] == 6) {
this["scorenum" + a] = 1;
} else if (this["scorenum" + a] == 7) {
this["scorenum" + a] = "t";
} else if (this["scorenum" + a] == 8) {
this["scorenum" + a] = "k";
} else if (this["scorenum" + a] == 9) {
this["scorenum" + a] = 6;
}
a++;
}
this.scorecode = ("x" + random(9)) + random(9);
b = scorelength - 1;
while (b >= 0) {
this.scorecode = this.scorecode + this["scorenum" + b];
b--;
}
mynewscore = _root.actScore;
getURL ((((("http://www.happytree.nl/games/" + _root.gameName) + "/") + _root.gameName) + "score.php?site=") + _root.site, "_top", "POST");
Symbol 183 MovieClip Frame 1
display = "score: " + _root.actScore;
if (_root.actScore <= 0) {
stop();
}
Symbol 183 MovieClip Frame 2
stop();
Symbol 184 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 6
stop();
Symbol 184 MovieClip Frame 37
gotoAndStop ("invisible");
Symbol 184 MovieClip Frame 58
stop();
Symbol 197 Button
on (release) {
var s = new Sound();
s.setVolume(0);
_root.snd.active = 0;
nextFrame();
}
Symbol 201 Button
on (release) {
_root.snd.active = 1;
prevFrame();
}
Symbol 203 Button
on (release) {
var s = new Sound();
s.setVolume(100);
_root.snd.active = 1;
prevFrame();
}
Symbol 204 MovieClip Frame 1
stop();