Frame 1
function onTimeout() {
if (!vc_lv.loaded) {
vc_lv.onLoad = null;
delete vc_lv;
play();
}
clearInterval(tOIntId);
delete tOIntId;
}
if (!kv_v) {
kv_v = {c:701, a:0, da:["distralytics.com", "distralytics.co.uk"]};
kv_v.i = 0;
while (kv_v.i < kv_v.da.length) {
if (dom.charAt(0) === ".") {
var dom = kv_v.da[kv_v.i];
dom.substr(1, dom.length - 1);
System.security.allowDomain(dom, "*." + dom);
} else {
System.security.allowDomain(kv_v.da[kv_v.i], (kv_v.c + ".c.") + kv_v.da[kv_v.i], "*." + kv_v.da[kv_v.i]);
}
kv_v.i++;
}
kv_v.lc = function () {
var _local2;
var _local1 = kv_v.da[kv_v.a % kv_v.da.length];
if (_local1.charAt(0) === ".") {
_local2 = ("http://" + _local1.substr(1, _local1.length - 1)) + kv_v.lurl;
} else {
_local2 = ((("http://" + kv_v.c) + ".c.") + _local1) + kv_v.lurl;
}
System.security.allowDomain(_local2);
kv_v.l_mcl.loadClip(_local2, kv_v.t_mc);
};
kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_v.lurl = "/control/tracking/tracker.swf?r=" + Math.floor(Math.random() * 10000);
kv_v.t_mc = createEmptyMovieClip("kv_tracker", -16734);
kv_v.l_mcl = new MovieClipLoader();
kv_v.mcl_l = {onLoadError:function () {
kv_v.a++;
kv_v.lc();
}, onLoadStart:function (m) {
System.security.allowDomain(m._url);
}};
kv_v.l_mcl.addListener(kv_v.mcl_l);
kv_v.lc();
}
_global.root = this;
var my_cm = new ContextMenu();
my_cm.hideBuiltInItems();
this.menu = my_cm;
_global.masterDomain = "media.tinymania.com";
_global.assetsURL = "http://media.tinymania.com/miikesnow/";
_global.isMaster = _root._url.indexOf(_global.masterDomain) >= 0;
_global.domain = ((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]));
_global.playerVersion = Number(getVersion().substr(getVersion().indexOf(" ") + 1).split(",")[0]);
_global.movieVersion = (_root.getSWFVersion ? (_root.getSWFVersion()) : 8);
_global.ori_dom = (_root.ori_dom ? (_root.ori_dom) : (domain));
System.security.allowDomain(_global.masterDomain);
var game_version = 1;
if (!testMode) {
stop();
if (playerVersion < 8) {
loadMovie (_global.assetsURL + "error.swf", _root);
} else if (isMaster) {
play();
} else {
var vc_lv = new LoadVars();
vc_lv.onLoad = function (success) {
clearInterval(tOIntId);
delete tOIntId;
if (success) {
if (Number(vc_lv.v) > game_version) {
loadMovie ((_global.assetsURL + "game.swf?ori_dom=") + ori_dom, _root);
} else {
play();
}
} else {
play();
}
delete vc_lv;
};
tOIntId = setInterval(onTimeout, 2000);
vc_lv.load("http://www.memecounter.com/comms/v.php?v=1&cId=701");
}
}
killerviral_btn.onMouseDown = function () {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
_root.kvClick(1227);
}
};
sponsor_btn.onMouseDown = function () {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
fadeOutMusicForURL();
_root.kvClick(1226);
}
};
Frame 3
function getSo() {
var _local1 = SharedObject.getLocal("tm_miikesnow", "/");
if (!_local1.data.highscores) {
_local1.data.highscores = defaultHighscores;
_local1.data.flush();
}
return(_local1);
}
function getHighscores() {
var _local2 = getSo();
var _local1 = [].concat(_local2.data.highscores);
_local1.sortOn(["score", "datetime", "name"], [Array.DESCENDING | Array.NUMERIC, Array.NUMERIC, Array.CASEINSENSITIVE]);
return(_local1);
}
function submitHighscore(name, score, other) {
var _local1 = getSo();
_local1.data.highscores.push({name:name, score:score, datetime:new Date(), other:other});
_local1.flush();
}
function goToStartPage() {
changePage("start");
}
function changePage(p) {
transition.nextPage = p;
transition.gotoAndPlay("in");
}
var defaultHighscores = [{name:"Miike Snow", score:23000, datetime:new Date(1205865112000)}, {name:"Pontus Winnberg", score:21000, datetime:new Date(1205864212000)}, {name:"Christian Karlsson", score:19000, datetime:new Date(1205864911000)}, {name:"Andrew Wyatt", score:17000, datetime:new Date(1205865112000)}, {name:"Jackalope", score:15000, datetime:new Date(1205865112000)}, {name:"Black And Blue", score:13000, datetime:new Date(1205865112000)}, {name:"Animal", score:11000, datetime:new Date(1205865112000)}, {name:"Burial", score:9000, datetime:new Date(1205865112000)}, {name:"A Horse", score:5000, datetime:new Date(1205865112000)}, {name:"Is Not A Home", score:1000, datetime:new Date(1205865112000)}];
startLevel = 1;
_global.changePage = changePage;
stop();
goToStartPage();
Frame 4
function highScoreEvent() {
_root.kvEvent(7076);
}
function gotoMiikeSnow() {
getURL ("http://www.myspace.com/miikesnow", "_blank");
fadeOutMusicForURL();
_root.kvClick(1223);
}
function gotoVideo() {
getURL ("http://www.youtube.com/watch?v=8oKQSAt4c4c", "_blank");
fadeOutMusicForURL();
_root.kvClick(1224);
}
function gotoTM() {
getURL ("http://www.tinymania.com", "_blank");
_root.kvClick(1225);
}
function fadeOutMusicForURL() {
_global.music.fadeTo(0, 3);
_global.root.onMouseDown = function () {
_global.music.fadeTo(100, 3);
delete this.onMouseDown;
};
}
if (!soundDone) {
_global.sndman = new SoundManager(_global.root);
_global.musicman = new SoundManager(_global.root.createEmptyMovieClip("music_mc", _global.root.getNextHighestDepth()));
_global.music = _global.musicman.newSound("music");
_global.music.volume = 0;
_global.music.loop();
_global.music.fadeTo(100, 2);
soundDone = true;
}
function goToGame() {
_global.root.changePage("game");
}
function getFacebookApp() {
}
stop();
Instance of Symbol 68 MovieClip "mute" in Frame 4
onClipEvent (load) {
if (new Sound().getVolume() == 0) {
gotoAndStop ("off");
}
this.onRelease = function () {
if (new Sound().getVolume() == 0) {
gotoAndStop ("on");
_global.isMuted = false;
new Sound().setVolume(100);
} else {
gotoAndStop ("off");
_global.isMuted = true;
new Sound().setVolume(0);
}
};
}
Frame 9
stop();
Frame 15
gotoAndStop ("game");
Symbol 8 MovieClip Frame 11
stop();
Symbol 11 MovieClip Frame 7
gotoAndPlay ("loop");
Symbol 14 MovieClip [cueBallChild] Frame 1
#initclip 1
Object.registerClass("cueBallChild", BallChildMC);
#endinitclip
stop();
Symbol 14 MovieClip [cueBallChild] Frame 3
stop();
Symbol 14 MovieClip [cueBallChild] Frame 7
stop();
Symbol 14 MovieClip [cueBallChild] Frame 38
stop();
_global.root.game.ballFallenDownHole();
Symbol 14 MovieClip [cueBallChild] Frame 52
stop();
_global.root.game.levelComplete();
Symbol 14 MovieClip [cueBallChild] Frame 65
stop();
Symbol 14 MovieClip [cueBallChild] Frame 248
stop();
Symbol 27 MovieClip Frame 64
stop();
Symbol 30 MovieClip Frame 11
gotoAndPlay (1);
Symbol 31 MovieClip Frame 1
function onEnterFrame() {
var _local2 = _root.getBytesLoaded() / _root.getBytesTotal();
footBall.gotoAndStop(Math.ceil(_local2 * footBall._totalframes));
if (_local2 == 1) {
delete onEnterFrame;
preloaderAnimDone();
}
}
function preloaderDone() {
_parent.play();
}
function waitForAnim() {
gotoAndStop ("wait");
}
function preloaderAnimDone() {
delete onEnterFrame;
gotoAndPlay ("out");
}
_parent.stop();
stop();
Symbol 31 MovieClip Frame 40
preloaderDone();
stop();
Symbol 35 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 2
play();
Symbol 35 MovieClip Frame 7
_parent.gotoAndStop(nextPage);
Symbol 35 MovieClip Frame 13
gotoAndStop (1);
Symbol 267 MovieClip [__Packages.BallChildMC] Frame 0
class BallChildMC extends MovieClip
{
function BallChildMC () {
super();
}
}
Symbol 268 MovieClip [__Packages.Snd] Frame 0
class Snd extends Sound
{
var target, manager, _volume, start, onSoundComplete, position, duration, onFadeComplete, fId, setPan;
function Snd (targ, sndman) {
super(targ);
target = (targ ? (targ) : _root);
manager = sndman;
_volume = super.getVolume();
}
function loop() {
start(0, 100000);
onSoundComplete = loop;
}
function switchSound(id, loops) {
var _local3 = position;
super.stop();
super.attachSound(id);
start((_local3 % duration) / 1000, loops);
}
function fade(dVol, tVol, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), tVol, true);
}
function fadeBy(dVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), dVol * t, true);
}
}
function fadeTo(tVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
var _local3 = (tVol - getVolume()) / t;
fId = setInterval(this, "changeVolTowards", FADE_RATE, _local3 * (FADE_RATE / 1000), tVol, true);
} else {
setVolume(tVol);
}
}
function changeVolTowards(dVol, tVol, fading) {
var _local2 = getVolume();
if (Math.abs(dVol) < Math.abs(tVol - _local2)) {
changeVolume(dVol);
} else {
setVolume(tVol);
if (fading) {
stopFade();
}
}
}
function stopFade() {
if (fId) {
clearInterval(fId);
delete fId;
onFadeComplete();
delete onFadeComplete;
}
}
function positionSound(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
d = ((d < 1) ? 1 : (d));
var _local4 = 1 / ((d / f) * 100);
setVolume(Math.ceil(_local4 * t));
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function positionSoundLinear(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
setVolume(((f - d) / f) * t);
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function setVolume(n) {
_volume = n;
super.setVolume(n);
}
function getVolume() {
return(_volume);
}
function changeVolume(n) {
setVolume(getVolume() + n);
}
function remove() {
super.stop();
delete onSoundComplete;
stopFade();
delete manager.sounds[target.getDepth()];
target.removeMovieClip();
delete target;
}
function toString() {
return(("(target=" + target) + ")");
}
function get volume() {
return(getVolume());
}
function set volume(n) {
setVolume(n);
//return(volume);
}
static var FADE_RATE = 100;
}
Symbol 269 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager extends Snd
{
var sounds, mc_holder, getVolume;
function SoundManager (hld_mc) {
super();
sounds = new Object();
mc_holder = (hld_mc ? (hld_mc) : _root);
}
function playAndRemove(snd_id, offset, loops) {
offset = (isNaN(offset) ? 0 : (offset));
loops = (isNaN(loops) ? 0 : (loops));
var _local2 = newSound(snd_id);
_local2.start(offset, loops);
_local2.onSoundComplete = _local2.remove;
return(_local2);
}
function playAndLoop(snd_id, offset) {
offset = (isNaN(offset) ? 0 : (offset));
var _local2 = newSound(snd_id);
_local2.start(offset, 999999);
_local2.onSoundComplete = _local2.loop;
return(_local2);
}
function clearAllSounds() {
for (var _local2 in sounds) {
sounds[_local2].remove();
}
}
function newSound() {
var _local5 = mc_holder.getNextHighestDepth();
var _local6 = mc_holder.createEmptyMovieClip("sh_mc" + _local5, _local5);
var _local4 = new Snd(_local6, this);
var _local3 = 0;
while (_local3 < arguments.length) {
if (arguments[_local3] != undefined) {
_local4.attachSound(arguments[_local3]);
}
_local3++;
}
sounds[_local5] = _local4;
return(_local4);
}
function deleteSound(snd) {
snd.remove();
}
function setVolume(vol) {
if (muted) {
curVol = vol;
} else {
super.setVolume(vol);
}
}
function get mute() {
return(muted);
}
function set mute(b) {
muted = b;
if (b) {
curVol = getVolume();
super.setVolume(0);
} else {
super.setVolume(curVol);
}
//return(mute);
}
var muted = false;
var curVol = 100;
}
Symbol 270 MovieClip [__Packages.BallMC] Frame 0
class BallMC extends MovieClip
{
function BallMC () {
super();
}
}
Symbol 271 MovieClip [__Packages.StarMC] Frame 0
class StarMC extends MovieClip
{
var xVel, yVel, _x, _y;
function StarMC () {
super();
xVel = (Math.random() - 0.5) * 3;
yVel = (Math.random() - 0.5) * 3;
}
function onEnterFrame() {
_x = _x + xVel;
_y = _y + yVel;
}
}
Symbol 272 MovieClip [__Packages.Engine] Frame 0
class Engine extends MovieClip
{
var tableAreaMarker, tableArea, chocolate, sex, _score, collectedPickups, rect, scrollRect, balls, ballHolder, ball, initBallPos, isGameOver, intro_mc, holes, pickups, bumpers, gravs, lines, walls, rabbitTargetX, ballStartMarker_mc, rabbitTargetY, rabbitYVel, onEnterFrame, onPress, retryLvl_mc, onMouseUp, onMouseMove, aimPullback, rabbitRunAtStart, gotoAndStop, transition_mc, carrots_txt, nextFn, messages, _xmouse, _ymouse, fireAngle, aimDot, elapsedTime, lastTime, frameTime, score_txt, background_mc, lives_mc, bgFlash, snowHolder, _lives;
function Engine () {
super();
announce("constructor", arguments);
tableAreaMarker._visible = false;
tableArea = new flash.geom.Rectangle(tableAreaMarker._x, tableAreaMarker._y, tableAreaMarker._width, tableAreaMarker._height);
chocolate = 1;
sex = 1;
_score = [];
_score[0] = 0;
setScore();
lives = (INIT_LIVES);
collectedPickups = {};
rect = new flash.geom.Rectangle(0, 0, Stage.width, Stage.height);
scrollRect = rect;
}
function announce(tr, arg) {
if (!arg) {
arg = "";
}
if (!disableAnnounce) {
}
}
function spawnBall(targetX, targetY, vx, vy) {
if (balls.length == 0) {
var _local3 = "cueBall";
} else {
var _local3 = "cueBallChild";
}
var _local2 = ballHolder.attachMovie(_local3, "ball_mc" + balls.length, ballHolder.getNextHighestDepth(), {_x:targetX, _y:targetY});
_local2.ball = (ball = new cust.geom2D.Ball(this, _local2, BALL_RADIUS, vx, vy, 1, BALL_BOUNCE_COEFFICIENT));
balls.push(_local2);
}
function initBalls() {
announce("initBalls", arguments);
var _local3 = 0;
while (_local3 < balls.length) {
balls[_local3].removeMovieClip();
_local3++;
}
balls = [];
spawnBall(initBallPos._x, initBallPos._y);
}
function startGame(lvl) {
announce("startGame", arguments);
lvlNum = lvl;
lives = (INIT_LIVES);
isGameOver = false;
initLvl();
}
function doInit() {
announce("doInit", arguments);
if (((lvlNum <= 2) || (lvlNum == 6)) || (lvlNum == 10)) {
intro_mc.gotoAndStop("lvl" + lvlNum);
} else {
intro_mc.gotoAndStop("hide");
}
balls = [];
resetLvl();
holes = [];
pickups = [];
bumpers = [];
gravs = [];
lines = [];
walls = [];
var _local6 = 2.8;
var _local5 = 450;
var _local3 = 477.4;
var _local7 = 0;
lines[lines.length] = new cust.geom2D.LineSegment(_local5, _local6, _local7, _local6);
lines[lines.length] = new cust.geom2D.LineSegment(_local5, _local3, _local5, _local6);
lines[lines.length] = new TheBottomLine(_local7, _local3, _local5, _local3);
lines[lines.length] = new cust.geom2D.LineSegment(_local7, _local6, _local7, _local3);
for (var _local4 in this) {
if (this[_local4] instanceof EndOfLevelPickup) {
holes.push(new HoleEnd(this, this[_local4]._x, this[_local4]._y));
} else if (this[_local4] instanceof HoleMC) {
holes.push(new Hole(this, this[_local4]._x, this[_local4]._y));
} else if (this[_local4] instanceof Pickup) {
pickups.push(this[_local4]);
this[_local4].init(this);
} else if (this[_local4] instanceof Bumper) {
bumpers.push(this[_local4].circle);
} else if (this[_local4] instanceof Gravity) {
gravs.push(this[_local4]);
} else if (this[_local4] instanceof WallMC) {
walls.push(this[_local4]);
this[_local4].init(this);
}
}
populateBeatArray();
rabbitTargetX = ballStartMarker_mc._x;
rabbitTargetY = ballStartMarker_mc._y;
updateHUD();
}
function populateBeatArray() {
beatArray = [];
for (var _local2 in this) {
if (this[_local2] instanceof ChocolatePickup) {
if (!this[_local2].isPickedUp) {
beatArray.push(this[_local2]);
}
}
}
}
function setupRabbitForJump() {
announce("setupRabbitForJump");
rabbitYVel = 0;
fadeBunnies();
onEnterFrame = preAimEnterFrame;
onPress = beginBallAim;
}
function resetLvl() {
announce("resetLvl", arguments);
delete onEnterFrame;
setupRabbitForJump();
retryLvl_mc.gotoAndStop("hide");
initBalls();
balls[0]._x = (balls[0].ball.x = initBallPos._x);
balls[0]._y = (balls[0].ball.y = initBallPos._y);
balls[0].ball.ballMovementLine = new cust.geom2D.LineSegment(initBallPos._x, initBallPos._y, initBallPos._x, initBallPos._y);
}
function primeRabbitForFiring() {
onMouseUp = launchBall;
onMouseMove = aimBall;
aimPullback._x = balls[0].ball.x;
aimPullback._y = balls[0].ball.y;
aimBall();
}
function resetCarrots() {
announce("resetCarrots");
totalCarrots = 0;
eatenCarrots = 0;
}
function addToBeatArray(t) {
t.beatIndex = beatArray.length;
beatArray.push(t);
}
function removeFromBeatArray(t) {
beatArray.splice(t.beatIndex, 1);
}
function initLvl() {
rabbitRunAtStart = true;
announce("------------------------------------------------------------------------");
announce("initLvl", arguments);
gotoAndStop("lvl" + lvlNum);
lives = (INIT_LIVES);
onEnterFrame = doInit;
levelCompleted = false;
transition_mc.curLvl.holder.removeMovieClip();
transition_mc.nextLvl.holder.removeMovieClip();
}
function addCarrot() {
totalCarrots++;
}
function eatenCarrot() {
eatenCarrots++;
updateHUD();
if (eatenCarrots == totalCarrots) {
levelCompleted = true;
}
}
function updateHUD() {
announce("updateHUD", arguments);
if (totalCarrots) {
carrots_txt.text = ("Carrots " + Math.floor((eatenCarrots / totalCarrots) * 100)) + "%";
} else {
carrots_txt.text = "Carrots 0%";
}
}
function checkIfLevelComplete() {
announce("checkIfLevelComplete", arguments);
levelCompleted = false;
levelCompleteTime = 0;
if (totalCarrots) {
if ((eatenCarrots / totalCarrots) >= 1) {
levelComplete();
} else {
delete onEnterFrame;
lives = ((lives-1));
if (lives == 0) {
} else {
nextFn = setupRabbitForJump;
onEnterFrame = dropRabbit;
}
}
}
}
function resetLvlAndHideMessage() {
resetLvl();
messages.gotoAndPlay("hide");
}
function restartLvlAndHideMessage() {
announce("restartLvlAndHideMessage", arguments);
restart();
messages.gotoAndPlay("hide");
}
function beginBallAim() {
announce("beginBallAnim", arguments);
delete onEnterFrame;
primeRabbitForFiring();
delete onPress;
}
function preAimEnterFrame() {
meanwhile();
var _local3 = (balls[0].ball.x = ((balls[0].ball.x * 5) + _xmouse) / 6);
if (_local3 > STAGE_WIDTH) {
_local3 = STAGE_WIDTH;
} else if (_local3 < 0) {
_local3 = 0;
}
var _local4 = _local3 - balls[0]._x;
var _local2 = balls[0];
if (_local4 != 0) {
if (_local4 < 0.5) {
_local2._xscale = 100;
} else if (_local4 > 0.5) {
_local2._xscale = -100;
}
}
if (_local2._xscale != oldXScale) {
_local2.gotoAndStop("turn");
turnCount = maxTurnCount;
} else if (turnCount) {
turnCount--;
_local2.gotoAndStop("turn");
} else if (Math.abs(_local4) > AIM_RUN_THRESHOLD) {
_local2.gotoAndStop("run");
} else {
_local2.gotoAndStop("idle");
}
oldXScale = _local2._xscale;
_local2._x = _local3;
}
function aimBall() {
var _local5 = _xmouse - balls[0].ball.x;
var _local4 = _ymouse - balls[0].ball.y;
var _local3 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
var _local2 = Math.atan2(_local4, _local5);
balls[0].gotoAndStop("readyToJump");
if (_local2 < -2.35619449019234) {
_local2 = -2.35619449019234;
} else if (_local2 > -0.785398163397448) {
_local2 = -0.785398163397448;
}
if ((_local2 < -1.55) || (_local2 > 1.55)) {
balls[0]._xscale = 100;
} else {
balls[0]._xscale = -100;
}
if (_local3 > MAX_PULLBACK_DIST) {
_local3 = MAX_PULLBACK_DIST;
}
fireAngle = _local2;
aimDot._x = balls[0].ball.x - (_local3 * Math.cos(_local2));
aimDot._y = balls[0].ball.y - (_local3 * Math.sin(_local2));
aimPullback._rotation = (_local2 * 57.2957795130823) - 90;
aimPullback.inner._height = _local3;
}
function launchBall() {
intro_mc.gotoAndStop("hide");
aimDot._x = 10000;
aimPullback._x = 10000;
delete balls[0].onPress;
delete onMouseMove;
delete onMouseUp;
var _local4 = _xmouse - balls[0].ball.x;
var _local3 = _ymouse - balls[0].ball.y;
var _local2 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local2 > MAX_PULLBACK_DIST) {
_local2 = MAX_PULLBACK_DIST;
} else if (_local2 < MIN_PULLBACK_DIST) {
_local2 = MIN_PULLBACK_DIST;
}
_local2 = (_local2 / MAX_PULLBACK_DIST) * MAX_FIRE_VELOCITY;
var _local5 = fireAngle;
balls[0].ball.v.x = (_local2 * Math.cos(_local5)) * BALL_INIT_SPEED_COEFFICIENT;
balls[0].ball.v.y = (_local2 * Math.sin(_local5)) * BALL_INIT_SPEED_COEFFICIENT;
balls[0].ball.rotVel = cust.geom2D.Ball.RABBIT_SPIN;
balls[0].gotoAndStop("jump");
rabbitRunAtStart = false;
elapsedTime = 0;
lastTime = getTimer();
onEnterFrame = gameLoop;
}
function meanwhile() {
wind = wind * 0.95;
}
function gameLoop() {
meanwhile();
var _local2 = getTimer();
frameTime = (_local2 - lastTime) / 1000;
elapsedTime = elapsedTime + (_local2 - lastTime);
lastTime = _local2;
moveBalls();
if (levelCompleted) {
balls[0].gotoAndStop("idle");
if ((levelCompleteTime++) > LEVEL_COMPLETE_WAIT) {
checkIfLevelComplete();
}
} else {
checkIfBallsAreStopped();
checkIfBallInBounds();
}
}
function checkIfBallInBounds() {
var _local2 = balls[0].ball;
if (!rect.containsPoint(_local2)) {
resetLvl();
}
}
function checkIfBallsAreStopped() {
announce("checkIfBallsAreStopped");
var _local3 = false;
var _local2 = 0;
while (_local2 < balls.length) {
if (!balls[_local2].ball.ballStopped) {
_local3 = true;
break;
}
_local2++;
}
if (!_local3) {
levelCompleted = true;
}
}
function moveBalls() {
var _local2 = 0;
while (_local2 < balls.length) {
balls[_local2].ball.move();
_local2++;
}
}
function restart() {
score = _score[lvlNum - 1];
announce("restart", arguments);
resetCarrots();
beatArray = [];
gotoAndStop("restart");
}
function levelComplete() {
announce("levelComplete", arguments);
delete onEnterFrame;
collectedPickups = {};
addPoints(LEVEL_COMPLETE_BONUS);
totalCarrots = 0;
totalEatenCarrots = eatenCarrots;
eatenCarrots = 0;
if (lvlNum >= NUM_LEVELS) {
gameComplete();
} else {
shrinkBunnies();
if ((lvlNum % VIDEO_FREQUENCY) == 0) {
setMessage(LEVEL_COMPLETE_VIDEO, Delegate.create(this, applyLevelCompleteBonus), Delegate.create(this, doNextLevelRabbitStuff));
} else {
setMessage(LEVEL_COMPLETE, Delegate.create(this, applyLevelCompleteBonus), Delegate.create(this, doNextLevelRabbitStuff));
}
}
}
function doNextLevelRabbitStuff() {
nextFn = nextLevel;
onEnterFrame = dropRabbit;
}
function applyLevelCompleteBonus() {
addPoints(LIVES_LEFT_BONUS * lives);
}
function displayLevelCompleteBonus(t) {
t.bonusFormula_txt.text = (LIVES_LEFT_BONUS + " x ") + lives;
t.scoreBonus_txt.text = "= " + (LIVES_LEFT_BONUS * lives);
}
function shrinkBunnies() {
var _local2 = 1;
while (_local2 < balls.length) {
if (!balls[_local2].ball.done) {
balls[_local2].ball.done = true;
balls[_local2].gotoAndPlay("out");
balls[_local2].play();
}
_local2++;
}
}
function fadeBunnies() {
var _local2 = 1;
while (_local2 < balls.length) {
if (!balls[_local2].ball.done) {
balls[_local2].ball.done = true;
balls[_local2].gotoAndPlay("out");
balls[_local2].play();
}
_local2++;
}
}
function nextLevel() {
announce("nextLevel", arguments);
var _local4 = [ballStartMarker_mc, messages, carrots_txt, score_txt, background_mc, lives_mc, balls[0], bgFlash, snowHolder];
var _local3;
_local3 = 0;
while (_local3 < _local4.length) {
_local4[_local3]._visible = false;
_local3++;
}
var _local5 = new flash.display.BitmapData(Stage.width, Stage.height, true, 0);
_local5.draw(this);
lvlNum++;
_local3 = 1;
while (_local3 < balls.length) {
balls[_local3].removeMovieClip();
_local3++;
}
beatArray = [];
gotoAndStop("blank");
_local3 = 0;
while (_local3 < _local4.length) {
_local4[_local3]._visible = false;
_local3++;
}
gotoAndStop("lvl" + lvlNum);
rabbitTargetX = ballStartMarker_mc._x;
rabbitTargetY = ballStartMarker_mc._y;
var _local6 = new flash.display.BitmapData(Stage.width, Stage.height, true, 0);
_local6.draw(this);
gotoAndStop("blank");
_local3 = 0;
while (_local3 < _local4.length) {
_local4[_local3]._visible = true;
_local3++;
}
transition_mc.curLvl.createEmptyMovieClip("holder", 0).attachBitmap(_local5, 0);
transition_mc.nextLvl.createEmptyMovieClip("holder", 0).attachBitmap(_local6, 0);
transition_mc.gotoAndPlay("startTransition");
_local3 = 0;
while (_local3 < _local4.length) {
_local4[_local3]._visible = true;
_local3++;
}
balls[0]._xscale = -100;
rabbitYVel = 0;
var _local7 = (BG_WIDTH - stageWidth) / (NUM_LEVELS - 1);
bgTarget = (-_local7) * (lvlNum - 1);
doRunRabbitToNextLevel();
}
function doRunRabbitToNextLevel() {
rabbitYVel = 0;
onEnterFrame = runRabbitToNextLevel;
}
function runRabbitToNextLevel() {
background_mc._x = ((background_mc._x * 10) + bgTarget) / 11;
wind = wind + (lastBGMCX - background_mc._x);
lastBGMCX = background_mc._x;
var _local3 = rabbitTargetY;
var _local2 = balls[0];
if (_local2._y == _local3) {
_local2.gotoAndStop("run");
_local2._x = ((_local2._x * 10) + rabbitTargetX) / 11;
if (Math.round(_local2._x / 20) == Math.round(rabbitTargetX / 20)) {
if (transitionDone) {
transitionDone = false;
restart();
delete onEnterFrame;
}
}
}
}
function dropRabbit() {
announce("dropRabbit");
var _local3 = rabbitTargetY;
var _local2 = balls[0];
_local2._rotation = _local2._rotation * 0.8;
var _local4 = 20 + ((_local2._y / _local3) * 80);
_local2._alpha = ((_local2._alpha * 3) + _local4) / 4;
if (_local2._y < _local3) {
rabbitYVel = rabbitYVel + GRAVITY;
_local2._y = _local2._y + rabbitYVel;
_local2.gotoAndStop("drop");
}
_local2.ball.x = _local2._x;
_local2.ball.y = _local2._y;
if (_local2._y >= _local3) {
_local2._y = _local3;
_local2._alpha = 100;
nextFn();
}
}
function ballFallingDownHole(hole, ball) {
delete onEnterFrame;
ball.mc._x = hole.x;
ball.mc._y = hole.y;
ball.mc.gotoAndPlay(BALL_FALL_DOWN_HOLE);
}
function ballFallingDownEndHole(hole, ball) {
delete onEnterFrame;
ball.mc._x = hole.x;
ball.mc._y = hole.y;
ball.mc.gotoAndPlay(BALL_FALL_DOWN_END_HOLE);
}
function ballFallenDownHole() {
delete onEnterFrame;
collectedPickups = {};
setLevelScore(lvlNum, 0);
if (lvlNum > 1) {
lvlNum--;
}
setLevelScore(lvlNum, 0);
lives = ((lives-1));
if (isGameOver) {
gameOver();
} else {
setMessage(FELL_DOWN_HOLE, Delegate.create(this, restart));
}
}
function retryButtonPressed() {
setLevelScore(lvlNum, 0);
applyPenalty();
}
function restartLevelManually() {
announce("restartLevelManually", arguments);
delete onEnterFrame;
gameOver();
}
function gameComplete() {
announce("gameComplete", arguments);
isGameOver = true;
setLevelScore(NUM_LEVELS + 1, REMAINING_LIVES_BONUS * lives);
_global.FB_score = score;
_global.FB_score_formatted = Format.number(score);
_global.root.score = score;
_global.root.chocolate = chocolate;
_global.root.sex = sex;
setMessage(GAME_COMPLETE);
onEndPage();
}
function gameOver() {
announce("gameOver", arguments);
isGameOver = true;
_global.FB_score = score;
_global.FB_score_formatted = Format.number(score);
_global.root.score = score;
_global.root.chocolate = chocolate;
_global.root.sex = sex;
setMessage(GAME_OVER);
onEndPage();
}
function onEndPage() {
messages.message.score_txt.text = Format.number(score);
messages.message.rating = sex / (sex + chocolate);
if (sex >= chocolate) {
messages.message.rating_txt.text = Math.round(100 * (sex / (sex + chocolate))) + "%";
messages.message.chocolateOrSex.gotoAndStop(SEX);
} else {
messages.message.rating_txt.text = Math.round(100 * (chocolate / (sex + chocolate))) + "%";
messages.message.chocolateOrSex.gotoAndStop(CHOCOLATE);
}
}
function setMessage(msg, onShown, onHiding) {
announce("setMessage", arguments);
messages.gotoAndPlay("show");
messages.message.gotoAndStop(msg);
messages.onShown = onShown;
if (onHiding) {
messages.onHiding = onHiding;
}
}
function scorePoints(n) {
addPoints(n);
}
function addPoints(n) {
setLevelScore(lvlNum, getLevelScore(lvlNum) + n);
setScore();
}
function setLevelScore(lvl, n) {
_score[lvl] = n;
setScore();
}
function getLevelScore(lvl) {
if (!isNaN(_score[lvl])) {
return(_score[lvl]);
}
return(0);
}
function setScore() {
score_txt.text = Format.number(score);
}
function get score() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < _score.length) {
if (!isNaN(Number(_score[_local2]))) {
_local3 = _local3 + Number(_score[_local2]);
}
_local2++;
}
return(_local3 - penaltyScore);
}
function applyPenalty() {
penaltyScore = penaltyScore + (score * 0.1);
setScore();
}
function get lives() {
return(_lives);
}
function set lives(l) {
_lives = l;
if (l <= 0) {
gameOver();
lives_mc.gotoAndStop("dead");
} else if (l > MAX_LIVES_DISPLAY) {
lives_mc.gotoAndStop(LIVES_MORE);
lives_mc.numLives_txt.text = l;
} else {
l = ((l > MAX_LIVES) ? (MAX_LIVES) : (l));
lives_mc.gotoAndStop(l);
}
//return(lives);
}
var oldXScale = 0;
var turnCount = 0;
var maxTurnCount = 1;
var wind = 0;
var lastBGMCX = 0;
var bgTarget = 0;
var penaltyScore = 0;
var lvlNum = 1;
var snowFlakeOffset = 0;
var transitionDone = false;
var stageWidth = 450;
var beatArray = [];
var disableAnnounce = true;
var totalCarrots = 0;
var eatenCarrots = 0;
var totalEatenCarrots = 0;
var levelCompleted = false;
var levelCompleteTime = 0;
static var BG_WIDTH = 675;
static var NUM_LEVELS = 15;
static var BALL_RADIUS = 11;
static var BALL_BOUNCE_COEFFICIENT = 0.75;
static var STAGE_WIDTH = 450;
static var AIM_RUN_THRESHOLD = 1;
static var MAX_FIRE_VELOCITY = 55;
static var MAX_PULLBACK_DIST = 120;
static var MIN_PULLBACK_DIST = 50;
static var BALL_INIT_SPEED_COEFFICIENT = 0.4;
static var BALL_FRICTION = 0.8;
static var BALL_FRICTION_BASE = 0.05;
static var BALL_FALL_DOWN_HOLE = "downHole";
static var BALL_FALL_DOWN_END_HOLE = "downEndHole";
static var BALL_STOPPED_SPEED = 5;
static var BALL_STOPPED_TIME = 30;
static var INIT_LIVES = 3;
static var MAX_LIVES = 5;
static var SEX = "sex";
static var CHOCOLATE = "chocolate";
static var LEVEL_COMPLETE_WAIT = 2;
static var GRAVITY = 0.4;
static var LIVES_LEFT_BONUS = 500;
static var LEVEL_COMPLETE_BONUS = 0;
static var PICKUP_POINTS = 200;
static var REMAINING_LIVES_BONUS = 500;
static var MAX_LIVES_DISPLAY = 5;
static var LIVES_MORE = "more";
static var VIDEO_FREQUENCY = 3;
static var LEVEL_COMPLETE = "lvlComplete";
static var LEVEL_COMPLETE_VIDEO = "lvlCompleteVideo";
static var BALL_STOPPED = "ballStopped";
static var RESTART_LVL_MANUALLY = "restartLvLManually";
static var FELL_DOWN_HOLE = "fellDownHole";
static var GAME_OVER = "gameOver";
static var GAME_COMPLETE = "gameComplete";
}
Symbol 273 MovieClip [__Packages.cust.geom2D.Vector] Frame 0
class cust.geom2D.Vector extends flash.geom.Point
{
var x, y;
function Vector (a, b) {
super();
x = a;
y = b;
}
function mark(mc, linestyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
mc.moveTo(x - 2, y - 2);
mc.lineTo(x + 2, y + 2);
mc.moveTo(x + 2, y - 2);
mc.lineTo(x - 2, y + 2);
}
function reflect(n) {
n.__set__length(1);
return(subtract(n.multiply(2 * dot(n))));
}
function angleBetweenVector(p) {
return(Math.acos(dot(p) / (length * p.__get__length())));
}
function angleBetweenVector2(p) {
var _local2 = Math.acos(dot(p) / (length * p.__get__length()));
var _local4 = (((p.__get__angle() - angle) + 9.42477796076938) % (Math.PI*2)) - Math.PI;
if (_local4 < 0) {
_local2 = _local2 * -1;
}
return(_local2);
}
function dot(v) {
return((x * v.x) + (y * v.y));
}
function multiply(m) {
return(new cust.geom2D.Vector(x * m, y * m));
}
function subtract(p) {
return(new cust.geom2D.Vector(x - p.x, y - p.y));
}
function toString() {
return(((("{ x:" + x) + ", y:") + y) + " }");
}
function get normal() {
var _local2 = angle;
return(new cust.geom2D.Vector(Math.cos(_local2), Math.sin(_local2)));
}
function get length() {
return(Math.sqrt((x * x) + (y * y)));
}
function set length(l) {
var _local2 = Math.atan2(y, x);
x = l * Math.cos(_local2);
y = l * Math.sin(_local2);
//return(length);
}
function get angle() {
return(Math.atan2(y, x));
}
function set angle(a) {
var _local2 = length;
x = _local2 * Math.cos(a);
y = _local2 * Math.sin(a);
//return(angle);
}
static function angleBetween(v1, v2) {
return(Math.atan2(v2.y - v1.y, v2.x - v1.x));
}
static function interpolate(p1, p2, f) {
return(new cust.geom2D.Vector(p1.x + (Math.abs(p1.x - p2.x) * f), p1.y + (Math.abs(p1.y - p2.y) * f)));
}
static function polar(l, a) {
return(new cust.geom2D.Vector(l * Math.cos(a), l * Math.sin(a)));
}
}
Symbol 274 MovieClip [__Packages.cust.geom2D.Circle] Frame 0
class cust.geom2D.Circle extends cust.geom2D.Vector
{
var x, y, subtract;
function Circle (ix, iy, ir) {
super();
x = ix;
y = iy;
r = ir;
}
function LineIntersection(l) {
var _local3 = new Array();
var _local2 = l.__get__start();
var _local4 = l.__get__end();
var _local9 = ((_local4.x - _local2.x) * (_local4.x - _local2.x)) + ((_local4.y - _local2.y) * (_local4.y - _local2.y));
var _local7 = 2 * (((_local4.x - _local2.x) * (_local2.x - x)) + ((_local4.y - _local2.y) * (_local2.y - y)));
var _local11 = (((((x * x) + (y * y)) + (_local2.x * _local2.x)) + (_local2.y * _local2.y)) - (2 * ((x * _local2.x) + (y * _local2.y)))) - (r * r);
var _local8 = (_local7 * _local7) - ((4 * _local9) * _local11);
if (_local8 < 0) {
_local3.type = "outside";
} else if (_local8 == 0) {
_local3.type = "tangent";
} else {
var _local10 = Math.sqrt(_local8);
var _local6 = ((-_local7) + _local10) / (2 * _local9);
var _local5 = ((-_local7) - _local10) / (2 * _local9);
if (((_local6 < 0) || (_local6 > 1)) && ((_local5 < 0) || (_local5 > 1))) {
if (((_local6 < 0) && (_local5 < 0)) || ((_local6 > 1) && (_local5 > 1))) {
_local3.type = "outside";
} else {
_local3.type = "inside";
}
} else {
_local3.type = "intersection";
if ((0 <= _local6) && (_local6 <= 1)) {
_local3[_local3.length] = cust.geom2D.Vector.interpolate(_local2, _local4, _local6);
}
if ((0 <= _local5) && (_local5 <= 1)) {
_local3[_local3.length] = cust.geom2D.Vector.interpolate(_local2, _local4, _local5);
}
}
}
return(_local3);
}
function isLineIntersecting(l) {
var _local3 = l.__get__start();
var _local4 = l.vector();
var _local8 = new cust.geom2D.Vector(x - _local3.x, y - _local3.y);
var _local2 = _local8.dot(_local4) / _local4.dot(_local4);
if (_local2 < 0) {
_local2 = 0;
}
if (_local2 > 1) {
_local2 = 1;
}
var _local6 = _local4.multiply(_local2);
var _local7 = new cust.geom2D.Vector(_local3.x + _local6.x, _local3.y + _local6.y);
var _local5 = subtract(_local7);
var _local9 = _local5.dot(_local5);
return(_local9 <= (r * r));
}
function xAtY(yp) {
yp = yp - y;
if ((yp <= r) && (yp >= (-r))) {
return(x + (r * Math.sin(Math.acos(y / r))));
}
return(false);
}
function isIntersecting(c) {
var _local2 = c.x - x;
var _local3 = c.y - y;
return((r + c.r) >= Math.sqrt((_local2 * _local2) + (_local3 * _local3)));
}
function pointsOfIntersection(c) {
var _local4 = c.x - x;
var _local5 = c.y - y;
var _local2 = Math.sqrt((_local4 * _local4) + (_local5 * _local5));
if (_local2 > (r + c.r)) {
return(false);
}
var _local3 = (((_local2 * _local2) + (r * r)) - (c.r * c.r)) / (2 * _local2);
return([new cust.geom2D.Vector((x + ((_local4 * _local3) / _local2)) + ((_local5 / _local2) * Math.sqrt((r * r) - (_local3 * _local3))), (y + ((_local5 * _local3) / _local2)) - ((_local4 / _local2) * Math.sqrt((r * r) - (_local3 * _local3)))), new cust.geom2D.Vector((x + ((_local4 * _local3) / _local2)) - ((_local5 / _local2) * Math.sqrt((r * r) - (_local3 * _local3))), (y + ((_local5 * _local3) / _local2)) + ((_local4 / _local2) * Math.sqrt((r * r) - (_local3 * _local3))))]);
}
function mark(mc, linestyle, fillstyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
if (fillstyle) {
mc.beginFill((fillstyle.rgb ? (fillstyle.rgb) : 0), ((fillstyle.alpha != undefined) ? (fillstyle.alpha) : 100));
}
mc.moveTo(x + r, y);
mc.curveTo(r + x, (0.414213562373095 * r) + y, (0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((0.414213562373095 * r) + x, r + y, x, r + y);
mc.curveTo((-0.414213562373095 * r) + x, r + y, (-0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((-r) + x, (0.414213562373095 * r) + y, (-r) + x, y);
mc.curveTo((-r) + x, (-0.414213562373095 * r) + y, (-0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo((-0.414213562373095 * r) + x, (-r) + y, x, (-r) + y);
mc.curveTo((0.414213562373095 * r) + x, (-r) + y, (0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo(r + x, (-0.414213562373095 * r) + y, r + x, y);
if (fillstyle) {
mc.endFill();
}
}
function toString() {
return(((((("(x=" + x) + ", y=") + y) + ", r=") + r) + ")");
}
var r = 0;
}
Symbol 275 MovieClip [__Packages.cust.geom2D.LineSegment] Frame 0
class cust.geom2D.LineSegment
{
var x1, y1, x2, y2;
function LineSegment (ix1, iy1, ix2, iy2) {
x1 = ix1;
y1 = iy1;
x2 = ix2;
y2 = iy2;
}
function vector() {
return(new cust.geom2D.Vector(x2 - x1, y2 - y1));
}
function isPointOnLine(p) {
var _local3 = false;
var _local4 = m;
if (Math.abs(_local4) <= 0.0001) {
if (Math.abs(p.y - y1) <= 0.0001) {
_local3 = true;
}
} else {
_local3 = p.y == ((_local4 * p.x) + c);
}
if (_local3) {
if (x1 >= x2) {
var _local8 = x1 - MARGIN;
var _local6 = x2 + MARGIN;
} else {
var _local8 = x2 - MARGIN;
var _local6 = x1 + MARGIN;
}
if (y1 >= y2) {
var _local7 = y1 + MARGIN;
var _local5 = y2 - MARGIN;
} else {
var _local7 = y2 + MARGIN;
var _local5 = y1 - MARGIN;
}
if (p.x >= _local6) {
if (p.x <= _local8) {
if (p.y >= _local5) {
if (p.y <= _local7) {
return(true);
}
}
}
}
}
return(false);
}
function isIntersectingRectangle(r) {
return(false);
}
function interpolate(f) {
f = (isNaN(f) ? 0.5 : (((f > 1) ? 1 : (((f < 0) ? 0 : (f))))));
return(new cust.geom2D.Vector(x1 + ((x2 - x1) * f), y1 + ((y2 - y1) * f)));
}
function offset(x, y) {
x1 = x1 + x;
x2 = x2 + x;
y1 = y1 + y;
y2 = y2 + y;
}
function offsetPoint(p) {
x1 = x1 + p.x;
x2 = x2 + p.x;
y1 = y1 + p.y;
y2 = y2 + p.y;
}
function isIntersecting(l) {
var _local4 = l.x1;
var _local6 = l.y1;
var _local11 = l.x2;
var _local10 = l.y2;
var _local2 = 0;
var _local3 = 0;
var _local7 = x2 - x1;
var _local5 = _local11 - _local4;
if (!_local7) {
if (!_local5) {
return(false);
}
_local2 = x1;
_local3 = _local6 + (((_local10 - _local6) * (x1 - _local4)) / _local5);
} else if (!_local5) {
_local2 = _local4;
_local3 = y1 + (((y2 - y1) * (_local4 - x1)) / _local7);
} else {
var _local9 = (y2 - y1) / _local7;
var _local8 = (_local10 - _local6) / _local5;
if (_local9 == _local8) {
return(false);
}
var _local14 = y1 - (_local9 * x1);
var _local13 = _local6 - (_local8 * _local4);
var _local12 = _local8 - _local9;
_local2 = (_local14 - _local13) / _local12;
_local3 = ((_local8 * _local14) - (_local9 * _local13)) / _local12;
}
if (_local7 > 0) {
if ((_local2 < x1) || (_local2 > x2)) {
return(false);
}
} else if (_local7 < 0) {
if ((_local2 > x1) || (_local2 < x2)) {
return(false);
}
} else if (((_local3 < y1) && (_local3 < y2)) || ((_local3 > y1) && (_local3 > y2))) {
return(false);
}
if (_local5 > 0) {
if ((_local2 < _local4) || (_local2 > _local11)) {
return(false);
}
} else if (_local5 < 0) {
if ((_local2 > _local4) || (_local2 < _local11)) {
return(false);
}
} else if (((_local3 < _local6) && (_local3 < _local10)) || ((_local3 > _local6) && (_local3 > _local10))) {
return(false);
}
return(true);
}
function isPointRightOf(p) {
var _local6 = p.x - x1;
var _local4 = p.y - y1;
var _local5 = x2 - p.x;
var _local3 = y2 - p.y;
return((_local6 * _local3) < (_local4 * _local5));
}
function clone() {
return(new cust.geom2D.LineSegment(x1, y1, x2, y2));
}
function closestPoint(p) {
if ((x1 == x2) && (y1 == y2)) {
return(new flash.geom.Point(x1, y1));
}
var _local7 = ((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2));
var _local6 = (((p.x - x1) * (x2 - x1)) + ((p.y - y1) * (y2 - y1))) / _local7;
var _local3 = x1 + (_local6 * (x2 - x1));
var _local2 = y1 + (_local6 * (y2 - y1));
var _local4 = Math.max;
var _local5 = Math.min;
_local3 = _local4(_local3, _local5(x1, x2));
_local3 = _local5(_local3, _local4(x1, x2));
_local2 = _local4(_local2, _local5(y1, y2));
_local2 = _local5(_local2, _local4(y1, y2));
return(new flash.geom.Point(_local3, _local2));
}
function extendStart(n) {
var _local2 = radians;
x1 = x1 - (n * Math.cos(_local2));
y1 = y1 - (n * Math.sin(_local2));
}
function extendEnd(l) {
var _local2 = radians;
x2 = x2 + (l * Math.cos(_local2));
y2 = y2 + (l * Math.sin(_local2));
}
function pointOfIntersection(l, full) {
var _local5 = x1;
var _local11 = x2;
var _local6 = l.x1;
var _local12 = l.x2;
var _local4 = y1;
var _local8 = y2;
var _local7 = l.y1;
var _local9 = l.y2;
var _local2 = 0;
var _local3 = 0;
var _local13 = _local11 - _local5;
var _local10 = _local12 - _local6;
var _local17 = _local8 - _local4;
var _local21 = _local9 - _local7;
if (!_local13) {
if (!_local10) {
return(false);
}
_local2 = _local5;
_local3 = _local7 + (((_local9 - _local7) * (_local5 - _local6)) / _local10);
} else if (!_local10) {
_local2 = _local6;
_local3 = _local4 + (((_local8 - _local4) * (_local6 - _local5)) / _local13);
} else {
var _local15 = (_local8 - _local4) / _local13;
var _local14 = (_local9 - _local7) / _local10;
if (_local15 == _local14) {
return(false);
}
var _local19 = _local4 - (_local15 * _local5);
var _local18 = _local7 - (_local14 * _local6);
var _local16 = _local14 - _local15;
_local2 = (_local19 - _local18) / _local16;
_local3 = ((_local14 * _local19) - (_local15 * _local18)) / _local16;
}
if (!full) {
if (_local13 > 0) {
_local5 = _local5 - MARGIN;
_local11 = _local11 + MARGIN;
if ((_local2 < _local5) || (_local2 > _local11)) {
return(false);
}
} else if (_local13 < 0) {
_local5 = _local5 + MARGIN;
_local11 = _local11 - MARGIN;
if ((_local2 < _local11) || (_local2 > _local5)) {
return(false);
}
}
if (_local17 > 0) {
if ((_local3 < _local4) || (_local3 > _local8)) {
return(false);
}
} else if (_local17 < 0) {
_local4 = _local4 - MARGIN;
_local8 = _local8 + MARGIN;
if ((_local3 < _local8) || (_local3 > _local4)) {
return(false);
}
} else {
_local4 = _local4 + MARGIN;
_local8 = _local8 - MARGIN;
if ((_local4 != _local4) || (_local5 != _local5)) {
return(false);
}
}
if (_local10 > 0) {
_local6 = _local6 - MARGIN;
_local12 = _local12 + MARGIN;
if ((_local2 < _local6) || (_local2 > _local12)) {
return(false);
}
} else if (_local10 < 0) {
_local6 = _local6 + MARGIN;
_local12 = _local12 - MARGIN;
if ((_local2 < _local12) || (_local2 > _local6)) {
return(false);
}
}
if (_local21 > 0) {
_local7 = _local7 - MARGIN;
_local9 = _local9 + MARGIN;
if ((_local3 < _local7) || (_local3 > _local9)) {
return(false);
}
} else if (_local21 < 0) {
_local7 = _local7 + MARGIN;
_local9 = _local9 - MARGIN;
if ((_local3 < _local9) || (_local3 > _local7)) {
return(false);
}
}
}
return(new cust.geom2D.Vector(_local2, _local3));
}
function mark(mc, linestyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
mc.moveTo(x1, y1);
mc.lineTo(x2, y2);
}
function toString() {
return((start.toString() + ", ") + end.toString());
}
function get c() {
return(y1 - (m * x1));
}
function get m() {
return((y2 - y1) / (x2 - x1));
}
function get length() {
return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
}
function set length(l) {
var _local2 = radians;
x2 = x1 + (l * Math.cos(_local2));
y2 = y1 + (l * Math.sin(_local2));
//return(length);
}
function get radians() {
return(Math.atan2(y2 - y1, x2 - x1));
}
function set radians(r) {
var _local2 = length;
x2 = x1 + (_local2 * Math.cos(r));
y2 = y1 + (_local2 * Math.sin(r));
//return(radians);
}
function get degrees() {
return(Math.atan2(y2 - y1, x2 - x1) * rd);
}
function set degrees(d) {
var _local2 = length;
x2 = x1 + (_local2 * Math.cos(d * dr));
y2 = y1 + (_local2 * Math.sin(d * dr));
//return(degrees);
}
function get isVertical() {
return(x1 == x2);
}
function get isHorizontal() {
return(y1 == y2);
}
function get start() {
return(new cust.geom2D.Vector(x1, y1));
}
function set start(p) {
x1 = p.x;
y1 = p.y;
//return(start);
}
function get end() {
return(new cust.geom2D.Vector(x2, y2));
}
function set end(p) {
x2 = p.x;
y2 = p.y;
//return(end);
}
static function fromPolar(m, a, p) {
if (p) {
var _local1 = p.x;
var _local2 = p.y;
} else {
var _local1 = 0;
var _local2 = 0;
}
return(new cust.geom2D.LineSegment(_local1, _local2, _local1 + (m * Math.cos(a)), _local2 + (m * Math.sin(a))));
}
static function fromPoints(p1, p2) {
if (p2) {
return(new cust.geom2D.LineSegment(p1.x, p1.y, p2.x, p2.y));
}
return(new cust.geom2D.LineSegment(0, 0, p1.x, p1.y));
}
static var rd = 57.2957795130823;
static var dr = (Math.PI/180);
static var MARGIN = 0.01;
}
Symbol 276 MovieClip [__Packages.cust.geom2D.Ball] Frame 0
class cust.geom2D.Ball extends cust.geom2D.Circle
{
var mc, x, y, r, speeds, engine, v, ballMovementLine;
function Ball (pEngine, iMc, ir, vx, vy, m, b) {
super();
mc = iMc;
x = iMc._x;
y = iMc._y;
r = (isNaN(ir) ? 0 : (ir));
speeds = [];
mass = (isNaN(m) ? 1 : (m));
bounce = (isNaN(b) ? 1 : (b));
engine = pEngine;
v = new cust.geom2D.Vector(vx, vy);
v.x = (isNaN(vx) ? 0 : (vx));
v.y = (isNaN(vy) ? 0 : (vy));
ballMovementLine = new cust.geom2D.LineSegment(x, y, x, y);
}
function spawnTrail() {
var _local2 = engine.attachMovie("star", "star" + engine.getNextHighestDepth(), engine.getNextHighestDepth());
_local2._x = x + ((Math.random() - 0.5) * 15);
_local2._y = y + ((Math.random() - 0.5) * 15);
}
function generateTrail() {
if (mc == engine.balls[0]) {
spawnTrail();
spawnTrail();
}
spawnTrail();
}
function move() {
if (disableMovement) {
return(undefined);
}
if (wobbleY >= 0) {
wobbleYMod = wobbleYMod * -1;
wobbleY--;
mc._yscale = 100 - wobbleY;
}
ballMovementLine.x1 = x;
ballMovementLine.y1 = y;
var _local10 = [].concat(engine.bumpers);
var _local2 = 0;
while (_local2 < engine.pickups.length) {
if (!engine.pickups[_local2].isPickedUp) {
_local10.push(engine.pickups[_local2].circle);
}
_local2++;
}
var _local8 = collisionDetection(_local10);
if (_local8) {
if (_local8.pickup) {
_local8.pickup.pickedUp(this);
} else if (_local8.bumper) {
_local8.bumper.hit();
}
if (_local8.pickup.solid || (_local8.bumper)) {
collisionResponse(_local8);
}
if (_local8.pickup.vertBoost) {
v.y = v.y + _local8.pickup.vertBoost;
}
} else {
x = x + v.x;
y = y + ((v.y = v.y + Engine.GRAVITY));
}
ballMovementLine.x2 = x;
ballMovementLine.y2 = y;
var _local3;
var _local4;
var _local6;
var _local9;
var _local7 = Number.MAX_VALUE;
var _local12;
_local2 = 0;
while (_local2 < engine.holes.length) {
_local3 = engine.holes[_local2];
_local6 = ballMovementLine.closestPoint(_local3);
_local4 = flash.geom.Point.distance(_local3, _local6);
if (_local4 < _local7) {
_local7 = _local4;
_local9 = _local3;
_local12 = _local6;
}
_local2++;
}
if (_local7 < _local9.ir) {
_local9.fallenDown(this);
} else {
if (_local7 < _local9.r) {
var _local14 = _local9.getForce(_local12);
v.x = v.x + (_local14.x * engine.frameTime);
v.y = v.y + (_local14.y * engine.frameTime);
}
collisonDetectWithLines(1);
var _local13 = 0;
if (v.x != 0) {
if (v.x < 0) {
mc._xscale = 100;
_local13 = -1;
} else {
mc._xscale = -100;
_local13 = 1;
}
}
if (rotVel) {
generateTrail();
mc._rotation = mc._rotation + (rotVel * _local13);
rotVel = rotVel - rabbitSpinSlow;
if ((mc._rotation > (-rotVelMin)) || (mc._rotation < rotVelMin)) {
}
} else {
mc._rotation = mc._rotation * 0.9;
}
mc._x = x;
mc._y = y;
v.length = v.length - Math.min(v.__get__length(), Engine.BALL_FRICTION_BASE);
var _local5;
_local2 = 0;
while (_local2 < engine.gravs.length) {
_local5 = engine.gravs[_local2].getForce(this);
v.x = v.x + _local5.x;
v.y = v.y + _local5.y;
_local2++;
}
speeds.push(v.__get__length());
if (speeds.length > Engine.BALL_STOPPED_TIME) {
speeds.shift();
}
var _local11 = 0;
_local2 = speeds.length - 1;
while (_local2 >= 0) {
_local11 = _local11 + speeds[_local2];
_local2--;
}
if (_local11 < Engine.BALL_STOPPED_SPEED) {
ballStopped = true;
} else {
ballStopped = false;
}
}
}
function collisonDetectWithLines(d) {
var _local3;
var _local5;
var _local9 = ballMovementLine.__get__start();
var _local7 = ballMovementLine.__get__end();
var _local10;
var _local11;
var _local8 = Number.MAX_VALUE;
var _local6;
var _local4 = 0;
while (_local4 < engine.lines.length) {
_local3 = engine.lines[_local4];
if (_local3.isPointRightOf(_local7) || (_local3.isPointOnLine(_local7))) {
_local5 = _local3.pointOfIntersection(ballMovementLine);
if (_local5) {
if (!_local3.isPointRightOf(_local9)) {
_local6 = flash.geom.Point.distance(_local9, _local5);
if (_local6 < _local8) {
_local8 = _local6;
_local11 = _local5;
_local10 = _local3;
}
}
}
}
_local4++;
}
if (_local11) {
var _local14 = 0;
var _local13 = 0;
if (_local10.__get__isVertical()) {
v.x = v.x * (-bounce);
wobbleX = wobbleHit;
_local14 = 1E-5 * (v.x / Math.abs(v.x));
} else {
var _local15 = ((-bounce) * bounceY) * ((_local10 instanceof TheBottomLine) ? 0.35 : 1);
v.y = v.y * _local15;
wobbleY = wobbleHit;
_local13 = 1E-5 * (v.y / Math.abs(v.y));
if (Math.abs(v.y) > jumpThreshold) {
doAnim("jump");
rotVel = RABBIT_SPIN;
} else {
rotVel = 0;
if (Math.abs(v.x) > xRunThreshold) {
if (Math.abs(v.y) < yRunThreshold) {
doAnim("run");
} else {
doAnim("jump");
}
} else {
doAnim("idle");
}
}
if (Math.abs(v.y) < minMoveThreshold) {
v.y = 0;
}
}
d = (v.__get__length() * d) / _local6;
x = _local11.x + _local14;
y = _local11.y + _local13;
ballMovementLine.x1 = x;
ballMovementLine.y1 = y;
ballMovementLine.x2 = x + (v.x * d);
ballMovementLine.y2 = y + (v.y * d);
_local10.wall.hit();
arguments.callee(d);
}
}
function doAnim(f) {
if (!done) {
mc.gotoAndStop(f);
}
}
function collisionDetection(objs) {
var _local6 = objs.length;
var _local2;
var _local4 = 0;
while (_local4 < _local6) {
if (this != objs[_local4]) {
_local2 = objs[_local4];
var _local3 = r + _local2.r;
if (_local2.x < (x - _local3)) {
} else if (_local2.x > (x + _local3)) {
} else if (_local2.y < (y - _local3)) {
} else if (_local2.y > (y + _local3)) {
} else if ((r + _local2.r) > Math.sqrt(((x - _local2.x) * (x - _local2.x)) + ((y - _local2.y) * (y - _local2.y)))) {
return(_local2);
}
}
_local4++;
}
}
function collisionResponse(ball) {
var _local5 = new cust.geom2D.Vector(ball.v.x - v.x, ball.v.y - v.y);
var _local4 = new cust.geom2D.Vector((ball.x - x) - _local5.x, (ball.y - y) - _local5.y);
var _local3 = (new cust.geom2D.Circle(0, 0, r + ball.r)).LineIntersection(cust.geom2D.LineSegment.fromPoints(_local4, new cust.geom2D.Vector(_local4.x + _local5.x, _local4.y + _local5.y)));
if (_local3.length == 2) {
if (flash.geom.Point.distance(_local4, _local3[1]) < flash.geom.Point.distance(_local4, _local3[0])) {
var _local7 = _local3[1];
} else {
var _local7 = _local3[0];
}
} else if (_local3.length == 1) {
var _local7 = _local3[0];
}
if (_local7) {
var _local6 = 1 - (flash.geom.Point.distance(_local7, _local4) / _local5.__get__length());
var _local9 = v.multiply(_local6);
_local9.length = _local9.length + 0.1;
x = x - _local9.x;
y = y - _local9.y;
var _local8 = ball.v.multiply(_local6);
_local8.length = _local8.length + 0.1;
ball.x = ball.x - _local8.x;
ball.y = ball.y - _local8.y;
}
bounceOffBall(ball);
if (_local7) {
var _local14 = v.multiply(_local6);
var _local12 = ball.v.multiply(_local6);
x = x + _local14.x;
y = y + _local14.y;
ball.x = ball.x + _local12.x;
ball.y = ball.y + _local12.y;
}
var _local16 = Math.sqrt(((x - ball.x) * (x - ball.x)) + ((y - ball.y) * (y - ball.y)));
if ((r + ball.r) > _local16) {
var _local18 = (r + ball.r) - _local16;
var _local15 = v.__get__length();
var _local13 = ball.v.__get__length();
var _local17 = _local18 / (_local15 + _local13);
var _local11 = new cust.geom2D.Vector(x - ball.x, y - ball.y);
var _local10 = new cust.geom2D.Vector(ball.x - x, ball.y - y);
_local11.__set__length((_local17 * _local15) + 1);
_local10.__set__length((_local17 * _local13) + 1);
x = x + _local11.x;
y = y + _local11.y;
ball.x = ball.x + _local10.x;
ball.y = ball.y + _local10.y;
}
}
function bounceOffBall(obj) {
var _local8 = obj.x - x;
var _local7 = obj.y - y;
var _local9 = Math.atan2(_local7, _local8);
var _local4 = Math.sin(_local9);
var _local3 = Math.cos(_local9);
var _local12 = new cust.geom2D.Vector(0, 0);
var _local11 = new cust.geom2D.Vector((_local8 * _local3) + (_local7 * _local4), (_local7 * _local3) - (_local8 * _local4));
var _local5 = new cust.geom2D.Vector((v.x * _local3) + (v.y * _local4), (v.y * _local3) - (v.x * _local4));
var _local6 = new cust.geom2D.Vector((obj.v.x * _local3) + (obj.v.y * _local4), (obj.v.y * _local3) - (obj.v.x * _local4));
var _local10 = _local5.x - _local6.x;
_local5.x = (((mass - obj.mass) * _local5.x) + ((2 * obj.mass) * _local6.x)) / (mass + obj.mass);
_local6.x = _local10 + _local5.x;
_local5.length = _local5.length * ((bounce + obj.bounce) / 2);
_local6.length = _local6.length * ((bounce + obj.bounce) / 2);
v.x = (_local5.x * _local3) - (_local5.y * _local4);
v.y = (_local5.y * _local3) + (_local5.x * _local4);
obj.v.x = (_local6.x * _local3) - (_local6.y * _local4);
obj.v.y = (_local6.y * _local3) + (_local6.x * _local4);
}
function toString() {
return(((((((((("(x:" + x) + ", y:") + y) + ", r:") + r) + ", vx:") + v.x) + ", vy:") + v.y) + ")");
}
var mass = 1;
var bounce = Engine.BALL_BOUNCE_COEFFICIENT;
var bounceY = 0.85;
var wobbleX = 0;
var wobbleY = 0;
var wobbleXMod = 1;
var wobbleYMod = 1;
var bounceChange = 5;
var wobbleHit = 10;
var disableMovement = false;
var minMoveThreshold = (Engine.GRAVITY * 5) - 0.1;
var onFloor = false;
var rotVel = 0;
var rotVelMin = 10;
var ballStopped = false;
var hitFloor = false;
var done = false;
static var RABBIT_SPIN = 20;
var rabbitSpinSlow = 0.5;
var jumpThreshold = 10;
var xRunThreshold = 1.5;
var yRunThreshold = 1.5;
}
Symbol 277 MovieClip [__Packages.Hole] Frame 0
class Hole extends cust.geom2D.Circle
{
var engine, y, x;
function Hole (e, ix, iy) {
super(ix, iy, r);
engine = e;
}
function getForce(p) {
var _local2 = flash.geom.Point.distance(this, p);
var _local5 = Math.atan2(y - p.y, x - p.x);
var _local4 = 1 - ((_local2 - ir) / (r - ir));
var _local6 = Math.sin((Math.PI/2) * _local4);
return(flash.geom.Point.polar(_local6 * MAX_FORCE, _local5));
}
function fallenDown(ball) {
engine.ballFallingDownHole(this, ball);
}
var ir = (Engine.BALL_RADIUS / 2) - 1.5;
var r = Engine.BALL_RADIUS + 10;
var MAX_FORCE = 100;
}
Symbol 278 MovieClip [__Packages.WallLine] Frame 0
class WallLine extends cust.geom2D.LineSegment
{
var wall;
function WallLine (x1, y1, x2, y2, pWall) {
super(x1, y1, x2, y2);
wall = pWall;
}
}
Symbol 279 MovieClip [__Packages.WallMC] Frame 0
class WallMC extends MovieClip
{
var circle, engine, isPickedUp, _x, _width, _y, _height, topLine, rightLine, bottomLine, leftLine, gotoAndPlay;
function WallMC () {
super();
}
function Pickup() {
circle = new cust.geom2D.Ball(engine, this, RADIUS, 0, 0, 10000000, 1.5);
circle.pickup = this;
}
function hit() {
}
function init(e) {
engine = e;
isPickedUp = false;
var _local5 = _x;
var _local3 = _x + _width;
var _local4 = _y;
var _local2 = _y + _height;
engine.lines.push((topLine = new WallLine(_local5, _local4, _local3, _local4, this)));
engine.lines.push((rightLine = new WallLine(_local3, _local4, _local3, _local2, this)));
engine.lines.push((bottomLine = new WallLine(_local3, _local2, _local5, _local2, this)));
engine.lines.push((leftLine = new WallLine(_local5, _local2, _local5, _local4, this)));
}
function isCollected(ls) {
if (!isPickedUp) {
var _local2 = ls.closestPoint(circle);
if (flash.geom.Point.distance(_local2, circle) <= (circle.r + Engine.BALL_RADIUS)) {
pickedUp();
}
}
}
function pickedUp(ball) {
gotoAndPlay(PICKUP_UP);
isPickedUp = true;
}
var solid = true;
static var RADIUS = 11;
static var PICKUP_UP = "pickedUp";
static var HIDDEN = "hidden";
}
Symbol 280 MovieClip [__Packages.TheBottomLine] Frame 0
class TheBottomLine extends cust.geom2D.LineSegment
{
function TheBottomLine (x1, y1, x2, y2) {
super(x1, y1, x2, y2);
}
}
Symbol 281 MovieClip [__Packages.HoleMC] Frame 0
class HoleMC extends MovieClip
{
function HoleMC () {
super();
}
}
Symbol 282 MovieClip [__Packages.EndOfLevelPickup] Frame 0
class EndOfLevelPickup extends HoleMC
{
function EndOfLevelPickup () {
super();
}
}
Symbol 283 MovieClip [__Packages.HoleEnd] Frame 0
class HoleEnd extends Hole
{
var engine;
function HoleEnd (e, ix, iy) {
super(e, ix, iy);
}
function fallenDown(ball) {
engine.ballFallingDownEndHole(this, ball);
}
var ir = (Engine.BALL_RADIUS / 2) + 5;
var r = Engine.BALL_RADIUS + 12;
}
Symbol 284 MovieClip [__Packages.Pickup] Frame 0
class Pickup extends MovieClip
{
var circle, engine, isPickedUp, gotoAndPlay, _x, _y;
function Pickup () {
super();
circle = new cust.geom2D.Ball(engine, this, RADIUS, 0, 0, 10000000, 1.5);
circle.pickup = this;
}
function init(e) {
engine = e;
isPickedUp = false;
}
function isCollected(ls) {
if (!isPickedUp) {
var _local2 = ls.closestPoint(circle);
if (flash.geom.Point.distance(_local2, circle) <= (circle.r + Engine.BALL_RADIUS)) {
pickedUp();
}
}
}
function pickedUp(ball) {
var _local2 = 0;
while (_local2 < pickedUpSplashAmount) {
makeSplash();
_local2++;
}
isPickedUp = true;
gotoAndPlay(PICKUP_UP);
}
function makeSplash() {
var _local2 = engine.attachMovie("starLong", "star" + engine.getNextHighestDepth(), engine.getNextHighestDepth());
_local2._x = _x + ((Math.random() - 0.5) * 15);
_local2._y = _y + ((Math.random() - 0.5) * 15);
_local2.xVel = (Math.random() - 0.5) * splashXVel;
_local2.yVel = (Math.random() - 0.75) * splashYVel;
}
var solid = true;
var pickedUpSplashAmount = 10;
var splashXVel = 10;
var splashYVel = 10;
static var RADIUS = 11;
static var PICKUP_UP = "pickedUp";
static var HIDDEN = "hidden";
}
Symbol 285 MovieClip [__Packages.Bumper] Frame 0
class Bumper extends MovieClip
{
var circle, engine, _width, gotoAndPlay;
function Bumper () {
super();
circle = new cust.geom2D.Ball(engine, this, _width / 2, 0, 0, 10000000, 1.2);
circle.bumper = this;
}
function hit() {
gotoAndPlay(HIT);
}
static var HIT = "hit";
}
Symbol 286 MovieClip [__Packages.Gravity] Frame 0
class Gravity extends MovieClip
{
var mass, _width, p, _x, _y;
function Gravity () {
super();
mass = _width;
p = new flash.geom.Point(_x, _y);
}
function getForce(t) {
var _local2 = flash.geom.Point.distance(p, t);
_local2 = Math.max(MIN, _local2);
var _local4 = Math.atan2(p.y - t.y, p.x - t.x);
var _local5 = (G * mass) * (1 / (_local2 * _local2));
return(flash.geom.Point.polar(_local5, _local4));
}
var G = 10;
var MIN = 15;
}
Symbol 287 MovieClip [__Packages.ChocolatePickup] Frame 0
class ChocolatePickup extends Pickup
{
var engine, _xscale, _alpha;
function ChocolatePickup () {
super();
}
function init(e) {
super.init(e);
engine.addCarrot();
}
function pickedUp(ball) {
super.pickedUp(ball);
engine.scorePoints(Engine.PICKUP_POINTS);
engine.chocolate++;
engine.eatenCarrot();
engine.populateBeatArray();
}
function mouseOver() {
_xscale = 200;
_alpha = 50;
}
function mouseOut() {
_xscale = 100;
_alpha = 100;
}
var solid = false;
}
Symbol 288 MovieClip [__Packages.Delegate] Frame 0
class Delegate
{
function Delegate () {
}
static function create(target, handler) {
var _local3 = arguments.slice(2);
var _local2 = function () {
return(arguments.callee.handler.apply(arguments.callee.target, arguments.concat(arguments.callee.extraArgs)));
};
_local2.extraArgs = _local3;
_local2.handler = handler;
_local2.target = target;
return(_local2);
}
}
Symbol 289 MovieClip [__Packages.Format] Frame 0
class Format
{
function Format () {
}
static function zerofill(n, z) {
var _local2 = String(n);
var _local1 = _local2.length;
while (_local1 < z) {
_local2 = "0" + _local2;
_local1++;
}
return(_local2);
}
static function time(t, minp, maxp) {
var _local1 = Math.round((t % 1000) / 10);
var _local2 = Math.round(Math.floor(t / 1000) % 60);
var _local4 = Math.floor(t / 60000);
var _local5 = (((_local4 + ":") + ((_local2 < 10) ? ("0" + _local2) : (_local2))) + ":") + ((_local1 < 10) ? ("0" + _local1) : (_local1));
return(_local5);
}
static function number(n, d, c, l) {
d = (isNaN(d) ? undefined : (d));
c = ((c == undefined) ? "," : (c));
var _local1 = String(n).split(".");
if (!(d === undefined)) {
if (_local1[1]) {
var _local3 = String(Math.round(Number("." + _local1[1]) * Math.pow(10, d)) * Math.pow(10, -d));
_local3 = ((_local3.indexOf(".") < 0) ? (_local3) : (_local3.split(".")[1]));
} else {
var _local3 = "";
}
var _local2 = 0;
while (_local3.length < d) {
var _local3 = _local3 + "0";
_local2++;
}
_local1[1] = _local3;
}
var _local2 = 3;
while (_local1[0].length > _local2) {
_local1[0] = (_local1[0].substring(0, _local1[0].length - _local2) + c) + _local1[0].substring(_local1[0].length - _local2);
_local2 = _local2 + 4;
}
if (!isNaN(l)) {
_local1[0] = zerofill(_local1[0], l);
}
if ((_local1.length > 1) && (d > 0)) {
return((_local1[0] + ".") + _local1[1]);
}
return(_local1[0]);
}
static function ordinal(n) {
if (((n % 100) >= 11) && ((n % 100) <= 13)) {
return("th");
}
if ((n % 10) == 1) {
return("st");
}
if ((n % 10) == 2) {
return("nd");
}
if ((n % 10) == 3) {
return("rd");
}
return("th");
}
static function truncate(s, l, r) {
l = (isNaN(l) ? 20 : (l));
r = ((r == undefined) ? "..." : (r));
if (s.length > l) {
s = s.substr(0, l - r.length);
s = s + r;
}
return(s);
}
}
Symbol 290 MovieClip [__Packages.StarGravityMC] Frame 0
class StarGravityMC extends StarMC
{
var yVel, _x, xVel, _y;
function StarGravityMC () {
super();
}
function onEnterFrame() {
yVel = yVel + Engine.GRAVITY;
_x = _x + xVel;
_y = _y + yVel;
}
}
Symbol 291 MovieClip [__Packages.SnowFlakeMC] Frame 0
class SnowFlakeMC extends MovieClip
{
var sprite, engine, _x, _y, gotoAndPlay, _totalframes;
function SnowFlakeMC () {
super();
sprite.gotoAndStop(Math.ceil(sprite._totalframes * Math.random()));
engine = _global.root.game;
}
function initSnowFlake() {
sprite.gotoAndStop(Math.ceil(sprite._totalframes * Math.random()));
_x = Math.random() * stageWidth;
_y = -10;
engine.snowFlakeOffset++;
gotoAndPlay((engine.snowFlakeOffset * 2) % _totalframes);
}
function onEnterFrame() {
_x = _x - engine.wind;
if (_x < (-fullAnimRadius)) {
_x = _x + stageWidth;
} else if (_x > (stageWidth + fullAnimRadius)) {
_x = _x - stageWidth;
}
_y = _y + fallSpeed;
if (_y > stageHeight) {
initSnowFlake();
}
}
var fallSpeed = 2;
var fullAnimRadius = 85;
var stageHeight = 520;
var stageWidth = 450;
}
Symbol 292 MovieClip [__Packages.Base64] Frame 0
class Base64 extends Object
{
static var _CharsReverseLookup;
var _base64Str, _base64Count;
function Base64 () {
super();
}
static function Encode(str) {
var _local1 = new Base64();
return(_local1.encodeBase64(str));
}
static function Decode(str) {
var _local1 = new Base64();
return(_local1.decodeBase64(str));
}
static function StringReplaceAll(source, find, replacement) {
return(source.split(find).join(replacement));
}
static function InitReverseChars() {
_CharsReverseLookup = new Array();
var _local1 = 0;
while (_local1 < _Chars.length) {
_CharsReverseLookup[_Chars[_local1]] = _local1;
_local1++;
}
return(true);
}
static function UrlDecode(str) {
str = StringReplaceAll(str, "\\", " ");
str = unescape(str);
return(str);
}
static function UrlEncode(str) {
str = escape(str);
str = StringReplaceAll(str, "\\", "%2B");
str = StringReplaceAll(str, "%20", "+");
return(str);
}
function setBase64Str(str) {
_base64Str = str;
_base64Count = 0;
}
function readBase64() {
if (!_base64Str) {
return(_EndOfInput);
}
if (_base64Count >= _base64Str.length) {
return(_EndOfInput);
}
var _local2 = _base64Str.charCodeAt(_base64Count) & 255;
_base64Count++;
return(_local2);
}
function encodeBase64(str) {
setBase64Str(str);
var _local3 = "";
var _local2 = new Array(3);
var _local5 = 0;
var _local4 = false;
while ((!_local4) && (((_local2[0] = readBase64())) != _EndOfInput)) {
_local2[1] = readBase64();
_local2[2] = readBase64();
_local3 = _local3 + _Chars[_local2[0] >> 2];
if (_local2[1] != _EndOfInput) {
_local3 = _local3 + _Chars[((_local2[0] << 4) & 48) | (_local2[1] >> 4)];
if (_local2[2] != _EndOfInput) {
_local3 = _local3 + _Chars[((_local2[1] << 2) & 60) | (_local2[2] >> 6)];
_local3 = _local3 + _Chars[_local2[2] & 63];
} else {
_local3 = _local3 + _Chars[(_local2[1] << 2) & 60];
_local3 = _local3 + "=";
_local4 = true;
}
} else {
_local3 = _local3 + _Chars[(_local2[0] << 4) & 48];
_local3 = _local3 + "=";
_local3 = _local3 + "=";
_local4 = true;
}
_local5 = _local5 + 4;
if (_local5 >= 76) {
_local3 = _local3 + newline;
_local5 = 0;
}
}
return(_local3);
}
function readReverseBase64() {
if (!_base64Str) {
return(_EndOfInput);
}
while (true) {
if (_base64Count >= _base64Str.length) {
return(_EndOfInput);
}
var _local2 = _base64Str.charAt(_base64Count);
_base64Count++;
if (_CharsReverseLookup[_local2]) {
return(_CharsReverseLookup[_local2]);
}
if (_local2 == "A") {
return(0);
}
}
}
function ntos(n) {
var _local1 = n.toString(16);
if (_local1.length == 1) {
_local1 = "0" + _local1;
}
_local1 = "%" + _local1;
return(unescape(_local1));
}
function decodeBase64(str) {
setBase64Str(str);
var _local3 = "";
var _local2 = new Array(4);
var _local4 = false;
while (((!_local4) && (((_local2[0] = readReverseBase64())) != _EndOfInput)) && (((_local2[1] = readReverseBase64())) != _EndOfInput)) {
_local2[2] = readReverseBase64();
_local2[3] = readReverseBase64();
_local3 = _local3 + ntos(((_local2[0] << 2) & 255) | (_local2[1] >> 4));
if (_local2[2] != _EndOfInput) {
_local3 = _local3 + ntos(((_local2[1] << 4) & 255) | (_local2[2] >> 2));
if (_local2[3] != _EndOfInput) {
_local3 = _local3 + ntos(((_local2[2] << 6) & 255) | _local2[3]);
} else {
_local4 = true;
}
} else {
_local4 = true;
}
}
return(_local3);
}
function toHex(n) {
var _local4 = "";
var _local3 = true;
var _local1 = 32;
while (_local1 > 0) {
_local1 = _local1 - 4;
var _local2 = (n >> _local1) & 15;
if ((!_local3) || (_local2 != 0)) {
_local3 = false;
_local4 = _local4 + _Digits[_local2];
}
}
return(((_local4 == "") ? "0" : (_local4)));
}
function pad(str, len, pad) {
var _local2 = str;
var _local1 = str.length;
while (_local1 < len) {
_local2 = pad + _local2;
_local1++;
}
return(_local2);
}
function encodeHex(str) {
var _local4 = "";
var _local2 = 0;
while (_local2 < str.length) {
_local4 = _local4 + pad(toHex(str.charCodeAt(_local2) & 255), 2, "0");
_local2++;
}
return(_local4);
}
function decodeHex(str) {
var _local5 = "";
var _local3 = "";
var _local2 = 0;
while (_local2 < str.length) {
_local3 = _local3 + str.charAt(_local2);
if (_local3.length == 2) {
_local5 = _local5 + ntos(parseInt("0x" + _local3));
_local3 = "";
}
_local2++;
}
return(_local5);
}
static var _EndOfInput = -1;
static var _Chars = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/");
static var _CharsReverseLookupInited = InitReverseChars();
static var _Digits = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
}
Symbol 293 MovieClip [__Packages.SexPickup] Frame 0
class SexPickup extends Pickup
{
var engine, _x, _y;
function SexPickup () {
super();
}
function pickedUp(ball) {
super.pickedUp(ball);
engine.scorePoints(Engine.PICKUP_POINTS);
engine.spawnBall(_x, _y, xDeviation, startYVel * angleFactor);
engine.spawnBall(_x, _y, xDeviation * 0.5, startYVel * angleFactor);
engine.spawnBall(_x, _y, (xDeviation * 0.5) * -1, startYVel * angleFactor);
engine.spawnBall(_x, _y, xDeviation * -1, startYVel * angleFactor);
engine.sex++;
}
var xDeviation = 3;
var startYVel = -10;
var angleFactor = 0.75;
var playerBallVelFactor = 0;
var solid = false;
var vertBoost = 5;
}
Symbol 294 MovieClip [__Packages.MusicTiming] Frame 0
class MusicTiming extends MovieClip
{
var engine, gotoAndPlay, _alpha;
function MusicTiming () {
super();
engine = _global.root.game;
}
function onEnterFrame() {
var _local3 = 19;
var _local7 = _global.music.duration / _local3;
if (!disable) {
if (lastPos > _global.music.position) {
gotoAndPlay("long");
barCount = 0;
} else if (_global.music.position > (_local7 * ((barCount + 1) % (_local3 + 1)))) {
gotoAndPlay("flicker");
_alpha = (barCount / _local3) * 100;
barCount++;
}
var _local4 = 76;
var _local6 = _global.music.duration / _local4;
if ((_global.music.position > (_local6 * ((beatCount + 1) % (_local4 + 1)))) || (lastPos > _global.music.position)) {
if (beatIndex >= (engine.beatArray.length - 1)) {
beatIndex = 0;
} else {
beatIndex++;
}
if (!engine.beatArray[beatIndex].isPickedUp) {
engine.beatArray[beatIndex].gotoAndPlay("beat");
}
var _local5 = (beatIndex + (engine.beatArray.length * 0.5)) % engine.beatArray.length;
if (_local5 != beatIndex) {
engine.beatArray[_local5].gotoAndPlay("beat");
}
lastPos = _global.music.position;
beatCount++;
}
}
}
var lastPos = 0;
var barCount = 0;
var beatCount = 0;
var beatIndex = 0;
var disable = false;
}
Symbol 295 MovieClip [__Packages.DestroyableWallMC] Frame 0
class DestroyableWallMC extends WallMC
{
var topLine, leftLine, rightLine, bottomLine, gotoAndStop;
function DestroyableWallMC () {
super();
}
function hit() {
hits--;
if (hits == 0) {
topLine.x1 = -10000;
topLine.x2 = -10000;
topLine.y1 = -10000;
topLine.y2 = -10000;
leftLine.x1 = -10000;
leftLine.x2 = -10000;
leftLine.y1 = -10000;
leftLine.y2 = -10000;
rightLine.x1 = -10000;
rightLine.x2 = -10000;
rightLine.y1 = -10000;
rightLine.y2 = -10000;
bottomLine.x1 = -10000;
bottomLine.x2 = -10000;
bottomLine.y1 = -10000;
bottomLine.y2 = -10000;
}
gotoAndStop("off");
}
var hits = 1;
}
Symbol 53 Button
on (release) {
_global.root.gotoMiikeSnow();
}
Symbol 56 Button
on (release) {
_global.root.goToGame();
}
Symbol 60 Button
on (release) {
_global.root.gotoTM();
}
Symbol 61 MovieClip Frame 1
useHandCursor = false;
onPress = function () {
};
Symbol 62 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 5
stop();
Symbol 68 MovieClip Frame 1
stop();
Symbol 68 MovieClip Frame 5
stop();
Symbol 71 MovieClip [star] Frame 1
#initclip 34
Object.registerClass("star", StarMC);
#endinitclip
Symbol 71 MovieClip [star] Frame 11
removeMovieClip(this);
stop();
Symbol 80 MovieClip Frame 13
stop();
Symbol 81 MovieClip Frame 7
gotoAndPlay ("loop");
Symbol 84 MovieClip Frame 7
gotoAndPlay ("loop");
Symbol 89 MovieClip Frame 4
gotoAndPlay ("loop");
Symbol 91 MovieClip [cueBall] Frame 1
#initclip 31
Object.registerClass("cueBall", BallMC);
#endinitclip
stop();
Symbol 91 MovieClip [cueBall] Frame 3
stop();
Symbol 91 MovieClip [cueBall] Frame 7
stop();
Symbol 91 MovieClip [cueBall] Frame 11
stop();
Symbol 91 MovieClip [cueBall] Frame 14
stop();
Symbol 91 MovieClip [cueBall] Frame 25
stop();
Symbol 91 MovieClip [cueBall] Frame 42
stop();
_global.root.game.ballFallenDownHole();
Symbol 91 MovieClip [cueBall] Frame 56
stop();
_global.root.game.levelComplete();
Symbol 92 MovieClip [starLong] Frame 1
#initclip 32
Object.registerClass("starLong", StarGravityMC);
#endinitclip
Symbol 92 MovieClip [starLong] Frame 23
removeMovieClip(this);
stop();
Symbol 98 MovieClip [snow] Frame 1
#initclip 33
Object.registerClass("snow", SnowFlakeMC);
#endinitclip
Symbol 98 MovieClip [snow] Frame 249
gotoAndPlay (1);
Symbol 100 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 50
stop();
Symbol 109 MovieClip Frame 100
stop();
Symbol 109 MovieClip Frame 150
stop();
Symbol 109 MovieClip Frame 200
stop();
Symbol 109 MovieClip Frame 250
stop();
Symbol 109 MovieClip Frame 300
stop();
Symbol 116 MovieClip Frame 1
_visible = false;
stop();
Symbol 116 MovieClip Frame 15
stop();
_parent.ballFallenDownHole();
Symbol 116 MovieClip Frame 29
stop();
_parent.levelComplete();
Symbol 119 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 10
stop();
Symbol 125 MovieClip Frame 9
_parent.gotoAndStop("on");
stop();
Symbol 126 MovieClip [chocolate pickup] Frame 1
#initclip 42
Object.registerClass("chocolate pickup", ChocolatePickup);
#endinitclip
stop();
Symbol 126 MovieClip [chocolate pickup] Frame 3
stop();
Symbol 126 MovieClip [chocolate pickup] Frame 13
stop();
Symbol 126 MovieClip [chocolate pickup] Frame 16
stop();
Symbol 128 MovieClip [wall1] Frame 1
#initclip 35
Object.registerClass("wall1", WallMC);
#endinitclip
Symbol 133 MovieClip [sex pickup] Frame 1
#initclip 36
Object.registerClass("sex pickup", SexPickup);
#endinitclip
stop();
Symbol 133 MovieClip [sex pickup] Frame 11
stop();
Symbol 138 Button
on (release) {
_parent.restartLevelManually();
}
Symbol 139 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 10
stop();
Symbol 143 MovieClip Frame 1
stop();
Symbol 143 MovieClip Frame 51
stop();
_parent.transitionDone = true;
Symbol 152 MovieClip Frame 1
stop();
Symbol 156 MovieClip [bgFlash] Frame 1
#initclip 37
Object.registerClass("bgFlash", MusicTiming);
#endinitclip
stop();
Symbol 156 MovieClip [bgFlash] Frame 38
gotoAndStop (1);
Symbol 156 MovieClip [bgFlash] Frame 62
stop();
Symbol 158 MovieClip Frame 1
stop();
Symbol 163 Button
on (release) {
_global.root.goToTM();
}
Symbol 169 MovieClip Frame 1
_global.root.game.displayLevelCompleteBonus(this);
Symbol 171 MovieClip Frame 58
_parent._parent.play();
stop();
Symbol 173 MovieClip Frame 127
_parent._parent.play();
Symbol 173 MovieClip Frame 144
stop();
Symbol 175 MovieClip Frame 226
_parent._parent.play();
Symbol 175 MovieClip Frame 239
stop();
Symbol 177 MovieClip Frame 219
_parent._parent.play();
Symbol 177 MovieClip Frame 236
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 14
if (!_global.root.videoNum) {
_global.root.videoNum = 1;
}
vidClip.gotoAndStop((_global.root.videoNum % 3) + 1);
_global.root.videoNum++;
Symbol 180 MovieClip Frame 56
stop();
Symbol 180 MovieClip Frame 70
_parent._parent.play();
stop();
Symbol 183 MovieClip Frame 36
_parent._parent.play();
Symbol 190 Button
on (release) {
_global.root.gotoMiikeSnow();
}
Symbol 196 Button
on (release) {
_global.root.gotoVideo();
}
Symbol 199 Button
on (release) {
gotoAndStop ("submitHighScore");
}
Symbol 201 Button
on (release) {
_global.root.goToStartPage();
}
Symbol 205 Button
on (release) {
_parent.onHiding = Delegate.create(_global.root.game, _global.root.game.restart);
_global.root.game.retryButtonPressed();
_parent.play();
}
Symbol 212 Button
on (release) {
if (name_txt.text) {
_global.root.submitHighscore(name_txt.text, _global.root.score);
_global.root.highScoreEvent();
gotoAndStop ("highscores");
}
}
Symbol 214 Button
on (release) {
_global.root.goToStartPage();
}
Symbol 235 MovieClip Frame 2
function FB_submit() {
getURL ((appURL + "?r=") + getScoreString(), "_blank");
}
function getScoreString() {
return(Base64.Encode(rating.toString()));
}
appURL = "http://apps.facebook.com/mjcsapp/";
stop();
continue_btn.onRelease = function () {
_parent.play();
};
Symbol 235 MovieClip Frame 10
stop();
_parent.play();
Symbol 235 MovieClip Frame 35
stop();
continue_btn.onRelease = function () {
_parent.play();
};
Symbol 235 MovieClip Frame 46
stop();
continue_btn.onRelease = function () {
_parent.play();
};
Symbol 235 MovieClip Frame 61
stop();
continue_btn.onRelease = function () {
_parent.play();
};
Symbol 235 MovieClip Frame 71
score_txt.text = _global.root.score;
stop();
Instance of Symbol 68 MovieClip "mute" in Symbol 235 MovieClip Frame 71
onClipEvent (load) {
if (new Sound().getVolume() == 0) {
gotoAndStop ("off");
}
this.onRelease = function () {
if (new Sound().getVolume() == 0) {
gotoAndStop ("on");
_global.isMuted = false;
new Sound().setVolume(100);
} else {
gotoAndStop ("off");
_global.isMuted = true;
new Sound().setVolume(0);
}
};
}
Symbol 235 MovieClip Frame 79
score_txt.text = _global.root.score;
stop();
Symbol 235 MovieClip Frame 86
stop();
Symbol 235 MovieClip Frame 97
highscores = _global.root.getHighscores();
var i = 0;
while (i < 10) {
p = i + 1;
this["name_" + p].text = (p + ". ") + highscores[i].name;
this["score_" + p].text = Format.number(highscores[i].score);
i++;
}
stop();
Symbol 236 MovieClip Frame 1
stop();
Symbol 236 MovieClip Frame 11
stop();
onShown();
delete onShown;
Symbol 236 MovieClip Frame 12
onHiding();
delete onHiding;
Symbol 245 MovieClip Frame 7
stop();
Symbol 246 MovieClip [wallDestroy] Frame 1
#initclip 38
Object.registerClass("wallDestroy", DestroyableWallMC);
#endinitclip
stop();
Symbol 250 MovieClip Frame 7
stop();
Symbol 251 MovieClip [wallDestroy copy] Frame 1
#initclip 39
Object.registerClass("wallDestroy copy", DestroyableWallMC);
#endinitclip
stop();
Symbol 256 MovieClip [bumper] Frame 1
#initclip 40
Object.registerClass("bumper", Bumper);
#endinitclip
stop();
Symbol 257 MovieClip [engine] Frame 1
#initclip 41
Object.registerClass("engine", Engine);
#endinitclip
stop();
Symbol 257 MovieClip [engine] Frame 65
initLvl();
Symbol 262 Button
on (release) {
play();
}
Symbol 264 MovieClip Frame 1
stop();
Symbol 264 MovieClip Frame 11
stop();
_global.root.game.startGame(_global.root.startLevel);
Symbol 266 MovieClip Frame 1
stop();
Symbol 266 MovieClip Frame 6
_parent.gotoAndStop("restartGame");
Symbol 266 MovieClip Frame 11
gotoAndStop ("off");