Frame 1
Stage.showMenu = false;
_focusrect = false;
Frame 2
stop();
Instance of Symbol 39 MovieClip "mcLoading" in Frame 2
onClipEvent (load) {
function preloadGame() {
var _local2 = (_parent.getBytesLoaded() / _parent.getBytesTotal()) * 100;
if (_local2 != 100) {
_local2 = Math.floor(_local2);
_parent.mcState.sPercent = _local2 + "%";
_parent.mcState.mcLoadBar.gotoAndStop(_local2);
} else {
_parent.mcState.sPercent = "100%";
_parent.mcState.mcLoadBar.gotoAndStop(100);
nDelay++;
if (nDelay > DELAY_TODO) {
_parent.gotoAndStop("Loaded");
}
}
}
_visible = false;
var DELAY_TODO = 4;
var nDelay = 0;
}
onClipEvent (enterFrame) {
preloadGame();
}
Instance of Symbol 41 MovieClip "mcSound" in Frame 9
onClipEvent (load) {
function ToMute() {
_global.MuseMuted = true;
this.onEnterFrame = function () {
if (SetVolumePack > 0) {
SetVolumePack = SetVolumePack - 5;
packMusic.setVolume(SetVolumePack);
}
if (SetVolumeInG > 0) {
SetVolumeInG = SetVolumeInG - 5;
WhatMovie.setVolume(SetVolumeInG);
}
if ((SetVolumePack == 0) && (SetVolumeInG == 0)) {
packMusic.stop();
WhatMovie.stop();
delete onEnterFrame;
}
};
}
function UnMute() {
_global.MuseMuted = false;
this.onEnterFrame = function () {
if ((SetVolumePack < setMaxVolume) && (musicIn == "Packaging")) {
if (SetVolumePack == 0) {
packMusic.start(0, 1000000);
}
SetVolumePack = SetVolumePack + 5;
packMusic.setVolume(SetVolumePack);
}
if ((SetVolumeInG < setMaxVolume) && (musicIn == "InGame")) {
if (SetVolumeInG == 0) {
WhatMovie.start(0, 1000000);
}
SetVolumeInG = SetVolumeInG + 5;
WhatMovie.setVolume(SetVolumeInG);
}
if ((SetVolumePack == setMaxVolume) || (SetVolumeInG == setMaxVolume)) {
delete onEnterFrame;
}
};
}
function SwitchToPack() {
musicIn = "Packaging";
this.onEnterFrame = function () {
if (_global.MuseMuted) {
WhatMovie.stop();
delete onEnterFrame;
} else {
if (SetVolumePack < setMaxVolume) {
if (SetVolumePack == 0) {
packMusic.start(0, 1000000);
}
SetVolumePack = SetVolumePack + 5;
packMusic.setVolume(SetVolumePack);
}
if (SetVolumeInG > 0) {
SetVolumeInG = SetVolumeInG - 5;
WhatMovie.setVolume(SetVolumeInG);
}
if ((SetVolumePack == setMaxVolume) && (SetVolumeInG == 0)) {
WhatMovie.stop();
delete onEnterFrame;
}
}
};
}
function SwitchToInGame(WhatGame) {
WhatMovie = this[WhatGame];
musicIn = "InGame";
this.onEnterFrame = function () {
if (_global.MuseMuted) {
packMusic.stop();
delete onEnterFrame;
} else {
if (SetVolumeInG < setMaxVolume) {
if (SetVolumeInG == 0) {
WhatMovie.start(0, 1000000);
}
SetVolumeInG = SetVolumeInG + 5;
WhatMovie.setVolume(SetVolumeInG);
}
if (SetVolumePack > 0) {
SetVolumePack = SetVolumePack - 5;
packMusic.setVolume(SetVolumePack);
}
if ((SetVolumeInG == setMaxVolume) && (SetVolumePack == 0)) {
packMusic.stop();
delete onEnterFrame;
}
}
};
}
function playSnd(WitchSound, nVolume, nloop) {
if (!_global.Muted) {
if (nloop == undefined) {
nloop = 1;
}
if (nVolume == undefined) {
nVolume = 50;
}
eval (WitchSound).start(0, nloop);
eval (WitchSound).setVolume(nVolume);
}
}
function StopASound(WitchSound) {
eval (WitchSound).stop();
}
function fGetVolume(WitchSound) {
return(eval (WitchSound).getVolume());
}
function fSetVolume(WitchSound, _num) {
eval (WitchSound).setVolume(_num);
}
_visible = false;
_global.oSnd = this;
_global.Muted = false;
_global.MuseMuted = false;
var SetVolumeInG;
var SetVolumePack;
var SetVolumeOld;
var musicIn;
var WhatMovie;
var OldMusic;
this.createEmptyMovieClip("packMusic", 1);
packMusic = new Sound("packMusic");
packMusic.attachSound("packMusic");
this.createEmptyMovieClip("gameMusic", 2);
gameMusic = new Sound("gameMusic");
gameMusic.attachSound("gameMusic");
packMusic.start(0, 1000000);
setMaxVolume = 40;
SetVolumePack = setMaxVolume;
SetVolumeInG = 0;
musicIn = "Packaging";
packMusic.setVolume(SetVolumePack);
soundList = new Array("Mooney1", "Mooney2", "Mooney3", "Jump1", "Jump2", "Stumble1", "Stumble2", "Bobble1", "Bobble2", "Buste", "Sophie", "pillarFall", "pillar", "Timer", "sFx_btnOver", "sFx_btnDown", "Fail", "TransOut", "success", "TransIn");
for (i in soundList) {
this.createEmptyMovieClip(soundList[i], i + 8);
this[soundList[i]] = new Sound(soundList[i]);
this[soundList[i]].attachSound(soundList[i]);
}
}
Frame 10
if (_global.P == undefined) {
_global.P = new MainCTRL(this);
}
_global.P.loadSection("Loaded");
_global.S = this;
stop();
Frame 20
_global.P.loadSection("Title");
Frame 30
_global.P.loadSection("Game");
Instance of Symbol 665 MovieClip "BonusShow" in Frame 30
onClipEvent (load) {
var oControl = new dynamicObj(this);
}
Instance of Symbol 673 MovieClip [_MoreBobble] in Frame 30
onClipEvent (load) {
_global.Collect = this;
var oControl = new dynamicObj(this);
oControl.setState("Idle");
}
Frame 40
play();
Frame 41
_global.P.loadSection("UnloadGame");
Frame 50
_global.P.loadSection("EndScreen");
Frame 60
_global.P.loadSection("HighScore");
Frame 70
_global.P.loadSection("ResetMain");
Symbol 10 MovieClip Frame 41
delete _parent.oControl;
removeMovieClip(_parent);
Symbol 11 MovieClip [_MoinsTime] Frame 1
var oControl = new dynamicObj(this);
Symbol 739 MovieClip [__Packages.State] Frame 0
class State
{
var mcRef, sState, nStateTotalFrame;
function State (P_mcRef) {
mcRef = P_mcRef;
}
function doEnterFrame() {
this["do" + sState]();
}
function pause() {
mcRef.mcState.stop();
}
function unPause() {
mcRef.mcState.play();
}
function setState(P_sState) {
if (sState != P_sState) {
unLoadState(sState);
sState = P_sState;
mcRef.gotoAndStop(sState);
nStateTotalFrame = mcRef.mcState._totalframes;
loadState(sState);
}
}
function loadState() {
}
function unLoadState() {
}
}
Symbol 740 MovieClip [__Packages.dynamicObj] Frame 0
class dynamicObj extends State
{
function dynamicObj (P_mcRef) {
super(P_mcRef);
_global.C.fAddBroadcastObj(this);
}
}
Symbol 741 MovieClip [__Packages.MainCTRL] Frame 0
class MainCTRL extends State
{
var mcRef, nMoneyTotal, nBonusTime, STAGE_WIDTH, STAGE_HEIGHT, STAGE_FPS, MAX_LEVEL, sCurrentSection, nPlayerScore, nBonusScore, nTotalScore, nLevel, sState, setState, pause;
function MainCTRL (P_mcRef) {
super(P_mcRef);
mcRef = P_mcRef;
initMainVar();
nMoneyTotal = 0;
nBonusTime = 0;
}
function initMainVar() {
STAGE_WIDTH = 550;
STAGE_HEIGHT = 420;
STAGE_FPS = 35;
MAX_LEVEL = 1;
sCurrentSection = "Loaded";
nPlayerScore = 0;
nBonusScore = 0;
nTotalScore = 0;
nLevel = 1;
}
function loadSection(P_sSection) {
trace("************************************");
trace(" Load section : " + P_sSection);
trace("************************************");
setSection(P_sSection);
switch (P_sSection) {
case "Loaded" :
if (_global.oTransition == undefined) {
_global.oTransition = new Transition(mcRef.mcTransition);
}
if (_global.oPopup == undefined) {
_global.oPopup = new Popup(mcRef.mcPopup);
}
_global.oTransition.setTransition("ResetMain");
break;
case "Title" :
break;
case "Game" :
_global.oSnd.SwitchToInGame("gameMusic");
_global.oHUD = new HUD(mcRef.mcHUD);
_global.C = new GameCTRL(mcRef.mcState);
break;
case "UnloadGame" :
sState = "NextLevel";
mcRef.gotoAndStop("Game");
break;
case "EndScreen" :
_global.oSnd.SwitchToPack();
fInitHSEngin();
fInitEndScreen();
break;
case "HighScore" :
mcRef.playerScore = nTotalScore;
mcRef.mcState.sScore = setScoreText(nTotalScore);
trace("_level0.fsd = " + mcRef.fsd);
mcRef.theDoge.loadMovie(_level0.fsd, 1);
break;
case "ResetMain" :
delete _global.C;
delete _global.oHUD;
setState("Title");
mcRef.theDoge.unloadMovie();
initMainVar();
}
}
function unloadSection(P_sSection) {
trace("************************************");
trace(" Unload section : " + P_sSection);
trace("************************************");
switch (P_sSection) {
case "Loaded" :
break;
case "Title" :
break;
case "Game" :
_global.C.doBroadcast("CleanObj");
delete _global.C;
delete _global.oHUD;
break;
case "UnloadGame" :
break;
case "EndScreen" :
break;
case "HighScore" :
break;
case "ResetMain" :
}
}
function fInitHSEngin() {
System.security.allowDomain("www.disney.go.com");
System.security.allowDomain("disney.go.com");
System.security.allowDomain("psc.disney.go.com");
System.security.allowDomain("apsc.disney.go.com");
System.security.allowDomain("tv.disney.go.com");
System.security.allowDomain("atv.disney.go.com");
System.security.allowDomain("scores.disney.go.com");
mcRef.gameID = "dc_cory_br";
mcRef.subject = "Cory in the House - Bobblehead Run";
mcRef.playerScore = 0;
mcRef.playerName = "";
mcRef.fsdPlayAgain = function () {
_global.P.playAgain();
};
}
function setSection(P_sSection) {
sCurrentSection = P_sSection;
}
function quitGame() {
pause();
_global.oPopup.setState("Idle");
_global.C.endLevel(false);
}
function playAgain() {
_global.oTransition.setTransition("ResetMain");
}
function getHelp() {
_global.oPopup.setState("Help");
}
function resumeHelp() {
if (sCurrentSection == "Game") {
_global.oPopup.setState("MenuOpen");
} else {
_global.oPopup.setState("Idle");
}
}
function resumeMenu() {
_global.oPopup.setState("EndMenu");
}
function getMenu() {
_global.C.pause();
_global.oPopup.setState("StartMenu");
}
function fInitEndScreen() {
if (nPlayerScore > 40000) {
mcRef.mcState.gotoAndStop(2);
}
if (nPlayerScore > 80000) {
mcRef.mcState.gotoAndStop(3);
}
mcRef.mcState.nScore = setScoreText(nPlayerScore);
mcRef.mcState.nBonus = setScoreText(nBonusScore);
nTotalScore = nPlayerScore + nBonusScore;
nMoneyTotal = nMoneyTotal + nTotalScore;
mcRef.mcState.nTotal = setScoreText(nTotalScore);
mcRef.mcState.nMoney = setScoreText(nMoneyTotal);
if (nBonusTime >= 15) {
mcRef.mcState.chrono1mc.gotoAndStop(2);
}
if (nBonusTime >= 30) {
mcRef.mcState.chrono2mc.gotoAndStop(2);
}
if (nBonusTime >= 45) {
mcRef.mcState.chrono3mc.gotoAndStop(2);
}
trace("nBonusTime = " + nBonusTime);
trace("mcRef.chrono1mc = " + mcRef.chrono1mc._currentframe);
}
function AddTimeBonus(__time, __cost) {
var _local2 = false;
if (nMoneyTotal >= __cost) {
nBonusTime = __time;
nMoneyTotal = nMoneyTotal - __cost;
mcRef.mcState.nMoney = nMoneyTotal;
_local2 = true;
}
return(_local2);
}
function setScoreText(P_nNumber, P_nMinimumChar) {
var _local6 = false;
var _local1 = String(P_nNumber);
var _local7 = _local1;
do {
if (_local1.length < P_nMinimumChar) {
_local6 = true;
_local7 = "0" + _local7;
}
} while (_local7.length < P_nMinimumChar);
_local1 = _local7;
var _local3 = "";
var _local5 = _local1.length;
_local5 = _local5 / 3;
if (_local5 <= 1) {
return(_local1);
}
var _local2 = _local5;
while (_local2 > 1) {
_local3 = (" " + _local1.substr(-3)) + _local3;
_local1 = _local1.substr(0, -3);
_local2--;
}
_local7 = _local1 + _local3;
return(_local7);
}
function NegativeScoring(__score) {
_global.C.nObjectIndex++;
mcRef.mcState.attachMovie("_MoinsMoney", "Obj" + _global.C.nObjectIndex, _global.C.fReturnDepth("_Bonus"));
mcRef.mcState["Obj" + _global.C.nObjectIndex]._x = SCORE_POP_X;
mcRef.mcState["Obj" + _global.C.nObjectIndex]._y = SCORE_POP_Y;
mcRef.mcState["Obj" + _global.C.nObjectIndex].mcState.amount.txt.text = __score;
}
function PositiveScoring(__score) {
_global.C.nObjectIndex++;
mcRef.mcState.attachMovie("_PlusMoney", "Obj" + _global.C.nObjectIndex, _global.C.fReturnDepth("_Bonus"));
mcRef.mcState["Obj" + _global.C.nObjectIndex]._x = SCORE_POP_X;
mcRef.mcState["Obj" + _global.C.nObjectIndex]._y = SCORE_POP_Y;
mcRef.mcState["Obj" + _global.C.nObjectIndex].mcState.amount.txt.text = __score;
}
function NegativeTime(__sec) {
_global.C.nObjectIndex++;
mcRef.mcState.attachMovie("_MoinsTime", "Obj" + _global.C.nObjectIndex, _global.C.fReturnDepth("_Bonus"));
mcRef.mcState["Obj" + _global.C.nObjectIndex]._x = SEC_POP_X;
mcRef.mcState["Obj" + _global.C.nObjectIndex]._y = SCORE_POP_Y;
mcRef.mcState["Obj" + _global.C.nObjectIndex].mcState.amount.txt.text = __sec;
}
function PositiveTime(__sec) {
_global.C.nObjectIndex++;
mcRef.mcState.attachMovie("_PlusTime", "Obj" + _global.C.nObjectIndex, _global.C.fReturnDepth("_Bonus"));
mcRef.mcState["Obj" + _global.C.nObjectIndex]._x = SEC_POP_X;
mcRef.mcState["Obj" + _global.C.nObjectIndex]._y = SEC_POP_Y;
mcRef.mcState["Obj" + _global.C.nObjectIndex].mcState.amount.txt.text = __sec;
}
var SCORE_POP_Y = 90;
var SCORE_POP_X = 385;
var SEC_POP_Y = 100;
var SEC_POP_X = 55;
}
Symbol 742 MovieClip [__Packages.Transition] Frame 0
class Transition extends State
{
var mcRef, mcInsideMovieClip, sNextFrameLabel, sState, doEnterFrame;
function Transition (P_mcRef) {
super(P_mcRef);
mcRef = P_mcRef;
setState("Idle");
initTrans();
}
function initTrans() {
mcInsideMovieClip = undefined;
sNextFrameLabel = "";
}
function doStartTransition() {
if (mcRef.mcState._currentframe >= mcRef.mcState._totalframes) {
changeSection();
var _local3 = "TransOut";
_global.oSnd.playSnd(_local3, 100, 1);
setState("EndTransition");
}
}
function doEndTransition() {
if (mcRef.mcState._currentframe >= mcRef.mcState._totalframes) {
setState("Idle");
}
}
function setTransition(P_sNextLabel, P_mcInsideMovieClip) {
sNextFrameLabel = P_sNextLabel;
if (P_mcInsideMovieClip != undefined) {
mcInsideMovieClip = P_mcInsideMovieClip;
}
var _local3 = "TransIn";
_global.oSnd.playSnd(_local3, 70, 1);
setState("StartTransition");
}
function changeSection() {
_global.P.unloadSection(_global.P.sCurrentSection);
if (mcInsideMovieClip != undefined) {
var _local3 = mcInsideMovieClip;
_local3.gotoAndStop(sNextFrameLabel);
mcInsideMovieClip = undefined;
} else {
_global.P.setState(sNextFrameLabel);
}
}
function setState(P_sState) {
if (P_sState != "Idle") {
sState = P_sState;
mcRef.gotoAndStop(P_sState);
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doEnterFrame);
} else {
sState = P_sState;
mcRef.gotoAndStop(P_sState);
delete mcRef.onEnterFrame;
}
loadState();
}
function loadState() {
mcRef.LockBtn.useHandCursor = false;
switch (sState) {
case "Idle" :
mcRef.stop();
break;
case "StartTransition" :
_global.objSnd.fPlaySounds("sFx_transition", 50, 1);
}
}
}
Symbol 743 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 744 MovieClip [__Packages.Popup] Frame 0
class Popup extends State
{
var mcRef, setState, sState, nStateTotalFrame, timeWaited;
function Popup (P_mcRef) {
super(P_mcRef);
mcRef = P_mcRef;
setState("Idle");
}
function doUnPausableEnterFrame() {
this["do" + sState]();
}
function doStartMenu() {
if (mcRef.mcState._currentframe >= nStateTotalFrame) {
setState("MenuOpen");
}
}
function dobPopUpStart() {
if (mcRef.mcState._currentframe >= nStateTotalFrame) {
setState("bPopUp");
timeWaited = 0;
}
}
function dobPopUpEnd() {
if (mcRef.mcState._currentframe >= nStateTotalFrame) {
setState("Idle");
_global.C.unPause();
_global.GameTime.StopTime();
_global.BonusTime.StartTime();
}
}
function doMenuOpen() {
}
function doEndMenu() {
if (mcRef.mcState._currentframe >= nStateTotalFrame) {
setState("Idle");
_global.C.unPause();
}
}
function doEventFailed() {
if (mcRef.mcState._currentframe >= nStateTotalFrame) {
trace("Failed");
_global.C.doBroadcast("removeBonusElements");
setState("Idle");
}
}
function doEventSucceed() {
if (mcRef.mcState._currentframe >= nStateTotalFrame) {
trace("Succeed");
_global.C.doBroadcast("removeBonusElements");
setState("Idle");
}
}
function doAppearRight() {
if (mcRef.mcState._currentframe >= nStateTotalFrame) {
setState("PointRight");
}
}
function doAppearLeft() {
if (mcRef.mcState._currentframe >= nStateTotalFrame) {
setState("PointLeft");
}
}
function doCollectBubble() {
timeWaited++;
if (timeWaited >= CollectBtimeWait) {
_global.C.unPause();
setState("Idle");
}
}
function doTimeUp() {
timeWaited++;
if (timeWaited >= TimeUptimeWait) {
setState("Idle");
_global.C.endLevel(false);
}
}
function loadState() {
mcRef.mcBlocker.useHandCursor = false;
switch (sState) {
case "Idle" :
delete mcRef.onEnterFrame;
break;
case "StartMenu" :
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doUnPausableEnterFrame);
break;
case "MenuOpen" :
delete mcRef.onEnterFrame;
break;
case "EndMenu" :
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doUnPausableEnterFrame);
break;
case "bPopUpStart" :
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doUnPausableEnterFrame);
break;
case "bPopUp" :
delete mcRef.onEnterFrame;
mcRef.mcMessage.gotoAndStop(_global.MiniGame.EventNo);
break;
case "bPopUpEnd" :
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doUnPausableEnterFrame);
break;
case "EventFailed" :
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doUnPausableEnterFrame);
break;
case "EventSucceed" :
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doUnPausableEnterFrame);
break;
case "AppearLeft" :
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doUnPausableEnterFrame);
break;
case "AppearRight" :
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doUnPausableEnterFrame);
break;
case "CollectBubble" :
timeWaited = 0;
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doUnPausableEnterFrame);
break;
case "TimeUp" :
timeWaited = 0;
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doUnPausableEnterFrame);
break;
case "Pointleft" :
delete mcRef.onEnterFrame;
break;
case "PointRight" :
delete mcRef.onEnterFrame;
}
}
function nextPage(__Section) {
__Section.nextFrame();
}
function prevPage(__Section) {
__Section.prevFrame();
}
function returnToGame() {
if (_global.C == undefined) {
_global.oTransition.setTransition("Game");
} else {
setState("MenuOpen");
}
}
function returnToBonus() {
setState("bPopUpEnd");
}
function closeMenu() {
setState("EndMenu");
}
function quitGame() {
setState("QuitOpen");
}
var CollectBtimeWait = 80;
var TimeUptimeWait = 60;
}
Symbol 745 MovieClip [__Packages.HUD] Frame 0
class HUD
{
var mcRef;
function HUD (P_mcRef) {
mcRef = P_mcRef;
mcRef.sBobble = 0;
mcRef.sTScore = _global.P.setScoreText(_global.P.nMoneyTotal);
}
function initHUD() {
setPoint();
}
function setPoint() {
mcRef.sScore = _global.P.setScoreText(_global.P.nPlayerScore);
}
}
Symbol 746 MovieClip [__Packages.GameCTRL] Frame 0
class GameCTRL extends State
{
var mcRef, nBobblePresentLevel, nBobbleNextLevel, bInit, nObjectIndex, oBroadcaster, aIndexSwapDepth, bPaused;
function GameCTRL (P_mcRef) {
super(P_mcRef);
mcRef = P_mcRef;
mcRef._xscale = (mcRef._yscale = 100);
nBobblePresentLevel = 0;
nBobbleNextLevel = 0;
mcRef._y = (mcRef._x = 0);
mcRef.onEnterFrame = mx.utils.Delegate.create(this, doEnterFrame);
initGameVars();
}
function initGameVars() {
bInit = false;
nObjectIndex = 1;
oBroadcaster = new Object();
AsBroadcaster.initialize(oBroadcaster);
aIndexSwapDepth = new Array();
aIndexSwapDepth[7] = {sType:"_Dog", nCurrentDepth:5000, nBaseDepth:5000, nLimitDepth:9900};
aIndexSwapDepth[0] = {sType:"_Pillar", nCurrentDepth:10000, nBaseDepth:10000, nLimitDepth:19900};
aIndexSwapDepth[1] = {sType:"_Vase", nCurrentDepth:35010, nBaseDepth:35010, nLimitDepth:39900};
aIndexSwapDepth[2] = {sType:"_Vase2", nCurrentDepth:35000, nBaseDepth:35000, nLimitDepth:35009};
aIndexSwapDepth[3] = {sType:"_TableS", nCurrentDepth:26000, nBaseDepth:26000, nLimitDepth:29900};
aIndexSwapDepth[4] = {sType:"_TableM", nCurrentDepth:30000, nBaseDepth:30000, nLimitDepth:33900};
aIndexSwapDepth[5] = {sType:"_TableM2", nCurrentDepth:34000, nBaseDepth:34000, nLimitDepth:34900};
aIndexSwapDepth[6] = {sType:"_TableB", nCurrentDepth:20010, nBaseDepth:20010, nLimitDepth:25920};
aIndexSwapDepth[7] = {sType:"_DogOut", nCurrentDepth:40000, nBaseDepth:40000, nLimitDepth:49900};
aIndexSwapDepth[8] = {sType:"_Bobble", nCurrentDepth:50000, nBaseDepth:50000, nLimitDepth:59900};
aIndexSwapDepth[9] = {sType:"_money", nCurrentDepth:60000, nBaseDepth:60000, nLimitDepth:69900};
aIndexSwapDepth[10] = {sType:"Remove", nCurrentDepth:900000, nBaseDepth:900000, nLimitDepth:1000000};
aIndexSwapDepth[11] = {sType:"_TableVS", nCurrentDepth:29910, nBaseDepth:29910, nLimitDepth:29990};
aIndexSwapDepth[12] = {sType:"_Bonus", nCurrentDepth:1000000, nBaseDepth:1000000, nLimitDepth:1100000};
}
function initGameObject() {
_global.Perso = new oPlayer(mcRef.mcPlayer);
_global.Sophie = new oSophie(mcRef.mcSophie);
_global.Map = new oCamPan(mcRef.mcBackGround);
_global.MiniGame = new oMiniGame(mcRef.mcBackGround.Mini_mc);
_global.BonusArrow = new Popup(mcRef._parent.BonusShow);
_global.Throw = new oThrowing();
_global.BonusTimer = mcRef._parent.mcHUD.mcBonusTimer;
_global.Passage = new oPassage(mcRef.mcBackGround.Passage1, mcRef.mcBackGround.Passage2, mcRef.mcBackGround.Passage3);
_global.Map.checkLimitX(START_X);
initTimer();
}
function initTimer() {
_global.GameTime = new Timer(mcRef._parent.mcHUD.mcTimer);
_global.BonusTime = new Timer(mcRef._parent.mcHUD.mcBonusTimer);
_global.GameTime.EndAction = function () {
_global.oPopup.setState("TimeUp");
_global.C.pause();
};
_global.BonusTime.EndAction = function () {
_global.MiniGame.failEvents();
};
}
function doEnterFrame() {
if (bInit == false) {
bInit = true;
initGameObject();
_global.GameTime.SetTimer(120 + _global.P.nBonusTime);
pause();
} else if (bPaused == false) {
_global.oHUD.setPoint();
_global.objSnd.Fade();
doBroadcast("doEnterFrame");
} else {
_global.objSnd.Fade();
doBroadcast("fDoUnpausableEnterFrame");
}
}
function doBroadcast(P_sMessage) {
oBroadcaster.broadcastMessage(P_sMessage);
}
function doBroadcastMess(P_sMessage, Param1, Param2) {
oBroadcaster.broadcastMessage(P_sMessage, Param1, Param2);
}
function pause() {
bPaused = true;
if (_global.MiniGame.bOver) {
_global.GameTime.StopTime();
} else {
_global.BonusTime.StopTime();
}
doBroadcast("pause");
}
function unPause() {
bPaused = false;
if (_global.MiniGame.bOver) {
_global.GameTime.StartTime();
} else {
_global.BonusTime.StartTime();
}
doBroadcast("unPause");
}
function fAddBroadcastObj(P_obj) {
oBroadcaster.addListener(P_obj);
}
function fRemoveBroadcastObj(P_obj) {
oBroadcaster.removeListener(P_obj);
}
function fRemoveObject(P_sObjName) {
delete this[P_sObjName];
}
function fRemoveInstance(P_mcRef) {
P_mcRef.swapDepths(fReturnDepth("Remove"));
P_mcRef.removeMovieClip();
}
function fReturnDepth(P_sType) {
for (var _local3 in aIndexSwapDepth) {
if (aIndexSwapDepth[_local3].sType == P_sType) {
aIndexSwapDepth[_local3].nCurrentDepth++;
if (aIndexSwapDepth[_local3].nCurrentDepth > aIndexSwapDepth[_local3].nLimitDepth) {
aIndexSwapDepth[_local3].nCurrentDepth = aIndexSwapDepth[_local3].nBaseDepth;
}
return(aIndexSwapDepth[_local3].nCurrentDepth);
}
}
}
function endLevel(__Success) {
if (__Success) {
if (_global.P.nLevel < _global.P.MAX_LEVEL) {
_global.P.nLevel++;
_global.oTransition.setTransition("UnloadGame");
} else {
_global.oTransition.setTransition("EndScreen");
}
} else {
_global.oTransition.setTransition("EndScreen");
}
}
function reInitBreakedObject() {
doBroadcast("putBackPillar");
doBroadcast("putBackBreakable");
}
function checkEndLevel() {
if ((((nBobblePresentLevel * 100) / PERCENT_TO_PASS) >= nBobbleNextLevel) && (_global.MiniGame.selectEvent == "")) {
_global.MiniGame.selectMiniGame();
_global.Collect.oControl.setState("Idle");
} else if (((nBobblePresentLevel * 100) / PERCENT_TO_PASS) < nBobbleNextLevel) {
var _local3 = Math.ceil((nBobbleNextLevel * PERCENT_TO_PASS) / 100) - nBobblePresentLevel;
if (_local3 <= 5) {
_global.Collect.oControl.setState("collect");
_global.Collect.mcState.amount.txt.text = _local3;
}
}
}
var PERCENT_TO_PASS = 70;
var START_X = 8400;
}
Symbol 747 MovieClip [__Packages.oPlayer] Frame 0
class oPlayer extends State
{
var mcRef, oKeyDown, oCollide, setState, nSpeed, nChute, nBobbleHead, nStageLevel, HIT, HIT_SIDE, HIT_UP, HIT_DOWN, sState, nStageX, nStageY;
function oPlayer (__player) {
super(__player);
_global.C.fAddBroadcastObj(this);
mcRef = __player;
setCoordHit();
oKeyDown = new oKeyDetect();
oCollide = new oCollider();
setState("Idle");
nSpeed = 0;
nChute = 0;
nBobbleHead = 0;
nStageLevel = 1;
}
function setCoordHit() {
HIT = mcRef.Hit;
HIT_SIDE = HIT._width / 2;
HIT_UP = HIT._height;
HIT_DOWN = 0;
}
function doIdle() {
oKeyDown.CheckKey();
checkWalk();
checkJump();
adjustMove();
checkGround();
}
function doWalk() {
oKeyDown.CheckKey();
checkWalk();
checkJump();
adjustMove();
checkGround();
}
function doRun() {
oKeyDown.CheckKey();
checkWalk();
checkJump();
adjustMove();
checkGround();
}
function doStartJump() {
oKeyDown.CheckKey();
checkWalk();
adjustMove();
checkGround();
if (checkEndAnim()) {
var _local3 = "Jump" + Number(random(2) + 1);
_global.oSnd.playSnd(_local3, 70, 1);
setState("Jump");
JumpPower();
}
}
function doJump() {
oKeyDown.CheckKey();
checkWalk();
adjustMove();
adjustHeight();
}
function doStartFall() {
oKeyDown.CheckKey();
checkWalk();
adjustMove();
adjustHeight();
if (checkEndAnim()) {
setState("Fall");
}
}
function doFall() {
oKeyDown.CheckKey();
checkWalk();
adjustMove();
adjustHeight();
}
function doEndJump() {
oKeyDown.CheckKey();
checkWalk();
adjustMove();
if (checkEndAnim()) {
setState("Idle");
}
checkGround();
}
function doStumble() {
adjustMove();
if (checkEndAnim()) {
setState("Idle");
}
checkGround();
}
function checkEndAnim() {
var _local2 = false;
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
_local2 = true;
}
return(_local2);
}
function checkGround() {
if (!oCollide.hitGround(this)) {
if (!oCollide.AjustToGround(this, 3)) {
adjustHeight();
}
}
}
function checkWalk() {
var _local3 = oKeyDown.SpacePress;
if (_local3) {
var _local2 = RUN_VELOCITY;
} else {
var _local2 = WALK_VELOCITY;
}
if (oKeyDown.RightPress) {
if (nSpeed < 0) {
nSpeed = nSpeed + (4 * ACCELARATION);
}
if (nSpeed < _local2) {
nSpeed = nSpeed + ACCELARATION;
if (nSpeed > _local2) {
nSpeed = _local2;
}
}
} else if (oKeyDown.LeftPress) {
if (nSpeed > 0) {
nSpeed = nSpeed - (4 * ACCELARATION);
}
if (nSpeed > (_local2 * -1)) {
nSpeed = nSpeed - ACCELARATION;
if (nSpeed < (_local2 * -1)) {
nSpeed = _local2 * -1;
}
}
}
if (((sState == "Idle") || (sState == "Walk")) || (sState == "Run")) {
if (Math.abs(nSpeed) > WALK_VELOCITY) {
setState("Run");
} else if (Math.abs(nSpeed) > 0) {
setState("Walk");
} else if ((!oKeyDown.RightPress) && (!oKeyDown.LeftPress)) {
setState("Idle");
}
}
}
function checkJump() {
if (oKeyDown.UpPress) {
setState("StartJump");
}
}
function JumpPower() {
_global.Perso.nChute = -_global.Perso.CHUTE_VELOCITY;
}
function adjustMove() {
if (oKeyDown.RightPress) {
mcRef._xscale = 100;
} else if (oKeyDown.LeftPress) {
mcRef._xscale = -100;
}
if ((!oKeyDown.RightPress) && (!oKeyDown.LeftPress)) {
if (nSpeed > 0) {
if (nSpeed > WALK_VELOCITY) {
nSpeed = WALK_VELOCITY;
}
nSpeed = nSpeed - (4 * ACCELARATION);
if (nSpeed < 0) {
nSpeed = 0;
}
} else if (nSpeed < 0) {
if (nSpeed < (-WALK_VELOCITY)) {
nSpeed = -WALK_VELOCITY;
}
nSpeed = nSpeed + (4 * ACCELARATION);
if (nSpeed > 0) {
nSpeed = 0;
}
}
} else if ((!oKeyDown.SpacePress) && (Math.abs(nSpeed) > WALK_VELOCITY)) {
if (nSpeed > 0) {
nSpeed = nSpeed - (2 * ACCELARATION);
} else if (nSpeed < 0) {
nSpeed = nSpeed + (2 * ACCELARATION);
}
}
if (!oCollide.hitWall(this)) {
mcRef._x = mcRef._x + nSpeed;
}
_global.Map.moveFrame();
}
function adjustHeight() {
nChute = nChute + GRAVITY;
if ((!oKeyDown.UpPress) && (nChute < 0)) {
nChute = nChute + GRAVITY;
}
if (nChute > 0) {
if (sState != "Fall") {
setState("StartFall");
} else if (sState != "StartFall") {
setState("Fall");
}
if (!oCollide.hitGround(this)) {
mcRef._y = mcRef._y + nChute;
} else {
nChute = 0;
setState("Idle");
}
} else {
mcRef._y = mcRef._y + nChute;
}
}
function Hurt() {
if ((sState == "Walk") || (sState == "Run")) {
if (nBobbleHead != 0) {
var _local6 = nBobbleHead;
if (_local6 > BOBBLE_LOSE_MAX) {
_local6 = BOBBLE_LOSE_MAX;
}
nBobbleHead = nBobbleHead - _local6;
_global.oHUD.mcRef.sBobble = _global.oHUD.mcRef.sBobble - _local6;
_global.P.nPlayerScore = _global.P.nPlayerScore - (_local6 * 500);
_global.P.NegativeScoring(_local6 * 500);
_global.P.NegativeTime(_local6 * 5);
var _local4 = 0;
while (_local4 < _local6) {
_global.C.nObjectIndex++;
_global.GameTime.addTime(-5);
_global.C.mcRef.mcBackGround.attachMovie("_Bobble", "Obj" + _global.C.nObjectIndex, _global.C.fReturnDepth("_Bobble"));
_global.C.mcRef.mcBackGround["Obj" + _global.C.nObjectIndex]._x = nStageX;
_global.C.mcRef.mcBackGround["Obj" + _global.C.nObjectIndex]._y = nStageY;
var _local3 = 1;
if (nSpeed < 0) {
_local3 = -1;
}
var _local5 = new oBobbleHead(_global.C.mcRef.mcBackGround["Obj" + _global.C.nObjectIndex], "_Bobble", _local3 * (random(15) + 5), random(15) + 8, "Fly", nStageLevel);
_local4++;
}
}
oKeyDown.RightPress = false;
oKeyDown.LeftPress = false;
oKeyDown.SpacePress = false;
var _local7 = "Stumble" + Number(random(2) + 1);
_global.oSnd.playSnd(_local7, 70, 1);
setState("Stumble");
if (nSpeed > 0) {
oKeyDown.RightPress = true;
nSpeed = BUMP_SPEED;
} else {
oKeyDown.LeftPress = true;
nSpeed = -BUMP_SPEED;
}
}
}
var BOBBLE_LOSE_MAX = 4;
var BUMP_SPEED = 10;
var CHUTE_VELOCITY = 14;
var WALK_VELOCITY = 8;
var RUN_VELOCITY = 15;
var ACCELARATION = 1;
var GRAVITY = 1;
}
Symbol 748 MovieClip [__Packages.oKeyDetect] Frame 0
class oKeyDetect
{
var LeftPress, RightPress, UpPress, DownPress, SpacePress;
function oKeyDetect () {
ResetDetect();
}
function ResetDetect() {
LeftPress = false;
RightPress = false;
UpPress = false;
DownPress = false;
SpacePress = false;
}
function CheckKey() {
if (Key.isDown(37) && (!LeftPress)) {
LeftPress = true;
} else if ((!Key.isDown(37)) && (LeftPress)) {
LeftPress = false;
}
if (Key.isDown(39) && (!RightPress)) {
RightPress = true;
} else if ((!Key.isDown(39)) && (RightPress)) {
RightPress = false;
}
if (Key.isDown(38) && (!UpPress)) {
UpPress = true;
} else if ((!Key.isDown(38)) && (UpPress)) {
UpPress = false;
}
if (Key.isDown(40) && (!DownPress)) {
DownPress = true;
} else if ((!Key.isDown(40)) && (DownPress)) {
DownPress = false;
}
if (Key.isDown(16) && (!SpacePress)) {
SpacePress = true;
} else if ((!Key.isDown(16)) && (SpacePress)) {
SpacePress = false;
}
}
}
Symbol 749 MovieClip [__Packages.oCollider] Frame 0
class oCollider
{
var STAGE_WIDTH, STAGE_HEIGHT, mcBackGround, aWall, aWallLeftB, aWallRightB, aGround, aStage, nArrayLoop, LoopObject, aBonusStage;
function oCollider () {
_global.oCollide = this;
InitInfo();
InitStageArray(false);
}
function InitInfo() {
STAGE_WIDTH = _global.P.STAGE_WIDTH;
STAGE_HEIGHT = _global.P.STAGE_HEIGHT;
mcBackGround = _global.C.mcRef.mcBackGround;
aWall = new Array();
aWallLeftB = new Array();
aWallRightB = new Array();
aGround = new Array();
aStage = new Array();
var _local3 = 0;
while (_local3 < Math.round(mcBackGround._width / ARRAY_SIZE)) {
aStage[_local3] = new Array();
_local3++;
}
nArrayLoop = 0;
LoopObject = _global.S.createEmptyMovieClip("looping", 100);
}
function InitBonusArray() {
aBonusStage = new Array();
var _local2 = 0;
while (_local2 < Math.round(mcBackGround._width / ARRAY_SIZE)) {
aBonusStage[_local2] = new Array();
_local2++;
}
}
function getBoundCoord(__mcRef, __mcToRef) {
var _local1 = new Object();
var _local2 = new Object();
_local2 = __mcRef.getBounds(__mcToRef);
_local1.x = (_local2.xMax + _local2.xMin) / 2;
_local1.y = _local2.yMax;
_local1.nWidth = __mcRef._width;
_local1.nHeight = __mcRef._height;
return(_local1);
}
function checkInScreen(__mcRef) {
var _local2 = true;
if ((__mcRef.x - (__mcRef.nWidth / 2)) > STAGE_WIDTH) {
_local2 = false;
}
if ((__mcRef.x + (__mcRef.nWidth / 2)) < 0) {
_local2 = false;
}
return(_local2);
}
function hitWall(__mcRef) {
var _local6 = false;
var _local3 = new Object();
_local3 = getBoundCoord(__mcRef.HIT, mcBackGround);
var _local5;
if (__mcRef.nSpeed > 0) {
_local5 = 1;
} else {
_local5 = -1;
}
var _local7 = aStage[Math.round(_local3.x / ARRAY_SIZE) + _local5][Math.round(_local3.y / ARRAY_SIZE) - 1];
if (_local7 == "Wall") {
while (aStage[Math.round(_local3.x / ARRAY_SIZE)][Math.round(_local3.y / ARRAY_SIZE) - 1] == "Wall") {
__mcRef.mcRef._x = __mcRef.mcRef._x - (_local5 * ARRAY_SIZE);
_local3 = getBoundCoord(__mcRef.HIT, mcBackGround);
}
_local6 = true;
} else if ((_local7 == "WallbLeft") && (_global.MiniGame.sSide != "l")) {
while (aStage[Math.round(_local3.x / ARRAY_SIZE)][Math.round(_local3.y / ARRAY_SIZE) - 1] == "WallbLeft") {
__mcRef.mcRef._x = __mcRef.mcRef._x - (_local5 * ARRAY_SIZE);
_local3 = getBoundCoord(__mcRef.HIT, mcBackGround);
}
_local6 = true;
} else if ((_local7 == "WallbRight") && (_global.MiniGame.sSide != "r")) {
while (aStage[Math.round(_local3.x / ARRAY_SIZE)][Math.round(_local3.y / ARRAY_SIZE) - 1] == "WallbRight") {
__mcRef.mcRef._x = __mcRef.mcRef._x - (_local5 * ARRAY_SIZE);
_local3 = getBoundCoord(__mcRef.HIT, mcBackGround);
}
_local6 = true;
}
return(_local6);
}
function hitGround(__mcRef) {
var _local5 = false;
var _local3 = new Object();
_local3 = getBoundCoord(__mcRef.HIT, mcBackGround);
if ((__mcRef.HIT == _global.Perso.HIT) || (_global.Sophie.HIT)) {
__mcRef.nStageX = _local3.x;
__mcRef.nStageY = _local3.y;
}
if (aStage[Math.round(_local3.x / ARRAY_SIZE)][Math.round(_local3.y / ARRAY_SIZE)] == "Ground") {
while (aStage[Math.round(_local3.x / ARRAY_SIZE)][Math.round(_local3.y / ARRAY_SIZE) - 1] == "Ground") {
__mcRef.mcRef._y = __mcRef.mcRef._y - ARRAY_SIZE;
_local3 = getBoundCoord(__mcRef.HIT, mcBackGround);
}
_local5 = true;
} else if (aBonusStage[Math.round(_local3.x / ARRAY_SIZE)][Math.round(_local3.y / ARRAY_SIZE)] == "Ground") {
while (aBonusStage[Math.round(_local3.x / ARRAY_SIZE)][Math.round(_local3.y / ARRAY_SIZE) - 1] == "Ground") {
__mcRef.mcRef._y = __mcRef.mcRef._y - ARRAY_SIZE;
_local3 = getBoundCoord(__mcRef.HIT, mcBackGround);
}
_local5 = true;
}
return(_local5);
}
function hitElement(__mcRef1, __mcRef2) {
var _local4 = false;
var _local3 = new Object();
var _local2 = new Object();
_local3 = getBoundCoord(__mcRef1.mcRef, mcBackGround);
_local2 = getBoundCoord(__mcRef2.mcRef, mcBackGround);
if (Math.abs(_local3.x - _local2.x) < (__mcRef1.HIT_SIDE + __mcRef2.HIT_SIDE)) {
if ((_local3.y < _local2.y) && (Math.abs(_local3.y - _local2.y) < Math.abs(__mcRef1.HIT_DOWN + __mcRef2.HIT_UP))) {
_local4 = true;
} else if ((_local3.y >= _local2.y) && (Math.abs(_local3.y - _local2.y) < Math.abs(__mcRef2.HIT_DOWN + __mcRef1.HIT_UP))) {
_local4 = true;
}
}
return(_local4);
}
function AjustToGround(__mcRef, __heightAjust) {
var _local2 = new Object();
_local2 = getBoundCoord(__mcRef.HIT, mcBackGround);
if (aStage[Math.round(_local2.x / ARRAY_SIZE)][Math.round(_local2.y / ARRAY_SIZE) + __heightAjust] == "Ground") {
while (aStage[Math.round(_local2.x / ARRAY_SIZE)][Math.round(_local2.y / ARRAY_SIZE)] != "Ground") {
__mcRef.mcRef._y = __mcRef.mcRef._y + ARRAY_SIZE;
_local2 = getBoundCoord(__mcRef.HIT, mcBackGround);
__mcRef.nChute = 0;
}
return(true);
}
if (aBonusStage[Math.round(_local2.x / ARRAY_SIZE)][Math.round(_local2.y / ARRAY_SIZE) + __heightAjust] == "Ground") {
while (aBonusStage[Math.round(_local2.x / ARRAY_SIZE)][Math.round(_local2.y / ARRAY_SIZE)] != "Ground") {
__mcRef.mcRef._y = __mcRef.mcRef._y + ARRAY_SIZE;
_local2 = getBoundCoord(__mcRef.HIT, mcBackGround);
__mcRef.nChute = 0;
}
return(true);
}
return(false);
}
function addWall(__mcRef) {
aWall.push(__mcRef);
}
function addGround(__mcRef) {
aGround.push(__mcRef);
}
function InitStageArray(_bonus) {
LoopObject.onEnterFrame = function () {
_global.oCollide.nArrayLoop++;
if (!_bonus) {
if (_global.oCollide.nArrayLoop == 4) {
_global.oCollide.InitBonusArray();
} else if (_global.oCollide.nArrayLoop == 6) {
_global.oCollide.InitWall();
} else if (_global.oCollide.nArrayLoop == 8) {
_global.oCollide.InitGround(false);
} else if (_global.oCollide.nArrayLoop == 10) {
_global.oCollide.clearLoopObject(false);
}
} else if (_global.oCollide.nArrayLoop == 15) {
_global.oCollide.InitBonusArray();
} else if (_global.oCollide.nArrayLoop == 17) {
_global.oCollide.InitGround(true);
} else if (_global.oCollide.nArrayLoop == 19) {
_global.oCollide.clearLoopObject(true);
}
};
}
function InitGround(_bonus) {
var _local7 = 0;
var _local5 = 0;
while (_local5 < aGround.length) {
var _local2 = new Object();
_local2.mc = aGround[_local5];
_local2.Coord = getBoundCoord(_local2.mc, mcBackGround);
_local2.xStart = Math.round((_local2.Coord.x - (_local2.mc._width / 2)) / ARRAY_SIZE);
_local2.xEnd = Math.round((_local2.Coord.x + (_local2.mc._width / 2)) / ARRAY_SIZE);
_local2.yStart = Math.round((_local2.Coord.y - _local2.mc._height) / ARRAY_SIZE);
_local2.yEnd = Math.round(_local2.Coord.y / ARRAY_SIZE);
var _local4 = _local2.xStart;
while (_local4 <= _local2.xEnd) {
var _local3 = _local2.yStart;
while (_local3 <= _local2.yEnd) {
if (!_bonus) {
aStage[_local4][_local3] = "Ground";
} else {
aBonusStage[_local4][_local3] = "Ground";
}
_local3++;
}
_local4++;
}
aGround[_local5].swapDepths(120);
removeMovieClip(aGround[_local5]);
aGround.splice(0, 1);
_local5--;
_local7++;
if (_local7 == 10) {
_local5 = aGround.length;
nArrayLoop--;
}
_local5++;
}
}
function InitWall() {
var _local6 = 0;
var _local5 = 0;
while (_local5 < aWall.length) {
var _local2 = new Object();
_local2.mc = aWall[_local5];
_local2.Coord = getBoundCoord(_local2.mc, mcBackGround);
_local2.xStart = Math.round((_local2.Coord.x - (_local2.mc._width / 2)) / ARRAY_SIZE);
_local2.xEnd = Math.round((_local2.Coord.x + (_local2.mc._width / 2)) / ARRAY_SIZE);
_local2.yStart = Math.round((_local2.Coord.y - _local2.mc._height) / ARRAY_SIZE);
_local2.yEnd = Math.round(_local2.Coord.y / ARRAY_SIZE);
var _local4 = _local2.xStart;
while (_local4 <= _local2.xEnd) {
var _local3 = _local2.yStart;
while (_local3 <= _local2.yEnd) {
if (_local2.mc._name == "BonusRight") {
aStage[_local4][_local3] = "WallbRight";
} else if (_local2.mc._name == "BonusLeft") {
aStage[_local4][_local3] = "WallbLeft";
} else {
aStage[_local4][_local3] = "Wall";
}
_local3++;
}
_local4++;
}
aWall[_local5].swapDepths(120);
removeMovieClip(aWall[_local5]);
aWall.splice(0, 1);
_local5--;
_local6++;
if (_local6 == 3) {
_local5 = aWall.length;
nArrayLoop--;
}
_local5++;
}
}
function clearLoopObject(_bonus) {
delete LoopObject.onEnterFrame;
nArrayLoop = 0;
if (!_bonus) {
_global.oPopup.setState("CollectBubble");
}
}
var ARRAY_SIZE = 3;
}
Symbol 750 MovieClip [__Packages.oObstacle] Frame 0
class oObstacle extends State
{
var mcRef, pasteToDepth, nIndex, sLinkName, setState, sFirstEtat, bMiniGame, oInfo, oInitialInfo, mcRefX, mcRefY, pasteToMovie, mcRefFrame, bUpdatedCoord, mcRefRotate, sOldsState, sState;
function oObstacle (__mcRef, __sLinkName, __sFirstEtat, __bMiniGame) {
super(__mcRef);
_global.C.fAddBroadcastObj(this);
mcRef = __mcRef;
pasteToDepth = _global.C.fReturnDepth(__sLinkName);
nIndex = _global.C.nObjectIndex;
_global.C.nObjectIndex++;
mcRef.swapDepths(pasteToDepth);
sLinkName = __sLinkName;
setState("Init");
sFirstEtat = __sFirstEtat;
if (__bMiniGame == true) {
bMiniGame = true;
_global.MiniGame.miniGameObject(this, __sLinkName);
} else {
bMiniGame = false;
}
}
function doInit() {
if (oInfo == undefined) {
followPillar();
oInfo = _global.oCollide.getBoundCoord(mcRef, _global.S);
oInitialInfo = _global.oCollide.getBoundCoord(mcRef, _global.S);
var _local3 = _global.oCollide.getBoundCoord(mcRef, _global.C.mcRef.mcBackGround);
mcRefX = _local3.x;
mcRefY = _local3.y;
pasteToMovie = _global.C.mcRef.mcBackGround;
setState(sFirstEtat);
mcRef.gotoAndStop(sFirstEtat);
mcRefFrame = mcRef._currentframe;
bUpdatedCoord = false;
oInitialInfo.xStart = mcRef._x;
oInitialInfo.yStart = mcRef._y;
oInitialInfo.rotate = mcRef._rotation;
oInitialInfo.frame = mcRef._currentframe;
}
}
function doIdle() {
checkToSleep();
}
function doBreak() {
checkToSleep();
}
function doSleep() {
checkToWake();
}
function checkToWake() {
if (_global.oCollide.checkInScreen(oInfo)) {
wakeUp();
}
}
function checkToSleep() {
if (!bUpdatedCoord) {
bUpdatedCoord = true;
addInfoToSave();
mcRefX = mcRef._x;
mcRefY = mcRef._y;
mcRefRotate = mcRef._rotation;
mcRefFrame = mcRef._currentframe;
oInfo = _global.oCollide.getBoundCoord(mcRef, _global.S);
}
if (!_global.oCollide.checkInScreen(oInfo)) {
putToSleep();
}
}
function ajustInfo(__numX, __numY) {
oInfo.x = oInfo.x - __numX;
oInfo.y = oInfo.y - __numY;
oInitialInfo.x = oInitialInfo.x - __numX;
oInitialInfo.y = oInitialInfo.y - __numY;
}
function putToSleep() {
sOldsState = sState;
setState("Sleep");
_global.C.fRemoveInstance(mcRef);
}
function wakeUp() {
reajustObject();
mcRef = pasteToMovie.attachMovie(sLinkName, "obj" + nIndex, pasteToDepth, {_x:mcRefX, _y:mcRefY});
mcRef._rotation = mcRefRotate;
mcRef.gotoAndStop(mcRefFrame);
pasteSavedInfo();
}
function cleanObj() {
putToSleep();
}
function reajustObject() {
setState(sOldsState);
}
function addInfoToSave() {
}
function pasteSavedInfo() {
}
function followPillar() {
}
function removeBonusElements() {
if (bMiniGame) {
_global.C.fRemoveInstance(mcRef);
_global.C.fRemoveBroadcastObj(this);
_global.C.fRemoveObject(this);
}
}
}
Symbol 751 MovieClip [__Packages.oBobbleHead] Frame 0
class oBobbleHead extends oObstacle
{
var HIT, mcRef, REF_HEIGHT, REMOVE_AT, nLastPickUp, LEVEL_ART, checkToSleep, bUpdatedCoord, setState, bInitRotate, checkToWake;
function oBobbleHead (__mcRef, __link, __InitSpeed, __InitChute, __InitEtat, __removeAt) {
super(__mcRef, __link, __InitEtat);
nChute = __InitChute * -1;
nSpeed = __InitSpeed;
HIT = mcRef.Hit;
REF_HEIGHT = mcRef._width / 2;
REMOVE_AT = __removeAt;
nLastPickUp = 0;
if (__InitEtat == "Idle") {
_global.C.nBobbleNextLevel++;
LEVEL_ART = true;
} else {
LEVEL_ART = false;
}
}
function doIdle() {
checkToSleep();
checkCollide();
}
function doFly() {
if (_global.Throw.addGravity(this)) {
bUpdatedCoord = false;
setState("Idle");
}
if (bInitRotate) {
checkCollide();
}
}
function doTake() {
if (checkEndOfAnim()) {
pick();
}
}
function doSleep() {
if (nLastPickUp < _global.Perso.nStageLevel) {
checkToWake();
}
}
function checkCollide() {
if (_global.oCollide.hitElement(this, _global.Perso)) {
var _local3 = "Bobble" + Number(random(2) + 1);
_global.oSnd.playSnd(_local3, 70, 1);
setState("Take");
}
}
function checkEndOfAnim() {
var _local2 = false;
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
_local2 = true;
}
return(_local2);
}
function pick() {
_global.Perso.nBobbleHead++;
_global.oHUD.mcRef.sBobble++;
_global.C.fRemoveInstance(mcRef);
_global.GameTime.addTime(4);
_global.P.nPlayerScore = _global.P.nPlayerScore + 500;
_global.P.PositiveScoring(500);
_global.P.PositiveTime(4);
if (REMOVE_AT <= _global.Perso.nStageLevel) {
if (LEVEL_ART) {
_global.C.nBobbleNextLevel--;
}
if (LEVEL_ART) {
_global.C.checkEndLevel();
}
_global.C.fRemoveBroadcastObj(this);
_global.C.fRemoveObject(this);
} else {
setState("Sleep");
if (LEVEL_ART) {
_global.C.nBobblePresentLevel++;
}
nLastPickUp = _global.Perso.nStageLevel;
if (LEVEL_ART) {
_global.C.checkEndLevel();
}
}
}
var nChute = 0;
var nSpeed = 0;
var HIT_SIDE = 10;
var HIT_UP = 40;
var HIT_DOWN = 0;
var FALL_LIMIT = 1;
var ACCELARATION = 0.97;
var GRAVITY = 1.5;
var REBOUNCE = 0.5;
var BOUNCE_STOP = 3;
var ACCEL_STOP = 1;
var ROTATE = true;
var ROTATE_UP = true;
}
Symbol 752 MovieClip [__Packages.oSophie] Frame 0
class oSophie extends State
{
var mcRef, setState, nSpeed, nChute, bRightPress, bLeftPress, bdepassLeft, bdepassRight, HIT, HIT_SIDE, HIT_UP, HIT_DOWN, nWaitTime, sState;
function oSophie (__player) {
super(__player);
_global.C.fAddBroadcastObj(this);
mcRef = __player;
setCoordHit();
setState("Idle");
nSpeed = 0;
nChute = 0;
bRightPress = false;
bLeftPress = false;
bdepassLeft = false;
bdepassRight = false;
}
function setCoordHit() {
HIT = mcRef.Hit;
HIT_SIDE = HIT._width / 2;
HIT_UP = HIT._height;
HIT_DOWN = 0;
}
function doIdle() {
checkCollide();
checkDirection();
checkWalk();
adjustMove();
}
function doRun() {
checkCollide();
checkDirection();
checkWalk();
adjustMove();
}
function doPoseSurpris() {
if (checkEndAnim()) {
setState("surpris");
}
}
function dosurpris() {
checkDirection();
checkWalk();
adjustMove();
}
function checkCollide() {
if (_global.oCollide.hitElement(this, _global.Perso)) {
var _local7 = "Sophie";
_global.oSnd.playSnd(_local7, 70, 1);
setState("PoseSurpris");
var _local5 = new Object();
_local5 = _global.oCollide.getBoundCoord(HIT, _global.oCollide.mcBackGround);
var _local4 = 0;
while (_local4 < 2) {
_global.C.nObjectIndex++;
_global.C.mcRef.mcBackGround.attachMovie("_Bobble", "Obj" + _global.C.nObjectIndex, _global.C.fReturnDepth("_Bobble"));
_global.C.mcRef.mcBackGround["Obj" + _global.C.nObjectIndex]._x = _local5.x;
_global.C.mcRef.mcBackGround["Obj" + _global.C.nObjectIndex]._y = _local5.y;
var _local3 = 1;
if (nSpeed < 0) {
_local3 = -1;
}
var _local6 = new oBobbleHead(_global.C.mcRef.mcBackGround["Obj" + _global.C.nObjectIndex], "_Bobble", _local3 * (random(15) + 5), random(10) + 8, "Fly", _global.Perso.nStageLevel);
_local4++;
}
}
}
function checkEndAnim() {
var _local2 = false;
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
_local2 = true;
}
return(_local2);
}
function checkDirection() {
var _local4 = "";
var _local3;
var _local5;
if (_global.Perso.nStageX < ZONE_LEFT) {
if (_global.Perso.nStageX < FORCE_LEFT) {
_local3 = "ForceLeft";
} else {
_local3 = "Left";
}
_local5 = DISTANCE_SIDE;
} else if (_global.Perso.nStageX > ZONE_RIGHT) {
if (_global.Perso.nStageX > FORCE_RIGHT) {
_local3 = "ForceRight";
} else {
_local3 = "Right";
}
_local5 = DISTANCE_SIDE;
} else {
_local3 = "Between";
_local5 = DISTANCE_BETWEEN;
}
if (_global.Perso.mcRef._x < mcRef._x) {
if ((((_global.Perso.mcRef._x + _local5) > mcRef._x) && (_local3 != "ForceRight")) && (_global.Perso.mcRef._y > PLAYER_HEIGHT)) {
_local4 = "R";
bdepassLeft = false;
} else if ((((_global.Perso.mcRef._y < PLAYER_HEIGHT) && (_local3 != "ForceLeft")) && (_local3 != "Left")) && (!bdepassRight)) {
_local4 = "L";
nWaitTime = 0;
bdepassLeft = true;
} else if (_local3 == "ForceRight") {
_local4 = "L";
bdepassLeft = false;
} else if (((_global.Perso.mcRef._x + DISTANCE_MAX) < mcRef._x) && (_local3 != "ForceLeft")) {
_local4 = "L";
bdepassLeft = false;
} else if ((_global.Perso.mcRef._x + _local5) > mcRef._x) {
_local4 = "R";
bdepassLeft = false;
} else {
nWaitTime++;
if (nWaitTime > WAIT_TO_RESPASS) {
bdepassLeft = false;
bdepassRight = false;
}
}
} else if ((((_global.Perso.mcRef._x - _local5) < mcRef._x) && (_local3 != "ForceLeft")) && (_global.Perso.mcRef._y > PLAYER_HEIGHT)) {
_local4 = "L";
bdepassRight = false;
} else if ((((_global.Perso.mcRef._y < PLAYER_HEIGHT) && (_local3 != "ForceRight")) && (_local3 != "Right")) && (!bdepassLeft)) {
_local4 = "R";
nWaitTime = 0;
bdepassRight = true;
} else if (_local3 == "ForceLeft") {
_local4 = "R";
bdepassRight = false;
} else if (((_global.Perso.mcRef._x - DISTANCE_MAX) > mcRef._x) && (_local3 != "ForceRight")) {
_local4 = "R";
bdepassRight = false;
} else if ((_global.Perso.mcRef._x - _local5) < mcRef._x) {
_local4 = "L";
bdepassRight = false;
} else {
nWaitTime++;
if (nWaitTime > WAIT_TO_RESPASS) {
bdepassLeft = false;
bdepassRight = false;
}
}
if (sState == "surpris") {
if ((_local3 == "Left") || (_local3 == "ForceLeft")) {
_local4 = "R";
} else if ((_local3 == "Right") || (_local3 == "ForceRight")) {
_local4 = "L";
}
}
if (_local4 == "R") {
bRightPress = true;
} else {
bRightPress = false;
}
if (_local4 == "L") {
bLeftPress = true;
} else {
bLeftPress = false;
}
}
function checkWalk() {
if (sState != "surpris") {
var _local2 = RUN_VELOCITY;
} else {
var _local2 = SUR_VELOCITY;
}
if (bRightPress) {
if (nSpeed < 0) {
nSpeed = nSpeed + (4 * ACCELARATION);
}
if (nSpeed < _local2) {
nSpeed = nSpeed + ACCELARATION;
if (nSpeed > _local2) {
nSpeed = _local2;
}
}
if (sState == "Idle") {
setState("Run");
}
} else if (bLeftPress) {
if (nSpeed > 0) {
nSpeed = nSpeed - (4 * ACCELARATION);
}
if (nSpeed > (_local2 * -1)) {
nSpeed = nSpeed - ACCELARATION;
if (nSpeed < (_local2 * -1)) {
nSpeed = _local2 * -1;
}
}
if (sState == "Idle") {
setState("Run");
}
}
}
function adjustMove() {
if (bRightPress) {
mcRef._xscale = 100;
} else if (bLeftPress) {
mcRef._xscale = -100;
}
if ((!bRightPress) && (!bLeftPress)) {
if (nSpeed > 0) {
nSpeed = nSpeed - (4 * ACCELARATION);
if (nSpeed <= 0) {
setState("Idle");
nSpeed = 0;
}
} else if (nSpeed < 0) {
nSpeed = nSpeed + (4 * ACCELARATION);
if (nSpeed >= 0) {
setState("Idle");
nSpeed = 0;
}
}
}
if (!_global.oCollide.hitWall(this)) {
mcRef._x = mcRef._x + nSpeed;
}
}
var SUR_VELOCITY = 16;
var RUN_VELOCITY = 13;
var ACCELARATION = 1;
var ZONE_LEFT = 5200;
var ZONE_RIGHT = 13400;
var FORCE_LEFT = 4200;
var FORCE_RIGHT = 14800;
var DISTANCE_BETWEEN = 550;
var DISTANCE_SIDE = 400;
var PLAYER_HEIGHT = 230;
var DISTANCE_MAX = 700;
var WAIT_TO_RESPASS = 360;
}
Symbol 753 MovieClip [__Packages.oCamPan] Frame 0
class oCamPan extends MovieClip
{
var mcRef, Cible, MapWidth, DistanceX;
function oCamPan (__mcRef) {
super();
mcRef = __mcRef;
Cible = _global.Perso;
MapWidth = mcRef._width - 30;
}
function changeCible(NewCible) {
Cible = NewCible;
}
function getBoundCoord(__mcRef) {
var _local3 = new Object();
var _local2 = new Object();
_local2 = __mcRef.getBounds(_global.S);
_local3.x = (_local2.xMin + _local2.xMax) / 2;
return(_local3);
}
function moveFrame() {
var _local2 = new Object();
_local2 = getBoundCoord(Cible.mcRef.Hit);
DistanceX = _local2.x - (STAGE_WIDTH / 2);
if (Math.abs(DistanceX) > 3) {
checkLimitX(Math.round(DistanceX / PAN_RATE));
}
}
function checkLimitX(deplaceNum) {
if (deplaceNum < 0) {
if ((mcRef._x - deplaceNum) > 0) {
deplaceNum = mcRef._x;
}
} else if ((mcRef._x - deplaceNum) < ((MapWidth - STAGE_WIDTH) * -1)) {
deplaceNum = mcRef._x - ((MapWidth - STAGE_WIDTH) * -1);
}
mcRef._x = mcRef._x - deplaceNum;
Cible.mcRef._x = Cible.mcRef._x - deplaceNum;
mcRef._parent.mcOverBackGround._x = mcRef._parent.mcOverBackGround._x - deplaceNum;
mcRef._parent.Behind._x = mcRef._parent.Behind._x - (deplaceNum / 2);
mcRef._parent.Over._x = mcRef._parent.Over._x - (deplaceNum * 1.4);
mcRef._parent.mcSophie._x = mcRef._parent.mcSophie._x - deplaceNum;
_global.C.doBroadcastMess("ajustInfo", deplaceNum, 0);
}
var STAGE_WIDTH = 550;
var PAN_RATE = 5;
}
Symbol 754 MovieClip [__Packages.oMiniGame] Frame 0
class oMiniGame extends State
{
var selectEvent, setState, EventNo, bOver, bBonusComplete, mcRef, sSide, nPillarbreak, nMoneyPick, nBreakabreak, mcBreaked, mcBreakSelect, aPillar;
function oMiniGame (__mcRef) {
super(__mcRef);
selectEvent = "";
_global.C.fAddBroadcastObj(this);
setState("Idle");
EventNo = 0;
bOver = true;
}
function selectMiniGame() {
bBonusComplete = false;
checkProximity();
checkSelected();
setState("BonusEnter");
mcRef._parent.porteL._visible = false;
mcRef._parent.porteR._visible = false;
}
function doIdle() {
}
function doBonusEnter() {
if ((sSide == "l") && (_global.Perso.nStageX < (nLimitLeft - nZoneHelp))) {
EnterLevel();
}
if ((sSide == "r") && (_global.Perso.nStageX > (nLimitRight + nZoneHelp))) {
EnterLevel();
}
}
function dolMoney() {
moneyEvents();
}
function dorMoney() {
moneyEvents();
}
function dolPillar() {
pillarEvents();
}
function dorPillar() {
pillarEvents();
}
function dolClimb() {
climbEvents();
}
function dorClimb() {
climbEvents();
}
function dolFind() {
findEvents();
}
function dorFind() {
findEvents();
}
function checkProximity() {
var _local3 = _global.Perso.nStageX;
if (Math.abs(nLimitLeft - _local3) < Math.abs(nLimitRight - _local3)) {
sSide = "l";
_global.BonusArrow.setState("AppearLeft");
} else {
sSide = "r";
_global.BonusArrow.setState("AppearRight");
}
}
function checkSelected() {
selectEvent = aEvents[EventNo];
EventNo++;
}
function checkLeave() {
if ((sSide == "l") && (_global.Perso.nStageX > (nLimitLeft + nZoneHelp))) {
leaveLevel();
}
if ((sSide == "r") && (_global.Perso.nStageX < (nLimitRight - nZoneHelp))) {
leaveLevel();
}
}
function fPillar() {
nPillarbreak++;
}
function fMoney() {
nMoneyPick++;
}
function fBreakable(__Breaked) {
nBreakabreak++;
mcBreaked = __Breaked;
}
function moneyEvents() {
checkLeave();
if (!bOver) {
if (nMoneyPick == MONEY_ON_EVENT) {
WinEvents();
}
if (nBreakabreak > 0) {
failEvents();
}
}
}
function pillarEvents() {
checkLeave();
if (!bOver) {
if (nBreakabreak == PILLAR_STATUE) {
WinEvents();
}
if (nPillarbreak > 0) {
failEvents();
}
}
}
function climbEvents() {
checkLeave();
if (!bOver) {
if (nMoneyPick > 0) {
WinEvents();
}
}
}
function findEvents() {
checkLeave();
if (mcBreakSelect == undefined) {
ChangeBreakable();
}
if (!bOver) {
if (nBreakabreak > 0) {
if (mcBreaked.sLinkName == "_Vase2") {
WinEvents();
} else {
failEvents();
}
}
}
}
function WinEvents() {
_global.oPopup.setState("EventSucceed");
_global.BonusTimer.gotoAndStop("exit");
_global.GameTime.StartTime();
bOver = true;
_global.P.nBonusScore = _global.P.nBonusScore + 5000;
_global.GameTime.addTime(10);
var _local3 = "success";
_global.oSnd.playSnd(_local3, 70, 1);
if (sSide == "l") {
_global.Perso.mcRef._x = (nLimitLeft + mcRef._parent._x) + nZoneHelp;
} else {
_global.Perso.mcRef._x = (nLimitRight + mcRef._parent._x) - nZoneHelp;
}
_global.Perso.mcRef._y = 320;
}
function failEvents() {
if (bOver == false) {
_global.oPopup.setState("EventFailed");
_global.BonusTimer.gotoAndStop("exit");
_global.GameTime.StartTime();
_global.C.doBroadcast("RemoveMoney");
bOver = true;
var _local3 = "Fail";
_global.oSnd.playSnd(_local3, 70, 1);
if (sSide == "l") {
_global.Perso.mcRef._x = (nLimitLeft + mcRef._parent._x) + nZoneHelp;
} else {
_global.Perso.mcRef._x = (nLimitRight + mcRef._parent._x) - nZoneHelp;
}
_global.Perso.mcRef._y = 320;
}
}
function EnterLevel() {
_global.C.nBobblePresentLevel = 0;
_global.BonusTime.SetTimer(60);
_global.BonusTime.StopTime();
_global.BonusTimer.gotoAndStop("Comming");
aPillar = new Array();
setState(sSide + selectEvent);
_global.oCollide.InitStageArray(true);
_global.C.pause();
_global.oPopup.setState("bPopUpStart");
_global.Perso.nStageLevel++;
_global.C.reInitBreakedObject();
bOver = false;
nBreakabreak = 0;
nMoneyPick = 0;
nPillarbreak = 0;
_global.BonusArrow.setState("Idle");
}
function leaveLevel() {
if (!bOver) {
_global.oPopup.setState("EventFailed");
}
if (!bOver) {
_global.BonusTimer.gotoAndStop("exit");
}
if (!bOver) {
_global.GameTime.StartTime();
}
if (!bOver) {
var _local3 = "Fail";
}
if (!bOver) {
_global.oSnd.playSnd(_local3, 70, 1);
}
mcBreakSelect = undefined;
mcBreaked = undefined;
selectEvent = "";
sSide = undefined;
aPillar = new Array();
if (EventNo == 4) {
EventNo = 0;
}
setState("Idle");
_global.oCollide.aBonusStage = new Array();
mcRef._parent.porteL._visible = true;
mcRef._parent.porteR._visible = true;
}
function fBreakMG(_obj) {
aPillar.push(_obj);
}
function ChangeBreakable() {
var _local2 = random(aPillar.length);
mcBreakSelect = aPillar[_local2].mcRef;
aPillar[_local2].sLinkName = "_Vase2";
}
var MONEY_ON_EVENT = 6;
var PILLAR_STATUE = 6;
var SAME_KIND = 6;
var nLimitLeft = 3470;
var nLimitRight = 15720;
var nZoneHelp = 300;
var aEvents = ["Money", "Pillar", "Find", "Climb"];
}
Symbol 755 MovieClip [__Packages.oThrowing] Frame 0
class oThrowing
{
function oThrowing () {
}
function addGravity(__mcRef) {
var _local4 = false;
if ((__mcRef.nSpeed == 0) && (__mcRef.nChute == 0)) {
if ((!_global.oCollide.hitGround(__mcRef)) && (!__mcRef.bInitRotate)) {
adjustHeight(__mcRef);
__mcRef.bInitRotate = false;
} else if (__mcRef.ROTATE_UP) {
if ((__mcRef.mcRef.mcState._rotation != 0) || (__mcRef.nMoveMax > -1)) {
if (__mcRef.mcRef.mcState._rotation > 80) {
__mcRef.mcRef.mcState._rotation = 80;
} else if (__mcRef.mcRef.mcState._rotation < -80) {
__mcRef.mcRef.mcState._rotation = -80;
} else if (__mcRef.mcRef.mcState._rotation > 45) {
__mcRef.mcRef.mcState._rotation = __mcRef.mcRef.mcState._rotation - 15;
} else if (__mcRef.mcRef.mcState._rotation < -45) {
__mcRef.mcRef.mcState._rotation = __mcRef.mcRef.mcState._rotation + 15;
} else {
if (!__mcRef.bInitRotate) {
if (__mcRef.mcRef.mcState._rotation > 0) {
__mcRef.nDir = 1;
}
if (__mcRef.mcRef.mcState._rotation < 0) {
__mcRef.nDir = -1;
}
__mcRef.nMoveMax = random(5) + 5;
__mcRef.nMove = 0;
__mcRef.mcRef.mcState._rotation = 0;
__mcRef.mcRef._rotation = 0;
__mcRef.mcRefX = __mcRef.mcRef._x;
__mcRef.mcRefY = __mcRef.mcRef._y;
__mcRef.bInitRotate = true;
__mcRef.oInfo = _global.oCollide.getBoundCoord(__mcRef.mcRef, _global.S);
}
rotateStats(__mcRef);
}
} else {
__mcRef.nMoveMax = 0;
_local4 = true;
}
} else {
_local4 = true;
}
} else {
adjustMove(__mcRef);
adjustHeight(__mcRef);
}
return(_local4);
}
function adjustMove(__mcRef) {
if (__mcRef.nSpeed > 0) {
__mcRef.nSpeed = __mcRef.nSpeed * __mcRef.ACCELARATION;
if (__mcRef.nSpeed < __mcRef.ACCEL_STOP) {
__mcRef.nSpeed = 0;
}
} else if (__mcRef.nSpeed < 0) {
__mcRef.nSpeed = __mcRef.nSpeed * __mcRef.ACCELARATION;
if (__mcRef.nSpeed > (__mcRef.ACCEL_STOP * -1)) {
__mcRef.nSpeed = 0;
}
}
__mcRef.mcRef._x = __mcRef.mcRef._x + __mcRef.nSpeed;
if (_global.oCollide.hitWall(__mcRef)) {
__mcRef.nSpeed = __mcRef.nSpeed * -1;
__mcRef.mcRef._x = __mcRef.mcRef._x + __mcRef.nSpeed;
}
}
function adjustHeight(__mcRef) {
if (__mcRef.ROTATE) {
__mcRef.mcRef.mcState._rotation = __mcRef.mcRef.mcState._rotation + ((Math.abs(__mcRef.nSpeed) + 3) * 2);
}
if (__mcRef.nChute > 0) {
if (!_global.oCollide.hitGround(__mcRef)) {
__mcRef.nChute = __mcRef.nChute + __mcRef.GRAVITY;
__mcRef.mcRef._y = __mcRef.mcRef._y + __mcRef.nChute;
if (_global.oCollide.hitGround(__mcRef)) {
__mcRef.nChute = Math.round(__mcRef.nChute * (-__mcRef.REBOUNCE));
if (__mcRef.nChute > (__mcRef.BOUNCE_STOP * -1)) {
__mcRef.nChute = 0;
__mcRef.nSpeed = 0;
}
__mcRef.mcRef._y = __mcRef.mcRef._y + __mcRef.nChute;
}
} else {
__mcRef.nChute = 0;
__mcRef.nSpeed = 0;
}
} else {
__mcRef.nChute = __mcRef.nChute + __mcRef.GRAVITY;
__mcRef.mcRef._y = __mcRef.mcRef._y + __mcRef.nChute;
}
}
function rotateStats(__mcRef) {
if (__mcRef.nDir > 0) {
if (__mcRef.nMove < __mcRef.nMoveMax) {
__mcRef.nMove++;
} else {
__mcRef.nDir = -1;
__mcRef.nMoveMax--;
}
} else if (__mcRef.nMove > (__mcRef.nMoveMax * -1)) {
__mcRef.nMove--;
} else {
__mcRef.nDir = 1;
__mcRef.nMoveMax--;
}
if (__mcRef.nMoveMax < 0) {
__mcRef.bInitRotate = false;
__mcRef.mcRef._rotation = 0;
__mcRef.mcRef.mcState._rotation = 0;
} else {
__mcRef.mcRef._rotation = __mcRef.mcRef._rotation + (Math.abs(__mcRef.nMoveMax - Math.abs(__mcRef.nMove)) * __mcRef.nDir);
ajustXY(__mcRef);
}
}
function ajustXY(__mcRef) {
var _local2;
if (__mcRef.mcRef._rotation > 0) {
_local2 = 1;
} else {
_local2 = -1;
}
__mcRef.mcRef._x = __mcRef.mcRefX + (_local2 * ((__mcRef.REF_HEIGHT * Math.abs(__mcRef.mcRef._rotation)) / 90));
__mcRef.mcRef._y = __mcRef.mcRefY - ((__mcRef.REF_HEIGHT * Math.abs(__mcRef.mcRef._rotation)) / 90);
}
}
Symbol 756 MovieClip [__Packages.oPassage] Frame 0
class oPassage extends State
{
var oPassage1, oPassage2, oPassage3, bTested, bPass, setState, oPass1, oPass2, oPass3, timebPass, PassUse;
function oPassage (_passage1, _passage2, _passage3) {
super();
_global.C.fAddBroadcastObj(this);
oPassage1 = new Object();
oPassage2 = new Object();
oPassage3 = new Object();
oPassage1.mcRef = _passage1;
oPassage2.mcRef = _passage2;
oPassage3.mcRef = _passage3;
initPassage();
bTested = false;
bPass = false;
setState("Idle");
}
function initPassage() {
oPass1 = _global.oCollide.getBoundCoord(oPassage1.mcRef, _global.C.mcRef.mcBackGround);
oPass2 = _global.oCollide.getBoundCoord(oPassage2.mcRef, _global.C.mcRef.mcBackGround);
oPass3 = _global.oCollide.getBoundCoord(oPassage3.mcRef, _global.C.mcRef.mcBackGround);
oPassage1.HIT = oPassage1.mcRef.Hit;
oPassage1.HIT_SIDE = oPassage1.mcRef.Hit._width / 2;
oPassage1.HIT_UP = oPassage1.mcRef.Hit._height;
oPassage1.HIT_DOWN = oPassage1.mcRef.Hit._height;
oPassage2.HIT = oPassage2.mcRef.Hit;
oPassage2.HIT_SIDE = oPassage2.mcRef.Hit._width / 2;
oPassage2.HIT_UP = oPassage2.mcRef.Hit._height;
oPassage2.HIT_DOWN = oPassage2.mcRef.Hit._height;
oPassage3.HIT = oPassage3.mcRef.Hit;
oPassage3.HIT_SIDE = oPassage3.mcRef.Hit._width / 2;
oPassage3.HIT_UP = oPassage3.mcRef.Hit._height;
oPassage3.HIT_DOWN = oPassage3.mcRef.Hit._height;
}
function doIdle() {
checkToWakeNSleep();
checkOntoDoor();
if (bPass) {
timebPass++;
if (timebPass > timeBetween) {
bPass = false;
}
}
}
function checkToWakeNSleep() {
if (_global.oCollide.checkInScreen(oPass1)) {
if (!bTested) {
wakeUp(oPassage1);
}
} else if (_global.oCollide.checkInScreen(oPass2)) {
if (!bTested) {
wakeUp(oPassage2);
}
} else if (_global.oCollide.checkInScreen(oPass3)) {
if (!bTested) {
wakeUp(oPassage3);
}
} else {
bTested = false;
Sleep();
}
}
function checkOntoDoor() {
if ((PassUse.mcRef._currentframe == 2) && (!bPass)) {
if (_global.oCollide.hitElement(PassUse, _global.Perso) && (Key.isDown(32))) {
bPass = true;
timebPass = 0;
var _local3 = 0;
while (_local3 < 2) {
var _local4 = random(3) + 1;
if (PassUse == this["oPassage" + _local4]) {
_local3 = 0;
} else {
_local3 = 2;
_global.Perso.mcRef._x = this["oPass" + _local4].x;
}
_local3++;
}
}
}
}
function wakeUp(__PassUse) {
bTested = true;
PassUse = new Object();
PassUse = __PassUse;
if ((random(100) < CHANCE_OPEN) || (bPass)) {
oPassage1.mcRef.gotoAndStop(2);
oPassage2.mcRef.gotoAndStop(2);
oPassage3.mcRef.gotoAndStop(2);
}
}
function Sleep() {
if (oPassage1.mcRef._currentframe == 2) {
oPassage1.mcRef.gotoAndStop(1);
oPassage2.mcRef.gotoAndStop(1);
oPassage3.mcRef.gotoAndStop(1);
}
}
function ajustInfo(__numX) {
oPass1.x = oPass1.x - __numX;
oPass2.x = oPass2.x - __numX;
oPass3.x = oPass3.x - __numX;
}
var CHANCE_OPEN = 40;
var timeBetween = 40;
}
Symbol 757 MovieClip [__Packages.Timer] Frame 0
class Timer
{
var bActive, mcRef, nPass, nTime;
function Timer (P_mcRef) {
bActive = false;
mcRef = P_mcRef;
mcRef.onEnterFrame = mx.utils.Delegate.create(this, EnterFrame);
}
function EnterFrame() {
if (bActive) {
nPass++;
if (nPass == 30) {
nPass = 0;
if (nTime > 0) {
nTime--;
AjustTime();
if ((_global.GameTime.nTime < 10) && (_global.GameTime.bActive == true)) {
var _local3 = "Timer";
_global.oSnd.playSnd(_local3, 70, 1);
}
} else {
nTime = 0;
AjustTime();
bActive = false;
EndAction();
}
}
}
}
function SetTimer(P_Time) {
nTime = P_Time;
nPass = 0;
AjustTime();
}
function StopTime() {
bActive = false;
}
function StartTime() {
bActive = true;
}
function addTime(P_Time) {
nTime = nTime + P_Time;
AjustTime();
}
function AjustTime() {
var _local4 = Math.floor(nTime / 60);
var _local2 = nTime % 60;
if (_local2 < 10) {
var _local3 = "0" + String(_local2);
} else {
var _local3 = String(_local2);
}
mcRef.mcState.Timer_mc.time_txt.text = (_local4 + ":") + _local3;
}
function EndAction() {
}
}
Symbol 758 MovieClip [__Packages.oPillar] Frame 0
class oPillar extends oObstacle
{
var nMoveMax, nMove, nDir, mcRefOlder, mcRef, REF_HEIGHT, APPEAR_AT, checkToSleep, checkToWake, oLinkVase, setState, mcRefY, bMiniGame, bUpdatedCoord, sOldsState, mcRefX, sState, oInitialInfo, oInfo, mcRefRotate, mcRefFrame;
function oPillar (__mcRef, __link, __bMiniGame, __AppearAt) {
super(__mcRef, __link, "Idle", __bMiniGame);
nMoveMax = 0;
nMove = 0;
nDir = 1;
mcRefOlder = mcRef.mcState.VaseOlder;
REF_HEIGHT = mcRef._width / 2;
APPEAR_AT = __AppearAt;
}
function doIdle() {
checkToSleep();
checkCollide();
}
function doShake() {
RotateStats();
}
function doFall() {
FallStats();
}
function doSleep() {
if (APPEAR_AT <= _global.Perso.nStageLevel) {
checkToWake();
}
}
function checkCollide() {
if (_global.oCollide.hitElement(this, _global.Perso) && (Math.abs(_global.Perso.nSpeed) > (Math.abs(nMoveMax) * 2))) {
var _local3 = "pillar";
_global.oSnd.playSnd(_local3, 70, 1);
nMoveMax = Math.round(Math.abs(_global.Perso.nSpeed) / 2);
if (_global.Perso.nSpeed > 0) {
nDir = 1;
if ((oLinkVase.sState == "Idle") || (oLinkVase.sState == "Shake")) {
oLinkVase.nDir = -1;
}
} else {
nDir = -1;
if ((oLinkVase.sState == "Idle") || (oLinkVase.sState == "Shake")) {
oLinkVase.nDir = 1;
}
}
setState("Shake");
if ((oLinkVase.sState == "Idle") || (oLinkVase.sState == "Shake")) {
oLinkVase.nMoveMax = Math.round(Math.abs(_global.Perso.nSpeed) / 1.7);
}
if ((oLinkVase.sState == "Idle") || (oLinkVase.sState == "Shake")) {
oLinkVase.setState("Shake");
}
}
}
function RotateStats() {
if (nDir > 0) {
if (nMove < nMoveMax) {
nMove++;
} else {
nDir = -1;
nMoveMax--;
var _local3 = "pillar";
_global.oSnd.playSnd(_local3, 70, 1);
}
} else if (nMove > (nMoveMax * -1)) {
nMove--;
} else {
nDir = 1;
nMoveMax--;
var _local3 = "pillar";
_global.oSnd.playSnd(_local3, 70, 1);
}
if (nMoveMax < 0) {
mcRef._rotation = 0;
mcRef._y = mcRefY;
setState("Idle");
nMove = 0;
} else {
mcRef._rotation = mcRef._rotation + (Math.abs(nMoveMax - Math.abs(nMove)) * nDir);
ajustXY();
if ((mcRef._rotation > FALL_LIMIT) || (mcRef._rotation < (-FALL_LIMIT))) {
setState("Fall");
if (bMiniGame) {
_global.MiniGame.fPillar();
} else if (_global.P.nPlayerScore >= 500) {
_global.P.nPlayerScore = _global.P.nPlayerScore - 500;
_global.P.NegativeScoring(500);
}
if (mcRef._rotation > 0) {
oLinkVase.launch(-3, 6);
} else {
oLinkVase.launch(3, 6);
}
} else if ((mcRef._rotation > LAUNCH_LIMIT) || (mcRef._rotation < (-LAUNCH_LIMIT))) {
if (mcRef._rotation > 0) {
oLinkVase.launch(-3, 6);
} else {
oLinkVase.launch(3, 6);
}
}
}
}
function FallStats() {
nMoveMax++;
nMove = 0;
if (mcRef._rotation < -90) {
var _local3 = "pillarFall";
_global.oSnd.playSnd(_local3, 70, 1);
mcRef._rotation = -90;
nMoveMax = nMoveMax * (-PILLAR_BOUNCE);
if (Math.abs(nMoveMax) < 4) {
mcRef.gotoAndStop("Break");
bUpdatedCoord = false;
sOldsState = "Break";
setState("Break");
}
} else if (mcRef._rotation > 90) {
var _local3 = "pillarFall";
_global.oSnd.playSnd(_local3, 70, 1);
mcRef._rotation = 90;
nMoveMax = nMoveMax * (-PILLAR_BOUNCE);
if (Math.abs(nMoveMax) < 4) {
mcRef.gotoAndStop("Break");
bUpdatedCoord = false;
sOldsState = "Break";
setState("Break");
}
} else {
mcRef._rotation = mcRef._rotation + (nMoveMax * nDir);
ajustXY();
}
}
function ajustXY() {
var _local2;
if (mcRef._rotation > 0) {
_local2 = 1;
} else {
_local2 = -1;
}
mcRef._x = mcRefX + (_local2 * ((REF_HEIGHT * Math.abs(mcRef._rotation)) / 90));
mcRef._y = mcRefY - ((REF_HEIGHT * Math.abs(mcRef._rotation)) / 180);
}
function pasteSavedInfo() {
mcRefOlder = mcRef.VaseOlder;
}
function putBackPillar() {
if (sState == "Sleep") {
if ((sOldsState == "Break") && (!_global.oCollide.checkInScreen(oInitialInfo))) {
sOldsState = "Idle";
oInfo.x = oInitialInfo.x;
oInfo.y = oInitialInfo.y;
oInfo.nWidth = oInitialInfo.nWidth;
mcRefX = oInitialInfo.xStart;
mcRefY = oInitialInfo.yStart;
mcRefRotate = oInitialInfo.rotate;
mcRefFrame = oInitialInfo.frame;
}
}
}
var FALL_LIMIT = 26;
var LAUNCH_LIMIT = 14;
var HIT_SIDE = 15;
var HIT_UP = 180;
var HIT_DOWN = 0;
var PILLAR_BOUNCE = 0.3;
}
Symbol 759 MovieClip [__Packages.oBreakable] Frame 0
class oBreakable extends oObstacle
{
var oParent, nMoveMax, nMove, nDir, REF_HEIGHT, mcRef, bMiniGame, APPEAR_AT, checkToSleep, setState, checkToWake, bUpdatedCoord, ObjectRebound, sState, HIT, oSaveInfo, sOldsState, oInitialInfo, oInfo, mcRefX, mcRefY, mcRefRotate, mcRefFrame;
function oBreakable (__mcRef, __link, __oParent, __bMiniGame, __AppearAt) {
super(__mcRef, __link, "Idle", __bMiniGame);
oParent = __oParent;
oParent.oLinkVase = this;
nMoveMax = 0;
nMove = 0;
nDir = 1;
REF_HEIGHT = mcRef._width / 2;
if (bMiniGame) {
_global.MiniGame.fBreakMG(this);
}
APPEAR_AT = __AppearAt;
}
function doIdle() {
checkToSleep();
followPillar();
checkCollide();
}
function doFly() {
if (_global.Throw.addGravity(this)) {
setState("HitFloor");
}
checkCollide();
}
function doSleep() {
if (APPEAR_AT <= _global.Perso.nStageLevel) {
checkToWake();
}
}
function doHitFloor() {
if (bMiniGame) {
_global.MiniGame.fBreakable(this);
} else if (_global.P.nPlayerScore >= 500) {
_global.P.nPlayerScore = _global.P.nPlayerScore - 500;
_global.P.NegativeScoring(500);
}
var _local4 = "Buste";
_global.oSnd.playSnd(_local4, 70, 1);
mcRef.mcState._rotation = 0;
mcRef.gotoAndStop("Breaking");
bUpdatedCoord = false;
setState("Breaking");
ObjectRebound = new Object();
var _local3 = 1;
while (_local3 < (BREAKING_PEICE + 1)) {
ObjectRebound["piece" + _local3] = new Object();
ObjectRebound["piece" + _local3].mcRef = mcRef.mcState["piece" + _local3];
ObjectRebound["piece" + _local3].ACCELARATION = 0.97;
ObjectRebound["piece" + _local3].GRAVITY = 2;
ObjectRebound["piece" + _local3].REBOUNCE = 0.4;
ObjectRebound["piece" + _local3].BOUNCE_STOP = 4;
ObjectRebound["piece" + _local3].ACCEL_STOP = 2;
ObjectRebound["piece" + _local3].ROTATE = true;
ObjectRebound["piece" + _local3].ROTATE_UP = false;
ObjectRebound["piece" + _local3].HIT = mcRef.mcState["piece" + _local3];
ObjectRebound["piece" + _local3].nChute = Number(random(6) * -1) - 3;
ObjectRebound["piece" + _local3].nSpeed = Number(12 - random(24));
_local3++;
}
}
function doBreaking() {
var _local4 = true;
var _local3 = 1;
while (_local3 < (BREAKING_PEICE + 1)) {
if (!_global.Throw.addGravity(ObjectRebound["piece" + _local3])) {
_local4 = false;
}
_local3++;
}
if (_local4) {
setState("Break");
}
}
function doShake() {
RotateStats();
followPillar();
checkCollide();
}
function checkCollide() {
if (_global.oCollide.hitElement(this, _global.Perso) && (sState != "Fly")) {
var _local3 = _global.Perso.nSpeed;
var _local4 = _global.Perso.nChute * -1;
launch(_local3, _local4);
}
}
function launch(__nSpeed, __nChute) {
if ((sState == "Idle") || (sState == "Shake")) {
nSpeed = __nSpeed;
nChute = __nChute * -1;
HIT = mcRef.mcState;
setState("Fly");
}
}
function addInfoToSave() {
oSaveInfo = new Object();
var _local2 = 1;
while (_local2 < (BREAKING_PEICE + 1)) {
oSaveInfo["piece" + _local2] = new Object();
oSaveInfo["piece" + _local2].mc = ObjectRebound["piece" + _local2].mcRef;
oSaveInfo["piece" + _local2].x = ObjectRebound["piece" + _local2].mcRef._x;
oSaveInfo["piece" + _local2].y = ObjectRebound["piece" + _local2].mcRef._y;
oSaveInfo["piece" + _local2].rotate = ObjectRebound["piece" + _local2].mcRef.mcState._rotation;
_local2++;
}
}
function pasteSavedInfo() {
var _local2 = 1;
while (_local2 < (BREAKING_PEICE + 1)) {
oSaveInfo["piece" + _local2].mc._x = oSaveInfo["piece" + _local2].x;
oSaveInfo["piece" + _local2].mc._y = oSaveInfo["piece" + _local2].y;
oSaveInfo["piece" + _local2].mc.mcState._rotation = oSaveInfo["piece" + _local2].rotate;
_local2++;
}
}
function followPillar() {
mcRef._rotation = oParent.mcRef._rotation;
var _local4 = new Object();
var _local3 = new Object();
_local4 = getBoundCoord(mcRef.Hit, _global.S);
_local3 = getBoundCoord(oParent.mcRefOlder, _global.S);
mcRef._x = mcRef._x + (_local3.x - _local4.x);
mcRef._y = mcRef._y + (_local3.y - _local4.y);
}
function getBoundCoord(__mcRef, __mcToRef) {
var _local1 = new Object();
var _local2 = new Object();
_local2 = __mcRef.getBounds(__mcToRef);
_local1.x = (_local2.xMax + _local2.xMin) / 2;
_local1.y = _local2.yMax;
_local1.nWidth = __mcRef._width;
_local1.nHeight = __mcRef._height;
return(_local1);
}
function RotateStats() {
if (nDir > 0) {
if (nMove < nMoveMax) {
nMove++;
} else {
nDir = -1;
nMoveMax--;
}
} else if (nMove > (nMoveMax * -1)) {
nMove--;
} else {
nDir = 1;
nMoveMax--;
}
if (nMoveMax < 0) {
mcRef.mcState._rotation = 0;
setState("Idle");
nMove = 0;
} else {
mcRef.mcState._rotation = mcRef.mcState._rotation + (Math.abs(nMoveMax - Math.abs(nMove)) * nDir);
}
}
function putBackBreakable() {
if (sState == "Sleep") {
if (((sOldsState == "Break") && (oParent.sOldsState == "Idle")) && (!_global.oCollide.checkInScreen(oInitialInfo))) {
sOldsState = "Idle";
oInfo.x = oInitialInfo.x;
oInfo.y = oInitialInfo.y;
oInfo.nWidth = oInitialInfo.nWidth;
mcRefX = oInitialInfo.xStart;
mcRefY = oInitialInfo.yStart;
mcRefRotate = oInitialInfo.rotate;
mcRefFrame = oInitialInfo.frame;
}
}
}
var nChute = 0;
var nSpeed = 0;
var FALL_LIMIT = 1;
var ACCELARATION = 0.97;
var GRAVITY = 1.5;
var REBOUNCE = 0;
var BOUNCE_STOP = 2;
var ACCEL_STOP = 1;
var ROTATE = true;
var ROTATE_UP = false;
var BREAKING_PEICE = 8;
var HIT_SIDE = 15;
var HIT_UP = 45;
var HIT_DOWN = 0;
}
Symbol 760 MovieClip [__Packages.oDoggy] Frame 0
class oDoggy extends oObstacle
{
var bCanComeOut, nStartX, mcRef, nStartY, APPEAR_AT, checkToSleep, checkToWake, setState, nDistance, wakeUp, sOldsState;
function oDoggy (__mcRef, __link, __bMiniGame, __AppearAt) {
super(__mcRef, __link, "Out", __bMiniGame);
bCanComeOut = true;
nStartX = mcRef._x;
nStartY = mcRef._y;
APPEAR_AT = __AppearAt;
}
function doIdle() {
checkToSleep();
checkCollide();
}
function doSleep() {
if (APPEAR_AT <= _global.Perso.nStageLevel) {
checkToWake();
checkDistance();
}
}
function doComeOut() {
if (checkEndOfAnim()) {
setState("Idle");
}
}
function doOut() {
checkToSleep();
checkDistance();
}
function checkDistance() {
var _local5;
var _local3;
nDistance = Math.abs(_global.Perso.nSpeed) * (OUT_FRAME + 2);
_local3 = Math.abs(_global.Perso.nStageX - nStartX);
if ((_local3 < nDistance) && (bCanComeOut == true)) {
bCanComeOut = false;
if ((Math.random() * 100) < APPEAR_RATE) {
wakeUp();
var _local4 = _global.C.fReturnDepth("_DogOut");
mcRef.swapDepths(_local4);
setState("ComeOut");
}
} else if (_local3 > DISTANCE_RETRY) {
if (!bCanComeOut) {
bCanComeOut = true;
}
}
}
function checkEndOfAnim() {
var _local2 = false;
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
_local2 = true;
}
return(_local2);
}
function checkCollide() {
if (_global.oCollide.hitElement(this, _global.Perso)) {
_global.Perso.Hurt();
}
}
function putToSleep() {
sOldsState = "Out";
setState("Sleep");
_global.C.fRemoveInstance(mcRef);
}
var DISTANCE_RETRY = 350;
var OUT_FRAME = 20;
var APPEAR_RATE = 40;
var HIT_SIDE = 20;
var HIT_UP = 50;
var HIT_DOWN = 0;
}
Symbol 761 MovieClip [__Packages.oMoney] Frame 0
class oMoney extends oObstacle
{
var checkToSleep, setState, mcRef, bMiniGame;
function oMoney (__mcRef, __link, __bMiniGame) {
super(__mcRef, __link, "Idle", __bMiniGame);
}
function doIdle() {
checkToSleep();
checkCollide();
}
function doTake() {
if (checkEndOfAnim()) {
pick();
}
}
function checkCollide() {
if (_global.oCollide.hitElement(this, _global.Perso)) {
var _local3 = "Mooney" + Number(random(3) + 1);
_global.oSnd.playSnd(_local3, 70, 1);
setState("Take");
}
}
function checkEndOfAnim() {
var _local2 = false;
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
_local2 = true;
}
return(_local2);
}
function pick() {
if (bMiniGame) {
_global.MiniGame.fMoney();
} else {
_global.P.nPlayerScore = _global.P.nPlayerScore + 500;
_global.P.PositiveScoring(500);
}
_global.C.fRemoveInstance(mcRef);
_global.C.fRemoveBroadcastObj(this);
_global.C.fRemoveObject(this);
}
function RemoveMoney() {
if (bMiniGame) {
_global.C.fRemoveInstance(mcRef);
_global.C.fRemoveBroadcastObj(this);
_global.C.fRemoveObject(this);
}
}
var HIT_SIDE = 10;
var HIT_UP = 10;
var HIT_DOWN = 0;
}
Symbol 41 MovieClip Frame 1
stop();
Symbol 41 MovieClip Frame 2
gotoAndStop (1);
Symbol 60 MovieClip Frame 1
stop();
var l_aSndArray = new Array("packMusic", "gameMusic", "Mooney1", "Mooney2", "Mooney3", "Jump1", "Jump2", "Stumble1", "Stumble2", "Bobble1", "Bobble2", "Buste", "Sophie", "pillarFall", "pillar", "Timer", "Rollover", "Click", "Fail", "TransOut", "success", "TransIn");
Symbol 79 Button
on (release) {
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
_global.oPopup.returnToGame();
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Symbol 83 Button
on (release) {
_global.oPopup.nextPage(this);
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Symbol 93 Button
on (release) {
_global.oPopup.prevPage(this);
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Symbol 189 MovieClip Frame 1
stop();
Symbol 195 Button
on (release) {
_global.oPopup.closeMenu();
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Symbol 199 Button
on (release) {
_global.Muted = true;
gotoAndStop (2);
}
Symbol 202 Button
on (release) {
_global.Muted = false;
gotoAndStop (1);
}
Symbol 203 MovieClip Frame 1
stop();
Symbol 206 Button
on (release) {
_global.oSnd.ToMute();
gotoAndStop (2);
}
Symbol 208 Button
on (release) {
_global.oSnd.UnMute();
gotoAndStop (1);
}
Symbol 209 MovieClip Frame 1
stop();
Symbol 212 Button
on (release) {
_global.oPopup.quitGame();
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Symbol 215 Button
on (release) {
_global.P.getHelp();
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Instance of Symbol 203 MovieClip in Symbol 216 MovieClip Frame 1
onClipEvent (load) {
if (_global.Muted) {
gotoAndStop (2);
} else {
stop();
}
}
Instance of Symbol 209 MovieClip in Symbol 216 MovieClip Frame 1
onClipEvent (load) {
if (_global.MuseMuted) {
gotoAndStop (2);
} else {
stop();
}
}
Symbol 222 Button
on (release) {
_global.P.quitGame();
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Symbol 227 Button
on (release) {
_global.oPopup.returnToGame();
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Symbol 256 MovieClip Frame 1
stop();
Symbol 256 MovieClip Frame 10
Instance of Symbol 191 MovieClip "mcState" in Symbol 256 MovieClip Frame 80
onClipEvent (load) {
timer = 0;
waitTo = 20;
}
onClipEvent (enterFrame) {
timer++;
}
onClipEvent (keyDown) {
if (timer > 20) {
_global.oPopup.returnToBonus();
}
}
Symbol 295 Button
on (release) {
_global.P.getHelp();
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Symbol 296 Button
on (release) {
_global.oTransition.setTransition("Game");
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Symbol 308 MovieClip Frame 1
this._visible = false;
Symbol 321 MovieClip [_Vase] Frame 1
stop();
Symbol 333 MovieClip [_Bobble] Frame 1
stop();
Symbol 335 MovieClip [_Dog] Frame 1
stop();
Symbol 342 MovieClip [_Vase2] Frame 1
stop();
Symbol 349 MovieClip Frame 41
delete _parent.oControl;
removeMovieClip(_parent);
Symbol 350 MovieClip [_MoinsMoney] Frame 1
var oControl = new dynamicObj(this);
Symbol 355 MovieClip Frame 41
delete _parent.oControl;
removeMovieClip(_parent);
Symbol 356 MovieClip [_PlusMoney] Frame 1
var oControl = new dynamicObj(this);
Symbol 361 MovieClip Frame 41
delete _parent.oControl;
removeMovieClip(_parent);
Symbol 362 MovieClip [_PlusTime] Frame 1
var oControl = new dynamicObj(this);
Symbol 363 MovieClip Frame 1
_global.C.fRemoveInstance(this);
Instance of Symbol 304 MovieClip [_TableB] in Symbol 363 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 309 MovieClip [_Pillar] in Symbol 363 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 321 MovieClip [_Vase] in Symbol 363 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 342 MovieClip [_Vase2] in Symbol 363 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 367 MovieClip Frame 3
_global.oCollide.addGround(this);
stop();
Symbol 368 MovieClip Frame 1
var Table = new oObstacle(this, "_TableS", "Idle");
Symbol 372 MovieClip Frame 1
var Pillar = new oPillar(this, "_Pillar", false, appearAt);
NumberShown.removeMovieClip();
Instance of Symbol 309 MovieClip [_Pillar] "mcState" in Symbol 372 MovieClip Frame 1
/* no clip actions */
Symbol 412 MovieClip Frame 1
stop();
Symbol 413 MovieClip Frame 1
var Bobble = new oBobbleHead(this, "_Bobble", 0, 0, "Idle", RemoveAt);
Symbol 414 MovieClip Frame 1
var Table = new oObstacle(this, "_TableB", "Idle");
Symbol 415 MovieClip Frame 1
var Pillar = new oPillar(this, "_Pillar", false, appearAt);
_parent.attachMovie("_Vase", "obj" + this._name, _parent.getNextHighestDepth());
var Vase = new oBreakable(_parent["obj" + this._name], "_Vase", Pillar, false, appearAt);
VaseShown.removeMovieClip();
NumberShown.removeMovieClip();
Instance of Symbol 309 MovieClip [_Pillar] "mcState" in Symbol 415 MovieClip Frame 1
/* no clip actions */
Symbol 420 MovieClip Frame 1
var Doggy = new oDoggy(this, "_Dog", false, appearAt);
Instance of Symbol 419 MovieClip in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 421 MovieClip Frame 1
var Table = new oObstacle(this, "_TableM2", "Idle");
Symbol 422 MovieClip Frame 1
var Table = new oObstacle(this, "_TableVS", "Idle");
Symbol 423 MovieClip Frame 1
var Money = new oMoney(this, "_money", false);
mcMoney.swapDepths(_global.C.fReturnDepth("Remove"));
mcMoney.removeMovieClip();
Symbol 429 MovieClip Frame 1
stop();
Symbol 451 MovieClip Frame 1
stop();
Symbol 452 MovieClip Frame 3
_global.oCollide.addWall(this);
stop();
Symbol 456 MovieClip Frame 1
var Pillar = new oPillar(this, "_Pillar", true, 1);
_parent.attachMovie("_Vase", "obj" + this._name, _parent.getNextHighestDepth());
var Vase = new oBreakable(_parent["obj" + this._name], "_Vase", Pillar, true, 1);
VaseShown.removeMovieClip();
NumberShown.removeMovieClip();
Instance of Symbol 309 MovieClip [_Pillar] "mcState" in Symbol 456 MovieClip Frame 1
/* no clip actions */
Symbol 457 MovieClip Frame 1
var Table = new oObstacle(this, "_TableM", "Idle", true);
Symbol 458 MovieClip Frame 1
var Table = new oObstacle(this, "_TableS", "Idle", true);
Symbol 460 MovieClip Frame 1
var Money = new oMoney(this, "_money", true, 1);
mcMoney.swapDepths(_global.C.fReturnDepth("Remove"));
mcMoney.removeMovieClip();
Symbol 461 MovieClip Frame 1
var Table = new oObstacle(this, "_TableB", "Idle", true);
Instance of Symbol 372 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 1;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 1200;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 9;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 2;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 4;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 10;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 7;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 6;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 5;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 1;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 1;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 1;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 2;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 3;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 4;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 9;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 4;
}
Instance of Symbol 420 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 1;
}
Instance of Symbol 420 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 1;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 14;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 3;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 9;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 10;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 11;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 2;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 3;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 2;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 4;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 4;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 10;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 3;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 6;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 14;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 2;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 1;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 2;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 7;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 10;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 3;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 5;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 14;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 3;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 1;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 5;
}
Instance of Symbol 413 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
RemoveAt = 3;
}
Instance of Symbol 420 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 3;
}
Instance of Symbol 420 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 1;
}
Instance of Symbol 420 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 1;
}
Instance of Symbol 420 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 1;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 6;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 6;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 6;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 7;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 11;
}
Instance of Symbol 415 MovieClip in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
appearAt = 6;
}
Symbol 478 MovieClip Frame 4
stop();
Symbol 507 MovieClip Frame 39
stop();
Symbol 530 MovieClip Frame 22
stop();
Instance of Symbol 463 MovieClip "mcBackGround" in Symbol 619 MovieClip Frame 1
/* no clip actions */
Symbol 629 MovieClip Frame 15
_parent.gotoAndStop("in");
Symbol 630 MovieClip Frame 15
_parent.gotoAndStop("Idle");
Symbol 631 MovieClip Frame 1
stop();
Symbol 638 Button
on (release) {
_global.P.getMenu();
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Instance of Symbol 631 MovieClip "mcBonusTimer" in Symbol 648 MovieClip Frame 1
onClipEvent (load) {
var oControl = new dynamicObj(this);
}
Instance of Symbol 644 MovieClip in Symbol 648 MovieClip Frame 1
onClipEvent (load) {
var oControl = new dynamicObj(this);
}
Symbol 665 MovieClip Frame 1
stop();
Symbol 672 MovieClip Frame 68
_parent.oControl.setState("Idle");
Symbol 678 Button
on (release) {
_global.P.playAgain();
_global.oSnd.playSnd("sFx_btnDown", 100, 1);
}
on (rollOver) {
_global.oSnd.playSnd("sFx_btnOver", 100, 1);
}
Symbol 704 MovieClip Frame 20
stop();
Symbol 705 Button
on (release) {
accept = _global.P.AddTimeBonus(15, 80000);
if (accept) {
gotoAndStop (2);
}
}
Symbol 708 MovieClip Frame 1
stop();
Symbol 714 MovieClip Frame 20
stop();
Symbol 715 Button
on (release) {
accept = _global.P.AddTimeBonus(30, 200000);
if (accept) {
gotoAndStop (2);
_parent.chrono1mc.gotoAndStop(2);
}
}
Symbol 716 MovieClip Frame 1
stop();
Symbol 722 MovieClip Frame 20
stop();
Symbol 723 Button
on (release) {
accept = _global.P.AddTimeBonus(45, 500000);
if (accept) {
gotoAndStop (2);
_parent.chrono1mc.gotoAndStop(2);
_parent.chrono2mc.gotoAndStop(2);
}
}
Symbol 724 MovieClip Frame 1
stop();
Symbol 731 MovieClip Frame 1
stop();