Frame 1
stop();
Instance of Symbol 41 MovieClip "mcLoader" in Frame 1
onClipEvent (enterFrame) {
var l_nPc = (_root.getBytesLoaded() / _root.getBytesTotal());
var l_sPc = (Math.floor(l_nPc * 100) + " %");
this.progress = l_sPc;
this.progressShadow = l_sPc;
if (l_nPc == 1) {
_parent.gotoAndPlay("performanceTest");
}
}
Frame 11
sarbakan.utils.PerformanceWatcher.start(35);
Frame 46
_global.PerformanceTestResult = sarbakan.utils.PerformanceWatcher.fps;
sarbakan.utils.PerformanceWatcher.stop();
Frame 47
stop();
Instance of Symbol 1212 MovieClip "mcContainer" in Frame 47
onClipEvent (load) {
}
Symbol 20 MovieClip Frame 1
stop();
Symbol 44 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 48 MovieClip Frame 1
_visible = false;
Symbol 67 MovieClip [_pause] Frame 1
#initclip 54
Object.registerClass("_pause", sarbakan.visual.PauseManager);
#endinitclip
Symbol 101 MovieClip Frame 1
stop();
Symbol 204 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 373 MovieClip Frame 1
stop();
Symbol 1213 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();
}
add(_parent);
_visible = false;
swapDepths(999999);
removeMovieClip();
bPaused = false;
}
static function add(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 1214 MovieClip [__Packages.sarbakan.utils.PerformanceWatcher] Frame 0
class sarbakan.utils.PerformanceWatcher
{
static var nMovieFPS, bActive, oEnterFrameListener, nCurrentFPS, mcDebug, nUpdateCount, nLastGetTimer;
function PerformanceWatcher () {
}
static function start(l_nMovieFPS) {
nMovieFPS = l_nMovieFPS;
if (!bActive) {
bActive = true;
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = mx.utils.Delegate.create(sarbakan.utils.PerformanceWatcher, update);
MovieClip.addListener(oEnterFrameListener);
}
nCurrentFPS = nMovieFPS;
reset();
}
static function stop() {
if (bActive) {
bActive = false;
MovieClip.removeListener(oEnterFrameListener);
stopDebug();
}
}
static function addListener(l_listener, l_nMinFPS, l_bDelete) {
aListeners.push({listener:l_listener, nMinFPS:l_nMinFPS, bDelete:l_bDelete});
}
static function removeListener(l_listener) {
for (var _local2 in aListeners) {
if (aListeners[_local2].listener == l_listener) {
aListeners.splice(_local2, 1);
}
}
}
static function get fps() {
return(nCurrentFPS);
}
static function startDebug(l_mcTimeline) {
mcDebug = l_mcTimeline.createEmptyMovieClip("PerformanceWatcherDebug", DEBUG_DEPTH);
mcDebug._x = (Stage.width - DEBUG_RIGHT_MARGIN) - 50;
mcDebug._y = DEBUG_TOP_MARGIN;
mcDebug.createTextField("field", 2, 0, 0, 50, 50);
var _local1 = new TextFormat();
_local1.font = DEBUG_FONT;
_local1.size = DEBUG_FONT_SIZE;
_local1.color = DEBUG_FONT_COLOR;
_local1.align = "right";
mcDebug.field.setNewTextFormat(_local1);
mcDebug.field.selectable = false;
mcDebug.createTextField("fieldShadow", 1, 1, 1, 50, 50);
var _local2 = new TextFormat();
_local2.font = DEBUG_FONT;
_local2.size = DEBUG_FONT_SIZE;
_local2.color = DEBUG_FONT_SHADOW_COLOR;
_local2.align = "right";
mcDebug.fieldShadow.setNewTextFormat(_local2);
mcDebug.fieldShadow.selectable = false;
}
static function stopDebug() {
if (mcDebug != undefined) {
mcDebug.removeMovieClip();
}
}
static function update() {
if ((++nUpdateCount) == nMovieFPS) {
computeFrameRate();
updateDebug();
notifyListeners();
}
}
static function reset() {
nUpdateCount = 0;
nLastGetTimer = getTimer();
}
static function computeFrameRate() {
var _local1 = getTimer() - nLastGetTimer;
var _local2 = _local1 / 1000;
nCurrentFPS = Math.round(nMovieFPS / _local2);
reset();
}
static function notifyListeners() {
var _local1 = new Array();
for (var _local2 in aListeners) {
if (aListeners[_local2].nMinFPS >= nCurrentFPS) {
aListeners[_local2].listener(nCurrentFPS);
if (aListeners[_local2].bDelete) {
_local1.push(aListeners[_local2].listener);
}
}
}
for (var _local2 in _local1) {
removeListener(_local1[_local2]);
}
}
static function updateDebug() {
if (mcDebug != undefined) {
mcDebug.field.text = nCurrentFPS + " fps";
mcDebug.fieldShadow.text = nCurrentFPS + " fps";
}
}
static var DEBUG_DEPTH = 123456;
static var DEBUG_RIGHT_MARGIN = 0;
static var DEBUG_TOP_MARGIN = 0;
static var DEBUG_FONT = "Verdana";
static var DEBUG_FONT_SIZE = 10;
static var DEBUG_FONT_COLOR = 16777215;
static var DEBUG_FONT_SHADOW_COLOR = 0;
static var aListeners = new Array();
}
Symbol 1215 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 1216 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 1217 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 1218 MovieClip [__Packages.Controller] Frame 0
class Controller
{
var mcContainer, oEnterFrameListener, oPackaging, bRestartGame, bEndGame, bEndLevelPart, nLevelPart, nLevelPartScore, nLevelPartMinutes, nLevelPartSeconds, oUnlockedCodes, oHUD, oModel, nDifficultyLevel, oGenerator, bSamePart, oGameView, oCam, oLayerFloor, oLayerGame, oLayerBg, oSpongeBob, sLastWaterType, oWater, oMazeView, oAmbiance, bRestarting, nQuality;
function Controller (l_mcTimeline) {
_global.C = this;
mcContainer = l_mcTimeline;
mcContainer.stop();
mcContainer._y = 0;
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = mx.utils.Delegate.create(this, update);
MovieClip.addListener(oEnterFrameListener);
sarbakan.sound.SoundManager.init(l_mcTimeline);
setQuality();
oPackaging = new Packaging(l_mcTimeline.mcPackaging);
bRestartGame = false;
bEndGame = false;
bEndLevelPart = false;
nLevelPart = 1;
nLevelPartScore = 0;
nLevelPartMinutes = 0;
nLevelPartSeconds = 0;
oUnlockedCodes = SharedObject.getLocal("sbghouls_codes");
}
function initGame(l_bSameLevel, l_bNextPart) {
mcContainer.gotoAndStop("game");
sarbakan.visual.PauseManager.reset();
resetElementsID();
if (!l_bSameLevel) {
if (l_bNextPart) {
nLevelPart++;
nLevelPartScore = oHUD.nScore;
nLevelPartMinutes = oHUD.nMinutes;
nLevelPartSeconds = oHUD.nSeconds;
}
if (nLevelPart < 4) {
oModel = new maze.MazeModel(maze.MazeData.DIFFICULTY_SETTING[nDifficultyLevel].width, maze.MazeData.DIFFICULTY_SETTING[nDifficultyLevel]["height" + nLevelPart]);
oGenerator = new maze.MazeGenerator(oModel);
oGenerator.generate(false);
} else {
oModel = new maze.MazeModel(maze.MazeData.BONUS_WIDTH, maze.MazeData.BONUS_HEIGHT);
oGenerator = new maze.MazeGenerator(oModel);
oGenerator.generate(true);
}
}
bSamePart = l_bSameLevel;
oGameView = new sarbakan.visual.layer.LayerManager(oModel.nWidth * maze.MazeData.VIEW_TILE_WIDTH, oModel.nHeight * maze.MazeData.VIEW_TILE_HEIGHT, 600, 300);
oCam = oGameView.getCamera();
oLayerFloor = new sarbakan.visual.layer.Layer(mcContainer.mcGame.mcFloor, new sarbakan.visual.activation.GridActivation());
oGameView.addLayer(oLayerFloor, 1, 1);
oLayerGame = new sarbakan.visual.layer.Layer(mcContainer.mcGame.mcMaze, new sarbakan.visual.activation.GridActivation());
oGameView.addLayer(oLayerGame, 1, 1);
oLayerGame.addCollisionMap(new sarbakan.visual.layer.CollisionMap("floor", oLayerGame, 12632256));
oLayerGame.oCollisionMaps.floor.setNewSource(mcContainer.mcGame.mcFloor);
oLayerGame.oCollisionMaps.floor.show(100);
oLayerBg = new sarbakan.visual.layer.Layer(mcContainer.mcGame.mcBg, new sarbakan.visual.activation.NoActivation());
oGameView.addLayer(oLayerBg, 1, 1);
oSpongeBob = new characters.SpongeBob(mcContainer.mcGame.mcMaze.mcSpongeBob);
oLayerGame.addDynamicElement(oSpongeBob);
oCam.lockOn(mx.utils.Delegate.create(oSpongeBob, oSpongeBob.getCoord), true);
if (oUnlockedCodes.data.SYRUP_WATER) {
if (sLastWaterType == "water") {
oWater.mc.removeMovieClip();
}
mcContainer.mcGame.mcMaze.gotoAndStop("syrup");
sLastWaterType = "syrup";
} else {
mcContainer.mcGame.mcMaze.gotoAndStop("water");
sLastWaterType = "water";
}
oWater = new maze.elements.Water(mcContainer.mcGame.mcMaze.mcWater);
oLayerGame.addDynamicElement(oWater);
oMazeView = new maze.MazeView(oLayerGame, oModel);
oMazeView.render();
oHUD = new HUD(mcContainer.mcHUD);
oHUD.showGetOut();
oHUD.setScore(nLevelPartScore);
oHUD.setTimer(nLevelPartMinutes, nLevelPartSeconds);
oAmbiance = sarbakan.sound.SoundManager.play("ambiance", maze.MazeData.VOLUME_AMBIANCE, 99999, true);
oGameView.update();
}
function destroyGame() {
sarbakan.sound.SoundManager.stop(oAmbiance);
oGameView.destroy();
delete oGameView;
}
function resetElementsID() {
sarbakan.visual.element.BaseElement.resetID();
sarbakan.visual.element.BaseElement.resetID();
sarbakan.visual.element.BaseElement.resetID();
sarbakan.visual.element.BaseElement.resetID();
sarbakan.visual.element.BaseElement.resetID();
}
function endLevelPart() {
bEndLevelPart = true;
}
function endGame(l_bWin) {
nLevelPart = 1;
nLevelPartScore = 0;
nLevelPartMinutes = 0;
nLevelPartSeconds = 0;
oHUD.resetLife();
bEndGame = true;
if (l_bWin) {
_global.C.oPackaging.goto("endGood" + nDifficultyLevel);
} else {
_global.C.oPackaging.goto("endBad");
}
}
function restartGame() {
bRestartGame = true;
bRestarting = true;
}
function restartFadeMiddle() {
destroyGame();
if (nLevelPart <= 3) {
if (bRestarting) {
initGame(true, false);
bRestarting = false;
} else {
initGame(false, true);
}
}
}
function restartFadeEnd() {
mcContainer.mcFade.gotoAndPlay("disabled");
}
function setDifficulty(l_nDifficultyLevel) {
nDifficultyLevel = l_nDifficultyLevel;
}
function togglePause() {
if (sarbakan.visual.PauseManager.bPaused) {
sarbakan.sound.SoundManager.fade(_global.C.oPackaging.oMusic, sarbakan.sound.SoundManager.FADE_VOLUME, maze.MazeData.VOLUME_MUSIC, 15);
} else {
sarbakan.sound.SoundManager.fade(_global.C.oPackaging.oMusic, sarbakan.sound.SoundManager.FADE_VOLUME, maze.MazeData.VOLUME_MUSIC / 3, 15);
}
oGameView.togglePause();
}
function unlockCode(l_sCodeID) {
if (l_sCodeID == "RESET") {
for (var _local2 in oUnlockedCodes.data) {
oUnlockedCodes.data[_local2] = false;
}
} else {
oUnlockedCodes.data[l_sCodeID] = true;
}
}
function update() {
if (bRestartGame || (bEndLevelPart)) {
mcContainer.mcFade.gotoAndPlay("fade");
bRestartGame = false;
bEndLevelPart = false;
}
if (bEndGame) {
destroyGame();
bEndGame = false;
}
if (oGameView) {
oGameView.update();
oHUD.update();
} else {
oPackaging.update();
}
}
function setQuality() {
if (_global.PerformanceTestResult >= 20) {
nQuality = QUALITY_MEDIUM;
} else {
nQuality = QUALITY_LOW;
}
}
static var QUALITY_LOW = 0;
static var QUALITY_MEDIUM = 1;
static var QUALITY_HI = 2;
}
Symbol 1219 MovieClip [__Packages.HUD] Frame 0
class HUD
{
static var nLife;
var mc, nMinutes, nSeconds, bTimerTick, nScore, oLifeField, oTimeMinField, oTimeSecField, oScoreField, nCurrentItemID, bMenuOpening, bMenuOpened, bCandyShown, bCandyShownCount, nTimerInterval;
function HUD (l_mc) {
mc = l_mc;
setItem();
if (!nLife) {
resetLife();
}
nMinutes = 0;
nSeconds = 0;
bTimerTick = false;
initTimerInterval();
initCandy();
nScore = 0;
oLifeField = new sarbakan.packaging.DigitBitmapField([mc.mcLife0, mc.mcLife1]);
oTimeMinField = new sarbakan.packaging.DigitBitmapField([mc.mcTime0, mc.mcTime1]);
oTimeSecField = new sarbakan.packaging.DigitBitmapField([mc.mcTime2, mc.mcTime3]);
oScoreField = new sarbakan.packaging.DigitBitmapField([mc.mcPoint0, mc.mcPoint1, mc.mcPoint2, mc.mcPoint3, mc.mcPoint4, mc.mcPoint5]);
oScoreField.setContent(0);
onOptionClosed();
}
function update() {
if ((!_global.C.bRestartGame) && (!_global.C.bRestarting)) {
oLifeField.setContent(nLife);
}
updateTime();
updateScore();
updateMenu();
}
function resetLife() {
nLife = DEFAULT_LIFE;
}
function setItem(l_nItemID) {
switch (l_nItemID) {
case maze.MazeData.ELEMENT_PUMPKIN :
mc.mcItem.gotoAndStop("pumpkin");
break;
case maze.MazeData.ELEMENT_SLUG :
mc.mcItem.gotoAndStop("slug");
break;
default :
mc.mcItem.gotoAndStop("empty");
}
nCurrentItemID = l_nItemID;
}
function setScore(l_nScore) {
nScore = l_nScore;
oScoreField.setContent(nScore);
}
function setTimer(l_nMinutes, l_nSeconds) {
nMinutes = l_nMinutes;
nSeconds = l_nSeconds;
}
function getItem() {
return(nCurrentItemID);
}
function useItem() {
setItem();
}
function gainLife() {
nLife++;
}
function loseLife() {
if ((--nLife) == 0) {
_global.C.endGame(false);
resetLife();
} else {
_global.C.restartGame();
}
delete mc.mcCandy.onRelease;
}
function increaseScore(l_nAmount) {
nScore = nScore + l_nAmount;
}
function showGetOut() {
if (!_global.C.bSamePart) {
sarbakan.sound.SoundManager.play("start" + _global.C.nLevelPart, maze.MazeData.VOLUME_DUTCHSTART, 1);
}
mc.mcGetOut.gotoAndPlay(1);
mc.mcGetOut.text.gotoAndStop("level");
}
function onGetOutEnd() {
_global.C.oSpongeBob.setState("idle");
if (_global.C.nLevelPart < 4) {
_global.C.oWater.setState("idle");
}
}
function onTimerTick() {
bTimerTick = true;
}
function onOptionOpened() {
bMenuOpening = false;
mc.mcOptions.stop();
initOptionsMenu();
}
function onOptionClosed() {
bMenuOpened = false;
bMenuOpening = false;
mc.mcOptions.gotoAndStop("idle");
initOptionsButton();
initTimerInterval();
}
function onButtonOptions() {
_global.C.togglePause();
mc.mcOptions.gotoAndPlay("opens");
bMenuOpened = true;
bMenuOpening = true;
bCandyShown = false;
mc.mcCandy._visible = false;
clearTimerInterval();
}
function onButtonInstructions() {
_global.C.oPackaging.goto("instructions", true);
}
function onButtonQuit() {
mc.mcOptions.mcQuit.gotoAndStop("menu");
mc.mcOptions.mcQuit.btYes.onRelease = sarbakan.utils.Delegate.create(this, onButtonQuitYes);
mc.mcOptions.mcQuit.btNo.onRelease = sarbakan.utils.Delegate.create(this, onButtonQuitNo);
}
function onButtonQuitYes() {
_global.C.endGame(false);
nLife = DEFAULT_LIFE;
}
function onButtonQuitNo() {
mc.mcOptions.mcQuit.gotoAndStop("inactive");
onButtonClose();
}
function onButtonClose() {
_global.C.togglePause();
mc.mcOptions.gotoAndPlay("closes");
}
function onButtonMusic() {
if (sarbakan.sound.SoundManager.isMuted()) {
sarbakan.sound.SoundManager.unmute();
} else {
sarbakan.sound.SoundManager.mute();
}
initOptionsMenu();
}
function onCandyClick() {
if (!sarbakan.visual.PauseManager.bPaused) {
_global.C.togglePause();
bCandyShown = false;
mc.mcCandy._visible = false;
mc.mcEasterEgg.gotoAndPlay(2);
sarbakan.sound.SoundManager.play("vampire", maze.MazeData.VOLUME_EASTEREGG, 1);
sarbakan.sound.SoundManager.play("thunder", maze.MazeData.VOLUME_THUNDER, 1);
}
}
function onEasterEggEnd() {
_global.C.togglePause();
mc.mcEasterEgg.gotoAndStop(2);
}
function updateTime() {
if (bTimerTick && (!sarbakan.visual.PauseManager.bPaused)) {
if ((++nSeconds) == 60) {
nSeconds = 0;
nMinutes++;
}
updateCandy();
bTimerTick = false;
}
oTimeMinField.setContent(nMinutes);
oTimeSecField.setContent(nSeconds);
}
function updateScore() {
var _local2 = oScoreField.getContent();
if (_local2 < nScore) {
_local2 = _local2 + SCORE_INCREASE_RATE;
if (_local2 > nScore) {
_local2 = nScore;
}
oScoreField.setContent(_local2);
}
}
function initCandy() {
bCandyShown = false;
mc.mcCandy.onRelease = sarbakan.utils.Delegate.create(this, onCandyClick);
}
function updateCandy() {
if ((!bCandyShown) && (Math.random() < CANDY_APPEAR_CHANCE)) {
bCandyShown = true;
mc.mcCandy._visible = true;
mc.mcCandy._x = sarbakan.utils.MoreMath.random(5, 560);
bCandyShownCount = 0;
} else if ((++bCandyShownCount) == 2) {
bCandyShown = false;
mc.mcCandy._visible = false;
}
}
function updateMenu() {
if (_global.C.oSpongeBob.oKey.P && (!bMenuOpening)) {
if (!bMenuOpened) {
onButtonOptions();
} else {
onButtonClose();
}
}
}
function initOptionsButton() {
mc.mcOptions.btOptions.onRelease = sarbakan.utils.Delegate.create(this, onButtonOptions);
}
function initOptionsMenu() {
mc.mcOptions.mcMenu.btClose.onRelease = sarbakan.utils.Delegate.create(this, onButtonClose);
mc.mcOptions.mcMenu.btInstructions.onRelease = sarbakan.utils.Delegate.create(this, onButtonInstructions);
mc.mcOptions.mcMenu.btQuit.onRelease = sarbakan.utils.Delegate.create(this, onButtonQuit);
mc.mcOptions.mcMenu.btMusicOn.onRelease = sarbakan.utils.Delegate.create(this, onButtonMusic);
mc.mcOptions.mcMenu.btMusicOff.onRelease = sarbakan.utils.Delegate.create(this, onButtonMusic);
if (sarbakan.sound.SoundManager.isMuted()) {
mc.mcOptions.mcMenu.btMusicOn._visible = false;
mc.mcOptions.mcMenu.btMusicOff._visible = true;
} else {
mc.mcOptions.mcMenu.btMusicOn._visible = true;
mc.mcOptions.mcMenu.btMusicOff._visible = false;
}
}
function initTimerInterval() {
clearTimerInterval();
nTimerInterval = setInterval(sarbakan.utils.Delegate.create(this, onTimerTick), 1000);
}
function clearTimerInterval() {
clearInterval(nTimerInterval);
}
static var DEFAULT_LIFE = 3;
static var SCORE_INCREASE_RATE = 100;
static var CANDY_APPEAR_CHANCE = 0.07;
}
Symbol 1220 MovieClip [__Packages.sarbakan.packaging.DigitBitmapField] Frame 0
class sarbakan.packaging.DigitBitmapField
{
var mcDigitList, nNumber;
function DigitBitmapField (l_mcDigitList) {
mcDigitList = l_mcDigitList;
setContent(0);
}
function setContent(l_number) {
nNumber = l_number;
update();
}
function getContent() {
return(nNumber);
}
function update() {
var _local3 = getNumberToPaddedString();
var _local2 = 0;
while (_local2 < mcDigitList.length) {
mcDigitList[_local2].gotoAndStop(Number(_local3.charAt(_local2)) + 1);
_local2++;
}
}
function getNumberToPaddedString() {
var _local2 = String(nNumber);
while (_local2.length < mcDigitList.length) {
_local2 = "0" + _local2;
}
return(_local2);
}
}
Symbol 1221 MovieClip [__Packages.maze.MazeData] Frame 0
class maze.MazeData
{
function MazeData () {
}
static function getRandomFloor() {
var _local1 = (l_nID = Math.floor(Math.random() * FLOORS.length));
return(FLOORS[_local1]);
}
static var VIEW_TILE_WIDTH = 75;
static var VIEW_TILE_HEIGHT = 100;
static var ELEMENT_FLOOR = 1;
static var ELEMENT_WALL = 2;
static var ELEMENT_WALKWAY = 3;
static var ELEMENT_PIPE = 4;
static var ELEMENT_SPIDERWEB = 5;
static var ELEMENT_WINDOW = 6;
static var ELEMENT_CANDLE = 7;
static var ELEMENT_DUTCHMAN = 8;
static var ELEMENT_SKELETUNA = 9;
static var ELEMENT_VAMPIRAY = 10;
static var ELEMENT_PUMPKIN = 11;
static var ELEMENT_BURGER = 12;
static var ELEMENT_SLUG = 13;
static var ELEMENT_TOKEN = 14;
static var ELEMENT_EXIT = 15;
static var ELEMENT_WAFFLE = 16;
static var FLOORS = [{width:2, height:1}, {width:2, height:2}, {width:2, height:3}, {width:4, height:1}, {width:4, height:2}, {width:4, height:3}, {width:6, height:1}, {width:6, height:2}, {width:6, height:3}];
static var FLOORS_MIN_WIDTH = 2;
static var FLOORS_MIN_HEIGHT = 1;
static var FLOORS_MAX_HEIGHT = 3;
static var TILE_EMPTY = 0;
static var TILE_FLOOR = 1;
static var TILE_WALL = 2;
static var TILE_PIPE = 3;
static var DEPTH_WINDOW = 10000;
static var DEPTH_DUTCHMAN = 11000;
static var DEPTH_DUTCHMAN_OUT = 9000;
static var DEPTH_SPIDERWEB = 12000;
static var DEPTH_CANDLE = 13000;
static var DEPTH_EXIT = 14000;
static var DEPTH_FLOOR = 20000;
static var DEPTH_WALL = 30000;
static var DEPTH_PIPE = 40000;
static var DEPTH_SKELETUNA = 60000;
static var DEPTH_SPONGEBOB = 61000;
static var DEPTH_VAMPIRAY = 62000;
static var DEPTH_BONUS = 70000;
static var DEPTH_WATER = 80000;
static var CHANCE_FLOOR_CREATION = 0.7;
static var CHANCE_WALL_CREATION = 0.1;
static var CHANCE_PIPE_CREATION = 0.8;
static var CHANCE_SPIDERWEB_CREATION = 0.33;
static var CHANCE_WINDOW_CREATION = 0.5;
static var CHANCE_CANDLE_CREATION = 0.33;
static var CHANCE_ENEMY_CREATION = 1;
static var CHANCE_BONUS_CREATION = 0.6;
static var CHANCE_BONUS_CREATION_WAFFLECODE = 0.9;
static var CHANCE_DUTCHMAN_CREATION = 0.4;
static var CHANCE_SKELETUNA_CREATION = 0.7;
static var CHANCE_VAMPIRAY_CREATION = 1;
static var CHANCE_TOKEN_CREATION = 0.1;
static var CHANCE_PUMPKIN_CREATION = 0.3;
static var CHANCE_SLUG_CREATION = 0.5;
static var CHANCE_BURGER_CREATION = 1;
static var MARGIN_PIPE = 30;
static var MARGIN_WINDOW = 30;
static var DIFFICULTY_EASY = 0;
static var DIFFICULTY_MEDIUM = 1;
static var DIFFICULTY_HARD = 2;
static var BONUS_WIDTH = 8;
static var BONUS_HEIGHT = 20;
static var DIFFICULTY_SETTING = [{width:12, height1:20, height2:30, height3:40, height4:BONUS_HEIGHT, raiseSpeed:0.4, scoreMultiplier:1, scoreElapsedTime:10000}, {width:18, height1:40, height2:50, height3:60, height4:BONUS_HEIGHT, raiseSpeed:0.65, scoreMultiplier:1.25, scoreElapsedTime:25000}, {width:22, height1:60, height2:80, height3:90, height4:BONUS_HEIGHT, raiseSpeed:0.8, scoreMultiplier:1.5, scoreElapsedTime:50000}];
static var SCORE_HAMBURGER = 2000;
static var SCORE_SLUG = 1000;
static var SCORE_PUMPKIN = 1000;
static var SCORE_TOKEN = 1000;
static var SCORE_REMAINING_LIFE = 2000;
static var VOLUME_MUSIC = 80;
static var VOLUME_AMBIANCE = 100;
static var VOLUME_EAT = 100;
static var VOLUME_LIFE = 100;
static var VOLUME_BONUS = 100;
static var VOLUME_PUTMASK = 100;
static var VOLUME_ENDMASK = 100;
static var VOLUME_GREASE = 100;
static var VOLUME_SQUISH = 110;
static var VOLUME_SKELETUNA = 100;
static var VOLUME_SKELETUNAOUT = 100;
static var VOLUME_VAMPIRAY = 100;
static var VOLUME_DUTCHMAN = 100;
static var VOLUME_BUTTON = 100;
static var VOLUME_LEVEL = 100;
static var VOLUME_THUNDER = 150;
static var VOLUME_EASTEREGG = 200;
static var VOLUME_SCARED = 215;
static var VOLUME_DUTCHSCARE = 140;
static var VOLUME_DUTCHSTART = 180;
}
Symbol 1222 MovieClip [__Packages.sarbakan.sound.SoundManager] Frame 0
class sarbakan.sound.SoundManager
{
static var mc, aSounds, oRootSound, oEnterFrameListener, bMuted, nSoundID;
function SoundManager () {
}
static function init(l_mc) {
mc = l_mc;
aSounds = [];
oRootSound = new Sound(mc);
if (!oEnterFrameListener) {
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = sarbakan.utils.Delegate.create(sarbakan.sound.SoundManager, update);
MovieClip.addListener(oEnterFrameListener);
}
}
static function play(l_sLinkage, l_nVolume, l_nLoop, l_bUnique) {
if (!mc) {
trace(("WARNING: Unitialized SoundManager OR Invalid base movieclip (" + l_sLinkage) + ")");
}
var _local3 = canPlaySound(l_sLinkage);
if (_local3 == true) {
var _local1 = {};
_local1.mc = mc.createEmptyMovieClip(MOVIECLIP_BASE_NAME + getNextID(), mc.getNextHighestDepth());
_local1.sLinkage = l_sLinkage;
_local1.bUnique = l_bUnique;
_local1.aFade = [];
_local1.nFullVolume = l_nVolume;
_local1.oSound = new Sound(_local1.mc);
_local1.oSound.attachSound(l_sLinkage);
_local1.oSound.onSoundComplete = sarbakan.utils.Delegate.create(sarbakan.sound.SoundManager, remove, _local1.oSound);
_local1.oSound.start(0, l_nLoop);
_local1.oSound.setVolume(l_nVolume);
aSounds.push(_local1);
return(_local1.oSound);
}
return(_local3);
}
static function stop(l_oSound) {
l_oSound.stop();
remove(l_oSound);
}
static function mute() {
bMuted = true;
oRootSound.setVolume(0);
}
static function unmute() {
bMuted = false;
oRootSound.setVolume(100);
}
static function fade(l_oSound, l_nFadeType, l_nDestination, l_nSpeed) {
var _local3;
var _local4;
switch (l_nFadeType) {
case FADE_VOLUME :
_local3 = sarbakan.utils.Delegate.create(l_oSound, l_oSound.getVolume);
_local4 = sarbakan.utils.Delegate.create(l_oSound, l_oSound.setVolume);
break;
case FADE_PAN :
_local3 = sarbakan.utils.Delegate.create(l_oSound, l_oSound.getPan);
_local4 = sarbakan.utils.Delegate.create(l_oSound, l_oSound.setPan);
}
var _local2 = getSoundData(l_oSound);
if (l_nDestination < _local3()) {
l_nSpeed = l_nSpeed * -1;
}
if (((l_nFadeType == FADE_VOLUME) && (l_nSpeed > 0)) && (l_nDestination > _local2.oData.nFullVolume)) {
l_nDestination = _local2.oData.nFullVolume;
}
aSounds[_local2.nPosition].aFade[l_nFadeType] = {nDest:l_nDestination, nSpeed:l_nSpeed, fSet:_local4, fGet:_local3};
}
static function fadeInAll(l_nSpeed) {
if (!l_nSpeed) {
l_nSpeed = FADE_DEFAULT_SPEED;
}
fadeAll(FADE_VOLUME, 100, l_nSpeed);
}
static function fadeOutAll(l_nSpeed) {
if (!l_nSpeed) {
l_nSpeed = FADE_DEFAULT_SPEED;
}
fadeAll(FADE_VOLUME, 0, l_nSpeed);
}
static function getLinkage(l_oSound) {
return(getSoundData(l_oSound).oData.sLinkage);
}
static function isSoundPlaying(l_oSound) {
return(l_oSound.duration != undefined);
}
static function isMuted() {
return(bMuted);
}
static function update() {
for (var _local2 in aSounds) {
for (var _local1 in aSounds[_local2].aFade) {
if (aSounds[_local2].aFade[_local1]) {
aSounds[_local2].aFade[_local1].fSet(aSounds[_local2].aFade[_local1].fGet() + aSounds[_local2].aFade[_local1].nSpeed);
if (((aSounds[_local2].aFade[_local1].nSpeed > 0) && (aSounds[_local2].aFade[_local1].fGet() >= aSounds[_local2].aFade[_local1].nDest)) or ((aSounds[_local2].aFade[_local1].nSpeed < 0) && (aSounds[_local2].aFade[_local1].fGet() <= aSounds[_local2].aFade[_local1].nDest))) {
aSounds[_local2].aFade[_local1].fSet(aSounds[_local2].aFade[_local1].nDest);
delete aSounds[_local2].aFade[_local1];
}
}
}
}
}
static function canPlaySound(l_sLinkage) {
for (var _local2 in aSounds) {
if (aSounds[_local2].bUnique && (aSounds[_local2].sLinkage == l_sLinkage)) {
return(aSounds[_local2].oSound);
}
}
return(true);
}
static function getNextID() {
if (!nSoundID) {
nSoundID = 0;
}
return(nSoundID++);
}
static function remove(l_oSound) {
var _local1 = getSoundData(l_oSound);
_local1.oData.mc.removeMovieClip();
aSounds.splice(_local1.nPosition, 1);
}
static function getSoundData(l_oSound) {
for (var _local3 in aSounds) {
if (aSounds[_local3].oSound == l_oSound) {
return({oData:aSounds[_local3], nPosition:_local3});
}
}
}
static function fadeAll(l_nFadeType, l_nDestination, l_nSpeed) {
for (var _local3 in aSounds) {
fade(aSounds[_local3].oSound, l_nFadeType, l_nDestination, l_nSpeed);
}
}
static var MOVIECLIP_BASE_NAME = "mcSounds";
static var FADE_DEFAULT_SPEED = 10;
static var FADE_VOLUME = 0;
static var FADE_PAN = 1;
}
Symbol 1223 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 1224 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 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);
}
}
Symbol 1225 MovieClip [__Packages.Packaging] Frame 0
class Packaging
{
var mc, oSecretCodeInterface, oHiScore, oLevelRoll, nFinalScore, oMusic;
function Packaging (l_mc) {
mc = l_mc;
mc.stop();
_global.oHS = new objHSNick();
_global.oHS.fDoHSInit();
show();
goto("title");
musicPackaging();
}
function show() {
mc._visible = true;
_quality = "high";
}
function hide() {
mc._visible = false;
switch (_global.C.nQuality) {
case Controller.QUALITY_HI :
_quality = "high";
break;
case Controller.QUALITY_MEDIUM :
_quality = "medium";
break;
case Controller.QUALITY_LOW :
_quality = "low";
}
}
function goto(l_sScreen, l_bInGame) {
mc.gotoAndStop(l_sScreen);
initButtons(l_bInGame);
switch (l_sScreen) {
case "endGood0" :
case "endGood1" :
case "endGood2" :
if (_global.gProxyObj.getIsLoggedIn()) {
mc.btnSubmitHS._visible = true;
} else {
mc.btnSubmitHS._visible = false;
}
musicPackaging();
showScore(true);
break;
case "endBad" :
if (_global.gProxyObj.getIsLoggedIn()) {
mc.btnSubmitHS._visible = true;
} else {
mc.btnSubmitHS._visible = false;
}
musicPackaging();
showScore(false);
break;
case "instructions" :
mc.btBack._visible = false;
}
show();
}
function toggleDemoButton(l_mc) {
if (l_mc._currentframe == 1) {
l_mc.gotoAndStop(2);
} else {
l_mc.gotoAndStop(1);
}
}
function update() {
if (oSecretCodeInterface) {
oSecretCodeInterface.update();
}
}
function initButtons(l_bInGame) {
if (l_bInGame) {
mc.btPlay.onRelease = sarbakan.utils.Delegate.create(this, onButtonResume);
} else {
mc.btPlay.onRelease = sarbakan.utils.Delegate.create(this, onButtonPlay);
mc.btTry.onRelease = mc.btPlay.onRelease;
mc.btPlayTitle.onRelease = sarbakan.utils.Delegate.create(this, onButtonPlayTitle);
}
mc.btnViewHSTitle.onRelease = sarbakan.utils.Delegate.create(this, onButtonScoreTitle);
mc.btnViewHS.onRelease = sarbakan.utils.Delegate.create(this, onButtonScore);
mc.btnSubmitHS.onRelease = sarbakan.utils.Delegate.create(this, onButtonScoreSubmit);
mc.btnSubmitHS2.onRelease = sarbakan.utils.Delegate.create(this, onButtonScoreSubmitRefresh);
mc.btInstructions.onRelease = sarbakan.utils.Delegate.create(this, onButtonInstructions);
mc.btBack.onRelease = sarbakan.utils.Delegate.create(this, onButtonBack);
mc.btNext.onRelease = sarbakan.utils.Delegate.create(this, onButtonNext);
mc.btQuit.onRelease = sarbakan.utils.Delegate.create(this, onButtonQuit);
mc.btCode.onRelease = sarbakan.utils.Delegate.create(this, onButtonCode);
mc.btEasy.onRelease = sarbakan.utils.Delegate.create(this, onButtonStartGame, maze.MazeData.DIFFICULTY_EASY);
mc.btMedium.onRelease = sarbakan.utils.Delegate.create(this, onButtonStartGame, maze.MazeData.DIFFICULTY_MEDIUM);
mc.btHard.onRelease = sarbakan.utils.Delegate.create(this, onButtonStartGame, maze.MazeData.DIFFICULTY_HARD);
mc.btEasy.onRollOver = sarbakan.utils.Delegate.create(this, onButtonStartGameRoll);
mc.btMedium.onRollOver = sarbakan.utils.Delegate.create(this, onButtonStartGameRoll);
mc.btHard.onRollOver = sarbakan.utils.Delegate.create(this, onButtonStartGameRoll);
}
function onButtonPlay() {
clickSound();
goto("levelSelect");
mc.btQuit._visible = false;
}
function onButtonPlayTitle() {
onButtonPlay();
mc.btQuit._visible = true;
mc.btBack._visible = false;
}
function onButtonResume() {
clickSound();
hide();
_global.C.oHUD.onOptionClosed();
_global.C.togglePause();
}
function onButtonScoreTitle() {
clickSound();
goto("hiscores");
mc.btTry._visible = false;
_global.oHS.fDoViewHS(mc, true);
initHiScore(true);
}
function onButtonScore() {
clickSound();
goto("hiscores");
mc.btPlay._visible = false;
mc.btQuit._visible = false;
_global.oHS.fDoViewHS(mc, true);
initHiScore();
}
function onButtonScoreSubmit() {
clickSound();
goto("hiscores");
mc.btPlay._visible = false;
mc.btQuit._visible = false;
_global.oHS.fDoSubmitHS(this, true);
initHiScore();
}
function onButtonScoreSubmitRefresh() {
clickSound();
mc.btnSubmitHS2._visible = false;
oHiScore.clearScores();
_global.oHS.fDoSubmitHS(this, true);
initHiScore();
}
function onButtonInstructions() {
clickSound();
goto("story");
}
function onButtonBack() {
clickSound();
mc.prevFrame();
initButtons();
}
function onButtonNext() {
clickSound();
mc.nextFrame();
initButtons();
}
function onButtonQuit() {
clickSound();
goto("title");
}
function onButtonCode() {
oSecretCodeInterface = new SecretCodeInterface(mc.mcCode);
oSecretCodeInterface.show();
clickSound();
}
function onButtonStartGame(l_nDifficultyLevel) {
sarbakan.sound.SoundManager.play("level", maze.MazeData.VOLUME_LEVEL, 1);
hide();
_global.C.setDifficulty(l_nDifficultyLevel);
_global.C.initGame();
musicGame();
}
function onButtonStartGameRoll() {
if (sarbakan.sound.SoundManager.isSoundPlaying(oLevelRoll)) {
sarbakan.sound.SoundManager.fade(oLevelRoll, sarbakan.sound.SoundManager.FADE_VOLUME, 0, 30);
}
oLevelRoll = sarbakan.sound.SoundManager.play("levelRoll", maze.MazeData.VOLUME_LEVEL, 1);
}
function showScore(l_bWin) {
var _local3 = _global.C.oHUD;
nFinalScore = _local3.nScore;
if (l_bWin) {
var _local4 = maze.MazeData.DIFFICULTY_SETTING[_global.C.nDifficultyLevel].scoreMultiplier;
nFinalScore = nFinalScore + ((HUD.nLife + 1) * maze.MazeData.SCORE_REMAINING_LIFE);
var _local5 = (_local3.nMinutes * 60) + _local3.nSeconds;
nFinalScore = nFinalScore + (maze.MazeData.DIFFICULTY_SETTING[_global.C.nDifficultyLevel].scoreElapsedTime / (_local5 / _local4));
nFinalScore = nFinalScore * _local4;
}
nFinalScore = Math.round(nFinalScore);
mc.score = nFinalScore;
}
function initHiScore(l_bFromTitle) {
oHiScore = new sarbakan.packaging.HighScoreBoard(mc.mcHiScore, mc.mcHiScore.mcLine, 200, 7);
oHiScore.setScrollBar(mc.mcScroll.mcScroller, -82, 80);
oHiScore.setMargin(-7);
_global.oHS.fSetHSBoard(mc);
_global.oHS.bGetHS = true;
mc.btnSubmitHS2._visible = false;
if ((_global.oHS.bGetHS == true) && (_global.oHS.bSubmitHS != true)) {
_global.oHS.bGetHS = false;
_global.oHS.getScores();
if ((!l_bFromTitle) && (_global.gProxyObj.getIsLoggedIn())) {
mc.btnSubmitHS2._visible = true;
}
} else if (_global.oHS.bSubmitHS == true) {
_global.oHS.bSubmitHS = false;
_global.oHS.submitScore(nFinalScore);
}
}
function musicGame() {
sarbakan.sound.SoundManager.stop(oMusic);
oMusic = sarbakan.sound.SoundManager.play("musicGame", maze.MazeData.VOLUME_MUSIC, 999999, true);
}
function musicPackaging() {
sarbakan.sound.SoundManager.stop(oMusic);
oMusic = sarbakan.sound.SoundManager.play("musicPackaging", maze.MazeData.VOLUME_MUSIC, 999999, true);
}
function clickSound() {
sarbakan.sound.SoundManager.play("click", maze.MazeData.VOLUME_BUTTON, 1);
}
}
Symbol 1226 MovieClip [__Packages.sarbakan.packaging.HighScoreBoard] Frame 0
class sarbakan.packaging.HighScoreBoard
{
var mcBoard, mcFields, nNextY, nFieldID, nMargin, nScrollPC, nBoardHeight, btUp, btDown, mcScrollBar, nScrollMin, nScrollMax, nScrollOrigin, bScrolling;
function HighScoreBoard (l_mcBoard, l_mcFields, l_nBoardHeight) {
mcBoard = l_mcBoard;
mcFields = l_mcFields;
nNextY = mcFields._y;
mcFields._visible = false;
nFieldID = 0;
nMargin = DEFAULT_MARGIN;
nScrollPC = 0;
nBoardHeight = l_nBoardHeight;
setMessage("Retrieving scores...");
}
function setScrollButtons(l_btUp, l_btDown) {
btUp = l_btUp;
btDown = l_btDown;
}
function setScrollBar(l_mc, l_nMinY, l_nMaxY) {
mcScrollBar = l_mc;
mcScrollBar._visible = false;
nScrollMin = l_nMinY;
nScrollMax = l_nMaxY;
mcScrollBar.onEnterFrame = sarbakan.utils.Delegate.create(this, onScrollBarUpdate);
mcScrollBar.onPress = sarbakan.utils.Delegate.create(this, onScrollBarClick);
mcScrollBar.onRelease = sarbakan.utils.Delegate.create(this, onScrollBarRelease);
mcScrollBar.onReleaseOutside = mcScrollBar.onRelease;
}
function setMargin(l_nMargin) {
nMargin = l_nMargin;
}
function addEntry(l_sName, l_nScore) {
var _local2 = mcFields.duplicateMovieClip("mcField" + (nFieldID++), mcFields._parent.getNextHighestDepth());
_local2._visible = true;
_local2._y = nNextY;
nNextY = nNextY + (mcFields._height + nMargin);
_local2.name = l_sName;
_local2.score = l_nScore;
clearMessage();
mcScrollBar._visible = true;
}
function setMessage(l_sMessage) {
mcBoard.message = l_sMessage;
}
function clearMessage() {
mcBoard.message = "";
}
function clearScores() {
var _local2 = 0;
while (_local2 <= 100) {
mcFields._parent["mcField" + _local2].removeMovieClip();
_local2++;
}
}
function scrollTo(l_nScrollPC) {
if (!nScrollOrigin) {
nScrollOrigin = mcBoard._y;
}
mcBoard._y = nScrollOrigin - ((mcBoard._height - nBoardHeight) * (l_nScrollPC / 100));
}
function onScrollBarUpdate() {
if (bScrolling) {
var _local2 = Math.round(((mcScrollBar._y - nScrollMin) / (nScrollMax - nScrollMin)) * 100);
if (_local2 != nScrollPC) {
nScrollPC = _local2;
scrollTo(nScrollPC);
}
}
}
function onScrollBarClick() {
bScrolling = true;
mcScrollBar.startDrag(false, mcScrollBar._x, nScrollMin, mcScrollBar._x, nScrollMax);
}
function onScrollBarRelease() {
bScrolling = false;
mcScrollBar.stopDrag();
}
static var DEFAULT_MARGIN = 5;
}
Symbol 1227 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(id);
}
static function resetID() {
nNextID = undefined;
}
static function getNextID() {
if (!nNextID) {
nNextID = 0;
}
return(nNextID++);
}
}
Symbol 1228 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) {
oActivationManager.addDynamicElement(l_oElement, l_oElement.mc._x, l_oElement.mc._y, l_oElement.mc._width, l_oElement.mc._height);
} else {
oActivationManager.addAlwaysActiveElement(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 1229 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 1230 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 1231 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 remove() {
mc.removeMovieClip();
}
static var BASE_DEPTH = 64000;
}
Symbol 1232 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, bEnabled, mc, oOwner, sNextState, sState;
function DynamicElement (l_sID) {
super(l_sID);
disable();
nSpeedX = 0;
nSpeedXLast = 0;
nSpeedY = 0;
nSpeedYLast = 0;
bAlwaysActive = false;
bStaticMovieClip = false;
}
function update() {
updateState();
updateDirection();
updateMove();
}
function enable() {
setState(DEFAULT_STATE);
updateState();
bEnabled = true;
}
function disable() {
setState("inactive");
updateState();
bEnabled = false;
}
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 getCoord() {
return({x:mc._x, y:mc._y});
}
function setCoord(l_oPos) {
mc._x = l_oPos.x;
mc._y = l_oPos.y;
}
function collideWithMap(l_sCollisionMapID) {
var _local3;
if (arguments[1]) {
_local3 = getGlobalPos(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 updateState() {
if (sNextState != undefined) {
sState = sNextState;
sNextState = undefined;
mc.gotoAndStop(sState);
}
this[sState]();
}
function updateDirection() {
if (nSpeedX > 0) {
mc._xscale = 100;
} else if (nSpeedX < 0) {
mc._xscale = -100;
}
nSpeedXLast = nSpeedX;
nSpeedYLast = nSpeedY;
}
function updateMove() {
mc._x = nSpeedX + mc._x;
mc._y = nSpeedY + mc._y;
}
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 stateStarting() {
return(mc.state._currentframe == 1);
}
function stateFinished() {
return(mc.state._currentframe == mc.state._totalframes);
}
function stateCurrentFrame() {
return(mc.state._currentframe);
}
var DEFAULT_STATE = "idle";
}
Symbol 1233 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.C.unlockCode(_local4);
_local3 = true;
setState("good");
getURL (("javascript:trackEvent('" + SECRET_CODES[_local4]) + "');");
break;
}
}
if (!_local3) {
setState("bad");
}
}
static var SECRET_CODES = {RANDOM_WAFFLES:"sun", BONUS_LEVEL:"pow", SYRUP_WATER:"find", RESET:"reset"};
}
Symbol 1234 MovieClip [__Packages.objHSNick] Frame 0
class objHSNick
{
var bHSAvailable, G_TestHighScore, bSubmitHS, bGetHS, G_GameID, mcHSZone;
function objHSNick () {
bHSAvailable = true;
G_TestHighScore = false;
bSubmitHS = false;
bGetHS = false;
G_GameID = "sb_ghouls";
mcHSZone = undefined;
if (G_TestHighScore == true) {
_global.gProxyObj.setServer("www.nick.com");
_global.gProxyObj.setScreenName("dd_programmer");
_global.gProxyObj.setIsLoggedIn(true);
}
}
function getScores() {
trace("getScore " + _global.gProxyObj);
if (_global.gProxyObj == undefined) {
listScores();
} else {
_global.gProxyObj.getScores(cbFunc2);
}
}
function submitScore(theScore) {
addMessage("The high score list is updating!");
_global.gProxyObj.submitScore(theScore, cbFunc);
}
function initHiScores() {
_global.gProxyObj.setGame_Id(G_GameID);
}
function getScoreString() {
var _local8 = "Oops! The high score list is not available right now!";
if (_global.gProxyObj != undefined) {
var _local7 = _global.gProxyObj.getScoreCount();
trace(_local7);
if (_local7 > 0) {
var _local3;
var _local4;
var _local5;
var _local6;
removeMessage();
_local3 = 0;
while (_local3 < _local7) {
_local8 = "";
_local4 = _global.gProxyObj.getScoreItem(_local3);
_local5 = _local4[0];
trace(_local5);
_local6 = _local4[1];
_global.C.oPackaging.oHiScore.addEntry(_local5, _local6);
_local3++;
}
} else {
addMessage("Oops! The high score list is not available right now!");
}
} else {
addMessage("Oops! The high score list is not available right now!");
}
return(_local8);
}
function listScores() {
getScoreString();
}
function cbFunc(thisBool) {
trace("cbFunc" + thisBool);
if (thisBool) {
_global.oHS.listScores();
} else {
addMessage("Oops! The high score list is not available right now!");
}
}
function cbFunc2(thisBool) {
trace("*" + thisBool);
if (thisBool) {
_global.oHS.listScores();
} else {
addMessage("Oops! The high score list is not available right now!");
}
}
function fDoHSInit() {
initHiScores();
if (_global.gProxyObj.getIsLoggedIn()) {
mcHSZone.btnSubmitHS._visible = true;
} else {
mcHSZone.btnSubmitHS._visible = false;
}
}
function fDoSubmitHS(l_mcStage) {
bSubmitHS = true;
}
function fDoViewHS(l_mcStage, l_bFromGame) {
bGetHS = true;
_global.KMC.startHighScore(l_mcStage, l_bFromGame);
}
function fSetHSBoard(P_mcRef) {
mcHSZone = P_mcRef;
if (_global.gProxyObj.getIsLoggedIn()) {
mcHSZone.btnSubmitHS._visible = true;
} else {
mcHSZone.btnSubmitHS._visible = false;
}
}
function addMessage(l_sMsg) {
_global.C.oPackaging.oHiScore.setMessage(l_sMsg);
}
function removeMessage() {
_global.C.oPackaging.oHiScore.clearMessage();
}
}
Symbol 1235 MovieClip [__Packages.maze.MazeModel] Frame 0
class maze.MazeModel
{
var nWidth, nHeight, aElementList, aGrid;
function MazeModel (l_nWidth, l_nHeight) {
nWidth = l_nWidth;
nHeight = l_nHeight;
aElementList = [];
generateEmptyGrid();
}
function addElementFloor(l_nX, l_nY, l_nWidth, l_nHeight) {
aElementList.push({element:maze.MazeData.ELEMENT_FLOOR, w:l_nWidth, h:l_nHeight, x:l_nX, y:l_nY});
}
function addElementWall(l_nX, l_nY) {
aElementList.push({element:maze.MazeData.ELEMENT_WALL, x:l_nX, y:l_nY});
}
function addElementWalkway(l_nX, l_nY, l_nWidth) {
aElementList.push({element:maze.MazeData.ELEMENT_WALKWAY, x:l_nX, y:l_nY, width:l_nWidth});
}
function addElementPipe(l_nX, l_nY, l_nHeight, l_bLastPipe) {
aElementList.push({element:maze.MazeData.ELEMENT_PIPE, x:l_nX, y:l_nY, height:l_nHeight, lastPipe:l_bLastPipe});
}
function addElementSpiderWeb(l_nX, l_nY, l_bFlipped) {
aElementList.push({element:maze.MazeData.ELEMENT_SPIDERWEB, x:l_nX, y:l_nY, flipped:l_bFlipped});
}
function addElementWindow(l_nX, l_nY, l_nWidth, l_nNumber) {
aElementList.push({element:maze.MazeData.ELEMENT_WINDOW, x:l_nX, y:l_nY, width:l_nWidth, number:l_nNumber});
}
function addElementCandle(l_nX, l_nY) {
aElementList.push({element:maze.MazeData.ELEMENT_CANDLE, x:l_nX, y:l_nY});
}
function addElementExit(l_nX, l_nY) {
aElementList.push({element:maze.MazeData.ELEMENT_EXIT, x:l_nX, y:l_nY});
}
function addElementDutchMan(l_nX, l_nY) {
aElementList.push({element:maze.MazeData.ELEMENT_DUTCHMAN, x:l_nX, y:l_nY});
}
function addElementVampiRay(l_nX, l_nY, l_nWidth) {
aElementList.push({element:maze.MazeData.ELEMENT_VAMPIRAY, x:l_nX, y:l_nY, width:l_nWidth});
}
function addElementSkeletuna(l_nX, l_nY) {
aElementList.push({element:maze.MazeData.ELEMENT_SKELETUNA, x:l_nX, y:l_nY});
}
function addElementToken(l_nX, l_nY) {
aElementList.push({element:maze.MazeData.ELEMENT_TOKEN, x:l_nX, y:l_nY});
}
function addElementPumpkin(l_nX, l_nY) {
aElementList.push({element:maze.MazeData.ELEMENT_PUMPKIN, x:l_nX, y:l_nY});
}
function addElementSlug(l_nX, l_nY) {
aElementList.push({element:maze.MazeData.ELEMENT_SLUG, x:l_nX, y:l_nY});
}
function addElementBurger(l_nX, l_nY) {
aElementList.push({element:maze.MazeData.ELEMENT_BURGER, x:l_nX, y:l_nY});
}
function addElementWaffle(l_nX, l_nY) {
aElementList.push({element:maze.MazeData.ELEMENT_WAFFLE, x:l_nX, y:l_nY});
}
function getElementList() {
return(aElementList);
}
function debug() {
var _local3;
trace("===================");
var _local4 = 0;
while (_local4 < nHeight) {
_local3 = "";
var _local2 = 0;
while (_local2 < nWidth) {
_local3 = _local3 + aGrid[_local4][_local2];
_local2++;
}
trace(_local3);
_local4++;
}
}
function generateEmptyGrid() {
aGrid = [];
var _local3 = 0;
while (_local3 < nHeight) {
aGrid.push([]);
var _local2 = 0;
while (_local2 < nWidth) {
aGrid[_local3][_local2] = maze.MazeData.TILE_EMPTY;
_local2++;
}
_local3++;
}
}
}
Symbol 1236 MovieClip [__Packages.maze.MazeView] Frame 0
class maze.MazeView
{
var oLayer, oModel, oDutchManManager;
function MazeView (l_oLayer, l_oModel) {
oLayer = l_oLayer;
oModel = l_oModel;
_global.walkway = 400000 /* 0x061A80 */;
}
function render() {
oDutchManManager = new characters.DutchManManager();
oLayer.addDynamicElement(oDutchManManager);
var _local3 = oModel.getElementList();
for (var _local5 in _local3) {
switch (_local3[_local5].element) {
case maze.MazeData.ELEMENT_FLOOR :
oLayer.addStaticElement(new maze.elements.platforms.Floor(_global.C.oLayerFloor, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_WALL :
oLayer.addStaticElement(new maze.elements.platforms.Wall(_global.C.oLayerFloor, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_PIPE :
oLayer.addDynamicElement(new maze.elements.Pipe(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_DUTCHMAN :
oLayer.addDynamicElement(new characters.DutchMan(oLayer, _local3[_local5], oDutchManManager));
break;
case maze.MazeData.ELEMENT_VAMPIRAY :
oLayer.addDynamicElement(new characters.VampiRay(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_SKELETUNA :
oLayer.addDynamicElement(new characters.Skeletuna(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_SPIDERWEB :
oLayer.addStaticElement(new maze.elements.decoration.SpiderWeb(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_WINDOW :
oLayer.addStaticElement(new maze.elements.decoration.Window(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_CANDLE :
oLayer.addStaticElement(new maze.elements.decoration.Candle(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_EXIT :
oLayer.addStaticElement(new maze.elements.decoration.Exit(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_BURGER :
oLayer.addDynamicElement(new maze.elements.bonuses.Burger(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_WAFFLE :
oLayer.addDynamicElement(new maze.elements.bonuses.Waffle(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_PUMPKIN :
oLayer.addDynamicElement(new maze.elements.bonuses.Pumpkin(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_SLUG :
oLayer.addDynamicElement(new maze.elements.bonuses.Slug(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_TOKEN :
oLayer.addDynamicElement(new maze.elements.bonuses.Token(oLayer, _local3[_local5]));
break;
case maze.MazeData.ELEMENT_WALKWAY :
var _local4 = oLayer.mc.attachMovie("walkway", "a" + (_global.walkway++), _global.walkway);
_local4._x = _local3[_local5].x * maze.MazeData.VIEW_TILE_WIDTH;
_local4._y = _local3[_local5].y * maze.MazeData.VIEW_TILE_HEIGHT;
_local4._width = _local4._width * _local3[_local5].width;
_local4.size = (((_local3[_local5].x + ",") + _local3[_local5].y) + " = ") + _local3[_local5].width;
}
}
}
}
Symbol 1237 MovieClip [__Packages.characters.DutchManManager] Frame 0
class characters.DutchManManager extends sarbakan.visual.element.DynamicElement
{
var bAlwaysActive, aDutchMan, enable, nPickDelayCount, oCurrentDutchman, setState, oOwner;
function DutchManManager () {
super();
bAlwaysActive = true;
aDutchMan = [];
enable();
nPickDelayCount = 0;
}
function add(l_oDutchMan, l_nX, l_nY) {
aDutchMan.push({dutchman:l_oDutchMan, x:l_nX, y:l_nY});
}
function remove(l_oDutchMan) {
for (var _local3 in aDutchMan) {
if (aDutchMan[_local3].dutchman == l_oDutchMan) {
aDutchMan.splice(_local3, 1);
break;
}
}
if (l_oDutchMan == oCurrentDutchman) {
onDutchManOut();
}
}
function onDutchManOut() {
oCurrentDutchman.setState("idle");
setState("idle");
}
function idle() {
if ((++nPickDelayCount) == PICK_DELAY) {
nPickDelayCount = 0;
setState("pick");
}
}
function pick() {
var _local4;
var _local3 = 100000 /* 0x0186A0 */;
var _local2;
for (var _local5 in aDutchMan) {
_local2 = sarbakan.utils.MoreMath.getDistance(aDutchMan[_local5].dutchman.mc._x, aDutchMan[_local5].dutchman.mc._y, oOwner.oDynamicElements.spongebob.mc._x, oOwner.oDynamicElements.spongebob.mc._y);
if (_local2 < _local3) {
_local4 = _local5;
_local3 = _local2;
}
}
oCurrentDutchman = aDutchMan[_local4].dutchman;
if (oCurrentDutchman) {
aDutchMan[_local4].dutchman.setState("idleIn");
setState("wait");
} else {
setState("idle");
}
}
static var PICK_DELAY = 50;
}
Symbol 1238 MovieClip [__Packages.characters.DutchMan] Frame 0
class characters.DutchMan extends sarbakan.visual.element.DynamicElement
{
var mc, nX, nY, oManager, updateState, oOwner, collideWithElementBox, setState, stateFinished, stateStarting;
function DutchMan (l_oLayer, l_oInfos, l_oManager) {
super("dutchMan" + sarbakan.visual.element.BaseElement.getNextID());
var _local4 = l_oLayer.mc;
mc = _local4.attachMovie("dutchMan", "dutchMan" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_DUTCHMAN + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
nX = l_oInfos.x;
nY = l_oInfos.Y;
oManager = l_oManager;
disable();
updateState();
}
function enable() {
super.enable();
oManager.add(this, nX, nY);
}
function disable() {
super.disable();
oManager.remove(this);
}
function idle() {
}
function idleIn() {
if (((mc.state._currentframe > ATTACK_MINIMUM_IN_FRAMES) && (oOwner.oDynamicElements.spongebob.bCanBeScared)) && (collideWithElementBox("spongebob", mc.collider))) {
oOwner.oDynamicElements.spongebob.onScared();
setState("attack");
sarbakan.sound.SoundManager.play("dutchmanSound", maze.MazeData.VOLUME_DUTCHMAN, 1, false);
}
if (stateFinished()) {
oManager.onDutchManOut();
}
}
function attack() {
if (stateStarting()) {
mc.attachMovie("dutchmanAttack", "attack", 1);
sarbakan.sound.SoundManager.play("dutchScare" + sarbakan.utils.MoreMath.random(1, 3), maze.MazeData.VOLUME_DUTCHSCARE, 1);
if (mc._x < oOwner.oDynamicElements.spongebob.mc._x) {
mc.state._xscale = -100;
mc.attack.state._xscale = -100;
}
}
if (stateFinished()) {
setState("idle");
mc.attack.removeMovieClip();
oManager.onDutchManOut();
if (mc.state._xscale == -100) {
mc.state._xscale = 100;
}
}
}
static var ATTACK_DELAY = 50;
static var ATTACK_MINIMUM_IN_FRAMES = 10;
var nAttackDelayCount = 0;
}
Symbol 1239 MovieClip [__Packages.maze.elements.platforms.Floor] Frame 0
class maze.elements.platforms.Floor extends sarbakan.visual.element.StaticElement
{
var mc;
function Floor (l_oLayer, l_oFloorInfos) {
super("floor" + sarbakan.visual.element.BaseElement.getNextID());
var _local4 = l_oLayer.mc;
mc = _local4.attachMovie((("floor_" + l_oFloorInfos.w) + "_") + l_oFloorInfos.h, "floor" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_FLOOR + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oFloorInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oFloorInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
mc.gotoAndStop(Math.floor(Math.random() * mc._totalframes) + 1);
}
}
Symbol 1240 MovieClip [__Packages.maze.elements.platforms.Wall] Frame 0
class maze.elements.platforms.Wall extends sarbakan.visual.element.StaticElement
{
var mc;
function Wall (l_oLayer, l_oWallInfos) {
super("wall" + sarbakan.visual.element.BaseElement.getNextID());
var _local3 = l_oLayer.mc;
mc = _local3.attachMovie("wall", "wall" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_WALL + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oWallInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oWallInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
mc.gotoAndStop(Math.floor(Math.random() * mc._totalframes) + 1);
}
}
Symbol 1241 MovieClip [__Packages.maze.elements.Pipe] Frame 0
class maze.elements.Pipe extends sarbakan.visual.element.DynamicElement
{
var mc, bLastPipe, collideWithElement, oOwner, setState;
function Pipe (l_oLayer, l_oPipeInfos) {
super("pipe" + sarbakan.visual.element.BaseElement.getNextID());
var _local5 = l_oLayer.mc;
mc = _local5.attachMovie("pipe", "pipe" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_PIPE + sarbakan.visual.element.BaseElement.nNextID);
var _local3 = Math.random() * maze.MazeData.VIEW_TILE_WIDTH;
if (_local3 < maze.MazeData.MARGIN_PIPE) {
_local3 = maze.MazeData.MARGIN_PIPE;
}
if (_local3 > (maze.MazeData.VIEW_TILE_WIDTH - maze.MazeData.MARGIN_PIPE)) {
_local3 = _local3 - maze.MazeData.MARGIN_PIPE;
}
mc._x = (l_oPipeInfos.x * maze.MazeData.VIEW_TILE_WIDTH) + _local3;
mc._y = l_oPipeInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
tile(l_oPipeInfos.height * maze.MazeData.VIEW_TILE_HEIGHT);
mc.mcBottom._y = l_oPipeInfos.height * maze.MazeData.VIEW_TILE_HEIGHT;
mc.mcBottom.swapDepths(9999999);
bLastPipe = l_oPipeInfos.lastPipe;
disable();
}
function enable() {
super.enable();
mc._visible = true;
}
function disable() {
super.disable();
mc._visible = false;
}
function remove() {
super.remove();
}
function tile(l_nHeight) {
var _local4 = mc.mcMiddle1._height;
var _local5 = Math.round(l_nHeight / _local4);
var _local3;
var _local2 = 1;
while (_local2 < _local5) {
_local3 = mc.mcMiddle1.duplicateMovieClip("mcMiddle" + _local2, mc.getNextHighestDepth());
_local3._y = _local3._y + (_local2 * (_local4 - 1));
_local2++;
}
_local3._height = _local3._height * (_local5 - (l_nHeight / _local4));
}
function idle() {
if (collideWithElement("spongebob", mc.collider)) {
oOwner.oDynamicElements.spongebob.oCurrentPipe = this;
setState("characterOn");
}
}
function characterOn() {
if (!collideWithElement("spongebob", mc.collider)) {
if (oOwner.oDynamicElements.spongebob.oCurrentPipe == this) {
oOwner.oDynamicElements.spongebob.oCurrentPipe = undefined;
}
setState("idle");
}
}
}
Symbol 1242 MovieClip [__Packages.characters.VampiRay] Frame 0
class characters.VampiRay extends sarbakan.visual.element.DynamicElement
{
var mc, disable, updateState, oOwner, collideWithElementBox, setState, stateFinished;
function VampiRay (l_oLayer, l_oInfos) {
super("vampiRay" + sarbakan.visual.element.BaseElement.getNextID());
var _local3 = l_oLayer.mc;
mc = _local3.attachMovie("vampiRay", "vampiRay" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_VAMPIRAY + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
disable();
updateState();
}
function idle() {
if (nAttackDelayCount < ATTACK_DELAY) {
nAttackDelayCount++;
} else if (oOwner.oDynamicElements.spongebob.bCanBeScared && (collideWithElementBox("spongebob", mc.collider))) {
oOwner.oDynamicElements.spongebob.onScared();
nAttackDelayCount = 0;
setState("attack");
sarbakan.sound.SoundManager.play("vampiraySound", maze.MazeData.VOLUME_VAMPIRAY, 1, false);
}
}
function attack() {
if (stateFinished()) {
setState("idle");
}
}
static var ATTACK_DELAY = 200;
var nAttackDelayCount = 0;
}
Symbol 1243 MovieClip [__Packages.characters.Skeletuna] Frame 0
class characters.Skeletuna extends sarbakan.visual.element.DynamicElement
{
var mc, disable, updateState, collideWithElement, oOwner, setState, collideWithElementBox, stateFinished;
function Skeletuna (l_oLayer, l_oInfos) {
super("skeletuna" + sarbakan.visual.element.BaseElement.getNextID());
var _local3 = l_oLayer.mc;
mc = _local3.attachMovie("skeletuna", "skeletuna" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_SKELETUNA + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
disable();
updateState();
}
function checkDry() {
if (collideWithElement("water", mc.dry)) {
oOwner.oDynamicElements.spongebob.endBashingSkeletuna();
oOwner.oDynamicElements.spongebob.setState("idle");
setState("attackMiss");
oOwner.oDynamicElements.spongebob.mc._x = mc._x;
}
}
function idle() {
if (nAttackDelayCount < ATTACK_DELAY) {
nAttackDelayCount++;
} else if (oOwner.oDynamicElements.spongebob.bCanBeScared && (collideWithElementBox("spongebob", mc.collider))) {
nAttackDelayCount = 0;
setState("attackStart");
}
}
function attackStart() {
if (stateFinished()) {
if (collideWithElementBox("spongebob", mc.collider)) {
oOwner.oDynamicElements.spongebob.setState("captured");
oOwner.oDynamicElements.spongebob.oCurrentSkeletuna = this;
setState("attackGood");
sarbakan.sound.SoundManager.play("skeletunaGood", maze.MazeData.VOLUME_SKELETUNA, 1);
} else {
setState("attackMiss");
sarbakan.sound.SoundManager.play("skeletunaBad", maze.MazeData.VOLUME_SKELETUNA, 1);
}
}
}
function attackGood() {
if (stateFinished()) {
oOwner.oDynamicElements.spongebob.setState("capturedPush");
oOwner.oDynamicElements.spongebob.startBashingSkeletuna();
setState("push");
}
}
function attackEnd() {
if (stateFinished()) {
setState("idle");
}
}
function attackMiss() {
if (stateFinished()) {
setState("idle");
}
}
static var ATTACK_DELAY = 150;
var nAttackDelayCount = 0;
}
Symbol 1244 MovieClip [__Packages.maze.elements.decoration.SpiderWeb] Frame 0
class maze.elements.decoration.SpiderWeb extends sarbakan.visual.element.StaticElement
{
var mc;
function SpiderWeb (l_oLayer, l_oInfos) {
super("web" + sarbakan.visual.element.BaseElement.getNextID());
var _local3 = l_oLayer.mc;
mc = _local3.attachMovie("bgWeb", "web" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_SPIDERWEB + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
if (l_oInfos.flipped) {
mc._xscale = -100;
}
}
}
Symbol 1245 MovieClip [__Packages.maze.elements.decoration.Window] Frame 0
class maze.elements.decoration.Window extends sarbakan.visual.element.StaticElement
{
var mc;
function Window (l_oLayer, l_oInfos) {
super("window" + sarbakan.visual.element.BaseElement.getNextID());
var _local4 = l_oLayer.mc;
mc = _local4.attachMovie("bgWindow", "window" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_WINDOW + sarbakan.visual.element.BaseElement.nNextID);
mc.gotoAndStop(l_oInfos.number);
mc._x = (l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH) + (((l_oInfos.width * maze.MazeData.VIEW_TILE_WIDTH) + mc._width) / 2);
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
}
}
Symbol 1246 MovieClip [__Packages.maze.elements.decoration.Candle] Frame 0
class maze.elements.decoration.Candle extends sarbakan.visual.element.StaticElement
{
var mc;
function Candle (l_oLayer, l_oInfos) {
super("candle" + sarbakan.visual.element.BaseElement.getNextID());
var _local4 = l_oLayer.mc;
mc = _local4.attachMovie("bgCandle", "candle" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_CANDLE + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
if (_global.C.nQuality < Controller.QUALITY_MEDIUM) {
mc.mcAlpha.gotoAndStop(2);
mc.mcAlpha._visible = false;
}
}
}
Symbol 1247 MovieClip [__Packages.maze.elements.decoration.Exit] Frame 0
class maze.elements.decoration.Exit extends sarbakan.visual.element.StaticElement
{
var mc;
function Exit (l_oLayer, l_oInfos) {
super("exit");
var _local5 = l_oLayer.mc;
var _local4 = "exit";
if (_global.C.nLevelPart < 3) {
_local4 = "thisWay";
}
if ((_global.C.nLevelPart == 3) && (_global.C.oUnlockedCodes.data.BONUS_LEVEL)) {
_local4 = "signBonus";
}
mc = _local5.attachMovie(_local4, "exit", maze.MazeData.DEPTH_EXIT);
mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
if (_global.C.nQuality < Controller.QUALITY_MEDIUM) {
mc.mcSkull.mcAlpha.gotoAndStop(2);
mc.mcSkull.mcAlpha._visible = false;
}
}
}
Symbol 1248 MovieClip [__Packages.maze.elements.bonuses.Bonus] Frame 0
class maze.elements.bonuses.Bonus extends sarbakan.visual.element.DynamicElement
{
var oOwner, collideWithElement, mc, setState, DEFAULT_STATE, stateFinished;
function Bonus (l_oLayer, l_oInfos) {
super("bonus" + sarbakan.visual.element.BaseElement.getNextID());
}
function idle() {
if ((oOwner.oDynamicElements.spongebob.sState != "slidePipe") && (collideWithElement("spongebob", mc.collider))) {
onPick();
setState("pick");
}
}
function pick() {
DEFAULT_STATE = "picked";
if (stateFinished()) {
setState("picked");
}
}
function onPick() {
}
}
Symbol 1249 MovieClip [__Packages.maze.elements.bonuses.Burger] Frame 0
class maze.elements.bonuses.Burger extends maze.elements.bonuses.Bonus
{
var mc, disable;
function Burger (l_oLayer, l_oInfos) {
super(l_oLayer, l_oInfos);
var _local3 = l_oLayer.mc;
mc = _local3.attachMovie("burger", "burger" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_BONUS + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
disable();
}
function onPick() {
_global.C.oHUD.increaseScore(maze.MazeData.SCORE_HAMBURGER);
sarbakan.sound.SoundManager.play("eat", maze.MazeData.VOLUME_EAT, 1);
}
}
Symbol 1250 MovieClip [__Packages.maze.elements.bonuses.Waffle] Frame 0
class maze.elements.bonuses.Waffle extends maze.elements.bonuses.Bonus
{
var mc, disable;
function Waffle (l_oLayer, l_oInfos) {
super(l_oLayer, l_oInfos);
var _local3 = l_oLayer.mc;
mc = _local3.attachMovie("waffle", "waffle" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_BONUS + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
disable();
}
function onPick() {
_global.C.oHUD.increaseScore(maze.MazeData.SCORE_HAMBURGER);
sarbakan.sound.SoundManager.play("eat", maze.MazeData.VOLUME_EAT, 1);
}
}
Symbol 1251 MovieClip [__Packages.maze.elements.bonuses.Pumpkin] Frame 0
class maze.elements.bonuses.Pumpkin extends maze.elements.bonuses.Bonus
{
var mc, disable;
function Pumpkin (l_oLayer, l_oInfos) {
super(l_oLayer, l_oInfos);
var _local3 = l_oLayer.mc;
mc = _local3.attachMovie("pumpkin", "pumpkin" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_BONUS + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
disable();
}
function onPick() {
_global.C.oHUD.setItem(maze.MazeData.ELEMENT_PUMPKIN);
_global.C.oHUD.increaseScore(maze.MazeData.SCORE_PUMPKIN);
sarbakan.sound.SoundManager.play("bonus", maze.MazeData.VOLUME_BONUS, 1);
}
}
Symbol 1252 MovieClip [__Packages.maze.elements.bonuses.Slug] Frame 0
class maze.elements.bonuses.Slug extends maze.elements.bonuses.Bonus
{
var mc, disable;
function Slug (l_oLayer, l_oInfos) {
super(l_oLayer, l_oInfos);
var _local3 = l_oLayer.mc;
mc = _local3.attachMovie("slug", "slug" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_BONUS + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
disable();
}
function onPick() {
_global.C.oHUD.setItem(maze.MazeData.ELEMENT_SLUG);
_global.C.oHUD.increaseScore(maze.MazeData.SCORE_SLUG);
sarbakan.sound.SoundManager.play("bonus", maze.MazeData.VOLUME_BONUS, 1);
}
}
Symbol 1253 MovieClip [__Packages.maze.elements.bonuses.Token] Frame 0
class maze.elements.bonuses.Token extends maze.elements.bonuses.Bonus
{
var mc, disable;
function Token (l_oLayer, l_oInfos) {
super(l_oLayer, l_oInfos);
var _local3 = l_oLayer.mc;
mc = _local3.attachMovie("token", "token" + sarbakan.visual.element.BaseElement.nNextID, maze.MazeData.DEPTH_BONUS + sarbakan.visual.element.BaseElement.nNextID);
mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
disable();
}
function onPick() {
_global.C.oHUD.gainLife();
_global.C.oHUD.increaseScore(maze.MazeData.SCORE_TOKEN);
sarbakan.sound.SoundManager.play("life", maze.MazeData.VOLUME_LIFE, 1);
}
}
Symbol 1254 MovieClip [__Packages.maze.MazeGenerator] Frame 0
class maze.MazeGenerator
{
var oModel, aGrid, nX, nY, oRandom;
function MazeGenerator (l_oModel) {
oModel = l_oModel;
aGrid = oModel.aGrid;
nX = 0;
nY = 0;
oRandom = new sarbakan.utils.PredefinedRandom();
}
function generate(l_bBonusLevel) {
var _local4;
generateBorders();
nX = 0;
nY = 4;
while (nY < (oModel.nHeight - (maze.MazeData.FLOORS_MAX_HEIGHT + 2))) {
nX = 0;
while (nX < oModel.nWidth) {
generateAtCurrentPos();
nX++;
}
nY++;
}
var _local2 = getWalkWays();
generatePipes(_local2, l_bBonusLevel);
generateEndFloor();
if (!l_bBonusLevel) {
_local4 = generateEnemies(_local2);
}
generateBonuses(_local2, l_bBonusLevel);
generateDecoration(_local2, _local4);
}
function generateAtCurrentPos() {
if (underFloor() && (canCreateWall())) {
createWall();
} else if ((underWalkWay() || (underHole())) && (canCreateFloor())) {
createFloor();
}
}
function generatePipes(l_aWalkWays, l_bBonusLevel) {
for (var _local7 in l_aWalkWays) {
var _local4 = 0;
var _local5 = l_aWalkWays[_local7].width / 3;
if (isWalkWayIsolated(l_aWalkWays[_local7].x, l_aWalkWays[_local7].y, l_aWalkWays[_local7].width)) {
createPipe(l_aWalkWays[_local7]);
_local4++;
}
if (l_bBonusLevel) {
var _local3 = 0;
while (_local3 < l_aWalkWays[_local7].width) {
if (_local4 < _local5) {
if (Math.random() < maze.MazeData.CHANCE_PIPE_CREATION) {
if (createPipe(l_aWalkWays[_local7])) {
_local4++;
}
}
} else {
break;
}
_local3++;
}
}
}
}
function generateBorders() {
nY = 0;
while (nY < oModel.nHeight) {
nX = 0;
createWall();
nX = oModel.nWidth - 1;
createWall();
nY++;
}
}
function generateEndFloor() {
nY = oModel.nHeight - 1;
nX = 0;
while (nX < oModel.nWidth) {
createWall();
nX++;
}
createPipe({x:1, y:nY - 1, width:oModel.nWidth - 2}, true);
createExit(1 + Math.floor(oRandom.getLastGetted() * (oModel.nWidth - 2)), nY - 2);
}
function createExit(l_nX, l_nY) {
oModel.addElementExit(l_nX, l_nY);
}
function generateEnemies(l_aWalkWays) {
var _local5 = false;
var _local6;
for (var _local7 in l_aWalkWays) {
if (canCreateEnemy(l_aWalkWays[_local7])) {
var _local4 = l_aWalkWays[_local7].x + Math.floor(Math.random() * l_aWalkWays[_local7].width);
_local6 = aGrid[l_aWalkWays[_local7].y - 1][_local4] != maze.MazeData.TILE_EMPTY;
var _local3 = Math.random();
if (_local3 <= maze.MazeData.CHANCE_DUTCHMAN_CREATION) {
createDutchman(l_aWalkWays[_local7].x + sarbakan.utils.MoreMath.random(1, l_aWalkWays[_local7].width - 2), l_aWalkWays[_local7].y);
_local5 = true;
} else if (_local3 <= maze.MazeData.CHANCE_SKELETUNA_CREATION) {
createSkeletuna(l_aWalkWays[_local7].x, l_aWalkWays[_local7].y);
} else if ((_local3 <= maze.MazeData.CHANCE_VAMPIRAY_CREATION) && (_local6)) {
createVampiray(_local4, l_aWalkWays[_local7].y);
} else if (Math.random() < 0.6) {
createDutchman(l_aWalkWays[_local7].x + sarbakan.utils.MoreMath.random(1, l_aWalkWays[_local7].width - 2), l_aWalkWays[_local7].y);
_local5 = true;
} else {
createSkeletuna(l_aWalkWays[_local7].x, l_aWalkWays[_local7].y);
}
}
}
return(_local5);
}
function canCreateEnemy(l_aWalkWay) {
return((l_aWalkWay.width > 2) && (Math.random() < maze.MazeData.CHANCE_ENEMY_CREATION));
}
function createVampiray(l_nX, l_nY) {
oModel.addElementVampiRay(l_nX, l_nY);
}
function createDutchman(l_nX, l_nY) {
oModel.addElementDutchMan(l_nX, l_nY);
}
function createSkeletuna(l_nX, l_nY, l_nWidth) {
oModel.addElementSkeletuna(l_nX + 2, l_nY);
}
function generateBonuses(l_aWalkWays, l_bBonusLevel) {
var _local6;
if (_global.C.oUnlockedCodes.data.RANDOM_WAFFLES) {
_local6 = maze.MazeData.CHANCE_BONUS_CREATION_WAFFLECODE;
} else {
_local6 = maze.MazeData.CHANCE_BONUS_CREATION;
}
for (var _local8 in l_aWalkWays) {
if (l_bBonusLevel) {
var _local4 = l_aWalkWays[_local8].x;
while (_local4 < (l_aWalkWays[_local8].x + l_aWalkWays[_local8].width)) {
createBurger(_local4, l_aWalkWays[_local8].y, true);
_local4++;
}
} else if (Math.random() < _local6) {
var _local5 = Math.random();
var _local4 = l_aWalkWays[_local8].x + Math.floor(Math.random() * l_aWalkWays[_local8].width);
if (_local5 <= maze.MazeData.CHANCE_TOKEN_CREATION) {
createToken(_local4, l_aWalkWays[_local8].y);
} else if (_local5 <= maze.MazeData.CHANCE_PUMPKIN_CREATION) {
createPumpkin(_local4, l_aWalkWays[_local8].y);
} else if (_local5 <= maze.MazeData.CHANCE_SLUG_CREATION) {
createSlug(_local4, l_aWalkWays[_local8].y);
} else if (_local5 <= maze.MazeData.CHANCE_BURGER_CREATION) {
createBurger(_local4, l_aWalkWays[_local8].y);
}
}
}
}
function createToken(l_nX, l_nY) {
oModel.addElementToken(l_nX, l_nY);
}
function createPumpkin(l_nX, l_nY) {
oModel.addElementPumpkin(l_nX, l_nY);
}
function createSlug(l_nX, l_nY) {
oModel.addElementSlug(l_nX, l_nY);
}
function createBurger(l_nX, l_nY, l_bBonusLevel) {
if (_global.C.oUnlockedCodes.data.RANDOM_WAFFLES || (l_bBonusLevel)) {
oModel.addElementWaffle(l_nX, l_nY);
} else {
oModel.addElementBurger(l_nX, l_nY);
}
}
function generateDecoration(l_aWalkWays, l_bDutchmanCreated) {
for (var _local5 in l_aWalkWays) {
if (canGenerateSpiderWeb(l_aWalkWays[_local5])) {
createSpiderWeb(l_aWalkWays[_local5]);
}
if (canGenerateWindow(l_aWalkWays[_local5]) && (!l_bDutchmanCreated)) {
var _local3 = 1;
if (l_aWalkWays[_local5].width >= 4) {
_local3++;
}
if (l_aWalkWays[_local5].width >= 6) {
_local3++;
}
createWindow(l_aWalkWays[_local5], _local3);
}
if (canGenerateCandle()) {
createCandle(l_aWalkWays[_local5]);
}
}
}
function underFloor() {
return((nY == 0) || (aGrid[nY - 1][nX] == maze.MazeData.TILE_FLOOR));
}
function underWalkWay() {
return((nY == 1) || (((nY > 1) && (aGrid[nY - 1][nX] == maze.MazeData.TILE_EMPTY)) && (aGrid[nY - 2][nX] == maze.MazeData.TILE_FLOOR)));
}
function underHole() {
return(((nY > 1) && (aGrid[nY - 1][nX] == maze.MazeData.TILE_EMPTY)) && (aGrid[nY - 2][nX] == maze.MazeData.TILE_EMPTY));
}
function canCreateFloor() {
return((((!mustCreateHole()) && ((oModel.nWidth - nX) >= maze.MazeData.FLOORS_MIN_WIDTH)) && (isGridFree(maze.MazeData.FLOORS_MIN_WIDTH, maze.MazeData.FLOORS_MIN_HEIGHT))) && (Math.random() < maze.MazeData.CHANCE_FLOOR_CREATION));
}
function mustCreateHole() {
return((aGrid[nY][nX - 1] == maze.MazeData.TILE_EMPTY) && (aGrid[nY][nX - 2] != maze.MazeData.TILE_EMPTY));
}
function createFloor() {
var _local2;
_local2 = maze.MazeData.getRandomFloor();
while ((_local2.width > (oModel.nWidth - nX)) || (!isGridFree(_local2.width, _local2.height))) {
_local2 = maze.MazeData.getRandomFloor();
}
fillGrid(maze.MazeData.TILE_FLOOR, _local2.width, _local2.height);
oModel.addElementFloor(nX, nY, _local2.width, _local2.height);
}
function canCreateWall() {
return(((((oModel.nWidth - nX) >= 1) && (aGrid[nY + 1][nX] == maze.MazeData.TILE_EMPTY)) && (Math.random() < maze.MazeData.CHANCE_WALL_CREATION)) && (isGridFree(1, 1)));
}
function createWall() {
fillGrid(maze.MazeData.TILE_WALL, 1, 1);
oModel.addElementWall(nX, nY);
}
function createPipe(l_oWalkWay, l_bLastPipe) {
var _local4 = l_oWalkWay.x + Math.floor(oRandom.get() * l_oWalkWay.width);
var _local3 = l_oWalkWay.y + 1;
var _local5 = 0;
if (aGrid[_local3][_local4] != maze.MazeData.TILE_PIPE) {
aGrid[_local3][_local4] = maze.MazeData.TILE_PIPE;
var _local2 = _local3;
while (_local2 < oModel.nHeight) {
if (aGrid[_local2][_local4] == maze.MazeData.TILE_EMPTY) {
break;
}
_local5++;
_local2++;
}
oModel.addElementPipe(_local4, _local3, _local5, l_bLastPipe);
return(true);
}
return(createPipe(l_oWalkWay, l_bLastPipe));
}
function createSpiderWeb(l_aWalkWay) {
var _local5;
var _local4;
var _local3;
if (Math.random() < 0.5) {
_local4 = l_aWalkWay.x;
_local3 = l_aWalkWay.y;
_local5 = true;
} else {
_local4 = l_aWalkWay.x + l_aWalkWay.width;
_local3 = l_aWalkWay.y;
_local5 = false;
}
oModel.addElementSpiderWeb(_local4, _local3, _local5);
}
function createWindow(l_aWalkWay, l_nNumber) {
oModel.addElementWindow(l_aWalkWay.x, l_aWalkWay.y, l_aWalkWay.width, l_nNumber);
}
function createCandle(l_aWalkWay) {
oModel.addElementCandle(l_aWalkWay.x, l_aWalkWay.y);
}
function canGenerateSpiderWeb(l_aWalkWay) {
return(isWalkWayIsolated(l_aWalkWay.x, l_aWalkWay.y, l_aWalkWay.width) && (Math.random() < maze.MazeData.CHANCE_SPIDERWEB_CREATION));
}
function canGenerateWindow(l_aWalkWay) {
return((l_aWalkWay.width > 1) && (Math.random() < maze.MazeData.CHANCE_WINDOW_CREATION));
}
function canGenerateCandle() {
return(Math.random() < maze.MazeData.CHANCE_CANDLE_CREATION);
}
function fillGrid(l_nTileType, l_nWidth, l_nHeight) {
var _local3 = nY;
while (_local3 < (nY + l_nHeight)) {
var _local2 = nX;
while (_local2 < (nX + l_nWidth)) {
aGrid[_local3][_local2] = l_nTileType;
_local2++;
}
_local3++;
}
}
function isGridFree(l_nWidth, l_nHeight) {
var _local3 = nY;
while (_local3 < (nY + l_nHeight)) {
var _local2 = nX;
while (_local2 < (nX + l_nWidth)) {
if (aGrid[_local3][_local2] != maze.MazeData.TILE_EMPTY) {
return(false);
}
_local2++;
}
_local3++;
}
return(true);
}
function getWalkWays() {
var _local4 = [];
var _local2 = false;
var _local3 = {};
var _local7 = 0;
while (_local7 < (oModel.nHeight - (maze.MazeData.FLOORS_MAX_HEIGHT + 2))) {
var _local5 = 0;
while (_local5 < oModel.nWidth) {
if (_local2) {
if ((aGrid[_local7][_local5] == maze.MazeData.TILE_EMPTY) && (aGrid[_local7 + 1][_local5] != maze.MazeData.TILE_EMPTY)) {
_local3.width++;
if (_local5 == (oModel.nWidth - 1)) {
_local4.push(_local3);
_local2 = false;
}
} else {
_local2 = false;
_local4.push(_local3);
}
} else if ((aGrid[_local7][_local5] == maze.MazeData.TILE_EMPTY) && (aGrid[_local7 + 1][_local5] != maze.MazeData.TILE_EMPTY)) {
_local2 = true;
_local3 = {x:_local5, y:_local7, width:1};
if (_local5 == (oModel.nWidth - 1)) {
_local4.push(_local3);
_local2 = false;
}
}
_local5++;
}
_local7++;
}
return(_local4);
}
function isWalkWayIsolated(l_nX, l_nY, l_nWidth) {
var _local3 = false;
var _local5 = false;
if (((l_nX > 0) && (aGrid[l_nY][l_nX - 1] == maze.MazeData.TILE_EMPTY)) && (aGrid[l_nY + 1][l_nX - 1] == maze.MazeData.TILE_EMPTY)) {
_local3 = true;
}
if (((l_nX < oModel.nWidth) && (aGrid[l_nY][l_nX + l_nWidth] == maze.MazeData.TILE_EMPTY)) && (aGrid[l_nY + 1][l_nX + l_nWidth] == maze.MazeData.TILE_EMPTY)) {
_local5 = true;
}
if ((!_local3) && (!_local5)) {
return(true);
}
}
}
Symbol 1255 MovieClip [__Packages.sarbakan.utils.PredefinedRandom] Frame 0
class sarbakan.utils.PredefinedRandom
{
var nListSize, aList, aOriginalList;
function PredefinedRandom (l_nListSize) {
if (l_nListSize) {
nListSize = l_nListSize;
} else {
nListSize = DEFAULT_LIST_SIZE;
}
regenerate();
}
function get() {
var _local2 = aList.pop();
aList.unshift(_local2);
return(_local2);
}
function getLastGetted() {
return(aList[0]);
}
function regenerate() {
aList = [];
var _local2 = 0;
while (_local2 < nListSize) {
aList.push(Math.random());
_local2++;
}
aOriginalList = aList;
}
static var DEFAULT_LIST_SIZE = 50;
}
Symbol 1256 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 togglePause() {
if (!bPaused) {
pause();
} else {
unpause();
}
}
function pause() {
bWillPause = true;
}
function unpause() {
if (bPaused) {
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.unpause();
_local2++;
}
sarbakan.visual.PauseManager.unpause();
}
bPaused = false;
bWillPause = false;
}
function update() {
if (bWillPause) {
bPaused = true;
bWillPause = false;
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.pause();
_local2++;
}
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 1257 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 1258 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.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 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 = 5;
static var DEFAULT_EASING = mx.transitions.easing.Regular.easeOut;
}
Symbol 1259 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 1260 MovieClip [__Packages.characters.SpongeBob] Frame 0
class characters.SpongeBob extends sarbakan.visual.element.DynamicElement
{
static var ORIGINAL_Y;
var setMC, enable, setState, bAlwaysActive, bStaticMovieClip, oKey, mc, nCameraX, nCameraY, bAutoBash, bLevelRestarting, bCanBeScared, bMasked, bMaskDestroying, nMaskDestroyCount, bGreased, nTimeout, nSpeedX, mcPumpkin, mcGrease, nSpeedY, stateFinished, oSlidingPipe, bBashingA, oSquishSound, nSlideDistance, nSlideDistanceTotal, bBashingB, oCurrentSkeletuna, stateCurrentFrame, oCurrentPipe, collideWithElement, sState, collideWithMap, oKeyBasherA, nSlideModifier, oKeyBasherB;
function SpongeBob (l_mc) {
super("spongebob");
setMC(l_mc);
enable();
setState("waitForStart");
bAlwaysActive = true;
bStaticMovieClip = true;
oKey = sarbakan.input.KeyManager.getInstance();
oKey.addKeyListener(38, "UP");
oKey.addKeyListener(40, "DOWN");
oKey.addKeyListener(37, "LEFT");
oKey.addKeyListener(39, "RIGHT");
oKey.addKeyListener(32, "SPACE");
oKey.addKeyListener(80, "P");
mc.swapDepths(maze.MazeData.DEPTH_SPONGEBOB);
mc._x = ((_global.C.oModel.nWidth * maze.MazeData.VIEW_TILE_WIDTH) - mc._width) / 2;
if (!ORIGINAL_Y) {
ORIGINAL_Y = mc._y;
} else {
mc._y = ORIGINAL_Y;
}
nCameraX = BASE_CAMERAX;
nCameraY = BASE_CAMERAY;
bAutoBash = false;
bLevelRestarting = false;
bCanBeScared = false;
bMasked = false;
bMaskDestroying = false;
nMaskDestroyCount = 0;
bGreased = false;
nTimeout = 0;
}
function update() {
super.update();
bCanBeScared = canBeScared();
updateMask();
updateGrease();
}
function getCoord() {
return({x:mc._x + nCameraX, y:mc._y + nCameraY});
}
function onScared() {
nSpeedX = 0;
setState("scared");
}
function setPumpkin(l_mcPumpkin) {
mcPumpkin = l_mcPumpkin;
updateMask();
}
function setGrease(l_mcGrease) {
mcGrease = l_mcGrease;
updateGrease();
}
function waitForStart() {
}
function idle() {
nSpeedX = 0;
nSpeedY = 0;
if (oKey.LEFT || (oKey.RIGHT)) {
setState("run");
}
checkPipe();
checkFall();
checkDry();
checkItem();
}
function run() {
checkWall();
if ((!oKey.LEFT) && (!oKey.RIGHT)) {
setState("idle");
}
if (oKey.LEFT) {
nSpeedX = SPEED_RUN * -1;
} else if (oKey.RIGHT) {
nSpeedX = SPEED_RUN;
}
mc.state.splat._visible = bGreased;
checkDry();
checkItem();
checkFall();
}
function fallStart() {
fall();
if (stateFinished()) {
setState("fall");
}
}
function fall() {
checkWall();
nSpeedY = SPEED_FALL;
if (isOnGround()) {
setPositionOutFloor();
nSpeedY = 0;
setState("land");
} else if (oKey.LEFT) {
nSpeedX = -1 * SPEED_FALL_MOVEX;
} else if (oKey.RIGHT) {
nSpeedX = SPEED_FALL_MOVEX;
} else {
nSpeedX = 0;
}
}
function land() {
if (stateFinished()) {
setState("idle");
}
}
function jumpInPipe() {
if (mc.state._currentframe == FR_INTUBE) {
mc._x = oSlidingPipe.mc._x + CORRECTION_TUBE;
}
if (stateFinished()) {
startBashingPipe();
setState("getInPipe");
}
}
function getInPipe() {
if (!bBashingA) {
mc.state.prevFrame();
} else {
mc.state.stop();
}
checkDry();
if (oKey.UP) {
endBashingPipe(false);
}
if (!sarbakan.sound.SoundManager.isSoundPlaying(oSquishSound)) {
oSquishSound = sarbakan.sound.SoundManager.play("squish" + sarbakan.utils.MoreMath.random(1, 6), maze.MazeData.VOLUME_SQUISH, 1);
}
}
function slidePipe() {
if (sarbakan.sound.SoundManager.isSoundPlaying(oSquishSound)) {
sarbakan.sound.SoundManager.fade(oSquishSound, sarbakan.sound.SoundManager.FADE_VOLUME, 0, 10);
}
nSlideDistance = nSlideDistance + nSpeedY;
if (nSlideDistance >= nSlideDistanceTotal) {
nSpeedY = 0;
mc._y = mc._y + CORRECTION_ENDSLIDE;
setState("outPipeGood");
}
}
function outPipeGood() {
if (stateFinished()) {
setState("fall");
if (oSlidingPipe.bLastPipe) {
if ((_global.C.nLevelPart < 3) || (_global.C.oUnlockedCodes.data.BONUS_LEVEL && (_global.C.nLevelPart < 4))) {
_global.C.oWater.setState("done");
_global.C.endLevelPart();
} else {
_global.C.endGame(true);
}
}
}
}
function outPipeMiss() {
if (sarbakan.sound.SoundManager.isSoundPlaying(oSquishSound)) {
sarbakan.sound.SoundManager.fade(oSquishSound, sarbakan.sound.SoundManager.FADE_VOLUME, 0, 20);
}
if (stateFinished()) {
setState("idle");
}
}
function scared() {
if (mc.state._currentframe == FR_SCARED_YELL) {
sarbakan.sound.SoundManager.play("scared" + sarbakan.utils.MoreMath.random(1, 2), maze.MazeData.VOLUME_SCARED, 1);
}
if (stateFinished()) {
setState("idle");
}
}
function captured() {
nSpeedX = 0;
}
function capturedPush() {
if ((!bBashingA) || (!bBashingB)) {
if (oCurrentSkeletuna.mc.state._currentFrame > 1) {
oCurrentSkeletuna.mc.state.prevFrame();
} else {
oCurrentSkeletuna.mc.state.stop();
}
} else {
oCurrentSkeletuna.mc.state.nextFrame();
if (oCurrentSkeletuna.mc.state._currentFrame == oCurrentSkeletuna.mc.state._totalframes) {
oCurrentSkeletuna.setState("attackEnd");
endBashingSkeletuna();
setState("idle");
mc._x = oCurrentSkeletuna.mc._x;
}
}
oCurrentSkeletuna.checkDry();
if (!sarbakan.sound.SoundManager.isSoundPlaying(oSquishSound)) {
oSquishSound = sarbakan.sound.SoundManager.play("skeletunaOut" + sarbakan.utils.MoreMath.random(1, 3), maze.MazeData.VOLUME_SKELETUNAOUT, 1);
}
}
function dry() {
nSpeedX = 0;
if (stateFinished() && (!bLevelRestarting)) {
bLevelRestarting = true;
_global.C.oWater.setState("done");
_global.C.oHUD.loseLife();
}
}
function putMask() {
if (stateCurrentFrame() == 3) {
sarbakan.sound.SoundManager.play("putMask", maze.MazeData.VOLUME_PUTMASK, 1);
}
if (stateFinished()) {
setState("idle");
startMask();
}
}
function greaseSelf() {
if (stateCurrentFrame() == 26) {
sarbakan.sound.SoundManager.play("greaseA", maze.MazeData.VOLUME_GREASE, 1);
}
if (stateFinished()) {
setState("idle");
startGrease();
}
}
function checkFall() {
if (!isOnGround()) {
setState("fallStart");
}
}
function checkWall() {
if (isHittingWall()) {
setPositionOutWall();
nSpeedX = 0;
}
}
function checkPipe() {
if (oCurrentPipe && (oKey.DOWN)) {
setState("jumpInPipe");
endMask();
oSlidingPipe = oCurrentPipe;
nSlideDistanceTotal = oCurrentPipe.mc._height;
}
}
function checkDry() {
if (collideWithElement("water", mc.dry)) {
if (sState == "getInPipe") {
endBashingPipe(false);
} else {
setState("dry");
}
}
}
function isOnGround() {
return(collideWithMap("floor", mc.bottom));
}
function isHittingWall() {
return(collideWithMap("floor", mc.front));
}
function canBeScared() {
return((!bMasked) && ((sState == "idle") || (sState == "run")));
}
function checkItem() {
if (oKey.SPACE && (_global.C.oHUD.getItem())) {
var _local3 = _global.C.oHUD.getItem();
_global.C.oHUD.useItem();
switch (_local3) {
case maze.MazeData.ELEMENT_PUMPKIN :
endGrease();
setState("putMask");
break;
case maze.MazeData.ELEMENT_SLUG :
endMask();
setState("greaseSelf");
}
nSpeedX = 0;
}
}
function setPositionOutFloor() {
while (isOnGround()) {
mc._y--;
}
mc._y++;
}
function setPositionOutWall() {
mc._x = mc._x - nSpeedX;
}
function startBashingPipe() {
if (bGreased || (bAutoBash)) {
oKeyBasherA = new sarbakan.input.KeyBasher(40, 1, 1, sarbakan.utils.Delegate.create(this, onBashReportPipe));
oKeyBasherA.enableAutoBashing();
} else {
nSlideModifier = Math.round(nSlideDistanceTotal / maze.MazeData.VIEW_TILE_HEIGHT);
if (nSlideModifier > 4) {
nSlideModifier = 4;
}
oKeyBasherA = new sarbakan.input.KeyBasher(40, BASH_BASE_RATE * nSlideModifier, BASH_BASE_SPEED[_global.C.nDifficultyLevel] * nSlideModifier, sarbakan.utils.Delegate.create(this, onBashReportPipe));
}
bBashingA = true;
}
function startBashingSkeletuna() {
oKeyBasherA = new sarbakan.input.KeyBasher(37, BASH_BASE_RATE, BASH_BASE_SPEED[_global.C.nDifficultyLevel], sarbakan.utils.Delegate.create(this, onBashReportSkeletuna, "bBashingA"));
oKeyBasherB = new sarbakan.input.KeyBasher(39, BASH_BASE_RATE, BASH_BASE_SPEED[_global.C.nDifficultyLevel], sarbakan.utils.Delegate.create(this, onBashReportSkeletuna, "bBashingB"));
bBashingA = false;
bBashingB = false;
}
function onBashReportPipe(l_bSuccess) {
if (!sarbakan.visual.PauseManager.bPaused) {
if (l_bSuccess) {
mc.state.nextFrame();
if (stateFinished()) {
endBashingPipe(true);
}
bBashingA = true;
} else {
if (mc.state._currentframe == 1) {
endBashingPipe(false);
}
bBashingA = false;
}
}
}
function endBashingPipe(l_bSuccess) {
oKeyBasherA.end();
if (l_bSuccess) {
startSlide();
} else {
setState("outPipeMiss");
}
}
function onBashReportSkeletuna(l_sVarName, l_bSuccess) {
if (!sarbakan.visual.PauseManager.bPaused) {
if (l_bSuccess) {
this[l_sVarName] = true;
} else {
this[l_sVarName] = false;
}
}
}
function endBashingSkeletuna() {
oKeyBasherA.end();
oKeyBasherB.end();
}
function startSlide() {
nSpeedY = SPEED_SLIDE;
if ((bGreased || (bAutoBash)) || (nSlideModifier >= 3)) {
nSpeedY = SPEED_SLIDE_GREASED;
}
nSlideDistance = 0;
setState("slidePipe");
}
function startMask() {
bMasked = true;
nTimeout = 0;
}
function endMask() {
if (bMasked) {
nMaskDestroyCount = 0;
mcPumpkin.gotoAndPlay("remove");
bMaskDestroying = true;
sarbakan.sound.SoundManager.play("endMask", maze.MazeData.VOLUME_ENDMASK, 1);
}
}
function updateMask() {
if (bMasked || (sState == "putMask")) {
mcPumpkin._visible = true;
if (bMaskDestroying) {
if ((++nMaskDestroyCount) < FR_MASKDESTROY) {
mcPumpkin.gotoAndStop("remove");
mcPumpkin.state.gotoAndStop(nMaskDestroyCount);
} else {
bMaskDestroying = false;
bMasked = false;
mcPumpkin._visible = false;
}
}
} else {
mcPumpkin._visible = false;
}
if ((((++nTimeout) >= TIMEOUT_MASK) && (bMasked)) && (!bMaskDestroying)) {
endMask();
}
}
function startGrease() {
bGreased = true;
nTimeout = 0;
}
function endGrease() {
bGreased = false;
}
function updateGrease() {
if (bGreased) {
mcGrease._visible = true;
if ((++nTimeout) >= TIMEOUT_GREASE) {
endGrease();
}
} else {
mcGrease._visible = false;
}
}
static var SPEED_RUN = 8;
static var SPEED_FALL = 10;
static var SPEED_SLIDE = 10;
static var SPEED_SLIDE_GREASED = 16;
static var SPEED_FALL_MOVEX = 4;
static var FR_INTUBE = 15;
static var FR_MASKDESTROY = 8;
static var FR_SCARED_YELL = 5;
static var CORRECTION_TUBE = 18;
static var CORRECTION_ENDSLIDE = 40;
static var BASH_BASE_RATE = 1;
static var BASH_BASE_SPEED = [10, 8, 5];
static var BASE_CAMERAX = -295;
static var BASE_CAMERAY = -150;
static var TIMEOUT_MASK = 500;
static var TIMEOUT_GREASE = 800;
}
Symbol 1261 MovieClip [__Packages.sarbakan.input.KeyBasher] Frame 0
class sarbakan.input.KeyBasher
{
var oEnterFrameListener, oKey, nPressNeeded, nPressCount, nUpdateDelay, nUpdateCount, fListener, bLastFrameWasDown, bAutoBashing;
function KeyBasher (l_nKey, l_nPressNeeded, l_nUpdateDelay, l_fListener) {
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = mx.utils.Delegate.create(this, update);
MovieClip.addListener(oEnterFrameListener);
oKey = sarbakan.input.KeyManager.getInstance();
oKey.addKeyListener(l_nKey, "KEY");
nPressNeeded = l_nPressNeeded;
nPressCount = 0;
nUpdateDelay = l_nUpdateDelay;
nUpdateCount = 0;
fListener = l_fListener;
bLastFrameWasDown = false;
bAutoBashing = false;
}
function enableAutoBashing() {
bAutoBashing = true;
}
function disableAutoBashing() {
bAutoBashing = false;
}
function end() {
MovieClip.removeListener(oEnterFrameListener);
}
function update() {
if (oKey.KEY) {
if (!bLastFrameWasDown) {
nPressCount++;
}
bLastFrameWasDown = true;
} else {
bLastFrameWasDown = false;
}
if ((++nUpdateCount) == nUpdateDelay) {
report();
nUpdateCount = 0;
nPressCount = 0;
}
}
function report() {
if ((nPressCount >= nPressNeeded) || (bAutoBashing)) {
fListener(true);
} else {
fListener(false);
}
}
}
Symbol 1262 MovieClip [__Packages.sarbakan.input.KeyManager] Frame 0
class sarbakan.input.KeyManager
{
static var oInstance;
var oKeyList;
function KeyManager () {
mx.transitions.OnEnterFrameBeacon.init();
MovieClip.addListener(this);
oKeyList = new Object();
}
static function getInstance() {
if (!oInstance) {
oInstance = new sarbakan.input.KeyManager();
}
return(oInstance);
}
function addKeyListener(l_nKeyCode, l_sKeyName) {
oKeyList[l_sKeyName] = new Object();
oKeyList[l_sKeyName].nKeyCode = l_nKeyCode;
this[l_sKeyName] = false;
}
function onEnterFrame() {
setKey();
}
function setKey() {
var _local2;
for (_local2 in oKeyList) {
if (Key.isDown(oKeyList[_local2].nKeyCode)) {
this[_local2] = true;
} else {
this[_local2] = false;
}
}
}
}
Symbol 1263 MovieClip [__Packages.maze.elements.Water] Frame 0
class maze.elements.Water extends sarbakan.visual.element.DynamicElement
{
static var ORIGINAL_Y;
var setMC, enable, setState, bAlwaysActive, bStaticMovieClip, mc, nSpeed, oOwner;
function Water (l_mc) {
super("water");
setMC(l_mc);
enable();
setState("waitForStart");
bAlwaysActive = true;
bStaticMovieClip = true;
if (!ORIGINAL_Y) {
ORIGINAL_Y = mc._y;
} else {
mc._y = ORIGINAL_Y;
}
if (_global.C.nQuality < Controller.QUALITY_MEDIUM) {
mc.mcAlpha._alpha = 100;
mc.mcAlpha._visible = false;
}
nSpeed = maze.MazeData.DIFFICULTY_SETTING[_global.C.nDifficultyLevel].raiseSpeed;
if (_global.C.oUnlockedCodes.data.SYRUP_WATER) {
nSpeed = nSpeed * 0.85;
}
mc.swapDepths(maze.MazeData.DEPTH_WATER);
mc.play();
}
function waitForStart() {
}
function idle() {
if ((oOwner.oDynamicElements.spongebob.sState == "dry") && (nSpeed < maze.MazeData.DIFFICULTY_SETTING[maze.MazeData.DIFFICULTY_HARD].raiseSpeed)) {
nSpeed = nSpeed + 0.1;
}
var _local2 = Math.abs(mc._y - oOwner.oDynamicElements.spongebob.mc._y);
if ((((_local2 > JUMP_DIFFERENCE) && (oOwner.oDynamicElements.spongebob.sState != "dry")) && (oOwner.oDynamicElements.spongebob.sState != "slidePipe")) && (oOwner.oDynamicElements.spongebob.sState != "outPipeGood")) {
mc._y = mc._y + ((_local2 - JUMP_DIFFERENCE) + 1);
} else {
mc._y = mc._y + nSpeed;
}
mc._x = oOwner.mc._x * -1;
}
static var JUMP_DIFFERENCE = 250;
}
Symbol 1264 MovieClip [__Packages.sarbakan.visual.activation.GridActivation] Frame 0
class sarbakan.visual.activation.GridActivation extends sarbakan.visual.activation.ActivationManager
{
var nZoneWidth, nZoneHeight, oDynamicElementsZone, oAlwaysActive, oStaticElementsZone, oCurrentZone, nCurrentX, nCurrentY, aVisibleZones;
function GridActivation () {
super();
}
function init(l_nZoneWidth, l_nZoneHeight) {
super.init();
nZoneWidth = l_nZoneWidth;
nZoneHeight = l_nZoneHeight;
oDynamicElementsZone = [];
oAlwaysActive = [];
oStaticElementsZone = [];
oCurrentZone = {};
oCurrentZone = {x:-999999, y:-999999};
}
function getActiveElements() {
var _local3 = [];
_local3 = _local3.concat(oAlwaysActive);
var _local2 = getSurroundingZones(oCurrentZone);
_local2.push(oCurrentZone);
for (var _local4 in _local2) {
_local3 = _local3.concat(oDynamicElementsZone[_local2[_local4].x][_local2[_local4].y]);
}
return(_local3);
}
function addDynamicElement(l_oElement, l_nX, l_nY, l_nWidth, l_nHeight) {
addToActivationZones(oDynamicElementsZone, l_oElement, l_nX, l_nY, l_nWidth, l_nHeight);
}
function removeDynamicElement(l_oElement) {
for (var _local5 in oDynamicElementsZone) {
for (var _local4 in oDynamicElementsZone[_local5]) {
if (oDynamicElementsZone[_local5][_local4]) {
for (var _local3 in oDynamicElementsZone[_local5][_local4]) {
if (oDynamicElementsZone[_local5][_local4][_local3]) {
if (l_oElement == oDynamicElementsZone[_local5][_local4][_local3]) {
delete oDynamicElementsZone[_local5][_local4][_local3];
}
}
}
}
}
}
}
function addStaticElement(l_oElement, l_nX, l_nY, l_nWidth, l_nHeight) {
addToActivationZones(oStaticElementsZone, l_oElement, l_nX, l_nY, l_nWidth, l_nHeight);
}
function removeStaticElement(l_oElement) {
}
function addAlwaysActiveElement(l_oElement) {
oAlwaysActive.push(l_oElement);
}
function updateActivation(l_nX, l_nY) {
nCurrentX = l_nX;
nCurrentY = l_nY;
var _local4 = getCurrentZone();
var _local2 = getSurroundingZones(_local4);
_local2.push(_local4);
if (((_local4.x != oCurrentZone.x) || (_local4.y != oCurrentZone.y)) || (zoneChanged(_local2))) {
var _local3 = getSurroundingZones(oCurrentZone);
_local3.push(oCurrentZone);
for (var _local5 in _local3) {
disableDynamicZone(_local3[_local5].x, _local3[_local5].y);
disableStaticZone(_local3[_local5].x, _local3[_local5].y);
}
for (var _local5 in _local2) {
enableDynamicZone(_local2[_local5].x, _local2[_local5].y);
enableStaticZone(_local2[_local5].x, _local2[_local5].y);
}
}
getVisibleZones(_local4);
oCurrentZone = _local4;
aVisibleZones = _local2;
}
function addToActivationZones(l_aZoneTable, l_oElementToRegister, l_nPosX, l_nPosY, l_nWidth, l_nHeight) {
var _local8;
var _local7;
_local8 = l_nWidth / nZoneWidth;
if (_local8 < 1) {
_local8 = 1;
}
_local8 = Math.round(_local8);
_local7 = l_nHeight / nZoneHeight;
if (_local7 < 1) {
_local7 = 1;
}
_local7 = Math.round(_local7);
addToZone(l_aZoneTable, l_oElementToRegister, l_nPosX, l_nPosY);
var _local2 = 1;
while (_local2 <= _local8) {
addToZone(l_aZoneTable, l_oElementToRegister, l_nPosX + (nZoneWidth * _local2), l_nPosY);
_local2++;
}
_local2 = 1;
while (_local2 <= _local7) {
addToZone(l_aZoneTable, l_oElementToRegister, l_nPosX, l_nPosY + (nZoneHeight * _local2));
_local2++;
}
}
function addToZone(l_aZoneTable, l_oElementToRegister, l_nPosX, l_nPosY) {
var _local2 = getZone(l_nPosX, l_nPosY);
if (!l_aZoneTable[_local2.x]) {
l_aZoneTable[_local2.x] = [];
}
if (!l_aZoneTable[_local2.x][_local2.y]) {
l_aZoneTable[_local2.x][_local2.y] = [];
}
l_aZoneTable[_local2.x][_local2.y].push(l_oElementToRegister);
}
function getZone(l_nPosX, l_nPosY) {
var _local3 = Math.floor(l_nPosX / nZoneWidth) * nZoneWidth;
var _local2 = Math.floor(l_nPosY / nZoneHeight) * nZoneHeight;
return({x:_local3, y:_local2});
}
function getSurroundingZones(l_oZone) {
var _local3 = [];
_local3.push({x:l_oZone.x - nZoneWidth, y:l_oZone.y - nZoneHeight});
_local3.push({x:l_oZone.x, y:l_oZone.y - nZoneHeight});
_local3.push({x:l_oZone.x + nZoneWidth, y:l_oZone.y - nZoneHeight});
_local3.push({x:l_oZone.x - nZoneWidth, y:l_oZone.y});
_local3.push({x:l_oZone.x + nZoneWidth, y:l_oZone.y});
_local3.push({x:l_oZone.x - nZoneWidth, y:l_oZone.y + nZoneHeight});
_local3.push({x:l_oZone.x, y:l_oZone.y + nZoneHeight});
_local3.push({x:l_oZone.x + nZoneWidth, y:l_oZone.y + nZoneHeight});
return(_local3);
}
function getVisibleZones(l_oZone) {
var _local3 = [];
var _local5 = Math.abs(Math.floor(nCurrentX / nZoneWidth) - (nCurrentX / nZoneWidth));
var _local4 = Math.abs(Math.floor(nCurrentY / nZoneHeight) - (nCurrentY / nZoneHeight));
if (_local5 < 0.5) {
_local3.push({x:l_oZone.x - nZoneWidth, y:l_oZone.y});
if (_local4 < 0.5) {
_local3.push({x:l_oZone.x - nZoneWidth, y:l_oZone.y - nZoneHeight});
}
if (_local4 > 0.5) {
_local3.push({x:l_oZone.x - nZoneWidth, y:l_oZone.y + nZoneHeight});
}
} else if (_local5 > 0.5) {
_local3.push({x:l_oZone.x + nZoneWidth, y:l_oZone.y});
if (_local4 < 0.5) {
_local3.push({x:l_oZone.x + nZoneWidth, y:l_oZone.y - nZoneHeight});
}
if (_local4 > 0.5) {
_local3.push({x:l_oZone.x + nZoneWidth, y:l_oZone.y + nZoneHeight});
}
}
if (_local4 < 0.5) {
_local3.push({x:l_oZone.x, y:l_oZone.y - nZoneHeight});
}
if (_local4 > 0.5) {
_local3.push({x:l_oZone.x, y:l_oZone.y + nZoneHeight});
}
return(_local3);
}
function getCurrentZone() {
return(getZone(nCurrentX, nCurrentY));
}
function zoneChanged(l_oVisibleZones) {
for (var _local3 in aVisibleZones) {
if ((aVisibleZones[_local3].x != l_oVisibleZones[_local3].x) || (aVisibleZones[_local3].y != l_oVisibleZones[_local3].y)) {
return(true);
}
}
return(false);
}
function enableDynamicZone(l_nZoneX, l_nZoneY) {
for (var _local4 in oDynamicElementsZone[l_nZoneX][l_nZoneY]) {
oDynamicElementsZone[l_nZoneX][l_nZoneY][_local4].enable();
}
}
function disableDynamicZone(l_nZoneX, l_nZoneY) {
for (var _local4 in oDynamicElementsZone[l_nZoneX][l_nZoneY]) {
oDynamicElementsZone[l_nZoneX][l_nZoneY][_local4].disable();
}
}
function enableStaticZone(l_nZoneX, l_nZoneY) {
for (var _local4 in oStaticElementsZone[l_nZoneX][l_nZoneY]) {
oStaticElementsZone[l_nZoneX][l_nZoneY][_local4]._visible = true;
}
}
function disableStaticZone(l_nZoneX, l_nZoneY) {
for (var _local4 in oStaticElementsZone[l_nZoneX][l_nZoneY]) {
oStaticElementsZone[l_nZoneX][l_nZoneY][_local4]._visible = false;
}
}
}
Symbol 1265 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 379 MovieClip Frame 1
this.useHandCursor = false;
this._alpha = 0;
this.onRelease = function () {
var _local1 = 0;
};
Symbol 471 MovieClip Frame 1
onRelease = function () {
};
useHandCursor = false;
_alpha = 50;
Symbol 488 MovieClip Frame 23
stop();
Symbol 493 MovieClip Frame 35
stop();
Symbol 496 MovieClip Frame 35
stop();
Symbol 497 MovieClip Frame 18
stop();
Symbol 498 MovieClip Frame 1
stop();
Symbol 510 Button
on (release) {
gotoAndStop ("titleCard");
}
Symbol 716 MovieClip Frame 1
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 48
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 49
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 62
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 64
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 66
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 68
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 70
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 72
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 74
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 76
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 78
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 80
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 82
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 84
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 86
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 106
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 108
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 110
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 112
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 114
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 116
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 118
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 120
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 122
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 124
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 126
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 128
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 129
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 131
_global.C.oPackaging.toggleDemoButton(_parent.mcDown);
Symbol 716 MovieClip Frame 194
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 231
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 252
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
Symbol 716 MovieClip Frame 254
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 256
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 258
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 260
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 262
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 264
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 266
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 268
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 270
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 272
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 274
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 276
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 278
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 280
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 282
_global.C.oPackaging.toggleDemoButton(_parent.mcLeft);
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 284
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 285
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 716 MovieClip Frame 299
_global.C.oPackaging.toggleDemoButton(_parent.mcRight);
Symbol 731 MovieClip Frame 1
stop();
Symbol 732 MovieClip Frame 1
stop();
Symbol 733 MovieClip Frame 1
stop();
Symbol 734 MovieClip Frame 1
stop();
Symbol 763 MovieClip Frame 50
stop();
Symbol 771 MovieClip Frame 50
stop();
Symbol 778 MovieClip Frame 50
stop();
Symbol 885 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 908 MovieClip Frame 1
_global.C.oSpongeBob.setPumpkin(this);
stop();
Symbol 910 MovieClip Frame 1
stop();
Symbol 923 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 925 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 949 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 961 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 981 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 990 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 998 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1022 MovieClip Frame 108
stop();
Symbol 1025 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1031 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1038 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1043 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1048 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1052 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1056 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1060 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1065 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1070 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1085 MovieClip Frame 1
_global.C.oSpongeBob.setGrease(this);
Symbol 1117 Button
on (release) {
_global.C.ShowMenu("Menu");
}
Symbol 1139 MovieClip Frame 1
stop();
Symbol 1168 MovieClip Frame 1
stop();
Symbol 1169 MovieClip Frame 1
stop();
Symbol 1169 MovieClip Frame 22
_global.C.oHUD.onOptionOpened();
Symbol 1169 MovieClip Frame 35
_global.C.oHUD.onOptionClosed();
Symbol 1198 MovieClip Frame 1
if (_global.C.nLevelPart <= 3) {
gotoAndStop ("level");
} else {
gotoAndStop ("bonus");
}
Symbol 1199 MovieClip Frame 65
_global.C.oHUD.onGetOutEnd();
stop();
Symbol 1207 MovieClip Frame 2
stop();
Symbol 1207 MovieClip Frame 30
_global.C.oHUD.onEasterEggEnd();
Symbol 1211 MovieClip Frame 2
stop();
Symbol 1211 MovieClip Frame 27
_global.C.restartFadeMiddle();
Symbol 1211 MovieClip Frame 52
_global.C.restartFadeEnd();
Symbol 1212 MovieClip Frame 1
Controller = new Controller(this);