Frame 1
function getPoints(_callbackFunction, _functionScope) {
trace("getting points");
}
function awardPoints(_points, _callbackFunction, _functionScope) {
trace(("You earned " + _points) + " NickPoints");
}
_global.NICKTROPOLIS_ENABLED = false;
_global.CHEAT_ENABLED = false;
if (_global.NICKTROPOLIS_ENABLED) {
_global.gGetPoints = getPoints;
_global.gAwardPoints = awardPoints;
}
Stage.showMenu = false;
stop();
Frame 5
stop();
Frame 10
gotoAndStop ("game");
Frame 20
Array.prototype.indexOf = function (_oValue, _nStartIndex) {
var _local4 = this.length;
var _local3 = -1;
if (_nStartIndex == undefined) {
_nStartIndex = 0;
}
var _local2 = _nStartIndex;
while (_local2 < _local4) {
if (this[_local2] == _oValue) {
_local3 = _local2;
break;
}
_local2++;
}
return(_local3);
};
Array.prototype.shuffle = function (_nLevel) {
var _local3 = this.length;
var _local2 = 0;
while (_local2 < _nLevel) {
this.exchange(Math.floor(Math.random() * _local3), Math.floor(Math.random() * _local3));
_local2++;
}
};
Array.prototype.exchange = function (_nIndexA, _nIndexB) {
var _local2 = this[_nIndexA];
this[_nIndexA] = this[_nIndexB];
this[_nIndexB] = _local2;
};
Array.prototype.equals = function (_aArray) {
var _local3 = true;
if (this != _aArray) {
var _local2 = this.length;
if (_local2 != _aArray.length) {
_local3 = false;
} else {
while (_local2--) {
if (this[_local2] != _aArray[_local2]) {
_local3 = false;
break;
}
}
}
}
return(_local3);
};
Array.prototype.getRandom = function () {
return(this[Math.floor(Math.random() * this.length)]);
};
String.prototype.pad = function (_nLen, _sPad, _bRight) {
while (this.length < _nLen) {
if (_bRight == true) {
this=this + _sPad;//parameter overwritten
this + _sPad;
} else {
this=_sPad + this;//parameter overwritten
_sPad + this;
}
}
return(this);
};
ASSetPropFlags(Array.prototype, new Array("indexOf", "shuffle", "exchange", "equals", "getRandom"), 7);
ASSetPropFlags(String.prototype, new Array("pad"), 7);
_global.P = new FF_Package(this.mcPackage);
_global.C = new FF_CtrlGame(this);
_global.C.initGame();
stop();
Symbol 8 MovieClip Frame 1
this.onEnterFrame = function () {
var _local3 = _parent.getBytesLoaded() / _parent.getBytesTotal();
if (_local3 < 1) {
this.mcLoadBar.mcBar._xscale = _local3 * 100;
} else {
_parent.gotoAndStop("game");
}
};
Symbol 696 MovieClip [__Packages.Game.State] Frame 0
class Game.State
{
var mcRef, sName, nPosX, nPosY, bPausable, sState, nNbFrAnim;
function State (_mcRef) {
mcRef = _mcRef;
sName = _mcRef._name;
nPosX = mcRef._x;
nPosY = mcRef._y;
bPausable = true;
}
function doPause() {
mcRef.mcState.stop();
}
function doUnPause() {
mcRef.mcState.play();
}
function doAction() {
if (!bPausable) {
this[sState]();
} else if (!_global.C.bPause) {
this[sState]();
}
}
function setState(_sState) {
if (sState != _sState) {
sState = _sState;
mcRef.gotoAndStop(sState);
nNbFrAnim = mcRef.mcState._totalframes;
}
}
}
Symbol 697 MovieClip [__Packages.Collision.Collider] Frame 0
class Collision.Collider extends Game.State
{
var nDistU, mcRef, nDistD, nDistR, nDistL, bBlocMove, sName, nPosX, nPosY;
function Collider (_mcRef) {
super(_mcRef);
nDistU = mcRef._height / 2;
nDistD = mcRef._height / 2;
nDistR = mcRef._width / 2;
nDistL = mcRef._width / 2;
bBlocMove = true;
_global.CM.nItemNameIndex++;
_global.CM.aItemCollide.push(sName);
offsetPosition();
}
function offsetPosition() {
nPosX = nPosX + mcRef._parent._x;
nPosY = nPosY + mcRef._parent._y;
}
}
Symbol 698 MovieClip [__Packages.FF_Wall] Frame 0
class FF_Wall extends Collision.Collider
{
var setState, sItemType;
function FF_Wall (_mcRef) {
super(_mcRef);
setState("idle" + (Math.floor(Math.random() * 3) + 1));
sItemType = "Wall";
}
}
Symbol 699 MovieClip [__Packages.ScrollOptimizer.ScrollingItem] Frame 0
class ScrollOptimizer.ScrollingItem extends Collision.Collider
{
var nAttachDepth, mcContainer, sAttachLink, sLastState, nLastX, mcRef, nLastY, sName, oBounds, nDistUpSide, nDistDownSide, nDistRightSide, nDistLeftSide, sLUBroadcast, sRUBroadcast, sLDBroadcast, sRDBroadcast, nPosX, nPosY, sState, setState;
function ScrollingItem (_mcRef, _sLinkName) {
super(_mcRef);
nAttachDepth = _mcRef.getDepth();
mcContainer = _mcRef._parent;
sAttachLink = _sLinkName;
setBounds();
addActivateBroadcast();
sLastState = "Idle";
nLastX = mcRef._x;
nLastY = mcRef._y;
_global.C.oActionBroadcast.addListener(this);
}
function destroyItem() {
removeFromBroadcast();
delete _global.C.oGameObjects[sName];
_global.CM.aItemCollide.splice(_global.CM.aItemCollide.indexOf(sName), 1);
mcRef.swapDepths(10);
mcRef.removeMovieClip();
_global.C.oActionBroadcast.removeListener(this);
}
function setBounds() {
oBounds = mcRef.getBounds(mcRef._parent);
nDistUpSide = mcRef._y - oBounds.yMin;
nDistDownSide = oBounds.yMax - mcRef._y;
nDistRightSide = oBounds.xMax - mcRef._x;
nDistLeftSide = mcRef._x - oBounds.xMin;
}
function addActivateBroadcast() {
sLUBroadcast = _global.C.oBg.addToBroadcast(this, oBounds.xMin + mcRef._parent._x, oBounds.yMin + mcRef._parent._y);
sRUBroadcast = _global.C.oBg.addToBroadcast(this, oBounds.xMax + mcRef._parent._x, oBounds.yMin + mcRef._parent._y);
sLDBroadcast = _global.C.oBg.addToBroadcast(this, oBounds.xMin + mcRef._parent._x, oBounds.yMax + mcRef._parent._y);
sRDBroadcast = _global.C.oBg.addToBroadcast(this, oBounds.xMax + mcRef._parent._x, oBounds.yMax + mcRef._parent._y);
}
function checkDesactivate() {
setBounds();
var _local4 = nPosX + _global.C.oBg.nPosX;
var _local3 = nPosY + _global.C.oBg.nPosY;
var _local6 = _local4 - nDistLeftSide;
var _local7 = _local4 + nDistRightSide;
var _local5 = _local3 - nDistUpSide;
var _local8 = _local3 + nDistDownSide;
if ((((_local7 < _global.C.oBg.nLActiveLimit) || (_local6 > _global.C.oBg.nRActiveLimit)) || (_local8 < _global.C.oBg.nUpActiveLimit)) || (_local5 > _global.C.oBg.nDwActiveLimit)) {
sLastState = sState;
nLastX = mcRef._x;
nLastY = mcRef._y;
setState("NotActive");
addActivateBroadcast();
mcRef.swapDepths(10);
mcRef.removeMovieClip();
_global.CM.aItemCollide.splice(_global.CM.aItemCollide.indexOf(sName), 1);
_global.C.oActionBroadcast.removeListener(this);
}
}
function checkActivate() {
var _local4 = nPosX + _global.C.oBg.nPosX;
var _local3 = nPosY + _global.C.oBg.nPosY;
var _local6 = _local4 - nDistLeftSide;
var _local7 = _local4 + nDistRightSide;
var _local5 = _local3 - nDistUpSide;
var _local8 = _local3 + nDistDownSide;
if ((((_local7 > _global.C.oBg.nLActiveLimit) && (_local6 < _global.C.oBg.nRActiveLimit)) && (_local8 > _global.C.oBg.nUpActiveLimit)) && (_local5 < _global.C.oBg.nDwActiveLimit)) {
activate();
}
}
function activate() {
_global.CM.aItemCollide.push(sName);
mcContainer.attachMovie(sAttachLink, sName, nAttachDepth);
mcRef = mcContainer[sName];
mcRef._x = nLastX;
mcRef._y = nLastY;
removeFromBroadcast();
_global.C.oBg.addToGeneralBroadcast(this);
setState(sLastState);
_global.C.oActionBroadcast.addListener(this);
}
function removeFromBroadcast() {
_global.C.oBg.removeFromBroadcast(this, sLUBroadcast);
_global.C.oBg.removeFromBroadcast(this, sRUBroadcast);
_global.C.oBg.removeFromBroadcast(this, sLDBroadcast);
_global.C.oBg.removeFromBroadcast(this, sRDBroadcast);
}
}
Symbol 700 MovieClip [__Packages.FF_PlatformWeak] Frame 0
class FF_PlatformWeak extends ScrollOptimizer.ScrollingItem
{
var bUrchinPower, bBlocMove, setState, checkDesactivate, nNbFrAnim, mcRef, destroyItem;
function FF_PlatformWeak (_mcRef, _sLinkName) {
super(_mcRef, _sLinkName);
}
function doSetUrchinPower() {
bUrchinPower = true;
bBlocMove = false;
}
function doUnsetUrchinPower() {
if (bUrchinPower) {
bUrchinPower = false;
bBlocMove = true;
}
}
function onHit(_sSideHit) {
if ((_sSideHit == "Bottom") || (bUrchinPower)) {
setState("destroyUp");
bBlocMove = false;
_global.C.oCtrlSFX.playSFX("destroyUp.wav", 100, 1);
}
if (_sSideHit == "Top") {
setState("destroyDown");
bBlocMove = false;
_global.C.oCtrlSFX.playSFX("destroyDown.wav", 100, 1);
}
}
function Idle() {
checkDesactivate();
}
function destroyUp() {
checkDesactivate();
if (mcRef.mcState._currentframe >= nNbFrAnim) {
destroyItem();
}
}
function destroyDown() {
checkDesactivate();
if (mcRef.mcState._currentframe >= nNbFrAnim) {
destroyItem();
}
}
}
Symbol 701 MovieClip [__Packages.FF_PlatformNormal] Frame 0
class FF_PlatformNormal extends ScrollOptimizer.ScrollingItem
{
var bUrchinPower, bBlocMove, setState, checkDesactivate, nNbFrAnim, mcRef, destroyItem;
function FF_PlatformNormal (_mcRef, _sLinkName) {
super(_mcRef, _sLinkName);
}
function doSetUrchinPower() {
bUrchinPower = true;
bBlocMove = false;
}
function doUnsetUrchinPower() {
if (bUrchinPower) {
bUrchinPower = false;
bBlocMove = true;
}
}
function onHit(_sSideHit) {
if ((_sSideHit == "Bottom") || (bUrchinPower)) {
setState("destroyUp");
bBlocMove = false;
_global.C.oCtrlSFX.playSFX("destroyUp.wav", 100, 1);
}
}
function Idle() {
checkDesactivate();
}
function destroyUp() {
checkDesactivate();
if (mcRef.mcState._currentframe >= nNbFrAnim) {
destroyItem();
}
}
}
Symbol 702 MovieClip [__Packages.FF_PlatformStrong] Frame 0
class FF_PlatformStrong extends ScrollOptimizer.ScrollingItem
{
var sItemType, checkDesactivate;
function FF_PlatformStrong (_mcRef, _sLinkName) {
super(_mcRef, _sLinkName);
sItemType = "PlatformStrong";
}
function onHit(_sSideHit) {
}
function Idle() {
checkDesactivate();
}
}
Symbol 703 MovieClip [__Packages.FF_Obstacle] Frame 0
class FF_Obstacle extends ScrollOptimizer.ScrollingItem
{
var sItemType, checkDesactivate;
function FF_Obstacle (_mcRef, _sLinkName) {
super(_mcRef, _sLinkName);
sItemType = "Obstacle";
}
function Idle() {
checkDesactivate();
}
}
Symbol 704 MovieClip [__Packages.FF_BonusPatty] Frame 0
class FF_BonusPatty extends ScrollOptimizer.ScrollingItem
{
var mcRef, sItemType, bBlocMove, sState, setState, checkDesactivate, nNbFrAnim, destroyItem;
function FF_BonusPatty (_mcRef, _sLinkName) {
super(_mcRef, _sLinkName);
mcRef._xscale = (mcRef._yscale = 80);
sItemType = "Bonus";
bBlocMove = false;
}
function onHit(_sSideHit) {
if (sState == "Idle") {
_global.C.oStats.nScore = _global.C.oStats.nScore + 100;
_global.C.oMessages.setState("points");
setState("collect");
bBlocMove = false;
_global.C.oCtrlSFX.playSFX("bonusPoints.wav", 100, 1);
}
}
function Idle() {
checkDesactivate();
}
function collect() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
destroyItem();
}
}
}
Symbol 705 MovieClip [__Packages.FF_BonusLife] Frame 0
class FF_BonusLife extends ScrollOptimizer.ScrollingItem
{
var mcRef, sItemType, bBlocMove, sState, setState, checkDesactivate, nNbFrAnim, destroyItem;
function FF_BonusLife (_mcRef, _sLinkName) {
super(_mcRef, _sLinkName);
mcRef._xscale = (mcRef._yscale = 80);
sItemType = "Bonus";
bBlocMove = false;
}
function onHit(_sSideHit) {
if (sState == "Idle") {
_global.C.oStats.nLives = _global.C.oStats.nLives + 1;
setState("collect");
bBlocMove = false;
_global.C.oCtrlSFX.playSFX("bonusLife.wav", 100, 1);
}
}
function Idle() {
checkDesactivate();
}
function collect() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
destroyItem();
}
}
}
Symbol 706 MovieClip [__Packages.FF_BonusTime] Frame 0
class FF_BonusTime extends ScrollOptimizer.ScrollingItem
{
var mcRef, sItemType, bBlocMove, removeFromBroadcast, sName, sState, setState, checkDesactivate;
function FF_BonusTime (_mcRef, _sLinkName) {
super(_mcRef, _sLinkName);
mcRef._xscale = (mcRef._yscale = 80);
sItemType = "Bonus";
bBlocMove = false;
}
function destroyItem() {
removeFromBroadcast();
delete _global.C.oGameObjects[sName];
_global.CM.aItemCollide.splice(_global.CM.aItemCollide.indexOf(sName), 1);
mcRef.swapDepths(10);
mcRef.removeMovieClip();
_global.C.oActionBroadcast.removeListener(this);
}
function onHit(_sSideHit) {
if (sState == "Idle") {
_global.C.oActionBroadcast.broadcastMessage("doFreeze");
setState("freeze");
bBlocMove = false;
_global.C.oMessages.setState("timeFreeze");
_global.C.oCtrlSFX.playSFX("bonusTime.wav", 100, 1);
}
}
function Idle() {
checkDesactivate();
}
function collect() {
destroyItem();
}
function freeze() {
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
_global.C.oActionBroadcast.broadcastMessage("doUnFreeze");
setState("collect");
}
}
}
Symbol 707 MovieClip [__Packages.FF_BonusUrchin] Frame 0
class FF_BonusUrchin extends ScrollOptimizer.ScrollingItem
{
var mcRef, sItemType, bBlocMove, removeFromBroadcast, sName, sState, setState, checkDesactivate, nNbFrAnim;
function FF_BonusUrchin (_mcRef, _sLinkName) {
super(_mcRef, _sLinkName);
if (_global.CHEAT_ENABLED && (_global.SECRET_POWERUP)) {
mcRef._xscale = (mcRef._yscale = 80);
sItemType = "Urchin";
bBlocMove = false;
} else {
destroyItem();
}
_global.SECRET_POWERUP = false;
}
function destroyItem() {
removeFromBroadcast();
delete _global.C.oGameObjects[sName];
_global.CM.aItemCollide.splice(_global.CM.aItemCollide.indexOf(sName), 1);
mcRef.swapDepths(10);
mcRef.removeMovieClip();
_global.C.oActionBroadcast.removeListener(this);
}
function onHit(_sSideHit) {
if (sState == "Idle") {
setState("collect");
bBlocMove = false;
_global.C.oCtrlSFX.playSFX("destroyUp.wav", 100, 1);
_global.C.oPlayer.startUrchinPower();
}
}
function Idle() {
checkDesactivate();
}
function collect() {
if (mcRef.mcState._currentframe == nNbFrAnim) {
destroyItem();
}
}
}
Symbol 708 MovieClip [__Packages.FF_Goal] Frame 0
class FF_Goal extends ScrollOptimizer.ScrollingItem
{
var sItemType, sState, setState, bBlocMove, checkDesactivate, destroyItem;
function FF_Goal (_mcRef, _sLinkName) {
super(_mcRef, _sLinkName);
sItemType = "Bonus";
}
function onHit(_sSideHit) {
if (sState != "collect") {
_global.C.oStats.nScore = _global.C.oStats.nScore + 1000;
_global.C.onWin();
setState("collect");
_global.C.oCtrlSFX.playSFX("goal.wav", 100, 1);
bBlocMove = false;
}
}
function Idle() {
checkDesactivate();
}
function collect() {
destroyItem();
}
}
Symbol 709 MovieClip [__Packages.FF_CtrlGame] Frame 0
class FF_CtrlGame
{
var mcRef, mcGame, nItemNameIndex, nItemDepthIndex, bPause, oStats, mcLevel, oCtrlLevels, oCtrlSFX, oActionBroadcast, oGameObjects, mcBg, oBg;
function FF_CtrlGame (_mcRef) {
mcRef = _mcRef;
mcGame = mcRef;
nItemNameIndex = 1;
nItemDepthIndex = 50;
bPause = false;
_global.CM = new Collision.CollisionMgr();
oStats = new FF_GameStats();
mcLevel = mcRef.mcDisplay.mcLevel;
oCtrlLevels = new FF_CtrlLevels(mcLevel);
oCtrlSFX = new Game.CtrlSFX(mcRef);
oActionBroadcast = new Object();
AsBroadcaster.initialize(oActionBroadcast);
oGameObjects = new Object();
mcRef.onEnterFrame = mx.utils.Delegate.create(this, enterFrame);
pauseGame();
mcBg = mcRef.mcDisplay;
}
function createBg() {
oBg = new ScrollOptimizer.Background(mcBg, "oBg");
}
function registerInstance(_oObj) {
oGameObjects[_oObj.sName] = _oObj;
}
function clearGameObjects() {
for (var _local3 in oGameObjects) {
if (((oGameObjects[_local3].sName != "mcKrabby") && (oGameObjects[_local3].sName != "mcPlankton")) && (oGameObjects[_local3].sName != "mcTrash")) {
if (oGameObjects[_local3].destroyItem) {
oGameObjects[_local3].destroyItem();
} else {
oGameObjects[_local3].mcRef.swapDepths(10);
oGameObjects[_local3].mcRef.removeMovieClip();
delete oGameObjects[_local3];
}
}
}
_global.CM.clearColliders();
oBg.clearScrBroadcasters();
oActionBroadcast.broadcastMessage("doReset");
}
function initGame() {
createBg();
mcLevel.createLevel(10);
mcRef.mcDisplay.mcTarget = mcRef.mcDisplay.mcLevel.mcKrabby;
}
function pauseGame() {
bPause = true;
oActionBroadcast.broadcastMessage("doPause");
_global.C.oCtrlSFX.changeMusic("_package.wav");
}
function unpauseGame() {
bPause = false;
oActionBroadcast.broadcastMessage("doUnPause");
_global.C.oCtrlSFX.changeMusic("_ingame.wav");
_global.oGameMenu.setState("Idle");
}
function enterFrame() {
oActionBroadcast.broadcastMessage("doAction");
oBg.broadcastScr();
}
function onLoseLevel() {
pauseGame();
_global.T.launch(this, function () {
this.mcLevel.resetLevel();
this.unpauseGame();
});
}
function onLoseGame() {
pauseGame();
_global.T.launch(this, function () {
_global.P.loseGame();
});
}
function onWin() {
if (oCtrlLevels.isLastLevel()) {
_global.T.launch(this, function () {
_global.P.winGame();
});
} else {
_global.T.launch(this, function () {
_global.P.winLevel();
});
}
}
}
Symbol 710 MovieClip [__Packages.Collision.CollisionMgr] Frame 0
class Collision.CollisionMgr
{
var nItemNameIndex, aItemCollide;
function CollisionMgr () {
clearColliders();
}
function clearColliders() {
nItemNameIndex = 1;
aItemCollide = new Array();
}
}
Symbol 711 MovieClip [__Packages.FF_GameStats] Frame 0
class FF_GameStats
{
var __nScore, __nLives;
function FF_GameStats () {
}
function resetStats() {
nScore = (0);
nLives = (3);
_global.canSubmitScore = true;
}
function get nScore() {
return(__nScore);
}
function set nScore(_nScore) {
__nScore = _nScore;
_global.C.oHud.mcRef.txtScore.text = __nScore.toString().pad(5, "0");
//return(nScore);
}
function get nLives() {
return(__nLives);
}
function set nLives(_nLives) {
if (_nLives < __nLives) {
if (_nLives > 0) {
_global.C.onLoseLevel();
} else {
_global.C.onLoseGame();
}
}
__nLives = _nLives;
_global.HUD_fish01._visible = false;
_global.HUD_fish02._visible = false;
_global.HUD_fish03._visible = false;
if (__nLives >= 1) {
_global.HUD_fish01._visible = true;
}
if (__nLives >= 2) {
_global.HUD_fish02._visible = true;
}
if (__nLives >= 3) {
_global.HUD_fish03._visible = true;
}
//return(nLives);
}
}
Symbol 712 MovieClip [__Packages.FF_CtrlLevels] Frame 0
class FF_CtrlLevels
{
var mcLevel, nCurrentLevel;
function FF_CtrlLevels (_mcLevel) {
mcLevel = _mcLevel;
}
function nextLevel() {
if (!isLastLevel()) {
nCurrentLevel++;
var _local2 = Math.floor(((nCurrentLevel / TOTAL_LEVELS) * (MAX_BLOCKS - MIN_BLOCKS)) + MIN_BLOCKS);
mcLevel.createLevel(_local2);
}
}
function newGame() {
nCurrentLevel = 0;
_global.C.oStats.resetStats();
nextLevel();
}
function isLastLevel() {
return(nCurrentLevel >= TOTAL_LEVELS);
}
var TOTAL_LEVELS = 5;
var MIN_BLOCKS = 7;
var MAX_BLOCKS = 20;
}
Symbol 713 MovieClip [__Packages.Game.CtrlSFX] Frame 0
class Game.CtrlSFX
{
var SFXs, allMuted, libLevel, musicMuted, sfxMuted;
function CtrlSFX (_libLevel) {
SFXs = new Array();
allMuted = false;
libLevel = _libLevel;
}
function playSFX(l_linkage, l_vol, l_loop) {
var _local5 = true;
l_loop = Math.max(0, l_loop);
var _local3 = 0;
while (_local3 < SFXs.length) {
if (SFXs[_local3].linkageID == l_linkage) {
_local5 = false;
SFXs[_local3].volume = l_vol;
SFXs[_local3].Play(l_loop);
if (this == _global.G_Music) {
(musicMuted ? (SFXs[_local3].Mute()) : null);
} else {
(sfxMuted ? (SFXs[_local3].Mute()) : null);
}
return(SFXs[_local3]);
}
_local3++;
}
if (_local5) {
libLevel.createEmptyMovieClip("sfx" + SFXs.length, libLevel.getNextHighestDepth());
var _local8 = new Game.SFX(l_linkage, l_vol, l_loop, libLevel["sfx" + SFXs.length]);
if (this == _global.G_Music) {
(musicMuted ? (_local8.Mute()) : null);
} else {
(sfxMuted ? (_local8.Mute()) : null);
}
SFXs.push(_local8);
return(_local8);
}
}
function removeSFX(l_sfx) {
var _local2 = 0;
while (_local2 < SFXs.length) {
if (SFXs[_local2] == l_sfx) {
SFXs[_local2].Stop();
SFXs.splice(_local2, 1);
}
_local2++;
}
}
function stopAllSounds() {
var _local2 = 0;
while (_local2 < SFXs.length) {
SFXs[_local2].Stop();
_local2++;
}
}
function playRandomSFX(l_prefix, l_amount) {
var _local2 = ((l_prefix + "_") + Math.floor((Math.random() * l_amount) + 1)) + ".wav";
return(playSFX(_local2, 100, 1));
}
function muteAll() {
var _local2 = 0;
while (_local2 < SFXs.length) {
SFXs[_local2].Mute();
_local2++;
}
allMuted = true;
}
function unMuteAll() {
var _local2 = 0;
while (_local2 < SFXs.length) {
SFXs[_local2].UnMute();
_local2++;
}
allMuted = false;
}
function muteSFX() {
var _local3 = 0;
while (_local3 < SFXs.length) {
if (SFXs[_local3] != _global.G_Music) {
SFXs[_local3].Mute();
}
_local3++;
}
sfxMuted = true;
}
function unMuteSFX() {
var _local3 = 0;
while (_local3 < SFXs.length) {
if (SFXs[_local3] != _global.G_Music) {
SFXs[_local3].UnMute();
}
_local3++;
}
sfxMuted = false;
}
function muteMusic() {
_global.G_Music.Mute();
musicMuted = true;
}
function unMuteMusic() {
_global.G_Music.UnMute();
musicMuted = false;
}
function changeMusic(_sLinkageName) {
if (_global.G_Music.linkageID != _sLinkageName) {
_global.G_Music.Stop();
_global.G_Music = playSFX(_sLinkageName, 60, 65535);
if (musicMuted) {
_global.G_Music.Mute();
} else {
_global.G_Music.UnMute();
}
}
}
}
Symbol 714 MovieClip [__Packages.Game.SFX] Frame 0
class Game.SFX extends Sound
{
var attachSound, isPlaying, linkageID, oldVolume, start, onSoundComplete, stop, setVolume, getVolume;
function SFX (l_linkage, l_vol, l_loop, l_mcHolder) {
super(l_mcHolder);
attachSound(l_linkage);
isPlaying = false;
linkageID = l_linkage;
volume = (l_vol);
oldVolume = l_vol;
Play(l_loop);
}
function Play(l_loop) {
start(0, l_loop);
isPlaying = true;
onSoundComplete = function () {
this.isPlaying = false;
};
}
function Stop() {
stop();
isPlaying = false;
}
function Mute() {
if (volume > 0) {
oldVolume = volume;
volume = (0);
}
}
function UnMute() {
volume = (oldVolume);
}
function set volume(l_vol) {
setVolume(l_vol);
//return(volume);
}
function get volume() {
return(getVolume());
}
}
Symbol 715 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 716 MovieClip [__Packages.ScrollOptimizer.Background] Frame 0
class ScrollOptimizer.Background extends Game.State
{
var nScrWidth, nScrHeight, nTotalWidth, mcRef, nTotalHeight, nTotalScrInX, nTotalScrInY, nActiveDist, nUpActiveLimit, nPosY, nDwActiveLimit, nRActiveLimit, nPosX, nLActiveLimit, nRightXMax, nLeftXMax, nUpYMax, nDownYMax, aScrBroadcasters, sState;
function Background (_mcRef) {
super(_mcRef);
nScrWidth = 600;
nScrHeight = 300;
nTotalWidth = mcRef._width;
nTotalHeight = mcRef._height;
nTotalScrInX = int(nTotalWidth / nScrWidth) + 1;
nTotalScrInY = int(nTotalHeight / nScrHeight) + 1;
nActiveDist = 100;
nUpActiveLimit = nPosY - nActiveDist;
nDwActiveLimit = (nPosY + nScrHeight) + nActiveDist;
nRActiveLimit = (nPosX + nScrWidth) + nActiveDist;
nLActiveLimit = nPosX - nActiveDist;
nRightXMax = 0;
nLeftXMax = (nTotalWidth - nScrWidth) * -1;
nUpYMax = (nTotalHeight - nScrHeight) * -1;
nDownYMax = 0;
aScrBroadcasters = new Array();
setState("Move");
_global.C.oActionBroadcast.addListener(this);
}
function broadcastScr() {
var _local3 = (-int((nPosX + nScrWidth) / nScrWidth)) + 1;
var _local2 = (-int((nPosY + nScrHeight) / nScrHeight)) + 1;
this[(("oBroadcastScr" + (_local3 - 1)) + "_") + (_local2 - 1)].broadcastMessage("checkActivate");
this[(("oBroadcastScr" + _local3) + "_") + (_local2 - 1)].broadcastMessage("checkActivate");
this[(("oBroadcastScr" + (_local3 + 1)) + "_") + (_local2 - 1)].broadcastMessage("checkActivate");
this[(("oBroadcastScr" + (_local3 - 1)) + "_") + _local2].broadcastMessage("checkActivate");
this[(("oBroadcastScr" + _local3) + "_") + _local2].broadcastMessage("checkActivate");
this[(("oBroadcastScr" + (_local3 + 1)) + "_") + _local2].broadcastMessage("checkActivate");
this[(("oBroadcastScr" + (_local3 - 1)) + "_") + (_local2 + 1)].broadcastMessage("checkActivate");
this[(("oBroadcastScr" + _local3) + "_") + (_local2 + 1)].broadcastMessage("checkActivate");
this[(("oBroadcastScr" + (_local3 + 1)) + "_") + (_local2 + 1)].broadcastMessage("checkActivate");
}
function addToBroadcast(_oRef, _nXCorner, _nYCorner) {
var _local3 = int(_nXCorner / nScrWidth) + 1;
var _local2 = int(_nYCorner / nScrHeight) + 1;
if (_nXCorner < 0) {
_local3 = _local3 - 2;
}
if (_nYCorner < 0) {
_local2 = _local2 - 2;
}
var _local4 = (("oBroadcastScr" + _local3) + "_") + _local2;
if (this[_local4] == undefined) {
setScrBroadcaster(_local3, _local2);
}
this[_local4].addListener(_oRef);
return(_local4);
}
function removeFromBroadcast(_oRef, _sBroadcastName) {
this[_sBroadcastName].removeListener(_oRef);
if (this[_sBroadcastName]._listeners.length == 0) {
delete this[_sBroadcastName];
}
}
function addToGeneralBroadcast(_oRef) {
_global.C.oActionBroadcast.addListener(_oRef);
}
function setState(_sState) {
if (sState != _sState) {
sState = _sState;
}
}
function clearScrBroadcasters() {
for (var _local3 in aScrBroadcasters) {
for (var _local2 in aScrBroadcasters[_local3]._listeners) {
aScrBroadcasters[_local3].removeListener(aScrBroadcasters[_local3]._listeners[_local2]);
}
delete aScrBroadcasters[_local3];
aScrBroadcasters.splice(_local3, 1);
}
aScrBroadcasters = new Array();
}
function setScrBroadcaster(_nScrX, _nScrY) {
this[(("oBroadcastScr" + _nScrX) + "_") + _nScrY] = new Object();
AsBroadcaster.initialize(this[(("oBroadcastScr" + _nScrX) + "_") + _nScrY]);
aScrBroadcasters.push(this[(("oBroadcastScr" + _nScrX) + "_") + _nScrY]);
}
function Move() {
nPosY = mcRef._y;
}
}
Symbol 717 MovieClip [__Packages.FF_Package] Frame 0
class FF_Package
{
var mcRef;
function FF_Package (_mcRef) {
mcRef = _mcRef;
}
function prepareGame() {
_global.C.oCtrlLevels.newGame();
}
function playGame() {
prepareGame();
resumeGame();
}
function loseGame() {
_global.C.pauseGame();
mcRef.gotoAndStop("loseGame");
updateScore();
awardNPs();
mcRef._visible = true;
}
function winLevel() {
_global.C.pauseGame();
mcRef.gotoAndStop("winLevel");
updateBonus();
updateScore();
mcRef._visible = true;
}
function winGame() {
_global.C.pauseGame();
mcRef.gotoAndStop("winGame");
updateBonus();
updateScore();
awardNPs();
mcRef._visible = true;
}
function howToPlay() {
_global.C.pauseGame();
mcRef.gotoAndStop("instructions1");
mcRef._visible = true;
}
function confirmQuit() {
mcRef.gotoAndStop("gameMenu");
mcRef._visible = true;
}
function resumeGame() {
_global.C.unpauseGame();
mcRef._visible = false;
}
function nextLevel() {
_global.C.oCtrlLevels.nextLevel();
resumeGame();
}
function awardNPs() {
var _local3;
if (_global.C.oStats.nScore < 100) {
_local3 = 0;
} else if (_global.C.oStats.nScore < 6000) {
_local3 = 50;
} else if (_global.C.oStats.nScore < 12000) {
_local3 = 150;
} else {
_local3 = 300;
}
if (_global.NICKTROPOLIS_ENABLED) {
if (_local3 > 0) {
_global.gAwardPoints(_local3);
mcRef.txtNPs.text = ("You've earned " + _local3) + " Nick Points! Play again for more Nick Points!";
} else {
mcRef.txtNPs.text = "You've earned no Nick Points. Play again to score some Nick Points!";
}
} else {
mcRef.txtNPs.text = "";
}
}
function updateBonus() {
var _local5 = _global.C.oTimer.nTime.toString() / 30;
var _local4 = _global.C.oCtrlLevels.nCurrentLevel;
var _local3 = Math.round(((-5 * _local5) + (50 * _local4)) + 500);
_global.C.oStats.nScore = _global.C.oStats.nScore + _local3;
mcRef.txtBonus.text = "+" + _local3.toString().pad(5, "0");
}
function updateScore() {
mcRef.txtScore.text = _global.C.oStats.nScore.toString().pad(5, "0");
}
}
Symbol 718 MovieClip [__Packages.FF_Trash] Frame 0
class FF_Trash extends Game.State
{
var nInitY, nPosY, sndTrash, nSpdX, nSpdY, nCurrentSpd, mcRef, setState, bFrozen, nPosX;
function FF_Trash (_mcRef) {
super(_mcRef);
nInitY = nPosY;
doReset();
_global.C.oActionBroadcast.addListener(this);
sndTrash = _global.C.oCtrlSFX.playSFX("junk.wav", 0, 65535);
}
function doReset() {
nSpdX = 0;
nSpdY = 0;
nCurrentSpd = FILL_SPEED;
nPosY = nInitY;
mcRef._y = nPosY;
setState("idle");
doUnFreeze();
}
function doLayerOnTop() {
mcRef.swapDepths(mcRef._parent.getNextHighestDepth());
}
function doFreeze() {
bFrozen = true;
}
function doUnFreeze() {
bFrozen = false;
}
function doPause() {
super.doPause();
sndTrash.Mute();
}
function doUnPause() {
super.doUnPause();
sndTrash.UnMute();
}
function adjustVolume() {
if (!_global.C.oCtrlSFX.sfxMuted) {
sndTrash.__set__volume((Math.max(VOLUME_DIST - (nPosY - _global.C.oPlayer.nPosY), 0) / VOLUME_DIST) * 100);
}
}
function checkHit() {
if (nPosY < _global.C.oPlayer.nPosY) {
_global.C.oPlayer.setState("die");
nCurrentSpd = 0;
}
}
function doMove() {
nPosX = nPosX + nSpdX;
nPosY = nPosY + nSpdY;
mcRef._x = nPosX;
mcRef._y = nPosY;
}
function idle() {
if (!bFrozen) {
nSpdY = -nCurrentSpd;
nCurrentSpd = Math.min(nCurrentSpd + FILL_ACCEL, FILL_SPEED_MAX);
} else {
nSpdY = 0;
}
adjustVolume();
checkHit();
doMove();
}
function stop() {
nSpdY = 0;
}
var FILL_SPEED = 0.1;
var FILL_ACCEL = 0.0025;
var FILL_SPEED_MAX = 3;
var VOLUME_DIST = 450;
}
Symbol 719 MovieClip [__Packages.Collision.ActiveCollider] Frame 0
class Collision.ActiveCollider extends Collision.Collider
{
var nSpdX, nSpdY, nCrossX, nPosX, nCrossY, nPosY, sItemGetHitX, sItemGetHitY, sSideHitX, sSideHitY, nYAtX, nXAtY, oMoveLine, setState, sName, nDistR, nDistL, nDistD, nDistU, mcRef;
function ActiveCollider (_mcRef) {
super(_mcRef);
nSpdX = (Math.floor(Math.random() * 5) + 1) - 5;
if (nSpdX == 0) {
nSpdX = 5;
}
nSpdY = (Math.floor(Math.random() * 5) + 1) - 5;
if (nSpdY == 0) {
nSpdY = 5;
}
nCrossX = nPosX;
nCrossY = nPosY;
sItemGetHitX = "";
sItemGetHitY = "";
sSideHitX = "";
sSideHitY = "";
nYAtX = 0;
nXAtY = 0;
oMoveLine = new Object();
oMoveLine.nX1 = 0;
oMoveLine.nY1 = 0;
oMoveLine.nX2 = 0;
oMoveLine.nY2 = 0;
oMoveLine.nM = 0;
oMoveLine.nB = 0;
setState("idle");
_global.C.oActionBroadcast.addListener(this);
}
function checkCollide() {
setMoveLine();
nCrossX = oMoveLine.nX2;
nCrossY = oMoveLine.nY2;
for (var _local3 in _global.CM.aItemCollide) {
if (_global.CM.aItemCollide[_local3] != sName) {
if (shouldCollideWith(_global.C.oGameObjects[_global.CM.aItemCollide[_local3]])) {
if (_global.C.oGameObjects[_global.CM.aItemCollide[_local3]] != undefined) {
if (checkInRange(_global.C.oGameObjects[_global.CM.aItemCollide[_local3]])) {
checkHitX(_global.C.oGameObjects[_global.CM.aItemCollide[_local3]]);
checkHitY(_global.C.oGameObjects[_global.CM.aItemCollide[_local3]]);
}
} else {
_global.CM.aItemCollide.splice(_local3, 1);
}
}
}
}
}
function shouldCollideWith(_mcCollider) {
return(true);
}
function setMoveLine() {
oMoveLine.nX1 = nPosX;
oMoveLine.nX2 = nPosX + nSpdX;
oMoveLine.nY1 = nPosY;
oMoveLine.nY2 = nPosY + nSpdY;
with (oMoveLine) {
nM = (nY2 - nY1) / (nX2 - nX1);
nB = nY2 - (nM * nX2);
}
}
function checkInRange(_oItem) {
if (nSpdX > 0) {
var _local4 = (nPosX + nSpdX) + nDistR;
var _local3 = nPosX - nDistL;
} else if (nSpdX < 0) {
var _local4 = nPosX + nDistR;
var _local3 = (nPosX + nSpdX) - nDistL;
} else {
var _local4 = nPosX + nDistR;
var _local3 = nPosX - nDistL;
}
if ((_local3 <= (_oItem.nPosX + _oItem.nDistR)) && (_local4 >= (_oItem.nPosX - _oItem.nDistL))) {
return(true);
}
return(false);
}
function checkHitX(_oItem) {
if (nSpdX >= 0) {
var _local3 = (_oItem.nPosX - _oItem.nDistL) - nDistR;
if ((_local3 >= oMoveLine.nX1) && (_local3 <= oMoveLine.nX2)) {
if ((oMoveLine.nM == Infinity) || (oMoveLine.nM == (-Infinity))) {
var _local4 = nPosY;
} else {
var _local4 = (oMoveLine.nM * _local3) + oMoveLine.nB;
}
if ((_local4 >= ((_oItem.nPosY - _oItem.nDistU) - nDistD)) && (_local4 <= ((_oItem.nPosY + _oItem.nDistD) + nDistU))) {
if (_local3 < nCrossX) {
if (_oItem.bBlocMove) {
sItemGetHitX = _oItem.sName;
sSideHitX = "Left";
nCrossX = _local3 - 0.1;
nYAtX = _local4;
} else {
_oItem.onHit();
}
}
}
}
} else if (nSpdX < 0) {
var _local3 = (_oItem.nPosX + _oItem.nDistR) + nDistL;
if ((_local3 <= oMoveLine.nX1) && (_local3 >= oMoveLine.nX2)) {
if ((oMoveLine.nM == Infinity) || (oMoveLine.nM == (-Infinity))) {
var _local4 = nPosY;
} else {
var _local4 = (oMoveLine.nM * _local3) + oMoveLine.nB;
}
if ((_local4 >= ((_oItem.nPosY - _oItem.nDistU) - nDistD)) && (_local4 <= ((_oItem.nPosY + _oItem.nDistD) + nDistU))) {
if (_local3 >= nCrossX) {
if (_oItem.bBlocMove) {
sItemGetHitX = _oItem.sName;
sSideHitX = "Right";
nCrossX = _local3 + 0.1;
nYAtX = _local4;
} else {
_oItem.onHit();
}
}
}
}
}
}
function checkHitY(_oItem) {
if (nSpdY > 0) {
var _local3 = (_oItem.nPosY - _oItem.nDistU) - nDistD;
if ((_local3 >= oMoveLine.nY1) && (_local3 <= oMoveLine.nY2)) {
if ((oMoveLine.nM == Infinity) || (oMoveLine.nM == (-Infinity))) {
var _local4 = nPosX;
} else {
var _local4 = (_local3 - oMoveLine.nB) / oMoveLine.nM;
}
if ((_local4 >= ((_oItem.nPosX - _oItem.nDistL) - nDistL)) && (_local4 <= ((_oItem.nPosX + _oItem.nDistR) + nDistR))) {
if (_local3 <= nCrossY) {
if (_oItem.bBlocMove) {
sItemGetHitY = _oItem.sName;
sSideHitY = "Top";
nCrossY = _local3 - 0.1;
nXAtY = _local4;
} else {
_oItem.onHit();
}
}
}
}
} else if (nSpdY < 0) {
var _local3 = (_oItem.nPosY + _oItem.nDistD) + nDistU;
if ((_local3 <= oMoveLine.nY1) && (_local3 >= oMoveLine.nY2)) {
if ((oMoveLine.nM == Infinity) || (oMoveLine.nM == (-Infinity))) {
var _local4 = nPosX;
} else {
var _local4 = (_local3 - oMoveLine.nB) / oMoveLine.nM;
}
if ((_local4 >= ((_oItem.nPosX - _oItem.nDistL) - nDistL)) && (_local4 <= ((_oItem.nPosX + _oItem.nDistR) + nDistR))) {
if (_local3 >= nCrossY) {
if (_oItem.bBlocMove) {
sItemGetHitY = _oItem.sName;
sSideHitY = "Bottom";
nCrossY = _local3 + 0.1;
nXAtY = _local4;
} else {
_oItem.onHit();
}
}
}
}
}
}
function selectHit(_sDirHit) {
if (_sDirHit == "HitX") {
_global.C.oGameObjects[sItemGetHitX].onHit(sSideHitX);
if (_global.C.oGameObjects[sItemGetHitX].bBlocMove) {
nSpdX = -nSpdX;
}
sItemGetHitX = "";
} else {
_global.C.oGameObjects[sItemGetHitY].onHit(sSideHitY);
if (_global.C.oGameObjects[sItemGetHitY].bBlocMove) {
nSpdY = -nSpdY;
}
sItemGetHitY = "";
sSideHitY = "";
sSideHitX = "";
}
}
function doMove() {
checkCollide();
if (nSpdY > 0) {
if ((nYAtX > nCrossY) and (sItemGetHitX != "")) {
nSpdY = 0;
checkCollide();
}
}
if (nSpdY < 0) {
if ((nYAtX < nCrossY) and (sItemGetHitX != "")) {
nSpdY = 0;
checkCollide();
}
}
nPosX = nCrossX;
nPosY = nCrossY;
mcRef._x = nPosX;
mcRef._y = nPosY;
if (sItemGetHitX != "") {
selectHit("HitX");
}
if (sItemGetHitY != "") {
selectHit("HitY");
}
}
function idle() {
doMove();
}
}
Symbol 720 MovieClip [__Packages.FF_Plankton] Frame 0
class FF_Plankton extends Collision.ActiveCollider
{
var nInitX, nPosX, nInitY, nPosY, X_OFFSET, Y_OFFSET, mcTarget, sItemType, nMoveMode, nSpdX, setState, oThrower, mcRef, nSpdY, bCanInput, sSideHitX, sItemGetHitY, sSideHitY, sItemGetHitX, checkCollide, nCrossY, nYAtX, nCrossX, bFacingLeft;
function FF_Plankton (_mcRef, _mcTarget) {
super(_mcRef);
nInitX = nPosX;
nInitY = nPosY;
X_OFFSET = 55;
Y_OFFSET = -13;
mcTarget = _mcTarget;
var _mcPlankton = this;
mcTarget.onGrab = function () {
_mcPlankton.setState("grabbed");
};
mcTarget.onThrow = function (_oThrower) {
_mcPlankton.oThrower = _oThrower;
_mcPlankton.throwPlankton();
};
sItemType = "Sidekick";
doReset();
}
function throwPlankton() {
nMoveMode = MOVEMODE_THROWN;
nPosX = targetX;
nPosY = targetY;
if (mcTarget._xscale < 0) {
facingLeft = (true);
nSpdX = -THROWN_SPEED;
} else {
facingLeft = (false);
nSpdX = THROWN_SPEED;
}
setState("idle");
oThrower.bCanInput = false;
}
function doPause() {
super.doPause();
mcRef.mcState.mcEyeLid.stop();
}
function doUnPause() {
super.doUnPause();
mcRef.mcState.mcEyeLid.play();
}
function doReset() {
setState("idle");
nSpdX = 0;
nSpdY = 0;
nPosX = nInitX;
mcRef._x = nPosX;
nPosY = nInitY;
mcRef._y = nPosY;
nMoveMode = MOVEMODE_FOLLOW;
setState("idle");
bCanInput = true;
}
function doLayerOnTop() {
mcRef.swapDepths(mcRef._parent.getNextHighestDepth());
}
function selectHit(_sDirHit) {
if ((sSideHitX != "") && ((nSpdX < -10) || (nSpdX > 10))) {
setState("hitWall");
_global.C.oCtrlSFX.playSFX("hitWall.wav", 100, 1);
}
if (_sDirHit == "HitY") {
if (_global.C.oGameObjects[sItemGetHitY].sItemType == "Bonus") {
_global.C.oGameObjects[sItemGetHitY].onHit(sSideHitY);
}
nSpdY = 0;
}
if (_sDirHit == "HitX") {
if (_global.C.oGameObjects[sItemGetHitX].sItemType == "Bonus") {
_global.C.oGameObjects[sItemGetHitX].onHit(sSideHitX);
}
nSpdX = 0;
}
sItemGetHitY = "";
sItemGetHitX = "";
}
function shouldCollideWith(_mcCollider) {
if ((_mcCollider.sItemType == "Obstacle") || (_mcCollider.sItemType == "Urchin")) {
return(false);
}
return(true);
}
function doCollide() {
checkCollide();
if (nSpdY > 0) {
if ((nYAtX > nCrossY) and (sItemGetHitX != "")) {
nSpdY = 0;
checkCollide();
}
}
if (nSpdY < 0) {
if ((nYAtX < nCrossY) and (sItemGetHitX != "")) {
nSpdY = 0;
checkCollide();
}
}
nPosX = nCrossX;
nPosY = nCrossY;
mcRef._x = nPosX;
mcRef._y = nPosY;
if (sItemGetHitX != "") {
selectHit("HitX");
}
if (sItemGetHitY != "") {
selectHit("HitY");
}
}
function doNotCollide() {
nPosX = nPosX + nSpdX;
nPosY = nPosY + nSpdY;
mcRef._x = nPosX;
mcRef._y = nPosY;
}
function doMove() {
switch (nMoveMode) {
case MOVEMODE_FOLLOW :
doNotCollide();
break;
case MOVEMODE_THROWN :
doCollide();
break;
case MOVEMODE_CONTROL :
doCollide();
break;
}
}
function checkFollow() {
if (targetX < (nPosX - SWIM_SPEED)) {
nSpdX = (targetX - nPosX) / 3;
facingLeft = (true);
} else if (targetX > (nPosX + SWIM_SPEED)) {
nSpdX = (targetX - nPosX) / 3;
facingLeft = (false);
} else {
nSpdX = 0;
}
if (targetY < (nPosY - SWIM_SPEED)) {
nSpdY = (targetY - nPosY) / 3;
} else if (targetY > (nPosY + SWIM_SPEED)) {
nSpdY = (targetY - nPosY) / 3;
} else {
nSpdY = 0;
}
}
function checkThrow() {
}
function checkControl() {
obeyFriction();
if (Key.isDown(37)) {
if (bCanInput) {
nSpdX = nSpdX - SWIM_SPEED;
facingLeft = (true);
bCanInput = false;
}
} else if (Key.isDown(39)) {
if (bCanInput) {
nSpdX = nSpdX + SWIM_SPEED;
facingLeft = (false);
bCanInput = false;
}
} else if (Key.isDown(38)) {
if (bCanInput) {
nSpdY = nSpdY - SWIM_SPEED;
bCanInput = false;
}
} else if (Key.isDown(40)) {
if (bCanInput) {
nSpdY = nSpdY + SWIM_SPEED;
bCanInput = false;
}
} else {
bCanInput = true;
}
}
function obeyFriction() {
if (Math.abs(nSpdX) > FRICTION_DECEL) {
if (nSpdX > 0) {
nSpdX = nSpdX - FRICTION_DECEL;
} else {
nSpdX = nSpdX + FRICTION_DECEL;
}
} else {
nSpdX = 0;
}
if (Math.abs(nSpdY) > FRICTION_DECEL) {
if (nSpdY > 0) {
nSpdY = nSpdY - FRICTION_DECEL;
} else {
nSpdY = nSpdY + FRICTION_DECEL;
}
} else {
nSpdY = 0;
}
}
function checkMove() {
switch (nMoveMode) {
case MOVEMODE_FOLLOW :
checkFollow();
break;
case MOVEMODE_THROWN :
checkThrow();
break;
case MOVEMODE_CONTROL :
checkControl();
checkTargetProximity();
break;
}
}
function checkSwim() {
if ((nSpdY != 0) || (nSpdX != 0)) {
setState("swim");
} else {
setState("idle");
}
}
function checkTargetProximity() {
var _local3 = new flash.geom.Point(nPosX, nPosY);
var _local2 = new flash.geom.Point(mcTarget._x, mcTarget._y);
if (flash.geom.Point.distance(_local3, _local2) < PROXIMITY_THRESHOLD) {
nMoveMode = MOVEMODE_FOLLOW;
oThrower.bCanInput = true;
}
}
function idle() {
checkMove();
checkSwim();
doMove();
}
function swim() {
checkMove();
checkSwim();
doMove();
}
function hitWall() {
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
setState("idle");
nMoveMode = MOVEMODE_CONTROL;
}
}
function grabbed() {
checkMove();
doMove();
}
function die() {
}
function get facingLeft() {
return(bFacingLeft);
}
function set facingLeft(_bFacingLeft) {
bFacingLeft = _bFacingLeft;
if (_bFacingLeft) {
mcRef._xscale = -Math.abs(mcRef._xscale);
} else {
mcRef._xscale = Math.abs(mcRef._xscale);
}
//return(facingLeft);
}
function get targetX() {
var _local2;
if (nMoveMode == MOVEMODE_THROWN) {
_local2 = mcTarget._x;
} else if (mcTarget._xscale < 0) {
_local2 = mcTarget._x - X_OFFSET;
} else {
_local2 = mcTarget._x + X_OFFSET;
}
return(_local2);
}
function set targetX(_targetX) {
//return(targetX);
}
function get targetY() {
return(mcTarget._y + Y_OFFSET);
}
function set targetY(_targetY) {
//return(targetY);
}
var SWIM_SPEED = 6;
var THROWN_SPEED = 25;
var PROXIMITY_THRESHOLD = 50;
var FRICTION_DECEL = 1;
var MOVEMODE_FOLLOW = 0;
var MOVEMODE_THROWN = 1;
var MOVEMODE_CONTROL = 2;
}
Symbol 721 MovieClip [__Packages.FF_Krabby] Frame 0
class FF_Krabby extends Collision.ActiveCollider
{
var nInitX, nPosX, nInitY, nPosY, sItemType, sState, mcRef, nNbFrAnim, nSpdX, nSpdY, bAlone, bCanInput, bCanJump, sItemGetHitY, sSideHitY, sItemGetHitX, sSideHitX, doMove, bFacingLeft;
function FF_Krabby (_mcRef) {
super(_mcRef);
nInitX = nPosX;
nInitY = nPosY;
sItemType = "Player";
_global.C.oPlayer = this;
doReset();
}
function setState(_sState) {
if (sState != _sState) {
sState = _sState;
mcRef.mcObj.gotoAndStop(sState);
nNbFrAnim = mcRef.mcObj.mcState._totalframes;
if (_sState == "fall") {
_global.C.oActionBroadcast.broadcastMessage("doUnsetUrchinPower");
}
}
}
function doPause() {
mcRef.mcObj.mcState.stop();
mcRef.mcObj.mcState.mcEyeLid1.stop();
mcRef.mcObj.mcState.mcEyeLid2.stop();
}
function doUnPause() {
mcRef.mcObj.mcState.play();
mcRef.mcObj.mcState.mcEyeLid1.play();
mcRef.mcObj.mcState.mcEyeLid2.play();
}
function doReset() {
setState("idle");
nSpdX = 0;
nSpdY = 0;
nPosX = nInitX;
mcRef._x = nPosX;
nPosY = nInitY;
mcRef._y = nPosY;
mcRef.gotoAndStop("alone");
bAlone = true;
bCanInput = true;
bCanJump = true;
}
function doLayerOnTop() {
mcRef.swapDepths(mcRef._parent.getNextHighestDepth());
}
function startUrchinPower() {
setState("jumpB");
nSpdY = -EXPLODE_FORCE;
bCanJump = false;
_global.C.oActionBroadcast.broadcastMessage("doSetUrchinPower");
}
function onHit() {
}
function selectHit(_sDirHit) {
if (_sDirHit == "HitY") {
_global.C.oGameObjects[sItemGetHitY].onHit(sSideHitY);
if ((_global.C.oGameObjects[sItemGetHitY].sItemType == "PlatformStrong") && (sSideHitY == "Bottom")) {
_global.C.oCtrlSFX.playSFX("hitWall.wav", 100, 1);
setState("hitRoof");
}
nSpdY = 0;
}
if (_sDirHit == "HitX") {
_global.C.oGameObjects[sItemGetHitX].onHit(sSideHitX);
nSpdX = 0;
}
sItemGetHitY = "";
sItemGetHitX = "";
}
function obeyGravity() {
nSpdY = nSpdY + FALL_ACCEL;
}
function checkMove() {
if (Key.isDown(37) && (bCanInput)) {
nSpdX = -RUN_SPEED;
facingLeft = (true);
} else if (Key.isDown(39) && (bCanInput)) {
nSpdX = RUN_SPEED;
facingLeft = (false);
} else {
nSpdX = 0;
}
}
function checkRun() {
if ((Key.isDown(37) || (Key.isDown(39))) && (bCanInput)) {
setState("run");
}
}
function checkIdle() {
if ((!Key.isDown(37)) && (!Key.isDown(39))) {
setState("idle");
}
}
function checkJump() {
if (Key.isDown(38)) {
if (bCanInput && (bCanJump)) {
setState("jumpB");
nSpdY = -JUMP_FORCE;
_global.C.oCtrlSFX.playSFX("jumpB.wav", 100, 1);
bCanJump = false;
}
} else {
bCanJump = true;
}
}
function checkFall() {
if (nSpdY > FALL_ACCEL) {
setState("fall");
}
}
function checkPlankton() {
if (Key.isDown(32) && (bCanInput)) {
if (isAlone) {
setState("grab");
_global.C.oCtrlSFX.playSFX("grab.wav", 100, 1);
} else if (sState == "jumpB") {
setState("jumpThrow");
} else {
setState("throwPlankton");
}
}
}
function idle() {
obeyGravity();
checkMove();
checkRun();
checkJump();
checkPlankton();
checkFall();
doMove();
}
function run() {
obeyGravity();
checkMove();
checkIdle();
checkJump();
checkPlankton();
checkFall();
doMove();
}
function jumpA() {
obeyGravity();
checkMove();
if (mcRef.mcObj.mcState._currentframe == mcRef.mcObj.mcState._totalframes) {
setState("jumpB");
nSpdY = -JUMP_FORCE;
_global.C.oCtrlSFX.playSFX("jumpB.wav", 100, 1);
}
doMove();
}
function jumpB() {
obeyGravity();
checkMove();
checkPlankton();
if (nSpdY >= (-FALL_ACCEL)) {
setState("jumpC");
}
doMove();
}
function jumpC() {
obeyGravity();
checkMove();
if (mcRef.mcObj.mcState._currentframe == mcRef.mcObj.mcState._totalframes) {
setState("fall");
}
doMove();
}
function fall() {
obeyGravity();
checkMove();
if (nSpdY <= FALL_ACCEL) {
setState("land");
}
doMove();
}
function land() {
obeyGravity();
checkMove();
checkRun();
if (mcRef.mcObj.mcState._currentframe == mcRef.mcObj.mcState._totalframes) {
setState("idle");
}
checkJump();
doMove();
}
function grab() {
nSpdX = 0;
obeyGravity();
if (mcRef.mcObj.mcState._currentframe == 8) {
mcRef.onGrab();
}
if (mcRef.mcObj.mcState._currentframe == mcRef.mcObj.mcState._totalframes) {
isAlone = (false);
setState("idle");
}
doMove();
}
function throwPlankton() {
obeyGravity();
if (mcRef.mcObj.mcState._currentframe == 8) {
_global.C.oCtrlSFX.playSFX("throw.wav", 100, 1);
mcRef.onThrow(this);
}
if (mcRef.mcObj.mcState._currentframe == mcRef.mcObj.mcState._totalframes) {
isAlone = (true);
setState("idle");
}
doMove();
}
function jumpThrow() {
obeyGravity();
if (mcRef.mcObj.mcState._currentframe == 6) {
_global.C.oCtrlSFX.playSFX("throw.wav", 100, 1);
mcRef.onThrow(this);
}
if (mcRef.mcObj.mcState._currentframe == mcRef.mcObj.mcState._totalframes) {
isAlone = (true);
setState("fall");
}
doMove();
}
function hitRoof() {
if (mcRef.mcObj.mcState._currentframe == mcRef.mcObj.mcState._totalframes) {
obeyGravity();
setState("fall");
}
}
function die() {
if (mcRef.mcObj.mcState._currentframe == 1) {
_global.C.oCtrlSFX.playSFX("die.wav", 100, 1);
}
if (mcRef.mcObj.mcState._currentframe == mcRef.mcObj.mcState._totalframes) {
_global.C.oStats.nLives--;
}
}
function get facingLeft() {
return(bFacingLeft);
}
function set facingLeft(_bFacingLeft) {
bFacingLeft = _bFacingLeft;
if (_bFacingLeft) {
mcRef._xscale = -Math.abs(mcRef._xscale);
} else {
mcRef._xscale = Math.abs(mcRef._xscale);
}
//return(facingLeft);
}
function get isAlone() {
return(bAlone);
}
function set isAlone(_bAlone) {
bAlone = _bAlone;
if (_bAlone) {
mcRef.gotoAndStop("alone");
} else {
mcRef.gotoAndStop("plankton");
}
//return(isAlone);
}
var RUN_SPEED = 3;
var FALL_ACCEL = 1;
var JUMP_FORCE = 17.5;
var EXPLODE_FORCE = 33;
}
Symbol 722 MovieClip [__Packages.FF_Hud] Frame 0
class FF_Hud
{
var mcRef;
function FF_Hud (_mcRef) {
_global.C.oHud = this;
mcRef = _mcRef;
}
}
Symbol 723 MovieClip [__Packages.FF_GameMenu] Frame 0
class FF_GameMenu extends Game.State
{
var setState, mcRef;
function FF_GameMenu (_mcRef) {
super(_mcRef);
_global.C.oActionBroadcast.addListener(this);
setState("Idle");
}
function Idle() {
}
function Open() {
}
function Close() {
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
setState("Idle");
}
}
}
Symbol 724 MovieClip [__Packages.FF_Timer] Frame 0
class FF_Timer extends Game.State
{
var setState, nTime, bFrozen, mcRef;
function FF_Timer (_mcRef) {
super(_mcRef);
_global.C.oTimer = this;
doReset();
_global.C.oActionBroadcast.addListener(this);
}
function doReset() {
setState("idle");
nTime = 0;
doUnFreeze();
}
function doFreeze() {
bFrozen = true;
}
function doUnFreeze() {
bFrozen = false;
}
function toString() {
var _local2 = Math.floor(nTime / 1800);
var _local3 = Math.floor((nTime % 1800) / 30);
return((_local2.toString().pad(2, "0") + ":") + _local3.toString().pad(2, "0"));
}
function idle() {
if (!bFrozen) {
nTime++;
mcRef.txtTimer.text = toString();
}
}
}
Symbol 725 MovieClip [__Packages.FF_GameMessages] Frame 0
class FF_GameMessages extends Game.State
{
var setState, mcRef;
function FF_GameMessages (_mcRef) {
super(_mcRef);
_global.C.oMessages = this;
_global.C.oActionBroadcast.addListener(this);
setState("idle");
}
function idle() {
}
function countDown() {
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
_global.C.unpauseGame();
setState("idle");
}
}
function points() {
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
setState("idle");
}
}
function timeFreeze() {
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
setState("idle");
}
}
}
Symbol 726 MovieClip [__Packages.Game.Transition] Frame 0
class Game.Transition extends Game.State
{
var bPausable, setState, fToLaunch, fLaunched, nNbFrAnim, mcRef;
function Transition (_mcRef) {
super(_mcRef);
bPausable = false;
_global.T = this;
_global.C.oActionBroadcast.addListener(this);
setState("Idle");
}
function launch(_oCaller, _fFunc) {
startTransition(mx.utils.Delegate.create(_oCaller, _fFunc));
}
function startTransition(_fToLaunch) {
fToLaunch = _fToLaunch;
setState("Opening");
_global.C.oCtrlSFX.playSFX("transition.wav", 100, 1);
}
function launchFunction() {
fToLaunch();
fLaunched = fToLaunch;
}
function Opening() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
setState("Opened");
}
}
function Opened() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
launchFunction();
setState("Closing");
}
}
function Closing() {
if (mcRef.mcState._currentframe >= nNbFrAnim) {
setState("Idle");
}
}
}
Symbol 727 MovieClip [__Packages.Game.Follower] Frame 0
class Game.Follower extends MovieClip
{
var _y, mcTarget;
function Follower () {
super();
}
function onEnterFrame() {
_y = (-mcTarget._y) + 150;
}
}
Symbol 728 MovieClip [__Packages.FF_Level] Frame 0
class FF_Level extends MovieClip
{
var aLevels, BLOCK_HEIGHT, aCurrentFloors, attachMovie, getNextHighestDepth;
function FF_Level () {
super();
aLevels = new Array();
aLevels.push("LEVEL 0 IS A DUMMY");
aLevels.push({sLevelType:"Bottom", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Bottom", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Bottom", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Bottom", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Bottom", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(1, 5, 19)});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(), bUrchin:true});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(5)});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(19)});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(), bUrchin:true});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(4)});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(5), bUrchin:true});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(18)});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(2), bUrchin:true});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(5, 19), bUrchin:true});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(1)});
aLevels.push({sLevelType:"Top", aNoPrecede:new Array(18, 21)});
aLevels.push({sLevelType:"Top", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Top", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Top", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Top", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array(), bUrchin:true});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Middle", aNoPrecede:new Array()});
aLevels.push({sLevelType:"Cap", aNoPrecede:new Array()});
BLOCK_HEIGHT = 300;
}
function createLevel(_nFloors) {
clearLevel();
prepareTerrain(_nFloors);
buildLevel();
}
function clearLevel() {
_global.SECRET_POWERUP = true;
_global.C.clearGameObjects();
var _local3 = 0;
while (_local3 < aCurrentFloors.length) {
this["block" + _local3].swapDepths(10);
this["block" + _local3].removeMovieClip();
_local3++;
}
}
function resetLevel() {
clearLevel();
buildLevel();
}
function prepareTerrain(_nFloors) {
aCurrentFloors = new Array();
var _local3 = 0;
_local3 = addLevelBlock("Bottom", _local3);
var _local2 = 0;
while (_local2 < (_nFloors - 2)) {
_local3 = addLevelBlock("Middle", _local3);
_local2++;
}
addLevelBlock("Top", _local3);
addLevelBlock("Cap", _local3);
}
function addLevelBlock(_sType, _nPrecede) {
var _local2 = 0;
while ((aLevels[_local2].sLevelType != _sType) || (aLevels[_local2].aNoPrecede.indexOf(_nPrecede) != -1)) {
_local2 = Math.floor(Math.random() * aLevels.length);
}
aCurrentFloors.push(_local2);
return(_local2);
}
function buildLevel() {
var _local5 = false;
var _local3 = 0;
while (_local3 < aCurrentFloors.length) {
var _local4 = "block" + _local3;
attachMovie("FF_LevelBlock", _local4, getNextHighestDepth());
this[_local4]._y = BLOCK_HEIGHT * (-_local3);
if ((_local3 == (aCurrentFloors.length - 3)) && (!_local5)) {
this[_local4].gotoAndStop(16);
} else {
this[_local4].gotoAndStop(aCurrentFloors[_local3]);
}
if (aLevels[aCurrentFloors[_local3]].bUrchin) {
_local5 = true;
}
_local3++;
}
_global.C.oActionBroadcast.broadcastMessage("doLayerOnTop");
}
}
Symbol 37 MovieClip Frame 1
this._name = "Item" + _global.CM.nItemNameIndex;
_global.C.registerInstance(new FF_Wall(this));
Symbol 37 MovieClip Frame 10
stop();
Symbol 37 MovieClip Frame 20
stop();
Symbol 37 MovieClip Frame 30
stop();
Symbol 39 MovieClip Frame 1
this._name = "Item" + _global.CM.nItemNameIndex;
_global.C.registerInstance(new FF_PlatformWeak(this, "PlatformWeak"));
this.swapDepths(10);
this.removeMovieClip();
stop();
Symbol 41 MovieClip Frame 1
this._name = "Item" + _global.CM.nItemNameIndex;
_global.C.registerInstance(new FF_PlatformNormal(this, "PlatformNormal"));
this.swapDepths(10);
this.removeMovieClip();
stop();
Symbol 43 MovieClip Frame 1
this._name = "Item" + _global.CM.nItemNameIndex;
_global.C.registerInstance(new FF_PlatformStrong(this, "PlatformStrong"));
this.swapDepths(10);
this.removeMovieClip();
stop();
Symbol 46 MovieClip Frame 1
this._name = "Item" + _global.CM.nItemNameIndex;
_global.C.registerInstance(new FF_Obstacle(this, "Obstacle"));
this.swapDepths(10);
this.removeMovieClip();
stop();
Symbol 49 MovieClip Frame 1
this._name = "Item" + _global.CM.nItemNameIndex;
_global.C.registerInstance(new FF_BonusPatty(this, "BonusPatty"));
this.swapDepths(10);
this.removeMovieClip();
stop();
Symbol 51 MovieClip Frame 1
this._name = "Item" + _global.CM.nItemNameIndex;
_global.C.registerInstance(new FF_BonusLife(this, "BonusLife"));
this.swapDepths(10);
this.removeMovieClip();
stop();
Symbol 53 MovieClip Frame 1
this._name = "Item" + _global.CM.nItemNameIndex;
_global.C.registerInstance(new FF_BonusTime(this, "BonusTime"));
this.swapDepths(10);
this.removeMovieClip();
stop();
Symbol 55 MovieClip Frame 1
this._name = "Item" + _global.CM.nItemNameIndex;
_global.C.registerInstance(new FF_BonusUrchin(this, "BonusUrchin"));
this.swapDepths(10);
this.removeMovieClip();
stop();
Symbol 57 MovieClip Frame 1
this._name = "Item" + _global.CM.nItemNameIndex;
_global.C.registerInstance(new FF_Goal(this, "Goal"));
this.swapDepths(10);
this.removeMovieClip();
stop();
Symbol 68 MovieClip Frame 16
stop();
Symbol 89 MovieClip Frame 18
stop();
Symbol 104 MovieClip [Obstacle] Frame 1
stop();
Symbol 111 MovieClip Frame 5
stop();
Symbol 118 MovieClip Frame 150
stop();
Symbol 128 MovieClip Frame 5
stop();
Symbol 141 Button
on (keyPress "<Left>") {
return(undefined);
}
on (keyPress "<Right>") {
return(undefined);
}
on (keyPress "<Up>") {
return(undefined);
}
on (keyPress "<Down>") {
return(undefined);
}
Symbol 170 MovieClip Frame 1
this._name = "mcTrash";
_global.C.registerInstance(new FF_Trash(this));
Symbol 170 MovieClip Frame 10
stop();
Symbol 170 MovieClip Frame 20
stop();
Symbol 193 MovieClip Frame 1
this._name = "mcEyeLid";
Symbol 195 MovieClip Frame 1
_global.C.oCtrlSFX.playRandomSFX("swim", 2);
Symbol 199 MovieClip Frame 7
stop();
Symbol 200 MovieClip Frame 1
_global.C.registerInstance(new FF_Plankton(this, this._parent.mcKrabby));
Symbol 200 MovieClip Frame 10
stop();
Symbol 200 MovieClip Frame 19
stop();
Symbol 200 MovieClip Frame 29
stop();
Symbol 200 MovieClip Frame 40
stop();
Symbol 200 MovieClip Frame 50
stop();
Symbol 216 MovieClip Frame 1
if ((this._parent.mcEyeLid1 != undefined) && (this._parent.mcEyeLid1 != this)) {
this._name = "mcEyeLid2";
} else {
this._name = "mcEyeLid1";
}
Symbol 225 MovieClip Frame 1
if ((this._parent.mcEyeLid1 != undefined) && (this._parent.mcEyeLid1 != this)) {
this._name = "mcEyeLid2";
} else {
this._name = "mcEyeLid1";
}
Symbol 280 MovieClip Frame 35
stop();
Symbol 304 MovieClip Frame 1
_global.C.registerInstance(new FF_Krabby(this));
Symbol 304 MovieClip Frame 10
stop();
Symbol 304 MovieClip Frame 20
stop();
Symbol 305 MovieClip [FF_Level] Frame 1
#initclip 35
Object.registerClass("FF_Level", FF_Level);
#endinitclip
Symbol 306 MovieClip [Display] Frame 1
#initclip 34
Object.registerClass("Display", Game.Follower);
#endinitclip
Symbol 308 MovieClip Frame 1
_global[this._name] = this;
Symbol 313 Button
on (release) {
_global.C.pauseGame();
oGameMenu.setState("Open");
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Instance of Symbol 315 MovieClip in Symbol 316 MovieClip Frame 1
/* no clip actions */
Symbol 320 Button
on (release) {
if (_global.C.oCtrlSFX.musicMuted) {
_global.C.oCtrlSFX.unMuteMusic();
mcMusic.gotoAndStop("on");
} else {
_global.C.oCtrlSFX.muteMusic();
mcMusic.gotoAndStop("off");
}
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 323 Button
on (release) {
_global.P.confirmQuit();
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 326 Button
on (release) {
_global.T.launch(this, function () {
_global.P.howToPlay();
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 332 Button
on (release) {
if (_global.C.oCtrlSFX.sfxMuted) {
_global.C.oCtrlSFX.unMuteSFX();
mcSFX.gotoAndStop("on");
} else {
_global.C.oCtrlSFX.muteSFX();
mcSFX.gotoAndStop("off");
}
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 333 MovieClip Frame 1
if (_global.C.oCtrlSFX.musicMuted) {
mcMusic.gotoAndStop("off");
} else {
mcMusic.gotoAndStop("on");
}
if (_global.C.oCtrlSFX.sfxMuted) {
mcSFX.gotoAndStop("off");
} else {
mcSFX.gotoAndStop("on");
}
Symbol 334 MovieClip Frame 1
_global.C.oCtrlSFX.playSFX("menu.wav", 100, 1);
Symbol 334 MovieClip Frame 10
stop();
Symbol 337 Button
on (release) {
_global.C.unpauseGame();
oGameMenu.setState("Close");
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 338 MovieClip Frame 1
_global.C.oCtrlSFX.playSFX("menu.wav", 100, 1);
Symbol 338 MovieClip Frame 10
stop();
Symbol 339 MovieClip Frame 1
this.oGameMenu = new FF_GameMenu(this);
_global.oGameMenu = this.oGameMenu;
Symbol 347 MovieClip Frame 1
new FF_Timer(this);
Symbol 364 MovieClip Frame 1
new FF_GameMessages(this);
Symbol 365 MovieClip Frame 1
new FF_Hud(this);
Symbol 367 MovieClip Frame 1
this.onRelease = function () {
};
this.useHandCursor = false;
Symbol 378 Button
on (release) {
_global.T.launch(this, function () {
_global.P.playGame();
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 379 Button
on (release) {
_global.P.prepareGame();
_global.T.launch(this, function () {
gotoAndStop ("instructions1");
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 382 Button
on (release) {
_global.T.launch(this, function () {
gotoAndStop ("enterCode");
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 435 Button
on (release) {
_global.T.launch(this, function () {
this.gotoAndStop("instructions2");
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 436 Button
on (release) {
_global.T.launch(this, function () {
_global.P.resumeGame();
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 468 Button
on (release) {
_global.T.launch(this, function () {
this.gotoAndStop("instructions1");
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 469 Button
on (release) {
_global.T.launch(this, function () {
this.gotoAndStop("instructions3");
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 487 MovieClip Frame 1
stop();
Symbol 488 MovieClip Frame 1
stop();
Symbol 491 MovieClip Frame 1
stop();
Symbol 494 Button
on (release) {
_global.T.launch(this, function () {
this.gotoAndStop("instructions2");
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 512 Button
on (release) {
_global.C.onLoseGame();
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 515 Button
on (release) {
_global.P.resumeGame();
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 548 Button
on (release) {
_global.T.launch(this, function () {
_global.P.nextLevel();
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 587 Button
on (release) {
_global.T.launch(this, function () {
_global.P.playGame();
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 588 Button
on (release) {
_global.T.launch(this, function () {
gotoAndStop ("titleCard");
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 591 Button
on (release) {
_global.HS.submitScore(_global.C.oStats.nScore);
_global.canSubmitScore = false;
btnSubmit._visible = false;
_global.T.launch(this, function () {
gotoAndStop ("highscores");
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 594 Button
on (release) {
_global.T.launch(this, function () {
gotoAndStop ("highscores");
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 627 Button
on (release) {
_global.T.launch(this, function () {
_global.P.playGame();
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 651 Button
on (press) {
ControlScroll.scrollUp = true;
}
on (release, releaseOutside) {
ControlScroll.scrollUp = false;
}
Symbol 652 Button
on (press) {
ControlScroll.scrollDown = true;
}
on (release, releaseOutside) {
ControlScroll.scrollDown = false;
}
Instance of Symbol 648 MovieClip "ControlScroll" in Symbol 653 MovieClip Frame 1
onClipEvent (load) {
scrollUp = false;
scrollDown = false;
}
onClipEvent (enterFrame) {
if (scrollUp == true) {
_parent.txtHSNumber.scroll--;
_parent.txtHSName.scroll--;
_parent.txtHSScore.scroll--;
} else if (scrollDown == true) {
_parent.txtHSNumber.scroll++;
_parent.txtHSName.scroll++;
_parent.txtHSScore.scroll++;
}
}
Instance of Symbol 648 MovieClip "ControlScroll" in Symbol 653 MovieClip Frame 1
onClipEvent (load) {
scrollUp = false;
scrollDown = false;
}
onClipEvent (enterFrame) {
if (scrollUp == true) {
_parent.txtHSNumber.scroll--;
_parent.txtHSName.scroll--;
_parent.txtHSScore.scroll--;
} else if (scrollDown == true) {
_parent.txtHSNumber.scroll++;
_parent.txtHSName.scroll++;
_parent.txtHSScore.scroll++;
}
}
Symbol 663 Button
on (release) {
_global.HS.submitScore(_global.C.oStats.nScore);
_global.canSubmitScore = false;
btnSubmit._visible = false;
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 664 Button
on (release) {
_global.P.playGame();
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 673 Button
on (release) {
if (txtCode.text.toUpperCase() == "TENTACLES") {
_global.T.launch(this, function () {
gotoAndStop ("goodCode");
});
} else {
_global.T.launch(this, function () {
gotoAndStop ("wrongCode");
});
}
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 687 Button
on (release) {
_global.T.launch(this, function () {
gotoAndStop ("enterCode");
});
}
on (press) {
_global.C.oCtrlSFX.playSFX("click.wav", 100, 1);
}
Symbol 688 MovieClip Frame 1
stop();
_global.C.oCtrlSFX.changeMusic("_package.wav");
if (_global.CHEAT_ENABLED) {
btnCode._visible = false;
}
Instance of Symbol 371 MovieClip "ControlHS" in Symbol 688 MovieClip Frame 1
onClipEvent (load) {
function getScores() {
if (G_TestHighScore == true) {
trace("getScores");
}
if (gProxyObj == undefined) {
if (G_TestHighScore == true) {
trace("dans getscore, listescore");
}
listScores();
} else {
if (G_TestHighScore == true) {
trace("dans getscore, getScores");
}
gProxyObj.getScores(cbFunc2);
}
}
function submitScore(theScore) {
if (G_TestHighScore == true) {
trace("Envoie le score = " + theScore);
}
gProxyObj.submitScore(theScore, cbFunc);
}
function initHiScores() {
if (G_TestHighScore == true) {
trace("Tu init le highscore!");
}
gProxyObj.setGame_Id("sb_foe");
}
function getScoreString() {
var _local7 = "Oops! The high score list is not available right now!";
if (gProxyObj != undefined) {
trace("gProxyObj is defined");
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.mcHS.txtHSNumber.text = strNumber;
_parent.mcHS.txtHSName.text = strName;
_parent.mcHS.txtHSScore.text = strScore;
} else {
_parent.mcHS.txtHSName.text = "Whoops, the high scores seem to have escaped!";
}
} else {
_parent.mcHS.txtHSName.text = "Oops! The high score list is not available right now!";
}
if (G_TestHighScore == true) {
trace("Tu retournes \u00E7a = " + _local7);
}
return(_local7);
}
function listScores() {
if (G_TestHighScore == true) {
trace("Liste les scores..");
}
getScoreString();
}
function setText() {
if (G_TestHighScore == true) {
trace("Set le texte..");
}
}
function cbFunc(thisBool) {
if (thisBool) {
if (G_TestHighScore == true) {
trace("\u00C7a serait cool que tu list les scores");
}
listScores();
} else {
if (G_TestHighScore == true) {
trace("CBfunc y\u00E9 false...");
}
_parent.mcHS.txtHSName.text = "Oops! The high score list is not available right now!";
}
}
function cbFunc2(thisBool) {
if (thisBool) {
if (G_TestHighScore == true) {
trace("\u00C7a serait cool que tu list les scores");
}
listScores();
} else {
if (G_TestHighScore == true) {
trace("CBfunc y\u00E9 false...");
}
_parent.mcHS.txtHSName.text = "Oops! The high score 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("TestUser");
gProxyObj.setIsLoggedIn(true);
}
initHiScores();
}
Symbol 688 MovieClip Frame 10
stop();
Instance of Symbol 315 MovieClip in Symbol 688 MovieClip Frame 10
/* no clip actions */
Symbol 688 MovieClip Frame 20
stop();
Instance of Symbol 315 MovieClip in Symbol 688 MovieClip Frame 30
/* no clip actions */
Symbol 688 MovieClip Frame 40
stop();
Symbol 688 MovieClip Frame 50
stop();
Instance of Symbol 315 MovieClip in Symbol 688 MovieClip Frame 50
/* no clip actions */
Symbol 688 MovieClip Frame 60
stop();
Instance of Symbol 315 MovieClip in Symbol 688 MovieClip Frame 60
/* no clip actions */
Symbol 688 MovieClip Frame 70
stop();
if ((gProxyObj.getIsLoggedIn() && (_global.canSubmitScore)) && (!_global.NICKTROPOLIS_ENABLED)) {
btnSubmit._visible = true;
} else {
btnSubmit._visible = false;
}
if (_global.NICKTROPOLIS_ENABLED) {
btnView._visible = false;
} else {
btnView._visible = true;
}
Symbol 688 MovieClip Frame 80
stop();
if ((gProxyObj.getIsLoggedIn() && (_global.canSubmitScore)) && (!_global.NICKTROPOLIS_ENABLED)) {
btnSubmit._visible = true;
} else {
btnSubmit._visible = false;
}
if (_global.NICKTROPOLIS_ENABLED) {
btnView._visible = false;
} else {
btnView._visible = true;
}
Instance of Symbol 315 MovieClip in Symbol 688 MovieClip Frame 80
/* no clip actions */
Symbol 688 MovieClip Frame 90
if (_global.NICKTROPOLIS_ENABLED) {
gotoAndStop ("titleCard");
}
_global.HS.getScores();
_global.P.updateScore();
if ((gProxyObj.getIsLoggedIn() && (_global.canSubmitScore)) && (!_global.NICKTROPOLIS_ENABLED)) {
btnSubmit._visible = true;
} else {
btnSubmit._visible = false;
}
stop();
Instance of Symbol 315 MovieClip in Symbol 688 MovieClip Frame 90
/* no clip actions */
Symbol 688 MovieClip Frame 100
txtCode.text = "";
txtCode.maxChars = 10;
Selection.setFocus(txtCode);
Symbol 688 MovieClip Frame 110
_global.CHEAT_ENABLED = true;
getURL ("javascript:trackEvent('TENTACLES')");
Symbol 695 MovieClip Frame 1
new Game.Transition(this);