Frame 1
function getPoints(_callback, _functionScope) {
}
function awardPoints(_points, _callbackFunction, _functionScope) {
}
System.security.allowDomain("www.nick.com");
Array.prototype.indexOf = function (_oValue, _nStartIndex) {
var _local4 = this.length;
var _local3 = -1;
if (_nStartIndex == undefined) {
_nStartIndex = 0;
}
var _local2 = _nStartIndex;
while (_local2 < _local4) {
if (this[_local2] == _oValue) {
_local3 = _local2;
break;
}
_local2++;
}
return(_local3);
};
Array.prototype.remove = function (_oValue) {
var _local2 = this.indexOf(_oValue);
if (_local2 != -1) {
this.splice(_local2, 1);
}
};
Array.prototype.shuffle = function (_nLevel) {
var _local3 = this.length;
var _local2 = 0;
while (_local2 < _nLevel) {
this.exchange(Math.floor(Math.random() * _local3), Math.floor(Math.random() * _local3));
_local2++;
}
};
Array.prototype.exchange = function (_nIndexA, _nIndexB) {
var _local2 = this[_nIndexA];
this[_nIndexA] = this[_nIndexB];
this[_nIndexB] = _local2;
};
Array.prototype.equals = function (_aArray) {
var _local3 = true;
if (this != _aArray) {
var _local2 = this.length;
if (_local2 != _aArray.length) {
_local3 = false;
} else {
while (_local2--) {
if (this[_local2] != _aArray[_local2]) {
_local3 = false;
break;
}
}
}
}
return(_local3);
};
Array.prototype.getRandom = function () {
return(this[Math.floor(Math.random() * this.length)]);
};
Array.prototype.merge = function () {
var _local5 = this;
var _local4 = 0;
while (_local4 < arguments.length) {
var _local3 = 0;
while (_local3 < arguments[_local4].length) {
_local5.push(arguments[_local4][_local3]);
_local3++;
}
_local4++;
}
return(_local5);
};
Array.prototype.each = function (_fFunc) {
var _local2 = 0;
while (_local2 < this.length) {
_fFunc(this[_local2]);
_local2++;
}
};
Array.prototype.unique = function () {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < this.length) {
if (_local3.indexOf(this[_local2]) < 0) {
_local3.push(this[_local2]);
}
_local2++;
}
return(_local3);
};
String.prototype.pad = function (_nLen, _sPad, _bRight) {
while (this.length < _nLen) {
if (_bRight == true) {
this=this + _sPad;//parameter overwritten
this + _sPad;
} else {
this=_sPad + this;//parameter overwritten
_sPad + this;
}
}
return(this);
};
ASSetPropFlags(Array.prototype, new Array("indexOf", "remove", "shuffle", "exchange", "equals", "getRandom", "merge", "unique", "each"), 7);
ASSetPropFlags(String.prototype, new Array("pad"), 7);
Stage.showMenu = false;
_focusrect = false;
HighScores.bDebug = false;
HighScores.bDisplay = true;
HighScores.init(gProxyObj, Config.HS_GAME_ID);
Frame 2
this.onEnterFrame = function () {
var _local2 = this.getBytesLoaded() / this.getBytesTotal();
mcLoader.txtPercent.text = Math.floor(_local2 * 100);
if (_local2 < 1) {
} else {
delete this.onEnterFrame;
}
};
stop();
Frame 20
stop();
Instance of Symbol 410 MovieClip in Frame 20
onClipEvent (load) {
_global.P = new GameParam(this);
_global.P.initParam();
}
Frame 50
stop();
Symbol 25 Button
on (keyPress "<Left>") {
return(undefined);
}
on (keyPress "<Right>") {
return(undefined);
}
on (keyPress "<Down>") {
return(undefined);
}
on (keyPress "<Up>") {
return(undefined);
}
Symbol 9 MovieClip Frame 1
stop();
Symbol 14 MovieClip Frame 1
stop();
Symbol 19 MovieClip Frame 1
stop();
Symbol 815 MovieClip [__Packages.HighScores] Frame 0
class HighScores
{
static var oProxyObj, bDebug;
function HighScores () {
}
static function init(_oProxyObj, _sGameID) {
oProxyObj = _oProxyObj;
oProxyObj.setGame_Id(_sGameID);
if (bDebug) {
oProxyObj.setServer("www.nick.com");
oProxyObj.setScreenName("SarbaDev");
oProxyObj.setIsLoggedIn(true);
}
}
static function requestScores() {
oProxyObj.getScores(function () {
HighScores.onSuccess();
});
}
static function submitScore(_nScore) {
oProxyObj.submitScore(_nScore, function () {
HighScores.onSuccess();
});
}
static function populateFields(_oIndexes, _oNames, _oScores) {
var _local2 = getHighScores();
var _local5 = "";
var _local3 = "";
var _local4 = "";
var _local1 = 0;
while (_local1 < _local2.length) {
_local5 = _local5 + ((_local2[_local1].nIndex + 1) + newline);
_local3 = _local3 + (_local2[_local1].sName + newline);
_local4 = _local4 + (_local2[_local1].nScore + newline);
_local1++;
}
if (_local3 == "") {
_local3 = "No score available.";
}
_oIndexes.text = _local5;
_oNames.text = _local3;
_oScores.text = _local4;
}
static function getHighScores() {
var _local6 = new Array();
var _local7 = oProxyObj.getScoreCount();
var _local1 = 0;
while (_local1 < _local7) {
var _local2 = oProxyObj.getScoreItem(_local1);
_local6.push({nIndex:_local1, sName:_local2[0], nScore:_local2[1]});
_local1++;
}
return(_local6);
}
}
Symbol 816 MovieClip [__Packages.Config] Frame 0
class Config
{
function Config () {
}
static var HS_GAME_ID = "zo_pca";
static var Chase = {speed:6, distanceFromZoey:1000, boundChase:{x:2.6, y:10.9, height:16, width:36}, tile:{width:75, height:75}, boundCZ:{normal:{x:-4.8, y:18.4, height:25.4, width:100}, up:{x:-0.7, y:-1.6, height:59, width:50}, down:{x:-0.7, y:28.5, height:59, width:50}}};
static var Ghost = {speed:6, distanceFromChase:800, distanceFromZoey:1200, distanceBetweenCZ:1000, stuckTime:215, distracted:70, catchDistance:30, bound:{x:3.3, y:18.8, width:66.7, height:27.4}};
static var PowerBall = {speed:12, range:450, blowOnContact:true};
static var Apple = {glow:15};
static var Powers = {count:10, apples:6, ball:3};
static var Zoey = {panic:{range:{small:600, medium:400, large:200}}};
static var Radar = {zoey:{small:3000, medium:1000, large:500}, ghost:{small:3000, medium:1000, large:500}};
static var Lightning = {interval:{min:2, max:10}};
static var Exit = {distanceFromZoey:1000, tile:Array([4, 10], [8, 2], [2, 23], [8, 36], [10, 30], [19, 8], [15, 23], [17, 19], [15, 30], [15, 34], [23, 36], [30, 4], [36, 10], [28, 15], [32, 15], [30, 21], [28, 36])};
static var Level = new Array({basicSpeed:0.65, stretSpeed:0.8, powerFailure:{min:3, max:5, interval:5}, powerBalls:{basic:6, max:10}, appleCores:{basic:30, max:50}, maze:{easy:8, medium:1, hard:0}, exitFromZoey:600, exit:10}, {basicSpeed:0.7, stretSpeed:0.85, powerFailure:{min:4, max:6, interval:5}, powerBalls:{basic:6, max:10}, appleCores:{basic:30, max:45}, maze:{easy:6, medium:3, hard:0}, exitFromZoey:600, exit:9}, {basicSpeed:0.75, stretSpeed:0.9, powerFailure:{min:5, max:7, interval:4}, powerBalls:{basic:4, max:8}, appleCores:{basic:25, max:40}, maze:{easy:5, medium:3, hard:1}, exitFromZoey:600, exit:8}, {basicSpeed:0.8, stretSpeed:0.95, powerFailure:{min:6, max:8, interval:4}, powerBalls:{basic:4, max:8}, appleCores:{basic:20, max:30}, maze:{easy:4, medium:4, hard:1}, exitFromZoey:600, exit:7}, {basicSpeed:0.85, stretSpeed:0.95, powerFailure:{min:7, max:9, interval:3}, powerBalls:{basic:2, max:6}, appleCores:{basic:15, max:25}, maze:{easy:4, medium:3, hard:2}, exitFromZoey:600, exit:7}, {basicSpeed:0.9, stretSpeed:1, powerFailure:{min:8, max:10, interval:2}, powerBalls:{basic:2, max:4}, appleCores:{basic:10, max:20}, maze:{easy:2, medium:3, hard:4}, exitFromZoey:600, exit:6}, {basicSpeed:0.9, stretSpeed:1, powerFailure:{min:8, max:10, interval:2}, powerBalls:{basic:2, max:4}, appleCores:{basic:10, max:20}, maze:{easy:9, medium:9, hard:9}, exitFromZoey:600, exit:5});
static var Depths = {Chase:600, Zoey:500, Ghost:700, Exit:{min:400, max:499}, Powerball:{min:900, max:999}, AppleCores:{min:200, max:399}, Powers:{min:100, max:199}, BlackOut:99, Lightning:50000};
static var Score = {Apple:250, Powerball:1000, Level:1000};
}
Symbol 817 MovieClip [__Packages.GameParam] Frame 0
class GameParam
{
var mcRef, mcRefMain, oParamBroadcaster, oTransit, oPopUp, nLevel, nScore, oSnd;
function GameParam (_mcRef) {
mcRef = _mcRef;
mcRef.onEnterFrame = mx.utils.Delegate.create(this, enterFrame);
mcRefMain = mcRef._parent;
oParamBroadcaster = new Object();
AsBroadcaster.initialize(oParamBroadcaster);
}
function createTransition(_mcRef, _mcRefMain) {
oTransit = new Game.Transition(_mcRef, "oTransit", _mcRefMain);
}
function createPopUps(_mcRef) {
oPopUp = new PopUp(_mcRef);
}
function initParam() {
createPopUps(mcRef._parent.mcPopUp);
createTransition(mcRef._parent.mcTransit, mcRefMain);
oParamBroadcaster.addListener(oPopUp);
oParamBroadcaster.addListener(oTransit);
nLevel = 1;
nScore = 0;
oSnd = new Library.Sound.SoundCall();
Library.Sound.SoundManager.doInit(mcRef._parent.mcSound);
Library.Sound.SoundManager.setCategoryVolume("music", 50);
Library.Sound.SoundManager.setCategoryVolume("SFX", 80);
if (Library.Sound.SoundManager.isSoundPlaying("sMu_pack").bPlaying == false) {
Library.Sound.SoundManager.doPlaySoundInCat("music", "sMu_pack", 0, 99999);
Library.Sound.SoundManager.isSoundPlaying("sMu_pack").oSound.doFadeTo(100, false);
}
}
function resetParam() {
nLevel = 1;
nScore = 0;
doUnmute("music");
doUnmute("SFX");
}
function enterFrame() {
oParamBroadcaster.broadcastMessage("doAction");
}
function levelUp() {
nLevel++;
}
function fFormatNumber(_nScore) {
var _local5 = "";
var _local2 = 0;
var _local4 = _nScore.toString().split("");
var _local3 = new Array();
_local4.reverse();
var _local1 = 0;
while (_local1 < _local4.length) {
_local2++;
if (_local2 == 4) {
_local2 = 0;
_local3.push(",");
}
_local3.push(_local4[_local1]);
_local1++;
}
_local3.reverse();
_local5 = _local3.join("");
return(_local5);
}
function doMute(_sCat) {
Library.Sound.SoundManager.doMuteCategory(_sCat);
}
function doUnmute(_sCat) {
Library.Sound.SoundManager.doUnMuteCategory(_sCat);
}
function isMuted(_sCat) {
return(Library.Sound.SoundManager.isCategoryMuted(_sCat));
}
function doPlayClick() {
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_click", 100, 1);
}
function doPlayRollOver() {
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_rollover", 100, 1, true);
}
}
Symbol 818 MovieClip [__Packages.Game.State] Frame 0
class Game.State
{
var mcRef, sName, nPosX, nPosY, bPausable, sState, nNbFrAnim, onStateEnd;
function State (_mcRef) {
mcRef = _mcRef;
sName = _mcRef._name;
nPosX = mcRef._x;
nPosY = mcRef._y;
bPausable = true;
_global.C.oActionBroadcast.addListener(this);
}
function doPause() {
mcRef.mcState.stop();
}
function doUnpause() {
mcRef.mcState.play();
}
function doAction() {
if (!bPausable) {
this[sState]();
} else if (!_global.C.bPause) {
this[sState]();
}
if (mcRef.mcState._currentframe == nNbFrAnim) {
onStateEnd();
}
}
function setState(_sState) {
if (sState != _sState) {
sState = _sState;
mcRef.gotoAndStop(sState);
nNbFrAnim = mcRef.mcState._totalframes;
delete onStateEnd;
}
}
function getState() {
return(sState);
}
function isStateFinished() {
var _local2 = false;
if (mcRef.mcState._currentframe == nNbFrAnim) {
_local2 = true;
}
return(_local2);
}
function destroy() {
mcRef.swapDepths(50);
mcRef.removeMovieClip();
_global.C.oActionBroadcast.removeListener(this);
}
}
Symbol 819 MovieClip [__Packages.Game.Transition] Frame 0
class Game.Transition extends Game.State
{
var bPausable, setState, fToLaunch, fLaunched, nNbFrAnim, mcRef;
function Transition (_mcRef) {
super(_mcRef);
bPausable = false;
_global.T = this;
_global.C.oActionBroadcast.addListener(this);
setState("Idle");
}
function goTo(_sFrame) {
if (_sFrame == "InGameInstructP1") {
_global.C.callPause();
launch(_global.P.oPopUp.mcRef.mcState.mcMenu, function () {
this.gotoAndStop("P1");
});
} else if (_sFrame == "InGameMenu") {
launch(_global.P.oPopUp.mcRef.mcState.mcMenu, function () {
this.gotoAndStop("Menu");
});
} else {
launch(_global.P.mcRefMain, function () {
this.gotoAndStop(_sFrame);
});
}
}
function launch(_oCaller, _fFunc) {
startTransition(mx.utils.Delegate.create(_oCaller, _fFunc));
}
function startTransition(_fToLaunch) {
fToLaunch = _fToLaunch;
setState("Opening");
}
function launchFunction() {
fToLaunch();
fLaunched = fToLaunch;
}
function Opening() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
setState("Opened");
}
}
function Opened() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
launchFunction();
setState("Closing");
}
}
function Closing() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
setState("Idle");
}
}
}
Symbol 820 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 821 MovieClip [__Packages.PopUp] Frame 0
class PopUp extends Game.State
{
var sCurPopUp, bPausable, bOpenQuit, bOpenMenu, bQuitGame, setState, mcRef, nNbFrAnim;
function PopUp (_mcRef) {
super(_mcRef);
sCurPopUp = "";
bPausable = false;
bOpenQuit = false;
bOpenMenu = false;
bQuitGame = false;
setState("Close");
}
function setOpen(_sPopUp, _bPause) {
if (_bPause == true) {
_global.C.callPause();
}
sCurPopUp = _sPopUp;
setState(_sPopUp + "Opening");
mcRef.LockBtn.useHandCursor = false;
}
function setClose() {
setState(sCurPopUp + "Closing");
}
function Close() {
}
function MenuOpening() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
setState("MenuOpen");
}
}
function MenuOpen() {
}
function MenuClosing() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
if (bOpenQuit == false) {
_global.C.callUnpause();
setState("Close");
} else {
sCurPopUp = "Quit";
setState("QuitOpening");
}
}
}
function QuitOpening() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
setState("QuitOpen");
}
}
function QuitOpen() {
}
function QuitClosing() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
if (bOpenMenu == true) {
bOpenMenu = false;
sCurPopUp = "Menu";
setState("MenuOpening");
} else {
sCurPopUp = "";
if (bQuitGame == true) {
bQuitGame = false;
_global.C.oGameEngine.clearLevel();
_global.C.oGameEngine.endGame();
_global.P.oTransit.goTo("EndScr");
} else {
_global.C.callUnpause();
}
setState("Close");
}
}
}
}
Symbol 822 MovieClip [__Packages.Library.Sound.SoundCall] Frame 0
class Library.Sound.SoundCall
{
function SoundCall () {
}
function Thunder() {
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_thunder", 100, 1, true);
}
}
Symbol 823 MovieClip [__Packages.Library.Sound.SoundItem] Frame 0
class Library.Sound.SoundItem
{
var sndObj, sLinkage, mcRef, nRemainingLoop, nCurrentVolume, nTargetVolume, nFadeRate, sCategory, bFadeAtEnd, bMuted, bPaused, bNeedFreshStart, fonComplete, nCurrentTime, aEventListeners, bStopAfterFade;
function SoundItem (__sndObject, __sLinkage, __nVolume, __nLoop, __sCategory, __mc, __fOnComplete) {
sndObj = __sndObject;
sLinkage = __sLinkage;
mcRef = __mc;
nRemainingLoop = __nLoop;
nCurrentVolume = __nVolume;
nTargetVolume = __nVolume;
nFadeRate = FADE_RATE;
sCategory = __sCategory;
bFadeAtEnd = false;
bMuted = false;
bPaused = false;
bNeedFreshStart = false;
fonComplete = __fOnComplete;
sndObj.onSoundComplete = Library.Utils.Delegate.create(this, doSoundComplete);
sndObj.start(0, __nLoop);
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
nCurrentTime = 0;
aEventListeners = new Array();
}
function doEnterFrame() {
if (!bPaused) {
if (nCurrentTime > sndObj.position) {
nRemainingLoop--;
}
nCurrentTime = sndObj.position;
}
doCheckFadeAtEnd();
doManageFade();
}
function doAddListener(__oListener) {
aEventListeners.push(__oListener);
}
function doRemoveListener(__oListener) {
var _local2 = 0;
while (_local2 < aEventListeners.length) {
if (aEventListeners[_local2] == __oListener) {
delete aEventListeners[_local2];
aEventListeners.splice(_local2, 1);
}
_local2++;
}
}
function doSoundComplete() {
if (bNeedFreshStart && (nRemainingLoop > 1)) {
sndObj.start(0, nRemainingLoop - 1);
} else {
doManageEndEvent();
}
}
function doUpdateSound() {
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
}
function doMute() {
bMuted = true;
doUpdateSound();
}
function doUnMute() {
bMuted = false;
doUpdateSound();
}
function doPause() {
sndObj.stop();
bPaused = true;
}
function doResume() {
bPaused = false;
bNeedFreshStart = true;
sndObj.start(nCurrentTime / 1000, 1);
}
function doStop() {
sndObj.stop();
doManageEndEvent();
}
function doFadeTo(__nVolume, __bStopAndDelete) {
if (__bStopAndDelete == undefined) {
__bStopAndDelete = true;
}
bStopAfterFade = __bStopAndDelete;
nTargetVolume = __nVolume;
}
function setVolumeTo(_nVolume) {
sndObj.setVolume(returnComputedVolume(_nVolume));
}
function setFadeRate(__nRate) {
if (__nRate == undefined) {
__nRate = FADE_RATE;
}
nFadeRate = __nRate;
}
function setFadeAtEnd(__bFadeAtEnd) {
bFadeAtEnd = true;
}
function setPan(__nPan) {
sndObj.setPan(__nPan);
}
function get Category() {
return(sCategory);
}
function get LinkageName() {
return(sLinkage);
}
function get Volume() {
return(sndObj.getVolume());
}
function get Position() {
return(sndObj.position);
}
function get SoundObject() {
return(sndObj);
}
function get OnComplete() {
return(fonComplete);
}
function set OnComplete(_fFunction) {
fonComplete = _fFunction;
//return(OnComplete);
}
function doCheckFadeAtEnd() {
if (bFadeAtEnd) {
if (nRemainingLoop == 1) {
if ((sndObj.duration - nCurrentTime) <= FADE_AT_END_TIME) {
doFadeTo(0);
}
}
}
}
function doManageEndEvent() {
var _local2 = 0;
while (_local2 < aEventListeners.length) {
aEventListeners[_local2].doSoundEvent(Library.Sound.SoundManager.EVENT_SOUND_COMPLETE, this);
_local2++;
}
aEventListeners = new Array();
mcRef.removeMovieClip();
delete mcRef;
delete aEventListeners;
delete sndObj.onSoundComplete;
delete sndObj;
}
function doManageFade() {
if (nCurrentVolume != nTargetVolume) {
nCurrentVolume = Library.Utils.MoreMath.getReachNum(nCurrentVolume, nTargetVolume, nFadeRate);
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
}
if ((nCurrentVolume <= 0) && (bStopAfterFade)) {
sndObj.stop();
doManageEndEvent();
}
}
function returnComputedVolume(__nVolume) {
var _local2;
if ((!bMuted) && (!Library.Sound.SoundManager.isCategoryMuted(sCategory))) {
var _local3 = Library.Sound.SoundManager.__get__MasterVolume() / 100;
var _local4 = Library.Sound.SoundManager.getCategoryVolume(sCategory) / 100;
_local2 = __nVolume;
_local2 = _local2 * _local4;
_local2 = _local2 * _local3;
} else {
_local2 = 0;
}
return(_local2);
}
static var FADE_RATE = 8;
static var FADE_AT_END_TIME = 800;
}
Symbol 824 MovieClip [__Packages.Library.Utils.Delegate] Frame 0
class Library.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 825 MovieClip [__Packages.Library.Sound.SoundManager] Frame 0
class Library.Sound.SoundManager
{
static var aSounds, nSoundNum, mcAttach, aSoundCategories, nMasterVolume, oEnterFrameListener;
function SoundManager () {
}
static function doPlaySound(__sLinkage, __nVolume, __nLoop, __bUnique) {
return(doPlaySoundInCat(DEFAULT_CATEGORY, __sLinkage, __nVolume, __nLoop, __bUnique));
}
static function doPlaySoundInCat(__sCategoryName, __sLinkage, __nVolume, __nLoop, __bUnique, __fOnComplete) {
doCheckInit();
if (__nVolume == undefined) {
__nVolume = 100;
}
if (__nLoop == undefined) {
__nLoop = 1;
}
if (__bUnique == undefined) {
__bUnique = false;
}
var _local1;
var _local2;
if (__bUnique) {
var _local4 = isSoundPlaying(__sLinkage);
_local2 = !_local4.bPlaying;
if (!_local2) {
_local1 = _local4.oSound;
}
} else {
_local2 = true;
}
if (_local2) {
doManageCategory(__sCategoryName);
var _local5 = getMCForSound();
var _local3 = new Sound(_local5);
_local3.attachSound(__sLinkage);
if (_local3.duration != undefined) {
_local1 = new Library.Sound.SoundItem(_local3, __sLinkage, __nVolume, __nLoop, __sCategoryName, _local5, __fOnComplete);
} else {
trace("**** BAD SOUND LINKAGE : " + __sLinkage);
}
_local1.doAddListener(Library.Sound.SoundManager);
aSounds.push(_local1);
}
return(_local1);
}
static function doPlayRandomSoundInCat(_sCategoryName, _sLinkagePrefix, _oSndLink, _nVolume, _nAmount, _bUnique) {
doCheckInit();
if (_nVolume == undefined) {
_nVolume = 100;
}
if (_bUnique == undefined) {
_bUnique = false;
}
var _local2 = false;
var _local7 = 1;
var _local5;
var _local1 = _sLinkagePrefix;
var _local6 = Math.floor((Math.random() * _nAmount) + 1);
_local1 = ((_local1 + "") + _local6) + "";
var _local3 = false;
if (_oSndLink != undefined) {
_local3 = isSoundPlaying(_oSndLink.__get__LinkageName()).bPlaying;
if ((!_local3) || (!_bUnique)) {
_local2 = true;
} else {
_local5 = _oSndLink;
}
} else {
_local2 = true;
}
if (_local2) {
_local5 = doPlaySoundInCat(_sCategoryName, _local1, _nVolume, _local7, _bUnique);
}
return(_local5);
}
static function isSoundPlaying(__sLinkageName) {
var _local1 = new Object();
_local1.bPlaying = false;
_local1.oSound = undefined;
for (var _local3 in aSounds) {
if (aSounds[_local3].LinkageName == __sLinkageName) {
_local1.bPlaying = true;
_local1.oSound = aSounds[_local3];
}
}
return(_local1);
}
static function doManageExternalSound(__oSound) {
doCheckInit();
doManageCategory(__oSound.__get__Category());
__oSound.doAddListener(Library.Sound.SoundManager);
aSounds.push(__oSound);
}
static function getMCForSound() {
nSoundNum++;
var _local1 = mcAttach.createEmptyMovieClip("Snd" + nSoundNum, nSoundNum);
return(_local1);
}
static function doInit(__mcAttach) {
mcAttach = __mcAttach;
if (!bInited) {
bInited = true;
nSoundNum = 0;
aSounds = new Array();
aSoundCategories = new Array();
nMasterVolume = 100;
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = Library.Utils.Delegate.create(Library.Sound.SoundManager, doEnterFrame);
MovieClip.addListener(oEnterFrameListener);
}
}
static function doEnterFrame() {
for (var _local1 in aSounds) {
aSounds[_local1].doEnterFrame();
}
}
static function setCategoryVolume(__sCategoryName, __nVol) {
doManageCategory(__sCategoryName);
for (var _local3 in aSoundCategories) {
if (aSoundCategories[_local3].sName == __sCategoryName) {
aSoundCategories[_local3].nVolume = __nVol;
}
}
doUpdateAllSoundsVolume();
}
static function getCategoryVolume(__sCategoryName) {
doManageCategory(__sCategoryName);
var _local1;
for (var _local3 in aSoundCategories) {
if (aSoundCategories[_local3].sName == __sCategoryName) {
_local1 = aSoundCategories[_local3].nVolume;
}
}
return(_local1);
}
static function isCategoryMuted(__sCategoryName) {
doManageCategory(__sCategoryName);
var _local1;
for (var _local3 in aSoundCategories) {
if (aSoundCategories[_local3].sName == __sCategoryName) {
_local1 = aSoundCategories[_local3].bMuted;
}
}
return(_local1);
}
static function doSoundEvent(__nEvent, __oSound) {
if (!(__nEvent === EVENT_SOUND_COMPLETE)) {
} else {
for (var _local2 in aSounds) {
if (aSounds[_local2] == __oSound) {
if (aSounds[_local2].OnComplete != undefined) {
aSounds[_local2].OnComplete();
}
delete aSounds[_local2];
aSounds.splice(_local2, 1);
}
}
}
}
static function doMuteCategory(__sCategoryName) {
for (var _local2 in aSoundCategories) {
if (aSoundCategories[_local2].sName == __sCategoryName) {
aSoundCategories[_local2].bMuted = true;
}
}
doUpdateAllSoundsVolume();
}
static function doUnMuteCategory(__sCategoryName) {
for (var _local2 in aSoundCategories) {
if (aSoundCategories[_local2].sName == __sCategoryName) {
aSoundCategories[_local2].bMuted = false;
}
}
doUpdateAllSoundsVolume();
}
static function setMasterVolume(__nVol) {
nMasterVolume = __nVol;
doUpdateAllSoundsVolume();
}
static function get MasterVolume() {
return(nMasterVolume);
}
static function doRemoveListenerFromAllSounds(__oListener) {
for (var _local2 in aSounds) {
aSounds[_local2].doRemoveListener(__oListener);
}
}
static function doUpdateAllSoundsVolume() {
for (var _local1 in aSounds) {
aSounds[_local1].doUpdateSound();
}
}
static function doCheckInit() {
if (!bInited) {
trace("**** ERROR, NEED TO INIT SOUND MANAGER FIRST");
}
}
static function doManageCategory(__sCategoryName) {
doCheckInit();
var _local1 = false;
for (var _local4 in aSoundCategories) {
if (aSoundCategories[_local4].sName == __sCategoryName) {
_local1 = true;
}
}
if (!_local1) {
var _local3 = new Object();
_local3.sName = __sCategoryName;
_local3.nVolume = 100;
_local3.bMuted = false;
aSoundCategories.push(_local3);
}
}
static var EVENT_SOUND_COMPLETE = 1;
static var DEFAULT_CATEGORY = "SFX";
static var bInited = false;
}
Symbol 826 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 827 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 828 MovieClip [__Packages.Library.Utils.MoreMath] Frame 0
class Library.Utils.MoreMath
{
function MoreMath () {
}
static function getRandomRange(__nMin, __nMax) {
return(Math.floor(Math.random() * ((__nMax + 1) - __nMin)) + __nMin);
}
static function getPolarity(__nNum) {
var _local1 = 0;
if (__nNum < 0) {
_local1 = -1;
} else if (__nNum > 0) {
_local1 = 1;
}
return(_local1);
}
static function getReachZero(__nNum, __nReducer) {
return(getReachNum(__nNum, 0, __nReducer));
}
static function getReachNum(__nNum, __nTargetNum, __nReducer) {
var _local1 = __nNum;
if (_local1 != __nTargetNum) {
if (_local1 < __nTargetNum) {
_local1 = _local1 + __nReducer;
if (_local1 > __nTargetNum) {
_local1 = __nTargetNum;
}
} else {
_local1 = _local1 - __nReducer;
if (_local1 < __nTargetNum) {
_local1 = __nTargetNum;
}
}
}
return(_local1);
}
static function getDistance(__nX1, __nY1, __nX2, __nY2) {
return(Math.sqrt(Math.pow(Math.abs(__nX2 - __nX1), 2) + Math.pow(Math.abs(__nY2 - __nY1), 2)));
}
static function getAngle(__nX1, __nY1, __nX2, __nY2) {
var _local3;
var _local2;
var _local1;
_local3 = Math.abs(__nX2) - Math.abs(__nX1);
_local2 = Math.abs(__nY2) - Math.abs(__nY1);
_local1 = Math.atan2(_local2, _local3);
_local1 = (_local1 * 180) / Math.PI;
return(_local1);
}
static function getHypotenuse(__nDX, __nDY) {
return(Math.sqrt(Math.pow(__nDX, 2) + Math.pow(__nDY, 2)));
}
static function getBoundsCenter(_oBox) {
var _local3 = (_oBox.xMin + _oBox.xMax) / 2;
var _local2 = (_oBox.yMin + _oBox.yMax) / 2;
return({x:_local3, y:_local2});
}
}
Symbol 829 MovieClip [__Packages.GameController] Frame 0
class GameController
{
var mcRef, mcGame, bPause, oActionBroadcast, oKeyManager, oHud, oGameEngine;
function GameController (_mcRef) {
mcRef = _mcRef;
mcGame = mcRef._parent;
bPause = false;
oActionBroadcast = new Object();
AsBroadcaster.initialize(oActionBroadcast);
mcRef.onEnterFrame = mx.utils.Delegate.create(this, enterFrame);
}
function callPause() {
bPause = true;
oActionBroadcast.broadcastMessage("doPause");
}
function callUnpause() {
oActionBroadcast.broadcastMessage("doUnpause");
bPause = false;
}
function enterFrame() {
oActionBroadcast.broadcastMessage("doAction");
}
function initController() {
initGame();
}
function initGame() {
_global.V = new Object();
oKeyManager = new KeyManager();
oHud = new Hud(mcGame.mcHud);
oGameEngine = new GameEngine(mcGame, _global.P.nLevel);
}
function destroy() {
delete oActionBroadcast;
delete mcRef.onEnterFrame;
}
function onGameLost() {
oGameEngine.clearLevel();
destroy();
_global.G_Music.Stop();
_global.T.goTo("EndScr");
}
function onGameWon() {
oGameEngine.clearLevel();
destroy();
_global.G_Music.Stop();
_global.T.goTo("EndScr");
}
}
Symbol 830 MovieClip [__Packages.Hud] Frame 0
class Hud extends Game.State
{
function Hud (_mcRef) {
super(_mcRef);
}
}
Symbol 831 MovieClip [__Packages.KeyManager] Frame 0
class KeyManager
{
var bLeft, bRight, bUp, bDown, bSpace, bB;
function KeyManager () {
bLeft = false;
bRight = false;
bUp = false;
bDown = false;
bSpace = false;
bB = false;
_global.C.oActionBroadcast.addListener(this);
}
function doAction() {
if (Key.isDown(KeyData.nLEFT)) {
bLeft = true;
} else {
bLeft = false;
}
if (Key.isDown(KeyData.nRIGHT)) {
bRight = true;
} else {
bRight = false;
}
if (Key.isDown(KeyData.nUP)) {
bUp = true;
} else {
bUp = false;
}
if (Key.isDown(KeyData.nDOWN)) {
bDown = true;
} else {
bDown = false;
}
if (Key.isDown(KeyData.nSPACE)) {
bSpace = true;
} else {
bSpace = false;
}
if (Key.isDown(KeyData.nB)) {
bB = true;
} else {
bB = false;
}
}
}
Symbol 832 MovieClip [__Packages.KeyData] Frame 0
class KeyData
{
function KeyData () {
}
static var nLEFT = 37;
static var nRIGHT = 39;
static var nUP = 38;
static var nDOWN = 40;
static var nSPACE = 32;
static var nB = 66;
}
Symbol 833 MovieClip [__Packages.GameEngine] Frame 0
class GameEngine
{
var mcRef, mcMaze, nStartTime, nLevel, oGhost, oExit, oChase, oZoey, oPowerBall, oRadar, oApple, oBlackOut, oMaze, oCnfMazes, oCnfGhost, oPowers, oCnfApples, oCnfBalls, oCollision, oCnfExit, oEvents, oCnfEvents, oCnfPowers;
function GameEngine (_mcRef, _nLevel) {
mcRef = _mcRef;
mcMaze = mcRef.mcMaze;
nStartTime = 0;
trace("GameEngine");
nLevel = _nLevel;
startLevel();
if (Library.Sound.SoundManager.isSoundPlaying("sSfx_win").bPlaying == true) {
Library.Sound.SoundManager.isSoundPlaying("sSfx_win").oSound.OnComplete = undefined;
Library.Sound.SoundManager.isSoundPlaying("sSfx_win").oSound.doFadeTo(0, true);
}
if (Library.Sound.SoundManager.isSoundPlaying("sMu_pack").bPlaying == true) {
Library.Sound.SoundManager.isSoundPlaying("sMu_pack").oSound.doFadeTo(0, true);
}
if (Library.Sound.SoundManager.isSoundPlaying("sMu_game_speed").bPlaying == true) {
Library.Sound.SoundManager.isSoundPlaying("sMu_game_speed").oSound.doFadeTo(0, true);
}
Library.Sound.SoundManager.doPlaySoundInCat("music", "sMu_game", 0, 99999);
Library.Sound.SoundManager.isSoundPlaying("sMu_game").oSound.doFadeTo(100, false);
_global.C.oActionBroadcast.addListener(this);
}
function clearLevel() {
stopListeners();
}
function endGame(_bPlayAnim) {
if (Library.Sound.SoundManager.isSoundPlaying("sMu_game").bPlaying == true) {
Library.Sound.SoundManager.isSoundPlaying("sMu_game").oSound.doFadeTo(0, true);
}
if (Library.Sound.SoundManager.isSoundPlaying("sMu_game_speed").bPlaying == true) {
Library.Sound.SoundManager.isSoundPlaying("sMu_game_speed").oSound.doFadeTo(0, true);
}
if (Library.Sound.SoundManager.isSoundPlaying("sSfx_ghost_speed").bPlaying == true) {
Library.Sound.SoundManager.isSoundPlaying("sSfx_ghost_speed").oSound.doFadeTo(0, true);
}
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_loose", 100, 1, true, function () {
Library.Sound.SoundManager.doPlaySoundInCat("music", "sMu_pack", 0, 99999);
Library.Sound.SoundManager.isSoundPlaying("sMu_pack").oSound.doFadeTo(100, false);
});
if (_bPlayAnim) {
_global.C.mcGame.mcLooseAnim.play();
} else {
_global.C.onGameLost();
}
}
function stopListeners() {
oGhost.stopListener();
oExit.stopListener();
oChase.stopListener();
oZoey.stopListener();
oPowerBall.stopListener();
oRadar.stopListener();
oApple.stopListener();
oBlackOut.stopListener();
}
function addTime(_nTime) {
nStartTime = nStartTime + _nTime;
}
function doAction() {
var _local4;
var _local3;
for (var _local6 in mcMaze) {
_local4 = true;
_local3 = true;
var _local5 = _local6.toString().split("_")[0];
if (_local5 != "mcMaze") {
if (Math.abs(mcMaze[_local6]._x - mcMaze.mcPlayer._x) > 350) {
_local4 = false;
}
if (Math.abs(mcMaze[_local6]._y - mcMaze.mcPlayer._y) > 200) {
_local3 = false;
}
mcMaze[_local6]._visible = _local4 && (_local3);
} else if (Key.isDown(81)) {
mcMaze[_local6]._visible = false;
} else {
mcMaze[_local6]._visible = true;
}
}
_global.C.oHud.mcRef.txtScore.text = _global.P.fFormatNumber(_global.P.nScore);
if (_global.C.mcGame.mcLooseAnim._currentframe == _global.C.mcGame.mcLooseAnim._totalframes) {
_global.C.oActionBroadcast.removeListener(this);
_global.C.onGameLost();
} else if (_global.C.mcGame.mcLooseAnim._currentframe == 50) {
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_panic_low", 100, 1);
}
}
function createMaze() {
trace("createMaze");
oMaze = new Maze(mcMaze, this, oCnfMazes);
}
function createZoey() {
trace("createZoey");
oZoey = new Zoey(mcMaze, this, Config.Zoey);
}
function createChase() {
trace("createChase");
oChase = new Chase(mcMaze, this, Config.Chase);
}
function createGhost() {
trace("createGhost");
oGhost = new Ghost(mcMaze, this, oCnfGhost);
}
function createPowers() {
trace("createPowers");
oPowers = new Powers(mcMaze, this, Config.Powers);
}
function createApples() {
trace("createApples");
oApple = new Apple(mcMaze, this, oCnfApples);
}
function createPowerBalls() {
trace("createPowerBalls");
oPowerBall = new PowerBall(mcMaze, this, oCnfBalls);
}
function createCollision() {
trace("createCollision");
oCollision = new Collision(Map.getMap(oMaze.getLayout()));
}
function createRadar() {
trace("createRadar");
oRadar = new Radar(oChase, oZoey, oGhost, _global.C.oHud.mcRef, Config.Radar);
}
function createExit() {
trace("createExit");
oExit = new Exit(mcMaze, this, oCnfExit);
}
function createEvents() {
trace("createEvents");
oEvents = new Events(mcMaze, this, oCnfEvents);
}
function createDoors() {
trace("createDoors");
oMaze.setDoors();
}
function createBlackOut() {
trace("createBlackOut");
oBlackOut = new BlackOut(mcMaze, this);
}
function setPositions() {
trace("setPositions");
var _local7;
var _local6;
var _local5;
var _local4;
var _local8;
var _local3;
var _local2;
var _local9 = oCollision.getMap();
trace("\nPositioning Zoey...");
while (true) {
trace("Trying position... (zoey)");
_local7 = Math.floor(Math.random() * 2);
_local6 = Math.floor(Math.random() * 2);
_local5 = Math.floor(Math.random() * 12);
_local4 = Math.floor(Math.random() * 12);
if (_local9[_local7][_local6][_local5][_local4] == 0) {
trace("Position found.");
_local3 = (975 * _local6) + (75 * _local4);
_local2 = (975 * _local7) + (75 * _local5);
oZoey.setPosition({x:_local3, y:_local2});
break;
}
}
trace("\nPositioning Chase...");
while (true) {
trace("Trying position... (chase)");
_local7 = Math.floor(Math.random() * 2);
_local6 = Math.floor(Math.random() * 2);
_local5 = Math.floor(Math.random() * 12);
_local4 = Math.floor(Math.random() * 12);
if (_local9[_local7][_local6][_local5][_local4] == 0) {
trace("Checking for distance...");
_local3 = (975 * _local6) + (75 * _local4);
_local2 = (975 * _local7) + (75 * _local5);
_local8 = Math.sqrt(((oZoey.__get__x() - _local3) * (oZoey.__get__x() - _local3)) + ((oZoey.__get__y() - _local2) * (oZoey.__get__y() - _local2)));
if (_local8 > Config.Chase.distanceFromZoey) {
trace("Position found.");
oChase.setPosition({x:_local3, y:_local2});
oMaze.setPosition({x:-_local3, y:-_local2});
break;
}
}
}
trace("\nPositioning Ghost...");
while (true) {
trace("Trying position... (ghost)");
_local7 = Math.floor(Math.random() * 2);
_local6 = Math.floor(Math.random() * 2);
_local5 = Math.floor(Math.random() * 12);
_local4 = Math.floor(Math.random() * 12);
if (_local9[_local7][_local6][_local5][_local4] == 0) {
trace("Checking for distance...");
_local3 = (975 * _local6) + (75 * _local4);
_local2 = (975 * _local7) + (75 * _local5);
_local8 = Math.sqrt(((oZoey.__get__x() - _local3) * (oZoey.__get__x() - _local3)) + ((oZoey.__get__y() - _local2) * (oZoey.__get__y() - _local2)));
var _local10 = Math.sqrt(((oChase.__get__x() - _local3) * (oChase.__get__x() - _local3)) + ((oChase.__get__y() - _local2) * (oChase.__get__y() - _local2)));
if ((_local8 > Config.Ghost.distanceFromZoey) && (_local10 > Config.Ghost.distanceFromChase)) {
trace("Position found.");
oGhost.setPosition({x:_local3, y:_local2});
break;
}
}
}
trace("\nPositioning Exit...");
oExit.selectExits();
}
function setLevel() {
trace("setLevel");
var _local2 = nLevel;
if (_local2 > Config.Level.length) {
_local2 = Config.Level.length;
}
_local2--;
var _local3 = Config.Level;
oCnfMazes = new Object();
oCnfMazes = _local3[_local2].maze;
oCnfApples = new Object();
oCnfApples = _local3[_local2].appleCores;
oCnfApples.glow = Config.Apple.glow;
oCnfBalls = new Object();
oCnfBalls = Config.PowerBall;
oCnfBalls.config = _local3[_local2].powerBalls;
oCnfPowers = new Object();
oCnfPowers = Config.Powers;
oCnfPowers.balls = _local3[_local2].powerBalls;
oCnfPowers.cores = _local3[_local2].appleCores;
oCnfGhost = new Object();
oCnfGhost = Config.Ghost;
oCnfGhost.basicSpeed = _local3[_local2].basicSpeed;
oCnfGhost.stretSpeed = _local3[_local2].stretSpeed;
oCnfExit = new Object();
oCnfExit = Config.Exit;
oCnfExit.extFromZoey = _local3[_local2].exitFromZoey;
oCnfExit.count = _local3[_local2].exit;
oCnfEvents = new Object();
oCnfEvents.Lightning = Config.Lightning;
oCnfEvents.powerFailure = _local3[_local2].powerFailure;
}
function startLevel() {
trace("startLevel");
_global.C.oHud.mcRef.mcViewport.gotoAndStop("Full");
setLevel();
createMaze();
createCollision();
createChase();
createZoey();
createGhost();
createBlackOut();
createExit();
setPositions();
createApples();
createPowerBalls();
createPowers();
createRadar();
createEvents();
createDoors();
_global.C.Powers = new Array();
_global.C.Zoey = new Array();
_global.C.Ghost = new Array();
_global.C.Chase = new Array();
_global.C.Blackout = new Array();
_global.C.MapDoors = new Array();
_global.C.Doors = new Array();
_global.C.Mazes = new Array();
_global.C.Hud = new Array();
_global.C.All = new Array();
var _local3;
for (var _local4 in mcMaze) {
_local3 = _local4.toString().split("_")[0];
trace("sType: " + _local3);
switch (_local3) {
case "mcPowers" :
_global.C.Powers.push(mcMaze[_local4]);
break;
case "mcZoey" :
_global.C.Zoey.push(mcMaze[_local4]);
break;
case "mcGhost" :
_global.C.Ghost.push(mcMaze[_local4]);
break;
case "mcPlayer" :
_global.C.Chase.push(mcMaze[_local4]);
break;
case "mcBlackout" :
_global.C.Blackout.push(mcMaze[_local4]);
break;
case "mcMapDoor" :
_global.C.MapDoors.push(mcMaze[_local4]);
break;
case "mcDoor" :
_global.C.Doors.push(mcMaze[_local4]);
break;
case "mcMaze" :
_global.C.Mazes.push(mcMaze[_local4]);
}
_global.C.All.push(mcMaze[_local4]);
}
_global.C.Hud.push(_global.C.oHud.mcRef);
oGhost.findAWay();
}
function endLevel() {
if (Library.Sound.SoundManager.isSoundPlaying("sMu_game_speed").bPlaying == true) {
Library.Sound.SoundManager.isSoundPlaying("sMu_game_speed").oSound.doFadeTo(0, true);
}
if (Library.Sound.SoundManager.isSoundPlaying("sSfx_ghost_speed").bPlaying == true) {
Library.Sound.SoundManager.isSoundPlaying("sSfx_ghost_speed").oSound.OnComplete = undefined;
Library.Sound.SoundManager.isSoundPlaying("sSfx_ghost_speed").oSound.doFadeTo(0, true);
}
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_win", 100, 1, true, function () {
Library.Sound.SoundManager.doPlaySoundInCat("music", "sMu_pack", 0, 99999);
Library.Sound.SoundManager.isSoundPlaying("sMu_pack").oSound.doFadeTo(100, false);
});
addScore();
clearLevel();
_global.P.oTransit.goTo("NextLevel");
}
function addScore() {
trace(("Level " + _global.P.nLevel) + " completed");
var _local3 = 0;
_local3 = _local3 + (Config.Score.Level * _global.P.nLevel);
_local3 = _local3 + (Config.Score.Apple * oApple.__get__cores());
_local3 = _local3 + (Config.Score.Powerball * oPowerBall.__get__balls());
_global.P.nLevelCompletedScore = Config.Score.Level * _global.P.nLevel;
trace("_global.P.nLevelCompletedScore: " + _global.P.nLevelCompletedScore);
_global.P.nPowerballsScore = Config.Score.Powerball;
trace("_global.P.nPowerballsScore: " + _global.P.nPowerballsScore);
_global.P.nPowerballs = oPowerBall.balls;
trace("_global.P.nPowerballs: " + _global.P.nPowerballs);
_global.P.nAppleCoresScore = Config.Score.Apple;
trace("_global.P.nAppleCoresScore: " + _global.P.nAppleCoresScore);
_global.P.nAppleCores = oApple.cores;
trace("_global.P.nAppleCores: " + _global.P.nAppleCores);
_global.P.nLevelScore = _local3;
trace("_global.P.nLevelScore: " + _global.P.nLevelScore);
_global.P.nScore = _global.P.nScore + _local3;
trace("_global.P.nScore: " + _global.P.nScore);
}
}
Symbol 834 MovieClip [__Packages.Maze] Frame 0
class Maze
{
var oOwner, oConfig, mcRef, aLayout, aMaze;
function Maze (_mcRef, _oOwner, _oConfig) {
oOwner = _oOwner;
oConfig = _oConfig;
mcRef = _mcRef;
aLayout = new Array();
aMaze = new Array();
buildMaze();
}
function setDoors() {
var _local2 = Map.Doors;
var _local3 = 10;
var _local4 = "";
var _local5 = "";
for (var _local6 in _local2) {
_local3++;
if (aLayout[_local2[_local6].maze - 1] == 0) {
_local4 = "Easy";
} else if (aLayout[_local2[_local6].maze - 1] == 1) {
_local4 = "Medium";
} else if (aLayout[_local2[_local6].maze - 1] == 2) {
_local4 = "Hard";
}
_local5 = _local2[_local6].prefix + (aLayout[_local2[_local6].maze - 1] + 1);
mcRef.attachMovie("mcDoors", "mcDoor_" + _local6.toString(), _local3);
mcRef["mcDoor_" + _local6.toString()]._rotation = _local2[_local6].rotation;
mcRef["mcDoor_" + _local6.toString()]._x = (_local2[_local6].x * 75) + 37.5;
mcRef["mcDoor_" + _local6.toString()]._y = (_local2[_local6].y * 75) + 37.5;
mcRef["mcDoor_" + _local6.toString()].gotoAndStop(_local4);
mcRef["mcDoor_" + _local6.toString()].mcDoor.txtDoor.text = "";
}
_local2 = Map.MapDoors;
for (var _local6 in _local2) {
_local3++;
mcRef.attachMovie("mcMapDoors", "mcMapDoor_" + _local6.toString(), _local3);
mcRef["mcMapDoor_" + _local6.toString()]._rotation = _local2[_local6].rotation;
mcRef["mcMapDoor_" + _local6.toString()]._x = _local2[_local6].x * 75;
mcRef["mcMapDoor_" + _local6.toString()]._y = _local2[_local6].y * 75;
if (_local2[_local6].rotation == 0) {
mcRef["mcMapDoor_" + _local6.toString()]._x = mcRef["mcMapDoor_" + _local6.toString()]._x + 37.5;
mcRef["mcMapDoor_" + _local6.toString()]._y = mcRef["mcMapDoor_" + _local6.toString()]._y + 75;
} else {
mcRef["mcMapDoor_" + _local6.toString()]._x = mcRef["mcMapDoor_" + _local6.toString()]._x + 75;
mcRef["mcMapDoor_" + _local6.toString()]._y = mcRef["mcMapDoor_" + _local6.toString()]._y + 37.5;
}
}
}
function getLayout() {
return(aLayout);
}
function setPosition(_obj) {
mcRef._x = _obj.x + 270;
mcRef._y = _obj.y + 120;
}
function clearMaze() {
aMaze.each(function (mc) {
mc.removeMovieClip();
});
}
function buildMaze() {
var _local10 = getTimer();
var _local5 = 0;
var _local9 = 9;
var _local7 = new Array();
var _local3 = new Array();
var _local6;
var _local12 = 0;
var _local13 = 0;
var _local11 = 0;
var _local4 = 0;
while (_local4 < oConfig.easy) {
_local3.push(0);
_local4++;
}
_local4 = 0;
while (_local4 < oConfig.medium) {
_local3.push(1);
_local4++;
}
_local4 = 0;
while (_local4 < oConfig.hard) {
_local3.push(2);
_local4++;
}
while (_local5 < _local9) {
_local6 = _local3.getRandom();
_local3.remove(_local6);
_local7.push(_local6);
_local5++;
}
var _local8;
var _local2;
_local8 = "mcMazes";
_local2 = "mcMaze_1";
mcRef.attachMovie(_local8, _local2, 1);
mcRef[_local2]._x = 0;
mcRef[_local2]._y = 0;
mcRef[_local2].gotoAndStop(_local7[0] + 1);
aMaze.push(mcRef[_local2]);
_local2 = "mcMaze_2";
mcRef.attachMovie(_local8, _local2, 2);
mcRef[_local2]._x = 975;
mcRef[_local2]._y = 0;
mcRef[_local2].gotoAndStop(_local7[1] + 4);
aMaze.push(mcRef[_local2]);
_local2 = "mcMaze_3";
mcRef.attachMovie(_local8, _local2, 3);
mcRef[_local2]._x = 1950;
mcRef[_local2]._y = 0;
mcRef[_local2].gotoAndStop(_local7[2] + 7);
aMaze.push(mcRef[_local2]);
_local2 = "mcMaze_4";
mcRef.attachMovie(_local8, _local2, 4);
mcRef[_local2]._x = 0;
mcRef[_local2]._y = 975;
mcRef[_local2].gotoAndStop(_local7[3] + 10);
aMaze.push(mcRef[_local2]);
_local2 = "mcMaze_5";
mcRef.attachMovie(_local8, _local2, 5);
mcRef[_local2]._x = 975;
mcRef[_local2]._y = 975;
mcRef[_local2].gotoAndStop(_local7[4] + 13);
aMaze.push(mcRef[_local2]);
_local2 = "mcMaze_6";
mcRef.attachMovie(_local8, _local2, 6);
mcRef[_local2]._x = 1950;
mcRef[_local2]._y = 975;
mcRef[_local2].gotoAndStop(_local7[5] + 16);
aMaze.push(mcRef[_local2]);
_local2 = "mcMaze_7";
mcRef.attachMovie(_local8, _local2, 7);
mcRef[_local2]._x = 0;
mcRef[_local2]._y = 1950;
mcRef[_local2].gotoAndStop(_local7[6] + 19);
aMaze.push(mcRef[_local2]);
_local2 = "mcMaze_8";
mcRef.attachMovie(_local8, _local2, 8);
mcRef[_local2]._x = 975;
mcRef[_local2]._y = 1950;
mcRef[_local2].gotoAndStop(_local7[7] + 22);
aMaze.push(mcRef[_local2]);
_local2 = "mcMaze_9";
mcRef.attachMovie(_local8, _local2, 9);
mcRef[_local2]._x = 1950;
mcRef[_local2]._y = 1950;
mcRef[_local2].gotoAndStop(_local7[8] + 25);
aMaze.push(mcRef[_local2]);
aLayout = _local7;
oOwner.addTime(getTimer() - _local10);
}
}
Symbol 835 MovieClip [__Packages.Map] Frame 0
class Map
{
function Map () {
}
static function getMap(_aLayout) {
var _local8 = new Array();
var _local5 = 0;
var _local2 = 0;
var _local1 = 0;
var _local6 = 3;
var _local9 = 3;
var _local10 = _aLayout.length;
var _local3;
var _local4;
while (_local5 < _local9) {
_local3 = new Array();
_local2 = 0;
while (_local2 < _local6) {
_local4 = aMapComplete[_local1][_aLayout[_local1]];
_local3.push(_local4);
_local1++;
_local2++;
}
_local8.push(_local3);
_local5++;
}
return(_local8);
}
static function getFullMap(_aLayout) {
var _local6 = new Array();
var _local4 = 0;
while (_local4 < 3) {
var _local2 = 0;
while (_local2 < 13) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < 3) {
_local3.merge(_aLayout[_local4][_local1][_local2]);
_local1++;
}
_local6.push(_local3);
_local2++;
}
_local4++;
}
return(_local6);
}
static function getWalkableTile(_aLayout) {
var _local4 = new Array();
var _local2 = 0;
while (_local2 < _aLayout.length) {
var _local1 = 0;
while (_local1 < _aLayout[_local2].length) {
if (_aLayout[_local2][_local1] == 0) {
_local4.push([_local2, _local1]);
}
_local1++;
}
_local2++;
}
return(_local4);
}
static var aMap1Easy = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 0, 1, 0, 1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1, 1, 1, 1, 1, 0, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1], [1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1], [1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
static var aMapComplete = [[aMap1Easy, aMap1Medium, aMap1Hard], [aMap2Easy, aMap2Medium, aMap2Hard], [aMap3Easy, aMap3Medium, aMap3Hard], [aMap4Easy, aMap4Medium, aMap4Hard], [aMap5Easy, aMap5Medium, aMap5Hard], [aMap6Easy, aMap6Medium, aMap6Hard], [aMap7Easy, aMap7Medium, aMap7Hard], [aMap8Easy, aMap8Medium, aMap8Hard], [aMap9Easy, aMap9Medium, aMap9Hard]];
static var Doors = {door1:{x:2, y:12, rotation:0, prefix:"A-", maze:1}, door2:{x:12, y:3, rotation:-90, prefix:"A-", maze:1}, door3:{x:13, y:3, rotation:90, prefix:"B-", maze:2}, door4:{x:23, y:12, rotation:0, prefix:"B-", maze:2}, door5:{x:25, y:9, rotation:-90, prefix:"B-", maze:2}, door6:{x:26, y:9, rotation:90, prefix:"C-", maze:3}, door7:{x:37, y:12, rotation:0, prefix:"C-", maze:3}, door8:{x:2, y:13, rotation:180, prefix:"D-", maze:4}, door9:{x:7, y:25, rotation:0, prefix:"D-", maze:4}, door10:{x:12, y:22, rotation:-90, prefix:"D-", maze:4}, door11:{x:23, y:13, rotation:180, prefix:"E-", maze:5}, door12:{x:13, y:22, rotation:90, prefix:"E-", maze:5}, door13:{x:16, y:25, rotation:0, prefix:"E-", maze:5}, door14:{x:25, y:20, rotation:-90, prefix:"E-", maze:5}, door15:{x:37, y:13, rotation:180, prefix:"F-", maze:6}, door16:{x:26, y:20, rotation:90, prefix:"F-", maze:6}, door17:{x:35, y:25, rotation:0, prefix:"F-", maze:6}, door18:{x:7, y:26, rotation:180, prefix:"G-", maze:7}, door19:{x:12, y:37, rotation:-90, prefix:"G-", maze:7}, door20:{x:16, y:26, rotation:180, prefix:"H-", maze:8}, door21:{x:13, y:37, rotation:90, prefix:"H-", maze:8}, door22:{x:25, y:29, rotation:-90, prefix:"H-", maze:8}, door23:{x:35, y:26, rotation:180, prefix:"I-", maze:9}, door24:{x:26, y:29, rotation:90, prefix:"I-", maze:9}};
static var MapDoors = {door1:{x:2, y:12, rotation:0}, door2:{x:12, y:3, rotation:90}, door3:{x:25, y:9, rotation:90}, door4:{x:37, y:12, rotation:0}, door5:{x:7, y:25, rotation:0}, door6:{x:12, y:22, rotation:90}, door7:{x:16, y:25, rotation:0}, door8:{x:23, y:12, rotation:0}, door9:{x:25, y:20, rotation:90}, door10:{x:35, y:25, rotation:0}, door11:{x:12, y:37, rotation:90}, door12:{x:25, y:29, rotation:90}};
}
Symbol 836 MovieClip [__Packages.Collision] Frame 0
class Collision
{
var aMap;
function Collision (_aMap) {
aMap = _aMap;
}
function getMap() {
return(aMap);
}
function clearCollision() {
aMap = new Array();
}
function canGoUp(_oObj) {
var _local6 = false;
var _local2 = Math.floor(_oObj.y / 975);
var _local7 = Math.floor(_oObj.x / 975);
var _local8 = _oObj.y - (_local2 * 975);
var _local4 = _oObj.x - (_local7 * 975);
var _local3 = Math.floor(_local8 / 75) - 1;
_local4 = Math.floor(_local4 / 75);
if (_local3 < 0) {
_local3 = 12;
_local2--;
}
if (aMap[_local2][_local7][_local3][_local4] == 0) {
_local6 = true;
}
return(_local6);
}
function canGoDown(_oObj) {
var _local6 = false;
var _local2 = Math.floor(_oObj.y / 975);
var _local7 = Math.floor(_oObj.x / 975);
var _local8 = _oObj.y - (_local2 * 975);
var _local4 = _oObj.x - (_local7 * 975);
var _local3 = Math.floor(_local8 / 75) + 1;
_local4 = Math.floor(_local4 / 75);
if (_local3 > 12) {
_local3 = 0;
_local2++;
}
if (aMap[_local2][_local7][_local3][_local4] == 0) {
_local6 = true;
}
return(_local6);
}
function canGoLeft(_oObj) {
var _local7 = false;
var _local5 = Math.floor(_oObj.y / 975);
var _local2 = Math.floor(_oObj.x / 975);
var _local3 = _oObj.y - (_local5 * 975);
var _local8 = _oObj.x - (_local2 * 975);
var _local4 = Math.floor(_local8 / 75) - 1;
_local3 = Math.floor(_local3 / 75);
if (_local4 < 0) {
_local4 = 12;
_local2--;
}
if (aMap[_local5][_local2][_local3][_local4] == 0) {
_local7 = true;
}
return(_local7);
}
function canGoRight(_oObj) {
var _local7 = false;
var _local5 = Math.floor(_oObj.y / 975);
var _local3 = Math.floor(_oObj.x / 975);
var _local4 = _oObj.y - (_local5 * 975);
var _local8 = _oObj.x - (_local3 * 975);
var _local2 = Math.floor(_local8 / 75) + 1;
_local4 = Math.floor(_local4 / 75);
if (_local2 > 12) {
_local2 = 0;
_local3--;
}
if (aMap[_local5][_local3][_local4][_local2] == 0) {
_local7 = true;
}
return(_local7);
}
function canGo(_obj) {
var _local7 = new Object();
var _local9 = _obj.x + _global.V.chaseSpeedX;
var _local8 = _obj.y + _global.V.chaseSpeedY;
var _local21 = true;
var _local10 = true;
var _local19 = true;
var _local11 = true;
var _local13 = _local9 - 37.5;
var _local12 = _local8 - 37.5;
var _local14 = _local9 + 37.5;
var _local15 = _local8 - 37.5;
var _local17 = _local9 - 37.5;
var _local16 = _local8 + 37.5;
var _local20 = _local9 + 37.5;
var _local18 = _local8 + 37.5;
var _local3;
var _local4;
var _local6;
var _local5;
_local3 = Math.floor(_local12 / 975);
_local4 = Math.floor(_local13 / 975);
_local5 = Math.floor(Math.floor(_local12 - ((_local3 * 975) / 75)));
_local6 = Math.floor(Math.floor(_local13 - ((_local4 * 975) / 75)));
_local21 = aMap[_local3][_local4][_local5][_local6] != 0;
_local3 = Math.floor(_local15 / 975);
_local4 = Math.floor(_local14 / 975);
_local5 = Math.floor(Math.floor(_local15 - ((_local3 * 975) / 75)));
_local6 = Math.floor(Math.floor(_local14 - ((_local4 * 975) / 75)));
_local10 = aMap[_local3][_local4][_local5][_local6] != 0;
_local3 = Math.floor(_local16 / 975);
_local4 = Math.floor(_local17 / 975);
_local5 = Math.floor(Math.floor(_local16 - ((_local3 * 975) / 75)));
_local6 = Math.floor(Math.floor(_local17 - ((_local3 * 975) / 75)));
_local19 = aMap[_local3][_local4][_local5][_local6] != 0;
_local3 = Math.floor(_local18 / 975);
_local4 = Math.floor(_local20 / 975);
_local5 = Math.floor(Math.floor(_local18 - ((_local3 * 975) / 75)));
_local6 = Math.floor(Math.floor(_local20 - ((_local4 * 975) / 75)));
_local11 = aMap[_local3][_local4][_local5][_local6] != 0;
_local7.topLeft = _local21;
_local7.topRight = _local10;
_local7.bottomLeft = _local19;
_local7.bottomRight = _local11;
return(_local7);
}
function getConnections(_nX, _nY, _nWidth, _nHeight) {
var _local5 = new Object();
var _local4 = Math.floor(_nY / 975);
var _local6 = Math.floor(_nX / 975);
_nY = _nY - (_local4 * 975);
_nX = _nX - (_local6 * 975);
var _local10 = Math.floor((_nY + (_nHeight / 2)) / 75);
var _local9 = Math.floor((_nY - (_nHeight / 2)) / 75);
var _local7 = Math.floor((_nX - (_nWidth / 2)) / 75);
var _local8 = Math.floor((_nX + (_nWidth / 2)) / 75);
_nX = Math.floor(_nX / 75);
_nY = Math.floor(_nY / 75);
_local5.top = ((aMap[_local4][_local6][_local10][_nX] == 1) ? true : false);
_local5.bottom = ((aMap[_local4][_local6][_local9][_nX] == 1) ? true : false);
_local5.left = ((aMap[_local4][_local6][_nY][_local7] == 1) ? true : false);
_local5.right = ((aMap[_local4][_local6][_nY][_local8] == 1) ? true : false);
return(_local5);
}
}
Symbol 837 MovieClip [__Packages.Zoey] Frame 0
class Zoey extends Game.State
{
var mcRef, setState, mcPanic, bLargePanic, bMediumPanic, bSmallPanic, oOwner, oConfig, sState, isStateFinished;
function Zoey (_mcRef, _oOwner, _oConfig) {
super(undefined);
_mcRef.attachMovie("mcZoey", "mcZoey", Config.Depths.Zoey);
mcRef = _mcRef.mcZoey;
var _local4 = new Array("Idle", "IdleDown", "IdleUp");
setState(_local4.getRandom());
mcPanic = _global.C.oHud.mcRef.mcPanic;
bLargePanic = false;
bMediumPanic = false;
bSmallPanic = false;
oOwner = _oOwner;
oConfig = _oConfig;
_global.C.oActionBroadcast.addListener(this);
}
function doAction() {
super.doAction();
if (!_global.C.bPause) {
panic();
if (mcRef != undefined) {
var _local4 = oOwner.oChase;
var _local5 = Math.abs(y - _local4.y);
var _local6 = Math.abs(x - _local4.x);
if ((_local5 <= ((height / 2) + (_local4.height / 2))) && (_local6 <= ((width / 2) + (_local4.width / 2)))) {
clearZoey();
oOwner.oChase.hasZoey = true;
oOwner.oExit.active = true;
oOwner.oEvents.doLightning();
}
}
}
}
function panic() {
var _local3 = oOwner.oGhost;
var _local4 = Math.sqrt(((_local3.x - x) * (_local3.x - x)) + ((_local3.y - y) * (_local3.y - y)));
var _local2 = "Scared";
if (sState.substr(-2) == "Up") {
_local2 = _local2 + "Up";
} else if (sState.substr(-4) == "Down") {
_local2 = _local2 + "Down";
}
if (_local4 < oConfig.panic.range.large) {
if (!bLargePanic) {
mcPanic.gotoAndStop("Large");
setState(_local2);
bLargePanic = true;
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_panic_high", 100, 1, true);
}
} else if (_local4 < oConfig.panic.range.medium) {
if (!bMediumPanic) {
mcPanic.gotoAndStop("Medium");
setState(_local2);
bMediumPanic = true;
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_panic_medium", 75, 1, true);
}
} else if (_local4 < oConfig.panic.range.small) {
if (!bSmallPanic) {
mcPanic.gotoAndStop("Small");
setState(_local2);
bSmallPanic = true;
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_panic_low", 60, 1, true);
}
} else {
mcPanic.gotoAndStop("None");
}
}
function setPosition(_obj) {
x = (_obj.x + 37.5);
y = (_obj.y + 37.5);
mcRef.swapDepths((Math.floor(y / 75) * 1000) + Config.Depths.Zoey);
}
function clearZoey() {
mcRef.removeMovieClip();
delete mcRef;
}
function stopListener() {
_global.C.oActionBroadcast.removeListener(this);
}
function Scared() {
if (isStateFinished()) {
setState("Idle");
}
}
function ScaredUp() {
if (isStateFinished()) {
setState("IdleUp");
}
}
function ScaredDown() {
if (isStateFinished()) {
setState("IdleDown");
}
}
function get x() {
return(mcRef._x);
}
function set x(_nX) {
mcRef._x = _nX;
//return(x);
}
function get y() {
return(mcRef._y);
}
function set y(_nY) {
mcRef._y = _nY;
//return(y);
}
function get height() {
return(mcRef._height);
}
function set height(_nHeight) {
//return(height);
}
function get width() {
return(mcRef._width);
}
function set width(_nWidth) {
//return(width);
}
}
Symbol 838 MovieClip [__Packages.Chase] Frame 0
class Chase extends Game.State
{
var oOwner, aMap, mcRef, setState, mcMaze, oTarget, oKey, bShooting, bScared, bChaseAndZoey, bB, bSpace, nCases, oLastPos, bWheredYaGo, bHasZoey, sState, isStateFinished;
function Chase (_mcRef, _oOwner, _oConfig) {
super(undefined);
oOwner = _oOwner;
aMap = Map.getFullMap(oOwner.oCollision.getMap());
_mcRef.attachMovie("mcPlayer", "mcPlayer", Config.Depths.Chase);
mcRef = _mcRef.mcPlayer;
setState("Idle");
mcMaze = _mcRef;
oTarget = new Object();
oKey = _global.C.oKeyManager;
bShooting = false;
bScared = false;
bChaseAndZoey = false;
bB = false;
bSpace = false;
nCases = 0;
oLastPos = new Object();
bWheredYaGo = false;
_global.C.oActionBroadcast.addListener(this);
}
function doAction() {
super.doAction();
if (((!_global.C.bPause) && (!bScared)) && (!bShooting)) {
if ((!bChaseAndZoey) && (bHasZoey)) {
var _local5 = mcRef._x;
var _local4 = mcRef._y;
clearChase();
mcMaze.attachMovie("mcChaseAndZoey", "mcPlayer", Config.Depths.Chase);
mcRef = mcMaze.mcPlayer;
setState("Idle");
mcRef._x = _local5;
mcRef._y = _local4;
bChaseAndZoey = true;
if (Library.Sound.SoundManager.isSoundPlaying("sMu_game").bPlaying == true) {
Library.Sound.SoundManager.isSoundPlaying("sMu_game").oSound.doFadeTo(0, true);
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_ghost_speed", 100, 1, true, function () {
Library.Sound.SoundManager.doPlaySoundInCat("music", "sMu_game_speed", 0, 99999);
Library.Sound.SoundManager.isSoundPlaying("sMu_game_speed").oSound.doFadeTo(100, false);
});
}
}
if (((oKey.bLeft && (!oKey.bRight)) && (!oKey.bUp)) && (!oKey.bDown)) {
goLeft();
} else if (((oKey.bRight && (!oKey.bLeft)) && (!oKey.bUp)) && (!oKey.bDown)) {
goRight();
} else if (((oKey.bUp && (!oKey.bLeft)) && (!oKey.bRight)) && (!oKey.bDown)) {
goUp();
} else if (((oKey.bDown && (!oKey.bLeft)) && (!oKey.bRight)) && (!oKey.bUp)) {
goDown();
}
if ((((!oKey.bSpace) && (oKey.bB)) && (!bB)) && (oOwner.oPowerBall.balls > 0)) {
oTarget.to = "";
bB = true;
if (sState.substr(-2) == "Up") {
setState("PowerballUp");
} else if (sState.substr(-4) == "Down") {
setState("PowerballDown");
} else {
setState("Powerball");
}
} else if ((oKey.bSpace && (!oKey.bB)) && (!bSpace)) {
bSpace = true;
oOwner.oApple.drop(mcRef);
}
if (!oKey.bSpace) {
bSpace = false;
}
if (!oKey.bB) {
bB = false;
}
mcRef.swapDepths((Math.floor(y / 75) * 1000) + Config.Depths.Chase);
doMove();
mcMaze._x = (-x) + 300;
mcMaze._y = (-y) + 150;
if (oOwner.oEvents.mcBlackOut != undefined) {
oOwner.oEvents.mcBlackOut._x = x;
oOwner.oEvents.mcBlackOut._y = y;
}
if (!bWheredYaGo) {
if ((Math.floor(mcRef._x / 75) != oLastPos.x) || (Math.floor(mcRef._y / 75) != oLastPos.y)) {
oLastPos = {x:Math.floor(mcRef._x / 75), y:Math.floor(mcRef._y / 75)};
nCases++;
}
if (nCases == 4) {
bWheredYaGo = true;
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_Whered_ya_go", 75, 1, true);
}
}
}
}
function setPosition(_obj) {
mcRef._x = _obj.x + 37.5;
mcRef._y = _obj.y + 37.5;
oLastPos = {x:Math.floor(mcRef._x / 75), y:Math.floor(mcRef._y / 75)};
}
function clearChase() {
mcRef.removeMovieClip();
delete mcRef;
}
function stopListener() {
_global.C.oActionBroadcast.removeListener(this);
}
function Idle() {
if (_global.D == "left") {
}
}
function IdleUp() {
}
function IdleDown() {
}
function RunSide() {
if (_global.D == "left") {
}
}
function RunUp() {
}
function RunDown() {
}
function Powerball() {
bShooting = true;
if (mcRef.mcState._currentframe == 11) {
if (mcRef._xscale == -100) {
oOwner.oPowerBall.shoot(mcRef, -36.1, -7.3);
} else {
oOwner.oPowerBall.shoot(mcRef, 36.1, -7.3);
}
}
if (isStateFinished()) {
bShooting = false;
setState("Idle");
}
}
function PowerballUp() {
bShooting = true;
if (mcRef.mcState._currentframe == 11) {
oOwner.oPowerBall.shoot(mcRef, -5, 14.4);
}
if (isStateFinished()) {
bShooting = false;
setState("IdleUp");
}
}
function PowerballDown() {
bShooting = true;
if (mcRef.mcState._currentframe == 11) {
oOwner.oPowerBall.shoot(mcRef, -5, 14.4);
}
if (isStateFinished()) {
bShooting = false;
setState("IdleDown");
}
}
function Hurt() {
if (isStateFinished()) {
_global.C.onGameLost();
}
}
function HurtUp() {
if (isStateFinished()) {
_global.C.onGameLost();
}
}
function HurtDown() {
if (isStateFinished()) {
_global.C.onGameLost();
}
}
function Scared() {
if (isStateFinished()) {
scared = (false);
setState("Idle");
}
}
function ScaredUp() {
if (isStateFinished()) {
scared = (false);
setState("IdleUp");
}
}
function ScaredDown() {
if (isStateFinished()) {
scared = (false);
setState("IdleDown");
}
}
function setTarget(_nX, _nY, _sTo) {
oTarget.x = (_nX * 75) + 37.5;
oTarget.y = (_nY * 75) + 37.5;
oTarget.to = _sTo;
}
function doMove() {
if (oTarget.to == "toLeft") {
if (y != oTarget.y) {
if (((y < oTarget.y) && ((oTarget.y - y) < Config.Chase.speed)) || ((y > oTarget.y) && ((y - oTarget.y) < Config.Chase.speed))) {
y = (oTarget.y);
} else if (y < oTarget.y) {
_global.D = "down";
setState("RunDown");
y = y + Config.Chase.speed;
} else {
_global.D = "up";
setState("RunUp");
y = y + (-Config.Chase.speed);
}
} else {
mcRef._xscale = -100;
if (x <= oTarget.x) {
x = (oTarget.x);
setState("Idle");
oTarget.to = "";
} else {
_global.D = "left";
setState("RunSide");
x = x + (-Config.Chase.speed);
}
}
} else if (oTarget.to == "toRight") {
if (y != oTarget.y) {
if (((y < oTarget.y) && ((oTarget.y - y) < Config.Chase.speed)) || ((y > oTarget.y) && ((y - oTarget.y) < Config.Chase.speed))) {
y = (oTarget.y);
} else if (y < oTarget.y) {
_global.D = "down";
setState("RunDown");
y = y + Config.Chase.speed;
} else {
_global.D = "up";
setState("RunUp");
y = y + (-Config.Chase.speed);
}
} else {
mcRef._xscale = 100;
if (x >= oTarget.x) {
x = (oTarget.x);
setState("Idle");
oTarget.to = "";
} else {
_global.D = "right";
setState("RunSide");
x = x + Config.Chase.speed;
}
}
} else if (oTarget.to == "toUp") {
if (x != oTarget.x) {
if (((x < oTarget.x) && ((oTarget.x - x) < Config.Chase.speed)) || ((x > oTarget.x) && ((x - oTarget.x) < Config.Chase.speed))) {
x = (oTarget.x);
} else if (x < oTarget.x) {
_global.D = "right";
setState("RunSide");
x = x + Config.Chase.speed;
} else {
_global.D = "left";
setState("RunSide");
x = x + (-Config.Chase.speed);
}
} else if (y <= oTarget.y) {
y = (oTarget.y);
setState("IdleUp");
oTarget.to = "";
} else {
_global.D = "up";
setState("RunUp");
y = y + (-Config.Chase.speed);
}
} else if (oTarget.to == "toDown") {
if (x != oTarget.x) {
if (((x < oTarget.x) && ((oTarget.x - x) < Config.Chase.speed)) || ((x > oTarget.x) && ((x - oTarget.x) < Config.Chase.speed))) {
x = (oTarget.x);
} else if (x < oTarget.x) {
_global.D = "right";
setState("RunSide");
x = x + Config.Chase.speed;
} else {
_global.D = "left";
setState("RunSide");
x = x + (-Config.Chase.speed);
}
} else if (y >= oTarget.y) {
y = (oTarget.y);
setState("IdleDown");
oTarget.to = "";
} else {
_global.D = "down";
setState("RunDown");
y = y + Config.Chase.speed;
}
}
}
function canGo(_obj) {
var _local2 = false;
if (aMap[_obj.y][_obj.x] == 0) {
_local2 = true;
}
return(_local2);
}
function goLeft() {
var _local3 = Math.floor(x / 75) - 1;
var _local2 = Math.floor(y / 75);
if (canGo({x:_local3, y:_local2})) {
setTarget(_local3, _local2, "toLeft");
}
}
function goRight() {
var _local3 = Math.floor(x / 75) + 1;
var _local2 = Math.floor(y / 75);
if (canGo({x:_local3, y:_local2})) {
setTarget(_local3, _local2, "toRight");
}
}
function goUp() {
var _local3 = Math.floor(x / 75);
var _local2 = Math.floor(y / 75) - 1;
if (canGo({x:_local3, y:_local2})) {
setTarget(_local3, _local2, "toUp");
}
}
function goDown() {
var _local3 = Math.floor(x / 75);
var _local2 = Math.floor(y / 75) + 1;
if (canGo({x:_local3, y:_local2})) {
setTarget(_local3, _local2, "toDown");
}
}
function get x() {
return(mcRef._x);
}
function set x(_nX) {
mcRef._x = _nX;
//return(x);
}
function get y() {
return(mcRef._y);
}
function set y(_nY) {
mcRef._y = _nY;
//return(y);
}
function get width() {
var _local2 = mcRef._width;
if (bHasZoey) {
if (sState.substr(-2) == "Up") {
_local2 = Config.Chase.boundCZ.up.width;
} else if (sState.substr(-4) == "Down") {
_local2 = Config.Chase.boundCZ.down.width;
} else {
_local2 = Config.Chase.boundCZ.normal.width;
}
} else {
_local2 = Config.Chase.boundChase.width;
}
return(_local2);
}
function set width(_nWidth) {
//return(width);
}
function get height() {
var _local2 = mcRef._height;
if (bHasZoey) {
if (sState.substr(-2) == "Up") {
_local2 = Config.Chase.boundCZ.up.height;
} else if (sState.substr(-4) == "Down") {
_local2 = Config.Chase.boundCZ.down.height;
} else {
_local2 = Config.Chase.boundCZ.normal.height;
}
} else {
_local2 = Config.Chase.boundChase.height;
}
return(_local2);
}
function set height(_nHeight) {
//return(height);
}
function get hasZoey() {
return(bHasZoey);
}
function set hasZoey(_bool) {
bHasZoey = _bool;
//return(hasZoey);
}
function get scared() {
return(bScared);
}
function set scared(_bool) {
bScared = _bool;
if (bScared) {
bShooting = false;
if (bHasZoey) {
if (sState.substr(-2) == "Up") {
setState("ScaredUp");
} else if (sState.substr(-4) == "Down") {
setState("ScaredDown");
} else {
setState("Scared");
}
} else {
setState("Scared");
}
}
//return(scared);
}
}
Symbol 839 MovieClip [__Packages.Ghost] Frame 0
class Ghost extends Game.State
{
var mcRef, mcPath, nFrames, sDirection, nextTile, bDistracted, bGotHurt, bGo, bRandomPosition, nBetweenSearch, setState, oOwner, oConfig, aMap, aWalkable, oPF, nSpeed, aPath, isStateFinished, bStuck, bStop;
function Ghost (_mcRef, _oOwner, _oConfig) {
super(undefined);
_mcRef.attachMovie("mcGhost", "mcGhost", Config.Depths.Ghost);
_mcRef.createEmptyMovieClip("mcPath", 6000000);
mcRef = _mcRef.mcGhost;
mcPath = _mcRef.mcPath;
nFrames = 0;
sDirection = "";
nextTile = new Object();
nextTile.x = undefined;
nextTile.y = undefined;
bDistracted = false;
bGotHurt = false;
bGo = false;
bRandomPosition = false;
nBetweenSearch = 0;
setState("Idle");
oOwner = _oOwner;
oConfig = _oConfig;
aMap = oOwner.oCollision.getMap();
aWalkable = Map.getWalkableTile(aMap);
oPF = new PathFinding(aMap);
nSpeed = oConfig.basicSpeed * oConfig.speed;
_global.C.oActionBroadcast.addListener(this);
}
function doAction() {
super.doAction();
if ((!_global.C.bPause) && (!oOwner.oChase.scared)) {
if ((!stuck) && (!stopped)) {
nBetweenSearch++;
doMove();
if ((!oPF.bPathFound) || (nBetweenSearch >= 35)) {
nBetweenSearch = 0;
findAWay();
}
} else if (stuck) {
if (!bGotHurt) {
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_ghost_hit", 100, 1, true);
setState("HurtIn");
bGotHurt = true;
nFrames = 0;
}
nFrames++;
if (nFrames > oConfig.stuckTime) {
nFrames = 0;
setState("HurtOut");
}
}
if (bDistracted || (stopped)) {
nFrames++;
if (nFrames > oConfig.distracted) {
nFrames = 0;
bDistracted = false;
stopped = (false);
}
}
if ((hasGotChase() || (hasGotZoey())) && (!stuck)) {
if (hasGotChase()) {
trace("Oh no! The ghost got you!");
if (oOwner.oChase.sState.substr(-2) == "Up") {
oOwner.oChase.setState("HurtUp");
} else if (oOwner.oChase.sState.substr(-4) == "Down") {
oOwner.oChase.setState("HurtDown");
} else {
oOwner.oChase.setState("Hurt");
}
oOwner.clearLevel();
oOwner.endGame(false);
} else {
trace("Oh no! The ghost got Zoey!");
if (oOwner.oZoey.sState.substr(-2) == "Up") {
oOwner.oZoey.setState("HurtUp");
} else if (oOwner.oZoey.sState.substr(-4) == "Down") {
oOwner.oZoey.setState("HurtDown");
} else {
oOwner.oZoey.setState("Hurt");
}
oOwner.clearLevel();
oOwner.endGame(true);
}
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_ghost_catch", 100, 1);
}
if (oOwner.oChase.hasZoey) {
nSpeed = oConfig.stretSpeed * oConfig.speed;
oOwner.oEvents.active = true;
}
mcRef.swapDepths((Math.floor(y / 75) * 1000) + Config.Depths.Ghost);
}
}
function hasGotChase() {
var _local3 = false;
var _local2 = oOwner.oChase;
var _local4 = Math.abs(y - _local2.y);
var _local5 = Math.abs(x - _local2.x);
if (((_local4 <= oConfig.catchDistance) && (_local5 <= oConfig.catchDistance)) && (_local2.mcRef != undefined)) {
_local3 = true;
}
return(_local3);
}
function hasGotZoey() {
var _local3 = false;
var _local2 = oOwner.oZoey;
var _local4 = Math.abs(y - _local2.y);
var _local5 = Math.abs(x - _local2.x);
if (((_local4 <= oConfig.catchDistance) && (_local5 <= oConfig.catchDistance)) && (_local2.mcRef != undefined)) {
_local3 = true;
}
return(_local3);
}
function findAWay() {
var _local2 = oOwner.oChase;
var _local3 = oOwner.oZoey;
var _local4 = Math.sqrt(((_local2.x - x) * (_local2.x - x)) + ((_local2.y - y) * (_local2.y - y)));
var _local5 = Math.sqrt(((_local3.x - x) * (_local3.x - x)) + ((_local3.y - y) * (_local3.y - y)));
var _local6 = Math.floor(Math.sqrt(((_local2.x - _local3.x) * (_local2.x - _local3.x)) + ((_local2.y - _local3.y) * (_local2.y - _local3.y))));
if (_local6 < oConfig.distanceBetweenCZ) {
bGo = true;
}
if (((_local4 < _local5) && (_local4 < oConfig.distanceFromChase)) || (_local2.hasZoey)) {
aPath = oPF.findPath(y, x, _local2.y, _local2.x);
bRandomPosition = false;
} else if (((_local5 < _local4) && (_local5 < oConfig.distanceFromZoey)) || (bGo)) {
aPath = oPF.findPath(y, x, _local3.y, _local3.x);
bRandomPosition = false;
} else {
aPath = oPF.findPath(y, x, _local2.y, _local2.x);
bRandomPosition = false;
}
}
function doMove() {
if (aPath.length == 0) {
oPF.bPathFound = false;
}
if ((x == nextTile.x) && (y == nextTile.y)) {
nextTile.x = undefined;
nextTile.y = undefined;
sDirection = "";
}
if ((aPath[0] != undefined) && (nextTile.x == undefined)) {
aPath.splice(0, 1);
nextTile.x = (aPath[0][1] * 75) + 37.5;
nextTile.y = (aPath[0][0] * 75) + 37.5;
if (nextTile.x > x) {
sDirection = "left";
mcRef._xscale = 100;
} else if (nextTile.x < x) {
sDirection = "right";
mcRef._xscale = -100;
} else if (nextTile.y > y) {
sDirection = "down";
mcRef._xscale = 100;
} else if (nextTile.y < y) {
sDirection = "up";
mcRef._xscale = 100;
}
}
if (sDirection == "left") {
if (x >= nextTile.x) {
x = (nextTile.x);
nextTile.x = undefined;
nextTile.y = undefined;
} else {
x = x + nSpeed;
setState("RunSide");
}
} else if (sDirection == "right") {
if (x <= nextTile.x) {
x = (nextTile.x);
nextTile.x = undefined;
nextTile.y = undefined;
} else {
x = x - nSpeed;
setState("RunSide");
}
} else if (sDirection == "up") {
if (y <= nextTile.y) {
y = (nextTile.y);
nextTile.x = undefined;
nextTile.y = undefined;
} else {
y = y - nSpeed;
setState("RunUp");
}
} else if (sDirection == "down") {
if (y >= nextTile.y) {
y = (nextTile.y);
nextTile.x = undefined;
nextTile.y = undefined;
} else {
y = y + nSpeed;
setState("RunDown");
}
}
}
function setPosition(_obj) {
mcRef._x = _obj.x + 37.5;
mcRef._y = _obj.y + 37.5;
}
function clearGhost() {
mcRef.removeMovieClip();
delete mcRef;
}
function stopListener() {
_global.C.oActionBroadcast.removeListener(this);
}
function Idle() {
}
function RunSide() {
}
function RunUp() {
}
function RunDown() {
}
function Hurt() {
if (isStateFinished()) {
setState("Idle");
bGotHurt = true;
}
}
function HurtIn() {
if (isStateFinished()) {
setState("HurtIdle");
}
}
function HurtIdle() {
}
function HurtOut() {
if (isStateFinished()) {
setState("Idle");
bGotHurt = false;
stuck = (false);
}
}
function get x() {
return(mcRef._x);
}
function set x(_nX) {
mcRef._x = _nX;
//return(x);
}
function get y() {
return(mcRef._y);
}
function set y(_nY) {
mcRef._y = _nY;
//return(y);
}
function get stuck() {
return(bStuck);
}
function set stuck(_bool) {
bStuck = _bool;
//return(stuck);
}
function get stopped() {
return(bStop);
}
function set stopped(_bool) {
bStop = _bool;
//return(stopped);
}
function get height() {
return(mcRef._height);
}
function set height(_nHeight) {
//return(height);
}
function get width() {
return(mcRef._width);
}
function set width(_nWidth) {
//return(width);
}
function paintPath(_aPath) {
var _local3;
var _local2;
mcPath.clear();
var _local4 = 0;
while (_local4 < _aPath.length) {
_local2 = _aPath[_local4][0] * 75;
_local3 = _aPath[_local4][1] * 75;
mcPath.beginFill(16777215, 70);
mcPath.moveTo(_local3, _local2);
mcPath.lineTo(_local3 + 75, _local2);
mcPath.lineTo(_local3 + 75, _local2 + 75);
mcPath.lineTo(_local3, _local2 + 75);
mcPath.lineTo(_local3, _local2);
mcPath.endFill();
_local4++;
}
_local3 = nextTile.x;
_local2 = nextTile.y;
mcPath.beginFill(65280, 50);
mcPath.moveTo(_local3 - 37.5, _local2 - 37.5);
mcPath.lineTo(_local3 + 37.5, _local2 - 37.5);
mcPath.lineTo(_local3 + 37.5, _local2 + 37.5);
mcPath.lineTo(_local3 - 37.5, _local2 + 37.5);
mcPath.lineTo(_local3 - 37.5, _local2 - 37.5);
mcPath.endFill();
}
}
Symbol 840 MovieClip [__Packages.PathFinding] Frame 0
class PathFinding
{
var nMaxTime, nCurrent, nTimeTaken, bPathFound, aTmp, aMapStatus, aOpenList;
function PathFinding (_aMap) {
nMaxTime = 12;
nCurrent = -1;
nTimeTaken = 0;
bPathFound = false;
aTmp = new Array();
var _local5 = 0;
while (_local5 < 3) {
var _local3 = 0;
while (_local3 < 13) {
var _local4 = new Array();
var _local2 = 0;
while (_local2 < 3) {
_local4.merge(_aMap[_local5][_local2][_local3]);
_local2++;
}
aTmp.push(_local4);
_local3++;
}
_local5++;
}
trace(aTmp);
}
function findPath(_nStartY, _nStartX, _nEndY, _nEndX) {
var _local2 = findPathInternal(_nStartY, _nStartX, _nEndY, _nEndX);
return(_local2);
}
function isOpened(_nY, _nX) {
return(aMapStatus[_nY][_nX].opened);
}
function isClosed(_nY, _nX) {
return(aMapStatus[_nY][_nX].closed);
}
function nearerSquare() {
var _local5 = 999999 /* 0x0F423F */;
var _local6 = 0;
var _local4;
var _local3;
var _local2 = aOpenList.length;
while ((_local2--) > 0) {
_local3 = aMapStatus[aOpenList[_local2][0]][aOpenList[_local2][1]];
_local4 = _local3.heuristic + _local3.movementCost;
if (_local4 <= _local5) {
_local5 = _local4;
_local6 = _local2;
}
}
return(_local6);
}
function closeSquare(_nY, _nX) {
var _local5 = aOpenList.length;
var _local2 = 0;
while (_local2 < _local5) {
if ((aOpenList[_local2][0] == _nY) && (aOpenList[_local2][1] == _nX)) {
aOpenList.splice(_local2, 1);
break;
}
_local2++;
}
aMapStatus[_nY][_nX].opened = false;
aMapStatus[_nY][_nX].closed = true;
}
function openSquare(_nY, _nX, _aParent, _nMovementCost, _nHeuristic, _bReplacing) {
if (!_bReplacing) {
aOpenList.push([_nY, _nX]);
aMapStatus[_nY][_nX] = {heuristic:_nHeuristic, opened:true, closed:false};
}
aMapStatus[_nY][_nX].parent = _aParent;
aMapStatus[_nY][_nX].movementCost = _nMovementCost;
}
function findPathInternal(_nStartY, _nStartX, _nEndY, _nEndX) {
if ((((_nStartY == undefined) || (_nStartX == undefined)) || (_nEndY == undefined)) || (_nEndX == undefined)) {
return(null);
}
_nStartY = Math.floor(_nStartY / 75);
_nStartX = Math.floor(_nStartX / 75);
_nEndY = Math.floor(_nEndY / 75);
_nEndX = Math.floor(_nEndX / 75);
var _local10 = aTmp.length;
var _local12 = aTmp[0].length;
aMapStatus = new Array();
var _local11 = 0;
while (_local11 < _local10) {
aMapStatus[_local11] = new Array();
_local11++;
}
aOpenList = new Array();
openSquare(_nStartY, _nStartX, undefined, 0);
var _local18 = getTimer();
_local11 = -1;
while (((aOpenList.length > 0) && (!isClosed(_nEndY, _nEndX))) || ((getTimer() - _local18) < nMaxTime)) {
if (nCurrent > -1) {
_local11 = nCurrent;
} else {
_local11 = nearerSquare();
}
var _local6 = aOpenList[_local11][0];
var _local7 = aOpenList[_local11][1];
closeSquare(_local6, _local7);
var _local3 = _local6 - 1;
while (_local3 < (_local6 + 2)) {
var _local2 = _local7 - 1;
while (_local2 < (_local7 + 2)) {
if (((((((_local3 >= 0) && (_local3 < _local10)) && (_local2 >= 0)) && (_local2 < _local12)) && (!((_local3 == _local6) && (_local2 == _local7)))) && ((bALLOW_DIAGONAL || (_local3 == _local6)) || (_local2 == _local7))) && (((bALLOW_DIAGONAL_CORNERING || (_local3 == _local6)) || (_local2 == _local7)) || ((aTmp[_local3][_local7] != 1) && (aTmp[_local6][_local2] != 1)))) {
if (aTmp[_local3][_local2] != 1) {
if (!isClosed(_local3, _local2)) {
var _local4 = aMapStatus[_local6][_local7].movementCost + ((((_local3 == _local6) || (_local2 == _local7)) ? (nHV_COST) : (nD_COST)) * aTmp[_local3][_local2]);
if (isOpened(_local3, _local2)) {
if (_local4 < aMapStatus[_local3][_local2].movementCost) {
openSquare(_local3, _local2, [_local6, _local7], _local4, undefined, true);
}
} else {
var _local5 = (Math.abs(_local3 - _nEndY) + Math.abs(_local2 - _nEndX)) * 75;
openSquare(_local3, _local2, [_local6, _local7], _local4, _local5, false);
}
}
}
}
_local2++;
}
_local3++;
}
}
var _local19 = isClosed(_nEndY, _nEndX);
if (_local19) {
bPathFound = true;
var _local17 = new Array();
var _local6 = _nEndY;
var _local7 = _nEndX;
while ((_local6 != _nStartY) || (_local7 != _nStartX)) {
_local17.push([_local6, _local7]);
var _local13 = aMapStatus[_local6][_local7].parent[0];
var _local14 = aMapStatus[_local6][_local7].parent[1];
_local6 = _local13;
_local7 = _local14;
}
_local17.push([_nStartY, _nStartX]);
_local17.reverse();
return(_local17);
}
return(null);
}
static var nHV_COST = 10;
static var nD_COST = 14;
static var bALLOW_DIAGONAL = false;
static var bALLOW_DIAGONAL_CORNERING = false;
}
Symbol 841 MovieClip [__Packages.Powers] Frame 0
class Powers
{
var mcRef, oOwner, oConfig, nIndex, aPowers, nCount;
function Powers (_mcRef, _oOwner, _oConfig) {
mcRef = _mcRef;
oOwner = _oOwner;
oConfig = _oConfig;
nIndex = Config.Depths.Powers.min;
aPowers = new Array();
nCount = 0;
while (nCount < oConfig.count) {
creates();
nCount++;
}
_global.C.oActionBroadcast.addListener(this);
}
function doAction() {
if (!_global.C.bPause) {
aPowers.each(isTouched);
}
}
function isTouched(_obj) {
var _local2 = _obj.owner.oChase.mcRef;
var _local3 = Math.sqrt(((_local2._x - _obj.mc._x) * (_local2._x - _obj.mc._x)) + ((_local2._y - _obj.mc._y) * (_local2._y - _obj.mc._y)));
if (_local3 < ((_obj.mc._width / 2) + (_local2._width / 2))) {
_obj.host.touch(_obj);
}
}
function creates() {
var _local4;
var _local5 = selectPosition();
var _local2 = "mcPowers_" + nIndex;
var _local3 = new Object();
if (Math.random() < 0.5) {
_local4 = "Balls";
_local3.count = oConfig.ball;
} else {
_local4 = "Apples";
_local3.count = oConfig.apples;
}
nIndex++;
if (nIndex > Config.Depths.Powers.max) {
nIndex = Config.Depths.Powers.min;
}
mcRef.attachMovie("mcPowers", _local2, nIndex);
mcRef[_local2]._x = _local5.x;
mcRef[_local2]._y = _local5.y;
mcRef[_local2].gotoAndStop(_local4);
mcRef[_local2].swapDepths((Math.floor(mcRef[_local2]._y / 75) * 1000) + nIndex);
_local3.mc = mcRef[_local2];
_local3.type = _local4;
_local3.owner = oOwner;
_local3.host = this;
aPowers.push(_local3);
}
function touch(_obj) {
if (_obj.type == "Apples") {
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_powers_apples", 100, 1);
oOwner.oApple.addApples(_obj.count);
} else if (_obj.type == "Balls") {
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_powers_balls", 100, 1);
oOwner.oPowerBall.addBalls(_obj.count);
}
clearPowers(_obj);
}
function selectPosition() {
var _local6 = new Object();
var _local5 = 0;
var _local4 = 0;
var _local3 = 0;
var _local2 = 0;
var _local7 = oOwner.oCollision.getMap();
_local6.x = -500;
_local6.y = -500;
while (true) {
_local5 = randomize(0, 2);
_local4 = randomize(0, 2);
_local3 = randomize(0, 12);
_local2 = randomize(0, 12);
if (_local7[_local5][_local4][_local3][_local2] == 0) {
_local6.x = ((_local4 * 975) + (_local2 * 75)) + 37.5;
_local6.y = ((_local5 * 975) + (_local3 * 75)) + 37.5;
break;
}
}
return(_local6);
}
function clearPowers(_obj) {
if (_obj == undefined) {
aPowers.each(function (s) {
s.mc.removeMovieClip();
delete s.mc;
});
aPowers.splice(0);
} else {
var _local2 = aPowers.indexOf(_obj);
aPowers[_local2].mc.removeMovieClip();
aPowers.splice(_local2, 1);
}
}
function stopListener() {
_global.C.oActionBroadcast.removeListener(this);
}
function randomize(_nMin, _nMax) {
return(Math.floor(Math.random() * ((_nMax - _nMin) + 1)) + _nMin);
}
}
Symbol 842 MovieClip [__Packages.Apple] Frame 0
class Apple
{
var mcRef, oConfig, oOwner, txtApple, nCount, nIndex, aCores;
function Apple (_mcRef, _oOwner, _oConfig) {
mcRef = _mcRef;
oConfig = _oConfig;
oOwner = _oOwner;
txtApple = _global.C.oHud.mcRef.txtCores;
nCount = 0;
nIndex = Config.Depths.AppleCores.min;
addApples(oConfig.basic);
aCores = new Array();
_global.C.oActionBroadcast.addListener(this);
}
function doAction() {
aCores.each(function (_obj) {
if ((!_obj.glowing) && (!_obj.lightup)) {
_obj.frames++;
if (_obj.frames >= _obj.glow) {
_obj.mc.gotoAndStop("LightUp");
_obj.lightup = true;
}
} else if ((!_obj.glowing) && (_obj.lightup)) {
if (_obj.mc.mcState._currentframe >= _obj.mc.mcState._totalframes) {
_obj.lightup = false;
_obj.glowing = true;
_obj.mc.gotoAndStop("Glowing");
}
}
});
}
function addApples(_nCount) {
nCount = nCount + _nCount;
txtApple.text = FormatNumber(nCount);
}
function drop(_object) {
if (nCount > 0) {
nCount--;
nIndex++;
if (nIndex > Config.Depths.AppleCores.max) {
nIndex = Config.Depths.AppleCores.min;
}
txtApple.text = FormatNumber(nCount);
var _local3 = "mcAppleCores_" + nIndex;
mcRef.attachMovie("mcAppleCores", _local3, nIndex);
mcRef[_local3]._x = _object._x;
mcRef[_local3]._y = _object._y;
mcRef[_local3].gotoAndStop("Idle");
if (oOwner.oEvents.blackout) {
mcRef[_local3].swapDepths(40000 + nIndex);
} else {
mcRef[_local3].swapDepths((Math.floor(_object._y / 75) * 1000) + nIndex);
}
var _local2 = new Object();
_local2.mc = mcRef[_local3];
_local2.depth = nIndex;
_local2.frames = 0;
_local2.glow = oConfig.glow;
_local2.glowing = false;
_local2.lightup = false;
_local2.host = this;
_local2.owner = oOwner;
aCores.push(_local2);
}
}
function glowInDark() {
aCores.each(function (_obj) {
if (_obj.mc.getDepth() > 40000) {
_obj.mc.swapDepths((Math.floor(_obj.mc._y / 75) * 1000) + _obj.depth);
} else {
_obj.mc.swapDepths(41000 + _obj.depth);
}
});
}
function clearCores() {
aCores.each(function (_obj) {
_obj.mc.removeMovieClip();
delete _obj.mc;
});
aCores.splice(0);
}
function stopListener() {
_global.C.oActionBroadcast.removeListener(this);
}
function FormatNumber(_nCount) {
var _local1 = _nCount.toString();
if (_local1.length < 2) {
_local1 = "0" + _local1;
}
return(_local1);
}
function set cores(_nCores) {
nCount = _nCores;
//return(cores);
}
function get cores() {
return(nCount);
}
}
Symbol 843 MovieClip [__Packages.PowerBall] Frame 0
class PowerBall
{
var mcRef, oOwner, oConfig, txtBalls, nCount, nIndex, aBalls, nSpeed;
function PowerBall (_mcRef, _oOwner, _oConfig) {
mcRef = _mcRef;
oOwner = _oOwner;
oConfig = _oConfig;
txtBalls = _global.C.oHud.mcRef.txtBalls;
nCount = 0;
nIndex = Config.Depths.Powerball.min;
addBalls(oConfig.config.basic);
aBalls = new Array();
nSpeed = oConfig.speed;
_global.C.oActionBroadcast.addListener(this);
}
function doAction() {
if (!_global.C.bPause) {
aBalls.each(doMove);
txtBalls.text = FormatNumber(nCount);
}
}
function addBalls(_nCount) {
nCount = nCount + _nCount;
}
function shoot(_object, _nX, _nY) {
if (nCount > 0) {
nCount--;
nIndex++;
if (nIndex > Config.Depths.Powerball.max) {
nIndex = Config.Depths.Powerball.min;
}
var _local4 = 0;
if (_obj.owner.oChase.hasZoey) {
_local4 = 40;
}
var _obj = new Object();
var _local3 = "mcPowerBall_" + nIndex;
mcRef.attachMovie("mcPowerBall", _local3, nIndex);
mcRef[_local3]._x = (_object._x + _nX) + _local4;
mcRef[_local3]._y = (_object._y + _nY) + 4;
mcRef[_local3].gotoAndStop("Idle");
mcRef[_local3].swapDepths((Math.floor(mcRef[_local3]._y / 75) * 1000) + nIndex);
_obj.mc = mcRef[_local3];
_obj.depth = nIndex;
_obj.speed = nSpeed;
_obj.owner = oOwner;
_obj.host = this;
_obj.direction = _global.D;
_obj.distance = 0;
_obj.exploded = false;
_obj.owner.oGhost.stopped = true;
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_powerball", 100, 1);
aBalls.push(_obj);
}
}
function doMove(_obj) {
var _local2 = 0;
var _local4 = false;
if (_obj.direction == "left") {
_local2 = -90;
} else if (_obj.direction == "right") {
_local2 = 90;
} else if (_obj.direction == "up") {
_local2 = 0;
} else if (_obj.direction == "down") {
_local2 = 180;
}
var _local8 = Math.sin(_local2 * (Math.PI/180)) * _obj.speed;
var _local7 = (Math.cos(_local2 * (Math.PI/180)) * _obj.speed) * -1;
var _local6 = _obj.mc._x + _local8;
var _local5 = _obj.mc._y + _local7;
var _local3 = _obj.owner.oCollision.getConnections(_local6, _local5, _obj.mc._width, _obj.mc._heights);
if (((_local3.left || (_local3.right)) || (_local3.top)) || (_local3.bottom)) {
_local4 = true;
}
if ((Math.floor(_obj.mc._x / 75) == Math.floor(_obj.owner.oGhost.x / 75)) && (Math.floor(_obj.mc._y / 75) == Math.floor(_obj.owner.oGhost.y / 75))) {
_obj.owner.oGhost.stuck = true;
if (_obj.host.oConfig.blowOnContact) {
_obj.exploded = true;
_obj.mc.gotoAndStop("Explode");
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_powerball_explode", 100, 1, true);
}
}
if ((_local4 || (_obj.distance >= _obj.host.oConfig.range)) && (!_obj.exploded)) {
_obj.exploded = true;
_obj.mc.gotoAndStop("Explode");
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_powerball_explode", 100, 1, true);
} else if (_obj.exploded) {
if (_obj.mc.mcState._currentframe >= _obj.mc.mcState._totalframes) {
_obj.host.clearBalls(_obj);
}
} else if ((!(_local4 || (_obj.distance >= _obj.host.oConfig.range))) && (!_obj.exploded)) {
_obj.mc._rotation = _obj.mc._rotation + 5;
_obj.distance = _obj.distance + _obj.speed;
_obj.mc._x = _local6;
_obj.mc._y = _local5;
}
_obj.mc.swapDepths((Math.floor(_obj.mc._y / 75) * 1000) + _obj.depth);
}
function glowInDark() {
aBalls.each(function (_obj) {
if (_obj.mc.getDepth() >= 45000) {
_obj.mc.swapDepths((Math.floor(_obj.mc._y / 75) * 1000) + _obj.depth);
} else {
_obj.mc.swapDepths(45000 + _obj.depth);
}
});
}
function clearBalls(_obj) {
if (_obj == undefined) {
aBalls.each(function (s) {
s.mc.removeMovieClip();
delete s.mc;
});
aBalls.splice(0);
} else {
var _local3 = aBalls.indexOf(_obj);
_obj.mc.removeMovieClip();
aBalls.splice(_local3, 1);
}
}
function FormatNumber(_nCount) {
var _local1 = _nCount.toString();
if (_local1.length < 2) {
_local1 = "0" + _local1;
}
return(_local1);
}
function stopListener() {
_global.C.oActionBroadcast.removeListener(this);
}
function set balls(_nBalls) {
nCount = _nBalls;
//return(balls);
}
function get balls() {
return(nCount);
}
}
Symbol 844 MovieClip [__Packages.Radar] Frame 0
class Radar
{
var oChase, oZoey, oGhost, mcHud, mcGhost, mcZoey, oConfig;
function Radar (_chase, _zoey, _ghost, _mcHud, _oConfig) {
oChase = _chase;
oZoey = _zoey;
oGhost = _ghost;
mcHud = _mcHud;
mcGhost = _mcHud.mcGhost;
mcZoey = _mcHud.mcZoey;
oConfig = _oConfig;
_global.C.oActionBroadcast.addListener(this);
}
function stopListener() {
_global.C.oActionBroadcast.removeListener(this);
}
function doAction() {
if (!_global.C.bPause) {
if (oZoey.mcRef == undefined) {
mcZoey._visible = false;
}
mcGhost.gotoAndStop(getAngle(oGhost));
mcZoey.gotoAndStop(getAngle(oZoey));
var _local4 = getDistance(oZoey);
if (_local4 < oConfig.zoey.large) {
mcZoey.mcArrow.gotoAndStop("Large");
} else if (_local4 < oConfig.medium) {
mcZoey.mcArrow.gotoAndStop("Medium");
} else {
mcZoey.mcArrow.gotoAndStop("Small");
}
var _local3 = getDistance(oGhost);
if (_local3 < oConfig.ghost.large) {
mcGhost.mcArrow.gotoAndStop("Large");
} else if (_local3 < oConfig.ghost.medium) {
mcGhost.mcArrow.gotoAndStop("Medium");
} else {
mcGhost.mcArrow.gotoAndStop("Small");
}
}
}
function getAngle(_oTarget) {
var _local2;
_local2 = ((Math.atan2(_oTarget.y - oChase.__get__y(), _oTarget.x - oChase.__get__x()) * 180) / Math.PI) + 90;
if (_local2 < 0) {
_local2 = 359 + _local2;
}
return(Math.floor(_local2 + 1));
}
function getDistance(_oTarget) {
var _local3;
_local3 = Math.sqrt(((_oTarget.x - oChase.__get__x()) * (_oTarget.x - oChase.__get__x())) + ((_oTarget.y - oChase.__get__y()) * (_oTarget.y - oChase.__get__y())));
return(_local3);
}
}
Symbol 845 MovieClip [__Packages.Exit] Frame 0
class Exit extends Game.State
{
var oOwner, oConfig, nIndex, aExit, bActive;
function Exit (_mcRef, _oOwner, _oConfig) {
super(undefined);
oOwner = _oOwner;
oConfig = _oConfig;
nIndex = Config.Depths.Exit.min;
aExit = new Array();
var _local4 = 0;
while (_local4 < oConfig.tile.length) {
nIndex++;
if (nIndex > Config.Depths.Exit.max) {
nIndex = Config.Depths.Exit.min;
}
_mcRef.attachMovie("mcExit", "mcExit_" + _local4, nIndex);
_mcRef["mcExit_" + _local4]._x = (75 * oConfig.tile[_local4][1]) + 37.5;
_mcRef["mcExit_" + _local4]._y = (75 * oConfig.tile[_local4][0]) + 37.5;
var _local5 = new Object();
_local5.mc = _mcRef["mcExit_" + _local4];
_local5.host = this;
_local5.owner = oOwner;
aExit.push(_local5);
_local4++;
}
_global.C.oActionBroadcast.addListener(this);
}
function doAction() {
if ((active && (oOwner.oChase.mcRef != undefined)) && (!_global.C.bPause)) {
aExit.each(function (_obj) {
_obj.mc.gotoAndStop("Active");
_obj.host.isTouched(_obj);
});
} else {
aExit.each(function (_obj) {
_obj.mc.gotoAndStop("Inactive");
});
}
}
function isTouched(_obj) {
var _local2 = _obj.owner.oChase.mcRef;
var _local3 = Math.abs(_obj.mc._y - _local2._y);
var _local4 = Math.abs(_obj.mc._x - _local2._x);
if ((_local3 <= 37.5) && (_local4 <= 37.5)) {
_obj.host.touch();
}
}
function touch() {
trace("Exitting...");
if (oOwner.oChase.sState.indexOf("Up") > -1) {
oOwner.oChase.setState("IdleUp");
} else if (oOwner.sState.indexOf("Down") > -1) {
oOwner.oChase.setState("IdleDown");
} else {
oOwner.oChase.setState("Idle");
}
oOwner.endLevel();
}
function clearExit(_obj) {
if (_obj == undefined) {
aExit.each(function (_obj) {
_obj.mc.removeMovieClip();
delete _obj.mc;
});
aExit.splice(0);
} else {
var _local3 = aExit.indexOf(_obj);
_obj.mc.removeMovieClip();
aExit.splice(_local3, 1);
}
}
function stopListener() {
_global.C.oActionBroadcast.removeListener(this);
}
function selectExits() {
trace("this.oConfig.count: " + oConfig.count);
aExit.each(function (_obj) {
var _local2 = Math.sqrt(((_obj.mc._x - _obj.owner.oZoey.x) * (_obj.mc._x - _obj.owner.oZoey.x)) + ((_obj.mc._y - _obj.owner.oZoey.y) * (_obj.mc._y - _obj.owner.oZoey.y)));
if (_local2 < _obj.host.oConfig.distanceFromZoey) {
_obj.host.clearExit(_obj);
}
});
while (aExit.length > oConfig.count) {
var _local2 = aExit.getRandom();
clearExit(_local2);
}
trace("Number of exit: " + aExit.length);
}
function get active() {
return(bActive);
}
function set active(_bool) {
bActive = _bool;
//return(active);
}
}
Symbol 846 MovieClip [__Packages.Events] Frame 0
class Events
{
var mcRef, oOwner, oConfig, bLightning, nFrsLight, nFrsLightInterval, nScared, bActive;
function Events (_mcRef, _oOwner, _oConfig) {
mcRef = _mcRef;
oOwner = _oOwner;
oConfig = _oConfig;
bLightning = false;
nFrsLight = 0;
nFrsLightInterval = -1;
nScared = 0;
_global.C.oHud.mcRef.mcLightning.gotoAndStop(1);
_global.C.oHud.mcRef.mcLightning.swapDepths(Config.Depths.Lightning);
_global.C.oHud.mcRef.mcLightning._visible = false;
_global.C.oActionBroadcast.addListener(this);
}
function doLightning() {
if (bLightning) {
if (_global.C.oHud.mcRef.mcLightning._currentframe == _global.C.oHud.mcRef.mcLightning._totalframes) {
bLightning = false;
_global.C.oHud.mcRef.mcLightning._visible = false;
_global.C.oHud.mcRef.mcLightning.gotoAndStop(1);
if (!oOwner.oBlackOut.inBlackOut) {
oOwner.oBlackOut.doBlackOut(getRandom(oConfig.powerFailure.max, oConfig.powerFailure.min) * 35);
}
nFrsLightInterval = -1;
nScared++;
if (nScared == 2) {
oOwner.oChase.scared = true;
Library.Sound.SoundManager.doPlaySoundInCat("SFX", "sSfx_panic_low", 100, 1, true);
nScared = 0;
}
}
} else {
bLightning = true;
_global.C.oHud.mcRef.mcLightning._visible = true;
_global.C.oHud.mcRef.mcLightning.play();
nFrsLight = 0;
}
}
function doAction() {
if (bActive && (!_global.C.bPause)) {
if (bLightning) {
doLightning();
} else {
if (nFrsLightInterval < 0) {
nFrsLightInterval = getRandom(oConfig.Lightning.interval.max, oConfig.Lightning.interval.min) * 35;
}
nFrsLight++;
if (nFrsLight >= nFrsLightInterval) {
nFrsLight = 0;
doLightning();
}
}
}
}
function getRandom(_nMax, _nMin) {
var _local1;
_local1 = Math.floor(Math.random() * ((_nMax - _nMin) + 1)) + _nMin;
return(_local1);
}
function get active() {
return(bActive);
}
function set active(_bool) {
bActive = _bool;
//return(active);
}
}
Symbol 847 MovieClip [__Packages.BlackOut] Frame 0
class BlackOut extends Game.State
{
var mcRef, setState, oOwner, nFrames, nCurFrames, isStateFinished, bInBlackOut;
function BlackOut (_mcRef, _oOwner) {
super(undefined);
_mcRef.attachMovie("mcBlackout", "mcBlackout", Config.Depths.BlackOut);
mcRef = _mcRef.mcBlackout;
setState("None");
oOwner = _oOwner;
}
function doAction() {
super.doAction();
if (!_global.C.bPause) {
x = (oOwner.oChase.x);
y = (oOwner.oChase.y);
}
}
function doBlackOut(_nFrames) {
inBlackOut = (true);
nFrames = _nFrames;
trace("_nFrames: " + _nFrames);
nCurFrames = 0;
setState("In");
}
function stopListener() {
_global.C.oActionBroadcast.removeListener(this);
}
function Idle() {
nCurFrames++;
mcRef._visible = false;
if (nCurFrames >= nFrames) {
setState("Out");
}
}
function In() {
var oColor = (new flash.geom.ColorTransform());
oColor.blueMultiplier = 0.2;
oColor.greenMultiplier = 0.2;
oColor.redMultiplier = 0.2;
var oTrans;
_global.C.Mazes.each(function (_mc) {
oTrans = new flash.geom.Transform(_mc);
oTrans.colorTransform = oColor;
});
mcRef._visible = false;
if (isStateFinished()) {
setState("Idle");
}
}
function Out() {
if ((((mcRef.mcState._currentframe == 1) || (mcRef.mcState._currentframe == 5)) || (mcRef.mcState._currentframe == 12)) || (mcRef.mcState._currentframe == 15)) {
var oColor = (new flash.geom.ColorTransform());
oColor.blueMultiplier = 1;
oColor.greenMultiplier = 1;
oColor.redMultiplier = 1;
var oTrans;
_global.C.Mazes.each(function (_mc) {
oTrans = new flash.geom.Transform(_mc);
oTrans.colorTransform = oColor;
});
} else if (((mcRef.mcState._currentframe == 3) || (mcRef.mcState._currentframe == 9)) || (mcRef.mcState._currentframe == 14)) {
var oColor = (new flash.geom.ColorTransform());
oColor.blueMultiplier = 0.2;
oColor.greenMultiplier = 0.2;
oColor.redMultiplier = 0.2;
var oTrans;
_global.C.Mazes.each(function (_mc) {
oTrans = new flash.geom.Transform(_mc);
oTrans.colorTransform = oColor;
});
}
mcRef._visible = false;
if (isStateFinished()) {
inBlackOut = (false);
setState("None");
}
}
function None() {
}
function get x() {
return(mcRef._x);
}
function get y() {
return(mcRef._y);
}
function get inBlackOut() {
return(bInBlackOut);
}
function set x(_nX) {
mcRef._x = _nX;
//return(x);
}
function set y(_nY) {
mcRef._y = _nY;
//return(y);
}
function set inBlackOut(_bool) {
bInBlackOut = _bool;
//return(inBlackOut);
}
}
Symbol 848 MovieClip [__Packages.Toggler] Frame 0
class Toggler
{
var bQ, bW, bE, bR, bT, bY, bU, bI, bO, bP, bPowers, bZoey, bGhost, bChase, bBlackout, bMapDoors, bDoors, bMazes, bHud, bAll;
function Toggler () {
bQ = false;
bW = false;
bE = false;
bR = false;
bT = false;
bY = false;
bU = false;
bI = false;
bO = false;
bP = false;
bPowers = true;
bZoey = true;
bGhost = true;
bChase = true;
bBlackout = true;
bMapDoors = true;
bDoors = true;
bMazes = true;
bHud = true;
bAll = true;
trace("Toggler created.");
_global.C.oActionBroadcast.addListener(this);
}
function doAction() {
if (Key.isDown(81) && (!bQ)) {
bQ = true;
bPowers = !bPowers;
_global.C.Powers.each(function (a) {
if (a._visible == false) {
a._visible = true;
} else {
a._visible = false;
}
});
trace("Toggle Powers");
} else if (!Key.isDown(81)) {
bQ = false;
}
if (Key.isDown(87) && (!bW)) {
bW = true;
bZoey = !bZoey;
_global.C.Zoey.each(function (a) {
if (a._visible == false) {
a._visible = true;
} else {
a._visible = false;
}
});
trace("Toggle Zoey");
} else if (!Key.isDown(87)) {
bW = false;
}
if (Key.isDown(69) && (!bE)) {
bE = true;
bGhost = !bGhost;
_global.C.Ghost.each(function (a) {
if (a._visible == false) {
a._visible = true;
} else {
a._visible = false;
}
});
trace("Toggle Ghost");
} else if (!Key.isDown(69)) {
bE = false;
}
if (Key.isDown(82) && (!bR)) {
bR = true;
bChase = !bChase;
_global.C.Chase.each(function (a) {
if (a._visible == false) {
a._visible = true;
} else {
a._visible = false;
}
});
trace("Toggle Chase");
} else if (!Key.isDown(82)) {
bR = false;
}
if (Key.isDown(84) && (!bT)) {
bT = true;
bBlackout = !bBlackout;
_global.C.Blackout.each(function (a) {
if (a._visible == false) {
a._visible = true;
} else {
a._visible = false;
}
});
trace("Toggle Blackout");
} else if (!Key.isDown(84)) {
bT = false;
}
if (Key.isDown(89) && (!bY)) {
bY = true;
bMapDoors = !bMapDoors;
_global.C.MapDoors.each(function (a) {
if (a._visible == false) {
a._visible = true;
} else {
a._visible = false;
}
});
trace("Toggle MapDoors");
} else if (!Key.isDown(89)) {
bY = false;
}
if (Key.isDown(85) && (!bU)) {
bU = true;
bDoors = !bDoors;
_global.C.Doors.each(function (a) {
if (a._visible == false) {
a._visible = true;
} else {
a._visible = false;
}
});
trace("Toggle Doors");
} else if (!Key.isDown(85)) {
bU = false;
}
if (Key.isDown(73) && (!bI)) {
bI = true;
bMazes = !bMazes;
_global.C.Mazes.each(function (a) {
if (a._visible == false) {
a._visible = true;
} else {
a._visible = false;
}
});
trace("Toggle Mazes");
} else if (!Key.isDown(73)) {
bI = false;
}
if (Key.isDown(79) && (!bO)) {
bO = true;
bHud = !bHud;
_global.C.Hud.each(function (a) {
if (a._visible == false) {
a._visible = true;
} else {
a._visible = false;
}
});
trace("Toggle Hud");
} else if (!Key.isDown(79)) {
bO = false;
}
if (Key.isDown(80) && (!bP)) {
bP = true;
bAll = !bAll;
_global.C.All.each(function (a) {
if (a._visible == false) {
a._visible = true;
} else {
a._visible = false;
}
});
trace("Toggle All");
} else if (!Key.isDown(80)) {
bP = false;
}
}
}
Symbol 80 MovieClip Frame 1
stop();
Instance of Symbol 80 MovieClip "mcStretcher" in Symbol 81 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._currentframe < 10) {
if (this.mcState._currentframe >= this.mcState._totalframes) {
this.gotoAndStop("Idle");
}
} else if (this._currentframe < 20) {
if (_parent.txtPercent.text == "100") {
this.gotoAndStop("Out");
}
} else if (this._currentframe < 30) {
if (this.mcState._currentframe >= this.mcState._totalframes) {
this._visible = false;
_parent._parent.gotoAndStop("Title");
}
}
}
Symbol 115 MovieClip [mcLightning] Frame 1
_global.P.oSnd.Thunder();
Symbol 115 MovieClip [mcLightning] Frame 13
stop();
Symbol 258 MovieClip [mcPowerBall] Frame 1
stop();
Symbol 376 MovieClip [mcLooseAnim] Frame 1
stop();
Symbol 376 MovieClip [mcLooseAnim] Frame 86
stop();
Symbol 383 MovieClip [mcMapDoors] Frame 1
stop();
Symbol 408 MovieClip Frame 1
stop();
Symbol 408 MovieClip Frame 2
gotoAndStop (1);
Symbol 456 MovieClip Frame 35
stop();
Symbol 459 MovieClip Frame 2
_global.P.oSnd.Thunder();
Symbol 459 MovieClip Frame 13
stop();
Symbol 468 MovieClip Frame 15
stop();
Symbol 472 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oTransit.goTo("Story");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 486 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oTransit.goTo("Instruct");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 491 Button
on (release) {
var gname = "Zoey101V2PC";
var gscore = _global.P.nScore;
getURL ("index.php?act=Arcade&do=newscore", "_self", "POST");
}
Instance of Symbol 459 MovieClip in Symbol 492 MovieClip Frame 1
onClipEvent (load) {
this.stop();
var nTimer = getTimer();
}
onClipEvent (enterFrame) {
if ((getTimer() - nTimer) >= 10000) {
this.nTimer = getTimer();
this.gotoAndPlay(1);
}
}
Symbol 505 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oTransit.goTo("InGameInstructP1");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 513 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oPopUp.bOpenQuit = false;
_global.P.oPopUp.setClose();
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 526 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.doMute("music");
gotoAndStop ("Off");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 529 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.doUnmute("music");
gotoAndStop ("On");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 530 MovieClip Frame 1
if (_global.P.isMuted("music")) {
gotoAndStop ("Off");
} else {
gotoAndStop ("On");
}
Symbol 533 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.doMute("SFX");
gotoAndStop ("Off");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 534 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.doUnmute("SFX");
gotoAndStop ("On");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 535 MovieClip Frame 1
if (_global.P.isMuted("SFX")) {
gotoAndStop ("Off");
} else {
gotoAndStop ("On");
}
Symbol 541 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oPopUp.bOpenQuit = true;
_global.P.oPopUp.setClose();
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 557 MovieClip Frame 30
stop();
Symbol 564 MovieClip Frame 1
stop();
Symbol 564 MovieClip Frame 49
stop();
Symbol 593 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
this.gotoAndStop("P2");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 594 MovieClip Frame 30
stop();
Symbol 612 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
this.gotoAndStop("P1");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 613 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oTransit.goTo("InGameMenu");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 614 MovieClip Frame 1
stop();
Symbol 640 MovieClip Frame 21
stop();
Symbol 641 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oPopUp.bOpenQuit = false;
_global.P.oPopUp.bQuitGame = true;
_global.P.oPopUp.bOpenMenu = false;
_global.P.oPopUp.setClose();
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 642 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oPopUp.bOpenMenu = true;
_global.P.oPopUp.setClose();
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 643 MovieClip Frame 1
stop();
Symbol 644 MovieClip Frame 1
Symbol 644 MovieClip Frame 21
stop();
Symbol 645 MovieClip Frame 1
nextFrame();
Symbol 661 MovieClip Frame 1
nextFrame();
Symbol 661 MovieClip Frame 10
LockBtn.useHandCursor = false;
Symbol 661 MovieClip Frame 20
LockBtn.useHandCursor = false;
Symbol 661 MovieClip Frame 30
LockBtn.useHandCursor = false;
Symbol 666 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oTransit.goTo("Story");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 667 MovieClip Frame 1
stop();
Symbol 674 MovieClip Frame 220
stop();
Symbol 686 MovieClip Frame 185
stop();
Symbol 687 MovieClip Frame 11
stop();
Symbol 692 MovieClip Frame 157
stop();
Symbol 694 MovieClip Frame 53
stop();
Symbol 698 MovieClip Frame 682
stop();
_global.P.oTransit.goTo("Game");
Symbol 703 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oTransit.goTo("Game");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 713 MovieClip Frame 26
stop();
Symbol 714 MovieClip Frame 21
stop();
Symbol 715 MovieClip Frame 14
stop();
Symbol 734 Button
on (release) {
_global.P.doPlayClick();
_global.P.oPopUp.setOpen("Menu", true);
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 735 MovieClip Frame 1
_global.C.fCreateHud(this);
Instance of Symbol 410 MovieClip "Controller" in Symbol 736 MovieClip Frame 1
onClipEvent (load) {
_global.C = new GameController(this);
_global.C.initController();
}
Symbol 744 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oTransit.goTo("Game");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 754 MovieClip Frame 1
txtLevel.text = ("Level " + _global.P.nLevel) + " completed :";
txtLevelCompletedScore.text = _global.P.nLevelCompletedScore;
txtPowerballScore.text = (_global.P.nPowerballs + " X ") + _global.P.nPowerballsScore;
txtAppleCoresScore.text = (_global.P.nAppleCores + " X ") + _global.P.nAppleCoresScore;
txtLevelScore.text = _global.P.fFormatNumber(_global.P.nLevelScore);
txtTotalScore.text = _global.P.fFormatNumber(_global.P.nScore);
_global.P.levelUp();
stop();
Symbol 759 MovieClip Frame 1
txtScore.text = _global.P.fFormatNumber(_global.P.nScore);
Symbol 760 MovieClip Frame 32
stop();
Symbol 767 Button
on (release) {
var gname = "Zoey101V2PC";
var gscore = _global.P.nScore;
getURL ("index.php?act=Arcade&do=newscore", "_self", "POST");
}
Symbol 772 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.resetParam();
_global.P.oTransit.goTo("Title");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 777 Button
on (release) {
var gname = "Zoey101V2PC";
var gscore = _global.P.nScore;
getURL ("index.php?act=Arcade&do=newscore", "_self", "POST");
}
Symbol 778 MovieClip Frame 1
if (gProxyObj.getIsLoggedIn() && (_global.P.nScore > 0)) {
btnSubmit._visible = true;
} else {
btnSubmit._visible = true;
}
Instance of Symbol 459 MovieClip in Symbol 778 MovieClip Frame 1
onClipEvent (load) {
this.stop();
var nTimer = getTimer();
}
onClipEvent (enterFrame) {
if ((getTimer() - nTimer) >= 10000) {
this.nTimer = getTimer();
this.gotoAndPlay(1);
}
}
Symbol 781 MovieClip Frame 30
stop();
Symbol 791 Button
on (press) {
_parent._parent._parent.ControlScroll.scrollUp = true;
}
on (release, releaseOutside) {
_parent._parent._parent.ControlScroll.scrollUp = false;
}
Symbol 792 Button
on (press) {
_parent._parent._parent.ControlScroll.scrollDown = true;
}
on (release, releaseOutside) {
_parent._parent._parent.ControlScroll.scrollDown = false;
}
Symbol 795 MovieClip Frame 45
this.mcBoard.txtNumber.text = _parent._parent.txtNumber.text;
this.mcBoard.txtName.text = _parent._parent.txtName.text;
this.mcBoard.txtScore.text = _parent._parent.txtScore.text;
Symbol 795 MovieClip Frame 65
this.mcBoard.txtNumber.text = _parent._parent.txtNumber.text;
this.mcBoard.txtName.text = _parent._parent.txtName.text;
this.mcBoard.txtScore.text = _parent._parent.txtScore.text;
stop();
Symbol 797 MovieClip Frame 55
stop();
Symbol 800 Button
on (release) {
var gname = "Zoey101V2PC";
var gscore = _global.P.nScore;
getURL ("index.php?act=Arcade&do=newscore", "_self", "POST");
}
Symbol 801 Button
on (release, releaseOutside) {
_global.P.doPlayClick();
_global.P.oTransit.goTo("Title");
}
on (rollOver) {
_global.P.doPlayRollOver();
}
Symbol 802 MovieClip Frame 97
if (_global.P.sSubmitFrom == "Title") {
btnBack._visible = true;
btnPlayAgain._visible = false;
} else {
btnBack._visible = false;
btnPlayAgain._visible = true;
}
Symbol 802 MovieClip Frame 116
stop();
Symbol 808 MovieClip Frame 1
txtScore.text = _global.P.fFormatNumber(_global.P.nScore);
Symbol 809 MovieClip Frame 48
stop();
Symbol 814 MovieClip Frame 1
if (_global.P.sSubmitFrom == "Title") {
btnSubmit._visible = true;
mcScore._visible = true;
HighScores.requestScores();
HighScores.onSuccess = function () {
HighScores.populateFields(txtNumber, txtName, txtScore);
};
} else if (_global.P.sSubmitFrom == "EndScr") {
btnBack._visible = false;
if (gProxyObj.getIsLoggedIn() && (_global.P.nScore > 0)) {
btnSubmit._visible = true;
} else {
btnSubmit._visible = true;
}
if (_global.P.bSubmitScore) {
HighScores.submitScore(_global.P.nScore);
HighScores.onSuccess = function () {
HighScores.requestScores();
HighScores.onSuccess = function () {
HighScores.populateFields(txtNumber, txtName, txtScore);
};
};
btnSubmit._visible = true;
} else {
HighScores.requestScores();
HighScores.onSuccess = function () {
HighScores.populateFields(txtNumber, txtName, txtScore);
};
}
}
Instance of Symbol 805 MovieClip "ControlScroll" in Symbol 814 MovieClip Frame 1
onClipEvent (load) {
scrollUp = false;
scrollDown = false;
}
onClipEvent (enterFrame) {
if (scrollUp == true) {
_parent.mcHighScore.mcTable.mcBoard.txtName.scroll--;
_parent.mcHighScore.mcTable.mcBoard.txtScore.scroll--;
_parent.mcHighScore.mcTable.mcBoard.txtNumber.scroll--;
} else if (scrollDown == true) {
_parent.mcHighScore.mcTable.mcBoard.txtName.scroll++;
_parent.mcHighScore.mcTable.mcBoard.txtScore.scroll++;
_parent.mcHighScore.mcTable.mcBoard.txtNumber.scroll++;
}
}