Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("69adbf1d", this, 10301, true);
function startGame() {
score = 0;
life = 3;
level = 1;
starttemp = Math.max(10, Math.min(50, 100 - (level * 10)));
penguins = 3;
haveitems = 0;
gotoAndStop ("play");
}
function nextLevel() {
level++;
haveitems++;
starttemp = Math.max(10, Math.min(50, 100 - (level * 10)));
penguins = Math.min(maxpenguin, penguins + 2);
gotoAndStop ("play");
}
function submitScore() {
Framework.PostHighScore(_root.user_id, _root.score, 0);
}
Framework.game = "3017";
this.stop();
Stage.showMenu = false;
Stage.scaleMode = "noScale";
this.onEnterFrame = function () {
var _local3 = this.getBytesTotal();
var _local4 = this.getBytesLoaded();
var _local2 = _local4 / _local3;
this.progress_mc.bar._xscale = _local2 * 100;
if (_local2 >= 1) {
delete this.onEnterFrame;
this.gotoAndStop("main");
}
};
var gsound = new Sound();
icon_mc.gotoAndStop("on");
var score;
var life;
var level;
var penguins;
var haveitems;
var maxpenguin = 12;
var starttemp;
Frame 5
function init() {
msg_mc._visible = false;
for (var _local9 in this.holder_mc) {
removeMovieClip(this.holder_mc[_local9]);
}
__Objects = new Array();
tempo = starttemp;
haveegg = true;
updateScreen();
var _local5 = this.holder_mc;
var _local3 = _local5.attachMovie("penguin", "player", _local5.getNextHighestDepth());
_local3._x = (_local3._y = 240);
__Objects.push({target:_local3, y:_local3._y, type:"player"});
var _local4 = 0;
while (_local4 < penguins) {
_local3 = _local5.attachMovie("penguin", "penguin" + _local4, _local5.getNextHighestDepth());
var _local6 = random(4);
switch (_local6) {
case 0 :
_local3._x = random(480);
_local3._y = -50;
break;
case 1 :
_local3._y = random(480);
_local3._x = -50;
break;
case 2 :
_local3._x = random(480);
_local3._y = 530;
break;
case 3 :
_local3._y = random(480);
_local3._x = 530;
}
_local3.gotoAndStop(random(8) + 1);
_local3.ani.gotoAndStop("stop");
_local3.ani.egg._visible = false;
_local3.mark._visible = false;
__Objects.push({target:_local3, y:_local3._y, type:"enemy"});
_local4++;
}
if (haveitems > 1) {
if (haveitems >= 2) {
var _local7 = _local5.attachMovie("stone", "stone", _local5.getNextHighestDepth());
_local7._x = random(480);
_local7._y = random(480);
__Objects.push({target:_local7, y:_local7._y, type:"stone"});
}
if (haveitems > 4) {
var _local7 = _local5.attachMovie("ice hole", "icehole", _local5.getNextHighestDepth());
_local7._x = random(440) + 20;
_local7._y = random(440);
_local7.time = random(100) + 200;
_local7.onEnterFrame = function () {
if (!(this.fish instanceof MovieClip)) {
if (this.time > 0) {
this.time--;
} else {
var _local3 = this._parent.attachMovie("fish", "fish", this._parent.getNextHighestDepth());
_local3._x = this._x + 60;
_local3._y = this._y;
this.fish = _local3;
_root.__Objects.push({target:_local3, y:_local3._y, type:"fish"});
this.time = random(100) + 200;
}
}
};
__Objects.push({target:_local7, y:0, type:"icehole"});
}
}
this.onEnterFrame = function () {
this.update();
};
}
function update() {
var _local3 = 0;
while (_local3 < __Objects.length) {
var _local2 = __Objects[_local3];
switch (_local2.type) {
case "player" :
playerMove(_local2);
_local2.y = _local2.target._y;
break;
case "enemy" :
enemyMove(_local2);
_local2.y = _local2.target._y;
break;
case "egg" :
_local2.y = _local2.target._y;
}
_local3++;
}
updateScreen();
if (tempo >= 100) {
delete this.onEnterFrame;
score = score + (level * 100);
this.gotoAndStop("levelup");
return(undefined);
}
if (tempo <= 0) {
life--;
delete this.onEnterFrame;
if (life == 0) {
this.gotoAndStop("gameover");
} else {
msg_mc._visible = true;
}
return(undefined);
}
}
function updateScreen() {
life_mc.gotoAndStop(life);
score_txt.text = score;
tempo = Math.min(100, Math.max(0, tempo));
this.termo_mc.bar._yscale = tempo;
this.termo_mc.pointer._y = -tempo;
__Objects.sortOn("y", Array.NUMERIC);
var _local2 = 0;
while (_local2 < __Objects.length) {
var _local3 = __Objects[_local2];
_local3.target.swapDepths(_local2 + 100);
_local2++;
}
}
function playerMove(o) {
if (o.stop > 0) {
time--;
}
if (!haveegg) {
time = time - 2;
}
if (time < -10) {
time = 0;
tempo = tempo - 4;
} else if (time > 10) {
time = 0;
tempo = tempo + 2;
}
if (o.stop > 0) {
o.target.ani.gotoAndStop("stop");
if (o.b > 0) {
if ((o.b % 2) == 0) {
o.target._y = o.target._y - (10 * Math.cos(o.bdir * (Math.PI/180)));
o.target._x = o.target._x + (10 * Math.sin(o.bdir * (Math.PI/180)));
o.target._y = o.target._y - o.b;
} else {
o.target._y = o.target._y + o.b;
}
o.b--;
return(undefined);
}
o.stop--;
return(undefined);
}
var _local2 = o.target;
var _local9 = Math.min(480, Math.max(0, _local2._parent._xmouse));
var _local10 = Math.min(480, Math.max(0, _local2._parent._ymouse));
var _local5 = _local2._x - _local9;
var _local4 = _local2._y - _local10;
var _local8 = Math.min(100, Math.sqrt((_local5 * _local5) + (_local4 * _local4)));
var _local7 = _local8 / 10;
var _local3 = (-Math.atan2(_local5, _local4)) / (Math.PI/180);
o.dir = _local3;
var _local6 = -_local3;
if (_local6 < 0) {
_local6 = _local6 + 360;
}
var _local11 = Math.floor(_local6 / 45);
_local2.gotoAndStop(_local11 + 1);
_local2.ani.egg._visible = haveegg;
if (_local8 > 3) {
_local2.ani.gotoAndStop("walk");
_local2._y = _local2._y - (_local7 * Math.cos(_local3 * (Math.PI/180)));
_local2._x = _local2._x + (_local7 * Math.sin(_local3 * (Math.PI/180)));
_local2.o.y = _local2._y;
if (haveegg) {
time++;
}
co(o);
} else {
_local2.ani.gotoAndStop("stop");
time--;
}
}
function enemyMove(o) {
if (o.goto == undefined) {
o.target.ani.gotoAndStop("stop");
if (o.b > 0) {
if ((o.b % 2) == 0) {
o.target._y = o.target._y - (10 * Math.cos(o.bdir * (Math.PI/180)));
o.target._x = o.target._x + (10 * Math.sin(o.bdir * (Math.PI/180)));
o.target._y = o.target._y - o.b;
} else {
o.target._y = o.target._y + o.b;
}
o.b--;
return(undefined);
}
if (o.stop > 0) {
o.stop--;
} else {
o.stop = 0;
o.goto = new Object();
o.goto.x = random(580) - 50;
o.goto.y = random(580) - 50;
o.isMove = true;
}
} else {
var _local4 = o.target._x - o.goto.x;
var _local3 = o.target._y - o.goto.y;
var _local7 = Math.min(65, Math.sqrt((_local4 * _local4) + (_local3 * _local3)));
var _local6 = _local7 / 10;
var _local2 = (-Math.atan2(_local4, _local3)) / (Math.PI/180);
var _local5 = -_local2;
if (_local5 < 0) {
_local5 = _local5 + 360;
}
var _local9 = Math.floor(_local5 / 45);
o.target.gotoAndStop(_local9 + 1);
o.target.ani.egg._visible = false;
o.dir = _local2;
if (_local7 > 3) {
o.target.ani.gotoAndStop("walk");
var _local8 = 1 + ((level * level) / 40);
o.target._y = o.target._y - ((_local8 * _local6) * Math.cos(_local2 * (Math.PI/180)));
o.target._x = o.target._x + ((_local8 * _local6) * Math.sin(_local2 * (Math.PI/180)));
o.y = o.target._y;
} else {
delete o.goto;
o.isMove = false;
o.stop = random(100);
o.target.ani.gotoAndStop("stop");
}
co(o);
}
}
function co(target) {
var _local4 = 0;
while (_local4 < __Objects.length) {
var _local2 = __Objects[_local4];
if (target != _local2) {
var _local6 = target.target._x - _local2.target._x;
var _local5 = target.target._y - _local2.target._y;
if (Math.sqrt((_local6 * _local6) + (_local5 * _local5)) < 20) {
if (_local2.type == "fish") {
if (target.type == "player") {
playSound("getfish");
score = score + 10;
removeMovieClip(_local2.target);
__Objects.splice(_local4, 1);
}
} else if (_local2.type == "egg") {
if ((target.type == "player") && (_local2.target.speed <= 0)) {
playSound("getegg");
score = score + 10;
haveegg = true;
removeMovieClip(_local2.target);
__Objects.splice(_local4, 1);
}
} else {
if (target.type == "player") {
target.stop = random(20) + 20;
} else {
delete target.goto;
target.stop = random(50) + 20;
}
if (target.stop != 0) {
target.bdir = target.dir - 180;
target.b = 10;
}
if (target.type == "player") {
if (haveegg) {
var _local7 = random(10);
if (_local7 > 3) {
playSound("dropegg");
haveegg = false;
target.target.ani.egg._visible = false;
var _local3 = this.holder_mc.attachMovie("egg", "egg", this.holder_mc.getNextHighestDepth());
_local3._x = _local2.target._x;
_local3._y = _local2.target._y;
__Objects.push({target:_local3, y:_local3._y, type:"egg"});
_local3.dir = random(360);
_local3.speed = 10;
_local3.onEnterFrame = function () {
if (this.speed > 0) {
this._y = this._y - (this.speed * Math.cos(this.dir * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(this.dir * (Math.PI/180)));
this.speed--;
this._x = Math.min(480, Math.max(0, this._x));
this._y = Math.min(480, Math.max(0, this._y));
} else {
delete this.onEnterFrame;
}
};
}
}
}
}
}
}
_local4++;
}
}
function playSound(n) {
if (sfx[n] == undefined) {
sfx[n] = new Sound();
sfx[n].attachSound(n);
}
sfx[n].start();
}
var tempo;
var haveegg;
var time = 0;
var __Objects;
var sfx = new Object();
init();
Symbol 9 Button
on (press) {
if (gsound.getVolume() == 100) {
gsound.setVolume(0);
icon_mc.gotoAndStop("off");
} else {
gsound.setVolume(100);
icon_mc.gotoAndStop("on");
}
}
Symbol 189 MovieClip [__Packages.Framework] Frame 0
class Framework
{
static var game;
function Framework () {
}
static function hotlinking() {
var _local7 = _root._url;
var _local4 = arguments;
var _local5 = _local7.substr(_local7.indexOf("://") + 3);
var _local6 = _local5.indexOf("/", 1);
if (_local6 > 0) {
_local5 = _local5.substr(0, _local6);
}
var _local3 = 0;
while (_local3 < _local4.length) {
if ((_local4[_local3] == _local5) || (_local5.substr(_local5.length - _local4[_local3].length) == _local4[_local3])) {
return(undefined);
}
_local3++;
}
unloadMovieNum (0);
getURL ("http://www.marapets.com/game.php?id=" + game);
}
static function PostHighScore(user, score, startTime) {
var _local2 = getTimer() - startTime;
var _local1 = new LoadVars();
_local1.userid = user;
_local1.gameid = game;
_local1.gamescore = score;
_local1.playtime = _local2;
_local1.send("http://www.marapets.com/gameover.php", "_blank", "POST");
}
}
Symbol 27 Button
on (release) {
this._parent.startGame();
}
Symbol 28 MovieClip Frame 30
this.stop();
Symbol 46 Button
on (release) {
this.gotoAndStop("main");
}
Symbol 59 MovieClip Frame 10
this.stop();
Symbol 67 Button
on (release) {
this.nextLevel();
}
Symbol 147 MovieClip [fish] Frame 10
this.stop();
Symbol 168 Button
on (release) {
this._parent.init();
this._visible = false;
}
Symbol 177 MovieClip Frame 10
this.stop();
Symbol 188 Button
on (release) {
this.submitScore();
}