Frame 1
stop();
Instance of Symbol 31 MovieClip "ControlHS" in Frame 1
onClipEvent (load) {
function getScores() {
if (G_TestHighScore == true) {
}
if (gProxyObj == undefined) {
if (G_TestHighScore == true) {
}
listScores();
} else {
if (G_TestHighScore == true) {
}
gProxyObj.getScores(cbFunc2);
}
}
function submitScore(theScore) {
if (G_TestHighScore == true) {
}
gProxyObj.submitScore(theScore, cbFunc);
}
function initHiScores() {
if (G_TestHighScore == true) {
}
gProxyObj.setGame_Id("sb_squarepantis");
}
function getScoreString() {
var _local7 = "Oops! The high scores list is not available right now!";
if (gProxyObj != undefined) {
var _local6 = gProxyObj.getScoreCount();
if (_local6 > 0) {
var _local2;
var _local3;
var _local4;
var _local5;
_local7 = "";
strNumber = "";
strName = "";
strScore = "";
_local2 = 0;
while (_local2 < _local6) {
_local3 = gProxyObj.getScoreItem(_local2);
_local4 = _local3[0];
_local5 = fStyleNumber(_local3[1]);
strNumber = strNumber + ((_local2 + 1) + newline);
strName = strName + (_local4 + newline);
strScore = strScore + ((_local5 + " pts") + newline);
_local2++;
}
_parent.mcState.mcState.mcState.mcPanel.txt_highScoreNumber.text = strNumber;
_parent.mcState.mcState.mcState.mcPanel.txt_highScoreName.text = strName;
_parent.mcState.mcState.mcState.mcPanel.txt_highScoreScore.text = strScore;
} else {
_parent.mcState.mcState.mcState.mcPanel.txt_highScoreName.text = "Whoops, the high scores seem to have escaped!";
}
} else {
_parent.mcState.mcState.mcState.mcPanel.txt_highScoreName.text = "Oops! The high scores list is not available right now!";
}
if (G_TestHighScore == true) {
}
return(_local7);
}
function listScores() {
if (G_TestHighScore == true) {
}
getScoreString();
}
function setText() {
if (G_TestHighScore == true) {
}
}
function cbFunc(thisBool) {
if (thisBool) {
if (G_TestHighScore == true) {
}
listScores();
} else {
if (G_TestHighScore == true) {
}
_parent.mcMain.txt_highScoreName.text = "Oops! The high scores list is not available right now!";
}
}
function cbFunc2(thisBool) {
if (thisBool) {
if (G_TestHighScore == true) {
}
listScores();
} else {
if (G_TestHighScore == true) {
}
_parent.mcMain.txt_highScoreName.text = "Oops! The high scores list is not available right now!";
}
}
function fStyleNumber(_nNumber, _nMinimumChar) {
_sNumber = String(_nNumber);
_sNewString = "";
_nlength = _sNumber.length;
_nlength = _nlength / 3;
if (_nlength <= 1) {
_sNewNumber = _sNumber;
if (_sNewNumber.length < _nMinimumChar) {
_sNewNumber = "0" + _sNewNumber;
}
return(_sNewNumber);
}
_nLoop = _nlength;
while (_nLoop > 1) {
_sNewString = (" " + _sNumber.substr(-3)) + _sNewString;
_sNumber = _sNumber.substr(0, -3);
_nLoop--;
}
_sNewNumber = _sNumber + _sNewString;
if (_sNewNumber.length < _nMinimumChar) {
_sNewNumber = "0" + _sNewNumber;
}
return(_sNewNumber);
}
_global.HS = this;
var G_ShowHighScore = true;
var G_TestHighScore = false;
if (G_TestHighScore == true) {
gProxyObj.setServer("www.nick.com");
gProxyObj.setScreenName("Simon");
gProxyObj.setIsLoggedIn(true);
}
}
Instance of Symbol 34 MovieClip "ControlLoad" in Frame 1
onClipEvent (enterFrame) {
if (_parent.getBytesLoaded() == _parent.getBytesTotal()) {
_parent.gotoAndStop("Init");
}
}
Frame 10
new Main(this);
Symbol 28 Button
on (keyPress "<Left>") {
return(undefined);
}
on (keyPress "<Right>") {
return(undefined);
}
on (keyPress "<Up>") {
return(undefined);
}
on (keyPress "<Down>") {
return(undefined);
}
Symbol 71 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 1
BtnInvisible.useHandCursor = false;
Symbol 83 MovieClip Frame 400
stop();
Symbol 184 MovieClip Frame 1
_visible = false;
Symbol 186 MovieClip Frame 1
stop();
Symbol 207 MovieClip Frame 40
stop();
Symbol 302 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().__get__Maze().addTrack(true, this);
_visible = false;
}
Symbol 304 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().__get__Maze().addTrack(false, this);
_visible = false;
}
Symbol 306 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().addDirtWall(this);
}
Symbol 307 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().addPowerUp(CTRLGame.nPOWERUP_BONUS_POINTS, this);
}
Symbol 309 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().addJellyFish(this);
}
Symbol 310 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().addPowerUp(CTRLGame.nPOWERUP_FALSE_NOTE, this);
}
Symbol 314 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().addPowerUp(CTRLGame.nPOWERUP_GOOD_NOTE, this);
}
Symbol 316 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().addActionWall(CTRLGame.nREVOLVER_WALL, this, 100);
}
Symbol 322 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().addAlgae(this);
}
Symbol 355 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().addActionWall(CTRLGame.nSLIDE_WALL_H, this, 100);
}
Symbol 359 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().addActionWall(CTRLGame.nTURN_WALL, this, -100);
}
Symbol 363 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().addActionWall(CTRLGame.nTURN_WALL_INVERSE, this, -100);
}
Symbol 368 MovieClip Frame 1
if (Main.getRef().getSection() == Main.GAME_SECTION) {
CTRLGame.getRef().addActionWall(CTRLGame.nSLIDE_WALL_V, this, 100);
}
Symbol 410 MovieClip Frame 1
_visible = false;
Symbol 442 MovieClip [SB_ASP_IceBall] Frame 1
stop();
Symbol 503 MovieClip Frame 1
this.swapDepths(8888);
this.removeMovieClip();
Symbol 1125 MovieClip [__Packages.CTRLGame] Frame 0
class CTRLGame
{
static var oRef;
var mcRef, nScore, nCurrentLevel, oGenerator, oAtlantisBus, oCenterScreen, aWalls, aDirtWalls, aJellys, aAlguaes, nNbPushBusSandyLeft, nSongsNumber, aItems;
function CTRLGame (_mcRef, _nScore, _nLevel) {
mcRef = _mcRef;
oRef = this;
nScore = _nScore;
nCurrentLevel = _nLevel;
initLevel();
}
function cleanUp() {
oGenerator.cleanUp();
oAtlantisBus.cleanUp();
oCenterScreen.cleanUp();
for (var i in aWalls) {
aWalls[i].cleanUp();
}
for (var i in aDirtWalls) {
for (var j in aDirtWalls[i]) {
aDirtWalls[i][j].cleanUp();
}
}
for (var i in aJellys) {
aJellys[i].cleanUp();
}
for (var i in aAlguaes) {
for (var j in aAlguaes[i]) {
aAlguaes[i][j].cleanUp();
}
}
delete oGenerator;
delete oAtlantisBus;
delete oCenterScreen;
}
function addObjectViaDummy(_mcDummy) {
var _local3 = new Object();
_local3.x = 0;
_local3.y = 0;
_local3.x = _mcDummy._x;
_local3.y = _mcDummy._y;
_mcDummy._parent.localToGlobal(_local3);
_mcDummy.swapDepths(nDUMMY_DEPTH);
_mcDummy.removeMovieClip();
return(_local3);
}
function countdownPushBusGames() {
if (nNbPushBusSandyLeft > 0) {
nNbPushBusSandyLeft--;
}
}
function modifyTime(_nNewValue) {
nSongsNumber = _nNewValue;
}
function blockEvents() {
mcRef.mcCache._y = 0;
mcRef.mcShadow._visible = true;
}
function unBlockEvents() {
mcRef.mcCache._y = nOUT_POS_BTN_CACHE;
mcRef.mcShadow._visible = false;
}
function addToScore(_nNumber) {
nScore = nScore + _nNumber;
Main.getRef().updateScoreField();
}
function substractToScore(_nNumber) {
nScore = nScore - _nNumber;
Main.getRef().updateScoreField();
}
function calculateDepth(_nY, _nAdd) {
var _local4 = ((Math.round(_nY) * nDEPTH_FACTOR) + _nAdd) + nMIN_DEPTH;
return(_local4);
}
function stopAnimElements() {
for (var i in aDirtWalls) {
for (var j in aDirtWalls[i]) {
aDirtWalls[i][j].doPause();
}
}
for (var i in aJellys) {
aJellys[i].doPause();
}
for (var i in aAlguaes) {
for (var j in aAlguaes[i]) {
aAlguaes[i][j].doPause();
}
}
oAtlantisBus.doPause();
}
function resumeAnimElements() {
for (var i in aDirtWalls) {
for (var j in aDirtWalls[i]) {
aDirtWalls[i][j].resumeAnim();
}
}
for (var i in aJellys) {
aJellys[i].resumeAnim();
}
for (var i in aAlguaes) {
for (var j in aAlguaes[i]) {
aAlguaes[i][j].resumeAnim();
}
}
oAtlantisBus.resumeAnim();
}
function addPowerUp(_nType, _mcItem) {
var _local4 = new Object();
_local4.mcRef = _mcItem;
_mcItem._xscale = _mcItem._parent._parent._xscale;
_local4.nType = _nType;
var _local5 = oGenerator.getTabIndexByName(_mcItem._parent._parent._name);
aItems[_local5].push(_local4);
}
function addDirtWall(_mcDummy) {
var _local3 = oGenerator.getTabIndexByName(_mcDummy._parent._parent._name);
var _local4 = addObjectViaDummy(_mcDummy);
aDirtWalls[_local3].push(new DirtWall(_local4.x, _local4.y));
}
function addJellyFish(_mcDummy) {
var _local3 = addObjectViaDummy(_mcDummy);
aJellys.push(new RoamingJellyFish(_local3.x, _local3.y));
}
function addAlgae(_mcDummy) {
var _local3 = oGenerator.getTabIndexByName(_mcDummy._parent._parent._name);
var _local4 = addObjectViaDummy(_mcDummy);
aAlguaes[_local3].push(new Algae(_local4.x, _local4.y));
}
function addActionWall(_nType, _mcDummy, _xScl) {
var _local5 = addObjectViaDummy(_mcDummy);
aWalls.push(new ActionWall(_nType, _local5.x, _local5.y, _xScl));
}
function checkPowerUps() {
var _local2 = oAtlantisBus.mcRef;
var _local3 = oGenerator.getTabIndex(_local2._x, _local2._y);
var _local4 = aItems[_local3];
for (var i in _local4) {
if (_local4[i].mcRef.hitTest(_local2._x, _local2._y, true)) {
activatePowerUp(_local4[i].nType, _local4[i].mcRef);
delete _local4[i];
_local4.splice(Number(i), 1);
break;
}
}
}
function checkDirtWalls() {
var _local2 = oAtlantisBus.mcRef;
var _local3 = oGenerator.getTabIndex(_local2._x, _local2._y);
var _local4 = aDirtWalls[_local3];
for (var i in _local4) {
if (_local4[i].mcRef.mcHit.hitTest(_local2.mcHit)) {
oCenterScreen.startBreakTheWall(_local4[i]);
_local4.splice(Number(i), 1);
break;
}
}
}
function checkJellys() {
var _local2 = oAtlantisBus.mcRef;
for (var i in aJellys) {
if (aJellys[i].mcRef.mcHit.hitTest(_local2._x, _local2._y, true)) {
aJellys[i].stopRoaming();
oCenterScreen.startJellyFishSwarm(aJellys[i]);
aJellys.splice(Number(i), 1);
break;
}
}
}
function checkAlgaes() {
var _local2 = oAtlantisBus.mcRef;
var _local3 = oGenerator.getTabIndex(_local2._x, _local2._y);
var _local4 = aAlguaes[_local3];
for (var i in aAlguaes) {
if (_local4[i].mcRef.mcHit.hitTest(_local2._x, _local2._y, true)) {
_local4[i].catchBus();
var _local5 = true;
if (nNbPushBusSandyLeft <= 0) {
_local5 = false;
}
oCenterScreen.startPushTheBus(_local4[i], _local5);
_local4.splice(Number(i), 1);
break;
}
}
}
function checkFinish() {
var _local2 = oAtlantisBus.mcRef;
if (mcRef.mcStart.piece.mcFinish.hitTest(oAtlantisBus.mcRef._x, oAtlantisBus.mcRef._y, true) && (!Main.getRef().Finished)) {
Main.getRef().winGame();
}
}
function isOkayToTurn(_mcHit) {
var _local3 = true;
if (_mcHit.hitTest(oAtlantisBus.mcRef._x, oAtlantisBus.mcRef._y, true) || (_mcHit.hitTest(oAtlantisBus.getMiCasePos().x, oAtlantisBus.getMiCasePos().y, true))) {
_local3 = false;
}
if (_local3) {
for (var i in aJellys) {
if (_mcHit.hitTest(aJellys[i].mcRef._x, aJellys[i].mcRef._y, true) || (_mcHit.hitTest(aJellys[i].getMiCasePos().x, aJellys[i].getMiCasePos().y, true))) {
_local3 = false;
break;
}
}
}
return(_local3);
}
function isOkayToTurnRevolver(_mcHit, _mcHitMore) {
var _local4 = true;
if (_mcHit.hitTest(oAtlantisBus.mcRef._x, oAtlantisBus.mcRef._y, true) || (_mcHit.hitTest(oAtlantisBus.getMiCasePos().x, oAtlantisBus.getMiCasePos().y, true) || (_mcHitMore.hitTest(oAtlantisBus.mcRef._x, oAtlantisBus.mcRef._y, true) || (_mcHitMore.hitTest(oAtlantisBus.getMiCasePos().x, oAtlantisBus.getMiCasePos().y, true))))) {
_local4 = false;
}
if (_local4) {
for (var i in aJellys) {
if (_mcHit.hitTest(aJellys[i].mcRef._x, aJellys[i].mcRef._y, true) || (_mcHit.hitTest(aJellys[i].getMiCasePos().x, aJellys[i].getMiCasePos().y, true) || (_mcHitMore.hitTest(aJellys[i].mcRef._x, aJellys[i].mcRef._y, true) || (_mcHitMore.hitTest(aJellys[i].getMiCasePos().x, aJellys[i].getMiCasePos().y, true))))) {
_local4 = false;
break;
}
}
}
return(_local4);
}
function isTouchingWall(_nFutureX, _nFutureY) {
var _local4 = false;
for (var i in aWalls) {
var _local5 = aWalls[i];
if (_local5.Type == nREVOLVER_WALL) {
if (_local5.Ref.mcHit.hitTest(_nFutureX, _nFutureY, true) || (_local5.Ref.mcHitMore.hitTest(_nFutureX, _nFutureY, true))) {
_local4 = true;
break;
}
} else if (_local5.Ref.mcHit.hitTest(_nFutureX, _nFutureY, true)) {
_local4 = true;
break;
}
}
return(_local4);
}
function isJellyTouchingDirtWall(_nFutureX, _nFutureY) {
var _local4 = false;
var _local5 = oGenerator.getTabIndex(_nFutureX, _nFutureY);
var _local6 = aDirtWalls[_local5];
for (var i in _local6) {
if (_local6[i].mcRef.mcHit.hitTest(_nFutureX, _nFutureY, true)) {
_local4 = true;
break;
}
}
return(_local4);
}
function isJellyTouchingAlguae(_nFutureX, _nFutureY) {
var _local4 = false;
var _local5 = oGenerator.getTabIndex(_nFutureX, _nFutureY);
var _local6 = aAlguaes[_local5];
for (var i in _local6) {
if (_local6[i].mcRef.mcHit.hitTest(_nFutureX, _nFutureY, true)) {
_local4 = true;
break;
}
}
return(_local4);
}
function isJellyTouchingJelly(_nFutureX, _nFutureY, _oJelly) {
var _local5 = false;
for (var i in aJellys) {
if (aJellys[i] != _oJelly) {
if (aJellys[i].mcRef.mcHit.hitTest(_nFutureX, _nFutureY, true)) {
_local5 = true;
break;
}
}
}
return(_local5);
}
function __get__Screen() {
return(oCenterScreen);
}
function __get__Bus() {
return(oAtlantisBus);
}
function __get__Maze() {
return(oGenerator);
}
function __get__Songs() {
return(nSongsNumber);
}
function __get__Level() {
return(nCurrentLevel);
}
function __get__Score() {
return(nScore);
}
static function getRef() {
return(oRef);
}
function activatePowerUp(_nType, _mcPowerUp) {
switch (_nType) {
case nPOWERUP_BONUS_POINTS :
Controller.getRef().getSounds().playSound("GoodPowerUp_Collect", Controller.nSFX_VOLUME, 1);
addToScore(LD.nBONUSPOINTS);
_mcPowerUp.swapDepths(7777);
_mcPowerUp.removeMovieClip();
break;
case nPOWERUP_FALSE_NOTE :
Controller.getRef().getSounds().playSound("BadPowerUp_Collect", Controller.nSFX_VOLUME, 1);
getRef().Screen.getInterface().setToLife(LD.nFALSE_NOTE_VALUE);
_mcPowerUp.swapDepths(7777);
_mcPowerUp.removeMovieClip();
break;
case nPOWERUP_GOOD_NOTE :
Controller.getRef().getSounds().playSound("GoodPowerUp_Collect", Controller.nSFX_VOLUME, 1);
getRef().Screen.getInterface().setToLife(LD.nGOOD_NOTE_VALUE);
_mcPowerUp.swapDepths(7777);
_mcPowerUp.removeMovieClip();
}
}
function winGame() {
getRef().Screen.getInterface().pauseTime();
Main.getRef().winGame();
}
function loseGame() {
getRef().Screen.getInterface().pauseTime();
Main.getRef().loseGame();
}
function initLevel() {
aItems = [[], [], [], [], [], [], [], [], [], []];
aWalls = new Array();
aAlguaes = [[], [], [], [], [], [], [], [], [], []];
aDirtWalls = [[], [], [], [], [], [], [], [], [], []];
aJellys = new Array();
nNbPushBusSandyLeft = LD.nNB_PUSHBUS_WITH_SANDY;
nSongsNumber = LD.getSongsMax(nCurrentLevel);
oGenerator = new MazeGenerator(mcRef);
oCenterScreen = new CenterScreen(mcRef.mcCenter);
oGenerator.generate();
oAtlantisBus = new AtlantisBus();
}
//_local1.addProperty("Screen", _local1.__get__Screen, function () {
});
//_local1.addProperty("Level", _local1.__get__Level, function () {
});
//_local1.addProperty("Songs", _local1.__get__Songs, function () {
});
//_local1.addProperty("Score", _local1.__get__Score, function () {
});
//_local1.addProperty("Maze", _local1.__get__Maze, function () {
});
//_local1.addProperty("Bus", _local1.__get__Bus, function () {
});
//ASSetPropFlags(_local1, null, 1);
static var nOUT_POS_BTN_CACHE = -400;
static var nPOWERUP_BONUS_POINTS = 0;
static var nPOWERUP_GOOD_NOTE = 1;
static var nPOWERUP_FALSE_NOTE = 2;
static var nTURN_WALL = 0;
static var nTURN_WALL_INVERSE = 1;
static var nSLIDE_WALL_H = 2;
static var nSLIDE_WALL_V = 3;
static var nREVOLVER_WALL = 4;
static var nDIR_LEFT = 0;
static var nDIR_UP = 1;
static var nDIR_RIGHT = 2;
static var nDIR_DOWN = 3;
static var nLEVEL1 = 1;
static var nLEVEL2 = 2;
static var nDUMMY_DEPTH = 999999;
static var nMIN_DEPTH = 100012;
static var nDEPTH_FACTOR = 100;
static var nDIRT_WALL_ADD = 1;
static var nMOVING_WALL_ADD = 25;
static var nALGAE_ADD = 50;
static var nBUS_ADD = 76;
static var nJELLYFISH_ADD = 100;
static var nNB_THROW_SOUNDS = 5;
}
Symbol 1126 MovieClip [__Packages.MazeGenerator] Frame 0
class MazeGenerator
{
var mcContainer, aVLines, aHLines, nDepth, mcPieceSE, mcPieceC1, mcPieceT1, mcPieceT2, mcPieceC2, mcPieceRJ, mcPieceC3, mcPieceB1, mcPieceB2, mcPieceC4;
function MazeGenerator (_mcContainer) {
mcContainer = _mcContainer;
aVLines = [[], [], [], [], [], [], [], [], [], []];
aHLines = [[], [], [], [], [], [], [], [], [], []];
nDepth = 0;
}
function addTrack(_bVertical, _mcLine) {
var _local4 = getTabIndexByName(_mcLine._parent._parent._name);
if (_bVertical) {
aVLines[_local4].push(_mcLine);
} else {
aHLines[_local4].push(_mcLine);
}
}
function getTabIndexByName(_nName) {
var _local3 = 0;
switch (_nName) {
case sNAME_SE :
_local3 = nINDEX_SE;
break;
case sNAME_RJ :
_local3 = nINDEX_RJ;
break;
case sNAME_C1 :
_local3 = nINDEX_C1;
break;
case sNAME_C2 :
_local3 = nINDEX_C2;
break;
case sNAME_C3 :
_local3 = nINDEX_C3;
break;
case sNAME_C4 :
_local3 = nINDEX_C4;
break;
case sNAME_B1 :
_local3 = nINDEX_B1;
break;
case sNAME_B2 :
_local3 = nINDEX_B2;
break;
case sNAME_T1 :
_local3 = nINDEX_T1;
break;
case sNAME_T2 :
_local3 = nINDEX_T2;
}
return(_local3);
}
function getTabIndex(_nX, _nY) {
var _local4 = 0;
if ((_nX >= nFIRST_X) && (_nX < nSECOND_X)) {
if ((_nY >= nFIRST_Y) && (_nY < nSECOND_Y)) {
_local4 = nINDEX_C1;
} else if ((_nY >= nSECOND_Y) && (_nY < nTHIRD_Y)) {
_local4 = nINDEX_SE;
} else {
_local4 = nINDEX_C3;
}
} else if ((_nX >= nSECOND_X) && (_nX < nTHIRD_X)) {
if ((_nY >= nFIRST_Y) && (_nY < nSECOND_Y)) {
_local4 = nINDEX_T1;
} else {
_local4 = nINDEX_B1;
}
} else if ((_nX >= nTHIRD_X) && (_nX < nFOURTH_X)) {
if ((_nY >= nFIRST_Y) && (_nY < nSECOND_Y)) {
_local4 = nINDEX_T2;
} else {
_local4 = nINDEX_B2;
}
} else if ((_nY >= nFIRST_Y) && (_nY < nSECOND_Y)) {
_local4 = nINDEX_C2;
} else if ((_nY >= nSECOND_Y) && (_nY < nTHIRD_Y)) {
_local4 = nINDEX_RJ;
} else {
_local4 = nINDEX_C4;
}
return(_local4);
}
function generate() {
generateStart();
generateLaterals();
generateCorners();
generateRightJct();
}
function cleanUp() {
mcPieceSE.removeMovieClip();
mcPieceC1.removeMovieClip();
mcPieceT1.removeMovieClip();
mcPieceT2.removeMovieClip();
mcPieceC2.removeMovieClip();
mcPieceRJ.removeMovieClip();
mcPieceC3.removeMovieClip();
mcPieceB1.removeMovieClip();
mcPieceB2.removeMovieClip();
mcPieceC4.removeMovieClip();
mcContainer.mcPanelStart.removeMovieClip();
mcContainer.mcPanelFinish.removeMovieClip();
}
function isPieceFlipped(_nIndex) {
var _local3 = false;
if ((_nIndex == nINDEX_B1) && (mcPieceB1._xscale == -100)) {
_local3 = true;
} else if ((_nIndex == nINDEX_B2) && (mcPieceB2._xscale == -100)) {
_local3 = true;
} else if ((_nIndex == nINDEX_C1) && (mcPieceC1._xscale == -100)) {
_local3 = true;
} else if ((_nIndex == nINDEX_C2) && (mcPieceC2._xscale == -100)) {
_local3 = true;
} else if ((_nIndex == nINDEX_C3) && (mcPieceC3._xscale == -100)) {
_local3 = true;
} else if ((_nIndex == nINDEX_C4) && (mcPieceC4._xscale == -100)) {
_local3 = true;
} else if ((_nIndex == nINDEX_RJ) && (mcPieceRJ._xscale == -100)) {
_local3 = true;
} else if ((_nIndex == nINDEX_SE) && (mcPieceSE._xscale == -100)) {
_local3 = true;
} else if ((_nIndex == nINDEX_T1) && (mcPieceT1._xscale == -100)) {
_local3 = true;
} else if ((_nIndex == nINDEX_T2) && (mcPieceT2._xscale == -100)) {
_local3 = true;
}
return(_local3);
}
function generateStart() {
var _local2 = 0;
if (CTRLGame.getRef().Level == CTRLGame.nLEVEL1) {
_local2 = Math.round(Math.random() * 1);
} else if (nUSED_SE_PIECE == 0) {
_local2 = 1;
} else {
_local2 = 0;
}
mcPieceSE = mcContainer.attachMovie(sLINKAGENAME_START, sNAME_SE, nDepth++);
mcPieceSE.gotoAndStop(_local2 + 1);
mcPieceSE._x = nLEFT_X;
mcPieceSE._y = nMIDDLE_Y;
nUSED_SE_PIECE = _local2;
var _local3 = CTRLGame.getRef().addObjectViaDummy(mcPieceSE.piece.mcPanelStart);
var _local4 = mcContainer.attachMovie(sLINKAGE_PANEL_START, "mcPanelStart", 1000000);
_local4._x = _local3.x;
_local4._y = _local3.y;
_local4._xscale = nPANEL_X_SCALE;
_local4._yscale = nPANEL_Y_SCALE;
_local3 = CTRLGame.getRef().addObjectViaDummy(mcPieceSE.piece.mcPanelFinish);
var _local5 = mcContainer.attachMovie(sLINKAGE_PANEL_FINISH, "mcPanelFinish", 1000001);
_local5._x = _local3.x;
_local5._y = _local3.y;
_local5._xscale = nPANEL_X_SCALE;
_local5._yscale = nPANEL_Y_SCALE;
if (CTRLGame.getRef().Level == CTRLGame.nLEVEL1) {
_local4.gotoAndStop(sSTATE_START);
_local5.gotoAndStop(sSTATE_MIDWAY);
} else {
_local4.gotoAndStop(sSTATE_MIDWAY);
_local5.gotoAndStop(sSTATE_FINISH);
}
}
function generateLaterals() {
var _local2 = [1, 2, 3, 4];
var _local3 = 0;
var _local4 = false;
_local3 = Math.round(Math.random() * (_local2.length - 1));
mcPieceT1 = mcContainer.attachMovie(sLINKAGENAME_LATERAL, sNAME_T1, nDepth++);
mcPieceT1.gotoAndStop(_local2[_local3]);
_local4 = Math.round(Math.random());
if (_local4) {
flipPiece(mcPieceT1);
}
mcPieceT1._x = nMIDDLE_LX;
mcPieceT1._y = nUPPER_Y;
_local2.splice(_local3, 1);
_local3 = Math.round(Math.random() * (_local2.length - 1));
mcPieceT2 = mcContainer.attachMovie(sLINKAGENAME_LATERAL, sNAME_T2, nDepth++);
mcPieceT2.gotoAndStop(_local2[_local3]);
_local4 = Math.round(Math.random());
if (_local4) {
flipPiece(mcPieceT2);
}
mcPieceT2._x = nMIDDLE_RX;
mcPieceT2._y = nUPPER_Y;
_local2.splice(_local3, 1);
_local3 = Math.round(Math.random() * (_local2.length - 1));
mcPieceB1 = mcContainer.attachMovie(sLINKAGENAME_LATERAL, sNAME_B1, nDepth++);
mcPieceB1.gotoAndStop(_local2[_local3]);
_local4 = Math.round(Math.random());
if (_local4) {
flipPiece(mcPieceB1);
}
mcPieceB1._x = nMIDDLE_LX;
mcPieceB1._y = nLOWER_Y;
_local2.splice(_local3, 1);
mcPieceB2 = mcContainer.attachMovie(sLINKAGENAME_LATERAL, sNAME_B2, nDepth++);
mcPieceB2.gotoAndStop(_local2[0]);
_local4 = Math.round(Math.random());
if (_local4) {
flipPiece(mcPieceB2);
}
mcPieceB2._x = nMIDDLE_RX;
mcPieceB2._y = nLOWER_Y;
}
function generateCorners() {
var _local2 = [1, 2];
var _local3 = [1, 2];
var _local4 = 0;
_local4 = Math.round(Math.random() * (_local2.length - 1));
mcPieceC1 = mcContainer.attachMovie(sLINKAGENAME_CORNER_UP, sNAME_C1, nDepth++);
mcPieceC1.gotoAndStop(_local2[_local4]);
mcPieceC1._x = nLEFT_X;
mcPieceC1._y = nUPPER_Y;
_local2.splice(_local4, 1);
mcPieceC2 = mcContainer.attachMovie(sLINKAGENAME_CORNER_UP, sNAME_C2, nDepth++);
mcPieceC2.gotoAndStop(_local2[0]);
mcPieceC2._x = nRIGHT_X;
mcPieceC2._y = nUPPER_Y;
flipPiece(mcPieceC2);
_local4 = Math.round(Math.random() * (_local3.length - 1));
mcPieceC3 = mcContainer.attachMovie(sLINKAGENAME_CORNER_DOWN, sNAME_C3, nDepth++);
mcPieceC3.gotoAndStop(_local3[_local4]);
mcPieceC3._x = nLEFT_X;
mcPieceC3._y = nLOWER_Y;
_local3.splice(_local4, 1);
_local4 = Math.round(Math.random() * (_local3.length - 1));
mcPieceC4 = mcContainer.attachMovie(sLINKAGENAME_CORNER_DOWN, sNAME_C4, nDepth++);
mcPieceC4.gotoAndStop(_local3[0]);
mcPieceC4._x = nRIGHT_X;
mcPieceC4._y = nLOWER_Y;
flipPiece(mcPieceC4);
}
function generateRightJct() {
var _local2 = 0;
if (CTRLGame.getRef().Level == CTRLGame.nLEVEL1) {
_local2 = Math.round(Math.random() * 1);
} else if (nUSED_RJ_PIECE == 0) {
_local2 = 1;
} else {
_local2 = 0;
}
var _local3 = Math.round(Math.random());
mcPieceRJ = mcContainer.attachMovie(sLINKAGENAME_RIGHTJCT, sNAME_RJ, nDepth++);
mcPieceRJ.gotoAndStop(_local2 + 1);
if (_local3) {
flipPiece(mcPieceRJ);
}
mcPieceRJ._x = nRIGHT_X;
mcPieceRJ._y = nMIDDLE_Y;
nUSED_RJ_PIECE = _local2;
}
function flipPiece(_mcPiece) {
_mcPiece._xscale = -100;
}
function getVTracks(_nX, _nY) {
var _local4 = getTabIndex(_nX, _nY);
return(aVLines[_local4]);
}
function getHTracks(_nX, _nY) {
var _local4 = getTabIndex(_nX, _nY);
return(aHLines[_local4]);
}
//ASSetPropFlags(_local1, null, 1);
static var sLINKAGENAME_CORNER_UP = "mcPieceCornerUp";
static var sLINKAGENAME_CORNER_DOWN = "mcPieceCornerDown";
static var sLINKAGENAME_START = "mcPieceStart";
static var sLINKAGENAME_LATERAL = "mcPieceLateral";
static var sLINKAGENAME_RIGHTJCT = "mcPieceRightJct";
static var sLINKAGE_PANEL_START = "SB_Panneau_Start";
static var sLINKAGE_PANEL_FINISH = "SB_Panneau_Finish";
static var nUPPER_Y = 60;
static var nMIDDLE_Y = 200;
static var nLOWER_Y = 340;
static var nLEFT_X = 70;
static var nMIDDLE_LX = 220;
static var nMIDDLE_RX = 380;
static var nRIGHT_X = 530;
static var nFIRST_X = -100;
static var nSECOND_X = 140;
static var nTHIRD_X = 300;
static var nFOURTH_X = 460;
static var nFIRST_Y = 0;
static var nSECOND_Y = 120;
static var nTHIRD_Y = 280;
static var sNAME_SE = "mcStart";
static var sNAME_C1 = "mcCornerUpLeft";
static var sNAME_T1 = "mcLateralTopLeft";
static var sNAME_T2 = "mcLateralTopRight";
static var sNAME_C2 = "mcCornerUpRight";
static var sNAME_RJ = "mcRightJct";
static var sNAME_C3 = "mcCornerDownLeft";
static var sNAME_B1 = "mcLateralBottomLeft";
static var sNAME_B2 = "mcLateralBottomRight";
static var sNAME_C4 = "mcCornerDownRight";
static var nINDEX_SE = 0;
static var nINDEX_C1 = 1;
static var nINDEX_T1 = 2;
static var nINDEX_T2 = 3;
static var nINDEX_C2 = 4;
static var nINDEX_RJ = 5;
static var nINDEX_C3 = 6;
static var nINDEX_B1 = 7;
static var nINDEX_B2 = 8;
static var nINDEX_C4 = 9;
static var nUSED_SE_PIECE = 0;
static var nUSED_RJ_PIECE = 0;
static var sSTATE_START = "Start";
static var sSTATE_MIDWAY = "Midway";
static var sSTATE_FINISH = "Finish";
static var nSTART_PANEL_DEPTH = 1000000;
static var nFINISH_PANEL_DEPTH = 1000001;
static var nPANEL_X_SCALE = 151.2;
static var nPANEL_Y_SCALE = 130.6;
}
Symbol 1127 MovieClip [__Packages.State] Frame 0
class State
{
var mcRef, sState;
function State (_mcRef, _bNormal) {
mcRef = _mcRef;
sState = "";
if (_bNormal == false) {
if (MainBroadcaster.Instance == null) {
var _local4 = new MainBroadcaster();
}
MainBroadcaster.Instance.doAddListener(this);
} else {
if (Broadcaster.Instance == null) {
var _local5 = new Broadcaster();
}
Broadcaster.Instance.doAddListener(this);
}
}
function cleanUp() {
Broadcaster.Instance.doRemoveListener(this);
}
function doAction() {
this[sState]();
}
function setState(_sState) {
if (sState != _sState) {
sState = _sState;
mcRef.gotoAndStop(_sState);
}
}
function doPause() {
mcRef.mcState.stop();
}
function doUnPause() {
mcRef.mcState.play();
}
function stateFinished() {
var _local2 = false;
if (mcRef.mcState._currentframe >= mcRef.mcState._totalframes) {
_local2 = true;
}
return(_local2);
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 1128 MovieClip [__Packages.MainBroadcaster] Frame 0
class MainBroadcaster
{
var oBroadcaster;
function MainBroadcaster () {
oRef = this;
oBroadcaster = new Object();
AsBroadcaster.initialize(oBroadcaster);
}
static function __get__Instance() {
return(oRef);
}
function doAddListener(listenerObj) {
oBroadcaster.addListener(listenerObj);
}
function doAction() {
oBroadcaster.broadcastMessage(DO_ACTION_EVENT);
}
//(_global.MainBroadcaster /* register */).addProperty("Instance", (_global.MainBroadcaster /* register */).__get__Instance, function () {
});
//ASSetPropFlags(_local1, null, 1);
static var PAUSE_EVENT = "doPause";
static var UNPAUSE_EVENT = "doUnPause";
static var DO_ACTION_EVENT = "doAction";
static var oRef = null;
}
Symbol 1129 MovieClip [__Packages.Broadcaster] Frame 0
class Broadcaster
{
var oBroadcaster;
function Broadcaster () {
oRef = this;
oBroadcaster = new Object();
AsBroadcaster.initialize(oBroadcaster);
}
function flushBroadcaster() {
for (var i in oBroadcaster._listeners) {
oBroadcaster.removeListener(oBroadcaster._listeners[i]);
}
}
static function __get__Instance() {
return(oRef);
}
function doAddListener(listenerObj) {
oBroadcaster.addListener(listenerObj);
}
function doRemoveListener(listenerObj) {
oBroadcaster.removeListener(listenerObj);
}
function doPause() {
if (Controller.getRef().isPaused()) {
oBroadcaster.broadcastMessage(PAUSE_EVENT);
}
}
function doUnPause() {
if (!Controller.getRef().isPaused()) {
oBroadcaster.broadcastMessage(UNPAUSE_EVENT);
}
}
function doAction() {
oBroadcaster.broadcastMessage(DO_ACTION_EVENT);
}
//(_global.Broadcaster /* register */).addProperty("Instance", (_global.Broadcaster /* register */).__get__Instance, function () {
});
//ASSetPropFlags(_local1, null, 1);
static var PAUSE_EVENT = "doPause";
static var UNPAUSE_EVENT = "doUnPause";
static var DO_ACTION_EVENT = "doAction";
static var oRef = null;
}
Symbol 1130 MovieClip [__Packages.Controller] Frame 0
class Controller
{
var bPause, oTransition, oMenu, oInstructions, oStartPop, oCheatPop, oTransitionLevel, oSounds;
function Controller (_mcTimeline) {
bPause = false;
oRef = this;
oTransition = new Transition(_mcTimeline.mcTransition);
oMenu = new Menu(_mcTimeline.mcMenu);
oInstructions = new Instructions(_mcTimeline.mcInstructions);
oStartPop = new StartPopUp(_mcTimeline.mcStartPop);
oCheatPop = new CheatPopUp(_mcTimeline.mcCodePop);
oTransitionLevel = new TransitionLevel(_mcTimeline.mcTransitionLevel);
oSounds = new Sounds(_mcTimeline);
}
function pauseGame() {
bPause = true;
CTRLGame.getRef().blockEvents();
Broadcaster.Instance.doPause();
}
function unPauseGame() {
bPause = false;
CTRLGame.getRef().unBlockEvents();
Broadcaster.Instance.doUnPause();
}
function isPaused() {
return(bPause);
}
function isSoundsMuted() {
return(oSounds.isSoundsMuted());
}
function muteSounds() {
oSounds.DoMuteSounds();
}
function unMuteSounds() {
oSounds.UndoMuteSounds();
}
function isMusicMuted() {
return(oSounds.isMusicMuted());
}
function muteMusic() {
oSounds.DoMuteMusic();
}
function unMuteMusic() {
oSounds.UndoMuteMusic();
}
function goTo(_sGoingTo, _classToMove) {
oTransition.goTo(_sGoingTo, _classToMove);
}
function goToNewLevel(_nFrameSongs) {
oTransitionLevel.goToNewLevel(_nFrameSongs);
}
function resetForNewGame() {
bPause = false;
}
function playRollOverSound() {
oSounds.playSound("Button_rollover", nSFX_VOLUME, 1);
}
function playClickSound() {
oSounds.playSound("Button_click", nSFX_VOLUME, 1);
}
function introComplete() {
if (Main.getRef().getSection() == Main.PACKAGING_SECTION) {
oSounds.playSound(PACKAGING_MUSIC_NAME, nMUSIC_VOLUME, 999999);
}
}
function playMusicLoop(_sSectionToPlay) {
if (_sSectionToPlay == Main.PACKAGING_SECTION) {
oSounds.startFadeOut(GAME_MUSIC_NAME);
oSounds.startFadeIn(PACKAGING_INTRO_MUSIC_NAME, nMUSIC_VOLUME, 1);
} else if (_sSectionToPlay == Main.GAME_SECTION) {
oSounds.startFadeOut(PACKAGING_INTRO_MUSIC_NAME);
oSounds.startFadeOut(PACKAGING_MUSIC_NAME);
oSounds.startFadeIn(GAME_MUSIC_NAME, nMUSIC_VOLUME, 999999);
}
}
static function getRef() {
return(oRef);
}
function getInstructions() {
return(oInstructions);
}
function getSounds() {
return(oSounds);
}
function getMenu() {
return(oMenu);
}
function getStartPop() {
return(oStartPop);
}
function getCheatPop() {
return(oCheatPop);
}
//ASSetPropFlags(_local1, null, 1);
static var PACKAGING_INTRO_MUSIC_NAME = "packaging_intro";
static var PACKAGING_MUSIC_NAME = "packaging_loop";
static var GAME_MUSIC_NAME = "in_game";
static var nSFX_VOLUME = 60;
static var nMUSIC_VOLUME = 60;
static var oRef = null;
}
Symbol 1131 MovieClip [__Packages.PopUp] Frame 0
#initclip
if (!PopUp) {
//(_global.PopUp = function (_mcRef) {
super(_mcRef, false);
this.setState(PopUp.sSTATE_IDLE);
}) extends State
var _local1 = (_global.PopUp /* register */).prototype;
_local1.doShow = function () {
if (this.sState == PopUp.sSTATE_IDLE) {
this.setState(PopUp.sSTATE_OPENING);
}
};
_local1.doInstantShow = function () {
if (this.sState == PopUp.sSTATE_IDLE) {
this.setState(PopUp.sSTATE_OPENED);
this.initPopUp();
}
};
_local1.doHide = function () {
if (this.sState == PopUp.sSTATE_OPENED) {
this.setState(PopUp.sSTATE_CLOSING);
}
};
_local1.doInstantHide = function () {
if (this.sState == PopUp.sSTATE_OPENED) {
this.setState(PopUp.sSTATE_IDLE);
}
};
_local1.initPopUp = function () {
};
_local1.Idle = function () {
};
_local1.Opening = function () {
if (this.stateFinished()) {
this.setState(PopUp.sSTATE_OPENED);
this.initPopUp();
}
};
_local1.Opened = function () {
};
_local1.Closing = function () {
if (this.stateFinished()) {
this.setState(PopUp.sSTATE_IDLE);
}
};
ASSetPropFlags(_local1, null, 1);
(_global.PopUp /* register */).sSTATE_IDLE = "Idle";
(_global.PopUp /* register */).sSTATE_OPENING = "Opening";
(_global.PopUp /* register */).sSTATE_OPENED = "Opened";
(_global.PopUp /* register */).sSTATE_CLOSING = "Closing";
}
#endinitclip
Symbol 1132 MovieClip [__Packages.Menu] Frame 0
#initclip
if (!Menu) {
//(_global.Menu = function (_mcRef) {
super(_mcRef);
}) extends PopUp
var _local1 = (_global.Menu /* register */).prototype;
_local1.doShow = function () {
if (this.sState == PopUp.sSTATE_IDLE) {
this.setState(PopUp.sSTATE_OPENING);
Controller.getRef().getSounds().playSound("Menu_In", Controller.nSFX_VOLUME, 1);
this.updateSoundButton();
this.updateMusicButton();
Controller.getRef().pauseGame();
}
};
_local1.doHide = function () {
if (this.sState == PopUp.sSTATE_OPENED) {
this.setState(PopUp.sSTATE_CLOSING);
Controller.getRef().getSounds().playSound("Menu_Out", Controller.nSFX_VOLUME, 1);
this.updateSoundButton();
this.updateMusicButton();
Controller.getRef().unPauseGame();
}
};
_local1.clickSoundButton = function () {
Controller.getRef().playClickSound();
if (Controller.getRef().isSoundsMuted()) {
Controller.getRef().unMuteSounds();
} else {
Controller.getRef().muteSounds();
}
this.updateSoundButton();
};
_local1.clickMusicButton = function () {
Controller.getRef().playClickSound();
if (Controller.getRef().isMusicMuted()) {
Controller.getRef().unMuteMusic();
} else {
Controller.getRef().muteMusic();
}
this.updateMusicButton();
};
_local1.resume = function () {
Controller.getRef().playClickSound();
this.doHide();
};
_local1.updateSoundButton = function () {
if (Controller.getRef().isSoundsMuted()) {
this.mcRef.mcState.mcPanel.mcSound.gotoAndStop(Menu.sSOUND_STATE_OFF);
} else {
this.mcRef.mcState.mcPanel.mcSound.gotoAndStop(Menu.sSOUND_STATE_ON);
}
this.mcRef.mcState.mcPanel.mcSound.btnSound.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.mcSound.btnSound.onRelease = Delegate.create(this, this.clickSoundButton);
};
_local1.updateMusicButton = function () {
if (Controller.getRef().isMusicMuted()) {
this.mcRef.mcState.mcPanel.mcMusic.gotoAndStop(Menu.sMUSIC_STATE_OFF);
} else {
this.mcRef.mcState.mcPanel.mcMusic.gotoAndStop(Menu.sMUSIC_STATE_ON);
}
this.mcRef.mcState.mcPanel.mcMusic.btnMusic.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.mcMusic.btnMusic.onRelease = Delegate.create(this, this.clickMusicButton);
};
_local1.gotoQuitMenu = function () {
Controller.getRef().playClickSound();
this.showQuitMenu();
};
_local1.gotoOptionsMenu = function () {
Controller.getRef().playClickSound();
this.showOptionsMenu();
};
_local1.showOptionsMenu = function () {
this.mcRef.mcState.gotoAndStop(Menu.sMENU_OPTIONS);
this.updateSoundButton();
this.updateMusicButton();
this.mcRef.mcState.mcPanel.btnResume.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnResume.onRelease = Delegate.create(this, this.resume);
this.mcRef.mcState.mcPanel.btnHowToPlay.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnHowToPlay.onRelease = Delegate.create(Main.getRef(), Main.getRef().clickInstructionsButton);
this.mcRef.mcState.mcPanel.btnQuit.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnQuit.onRelease = Delegate.create(this, this.gotoQuitMenu);
};
_local1.showQuitMenu = function () {
Controller.getRef().playClickSound();
this.mcRef.mcState.gotoAndStop(Menu.sMENU_QUIT);
this.mcRef.mcState.mcPanel.btnYes.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnNo.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnYes.onRelease = Delegate.create(Main.getRef(), Main.getRef().clickQuitButton);
this.mcRef.mcState.mcPanel.btnNo.onRelease = Delegate.create(this, this.gotoOptionsMenu);
};
_local1.Opening = function () {
if (this.stateFinished()) {
this.setState(PopUp.sSTATE_OPENED);
this.showOptionsMenu();
}
};
_local1.Opened = function () {
};
_local1.Closing = function () {
if (this.stateFinished()) {
this.setState(PopUp.sSTATE_IDLE);
}
};
ASSetPropFlags(_local1, null, 1);
(_global.Menu /* register */).sSOUND_STATE_ON = "SoundOn";
(_global.Menu /* register */).sSOUND_STATE_OFF = "SoundOff";
(_global.Menu /* register */).sMUSIC_STATE_ON = "MusicOn";
(_global.Menu /* register */).sMUSIC_STATE_OFF = "MusicOff";
(_global.Menu /* register */).sMENU_OPTIONS = "Options";
(_global.Menu /* register */).sMENU_QUIT = "Quit";
}
#endinitclip
Symbol 1133 MovieClip [__Packages.Delegate] Frame 0
#initclip
if (!Delegate) {
//(_global.Delegate = function () {
super();
}) extends Object
var _local1 = (_global.Delegate /* register */).prototype;
_local1.DelegateArgs = function (f) {
this.func = f;
};
(_global.Delegate /* register */).create = function (obj, func) {
var _local3 = function () {
var _local2 = arguments.callee.target;
func = arguments.callee.func;
var _local3 = arguments.callee.arg;
_local3 = _local3.concat(arguments);
return(func.apply(_local2, _local3));
};
_local3.target = obj;
_local3.func = func;
_local3.arg = arguments.slice(2);
return(_local3);
};
_local1.createDelegate = function (obj) {
return(Delegate.create(obj, this.func));
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 1134 MovieClip [__Packages.Main] Frame 0
#initclip
if (!Main) {
//(_global.Main = function (_mcRef) {
super(_mcRef, false);
Stage.showMenu = false;
Main.oRef = this;
this.mcRef.onEnterFrame = Delegate.create(this, this.enterFrame);
this.sSection = Main.PACKAGING_SECTION;
this.oController = new Controller(this.mcRef);
this.oDynamicPack = null;
this.bQuitting = false;
this.bFinished = false;
this.bCheatClothesActivated = false;
this.bMustSendScore = false;
this.bEasterEgg = false;
this.oShadow = new Shadow(this.mcRef.mcShadow);
this.sState = Main.sSTATE_INIT;
this.oController.playMusicLoop(Main.PACKAGING_SECTION);
}) extends State
var _local1 = (_global.Main /* register */).prototype;
_local1.doHide = function () {
this.mcRef.visible = false;
};
_local1.doShow = function () {
this.mcRef.visible = true;
};
_local1.winGame = function () {
this.bFinished = true;
CTRLGame.getRef().Screen.getInterface().pauseTime();
if (CTRLGame.getRef().Level == CTRLGame.nLEVEL1) {
this.calculateScore();
this.oController.goToNewLevel(this.game.Screen.getInterface().mcRef.mcSongs._currentframe);
} else {
this.oController.goTo(Main.sSTATE_WIN, this);
}
};
_local1.loseGame = function () {
this.bFinished = true;
CTRLGame.getRef().Screen.getInterface().pauseTime();
this.oController.goTo(Main.sSTATE_LOSE, this);
};
_local1.startNewLevel = function () {
this.bFinished = false;
var _local2 = CTRLGame.getRef().Level;
var _local3 = CTRLGame.getRef().Score;
this.game.cleanUp();
delete this.game;
this.game = null;
this.game = new CTRLGame(this.mcRef.mcState, _local3, _local2 + 1);
this.game.Screen.getInterface().doShow();
};
_local1.updateScoreField = function () {
if (this.sState == Main.sSTATE_GAME) {
CTRLGame.getRef().Screen.getInterface().setScoreValue(CTRLGame.getRef().Score);
} else if ((this.sState == Main.sSTATE_WIN) || (this.sState == Main.sSTATE_LOSE)) {
this.mcRef.mcState.txtScore.text = Utils.styleNumber(CTRLGame.getRef().Score);
}
};
_local1.doPause = function () {
};
_local1.doUnPause = function () {
};
_local1.onRestartButton = function () {
this.resetForNewGame();
this.sStartDynamic = ScrollingPanel.sSTATE_TITLE;
this.oController.goTo(Main.sSTATE_PACKAGING, this);
};
_local1.onHighScoresButton = function () {
if (this.sState != Main.sSTATE_PACKAGING) {
this.resetForNewGame();
}
this.bMustSendScore = false;
this.sStartDynamic = ScrollingPanel.sSTATE_HIGHSCORES;
this.oController.goTo(Main.sSTATE_PACKAGING, this);
};
_local1.rollOverButton = function () {
this.oController.playRollOverSound();
};
_local1.clickPlayButton = function () {
this.oController.playClickSound();
this.oController.goTo(Main.sSTATE_GAME, this);
};
_local1.clickInstructionsButton = function () {
this.oController.playClickSound();
this.oController.goTo(Main.sSTATE_INSTRUCTIONS, this);
};
_local1.clickMenuButton = function () {
this.oController.playClickSound();
this.oController.getMenu().doShow();
};
_local1.clickQuitButton = function () {
this.oController.playClickSound();
this.bQuitting = true;
this.loseGame();
};
_local1.clickSubmitScore = function () {
this.oController.playClickSound();
this.bMustSendScore = true;
this.resetForNewGame();
this.sStartDynamic = ScrollingPanel.sSTATE_HIGHSCORES;
this.oController.goTo(Main.sSTATE_PACKAGING, this);
};
_local1.clickRestartButton = function () {
this.oController.playClickSound();
this.onRestartButton();
};
_local1.clickHighScoresButton = function () {
this.oController.playClickSound();
this.onHighScoresButton();
};
_local1.setState = function (_sState) {
this.sLastState = this.sState;
super.setState(_sState);
this.initState(_sState);
};
_local1.showHighScoreStuff = function (_btnSubmit) {
_global.HS.initHiScores();
if (_global.gProxyObj.getIsLoggedIn()) {
_btnSubmit._visible = true;
} else {
_btnSubmit._visible = false;
}
if (_global.HS.G_ShowHighScore == false) {
_btnSubmit._visible = false;
_btnSubmit._visible = false;
}
};
_local1.setCheatClothes = function (_bActive) {
this.bCheatClothesActivated = _bActive;
};
_local1.setMustSendScore = function (_bMustSend) {
this.bMustSendScore = _bMustSend;
};
_local1.isCheatClothesActivated = function () {
return(this.bCheatClothesActivated);
};
_local1.getSection = function () {
return(this.sSection);
};
_local1.__get__Finished = function () {
return(this.bFinished);
};
_local1.__get__MustSendScore = function () {
return(this.bMustSendScore);
};
_local1.__get__EasterEgg = function () {
return(this.bEasterEgg);
};
_local1.setEasterEgg = function (_bEasterEgg) {
this.bEasterEgg = _bEasterEgg;
};
(_global.Main /* register */).getRef = function () {
return(Main.oRef);
};
_local1.Init = function () {
if (this.mcRef.mcState.mcLoading._currentframe == this.mcRef.mcState.mcLoading._totalframes) {
this.setState(Main.sSTATE_PACKAGING);
this.sStartDynamic = ScrollingPanel.sSTATE_TITLE;
}
};
_local1.Packaging = function () {
};
_local1.Game = function () {
if (Controller.getRef().isPaused() || (CTRLGame.getRef().Screen.isInMiniGame())) {
if (!this.oShadow.isVisible()) {
this.oShadow.doShow();
}
} else if (this.oShadow.isVisible()) {
this.oShadow.doHide();
}
};
_local1.LoseScreen = function () {
};
_local1.WinScreen = function () {
};
_local1.calculateScore = function () {
if (!this.bQuitting) {
var _local2 = CTRLGame.getRef().Songs / Main.nFRAME_RATE;
if ((_local2 - Math.round(_local2)) != 0) {
_local2 = Math.round(_local2);
_local2++;
} else {
_local2 = Math.round(_local2);
}
CTRLGame.getRef().addToScore(_local2 * LD.nSECOND_LEFT_VALUE);
}
};
_local1.initState = function (_sState) {
switch (_sState) {
case Main.sSTATE_PACKAGING :
if (this.sLastState == Main.sSTATE_INIT) {
this.oDynamicPack = new DynamicPack(this.mcRef.mcState, DynamicPack.sSTATE_ENTER, this.sStartDynamic);
} else {
this.oDynamicPack = new DynamicPack(this.mcRef.mcState, DynamicPack.sSTATE_IDLE, this.sStartDynamic);
}
break;
case Main.sSTATE_GAME :
if (this.sSection == Main.PACKAGING_SECTION) {
this.oDynamicPack.cleanUp();
delete this.oDynamicPack;
this.oDynamicPack = null;
this.game = new CTRLGame(this.mcRef.mcState, 0, 1);
this.oController.playMusicLoop(Main.GAME_SECTION);
Controller.getRef().getStartPop().doInstantShow();
}
this.sSection = Main.GAME_SECTION;
break;
case Main.sSTATE_WIN :
CTRLGame.getRef().addToScore(LD.nWIN_BONUSPOINTS);
case Main.sSTATE_LOSE :
this.calculateScore();
this.oController.playMusicLoop(Main.PACKAGING_SECTION);
this.sSection = Main.PACKAGING_SECTION;
this.oEndScreen = new EndScreen(this.mcRef.mcState);
CTRLGame.getRef().Screen.getInterface().doHide();
this.oController.getMenu().doInstantHide();
this.oShadow.doInstantHide();
break;
}
};
_local1.enterFrame = function () {
MainBroadcaster.Instance.doAction();
Broadcaster.Instance.doAction();
};
_local1.resetForNewGame = function () {
Broadcaster.Instance.flushBroadcaster();
this.oEndScreen.cleanUp();
delete this.oEndScreen;
this.oController.resetForNewGame();
this.game.cleanUp();
delete this.game;
this.game = null;
this.bQuitting = false;
this.bFinished = false;
};
_local1.addProperty("Finished", _local1.__get__Finished, function () {
});
_local1.addProperty("EasterEgg", _local1.__get__EasterEgg, function () {
});
_local1.addProperty("MustSendScore", _local1.__get__MustSendScore, function () {
});
ASSetPropFlags(_local1, null, 1);
(_global.Main /* register */).PACKAGING_SECTION = "Packaging";
(_global.Main /* register */).GAME_SECTION = "Game";
(_global.Main /* register */).sSTATE_INIT = "Init";
(_global.Main /* register */).sSTATE_PACKAGING = "Packaging";
(_global.Main /* register */).sSTATE_GAME = "Game";
(_global.Main /* register */).sSTATE_WIN = "WinScreen";
(_global.Main /* register */).sSTATE_LOSE = "LoseScreen";
(_global.Main /* register */).sSTATE_RESET = "Reset";
(_global.Main /* register */).sSTATE_INSTRUCTIONS = "Instructions";
(_global.Main /* register */).nFRAME_RATE = 35;
}
#endinitclip
Symbol 1135 MovieClip [__Packages.DynamicPack] Frame 0
#initclip
if (!DynamicPack) {
//(_global.DynamicPack = function (_mcRef, _sInitState, _sStartDynamic) {
super(_mcRef);
this.setState(_sInitState);
if (_sInitState == DynamicPack.sSTATE_IDLE) {
this.oPanel = new ScrollingPanel(this.mcRef.mcState);
this.oPanel.setState(_sStartDynamic);
}
}) extends State
var _local1 = (_global.DynamicPack /* register */).prototype;
_local1.cleanUp = function () {
super.cleanUp();
this.oPanel.cleanUp();
};
_local1.Enter = function () {
if (this.stateFinished()) {
this.setState(DynamicPack.sSTATE_IDLE);
this.oPanel = new ScrollingPanel(this.mcRef.mcState);
}
};
_local1.Idle = function () {
};
ASSetPropFlags(_local1, null, 1);
(_global.DynamicPack /* register */).sSTATE_ENTER = "Enter";
(_global.DynamicPack /* register */).sSTATE_IDLE = "Idle";
}
#endinitclip
Symbol 1136 MovieClip [__Packages.ScrollingPanel] Frame 0
#initclip
if (!ScrollingPanel) {
//(_global.ScrollingPanel = function (_mcRef) {
super(_mcRef);
this.setState(ScrollingPanel.sSTATE_TITLE);
this.nInstructionsPage = 1;
this.nKeyPosition = 1;
}) extends State
var _local1 = (_global.ScrollingPanel /* register */).prototype;
_local1.setState = function (_sState) {
this.sLastState = this.sState;
super.setState(_sState);
this.initState(_sState);
};
_local1.TitleToHowToPlay = function () {
if (this.stateFinished()) {
var _local2 = this.mcRef.mcState.mcPanel.mcPage.mcKeys._currentframe;
this.setState(ScrollingPanel.sSTATE_HOWTOPLAY);
this.mcRef.mcState.mcPanel.mcPage.mcKeys.gotoAndPlay(_local2);
}
};
_local1.HowToPlayToTitle = function () {
if (this.stateFinished()) {
this.nKeyPosition = this.mcRef.mcState.mcPanel.mcPage.mcKeys._currentframe;
this.setState(ScrollingPanel.sSTATE_TITLE);
}
};
_local1.TitleToHighScores = function () {
if (this.stateFinished()) {
this.changeStateKeepingInfo(ScrollingPanel.sSTATE_HIGHSCORES);
}
};
_local1.HighScoresToTitle = function () {
if (this.stateFinished()) {
this.setState(ScrollingPanel.sSTATE_TITLE);
}
};
_local1.TitleCard = function () {
};
_local1.HighScores = function () {
};
_local1.Instructions = function () {
};
_local1.moveTitleToIns = function () {
this.setState(ScrollingPanel.sSTATE_TITLE_TO_HOWTOPLAY);
this.mcRef.mcState.mcPanel.mcPage.mcKeys.gotoAndPlay(this.nKeyPosition);
this.initPage();
};
_local1.moveTitleToHighScores = function () {
Main.getRef().setMustSendScore(false);
this.setState(ScrollingPanel.sSTATE_TITLE_TO_HIGHSCORES);
Main.getRef().showHighScoreStuff(this.mcRef.mcState.mcPanel.mcSubmit);
this.checkToSubmitHighScore();
this.mcRef.mcState.mcPanel.mcSubmit._visible = false;
this.mcRef.mcState.mcPanel.mcMain.gotoAndStop(2);
};
_local1.desactivateButton = function (_mcButton) {
delete _mcButton.button.onRollOver;
_mcButton.button.onRollOver = undefined;
delete _mcButton.button.onRelease;
_mcButton.button.onRelease = undefined;
_mcButton.gotoAndStop(2);
};
_local1.activateButton = function (_mcButton, _onRelease) {
_mcButton.gotoAndStop(1);
_mcButton.button.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
_mcButton.button.onRelease = Delegate.create(this, _onRelease);
};
_local1.nextPage = function () {
Controller.getRef().playClickSound();
this.nInstructionsPage++;
this.initPage();
};
_local1.previousPage = function () {
Controller.getRef().playClickSound();
this.nInstructionsPage--;
this.initPage();
};
_local1.initPage = function () {
if (this.nInstructionsPage == 1) {
this.desactivateButton(this.mcRef.mcState.mcPanel.mcBack);
this.activateButton(this.mcRef.mcState.mcPanel.mcNext, this.nextPage);
} else if (this.nInstructionsPage == 2) {
this.activateButton(this.mcRef.mcState.mcPanel.mcBack, this.previousPage);
this.activateButton(this.mcRef.mcState.mcPanel.mcNext, this.nextPage);
} else if (this.nInstructionsPage == 3) {
this.activateButton(this.mcRef.mcState.mcPanel.mcBack, this.previousPage);
this.desactivateButton(this.mcRef.mcState.mcPanel.mcNext);
}
this.mcRef.mcState.mcPanel.mcPage.gotoAndStop(this.nInstructionsPage);
};
_local1.checkToSubmitHighScore = function () {
if (_global.gProxyObj.getIsLoggedIn()) {
this.mcRef.mcState.mcPanel.mcSubmit._visible = true;
} else {
this.mcRef.mcState.mcPanel.mcSubmit._visible = false;
}
if (Main.getRef().MustSendScore) {
this.clickSubmitButton();
} else {
_global.HS.getScores();
}
};
_local1.initState = function (_sState) {
switch (_sState) {
case ScrollingPanel.sSTATE_TITLE :
_global.HS.initHiScores();
this.mcRef.mcState.mcPanel.btnPlay2.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnPlay2.onRelease = Delegate.create(Main.getRef(), Main.getRef().clickPlayButton);
this.mcRef.mcState.mcPanel.btnHighScores.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnHighScores.onRelease = Delegate.create(this, this.clickTitleToHSButton);
this.mcRef.mcState.mcPanel.btnHowToPlay.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnHowToPlay.onRelease = Delegate.create(this, this.clickTitleToInsButton);
this.mcRef.mcState.mcPanel.btnCheat.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnCheat.onRelease = Delegate.create(this, this.clickEnterCodeButton);
break;
case ScrollingPanel.sSTATE_HOWTOPLAY :
this.mcRef.mcState.mcPanel.btnPlay1.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnPlay1.onRelease = Delegate.create(Main.getRef(), Main.getRef().clickPlayButton);
this.initPage();
break;
case ScrollingPanel.sSTATE_HIGHSCORES :
if (this.sLastState == ScrollingPanel.sSTATE_TITLE_TO_HIGHSCORES) {
this.mcRef.mcState.mcPanel.mcSubmit._visible = false;
} else {
Main.getRef().showHighScoreStuff(this.mcRef.mcState.mcPanel.mcSubmit);
this.checkToSubmitHighScore();
}
if (this.mcRef.mcState.mcPanel.mcSubmit._visible) {
this.mcRef.mcState.mcPanel.mcSubmit.btnSubmit.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.mcSubmit.btnSubmit.onRelease = Delegate.create(this, this.clickSubmitButton);
this.mcRef.mcState.mcPanel.mcMain.gotoAndStop(1);
} else {
this.mcRef.mcState.mcPanel.mcMain.gotoAndStop(2);
}
this.mcRef.mcState.mcPanel.mcMain.btnHSToTitle.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.mcMain.btnHSToTitle.onRelease = Delegate.create(this, this.clickHSToTitleButton);
break;
}
};
_local1.clickTitleToInsButton = function () {
Controller.getRef().playClickSound();
this.moveTitleToIns();
};
_local1.clickTitleToHSButton = function () {
Controller.getRef().playClickSound();
this.moveTitleToHighScores();
};
_local1.clickHSToTitleButton = function () {
Controller.getRef().playClickSound();
this.changeStateKeepingInfo(ScrollingPanel.sSTATE_HIGHSCORES_TO_TITLE);
};
_local1.clickInsToTitleButton = function () {
Controller.getRef().playClickSound();
var _local2 = this.mcRef.mcState.mcPanel.mcPage.mcKeys._currentframe;
this.setState(ScrollingPanel.sSTATE_HOWTOPLAY_TO_TITLE);
this.mcRef.mcState.mcPanel.mcPage.mcKeys.gotoAndPlay(_local2);
this.initPage();
};
_local1.clickEnterCodeButton = function () {
Controller.getRef().playClickSound();
Controller.getRef().getCheatPop().doShow();
};
_local1.clickSubmitButton = function () {
_global.HS.submitScore(CTRLGame.getRef().Score);
this.mcRef.mcState.mcPanel.mcSubmit._visible = false;
if (this.mcRef.mcState.mcPanel.mcSubmit._visible) {
this.mcRef.mcState.mcPanel.mcMain.gotoAndStop(1);
} else {
this.mcRef.mcState.mcPanel.mcMain.gotoAndStop(2);
}
};
_local1.changeStateKeepingInfo = function (_sNextState) {
var _local3 = this.mcRef.mcState.mcPanel.mcSubmit._visible;
var _local4 = this.mcRef.mcState.mcPanel.txt_highScoreNumber.text;
var _local5 = this.mcRef.mcState.mcPanel.txt_highScoreName.text;
var _local6 = this.mcRef.mcState.mcPanel.txt_highScoreScore.text;
var _local7 = this.mcRef.mcState.mcPanel.txt_highScoreScore.scroll;
this.setState(_sNextState);
this.mcRef.mcState.mcPanel.mcSubmit._visible = _local3;
if (this.mcRef.mcState.mcPanel.mcSubmit._visible) {
this.mcRef.mcState.mcPanel.mcMain.gotoAndStop(1);
} else {
this.mcRef.mcState.mcPanel.mcMain.gotoAndStop(2);
}
this.mcRef.mcState.mcPanel.txt_highScoreNumber.text = _local4;
this.mcRef.mcState.mcPanel.txt_highScoreName.text = _local5;
this.mcRef.mcState.mcPanel.txt_highScoreScore.text = _local6;
this.mcRef.mcState.mcPanel.txt_highScoreNumber.scroll = _local7;
this.mcRef.mcState.mcPanel.txt_highScoreName.scroll = _local7;
this.mcRef.mcState.mcPanel.txt_highScoreScore.scroll = _local7;
};
ASSetPropFlags(_local1, null, 1);
(_global.ScrollingPanel /* register */).sSTATE_TITLE = "TitleCard";
(_global.ScrollingPanel /* register */).sSTATE_TITLE_TO_HOWTOPLAY = "TitleToHowToPlay";
(_global.ScrollingPanel /* register */).sSTATE_HOWTOPLAY = "HowToPlay";
(_global.ScrollingPanel /* register */).sSTATE_HOWTOPLAY_TO_TITLE = "HowToPlayToTitle";
(_global.ScrollingPanel /* register */).sSTATE_HIGHSCORES = "HighScores";
(_global.ScrollingPanel /* register */).sSTATE_HIGHSCORES_TO_TITLE = "HighScoresToTitle";
(_global.ScrollingPanel /* register */).sSTATE_TITLE_TO_HIGHSCORES = "TitleToHighScores";
}
#endinitclip
Symbol 1137 MovieClip [__Packages.EndScreen] Frame 0
#initclip
if (!EndScreen) {
//(_global.EndScreen = function (_mcRef) {
super(_mcRef);
this.setState(EndScreen.sSTATE_IN);
this.bRestartButton = false;
this.nFinalScore = CTRLGame.getRef().Score;
this.sUnit = " points!";
if ((this.nFinalScore == 0) || (this.nFinalScore == 1)) {
this.sUnit = " point!";
}
}) extends State
var _local1 = (_global.EndScreen /* register */).prototype;
_local1.doPause = function () {
};
_local1.doUnPause = function () {
};
_local1.In = function () {
this.mcRef.mcState.mcScreen.txtScore.text = Utils.styleNumber(this.nFinalScore) + this.sUnit;
if (this.stateFinished()) {
this.setState(EndScreen.sSTATE_IDLE);
this.initScreen();
this.mcRef.mcState.txtScore.text = Utils.styleNumber(this.nFinalScore) + this.sUnit;
} else if (this.mcRef.mcState._currentframe == EndScreen.nFIRST_VISIBLE_FRAME) {
Main.getRef().showHighScoreStuff(this.mcRef.mcState.mcScreen.mcSubmit);
this.mcRef.mcState.mcScreen.txtScore.text = Utils.styleNumber(this.nFinalScore) + this.sUnit;
if (Main.getRef().sState == Main.sSTATE_WIN) {
Controller.getRef().getSounds().playSound("WinScreen_In", Controller.nSFX_VOLUME, 1);
} else if (Main.getRef().sState == Main.sSTATE_LOSE) {
Controller.getRef().getSounds().playSound("LoseScreen_In", Controller.nSFX_VOLUME, 1);
}
}
};
_local1.Idle = function () {
};
_local1.Out = function () {
this.mcRef.mcState.mcScreen.txtScore.text = Utils.styleNumber(this.nFinalScore) + this.sUnit;
if (this.stateFinished()) {
this.mcRef.mcState.stop();
if (this.bRestartButton) {
Main.getRef().onRestartButton();
} else {
Main.getRef().onHighScoresButton();
}
}
};
_local1.clickRestartButton = function () {
Controller.getRef().playClickSound();
this.bRestartButton = true;
this.setOut();
};
_local1.clickHighScoresButton = function () {
Controller.getRef().playClickSound();
this.bRestartButton = false;
this.setOut();
};
_local1.setOut = function () {
this.setState(EndScreen.sSTATE_OUT);
Main.getRef().showHighScoreStuff(this.mcRef.mcState.mcScreen.mcSubmit);
Controller.getRef().getSounds().startFadeOut("WinScreen_In");
Controller.getRef().getSounds().startFadeOut("LoseScreen_In");
Controller.getRef().getSounds().playSound("EndScreen_Out", Controller.nSFX_VOLUME, 1);
this.mcRef.mcState.mcScreen.txtScore.text = Utils.styleNumber(this.nFinalScore) + this.sUnit;
};
_local1.initScreen = function () {
this.mcRef.mcState.btnPlayAgain.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.btnPlayAgain.onRelease = Delegate.create(this, this.clickRestartButton);
this.mcRef.mcState.btnHighScores.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.btnHighScores.onRelease = Delegate.create(this, this.clickHighScoresButton);
Main.getRef().showHighScoreStuff(this.mcRef.mcState.mcSubmit);
if (this.mcRef.mcState.mcSubmit._visible) {
this.mcRef.mcState.mcSubmit.btnSubmit.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcSubmit.btnSubmit.onRelease = Delegate.create(Main.getRef(), Main.getRef().clickSubmitScore);
}
};
ASSetPropFlags(_local1, null, 1);
(_global.EndScreen /* register */).sSTATE_IN = "In";
(_global.EndScreen /* register */).sSTATE_IDLE = "Idle";
(_global.EndScreen /* register */).sSTATE_OUT = "Out";
(_global.EndScreen /* register */).nFIRST_VISIBLE_FRAME = 15;
}
#endinitclip
Symbol 1138 MovieClip [__Packages.Utils] Frame 0
class Utils
{
function Utils () {
}
static function styleNumber(pNumber, pMinimumChar) {
var _local4 = false;
var _local5 = String(pNumber);
var _local6 = _local5;
do {
if (_local5.length < pMinimumChar) {
_local4 = true;
_local6 = "0" + _local6;
}
} while (_local6.length < pMinimumChar);
_local5 = _local6;
var _local7 = "";
var _local8 = _local5.length;
_local8 = _local8 / 3;
if (_local8 <= 1) {
return(_local5);
}
var _local9 = _local8;
for ( ; _local9 > 1 ; _local9--) {
_local7 = (" " + _local5.substr(-3)) + _local7;
_local5 = _local5.substr(0, -3);
}
_local6 = _local5 + _local7;
return(_local6);
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 1139 MovieClip [__Packages.Shadow] Frame 0
#initclip
if (!Shadow) {
//(_global.Shadow = function (_mcRef) {
super(_mcRef, false);
this.setState(this.sSTATE_EMPTY);
}) extends State
var _local1 = (_global.Shadow /* register */).prototype;
_local1.doShow = function () {
this.setState(this.sSTATE_IN);
};
_local1.doInstantHide = function () {
this.setState(this.sSTATE_EMPTY);
};
_local1.doHide = function () {
this.setState(this.sSTATE_OUT);
};
_local1.isVisible = function () {
var _local2 = true;
if (this.sState == this.sSTATE_EMPTY) {
_local2 = false;
}
return(_local2);
};
_local1.In = function () {
if (this.stateFinished()) {
this.setState(this.sSTATE_IDLE);
}
};
_local1.Idle = function () {
};
_local1.Out = function () {
if (this.stateFinished()) {
this.setState(this.sSTATE_EMPTY);
}
};
_local1.Empty = function () {
};
ASSetPropFlags(_local1, null, 1);
_local1.sSTATE_IN = "In";
_local1.sSTATE_IDLE = "Idle";
_local1.sSTATE_OUT = "Out";
_local1.sSTATE_EMPTY = "Empty";
}
#endinitclip
Symbol 1140 MovieClip [__Packages.LD] Frame 0
class LD
{
function LD () {
}
static function getSongsMax(_nLevel) {
return(aSONGS_MAX[_nLevel - 1]);
}
//ASSetPropFlags(_local1, null, 1);
static var nBONUSPOINTS = 500;
static var nWIN_BONUSPOINTS = 5000;
static var nGOOD_NOTE_VALUE = 330;
static var nFALSE_NOTE_VALUE = -330;
static var aSONGS_MAX = [(3.5 * 60) * 35, (3 * 60) * 35];
static var nNB_PUSHBUS_WITH_SANDY = 3;
static var nSECOND_LEFT_VALUE = 100;
static var sCHEAT_CLOTHING = "BUBBLE";
}
Symbol 1141 MovieClip [__Packages.Transition] Frame 0
#initclip
if (!Transition) {
//(_global.Transition = function (_mcRef) {
super(_mcRef, false);
this.setState(Transition.sSTATE_IDLE);
this.bIsLeft = Math.round(Math.random());
}) extends State
var _local1 = (_global.Transition /* register */).prototype;
_local1.goTo = function (_sGoingTo, _classToMove) {
this.sGoingTo = _sGoingTo;
if ((!(_classToMove instanceof State)) || ((_classToMove == undefined) || (_classToMove == null))) {
this.classToMove = Main.getRef();
} else {
this.classToMove = _classToMove;
}
if (this.sState == Transition.sSTATE_IDLE) {
if (this.bIsLeft) {
this.setState(Transition.sSTATE_PLAY_RIGHT);
this.bIsLeft = false;
} else {
this.setState(Transition.sSTATE_PLAY_LEFT);
this.bIsLeft = true;
}
}
Controller.getRef().getSounds().playSound("SFX_Transition", Controller.nSFX_VOLUME, 1);
};
_local1.managePlayAnim = function () {
if (this.stateFinished()) {
this.setState(Transition.sSTATE_IDLE);
} else if (this.mcRef.mcState._currentframe == Transition.nFRAME_CHANGE) {
if (this.sGoingTo != Transition.sEXCEPTION) {
Controller.getRef().getInstructions().doHide();
this.classToMove.setState(this.sGoingTo);
} else {
Controller.getRef().getInstructions().doShow();
}
}
};
_local1.Idle = function () {
};
_local1.PlayLeft = function () {
this.managePlayAnim();
};
_local1.PlayRight = function () {
this.managePlayAnim();
};
ASSetPropFlags(_local1, null, 1);
(_global.Transition /* register */).sEXCEPTION = "Instructions";
(_global.Transition /* register */).sSTATE_IDLE = "Idle";
(_global.Transition /* register */).sSTATE_PLAY_LEFT = "PlayLeft";
(_global.Transition /* register */).sSTATE_PLAY_RIGHT = "PlayRight";
(_global.Transition /* register */).nFRAME_CHANGE = 30;
}
#endinitclip
Symbol 1142 MovieClip [__Packages.TransitionLevel] Frame 0
#initclip
if (!TransitionLevel) {
//(_global.TransitionLevel = function (_mcRef) {
super(_mcRef, false);
this.nFrameSongs = 0;
this.setState(TransitionLevel.sSTATE_IDLE);
}) extends State
var _local1 = (_global.TransitionLevel /* register */).prototype;
_local1.goToNewLevel = function (_nFrameSongs) {
if (this.sState == TransitionLevel.sSTATE_IDLE) {
this.setState(TransitionLevel.sSTATE_IN);
this.nFrameSongs = _nFrameSongs;
this.mcRef.mcState.mcScreen.mcSongs.gotoAndStop(1);
}
Controller.getRef().getSounds().startFadeOut(Controller.GAME_MUSIC_NAME);
Controller.getRef().getSounds().startFadeIn("rewindsong", Controller.nSFX_VOLUME, 1);
};
_local1.manageRefillGauge = function () {
if (this.mcRef.mcState.mcScreen.mcSongs._currentframe == 100) {
var _local2 = this.mcRef.mcState.mcScreen.mcSongs._currentframe;
this.setState(TransitionLevel.sSTATE_OUT);
Controller.getRef().getSounds().startFadeOut("rewindsong");
Controller.getRef().getSounds().startFadeIn(Controller.GAME_MUSIC_NAME, Controller.nMUSIC_VOLUME, 999999);
this.mcRef.mcState.mcScreen.mcSongs.gotoAndStop(_local2);
} else {
this.mcRef.mcState.mcScreen.mcSongs.gotoAndStop(Math.min(this.mcRef.mcState.mcScreen.mcSongs._currentframe + 2, 100));
}
};
_local1.Idle = function () {
};
_local1.In = function () {
if (this.stateFinished()) {
var _local2 = this.mcRef.mcState.mcScreen.mcSongs._currentframe;
var _local3 = this.mcRef.mcState.mcScreen.mcSquidward._currentframe;
var _local4 = this.mcRef.mcState.mcScreen.mcBus._currentframe;
this.setState(TransitionLevel.sSTATE_OPENED);
this.mcRef.mcState.mcScreen.mcSongs.gotoAndStop(_local2);
this.mcRef.mcState.mcScreen.mcSquidward.gotoAndPlay(_local3);
this.mcRef.mcState.mcScreen.mcBus.gotoAndPlay(_local4);
Main.getRef().startNewLevel();
}
};
_local1.Opened = function () {
this.manageRefillGauge();
};
_local1.Out = function () {
if (this.stateFinished()) {
this.setState(TransitionLevel.sSTATE_IDLE);
this.mcRef.mcState.mcScreen.mcSongs.gotoAndStop(100);
}
};
ASSetPropFlags(_local1, null, 1);
(_global.TransitionLevel /* register */).sSTATE_IDLE = "Idle";
(_global.TransitionLevel /* register */).sSTATE_IN = "In";
(_global.TransitionLevel /* register */).sSTATE_OPENED = "Opened";
(_global.TransitionLevel /* register */).sSTATE_OUT = "Out";
}
#endinitclip
Symbol 1143 MovieClip [__Packages.Instructions] Frame 0
#initclip
if (!Instructions) {
//(_global.Instructions = function (_mcRef) {
super(_mcRef, false);
this.nInstructionsPage = 1;
this.setState(Instructions.sSTATE_IDLE);
}) extends State
var _local1 = (_global.Instructions /* register */).prototype;
_local1.doShow = function () {
if (this.sState == Instructions.sSTATE_IDLE) {
this.setState(Instructions.sSTATE_SHOW);
Main.getRef().doHide();
this.initPage();
this.mcRef.mcState.mcScreen.mcPanel.btnPlay1.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcScreen.mcPanel.btnPlay1.onRelease = Delegate.create(Main.getRef(), Main.getRef().clickPlayButton);
this.mcRef.mcState.stop();
}
};
_local1.doHide = function () {
if (this.sState != Instructions.sSTATE_IDLE) {
this.setState(Instructions.sSTATE_IDLE);
Main.getRef().doShow();
}
};
_local1.desactivateButton = function (_mcButton) {
delete _mcButton.button.onRollOver;
_mcButton.button.onRollOver = undefined;
delete _mcButton.button.onRelease;
_mcButton.button.onRelease = undefined;
_mcButton.gotoAndStop(2);
};
_local1.activateButton = function (_mcButton, _onRelease) {
_mcButton.gotoAndStop(1);
_mcButton.button.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
_mcButton.button.onRelease = Delegate.create(this, _onRelease);
};
_local1.nextPage = function () {
Controller.getRef().playClickSound();
this.nInstructionsPage++;
this.initPage();
};
_local1.previousPage = function () {
Controller.getRef().playClickSound();
this.nInstructionsPage--;
this.initPage();
};
_local1.initPage = function () {
if (this.nInstructionsPage == 1) {
this.desactivateButton(this.mcRef.mcState.mcScreen.mcPanel.mcBack);
this.activateButton(this.mcRef.mcState.mcScreen.mcPanel.mcNext, this.nextPage);
} else if (this.nInstructionsPage == 2) {
this.activateButton(this.mcRef.mcState.mcScreen.mcPanel.mcBack, this.previousPage);
this.activateButton(this.mcRef.mcState.mcScreen.mcPanel.mcNext, this.nextPage);
} else if (this.nInstructionsPage == 3) {
this.activateButton(this.mcRef.mcState.mcScreen.mcPanel.mcBack, this.previousPage);
this.desactivateButton(this.mcRef.mcState.mcScreen.mcPanel.mcNext);
}
this.mcRef.mcState.mcScreen.mcPanel.mcPage.gotoAndStop(this.nInstructionsPage);
};
_local1.doPause = function () {
};
_local1.doUnPause = function () {
};
_local1.Idle = function () {
};
_local1.ShowScreen = function () {
};
ASSetPropFlags(_local1, null, 1);
(_global.Instructions /* register */).sSTATE_IDLE = "Idle";
(_global.Instructions /* register */).sSTATE_SHOW = "ShowScreen";
}
#endinitclip
Symbol 1144 MovieClip [__Packages.Sounds] Frame 0
class Sounds
{
var mcTimeLine, mcRef, bMuteSound, bMuteMusic, oSounds, nDepth, aTabSonFade, nFadingSpeed;
function Sounds (_mcTimeline) {
mcTimeLine = _mcTimeline;
init();
mcRef = _mcTimeline.mcSounds;
mcRef.onEnterFrame = Delegate.create(this, enterFrame);
}
function isSoundsMuted() {
return(bMuteSound);
}
function isMusicMuted() {
return(bMuteMusic);
}
function playSound(_sName, _nVolume, _nLoop) {
if (!exist(_sName)) {
oSounds[_sName] = new Object();
oSounds[_sName].sName = _sName;
oSounds[_sName].nVolume = 0;
oSounds[_sName].nPausePosition = 0;
oSounds[_sName].mcRef = mcTimeLine.createEmptyMovieClip(_sName, nDepth);
oSounds[_sName].sSound = new Sound(_sName);
oSounds[_sName].sSound.attachSound(_sName);
if (_sName == Controller.PACKAGING_INTRO_MUSIC_NAME) {
oSounds[_sName].sSound.onSoundComplete = Delegate.create(Controller.getRef(), Controller.getRef().introComplete);
}
nDepth++;
}
if (exist(_sName)) {
setVolumeSound(_sName, _nVolume);
oSounds[_sName].sSound.start(0, _nLoop);
if (isMusic(_sName)) {
if (bMuteMusic) {
oSounds[_sName].sSound.setVolume(0);
}
} else if (bMuteSound) {
oSounds[_sName].sSound.setVolume(0);
}
}
}
function playRandomSound(_nMaxSounds, _sSoundName, _nVolume) {
var _local5 = Math.round(Math.random() * (_nMaxSounds - 1));
_local5++;
playSound(((_sSoundName + "(") + _local5) + ")", _nVolume, 1);
}
function stopSound(_sName) {
if (exist(_sName)) {
setVolumeSound(_sName, 0);
oSounds[_sName].sSound.stop();
}
}
function pauseSound(_sName) {
if (exist(_sName)) {
if (!isMusic(_sName)) {
if (oSounds[_sName].nPausePosition == -1) {
oSounds[_sName].nPausePosition = 0;
} else {
oSounds[_sName].nPausePosition = oSounds[_sName].sSound.position;
}
oSounds[_sName].sSound.stop();
}
}
}
function resumeSound(_sName) {
if (exist(_sName)) {
if (!isMusic(_sName)) {
if ((oSounds[_sName].nPausePosition != 0) && (oSounds[_sName].nPausePosition != undefined)) {
oSounds[_sName].sSound.start(oSounds[_sName].nPausePosition / 1000, 0);
}
}
}
}
function pauseAllSounds() {
for (var i in oSounds) {
pauseSound(oSounds[i].sName);
}
}
function resumeAllSounds() {
for (var i in oSounds) {
resumeSound(oSounds[i].sName);
}
}
function startFadeIn(_sName, _nVolume, _nLoop) {
if (((!bMuteSound) && (!isMusic(_sName))) || ((!bMuteMusic) && (isMusic(_sName)))) {
playSound(_sName, 0, _nLoop);
var _local5 = [_sName, _nVolume, "In", 0];
aTabSonFade.push(_local5);
} else {
playSound(_sName, _nVolume, _nLoop);
}
}
function startFadeOut(_sName) {
if (exist(_sName)) {
aTabSonFade = [];
if (oSounds[_sName].sSound.getVolume() != 0) {
var _local3 = [_sName, 0, "Out", oSounds[_sName].sSound.getVolume()];
aTabSonFade.push(_local3);
} else {
stopSound(_sName);
}
}
}
function setVolumeSound(_sName, _nVolume) {
if (exist(_sName)) {
oSounds[_sName].nVolume = _nVolume;
if ((bMuteSound && (!isMusic(_sName))) || (bMuteMusic && (isMusic(_sName)))) {
oSounds[_sName].sSound.setVolume(0);
} else {
oSounds[_sName].sSound.setVolume(_nVolume);
}
}
}
function DoMuteSounds() {
bMuteSound = true;
for (var i in oSounds) {
if (!isMusic(oSounds[i].sName)) {
oSounds[oSounds[i].sName].sSound.setVolume(0);
}
}
}
function UndoMuteSounds() {
bMuteSound = false;
for (var i in oSounds) {
if (!isMusic(oSounds[i].sName)) {
setVolumeSound(oSounds[i].sName, oSounds[i].nVolume);
}
}
}
function DoMuteMusic() {
bMuteMusic = true;
for (var i in oSounds) {
if (isMusic(oSounds[i].sName)) {
oSounds[oSounds[i].sName].sSound.setVolume(0);
}
}
}
function UndoMuteMusic() {
bMuteMusic = false;
for (var i in oSounds) {
if (isMusic(oSounds[i].sName)) {
setVolumeSound(oSounds[i].sName, oSounds[i].nVolume);
}
}
}
function enterFrame() {
for (var i in aTabSonFade) {
var _local2 = aTabSonFade[i][0];
var _local3 = aTabSonFade[i][1];
var _local4 = aTabSonFade[i][2];
var _local5 = aTabSonFade[i][3];
if (_local4 == "In") {
_local5 = _local5 + nFadingSpeed;
if (_local5 >= _local3) {
_local5 = _local3;
deleteFading(_local2);
if (aTabSonFade.length == 0) {
delete oSounds[_local2].mcRef.onEnterFrame;
}
}
} else {
_local5 = _local5 - nFadingSpeed;
if (_local5 <= 0) {
stopSound(_local2);
_local5 = 0;
deleteFading(_local2);
if (aTabSonFade.length == 0) {
delete oSounds[_local2].mcRef.onEnterFrame;
}
}
}
if (_local5 != 0) {
aTabSonFade[i][3] = _local5;
}
setVolumeSound(_local2, _local5);
}
}
function deleteFading(_sName) {
var _local3 = 0;
for ( ; _local3 <= aTabSonFade.length ; _local3++) {
if (aTabSonFade[_local3][0] == _sName) {
aTabSonFade.splice(_local3, 1);
}
}
}
function init() {
oSounds = {};
aTabSonFade = [];
bMuteMusic = false;
bMuteSound = false;
nDepth = 0;
nFadingSpeed = nFADE_SPEED;
}
function exist(_sName) {
var _local3 = false;
if (oSounds[_sName]) {
_local3 = true;
}
return(_local3);
}
function isMusic(_sName) {
var _local3 = false;
if ((_sName == Controller.GAME_MUSIC_NAME) || ((_sName == Controller.PACKAGING_INTRO_MUSIC_NAME) || (_sName == Controller.PACKAGING_MUSIC_NAME))) {
_local3 = true;
}
return(_local3);
}
//ASSetPropFlags(_local1, null, 1);
static var nFADE_SPEED = 5;
}
Symbol 1145 MovieClip [__Packages.StartPopUp] Frame 0
#initclip
if (!StartPopUp) {
//(_global.StartPopUp = function (_mcRef) {
super(_mcRef);
}) extends PopUp
var _local1 = (_global.StartPopUp /* register */).prototype;
_local1.doShow = function () {
var _local3 = this.sState;
super.doShow();
if (_local3 == PopUp.sSTATE_IDLE) {
Controller.getRef().pauseGame();
}
};
_local1.doInstantShow = function () {
var _local3 = this.sState;
super.doInstantShow();
if (_local3 == PopUp.sSTATE_IDLE) {
Controller.getRef().pauseGame();
}
};
_local1.doHide = function () {
var _local3 = this.sState;
var _local4 = this.mcRef.mcState.mcPanel.mcSongs._currentframe;
super.doHide();
if (_local3 == PopUp.sSTATE_OPENED) {
this.mcRef.mcState.mcPanel.mcSongs.gotoAndPlay(_local4);
Controller.getRef().unPauseGame();
CTRLGame.getRef().Screen.getInterface().doShow();
}
};
_local1.doInstantHide = function () {
var _local3 = this.sState;
super.doInstantHide();
if (_local3 == PopUp.sSTATE_OPENED) {
Controller.getRef().unPauseGame();
CTRLGame.getRef().Screen.getInterface().doShow();
}
};
_local1.clickStartButton = function () {
Controller.getRef().playClickSound();
this.doHide();
};
_local1.initPopUp = function () {
this.mcRef.mcState.mcPanel.btnStart.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnStart.onRelease = Delegate.create(this, this.clickStartButton);
};
ASSetPropFlags(_local1, null, 1);
}
#endinitclip
Symbol 1146 MovieClip [__Packages.CheatPopUp] Frame 0
#initclip
if (!CheatPopUp) {
//(_global.CheatPopUp = function (_mcRef) {
super(_mcRef);
}) extends PopUp
var _local1 = (_global.CheatPopUp /* register */).prototype;
_local1.doShow = function () {
if (this.sState == PopUp.sSTATE_IDLE) {
this.setState(PopUp.sSTATE_OPENING);
this.nCount = 0;
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(CheatPopUp.sSTATE_CHEAT_EMPTY);
}
};
_local1.doHide = function () {
if (this.sState == PopUp.sSTATE_OPENED) {
var _local2 = this.mcRef.mcState.mcPanel.mcResult._currentframe;
var _local3 = this.mcRef.mcState.mcPanel.txtCheat.text;
this.setState(PopUp.sSTATE_CLOSING);
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(_local2);
this.mcRef.mcState.mcPanel.txtCheat.text = _local3;
}
};
_local1.clickCancelButton = function () {
Controller.getRef().playClickSound();
this.doHide();
};
_local1.clickEnterButton = function () {
Controller.getRef().playClickSound();
if (this.mcRef.mcState.mcPanel.txtCheat.text == LD.sCHEAT_CLOTHING) {
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(CheatPopUp.sSTATE_CHEAT_OUTFITS);
Main.getRef().setCheatClothes(true);
} else {
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(CheatPopUp.sSTATE_CHEAT_BADCODE);
}
Selection.setFocus(this.mcRef.mcState.mcPanel.txtCheat);
};
_local1.manageChange = function () {
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(CheatPopUp.sSTATE_CHEAT_EMPTY);
};
_local1.initPopUp = function () {
this.mcRef.mcState.mcPanel.btnCancel.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnCancel.onRelease = Delegate.create(this, this.clickCancelButton);
this.mcRef.mcState.mcPanel.btnEnter.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnEnter.onRelease = Delegate.create(this, this.clickEnterButton);
this.mcRef.mcState.mcPanel.txtCheat.tabIndex = 101;
this.mcRef.mcState.mcPanel.txtCheat.maxChars = CheatPopUp.nMAX_LENGTH_CODE;
this.mcRef.mcState.mcPanel.txtCheat.restrict = CheatPopUp.sCODE_CHARS_ALLOWED;
this.mcRef.mcState.mcPanel.txtCheat.onChanged = Delegate.create(this, this.manageChange);
Selection.setFocus(this.mcRef.mcState.mcPanel.txtCheat);
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(CheatPopUp.sSTATE_CHEAT_EMPTY);
};
ASSetPropFlags(_local1, null, 1);
(_global.CheatPopUp /* register */).nMAX_LENGTH_CODE = 22;
(_global.CheatPopUp /* register */).sCODE_CHARS_ALLOWED = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 _!?.";
(_global.CheatPopUp /* register */).sSTATE_CHEAT_OUTFITS = "Outfits";
(_global.CheatPopUp /* register */).sSTATE_CHEAT_BADCODE = "BadCode";
(_global.CheatPopUp /* register */).sSTATE_CHEAT_EMPTY = "Empty";
}
#endinitclip
Symbol 1147 MovieClip [__Packages.CenterScreen] Frame 0
#initclip
if (!CenterScreen) {
//(_global.CenterScreen = function (_mcRef) {
super(_mcRef);
this.oCurrentMinigame = null;
this.oCurrentAlgae = null;
this.oCurrentJelly = null;
this.oCurrentWall = null;
this.oInterface = new Interface(this.mcRef.mcInterface);
this.oTransition = new MinigameTransition(this.mcRef.mcTransition);
this.sNextState = "";
this.setState(CenterScreen.sSTATE_IDLE);
}) extends State
var _local1 = (_global.CenterScreen /* register */).prototype;
_local1.cleanUp = function () {
super.cleanUp();
if (this.oCurrentMinigame != null) {
this.oCurrentMinigame.destroyMiniGame(true);
delete this.oCurrentMinigame;
this.oCurrentMinigame = null;
}
if (this.oCurrentAlgae != null) {
this.oCurrentAlgae.cleanUp();
delete this.oCurrentAlgae;
}
if (this.oCurrentJelly != null) {
this.oCurrentJelly.cleanUp();
delete this.oCurrentJelly;
}
if (this.oCurrentWall != null) {
this.oCurrentWall.cleanUp();
delete this.oCurrentWall;
}
};
_local1.startBreakTheWall = function (_oWall) {
if (!this.isInMiniGame()) {
this.oCurrentWall = _oWall;
this.goTo(CenterScreen.sSTATE_MG_BREAKWALL);
this.setState(CenterScreen.sSTATE_IDLE);
CTRLGame.getRef().Screen.getInterface().pauseTime();
CTRLGame.getRef().stopAnimElements();
}
};
_local1.startJellyFishSwarm = function (_oJelly) {
if (!this.isInMiniGame()) {
this.oCurrentJelly = _oJelly;
this.goTo(CenterScreen.sSTATE_MG_JELLYFISHSWARM);
this.setState(CenterScreen.sSTATE_IDLE);
CTRLGame.getRef().Screen.getInterface().pauseTime();
CTRLGame.getRef().stopAnimElements();
}
};
_local1.startPushTheBus = function (_oAlgae) {
if (!this.isInMiniGame()) {
this.oCurrentAlgae = _oAlgae;
this.goTo(CenterScreen.sSTATE_MG_PUSHBUS);
this.setState(CenterScreen.sSTATE_IDLE);
CTRLGame.getRef().Screen.getInterface().pauseTime();
CTRLGame.getRef().stopAnimElements();
}
};
_local1.isInMiniGame = function () {
var _local2 = false;
if ((this.sState == CenterScreen.sSTATE_MG_BREAKWALL) || ((this.sState == CenterScreen.sSTATE_MG_JELLYFISHSWARM) || ((this.sState == CenterScreen.sSTATE_MG_PUSHBUS) || (!this.oTransition.isInIdle())))) {
_local2 = true;
}
return(_local2);
};
_local1.manageAnim = function (_nNewDir, _nLastDir, _nMovement) {
if (_nMovement == 0) {
if (this.isSkippableState()) {
this.setState(CenterScreen.sSTATE_IDLE);
} else {
this.sNextState = CenterScreen.sSTATE_IDLE;
}
} else if (((_nNewDir == CTRLGame.nDIR_DOWN) && (_nLastDir == CTRLGame.nDIR_DOWN)) || (((_nNewDir == CTRLGame.nDIR_UP) && (_nLastDir == CTRLGame.nDIR_UP)) || (((_nNewDir == CTRLGame.nDIR_LEFT) && (_nLastDir == CTRLGame.nDIR_LEFT)) || ((_nNewDir == CTRLGame.nDIR_RIGHT) && (_nLastDir == CTRLGame.nDIR_RIGHT))))) {
if (this.isSkippableState()) {
this.setState(CenterScreen.sSTATE_MOVEFORWARD);
} else {
this.sNextState = CenterScreen.sSTATE_MOVEFORWARD;
}
} else if ((_nNewDir == CTRLGame.nDIR_DOWN) && (_nLastDir == CTRLGame.nDIR_UP)) {
if (this.isSkippableState()) {
this.setState(CenterScreen.sSTATE_TURN180_DOWN);
} else {
this.sNextState = CenterScreen.sSTATE_TURN180_DOWN;
}
} else if ((_nNewDir == CTRLGame.nDIR_RIGHT) && (_nLastDir == CTRLGame.nDIR_LEFT)) {
if (this.isSkippableState()) {
this.setState(CenterScreen.sSTATE_TURN180_LEFT);
} else {
this.sNextState = CenterScreen.sSTATE_TURN180_LEFT;
}
} else if ((_nNewDir == CTRLGame.nDIR_LEFT) && (_nLastDir == CTRLGame.nDIR_RIGHT)) {
if (this.isSkippableState()) {
this.setState(CenterScreen.sSTATE_TURN180_RIGHT);
} else {
this.sNextState = CenterScreen.sSTATE_TURN180_RIGHT;
}
} else if ((_nNewDir == CTRLGame.nDIR_UP) && (_nLastDir == CTRLGame.nDIR_DOWN)) {
if (this.isSkippableState()) {
this.setState(CenterScreen.sSTATE_TURN180_UP);
} else {
this.sNextState = CenterScreen.sSTATE_TURN180_UP;
}
} else if (((_nNewDir == CTRLGame.nDIR_DOWN) && (_nLastDir == CTRLGame.nDIR_LEFT)) || (((_nNewDir == CTRLGame.nDIR_LEFT) && (_nLastDir == CTRLGame.nDIR_UP)) || (((_nNewDir == CTRLGame.nDIR_UP) && (_nLastDir == CTRLGame.nDIR_RIGHT)) || ((_nNewDir == CTRLGame.nDIR_RIGHT) && (_nLastDir == CTRLGame.nDIR_DOWN))))) {
if (this.isSkippableState()) {
this.setState(CenterScreen.sSTATE_TURNLEFT);
} else {
this.sNextState = CenterScreen.sSTATE_TURNLEFT;
}
} else if (((_nNewDir == CTRLGame.nDIR_DOWN) && (_nLastDir == CTRLGame.nDIR_RIGHT)) || (((_nNewDir == CTRLGame.nDIR_RIGHT) && (_nLastDir == CTRLGame.nDIR_UP)) || (((_nNewDir == CTRLGame.nDIR_UP) && (_nLastDir == CTRLGame.nDIR_LEFT)) || ((_nNewDir == CTRLGame.nDIR_LEFT) && (_nLastDir == CTRLGame.nDIR_DOWN))))) {
if (this.isSkippableState()) {
this.setState(CenterScreen.sSTATE_TURNRIGHT);
} else {
this.sNextState = CenterScreen.sSTATE_TURNRIGHT;
}
}
};
_local1.setState = function (_sState) {
var _local4 = this.sState;
super.setState(_sState);
if (this.sState == CenterScreen.sSTATE_MG_BREAKWALL) {
this.oCurrentMinigame = new MiniGames.BTW.BreakTheWallMG(this.mcRef.mcState);
} else if (this.sState == CenterScreen.sSTATE_MG_JELLYFISHSWARM) {
this.oCurrentMinigame = new MiniGames.JFS.JellyFishSwarmMG(this.mcRef.mcState);
} else if (this.sState == CenterScreen.sSTATE_MG_PUSHBUS) {
this.oCurrentMinigame = new MiniGames.PTB.PushTheBusMG(this.mcRef.mcState);
}
if ((_local4 == CenterScreen.sSTATE_MG_BREAKWALL) || ((_local4 == CenterScreen.sSTATE_MG_JELLYFISHSWARM) || (_local4 == CenterScreen.sSTATE_MG_PUSHBUS))) {
if (this.sState == CenterScreen.sSTATE_IDLE) {
CTRLGame.getRef().Screen.getInterface().unPauseTime();
CTRLGame.getRef().resumeAnimElements();
}
}
};
_local1.getInterface = function () {
return(this.oInterface);
};
_local1.isSkippableState = function () {
var _local2 = false;
if ((this.sState == CenterScreen.sSTATE_MOVEFORWARD) || (this.sState == CenterScreen.sSTATE_IDLE)) {
_local2 = true;
}
return(_local2);
};
_local1.manageEndMiniGame = function () {
if (this.oCurrentMinigame.isFinished() && (this.oCurrentMinigame != null)) {
this.oCurrentMinigame.destroyMiniGame();
delete this.oCurrentMinigame;
this.oCurrentMinigame = null;
if (this.sState == CenterScreen.sSTATE_MG_BREAKWALL) {
this.oCurrentWall.cleanUp();
delete this.oCurrentWall;
this.oCurrentWall = null;
} else if (this.sState == CenterScreen.sSTATE_MG_JELLYFISHSWARM) {
this.oCurrentJelly.cleanUp();
delete this.oCurrentJelly;
this.oCurrentJelly = null;
} else {
this.oCurrentAlgae.cleanUp();
delete this.oCurrentAlgae;
this.oCurrentAlgae = null;
}
this.goTo(CenterScreen.sSTATE_IDLE);
}
};
_local1.manageTempState = function () {
if (this.stateFinished()) {
if (this.sNextState != "") {
this.setState(this.sNextState);
this.sNextState = "";
} else {
this.setState(CenterScreen.sSTATE_MOVEFORWARD);
}
}
};
_local1.goTo = function (_sState) {
this.oTransition.goTo(_sState);
};
_local1.Idle = function () {
};
_local1.MoveForward = function () {
};
_local1.TurnLeft = function () {
this.manageTempState();
};
_local1.TurnRight = function () {
this.manageTempState();
};
_local1.Turn180Left = function () {
this.manageTempState();
};
_local1.Turn180Right = function () {
this.manageTempState();
};
_local1.Turn180Up = function () {
this.manageTempState();
};
_local1.Turn180Down = function () {
this.manageTempState();
};
_local1.MG_BreakTheWall = function () {
this.manageEndMiniGame();
};
_local1.MG_JellyFishSwarm = function () {
this.manageEndMiniGame();
};
_local1.MG_PushTheBus = function () {
this.manageEndMiniGame();
};
ASSetPropFlags(_local1, null, 1);
(_global.CenterScreen /* register */).sSTATE_IDLE = "Idle";
(_global.CenterScreen /* register */).sSTATE_TURNLEFT = "TurnLeft";
(_global.CenterScreen /* register */).sSTATE_TURNRIGHT = "TurnRight";
(_global.CenterScreen /* register */).sSTATE_MOVEFORWARD = "MoveForward";
(_global.CenterScreen /* register */).sSTATE_TURN180_LEFT = "Turn180Left";
(_global.CenterScreen /* register */).sSTATE_TURN180_RIGHT = "Turn180Right";
(_global.CenterScreen /* register */).sSTATE_TURN180_UP = "Turn180Up";
(_global.CenterScreen /* register */).sSTATE_TURN180_DOWN = "Turn180Down";
(_global.CenterScreen /* register */).sSTATE_MG_BREAKWALL = "MG_BreakTheWall";
(_global.CenterScreen /* register */).sSTATE_MG_JELLYFISHSWARM = "MG_JellyFishSwarm";
(_global.CenterScreen /* register */).sSTATE_MG_PUSHBUS = "MG_PushTheBus";
}
#endinitclip
Symbol 1148 MovieClip [__Packages.MiniGames.BaseMiniGame] Frame 0
class MiniGames.BaseMiniGame extends State
{
var bOver, cleanUp, nTime, setState, mcRef, sState, oListener, stateFinished;
function BaseMiniGame (_mcRef) {
super(_mcRef);
bOver = false;
}
function initMiniGame() {
}
function validateEndMiniGame() {
}
function destroyMiniGame(_bQuitting) {
if ((_bQuitting == false) || (_bQuitting == undefined)) {
calculateScore();
}
cleanUp();
}
function calculateScore() {
}
function addScoreFromTimeLeft(_nTimeMax, _nSecondsValue) {
var _local4 = Math.round(_nTimeMax - (nTime / Main.nFRAME_RATE));
if (_local4 < 0) {
_local4 = 0;
}
_local4 = _local4 * _nSecondsValue;
if (_local4 > nSCORE_MAX) {
_local4 = nSCORE_MAX;
}
CTRLGame.getRef().addToScore(_local4);
}
function isFinished() {
return(bOver);
}
function showInstructions() {
setState(sSTATE_HOWTOPLAY_IN);
Controller.getRef().getSounds().playSound("Minigame_HowToPlay_In", Controller.nSFX_VOLUME, 1);
}
function doPause() {
super.doPause();
}
function doUnPause() {
super.doUnPause();
mcRef.stop();
}
function startGame() {
clearSkipKeys();
setState(sSTATE_MINIGAME);
CTRLGame.getRef().Screen.getInterface().unPauseTime();
initMiniGame();
nTime = 0;
}
function setVictory() {
setState(sSTATE_VICTORY);
CTRLGame.getRef().Screen.getInterface().pauseTime();
}
function pressKey() {
if ((Key.getCode() != Key.UP) && ((Key.getCode() != Key.DOWN) && ((Key.getCode() != Key.LEFT) && ((Key.getCode() != Key.RIGHT) && (sState == sSTATE_HOWTOPLAY_IDLE))))) {
skipInstructions();
}
}
function pressMouseButton() {
Controller.getRef().playClickSound();
skipInstructions();
}
function skipInstructions() {
clearSkipKeys();
onOutInstructions();
}
function onOutInstructions() {
setState(sSTATE_HOWTOPLAY_OUT);
Controller.getRef().getSounds().playSound("Minigame_HowToPlay_Out", Controller.nSFX_VOLUME, 1);
}
function clearSkipKeys() {
delete mcRef.mcState.btnSkip.onRelease;
delete mcRef.mcState.btnSkip2.onRelease;
delete mcRef.mcState.btnSkip2.onRollOver;
mcRef.mcState.btnSkip.onRelease = undefined;
mcRef.mcState.btnSkip2.onRelease = undefined;
mcRef.mcState.btnSkip2.onRollOver = undefined;
if (oListener != null) {
Key.removeListener(oListener);
delete oListener;
oListener = null;
}
}
function initSkipKeys() {
oListener = new Object();
oListener.onKeyDown = Delegate.create(this, pressKey);
Key.addListener(oListener);
mcRef.mcState.btnSkip.onRelease = Delegate.create(this, skipInstructions);
mcRef.mcState.btnSkip2.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
mcRef.mcState.btnSkip2.onRelease = Delegate.create(this, pressMouseButton);
}
function HowToPlayIn() {
if (stateFinished()) {
setState(sSTATE_HOWTOPLAY_IDLE);
initSkipKeys();
}
}
function HowToPlayIdle() {
if (stateFinished()) {
onOutInstructions();
}
}
function HowToPlayOut() {
if (stateFinished()) {
startGame();
}
}
function MiniGame() {
if (!Controller.getRef().isPaused()) {
nTime++;
validateEndMiniGame();
}
}
function Victory() {
if (stateFinished()) {
bOver = true;
}
}
static var sSTATE_HOWTOPLAY_IN = "HowToPlayIn";
static var sSTATE_HOWTOPLAY_IDLE = "HowToPlayIdle";
static var sSTATE_HOWTOPLAY_OUT = "HowToPlayOut";
static var sSTATE_MINIGAME = "MiniGame";
static var sSTATE_VICTORY = "Victory";
static var nSCORE_MAX = 1200;
static var nWAITING_TIME = 105;
}
Symbol 1149 MovieClip [__Packages.Algae] Frame 0
#initclip
if (!Algae) {
//(_global.Algae = function (_nX, _nY) {
super(CTRLGame.getRef().mcRef.attachMovie(Algae.sLINKAGE_NAME, Algae.sLINKAGE_NAME + Algae.nCOUNTER, this.calculateDepth(_nY, CTRLGame.nALGAE_ADD + Algae.nCOUNTER)));
Algae.nCOUNTER++;
this.mcRef._x = _nX;
this.mcRef._y = _nY;
this.setIdleState();
this.nCountDown = 0;
if (Controller.getRef().isPaused()) {
this.doPause();
}
}) extends State
var _local1 = (_global.Algae /* register */).prototype;
_local1.cleanUp = function () {
super.cleanUp();
this.mcRef.swapDepths(7777);
this.mcRef.removeMovieClip();
};
_local1.catchBus = function () {
this.setState(this.sSTATE_CATCHING);
};
_local1.setInactive = function () {
this.setState(this.sSTATE_FALLING);
this.nCountDown = this.nMAX_COUNTDOWN;
this.mcRef.swapDepths(this.mcRef.getDepth() - Algae.nSUBSTRACT_DEPTH);
};
_local1.isInactive = function () {
return(this.sState != this.sSTATE_IDLE);
};
_local1.setIdleState = function () {
var _local2 = Math.round(Math.random() * 42) + 1;
this.setState(this.sSTATE_IDLE);
this.mcRef.mcState.gotoAndPlay(_local2);
};
_local1.calculateDepth = function (_nY, _nAdd) {
var _local4 = ((Math.round(_nY) * Algae.nDEPTH_FACTOR) + Algae.nMIN_DEPTH) + _nAdd;
return(_local4);
};
_local1.Idle = function () {
};
_local1.Catching = function () {
if (this.stateFinished()) {
this.setState(this.sSTATE_CAUGHT);
}
};
_local1.Caught = function () {
};
_local1.Falling = function () {
if (this.stateFinished()) {
this.setState(this.sSTATE_FALLEN);
}
};
_local1.Fallen = function () {
if ((!Controller.getRef().isPaused()) && (!CTRLGame.getRef().Screen.isInMiniGame())) {
this.nCountDown--;
if (this.nCountDown <= 0) {
this.setState(this.sSTATE_RETURN);
}
}
};
_local1.Return = function () {
if (this.stateFinished()) {
this.setIdleState();
this.mcRef.swapDepths(this.mcRef.getDepth() + Algae.nSUBSTRACT_DEPTH);
}
};
ASSetPropFlags(_local1, null, 1);
(_global.Algae /* register */).sLINKAGE_NAME = "mcAlgae";
_local1.sSTATE_IDLE = "Idle";
_local1.sSTATE_CATCHING = "Catching";
_local1.sSTATE_CAUGHT = "Caught";
_local1.sSTATE_FALLING = "Falling";
_local1.sSTATE_FALLEN = "Fallen";
_local1.sSTATE_RETURN = "Return";
_local1.nMAX_COUNTDOWN = 200;
(_global.Algae /* register */).nCOUNTER = 0;
(_global.Algae /* register */).nMIN_DEPTH = 200012 /* 0x030D4C */;
(_global.Algae /* register */).nSUBSTRACT_DEPTH = 200000 /* 0x030D40 */;
(_global.Algae /* register */).nDEPTH_FACTOR = 25;
(_global.Algae /* register */).nMIN_WAIT_TIME = 50;
(_global.Algae /* register */).nMAX_WAIT_TIME = 250;
}
#endinitclip
Symbol 1150 MovieClip [__Packages.MovingObject] Frame 0
#initclip
if (!MovingObject) {
//(_global.MovingObject = function (_mcRef) {
super(_mcRef);
this.setState(MovingObject.sSTATE_RIGHT);
this.nCurrentDir = CTRLGame.nDIR_RIGHT;
this.nMovement = 0;
}) extends State
var _local1 = (_global.MovingObject /* register */).prototype;
_local1.__get__FuturePos = function () {
var _local2 = new Object();
_local2.x = 0;
_local2.y = 0;
switch (this.sState) {
case MovingObject.sSTATE_UP :
_local2.x = this.mcRef._x;
_local2.y = this.mcRef._y - this.nMovement;
break;
case MovingObject.sSTATE_DOWN :
_local2.x = this.mcRef._x;
_local2.y = this.mcRef._y + this.nMovement;
break;
case MovingObject.sSTATE_LEFT :
_local2.x = this.mcRef._x - this.nMovement;
_local2.y = this.mcRef._y;
break;
case MovingObject.sSTATE_RIGHT :
_local2.x = this.mcRef._x + this.nMovement;
_local2.y = this.mcRef._y;
break;
default :
_local2.x = this.mcRef._x;
_local2.y = this.mcRef._y;
}
return(_local2);
};
_local1.getMiCasePos = function () {
var _local2 = 0.5 * MovingObject.nMAX_MOVEMENT;
var _local3 = new Object();
_local3.x = 0;
_local3.y = 0;
switch (this.sState) {
case MovingObject.sSTATE_UP :
_local3.x = this.mcRef._x;
_local3.y = this.mcRef._y - _local2;
break;
case MovingObject.sSTATE_DOWN :
_local3.x = this.mcRef._x;
_local3.y = this.mcRef._y + _local2;
break;
case MovingObject.sSTATE_LEFT :
_local3.x = this.mcRef._x - _local2;
_local3.y = this.mcRef._y;
break;
case MovingObject.sSTATE_RIGHT :
_local3.x = this.mcRef._x + _local2;
_local3.y = this.mcRef._y;
break;
default :
_local3.x = this.mcRef._x;
_local3.y = this.mcRef._y;
}
return(_local3);
};
_local1.__get__Moving = function () {
return(this.nMovement != 0);
};
_local1.getWishPos = function (_nDir) {
var _local3 = new Object();
_local3.x = 0;
_local3.y = 0;
switch (_nDir) {
case CTRLGame.nDIR_UP :
_local3.x = this.mcRef._x;
_local3.y = this.mcRef._y - MovingObject.nMAX_MOVEMENT;
break;
case CTRLGame.nDIR_DOWN :
_local3.x = this.mcRef._x;
_local3.y = this.mcRef._y + MovingObject.nMAX_MOVEMENT;
break;
case CTRLGame.nDIR_LEFT :
_local3.x = this.mcRef._x - MovingObject.nMAX_MOVEMENT;
_local3.y = this.mcRef._y;
break;
case CTRLGame.nDIR_RIGHT :
_local3.x = this.mcRef._x + MovingObject.nMAX_MOVEMENT;
_local3.y = this.mcRef._y;
break;
default :
_local3.x = this.mcRef._x;
_local3.y = this.mcRef._y;
}
return(_local3);
};
_local1.getWishMidPos = function (_nDir) {
var _local3 = new Object();
_local3.x = 0;
_local3.y = 0;
switch (_nDir) {
case CTRLGame.nDIR_UP :
_local3.x = this.mcRef._x;
_local3.y = this.mcRef._y - (0.5 * MovingObject.nMAX_MOVEMENT);
break;
case CTRLGame.nDIR_DOWN :
_local3.x = this.mcRef._x;
_local3.y = this.mcRef._y + (0.5 * MovingObject.nMAX_MOVEMENT);
break;
case CTRLGame.nDIR_LEFT :
_local3.x = this.mcRef._x - (0.5 * MovingObject.nMAX_MOVEMENT);
_local3.y = this.mcRef._y;
break;
case CTRLGame.nDIR_RIGHT :
_local3.x = this.mcRef._x + (0.5 * MovingObject.nMAX_MOVEMENT);
_local3.y = this.mcRef._y;
break;
default :
_local3.x = this.mcRef._x;
_local3.y = this.mcRef._y;
}
return(_local3);
};
_local1.canMove = function () {
var _local2 = false;
if ((!Controller.getRef().isPaused()) && (!CTRLGame.getRef().Screen.isInMiniGame())) {
_local2 = true;
}
return(_local2);
};
_local1.inverseDirection = function (_nCurrentDir) {
switch (_nCurrentDir) {
case CTRLGame.nDIR_UP :
var _local3 = CTRLGame.nDIR_DOWN;
break;
case CTRLGame.nDIR_DOWN :
_local3 = CTRLGame.nDIR_UP;
break;
case CTRLGame.nDIR_LEFT :
_local3 = CTRLGame.nDIR_RIGHT;
break;
case CTRLGame.nDIR_RIGHT :
_local3 = CTRLGame.nDIR_LEFT;
}
return(_local3);
};
_local1.isTrackOkay = function (_nFutureDir) {
var _local3 = false;
var _local4 = this.getWishPos(_nFutureDir);
var _local5 = CTRLGame.getRef().Maze.getVTracks(_local4.x, _local4.y);
var _local6 = CTRLGame.getRef().Maze.getHTracks(_local4.x, _local4.y);
switch (_nFutureDir) {
case CTRLGame.nDIR_UP :
case CTRLGame.nDIR_DOWN :
for (var i in _local5) {
if (_local5[i].hitTest(_local4.x, _local4.y, true)) {
_local3 = true;
break;
}
}
break;
case CTRLGame.nDIR_LEFT :
case CTRLGame.nDIR_RIGHT :
for (var i in _local6) {
if (_local6[i].hitTest(_local4.x, _local4.y, true)) {
_local3 = true;
break;
}
}
}
return(_local3);
};
_local1.manageMovement = function () {
};
_local1.IdleUp = function () {
};
_local1.IdleDown = function () {
};
_local1.IdleLeft = function () {
};
_local1.IdleRight = function () {
};
_local1.Left = function () {
};
_local1.Up = function () {
};
_local1.Right = function () {
};
_local1.Down = function () {
};
_local1.addProperty("Moving", _local1.__get__Moving, function () {
});
_local1.addProperty("FuturePos", _local1.__get__FuturePos, function () {
});
ASSetPropFlags(_local1, null, 1);
(_global.MovingObject /* register */).sSTATE_IDLE_UP = "IdleUp";
(_global.MovingObject /* register */).sSTATE_IDLE_DOWN = "IdleDown";
(_global.MovingObject /* register */).sSTATE_IDLE_LEFT = "IdleLeft";
(_global.MovingObject /* register */).sSTATE_IDLE_RIGHT = "IdleRight";
(_global.MovingObject /* register */).sSTATE_LEFT = "Left";
(_global.MovingObject /* register */).sSTATE_RIGHT = "Right";
(_global.MovingObject /* register */).sSTATE_UP = "Up";
(_global.MovingObject /* register */).sSTATE_DOWN = "Down";
(_global.MovingObject /* register */).nMAX_MOVEMENT = 20;
}
#endinitclip
Symbol 1151 MovieClip [__Packages.RoamingJellyFish] Frame 0
#initclip
if (!RoamingJellyFish) {
//(_global.RoamingJellyFish = function (_nX, _nY) {
super(CTRLGame.getRef().mcRef.attachMovie(RoamingJellyFish.sLINKAGE_NAME, RoamingJellyFish.sLINKAGE_NAME + RoamingJellyFish.nCOUNTER, CTRLGame.nMIN_DEPTH));
this.nId = RoamingJellyFish.nCOUNTER++;
this.mcRef._x = _nX;
this.mcRef._y = _nY;
this.adaptDepth();
var _local5 = Math.round(Math.random() * 66) + 1;
this.mcRef.mcState.jelly.jelly.gotoAndPlay(_local5);
this.nWaitTime = 0;
if (Controller.getRef().isPaused()) {
this.doPause();
}
}) extends MovingObject
var _local1 = (_global.RoamingJellyFish /* register */).prototype;
_local1.stopRoaming = function () {
this.setState(RoamingJellyFish.sSTATE_STOPROAM);
};
_local1.calculateDepth = function (_nY, _nAdd) {
var _local4 = ((Math.round(_nY) * RoamingJellyFish.nDEPTH_FACTOR) + RoamingJellyFish.nMIN_DEPTH) + _nAdd;
return(_local4);
};
_local1.cleanUp = function () {
super.cleanUp();
this.mcRef.swapDepths(7777);
this.mcRef.removeMovieClip();
};
_local1.doPause = function () {
super.doPause();
this.mcRef.mcState.jelly.jelly.stop();
this.mcRef.mcState.shadow.stop();
};
_local1.doUnPause = function () {
if (!CTRLGame.getRef().Screen.isInMiniGame()) {
super.doUnPause();
this.mcRef.mcState.jelly.jelly.play();
this.mcRef.mcState.shadow.play();
}
};
_local1.resumeAnim = function () {
super.doUnPause();
this.mcRef.mcState.jelly.jelly.play();
this.mcRef.mcState.shadow.play();
};
_local1.adaptDepth = function () {
this.mcRef.swapDepths(this.calculateDepth(this.mcRef._y, CTRLGame.nJELLYFISH_ADD + this.nId));
};
_local1.manageMovement = function () {
if (this.canMove() && (this.nMovement == 0)) {
if ((this.sState == MovingObject.sSTATE_DOWN) || ((this.sState == MovingObject.sSTATE_UP) || ((this.sState == MovingObject.sSTATE_LEFT) || (this.sState == MovingObject.sSTATE_RIGHT)))) {
this.setIdleState();
} else if (this.isNextMoveGood(this.nCurrentDir)) {
switch (this.nCurrentDir) {
case CTRLGame.nDIR_UP :
this.setState(MovingObject.sSTATE_UP);
break;
case CTRLGame.nDIR_DOWN :
this.setState(MovingObject.sSTATE_DOWN);
break;
case CTRLGame.nDIR_LEFT :
this.setState(MovingObject.sSTATE_LEFT);
break;
case CTRLGame.nDIR_RIGHT :
this.setState(MovingObject.sSTATE_RIGHT);
break;
}
this.nMovement = MovingObject.nMAX_MOVEMENT;
} else {
do {
var _local2 = Math.round(Math.random() * 3);
} while (_local2 == this.nCurrentDir);
if (this.isNextMoveGood(_local2)) {
if (_local2 == CTRLGame.nDIR_UP) {
this.setState(MovingObject.sSTATE_UP);
} else if (_local2 == CTRLGame.nDIR_DOWN) {
this.setState(MovingObject.sSTATE_DOWN);
} else if (_local2 == CTRLGame.nDIR_LEFT) {
this.setState(MovingObject.sSTATE_LEFT);
} else {
this.setState(MovingObject.sSTATE_RIGHT);
}
this.nCurrentDir = _local2;
this.nMovement = MovingObject.nMAX_MOVEMENT;
} else {
this.setIdleState();
}
}
}
};
_local1.setIdleState = function () {
this.nWaitTime = RoamingJellyFish.nMAX_WAIT_TIME;
switch (this.nCurrentDir) {
case CTRLGame.nDIR_UP :
this.setState(MovingObject.sSTATE_IDLE_UP);
break;
case CTRLGame.nDIR_DOWN :
this.setState(MovingObject.sSTATE_IDLE_DOWN);
break;
case CTRLGame.nDIR_LEFT :
this.setState(MovingObject.sSTATE_IDLE_LEFT);
break;
case CTRLGame.nDIR_RIGHT :
this.setState(MovingObject.sSTATE_IDLE_RIGHT);
}
};
_local1.isNextMoveGood = function (_nNextDir) {
var _local3 = this.getWishPos(_nNextDir);
var _local4 = this.getWishMidPos(_nNextDir);
var _local5 = false;
if (this.isTrackOkay(_nNextDir) && ((!CTRLGame.getRef().isTouchingWall(_local4.x, _local4.y)) && ((!CTRLGame.getRef().isJellyTouchingDirtWall(_local3.x, _local3.y)) && ((!CTRLGame.getRef().isJellyTouchingAlguae(_local3.x, _local3.y)) && (!CTRLGame.getRef().isJellyTouchingJelly(_local3.x, _local3.y, this)))))) {
_local5 = true;
}
return(_local5);
};
_local1.IdleUp = function () {
if (this.canMove()) {
if (this.nWaitTime > 0) {
this.nWaitTime--;
}
if (this.nWaitTime <= 0) {
this.manageMovement();
}
}
};
_local1.IdleDown = function () {
if (this.canMove()) {
if (this.nWaitTime > 0) {
this.nWaitTime--;
}
if (this.nWaitTime <= 0) {
this.manageMovement();
}
}
};
_local1.IdleLeft = function () {
if (this.canMove()) {
if (this.nWaitTime > 0) {
this.nWaitTime--;
}
if (this.nWaitTime <= 0) {
this.manageMovement();
}
}
};
_local1.IdleRight = function () {
if (this.canMove()) {
if (this.nWaitTime > 0) {
this.nWaitTime--;
}
if (this.nWaitTime <= 0) {
this.manageMovement();
}
}
};
_local1.Left = function () {
if ((this.nMovement > 0) && (this.canMove())) {
this.mcRef._x = this.mcRef._x - RoamingJellyFish.nSPEED;
this.nMovement = this.nMovement - RoamingJellyFish.nSPEED;
}
this.manageMovement();
};
_local1.Up = function () {
if ((this.nMovement > 0) && (this.canMove())) {
this.mcRef._y = this.mcRef._y - RoamingJellyFish.nSPEED;
this.nMovement = this.nMovement - RoamingJellyFish.nSPEED;
this.adaptDepth();
}
this.manageMovement();
};
_local1.Right = function () {
if ((this.nMovement > 0) && (this.canMove())) {
this.mcRef._x = this.mcRef._x + RoamingJellyFish.nSPEED;
this.nMovement = this.nMovement - RoamingJellyFish.nSPEED;
}
this.manageMovement();
};
_local1.Down = function () {
if ((this.nMovement > 0) && (this.canMove())) {
this.mcRef._y = this.mcRef._y + RoamingJellyFish.nSPEED;
this.nMovement = this.nMovement - RoamingJellyFish.nSPEED;
this.adaptDepth();
}
this.manageMovement();
};
_local1.StopRoam = function () {
};
ASSetPropFlags(_local1, null, 1);
(_global.RoamingJellyFish /* register */).sLINKAGE_NAME = "mcJellyFish";
(_global.RoamingJellyFish /* register */).nCOUNTER = 0;
(_global.RoamingJellyFish /* register */).sSTATE_STOPROAM = "StopRoam";
(_global.RoamingJellyFish /* register */).nSPEED = 1;
(_global.RoamingJellyFish /* register */).nMAX_WAIT_TIME = 75;
(_global.RoamingJellyFish /* register */).nMIN_DEPTH = 300000 /* 0x0493E0 */;
(_global.RoamingJellyFish /* register */).nDEPTH_FACTOR = 25;
}
#endinitclip
Symbol 1152 MovieClip [__Packages.DirtWall] Frame 0
#initclip
if (!DirtWall) {
//(_global.DirtWall = function (_nX, _nY) {
super(CTRLGame.getRef().mcRef.attachMovie(DirtWall.sLINKAGE_NAME, DirtWall.sLINKAGE_NAME + DirtWall.nCOUNTER, CTRLGame.getRef().calculateDepth(_nY, CTRLGame.nDIRT_WALL_ADD + DirtWall.nCOUNTER)));
DirtWall.nCOUNTER++;
this.mcRef._x = _nX;
this.mcRef._y = _nY;
this.nWaitTime = Math.round(Math.random() * (DirtWall.nMAX_WAIT_TIME - DirtWall.nMIN_WAIT_TIME)) + DirtWall.nMIN_WAIT_TIME;
if (this.nWaitTime == 0) {
this.setState(this.sSTATE_FALL);
} else {
this.setState(this.sSTATE_IDLE);
}
if (Controller.getRef().isPaused()) {
this.doPause();
}
}) extends State
var _local1 = (_global.DirtWall /* register */).prototype;
_local1.cleanUp = function () {
super.cleanUp();
this.mcRef.swapDepths(7777);
this.mcRef.removeMovieClip();
};
_local1.doPause = function () {
super.doPause();
for (var i in this.mcRef.mcState) {
this.mcRef.mcState[i].stop();
}
};
_local1.doUnPause = function () {
if (!CTRLGame.getRef().Screen.isInMiniGame()) {
super.doUnPause();
for (var i in this.mcRef.mcState) {
this.mcRef.mcState[i].play();
}
}
};
_local1.resumeAnim = function () {
super.doUnPause();
for (var i in this.mcRef.mcState) {
this.mcRef.mcState[i].play();
}
};
_local1.Idle = function () {
if ((!Controller.getRef().isPaused()) && (!CTRLGame.getRef().Screen.isInMiniGame())) {
this.nWaitTime--;
if (this.nWaitTime <= 0) {
this.setState(this.sSTATE_FALL);
}
}
};
_local1.Fall = function () {
if ((!Controller.getRef().isPaused()) && (!CTRLGame.getRef().Screen.isInMiniGame())) {
if (this.stateFinished()) {
this.setState(this.sSTATE_IDLE);
this.nWaitTime = Math.round(Math.random() * (DirtWall.nMAX_WAIT_TIME - DirtWall.nMIN_WAIT_TIME)) + DirtWall.nMIN_WAIT_TIME;
}
}
};
ASSetPropFlags(_local1, null, 1);
(_global.DirtWall /* register */).sLINKAGE_NAME = "mcDirtWall";
_local1.sSTATE_IDLE = "Idle";
_local1.sSTATE_FALL = "Fall";
(_global.DirtWall /* register */).nMIN_WAIT_TIME = 200;
(_global.DirtWall /* register */).nMAX_WAIT_TIME = 500;
(_global.DirtWall /* register */).nCOUNTER = 0;
}
#endinitclip
Symbol 1153 MovieClip [__Packages.Interface] Frame 0
#initclip
if (!Interface) {
//(_global.Interface = function (_mcRef) {
super(_mcRef);
CTRLGame.getRef().modifyTime(LD.getSongsMax(CTRLGame.getRef().Level));
this.bTimePaused = false;
this.setState(Interface.sSTATE_IDLE);
}) extends State
var _local1 = (_global.Interface /* register */).prototype;
_local1.doShow = function () {
if (this.sState == Interface.sSTATE_IDLE) {
this.setState(Interface.sSTATE_SHOW);
CTRLGame.getRef().modifyTime(LD.getSongsMax(CTRLGame.getRef().Level));
this.mcRef.btnMenu.onRollOver = Delegate.create(Main.getRef(), Main.getRef().rollOverButton);
this.mcRef.btnMenu.onRelease = Delegate.create(Main.getRef(), Main.getRef().clickMenuButton);
this.setScoreValue(CTRLGame.getRef().Score);
}
};
_local1.doHide = function () {
if (this.sState != Interface.sSTATE_IDLE) {
this.setState(Interface.sSTATE_IDLE);
}
};
_local1.setScoreValue = function (_nScore) {
if (this.sState == Interface.sSTATE_SHOW) {
this.mcRef.txtScore.text = Utils.styleNumber(_nScore);
}
};
_local1.doPause = function () {
};
_local1.doUnPause = function () {
};
_local1.pauseTime = function () {
this.bTimePaused = true;
};
_local1.unPauseTime = function () {
this.bTimePaused = false;
};
_local1.setToLife = function (_nValue) {
CTRLGame.getRef().modifyTime(CTRLGame.getRef().Songs + _nValue);
if (CTRLGame.getRef().Songs < 0) {
CTRLGame.getRef().modifyTime(0);
} else if (CTRLGame.getRef().Songs > LD.getSongsMax(CTRLGame.getRef().Level)) {
CTRLGame.getRef().modifyTime(LD.getSongsMax(CTRLGame.getRef().Level));
}
};
_local1.Idle = function () {
};
_local1.ShowScreen = function () {
if ((!Controller.getRef().isPaused()) && (!this.bTimePaused)) {
if (CTRLGame.getRef().Songs > 0) {
CTRLGame.getRef().modifyTime(CTRLGame.getRef().Songs - 1);
} else {
Main.getRef().loseGame();
}
}
var _local2 = this.mcRef.mcSongs._totalframes - Math.round((CTRLGame.getRef().Songs / LD.getSongsMax(CTRLGame.getRef().Level)) * 100);
if (_local2 <= 0) {
_local2 = 1;
}
this.mcRef.mcSongs.gotoAndStop(_local2);
};
ASSetPropFlags(_local1, null, 1);
(_global.Interface /* register */).sSTATE_IDLE = "Idle";
(_global.Interface /* register */).sSTATE_SHOW = "ShowScreen";
}
#endinitclip
Symbol 1154 MovieClip [__Packages.MinigameTransition] Frame 0
#initclip
if (!MinigameTransition) {
//(_global.MinigameTransition = function (_mcRef) {
super(_mcRef);
this.setState(MinigameTransition.sSTATE_IDLE);
this.bIsLeft = Math.round(Math.random());
}) extends State
var _local1 = (_global.MinigameTransition /* register */).prototype;
_local1.isInIdle = function () {
var _local2 = false;
if (this.sState == MinigameTransition.sSTATE_IDLE) {
_local2 = true;
}
return(_local2);
};
_local1.goTo = function (_sGoingTo) {
this.sGoingTo = _sGoingTo;
if (this.sState == MinigameTransition.sSTATE_IDLE) {
if (this.bIsLeft) {
this.setState(MinigameTransition.sSTATE_PLAY_RIGHT);
this.bIsLeft = false;
} else {
this.setState(MinigameTransition.sSTATE_PLAY_LEFT);
this.bIsLeft = true;
}
}
};
_local1.doPause = function () {
};
_local1.doUnPause = function () {
};
_local1.managePlayAnim = function () {
if (this.stateFinished()) {
this.setState(MinigameTransition.sSTATE_IDLE);
} else if (this.mcRef.mcState._currentframe == MinigameTransition.nFRAME_CHANGE) {
CTRLGame.getRef().Screen.setState(this.sGoingTo);
}
};
_local1.Idle = function () {
};
_local1.PlayLeft = function () {
this.managePlayAnim();
};
_local1.PlayRight = function () {
this.managePlayAnim();
};
ASSetPropFlags(_local1, null, 1);
(_global.MinigameTransition /* register */).sSTATE_IDLE = "Idle";
(_global.MinigameTransition /* register */).sSTATE_PLAY_LEFT = "PlayLeft";
(_global.MinigameTransition /* register */).sSTATE_PLAY_RIGHT = "PlayRight";
(_global.MinigameTransition /* register */).nFRAME_CHANGE = 15;
}
#endinitclip
Symbol 1155 MovieClip [__Packages.MiniGames.BTW.BreakTheWallMG] Frame 0
class MiniGames.BTW.BreakTheWallMG extends MiniGames.BaseMiniGame
{
var showInstructions, aBalls, oSpongeBob, mcRef, oWallPart1, oWallPart2, oWallPart3, oWallPart4, oWallPart5, oWallPart6, addScoreFromTimeLeft, setVictory, sState, bOver;
function BreakTheWallMG (_mcRef) {
super(_mcRef);
showInstructions();
}
function initMiniGame() {
aBalls = new Array();
oSpongeBob = new MiniGames.BTW.BTWSpongeBob(mcRef.mcState.mcBob, this);
oWallPart1 = new MiniGames.BTW.BTWWallPart(mcRef.mcState.mcPart1, this);
oWallPart2 = new MiniGames.BTW.BTWWallPart(mcRef.mcState.mcPart2, this);
oWallPart3 = new MiniGames.BTW.BTWWallPart(mcRef.mcState.mcPart3, this);
oWallPart4 = new MiniGames.BTW.BTWWallPart(mcRef.mcState.mcPart4, this);
oWallPart5 = new MiniGames.BTW.BTWWallPart(mcRef.mcState.mcPart5, this);
oWallPart6 = new MiniGames.BTW.BTWWallPart(mcRef.mcState.mcPart6, this);
}
function destroyMiniGame() {
super.destroyMiniGame();
oWallPart1.cleanUp();
oWallPart2.cleanUp();
oWallPart3.cleanUp();
oWallPart4.cleanUp();
oWallPart5.cleanUp();
oWallPart6.cleanUp();
oSpongeBob.cleanUp();
for (var i in aBalls) {
aBalls[i].cleanUp();
}
}
function calculateScore() {
addScoreFromTimeLeft(nMAX_TIME, nSECOND_VALUE);
}
function validateEndMiniGame() {
if (oWallPart1.isDestroyed() && (oWallPart2.isDestroyed() && (oWallPart3.isDestroyed() && (oWallPart4.isDestroyed() && (oWallPart5.isDestroyed() && (oWallPart6.isDestroyed())))))) {
setVictory();
}
}
function setState(_sState) {
super.setState(_sState);
if ((sState == MiniGames.BaseMiniGame.sSTATE_MINIGAME) || (sState == MiniGames.BaseMiniGame.sSTATE_VICTORY)) {
if (Main.getRef().isCheatClothesActivated()) {
mcRef.mcState.gotoAndStop(sSTATE_WHACKY);
} else {
mcRef.mcState.gotoAndStop(sSTATE_NORMAL);
}
} else if (Main.getRef().isCheatClothesActivated()) {
mcRef.mcBack.gotoAndStop(sSTATE_WHACKY);
} else {
mcRef.mcBack.gotoAndStop(sSTATE_NORMAL);
}
}
function doUnPause() {
super.doUnPause();
mcRef.stop();
mcRef.mcBack.stop();
if ((sState == MiniGames.BaseMiniGame.sSTATE_MINIGAME) || (sState == MiniGames.BaseMiniGame.sSTATE_VICTORY)) {
mcRef.mcState.stop();
}
}
function clickOnWall(_oSrc) {
oSpongeBob.throwABall(_oSrc);
}
function createBall(_oAimWall, _nX, _nY) {
aBalls.push(new MiniGames.BTW.BTWBall(mcRef.mcState, _oAimWall, _nX, _nY));
}
function MiniGame() {
super.MiniGame();
var _local3 = aBalls.length - 1;
for ( ; _local3 >= 0 ; _local3--) {
if (aBalls[_local3].isExploding()) {
aBalls[_local3].Target.damage();
} else if (aBalls[_local3].isDestroyed()) {
aBalls[_local3].cleanUp();
delete aBalls[_local3];
aBalls.splice(_local3, 1);
}
}
if (oWallPart1.isDestroyed() && (oWallPart3.isDestroyed() && (oWallPart5.isDestroyed()))) {
mcRef.mcState.mcShadowLeft._visible = false;
}
if (oWallPart2.isDestroyed() && (oWallPart4.isDestroyed() && (oWallPart6.isDestroyed()))) {
mcRef.mcState.mcShadowRight._visible = false;
}
}
function Victory() {
bOver = true;
}
static var sSTATE_NORMAL = "Normal";
static var sSTATE_WHACKY = "Whacky";
static var nMAX_TIME = 15;
static var nSECOND_VALUE = 100;
}
Symbol 1156 MovieClip [__Packages.MiniGames.BTW.BTWSpongeBob] Frame 0
class MiniGames.BTW.BTWSpongeBob extends State
{
var setState, oParent, oCurrentAim, sState, stateFinished, mcRef;
function BTWSpongeBob (_mcRef, _oParent) {
super(_mcRef);
setState(sSTATE_IDLE);
oParent = _oParent;
oCurrentAim = null;
}
function throwABall(_oCurrentAim) {
if (sState == sSTATE_IDLE) {
oCurrentAim = _oCurrentAim;
setState(sSTATE_THROW_BALL);
Controller.getRef().getSounds().playRandomSound(CTRLGame.nNB_THROW_SOUNDS, "IceBall_Throwed", Controller.nSFX_VOLUME);
}
}
function Idle() {
}
function ThrowBall() {
if (stateFinished()) {
setState(sSTATE_IDLE);
} else if (mcRef.mcState._currentframe == nBALL_THROWED_FRAME) {
var _local2 = new Object();
_local2.x = 0;
_local2.y = 0;
_local2.x = mcRef.mcState.mcBall._x;
_local2.y = mcRef.mcState.mcBall._y;
mcRef.mcState.localToGlobal(_local2);
mcRef._parent.globalToLocal(_local2);
oParent.createBall(oCurrentAim, _local2.x, _local2.y);
}
}
static var sSTATE_IDLE = "Idle";
static var sSTATE_THROW_BALL = "ThrowBall";
static var nBALL_THROWED_FRAME = 7;
}
Symbol 1157 MovieClip [__Packages.MiniGames.BTW.BTWWallPart] Frame 0
class MiniGames.BTW.BTWWallPart extends State
{
var setState, oParent, mcRef, sState;
function BTWWallPart (_mcRef, _oParent) {
super(_mcRef);
setState(sSTATE_IDLE);
oParent = _oParent;
mcRef.onRelease = Delegate.create(oParent, oParent.clickOnWall, this);
}
function cleanUp() {
delete mcRef.onRelease;
mcRef.onRelease = null;
}
function damage() {
var _local2 = sState;
switch (sState) {
case sSTATE_IDLE :
setState(sSTATE_CRACKED);
playCrackSound();
break;
case sSTATE_CRACKED :
setState(sSTATE_BROKEN);
playCrackSound();
break;
case sSTATE_BROKEN :
setState(sSTATE_DESTROYED);
playCrackSound();
break;
case sSTATE_DESTROYED :
}
if (_local2 != sSTATE_DESTROYED) {
mcRef.mcRocks.gotoAndPlay(1);
for (var i in mcRef.mcRocks) {
mcRef.mcRocks[i].gotoAndPlay(1);
}
}
}
function isDestroyed() {
var _local2 = false;
if (sState == sSTATE_DESTROYED) {
_local2 = true;
}
return(_local2);
}
function playCrackSound() {
Controller.getRef().getSounds().playRandomSound(nNB_CRACK_SOUNDS, "Wall_Cracked", nCRACK_VOLUME);
}
function Idle() {
}
function Cracked() {
}
function Broken() {
}
function Destroyed() {
}
static var sSTATE_IDLE = "Idle";
static var sSTATE_CRACKED = "Cracked";
static var sSTATE_BROKEN = "Broken";
static var sSTATE_DESTROYED = "Destroyed";
static var nNB_CRACK_SOUNDS = 2;
static var nCRACK_VOLUME = 30;
}
Symbol 1158 MovieClip [__Packages.MiniGames.BTW.BTWBall] Frame 0
class MiniGames.BTW.BTWBall extends State
{
var mcRef, isExplodingOnce, setState, oWallTarget, nX, nY, sState, stateFinished;
function BTWBall (_mcParent, _oWallTarget, _nX, _nY) {
super(_mcParent.attachMovie(sLINKAGE_BALL, "mcBall" + (++nCOUNTER), _mcParent.getNextHighestDepth()));
mcRef._x = _nX;
mcRef._y = _nY;
isExplodingOnce = false;
setState(sSTATE_MOVE);
oWallTarget = _oWallTarget;
var _local7 = mcRef._x - oWallTarget.mcRef._x;
var _local8 = mcRef._y - oWallTarget.mcRef._y;
var _local9 = _local8 / _local7;
nSPEED = (5 / 30) * _local7;
nX = nSPEED;
nY = _local9 * nSPEED;
if (_local7 > _local8) {
_local9 = _local7 / _local8;
nSPEED = (5 / 30) * _local8;
nX = _local9 * nSPEED;
nY = nSPEED;
}
setState(sSTATE_MOVE);
}
function cleanUp() {
mcRef.removeMovieClip();
}
function isDestroyed() {
var _local2 = false;
if (sState == sSTATE_DESTROYED) {
_local2 = true;
}
return(_local2);
}
function isExploding() {
var _local2 = false;
if ((sState == sSTATE_EXPLODE) && (isExplodingOnce == false)) {
_local2 = true;
isExplodingOnce = true;
}
return(_local2);
}
function get Target() {
return(oWallTarget);
}
function Move() {
if (!Controller.getRef().isPaused()) {
mcRef._x = mcRef._x - nX;
mcRef._y = mcRef._y - nY;
if ((mcRef._x <= oWallTarget.mcRef._x) && (mcRef._y <= oWallTarget.mcRef._y)) {
if (!oWallTarget.isDestroyed()) {
setState(sSTATE_EXPLODE);
Controller.getRef().getSounds().playRandomSound(nNB_SPLASH_SOUNDS, "IceBall_Splashed", nSPLASH_VOLUME);
} else {
setState(sSTATE_DESTROYED);
}
}
}
}
function Explode() {
if (stateFinished()) {
setState(sSTATE_DESTROYED);
}
}
function Destroyed() {
}
static var sSTATE_MOVE = "Move";
static var sSTATE_EXPLODE = "Explode";
static var sSTATE_DESTROYED = "Destroyed";
static var sLINKAGE_BALL = "SB_ASP_IceBall";
var nSPEED = 2;
static var nCOUNTER = 0;
static var nNB_SPLASH_SOUNDS = 5;
static var nSPLASH_VOLUME = 100;
}
Symbol 1159 MovieClip [__Packages.MiniGames.JFS.JellyFishSwarmMG] Frame 0
class MiniGames.JFS.JellyFishSwarmMG extends MiniGames.BaseMiniGame
{
var nNbJellyFish, showInstructions, oPatrick, mcRef, aJellyFishes, sState, setVictory, addScoreFromTimeLeft, bOver;
function JellyFishSwarmMG (_mcRef) {
super(_mcRef);
nNbJellyFish = 0;
showInstructions();
}
function initMiniGame() {
oPatrick = new MiniGames.JFS.JFSPatrick(mcRef.mcState.mcPatrick);
aJellyFishes = new Array();
for (var i in mcRef.mcState.mcContainer) {
aJellyFishes.push(new MiniGames.JFS.JFSJellyFish(mcRef.mcState.mcContainer[i], this));
nNbJellyFish++;
}
}
function setState(_sState) {
super.setState(_sState);
if ((sState == MiniGames.BaseMiniGame.sSTATE_MINIGAME) || (sState == MiniGames.BaseMiniGame.sSTATE_VICTORY)) {
if (Main.getRef().isCheatClothesActivated()) {
mcRef.mcState.gotoAndStop(sSTATE_WHACKY);
} else {
mcRef.mcState.gotoAndStop(sSTATE_NORMAL);
}
} else if (Main.getRef().isCheatClothesActivated()) {
mcRef.mcBack.gotoAndStop(sSTATE_WHACKY);
} else {
mcRef.mcBack.gotoAndStop(sSTATE_NORMAL);
}
}
function doUnPause() {
super.doUnPause();
mcRef.stop();
mcRef.mcBack.stop();
if ((sState == MiniGames.BaseMiniGame.sSTATE_MINIGAME) || (sState == MiniGames.BaseMiniGame.sSTATE_VICTORY)) {
mcRef.mcState.stop();
}
}
function validateEndMiniGame() {
if ((nNbJellyFish == 0) && (sState == MiniGames.BaseMiniGame.sSTATE_MINIGAME)) {
setVictory();
}
}
function destroyMiniGame() {
super.destroyMiniGame();
for (var i in aJellyFishes) {
aJellyFishes[i].cleanUp();
}
oPatrick.cleanUp();
}
function calculateScore() {
addScoreFromTimeLeft(nMAX_TIME, nSECOND_VALUE);
}
function decreaseJellyFishCount() {
if (nNbJellyFish > 0) {
nNbJellyFish--;
}
}
function takeHook(_oJelly) {
oPatrick.takeHook(_oJelly);
}
function MiniGame() {
super.MiniGame();
}
function Victory() {
if (mcRef.mcState.mcState._currentframe == (mcRef.mcState.mcState._totalframes - nBUFFER_TIME)) {
bOver = true;
}
}
static var sSTATE_NORMAL = "Normal";
static var sSTATE_WHACKY = "Whacky";
static var nMAX_TIME = 24;
static var nSECOND_VALUE = 100;
static var nBUFFER_TIME = 10;
}
Symbol 1160 MovieClip [__Packages.MiniGames.JFS.JFSPatrick] Frame 0
class MiniGames.JFS.JFSPatrick extends State
{
var oJelly, nX, nY, setState, sState, mcRef, stateFinished;
function JFSPatrick (_mcRef) {
super(_mcRef);
oJelly = null;
nX = 0;
nY = 0;
setState(sSTATE_IDLE);
}
function reel() {
if ((sState == aSTATES_IDLEHOOK[0]) || ((sState == aSTATES_IDLEHOOK[1]) || ((sState == aSTATES_IDLEHOOK[2]) || ((sState == aSTATES_IDLEHOOK[3]) || ((sState == aSTATES_IDLEHOOK[4]) || ((sState == aSTATES_IDLEHOOK[5]) || ((sState == aSTATES_IDLEHOOK[6]) || ((sState == aSTATES_IDLEHOOK[7]) || ((sState == aSTATES_IDLEHOOK[8]) || ((sState == aSTATES_IDLEHOOK[9]) || (sState == aSTATES_IDLEHOOK[10]))))))))))) {
setState(aSTATES_REEL[Number(oJelly.mcRef._name) - 1]);
Controller.getRef().getSounds().playRandomSound(nNB_FISHERROD_SOUNDS, "Reel", Controller.nSFX_VOLUME);
}
}
function takeHook(_oJelly) {
if (sState == sSTATE_IDLE) {
setState(aSTATES_TAKEHOOK[Number(_oJelly.mcRef._name) - 1]);
Controller.getRef().getSounds().playRandomSound(CTRLGame.nNB_THROW_SOUNDS, "IceBall_Throwed", Controller.nSFX_VOLUME);
oJelly = _oJelly;
oJelly.removeEvent();
nX = mcRef._xmouse;
nY = mcRef._ymouse;
}
}
function remove() {
var _local2 = mcRef._xmouse - nX;
var _local3 = mcRef._ymouse - nY;
if ((Math.abs(_local2) > nRANGE_DRAG) || (Math.abs(_local3) > nRANGE_DRAG)) {
reel();
}
}
function manageReel() {
if (mcRef.mcState._currentframe == nFRAME_REACT_JELLY) {
oJelly.react();
} else if (mcRef.mcState._currentframe == nFRAME_DETACH_JELLY) {
oJelly.leaveBus();
oJelly = null;
} else if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
function manageHook() {
if (stateFinished()) {
setState(aSTATES_IDLEHOOK[Number(oJelly.mcRef._name) - 1]);
}
}
function Idle() {
}
function Hook1() {
manageHook();
}
function Hook2() {
manageHook();
}
function Hook3() {
manageHook();
}
function Hook4() {
manageHook();
}
function Hook5() {
manageHook();
}
function Hook6() {
manageHook();
}
function Hook7() {
manageHook();
}
function Hook8() {
manageHook();
}
function Hook9() {
manageHook();
}
function Hook10() {
manageHook();
}
function Hook11() {
manageHook();
}
function IdleHook1() {
remove();
}
function IdleHook2() {
remove();
}
function IdleHook3() {
remove();
}
function IdleHook4() {
remove();
}
function IdleHook5() {
remove();
}
function IdleHook6() {
remove();
}
function IdleHook7() {
remove();
}
function IdleHook8() {
remove();
}
function IdleHook9() {
remove();
}
function IdleHook10() {
remove();
}
function IdleHook11() {
remove();
}
function Reel1() {
manageReel();
}
function Reel2() {
manageReel();
}
function Reel3() {
manageReel();
}
function Reel4() {
manageReel();
}
function Reel5() {
manageReel();
}
function Reel6() {
manageReel();
}
function Reel7() {
manageReel();
}
function Reel8() {
manageReel();
}
function Reel9() {
manageReel();
}
function Reel10() {
manageReel();
}
function Reel11() {
manageReel();
}
static var sSTATE_IDLE = "Idle";
static var aSTATES_TAKEHOOK = ["Hook1", "Hook2", "Hook3", "Hook4", "Hook5", "Hook6", "Hook7", "Hook8", "Hook9", "Hook10", "Hook11"];
static var aSTATES_IDLEHOOK = ["IdleHook1", "IdleHook2", "IdleHook3", "IdleHook4", "IdleHook5", "IdleHook6", "IdleHook7", "IdleHook8", "IdleHook9", "IdleHook10", "IdleHook11"];
static var aSTATES_REEL = ["Reel1", "Reel2", "Reel3", "Reel4", "Reel5", "Reel6", "Reel7", "Reel8", "Reel9", "Reel10", "Reel11"];
static var nNB_FISHERROD_SOUNDS = 4;
static var nRANGE_DRAG = 50;
static var nFRAME_REACT_JELLY = 2;
static var nFRAME_DETACH_JELLY = 8;
static var nDRAG_TIME = 7;
}
Symbol 1161 MovieClip [__Packages.MiniGames.JFS.JFSJellyFish] Frame 0
class MiniGames.JFS.JFSJellyFish extends State
{
var oParent, setState, mcRef, stateFinished;
function JFSJellyFish (_mcRef, _oParent) {
super(_mcRef);
oParent = _oParent;
setState(sSTATE_IDLE);
var _local5 = Math.round((Math.random() * mcRef.mcState._totalframes) - 1) + 1;
mcRef.mcState.gotoAndPlay(_local5);
mcRef.mcState.mcHeart.gotoAndPlay(_local5);
giveEvent();
}
function leaveBus() {
setState(sSTATE_REMOVING);
Controller.getRef().getSounds().playSound("JellyFish_Leave", Controller.nSFX_VOLUME, 1);
}
function giveEvent() {
mcRef.onPress = Delegate.create(this, register);
}
function removeEvent() {
delete mcRef.onPress;
mcRef.onPress = null;
}
function react() {
setState(sSTATE_REACT);
}
function doPause() {
super.doPause();
for (var i in mcRef.mcState) {
mcRef.mcState[i].stop();
}
}
function doUnPause() {
super.doUnPause();
for (var i in mcRef.mcState) {
mcRef.mcState[i].play();
}
}
function register() {
oParent.takeHook(this);
}
function Idle() {
}
function Removing() {
if (stateFinished()) {
setState(sSTATE_REMOVED);
oParent.decreaseJellyFishCount();
}
}
function React() {
}
function Removed() {
}
static var sSTATE_IDLE = "Idle";
static var sSTATE_REMOVING = "Removing";
static var sSTATE_REMOVED = "Removed";
static var sSTATE_REACT = "React";
}
Symbol 1162 MovieClip [__Packages.MiniGames.PTB.PushTheBusMG] Frame 0
class MiniGames.PTB.PushTheBusMG extends MiniGames.BaseMiniGame
{
var nDone, bModeSandy, nRange, nNumberTimes, nNextDir, showInstructions, mcRef, nPosX, addScoreFromTimeLeft, sState, initSkipKeys, startGame, bOver;
function PushTheBusMG (_mcRef) {
super(_mcRef);
nDone = 0;
if (CTRLGame.getRef().Level == CTRLGame.nLEVEL1) {
bModeSandy = true;
nRange = nRANGE_SANDY;
nNumberTimes = nTIME_TO_PUSH_SANDY;
} else {
bModeSandy = false;
nRange = nRANGE_BOB;
nNumberTimes = nTIME_TO_PUSH_BOB;
}
nNextDir = nDIR_LEFT;
showInstructions();
}
function initMiniGame() {
mcRef.mcState.mcMode.mcBus.mcStrenght.gotoAndStop(mcRef.mcState.mcStrenght._totalframes);
nPosX = 300;
}
function calculateScore() {
addScoreFromTimeLeft(nMAX_TIME, nSECOND_VALUE);
}
function validateEndMiniGame() {
if (nDone >= nNumberTimes) {
setVictory();
}
}
function setState(_sState) {
super.setState(_sState);
setPlayCharacter();
}
function doPause() {
super.doPause();
if (sState == MiniGames.BaseMiniGame.sSTATE_MINIGAME) {
mcRef.mcState.mcBus.stop();
} else if (sState == MiniGames.BaseMiniGame.sSTATE_VICTORY) {
mcRef.mcState.mcMode.stop();
mcRef.mcState.mcMode.mcBus.stop();
}
}
function doUnPause() {
super.doUnPause();
mcRef.mcState.stop();
if (sState == MiniGames.BaseMiniGame.sSTATE_MINIGAME) {
mcRef.mcState.mcBus.play();
} else if (sState == MiniGames.BaseMiniGame.sSTATE_VICTORY) {
mcRef.mcState.mcMode.play();
mcRef.mcState.mcMode.mcBus.play();
}
}
function setPlayCharacter() {
if (bModeSandy) {
if (Main.getRef().isCheatClothesActivated()) {
mcRef.mcState.gotoAndStop(sSTATE_SANDY_WHACKY);
} else {
mcRef.mcState.gotoAndStop(sSTATE_SANDY);
}
} else if (Main.getRef().isCheatClothesActivated()) {
mcRef.mcState.gotoAndStop(sSTATE_BOB_WHACKY);
} else {
mcRef.mcState.gotoAndStop(sSTATE_BOB);
}
var _local2 = (mcRef.mcState.mcMode.mcBus.mcStrenght._totalframes / nNumberTimes) * nDone;
mcRef.mcState.mcMode.mcBus.mcStrenght.gotoAndStop(100 - Math.round(_local2));
}
function onKeyPressed() {
nDone++;
var _local2 = (mcRef.mcState.mcMode.mcBus.mcStrenght._totalframes / nNumberTimes) * nDone;
mcRef.mcState.mcMode.mcBus.mcStrenght.gotoAndStop(100 - Math.round(_local2));
}
function validateActions() {
if (!Controller.getRef().isPaused()) {
if (nNextDir == nDIR_LEFT) {
if (CTRLGame.getRef().mcRef._xmouse <= (nPosX - nRange)) {
onKeyPressed();
nNextDir = nDIR_RIGHT;
}
} else if (nNextDir == nDIR_RIGHT) {
if (CTRLGame.getRef().mcRef._xmouse >= (nPosX + nRange)) {
nNextDir = nDIR_LEFT;
onKeyPressed();
}
}
}
}
function setVictory() {
setState(MiniGames.BaseMiniGame.sSTATE_VICTORY);
CTRLGame.getRef().Screen.getInterface().pauseTime();
mcRef.mcState.mcMode.mcBus.mcStrenght.stop();
Controller.getRef().getSounds().playSound("alguaetore", Controller.nSFX_VOLUME, 1);
}
function HowToPlayIn() {
if (mcRef.mcState.mcMode._currentframe == mcRef.mcState.mcMode._totalframes) {
setState(MiniGames.BaseMiniGame.sSTATE_HOWTOPLAY_IDLE);
initSkipKeys();
}
}
function HowToPlayIdle() {
if (mcRef.mcState.mcMode._currentframe == mcRef.mcState.mcMode._totalframes) {
setState(MiniGames.BaseMiniGame.sSTATE_HOWTOPLAY_OUT);
}
}
function HowToPlayOut() {
if (mcRef.mcState.mcMode._currentframe == mcRef.mcState.mcMode._totalframes) {
startGame();
}
}
function MiniGame() {
super.MiniGame();
validateActions();
}
function Victory() {
if (mcRef.mcState.mcMode._currentframe == (mcRef.mcState.mcMode._totalframes - 15)) {
bOver = true;
}
}
static var sSTATE_SANDY = "Sandy";
static var sSTATE_BOB = "SpongeBob";
static var sSTATE_SANDY_WHACKY = "SandyWhacky";
static var sSTATE_BOB_WHACKY = "BobWhacky";
static var nDIR_LEFT = 1;
static var nDIR_RIGHT = 2;
static var nTIME_TO_PUSH_SANDY = 40;
static var nTIME_TO_PUSH_BOB = 70;
static var nMAX_TIME = 16;
static var nSECOND_VALUE = 100;
static var nRANGE_SANDY = 40;
static var nRANGE_BOB = 40;
}
Symbol 1163 MovieClip [__Packages.AtlantisBus] Frame 0
#initclip
if (!AtlantisBus) {
//(_global.AtlantisBus = function () {
super(CTRLGame.getRef().mcRef.attachMovie(AtlantisBus.sLINKAGE_NAME, AtlantisBus.sLINKAGE_NAME, CTRLGame.getRef().calculateDepth(AtlantisBus.nINITIAL_Y, CTRLGame.nBUS_ADD)));
this.mcRef._x = AtlantisBus.nINITIAL_X;
this.mcRef._y = AtlantisBus.nINITIAL_Y;
this.bKeyEasterPressed = false;
if (!Main.getRef().EasterEgg) {
this.nKeyMoveUp = AtlantisBus.nMOVE_UP;
this.nKeyMoveDown = AtlantisBus.nMOVE_DOWN;
this.nKeyMoveLeft = AtlantisBus.nMOVE_LEFT;
this.nKeyMoveRight = AtlantisBus.nMOVE_RIGHT;
} else {
this.nKeyMoveUp = AtlantisBus.nMOVE_DOWN;
this.nKeyMoveDown = AtlantisBus.nMOVE_UP;
this.nKeyMoveLeft = AtlantisBus.nMOVE_RIGHT;
this.nKeyMoveRight = AtlantisBus.nMOVE_LEFT;
}
}) extends MovingObject
var _local1 = (_global.AtlantisBus /* register */).prototype;
_local1.cleanUp = function () {
super.cleanUp();
this.mcRef.swapDepths(7777);
this.mcRef.removeMovieClip();
};
_local1.doUnPause = function () {
if (!CTRLGame.getRef().Screen.isInMiniGame()) {
super.doUnPause();
}
};
_local1.resumeAnim = function () {
super.doUnPause();
};
_local1.checkObjects = function () {
CTRLGame.getRef().checkPowerUps();
CTRLGame.getRef().checkAlgaes();
CTRLGame.getRef().checkJellys();
CTRLGame.getRef().checkDirtWalls();
CTRLGame.getRef().checkFinish();
};
_local1.manageMovement = function () {
this.setupKeys();
if (this.canMove() && (this.nMovement == 0)) {
var _local2 = this.nCurrentDir;
if (Key.isDown(this.nKeyMoveUp)) {
if (this.isNextMoveGood(CTRLGame.nDIR_UP)) {
this.setState(MovingObject.sSTATE_UP);
this.nCurrentDir = CTRLGame.nDIR_UP;
this.nMovement = MovingObject.nMAX_MOVEMENT;
}
} else if (Key.isDown(this.nKeyMoveDown)) {
if (this.isNextMoveGood(CTRLGame.nDIR_DOWN)) {
this.setState(MovingObject.sSTATE_DOWN);
this.nCurrentDir = CTRLGame.nDIR_DOWN;
this.nMovement = MovingObject.nMAX_MOVEMENT;
}
} else if (Key.isDown(this.nKeyMoveLeft)) {
if (this.isNextMoveGood(CTRLGame.nDIR_LEFT)) {
this.setState(MovingObject.sSTATE_LEFT);
this.nCurrentDir = CTRLGame.nDIR_LEFT;
this.nMovement = MovingObject.nMAX_MOVEMENT;
}
} else if (Key.isDown(this.nKeyMoveRight)) {
if (this.isNextMoveGood(CTRLGame.nDIR_RIGHT)) {
this.setState(MovingObject.sSTATE_RIGHT);
this.nCurrentDir = CTRLGame.nDIR_RIGHT;
this.nMovement = MovingObject.nMAX_MOVEMENT;
}
}
if (this.nMovement == 0) {
switch (this.nCurrentDir) {
case CTRLGame.nDIR_UP :
this.setState(MovingObject.sSTATE_IDLE_UP);
break;
case CTRLGame.nDIR_DOWN :
this.setState(MovingObject.sSTATE_IDLE_DOWN);
break;
case CTRLGame.nDIR_LEFT :
this.setState(MovingObject.sSTATE_IDLE_LEFT);
break;
case CTRLGame.nDIR_RIGHT :
this.setState(MovingObject.sSTATE_IDLE_RIGHT);
}
}
CTRLGame.getRef().Screen.manageAnim(this.nCurrentDir, _local2, this.nMovement);
}
};
_local1.setupKeys = function () {
if (this.canMove()) {
if (!Key.isDown(AtlantisBus.nEASTER_EGG)) {
this.bKeyEasterPressed = false;
} else if (Key.isDown(AtlantisBus.nEASTER_EGG) && ((!Main.getRef().EasterEgg) && (!this.bKeyEasterPressed))) {
Main.getRef().setEasterEgg(true);
this.bKeyEasterPressed = true;
this.nKeyMoveUp = AtlantisBus.nMOVE_DOWN;
this.nKeyMoveDown = AtlantisBus.nMOVE_UP;
this.nKeyMoveLeft = AtlantisBus.nMOVE_RIGHT;
this.nKeyMoveRight = AtlantisBus.nMOVE_LEFT;
} else if (Key.isDown(AtlantisBus.nEASTER_EGG) && (Main.getRef().EasterEgg && (!this.bKeyEasterPressed))) {
Main.getRef().setEasterEgg(false);
this.bKeyEasterPressed = true;
this.nKeyMoveUp = AtlantisBus.nMOVE_UP;
this.nKeyMoveDown = AtlantisBus.nMOVE_DOWN;
this.nKeyMoveLeft = AtlantisBus.nMOVE_LEFT;
this.nKeyMoveRight = AtlantisBus.nMOVE_RIGHT;
}
}
};
_local1.isNextMoveGood = function (_nNextDir) {
var _local3 = this.getWishMidPos(_nNextDir);
var _local4 = false;
if (this.isTrackOkay(_nNextDir) && (!CTRLGame.getRef().isTouchingWall(_local3.x, _local3.y))) {
_local4 = true;
}
return(_local4);
};
_local1.adaptDepth = function () {
this.mcRef.swapDepths(CTRLGame.getRef().calculateDepth(this.mcRef._y, CTRLGame.nBUS_ADD));
};
_local1.manageIdle = function () {
this.manageMovement();
CTRLGame.getRef().checkJellys();
CTRLGame.getRef().checkAlgaes();
};
_local1.IdleUp = function () {
this.manageIdle();
};
_local1.IdleDown = function () {
this.manageIdle();
};
_local1.IdleLeft = function () {
this.manageIdle();
};
_local1.IdleRight = function () {
this.manageIdle();
};
_local1.Left = function () {
if ((this.nMovement > 0) && (this.canMove())) {
this.mcRef._x = this.mcRef._x - AtlantisBus.nSPEED;
this.nMovement = this.nMovement - AtlantisBus.nSPEED;
this.checkObjects();
}
this.manageMovement();
};
_local1.Up = function () {
if ((this.nMovement > 0) && (this.canMove())) {
this.mcRef._y = this.mcRef._y - AtlantisBus.nSPEED;
this.nMovement = this.nMovement - AtlantisBus.nSPEED;
this.adaptDepth();
this.checkObjects();
}
this.manageMovement();
};
_local1.Right = function () {
if ((this.nMovement > 0) && (this.canMove())) {
this.mcRef._x = this.mcRef._x + AtlantisBus.nSPEED;
this.nMovement = this.nMovement - AtlantisBus.nSPEED;
this.checkObjects();
}
this.manageMovement();
};
_local1.Down = function () {
if ((this.nMovement > 0) && (this.canMove())) {
this.mcRef._y = this.mcRef._y + AtlantisBus.nSPEED;
this.nMovement = this.nMovement - AtlantisBus.nSPEED;
this.adaptDepth();
this.checkObjects();
}
this.manageMovement();
};
ASSetPropFlags(_local1, null, 1);
(_global.AtlantisBus /* register */).sLINKAGE_NAME = "mcAtlantisBus";
(_global.AtlantisBus /* register */).nMOVE_UP = Key.UP;
(_global.AtlantisBus /* register */).nMOVE_DOWN = Key.DOWN;
(_global.AtlantisBus /* register */).nMOVE_LEFT = Key.LEFT;
(_global.AtlantisBus /* register */).nMOVE_RIGHT = Key.RIGHT;
(_global.AtlantisBus /* register */).nNO_KEY = -99;
(_global.AtlantisBus /* register */).nEASTER_EGG = 83;
(_global.AtlantisBus /* register */).nSPEED = 1;
(_global.AtlantisBus /* register */).nINITIAL_X = 10;
(_global.AtlantisBus /* register */).nINITIAL_Y = 170;
}
#endinitclip
Symbol 1164 MovieClip [__Packages.ActionWall] Frame 0
#initclip
if (!ActionWall) {
//(_global.ActionWall = function (_nType, _nX, _nY, _xScl) {
super(CTRLGame.getRef().mcRef.attachMovie(this.getLinkage(_nType), "mcMovingWall" + ActionWall.nCOUNTER, CTRLGame.getRef().calculateDepth(_nY, CTRLGame.nMOVING_WALL_ADD + ActionWall.nCOUNTER)));
ActionWall.nCOUNTER++;
this.mcRef._x = _nX;
this.mcRef._y = _nY;
this.mcRef._xscale = _xScl;
var _local7 = CTRLGame.getRef().Maze.getTabIndex(this.mcRef._x, this.mcRef._y);
if (CTRLGame.getRef().Maze.isPieceFlipped(_local7)) {
this.mcRef._xscale = -this.mcRef._xscale;
}
this.nType = _nType;
this.setState(ActionWall.sSTATE_CLOSED);
this.nSwitchRate = Math.round(Math.random() * (ActionWall.nMAX_TIME - ActionWall.nMIN_TIME)) + ActionWall.nMIN_TIME;
this.nLife = this.nSwitchRate;
}) extends State
var _local1 = (_global.ActionWall /* register */).prototype;
_local1.cleanUp = function () {
super.cleanUp();
this.mcRef.swapDepths(7777);
this.mcRef.removeMovieClip();
};
_local1.__get__Type = function () {
return(this.nType);
};
_local1.__get__Ref = function () {
return(this.mcRef);
};
_local1.manageStaticState = function (_sNextState) {
if ((!Controller.getRef().isPaused()) && (!CTRLGame.getRef().Screen.isInMiniGame())) {
if (this.nLife > 0) {
this.nLife--;
}
if (this.nLife == 0) {
if (this.nType == CTRLGame.nREVOLVER_WALL) {
if (CTRLGame.getRef().isOkayToTurnRevolver(this.mcRef.mcHit2, this.mcRef.mcHit2More)) {
this.setState(_sNextState);
this.nLife = this.nSwitchRate;
}
} else if (CTRLGame.getRef().isOkayToTurn(this.mcRef.mcHit2)) {
this.setState(_sNextState);
this.nLife = this.nSwitchRate;
}
}
}
};
_local1.getLinkage = function (_nType) {
if (_nType == CTRLGame.nTURN_WALL) {
var _local3 = ActionWall.sLINKAGE_NAME_DOOR;
} else if (_nType == CTRLGame.nREVOLVER_WALL) {
var _local3 = ActionWall.sLINKAGE_NAME_REVOLVER;
} else if (_nType == CTRLGame.nSLIDE_WALL_H) {
var _local3 = ActionWall.sLINKAGE_NAME_SLIDE_H;
} else if (_nType == CTRLGame.nTURN_WALL_INVERSE) {
var _local3 = ActionWall.sLINKAGE_NAME_DOOR_INVERSE;
} else {
var _local3 = ActionWall.sLINKAGE_NAME_SLIDE_V;
}
return(_local3);
};
_local1.Opened = function () {
this.manageStaticState(ActionWall.sSTATE_CLOSING);
};
_local1.Closing = function () {
if (this.stateFinished()) {
this.setState(ActionWall.sSTATE_CLOSED);
}
};
_local1.Closed = function () {
this.manageStaticState(ActionWall.sSTATE_OPENING);
};
_local1.Opening = function () {
if (this.stateFinished()) {
this.setState(ActionWall.sSTATE_OPENED);
}
};
_local1.addProperty("Ref", _local1.__get__Ref, function () {
});
_local1.addProperty("Type", _local1.__get__Type, function () {
});
ASSetPropFlags(_local1, null, 1);
(_global.ActionWall /* register */).sLINKAGE_NAME_DOOR = "mcDoor90";
(_global.ActionWall /* register */).sLINKAGE_NAME_DOOR_INVERSE = "mcDoor90Inverse";
(_global.ActionWall /* register */).sLINKAGE_NAME_REVOLVER = "mcRevolver";
(_global.ActionWall /* register */).sLINKAGE_NAME_SLIDE_H = "mcSlideH";
(_global.ActionWall /* register */).sLINKAGE_NAME_SLIDE_V = "mcSlideV";
(_global.ActionWall /* register */).sSTATE_OPENED = "Opened";
(_global.ActionWall /* register */).sSTATE_CLOSED = "Closed";
(_global.ActionWall /* register */).sSTATE_OPENING = "Opening";
(_global.ActionWall /* register */).sSTATE_CLOSING = "Closing";
(_global.ActionWall /* register */).nCOUNTER = 0;
(_global.ActionWall /* register */).nMIN_TIME = 40;
(_global.ActionWall /* register */).nMAX_TIME = 120;
}
#endinitclip
Symbol 504 MovieClip Frame 25
stop();
Symbol 505 MovieClip Frame 25
stop();
Symbol 532 Button
on (press) {
ControlScroll.scrollUp = true;
_global.P.fPlayBtnClick();
}
on (release, releaseOutside) {
ControlScroll.scrollUp = false;
}
on (rollOver) {
_global.P.fPlayBtnRollOver();
}
Symbol 533 Button
on (press) {
ControlScroll.scrollDown = true;
_global.P.fPlayBtnClick();
}
on (release, releaseOutside) {
ControlScroll.scrollDown = false;
}
on (rollOver) {
_global.P.fPlayBtnRollOver();
}
Instance of Symbol 528 MovieClip "ControlScroll" in Symbol 541 MovieClip Frame 1
onClipEvent (load) {
scrollUp = false;
scrollDown = false;
}
onClipEvent (enterFrame) {
if (scrollUp == true) {
_parent.txt_highScoreName.scroll--;
_parent.txt_highScoreScore.scroll--;
_parent.txt_highScoreNumber.scroll--;
} else if (scrollDown == true) {
_parent.txt_highScoreName.scroll++;
_parent.txt_highScoreScore.scroll++;
_parent.txt_highScoreNumber.scroll++;
}
}
Symbol 686 MovieClip Frame 27
stop();
Symbol 687 MovieClip Frame 27
stop();
Symbol 690 MovieClip Frame 20
stop();
Symbol 693 MovieClip Frame 1
_visible = false;
Symbol 1038 MovieClip Frame 1
stop();
Symbol 1051 MovieClip Frame 1
stop();