Frame 1
var _oPreloaderScreen = (new com.disney.gem.games.pizza_toss.screens.PreloaderScreen(mcScreens.mcPreloader));
com.sarbakan.BaseDisneyController.bDEBUG = false;
new com.disney.gem.games.pizza_toss.Controller(this, _oPreloaderScreen);
Symbol 2110 MovieClip [__Packages.com.sarbakan.BaseDisneyController] Frame 0
class com.sarbakan.BaseDisneyController
{
static var oInstance;
var mcTimeline, oPreloaderScreen, oMainBroadcaster, oFrameRate, aPopups, oTransitionManager, bSoundMuted, nLastSoundToggleTimer, bPaused, oDXDControllerWrapper, nGamePhase, oCurrentScreen, fScreenShowTransitionCallBack, fScreenHideCallBack, nLevel, nScore, bInstructionCanBeDisplayed, bInstructionActive, nLastUpdateTimer;
function BaseDisneyController (_mcTimeline, _oPreloaderScreen) {
oInstance = this;
mcTimeline = _mcTimeline;
_mcTimeline.stop();
oPreloaderScreen = _oPreloaderScreen;
oMainBroadcaster = new Object();
AsBroadcaster.initialize(oMainBroadcaster);
oMainBroadcaster.addListener(this);
if (bDEBUG) {
oFrameRate = new com.sarbakan.utils.FrameRateDisplayer(_mcTimeline, nFRAME_RATE, nGAME_STAGE_WIDTH);
oMainBroadcaster.addListener(oFrameRate);
} else {
Stage.showMenu = false;
mcTimeline._focusrect = false;
}
aPopups = new Array();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
setDXDCallback();
} else {
initStandAloneController();
}
}
static function getInstance() {
return(oInstance);
}
function init() {
setGamePhase(nGAME_PHASE_PACKAGING);
stopScreenContainers();
oTransitionManager = new com.sarbakan.utils.TransitionManager(mcTimeline.mcTransitions);
oMainBroadcaster.addListener(oTransitionManager);
bSoundMuted = false;
nLastSoundToggleTimer = getTimer();
}
function update(_nElapsed) {
if (bPaused) {
oMainBroadcaster.broadcastMessage("onUpdatePaused", _nElapsed);
} else {
oMainBroadcaster.broadcastMessage("onUpdate", _nElapsed);
}
checkGlobalKeys();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
bSoundMuted = oDXDControllerWrapper.isMuted();
}
}
function pause() {
if (!bPaused) {
bPaused = true;
oMainBroadcaster.broadcastMessage("onPause");
}
}
function unpause() {
if (bPaused) {
bPaused = false;
oMainBroadcaster.broadcastMessage("onUnPause");
}
}
function togglePause() {
if (bPaused) {
unpause();
} else {
pause();
}
}
function getControllerMode() {
if (com.disney.gem.base.BaseObject == undefined) {
var _local2 = nCONTROLLER_MODE_STANDALONE;
} else {
var _local2 = nCONTROLLER_MODE_DXD;
}
return(_local2);
}
function setGamePhase(_nPhase) {
nGamePhase = _nPhase;
switch (_nPhase) {
case nGAME_PHASE_PRELOADER :
mcTimeline.gotoAndStop("preloader");
break;
case nGAME_PHASE_PACKAGING :
mcTimeline.gotoAndStop("packaging");
break;
case nGAME_PHASE_INGAME :
mcTimeline.gotoAndStop("game");
}
}
function getGamePhase() {
return(nGamePhase);
}
function gameLog(_sText) {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.gameLog(_sText);
} else {
org.flashdevelop.utils.FlashConnect.trace(_sText, "com.sarbakan.BaseDisneyController::gameLog", "S:\\00738_32_WDIG_Goofy_Pizza_Toss\\4-Production\\Prog\\Integration\\080522\\Pizza Toss\\src/com/sarbakan/BaseDisneyController.as", 314);
}
}
function showScreen(_oScreenController, _bInOut, _sTransitionID, _fMidTransitionCallBack) {
if (oCurrentScreen) {
hideCurrentScreen(com.sarbakan.utils.Delegate.create(this, showScreen, _oScreenController, _bInOut, null, _fMidTransitionCallBack), _sTransitionID);
} else {
oCurrentScreen = _oScreenController;
oCurrentScreen.setGameController(this);
if (_sTransitionID != undefined) {
fScreenShowTransitionCallBack = _fMidTransitionCallBack;
oTransitionManager.playTransition(_sTransitionID, com.sarbakan.utils.Delegate.create(this, onScreenShowTransitionMiddle, _bInOut));
} else {
oCurrentScreen.show(_bInOut);
_fMidTransitionCallBack();
}
oMainBroadcaster.addListener(oCurrentScreen);
}
}
function hideCurrentScreen(_fHideCallBack, _sTransition, _fEndCallBack) {
fScreenHideCallBack = _fHideCallBack;
if (_sTransition != undefined) {
oTransitionManager.playTransition(_sTransition, com.sarbakan.utils.Delegate.create(oCurrentScreen, oCurrentScreen.hide, com.sarbakan.utils.Delegate.create(this, onScreenHidden)), _fEndCallBack);
} else {
oCurrentScreen.hide(com.sarbakan.utils.Delegate.create(this, onScreenHidden));
}
}
function showPopup(_oPopupController, _bInOut) {
var _local4 = false;
var _local5 = aPopups.length - 1;
for ( ; _local5 >= 0 ; _local5--) {
var _local6 = aPopups[_local5];
if (_oPopupController.getRef() == _local6.getRef()) {
_local4 = true;
_local6.destroy();
oMainBroadcaster.removeListener(_local6);
aPopups[_local5] = _oPopupController;
break;
}
}
if (!_local4) {
aPopups.push(_oPopupController);
}
_oPopupController.setGameController(this);
_oPopupController.show(_bInOut);
oMainBroadcaster.addListener(_oPopupController);
}
function setLevel(_nLevel) {
nLevel = _nLevel;
}
function getLevel() {
return(nLevel);
}
function setScore(_nScore) {
nScore = _nScore;
}
function increaseScore(_nIncrement) {
nScore = nScore + _nIncrement;
}
function getScore() {
return(nScore);
}
function allowInstructions() {
bInstructionCanBeDisplayed = true;
}
function disallowInstructions() {
bInstructionCanBeDisplayed = false;
}
function showInstructions() {
if (canShowInstructions()) {
bInstructionActive = true;
showInstructionsScreen();
}
}
function hideInstructions() {
if (canHideInstructions()) {
bInstructionActive = false;
hideInstructionsScreen();
}
}
function toggleSound() {
if ((getTimer() - nLastSoundToggleTimer) >= nSOUND_TOGGLE_DELAY) {
bSoundMuted = !bSoundMuted;
nLastSoundToggleTimer = getTimer();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.toggleSound();
} else {
toggleSoundStandalone();
}
}
}
function onPreloadingDone() {
hideCurrentScreen();
init();
}
function onGameStart() {
setLevel(1);
setScore(0);
}
function onLevelStart() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.startLevel(nLevel, nScore);
}
}
function onLevelEnd() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.endLevel(nLevel, nScore);
}
}
function onGameEnd() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.endGame(nLevel, nScore);
}
}
function onTransitionStart(_mcTransition) {
}
function onTransitionMiddle(_mcTransition) {
}
function onEnterFrame() {
var _local2 = getTimer();
update(_local2 - nLastUpdateTimer);
nLastUpdateTimer = _local2;
}
function onScreenShowTransitionMiddle(_bInOut) {
fScreenShowTransitionCallBack();
oCurrentScreen.show(_bInOut);
}
function onScreenHidden() {
oMainBroadcaster.removeListener(oCurrentScreen);
delete oCurrentScreen;
fScreenHideCallBack();
}
function setDXDCallback() {
mcTimeline.init = com.sarbakan.utils.Delegate.create(this, initDXDController);
}
function initDXDController(_oOwner) {
oDXDControllerWrapper = new com.sarbakan.DXDControllerWrapper(this, mcTimeline, _oOwner);
return(oDXDControllerWrapper);
}
function initStandAloneController() {
mcTimeline.onEnterFrame = com.sarbakan.utils.Delegate.create(this, onEnterFrame);
nLastUpdateTimer = getTimer();
initPreloader();
}
function initPreloader() {
setGamePhase(nGAME_PHASE_PRELOADER);
showScreen(oPreloaderScreen);
}
function checkGlobalKeys() {
if (Key.isDown(nKEY_INSTRUCTIONS)) {
if (!bInstructionActive) {
showInstructions();
} else {
hideInstructions();
}
}
if (Key.isDown(nKEY_SOUND)) {
toggleSound();
}
}
function toggleSoundStandalone() {
var _local2 = new Sound(mcTimeline);
if (!bSoundMuted) {
_local2.setVolume(100);
} else {
_local2.setVolume(0);
}
}
function canShowInstructions() {
return((!bInstructionActive) && (bInstructionCanBeDisplayed && ((!oCurrentScreen.isInOutTransitionning()) && (!oTransitionManager.isTransitionning()))));
}
function canHideInstructions() {
return(bInstructionActive && (bInstructionCanBeDisplayed && ((!oCurrentScreen.isInOutTransitionning()) && (!oTransitionManager.isTransitionning()))));
}
function showInstructionsScreen() {
}
function hideInstructionsScreen() {
}
function stopScreenContainers() {
var _local2 = [mcTimeline.mcPopups, mcTimeline.mcScreens];
var _local3 = _local2.length - 1;
for ( ; _local3 >= 0 ; _local3--) {
for (var j in _local2[_local3]) {
_local2[_local3][j].stop();
}
}
}
static var bDEBUG = true;
static var nFRAME_RATE = 30;
static var nCONTROLLER_MODE_STANDALONE = 1;
static var nCONTROLLER_MODE_DXD = 2;
static var nGAME_PHASE_PRELOADER = 1;
static var nGAME_PHASE_PACKAGING = 2;
static var nGAME_PHASE_INGAME = 3;
static var nKEY_INSTRUCTIONS = 72;
static var nKEY_SOUND = 77;
static var nGAME_STAGE_WIDTH = 580;
static var nGAME_STAGE_HEIGHT = 400;
static var nSOUND_TOGGLE_DELAY = 100;
}
Symbol 2111 MovieClip [__Packages.com.sarbakan.utils.StateManaged] Frame 0
class com.sarbakan.utils.StateManaged
{
var mcRef, bPausable, sNextState, sState;
function StateManaged (_mcRef) {
setMC(_mcRef);
setPausable(true);
}
function setMC(_mcRef) {
mcRef = _mcRef;
}
function setPausable(_bPausable) {
bPausable = _bPausable;
}
function setState(_sState, _bInstant, _bForce) {
sNextState = _sState;
if (_bInstant) {
checkStateChange();
}
if (_bForce) {
mcRef.mcState.gotoAndPlay(1);
}
}
function getState() {
return(sState);
}
function stateStarting() {
return(mcRef.mcState._currentframe == 1);
}
function stateFinished() {
return(mcRef.mcState._currentframe == mcRef.mcState._totalframes);
}
function stateCurrentFrame() {
return(mcRef.mcState._currentframe);
}
function stateIsNot() {
var _local2 = false;
var _local3 = arguments.length - 1;
for ( ; _local3 >= 0 ; _local3--) {
if (arguments[_local3] == sState) {
_local2 = true;
break;
}
}
return(!_local2);
}
function destroy() {
delete mcRef;
}
function get Mc() {
return(mcRef);
}
function onUpdate() {
checkStateChange();
this["state_" + sState]();
}
function checkStateChange() {
if ((sNextState != undefined) && (sNextState != sState)) {
this[("state_" + sState) + "_end"]();
sState = sNextState;
sNextState = undefined;
mcRef.gotoAndStop(sState);
this[("state_" + sState) + "_init"]();
}
}
function onUpdatePaused() {
if (bPausable == false) {
onUpdate();
}
}
function onPause() {
if (bPausable) {
mcRef.mcState.stop();
}
}
function onUnPause() {
if (bPausable) {
mcRef.mcState.play();
}
}
}
Symbol 2112 MovieClip [__Packages.com.sarbakan.utils.TransitionManager] Frame 0
class com.sarbakan.utils.TransitionManager extends com.sarbakan.utils.StateManaged
{
var setPausable, mcTransitionContainer, mcTransition, fMiddleCallBack, fEndCallBack, bTransitionning, setMC, setState, stateFinished, mcRef;
function TransitionManager (_mcTransition) {
super();
setPausable(false);
mcTransitionContainer = _mcTransition;
for (var i in mcTransitionContainer) {
mcTransitionContainer[i].stop();
}
}
function playTransition(_sTransitionID, _fMiddleCallBack, _fEndCallBack) {
mcTransition = mcTransitionContainer["mc" + com.sarbakan.utils.MoreString.upperFirstChar(_sTransitionID)];
fMiddleCallBack = _fMiddleCallBack;
fEndCallBack = _fEndCallBack;
if (mcTransition == undefined) {
org.flashdevelop.utils.FlashConnect.trace(("TransitionManager error: Unable to find mc" + com.sarbakan.utils.MoreString.upperFirstChar(_sTransitionID)) + " in transition movieclip", "com.sarbakan.utils.TransitionManager::playTransition", "S:\\00738_32_WDIG_Goofy_Pizza_Toss\\4-Production\\Prog\\Integration\\080522\\Pizza Toss\\src/com/sarbakan/utils/TransitionManager.as", 77);
} else {
bTransitionning = true;
setMC(mcTransition);
setState(sSTATE_IN);
}
}
function isTransitionning() {
return(bTransitionning);
}
function state_in() {
if (stateFinished()) {
setState(sSTATE_OUT);
fMiddleCallBack();
}
}
function state_out() {
if (stateFinished()) {
bTransitionning = false;
setState(sSTATE_HIDDEN);
fEndCallBack();
}
}
function state_in_init() {
com.sarbakan.BaseDisneyController.getInstance().onTransitionStart(mcTransition);
mcRef.btBlocker.useHandCursor = false;
}
function state_out_init() {
com.sarbakan.BaseDisneyController.getInstance().onTransitionMiddle(mcTransition);
mcRef.btBlocker.useHandCursor = false;
}
static var sSTATE_IN = "in";
static var sSTATE_OUT = "out";
static var sSTATE_HIDDEN = "hidden";
}
Symbol 2113 MovieClip [__Packages.com.sarbakan.utils.MoreString] Frame 0
class com.sarbakan.utils.MoreString
{
function MoreString () {
}
static function pad(_sToPad, _sCharPad, _nMinLength, _sSideToPad) {
var _local6 = String(_sToPad);
while (_local6.length < _nMinLength) {
if (_sSideToPad == "RIGHT") {
_local6 = _local6 + _sCharPad;
} else {
_local6 = _sCharPad + _local6;
}
}
return(_local6);
}
static function trim(_sToTrim, _sCharTrim, _sSideToTrim) {
var _local5 = String(_sToTrim);
if (_sSideToTrim == "RIGHT") {
while (_local5.substr(_local5.length - 2, 1) == _sCharTrim) {
_local5 = _local5.slice(-1);
}
} else {
while (_local5.substr(0, 1) == _sCharTrim) {
_local5 = _local5.slice(1);
}
}
return(_local5);
}
static function replace(_sString, _sFind, _sReplace) {
return(_sString.split(_sFind).join(_sReplace));
}
static function formatTime(_nTime) {
var _local3 = _nTime;
var _local4 = Math.floor(_local3 / 60);
var _local5 = Math.round(_local3 - (_local4 * 60));
return((pad(String(_local4), "0", 2) + ":") + pad(String(_local5), "0", 2));
}
static function formatNumber(__sNumber, __nMinimumChar) {
var _local4 = String(__sNumber);
var _local5 = "";
var _local6 = _local4.length;
_local6 = _local6 / 3;
if (_local6 <= 1) {
var _local7 = _local4;
if (_local7.length < __nMinimumChar) {
_local7 = "0" + _local7;
}
} else {
var _local8 = _local6;
for ( ; _local8 > 1 ; _local8--) {
_local5 = (" " + _local4.substr(-3)) + _local5;
_local4 = _local4.substr(0, -3);
}
var _local7 = _local4 + _local5;
if (_local7.length < __nMinimumChar) {
_local7 = "0" + _local7;
}
}
return(_local7);
}
static function upperFirstChar(_sString) {
return(_sString.substr(0, 1).toUpperCase() + _sString.substr(1));
}
static function lowerFirstChar(_sString) {
return(_sString.substr(0, 1).toLowerCase() + _sString.substr(1));
}
static function convertToBoolean(_sString) {
return(_sString.toLowerCase() == "true");
}
static function formatMoney(_nMoney, _sDelimiteur, _bDecimalOpt) {
if (_bDecimalOpt == undefined) {
var _local9 = true;
} else {
var _local9 = _bDecimalOpt;
}
var _local5 = String(_nMoney).split(".");
if (_local5[1] != undefined) {
var _local6 = _local5[1].substr(0, 2);
switch (_local6.length) {
case 0 :
_local6 = _local6 + "00";
break;
case 1 :
_local6 = _local6 + "0";
break;
case 2 :
break;
default :
_local6 = "00";
}
} else {
var _local6 = "00";
}
var _local8 = _local5[0];
var _local7 = "";
while (_local8.length > 3) {
_local7 = (_sDelimiteur + _local8.substr(_local8.length - 3)) + _local7;
_local8 = _local8.substr(0, _local8.length - 3);
}
_local7 = _local8 + _local7;
if (_local9) {
return(((_local7 + ".") + _local6) + "$");
}
return(_local7 + " $");
}
static function getOrdinalSuffix(_nNumber) {
var _local4 = String(_nNumber);
if ((_local4.substr(-2, 2) == 11) || ((_local4.substr(-2, 2) == 12) || (_local4.substr(-2, 2) == 13))) {
var _local3 = "th";
} else if (_local4.substr(-1, 1) == 1) {
var _local3 = "st";
} else if (_local4.substr(-1, 1) == 2) {
var _local3 = "nd";
} else if (_local4.substr(-1, 1) == 3) {
var _local3 = "rd";
} else {
var _local3 = "th";
}
return(_local3);
}
}
Symbol 2114 MovieClip [__Packages.com.sarbakan.DXDControllerWrapper] Frame 0
class com.sarbakan.DXDControllerWrapper extends com.disney.gem.games.BaseGameController
{
var oRealController, __owner;
function DXDControllerWrapper (_oRealController, _mcTimeline, _oOwner) {
super(_mcTimeline, _oOwner);
oRealController = _oRealController;
}
function init() {
super.init();
oRealController.init();
}
function update(_nElapsed) {
oRealController.update(_nElapsed);
}
function toggleSound() {
__owner.onToggleSound();
}
function isMuted() {
return(!__owner.__soundOn);
}
function gameLog(_sText) {
__owner.gameLog(_sText, "game");
}
}
Symbol 2115 MovieClip [__Packages.com.disney.gem.games.GameContainer] Frame 0
class com.disney.gem.games.GameContainer
{
function GameContainer () {
}
}
Symbol 2116 MovieClip [__Packages.com.sarbakan.utils.FrameRateDisplayer] Frame 0
class com.sarbakan.utils.FrameRateDisplayer
{
var nMovieFPS, nUpdateCounter, nAverageFps, nCurrentFPS, nUpdateCount, mcDebug, nLastGetTimer;
function FrameRateDisplayer (_mcTimeline, _nMovieFPS, _nStageWidth) {
nMovieFPS = _nMovieFPS;
nUpdateCounter = 0;
nAverageFps = 0;
nCurrentFPS = nMovieFPS;
reset();
startDebug(_mcTimeline, _nStageWidth);
}
function get fps() {
return(nCurrentFPS);
}
function onUpdate() {
if ((++nUpdateCount) == nMovieFPS) {
computeFrameRate();
updateDebug();
}
}
function onUpdatePaused() {
onUpdate();
}
function startDebug(_mcTimeline, _nStageWidth) {
mcDebug = _mcTimeline.createEmptyMovieClip("PerformanceWatcherDebug", DEBUG_DEPTH);
mcDebug._x = (_nStageWidth - DEBUG_RIGHT_MARGIN) - 400;
mcDebug._y = DEBUG_TOP_MARGIN;
mcDebug.createTextField("field", 2, 0, 0, 400, 50);
var _local4 = new TextFormat();
_local4.font = DEBUG_FONT;
_local4.size = DEBUG_FONT_SIZE;
_local4.color = DEBUG_FONT_COLOR;
_local4.align = "right";
mcDebug.field.setNewTextFormat(_local4);
mcDebug.field.selectable = false;
mcDebug.createTextField("fieldShadow", 1, 1, 1, 400, 50);
var _local5 = new TextFormat();
_local5.font = DEBUG_FONT;
_local5.size = DEBUG_FONT_SIZE;
_local5.color = DEBUG_FONT_SHADOW_COLOR;
_local5.align = "right";
mcDebug.fieldShadow.setNewTextFormat(_local5);
mcDebug.fieldShadow.selectable = false;
}
function reset() {
nUpdateCount = 0;
nLastGetTimer = getTimer();
}
function computeFrameRate() {
var _local2 = getTimer() - nLastGetTimer;
var _local3 = _local2 / 1000;
nCurrentFPS = Math.round(nMovieFPS / _local3);
reset();
}
function updateDebug() {
if (mcDebug != undefined) {
nUpdateCounter++;
var _local2 = ((nCurrentFPS + " fps (avg ") + getAverage()) + ")";
mcDebug.field.text = _local2;
mcDebug.fieldShadow.text = _local2;
}
}
function getAverage() {
nAverageFps = nAverageFps + ((nCurrentFPS - nAverageFps) * (1 / nUpdateCounter));
var _local2 = "";
var _local3 = String(nAverageFps).split(".");
if (_local3[1] == undefined) {
_local2 = nAverageFps + ".00";
} else if (_local3[1].length == 1) {
_local2 = (_local3[0] + ".0") + _local3[1];
} else {
_local2 = (_local3[0] + ".") + _local3[1].substr(0, 2);
}
return(_local2);
}
static var DEBUG_DEPTH = 123456;
static var DEBUG_RIGHT_MARGIN = 0;
static var DEBUG_TOP_MARGIN = 0;
static var DEBUG_FONT = "Verdana";
static var DEBUG_FONT_SIZE = 10;
static var DEBUG_FONT_COLOR = 16777215;
static var DEBUG_FONT_SHADOW_COLOR = 0;
}
Symbol 2117 MovieClip [__Packages.com.sarbakan.utils.ScreenController] Frame 0
class com.sarbakan.utils.ScreenController extends com.sarbakan.utils.StateManaged
{
var setMC, setState, setPausable, oController, bInOut, fHideCallBack, mcRef, sState, stateFinished;
function ScreenController (_mcRef) {
super();
setMC(_mcRef);
setState(sSTATE_HIDDEN);
setPausable(false);
}
function setGameController(_oController) {
oController = _oController;
}
function show(_bInOut) {
bInOut = _bInOut;
if (bInOut) {
setState(sSTATE_IN, true);
} else {
setState(sSTATE_IDLE, true);
}
}
function hide(_fHideCallBack, _bInOutOverride) {
fHideCallBack = _fHideCallBack;
var _local4 = bInOut;
if (_bInOutOverride != undefined) {
_local4 = _bInOutOverride;
}
if (_local4) {
setState(sSTATE_OUT);
} else {
setState(sSTATE_HIDDEN, true);
fHideCallBack();
}
}
function getRef() {
return(mcRef);
}
function isInOutTransitionning() {
return((sState == sSTATE_IN) || (sState == sSTATE_OUT));
}
function state_in() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
function state_out() {
if (stateFinished()) {
setState(sSTATE_HIDDEN, true);
fHideCallBack();
}
}
function state_in_init() {
mcRef.btBlocker.useHandCursor = false;
}
function state_idle_init() {
mcRef.btBlocker.useHandCursor = false;
}
function state_out_init() {
mcRef.btBlocker.useHandCursor = false;
}
static var sSTATE_HIDDEN = "hidden";
static var sSTATE_IN = "in";
static var sSTATE_IDLE = "idle";
static var sSTATE_OUT = "out";
}
Symbol 2118 MovieClip [__Packages.com.sarbakan.utils.Delegate] Frame 0
class com.sarbakan.utils.Delegate extends Object
{
var func;
function Delegate () {
super();
}
function DelegateArgs(f) {
func = f;
}
static function create(obj, func) {
var _local4 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
var _local4 = arguments.callee.arg;
_local4 = _local4.concat(arguments);
return(_local3.apply(_local2, _local4));
};
_local4.target = obj;
_local4.func = func;
_local4.arg = arguments.slice(2);
return(_local4);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 2119 MovieClip [__Packages.com.disney.gem.games.pizza_toss.Controller] Frame 0
class com.disney.gem.games.pizza_toss.Controller extends com.sarbakan.BaseDisneyController
{
var nIndex, mcTimeline, oTransitionManager, showScreen, pause, nGamePhase, unpause, onGameStart, setLevel, setGamePhase, nLevel, oGame, oMainBroadcaster, hideCurrentScreen, onLevelStart;
function Controller (_mcTimeline, _oPreloaderScreen) {
super(_mcTimeline, _oPreloaderScreen);
nIndex = 0;
var _local5 = mcTimeline.createEmptyMovieClip("mcSound", mcTimeline.getNextHighestDepth());
com.disney.gem.games.pizza_toss.utility.sndEngine.doInit(_local5);
com.disney.gem.games.pizza_toss.utility.sndEngine.setCategoryVolume(com.disney.gem.games.pizza_toss.utility.Sounds.sMUSIC_CAT_NAME, com.disney.gem.games.pizza_toss.utility.Sounds.nMUSIC_CAT_VOLUME);
com.disney.gem.games.pizza_toss.utility.sndEngine.setCategoryVolume(com.disney.gem.games.pizza_toss.utility.Sounds.sAMBIENT_CAT_NAME, com.disney.gem.games.pizza_toss.utility.Sounds.nAMBIENT_CAT_VOLUME);
com.disney.gem.games.pizza_toss.utility.sndEngine.setCategoryVolume(com.disney.gem.games.pizza_toss.utility.Sounds.sSOUND_CAT_NAME, com.disney.gem.games.pizza_toss.utility.Sounds.nSOUND_CAT_VOLUME);
com.disney.gem.games.pizza_toss.utility.sndEngine.setCategoryVolume(com.disney.gem.games.pizza_toss.utility.Sounds.sTRANSIT_CAT_NAME, com.disney.gem.games.pizza_toss.utility.Sounds.nTRANSIT_CAT_VOLUME);
}
static function __get__Instance() {
return(com.disney.gem.games.pizza_toss.Controller(com.sarbakan.BaseDisneyController.oInstance));
}
function update(_nElapsed) {
super.update(_nElapsed);
if (oTransitionManager.getState() == "in") {
com.disney.gem.games.pizza_toss.utility.Sounds.PlayTransit(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_TRANSITION, true, false);
}
}
function init() {
super.init();
showTitleScreen();
com.disney.gem.games.pizza_toss.utility.Sounds.setMusic(com.disney.gem.games.pizza_toss.utility.Sounds.sMUSIC_PACKAGING);
}
function showTitleScreen(_bShowTransition) {
if (_bShowTransition) {
showScreen(new com.disney.gem.games.pizza_toss.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT);
} else {
showScreen(new com.disney.gem.games.pizza_toss.screens.TitleScreen(mcTimeline.mcScreens.mcTitle));
}
}
function showInstructionScreen() {
pause();
if (nGamePhase == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
oTransitionManager.playTransition(sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, showHelpScreen));
} else {
showScreen(new com.disney.gem.games.pizza_toss.screens.HelpScreen(mcTimeline.mcScreens.mcHelp), false, sTRANSITION_DEFAULT);
}
}
function hideInstructionScreen() {
if (nGamePhase == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
oTransitionManager.playTransition(sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, hideHelpScreen), com.sarbakan.utils.Delegate.create(this, unpause));
} else {
showScreen(new com.disney.gem.games.pizza_toss.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT);
}
}
function startNewGame() {
onGameStart();
setLevel(com.disney.gem.games.pizza_toss.Config.Defaults.StartLevel);
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME);
com.disney.gem.games.pizza_toss.Stats.init();
com.disney.gem.games.pizza_toss.Stats.reset();
oTransitionManager.playTransition(sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, restartLevel), com.sarbakan.utils.Delegate.create(this, onLevelTransitionDone));
}
function startNextLevel() {
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME);
setLevel(nLevel + 1);
restartLevel(true);
}
function restartLevel(_bRestart) {
if (_bRestart) {
oTransitionManager.playTransition(sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, restartLevel), com.sarbakan.utils.Delegate.create(this, onLevelTransitionDone));
} else {
setLevel(nLevel);
if (oGame != undefined) {
oGame.deleteAll();
oMainBroadcaster.removeListener(oGame);
delete oGame;
}
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING);
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME);
oGame = new com.disney.gem.games.pizza_toss.GameEngine(mcTimeline.mcGame);
oGame.preBuild();
oMainBroadcaster.addListener(oGame);
hideCurrentScreen();
onLevelStart();
}
}
function showHelpScreen() {
showScreen(new com.disney.gem.games.pizza_toss.screens.HelpScreen(mcTimeline.mcScreens.mcHelp), false);
}
function hideHelpScreen() {
hideCurrentScreen(null);
}
function onLevelTransitionDone() {
oGame.init();
}
function onGameLose() {
showScreen(new com.disney.gem.games.pizza_toss.screens.EndScreen(mcTimeline.mcScreens.mcLose), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, clearLevel, com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING));
}
function onGameWon() {
showScreen(new com.disney.gem.games.pizza_toss.screens.EndScreen(mcTimeline.mcScreens.mcWin), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, clearLevel, com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING));
}
function clearLevel(_nGamePhase) {
if (oGame != undefined) {
oGame.deleteAll();
oMainBroadcaster.removeListener(oGame);
delete oGame;
}
setGamePhase(_nGamePhase);
}
function getGenericName(_sPrefix) {
return((("mc" + _sPrefix) + "_") + (nIndex++));
}
function get Game() {
return(oGame);
}
static var sTRANSITION_DEFAULT = "default";
}
Symbol 2120 MovieClip [__Packages.com.disney.gem.games.pizza_toss.GameEngine] Frame 0
class com.disney.gem.games.pizza_toss.GameEngine
{
static var oInstance;
var mcRef, mcGame, oHud, oEventDispatcher, aObjects, oScroller, aDisplayed, nRoadDepth, nItemDepth, bEmergencyBox, bEmergencyGas, bPerfectPlayed, nGasTank, nBox, nRoadCreated, oColor, oPlayer, nRoad, sLast, aLastPattern, oObstacle;
function GameEngine (_mcRef) {
oInstance = this;
mcRef = _mcRef;
mcGame = mcRef.mcGame;
oHud = new com.disney.gem.games.pizza_toss.ui.Hud(mcRef.mcHud);
oEventDispatcher = new com.disney.gem.games.pizza_toss.events.EventDispatcher();
aObjects = new Array();
oScroller = new com.disney.gem.games.pizza_toss.scroller.ScrollerEngine(this);
aDisplayed = new Array();
nRoadDepth = 100000 /* 0x0186A0 */;
nItemDepth = 100000 /* 0x0186A0 */;
bEmergencyBox = true;
bEmergencyGas = true;
bPerfectPlayed = false;
nGasTank = 0;
nBox = 0;
nRoadCreated = 0;
com.disney.gem.games.pizza_toss.Stats.reset();
mcGame.mcInner._x = 0;
com.disney.gem.games.pizza_toss.utility.Sounds.StopAll(com.disney.gem.games.pizza_toss.utility.Sounds.sSOUND_CAT_NAME);
var _local3 = com.disney.gem.games.pizza_toss.Config["Level" + com.disney.gem.games.pizza_toss.Controller.Instance.getLevel()].Time;
com.disney.gem.games.pizza_toss.utility.Sounds.setAmbient("sAm_" + String(_local3).toLowerCase());
var _local4 = new flash.geom.Transform(mcRef.mcGame);
oColor = com.disney.gem.games.pizza_toss.dayTime.Hour[_local3];
_local4.colorTransform = oColor;
}
function preBuild() {
com.disney.gem.games.pizza_toss.utility.Sounds.setMusic(com.disney.gem.games.pizza_toss.utility.Sounds.sMUSIC_INGAME);
buildLevel(0);
oScroller.preActivate();
}
function init() {
oHud.init();
var _local2 = ("com.disney.gem.games.pizza_toss.popups.Level" + com.disney.gem.games.pizza_toss.Controller.Instance.getLevel()) + "Popup";
var _local3 = com.disney.gem.games.pizza_toss.utility.ClassFinder.find(_local2);
com.disney.gem.games.pizza_toss.Controller.Instance.showPopup(new _local3[undefined](com.disney.gem.games.pizza_toss.Controller.Instance.mcTimeline.mcPopups["mcLevel" + com.disney.gem.games.pizza_toss.Controller.Instance.getLevel()], com.sarbakan.utils.Delegate.create(this, startGame)), true);
}
function startGame() {
com.disney.gem.games.pizza_toss.Controller.Instance.unpause();
}
function onGameEnd() {
if (((com.disney.gem.games.pizza_toss.Stats.clients / com.disney.gem.games.pizza_toss.Stats.maxClients) >= com.disney.gem.games.pizza_toss.Config["Level" + com.disney.gem.games.pizza_toss.Controller.Instance.getLevel()].WinPercent) && (com.disney.gem.games.pizza_toss.Stats.fuel > 0)) {
var _local2 = com.disney.gem.games.pizza_toss.Stats.score;
com.disney.gem.games.pizza_toss.Stats.score = 0;
com.disney.gem.games.pizza_toss.Controller.Instance.increaseScore(_local2);
com.disney.gem.games.pizza_toss.utility.Sounds.StopAll(com.disney.gem.games.pizza_toss.utility.Sounds.sAMBIENT_CAT_NAME);
com.disney.gem.games.pizza_toss.utility.Sounds.StopAll(com.disney.gem.games.pizza_toss.utility.Sounds.sSOUND_CAT_NAME);
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WIN, true, false);
if (com.disney.gem.games.pizza_toss.Controller.Instance.getLevel() == 3) {
com.disney.gem.games.pizza_toss.Controller.Instance.onGameWon();
com.disney.gem.games.pizza_toss.utility.Sounds.setMusic(com.disney.gem.games.pizza_toss.utility.Sounds.sMUSIC_PACKAGING);
} else {
com.disney.gem.games.pizza_toss.Controller.Instance.startNextLevel();
}
} else {
com.disney.gem.games.pizza_toss.utility.Sounds.StopAll(com.disney.gem.games.pizza_toss.utility.Sounds.sAMBIENT_CAT_NAME);
com.disney.gem.games.pizza_toss.utility.Sounds.StopAll(com.disney.gem.games.pizza_toss.utility.Sounds.sSOUND_CAT_NAME);
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_LOSE, true, false);
com.disney.gem.games.pizza_toss.Stats.tries--;
if (com.disney.gem.games.pizza_toss.Stats.tries > 0) {
com.disney.gem.games.pizza_toss.Stats.score = 0;
com.disney.gem.games.pizza_toss.Controller.Instance.restartLevel(true);
} else {
var _local3 = com.disney.gem.games.pizza_toss.Stats.score;
com.disney.gem.games.pizza_toss.Stats.score = 0;
com.disney.gem.games.pizza_toss.Controller.Instance.increaseScore(_local3);
com.disney.gem.games.pizza_toss.Controller.Instance.onGameLose();
com.disney.gem.games.pizza_toss.utility.Sounds.setMusic(com.disney.gem.games.pizza_toss.utility.Sounds.sMUSIC_PACKAGING);
}
}
}
function deleteAll() {
oEventDispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.DESTROY), this);
aObjects.splice(0);
aObjects = new Array();
}
function deleteMe(_oItem) {
var _local3 = aObjects.length - 1;
for ( ; _local3 > -1 ; _local3--) {
if (_oItem.Mc.getDepth() == aObjects[_local3].Mc.getDepth()) {
aObjects.splice(_local3, 1);
break;
}
}
}
function displayHotDog() {
com.disney.gem.games.pizza_toss.Controller.Instance.showPopup(new com.disney.gem.games.pizza_toss.popups.HotDogPopup(com.disney.gem.games.pizza_toss.Controller.Instance.mcTimeline.mcPopups.mcHotDog), true);
}
function onUpdate() {
oHud.update();
mcRef.mcGame.mcInner._x = mcRef.mcGame.mcInner._x - oScroller.speed;
oScroller.update();
if (oScroller.speed == 0) {
checkForPerfect();
}
com.disney.gem.games.pizza_toss.utility.DepthManager.check(this);
}
function checkForPerfect() {
if (!bPerfectPlayed) {
if (com.disney.gem.games.pizza_toss.Stats.clients >= com.disney.gem.games.pizza_toss.Stats.maxClients) {
bPerfectPlayed = true;
com.disney.gem.games.pizza_toss.Stats.score = com.disney.gem.games.pizza_toss.Stats.score + com.disney.gem.games.pizza_toss.Config.Points.Perfect;
com.disney.gem.games.pizza_toss.Controller.Instance.showPopup(new com.disney.gem.games.pizza_toss.popups.PerfectPopup(com.disney.gem.games.pizza_toss.Controller.Instance.mcTimeline.mcPopups.mcPerfect), true);
}
}
}
function amILast(_oRoad) {
if (_oRoad.Mc.getDepth() == nRoadDepth) {
generateRoad();
}
}
function getPlayer() {
return(oPlayer);
}
function buildLevel(_nLevel) {
nRoad = -com.disney.gem.games.pizza_toss.Config.RoadDistance.RoadToRoad;
sLast = "Intersection";
var _local3 = 0;
for ( ; _local3 < 5 ; _local3++) {
generateRoad();
}
var _local4 = new Array(["_x", 35.5], ["_y", 348.5]);
aObjects.push(new com.disney.gem.games.pizza_toss.elements.Player(this, _local4, {depth:500000}));
oPlayer = aObjects[aObjects.length - 1];
_local4 = new Array(["_x", 35.5], ["_y", 320.8]);
aObjects.push(new com.disney.gem.games.pizza_toss.colliders.Limit(this, _local4, {depth:500001, player:oPlayer}));
_local4 = new Array(["_x", 35.5], ["_y", 457.7]);
aObjects.push(new com.disney.gem.games.pizza_toss.colliders.Limit(this, _local4, {depth:500002, player:oPlayer}));
}
function generateRoad() {
var _local2 = new Array();
var _local3 = new Object();
var _local4 = "com.disney.gem.games.pizza_toss.elements.roads.";
if ((Math.random() <= com.disney.gem.games.pizza_toss.Config["Level" + com.disney.gem.games.pizza_toss.Controller.Instance.getLevel()].Intersection) && (sLast != "Intersection")) {
var _local6 = getRoadDistance(sLast, "Intersection");
_local3 = setItemInfo(_local6, 400, com.disney.gem.games.pizza_toss.patterns.Cross.Road.name, com.disney.gem.games.pizza_toss.patterns.Cross.Road.linkage, com.disney.gem.games.pizza_toss.patterns.Cross.Road.left, com.disney.gem.games.pizza_toss.patterns.Cross.Road.right, getRoadDepth());
_local2 = getProperties(_local3);
sLast = "Intersection";
} else {
var _local6 = getRoadDistance(sLast, "Road");
_local3 = setItemInfo(_local6, 400, com.disney.gem.games.pizza_toss.patterns.Straight.Road.name, com.disney.gem.games.pizza_toss.patterns.Straight.Road.linkage, com.disney.gem.games.pizza_toss.patterns.Straight.Road.left, com.disney.gem.games.pizza_toss.patterns.Straight.Road.right, getRoadDepth());
_local2 = getProperties(_local3);
sLast = "Road";
}
nRoad = nRoad + _local6;
var _local5 = com.disney.gem.games.pizza_toss.utility.ClassFinder.find(_local4 + _local3.name);
aObjects.push(new _local5[undefined](this, _local2, _local3));
}
function getProperties(_oItem) {
var _local3 = new Array();
var _local4 = new Array("x", "y", "xscale", "yscale", "rotation", "width", "height");
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
if (_oItem[_local4[_local5]] != undefined) {
_local3.push(["_" + _local4[_local5], _oItem[_local4[_local5]]]);
}
}
return(_local3);
}
function getRoadDistance(_sLast, _sNext) {
switch (_sLast) {
case undefined :
var _local4 = com.disney.gem.games.pizza_toss.Config.RoadDistance.RoadToRoad;
break;
case "Road" :
if (_sNext == "Road") {
_local4 = com.disney.gem.games.pizza_toss.Config.RoadDistance.RoadToRoad;
} else {
_local4 = com.disney.gem.games.pizza_toss.Config.RoadDistance.RoadToInter;
}
break;
case "Intersection" :
if (_sNext == "Road") {
_local4 = com.disney.gem.games.pizza_toss.Config.RoadDistance.InterToRoad;
} else {
_local4 = com.disney.gem.games.pizza_toss.Config.RoadDistance.InterToInter;
}
}
return(_local4);
}
function getRoadDepth() {
nRoadDepth = nRoadDepth - 1000;
return(nRoadDepth);
}
function getItemDepth() {
nItemDepth = nItemDepth + 1;
return(nItemDepth);
}
function emergencyAvailable(_sItem) {
if (_sItem == "GasTank") {
return(bEmergencyGas);
}
if (_sItem == "HotDogBox") {
return(bEmergencyBox);
}
return(false);
}
function setEmergency(_sItem, _bValue) {
if (_sItem == "GasTank") {
bEmergencyGas = _bValue;
} else if (_sItem == "HotDogBox") {
bEmergencyBox = _bValue;
}
}
function setItemInfo(_nX, _nY, _sName, _sLinkage, _nLeft, _nRight, _nDepth) {
var _local9 = new Object();
_local9.x = nRoad + _nX;
_local9.y = _nY;
_local9.name = _sName;
_local9.linkage = _sLinkage;
_local9.left = _local9.x + _nLeft;
_local9.right = _local9.x + _nRight;
_local9.depth = _nDepth;
return(_local9);
}
function setLastPattern(_aPattern) {
aLastPattern = _aPattern;
}
function getLastPattern() {
return(aLastPattern);
}
function setLastObstacle(_oObstacle) {
oObstacle = _oObstacle;
}
function getLastObstacle() {
return(oObstacle);
}
function get dispatcher() {
return(oEventDispatcher);
}
function get displayed() {
return(aDisplayed);
}
function set displayed(_aDisplayed) {
aDisplayed = _aDisplayed;
//return(displayed);
}
function get objectsList() {
return(aObjects);
}
function set objectsList(_aArr) {
aObjects = _aArr;
//return(objectsList);
}
function get scroller() {
return(oScroller);
}
}
Symbol 2121 MovieClip [__Packages.com.disney.gem.games.pizza_toss.ui.Hud] Frame 0
class com.disney.gem.games.pizza_toss.ui.Hud
{
var mcHud, bEnded, txtTries, txtScore, txtHotdogs, mcGauge, nAngleEmpty, nAngleFull, nTarget;
function Hud (_mcHud) {
mcHud = _mcHud;
bEnded = false;
txtTries = mcHud.txtTries;
txtScore = mcHud.txtScore;
txtHotdogs = mcHud.txtHotdogs;
mcGauge = mcHud.mcFuel.mcGauge;
nAngleEmpty = mcHud.mcFuel.mcEmptyAngle._rotation;
nAngleFull = mcHud.mcFuel.mcFullAngle._rotation;
mcHud.mcFuel.mcEmptyAngle._visible = false;
mcHud.mcFuel.mcFullAngle._visible = false;
mcGauge._rotation = nAngleFull;
mcHud.btMenu.onRelease = com.sarbakan.utils.Delegate.create(this, onBtMenu);
mcHud.btMenu.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
}
function init() {
txtTries.text = String(com.disney.gem.games.pizza_toss.Stats.tries);
txtScore.text = String(com.disney.gem.games.pizza_toss.Controller.Instance.getScore() + com.disney.gem.games.pizza_toss.Stats.score);
txtHotdogs.text = String(com.disney.gem.games.pizza_toss.Stats.hotdogs);
if (com.disney.gem.games.pizza_toss.Stats.clients < com.disney.gem.games.pizza_toss.Stats.maxClients) {
nTarget = (Math.abs(nAngleFull - nAngleEmpty) * (com.disney.gem.games.pizza_toss.Stats.fuel / 100)) + nAngleEmpty;
}
if (Math.abs(nTarget - mcGauge._rotation) < com.disney.gem.games.pizza_toss.Config.Defaults.GaugeSpeed) {
mcGauge._rotation = nTarget;
} else if (nTarget > mcGauge._rotation) {
if ((mcGauge._rotation + com.disney.gem.games.pizza_toss.Config.Defaults.GaugeSpeed) < nTarget) {
mcGauge._rotation = mcGauge._rotation + com.disney.gem.games.pizza_toss.Config.Defaults.GaugeSpeed;
} else {
mcGauge._rotation = nTarget;
}
} else if (nTarget < mcGauge._rotation) {
if ((mcGauge._rotation - com.disney.gem.games.pizza_toss.Config.Defaults.GaugeSpeed) > nTarget) {
mcGauge._rotation = mcGauge._rotation - com.disney.gem.games.pizza_toss.Config.Defaults.GaugeSpeed;
} else {
mcGauge._rotation = nTarget;
}
}
if ((mcGauge._rotation < nAngleEmpty) && (!bEnded)) {
bEnded = true;
mcGauge._rotation = nAngleEmpty;
com.disney.gem.games.pizza_toss.Controller.Instance.Game.onGameEnd();
}
}
function update() {
init();
}
function onBtOver() {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_ROLLOVER, true, false);
}
function onBtMenu() {
com.disney.gem.games.pizza_toss.Controller.Instance.pause();
com.disney.gem.games.pizza_toss.Controller.Instance.showPopup(new com.disney.gem.games.pizza_toss.popups.MenuPopup(com.disney.gem.games.pizza_toss.Controller.Instance.mcTimeline.mcPopups.mcMenu), true);
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_CLICK);
}
}
Symbol 2122 MovieClip [__Packages.com.disney.gem.games.pizza_toss.Stats] Frame 0
class com.disney.gem.games.pizza_toss.Stats
{
static var nTempScore, nHotDog, nFuel, nClients, nTotalClients, bMickey, nMaxClients, nTries;
function Stats () {
}
static function reset() {
nTempScore = 0;
nHotDog = com.disney.gem.games.pizza_toss.Config.Defaults.Hotdogs;
nFuel = com.disney.gem.games.pizza_toss.Config.Defaults.Fuel;
nClients = 0;
nTotalClients = 0;
bMickey = false;
nMaxClients = com.disney.gem.games.pizza_toss.Config["Level" + com.disney.gem.games.pizza_toss.Controller.Instance.getLevel()].ClientToServe;
}
static function init() {
nTries = com.disney.gem.games.pizza_toss.Config.Defaults.Tries;
}
static function __get__tries() {
return(nTries);
}
static function __get__score() {
return(nTempScore);
}
static function __set__tries(_nTries) {
nTries = _nTries;
return(__get__tries());
}
static function __set__score(_nScore) {
nTempScore = _nScore;
return(__get__score());
}
static function __get__hotdogs() {
return(nHotDog);
}
static function __set__hotdogs(_nHotDogs) {
nHotDog = _nHotDogs;
nHotDog = ((nHotDog < 0) ? 0 : (nHotDog));
nHotDog = ((nHotDog > com.disney.gem.games.pizza_toss.Config.Defaults.MaxHotDogs) ? (com.disney.gem.games.pizza_toss.Config.Defaults.MaxHotDogs) : (nHotDog));
return(__get__hotdogs());
}
static function __get__fuel() {
return(nFuel);
}
static function __set__fuel(_nFuel) {
nFuel = _nFuel;
if (nFuel > com.disney.gem.games.pizza_toss.Config.Defaults.Fuel) {
nFuel = com.disney.gem.games.pizza_toss.Config.Defaults.Fuel;
}
return(__get__fuel());
}
static function __get__clients() {
return(nClients);
}
static function __set__clients(_nClients) {
nClients = _nClients;
return(__get__clients());
}
static function __get__totalClients() {
return(nTotalClients);
}
static function __set__totalClients(_nClients) {
nTotalClients = _nClients;
return(__get__totalClients());
}
static function __get__maxClients() {
return(nMaxClients);
}
static function __get__mickey() {
return(bMickey);
}
static function __set__mickey(_bMickey) {
bMickey = _bMickey;
return(__get__mickey());
}
}
Symbol 2123 MovieClip [__Packages.com.disney.gem.games.pizza_toss.Config] Frame 0
class com.disney.gem.games.pizza_toss.Config
{
function Config () {
}
static var Defaults = {StartLevel:1, Tries:3, Slice:20, Depth:1000000, Temp:200000, LevelPopupTime:60, HDPopupTime:20, Hotdogs:10, Fuel:100, FuelByPixel:0.01, RoadBefore:5, HotdogSpeed:8, MaxHotDogs:25, ExitClient:50, PerfectTime:20, GaugeSpeed:2, EmergencyFuel:20, EmergencyBox:1};
static var Control = {Left:37, Right:39, Accelerate:38, Brake:40, TossHigh:67, TossLow:32};
static var Player = {Accelerate:0.8, Brake:1, TurnLeft:3, TurnRight:3, MaxSpeedX:8, MinSpeedX:3, SlowSpeedX:4, SlowTime:35, Invicible:70};
static var Clients = {Idle:160};
static var Weiner = {Speed:7.9, ChanceToChase:1};
static var RoadDistance = {RoadToRoad:383.2, InterToInter:423.1, RoadToInter:406.5, InterToRoad:400.1};
static var Bonus = {GasTank:{Fuel:100}, HotdogBox:{Hotdogs:10}};
static var Points = {HotDogBox:250, GasTank:300, Deliver:500, Perfect:5000};
static var Penalities = {Weiner:150, Crash:0, SlowDown:0};
static var HotDogAngle = {High:{Min:-18, Max:21, Normal:3}, Low:{Min:-33, Max:6, Normal:-10}};
static var Level1 = {Wall:0.5, Accessory:0.5, Obstacle:0.5, Bonus:0.2, GasTank:0.3, HotDogBox:0.7, SlowDown:0.7, Crash:0.3, Intersection:0, Client:0.9, ClientToServe:20, WinPercent:0.4, Time:"Morning"};
static var Level2 = {Wall:0.5, Accessory:0.5, Obstacle:0.5, Bonus:0.2, GasTank:0.3, HotDogBox:0.7, SlowDown:0.5, Crash:0.5, Intersection:0.1, Client:0.9, ClientToServe:25, WinPercent:0.5, Time:"Noon"};
static var Level3 = {Wall:0.5, Accessory:0.5, Obstacle:0.5, Bonus:0.2, GasTank:0.3, HotDogBox:0.7, SlowDown:0.5, Crash:0.5, Intersection:0.2, Client:0.9, ClientToServe:30, WinPercent:0.8, Time:"Evening"};
}
Symbol 2124 MovieClip [__Packages.com.disney.gem.games.pizza_toss.utility.Sounds] Frame 0
class com.disney.gem.games.pizza_toss.utility.Sounds
{
static var sCurrentMusic, sCurrentAmbient;
function Sounds () {
}
static function Play(_sSounds, _bUnique, _bOverride) {
var _local5 = true;
if (_bUnique) {
if (com.disney.gem.games.pizza_toss.utility.sndEngine.isSoundPlaying(_sSounds).bPlaying) {
_local5 = false;
}
}
if (_bOverride && (!_local5)) {
Stop(_sSounds);
_local5 = true;
}
if (_local5) {
com.disney.gem.games.pizza_toss.utility.sndEngine.doPlaySoundInCat(sSOUND_CAT_NAME, _sSounds, 100, 1);
}
}
static function PlayLoop(_sSounds, _bUnique, _bOverride) {
var _local5 = true;
if (_bUnique) {
if (com.disney.gem.games.pizza_toss.utility.sndEngine.isSoundPlaying(_sSounds).bPlaying) {
_local5 = false;
}
}
if (_bOverride && (!_local5)) {
Stop(_sSounds);
_local5 = true;
}
if (_local5) {
com.disney.gem.games.pizza_toss.utility.sndEngine.doPlaySoundInCat(sSOUND_CAT_NAME, _sSounds, 100, 65536);
}
}
static function PlayTransit(_sSounds, _bUnique, _bOverride) {
var _local5 = true;
if (_bUnique) {
if (com.disney.gem.games.pizza_toss.utility.sndEngine.isSoundPlaying(_sSounds).bPlaying) {
_local5 = false;
}
}
if (_bOverride && (!_local5)) {
Stop(_sSounds);
_local5 = true;
}
if (_local5) {
com.disney.gem.games.pizza_toss.utility.sndEngine.doPlaySoundInCat(sTRANSIT_CAT_NAME, _sSounds, 100, 1);
}
}
static function Stop(_sSound) {
if (com.disney.gem.games.pizza_toss.utility.sndEngine.isSoundPlaying(_sSound).bPlaying) {
com.disney.gem.games.pizza_toss.utility.sndEngine.isSoundPlaying(_sSound).oSound.doStop();
}
}
static function Pause(_sCategory) {
com.disney.gem.games.pizza_toss.utility.sndEngine.doPauseCategory(_sCategory);
}
static function Unpause(_sCategory) {
com.disney.gem.games.pizza_toss.utility.sndEngine.doUnPauseCategory(_sCategory);
}
static function StopAll(_sCategory) {
com.disney.gem.games.pizza_toss.utility.sndEngine.doStopCategory(_sCategory);
}
static function setMusic(_sSound) {
if ((sCurrentMusic != undefined) && (sCurrentMusic != _sSound)) {
com.disney.gem.games.pizza_toss.utility.sndEngine.isSoundPlaying(sCurrentMusic).oSound.doFadeTo(0);
}
com.disney.gem.games.pizza_toss.utility.sndEngine.doPlaySoundInCat(sMUSIC_CAT_NAME, _sSound, 0, 65536, true);
com.disney.gem.games.pizza_toss.utility.sndEngine.isSoundPlaying(_sSound).oSound.doFadeTo(100, false);
sCurrentMusic = _sSound;
}
static function setAmbient(_sSound) {
if (com.disney.gem.games.pizza_toss.Controller.Instance.getGamePhase() == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
if ((sCurrentAmbient != undefined) && (sCurrentAmbient != _sSound)) {
com.disney.gem.games.pizza_toss.utility.sndEngine.isSoundPlaying(_sSound).oSound.doFadeTo(0);
}
com.disney.gem.games.pizza_toss.utility.sndEngine.doPlaySoundInCat(sAMBIENT_CAT_NAME, _sSound, 0, 65536, true);
com.disney.gem.games.pizza_toss.utility.sndEngine.isSoundPlaying(_sSound).oSound.doFadeTo(100, false);
sCurrentAmbient = _sSound;
} else {
StopAll(sAMBIENT_CAT_NAME);
}
}
static var sSOUND_CAT_NAME = "SFX";
static var sAMBIENT_CAT_NAME = "Ambient";
static var sMUSIC_CAT_NAME = "Music";
static var sTRANSIT_CAT_NAME = "Transition";
static var nSOUND_CAT_VOLUME = 90;
static var nAMBIENT_CAT_VOLUME = 35;
static var nMUSIC_CAT_VOLUME = 50;
static var nTRANSIT_CAT_VOLUME = 90;
static var sMUSIC_PACKAGING = "sMu_pack";
static var sMUSIC_INGAME = "sMu_game";
static var sAM_MORNING = "sAm_morning";
static var sAM_NOON = "sAm_noon";
static var sAM_EVENING = "sAm_evening";
static var sSFX_BOX_TAKE = "sSfx_box_take";
static var sSFX_BUTTON_CLICK = "sSfx_button_click,sSfx_button_click_02,sSfx_button_click_03";
static var sSFX_BUTTON_ROLLOVER = "sSfx_button_rollover";
static var sSFX_CAR = "sSfx_car1,sSfx_car2,sSfx_car3,sSfx_car4";
static var sSFX_DOG_IDLE = "sSfx_dog_idle";
static var sSFX_DOG_BUMP = "sSfx_dog_bump";
static var sSFX_DOG_RUN = "sSfx_dog_run";
static var sSFX_DOG_SCARED = "sSfx_dog_scared,sSfx_dog_scared_02";
static var sSFX_DOOR_CATCH = "sSfx_door_catch_01,sSfx_door_catch_02,sSfx_door_catch_03,sSfx_door_catch_04";
static var sSFX_DOOR_IN = "sSfx_door_in_01,sSfx_door_in_02,sSfx_door_in_03,sSfx_door_in_04";
static var sSFX_DOOR_MISSED = "sSfx_door_missed";
static var sSFX_DOOR_OUT = "sSfx_door_out,sSfx_door_out_02,sSfx_door_out_03,sSfx_door_out_04";
static var sSFX_FIREBORN = "sSfx_fireborn";
static var sSFX_GAS_TAKE = "sSfx_gas_take";
static var sSFX_GOOFY_ACCEL = "sSfx_goofy_accel";
static var sSFX_GOOFY_BREAK = "sSfx_goofy_break_02,sSfx_goofy_break_03";
static var sSFX_GOOFY_BUMP = "sSfx_goofy_bump_01";
static var sSFX_GOOFY_CRASH = "sSfx_goofy_crash";
static var sSFX_GOOFY_FLASH = "sSfx_goofy_flash";
static var sSFX_GOOFY_IDLE = "sSfx_goofy_idle_01";
static var sSFX_GOOFY_PICKUP = "sSfx_goofy_pickup,sSfx_goofy_pickup_02";
static var sSFX_GOOFY_QUICK = "sSfx_goofy_quick";
static var sSFX_GOOFY_THROW = "sSfx_goofy_throw,sSfx_goofy_throw_02,sSfx_goofy_throw_03";
static var sSFX_GOOFY_WATER = "sSfx_goofy_water,sSfx_goofy_water_02";
static var sSFX_HOTDOG_GROUND = "sSfx_hotdog_ground";
static var sSFX_HOTDOG_IDLE = "sSfx_hotdog_idle";
static var sSFX_HOTDOG_WALL = "sSfx_hotdog_wall,sSfx_hotdog_wall_02,sSfx_hotdog_wall_03";
static var sSFX_KID_GROUND = "sSfx_kid_ground";
static var sSFX_KID_PLAY = "sSfx_kid_play";
static var sSFX_KID_SCARED = "sSfx_kid_scared";
static var sSFX_LOSE = "sSfx_lose,sSfx_lose_02";
static var sSFX_MANHOLE = "sSfx_manhole_02";
static var sSFX_MICKEY = "sSfx_mickey";
static var sSFX_OLD_FALL = "sSfx_old_fall_01,sSfx_old_fall_02";
static var sSFX_OLD_GET_SCARED = "sSfx_old_get_scared";
static var sSFX_OLD_GROUND = "sSfx_old_ground,sSfx_old_ground_02";
static var sSFX_OLD_SCARED = "sSfx_old_ground,sSfx_old_ground_02";
static var sSFX_OLD_WALKING = "sSfx_old_walking";
static var sSFX_TRANSITION = "sSfx_transition";
static var sSFX_WIN = "sSfx_win_01,sSfx_win_02";
static var sSFX_WINDOW_OUT = "sSfx_window_out";
static var sSFX_WINDOW_CATCH = "sSfx_window_catch";
static var sSFX_WINDOW_IN = "sSfx_window_in";
static var sSFX_WINDOW_MISSED = "sSfx_window_missed";
}
Symbol 2125 MovieClip [__Packages.com.disney.gem.games.pizza_toss.utility.sndEngine] Frame 0
class com.disney.gem.games.pizza_toss.utility.sndEngine
{
static var aSounds, mcAttach, nSoundNum, aSoundCategories, nMasterVolume;
function sndEngine () {
}
static function doPlaySound(__sLinkage, __nVolume, __nLoop, __bUnique) {
return(doPlaySoundInCat(DEFAULT_CATEGORY, __sLinkage, __nVolume, __nLoop, __bUnique));
}
static function doPlaySoundInCat(__sCategoryName, __sLinkage, __nVolume, __nLoop, __bUnique) {
doCheckInit();
var _local8 = new Array();
if (__nVolume == undefined) {
__nVolume = 100;
}
if (__nLoop == undefined) {
__nLoop = 1;
}
if (__bUnique == undefined) {
__bUnique = false;
}
if (__sLinkage.indexOf(",") > 0) {
_local8 = __sLinkage.split(",");
var _local9 = _local8[Math.floor(Math.random() * (_local8.length - 1))];
} else {
var _local9 = __sLinkage;
}
if (__bUnique) {
var _local11 = isSoundPlaying(__sLinkage);
if (_local11.bPlaying) {
var _local10 = false;
var _local7 = _local11.oSound;
} else {
var _local10 = true;
}
} else {
var _local10 = true;
}
if (_local10) {
doManageCategory(__sCategoryName);
var _local12 = getMCForSound();
var _local13 = new Sound(_local12);
_local13.attachSound(_local9);
if (_local13.duration != undefined) {
var _local7 = new com.disney.gem.games.pizza_toss.utility.sndItem(_local13, _local9, __nVolume, __nLoop, __sCategoryName, _local12);
} else {
org.flashdevelop.utils.FlashConnect.trace("***** BAD SOUND LINKAGE : " + __sLinkage, "com.disney.gem.games.pizza_toss.utility.sndEngine::doPlaySoundInCat", "S:\\00738_32_WDIG_Goofy_Pizza_Toss\\4-Production\\Prog\\Integration\\080522\\Pizza Toss\\src/com/disney/gem/games/pizza_toss/utility/sndEngine.as", 67);
}
_local7.doAddListener(com.disney.gem.games.pizza_toss.utility.sndEngine);
aSounds.push(_local7);
}
return(_local7);
}
static function isSoundPlaying(__sLinkageName) {
var _local3 = new Object();
var _local4 = new Array();
_local3.bPlaying = false;
_local3.oSound = undefined;
if (__sLinkageName.indexOf(",") > 0) {
_local4 = __sLinkageName.split(",");
}
if (_local4.length > 0) {
var _local5 = 0;
// unexpected jump
do {
_local5++;
if (_local5 >= aSounds.length) {
break;
}
var _local6 = 0;
} while (for ( ; _local6 < _local4.length ; _local6++) {
if (aSounds[_local5].LinkageName == _local4[_local6]) {
_local3.oSound = aSounds[_local5]_local3.bPlaying = truebreak;
}
}
, !_local3.bPlaying);
} else {
var _local7 = 0;
for ( ; _local7 < aSounds.length ; _local7++) {
if (aSounds[_local7].LinkageName == __sLinkageName) {
_local3.oSound = aSounds[_local7];
_local3.bPlaying = true;
break;
}
}
}
return(_local3);
}
static function doManageExternalSound(__oSound) {
doCheckInit();
doManageCategory(__oSound.Category);
__oSound.doAddListener(com.disney.gem.games.pizza_toss.utility.sndEngine);
aSounds.push(__oSound);
}
static function getMCForSound() {
var _local2 = getNextDepth();
var _local3 = mcAttach.createEmptyMovieClip("Snd" + _local2, _local2);
return(_local3);
}
static function getNextDepth() {
nSoundNum++;
return(nSoundNum);
}
static function doInit(__mcAttach) {
mcAttach = __mcAttach;
if (!bInited) {
bInited = true;
nSoundNum = 0;
aSounds = new Array();
aSoundCategories = new Array();
nMasterVolume = 100;
mcAttach.onEnterFrame = com.sarbakan.utils.Delegate.create(com.disney.gem.games.pizza_toss.utility.sndEngine, doEnterFrame);
}
}
static function doEnterFrame() {
var _local2 = 0;
for ( ; _local2 < aSounds.length ; _local2++) {
aSounds[_local2].doEnterFrame();
}
}
static function setCategoryVolume(__sCategoryName, __nVol) {
doManageCategory(__sCategoryName);
var _local4 = 0;
for ( ; _local4 < aSoundCategories.length ; _local4++) {
if (aSoundCategories[_local4].sName == __sCategoryName) {
aSoundCategories[_local4].nVolume = __nVol;
}
}
doUpdateAllSoundsVolume();
}
static function getCategoryVolume(__sCategoryName) {
doManageCategory(__sCategoryName);
var _local4 = 0;
for ( ; _local4 < aSoundCategories.length ; _local4++) {
if (aSoundCategories[_local4].sName == __sCategoryName) {
var _local3 = aSoundCategories[_local4].nVolume;
}
}
return(_local3);
}
static function isCategoryMuted(__sCategoryName) {
doManageCategory(__sCategoryName);
var _local4 = 0;
for ( ; _local4 < aSoundCategories.length ; _local4++) {
if (aSoundCategories[_local4].sName == __sCategoryName) {
var _local3 = aSoundCategories[_local4].bMuted;
}
}
return(_local3);
}
static function doSoundEvent(__nEvent, __oSound) {
if (!(__nEvent === EVENT_SOUND_COMPLETE)) {
} else {
var _local4 = false;
var _local5 = 0;
for ( ; _local5 < aSounds.length ; _local5++) {
if (!_local4) {
if (aSounds[_local5] == __oSound) {
_local4 = true;
delete aSounds[_local5];
aSounds.splice(_local5, 1);
}
}
}
}
}
static function doMuteCategory(__sCategoryName) {
var _local3 = 0;
for ( ; _local3 < aSoundCategories.length ; _local3++) {
if (aSoundCategories[_local3].sName == __sCategoryName) {
aSoundCategories[_local3].bMuted = true;
}
}
doUpdateAllSoundsVolume();
}
static function doUnMuteCategory(__sCategoryName) {
var _local3 = 0;
for ( ; _local3 < aSoundCategories.length ; _local3++) {
if (aSoundCategories[_local3].sName == __sCategoryName) {
aSoundCategories[_local3].bMuted = false;
}
}
doUpdateAllSoundsVolume();
}
static function doPauseCategory(__sCategoryName) {
var _local3 = 0;
for ( ; _local3 < aSounds.length ; _local3++) {
if (aSounds[_local3].Category == __sCategoryName) {
aSounds[_local3].doPause();
}
}
}
static function doUnPauseCategory(__sCategoryName) {
var _local3 = 0;
for ( ; _local3 < aSounds.length ; _local3++) {
if (aSounds[_local3].Category == __sCategoryName) {
aSounds[_local3].doResume();
}
}
}
static function doStopCategory(__sCategoryName) {
var _local3 = 0;
for ( ; _local3 < aSounds.length ; _local3++) {
if (aSounds[_local3].Category == __sCategoryName) {
aSounds[_local3].doStop();
}
}
}
static function setMasterVolume(__nVol) {
nMasterVolume = __nVol;
doUpdateAllSoundsVolume();
}
static function __get__NewSoundAllowed() {
return(aSounds.length < MAX_SOUNDS_PLAYING);
}
static function __get__MasterVolume() {
return(nMasterVolume);
}
static function doRemoveListenerFromAllSounds(__oListener) {
var _local3 = 0;
for ( ; _local3 < aSounds.length ; _local3++) {
aSounds[_local3].doRemoveListener(__oListener);
}
}
static function clearData() {
doRemoveListenerFromAllSounds();
var _local2 = 0;
for ( ; _local2 < aSounds.length ; _local2++) {
aSounds[_local2].clearData();
}
}
static function doUpdateAllSoundsVolume() {
var _local2 = 0;
for ( ; _local2 < aSounds.length ; _local2++) {
aSounds[_local2].doUpdateSound();
}
}
static function doCheckInit() {
if (!bInited) {
org.flashdevelop.utils.FlashConnect.trace("***** ERROR, NEED TO INIT SOUND MANAGER FIRST *****", "com.disney.gem.games.pizza_toss.utility.sndEngine::doCheckInit", "S:\\00738_32_WDIG_Goofy_Pizza_Toss\\4-Production\\Prog\\Integration\\080522\\Pizza Toss\\src/com/disney/gem/games/pizza_toss/utility/sndEngine.as", 282);
}
}
static function doManageCategory(__sCategoryName) {
doCheckInit();
var _local3 = false;
var _local4 = 0;
for ( ; _local4 < aSoundCategories.length ; _local4++) {
if (aSoundCategories[_local4].sName == __sCategoryName) {
_local3 = true;
}
}
if (!_local3) {
var _local5 = new Object();
_local5.sName = __sCategoryName;
_local5.nVolume = 100;
_local5.bMuted = false;
aSoundCategories.push(_local5);
}
}
static var EVENT_SOUND_COMPLETE = 1;
static var DEFAULT_CATEGORY = "SFX";
static var MAX_SOUNDS_PLAYING = 128;
static var bInited = false;
}
Symbol 2126 MovieClip [__Packages.com.disney.gem.games.pizza_toss.utility.sndItem] Frame 0
class com.disney.gem.games.pizza_toss.utility.sndItem
{
var sndObj, sLinkage, mcRef, nRemainingLoop, nCurrentVolume, nTargetVolume, nFadeRate, sCategory, bFadeAtEnd, bMuted, bPaused, bNeedFreshStart, nCurrentTime, aEventListeners, onComplete, bStopAfterFade;
function sndItem (__sndObject, __sLinkage, __nVolume, __nLoop, __sCategory, __mc) {
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;
sndObj.onSoundComplete = com.sarbakan.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 _local3 = 0;
for ( ; _local3 < aEventListeners.length ; _local3++) {
if (aEventListeners[_local3] == __oListener) {
delete aEventListeners[_local3];
aEventListeners.splice(_local3, 1);
}
}
}
function doSoundComplete() {
if (bNeedFreshStart && (nRemainingLoop > 1)) {
sndObj.start(0, nRemainingLoop - 1);
} else {
if (onComplete != undefined) {
onComplete();
}
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 setFadeRate(__nRate) {
if (__nRate == undefined) {
__nRate = FADE_RATE;
}
nFadeRate = __nRate;
}
function setFadeAtEnd(__bFadeAtEnd) {
bFadeAtEnd = __bFadeAtEnd;
}
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 clearData() {
sndObj.stop();
delete sndObj;
mcRef.removeMovieClip();
}
function doCheckFadeAtEnd() {
if (bFadeAtEnd) {
if (nRemainingLoop == 1) {
if ((sndObj.duration - nCurrentTime) <= FADE_AT_END_TIME) {
doFadeTo(0);
}
}
}
}
function doManageEndEvent() {
var _local2 = 0;
for ( ; _local2 < aEventListeners.length ; _local2++) {
aEventListeners[_local2].doSoundEvent(com.disney.gem.games.pizza_toss.utility.sndEngine.EVENT_SOUND_COMPLETE, this);
}
aEventListeners = new Array();
mcRef.removeMovieClip();
delete mcRef;
delete aEventListeners;
delete sndObj.onSoundComplete;
delete sndObj;
}
function doManageFade() {
if (nCurrentVolume != nTargetVolume) {
nCurrentVolume = com.sarbakan.utils.MoreMath.getReachNum(nCurrentVolume, nTargetVolume, nFadeRate);
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
}
if ((nCurrentVolume <= 0) && (bStopAfterFade)) {
sndObj.stop();
doManageEndEvent();
}
}
function returnComputedVolume(__nVolume) {
if ((!bMuted) && (!com.disney.gem.games.pizza_toss.utility.sndEngine.isCategoryMuted(sCategory))) {
var _local4 = com.disney.gem.games.pizza_toss.utility.sndEngine.MasterVolume / 100;
var _local5 = com.disney.gem.games.pizza_toss.utility.sndEngine.getCategoryVolume(sCategory) / 100;
var _local3 = __nVolume;
_local3 = _local3 * _local5;
_local3 = _local3 * _local4;
} else {
var _local3 = 0;
}
return(_local3);
}
static var FADE_RATE = 8;
static var FADE_AT_END_TIME = 800;
}
Symbol 2127 MovieClip [__Packages.com.sarbakan.utils.MoreMath] Frame 0
class com.sarbakan.utils.MoreMath
{
function MoreMath () {
}
static function getRandomRange(__nMin, __nMax) {
return(Math.floor(Math.random() * ((__nMax + 1) - __nMin)) + __nMin);
}
static function getPolarity(__nNum) {
var _local3 = 0;
if (__nNum < 0) {
_local3 = -1;
} else if (__nNum > 0) {
_local3 = 1;
}
return(_local3);
}
static function getReachZero(__nNum, __nReducer) {
return(getReachNum(__nNum, 0, __nReducer));
}
static function getReachNum(__nNum, __nTargetNum, __nReducer) {
var _local5 = __nNum;
if (_local5 != __nTargetNum) {
if (_local5 < __nTargetNum) {
_local5 = _local5 + __nReducer;
if (_local5 > __nTargetNum) {
_local5 = __nTargetNum;
}
} else {
_local5 = _local5 - __nReducer;
if (_local5 < __nTargetNum) {
_local5 = __nTargetNum;
}
}
}
return(_local5);
}
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 getManhattanDistance(_x1, _y1, _x2, _y2) {
return(Math.abs(_x1 - _x2) + Math.abs(_y1 - _y2));
}
static function getHypotenuse(__nDX, __nDY) {
return(Math.sqrt(Math.pow(__nDX, 2) + Math.pow(__nDY, 2)));
}
static function getAngle(__nX1, __nY1, __nX2, __nY2) {
var _local6 = __nX2 - __nX1;
var _local7 = __nY2 - __nY1;
var _local8 = Math.atan2(_local7, _local6);
var _local9 = getDegreeFromRadius(_local8);
return(_local9);
}
static function getCleanedAngle(_nAngle) {
while (_nAngle < 360) {
_nAngle = _nAngle + 360;
}
_nAngle = _nAngle % 360;
return(_nAngle);
}
static function getDegreeFromRadius(__nRadius) {
var _local3 = (__nRadius / MATH_PI) * 180;
return(_local3);
}
static function getRadianFromDegree(__nDegree) {
var _local3 = __nDegree * (MATH_PI / 180);
return(_local3);
}
static function getBoundsCenter(_oBox) {
var _local3 = (_oBox.xMin + _oBox.xMax) / 2;
var _local4 = (_oBox.yMin + _oBox.yMax) / 2;
return({x:_local3, y:_local4});
}
static var MATH_PI = Math.PI;
}
Symbol 2128 MovieClip [__Packages.com.disney.gem.games.pizza_toss.popups.MenuPopup] Frame 0
class com.disney.gem.games.pizza_toss.popups.MenuPopup extends com.sarbakan.utils.ScreenController
{
var hide, mcRef, oController;
function MenuPopup (_mcRef) {
super(_mcRef);
}
function onBtSound() {
playClick();
com.disney.gem.games.pizza_toss.Controller.Instance.toggleSound();
updateSoundGroup();
}
function onBtHelp() {
playClick();
hide(null, true);
com.disney.gem.games.pizza_toss.Controller.Instance.showInstructionScreen();
}
function onBtQuit() {
playClick();
hide(com.sarbakan.utils.Delegate.create(this, onHide), true);
}
function onBtResume() {
playClick();
com.disney.gem.games.pizza_toss.utility.Sounds.Unpause(com.disney.gem.games.pizza_toss.utility.Sounds.sSOUND_CAT_NAME);
com.disney.gem.games.pizza_toss.utility.Sounds.Unpause(com.disney.gem.games.pizza_toss.utility.Sounds.sAMBIENT_CAT_NAME);
com.disney.gem.games.pizza_toss.utility.Sounds.setMusic(com.disney.gem.games.pizza_toss.utility.Sounds.sMUSIC_INGAME);
hide(com.sarbakan.utils.Delegate.create(com.disney.gem.games.pizza_toss.Controller.Instance, com.disney.gem.games.pizza_toss.Controller.Instance.unpause));
}
function state_in_init() {
super.state_in_init();
setBts();
com.disney.gem.games.pizza_toss.utility.Sounds.Pause(com.disney.gem.games.pizza_toss.utility.Sounds.sSOUND_CAT_NAME);
com.disney.gem.games.pizza_toss.utility.Sounds.Pause(com.disney.gem.games.pizza_toss.utility.Sounds.sAMBIENT_CAT_NAME);
com.disney.gem.games.pizza_toss.utility.Sounds.setMusic(com.disney.gem.games.pizza_toss.utility.Sounds.sMUSIC_PACKAGING);
}
function state_idle_init() {
super.state_idle_init();
setBts();
}
function state_out_init() {
super.state_out_init();
setBts();
}
function onHide() {
com.disney.gem.games.pizza_toss.Controller.Instance.showPopup(new com.disney.gem.games.pizza_toss.popups.ConfirmPopup(com.disney.gem.games.pizza_toss.Controller.Instance.mcTimeline.mcPopups.mcConfirm, this), true);
}
function setBts() {
mcRef.mcState.mcContent.btHelp.onRelease = com.sarbakan.utils.Delegate.create(this, onBtHelp);
mcRef.mcState.mcContent.btHelp.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
mcRef.mcState.mcContent.btQuit.onRelease = com.sarbakan.utils.Delegate.create(this, onBtQuit);
mcRef.mcState.mcContent.btQuit.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
mcRef.mcState.mcContent.btResume.onRelease = com.sarbakan.utils.Delegate.create(this, onBtResume);
mcRef.mcState.mcContent.btResume.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
updateSoundGroup();
}
function updateSoundGroup() {
if (com.disney.gem.games.pizza_toss.Controller(oController).bSoundMuted) {
mcRef.mcState.mcContent.btSoundOn._visible = false;
mcRef.mcState.mcContent.btSoundOff._visible = true;
mcRef.mcState.mcContent.btSoundOff.onRelease = com.sarbakan.utils.Delegate.create(this, onBtSound);
mcRef.mcState.mcContent.btSoundOff.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
} else {
mcRef.mcState.mcContent.btSoundOff._visible = false;
mcRef.mcState.mcContent.btSoundOn._visible = true;
mcRef.mcState.mcContent.btSoundOn.onRelease = com.sarbakan.utils.Delegate.create(this, onBtSound);
mcRef.mcState.mcContent.btSoundOn.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
}
}
function playClick() {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_CLICK);
}
function playOver() {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_ROLLOVER, true, false);
}
}
Symbol 2129 MovieClip [__Packages.com.disney.gem.games.pizza_toss.popups.ConfirmPopup] Frame 0
class com.disney.gem.games.pizza_toss.popups.ConfirmPopup extends com.sarbakan.utils.ScreenController
{
var oMenuOrigin, hide, mcRef;
function ConfirmPopup (_mcRef, _oMenuOrigin) {
super(_mcRef);
oMenuOrigin = _oMenuOrigin;
}
function onBtNo() {
playClick();
hide(com.sarbakan.utils.Delegate.create(this, onHide));
}
function onBtYes() {
playClick();
hide();
com.disney.gem.games.pizza_toss.Controller.Instance.onGameLose();
}
function state_in_init() {
super.state_in_init();
setBts();
}
function state_idle_init() {
super.state_idle_init();
setBts();
}
function state_out_init() {
super.state_out_init();
setBts();
}
function onHide() {
oMenuOrigin.show(true);
}
function setBts() {
mcRef.mcState.mcContent.btNo.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNo);
mcRef.mcState.mcContent.btNo.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
mcRef.mcState.mcContent.btYes.onRelease = com.sarbakan.utils.Delegate.create(this, onBtYes);
mcRef.mcState.mcContent.btYes.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
}
function playClick() {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_CLICK);
}
function playOver() {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_ROLLOVER, true, false);
}
}
Symbol 2130 MovieClip [__Packages.com.disney.gem.games.pizza_toss.events.EventDispatcher] Frame 0
class com.disney.gem.games.pizza_toss.events.EventDispatcher
{
var oListener, bEnabled;
function EventDispatcher () {
oListener = new Object();
bEnabled = true;
}
function dispatchEvent(_oEvt, _oOwner) {
if (bEnabled && (hasEventListener(_oEvt.type))) {
_oEvt.target = this;
var _local4 = oListener[_oEvt.type];
var _local5 = _local4.length;
var _local6 = _local5 - 1;
for ( ; _local6 > -1 ; _local6--) {
var _local7 = _local4[_local6];
_local7.func.apply(_local7.owner, [_oEvt, _oOwner]);
}
return(true);
}
return(false);
}
function addEventListener(_sType, _fFunc, _oOwner) {
if (oListener[_sType] == undefined) {
oListener[_sType] = new Array();
}
if (findListener(_sType, _fFunc, _oOwner) == -1) {
oListener[_sType].push({func:_fFunc, owner:_oOwner});
return(true);
}
return(false);
}
function removeEventListener(_sType, _fFunc, _oOwner) {
if ((_sType != undefined) && ((_fFunc != undefined) && (_oOwner != undefined))) {
var _local5 = findListener(_sType, _fFunc, _oOwner);
if (_local5 > -1) {
oListener[_sType].splice(_local5, 1);
return(true);
}
return(false);
}
return(false);
}
function clearListeners() {
oListener = new Object();
}
function hasEventListener(_sType) {
return(oListener[_sType].length > 0);
}
function hasEventListeners(_sType) {
return(oListener[_sType].length);
}
function findListener(_sType, _fFunc, _oOwner) {
var _local5 = oListener[_sType];
var _local6 = _local5.length;
var _local7 = -1;
var _local8 = _local6 - 1;
for ( ; _local8 > -1 ; _local8--) {
if ((_local5[_local8].owner == _oOwner) && (_local5[_local8].func == _fFunc)) {
_local7 = _local8;
break;
}
}
return(_local7);
}
function get enabled() {
return(bEnabled);
}
function set enabled(_bEnabled) {
bEnabled = _bEnabled;
//return(enabled);
}
}
Symbol 2131 MovieClip [__Packages.com.disney.gem.games.pizza_toss.events.Event] Frame 0
class com.disney.gem.games.pizza_toss.events.Event
{
var sType, sFrom, sMore, oTarget;
function Event (_sType, _sFrom, _sMore) {
sType = _sType;
sFrom = _sFrom;
sMore = _sMore;
}
function set target(_oTarget) {
oTarget = _oTarget;
//return(target);
}
function get target() {
return(oTarget);
}
function get type() {
return(sType);
}
function get from() {
return(sFrom);
}
function get more() {
return(sMore);
}
function toString() {
return(((("[Event type=\"" + sType) + "\" from=\"") + sFrom) + "\"]");
}
static var COLLIDE = "collide";
static var TEST = "test";
static var COLLIDE_HD = "collide_hd";
static var TEST_LOW = "test_low";
static var TEST_HIGH = "test_high";
static var FINISH = "finish";
static var DESTROY = "destroy";
static var FOLLOW = "follow";
static var POSITION = "position";
}
Symbol 2132 MovieClip [__Packages.com.disney.gem.games.pizza_toss.scroller.ScrollerEngine] Frame 0
class com.disney.gem.games.pizza_toss.scroller.ScrollerEngine
{
var oOwner, oViewport, aItems, aActivated, nSpeed;
function ScrollerEngine (_oOwner) {
oOwner = _oOwner;
reset();
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.FOLLOW, setSpeed, this);
}
function preActivate() {
var _local2 = Math.floor(oViewport.right / nSLICE);
var _local3 = Math.floor(oViewport.left / nSLICE);
var _local4 = _local3;
for ( ; _local4 < _local2 ; _local4++) {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event("activate_" + _local4), this);
}
}
function addItem(_sName, _nX) {
var _local4 = {name:_sName, x:_nX};
if (indexOf(aItems, _local4) == -1) {
aItems.push(_local4);
}
}
function removeItem(_sName, _nX) {
var _local4 = {name:_sName, x:_nX};
var _local5 = indexOf(aItems, _local4);
if (_local5 > -1) {
aItems.splice(_local5, 1);
}
}
function reset() {
oViewport = {left:-630, right:630};
aItems = new Array();
aActivated = new Array();
nSpeed = 0;
}
function stopListening() {
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.FOLLOW, setSpeed, this);
}
function setSpeed(_oEvt, _oObj) {
nSpeed = Number(_oEvt.more);
}
function update() {
oViewport.left = oViewport.left + nSpeed;
oViewport.right = oViewport.right + nSpeed;
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event("activate_" + Math.floor(oViewport.right / nSLICE)), this);
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event("deactivate_" + Math.floor(oViewport.left / nSLICE)), this);
}
function indexOf(_aArr, _oObj) {
var _local4 = -1;
var _local5 = 0;
for ( ; _local5 < _aArr.length ; _local5++) {
if (_aArr[_local5] == _oObj) {
_local4 = _local5;
break;
}
}
return(_local4);
}
function get speed() {
return(nSpeed);
}
static var nSLICE = com.disney.gem.games.pizza_toss.Config.Defaults.Slice;
}
Symbol 2133 MovieClip [__Packages.com.disney.gem.games.pizza_toss.ItemCacher] Frame 0
class com.disney.gem.games.pizza_toss.ItemCacher
{
function ItemCacher () {
}
}
Symbol 2134 MovieClip [__Packages.com.disney.gem.games.pizza_toss.collisions.CollideItem] Frame 0
class com.disney.gem.games.pizza_toss.collisions.CollideItem extends com.sarbakan.utils.StateManaged
{
var nSpeedX, nSpeedY, oTopLeft, oBottomRight, oTarget, sState, sClass, sNextState, checkStateChange, mcRef, sType, Mc;
function CollideItem () {
super(undefined);
nSpeedX = 0;
nSpeedY = 0;
}
function topLeft(_oTP) {
oTopLeft = _oTP;
}
function bottomRight(_oBR) {
oBottomRight = _oBR;
}
function setTarget(_oTarget) {
oTarget = _oTarget;
}
function Collide(_oEvt, _oObj) {
var _local4 = left + speedX;
var _local5 = top + speedY;
var _local6 = right + speedX;
var _local7 = bottom + speedY;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(left, top, right, bottom, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local13 > -1) || (_local12 > -1)) {
var _local14 = fromWhere(_local13);
_oEvt.target.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE, _local14), this);
}
}
function fromWhere(_nFrom) {
switch (_nFrom) {
case 0 :
case 1 :
case 2 :
case 9 :
var _local3 = "top";
break;
case 3 :
case 11 :
case 14 :
case 16 :
_local3 = "left";
break;
case 5 :
case 12 :
case 15 :
case 17 :
_local3 = "right";
break;
case 6 :
case 7 :
case 8 :
case 10 :
_local3 = "bottom";
break;
case 4 :
_local3 = "center";
break;
case 13 :
_local3 = "over";
break;
default :
_local3 = "undefined";
}
return(_local3);
}
function testCollide(_nX1A, _nY1A, _nX2A, _nY2A, _nX1B, _nY1B, _nX2B, _nY2B) {
var _local10 = ((_nX1A < _nX2A) ? (_nX1A) : (_nX2A));
var _local11 = ((_nX1A < _nX2A) ? (_nX2A) : (_nX1A));
var _local12 = ((_nY1A < _nY2A) ? (_nY1A) : (_nY2A));
var _local13 = ((_nY1A < _nY2A) ? (_nY2A) : (_nY1A));
var _local14 = ((_nX1B < _nX2B) ? (_nX1B) : (_nX2B));
var _local15 = ((_nX1B < _nX2B) ? (_nX2B) : (_nX1B));
var _local16 = ((_nY1B < _nY2B) ? (_nY1B) : (_nY2B));
var _local17 = ((_nY1B < _nY2B) ? (_nY2B) : (_nY1B));
var _local18 = -1;
if ((_local15 > _local10) && ((_local17 > _local12) && ((_local14 < _local10) && (_local16 < _local12)))) {
_local18 = (((_local15 - _local10) > (_local17 - _local12)) ? 0 : 14);
} else if ((_local15 < _local11) && ((_local17 > _local12) && ((_local14 > _local10) && (_local16 < _local12)))) {
_local18 = 1;
} else if ((_local15 > _local11) && ((_local17 > _local12) && ((_local14 < _local11) && (_local16 < _local12)))) {
_local18 = (((_local11 - _local14) > (_local17 - _local12)) ? 2 : 15);
} else if ((_local15 > _local10) && ((_local17 < _local13) && ((_local14 < _local10) && (_local16 > _local12)))) {
_local18 = 3;
} else if ((_local15 < _local11) && ((_local17 < _local13) && ((_local14 > _local10) && (_local16 > _local12)))) {
_local18 = 4;
} else if ((_local15 > _local11) && ((_local17 < _local13) && ((_local14 < _local11) && (_local16 > _local12)))) {
_local18 = 5;
} else if ((_local15 > _local10) && ((_local17 > _local13) && ((_local14 < _local10) && (_local16 < _local13)))) {
_local18 = (((_local15 - _local10) > (_local13 - _local16)) ? 6 : 16);
} else if ((_local15 < _local11) && ((_local17 > _local13) && ((_local14 > _local10) && (_local16 < _local13)))) {
_local18 = 7;
} else if ((_local15 > _local11) && ((_local17 > _local13) && ((_local14 < _local11) && (_local16 < _local13)))) {
_local18 = (((_local11 - _local14) > (_local13 - _local16)) ? 8 : 17);
} else if ((_local15 > _local11) && ((_local14 < _local10) && ((_local17 > _local12) && (_local16 < _local12)))) {
_local18 = 9;
} else if ((_local15 > _local11) && ((_local14 < _local10) && ((_local16 < _local13) && (_local17 > _local13)))) {
_local18 = 10;
} else if ((_local15 > _local10) && ((_local14 < _local10) && ((_local16 < _local12) && (_local17 > _local13)))) {
_local18 = 11;
} else if ((_local15 > _local11) && ((_local14 < _local11) && ((_local16 < _local12) && (_local17 > _local13)))) {
_local18 = 12;
} else if ((_local15 > _local11) && ((_local14 < _local10) && ((_local16 < _local12) && (_local17 > _local13)))) {
_local18 = 13;
}
return(_local18);
}
function startListening() {
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function stopListening() {
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function stateIsOneOf() {
var _local2 = false;
var _local3 = 0;
for ( ; _local3 < arguments.length ; _local3++) {
if (sState == arguments[_local3]) {
_local2 = true;
break;
}
}
return(_local2);
}
function stateAvailable(_sState) {
var _local3 = false;
if (com.disney.gem.games.pizza_toss.datas.StatesSwitch[sClass][sState][_sState] || (sState == undefined)) {
_local3 = true;
}
return(_local3);
}
function setState(_sState, _bInstant, _bForce) {
var _local5 = stateAvailable(_sState);
if (_local5) {
sNextState = _sState;
if (_bInstant) {
checkStateChange();
}
if (_bForce) {
mcRef.mcState.gotoAndPlay(1);
}
}
}
function destroy() {
stopListening();
com.sarbakan.BaseDisneyController.getInstance().oMainBroadcaster.removeListener(this);
mcRef.removeMovieClip();
super.destroy();
}
function get x() {
return(mcRef._x);
}
function get y() {
return(mcRef._y);
}
function get top() {
return(oTopLeft._y + y);
}
function get bottom() {
return(oBottomRight._y + y);
}
function get left() {
return(oTopLeft._x + x);
}
function get right() {
return(oBottomRight._x + x);
}
function get speedX() {
return(nSpeedX);
}
function set speedX(_nSpeedX) {
nSpeedX = _nSpeedX;
//return(speedX);
}
function get speedY() {
return(nSpeedY);
}
function set speedY(_nSpeedY) {
nSpeedY = _nSpeedY;
//return(speedY);
}
function set x(_nX) {
mcRef._x = _nX;
//return(x);
}
function set y(_nY) {
mcRef._y = _nY;
//return(y);
}
function get type() {
return(sType);
}
function get name() {
return(Mc._name);
}
}
Symbol 2135 MovieClip [__Packages.com.disney.gem.games.pizza_toss.datas.StatesSwitch] Frame 0
class com.disney.gem.games.pizza_toss.datas.StatesSwitch
{
function StatesSwitch () {
}
static var Car1 = {idle:{idle:true}};
static var Car2 = {idle:{idle:true}};
static var Copse = {idle:{idle:true}};
static var Fireborn = {idle:{bump:true, idle:true}, bump:{idle:true}};
static var GasTank = {idle:{idle:true, picked:true}, picked:{}};
static var Hotdog = {idle:{idle:true, hit_wall:true, hit_ground:true}, hit_wall:{}, hit_ground:{}};
static var HotDogBox = {idle:{idle:true, picked:true}, picked:{}};
static var House1 = {door_out:{door_idle:true, door_catch:true}, door_in:{door_closed:true}, door_catch:{door_closed:true}, door_idle:{door_catch:true, door_idle:true, door_missed:true}, door_missed:{door_in:true, door_catch:true}, door_closed:{door_out:true, window_out:true}, window_out:{window_idle:true, window_catch:true}, window_in:{window_closed:true}, window_catch:{window_closed:true}, window_idle:{window_catch:true, window_idle:true, window_missed:true}, window_missed:{window_in:true, window_catch:true}, window_closed:{door_out:true, window_out:true}};
static var House2 = {door_out:{door_idle:true, door_catch:true}, door_in:{door_closed:true}, door_catch:{door_closed:true}, door_idle:{door_catch:true, door_idle:true, door_missed:true}, door_missed:{door_in:true, door_catch:true}, door_closed:{door_out:true, window_out:true}, window_out:{window_idle:true, window_catch:true}, window_in:{window_closed:true}, window_catch:{window_closed:true}, window_idle:{window_catch:true, window_idle:true, window_missed:true}, window_missed:{window_in:true, window_catch:true}, window_closed:{door_out:true, window_out:true}};
static var House3 = {door_out:{door_idle:true, door_catch:true}, door_in:{door_closed:true}, door_catch:{door_closed:true}, door_idle:{door_catch:true, door_idle:true, door_missed:true}, door_missed:{door_in:true, door_catch:true}, door_closed:{door_out:true, window_out:true}, window_out:{window_idle:true, window_catch:true}, window_in:{window_closed:true}, window_catch:{window_closed:true}, window_idle:{window_catch:true, window_idle:true, window_missed:true}, window_missed:{window_in:true, window_catch:true}, window_closed:{door_out:true, window_out:true}};
static var House4 = {door_out:{door_idle:true, door_catch:true}, door_in:{door_closed:true}, door_catch:{door_closed:true}, door_idle:{door_catch:true, door_idle:true, door_missed:true}, door_missed:{door_in:true, door_catch:true}, door_closed:{door_out:true, window_out:true}, window_out:{window_idle:true, window_catch:true}, window_in:{window_closed:true}, window_catch:{window_closed:true}, window_idle:{window_catch:true, window_idle:true, window_missed:true}, window_missed:{window_in:true, window_catch:true}, window_closed:{door_out:true, window_out:true}};
static var House5 = {door_out:{door_idle:true, door_catch:true}, door_in:{door_closed:true}, door_catch:{door_closed:true}, door_idle:{door_catch:true, door_idle:true, door_missed:true}, door_missed:{door_in:true, door_catch:true}, door_closed:{door_out:true, window_out:true}, window_out:{window_idle:true, window_catch:true}, window_in:{window_closed:true}, window_catch:{window_closed:true}, window_idle:{window_catch:true, window_idle:true, window_missed:true}, window_missed:{window_in:true, window_catch:true}, window_closed:{door_out:true, window_out:true}};
static var HotDog = {idle:{idle:true, hit_wall:true, hit_ground:true}, hit_wall:{}, hit_ground:{}};
static var Kid = {idle:{idle:true, scared:true}, scared:{fall:true}, fall:{fall:true}};
static var Mailbox1 = {idle:{idle:true}};
static var Mailbox2 = {idle:{idle:true}};
static var Mailbox3 = {idle:{idle:true}};
static var Mailbox4 = {idle:{idle:true}};
static var Manhole = {idle:{idle:true}};
static var Mickey = {idle:{idle:true}};
static var OldDude = {idle:{idle:true, scared_in:true, fall_in:true}, scared_in:{scared_idle:true}, scared_idle:{scared_idle:true}, fall_in:{fall_idle:true}, fall_idle:{fall_idle:true}};
static var Player = {idle:{idle:true, idle_quick:true, accelerate:true, slow_down:true, bump_obstacle:true, bump_water:true, crash:true, pick_hotdog:true}, idle_quick:{idle:true, idle_quick:true, slow_down:true, bump_obstacle:true, bump_water:true, crash:true, pick_hotdog:true}, accelerate:{idle_quick:true, slow_down:true, bump_obstacle:true, bump_water:true, crash:true}, slow_down:{idle:true, accelerate:true, bump_obstacle:true, bump_water:true, crash:true}, bump_obstacle:{idle:true, crash:true}, bump_water:{idle:true, idle_quick:true, crash:true}, crash:{crash_idle:true}, crash_idle:{idle:true, crash_idle:true}, pick_hotdog:{throw_hotdog:true, crash:true}, throw_hotdog:{idle:true, idle_quick:true, accelerate:true, slow_down:true, crash:true}};
static var RoadCiment = {idle:{idle:true}};
static var RoadRock = {idle:{idle:true}};
static var SmallTree = {idle:{idle:true}};
static var StreetLight = {idle:{idle:true, closed:true}, closed:{idle:true, closed:true}};
static var StreetLightSpot = {idle:{idle:true, hidden:true}, hidden:{idle:true, hidden:true}};
static var Tree = {idle:{idle:true}};
static var Wall = {idle:{idle:true}};
static var Weiner = {idle:{idle:true, run:true}, run:{run:true, bump:true}, bump:{bump_idle:true}, bump_idle:{bump_idle:true}};
}
Symbol 2136 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.Player] Frame 0
class com.disney.gem.games.pizza_toss.elements.Player extends com.disney.gem.games.pizza_toss.collisions.CollideItem
{
var oOwner, oItem, bBraking, bAccelerating, bTossing, sClass, nFrame, nSlowFrame, nMaxSpeedX, setMC, mcRef, topLeft, bottomRight, setState, setTarget, oTarget, nSpeedX, destroy, bCrashing, stateIsNot, nSpeedY, sHeight, bottom, top, right, y, left, sLastTouch, x, oClient, stateFinished;
function Player (_oOwner, _aProperties, _oItem) {
super();
oOwner = _oOwner;
oItem = _oItem;
bBraking = false;
bAccelerating = false;
bTossing = false;
sClass = "Player";
nFrame = 0;
nSlowFrame = 0;
nMaxSpeedX = com.disney.gem.games.pizza_toss.Config.Player.MaxSpeedX;
oOwner.mcGame.mcInner.attachMovie("mcPlayer", "mcPlayer", _oItem.depth);
setMC(oOwner.mcGame.mcInner.mcPlayer);
var _local6 = 0;
for ( ; _local6 < _aProperties.length ; _local6++) {
mcRef[_aProperties[_local6][0]] = _aProperties[_local6][1];
}
oOwner.displayed.push({mc:mcRef, x:mcRef._x, y:mcRef._y, depth:mcRef.getDepth()});
topLeft(mcRef.mcTopLeft);
bottomRight(mcRef.mcBottomRight);
mcRef.mcTopLeft._visible = false;
mcRef.mcBottomRight._visible = false;
setState(STATE_IDLE, true);
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_IDLE, true, false);
setTarget(com.disney.gem.games.pizza_toss.Controller.Instance.Game.dispatcher);
com.disney.gem.games.pizza_toss.Controller.Instance.oMainBroadcaster.addListener(this);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.COLLIDE, collideWith, this);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.FINISH, onFinish, this);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.DESTROY, onDestroy, this);
}
function onUpdate() {
super.onUpdate();
checkControl();
oTarget.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.TEST), this);
com.disney.gem.games.pizza_toss.Stats.fuel = com.disney.gem.games.pizza_toss.Stats.fuel - (com.disney.gem.games.pizza_toss.Config.Defaults.FuelByPixel * nSpeedX);
if (nSlowFrame > 0) {
nSlowFrame--;
if (nSlowFrame <= 0) {
nSlowFrame = 0;
nMaxSpeedX = com.disney.gem.games.pizza_toss.Config.Player.MaxSpeedX;
}
}
oTarget.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.FOLLOW, "", String(nSpeedX)), this);
move();
}
function onDestroy() {
var _local2 = 0;
for ( ; _local2 < oOwner.displayed.length ; _local2++) {
if (oOwner.displayed[_local2] == mcRef) {
oOwner.displayed.splice(_local2, 1);
break;
}
}
com.sarbakan.BaseDisneyController.getInstance().oMainBroadcaster.removeListener(this);
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.FINISH, onFinish, this);
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.DESTROY, onDestroy, this);
destroy();
}
function checkControl() {
if (!bCrashing) {
if (com.disney.gem.games.pizza_toss.utility.Keys.isPressed(com.disney.gem.games.pizza_toss.Config.Control.Left) && (com.disney.gem.games.pizza_toss.utility.Keys.isNotPressed(com.disney.gem.games.pizza_toss.Config.Control.Right) && (stateIsNot(STATE_CRASH)))) {
turn(-com.disney.gem.games.pizza_toss.Config.Player.TurnLeft);
} else if (com.disney.gem.games.pizza_toss.utility.Keys.isPressed(com.disney.gem.games.pizza_toss.Config.Control.Right) && (com.disney.gem.games.pizza_toss.utility.Keys.isNotPressed(com.disney.gem.games.pizza_toss.Config.Control.Left) && (stateIsNot(STATE_CRASH)))) {
turn(com.disney.gem.games.pizza_toss.Config.Player.TurnRight);
} else if (com.disney.gem.games.pizza_toss.utility.Keys.areNotPressed(com.disney.gem.games.pizza_toss.Config.Control.Left, com.disney.gem.games.pizza_toss.Config.Control.Right)) {
turn(0);
}
if (com.disney.gem.games.pizza_toss.utility.Keys.isPressed(com.disney.gem.games.pizza_toss.Config.Control.Brake)) {
decelerate(com.disney.gem.games.pizza_toss.Config.Player.Brake);
bAccelerating = false;
} else if (com.disney.gem.games.pizza_toss.utility.Keys.isNotPressed(com.disney.gem.games.pizza_toss.Config.Control.Brake)) {
accelerate(com.disney.gem.games.pizza_toss.Config.Player.Accelerate);
bBraking = false;
}
if (com.disney.gem.games.pizza_toss.utility.Keys.isPressed(com.disney.gem.games.pizza_toss.Config.Control.TossHigh) && (com.disney.gem.games.pizza_toss.utility.Keys.isNotPressed(com.disney.gem.games.pizza_toss.Config.Control.TossLow))) {
tossHigh();
} else if (com.disney.gem.games.pizza_toss.utility.Keys.isPressed(com.disney.gem.games.pizza_toss.Config.Control.TossLow) && (com.disney.gem.games.pizza_toss.utility.Keys.isNotPressed(com.disney.gem.games.pizza_toss.Config.Control.TossHigh))) {
tossLow();
}
}
}
function move() {
mcRef._x = mcRef._x + nSpeedX;
mcRef._y = mcRef._y + nSpeedY;
}
function turn(_nSpeedY) {
nSpeedY = _nSpeedY;
}
function decelerate(_nSpeedX) {
if (stateIsNot(STATE_CRASH)) {
nSpeedX = nSpeedX - _nSpeedX;
if ((!bBraking) && (nSlowFrame > 0)) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_BREAK, true, false);
setState(STATE_BREAK, true);
bBraking = true;
}
if (nSpeedX < com.disney.gem.games.pizza_toss.Config.Player.MinSpeedX) {
nSpeedX = com.disney.gem.games.pizza_toss.Config.Player.MinSpeedX;
}
}
}
function accelerate(_nSpeedX) {
if (stateIsNot(STATE_CRASH)) {
nSpeedX = nSpeedX + _nSpeedX;
if ((!bAccelerating) && (nSlowFrame > 0)) {
}
if (nSpeedX > nMaxSpeedX) {
nSpeedX = nMaxSpeedX;
}
}
}
function tossHigh() {
if ((!bTossing) && (com.disney.gem.games.pizza_toss.Stats.hotdogs > 0)) {
bTossing = true;
sHeight = "High";
com.disney.gem.games.pizza_toss.Stats.hotdogs--;
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_PICKUP, true, false);
setState(STATE_PICK_HOTDOG, true);
}
}
function tossLow() {
if ((!bTossing) && (com.disney.gem.games.pizza_toss.Stats.hotdogs > 0)) {
bTossing = true;
sHeight = "Low";
com.disney.gem.games.pizza_toss.Stats.hotdogs--;
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_PICKUP, true, false);
setState(STATE_PICK_HOTDOG, true);
}
}
function collideWith(_oEvt, _oObj) {
if (_oEvt.from != undefined) {
switch (_oObj.type) {
case "collider" :
onCollider(_oEvt, _oObj);
break;
case "bonus" :
onBonus(_oEvt, _oObj);
break;
case "slowdown" :
onSlowDown(_oEvt, _oObj);
break;
case "crash" :
onCrash(_oEvt, _oObj);
}
}
}
function onCollider(_oEvt, _oObj) {
if (_oEvt.from == "top") {
nSpeedY = _oObj.top - bottom;
} else if (_oEvt.from == "bottom") {
nSpeedY = _oObj.bottom - top;
}
}
function onBonus(_oEvt, _oObj) {
if (_oObj.sBonus == "Hotdog") {
com.disney.gem.games.pizza_toss.Stats.hotdogs = com.disney.gem.games.pizza_toss.Stats.hotdogs + com.disney.gem.games.pizza_toss.Config.Bonus.HotdogBox.Hotdogs;
} else if (_oObj.sBonus == "Fuel") {
com.disney.gem.games.pizza_toss.Stats.fuel = com.disney.gem.games.pizza_toss.Stats.fuel + com.disney.gem.games.pizza_toss.Config.Bonus.GasTank.Fuel;
}
_oObj.pickUp();
}
function onWater(_oEvt, _oObj) {
if (nFrame <= 0) {
var _local4 = com.disney.gem.games.pizza_toss.collisions.LineCollision.check(right, y, right + nSpeedX, y + nSpeedY, _oObj.crosses.one._x + _oObj.x, _oObj.crosses.one._y + _oObj.y, _oObj.crosses.two._x + _oObj.x, _oObj.crosses.two._y + _oObj.y);
if (_local4.cross) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_WATER, true, false);
setState(STATE_BUMP_WATER, true);
nMaxSpeedX = com.disney.gem.games.pizza_toss.Config.Player.SlowSpeedX;
nSlowFrame = com.disney.gem.games.pizza_toss.Config.Player.SlowTime;
} else {
_local4 = com.disney.gem.games.pizza_toss.collisions.LineCollision.check(left, y, right, y, _oObj.crosses.one._x + _oObj.x, _oObj.crosses.one._y + _oObj.y, _oObj.crosses.two._x + _oObj.x, _oObj.crosses.two._y + _oObj.y);
if (_local4.cross) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_WATER, true, false);
setState(STATE_BUMP_WATER, true);
nMaxSpeedX = com.disney.gem.games.pizza_toss.Config.Player.SlowSpeedX;
nSlowFrame = com.disney.gem.games.pizza_toss.Config.Player.SlowTime;
}
}
}
}
function onSlow(_oEvt, _oObj) {
if (nFrame <= 0) {
var _local4 = com.disney.gem.games.pizza_toss.collisions.LineCollision.check(right, y, right + nSpeedX, y + nSpeedY, _oObj.crosses.one._x + _oObj.x, _oObj.crosses.one._y + _oObj.y, _oObj.crosses.two._x + _oObj.x, _oObj.crosses.two._y + _oObj.y);
if (_local4.cross) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_BUMP, true, false);
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_MANHOLE, true, false);
decelerate(com.disney.gem.games.pizza_toss.Config.Player.Brake);
bAccelerating = false;
bTossing = false;
setState(STATE_BUMP_OBSTACLE, true);
nMaxSpeedX = com.disney.gem.games.pizza_toss.Config.Player.SlowSpeedX;
nSlowFrame = com.disney.gem.games.pizza_toss.Config.Player.SlowTime;
} else {
_local4 = com.disney.gem.games.pizza_toss.collisions.LineCollision.check(left, y, right, y, _oObj.crosses.one._x + _oObj.x, _oObj.crosses.one._y + _oObj.y, _oObj.crosses.two._x + _oObj.x, _oObj.crosses.two._y + _oObj.y);
if (_local4.cross) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_BUMP, true, false);
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_MANHOLE, true, false);
decelerate(com.disney.gem.games.pizza_toss.Config.Player.Brake);
bAccelerating = false;
bTossing = false;
setState(STATE_BUMP_OBSTACLE, true);
nMaxSpeedX = com.disney.gem.games.pizza_toss.Config.Player.SlowSpeedX;
nSlowFrame = com.disney.gem.games.pizza_toss.Config.Player.SlowTime;
}
}
}
}
function onCrash(_oEvt, _oObj) {
if (nFrame <= 0) {
if (_oObj.sCrash == "OldDude") {
if (top < _oObj.limit) {
_oObj.fall();
var _local4 = com.disney.gem.games.pizza_toss.collisions.LineCollision.check(left, y, right, y, _oObj.crosses.one._x + _oObj.x, _oObj.crosses.one._y + _oObj.y, _oObj.crosses.two._x + _oObj.x, _oObj.crosses.two._y + _oObj.y);
if (_local4.cross) {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_IDLE);
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_CRASH, true, false);
setState(STATE_CRASH, true);
bCrashing = true;
nSpeedX = 0;
nMaxSpeedX = com.disney.gem.games.pizza_toss.Config.Player.SlowSpeedX;
nSlowFrame = com.disney.gem.games.pizza_toss.Config.Player.SlowTime;
com.disney.gem.games.pizza_toss.Stats.hotdogs = com.disney.gem.games.pizza_toss.Stats.hotdogs - com.disney.gem.games.pizza_toss.Config.Penalities.Crash;
}
} else {
_oObj.scared();
}
} else if (_oObj.sCrash == "Kid") {
_oObj.scared();
var _local5 = com.disney.gem.games.pizza_toss.collisions.LineCollision.check(left, y, right, y, _oObj.crosses.one._x + _oObj.x, _oObj.crosses.one._y + _oObj.y, _oObj.crosses.two._x + _oObj.x, _oObj.crosses.two._y + _oObj.y);
if (_local5.cross) {
setState(STATE_CRASH, true);
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_IDLE);
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_CRASH, true, false);
bCrashing = true;
nSpeedX = 0;
nMaxSpeedX = com.disney.gem.games.pizza_toss.Config.Player.SlowSpeedX;
nSlowFrame = com.disney.gem.games.pizza_toss.Config.Player.SlowTime;
com.disney.gem.games.pizza_toss.Stats.hotdogs = com.disney.gem.games.pizza_toss.Stats.hotdogs - com.disney.gem.games.pizza_toss.Config.Penalities.Crash;
}
} else if (_oObj.sCrash == "Car") {
var _local6 = com.disney.gem.games.pizza_toss.collisions.LineCollision.check(right, y, right + nSpeedX, y + nSpeedY, _oObj.crosses.one._x + _oObj.x, _oObj.crosses.one._y + _oObj.y, _oObj.crosses.two._x + _oObj.x, _oObj.crosses.two._y + _oObj.y);
if (_local6.cross) {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_IDLE);
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_CRASH, true, false);
setState(STATE_CRASH, true);
bCrashing = true;
nSpeedX = 0;
nMaxSpeedX = com.disney.gem.games.pizza_toss.Config.Player.SlowSpeedX;
nSlowFrame = com.disney.gem.games.pizza_toss.Config.Player.SlowTime;
com.disney.gem.games.pizza_toss.Stats.hotdogs = com.disney.gem.games.pizza_toss.Stats.hotdogs - com.disney.gem.games.pizza_toss.Config.Penalities.Crash;
}
} else if (_oObj.sCrash == "Weiner") {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_IDLE);
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_CRASH, true, false);
setState(STATE_CRASH, true);
_oObj.bump();
bCrashing = true;
nSpeedX = 0;
nMaxSpeedX = com.disney.gem.games.pizza_toss.Config.Player.SlowSpeedX;
nSlowFrame = com.disney.gem.games.pizza_toss.Config.Player.SlowTime;
com.disney.gem.games.pizza_toss.Stats.hotdogs = com.disney.gem.games.pizza_toss.Stats.hotdogs - com.disney.gem.games.pizza_toss.Config.Penalities.Crash;
}
}
}
function onSlowDown(_oEvt, _oObj) {
if (nFrame <= 0) {
if (_oObj.sSlow == "Water") {
onWater(_oEvt, _oObj);
} else {
onSlow(_oEvt, _oObj);
}
if (sLastTouch != _oObj.name) {
com.disney.gem.games.pizza_toss.Stats.hotdogs = com.disney.gem.games.pizza_toss.Stats.hotdogs - com.disney.gem.games.pizza_toss.Config.Penalities.SlowDown;
sLastTouch = _oObj.name;
}
}
}
function onFinish(_oEvt, _oObj) {
if (x > _oObj.end) {
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.FINISH, onFinish, this);
oOwner.onGameEnd();
}
}
function tossHotDog() {
var _local2 = getSpeeds();
var _local3 = new Object();
_local3.x = x - 9.6;
_local3.y = y - 56;
_local3.speedX = _local2.x;
_local3.speedY = _local2.y;
_local3.left = _local3.x;
_local3.right = _local3.x;
_local3.linkage = "mcHotdog";
_local3.name = "Hotdog";
_local3.depth = oOwner.getItemDepth();
_local3.type = sHeight;
var _local4 = oOwner.getProperties(_local3);
oOwner.objectsList.push(new com.disney.gem.games.pizza_toss.elements.items.HotDog(oOwner, _local4, _local3));
}
function getSpeeds() {
var _local2 = new Object();
var _local3 = getDefaultAngle();
if (clientInRange()) {
_local3 = getClientAngle();
if (_local3 > 180) {
_local3 = _local3 + -360;
}
}
_local2.x = Math.sin(_local3 * (Math.PI / 180)) * com.disney.gem.games.pizza_toss.Config.Defaults.HotdogSpeed;
_local2.y = (Math.cos(_local3 * (Math.PI / 180)) * com.disney.gem.games.pizza_toss.Config.Defaults.HotdogSpeed) * -1;
return(_local2);
}
function getDefaultAngle() {
return(com.disney.gem.games.pizza_toss.Config.HotDogAngle[sHeight].Normal);
}
function clientInRange() {
var _local2 = false;
var _local3 = 0;
var _local4 = 0;
for ( ; _local4 <= oOwner.objectsList.length ; _local4++) {
if (oOwner.objectsList[_local4].bClient) {
_local3 = ((Math.atan2(oOwner.objectsList[_local4].y - y, oOwner.objectsList[_local4].x - x) * 180) / Math.PI) + 90;
if (_local3 > 180) {
_local3 = _local3 + -360;
}
if ((_local3 >= getMinAngle()) && (_local3 <= getMaxAngle())) {
oClient = oOwner.objectsList[_local4];
_local2 = true;
break;
}
}
}
return(_local2);
}
function getMinAngle() {
return(com.disney.gem.games.pizza_toss.Config.HotDogAngle[sHeight].Min);
}
function getMaxAngle() {
return(com.disney.gem.games.pizza_toss.Config.HotDogAngle[sHeight].Max);
}
function getClientAngle() {
return(((Math.atan2(oClient.y - y, oClient.x - x) * 180) / Math.PI) + 90);
}
function state_idle() {
bTossing = false;
}
function state_idle_quick() {
bTossing = false;
}
function state_accelerate() {
if (stateFinished()) {
setState(STATE_IDLE_QUICK, true);
}
}
function state_slow_down() {
if (stateFinished()) {
setState(STATE_IDLE, true);
}
}
function state_bump_obstacle() {
if (stateFinished()) {
setState(STATE_IDLE, true);
}
}
function state_bump_water() {
if (stateFinished()) {
setState(STATE_IDLE, true);
}
}
function state_crash() {
if (stateFinished()) {
bCrashing = false;
bAccelerating = false;
bBraking = false;
nFrame = com.disney.gem.games.pizza_toss.Config.Player.Invicible;
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_FLASH);
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_IDLE);
setState(STATE_CRASH_IDLE, true);
}
}
function state_crash_idle() {
nFrame--;
if (nFrame <= 0) {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_FLASH);
setState(STATE_IDLE, true);
}
}
function state_pick_hotdog() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GOOFY_THROW, true, false);
setState(STATE_THROW_HOTDOG, true);
}
}
function state_throw_hotdog() {
if (mcRef.mcState.mcThrowPoint != undefined) {
mcRef.mcState.mcThrowPoint._visible = false;
tossHotDog();
}
if (stateFinished()) {
setState(STATE_IDLE, true);
bTossing = false;
}
}
static var STATE_IDLE = "idle";
static var STATE_IDLE_QUICK = "idle_quick";
static var STATE_ACCELERATE = "accelerate";
static var STATE_BREAK = "slow_down";
static var STATE_BUMP_OBSTACLE = "bump_obstacle";
static var STATE_BUMP_WATER = "bump_water";
static var STATE_CRASH = "crash";
static var STATE_CRASH_IDLE = "crash_idle";
static var STATE_PICK_HOTDOG = "pick_hotdog";
static var STATE_THROW_HOTDOG = "throw_hotdog";
}
Symbol 2137 MovieClip [__Packages.com.disney.gem.games.pizza_toss.utility.Keys] Frame 0
class com.disney.gem.games.pizza_toss.utility.Keys
{
function Keys () {
}
static function isPressed(_nKey) {
var _local3 = false;
if (Key.isDown(_nKey)) {
_local3 = true;
}
return(_local3);
}
static function isNotPressed(_nKey) {
var _local3 = false;
if (Key.isDown(_nKey)) {
_local3 = true;
}
return(!_local3);
}
static function arePressed() {
var _local2 = 0;
var _local3 = 0;
for ( ; _local3 < arguments.length ; _local3++) {
if (Key.isDown(arguments[_local3])) {
_local2++;
}
}
return(_local2 == arguments.length);
}
static function areNotPressed() {
var _local2 = false;
var _local3 = 0;
for ( ; _local3 < arguments.length ; _local3++) {
if (Key.isDown(arguments[_local3])) {
_local2 = true;
break;
}
}
return(!_local2);
}
}
Symbol 2138 MovieClip [__Packages.com.disney.gem.games.pizza_toss.collisions.LineCollision] Frame 0
class com.disney.gem.games.pizza_toss.collisions.LineCollision
{
function LineCollision () {
}
static function check(_nX1a, _nY1a, _nX2a, _nY2a, _nX1b, _nY1b, _nX2b, _nY2b) {
var _local10 = {cross:false, x:0, y:0};
var _local13 = ((_nX2a - _nX1a) * (_nY2b - _nY1b)) - ((_nY2a - _nY1a) * (_nX2b - _nX1b));
if (_local13 != 0) {
var _local11 = (((_nY1a - _nY1b) * (_nX2b - _nX1b)) - ((_nX1a - _nX1b) * (_nY2b - _nY1b))) / _local13;
var _local12 = (((_nY1a - _nY1b) * (_nX2a - _nX1a)) - ((_nX1a - _nX1b) * (_nY2a - _nY1a))) / _local13;
if ((_local11 >= 0) && ((_local11 <= 1) && ((_local12 >= 0) && (_local12 <= 1)))) {
_local10.cross = true;
_local10.x = _nX1a + (_local11 * (_nX2a - _nX1a));
_local10.y = _nY1a + (_local11 * (_nY2a - _nY1a));
}
}
return(_local10);
}
}
Symbol 2139 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.ElementBase] Frame 0
class com.disney.gem.games.pizza_toss.elements.ElementBase extends com.disney.gem.games.pizza_toss.collisions.CollideItem
{
var bCreated, oOwner, sActivate, sDeactivate, mcRef, destroy, sLinkage, sName, oItem, setMC, aProperties;
function ElementBase (_oOwner, _nX) {
super();
bCreated = false;
oOwner = _oOwner;
}
function defineEvents(_nXLeft, _nXRight) {
sActivate = "activate_" + Math.floor(_nXLeft / com.disney.gem.games.pizza_toss.Config.Defaults.Slice);
sDeactivate = "deactivate_" + Math.floor(_nXRight / com.disney.gem.games.pizza_toss.Config.Defaults.Slice);
oOwner.dispatcher.addEventListener(sActivate, onActivate, this);
}
function onActivate() {
oOwner.dispatcher.removeEventListener(sActivate, onActivate, this);
oOwner.dispatcher.addEventListener(sDeactivate, onDestroy, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.DESTROY, onDestroy, this);
createElement();
}
function onDeactivate() {
oOwner.dispatcher.removeEventListener(sDeactivate, onDestroy, this);
oOwner.dispatcher.addEventListener(sActivate, onActivate, this);
var _local2 = 0;
for ( ; _local2 < oOwner.displayed.length ; _local2++) {
if (oOwner.displayed[_local2].mc == mcRef) {
oOwner.displayed.splice(_local2, 1);
break;
}
}
deleteElement();
}
function onDestroy() {
onDeactivate();
oOwner.dispatcher.removeEventListener(sActivate, onActivate, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.DESTROY, onDestroy, this);
destroy();
}
function createElement() {
if (bCreated) {
return(undefined);
}
bCreated = true;
oOwner.mcGame.mcInner.attachMovie(sLinkage, sName, oItem.depth);
setMC(oOwner.mcGame.mcInner[sName]);
var _local2 = 0;
for ( ; _local2 < aProperties.length ; _local2++) {
mcRef[aProperties[_local2][0]] = aProperties[_local2][1];
}
com.disney.gem.games.pizza_toss.Controller.Instance.oMainBroadcaster.addListener(this);
}
function deleteElement() {
oOwner.deleteMe(this);
com.disney.gem.games.pizza_toss.Controller.Instance.oMainBroadcaster.removeListener(this);
mcRef.removeMovieClip();
delete mcRef;
}
function setProperties(_aProperties) {
aProperties = _aProperties;
}
function setItem(_oItem) {
oItem = _oItem;
}
function setNameLinkage(_sLinkage, _sName) {
sLinkage = _sLinkage;
sName = _sName;
}
}
Symbol 2140 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.items.HotDog] Frame 0
class com.disney.gem.games.pizza_toss.elements.items.HotDog extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, bDeleting, setProperties, setItem, setNameLinkage, oItem, defineEvents, onActivate, oOwner, nSpeedX, nSpeedY, setState, topLeft, mcRef, bottomRight, name, nFrame, aPosition, x, stateFinished;
function HotDog (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "HotDog";
bDeleting = false;
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
if (oItem.type == "High") {
oItem.event = com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH;
} else {
oItem.event = com.disney.gem.games.pizza_toss.events.Event.TEST_LOW;
}
defineEvents(_oItem.left, _oItem.right);
onActivate();
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, collideWith, this);
nSpeedX = oItem.speedX;
nSpeedY = oItem.speedY;
setState(STATE_IDLE, true);
}
function createElement() {
super.createElement();
topLeft(mcRef.mcTopLeft);
bottomRight(mcRef.mcBottomRight);
mcRef.mcTopLeft._visible = false;
mcRef.mcBottomRight._visible = false;
}
function stopListen() {
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, collideWith, this);
}
function move() {
mcRef._x = mcRef._x + nSpeedX;
mcRef._y = mcRef._y + nSpeedY;
}
function collideWith(_oEvt, _oObj) {
if (_oEvt.more == name) {
if (_oEvt.from != undefined) {
switch (_oObj.type) {
case "ground" :
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_HOTDOG_GROUND, true, false);
setState(STATE_HIT_GROUND, true);
stopListen();
break;
case "wall" :
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_HOTDOG_WALL, true, false);
setState(STATE_HIT_WALL, true);
stopListen();
break;
case "client" :
oOwner.displayHotDog();
stopListen();
_oObj.grabIt();
deleteIn(5);
}
}
}
}
function deleteElement() {
stopListen();
super.deleteElement();
}
function deleteIn(_nFrame) {
nFrame = _nFrame;
bDeleting = true;
}
function setDepth() {
var _local2 = mcRef.getDepth();
var _local3 = 0;
for ( ; _local3 < aPosition.length ; _local3++) {
if ((x > aPosition[_local3].x) && (_local2 > aPosition[_local3].depth)) {
_local2 = getAvailableDepth(aPosition[_local3].depth);
}
}
mcRef.swapDepths(_local2);
}
function getAvailableDepth(_nDepth) {
var _local3 = _nDepth--;
var _local4 = oOwner.mcGame.mcInner;
var _local5 = 1;
for ( ; _local5 <= 9 ; _local5++) {
if (_local4.getInstanceAtDepth(_nDepth - _local5) == undefined) {
_local3 = _nDepth + _local5;
break;
}
}
return(_local3);
}
function pushPosition(_nX, _nDepth) {
aPosition.push({x:_nX, depth:_nDepth});
}
function state_idle() {
if (nFrame == undefined) {
aPosition = new Array();
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.POSITION, "", oItem.event), this);
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(oItem.event), this);
setDepth();
move();
}
if (bDeleting) {
nFrame--;
if (nFrame <= 0) {
deleteElement();
}
}
}
function state_hit_wall() {
if (stateFinished()) {
deleteElement();
}
}
function state_hit_ground() {
if (stateFinished()) {
deleteElement();
}
}
function get type() {
return(oItem.type);
}
static var STATE_IDLE = "idle";
static var STATE_HIT_WALL = "hit_wall";
static var STATE_HIT_GROUND = "hit_ground";
}
Symbol 2141 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.Copse] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.Copse extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, onActivate, aProperties, mcRef, setState;
function Copse (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Copse";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
if (typeof(aProperties[0]) == "object") {
var _local3 = Math.floor(Math.random() * aProperties[0][0].length);
mcRef._x = aProperties[0][_local3];
mcRef._y = aProperties[1][_local3];
}
setState(STATE_IDLE, true);
}
static var STATE_IDLE = "idle";
}
Symbol 2142 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.Mailbox1] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.Mailbox1 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, onActivate, setState;
function Mailbox1 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Mailbox1";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_IDLE, true);
}
static var STATE_IDLE = "idle";
}
Symbol 2143 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.Mailbox2] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.Mailbox2 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, onActivate, setState;
function Mailbox2 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Mailbox2";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_IDLE, true);
}
static var STATE_IDLE = "idle";
}
Symbol 2144 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.Mailbox3] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.Mailbox3 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, onActivate, setState;
function Mailbox3 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Mailbox3";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_IDLE, true);
}
static var STATE_IDLE = "idle";
}
Symbol 2145 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.Mailbox4] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.Mailbox4 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, onActivate, setState;
function Mailbox4 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Mailbox4";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_IDLE, true);
}
static var STATE_IDLE = "idle";
}
Symbol 2146 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.RoadRock] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.RoadRock extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, onActivate, setState;
function RoadRock (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "RoadRock";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_IDLE, true);
}
static var STATE_IDLE = "idle";
}
Symbol 2147 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.SmallTree] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.SmallTree extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, onActivate, aProperties, mcRef, setState, oOwner, x;
function SmallTree (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "SmallTree";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
if (typeof(aProperties[0]) == "object") {
var _local3 = Math.floor(Math.random() * aProperties[0][0].length);
mcRef._x = aProperties[0][_local3];
mcRef._y = aProperties[1][_local3];
}
setState(STATE_IDLE, true);
mcRef.mcLBR._visible = false;
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
}
function deleteElement() {
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
super.deleteElement();
}
function givePosition(_oEvt, _oObj) {
if ((_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_LOW) && (_oObj.x > (x + mcRef.mcLBR._x))) {
_oObj.pushPosition(x + mcRef.mcLBR._x, mcRef.getDepth());
}
}
static var STATE_IDLE = "idle";
}
Symbol 2148 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.StreetLight] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.StreetLight extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, defineEvents, onActivate, oOwner, setState, mcRef, x, y, testCollide, fromWhere;
function StreetLight (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "StreetLight";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "wall";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
if (oOwner.oColor == com.disney.gem.games.pizza_toss.dayTime.Hour.Evening) {
setState(STATE_IDLE, true);
var _local3 = new flash.geom.Transform(mcRef.mcState.mcLamp.mcBubble);
var _local4 = new flash.geom.ColorTransform(1.4375, 1.4375, 1.4375, 1, 0, 0, 0, 0);
_local3.colorTransform = _local4;
} else {
setState(STATE_OFF, true);
}
hideMark();
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
}
function deleteElement() {
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
super.deleteElement();
}
function givePosition(_oEvt, _oObj) {
if ((_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_LOW) && (_oObj.x > (x + mcRef.mcLBR._x))) {
_oObj.pushPosition(x + mcRef.mcLBR._x, mcRef.getDepth());
}
}
function hideMark() {
mcRef.mcLTL._visible = false;
mcRef.mcLBR._visible = false;
}
function Collide_Low(_oEvt, _oObj) {
var _local4 = x + mcRef.mcLTL._x;
var _local5 = y + mcRef.mcLTL._y;
var _local6 = x + mcRef.mcLBR._x;
var _local7 = y + mcRef.mcLBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcLTL._x, mcRef.mcLTL._y, mcRef.mcLBR._x, mcRef.mcLBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
static var STATE_IDLE = "idle";
static var STATE_OFF = "off";
}
Symbol 2149 MovieClip [__Packages.com.disney.gem.games.pizza_toss.dayTime.Hour] Frame 0
class com.disney.gem.games.pizza_toss.dayTime.Hour
{
function Hour () {
}
static var Morning = new flash.geom.ColorTransform(0.83984375, 0.83984375, 0.83984375, 1, 41, 8, 0, 0);
static var Noon = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
static var Evening = new flash.geom.ColorTransform(0.71875, 0.71875, 0.71875, 1, 0, 0, 0, 0);
}
Symbol 2150 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.Tree] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.Tree extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, defineEvents, onActivate, aProperties, mcRef, setState, oOwner, x, y, testCollide, fromWhere;
function Tree (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Tree";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "wall";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
if (typeof(aProperties[0]) == "object") {
var _local3 = Math.floor(Math.random() * aProperties[0][0].length);
mcRef._x = aProperties[0][_local3];
mcRef._y = aProperties[1][_local3];
}
setState(STATE_IDLE, true);
hideMark();
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
}
function deleteElement() {
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
super.deleteElement();
}
function givePosition(_oEvt, _oObj) {
if (_oObj.x > (x + mcRef.mcLBR._x)) {
_oObj.pushPosition(x + mcRef.mcLBR._x, mcRef.getDepth());
}
}
function hideMark() {
mcRef.mcLTL._visible = false;
mcRef.mcLBR._visible = false;
}
function Collide_Low(_oEvt, _oObj) {
var _local4 = x + mcRef.mcLTL._x;
var _local5 = y + mcRef.mcLTL._y;
var _local6 = x + mcRef.mcLBR._x;
var _local7 = y + mcRef.mcLBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcLTL._x, mcRef.mcLTL._y, mcRef.mcLBR._x, mcRef.mcLBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
static var STATE_IDLE = "idle";
}
Symbol 2151 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.Wall] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.Wall extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, defineEvents, onActivate, mcRef, oItem, setState, oOwner, x, y, testCollide, fromWhere;
function Wall (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Wall";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "wall";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
var _local3 = mcRef.transform.matrix;
if (oItem.vertical) {
_local3.a = -0.5;
_local3.b = -0.86602783203125;
_local3.c = -0.86602783203125;
_local3.d = 0.5;
}
mcRef.transform.matrix = _local3;
setState(STATE_IDLE, true);
hideMark();
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
}
function deleteElement() {
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
super.deleteElement();
}
function givePosition(_oEvt, _oObj) {
if ((_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_LOW) && (_oObj.x > (x + mcRef.mcLBR._x))) {
_oObj.pushPosition(x + mcRef.mcLBR._x, mcRef.getDepth());
}
}
function hideMark() {
mcRef.mcLTL._visible = false;
mcRef.mcLBR._visible = false;
}
function Collide_Low(_oEvt, _oObj) {
var _local4 = x + mcRef.mcLTL._x;
var _local5 = y + mcRef.mcLTL._y;
var _local6 = x + mcRef.mcLBR._x;
var _local7 = y + mcRef.mcLBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcLTL._x, mcRef.mcLTL._y, mcRef.mcLBR._x, mcRef.mcLBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
static var STATE_IDLE = "idle";
}
Symbol 2152 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.bonus.GasTank] Frame 0
class com.disney.gem.games.pizza_toss.elements.bonus.GasTank extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sBonus, sType, defineEvents, topLeft, mcRef, bottomRight, setState, oOwner, setTarget, oTarget, Collide, stateFinished, onDestroy;
function GasTank (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "GasTank";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sBonus = "Fuel";
sType = "bonus";
defineEvents(_oItem.left, _oItem.right);
}
function createElement() {
super.createElement();
topLeft(mcRef.mcTopLeft);
bottomRight(mcRef.mcBottomRight);
mcRef.mcTopLeft._visible = false;
mcRef.mcBottomRight._visible = false;
setState(STATE_IDLE, true);
oOwner.displayed.push({mc:mcRef, x:mcRef._x, y:mcRef._y, depth:mcRef.getDepth()});
setTarget(oOwner.dispatcher);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
oOwner.nGasTank = oOwner.nGasTank + 1;
}
function deleteElement() {
oOwner.nGasTank = oOwner.nGasTank - 1;
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
super.deleteElement();
}
function pickUp() {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_GAS_TAKE, true, false);
setState(STATE_PICKED, true);
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
com.disney.gem.games.pizza_toss.Stats.score = com.disney.gem.games.pizza_toss.Stats.score + com.disney.gem.games.pizza_toss.Config.Points.GasTank;
com.disney.gem.games.pizza_toss.Stats.fuel = com.disney.gem.games.pizza_toss.Stats.fuel + com.disney.gem.games.pizza_toss.Config.Bonus.GasTank.Fuel;
}
function state_picked() {
if (stateFinished()) {
onDestroy();
}
}
static var STATE_IDLE = "idle";
static var STATE_PICKED = "picked";
}
Symbol 2153 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.bonus.HotDogBox] Frame 0
class com.disney.gem.games.pizza_toss.elements.bonus.HotDogBox extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sBonus, sType, defineEvents, topLeft, mcRef, bottomRight, setState, oOwner, setTarget, oTarget, Collide, stateFinished, onDestroy;
function HotDogBox (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "HotDogBox";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sBonus = "Hotdog";
sType = "bonus";
defineEvents(_oItem.left, _oItem.right);
}
function createElement() {
super.createElement();
topLeft(mcRef.mcTopLeft);
bottomRight(mcRef.mcBottomRight);
mcRef.mcTopLeft._visible = false;
mcRef.mcBottomRight._visible = false;
setState(STATE_IDLE, true);
oOwner.displayed.push({mc:mcRef, x:mcRef._x, y:mcRef._y, depth:mcRef.getDepth()});
setTarget(oOwner.dispatcher);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
oOwner.nBox = oOwner.nBox + 1;
}
function deleteElement() {
oOwner.nBox = oOwner.nBox - 1;
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
super.deleteElement();
}
function pickUp() {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BOX_TAKE, true, false);
setState(STATE_PICKED, true);
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
com.disney.gem.games.pizza_toss.Stats.score = com.disney.gem.games.pizza_toss.Stats.score + com.disney.gem.games.pizza_toss.Config.Points.HotDogBox;
}
function state_picked() {
if (stateFinished()) {
onDestroy();
}
}
static var STATE_IDLE = "idle";
static var STATE_PICKED = "picked";
}
Symbol 2154 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.clients.ClientBase] Frame 0
class com.disney.gem.games.pizza_toss.elements.clients.ClientBase
{
var oOwner, oHouse, sHouse, nFrameBeforeExit, sType, bClient, mcClient, sEvent, oTL, oBR;
function ClientBase (_oOwner, _oHouse) {
oOwner = _oOwner;
oHouse = _oHouse;
sHouse = oHouse.name;
nFrameBeforeExit = com.disney.gem.games.pizza_toss.Config.Defaults.ExitClient;
sType = "client";
bClient = true;
mcClient = oHouse.getRandomClient();
var _local4 = oHouse.getClientCollide();
setCollision(_local4.tl, _local4.br);
setEvent(oHouse.getEvent());
com.disney.gem.games.pizza_toss.Controller.Instance.oMainBroadcaster.addListener(this);
}
function onUpdate() {
nFrameBeforeExit--;
if (nFrameBeforeExit <= 0) {
com.disney.gem.games.pizza_toss.Controller.Instance.oMainBroadcaster.removeListener(this);
oHouse.open();
startListening();
}
}
function setEvent(_sEvent) {
sEvent = _sEvent;
}
function setCollision(_oTL, _oBR) {
oTL = _oTL;
oBR = _oBR;
}
function startListening() {
oOwner.dispatcher.addEventListener(sEvent, Collide, this);
}
function stopListening() {
oOwner.dispatcher.removeEventListener(sEvent, Collide, this);
}
function grabIt() {
oHouse.catches();
com.disney.gem.games.pizza_toss.Stats.clients++;
com.disney.gem.games.pizza_toss.Stats.score = com.disney.gem.games.pizza_toss.Stats.score + com.disney.gem.games.pizza_toss.Config.Points.Deliver;
stopListening();
}
function destroy() {
stopListening();
}
function Collide(_oEvt, _oObj) {
var _local4 = left;
var _local5 = top;
var _local6 = right;
var _local7 = bottom;
var _local8 = _oObj.left;
var _local9 = _oObj.top;
var _local10 = _oObj.right;
var _local11 = _oObj.bottom;
var _local12 = testCollide(left, top, right, bottom, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
function testCollide(_nX1A, _nY1A, _nX2A, _nY2A, _nX1B, _nY1B, _nX2B, _nY2B) {
var _local10 = ((_nX1A < _nX2A) ? (_nX1A) : (_nX2A));
var _local11 = ((_nX1A < _nX2A) ? (_nX2A) : (_nX1A));
var _local12 = ((_nY1A < _nY2A) ? (_nY1A) : (_nY2A));
var _local13 = ((_nY1A < _nY2A) ? (_nY2A) : (_nY1A));
var _local14 = ((_nX1B < _nX2B) ? (_nX1B) : (_nX2B));
var _local15 = ((_nX1B < _nX2B) ? (_nX2B) : (_nX1B));
var _local16 = ((_nY1B < _nY2B) ? (_nY1B) : (_nY2B));
var _local17 = ((_nY1B < _nY2B) ? (_nY2B) : (_nY1B));
var _local18 = -1;
if ((_local15 > _local10) && ((_local17 > _local12) && ((_local14 < _local10) && (_local16 < _local12)))) {
_local18 = (((_local15 - _local10) > (_local17 - _local12)) ? 0 : 14);
} else if ((_local15 < _local11) && ((_local17 > _local12) && ((_local14 > _local10) && (_local16 < _local12)))) {
_local18 = 1;
} else if ((_local15 > _local11) && ((_local17 > _local12) && ((_local14 < _local11) && (_local16 < _local12)))) {
_local18 = (((_local11 - _local14) > (_local17 - _local12)) ? 2 : 15);
} else if ((_local15 > _local10) && ((_local17 < _local13) && ((_local14 < _local10) && (_local16 > _local12)))) {
_local18 = 3;
} else if ((_local15 < _local11) && ((_local17 < _local13) && ((_local14 > _local10) && (_local16 > _local12)))) {
_local18 = 4;
} else if ((_local15 > _local11) && ((_local17 < _local13) && ((_local14 < _local11) && (_local16 > _local12)))) {
_local18 = 5;
} else if ((_local15 > _local10) && ((_local17 > _local13) && ((_local14 < _local10) && (_local16 < _local13)))) {
_local18 = (((_local15 - _local10) > (_local13 - _local16)) ? 6 : 16);
} else if ((_local15 < _local11) && ((_local17 > _local13) && ((_local14 > _local10) && (_local16 < _local13)))) {
_local18 = 7;
} else if ((_local15 > _local11) && ((_local17 > _local13) && ((_local14 < _local11) && (_local16 < _local13)))) {
_local18 = (((_local11 - _local14) > (_local13 - _local16)) ? 8 : 17);
} else if ((_local15 > _local11) && ((_local14 < _local10) && ((_local17 > _local12) && (_local16 < _local12)))) {
_local18 = 9;
} else if ((_local15 > _local11) && ((_local14 < _local10) && ((_local16 < _local13) && (_local17 > _local13)))) {
_local18 = 10;
} else if ((_local15 > _local10) && ((_local14 < _local10) && ((_local16 < _local12) && (_local17 > _local13)))) {
_local18 = 11;
} else if ((_local15 > _local11) && ((_local14 < _local11) && ((_local16 < _local12) && (_local17 > _local13)))) {
_local18 = 12;
} else if ((_local15 > _local11) && ((_local14 < _local10) && ((_local16 < _local12) && (_local17 > _local13)))) {
_local18 = 13;
}
return(_local18);
}
function get type() {
return(sType);
}
function get x() {
return(oHouse.x + mcClient._x);
}
function get y() {
return(oHouse.y + mcClient._y);
}
function get left() {
return(oHouse.x + oTL._x);
}
function get right() {
return(oHouse.x + oBR._x);
}
function get top() {
return(oHouse.y + oTL._y);
}
function get bottom() {
return(oHouse.y + oBR._y);
}
}
Symbol 2155 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.clients.Client1] Frame 0
class com.disney.gem.games.pizza_toss.elements.clients.Client1 extends com.disney.gem.games.pizza_toss.elements.clients.ClientBase
{
var sType;
function Client1 (_oOwner, _oHouse) {
super(_oOwner, _oHouse);
sType = "client";
}
}
Symbol 2156 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.clients.Client2] Frame 0
class com.disney.gem.games.pizza_toss.elements.clients.Client2 extends com.disney.gem.games.pizza_toss.elements.clients.ClientBase
{
var sType;
function Client2 (_oOwner, _oHouse) {
super(_oOwner, _oHouse);
sType = "client";
}
}
Symbol 2157 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.clients.Client3] Frame 0
class com.disney.gem.games.pizza_toss.elements.clients.Client3 extends com.disney.gem.games.pizza_toss.elements.clients.ClientBase
{
var sType;
function Client3 (_oOwner, _oHouse) {
super(_oOwner, _oHouse);
sType = "client";
}
}
Symbol 2158 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.clients.Client4] Frame 0
class com.disney.gem.games.pizza_toss.elements.clients.Client4 extends com.disney.gem.games.pizza_toss.elements.clients.ClientBase
{
var sType;
function Client4 (_oOwner, _oHouse) {
super(_oOwner, _oHouse);
sType = "client";
}
}
Symbol 2159 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.clients.Client5] Frame 0
class com.disney.gem.games.pizza_toss.elements.clients.Client5 extends com.disney.gem.games.pizza_toss.elements.clients.ClientBase
{
var sType;
function Client5 (_oOwner, _oHouse) {
super(_oOwner, _oHouse);
sType = "client";
}
}
Symbol 2160 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.StreetLightSpot] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.StreetLightSpot extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, onActivate, oOwner, setState, mcRef;
function StreetLightSpot (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "StreetLightSpot";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
if (oOwner.oColor == com.disney.gem.games.pizza_toss.dayTime.Hour.Evening) {
setState(STATE_IDLE, true);
var _local3 = new flash.geom.Transform(mcRef);
var _local4 = new flash.geom.ColorTransform(1.4375, 1.4375, 1.4375, 1, 0, 0, 0, 0);
_local3.colorTransform = _local4;
} else {
setState(STATE_HIDDEN, true);
}
}
static var STATE_IDLE = "idle";
static var STATE_HIDDEN = "hidden";
}
Symbol 2161 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.houses.House1] Frame 0
class com.disney.gem.games.pizza_toss.elements.houses.House1 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, defineEvents, onActivate, setState, oItem, oOwner, oClient, mcRef, nIndex, stateIsOneOf, nFrame, x, y, testCollide, fromWhere, stateFinished;
function House1 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "House1";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "wall";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_DOOR_CLOSED, true);
if (oItem.client) {
oOwner.objectsList.push(new com.disney.gem.games.pizza_toss.elements.clients.Client1(oOwner, this));
oClient = oOwner.objectsList[oOwner.objectsList.length - 1];
}
hideMark();
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH, Collide_High, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
}
function deleteElement() {
var _local3 = 0;
for ( ; _local3 < oOwner.objectsList.length ; _local3++) {
if (oOwner.objectsList[_local3].sHouse == oClient.sHouse) {
oOwner.objectsList.splice(_local3, 1);
break;
}
}
oClient.destroy();
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH, Collide_High, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
super.deleteElement();
}
function hideMark() {
mcRef.mcCHTL._visible = false;
mcRef.mcCHBR._visible = false;
mcRef.mcCLTL._visible = false;
mcRef.mcCLBR._visible = false;
mcRef.mcLTL._visible = false;
mcRef.mcLBR._visible = false;
mcRef.mcHTL._visible = false;
mcRef.mcHBR._visible = false;
mcRef.mcHigh._visible = false;
mcRef.mcLow._visible = false;
}
function getRandomClient() {
var _local2 = new Array(mcRef.mcLow, mcRef.mcHigh);
nIndex = Math.floor(Math.random() * _local2.length);
if (nIndex == 0) {
oItem.exit = "door";
} else {
oItem.exit = "window";
}
oItem.time = com.disney.gem.games.pizza_toss.Config.Clients.Idle;
return(_local2[nIndex]);
}
function getEvent() {
if (nIndex == 0) {
var _local2 = com.disney.gem.games.pizza_toss.events.Event.TEST_LOW;
} else {
var _local2 = com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH;
}
return(_local2);
}
function hasMissed() {
var _local2 = false;
if (stateIsOneOf(STATE_DOOR_MISSED, STATE_WINDOW_MISSED)) {
_local2 = true;
}
return(_local2);
}
function open() {
nFrame = oItem.time;
setState(oItem.exit + "_out", true);
if (oItem.exit == "window") {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_OUT, true, false);
} else {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_OUT, true, false);
}
}
function catches() {
setState(oItem.exit + "_catch", true);
if (oItem.exit == "window") {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_CATCH, true, false);
} else {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_CATCH, true, false);
}
}
function getClientCollide() {
var _local2 = new Array({tl:mcRef.mcCLTL, br:mcRef.mcCLBR}, {tl:mcRef.mcCHTL, br:mcRef.mcCHBR});
return(_local2[nIndex]);
}
function givePosition(_oEvt, _oObj) {
if ((_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_LOW) && (_oObj.x > (x + mcRef.mcLBR._x))) {
_oObj.pushPosition(x + mcRef.mcLBR._x, mcRef.getDepth());
} else if ((_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH) && (_oObj.x > (x + mcRef.mcHBR._x))) {
_oObj.pushPosition(x + mcRef.mcHBR._x, mcRef.getDepth());
}
}
function Collide_High(_oEvt, _oObj) {
var _local4 = x + mcRef.mcHTL._x;
var _local5 = y + mcRef.mcHTL._y;
var _local6 = x + mcRef.mcHBR._x;
var _local7 = y + mcRef.mcHBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcHTL._x, mcRef.mcHTL._y, mcRef.mcHBR._x, mcRef.mcHBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
function Collide_Low(_oEvt, _oObj) {
var _local4 = x + mcRef.mcLTL._x;
var _local5 = y + mcRef.mcLTL._y;
var _local6 = x + mcRef.mcLBR._x;
var _local7 = y + mcRef.mcLBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcLTL._x, mcRef.mcLTL._y, mcRef.mcLBR._x, mcRef.mcLBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
function state_door_out() {
if (stateFinished()) {
setState(STATE_DOOR_IDLE, true);
}
}
function state_door_in() {
if (stateFinished()) {
setState(STATE_DOOR_CLOSED, true);
}
}
function state_door_catch() {
if (stateFinished()) {
setState(STATE_DOOR_CLOSED, true);
}
}
function state_door_idle() {
nFrame--;
if (nFrame <= 0) {
oClient.destroy();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_MISSED, true, false);
setState(STATE_DOOR_MISSED, true);
}
}
function state_door_missed() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_IN, true, false);
setState(STATE_DOOR_IN, true);
}
}
function state_window_out() {
if (stateFinished()) {
setState(STATE_WINDOW_IDLE, true);
}
}
function state_window_in() {
if (stateFinished()) {
setState(STATE_WINDOW_CLOSED, true);
}
}
function state_window_catch() {
if (stateFinished()) {
setState(STATE_WINDOW_CLOSED, true);
}
}
function state_window_idle() {
nFrame--;
if (nFrame <= 0) {
oClient.destroy();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_MISSED, true, false);
setState(STATE_WINDOW_MISSED, true);
}
}
function state_window_missed() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_IN, true, false);
setState(STATE_WINDOW_IN, true);
}
}
static var STATE_DOOR_OUT = "door_out";
static var STATE_DOOR_IN = "door_in";
static var STATE_DOOR_CATCH = "door_catch";
static var STATE_DOOR_IDLE = "door_idle";
static var STATE_DOOR_MISSED = "door_missed";
static var STATE_DOOR_CLOSED = "door_closed";
static var STATE_WINDOW_OUT = "window_out";
static var STATE_WINDOW_IN = "window_in";
static var STATE_WINDOW_CATCH = "window_catch";
static var STATE_WINDOW_IDLE = "window_idle";
static var STATE_WINDOW_MISSED = "window_missed";
static var STATE_WINDOW_CLOSED = "window_closed";
}
Symbol 2162 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.houses.House2] Frame 0
class com.disney.gem.games.pizza_toss.elements.houses.House2 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, defineEvents, onActivate, setState, oItem, oOwner, oClient, mcRef, nIndex, stateIsOneOf, nFrame, x, y, testCollide, fromWhere, stateFinished;
function House2 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "House2";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "wall";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_DOOR_CLOSED, true);
if (oItem.client) {
oOwner.objectsList.push(new com.disney.gem.games.pizza_toss.elements.clients.Client2(oOwner, this));
oClient = oOwner.objectsList[oOwner.objectsList.length - 1];
}
hideMark();
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH, Collide_High, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
}
function deleteElement() {
var _local3 = 0;
for ( ; _local3 < oOwner.objectsList.length ; _local3++) {
if (oOwner.objectsList[_local3].sHouse == oClient.sHouse) {
oOwner.objectsList.splice(_local3, 1);
break;
}
}
oClient.destroy();
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH, Collide_High, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
super.deleteElement();
}
function hideMark() {
mcRef.mcCHTL._visible = false;
mcRef.mcCHBR._visible = false;
mcRef.mcCLTL._visible = false;
mcRef.mcCLBR._visible = false;
mcRef.mcLTL._visible = false;
mcRef.mcLBR._visible = false;
mcRef.mcHTL._visible = false;
mcRef.mcHBR._visible = false;
mcRef.mcHigh._visible = false;
mcRef.mcLow._visible = false;
}
function getRandomClient() {
var _local2 = new Array(mcRef.mcLow, mcRef.mcHigh);
nIndex = Math.floor(Math.random() * _local2.length);
if (nIndex == 0) {
oItem.exit = "door";
} else {
oItem.exit = "window";
}
oItem.time = com.disney.gem.games.pizza_toss.Config.Clients.Idle;
return(_local2[nIndex]);
}
function getEvent() {
if (nIndex == 0) {
var _local2 = com.disney.gem.games.pizza_toss.events.Event.TEST_LOW;
} else {
var _local2 = com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH;
}
return(_local2);
}
function hasMissed() {
var _local2 = false;
if (stateIsOneOf(STATE_DOOR_MISSED, STATE_WINDOW_MISSED)) {
_local2 = true;
}
return(_local2);
}
function open() {
nFrame = oItem.time;
setState(oItem.exit + "_out", true);
if (oItem.exit == "window") {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_OUT, true, false);
} else {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_OUT, true, false);
}
}
function catches() {
setState(oItem.exit + "_catch", true);
if (oItem.exit == "window") {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_CATCH, true, false);
} else {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_CATCH, true, false);
}
}
function getClientCollide() {
var _local2 = new Array({tl:mcRef.mcCLTL, br:mcRef.mcCLBR}, {tl:mcRef.mcCHTL, br:mcRef.mcCHBR});
return(_local2[nIndex]);
}
function givePosition(_oEvt, _oObj) {
if ((_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_LOW) && (_oObj.x > (x + mcRef.mcLBR._x))) {
_oObj.pushPosition(x + mcRef.mcLBR._x, mcRef.getDepth());
} else if ((_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH) && (_oObj.x > (x + mcRef.mcHBR._x))) {
_oObj.pushPosition(x + mcRef.mcHBR._x, mcRef.getDepth());
}
}
function Collide_High(_oEvt, _oObj) {
var _local4 = x + mcRef.mcHTL._x;
var _local5 = y + mcRef.mcHTL._y;
var _local6 = x + mcRef.mcHBR._x;
var _local7 = y + mcRef.mcHBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcHTL._x, mcRef.mcHTL._y, mcRef.mcHBR._x, mcRef.mcHBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
function Collide_Low(_oEvt, _oObj) {
var _local4 = x + mcRef.mcLTL._x;
var _local5 = y + mcRef.mcLTL._y;
var _local6 = x + mcRef.mcLBR._x;
var _local7 = y + mcRef.mcLBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcLTL._x, mcRef.mcLTL._y, mcRef.mcLBR._x, mcRef.mcLBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
function state_door_out() {
if (stateFinished()) {
setState(STATE_DOOR_IDLE, true);
}
}
function state_door_in() {
if (stateFinished()) {
setState(STATE_DOOR_CLOSED, true);
}
}
function state_door_catch() {
if (stateFinished()) {
setState(STATE_DOOR_CLOSED, true);
}
}
function state_door_idle() {
nFrame--;
if (nFrame <= 0) {
oClient.destroy();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_MISSED, true, false);
setState(STATE_DOOR_MISSED, true);
}
}
function state_door_missed() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_IN, true, false);
setState(STATE_DOOR_IN, true);
}
}
function state_window_out() {
if (stateFinished()) {
setState(STATE_WINDOW_IDLE, true);
}
}
function state_window_in() {
if (stateFinished()) {
setState(STATE_WINDOW_CLOSED, true);
}
}
function state_window_catch() {
if (stateFinished()) {
setState(STATE_WINDOW_CLOSED, true);
}
}
function state_window_idle() {
nFrame--;
if (nFrame <= 0) {
oClient.destroy();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_MISSED, true, false);
setState(STATE_WINDOW_MISSED, true);
}
}
function state_window_missed() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_IN, true, false);
setState(STATE_WINDOW_IN, true);
}
}
static var STATE_DOOR_OUT = "door_out";
static var STATE_DOOR_IN = "door_in";
static var STATE_DOOR_CATCH = "door_catch";
static var STATE_DOOR_IDLE = "door_idle";
static var STATE_DOOR_MISSED = "door_missed";
static var STATE_DOOR_CLOSED = "door_closed";
static var STATE_WINDOW_OUT = "window_out";
static var STATE_WINDOW_IN = "window_in";
static var STATE_WINDOW_CATCH = "window_catch";
static var STATE_WINDOW_IDLE = "window_idle";
static var STATE_WINDOW_MISSED = "window_missed";
static var STATE_WINDOW_CLOSED = "window_closed";
}
Symbol 2163 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.houses.House3] Frame 0
class com.disney.gem.games.pizza_toss.elements.houses.House3 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, defineEvents, onActivate, setState, oItem, oOwner, oClient, mcRef, nIndex, stateIsOneOf, nFrame, x, y, testCollide, fromWhere, stateFinished;
function House3 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "House3";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "wall";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_DOOR_CLOSED, true);
if (oItem.client) {
oOwner.objectsList.push(new com.disney.gem.games.pizza_toss.elements.clients.Client3(oOwner, this));
oClient = oOwner.objectsList[oOwner.objectsList.length - 1];
}
hideMark();
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH, Collide_High, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
}
function deleteElement() {
var _local3 = 0;
for ( ; _local3 < oOwner.objectsList.length ; _local3++) {
if (oOwner.objectsList[_local3].sHouse == oClient.sHouse) {
oOwner.objectsList.splice(_local3, 1);
break;
}
}
oClient.destroy();
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH, Collide_High, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
super.deleteElement();
}
function hideMark() {
mcRef.mcCHTL._visible = false;
mcRef.mcCHBR._visible = false;
mcRef.mcCLTL._visible = false;
mcRef.mcCLBR._visible = false;
mcRef.mcLTL._visible = false;
mcRef.mcLBR._visible = false;
mcRef.mcHTL._visible = false;
mcRef.mcHBR._visible = false;
mcRef.mcHigh._visible = false;
mcRef.mcLow._visible = false;
}
function getRandomClient() {
var _local2 = new Array(mcRef.mcLow, mcRef.mcHigh);
nIndex = Math.floor(Math.random() * _local2.length);
if (nIndex == 0) {
oItem.exit = "door";
} else {
oItem.exit = "window";
}
oItem.time = com.disney.gem.games.pizza_toss.Config.Clients.Idle;
return(_local2[nIndex]);
}
function getEvent() {
if (nIndex == 0) {
var _local2 = com.disney.gem.games.pizza_toss.events.Event.TEST_LOW;
} else {
var _local2 = com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH;
}
return(_local2);
}
function hasMissed() {
var _local2 = false;
if (stateIsOneOf(STATE_DOOR_MISSED, STATE_WINDOW_MISSED)) {
_local2 = true;
}
return(_local2);
}
function open() {
nFrame = oItem.time;
setState(oItem.exit + "_out", true);
if (oItem.exit == "window") {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_OUT, true, false);
} else {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_OUT, true, false);
}
}
function catches() {
setState(oItem.exit + "_catch", true);
if (oItem.exit == "window") {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_CATCH, true, false);
} else {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_CATCH, true, false);
}
}
function getClientCollide() {
var _local2 = new Array({tl:mcRef.mcCLTL, br:mcRef.mcCLBR}, {tl:mcRef.mcCHTL, br:mcRef.mcCHBR});
return(_local2[nIndex]);
}
function givePosition(_oEvt, _oObj) {
if (_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_LOW) {
_oObj.pushPosition(x + mcRef.mcLBR._x, mcRef.getDepth());
} else if (_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH) {
_oObj.pushPosition(x + mcRef.mcHBR._x, mcRef.getDepth());
}
}
function Collide_High(_oEvt, _oObj) {
var _local4 = x + mcRef.mcHTL._x;
var _local5 = y + mcRef.mcHTL._y;
var _local6 = x + mcRef.mcHBR._x;
var _local7 = y + mcRef.mcHBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcHTL._x, mcRef.mcHTL._y, mcRef.mcHBR._x, mcRef.mcHBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
function Collide_Low(_oEvt, _oObj) {
var _local4 = x + mcRef.mcLTL._x;
var _local5 = y + mcRef.mcLTL._y;
var _local6 = x + mcRef.mcLBR._x;
var _local7 = y + mcRef.mcLBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcLTL._x, mcRef.mcLTL._y, mcRef.mcLBR._x, mcRef.mcLBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
function state_door_out() {
if (stateFinished()) {
setState(STATE_DOOR_IDLE, true);
}
}
function state_door_in() {
if (stateFinished()) {
setState(STATE_DOOR_CLOSED, true);
}
}
function state_door_catch() {
if (stateFinished()) {
setState(STATE_DOOR_CLOSED, true);
}
}
function state_door_idle() {
nFrame--;
if (nFrame <= 0) {
oClient.destroy();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_MISSED, true, false);
setState(STATE_DOOR_MISSED, true);
}
}
function state_door_missed() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_IN, true, false);
setState(STATE_DOOR_IN, true);
}
}
function state_window_out() {
if (stateFinished()) {
setState(STATE_WINDOW_IDLE, true);
}
}
function state_window_in() {
if (stateFinished()) {
setState(STATE_WINDOW_CLOSED, true);
}
}
function state_window_catch() {
if (stateFinished()) {
setState(STATE_WINDOW_CLOSED, true);
}
}
function state_window_idle() {
nFrame--;
if (nFrame <= 0) {
oClient.destroy();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_MISSED, true, false);
setState(STATE_WINDOW_MISSED, true);
}
}
function state_window_missed() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_IN, true, false);
setState(STATE_WINDOW_IN, true);
}
}
static var STATE_DOOR_OUT = "door_out";
static var STATE_DOOR_IN = "door_in";
static var STATE_DOOR_CATCH = "door_catch";
static var STATE_DOOR_IDLE = "door_idle";
static var STATE_DOOR_MISSED = "door_missed";
static var STATE_DOOR_CLOSED = "door_closed";
static var STATE_WINDOW_OUT = "window_out";
static var STATE_WINDOW_IN = "window_in";
static var STATE_WINDOW_CATCH = "window_catch";
static var STATE_WINDOW_IDLE = "window_idle";
static var STATE_WINDOW_MISSED = "window_missed";
static var STATE_WINDOW_CLOSED = "window_closed";
}
Symbol 2164 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.houses.House4] Frame 0
class com.disney.gem.games.pizza_toss.elements.houses.House4 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, defineEvents, onActivate, setState, oItem, oOwner, oClient, mcRef, nIndex, stateIsOneOf, nFrame, x, y, testCollide, fromWhere, stateFinished;
function House4 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "House4";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "wall";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_DOOR_CLOSED, true);
if (oItem.client) {
oOwner.objectsList.push(new com.disney.gem.games.pizza_toss.elements.clients.Client4(oOwner, this));
oClient = oOwner.objectsList[oOwner.objectsList.length - 1];
}
hideMark();
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH, Collide_High, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
}
function deleteElement() {
var _local3 = 0;
for ( ; _local3 < oOwner.objectsList.length ; _local3++) {
if (oOwner.objectsList[_local3].sHouse == oClient.sHouse) {
oOwner.objectsList.splice(_local3, 1);
break;
}
}
oClient.destroy();
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH, Collide_High, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
super.deleteElement();
}
function hideMark() {
mcRef.mcCHTL._visible = false;
mcRef.mcCHBR._visible = false;
mcRef.mcCLTL._visible = false;
mcRef.mcCLBR._visible = false;
mcRef.mcLTL._visible = false;
mcRef.mcLBR._visible = false;
mcRef.mcHTL._visible = false;
mcRef.mcHBR._visible = false;
mcRef.mcHigh._visible = false;
mcRef.mcLow._visible = false;
}
function getRandomClient() {
var _local2 = new Array(mcRef.mcLow, mcRef.mcHigh);
nIndex = Math.floor(Math.random() * _local2.length);
if (nIndex == 0) {
oItem.exit = "door";
} else {
oItem.exit = "window";
}
oItem.time = com.disney.gem.games.pizza_toss.Config.Clients.Idle;
return(_local2[nIndex]);
}
function getEvent() {
if (nIndex == 0) {
var _local2 = com.disney.gem.games.pizza_toss.events.Event.TEST_LOW;
} else {
var _local2 = com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH;
}
return(_local2);
}
function hasMissed() {
var _local2 = false;
if (stateIsOneOf(STATE_DOOR_MISSED, STATE_WINDOW_MISSED)) {
_local2 = true;
}
return(_local2);
}
function open() {
nFrame = oItem.time;
setState(oItem.exit + "_out", true);
if (oItem.exit == "window") {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_OUT, true, false);
} else {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_OUT, true, false);
}
}
function catches() {
setState(oItem.exit + "_catch", true);
if (oItem.exit == "window") {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_CATCH, true, false);
} else {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_CATCH, true, false);
}
}
function getClientCollide() {
var _local2 = new Array({tl:mcRef.mcCLTL, br:mcRef.mcCLBR}, {tl:mcRef.mcCHTL, br:mcRef.mcCHBR});
return(_local2[nIndex]);
}
function givePosition(_oEvt, _oObj) {
if ((_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_LOW) && (_oObj.x > (x + mcRef.mcLBR._x))) {
_oObj.pushPosition(x + mcRef.mcLBR._x, mcRef.getDepth());
} else if ((_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH) && (_oObj.x > (x + mcRef.mcHBR._x))) {
_oObj.pushPosition(x + mcRef.mcHBR._x, mcRef.getDepth());
}
}
function Collide_High(_oEvt, _oObj) {
var _local4 = x + mcRef.mcHTL._x;
var _local5 = y + mcRef.mcHTL._y;
var _local6 = x + mcRef.mcHBR._x;
var _local7 = y + mcRef.mcHBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcHTL._x, mcRef.mcHTL._y, mcRef.mcHBR._x, mcRef.mcHBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
function Collide_Low(_oEvt, _oObj) {
var _local4 = x + mcRef.mcLTL._x;
var _local5 = y + mcRef.mcLTL._y;
var _local6 = x + mcRef.mcLBR._x;
var _local7 = y + mcRef.mcLBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcLTL._x, mcRef.mcLTL._y, mcRef.mcLBR._x, mcRef.mcLBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
function state_door_out() {
if (stateFinished()) {
setState(STATE_DOOR_IDLE, true);
}
}
function state_door_in() {
if (stateFinished()) {
setState(STATE_DOOR_CLOSED, true);
}
}
function state_door_catch() {
if (stateFinished()) {
setState(STATE_DOOR_CLOSED, true);
}
}
function state_door_idle() {
nFrame--;
if (nFrame <= 0) {
oClient.destroy();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_MISSED, true, false);
setState(STATE_DOOR_MISSED, true);
}
}
function state_door_missed() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_IN, true, false);
setState(STATE_DOOR_IN, true);
}
}
function state_window_out() {
if (stateFinished()) {
setState(STATE_WINDOW_IDLE, true);
}
}
function state_window_in() {
if (stateFinished()) {
setState(STATE_WINDOW_CLOSED, true);
}
}
function state_window_catch() {
if (stateFinished()) {
setState(STATE_WINDOW_CLOSED, true);
}
}
function state_window_idle() {
nFrame--;
if (nFrame <= 0) {
oClient.destroy();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_MISSED, true, false);
setState(STATE_WINDOW_MISSED, true);
}
}
function state_window_missed() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_IN, true, false);
setState(STATE_WINDOW_IN, true);
}
}
static var STATE_DOOR_OUT = "door_out";
static var STATE_DOOR_IN = "door_in";
static var STATE_DOOR_CATCH = "door_catch";
static var STATE_DOOR_IDLE = "door_idle";
static var STATE_DOOR_MISSED = "door_missed";
static var STATE_DOOR_CLOSED = "door_closed";
static var STATE_WINDOW_OUT = "window_out";
static var STATE_WINDOW_IN = "window_in";
static var STATE_WINDOW_CATCH = "window_catch";
static var STATE_WINDOW_IDLE = "window_idle";
static var STATE_WINDOW_MISSED = "window_missed";
static var STATE_WINDOW_CLOSED = "window_closed";
}
Symbol 2165 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.houses.House5] Frame 0
class com.disney.gem.games.pizza_toss.elements.houses.House5 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, defineEvents, onActivate, setState, oItem, oOwner, oClient, mcRef, nIndex, stateIsOneOf, nFrame, x, y, testCollide, fromWhere, stateFinished;
function House5 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "House5";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "wall";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_DOOR_CLOSED, true);
if (oItem.client) {
oOwner.objectsList.push(new com.disney.gem.games.pizza_toss.elements.clients.Client5(oOwner, this));
oClient = oOwner.objectsList[oOwner.objectsList.length - 1];
}
hideMark();
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH, Collide_High, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
}
function deleteElement() {
var _local3 = 0;
for ( ; _local3 < oOwner.objectsList.length ; _local3++) {
if (oOwner.objectsList[_local3].sHouse == oClient.sHouse) {
oOwner.objectsList.splice(_local3, 1);
break;
}
}
oClient.destroy();
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH, Collide_High, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST_LOW, Collide_Low, this);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.POSITION, givePosition, this);
super.deleteElement();
}
function hideMark() {
mcRef.mcCHTL._visible = false;
mcRef.mcCHBR._visible = false;
mcRef.mcCLTL._visible = false;
mcRef.mcCLBR._visible = false;
mcRef.mcLTL._visible = false;
mcRef.mcLBR._visible = false;
mcRef.mcHTL._visible = false;
mcRef.mcHBR._visible = false;
mcRef.mcHigh._visible = false;
mcRef.mcLow._visible = false;
}
function getRandomClient() {
var _local2 = new Array(mcRef.mcLow, mcRef.mcHigh);
nIndex = Math.floor(Math.random() * _local2.length);
if (nIndex == 0) {
oItem.exit = "door";
} else {
oItem.exit = "window";
}
oItem.time = com.disney.gem.games.pizza_toss.Config.Clients.Idle;
return(_local2[nIndex]);
}
function getEvent() {
if (nIndex == 0) {
var _local2 = com.disney.gem.games.pizza_toss.events.Event.TEST_LOW;
} else {
var _local2 = com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH;
}
return(_local2);
}
function hasMissed() {
var _local2 = false;
if (stateIsOneOf(STATE_DOOR_MISSED, STATE_WINDOW_MISSED)) {
_local2 = true;
}
return(_local2);
}
function open() {
nFrame = oItem.time;
setState(oItem.exit + "_out", true);
if (oItem.exit == "window") {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_OUT, true, false);
} else {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_OUT, true, false);
}
}
function catches() {
setState(oItem.exit + "_catch", true);
if (oItem.exit == "window") {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_CATCH, true, false);
} else {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_CATCH, true, false);
}
}
function getClientCollide() {
var _local2 = new Array({tl:mcRef.mcCLTL, br:mcRef.mcCLBR}, {tl:mcRef.mcCHTL, br:mcRef.mcCHBR});
return(_local2[nIndex]);
}
function givePosition(_oEvt, _oObj) {
if ((_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_LOW) && (_oObj.x > (x + mcRef.mcLBR._x))) {
_oObj.pushPosition(x + mcRef.mcLBR._x, mcRef.getDepth());
} else if ((_oEvt.more == com.disney.gem.games.pizza_toss.events.Event.TEST_HIGH) && (_oObj.x > (x + mcRef.mcHBR._x))) {
_oObj.pushPosition(x + mcRef.mcHBR._x, mcRef.getDepth());
}
}
function Collide_High(_oEvt, _oObj) {
var _local4 = x + mcRef.mcHTL._x;
var _local5 = y + mcRef.mcHTL._y;
var _local6 = x + mcRef.mcHBR._x;
var _local7 = y + mcRef.mcHBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcHTL._x, mcRef.mcHTL._y, mcRef.mcHBR._x, mcRef.mcHBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
function Collide_Low(_oEvt, _oObj) {
var _local4 = x + mcRef.mcLTL._x;
var _local5 = y + mcRef.mcLTL._y;
var _local6 = x + mcRef.mcLBR._x;
var _local7 = y + mcRef.mcLBR._y;
var _local8 = _oObj.left + _oObj.speedX;
var _local9 = _oObj.top + _oObj.speedY;
var _local10 = _oObj.right + _oObj.speedX;
var _local11 = _oObj.bottom + _oObj.speedY;
var _local12 = testCollide(mcRef.mcLTL._x, mcRef.mcLTL._y, mcRef.mcLBR._x, mcRef.mcLBR._y, _oObj.left, _oObj.top, _oObj.right, _oObj.bottom);
var _local13 = testCollide(_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11);
if ((_local12 > -1) || (_local13 > -1)) {
var _local14 = fromWhere(((_local12 > -1) ? (_local12) : (_local13)));
if (_local14 == "bottom") {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.COLLIDE_HD, "bottom", _oObj.name), this);
}
}
}
function state_door_out() {
if (stateFinished()) {
setState(STATE_DOOR_IDLE, true);
}
}
function state_door_in() {
if (stateFinished()) {
setState(STATE_DOOR_CLOSED, true);
}
}
function state_door_catch() {
if (stateFinished()) {
setState(STATE_DOOR_CLOSED, true);
}
}
function state_door_idle() {
nFrame--;
if (nFrame <= 0) {
oClient.destroy();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_MISSED, true, false);
setState(STATE_DOOR_MISSED, true);
}
}
function state_door_missed() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOOR_IN, true, false);
setState(STATE_DOOR_IN, true);
}
}
function state_window_out() {
if (stateFinished()) {
setState(STATE_WINDOW_IDLE, true);
}
}
function state_window_in() {
if (stateFinished()) {
setState(STATE_WINDOW_CLOSED, true);
}
}
function state_window_catch() {
if (stateFinished()) {
setState(STATE_WINDOW_CLOSED, true);
}
}
function state_window_idle() {
nFrame--;
if (nFrame <= 0) {
oClient.destroy();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_MISSED, true, false);
setState(STATE_WINDOW_MISSED, true);
}
}
function state_window_missed() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_WINDOW_IN, true, false);
setState(STATE_WINDOW_IN, true);
}
}
static var STATE_DOOR_OUT = "door_out";
static var STATE_DOOR_IN = "door_in";
static var STATE_DOOR_CATCH = "door_catch";
static var STATE_DOOR_IDLE = "door_idle";
static var STATE_DOOR_MISSED = "door_missed";
static var STATE_DOOR_CLOSED = "door_closed";
static var STATE_WINDOW_OUT = "window_out";
static var STATE_WINDOW_IN = "window_in";
static var STATE_WINDOW_CATCH = "window_catch";
static var STATE_WINDOW_IDLE = "window_idle";
static var STATE_WINDOW_MISSED = "window_missed";
static var STATE_WINDOW_CLOSED = "window_closed";
}
Symbol 2166 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.accessories.RoadCiment] Frame 0
class com.disney.gem.games.pizza_toss.elements.accessories.RoadCiment extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, onActivate, setState;
function RoadCiment (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "RoadCiment";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_IDLE, true);
}
static var STATE_IDLE = "idle";
}
Symbol 2167 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.obstacles.Car1] Frame 0
class com.disney.gem.games.pizza_toss.elements.obstacles.Car1 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, bStart, setProperties, setItem, setNameLinkage, sType, sCrash, defineEvents, onActivate, topLeft, mcRef, bottomRight, nTime, oItem, oOwner, setState, setTarget, oTarget, Collide, aPosition, x, y;
function Car1 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Car1";
bStart = false;
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "crash";
sCrash = "Car";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
topLeft(mcRef.mcTopLeft);
bottomRight(mcRef.mcBottomRight);
mcRef.mcTopLeft._visible = false;
mcRef.mcBottomRight._visible = false;
mcRef.mcCross1._visible = false;
mcRef.mcCross2._visible = false;
var _local3 = getMove();
nTime = (oItem.timebefore - Math.floor(Math.floor((oItem.endx - oItem.startx) / _local3.x) / 2)) - 7;
oOwner.displayed.push({mc:mcRef, x:mcRef._x, y:mcRef._y, depth:mcRef.getDepth()});
setState(STATE_IDLE, true);
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_CAR, true, false);
setTarget(oOwner.dispatcher);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function deleteElement() {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_CAR);
super.deleteElement();
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function setDepth() {
var _local2 = mcRef.getDepth();
var _local3 = 0;
for ( ; _local3 < aPosition.length ; _local3++) {
if ((x > aPosition[_local3].x) && (_local2 > aPosition[_local3].depth)) {
_local2 = getAvailableDepth(aPosition[_local3].depth);
}
}
mcRef.swapDepths(_local2);
}
function getAvailableDepth(_nDepth) {
var _local3 = _nDepth--;
var _local4 = oOwner.mcGame.mcInner;
var _local5 = 1;
for ( ; _local5 <= 9 ; _local5++) {
if (_local4.getInstanceAtDepth(_nDepth - _local5) == undefined) {
_local3 = _nDepth + _local5;
break;
}
}
return(_local3);
}
function pushPosition(_nX, _nDepth) {
aPosition.push({x:_nX, depth:_nDepth});
}
function state_idle() {
if (!bStart) {
nTime--;
if (nTime <= 0) {
bStart = true;
}
} else {
aPosition = new Array();
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.POSITION, "", oItem.event), this);
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(oItem.event), this);
setDepth();
move();
}
}
function move() {
if (x < oItem.endx) {
var _local2 = getMove();
x = x + _local2.x;
y = y + _local2.y;
}
if (oOwner.oColor == com.disney.gem.games.pizza_toss.dayTime.Hour.Evening) {
var _local3 = new flash.geom.Transform(mcRef.mcState.mcFront.mcLight);
var _local4 = new flash.geom.ColorTransform(1.4375, 1.4375, 1.4375, 1, 0, 0, 0, 0);
_local3.colorTransform = _local4;
}
}
function getMove() {
var _local2 = getAngle();
var _local3 = {x:0, y:0};
_local3.x = Math.sin(_local2 * (Math.PI / 180)) * nSpeed;
_local3.y = (Math.cos(_local2 * (Math.PI / 180)) * nSpeed) * -1;
return(_local3);
}
function getAngle() {
var _local2 = ((Math.atan2(oItem.endy - oItem.starty, oItem.endx - oItem.startx) * 180) / Math.PI) + 90;
if (_local2 > 180) {
_local2 = _local2 + -360;
}
return(_local2);
}
function get crosses() {
return({one:mcRef.mcCross1, two:mcRef.mcCross2});
}
static var STATE_IDLE = "idle";
var nSpeed = 10;
}
Symbol 2168 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.obstacles.Car2] Frame 0
class com.disney.gem.games.pizza_toss.elements.obstacles.Car2 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, bStart, setProperties, setItem, setNameLinkage, sType, sCrash, defineEvents, onActivate, topLeft, mcRef, bottomRight, nTime, oItem, oOwner, setState, setTarget, oTarget, Collide, aPosition, x, y;
function Car2 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Car2";
bStart = false;
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "crash";
sCrash = "Car";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
topLeft(mcRef.mcTopLeft);
bottomRight(mcRef.mcBottomRight);
mcRef.mcTopLeft._visible = false;
mcRef.mcBottomRight._visible = false;
mcRef.mcCross1._visible = false;
mcRef.mcCross2._visible = false;
var _local3 = getMove();
nTime = (oItem.timebefore - Math.floor(Math.floor((oItem.endx - oItem.startx) / _local3.x) / 2)) - 7;
oOwner.displayed.push({mc:mcRef, x:mcRef._x, y:mcRef._y, depth:mcRef.getDepth()});
setState(STATE_IDLE, true);
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_CAR, true, false);
setTarget(oOwner.dispatcher);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function deleteElement() {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_CAR);
super.deleteElement();
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function setDepth() {
var _local2 = mcRef.getDepth();
var _local3 = 0;
for ( ; _local3 < aPosition.length ; _local3++) {
if ((x > aPosition[_local3].x) && (_local2 > aPosition[_local3].depth)) {
_local2 = getAvailableDepth(aPosition[_local3].depth);
}
}
mcRef.swapDepths(_local2);
}
function getAvailableDepth(_nDepth) {
var _local3 = _nDepth--;
var _local4 = oOwner.mcGame.mcInner;
var _local5 = 1;
for ( ; _local5 <= 9 ; _local5++) {
if (_local4.getInstanceAtDepth(_nDepth - _local5) == undefined) {
_local3 = _nDepth + _local5;
break;
}
}
return(_local3);
}
function pushPosition(_nX, _nDepth) {
aPosition.push({x:_nX, depth:_nDepth});
}
function state_idle() {
if (!bStart) {
nTime--;
if (nTime <= 0) {
bStart = true;
}
} else {
aPosition = new Array();
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.POSITION, "", oItem.event), this);
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(oItem.event), this);
setDepth();
move();
}
}
function move() {
if (x < oItem.endx) {
var _local2 = getMove();
x = x + _local2.x;
y = y + _local2.y;
}
if (oOwner.oColor == com.disney.gem.games.pizza_toss.dayTime.Hour.Evening) {
var _local3 = new flash.geom.Transform(mcRef.mcState.mcFront.mcLight);
var _local4 = new flash.geom.ColorTransform(1.4375, 1.4375, 1.4375, 1, 0, 0, 0, 0);
_local3.colorTransform = _local4;
}
}
function getMove() {
var _local2 = getAngle();
var _local3 = {x:0, y:0};
_local3.x = Math.sin(_local2 * (Math.PI / 180)) * nSpeed;
_local3.y = (Math.cos(_local2 * (Math.PI / 180)) * nSpeed) * -1;
return(_local3);
}
function getAngle() {
var _local2 = ((Math.atan2(oItem.endy - oItem.starty, oItem.endx - oItem.startx) * 180) / Math.PI) + 90;
if (_local2 > 180) {
_local2 = _local2 + -360;
}
return(_local2);
}
function get crosses() {
return({one:mcRef.mcCross1, two:mcRef.mcCross2});
}
static var STATE_IDLE = "idle";
var nSpeed = 10;
}
Symbol 2169 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.obstacles.Fireborn] Frame 0
class com.disney.gem.games.pizza_toss.elements.obstacles.Fireborn extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, sSlow, defineEvents, onActivate, topLeft, mcRef, bottomRight, setState, setTarget, oOwner, oTarget, Collide, stateFinished;
function Fireborn (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Fireborn";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "slowdown";
sSlow = "Water";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
topLeft(mcRef.mcTopLeft);
bottomRight(mcRef.mcBottomRight);
mcRef.mcTopLeft._visible = false;
mcRef.mcBottomRight._visible = false;
mcRef.mcCross1._visible = false;
mcRef.mcCross2._visible = false;
setState(STATE_IDLE, true);
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_FIREBORN, true, false);
setTarget(oOwner.dispatcher);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function deleteElement() {
super.deleteElement();
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function bump() {
setState(STATE_BUMP, true);
}
function state_bump() {
if (stateFinished()) {
setState(STATE_IDLE, true);
}
}
function get crosses() {
return({one:mcRef.mcCross1, two:mcRef.mcCross2});
}
static var STATE_IDLE = "idle";
static var STATE_BUMP = "bump";
}
Symbol 2170 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.obstacles.Kid] Frame 0
class com.disney.gem.games.pizza_toss.elements.obstacles.Kid extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, sCrash, defineEvents, onActivate, topLeft, mcRef, bottomRight, setState, oOwner, setTarget, oTarget, Collide, bAct, stateFinished, x, y;
function Kid (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Kid";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "crash";
sCrash = "Kid";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
topLeft(mcRef.mcTopLeft);
bottomRight(mcRef.mcBottomRight);
mcRef.mcTopLeft._visible = false;
mcRef.mcBottomRight._visible = false;
mcRef.mcCross1._visible = false;
mcRef.mcCross2._visible = false;
setState(STATE_IDLE, true);
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_KID_PLAY);
oOwner.displayed.push({mc:mcRef, x:mcRef._x, y:mcRef._y, depth:mcRef.getDepth()});
setTarget(oOwner.dispatcher);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function deleteElement() {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_KID_PLAY);
super.deleteElement();
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function scared() {
if (!bAct) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_KID_SCARED);
setState(STATE_SCARED, true);
bAct = true;
}
}
function state_scared() {
if (stateFinished()) {
setState(STATE_FALL, true);
x = x + -33.6;
y = y + -9.6;
}
}
function get crosses() {
return({one:mcRef.mcCross1, two:mcRef.mcCross2});
}
static var STATE_IDLE = "idle";
static var STATE_SCARED = "scared";
static var STATE_FALL = "fall";
}
Symbol 2171 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.obstacles.Manhole] Frame 0
class com.disney.gem.games.pizza_toss.elements.obstacles.Manhole extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, sSlow, defineEvents, onActivate, topLeft, mcRef, bottomRight, setState, setTarget, oOwner, oTarget, Collide;
function Manhole (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Manhole";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "slowdown";
sSlow = "SlowDown";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
topLeft(mcRef.mcTopLeft);
bottomRight(mcRef.mcBottomRight);
mcRef.mcTopLeft._visible = false;
mcRef.mcBottomRight._visible = false;
mcRef.mcCross1._visible = false;
mcRef.mcCross2._visible = false;
setState(STATE_IDLE, true);
setTarget(oOwner.dispatcher);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function deleteElement() {
super.deleteElement();
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function get crosses() {
return({one:mcRef.mcCross1, two:mcRef.mcCross2});
}
static var STATE_IDLE = "idle";
}
Symbol 2172 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.obstacles.OldDude] Frame 0
class com.disney.gem.games.pizza_toss.elements.obstacles.OldDude extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, sCrash, defineEvents, onActivate, topLeft, mcRef, bottomRight, setState, oOwner, setTarget, oTarget, Collide, bAct, stateFinished, x, y;
function OldDude (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "OldDude";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "crash";
sCrash = "OldDude";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
topLeft(mcRef.mcTopLeft);
bottomRight(mcRef.mcBottomRight);
mcRef.mcTopLeft._visible = false;
mcRef.mcBottomRight._visible = false;
mcRef.mcSep._visible = false;
mcRef.mcCross1._visible = false;
mcRef.mcCross2._visible = false;
setState(STATE_IDLE, true);
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_OLD_WALKING);
oOwner.displayed.push({mc:mcRef, x:mcRef._x, y:mcRef._y, depth:mcRef.getDepth()});
setTarget(oOwner.dispatcher);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function deleteElement() {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_OLD_WALKING);
super.deleteElement();
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function scared() {
if (!bAct) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_OLD_GET_SCARED, true, false);
setState(STATE_SCARED_IN, true);
bAct = true;
}
}
function fall() {
if (!bAct) {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_OLD_FALL, true, false);
setState(STATE_FALL_IN, true);
bAct = true;
}
}
function state_idle() {
if (stateFinished()) {
mcRef.mcState.gotoAndPlay(1);
mcRef._x = mcRef._x + 7.2;
mcRef._y = mcRef._y + 4.4;
}
}
function state_scared_in() {
if (stateFinished()) {
setState(STATE_SCARED_IDLE, true);
}
}
function state_fall_in() {
if (stateFinished()) {
setState(STATE_FALL_IDLE, true);
x = x + -33.7;
y = y + -30.3;
}
}
function get limit() {
return(mcRef.mcSep._y + y);
}
function get crosses() {
return({one:mcRef.mcCross1, two:mcRef.mcCross2});
}
static var STATE_IDLE = "idle";
static var STATE_SCARED_IN = "scared_in";
static var STATE_SCARED_IDLE = "scared_idle";
static var STATE_FALL_IN = "fall_in";
static var STATE_FALL_IDLE = "fall_idle";
}
Symbol 2173 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.obstacles.Weiner] Frame 0
class com.disney.gem.games.pizza_toss.elements.obstacles.Weiner extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, sCrash, nFrame, nSpeed, defineEvents, onActivate, topLeft, mcRef, bottomRight, oOwner, setState, Collide, sDeactivate, oItem, y, x, stateFinished;
function Weiner (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Weiner";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "crash";
sCrash = "Weiner";
nFrame = 0;
nSpeed = com.disney.gem.games.pizza_toss.Config.Weiner.Speed;
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
topLeft(mcRef.mcTopLeft);
bottomRight(mcRef.mcBottomRight);
mcRef.mcTopLeft._visible = false;
mcRef.mcBottomRight._visible = false;
oOwner.displayed.push({mc:mcRef, x:mcRef._x, y:mcRef._y, depth:mcRef.getDepth()});
setState(STATE_IDLE, true);
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOG_IDLE);
}
function onDestroy() {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOG_IDLE);
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOG_SCARED);
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOG_RUN);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
super.onDestroy();
}
function changeDelete() {
oOwner.dispatcher.removeEventListener(sDeactivate, onDestroy, this);
sDeactivate = "deactivate_" + Math.floor(mcRef._x / com.disney.gem.games.pizza_toss.Config.Defaults.Slice);
oOwner.dispatcher.addEventListener(sDeactivate, onDestroy, this);
}
function run() {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOG_IDLE);
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOG_RUN);
setState(STATE_RUN, true);
nFrame = com.disney.gem.games.pizza_toss.Config.Penalities.Weiner;
}
function bump() {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOG_RUN);
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOG_BUMP);
setState(STATE_BUMP, true);
oOwner.dispatcher.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function willChase() {
if (oItem.house.hasMissed()) {
if (Math.random() < com.disney.gem.games.pizza_toss.Config.Weiner.ChanceToChase) {
oOwner.dispatcher.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
run();
}
}
}
function getMove() {
var _local2 = getAngle();
var _local3 = {x:0, y:0};
_local3.x = Math.sin(_local2 * (Math.PI / 180)) * nSpeed;
_local3.y = (Math.cos(_local2 * (Math.PI / 180)) * nSpeed) * -1;
return(_local3);
}
function getAngle() {
var _local2 = ((Math.atan2(oOwner.getPlayer().y - y, oOwner.getPlayer().x - x) * 180) / Math.PI) + 90;
if (_local2 > 180) {
_local2 = _local2 + -360;
}
return(_local2);
}
function state_idle() {
willChase();
}
function state_run() {
nFrame--;
if (nFrame <= 0) {
nSpeed = nSpeed - 0.1;
if (nSpeed <= 0) {
nSpeed = 0;
}
}
changeDelete();
var _local2 = getMove();
mcRef._rotation = -33;
mcRef._x = mcRef._x + _local2.x;
mcRef._y = mcRef._y + _local2.y;
}
function state_bump() {
if (stateFinished()) {
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_DOG_SCARED);
setState(STATE_BUMP_IDLE, true);
}
}
static var STATE_IDLE = "idle";
static var STATE_RUN = "run";
static var STATE_BUMP = "bump";
static var STATE_BUMP_IDLE = "bump_idle";
}
Symbol 2174 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.roads.Intersection] Frame 0
class com.disney.gem.games.pizza_toss.elements.roads.Intersection extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, oOwner, setState, nTimeBefore, x, sActivate, sDeactivate, deleteElement, y, aSchema;
function Intersection (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Intersection";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
}
function createElement() {
super.createElement();
oOwner.amILast(this);
setState("day", true);
oOwner.nRoadCreated = oOwner.nRoadCreated + 1;
var _local3 = oOwner.getPlayer();
nTimeBefore = Math.floor((x - _local3.x) / _local3.speedX);
if (!_global.isFinite(nTimeBefore)) {
nTimeBefore = 100;
}
generateRoadItems(com.disney.gem.games.pizza_toss.patterns.Cross.pattern);
}
function onActivate() {
oOwner.dispatcher.removeEventListener(sActivate, onActivate, this);
oOwner.dispatcher.addEventListener(sDeactivate, onDeactivate, this);
createElement();
}
function onDeactivate() {
oOwner.dispatcher.removeEventListener(sDeactivate, onDeactivate, this);
oOwner.dispatcher.addEventListener(sActivate, onActivate, this);
deleteElement();
}
function generateRoadItems(_aPattern) {
var _local6 = new Array();
_local6 = _aPattern;
var _local7 = 0;
for ( ; _local7 < _local6.length ; _local7++) {
var _local4 = new Array();
var _local5 = new Object();
for ( ; (_local6[_local7].name.indexOf("Car") > -1) && (oOwner.nRoadCreated < com.disney.gem.games.pizza_toss.Config.Defaults.RoadBefore) ; _local7++) {
}
_local5 = generateItemInfo(_local6[_local7]);
_local5.depth = oOwner.getItemDepth();
_local4 = getProperties(_local5);
if (_local4 != undefined) {
var _local8 = "com.disney.gem.games.pizza_toss.elements.";
if (_local5.package != "") {
_local8 = _local8 + (_local5.package + ".");
}
_local8 = _local8 + _local5.name;
var _local3 = com.disney.gem.games.pizza_toss.utility.ClassFinder.find(_local8);
com.disney.gem.games.pizza_toss.Controller.Instance.Game.objectsList.push(new _local3[undefined](oOwner, _local4, _local5));
}
}
}
function getProperties(_oItem) {
var _local3 = new Array();
var _local4 = new Array("x", "y", "xscale", "yscale", "rotation", "width", "height");
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
if (_oItem[_local4[_local5]] != undefined) {
_local3.push(["_" + _local4[_local5], _oItem[_local4[_local5]]]);
}
}
return(_local3);
}
function generateItemInfo(_oItem) {
var _local3 = new Object();
if (_oItem.name != undefined) {
_local3.name = _oItem.name;
}
if (_oItem.package != undefined) {
_local3.package = _oItem.package;
}
if (_oItem.linkage != undefined) {
_local3.linkage = _oItem.linkage;
}
if (_oItem.x != undefined) {
_local3.x = _oItem.x + x;
_local3.left = _local3.x;
_local3.right = _local3.x;
}
if (_oItem.y != undefined) {
_local3.y = _oItem.y + y;
}
if (_oItem.optional != undefined) {
_local3.optional = _oItem.optional;
}
if (_oItem.obstacle != undefined) {
_local3.obstacle = _oItem.obstacle;
}
if (_oItem.startx != undefined) {
_local3.startx = _oItem.startx + x;
_local3.x = _local3.startx;
_local3.left = _local3.startx;
}
if (_oItem.starty != undefined) {
_local3.starty = _oItem.starty + y;
_local3.y = _local3.starty;
}
if (_oItem.endx != undefined) {
_local3.endx = _oItem.endx + x;
_local3.right = _local3.endx;
}
if (_oItem.endy != undefined) {
_local3.endy = _oItem.endy + y;
}
if (_oItem.rotation != undefined) {
_local3.rotation = _oItem.rotation;
}
if (_oItem.bonus != undefined) {
_local3.bonus = _oItem.bonus;
}
if (_oItem.victory != undefined) {
_local3.victory = _oItem.victory;
}
if (_oItem.road != undefined) {
_local3.road = _oItem.road;
}
if (_oItem.accessory != undefined) {
_local3.accessory = _oItem.accessory;
}
if (_oItem.horizontal != undefined) {
_local3.horizontal = _oItem.horizontal;
}
if (_oItem.vertical != undefined) {
_local3.vertical = _oItem.vertical;
}
if (nTimeBefore != undefined) {
_local3.timebefore = nTimeBefore;
}
return(_local3);
}
function get schemas() {
return(aSchema);
}
}
Symbol 2175 MovieClip [__Packages.com.disney.gem.games.pizza_toss.patterns.Cross] Frame 0
class com.disney.gem.games.pizza_toss.patterns.Cross
{
function Cross () {
}
static function __get__pattern() {
var _local2 = new Array(aPattern01, aPattern02);
var _local3 = Math.round(Math.random() * (_local2.length - 1));
var _local4 = _local2[_local3];
return(_local4);
}
static var Road = {name:"Intersection", linkage:"mcIntersection", left:-209.4, right:216.5};
static var aPattern01 = [{name:"StreetLight", linkage:"mcStreetLight", package:"accessories", x:40.5, y:-94.5, optional:false, depth:20}, {name:"StreetLightSpot", linkage:"mcStreetLightSpot", package:"accessories", x:65.8, y:-71.5, rotation:-37.1, optional:false, depth:10}, {name:"Car1", linkage:"mcCar1", package:"obstacles", startx:-375.1, starty:-419.6, endx:316.1, endy:414.4, optional:true, obstacle:true, crash:true, interact:true, depth:30}];
static var aPattern02 = [{name:"StreetLight", linkage:"mcStreetLight", package:"accessories", x:40.5, y:-94.5, optional:false, depth:20}, {name:"StreetLightSpot", linkage:"mcStreetLightSpot", package:"accessories", x:65.8, y:-71.5, rotation:-37.1, optional:false, depth:10}, {name:"Car2", linkage:"mcCar2", package:"obstacles", startx:-368.3, starty:-426.8, endx:324.5, endy:408.4, optional:true, obstacle:true, crash:true, interact:true, depth:30}];
}
Symbol 2176 MovieClip [__Packages.com.disney.gem.games.pizza_toss.utility.ClassFinder] Frame 0
class com.disney.gem.games.pizza_toss.utility.ClassFinder
{
function ClassFinder () {
}
static function find(_sPackage) {
var _local3 = _global;
var _local4 = _sPackage.split(".");
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
_local3 = _local3[_local4[_local5]];
}
return(Function(_local3));
}
}
Symbol 2177 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.roads.Road] Frame 0
class com.disney.gem.games.pizza_toss.elements.roads.Road extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, oOwner, setState, sActivate, sDeactivate, deleteElement, mcRef, oHouse, x, y, aSchema;
function Road (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Road";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
}
function createElement() {
super.createElement();
oOwner.amILast(this);
setState("day", true);
oOwner.nRoadCreated = oOwner.nRoadCreated + 1;
if ((com.disney.gem.games.pizza_toss.Stats.totalClients >= com.disney.gem.games.pizza_toss.Stats.maxClients) && (!com.disney.gem.games.pizza_toss.Stats.mickey)) {
generateRoadItems(com.disney.gem.games.pizza_toss.patterns.Straight.oPattern07);
com.disney.gem.games.pizza_toss.Stats.mickey = true;
} else {
generateRoadItems(com.disney.gem.games.pizza_toss.patterns.Straight.pattern(oOwner.getLastPattern()));
}
}
function onActivate() {
oOwner.dispatcher.removeEventListener(sActivate, onActivate, this);
oOwner.dispatcher.addEventListener(sDeactivate, onDeactivate, this);
createElement();
}
function onDeactivate() {
oOwner.dispatcher.removeEventListener(sDeactivate, onDeactivate, this);
oOwner.dispatcher.addEventListener(sActivate, onActivate, this);
deleteElement();
}
function generateRoadItems(_aPattern) {
oOwner.setLastPattern(_aPattern);
var _local6 = new Array();
_local6 = generateList(_aPattern);
var _local7 = 0;
for ( ; _local7 < _local6.length ; _local7++) {
var _local4 = new Array();
var _local5 = new Object();
_local5 = generateItemInfo(_local6[_local7]);
_local5.depth = _local5.depth + mcRef.getDepth();
_local4 = getProperties(_local5);
if (_local4 != undefined) {
var _local8 = "com.disney.gem.games.pizza_toss.elements.";
if (_local5.package != undefined) {
_local8 = _local8 + (_local5.package + ".");
}
if (_local5.name.indexOf(",") > -1) {
var _local9 = _local5.name.split(",");
var _local10 = _local5.linkage.split(",");
var _local11 = Math.floor(Math.random() * _local9.length);
_local5.name = _local9[_local11];
_local5.linkage = _local10[_local11];
}
if ((oOwner.nRoadCreated > com.disney.gem.games.pizza_toss.Config.Defaults.RoadBefore) && ((_local5.package == "houses") && (!_local5.noclient))) {
_local5.client = Math.random() <= com.disney.gem.games.pizza_toss.Config["Level" + com.disney.gem.games.pizza_toss.Controller.Instance.getLevel()].Client;
if (_local5.client) {
com.disney.gem.games.pizza_toss.Stats.totalClients++;
}
} else {
_local5.client = false;
}
_local8 = _local8 + _local5.name;
var _local3 = com.disney.gem.games.pizza_toss.utility.ClassFinder.find(_local8);
com.disney.gem.games.pizza_toss.Controller.Instance.Game.objectsList.push(new _local3[undefined](oOwner, _local4, _local5));
if (_local5.package == "houses") {
oHouse = com.disney.gem.games.pizza_toss.Controller.Instance.Game.objectsList[com.disney.gem.games.pizza_toss.Controller.Instance.Game.objectsList.length - 1];
}
}
}
}
function getProperties(_oItem) {
var _local3 = new Array();
var _local4 = new Array("x", "y", "xscale", "yscale", "rotation", "width", "height");
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
if (_oItem[_local4[_local5]] != undefined) {
_local3.push(["_" + _local4[_local5], _oItem[_local4[_local5]]]);
}
}
return(_local3);
}
function generateItemInfo(_oItem) {
var _local3 = new Object();
if (_oItem.name != undefined) {
_local3.name = _oItem.name;
}
if (_oItem.package != undefined) {
_local3.package = _oItem.package;
}
if (_oItem.linkage != undefined) {
_local3.linkage = _oItem.linkage;
}
if (_oItem.x != undefined) {
if (typeof(_oItem.x) == "object") {
var _local4 = Math.floor(Math.random() * _oItem.x.length);
_local3.x = _oItem.x[_local4] + x;
} else {
_local3.x = _oItem.x + x;
}
_local3.left = _local3.x;
_local3.right = _local3.x;
}
if (_oItem.y != undefined) {
if (typeof(_oItem.y) == "object") {
_local3.y = _oItem.y[_local4] + y;
} else {
_local3.y = _oItem.y + y;
}
}
if (_oItem.optional != undefined) {
_local3.optional = _oItem.optional;
}
if (_oItem.obstacle != undefined) {
_local3.obstacle = _oItem.obstacle;
}
if (_oItem.startx != undefined) {
_local3.startx = _oItem.startx + x;
_local3.x = _local3.startx;
_local3.left = _local3.startx;
}
if (_oItem.starty != undefined) {
_local3.starty = _oItem.starty + y;
_local3.y = _local3.starty;
}
if (_oItem.endx != undefined) {
_local3.endx = _oItem.endx + x;
_local3.right = _local3.endx;
}
if (_oItem.endy != undefined) {
_local3.endy = _oItem.endy + y;
}
if (_oItem.rotation != undefined) {
_local3.rotation = _oItem.rotation;
}
if (_oItem.bonus != undefined) {
_local3.bonus = _oItem.bonus;
}
if (_oItem.victory != undefined) {
_local3.victory = _oItem.victory;
}
if (_oItem.road != undefined) {
_local3.road = _oItem.road;
}
if (_oItem.accessory != undefined) {
_local3.accessory = _oItem.accessory;
}
if (_oItem.horizontal != undefined) {
_local3.horizontal = _oItem.horizontal;
}
if (_oItem.vertical != undefined) {
_local3.vertical = _oItem.vertical;
}
if (_oItem.noclient != undefined) {
_local3.noclient = _oItem.noclient;
}
if (_oItem.name.indexOf("Weiner") > -1) {
_local3.house = oHouse;
}
if (_oItem.depth != undefined) {
_local3.depth = _oItem.depth;
}
return(_local3);
}
function generateList(_aPattern) {
var _local3 = new Array();
var _local4 = com.disney.gem.games.pizza_toss.Config["Level" + com.disney.gem.games.pizza_toss.Controller.Instance.getLevel()];
var _local5 = generateLists(_aPattern);
_local3 = _local5.must;
if (_local5.road.length > 0) {
var _local6 = Math.floor(Math.random() * _local5.road.length);
_local3.push(_local5.road[_local6]);
}
if (_local5.wall.length > 0) {
if (Math.random() <= _local4.Wall) {
_local3 = _local3.concat(_local5.wall);
}
}
if (_local5.bonus.length > 0) {
if (Math.random() <= _local4.Bonus) {
if ((Math.random() <= _local4.GasTank) && (oOwner.nGasTank == 0)) {
_local3.push(_local5.gastank[Math.floor(Math.random() * _local5.gastank.length)]);
} else if (oOwner.nBox == 0) {
_local3.push(_local5.hotdog[Math.floor(Math.random() * _local5.hotdog.length)]);
}
} else if (com.disney.gem.games.pizza_toss.Stats.fuel <= com.disney.gem.games.pizza_toss.Config.Defaults.EmergencyFuel) {
if (oOwner.emergencyAvailable("GasTank")) {
oOwner.setEmergency("GasTank", false);
_local3.push(_local5.gastank[Math.floor(Math.random() * _local5.gastank.length)]);
}
} else if (com.disney.gem.games.pizza_toss.Stats.hotdogs <= com.disney.gem.games.pizza_toss.Config.Defaults.EmergencyBox) {
if (oOwner.emergencyAvailable("HotDogBox")) {
oOwner.setEmergency("HotDogBox", false);
_local3.push(_local5.hotdog[Math.floor(Math.random() * _local5.hotdog.length)]);
}
}
}
if ((_local5.obstacles.length > 0) && (oOwner.nRoadCreated > com.disney.gem.games.pizza_toss.Config.Defaults.RoadBefore)) {
if (Math.random() <= _local4.Obstacle) {
if (Math.random() <= _local4.SlowDown) {
_local3.push(_local5.slow[Math.floor(Math.random() * _local5.slow.length)]);
} else {
_local3.push(_local5.crash[Math.floor(Math.random() * _local5.crash.length)]);
}
}
}
if (_local5.accessories.length > 0) {
var _local7 = 0;
for ( ; _local7 < _local5.accessories.length ; _local7++) {
if (Math.random() <= _local4.Accessory) {
_local3.push(_local5.accessories[_local7]);
}
}
}
return(_local3);
}
function generateLists(_aPattern) {
var _local3 = new Array();
var _local4 = new Array();
var _local5 = new Array();
var _local6 = new Array();
var _local7 = new Array();
var _local8 = new Array();
var _local9 = new Array();
var _local10 = new Array();
var _local11 = new Array();
var _local12 = new Array();
var _local13 = new Array();
var _local14 = new Array();
var _local15 = 0;
for ( ; _local15 < _aPattern.length ; _local15++) {
if (_aPattern[_local15].wall) {
_local3.push(_aPattern[_local15]);
}
if (_aPattern[_local15].optional) {
_local4.push(_aPattern[_local15]);
}
if (_aPattern[_local15].optional == false) {
_local12.push(_aPattern[_local15]);
}
if (_aPattern[_local15].accessory) {
_local5.push(_aPattern[_local15]);
}
if (_aPattern[_local15].obstacle && (!com.disney.gem.games.pizza_toss.Stats.mickey)) {
if (oOwner.getLastObstacle() != _aPattern[_local15]) {
oOwner.setLastObstacle(_aPattern[_local15]);
_local6.push(_aPattern[_local15]);
}
}
if (_aPattern[_local15].road) {
_local9.push(_aPattern[_local15]);
}
if (_aPattern[_local15].victory) {
_local10.push(_aPattern[_local15]);
}
if (_aPattern[_local15].bonus && (!com.disney.gem.games.pizza_toss.Stats.mickey)) {
_local11.push(_aPattern[_local15]);
}
if (_aPattern[_local15].slow && (!com.disney.gem.games.pizza_toss.Stats.mickey)) {
_local7.push(_aPattern[_local15]);
}
if (_aPattern[_local15].crash && (!com.disney.gem.games.pizza_toss.Stats.mickey)) {
_local8.push(_aPattern[_local15]);
}
if (_aPattern[_local15].gastank && (!com.disney.gem.games.pizza_toss.Stats.mickey)) {
_local14.push(_aPattern[_local15]);
}
if (_aPattern[_local15].hotdog && (!com.disney.gem.games.pizza_toss.Stats.mickey)) {
_local13.push(_aPattern[_local15]);
}
}
var _local16 = {wall:_local3, optional:_local4, must:_local12, accessories:_local5, road:_local9, victory:_local10, bonus:_local11, hotdog:_local13, gastank:_local14, slow:_local7, crash:_local8, obstacles:_local6};
return(_local16);
}
function get schemas() {
return(aSchema);
}
}
Symbol 2178 MovieClip [__Packages.com.disney.gem.games.pizza_toss.patterns.Straight] Frame 0
class com.disney.gem.games.pizza_toss.patterns.Straight
{
function Straight () {
}
static function pattern(_aLastPattern) {
if (com.disney.gem.games.pizza_toss.Stats.mickey) {
return(oPattern01);
}
var _local3 = new Array(oPattern01, oPattern02, oPattern03, oPattern04, oPattern05, oPattern06);
var _local4 = 0;
for ( ; _local4 < _local3.length ; _local4++) {
if (_local3[_local4] == _aLastPattern) {
_local3.splice(_local4, 1);
break;
}
}
var _local5 = Math.round(Math.random() * (_local3.length - 1));
var _local6 = _local3[_local5];
return(_local6);
}
static var Road = {name:"Road", linkage:"mcRoadAhead", left:-181.2, right:204.2};
static var oPattern01 = [{name:"Tree", package:"accessories", linkage:"mcTree", x:[-85.3, -245.9, -143.4], y:[-165.8, -187.3, -153.8], accessory:true, depth:40}, {name:"HotDogBox", package:"bonus", linkage:"mcHotDogBox", x:125.7, y:-23.4, bonus:true, hotdog:true, interact:true, depth:60}, {name:"GasTank", package:"bonus", linkage:"mcGasTank", x:125.1, y:-19.8, bonus:true, gastank:true, interact:true, depth:70}, {name:"Manhole", package:"obstacles", linkage:"mcManhole", x:53.1, y:-23.5, obstacle:true, slow:true, depth:10}, {name:"StreetLight", package:"accessories", linkage:"mcStreetLight", x:0.1, y:-97.8, optional:false, depth:50}, {name:"StreetLightSpot", package:"accessories", linkage:"mcStreetLightSpot", x:34.9, y:-71.2, rotation:-37.1, optional:false, depth:20}, {name:"Fireborn", package:"obstacles", linkage:"mcFireborn", x:83.9, y:44, obstacle:true, slow:true, depth:30}, {name:"OldDude", package:"obstacles", linkage:"mcOldDude", startx:-171.2, starty:-38, endx:-74.4, endy:24.7, obstacle:true, crash:true, interact:true, depth:80}, {name:"Kid", package:"obstacles", linkage:"mcKid", x:-43.8, y:-36.4, obstacle:true, crash:true, interact:true, depth:90}];
static var oPattern02 = [{name:"HotDogBox", package:"bonus", linkage:"mcHotDogBox", x:125.7, y:-23.4, bonus:true, hotdog:true, interact:true, depth:100}, {name:"GasTank", package:"bonus", linkage:"mcGasTank", x:125.1, y:-19.8, bonus:true, gastank:true, interact:true, depth:110}, {name:"Manhole", package:"obstacles", linkage:"mcManhole", x:53.1, y:-23.5, obstacle:true, slow:true, depth:10}, {name:"StreetLight", package:"accessories", linkage:"mcStreetLight", x:0.1, y:-97.8, optional:false, depth:60}, {name:"StreetLightSpot", package:"accessories", linkage:"mcStreetLightSpot", x:34.9, y:-71.2, rotation:-37.1, optional:false, depth:20}, {name:"Fireborn", package:"obstacles", linkage:"mcFireborn", x:83.9, y:44, obstacle:true, slow:true, depth:30}, {name:"OldDude", package:"obstacles", linkage:"mcOldDude", startx:-171.2, starty:-38, endx:-74.4, endy:24.7, obstacle:true, crash:true, interact:true, depth:120}, {name:"Kid", package:"obstacles", linkage:"mcKid", x:-43.8, y:-36.4, obstacle:true, crash:true, interact:true, depth:130}, {name:"RoadRock", package:"accessories", linkage:"mcRoadRock", x:-110.2, y:-120.3, road:true, depth:40}, {name:"RoadCiment", package:"accessories", linkage:"mcRoadCiment", x:-109.1, y:-120.8, road:true, depth:40}, {name:"Weiner", package:"obstacles", linkage:"mcWeiner", x:-63.6, y:-115.5, obstacle:true, crash:true, interact:true, depth:140}, {name:"SmallTree", package:"accessories", linkage:"mcSmallTree", x:[-8.1, -4.4, 32.7], y:[-221.8, -143.3, -166.8], accessory:true, depth:50}, {name:"Mailbox1,Mailbox2,Mailbox3,Mailbox4", package:"accessories", linkage:"mcMailbox1,mcMailbox2,mcMailbox3,mcMailbox4", x:-146.9, y:-100.7, accessory:true, depth:80}, {name:"Copse", package:"accessories", linkage:"mcCopse", x:[-250.1, -250.1, -185.5], y:[-182.8, -140.1, -130.2], accessory:true, depth:90}, {name:"House1", package:"houses", linkage:"mcHouse1", x:-194.4, y:-150.9, optional:false, depth:70}];
static var oPattern03 = [{name:"HotDogBox", package:"bonus", linkage:"mcHotDogBox", x:125.7, y:-23.4, bonus:true, hotdog:true, interact:true, depth:100}, {name:"GasTank", package:"bonus", linkage:"mcGasTank", x:125.1, y:-19.8, bonus:true, gastank:true, interact:true, depth:110}, {name:"Manhole", package:"obstacles", linkage:"mcManhole", x:53.1, y:-23.5, obstacle:true, slow:true, depth:10}, {name:"StreetLight", package:"accessories", linkage:"mcStreetLight", x:0.1, y:-97.8, optional:false, depth:60}, {name:"StreetLightSpot", package:"accessories", linkage:"mcStreetLightSpot", x:34.9, y:-71.2, rotation:-37.1, optional:false, depth:20}, {name:"Fireborn", package:"obstacles", linkage:"mcFireborn", x:83.9, y:44, obstacle:true, slow:true, depth:30}, {name:"OldDude", package:"obstacles", linkage:"mcOldDude", startx:-171.2, starty:-38, endx:-74.4, endy:24.7, obstacle:true, crash:true, interact:true, depth:120}, {name:"Kid", package:"obstacles", linkage:"mcKid", x:-43.8, y:-36.4, obstacle:true, crash:true, interact:true, depth:130}, {name:"RoadRock", package:"accessories", linkage:"mcRoadRock", x:-110.2, y:-120.3, road:true, depth:40}, {name:"RoadCiment", package:"accessories", linkage:"mcRoadCiment", x:-109.1, y:-120.8, road:true, depth:40}, {name:"Weiner", package:"obstacles", linkage:"mcWeiner", x:-63.6, y:-115.5, obstacle:true, crash:true, interact:true, depth:140}, {name:"SmallTree", package:"accessories", linkage:"mcSmallTree", x:[-8.1, -4.4, 32.7], y:[-221.8, -143.3, -166.8], accessory:true, depth:50}, {name:"Mailbox1,Mailbox2,Mailbox3,Mailbox4", package:"accessories", linkage:"mcMailbox1,mcMailbox2,mcMailbox3,mcMailbox4", x:-146.9, y:-100.7, accessory:true, depth:80}, {name:"Copse", package:"accessories", linkage:"mcCopse", x:[-287.9, -233.2, -241.8], y:[-210.9, -161.1, -113], accessory:true, depth:90}, {name:"House2", package:"houses", linkage:"mcHouse2", x:-195.8, y:-150.9, optional:false, depth:70}];
static var oPattern04 = [{name:"HotDogBox", package:"bonus", linkage:"mcHotDogBox", x:125.7, y:-23.4, bonus:true, hotdog:true, interact:true, depth:100}, {name:"GasTank", package:"bonus", linkage:"mcGasTank", x:125.1, y:-19.8, bonus:true, gastank:true, interact:true, depth:110}, {name:"Manhole", package:"obstacles", linkage:"mcManhole", x:53.1, y:-23.5, obstacle:true, slow:true, depth:10}, {name:"StreetLight", package:"accessories", linkage:"mcStreetLight", x:0.1, y:-97.8, optional:false, depth:60}, {name:"StreetLightSpot", package:"accessories", linkage:"mcStreetLightSpot", x:34.9, y:-71.2, rotation:-37.1, optional:false, depth:20}, {name:"Fireborn", package:"obstacles", linkage:"mcFireborn", x:83.9, y:44, obstacle:true, slow:true, depth:30}, {name:"OldDude", package:"obstacles", linkage:"mcOldDude", startx:-171.2, starty:-38, endx:-74.4, endy:24.7, obstacle:true, crash:true, interact:true, depth:120}, {name:"Kid", package:"obstacles", linkage:"mcKid", x:-43.8, y:-36.4, obstacle:true, crash:true, interact:true, depth:130}, {name:"RoadRock", package:"accessories", linkage:"mcRoadRock", x:-110.2, y:-120.3, road:true, depth:40}, {name:"RoadCiment", package:"accessories", linkage:"mcRoadCiment", x:-109.1, y:-120.8, road:true, depth:40}, {name:"Weiner", package:"obstacles", linkage:"mcWeiner", x:-63.6, y:-115.5, obstacle:true, crash:true, interact:true, depth:140}, {name:"SmallTree", package:"accessories", linkage:"mcSmallTree", x:[-8.1, -4.4, 32.7], y:[-221.8, -143.3, -166.8], accessory:true, depth:50}, {name:"Mailbox1,Mailbox2,Mailbox3,Mailbox4", package:"accessories", linkage:"mcMailbox1,mcMailbox2,mcMailbox3,mcMailbox4", x:-146.9, y:-100.7, accessory:true, depth:80}, {name:"Copse", package:"accessories", linkage:"mcCopse", x:[-299.7, -286.4, -222.4], y:[-227.4, -163.2, -116.4], accessory:true, depth:90}, {name:"House3", package:"houses", linkage:"mcHouse3", x:-223.9, y:-151.3, optional:false, depth:70}];
static var oPattern05 = [{name:"HotDogBox", package:"bonus", linkage:"mcHotDogBox", x:125.7, y:-23.4, bonus:true, hotdog:true, interact:true, depth:100}, {name:"GasTank", package:"bonus", linkage:"mcGasTank", x:125.1, y:-19.8, bonus:true, gastank:true, interact:true, depth:110}, {name:"Manhole", package:"obstacles", linkage:"mcManhole", x:53.1, y:-23.5, obstacle:true, slow:true, depth:10}, {name:"StreetLight", package:"accessories", linkage:"mcStreetLight", x:0.1, y:-97.8, optional:false, depth:60}, {name:"StreetLightSpot", package:"accessories", linkage:"mcStreetLightSpot", x:34.9, y:-71.2, rotation:-37.1, optional:false, depth:20}, {name:"Fireborn", package:"obstacles", linkage:"mcFireborn", x:83.9, y:44, obstacle:true, slow:true, depth:30}, {name:"OldDude", package:"obstacles", linkage:"mcOldDude", startx:-171.2, starty:-38, endx:-74.4, endy:24.7, obstacle:true, crash:true, interact:true, depth:120}, {name:"Kid", package:"obstacles", linkage:"mcKid", x:-43.8, y:-36.4, obstacle:true, crash:true, interact:true, depth:130}, {name:"RoadRock", package:"accessories", linkage:"mcRoadRock", x:-110.2, y:-120.3, road:true, depth:40}, {name:"RoadCiment", package:"accessories", linkage:"mcRoadCiment", x:-109.1, y:-120.8, road:true, depth:40}, {name:"Weiner", package:"obstacles", linkage:"mcWeiner", x:-63.6, y:-115.5, obstacle:true, crash:true, interact:true, depth:140}, {name:"SmallTree", package:"accessories", linkage:"mcSmallTreet", x:[-8.1, -4.4, 32.7], y:[-221.8, -143.3, -166.8], accessory:true, depth:50}, {name:"Mailbox1,Mailbox2,Mailbox3,Mailbox4", package:"accessories", linkage:"mcMailbox1,mcMailbox2,mcMailbox3,mcMailbox4", x:-146.9, y:-100.7, accessory:true, depth:80}, {name:"Copse", package:"accessories", linkage:"mcCopse", x:[-222.6, -273.7, -267.1], y:[-111.3, -148.1, -206.2], accessory:true, depth:90}, {name:"House4", package:"houses", linkage:"mcHouse4", x:-194.8, y:-151.1, optional:false, depth:70}];
static var oPattern06 = [{name:"HotDogBox", package:"bonus", linkage:"mcHotDogBox", x:125.7, y:-23.4, bonus:true, hotdog:true, interact:true, depth:130}, {name:"GasTank", package:"bonus", linkage:"mcGasTank", x:125.1, y:-19.8, bonus:true, gastank:true, interact:true, depth:140}, {name:"Manhole", package:"obstacles", linkage:"mcManhole", x:53.1, y:-23.5, obstacle:true, slow:true, depth:10}, {name:"StreetLight", package:"accessories", linkage:"mcStreetLight", x:0.1, y:-97.8, optional:false, depth:90}, {name:"StreetLightSpot", package:"accessories", linkage:"mcStreetLightSpot", x:34.9, y:-71.2, rotation:-37.1, optional:false, depth:20}, {name:"Fireborn", package:"obstacles", linkage:"mcFireborn", x:83.9, y:44, obstacle:true, slow:true, depth:30}, {name:"OldDude", package:"obstacles", linkage:"mcOldDude", startx:-171.2, starty:-38, endx:-74.4, endy:24.7, obstacle:true, crash:true, interact:true, depth:150}, {name:"Kid", package:"obstacles", linkage:"mcKid", x:-43.8, y:-36.4, obstacle:true, crash:true, interact:true, depth:160}, {name:"RoadRock", package:"accessories", linkage:"mcRoadRock", x:-110.2, y:-120.3, road:true, depth:40}, {name:"RoadCiment", package:"accessories", linkage:"mcRoadCiment", x:-109.1, y:-120.8, road:true, depth:40}, {name:"Weiner", package:"obstacles", linkage:"mcWeiner", x:-63.6, y:-115.5, obstacle:true, crash:true, interact:true, depth:170}, {name:"SmallTree", package:"accessories", linkage:"mcSmallTree", x:[-8.1, -4.4, 32.7], y:[-221.8, -143.3, -166.8], accessory:true, depth:50}, {name:"Mailbox1,Mailbox2,Mailbox3,Mailbox4", package:"accessories", linkage:"mcMailbox1,mcMailbox2,mcMailbox3,mcMailbox4", x:-146.9, y:-100.7, accessory:true, depth:80}, {name:"Copse", package:"accessories", linkage:"mcCopse", x:[-281.6, -260.5, -230.9], y:[-217.9, -157.4, -120.3], accessory:true, depth:70}, {name:"House5", package:"houses", linkage:"mcHouse5", x:-204.9, y:-148.6, optional:false, depth:60}, {name:"Wall", package:"accessories", linkage:"mcWall", x:-251.4, y:-104, horizontal:0, vertical:0, wall:true, depth:120}, {name:"Wall", package:"accessories", linkage:"mcWall", x:-256.3, y:-107.6, horizontal:60, vertical:-120, wall:true, depth:110}, {name:"Wall", package:"accessories", linkage:"mcWall", x:-293.4, y:-167.1, horizontal:60, vertical:-120, wall:true, depth:100}];
static var oPattern07 = [{name:"Mickey", linkage:"mcMickey", x:-111.2, y:-126.8, victory:true, optional:false, depth:50}, {name:"House6", package:"houses", linkage:"mcHouse6", x:-251.9, y:-160.4, optional:false, noclient:true, depth:30}, {name:"SmallTree", package:"accessories", linkage:"mcSmallTree", x:-341.9, y:-251.7, optional:false, depth:40}, {name:"RoadCiment", package:"accessories", linkage:"mcRoadCiment", x:-109.1, y:-120.8, optional:false, depth:10}, {name:"Mailbox4", package:"accessories", linkage:"mcMailbox4", x:-133.7, y:-102.1, optional:false, depth:60}, {name:"StreetLight", package:"accessories", linkage:"mcStreetLight", x:0.1, y:-97.8, optional:false, depth:70}, {name:"StreetLightSpot", package:"accessories", linkage:"mcStreetLightSpot", x:34.9, y:-71.2, rotation:-37.1, optional:false, depth:20}];
}
Symbol 2179 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.houses.House6] Frame 0
class com.disney.gem.games.pizza_toss.elements.houses.House6 extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, sType, defineEvents, onActivate, mcRef;
function House6 (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "House6";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
sType = "wall";
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
hideMark();
}
function hideMark() {
mcRef.mcCHTL._visible = false;
mcRef.mcCHBR._visible = false;
mcRef.mcCLTL._visible = false;
mcRef.mcCLBR._visible = false;
mcRef.mcLTL._visible = false;
mcRef.mcLBR._visible = false;
mcRef.mcHTL._visible = false;
mcRef.mcHBR._visible = false;
mcRef.mcHigh._visible = false;
mcRef.mcLow._visible = false;
}
}
Symbol 2180 MovieClip [__Packages.com.disney.gem.games.pizza_toss.elements.Mickey] Frame 0
class com.disney.gem.games.pizza_toss.elements.Mickey extends com.disney.gem.games.pizza_toss.elements.ElementBase
{
var sClass, setProperties, setItem, setNameLinkage, defineEvents, onActivate, setState, oOwner, x;
function Mickey (_oOwner, _aProperties, _oItem) {
super(_oOwner);
sClass = "Mickey";
setProperties(_aProperties);
setItem(_oItem);
setNameLinkage(_oItem.linkage, com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName(_oItem.name));
defineEvents(_oItem.left, _oItem.right);
onActivate();
}
function createElement() {
super.createElement();
setState(STATE_IDLE, true);
com.disney.gem.games.pizza_toss.utility.Sounds.PlayLoop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_MICKEY, true, false);
}
function deleteElement() {
com.disney.gem.games.pizza_toss.utility.Sounds.Stop(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_MICKEY);
}
function isInMiddle() {
var _local2 = false;
if ((x - Math.abs(oOwner.mcGame.mcInner._x)) < 50) {
_local2 = true;
}
return(_local2);
}
function state_idle() {
if (isInMiddle()) {
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.FOLLOW, "", "0"), this);
oOwner.scroller.stopListening();
}
oOwner.dispatcher.dispatchEvent(new com.disney.gem.games.pizza_toss.events.Event(com.disney.gem.games.pizza_toss.events.Event.FINISH), {end:x + 300});
}
static var STATE_IDLE = "idle";
}
Symbol 2181 MovieClip [__Packages.com.disney.gem.games.pizza_toss.popups.Level1Popup] Frame 0
class com.disney.gem.games.pizza_toss.popups.Level1Popup extends com.sarbakan.utils.ScreenController
{
var fOnEnd, nFrame, mcRef, stateFinished, setState;
function Level1Popup (_mcRef, _fOnEnd) {
super(_mcRef);
fOnEnd = _fOnEnd;
nFrame = com.disney.gem.games.pizza_toss.Config.Defaults.LevelPopupTime;
}
function setText() {
var _local2 = mcRef.mcState.mcCustomers.txtCustomers;
_local2.text = replaceString(_local2.text);
}
function replaceString(_sString) {
var _local3 = _sString.split("(req)");
var _local4 = _local3.join(String(Math.ceil(com.disney.gem.games.pizza_toss.Config.Level1.ClientToServe * com.disney.gem.games.pizza_toss.Config.Level1.WinPercent)));
_local3 = _local4.split("(total)");
_local4 = _local3.join(String(com.disney.gem.games.pizza_toss.Config.Level1.ClientToServe));
return(_local4);
}
function state_in() {
setText();
if (stateFinished()) {
setState(com.sarbakan.utils.ScreenController.sSTATE_IDLE, true);
setText();
}
}
function state_idle() {
setText();
nFrame--;
if (nFrame <= 0) {
setState(com.sarbakan.utils.ScreenController.sSTATE_OUT, true);
setText();
}
}
function state_out() {
setText();
if (stateFinished()) {
setState(com.sarbakan.utils.ScreenController.sSTATE_HIDDEN, true);
fOnEnd();
}
}
}
Symbol 2182 MovieClip [__Packages.com.disney.gem.games.pizza_toss.popups.Level2Popup] Frame 0
class com.disney.gem.games.pizza_toss.popups.Level2Popup extends com.sarbakan.utils.ScreenController
{
var fOnEnd, nFrame, mcRef, stateFinished, setState;
function Level2Popup (_mcRef, _fOnEnd) {
super(_mcRef);
fOnEnd = _fOnEnd;
nFrame = com.disney.gem.games.pizza_toss.Config.Defaults.LevelPopupTime;
}
function setText() {
var _local2 = mcRef.mcState.mcCustomers.txtCustomers;
_local2.text = replaceString(_local2.text);
}
function replaceString(_sString) {
var _local3 = _sString.split("(req)");
var _local4 = _local3.join(String(Math.ceil(com.disney.gem.games.pizza_toss.Config.Level2.ClientToServe * com.disney.gem.games.pizza_toss.Config.Level2.WinPercent)));
_local3 = _local4.split("(total)");
_local4 = _local3.join(String(com.disney.gem.games.pizza_toss.Config.Level2.ClientToServe));
return(_local4);
}
function state_in() {
setText();
if (stateFinished()) {
setState(com.sarbakan.utils.ScreenController.sSTATE_IDLE, true);
setText();
}
}
function state_idle() {
setText();
nFrame--;
if (nFrame <= 0) {
setState(com.sarbakan.utils.ScreenController.sSTATE_OUT, true);
setText();
}
}
function state_out() {
setText();
if (stateFinished()) {
setState(com.sarbakan.utils.ScreenController.sSTATE_HIDDEN, true);
fOnEnd();
}
}
}
Symbol 2183 MovieClip [__Packages.com.disney.gem.games.pizza_toss.popups.Level3Popup] Frame 0
class com.disney.gem.games.pizza_toss.popups.Level3Popup extends com.sarbakan.utils.ScreenController
{
var fOnEnd, nFrame, mcRef, stateFinished, setState;
function Level3Popup (_mcRef, _fOnEnd) {
super(_mcRef);
fOnEnd = _fOnEnd;
nFrame = com.disney.gem.games.pizza_toss.Config.Defaults.LevelPopupTime;
}
function setText() {
var _local2 = mcRef.mcState.mcCustomers.txtCustomers;
_local2.text = replaceString(_local2.text);
}
function replaceString(_sString) {
var _local3 = _sString.split("(req)");
var _local4 = _local3.join(String(Math.ceil(com.disney.gem.games.pizza_toss.Config.Level3.ClientToServe * com.disney.gem.games.pizza_toss.Config.Level3.WinPercent)));
_local3 = _local4.split("(total)");
_local4 = _local3.join(String(com.disney.gem.games.pizza_toss.Config.Level3.ClientToServe));
return(_local4);
}
function state_in() {
setText();
if (stateFinished()) {
setState(com.sarbakan.utils.ScreenController.sSTATE_IDLE, true);
setText();
}
}
function state_idle() {
setText();
nFrame--;
if (nFrame <= 0) {
setState(com.sarbakan.utils.ScreenController.sSTATE_OUT, true);
setText();
}
}
function state_out() {
setText();
if (stateFinished()) {
setState(com.sarbakan.utils.ScreenController.sSTATE_HIDDEN, true);
fOnEnd();
}
}
}
Symbol 2184 MovieClip [__Packages.com.disney.gem.games.pizza_toss.popups.HotDogPopup] Frame 0
class com.disney.gem.games.pizza_toss.popups.HotDogPopup extends com.sarbakan.utils.ScreenController
{
var nFrame, mcRef, stateFinished, setState;
function HotDogPopup (_mcRef) {
super(_mcRef);
nFrame = com.disney.gem.games.pizza_toss.Config.Defaults.HDPopupTime;
}
function setText() {
mcRef.mcState.mcCount.txtCount.text = String(com.disney.gem.games.pizza_toss.Stats.clients);
mcRef.mcState.mcCount.txtCountShadow.text = String(com.disney.gem.games.pizza_toss.Stats.clients);
}
function state_in() {
setText();
if (stateFinished()) {
setState(com.sarbakan.utils.ScreenController.sSTATE_IDLE, true);
setText();
}
}
function state_idle() {
setText();
nFrame--;
if (nFrame <= 0) {
setState(com.sarbakan.utils.ScreenController.sSTATE_OUT, true);
setText();
}
}
function state_out() {
setText();
if (stateFinished()) {
setState(com.sarbakan.utils.ScreenController.sSTATE_HIDDEN, true);
}
}
}
Symbol 2185 MovieClip [__Packages.com.disney.gem.games.pizza_toss.utility.DepthManager] Frame 0
class com.disney.gem.games.pizza_toss.utility.DepthManager
{
function DepthManager () {
}
static function check(_oGame) {
var _local3 = com.disney.gem.games.pizza_toss.Config.Defaults.Depth;
var _local4 = com.disney.gem.games.pizza_toss.Config.Defaults.Temp;
var _local5 = _oGame.displayed;
var _local6 = 0;
for ( ; _local6 < _local5.length ; _local6++) {
_local5[_local6].x = _local5[_local6].mc._x;
_local5[_local6].y = _local5[_local6].mc._y;
}
_local5.sortOn(["y", "x"], [Array.NUMERIC, Array.NUMERIC | Array.DESCENDING]);
var _local7 = 0;
for ( ; _local7 < _local5.length ; _local7++) {
_local3++;
_local5[_local7].depth = (_local3 + (10000 * _local7)) + _local7;
_local5[_local7].mc.swapDepths(_local5[_local7].depth);
}
}
}
Symbol 2186 MovieClip [__Packages.com.disney.gem.games.pizza_toss.popups.PerfectPopup] Frame 0
class com.disney.gem.games.pizza_toss.popups.PerfectPopup extends com.sarbakan.utils.ScreenController
{
var nFrame, setState;
function PerfectPopup (_mcRef) {
super(_mcRef);
nFrame = com.disney.gem.games.pizza_toss.Config.Defaults.PerfectTime;
}
function state_idle() {
nFrame--;
if (nFrame <= 0) {
setState(com.sarbakan.utils.ScreenController.sSTATE_OUT, true);
}
}
}
Symbol 2187 MovieClip [__Packages.com.disney.gem.games.pizza_toss.colliders.Limit] Frame 0
class com.disney.gem.games.pizza_toss.colliders.Limit extends com.disney.gem.games.pizza_toss.collisions.CollideItem
{
var oOwner, oItem, aProperties, oPlayer, sType, sName, setMC, mcRef, topLeft, bottomRight, setTarget, oTarget, Collide;
function Limit (_oOwner, _aProperties, _oItem) {
super();
oOwner = _oOwner;
oItem = _oItem;
aProperties = _aProperties;
oPlayer = _oItem.player;
sType = "collider";
sName = com.disney.gem.games.pizza_toss.Controller.Instance.getGenericName("Limit");
createElement();
}
function createElement() {
oOwner.mcGame.mcInner.attachMovie("mcLimit", sName, oItem.depth);
setMC(oOwner.mcGame.mcInner[sName]);
var _local2 = 0;
for ( ; _local2 < aProperties.length ; _local2++) {
mcRef[aProperties[_local2][0]] = aProperties[_local2][1];
}
var _local3 = {_x:(mcRef._width / 2) * -1, _y:(mcRef._height / 2) * -1};
var _local4 = {_x:mcRef._width / 2, _y:mcRef._height / 2};
mcRef._visible = false;
topLeft(_local3);
bottomRight(_local4);
setTarget(com.disney.gem.games.pizza_toss.Controller.Instance.Game.dispatcher);
oTarget.addEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
com.disney.gem.games.pizza_toss.Controller.Instance.oMainBroadcaster.addListener(this);
}
function deleteElement() {
com.disney.gem.games.pizza_toss.Controller.Instance.oMainBroadcaster.removeListener(this);
mcRef.removeMovieClip();
delete mcRef;
oTarget.removeEventListener(com.disney.gem.games.pizza_toss.events.Event.TEST, Collide, this);
}
function onUpdate() {
super.onUpdate();
mcRef._x = oPlayer.x;
}
}
Symbol 2188 MovieClip [__Packages.com.disney.gem.games.pizza_toss.screens.TitleScreen] Frame 0
class com.disney.gem.games.pizza_toss.screens.TitleScreen extends com.sarbakan.utils.ScreenController
{
var mcRef;
function TitleScreen (_mcRef) {
super(_mcRef);
}
function onBtHelp() {
com.disney.gem.games.pizza_toss.Controller.Instance.showInstructionScreen();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_CLICK);
}
function onBtPlay() {
com.disney.gem.games.pizza_toss.Controller.Instance.startNewGame();
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_CLICK);
}
function onBtOver() {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_ROLLOVER, true, false);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btHelp.onRelease = com.sarbakan.utils.Delegate.create(this, onBtHelp);
mcRef.mcState.mcContent.btHelp.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
}
}
Symbol 2189 MovieClip [__Packages.com.disney.gem.games.pizza_toss.screens.HelpScreen] Frame 0
class com.disney.gem.games.pizza_toss.screens.HelpScreen extends com.sarbakan.utils.ScreenController
{
var setState, mcRef;
function HelpScreen (_mcRef) {
super(_mcRef);
setState(com.sarbakan.utils.ScreenController.sSTATE_IDLE);
}
function onBtPlay() {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_CLICK);
if (com.disney.gem.games.pizza_toss.Controller.Instance.getGamePhase() == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
com.disney.gem.games.pizza_toss.Controller.Instance.hideInstructionScreen();
com.disney.gem.games.pizza_toss.utility.Sounds.Unpause(com.disney.gem.games.pizza_toss.utility.Sounds.sSOUND_CAT_NAME);
com.disney.gem.games.pizza_toss.utility.Sounds.Unpause(com.disney.gem.games.pizza_toss.utility.Sounds.sAMBIENT_CAT_NAME);
com.disney.gem.games.pizza_toss.utility.Sounds.setMusic(com.disney.gem.games.pizza_toss.utility.Sounds.sMUSIC_INGAME);
} else {
com.disney.gem.games.pizza_toss.Controller.Instance.startNewGame();
}
}
function onBtNext() {
setState("idle2");
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_CLICK);
}
function onBtBack() {
setState("idle");
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_CLICK);
}
function onBtOver() {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_ROLLOVER, true, false);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btNext.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNext);
mcRef.mcState.mcContent.btNext.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
}
function state_idle2_init() {
mcRef.btBlocker.useHandCursor = false;
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
mcRef.mcState.mcContent.btBack.onRelease = com.sarbakan.utils.Delegate.create(this, onBtBack);
mcRef.mcState.mcContent.btBack.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
}
}
Symbol 2190 MovieClip [__Packages.com.disney.gem.games.pizza_toss.screens.EndScreen] Frame 0
class com.disney.gem.games.pizza_toss.screens.EndScreen extends com.sarbakan.utils.ScreenController
{
var mcRef;
function EndScreen (_mcRef) {
super(_mcRef);
com.disney.gem.games.pizza_toss.utility.Sounds.StopAll(com.disney.gem.games.pizza_toss.utility.Sounds.sSOUND_CAT_NAME);
}
function onBtPlay() {
com.disney.gem.games.pizza_toss.Controller.Instance.showTitleScreen(true);
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_CLICK);
}
function onBtOver() {
com.disney.gem.games.pizza_toss.utility.Sounds.Play(com.disney.gem.games.pizza_toss.utility.Sounds.sSFX_BUTTON_ROLLOVER, true, false);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
mcRef.mcState.mcContent.txtScore.text = String(com.disney.gem.games.pizza_toss.Controller.Instance.getScore());
}
}
Symbol 2191 MovieClip [__Packages.com.disney.gem.games.pizza_toss.screens.PreloaderScreen] Frame 0
class com.disney.gem.games.pizza_toss.screens.PreloaderScreen extends com.sarbakan.utils.ScreenController
{
var mcRef;
function PreloaderScreen (_mcRef) {
super(_mcRef);
}
function state_idle() {
var _local2 = com.disney.gem.games.pizza_toss.Controller.Instance.mcTimeline.getBytesLoaded() / com.disney.gem.games.pizza_toss.Controller.Instance.mcTimeline.getBytesTotal();
mcRef.mcState.mcProgress._xscale = _local2 * 100;
if (_local2 == 1) {
com.disney.gem.games.pizza_toss.Controller.Instance.onPreloadingDone();
}
}
}
Symbol 20480 MovieClip [__Packages.com.disney.gem.games.template.GameEngine] Frame 0
class com.disney.gem.games.template.GameEngine
{
var oController, mcGame;
function GameEngine (_oController, _mcGame) {
oController = _oController;
mcGame = _mcGame;
mcGame.mcHud.txtScore.text = oController.getScore();
mcGame.mcHud.txtLevel.text = oController.getLevel();
mcGame.mcHud.btMenu.onRelease = com.sarbakan.utils.Delegate.create(this, onBtMenu);
mcGame.btWin.onRelease = com.sarbakan.utils.Delegate.create(this, onBtWin);
mcGame.btLose.onRelease = com.sarbakan.utils.Delegate.create(this, onBtLose);
}
function init() {
}
function onUpdate() {
}
function onPause() {
mcGame.mcMouth.stop();
}
function onUnPause() {
mcGame.mcMouth.play();
}
function onBtLose() {
oController.onGameLose();
}
function onBtWin() {
oController.onGameWon();
}
function onBtMenu() {
oController.pause();
oController.showPopup(new com.disney.gem.games.template.popups.MenuPopup(oController.mcTimeline.mcPopups.mcMenu), true);
}
static var nCHICKEN_SPEED = 4;
}
Symbol 20481 MovieClip [__Packages.com.disney.gem.games.template.screens.PreloaderScreen] Frame 0
class com.disney.gem.games.template.screens.PreloaderScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function PreloaderScreen (_mcRef) {
super(_mcRef);
}
function state_idle() {
var _local2 = com.disney.gem.games.template.Controller(oController).mcTimeline.getBytesLoaded() / com.disney.gem.games.template.Controller(oController).mcTimeline.getBytesTotal();
mcRef.mcState.txtLoading.text = ("Loading: " + Math.round(_local2 * 100)) + "%";
if (_local2 == 1) {
com.disney.gem.games.template.Controller(oController).onPreloadingDone();
}
}
}
Symbol 20482 MovieClip [__Packages.com.disney.gem.games.template.screens.TitleScreen] Frame 0
class com.disney.gem.games.template.screens.TitleScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function TitleScreen (_mcRef) {
super(_mcRef);
}
function onBtHelp() {
com.disney.gem.games.template.Controller(oController).showInstructions();
}
function onBtPlay() {
com.disney.gem.games.template.Controller(oController).startNewGame();
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btHelp.onRelease = com.sarbakan.utils.Delegate.create(this, onBtHelp);
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
}
}
Symbol 20483 MovieClip [__Packages.com.disney.gem.games.template.screens.EndScreen] Frame 0
class com.disney.gem.games.template.screens.EndScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function EndScreen (_mcRef) {
super(_mcRef);
}
function onBtPlay() {
com.disney.gem.games.template.Controller(oController).showTitleScreen(true);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
}
}
Symbol 20484 MovieClip [__Packages.org.flashdevelop.utils.FlashConnect] Frame 0
class org.flashdevelop.utils.FlashConnect
{
static var messages, movie, counter, socket, interval;
function FlashConnect () {
}
static function send(message) {
if (messages == null) {
initialize();
}
messages.push(message);
}
static function trace(message, level) {
var _local4 = createMsgNode(message, level);
send(_local4);
}
static function mtrace(message, method, path, line) {
if (path.indexOf(":") < 0) {
if (movie == undefined) {
var _local6 = _global.unescape(_level0._url).split("///");
if (_local6.length == 1) {
_local6 = _global.unescape(_level0._url).split("//");
}
if (_local6[0] == "file:") {
movie = _local6[1];
movie = movie.substr(0, movie.lastIndexOf("\\") + 1).split("|").join(":");
} else {
movie = new String("");
}
}
path = movie + path;
}
var _local7 = path.split("/").join("\\");
var _local8 = (((_local7 + ":") + line) + ":") + message;
trace(_local8, org.flashdevelop.utils.TraceLevel.DEBUG);
}
static function initialize() {
counter = 0;
messages = new Array();
socket = new XMLSocket();
socket.onData = function (data) {
org.flashdevelop.utils.FlashConnect.onReturnData(data);
};
socket.onConnect = function (success) {
if (success) {
org.flashdevelop.utils.FlashConnect.status = 1;
} else {
org.flashdevelop.utils.FlashConnect.status = -1;
}
org.flashdevelop.utils.FlashConnect.onConnection();
};
interval = _global.setInterval(sendStack, 50);
socket.connect(host, port);
}
static function createMsgNode(message, level) {
if (_global.isNaN(level)) {
level = org.flashdevelop.utils.TraceLevel.DEBUG;
}
var _local4 = new XMLNode(1, null);
var _local5 = new XMLNode(3, _global.escape(message));
_local4.attributes.state = level.toString();
_local4.attributes.cmd = "trace";
_local4.nodeName = "message";
_local4.appendChild(_local5);
return(_local4);
}
static function sendStack() {
if ((messages.length > 0) && (status == 1)) {
var _local2 = new XML();
var _local3 = _local2.createElement("flashconnect");
while (messages.length != 0) {
counter++;
if (counter > limit) {
_global.clearInterval(interval);
var _local4 = new String("FlashConnect aborted. You have reached the limit of maximum messages.");
var _local5 = createMsgNode(_local4, org.flashdevelop.utils.TraceLevel.ERROR);
_local3.appendChild(_local5);
break;
}
var _local6 = XMLNode(messages.shift());
_local3.appendChild(_local6);
}
_local2.appendChild(_local3);
socket.send(_local2);
}
}
static var status = 0;
static var limit = 1000;
static var host = "localhost";
static var port = 1978;
}
Symbol 20485 MovieClip [__Packages.com.disney.gem.games.template.popups.MenuPopup] Frame 0
class com.disney.gem.games.template.popups.MenuPopup extends com.sarbakan.utils.ScreenController
{
var oController, hide, mcRef;
function MenuPopup (_mcRef) {
super(_mcRef);
}
function onBtSound() {
com.disney.gem.games.template.Controller(oController).toggleSound();
updateSoundGroup();
}
function onBtHelp() {
com.disney.gem.games.template.Controller(oController).showInstructions();
hide(null, true);
}
function onBtQuit() {
com.disney.gem.games.template.Controller(oController).showPopup(new com.disney.gem.games.template.popups.ConfirmPopup(com.disney.gem.games.template.Controller(oController).mcTimeline.mcPopups.mcConfirm, this), true);
}
function onBtResume() {
com.disney.gem.games.template.Controller(oController).unpause();
hide();
}
function state_in_init() {
super.state_in_init();
setBts();
}
function state_idle_init() {
super.state_idle_init();
setBts();
}
function state_idle() {
updateSoundGroup();
}
function state_out_init() {
super.state_out_init();
setBts();
}
function setBts() {
mcRef.mcState.mcContent.btHelp.onRelease = com.sarbakan.utils.Delegate.create(this, onBtHelp);
mcRef.mcState.mcContent.btQuit.onRelease = com.sarbakan.utils.Delegate.create(this, onBtQuit);
mcRef.mcState.mcContent.btResume.onRelease = com.sarbakan.utils.Delegate.create(this, onBtResume);
updateSoundGroup();
}
function updateSoundGroup() {
var _local2 = "On";
if (com.disney.gem.games.template.Controller(oController).bSoundMuted) {
_local2 = "Off";
}
mcRef.mcState.mcContent.mcSoundToggle.gotoAndStop(_local2);
mcRef.mcState.mcContent.mcSoundToggle.btSound.onRelease = com.sarbakan.utils.Delegate.create(this, onBtSound);
}
}
Symbol 20486 MovieClip [__Packages.com.disney.gem.games.template.screens.HelpScreen] Frame 0
class com.disney.gem.games.template.screens.HelpScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function HelpScreen (_mcRef) {
super(_mcRef);
}
function onBtBack() {
com.disney.gem.games.template.Controller(oController).hideInstructions();
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btBack.onRelease = com.sarbakan.utils.Delegate.create(this, onBtBack);
}
}
Symbol 20487 MovieClip [__Packages.org.flashdevelop.utils.TraceLevel] Frame 0
class org.flashdevelop.utils.TraceLevel
{
function TraceLevel () {
}
static var INFO = 0;
static var DEBUG = 1;
static var WARNING = 2;
static var ERROR = 3;
static var FATAL = 4;
}
Symbol 20488 MovieClip [__Packages.com.disney.gem.games.template.Controller] Frame 0
class com.disney.gem.games.template.Controller extends com.sarbakan.BaseDisneyController
{
var showScreen, mcTimeline, allowInstructions, onGameStart, setLevel, bPaused, unpause, setGamePhase, nLevel, oGame, oMainBroadcaster, hideCurrentScreen, onLevelStart, pause, nGamePhase;
function Controller (_mcTimeline, _oPreloaderScreen) {
super(_mcTimeline, _oPreloaderScreen);
}
static function getInstance() {
return(com.disney.gem.games.template.Controller(com.sarbakan.BaseDisneyController.oInstance));
}
function init() {
super.init();
showTitleScreen();
}
function showTitleScreen(_bShowTransition) {
if (_bShowTransition) {
showScreen(new com.disney.gem.games.template.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT);
} else {
showScreen(new com.disney.gem.games.template.screens.TitleScreen(mcTimeline.mcScreens.mcTitle));
}
allowInstructions();
}
function startNewGame() {
onGameStart();
setLevel(0);
startNextLevel();
}
function startNextLevel() {
if (bPaused) {
unpause();
}
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME);
setLevel(nLevel + 1);
oGame = new com.disney.gem.games.template.GameEngine(this, mcTimeline.mcGame);
oMainBroadcaster.addListener(oGame);
hideCurrentScreen(com.sarbakan.utils.Delegate.create(this, onLevelTransitionDone), sTRANSITION_DEFAULT);
onLevelStart();
}
function showInstructionsScreen() {
pause();
showScreen(new com.disney.gem.games.template.screens.HelpScreen(mcTimeline.mcScreens.mcHelp), false, sTRANSITION_DEFAULT);
}
function hideInstructionsScreen() {
if (nGamePhase == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
unpause();
hideCurrentScreen(null, sTRANSITION_DEFAULT);
} else {
showScreen(new com.disney.gem.games.template.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT);
}
}
function onLevelTransitionDone() {
oGame.init();
}
function onGameLose() {
showScreen(new com.disney.gem.games.template.screens.EndScreen(mcTimeline.mcScreens.mcLose), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, setGamePhase, com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING));
}
function onGameWon() {
showScreen(new com.disney.gem.games.template.screens.EndScreen(mcTimeline.mcScreens.mcWin), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, setGamePhase, com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING));
}
static var sTRANSITION_DEFAULT = "default";
}
Symbol 20489 MovieClip [__Packages.com.disney.gem.games.template.popups.ConfirmPopup] Frame 0
class com.disney.gem.games.template.popups.ConfirmPopup extends com.sarbakan.utils.ScreenController
{
var oMenuOrigin, hide, oController, mcRef;
function ConfirmPopup (_mcRef, _oMenuOrigin) {
super(_mcRef);
oMenuOrigin = _oMenuOrigin;
}
function onBtNo() {
hide();
}
function onBtYes() {
hide();
com.disney.gem.games.template.Controller(oController).onGameLose();
oMenuOrigin.hide();
}
function state_in_init() {
super.state_in_init();
setBts();
}
function state_idle_init() {
super.state_idle_init();
setBts();
}
function state_out_init() {
super.state_out_init();
setBts();
}
function setBts() {
mcRef.mcState.mcContent.btYes.onRelease = com.sarbakan.utils.Delegate.create(this, onBtYes);
mcRef.mcState.mcContent.btNo.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNo);
}
}
Symbol 1669 MovieClip Frame 1
stop();