Frame 1
Stage.showMenu = false;
_focusrect = false;
Instance of Symbol 14 MovieClip "Percent" in Frame 1
onClipEvent (load) {
this.stop();
}
Frame 2
TotFrame = getBytesTotal();
loadFrame = getBytesLoaded();
if (TotFrame == loadFrame) {
gotoAndPlay ("Loaded");
} else {
Percent.gotoAndStop(Math.round((loadFrame * 100) / TotFrame));
gotoAndPlay(_currentframe - 1);
}
Frame 7
_global.GS = this;
var pack = new MainCTRL(this);
Instance of Symbol 125 MovieClip in Frame 7
onClipEvent (load) {
function TransFunc() {
}
this.swapDepths(12000);
_global.Transition = this;
}
Instance of Symbol 227 MovieClip "Sounds" in Frame 7
onClipEvent (load) {
function ToMute() {
_global.Muted = true;
this.onEnterFrame = function () {
if (SetVolumePack > 0) {
SetVolumePack = SetVolumePack - 5;
packMusic.setVolume(SetVolumePack);
}
if (SetVolumeInG > 0) {
SetVolumeInG = SetVolumeInG - 5;
WhatMovie.setVolume(SetVolumeInG);
}
if ((SetVolumePack == 0) && (SetVolumeInG == 0)) {
packMusic.stop();
WhatMovie.stop();
delete onEnterFrame;
}
};
}
function UnMute() {
_global.Muted = false;
this.onEnterFrame = function () {
if ((SetVolumePack < setMaxVolume) && (musicIn == "Packaging")) {
if (SetVolumePack == 0) {
packMusic.start(0, 1000000);
}
SetVolumePack = SetVolumePack + 5;
packMusic.setVolume(SetVolumePack);
}
if ((SetVolumeInG < setMaxVolume) && (musicIn == "InGame")) {
if (SetVolumeInG == 0) {
WhatMovie.start(0, 1000000);
}
SetVolumeInG = SetVolumeInG + 5;
WhatMovie.setVolume(SetVolumeInG);
}
if ((SetVolumePack == setMaxVolume) || (SetVolumeInG == setMaxVolume)) {
delete onEnterFrame;
}
};
}
function SwitchToPack() {
musicIn = "Packaging";
this.onEnterFrame = function () {
if (_global.Muted) {
WhatMovie.stop();
delete onEnterFrame;
} else {
if (SetVolumePack < setMaxVolume) {
if (SetVolumePack == 0) {
packMusic.start(0, 1000000);
}
SetVolumePack = SetVolumePack + 5;
packMusic.setVolume(SetVolumePack);
}
if (SetVolumeInG > 0) {
SetVolumeInG = SetVolumeInG - 5;
WhatMovie.setVolume(SetVolumeInG);
}
if ((SetVolumePack == setMaxVolume) && (SetVolumeInG == 0)) {
WhatMovie.stop();
delete onEnterFrame;
}
}
};
}
function SwitchToInGame(WhatGame) {
WhatMovie = this[WhatGame];
musicIn = "InGame";
this.onEnterFrame = function () {
if (_global.Muted) {
packMusic.stop();
delete onEnterFrame;
} else {
if (SetVolumeInG < setMaxVolume) {
if (SetVolumeInG == 0) {
WhatMovie.start(0, 1000000);
}
SetVolumeInG = SetVolumeInG + 5;
WhatMovie.setVolume(SetVolumeInG);
}
if (SetVolumePack > 0) {
SetVolumePack = SetVolumePack - 5;
packMusic.setVolume(SetVolumePack);
}
if ((SetVolumeInG == setMaxVolume) && (SetVolumePack == 0)) {
packMusic.stop();
delete onEnterFrame;
}
}
};
}
function PlayASound(WitchSound, nloop, nVolume) {
if (nloop == undefined) {
nloop = 1;
}
if (nVolume == undefined) {
nVolume = 50;
}
eval (WitchSound).start(0, nloop);
eval (WitchSound).setVolume(nVolume);
}
function StopASound(WitchSound) {
eval (WitchSound).stop();
}
function fGetVolume(WitchSound) {
return(eval (WitchSound).getVolume());
}
function fSetVolume(WitchSound, _num) {
eval (WitchSound).setVolume(_num);
}
_global.Sounds = this;
_global.Muted = false;
var SetVolumeInG;
var SetVolumePack;
var SetVolumeOld;
var musicIn;
var WhatMovie;
var OldMusic;
this.createEmptyMovieClip("packMusic", 1);
packMusic = new Sound("packMusic");
packMusic.attachSound("packMusic");
this.createEmptyMovieClip("gameMusic", 2);
gameMusic = new Sound("gameMusic");
gameMusic.attachSound("gameMusic");
packMusic.start(0, 1000000);
setMaxVolume = 40;
SetVolumePack = setMaxVolume;
SetVolumeInG = 0;
musicIn = "Packaging";
packMusic.setVolume(SetVolumePack);
soundList = new Array("bulleApp", "bananeApp", "Dent", "boiteTombe", "boiteVole", "Swish1", "Swish2", "Swish3", "Swish4", "chearleader", "depose", "bananeDis", "echape", "essuiFront", "gluein", "glueout", "gonfle", "flute", "objApp", "equilibre", "pompe", "pop5", "pop1", "pop2", "pop3", "pop4", "rampe", "boiteRecoi", "rentre", "rire", "sort", "StepL", "StepR", "stretch1", "stretch2", "stretch3", "stretch4", "tombe1", "tombe2", "transition", "walkL", "walkR");
for (i in soundList) {
this.createEmptyMovieClip(soundList[i], i + 8);
this[soundList[i]] = new Sound(soundList[i]);
this[soundList[i]].attachSound(soundList[i]);
}
SwitchToPack();
}
Instance of Symbol 229 MovieClip in Frame 7
onClipEvent (load) {
function getScores() {
if (G_TestHighScore == true) {
trace("getScores");
}
if (gProxyObj == undefined) {
if (G_TestHighScore == true) {
trace("dans getscore, listescore");
}
listScores();
} else {
if (G_TestHighScore == true) {
trace("dans getscore, getScores");
}
gProxyObj.getScores(cbFunc2);
}
}
function submitScore(theScore) {
if (G_TestHighScore == true) {
trace("Envoie le score = " + theScore);
}
gProxyObj.submitScore(theScore, cbFunc);
}
function initHiScores() {
if (G_TestHighScore == true) {
trace("Tu init le highscore!");
}
gProxyObj.setGame_Id("sb_ever");
}
function getScoreString() {
var _local5 = "Oops! The high score list isn't available right now!";
var _local8 = 30;
if (gProxyObj != undefined) {
var _local7 = gProxyObj.getScoreCount();
if (_local7 > 0) {
var _local1;
var _local6;
var _local3;
var _local4;
_local5 = "";
_local1 = 0;
while (_local1 < _local7) {
_local6 = gProxyObj.getScoreItem(_local1);
_local3 = _local6[0];
_local4 = fStyleNumber(_local6[1]);
spaceNb = ((_local8 - _local3.length) - _local4.length) - 4;
spaceTXT = "";
var _local2 = 0;
while (_local2 < spaceNb) {
spaceTXT = spaceTXT + " ";
_local2++;
}
if (_local1 < 9) {
_local5 = _local5 + ((((((_local1 + 1) + " ") + _local3) + spaceTXT) + _local4) + newline);
} else if (_local1 < 99) {
_local5 = _local5 + ((((((_local1 + 1) + " ") + _local3) + spaceTXT) + _local4) + newline);
} else {
_local5 = _local5 + ((((((_local1 + 1) + " ") + _local3) + spaceTXT) + _local4) + newline);
}
_local1++;
}
} else {
_local5 = "Whoops, the high scores seem to have escaped!";
}
}
trace("G_TestHighScore = " + G_TestHighScore);
if (G_TestHighScore == true) {
trace("Tu retournes \u00E7a = " + _local5);
}
return(_local5);
}
function listScores() {
if (G_TestHighScore == true) {
trace("Liste les scores..");
}
_parent.txt_highScore.text = getScoreString();
}
function cbFunc(thisBool) {
if (thisBool) {
listScores();
} else {
if (G_TestHighScore == true) {
trace("CBfunc y\u00E9 false...");
}
_parent.txt_highScore.text = "Oops! The high score list isn\u2019t available right now!";
}
}
function cbFunc2(thisBool) {
if (thisBool) {
listScores();
} else {
_parent.txt_highScore.text = "Oops! The high score list isn\u2019t available right now!";
}
}
function fStyleNumber(_nNumber, _nMinimumChar) {
_sNumber = String(_nNumber);
_sNewString = "";
_nlength = _sNumber.length;
_nlength = _nlength / 3;
if (_nlength <= 1) {
_sNewNumber = _sNumber;
if (_sNewNumber.length < _nMinimumChar) {
_sNewNumber = "0" + _sNewNumber;
}
return(_sNewNumber);
}
_nLoop = _nlength;
while (_nLoop > 1) {
_sNewString = (" " + _sNumber.substr(-3)) + _sNewString;
_sNumber = _sNumber.substr(0, -3);
_nLoop--;
}
_sNewNumber = _sNumber + _sNewString;
if (_sNewNumber.length < _nMinimumChar) {
_sNewNumber = "0" + _sNewNumber;
}
return(_sNewNumber);
}
_global.HS = this;
var G_ShowHighScore = true;
var G_TestHighScore = false;
if (G_TestHighScore == true) {
gProxyObj.setServer("www.nick.com");
gProxyObj.setScreenName("DanQuiTest");
gProxyObj.setIsLoggedIn(true);
}
_global.HS.initHiScores();
trace("gProxyObj.getIsLoggedIn() = " + gProxyObj.getIsLoggedIn());
}
Frame 8
play();
Frame 16
pack.TitleCard();
Frame 17
_global.Sounds.SwitchToInGame("gameMusic");
Frame 25
pack.EndCard();
fromTitle = false;
_global.HS.initHiScores();
if (gProxyObj.getIsLoggedIn()) {
btn_submit_score._visible = true;
} else {
btn_submit_score._visible = false;
}
if (_global.HS.G_ShowHighScore == false) {
btn_submit_score._visible = false;
btn_view_score._visible = false;
}
Frame 33
fromTitle = false;
_global.Pack.nLevel = 1;
if (!_global.Pack.bBonus) {
_global.Pack.nFunds = 5000;
} else {
_global.Pack.nFunds = 6000;
}
_global.HS.initHiScores();
if (gProxyObj.getIsLoggedIn()) {
btn_submit_score._visible = true;
} else {
btn_submit_score._visible = false;
}
if (_global.HS.G_ShowHighScore == false) {
btn_submit_score._visible = false;
btn_view_score._visible;
}
Frame 42
if (gProxyObj.getIsLoggedIn()) {
btn_submit_score._visible = true;
} else {
btn_submit_score._visible = false;
}
_global.HS.getScores();
if (submited) {
submited = false;
_global.HS.submitScore(_global.Pack.nScore);
btn_submit_score._visible = false;
}
if (fromTitle) {
btn_submit_score._visible = false;
}
Instance of Symbol 1024 MovieClip "ControlScroll" in Frame 42
onClipEvent (load) {
scrollUp = false;
scrollDown = false;
}
onClipEvent (enterFrame) {
if (scrollUp == true) {
_parent.txt_highScore.scroll--;
} else if (scrollDown == true) {
_parent.txt_highScore.scroll++;
}
}
Frame 51
trace("pass here");
Symbol 1027 MovieClip [__Packages.MainCTRL] Frame 0
class MainCTRL
{
var mcRef, bInGame, bMenuOpen, bPaused, nLevel, nFunds, nScore, bBonus, oSecretCodeInterface;
function MainCTRL (p_mcRef) {
mcRef = p_mcRef;
bInGame = false;
bMenuOpen = false;
bPaused = false;
nLevel = 1;
nFunds = 5000;
nScore = 0;
_global.Pack = this;
bBonus = false;
}
function TitleCard() {
nScore = 0;
mcRef.stop();
}
function AdjustScore(p_Num) {
nScore = nScore + p_Num;
}
function Play() {
if (bInGame) {
mcRef.instructions.gotoAndStop(1);
hidesMenu();
bMenuOpen = false;
unPauseGame();
} else {
_global.Transition.play();
_global.Transition.TransFunc = function () {
_global.Pack.nScore = 0;
_global.Pack.mcRef.instructions.gotoAndStop(1);
_global.Pack.mcRef.gotoAndStop("Game");
_global.Pack.bInGame = true;
};
}
}
function pauseGame() {
_global.C.oGame.oLevel.Paused();
_global.C.oGame.oLevel.oCam.pause();
_global.C.oGame.oLevel.update();
_global.C.oGame.oLevel.oPatrick.sDropPoint.mcItem.stop();
bPaused = true;
}
function unPauseGame() {
if (_global.GS.mcGame.FinishScreen._currentframe > 1) {
} else {
_global.C.oGame.oLevel.unPaused();
_global.C.oGame.oLevel.oCam.unpause();
if (_global.C.oGame.oLevel.oPatrick.sDropPoint.mcItem._currentframe != _global.C.oGame.oLevel.oPatrick.sDropPoint.mcItem._totalframes) {
_global.C.oGame.oLevel.oPatrick.sDropPoint.mcItem.play();
}
_global.C.oGame.oLevel.oPatrick.mc._parent._parent.mcSpongebob.gotoAndStop("Idle");
bPaused = false;
}
}
function Instruc() {
mcRef.instructions.gotoAndStop(2);
}
function showsMenu() {
mcRef.mcGame.mcMenu.gotoAndPlay("appear");
bMenuOpen = true;
}
function hidesMenu() {
mcRef.mcGame.mcMenu.gotoAndPlay("disapear");
bMenuOpen = false;
}
function pressMenu() {
if (bMenuOpen) {
hidesMenu();
unPauseGame();
} else {
showsMenu();
pauseGame();
}
}
function Quit() {
_global.MiniGame.ClearControls();
_global.C.oGame.oLevel.oPatrick.ClearControls();
mcRef.gotoAndStop("EndCard");
bMenuOpen = false;
bInGame = false;
}
function EndCard() {
_global.Sounds.SwitchToPack();
bMenuOpen = false;
bPaused = false;
if (nLevel >= 6) {
mcRef.gotoAndStop("WinCard");
}
nLevel = 1;
if (!_global.Pack.bBonus) {
nFunds = 5000;
} else {
nFunds = 6000;
}
}
function Code() {
oSecretCodeInterface = new SecretCodeInterface(mcRef.mcCode);
oSecretCodeInterface.show();
mcRef.mcCode.onEnterFrame = function () {
_global.Pack.oSecretCodeInterface.update();
};
}
function unlockCode(__Code) {
if (__Code == "sBONUS") {
_global.Pack.bBonus = true;
nFunds = 6000;
}
}
}
Symbol 1028 MovieClip [__Packages.sarbakan.visual.element.BaseElement] Frame 0
class sarbakan.visual.element.BaseElement
{
static var nNextID;
var id, oOwner, mc;
function BaseElement (l_sID) {
id = l_sID;
}
function setOwner(l_oOwner) {
oOwner = l_oOwner;
}
function setMC(l_mc) {
mc = l_mc;
}
function getMC() {
return(mc);
}
function attachMC() {
}
function toString() {
return(("[Element " + id) + "]");
}
static function resetID() {
nNextID = undefined;
}
static function getNextID() {
if (!nNextID) {
nNextID = 0;
}
return(nNextID++);
}
}
Symbol 1029 MovieClip [__Packages.sarbakan.visual.layer.Layer] Frame 0
class sarbakan.visual.layer.Layer
{
var mc, oDynamicElements, oStaticElements, oCollisionMaps, oActivationManager, nStageWHalf, nStageHHalf;
function Layer (l_mc, l_oActivationManager) {
mc = l_mc;
oDynamicElements = {};
oStaticElements = [];
oCollisionMaps = {};
oActivationManager = l_oActivationManager;
}
function init(l_nStageW, l_nStageH) {
nStageWHalf = l_nStageW / 2;
nStageHHalf = l_nStageH / 2;
oActivationManager.init(l_nStageW, l_nStageH);
}
function addDynamicElement(l_oElement) {
oDynamicElements[l_oElement.id] = l_oElement;
l_oElement.setOwner(this);
if (!l_oElement.bAlwaysActive) {
var _local3 = l_oElement.getGlobalPos(l_oElement.mc);
oActivationManager.addDynamicElement(l_oElement, _local3.x, _local3.y, l_oElement.mc._width, l_oElement.mc._height);
} else {
oActivationManager.addAlwaysActiveElement(l_oElement);
}
}
function changeDynamicElementID(l_oElement, l_sNewID) {
delete oDynamicElements[l_oElement.id];
l_oElement.id = l_sNewID;
oDynamicElements[l_oElement.id] = l_oElement;
}
function removeDynamicElement(l_oElement) {
oActivationManager.removeDynamicElement(l_oElement);
delete oDynamicElements[l_oElement.id];
}
function addStaticElement(l_oElement) {
l_oElement.mc._visible = false;
l_oElement.setOwner(this);
oActivationManager.addStaticElement(l_oElement.mc, l_oElement.mc._x, l_oElement.mc._y, l_oElement.mc._width, l_oElement.mc._height);
oStaticElements.push(l_oElement.mc);
}
function addCollisionMap(l_oCollisionMap) {
oCollisionMaps[l_oCollisionMap.id] = l_oCollisionMap;
}
function update() {
oActivationManager.updateActivation((mc._x - nStageWHalf) * -1, (mc._y - nStageHHalf) * -1);
var _local2;
_local2 = oActivationManager.getActiveElements();
for (var _local3 in _local2) {
_local2[_local3].update();
}
}
function reset() {
for (var _local2 in oDynamicElements) {
oDynamicElements[_local2].reset();
}
}
function pause() {
var _local2;
_local2 = oActivationManager.getActiveElements();
for (var _local3 in _local2) {
_local2[_local3].pause();
}
}
function unpause() {
var _local2;
_local2 = oActivationManager.getActiveElements();
for (var _local3 in _local2) {
_local2[_local3].unpause();
}
}
function destroy() {
for (var _local2 in oDynamicElements) {
oDynamicElements[_local2].remove();
}
for (var _local2 in oStaticElements) {
oStaticElements[_local2].removeMovieClip();
}
for (var _local2 in oCollisionMaps) {
oCollisionMaps[_local2].remove();
}
}
}
Symbol 1030 MovieClip [__Packages.sarbakan.visual.activation.ActivationManager] Frame 0
class sarbakan.visual.activation.ActivationManager
{
var nZoneWidth, nZoneHeight;
function ActivationManager () {
}
function init(l_nZoneWidth, l_nZoneHeight) {
nZoneWidth = l_nZoneWidth;
nZoneHeight = l_nZoneHeight;
}
function addDynamicElement(l_oElement, l_nX, l_nY, l_nWidth, l_nHeight) {
}
function addAlwaysActiveElement(l_oElement) {
}
function removeDynamicElement(l_oElement) {
}
function addStaticElement(l_oElement, l_nX, l_nY, l_nWidth, l_nHeight) {
}
function removeStaticElement(l_oElement) {
}
function updateActivation(l_nX, l_nY) {
}
function getActiveElements() {
return([]);
}
}
Symbol 1031 MovieClip [__Packages.sarbakan.visual.element.StaticElement] Frame 0
class sarbakan.visual.element.StaticElement extends sarbakan.visual.element.BaseElement
{
function StaticElement (l_sID) {
super(l_sID);
}
}
Symbol 1032 MovieClip [__Packages.sarbakan.visual.layer.CollisionMap] Frame 0
class sarbakan.visual.layer.CollisionMap
{
static var nDepth;
var id, oLayer, mc, nColor;
function CollisionMap (l_sID, l_oLayer, l_nColor) {
if (!nDepth) {
nDepth = BASE_DEPTH;
}
id = l_sID;
oLayer = l_oLayer;
mc = oLayer.mc.createEmptyMovieClip(id, nDepth++);
mc._visible = false;
if (!l_nColor) {
nColor = 16711935 /* 0xFF00FF */;
} else {
nColor = l_nColor;
}
}
function show(l_nAlpha) {
mc._visible = true;
if (l_nAlpha) {
mc._alpha = l_nAlpha;
} else {
mc._alpha = 100;
}
}
function hide() {
mc._visible = false;
mc._alpha = 100;
}
function drawRect(l_nX, l_nY, l_nWidth, l_nHeight) {
mc.moveTo(l_nX, l_nY);
mc.beginFill(nColor);
mc.lineTo(l_nX + l_nWidth, l_nY);
mc.lineTo(l_nX + l_nWidth, l_nY + l_nHeight);
mc.lineTo(l_nX, l_nY + l_nHeight);
mc.lineTo(l_nX, l_nY);
}
function setNewSource(l_mcSource) {
remove();
mc = l_mcSource;
mc._visible = false;
}
function attachMC(l_sLinkage, l_nX, l_nY, l_sName) {
if (!l_sName) {
l_sName = String(mc.getNextHighestDepth());
}
return(mc.attachMovie(l_sLinkage, l_sName, mc.getNextHighestDepth(), {_x:l_nX, _y:l_nY}));
}
function remove() {
mc.removeMovieClip();
}
static var BASE_DEPTH = 64000;
}
Symbol 1033 MovieClip [__Packages.sarbakan.visual.element.DynamicElement] Frame 0
class sarbakan.visual.element.DynamicElement extends sarbakan.visual.element.BaseElement
{
var nSpeedX, nSpeedXLast, nSpeedY, nSpeedYLast, bAlwaysActive, bStaticMovieClip, mc, oOwner, sNextState, sState;
function DynamicElement (l_sID) {
super(l_sID);
nSpeedX = 0;
nSpeedXLast = 0;
nSpeedY = 0;
nSpeedYLast = 0;
bAlwaysActive = false;
bStaticMovieClip = false;
}
function update() {
updateState();
updateDirection();
updateMove();
}
function enable() {
setState(DEFAULT_STATE);
updateState();
}
function disable() {
setState("inactive");
updateState();
}
function pause() {
mc.state.stop();
}
function unpause() {
mc.state.play();
}
function remove() {
disable();
if (!bStaticMovieClip) {
mc.removeMovieClip();
}
oOwner.removeDynamicElement(this);
}
function reset() {
}
function setState(l_sState) {
sNextState = l_sState;
}
function getState() {
return(sState);
}
function getCoord() {
var _local2 = new Object();
_local2.x = mc._x;
_local2.y = mc._y;
return(_local2);
}
function setCoord(l_oPos) {
mc._x = l_oPos.x;
mc._y = l_oPos.y;
}
function collideWithMap(l_sCollisionMapID) {
var _local3;
if (typeof(arguments[1]) == "movieclip") {
_local3 = getGlobalPos(arguments[1]);
} else if (typeof(arguments[1]) == "object") {
_local3 = arguments[1];
} else {
_local3 = getGlobalPos(mc);
}
return(oOwner.oCollisionMaps[l_sCollisionMapID].mc.hitTest(_local3.x, _local3.y, true));
}
function collideWithElement(l_sElementID) {
var _local3;
if (arguments[1]) {
_local3 = getGlobalPos(arguments[1]);
} else {
_local3 = getGlobalPos(mc);
}
return(oOwner.oDynamicElements[l_sElementID].mc.hitTest(_local3.x, _local3.y, false));
}
function collideWithElementBox(l_sElementID) {
var _local3;
if (arguments[1]) {
_local3 = arguments[1];
} else {
_local3 = mc;
}
return(oOwner.oDynamicElements[l_sElementID].mc.hitTest(_local3));
}
function setMC(l_mc) {
super.setMC(l_mc);
sNextState = sState;
updateState();
}
function getElement(l_sElementID) {
return(oOwner.oDynamicElements[l_sElementID]);
}
function stateStarting() {
return(mc.state._currentframe == 1);
}
function stateFinished() {
return(mc.state._currentframe == mc.state._totalframes);
}
function stateCurrentFrame() {
return(mc.state._currentframe);
}
function getGlobalPos(l_mc) {
var _local1 = new Object();
_local1.x = 0;
_local1.y = 0;
_local1.x = l_mc._x;
_local1.y = l_mc._y;
l_mc._parent.localToGlobal(_local1);
return(_local1);
}
function updateState() {
if (sNextState != undefined) {
sState = sNextState;
sNextState = undefined;
mc.gotoAndStop(sState);
}
this[sState]();
}
function updateDirection() {
if (nSpeedX > 0) {
mc._xscale = Math.abs(mc._xscale);
} else if (nSpeedX < 0) {
mc._xscale = -1 * Math.abs(mc._xscale);
}
nSpeedXLast = nSpeedX;
nSpeedYLast = nSpeedY;
}
function updateMove() {
mc._x = nSpeedX + mc._x;
mc._y = nSpeedY + mc._y;
}
var DEFAULT_STATE = "idle";
}
Symbol 1034 MovieClip [__Packages.SecretCodeInterface] Frame 0
class SecretCodeInterface extends sarbakan.visual.element.DynamicElement
{
var setMC, setState, stateFinished, stateStarting, disable, mc;
function SecretCodeInterface (l_mc) {
super("secretCode");
setMC(l_mc);
}
function show() {
setState("open");
}
function open() {
if (stateFinished()) {
setState("idle");
}
}
function idle() {
if (stateStarting()) {
initButtons();
}
if (Key.isDown(13)) {
onButtonValidate();
}
}
function good() {
if (stateFinished()) {
setState("close");
}
}
function bad() {
if (stateFinished()) {
setState("idle");
}
}
function close() {
if (stateFinished()) {
disable();
}
}
function onButtonValidate() {
_global.C.oPackaging.clickSound();
validateCode();
}
function onButtonBack() {
_global.C.oPackaging.clickSound();
setState("close");
}
function initButtons() {
mc.state.btValidate.onRelease = sarbakan.utils.Delegate.create(this, onButtonValidate);
mc.state.btBack.onRelease = sarbakan.utils.Delegate.create(this, onButtonBack);
}
function validateCode() {
var _local3 = false;
for (var _local4 in SECRET_CODES) {
if (mc.state.code.text.toLowerCase() == SECRET_CODES[_local4]) {
_global.Pack.unlockCode(_local4);
_local3 = true;
setState("good");
getURL (("javascript:trackEvent('" + SECRET_CODES[_local4]) + "');");
break;
}
}
if (!_local3) {
setState("bad");
}
}
static var SECRET_CODES = {sBONUS:"sbbde3n"};
}
Symbol 1035 MovieClip [__Packages.sarbakan.utils.Delegate] Frame 0
class sarbakan.utils.Delegate extends Object
{
var func;
function Delegate () {
super();
}
function DelegateArgs(f) {
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local3 = arguments.callee.target;
var _local4 = arguments.callee.func;
var _local2 = arguments.callee.arg;
_local2 = _local2.concat(arguments);
return(_local4.apply(_local3, _local2));
};
_local2.target = obj;
_local2.func = func;
_local2.arg = arguments.slice(2);
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1036 MovieClip [__Packages.MCObstacles] Frame 0
class MCObstacles extends MovieClip
{
var bActive, Etat, gotoAndStop, onEnterFrame;
function MCObstacles (l_sType) {
super();
_global.C.addObstacle(this, l_sType);
bActive = false;
Etat = "Idle";
gotoAndStop("Idle");
onEnterFrame = function () {
this.EnterFrame();
};
}
function activate() {
bActive = true;
}
function deactivate() {
bActive = false;
}
function getType() {
return(STRING_TYPE);
}
function getActive() {
return(bActive);
}
function EnterFrame() {
this[Etat]();
}
var STRING_TYPE = undefined;
}
Symbol 1037 MovieClip [__Packages.MCSlobber] Frame 0
class MCSlobber extends MCObstacles
{
var Etat, gotoAndStop, onRollOver, removeMovieClip, Anim;
function MCSlobber () {
super(STRING_TYPE);
activate();
}
function activate() {
super.activate();
Etat = "Appear";
gotoAndStop("Appear");
onRollOver = fRemove;
}
function deactivate() {
super.deactivate();
}
function fRemove() {
deactivate();
Etat = "Disapear";
gotoAndStop("Disapear");
}
function cancelAction() {
removeMovieClip();
}
function Appear() {
if (Anim._currentframe == Anim._totalframes) {
Etat = "Idle";
gotoAndStop("Idle");
}
}
function Disapear() {
if (Anim._currentframe == Anim._totalframes) {
cancelAction();
_global.C.removeObstacle(this);
}
}
var STRING_TYPE = "Slobber";
}
Symbol 1038 MovieClip [__Packages.sarbakan.visual.PauseManager] Frame 0
class sarbakan.visual.PauseManager extends MovieClip
{
static var oPausableList, bPaused;
var _parent, _visible, swapDepths, removeMovieClip;
function PauseManager () {
super();
if (!oPausableList) {
reset();
}
register(_parent);
_visible = false;
swapDepths(999999);
removeMovieClip();
bPaused = false;
}
static function register(l_mc) {
oPausableList[l_mc] = l_mc;
l_mc.onUnload = function () {
sarbakan.visual.PauseManager.remove(this);
};
}
static function remove(l_mc) {
delete oPausableList[l_mc];
}
static function reset() {
oPausableList = {};
}
static function pause() {
for (var _local1 in oPausableList) {
oPausableList[_local1].stop();
}
bPaused = true;
}
static function unpause() {
for (var _local1 in oPausableList) {
oPausableList[_local1].play();
}
bPaused = false;
}
}
Symbol 1039 MovieClip [__Packages.MCDropPoint] Frame 0
class MCDropPoint extends MovieClip
{
var stop, _visible;
function MCDropPoint () {
super();
_global.C.addDropPoint(this);
stop();
_visible = false;
}
function getType() {
return(STRING_TYPE);
}
var STRING_TYPE = "undefined";
}
Symbol 1040 MovieClip [__Packages.MCSpeaker] Frame 0
class MCSpeaker extends MCDropPoint
{
function MCSpeaker () {
super();
}
var STRING_TYPE = "Speaker";
}
Symbol 1041 MovieClip [__Packages.MCSpot] Frame 0
class MCSpot extends MCDropPoint
{
function MCSpot () {
super();
}
var STRING_TYPE = "Spot";
}
Symbol 1042 MovieClip [__Packages.MCGary] Frame 0
class MCGary extends MCObstacles
{
var gotoAndStop, Etat, onRelease, deactivate, _xscale, _x, nSlobber, _parent, _y, mcEdgeDetector, localToGlobal, Anim, activate;
function MCGary () {
super(STRING_TYPE);
gotoAndStop("Hide");
Etat = "Hide";
}
function setObstacle() {
if (Etat == "Hide") {
fShow();
onRelease = fHide;
}
}
function fShow() {
Etat = "Appear";
gotoAndStop("Appear");
}
function fHide() {
Etat = "Disapear";
gotoAndStop("Disapear");
deactivate();
delete onRelease;
}
function fUpdate() {
if (!_global.Pack.bPaused) {
var _local3;
if (_xscale > 0) {
_local3 = 1;
} else {
_local3 = -1;
}
_x = _x + (NUMBER_SPEED * _local3);
addSlobber();
FearEdge();
}
}
function addSlobber() {
nSlobber--;
if ((nSlobber <= 0) && (_global.C.oGame.oLevel.oObstacleManager.garyCollide())) {
var _local4 = _parent.SlobberPast.getNextHighestDepth();
var _local3 = _parent.SlobberPast.attachMovie("slobber", "slobber" + _local4, _local4);
_local3._x = _x;
_local3._y = _y;
nSlobber = NUMBER_SLOBBER;
} else if (nSlobber <= 0) {
nSlobber = NUMBER_SLOBBER;
}
}
function FearEdge() {
var _local2 = new Object({x:mcEdgeDetector._x, y:mcEdgeDetector._y});
localToGlobal(_local2);
if (!_parent.mcFloor.hitTest(_local2.x, _local2.y, true)) {
_xscale = _xscale * -1;
}
}
function Appear() {
if (Anim._currentframe == Anim._totalframes) {
activate();
nSlobber = NUMBER_SLOBBER;
Etat = "Walk";
gotoAndStop("Walk");
}
}
function Walk() {
fUpdate();
}
function Disapear() {
if (Anim._currentframe == Anim._totalframes) {
Etat = "Hide";
gotoAndStop("Hide");
}
}
function Hide() {
}
var STRING_TYPE = "Gary";
static var NUMBER_SPEED = 2;
static var NUMBER_SLOBBER = 15;
}
Symbol 1043 MovieClip [__Packages.sarbakan.utils.Time] Frame 0
class sarbakan.utils.Time
{
var nSeconds, nMinutes, nFrames;
function Time (l_nMinutes, l_nSeconds) {
nSeconds = l_nSeconds;
nMinutes = l_nMinutes;
nFrames = 0;
}
function update() {
nFrames--;
if (nFrames < 0) {
nSeconds--;
if (nSeconds < 0) {
nMinutes = Math.max(nMinutes - 1, 0);
nSeconds = 59;
}
nFrames = NUMBER_FRAME_RATE - 1;
}
}
function addTime(l_oTime) {
nSeconds = nSeconds + l_oTime.seconds;
while (nSeconds >= 60) {
nSeconds = nSeconds - 60;
nMinutes++;
}
nMinutes = nMinutes + l_oTime.minutes;
}
function get timeOut() {
return(((nFrames <= 0) && (nSeconds <= 0)) && (nMinutes <= 0));
}
function get frames() {
return(nFrames);
}
function get seconds() {
return(nSeconds);
}
function get minutes() {
return(nMinutes);
}
function set seconds(l_nSeconds) {
nSeconds = l_nSeconds;
nFrames = 0;
//return(seconds);
}
function set frames(l_nFrames) {
nFrames = l_nFrames;
while (nFrames >= NUMBER_FRAME_RATE) {
nSeconds++;
nFrames = nFrames - NUMBER_FRAME_RATE;
while (nSeconds >= 60) {
nSeconds = nSeconds - 60;
nMinutes++;
}
}
//return(frames);
}
function get exactSecond() {
return(nFrames == NUMBER_FRAME_RATE);
}
function set minutes(l_nMinutes) {
nMinutes = l_nMinutes;
//return(minutes);
}
var NUMBER_FRAME_RATE = 30;
}
Symbol 1044 MovieClip [__Packages.MCLadder] Frame 0
class MCLadder extends MovieClip
{
function MCLadder () {
super();
_global.C.addLadder(this);
}
}
Symbol 1045 MovieClip [__Packages.MCPatrick] Frame 0
class MCPatrick extends MovieClip
{
function MCPatrick () {
super();
_global.C.addPatrick(this);
}
}
Symbol 1046 MovieClip [__Packages.MCBubbles] Frame 0
class MCBubbles extends MCObstacles
{
var bMouseOver, _visible, Etat, gotoAndStop, onRollOver, onRollOut, onMouseMove, nStrength, Anim;
function MCBubbles () {
super(STRING_TYPE);
bMouseOver = false;
_visible = false;
_global.C.addObstacle(this, STRING_TYPE);
}
function activate() {
super.activate();
Etat = "Appear";
gotoAndStop("Appear");
_visible = true;
}
function deactivate() {
super.deactivate();
}
function setObstacle() {
activate();
onRollOver = fRollOver;
onRollOut = fRollOut;
onMouseMove = fMouseMove;
nStrength = NUMBER_STRENGTH;
}
function fRollOver() {
bMouseOver = true;
reduceSize();
}
function fRollOut() {
bMouseOver = false;
}
function fMouseMove() {
if (bMouseOver) {
reduceSize();
}
}
function reduceSize() {
nStrength--;
Anim.gotoAndStop(Math.round(Anim._totalframes - ((nStrength * Anim._totalframes) / 100)));
if (nStrength <= 0) {
deactivate();
delete onRollOver;
delete onRollOut;
delete onMouseMove;
Etat = "Disapear";
gotoAndStop("Disapear");
}
}
function cancelAction() {
_visible = false;
}
function Appear() {
if (Anim._currentframe == Anim._totalframes) {
Etat = "Idle";
gotoAndStop("Idle");
Anim.stop();
}
}
function Idle() {
}
function Disapear() {
if (Anim._currentframe == Anim._totalframes) {
cancelAction();
bMouseOver = false;
_global.C.removeObstacle(this);
}
}
static var NUMBER_STRENGTH = 100;
var STRING_TYPE = "Bubbles";
}
Symbol 1047 MovieClip [__Packages.MCBanana] Frame 0
class MCBanana extends MCObstacles
{
var _visible, Etat, gotoAndStop, onRelease, Anim;
function MCBanana () {
super(STRING_TYPE);
_visible = false;
}
function activate() {
super.activate();
_visible = true;
}
function deactivate() {
super.deactivate();
}
function setObstacle() {
Etat = "Appear";
gotoAndStop("Appear");
activate();
onRelease = fRemove;
}
function fRemove() {
Etat = "Disapear";
gotoAndStop("Disapear");
deactivate();
delete onRelease;
_global.C.removeObstacle(this);
}
function getType() {
return(STRING_TYPE);
}
function cancelAction() {
_visible = false;
}
function Appear() {
if (Anim._currentframe == Anim._totalframes) {
Etat = "Idle";
gotoAndStop("Idle");
}
}
function Idle() {
}
function Disapear() {
if (Anim._currentframe == Anim._totalframes) {
cancelAction();
}
}
var STRING_TYPE = "Banana";
}
Symbol 1048 MovieClip [__Packages.MiniGame] Frame 0
class MiniGame extends MovieClip
{
var keyListener, nKeyUsed, nTimeWait, sEtat, nTimeToWait, ActionDone, nKeyToUse, nElementToUse, RepeatAction, mcRef, aKeyToActive;
function MiniGame () {
super();
_global.C.oGame.mcMiniGame = _global.C.oGame.mcGame.MiniGame;
_global.MiniGame = this;
keyListener = new Object();
nKeyUsed = 0;
nTimeWait = 0;
sEtat = "Wait";
setVars();
}
function update() {
this[sEtat]();
}
function setVars() {
nTimeToWait = _global.C.oGame.nTimeBetweenMG + random(TIME_RANDOM);
}
function Wait() {
nTimeWait++;
if ((nTimeWait > nTimeToWait) && (_global.C.oGame.oLevel.oPatrick.sState == "Move")) {
nTimeWait = 0;
ActionDone = 0;
nKeyToUse = 0;
setVars();
PrepareStage();
var _local3 = random(100);
if ((_local3 < 33) && (nElementToUse != 1)) {
RepeatAction = 15;
nElementToUse = 1;
} else if ((_local3 < 66) && (nElementToUse != 2)) {
RepeatAction = 7;
nElementToUse = 2;
} else if (nElementToUse != 3) {
RepeatAction = 4;
nElementToUse = 3;
} else {
RepeatAction = 7;
nElementToUse = 2;
}
mcRef.gotoAndStop(nElementToUse);
CreateArray();
sEtat = "Pass";
}
}
function CreateArray() {
aKeyToActive = new Array();
var _local3 = Tools.doCopyArray(aKeyPossible);
while (aKeyToActive.length < nElementToUse) {
var _local2 = random(_local3.length);
mcRef["Key" + aKeyToActive.length].Key_txt.text = String.fromCharCode(_local3[_local2]);
if (aKeyToActive.length == 0) {
mcRef.Window_txt.text = mcRef.Window_txt.text + String(mcRef["Key" + aKeyToActive.length].Key_txt.text);
mcRef["Key" + aKeyToActive.length].gotoAndStop(2);
} else {
mcRef.Window_txt.text = mcRef.Window_txt.text + (", " + String(mcRef["Key" + aKeyToActive.length].Key_txt.text));
}
aKeyToActive.push(_local3[_local2]);
_local3.splice(_local2, 1);
}
}
function PrepareStage() {
_global.C.oGame.bMiniGame = true;
_global.C.oGame.oLevel.oPatrick.mc._parent._parent.mcSpongebob.gotoAndStop("OffScreen");
_global.C.oGame.mcGame.MiniGame.gotoAndPlay("appear");
mcRef = _global.C.oGame.mcGame.MiniGame.GameScreen;
mcRef.Barre._xscale = 0;
CreateOnPress();
}
function Pass() {
if (nKeyUsed != 0) {
CheckActionEnter();
nKeyUsed = 0;
if (ActionDone == RepeatAction) {
Succead();
}
}
}
function CheckActionEnter() {
if (nKeyUsed == aKeyToActive[nKeyToUse]) {
mcRef["Key" + nKeyToUse].gotoAndStop(1);
nKeyToUse++;
mcRef.Barre._xscale = Number(((nKeyToUse + (ActionDone * nElementToUse)) / (RepeatAction * nElementToUse)) * 100);
if (nKeyToUse >= aKeyToActive.length) {
nKeyToUse = 0;
ActionDone++;
}
mcRef["Key" + nKeyToUse].gotoAndStop(2);
}
}
function CheckButtonEnter(_code) {
if (_code == aKeyToActive[nKeyToUse]) {
mcRef["Key" + nKeyToUse].gotoAndStop(3);
}
}
function Succead() {
sEtat = "Wait";
mcRef.gotoAndStop(Number(mcRef._currentframe + 3));
_global.C.oGame.AjustScore(_global.C.oGame.nMiniFunds, "Funds");
_global.C.oGame.oLevel.oPatrick.mc._parent._parent.mcSpongebob.gotoAndStop("inScreen");
_global.C.oGame.mcGame.MiniGame.gotoAndPlay("disapear");
_global.C.oGame.bMiniGame = false;
ClearControls();
}
function CreateOnPress() {
keyListener.onKeyUp = function () {
_global.MiniGame.nKeyUsed = Key.getCode();
};
keyListener.onKeyDown = function () {
_global.MiniGame.CheckButtonEnter(Key.getCode());
};
Key.addListener(keyListener);
}
function ClearControls() {
Key.removeListener(keyListener);
}
var DEFAULT_STATE = "update";
var TIME_RANDOM = 200;
var aKeyPossible = ["81", "87", "82", "84", "80", "76", "75", "74", "72", "71", "70", "68", "83"];
}
Symbol 1049 MovieClip [__Packages.Tools] Frame 0
class Tools
{
function Tools () {
}
static function isItemInArray(__aArray, __oItem) {
var _local2 = false;
for (var _local4 in __aArray) {
if (__aArray[_local4] == __oItem) {
_local2 = true;
}
}
return(_local2);
}
static function doCopyArray(__aArraySource) {
var _local3 = new Array();
var _local1 = 0;
_local1 = 0;
while (_local1 < __aArraySource.length) {
if (__aArraySource[_local1] instanceof Array) {
_local3.push(doCopyArray(__aArraySource[_local1]));
} else {
_local3.push(__aArraySource[_local1]);
}
_local1++;
}
return(_local3);
}
}
Symbol 1050 MovieClip [__Packages.Controller] Frame 0
class Controller extends MovieClip
{
var oGame, _parent, onEnterFrame;
function Controller () {
super();
_global.C = this;
oGame = new Game(_parent.mcGame);
onEnterFrame = update;
}
function update() {
oGame.update();
}
function addLadder(l_mcLadder) {
oGame.addLadder(l_mcLadder);
}
function addFloor(l_mcFloor) {
oGame.addFloor(l_mcFloor);
}
function addDropPoint(l_mcDropPoint) {
oGame.addDropPoint(l_mcDropPoint);
}
function addPatrick(l_mcPatrick) {
oGame.addPatrick(l_mcPatrick);
}
function addObstacle(l_mcObstacle, l_sType) {
oGame.addObstacle(l_mcObstacle, l_sType);
}
function removeObstacle(l_mcObstacle) {
oGame.removeObstacle(l_mcObstacle);
}
function dropBox(l_bCorrect) {
oGame.dropBox(l_bCorrect);
}
}
Symbol 1051 MovieClip [__Packages.Game] Frame 0
class Game
{
var mcGame, bGamePlaying, bMiniGame, oLevel, nMiniFunds, nTimeBetweenMG, nTempFund, nTempIncome, nTempSpend, mcMiniGame;
function Game (l_mcGame) {
trace("-----------------------------------------------");
trace("Level = " + _global.Pack.nLevel);
mcGame = l_mcGame;
bGamePlaying = true;
bMiniGame = false;
var _local3 = _global.Pack.nLevel;
while (_local3 > 5) {
_local3 = _local3 - 5;
}
mcGame.gotoAndStop("Level" + _local3);
oLevel = new Level(_global.Pack.nLevel, mcGame);
nMiniFunds = Number(830 - (30 * _global.Pack.nLevel));
nTimeBetweenMG = Number(1220 - (20 * _global.Pack.nLevel));
if (nTimeBetweenMG < 400) {
nTimeBetweenMG = 400;
}
if (nMiniFunds < 150) {
nMiniFunds = 150;
}
nTempFund = _global.Pack.nFunds;
nTempIncome = 0;
nTempSpend = 0;
AjustScore(0, "Funds");
AjustScore(0, "Score");
_global.Pack.unPauseGame();
trace("nFunds per miss = " + Number(450 + (_global.Pack.nLevel * 50)));
trace("pay Per miniGame = " + nMiniFunds);
trace("time Between miniGame = " + nTimeBetweenMG);
trace("-----------------------------------------------");
}
function update() {
if (!_global.Pack.bPaused) {
oLevel.update();
mcMiniGame.update();
}
}
function addLadder(l_mcLadder) {
oLevel.addLadder(l_mcLadder);
}
function addFloor(l_mcFloor) {
oLevel.addFloor(l_mcFloor);
}
function addDropPoint(l_mcDropPoint) {
oLevel.addDropPoint(l_mcDropPoint);
}
function addPatrick(l_mcPatrick) {
oLevel.addPatrick(l_mcPatrick);
}
function addObstacle(l_mcObstacle, l_sType) {
oLevel.addObstacle(l_mcObstacle, l_sType);
}
function removeObstacle(l_mcObstacle) {
oLevel.removeObstacle(l_mcObstacle);
}
function dropBox(l_bCorrect) {
oLevel.dropBox(l_bCorrect);
if (!l_bCorrect) {
AjustScore(Number(-450 - (_global.Pack.nLevel * 50)), "Funds");
} else {
AjustScore(Number(450 + (_global.Pack.nLevel * 50)), "Score");
}
}
function createLevel() {
_global.Transition.play();
_global.Transition.TransFunc = function () {
_global.Pack.nLevel++;
_global.GS.gotoAndStop("Game");
};
}
function AjustScore(_Txt, _Kind) {
var _local4 = 0;
if (_Kind == "Score") {
_global.Pack.nScore = _global.Pack.nScore + _Txt;
mcGame.Hud.nScore_txt.text = _global.Pack.nScore;
} else {
_global.Pack.nFunds = _global.Pack.nFunds + _Txt;
if (_global.Pack.nFunds < 0) {
EndGame(false);
mcGame.Hud.nFunds_txt.text = "$ 0";
} else {
mcGame.Hud.nFunds_txt.text = "$ " + _global.Pack.nFunds;
}
if (_Txt > 0) {
nTempIncome = nTempIncome + _Txt;
} else {
nTempSpend = nTempSpend - _Txt;
}
}
}
function EndGame(p_bSuccces) {
bGamePlaying = false;
oLevel.oPatrick.ClearControls();
mcGame.FinishScreen.gotoAndPlay("appear");
if (p_bSuccces) {
AjustScore(1000, "Funds");
if (!_global.Pack.bBonus) {
mcGame.FinishScreen.Table.gotoAndStop(1);
} else {
mcGame.FinishScreen.Table.gotoAndStop(2);
}
} else {
_global.MiniGame.ClearControls();
if (_global.MiniGame._parent._currentframe != 1) {
_global.MiniGame._parent.gotoAndPlay("disapear");
}
mcGame.FinishScreen.Table.gotoAndStop(3);
}
_global.Pack.pauseGame();
}
function pasteInfo(p_mcMovie) {
p_mcMovie.nLevel_txt.text = _global.Pack.nLevel;
p_mcMovie.StartFunds_txt.text = "$ " + nTempFund;
p_mcMovie.FundsEarn_txt.text = "$ " + nTempIncome;
p_mcMovie.FundsSpend_txt.text = "$ " + nTempSpend;
if (_global.Pack.bBonus) {
_global.Pack.nFunds = _global.Pack.nFunds + 100;
mcGame.Hud.nFunds_txt.text = "$ " + _global.Pack.nFunds;
}
p_mcMovie.Remain_txt.text = "$ " + _global.Pack.nFunds;
}
}
Symbol 1052 MovieClip [__Packages.Level] Frame 0
class Level
{
var aLadders, aDropPoints, mcGame, nTotalDropPoints, DropPointType, sState, oObstacleManager, oBoxes, oLayerManager, oLevelLayer, oPatrick, oDropPoint, oCam, fEasing;
function Level (l_nLevel, l_mcGame) {
aLadders = new Array();
aDropPoints = new Array();
mcGame = l_mcGame;
nTotalDropPoints = 5 + Math.floor((_global.Pack.nLevel - 1) / 5);
if (nTotalDropPoints > 12) {
nTotalDropPoints = 12;
}
trace("nTotalDropPoints = " + nTotalDropPoints);
DropPointType = "None";
sState = "setNewDropPoint";
oObstacleManager = new ObstacleGenerator(new sarbakan.utils.Time(0, 9));
oBoxes = new Object();
setLayerManager();
}
function update() {
this[sState]();
oLayerManager.update();
}
function addLadder(l_mcLadder) {
aLadders.push(l_mcLadder);
oLevelLayer.oCollisionMaps.ladders.setNewSource(l_mcLadder);
oLevelLayer.oCollisionMaps.ladders.show(100);
}
function addFloor(l_mcFloor) {
oLevelLayer.oCollisionMaps.floor.setNewSource(l_mcFloor);
oLevelLayer.oCollisionMaps.floor.show(100);
}
function addDropPoint(l_mcDropPoint) {
var _local3 = new DropPoint(l_mcDropPoint);
oLevelLayer.addDynamicElement(_local3);
if (oBoxes[l_mcDropPoint.getType()] != undefined) {
oBoxes[l_mcDropPoint.getType()]++;
oBoxes[l_mcDropPoint.getType() + "Total"]++;
} else {
oBoxes[l_mcDropPoint.getType()] = 1;
oBoxes[l_mcDropPoint.getType() + "Total"] = 1;
}
aDropPoints.push(_local3);
}
function addPatrick(l_mcPatrick) {
oPatrick = new Patrick(l_mcPatrick, this, 500);
oPatrick.setControls(mcGame.mcControls);
oLevelLayer.addDynamicElement(oPatrick);
oObstacleManager.__set__patrick(oPatrick);
setCamera();
}
function addObstacle(l_mcObstacle, l_sType) {
oObstacleManager.addObstacle(l_mcObstacle, l_sType);
var _local2 = new Obstacle(l_mcObstacle);
oLevelLayer.addDynamicElement(_local2);
}
function removeObstacle(l_mcObstacle) {
oObstacleManager.removeObstacle(l_mcObstacle);
}
function dropBox(l_bCorrect) {
if (l_bCorrect) {
oDropPoint.mc.gotoAndStop("Item");
oBoxes[oDropPoint.mc.getType()]--;
var _local2;
for (_local2 in aDropPoints) {
if (oDropPoint == aDropPoints[_local2]) {
oDropPoint = undefined;
delete oDropPoint;
aDropPoints.splice(_local2, 1);
}
}
nTotalDropPoints--;
} else {
oDropPoint.mc._visible = false;
}
if (nTotalDropPoints <= 0) {
oPatrick.win();
}
}
function setLayerManager() {
oLayerManager = new sarbakan.visual.layer.LayerManager(mcGame.mcLevel._width, mcGame.mcLevel._height, 600, 300);
oCam = oLayerManager.getCamera();
oLevelLayer = new sarbakan.visual.layer.Layer(mcGame.mcLevel, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(oLevelLayer, 1, 1);
oLevelLayer.addCollisionMap(new sarbakan.visual.layer.CollisionMap("ladders", oLevelLayer, 12632256));
oLevelLayer.addCollisionMap(new sarbakan.visual.layer.CollisionMap("floor", oLevelLayer, 0));
var _local2 = new sarbakan.visual.layer.Layer(mcGame.mcSpongebob, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(_local2, 0, 0.2);
}
function Paused() {
oLayerManager.pause();
}
function unPaused() {
oLayerManager.unpause();
}
function setCamera() {
oCam.lockOn(sarbakan.utils.Delegate.create(oPatrick, oPatrick.getCamCoord), true);
fEasing = mx.transitions.easing.Regular.easeOut;
}
function setNewDropPoint() {
var _local4 = oDropPoint;
var _local3 = 0;
do {
_local3++;
var _local2 = Math.floor(Math.random() * aDropPoints.length);
oDropPoint = aDropPoints[_local2];
if ((_local3 > 15) && (_local4 != oDropPoint)) {
break;
}
} while ((_local4 == oDropPoint) || (getDistanceBetween(oPatrick.mc, oDropPoint.mc) < 350));
DropPointType = oDropPoint.mc.getType();
oDropPoint.activate();
oPatrick.__set__dropPoint(oDropPoint.mc._name);
sState = "WaitForObstacle";
}
function getDistanceBetween(__movie1, __movie2) {
var _local1 = Math.abs(__movie1._x - __movie2._x);
var _local2 = Math.abs(__movie1._y - __movie2._y);
return(_local1 + (_local2 * 3));
}
function WaitForObstacle() {
oObstacleManager.update();
}
}
Symbol 1053 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 1054 MovieClip [__Packages.sarbakan.visual.Camera] Frame 0
class sarbakan.visual.Camera
{
static var oEnterFrameListener;
var nX, nY, nViewZoneW, nViewZoneH, nStageW, nStageH, bLockedOn, nSpeed, bTravelling, oTweenX, fEasing, oTweenY, nTravelDestX, nTravelDestY, fEndListener, fLockedFunction, __get__x, __get__y;
function Camera (l_viewZoneW, l_viewZoneH, l_nStageW, l_nStageH) {
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = mx.utils.Delegate.create(this, update);
MovieClip.removeListener(oEnterFrameListener);
MovieClip.addListener(oEnterFrameListener);
nX = 0;
nY = 0;
nViewZoneW = l_viewZoneW;
nViewZoneH = l_viewZoneH;
nStageW = l_nStageW;
nStageH = l_nStageH;
setSpeed(DEFAULT_SPEED);
setEasing(DEFAULT_EASING);
bLockedOn = false;
}
function travelTo(l_nDestX, l_nDestY, l_fListener) {
var _local2 = Math.round(sarbakan.utils.MoreMath.getDistance(nX * -1, nY * -1, l_nDestX, l_nDestY) / nSpeed);
if (!bTravelling) {
oTweenX = new mx.transitions.Tween(this, "x", fEasing, nX * -1, l_nDestX, _local2, false);
oTweenY = new mx.transitions.Tween(this, "y", fEasing, nY * -1, l_nDestY, _local2, false);
oTweenX.onMotionFinished = mx.utils.Delegate.create(this, onTravelFinished);
} else {
oTweenX.continueTo(l_nDestX, _local2);
oTweenY.continueTo(l_nDestY, _local2);
}
nTravelDestX = l_nDestX;
nTravelDestY = l_nDestY;
if (l_fListener) {
fEndListener = l_fListener;
}
bTravelling = true;
}
function moveTo(l_nDestX, l_nDestY) {
x = (l_nDestX);
y = (l_nDestY);
}
function lockOn(l_fLockFunction, l_bInstant) {
bLockedOn = true;
fLockedFunction = l_fLockFunction;
var _local2 = fLockedFunction();
if ((_local2.x != nX) || (_local2.y != nY)) {
if (l_bInstant) {
moveTo(_local2.x, _local2.y);
} else {
travelTo(_local2.x, _local2.y);
}
}
}
function unlock() {
bLockedOn = false;
fLockedFunction = undefined;
}
function setSpeed(l_nSpeed) {
if (l_nSpeed) {
nSpeed = l_nSpeed;
} else {
setSpeed(DEFAULT_SPEED);
}
}
function setEasing(l_fEasing) {
if (l_fEasing) {
fEasing = l_fEasing;
} else {
setEasing(DEFAULT_EASING);
}
}
function set x(l_nX) {
nX = l_nX;
if (nX < 0) {
nX = 0;
}
if (nX > (nViewZoneW - nStageW)) {
nX = Math.round(nViewZoneW - nStageW);
}
nX = nX * -1;
//return(__get__x());
}
function set y(l_nY) {
nY = l_nY;
if (nY < 0) {
nY = 0;
}
if (nY > (nViewZoneH - nStageH)) {
nY = Math.round(nViewZoneH - nStageH);
}
nY = nY * -1;
//return(__get__y());
}
function getX() {
return(nX);
}
function getY() {
return(nY);
}
function destroy() {
MovieClip.removeListener(oEnterFrameListener);
}
function pause() {
oTweenX.stop();
oTweenY.stop();
}
function unpause() {
oTweenX.resume();
oTweenY.resume();
}
function update() {
if (bLockedOn) {
var _local2;
if ((!bTravelling) && (bLockedOn)) {
_local2 = fLockedFunction();
moveTo(_local2.x, _local2.y);
} else if ((_local2.x != nTravelDestX) || (_local2.y != nTravelDestY)) {
}
}
}
function onTravelFinished() {
bTravelling = false;
if (fEndListener) {
fEndListener();
fEndListener = undefined;
}
}
static var DEFAULT_SPEED = 10;
static var DEFAULT_EASING = mx.transitions.easing.Regular.easeOut;
}
Symbol 1055 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 1056 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 1057 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 1058 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1059 MovieClip [__Packages.sarbakan.utils.MoreMath] Frame 0
class sarbakan.utils.MoreMath
{
function MoreMath () {
}
static function random(l_nMin, l_nMax) {
return(Math.floor(Math.random() * l_nMax) + l_nMin);
}
static function getDistance(l_x1, l_y1, l_x2, l_y2) {
return(Math.sqrt(Math.pow(Math.abs(l_x2 - l_x1), 2) + Math.pow(Math.abs(l_y2 - l_y1), 2)));
}
static function getManhattanDistance(l_x1, l_y1, l_x2, l_y2) {
return(Math.abs(l_x1 - l_x2) + Math.abs(l_y1 - l_y2));
}
static function getAngle(l_oPt1, l_oPt2) {
var _local2 = 0;
var _local3 = 0;
var _local1 = 0;
var _local4 = 0;
_local2 = (l_oPt1.x - l_oPt2.x) * -1;
_local3 = (l_oPt1.y - l_oPt2.y) * -1;
_local1 = Math.atan2(_local3, _local2);
_local1 = (_local1 * 180) / Math.PI;
if (_local1 < 0) {
_local1 = _local1 * -1;
_local4 = 180 - _local1;
_local1 = 180 + _local4;
}
if (_local1 < 0) {
_local1 = _local1 + 360;
}
return(_local1);
}
static function angleDirection(x1, y1, x2, y2) {
var _local7 = Math.abs(x2 - x1);
var _local6 = getDistance(x1, y1, x2, y2);
var _local1 = Math.asin(_local7 / _local6) * 57.2957795130823;
if ((x2 >= x1) && (y2 >= y1)) {
_local1 = 90 + (90 - _local1);
} else if ((x2 <= x1) && (y2 >= y1)) {
_local1 = _local1 + 180;
} else if ((x2 <= x1) && (y2 <= y1)) {
_local1 = 270 + (90 - _local1);
}
return(_local1);
}
static function getRadian(l_oPt1, l_oPt2) {
var _local1 = 0;
var _local2 = 0;
var _local3 = 0;
_local1 = (l_oPt1.x - l_oPt2.x) * -1;
_local2 = (l_oPt1.y - l_oPt2.y) * -1;
_local3 = Math.atan2(_local2, _local1);
return(_local3);
}
static function between(small, large, compare, include) {
var _local1 = false;
if ((include === true) || (include === undefined)) {
if ((small <= compare) && (large >= compare)) {
_local1 = true;
}
} else if ((small < compare) && (large > compare)) {
_local1 = true;
}
return(_local1);
}
static function angleBetween(small, large, compare, include) {
var _local1 = false;
if (small < large) {
if ((small <= compare) && (large >= compare)) {
_local1 = true;
}
} else if ((small <= compare) || (large >= compare)) {
_local1 = true;
}
if (include === false) {
if ((small == compare) || (large == compare)) {
_local1 = false;
}
}
return(_local1);
}
static function angleRange(angle1, angle2) {
var _local1 = Math.abs(angle2 - angle1);
return(Math.min(360 - _local1, _local1));
}
static function positionCompare(l_o2, l_o1, l_nVariation) {
var _local1 = false;
if (isNaN(l_nVariation)) {
l_nVariation = 0;
}
if ((l_o1 != undefined) && (l_o2 != undefined)) {
_local1 = (Math.abs(l_o1.x2 - l_o2.x1) <= l_nVariation) && (Math.abs(l_o1.y2 - l_o2.y1) <= l_nVariation);
}
return(_local1);
}
static function padZero(l_nNumber, l_nSize) {
var _local2 = "";
var _local1;
var _local3 = l_nSize - l_nNumber.toString().length;
_local1 = 0;
while (_local1 < _local3) {
_local2 = _local2 + "0";
_local1++;
}
return(_local2 + l_nNumber.toString());
}
}
Symbol 1060 MovieClip [__Packages.sarbakan.visual.layer.LayerManager] Frame 0
class sarbakan.visual.layer.LayerManager
{
var nStageW, nStageH, oCam, aLayers, bPaused, bWillPause;
function LayerManager (l_nViewZoneW, l_nViewZoneH, l_nStageW, l_nStageH) {
nStageW = l_nStageW;
nStageH = l_nStageH;
oCam = new sarbakan.visual.Camera(l_nViewZoneW, l_nViewZoneH, nStageW, nStageH);
aLayers = [];
bPaused = false;
bWillPause = false;
}
function addLayer(l_oLayer, l_parallaxRatioX, l_parallaxRatioY) {
aLayers.push({layer:l_oLayer, mc:l_oLayer.mc, ratioX:l_parallaxRatioX, ratioY:l_parallaxRatioY});
l_oLayer.init(nStageW, nStageH);
}
function getCamera() {
return(oCam);
}
function destroy() {
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.destroy();
_local2++;
}
oCam.destroy();
}
function pause() {
bWillPause = true;
}
function unpause() {
if (bPaused) {
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.unpause();
_local2++;
}
oCam.unpause();
sarbakan.visual.PauseManager.unpause();
}
bPaused = false;
bWillPause = false;
}
function togglePause() {
if (!bPaused) {
pause();
} else {
unpause();
}
}
function update() {
if (bWillPause) {
bPaused = true;
bWillPause = false;
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.pause();
_local2++;
}
oCam.pause();
sarbakan.visual.PauseManager.pause();
}
if (!bPaused) {
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.update();
_local2++;
}
var _local4 = oCam.getX();
var _local3 = oCam.getY();
_local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].mc._x = _local4 * aLayers[_local2].ratioX;
aLayers[_local2].mc._y = _local3 * aLayers[_local2].ratioY;
_local2++;
}
}
}
}
Symbol 1061 MovieClip [__Packages.Patrick] Frame 0
class Patrick extends sarbakan.visual.element.DynamicElement
{
var setMC, keyListener, enable, oLevel, oConfusionTime, nMaxStrength, nStrength, nStrengthDivider, bActive, bTrapped, bLadder, nTimeSpend, mcArrow, mc, sState, fLoopFunction, oTime, nSpeedX, nSpeedY, setState, collideWithMap, sDropPoint, sLastArrow, sTimedNextAction, getElement, __get__dropPoint;
function Patrick (l_mcPatrick, l_oLevel, l_nMaxStrength) {
super(l_mcPatrick._name);
setMC(l_mcPatrick);
keyListener = new Object();
enable();
oLevel = l_oLevel;
oConfusionTime = undefined;
nMaxStrength = l_nMaxStrength;
nStrength = nMaxStrength;
nStrengthDivider = nMaxStrength / 60;
bActive = false;
bTrapped = false;
bLadder = false;
nTimeSpend = 0;
mcArrow = mc._parent._parent.Arrow_mc;
}
function setAction(l_sAction) {
if (bActive && (!bTrapped)) {
this[l_sAction]();
}
if (mc._parent._parent.mcSpongebob._currentframe != NUMBER_EASTEREGG) {
mc._parent._parent.mcSpongebob.gotoAndStop(l_sAction);
if (mc._parent._parent.mcSpongebob.state._currentframe == mc._parent._parent.mcSpongebob.state._totalframes) {
mc._parent._parent.mcSpongebob.state.gotoAndPlay(1);
}
}
}
function update() {
super.update();
if (bActive) {
if (sState == "Move") {
StrengthManagement();
}
FearEdge();
CheckConfusion();
if (fLoopFunction) {
fLoopFunction();
}
if (oTime) {
oTime.update();
if (oTime.__get__timeOut()) {
fLoopFunction = undefined;
}
}
placeArrow();
} else if (mcArrow._currentframe != 1) {
mcArrow.gotoAndStop(1);
}
}
function setControls(l_mcControls) {
keyListener.onKeyDown = function () {
if ((!_global.C.oGame.bMiniGame) && (!_global.Pack.bPaused)) {
if (Key.isDown(38)) {
_global.C.oGame.oLevel.oPatrick.setAction("MoveUp");
} else if (Key.isDown(37)) {
_global.C.oGame.oLevel.oPatrick.setAction("MoveLeft");
} else if (Key.isDown(39)) {
_global.C.oGame.oLevel.oPatrick.setAction("MoveRight");
} else if (Key.isDown(40)) {
_global.C.oGame.oLevel.oPatrick.setAction("MoveDown");
} else if (Key.isDown(32)) {
_global.C.oGame.oLevel.oPatrick.setAction("DropBoxHere");
} else if (Key.isDown(77)) {
_global.C.oGame.oLevel.oPatrick.setAction("CheerUp");
} else if ((Key.getCode() == 187) || (Key.getCode() == 107)) {
_global.C.oGame.oLevel.oPatrick.setAction("EasterEgg");
}
}
};
Key.addListener(keyListener);
}
function ClearControls() {
Key.removeListener(keyListener);
}
function trap(l_bTrapped, l_mcObstacle) {
bTrapped = l_bTrapped;
if (_global.C.oGame.bGamePlaying) {
if (bTrapped) {
switch (l_mcObstacle.getType()) {
case "Bubbles" :
mc.gotoAndStop("Idle");
mc.state.Bras.gotoAndStop(2);
nSpeedX = 0;
nSpeedY = 0;
fLoopFunction = undefined;
break;
case "Banana" :
case "Slobber" :
setState("BoxLost");
nSpeedX = 0;
nSpeedY = 0;
fLoopFunction = undefined;
l_mcObstacle.fRemove();
_global.C.dropBox(false);
nStrength = nMaxStrength;
break;
case "Gary" :
bTrapped = false;
}
}
}
}
function win() {
Idle();
setState("Winner");
mc.gotoAndStop("Winner");
super.update();
bActive = false;
}
function Winner() {
if (mc.state._currentframe == mc.state._totalframes) {
setState("Idle");
_global.C.oGame.EndGame(true);
}
}
function getCamCoord() {
return({x:(mc._x - NUMBER_HUD_ADJUST) - (NUMBER_SCREEN_WIDTH / 2), y:mc._y - (NUMBER_SCREEN_HEIGHT / 2)});
}
function StrengthManagement() {
if (nStrength > 0) {
nStrength--;
mc.state.mc_Arm.gotoAndStop(Math.ceil((nMaxStrength - nStrength) / nStrengthDivider));
mc.state.Bras.BrasAnim.gotoAndStop(Math.ceil((nMaxStrength - nStrength) / nStrengthDivider));
if (nStrength == 0) {
Idle();
nStrength = nMaxStrength;
setState("DropBox");
mc.gotoAndStop("DropBox");
bActive = false;
if (!collideWithMap("floor", mc.mcEdgeDetector)) {
mc._xscale = mc._xscale * -1;
}
_global.C.dropBox(false);
fLoopFunction = undefined;
}
}
}
function Ballance() {
bActive = false;
nSpeedX = 0;
nSpeedY = 0;
if (mc.state._currentframe == mc.state._totalframes) {
setState("ViewPoint");
mc.gotoAndStop("ViewPoint");
oLevel.setNewDropPoint();
mc._xscale = mc._xscale * -1;
}
}
function FearEdge() {
if (((!collideWithMap("floor", mc.mcEdgeDetector)) && (nSpeedX != 0)) && (mc._y < 300)) {
setState("Ballance");
mc.gotoAndStop("Winner");
nStrength = nMaxStrength;
bActive = false;
_global.C.dropBox(false);
fLoopFunction = undefined;
} else if (((!collideWithMap("floor", mc.mcEdgeDetector)) && (nSpeedX != 0)) && (mc._y > 300)) {
nSpeedX = nSpeedX * -1;
}
}
function CheckConfusion() {
if (oConfusionTime != undefined) {
oConfusionTime.update();
if (oConfusionTime.__get__timeOut()) {
oConfusionTime = undefined;
}
}
}
function Idle() {
nSpeedX = 0;
nSpeedY = 0;
}
function DropBox() {
bActive = false;
nSpeedX = 0;
nSpeedY = 0;
if (mc.state._currentframe == mc.state._totalframes) {
setState("ViewPoint");
mc.gotoAndStop("ViewPoint");
oLevel.setNewDropPoint();
}
}
function BoxLost() {
bActive = false;
nSpeedX = 0;
nSpeedY = 0;
if (mc.state._currentframe == mc.state._totalframes) {
setState("ViewPoint");
mc.gotoAndStop("ViewPoint");
oLevel.setNewDropPoint();
}
}
function BoxDown() {
nSpeedX = 0;
nSpeedY = 0;
bActive = false;
if (mc.state._currentframe == mc.state._totalframes) {
setState("ViewPoint");
mc.gotoAndStop("ViewPoint");
oLevel.setNewDropPoint();
}
}
function BoxReceive() {
if (mc.state._currentframe == mc.state._totalframes) {
bActive = true;
nSpeedY = 0;
setState("Move");
if (mc._xscale == 100) {
nSpeedX = NUMBER_SPEED_X;
} else {
nSpeedX = -NUMBER_SPEED_X;
}
}
}
function ViewPoint() {
bActive = false;
oConfusionTime = undefined;
nStrength = nMaxStrength;
bTrapped = false;
setState("Idle");
if (_global.Pack.nFunds >= 0) {
oLevel.oCam.travelTo((mc._parent[sDropPoint]._x - NUMBER_HUD_ADJUST) - (NUMBER_SCREEN_WIDTH / 2), mc._parent[sDropPoint]._y - (NUMBER_SCREEN_HEIGHT / 2), CamReturn);
}
}
function Start() {
mc.gotoAndStop("Idle");
nTimeSpend++;
if (nTimeSpend > 50) {
nTimeSpend = 0;
setState("ViewPoint");
mc.gotoAndStop("ViewPoint");
}
}
function CamReturn() {
_global.C.oGame.oLevel.oPatrick.setState("BoxReceive");
_global.C.oGame.oLevel.oPatrick.mc.gotoAndStop("BoxReceive");
_global.C.oGame.oLevel.oCam.travelTo((_global.C.oGame.oLevel.oPatrick.mc._x - NUMBER_HUD_ADJUST) - (NUMBER_SCREEN_WIDTH / 2), _global.C.oGame.oLevel.oPatrick.mc._y - (NUMBER_SCREEN_HEIGHT / 2));
}
function MoveLeft() {
if (oConfusionTime && (!bLadder)) {
if (sLastArrow != "Left") {
nStrength = 1;
StrengthManagement();
}
} else if (!bLadder) {
sLastArrow = "Left";
oConfusionTime = new sarbakan.utils.Time(0, 0);
oConfusionTime.__set__frames(10);
nSpeedX = -NUMBER_SPEED_X;
nSpeedY = 0;
setState("Move");
} else {
sTimedNextAction = "MoveLeft";
}
}
function MoveRight() {
if (oConfusionTime && (!bLadder)) {
if (sLastArrow != "Right") {
nStrength = 1;
StrengthManagement();
}
} else if (!bLadder) {
sLastArrow = "Right";
oConfusionTime = new sarbakan.utils.Time(0, 0);
oConfusionTime.__set__frames(10);
nSpeedX = NUMBER_SPEED_X;
nSpeedY = 0;
setState("Move");
} else {
sTimedNextAction = "MoveRight";
}
}
function CheerUp() {
nStrength = nStrength + 150;
nStrength = Math.min(nStrength, nMaxStrength);
}
function MoveDown() {
if (sState == "Move") {
if (LadderCollide(-15)) {
nSpeedX = 0;
nTimeSpend = 0;
nSpeedY = NUMBER_SPEED_Y;
setState("DownLadder");
fLoopFunction = loopLadderDown;
bLadder = true;
oTime = undefined;
} else {
oTime = new sarbakan.utils.Time(0, 1);
oTime.__set__frames(12);
fLoopFunction = loopFindLadderDown;
}
}
}
function loopLadderDown() {
nTimeSpend++;
if (nTimeSpend >= 10) {
if (!LadderCollide(5)) {
if (!sTimedNextAction) {
setRandomDirection();
} else {
setAction(sTimedNextAction);
}
mc._y = mc._y - NUMBER_SPEED_Y;
fLoopFunction = undefined;
bLadder = false;
}
}
}
function loopFindLadderDown() {
if (LadderCollide(-15)) {
oTime = undefined;
nSpeedX = 0;
nTimeSpend = 0;
nSpeedY = NUMBER_SPEED_Y;
setState("DownLadder");
fLoopFunction = loopLadderDown;
bLadder = true;
}
}
function MoveUp() {
if (sState == "Move") {
if (LadderCollide(15)) {
nSpeedX = 0;
nTimeSpend = 0;
nSpeedY = -NUMBER_SPEED_Y;
setState("UpLadder");
fLoopFunction = loopLadderUp;
bLadder = true;
oTime = undefined;
} else {
oTime = new sarbakan.utils.Time(0, 1);
oTime.__set__frames(12);
fLoopFunction = loopFindLadderUp;
}
}
}
function loopLadderUp() {
nTimeSpend++;
if (nTimeSpend >= 10) {
if (!LadderCollide(-5)) {
if (!sTimedNextAction) {
setRandomDirection();
} else {
setAction(sTimedNextAction);
}
mc._y = mc._y + NUMBER_SPEED_Y;
fLoopFunction = undefined;
bLadder = false;
}
}
}
function loopFindLadderUp() {
if (LadderCollide(15)) {
oTime = undefined;
nSpeedX = 0;
nTimeSpend = 0;
nSpeedY = -NUMBER_SPEED_Y;
setState("UpLadder");
fLoopFunction = loopLadderUp;
bLadder = true;
}
}
function LadderCollide(_modifier) {
var _local4 = false;
var _local3 = mc.mcDetector.getBounds(_global.GS);
var _local6 = (_local3.xMax + _local3.xMin) / 2;
var _local5 = _local3.yMax - _modifier;
if (mc._parent.Ladders.hitTest(_local6, _local5, true)) {
_local4 = true;
} else {
bLadder = false;
}
return(_local4);
}
function DropPointCollide() {
var _local2 = false;
if (mc.hitTest(mc._parent[sDropPoint]) && (getElement(sDropPoint).mc._currentframe == 1)) {
_local2 = true;
}
return(_local2);
}
function DropBoxHere() {
if ((!bLadder) && (DropPointCollide())) {
setState("BoxDown");
mc.gotoAndStop("BoxDown");
_global.C.dropBox(true);
} else if (!bLadder) {
setState("BoxDown");
mc.gotoAndStop("BoxDown");
_global.C.dropBox(false);
}
}
function setRandomDirection() {
nSpeedY = 0;
setState("Move");
var _local2 = Math.ceil(Math.random() * 2);
if (_local2 == 1) {
nSpeedX = -NUMBER_SPEED_X;
} else {
nSpeedX = NUMBER_SPEED_X;
}
}
function set dropPoint(l_sDropPoint) {
sDropPoint = l_sDropPoint;
//return(__get__dropPoint());
}
function placeArrow() {
var _local3 = false;
var _local2 = "";
if (Math.abs(mc._y - mc._parent[sDropPoint]._y) > 100) {
_local3 = true;
if ((mc._y - mc._parent[sDropPoint]._y) > 0) {
_local2 = _local2 + "U";
} else {
_local2 = _local2 + "D";
}
}
if (Math.abs(mc._x - mc._parent[sDropPoint]._x) > 250) {
_local3 = true;
if ((mc._x - mc._parent[sDropPoint]._x) > 0) {
_local2 = _local2 + "L";
} else {
_local2 = _local2 + "R";
}
} else if (Math.abs(mc._y - mc._parent[sDropPoint]._y) < 150) {
_local3 = false;
}
if (_local3) {
mcArrow.gotoAndStop(_local2);
} else {
mcArrow.gotoAndStop(1);
}
}
static var NUMBER_SPEED_X = 3;
static var NUMBER_SPEED_Y = 2;
static var NUMBER_PATRICK_MEMORY = 30;
static var NUMBER_SCREEN_WIDTH = 600;
static var NUMBER_SCREEN_HEIGHT = 300;
static var NUMBER_HUD_ADJUST = 65;
static var NUMBER_EASTEREGG = 46;
var DEFAULT_STATE = "Start";
var nTimeViewPoint = 50;
}
Symbol 1062 MovieClip [__Packages.DropPoint] Frame 0
class DropPoint extends sarbakan.visual.element.DynamicElement
{
var setMC, mc;
function DropPoint (l_mcDropPoint) {
super(l_mcDropPoint._name);
setMC(l_mcDropPoint);
}
function activate() {
mc._visible = true;
}
}
Symbol 1063 MovieClip [__Packages.ObstacleGenerator] Frame 0
class ObstacleGenerator
{
var oTime, oObstacles, oPatrick, aActiveObstacles, oOriginalTime, __get__time, __get__patrick;
function ObstacleGenerator (l_oTimeGeneratorSpeed) {
setObject();
time = (l_oTimeGeneratorSpeed);
}
function update() {
oTime.update();
if (oTime.__get__timeOut()) {
var _local6 = 0;
while (_local6 < 5) {
var _local3;
var _local2;
var _local4 = 0;
do {
_local3 = Math.floor(Math.random() * ARRAY_OBSTACLE_TYPES.length);
_local2 = ARRAY_OBSTACLE_TYPES[_local3];
_local4++;
if (_local4 > 25) {
break;
}
} while ((_local4 < 4) && ((oObstacles[_local2].length == 0) || ((oObstacles[_local2].length == 1) && (oObstacles[_local2][0].getActive()))));
if (_local4 < 4) {
var _local5 = 0;
do {
_local5++;
if (_local5 > 10) {
break;
}
_local3 = Math.floor(Math.random() * oObstacles[_local2].length);
} while (oObstacles[_local2][_local3].getActive());
}
if (getDistanceBetween(oPatrick.mc, oObstacles[_local2][_local3]) > 350) {
_local6 = 10;
}
_local6++;
}
oObstacles[_local2][_local3].setObstacle();
aActiveObstacles.push(oObstacles[_local2][_local3]);
reset();
}
Collide();
}
function getDistanceBetween(__movie1, __movie2) {
var _local1 = Math.abs(__movie1._x - __movie2._x);
var _local2 = Math.abs(__movie1._y - __movie2._y);
return(_local1 + (_local2 * 3));
}
function addObstacle(l_mcObstacle, l_sType) {
oObstacles[l_sType].push(l_mcObstacle);
if (l_sType == "Slobber") {
aActiveObstacles.push(l_mcObstacle);
}
}
function removeObstacle(l_mcObstacle) {
for (var _local2 in aActiveObstacles) {
if (l_mcObstacle == aActiveObstacles[_local2]) {
aActiveObstacles.splice(_local2, 1);
}
}
}
function reset() {
var _local4 = oOriginalTime.__get__minutes();
var _local3 = oOriginalTime.__get__seconds() - Math.floor(_global.Pack.nLevel / 3);
if (_local3 < 5) {
_local3 = 5;
}
oTime = new sarbakan.utils.Time(_local4, _local3);
}
function setObject() {
var _local2;
oObstacles = new Object();
for (_local2 in ARRAY_OBSTACLE_TYPES) {
oObstacles[ARRAY_OBSTACLE_TYPES[_local2]] = new Array();
}
aActiveObstacles = new Array();
}
function Collide() {
var _local2;
oPatrick.trap(false);
if (oPatrick.bActive && (oPatrick.sState == "Move")) {
for (_local2 in aActiveObstacles) {
if (oPatrick.mc.mcDetector.hitTest(aActiveObstacles[_local2])) {
if (aActiveObstacles[_local2].getType() != "Gary") {
oPatrick.trap(true, aActiveObstacles[_local2]);
}
}
}
}
}
function addTime(l_oTime) {
oTime.addTime(l_oTime);
}
function set time(l_oTime) {
oTime = l_oTime;
oOriginalTime = new sarbakan.utils.Time(l_oTime.__get__minutes(), l_oTime.__get__seconds());
var _local3 = l_oTime.__get__seconds() - Math.floor(_global.Pack.nLevel / 3);
if (_local3 < 5) {
_local3 = 5;
}
trace("time between event = " + _local3);
//return(__get__time());
}
function set patrick(l_oPatrick) {
oPatrick = l_oPatrick;
//return(__get__patrick());
}
function garyCollide() {
var _local2;
for (_local2 in aActiveObstacles) {
if (aActiveObstacles[_local2].getType() == "Slobber") {
if (oPatrick.mc._parent.gary.mcEdgeDetector.hitTest(aActiveObstacles[_local2])) {
return(false);
}
}
}
return(true);
}
var ARRAY_OBSTACLE_TYPES = new Array("Bubbles", "Bubbles", "Bubbles", "Banana", "Banana", "Banana", "Gary", "Gary");
}
Symbol 1064 MovieClip [__Packages.MCFloor] Frame 0
class MCFloor extends MovieClip
{
function MCFloor () {
super();
_global.C.addFloor(this);
}
}
Symbol 1065 MovieClip [__Packages.Obstacle] Frame 0
class Obstacle extends sarbakan.visual.element.DynamicElement
{
var setMC;
function Obstacle (l_mcObstacle) {
super(l_mcObstacle._name);
setMC(l_mcObstacle);
}
}
Symbol 1066 MovieClip [__Packages.sarbakan.visual.activation.NoActivation] Frame 0
class sarbakan.visual.activation.NoActivation extends sarbakan.visual.activation.ActivationManager
{
var aDynamicElements;
function NoActivation () {
super();
aDynamicElements = [];
}
function addDynamicElement(l_oElement, l_nX, l_nY, l_nWidth, l_nHeight) {
l_oElement.enable();
aDynamicElements.push(l_oElement);
}
function addAlwaysActiveElement(l_oElement) {
l_oElement.enable();
aDynamicElements.push(l_oElement);
}
function removeDynamicElement(l_oElement) {
for (var _local3 in aDynamicElements) {
if (aDynamicElements[_local3] == l_oElement) {
aDynamicElements.splice(_local3, 1);
break;
}
}
}
function addStaticElement(l_oElement, l_nX, l_nY, l_nWidth, l_nHeight) {
l_oElement._visible = true;
}
function getActiveElements() {
return(aDynamicElements);
}
}
Symbol 72 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 1
_global.Sounds.PlayASound("gluein");
Symbol 81 MovieClip Frame 1
_global.Sounds.PlayASound("glueout");
Symbol 82 MovieClip [Slobber] Frame 1
#initclip 41
Object.registerClass("Slobber", MCSlobber);
#endinitclip
Symbol 89 MovieClip Frame 5
stop();
Symbol 94 Button
on (release) {
_global.Pack.Code();
}
Symbol 110 Button
on (release) {
fromTitle = true;
gotoAndStop ("HighScores");
}
Symbol 114 Button
on (release) {
_global.Pack.Instruc();
}
Symbol 118 Button
on (release) {
_global.Pack.Play();
}
Symbol 125 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 2
_global.Sounds.PlayASound("transition");
Symbol 125 MovieClip Frame 12
_global.GS.gotoAndStop("resetVar");
Symbol 125 MovieClip Frame 13
TransFunc();
Symbol 136 Button
on (release) {
nextFrame();
}
Symbol 137 Button
on (release) {
_global.Pack.Play();
}
Symbol 167 Button
on (release) {
prevFrame();
}
Symbol 223 MovieClip Frame 1
_global.Sounds.PlayASound(String("pop" + Number(random(5) + 1)));
Symbol 223 MovieClip Frame 5
stop();
Symbol 224 MovieClip Frame 1
stop();
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Instance of Symbol 214 MovieClip in Symbol 224 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(40));
}
Symbol 225 MovieClip Frame 1
stop();
Symbol 225 MovieClip Frame 2
back_btn.useHandCursor = false;
Symbol 227 MovieClip Frame 1
stop();
Symbol 231 Button
on (keyPress "<Left>") {
return(undefined);
}
on (keyPress "<Right>") {
return(undefined);
}
on (keyPress "<Up>") {
return(undefined);
}
on (keyPress "<Down>") {
return(undefined);
}
on (keyPress "<Space>") {
return(undefined);
}
Symbol 233 MovieClip Frame 1
onRelease = function () {
};
useHandCursor = false;
_alpha = 50;
Symbol 250 MovieClip Frame 23
stop();
Symbol 257 MovieClip Frame 35
stop();
Symbol 260 MovieClip Frame 35
stop();
Symbol 261 MovieClip Frame 18
stop();
Symbol 262 MovieClip Frame 1
stop();
Symbol 268 MovieClip [Floor 1] Frame 1
#initclip 59
Object.registerClass("Floor 1", MCFloor);
#endinitclip
this._visible = false;
Symbol 275 MovieClip [_pause] Frame 1
#initclip 42
Object.registerClass("_pause", sarbakan.visual.PauseManager);
#endinitclip
Symbol 278 MovieClip Frame 28
_global.Sounds.PlayASound("objApp", 1, 100);
Symbol 278 MovieClip Frame 45
_parent.gotoAndStop("finish");
Symbol 279 MovieClip [Spot] Frame 1
#initclip 43
Object.registerClass("Spot", MCSpeaker);
#endinitclip
Symbol 282 MovieClip Frame 28
_global.Sounds.PlayASound("objApp", 1, 100);
Symbol 282 MovieClip Frame 45
_parent.gotoAndStop("finish");
Symbol 283 MovieClip [Guitar] Frame 1
#initclip 44
Object.registerClass("Guitar", MCSpot);
#endinitclip
Symbol 286 MovieClip Frame 28
_global.Sounds.PlayASound("objApp", 1, 100);
Symbol 286 MovieClip Frame 45
_parent.gotoAndStop("finish");
Symbol 287 MovieClip [DropPoint] Frame 1
#initclip 45
Object.registerClass("DropPoint", MCSpeaker);
#endinitclip
Symbol 295 MovieClip Frame 28
_global.Sounds.PlayASound("objApp", 1, 100);
Symbol 295 MovieClip Frame 45
_parent.gotoAndStop("finish");
Symbol 296 MovieClip [Spotlight] Frame 1
#initclip 46
Object.registerClass("Spotlight", MCSpot);
#endinitclip
Symbol 299 MovieClip Frame 28
_global.Sounds.PlayASound("objApp", 1, 100);
Symbol 299 MovieClip Frame 45
_parent.gotoAndStop("finish");
Symbol 300 MovieClip [Jellyfish] Frame 1
#initclip 47
Object.registerClass("Jellyfish", MCSpot);
#endinitclip
Symbol 303 MovieClip Frame 28
_global.Sounds.PlayASound("objApp", 1, 100);
Symbol 303 MovieClip Frame 45
_parent.gotoAndStop("finish");
Symbol 304 MovieClip [Flower] Frame 1
#initclip 48
Object.registerClass("Flower", MCSpot);
#endinitclip
Symbol 308 MovieClip Frame 28
_global.Sounds.PlayASound("objApp", 1, 100);
Symbol 308 MovieClip Frame 45
_parent.gotoAndStop("finish");
Symbol 309 MovieClip [Drum] Frame 1
#initclip 49
Object.registerClass("Drum", MCSpot);
#endinitclip
Symbol 313 MovieClip Frame 28
_global.Sounds.PlayASound("objApp", 1, 100);
Symbol 313 MovieClip Frame 45
_parent.gotoAndStop("finish");
Symbol 314 MovieClip [chair] Frame 1
#initclip 50
Object.registerClass("chair", MCSpeaker);
#endinitclip
Symbol 326 MovieClip Frame 28
_global.Sounds.PlayASound("objApp", 1, 100);
Symbol 326 MovieClip Frame 45
_parent.gotoAndStop("finish");
Symbol 327 MovieClip [Burger] Frame 1
#initclip 51
Object.registerClass("Burger", MCSpot);
#endinitclip
Symbol 329 MovieClip Frame 1
this._visible = false;
Symbol 337 MovieClip Frame 2
_global.Sounds.PlayASound("sort");
Symbol 338 MovieClip Frame 3
_global.Sounds.PlayASound("rentre");
Symbol 339 MovieClip Frame 1
_global.Sounds.PlayASound("rampe");
Symbol 340 MovieClip [Gary] Frame 1
#initclip 52
Object.registerClass("Gary", MCGary);
#endinitclip
Symbol 349 MovieClip [Ladders 1] Frame 1
#initclip 53
Object.registerClass("Ladders 1", MCLadder);
#endinitclip
this._visible = false;
Symbol 380 MovieClip Frame 1
stop();
Symbol 410 MovieClip Frame 8
_global.Sounds.PlayASound("walkR", 1, 80);
Symbol 410 MovieClip Frame 22
_global.Sounds.PlayASound("walkL", 1, 80);
Symbol 411 MovieClip Frame 2
_global.Sounds.PlayASound("boiteVole", 1, 80);
Symbol 411 MovieClip Frame 16
_global.Sounds.PlayASound("boiteRecoi", 1, 80);
Symbol 419 MovieClip Frame 2
_global.Sounds.PlayASound("equilibre", 1, 80);
Symbol 419 MovieClip Frame 33
_global.Sounds.PlayASound("boiteTombe", 1, 80);
Symbol 421 MovieClip Frame 23
_global.Sounds.PlayASound("depose", 1, 80);
Symbol 469 MovieClip Frame 11
_global.Sounds.PlayASound("echape", 1, 80);
Symbol 469 MovieClip Frame 24
_global.Sounds.PlayASound("essuiFront", 1, 80);
Symbol 484 MovieClip Frame 3
_global.Sounds.PlayASound("StepL", 1, 80);
Symbol 484 MovieClip Frame 12
_global.Sounds.PlayASound("StepR", 1, 80);
Symbol 484 MovieClip Frame 18
_global.Sounds.PlayASound("StepL", 1, 80);
Symbol 484 MovieClip Frame 25
_global.Sounds.PlayASound("StepR", 1, 80);
Symbol 485 MovieClip Frame 2
_global.Sounds.PlayASound("equilibre", 1, 80);
Symbol 485 MovieClip Frame 37
_global.Sounds.PlayASound("echape", 1, 80);
Symbol 486 MovieClip [Patrick] Frame 1
#initclip 54
Object.registerClass("Patrick", MCPatrick);
#endinitclip
Symbol 488 MovieClip Frame 2
_global.Sounds.PlayASound("bulleApp");
Symbol 489 MovieClip [Bubbles] Frame 1
#initclip 55
Object.registerClass("Bubbles", MCBubbles);
#endinitclip
Symbol 490 MovieClip Frame 2
_global.Sounds.PlayASound("bananeApp");
Symbol 491 MovieClip Frame 2
_global.Sounds.PlayASound("bananeDis");
Symbol 491 MovieClip Frame 10
stop();
Symbol 492 MovieClip [Banana Peel] Frame 1
#initclip 56
Object.registerClass("Banana Peel", MCBanana);
#endinitclip
Symbol 528 MovieClip Frame 4
_global.Sounds.PlayASound(String("Swish" + Number(random(4) + 1)));
Symbol 528 MovieClip Frame 14
_global.Sounds.PlayASound(String("Swish" + Number(random(4) + 1)));
Symbol 528 MovieClip Frame 25
_global.Sounds.PlayASound(String("Swish" + Number(random(4) + 1)));
Symbol 528 MovieClip Frame 38
stop();
Symbol 531 MovieClip Frame 7
_global.Sounds.PlayASound(String("Swish" + Number(random(4) + 1)));
Symbol 531 MovieClip Frame 17
_global.Sounds.PlayASound(String("Swish" + Number(random(4) + 1)));
Symbol 531 MovieClip Frame 28
_global.Sounds.PlayASound(String("Swish" + Number(random(4) + 1)));
Symbol 531 MovieClip Frame 43
stop();
Symbol 536 MovieClip Frame 4
_global.Sounds.PlayASound(String("Swish" + Number(random(4) + 1)));
Symbol 536 MovieClip Frame 17
_global.Sounds.PlayASound(String("Swish" + Number(random(4) + 1)));
Symbol 536 MovieClip Frame 35
stop();
Symbol 539 MovieClip Frame 8
_global.Sounds.PlayASound(String("Swish" + Number(random(4) + 1)));
Symbol 539 MovieClip Frame 19
_global.Sounds.PlayASound(String("Swish" + Number(random(4) + 1)));
Symbol 539 MovieClip Frame 37
stop();
Symbol 561 MovieClip Frame 2
_global.Sounds.PlayASound("chearleader");
Symbol 561 MovieClip Frame 33
stop();
Symbol 566 MovieClip Frame 7
_global.Sounds.PlayASound("gonfle");
Symbol 566 MovieClip Frame 85
gotoAndPlay (30);
Symbol 571 MovieClip Frame 35
_parent.gotoAndStop("Off");
Symbol 580 MovieClip Frame 17
_parent.gotoAndStop("Idle");
Symbol 617 MovieClip Frame 2
_global.Sounds.PlayASound(String("stretch" + Number(random(4) + 1)));
Symbol 664 MovieClip Frame 2
_global.Sounds.PlayASound("Dent");
Symbol 664 MovieClip Frame 10
_global.Sounds.PlayASound("tombe1");
Symbol 664 MovieClip Frame 31
_global.Sounds.PlayASound("rire");
Symbol 670 MovieClip Frame 1
stop();
Symbol 701 MovieClip Frame 2
_global.Sounds.PlayASound("pompe");
Symbol 726 MovieClip Frame 2
_global.Sounds.PlayASound("flute");
Instance of Symbol 665 MovieClip "Bob" in Symbol 727 MovieClip Frame 1
onClipEvent (load) {
this.stop();
}
Symbol 735 MovieClip [_Krab] Frame 1
#initclip 57
Object.registerClass("_Krab", MiniGame);
#endinitclip
stop();
Symbol 735 MovieClip [_Krab] Frame 2
back_btn.useHandCursor = false;
Symbol 735 MovieClip [_Krab] Frame 19
stop();
Symbol 735 MovieClip [_Krab] Frame 20
_global.Sounds.PlayASound("rire");
Symbol 774 MovieClip Frame 1
var l_nStage = _global.Pack.nLevel;
while (l_nStage > 5) {
l_nStage = l_nStage - 5;
}
gotoAndStop(l_nStage);
Symbol 775 MovieClip Frame 1
_global.C.oGame.pasteInfo(this);
Instance of Symbol 763 MovieClip in Symbol 775 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(Number(random(6) + 1));
}
Symbol 776 Button
on (release) {
_parent.play();
trace("create level");
_global.C.oGame.createLevel();
}
Symbol 785 MovieClip Frame 1
_global.C.oGame.pasteInfo(this);
Instance of Symbol 763 MovieClip in Symbol 785 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(Number(random(6) + 1));
}
Symbol 794 MovieClip Frame 1
nLevel_txt.text = _global.Pack.nLevel;
Instance of Symbol 793 MovieClip in Symbol 794 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(Number(random(3) + 1));
}
Symbol 795 Button
on (release) {
_parent.play();
_global.Transition.play();
_global.Transition.TransFunc = function () {
trace("_global.GS._currentframe before = " + _global.GS._currentframe);
_global.GS.gotoAndStop("EndCard");
trace("_global.GS._currentframe after = " + _global.GS._currentframe);
_global.Pack.bInGame = false;
};
}
Symbol 796 MovieClip Frame 1
stop();
Symbol 797 MovieClip Frame 1
stop();
Symbol 797 MovieClip Frame 2
back_btn.useHandCursor = false;
Symbol 797 MovieClip Frame 3
_global.C.oGame.oLevel.oPatrick.mc.state.stop();
trace("Stop Anim");
Symbol 797 MovieClip Frame 19
stop();
Symbol 807 Button
on (release) {
_global.Pack.pauseGame();
gotoAndStop (2);
}
Symbol 811 Button
on (release) {
_global.Pack.pauseGame();
_global.Pack.Instruc();
}
Symbol 814 Button
on (release) {
_global.Sounds.ToMute();
gotoAndStop (2);
}
Symbol 817 Button
on (release) {
_global.Sounds.UnMute();
gotoAndStop (1);
}
Symbol 824 Button
on (release) {
_global.Pack.unPauseGame();
gotoAndStop (1);
}
Symbol 825 Button
on (release) {
_global.Pack.Quit();
}
Symbol 826 MovieClip Frame 1
stop();
Instance of Symbol 818 MovieClip "MuteSymbol" in Symbol 826 MovieClip Frame 1
onClipEvent (load) {
if (_global.Muted) {
gotoAndStop (2);
} else {
stop();
}
}
Symbol 826 MovieClip Frame 2
back_btn.useHandCursor = false;
Symbol 831 MovieClip Frame 1
stop();
Symbol 834 MovieClip Frame 1
this._visible = false;
Symbol 838 MovieClip Frame 1
this._visible = false;
Symbol 842 MovieClip Frame 1
this._visible = false;
Symbol 846 MovieClip Frame 1
this._visible = false;
Instance of Symbol 581 MovieClip "mcSpongebob" in Symbol 848 MovieClip Frame 15
onClipEvent (load) {
this.gotoAndStop("Idle");
}
Instance of Symbol 581 MovieClip "mcSpongebob" in Symbol 848 MovieClip Frame 24
onClipEvent (load) {
this.gotoAndStop("Idle");
}
Instance of Symbol 581 MovieClip "mcSpongebob" in Symbol 848 MovieClip Frame 33
onClipEvent (load) {
this.gotoAndStop("Idle");
}
Instance of Symbol 581 MovieClip "mcSpongebob" in Symbol 848 MovieClip Frame 42
onClipEvent (load) {
this.gotoAndStop("Idle");
}
Instance of Symbol 581 MovieClip "mcSpongebob" in Symbol 848 MovieClip Frame 51
onClipEvent (load) {
this.gotoAndStop("Idle");
}
Symbol 850 MovieClip [Controller] Frame 1
#initclip 58
Object.registerClass("Controller", Controller);
#endinitclip
Symbol 853 Button
on (release) {
gotoAndStop ("TitleCard");
}
Symbol 857 Button
on (release) {
_global.Pack.Play();
}
Symbol 858 Button
on (release) {
submited = false;
gotoAndStop ("HighScores");
}
Symbol 988 Button
on (release) {
submited = true;
gotoAndStop ("HighScores");
}
Symbol 1007 Button
on (release) {
gotoAndStop ("TitleCard");
}
Symbol 1015 Button
on (press) {
ControlScroll.scrollDown = true;
}
on (release, releaseOutside) {
ControlScroll.scrollDown = false;
}
Symbol 1025 Button
on (release) {
_global.HS.submitScore(_global.Pack.nScore);
btn_submit_score._visible = false;
}
Symbol 1026 Button
on (press) {
ControlScroll.scrollUp = true;
}
on (release, releaseOutside) {
ControlScroll.scrollUp = false;
}