Frame 1
_focusrect = false;
Stage.showMenu = false;
stop();
Instance of Symbol 51 MovieClip "loader" in Frame 1
onClipEvent (load) {
}
onClipEvent (enterFrame) {
if (_parent.getBytesLoaded() >= _parent.getBytesTotal()) {
mcLoader.mcBar.gotoAndStop(50);
_parent.gotoAndStop("game");
} else {
var l_pc = Math.ceil((_parent.getBytesLoaded() / _parent.getBytesTotal()) * 100);
if (l_pc < 1) {
l_pc = 1;
}
if (l_pc > 100) {
l_pc = 100;
}
mcLoader.mcBar.gotoAndStop(Math.floor(l_pc / 2));
}
}
Frame 14
if (_global.objHS == undefined) {
_global.objHS = new objHSNick();
}
stop();
Symbol 7 MovieClip Frame 1
this._visible = false;
Symbol 28 MovieClip [EasterEgg] Frame 1
#initclip 1
Object.registerClass("EasterEgg", game.visual.movieclip.MCEasterEgg);
#endinitclip
Symbol 29 MovieClip Frame 15
stop();
Symbol 30 MovieClip Frame 28
_global.AOC.projCollide();
Symbol 50 MovieClip Frame 21
stop();
Symbol 56 Button
on (keyPress "<Left>") {
return(undefined);
}
on (keyPress "<Right>") {
return(undefined);
}
on (keyPress "<Up>") {
return(undefined);
}
on (keyPress "<Down>") {
return(undefined);
}
on (keyPress "<Space>") {
return(undefined);
}
on (keyPress "p") {
return(undefined);
}
on (keyPress "P") {
return(undefined);
}
Symbol 58 MovieClip Frame 1
stop();
Symbol 865 MovieClip [__Packages.game.visual.movieclip.MCEasterEgg] Frame 0
class game.visual.movieclip.MCEasterEgg extends MovieClip
{
var onEnterFrame, gotoAndStop, state, removeMovieClip;
function MCEasterEgg () {
super();
onEnterFrame = update;
gotoAndStop(_global.AOC.easterEggState);
}
function update() {
if (state._currentframe == state._totalframes) {
removeMovieClip();
}
}
}
Symbol 866 MovieClip [__Packages.sarbakan.visual.PauseManager] Frame 0
class sarbakan.visual.PauseManager extends MovieClip
{
static var oPausableList, bPaused;
var _parent, _visible, swapDepths, removeMovieClip;
function PauseManager () {
super();
if (!oPausableList) {
reset();
}
register(_parent);
_visible = false;
swapDepths(999999);
removeMovieClip();
bPaused = false;
}
static function register(l_mc) {
oPausableList[l_mc] = l_mc;
l_mc.onUnload = function () {
sarbakan.visual.PauseManager.remove(this);
};
}
static function remove(l_mc) {
delete oPausableList[l_mc];
}
static function reset() {
oPausableList = {};
}
static function pause() {
for (var _local1 in oPausableList) {
oPausableList[_local1].stop();
}
bPaused = true;
}
static function unpause() {
for (var _local1 in oPausableList) {
oPausableList[_local1].play();
}
bPaused = false;
}
}
Symbol 867 MovieClip [__Packages.game.visual.movieclip.MCElement] Frame 0
class game.visual.movieclip.MCElement extends MovieClip
{
var sPrefix, state, sNextState, onEnterFrame, fNextFunction, removeMovieClip, hitTest, mcProjectile, sSide, gotoAndStop;
function MCElement () {
super();
sPrefix = "";
}
function update() {
if (state._currentframe == state._totalframes) {
setState(sNextState);
delete onEnterFrame;
}
}
function updatePreOut() {
if (state._currentframe == state._totalframes) {
setState("In");
state.gotoAndStop(state._totalframes);
onEnterFrame = updateOut;
}
}
function updateOut() {
if (!_global.AOC.pause) {
state.prevFrame();
if (state._currentframe == 1) {
fNextFunction();
removeMovieClip();
}
}
}
function updateWillBreak() {
if (hitTest(mcProjectile)) {
setBreak();
}
}
function updateBreak() {
if (state._currentframe == state._totalframes) {
if (fNextFunction) {
fNextFunction();
fNextFunction = undefined;
}
removeMovieClip();
}
}
function updateSwitch() {
if (state._currentframe == state._totalframes) {
if (sSide == "Right") {
sSide = "Left";
} else {
sSide = "Right";
}
setState("Idle");
if (fNextFunction != undefined) {
delete onEnterFrame;
fNextFunction();
} else {
delete onEnterFrame;
}
}
}
function updateMeld() {
if (state._currentframe == state._totalframes) {
setState(sNextState);
fNextFunction();
delete onEnterFrame;
}
}
function setMeld(l_fNextFunction, l_sState, l_sNextState) {
fNextFunction = l_fNextFunction;
setState(l_sState);
if (l_sNextState != undefined) {
sNextState = l_sNextState;
}
onEnterFrame = updateMeld;
}
function setSwitch(l_fNextFunction) {
setState("Switch");
onEnterFrame = updateSwitch;
fNextFunction = l_fNextFunction;
}
function setWillBreak(l_mcProjectile) {
mcProjectile = l_mcProjectile;
onEnterFrame = updateWillBreak;
}
function setBreak(l_fNextFunction) {
setState("Break");
onEnterFrame = updateBreak;
fNextFunction = l_fNextFunction;
}
function setOut(l_fNextFunction) {
if (state._currentframe == state._totalframes) {
setState("In");
state.gotoAndStop(state._totalframes);
onEnterFrame = updateOut;
} else {
onEnterFrame = updatePreOut;
}
fNextFunction = l_fNextFunction;
}
function setState(l_sState, l_sNextState) {
state.gotoAndPlay(1);
gotoAndStop((sSide + sPrefix) + l_sState);
if (l_sNextState != undefined) {
sNextState = l_sNextState;
onEnterFrame = update;
}
}
function setSide(l_sSide) {
sSide = l_sSide;
}
function setPrefix(l_sPrefix) {
sPrefix = l_sPrefix;
}
function getSide() {
return(sSide);
}
}
Symbol 868 MovieClip [__Packages.game.visual.movieclip.MCSokaProjectile] Frame 0
class game.visual.movieclip.MCSokaProjectile extends MovieClip
{
var nProj, state, sndBoomerang;
function MCSokaProjectile () {
super();
}
function setProj(l_nProj) {
nProj = l_nProj;
state.state.gotoAndStop(nProj);
if (l_nProj == 3) {
sndBoomerang = _global.AOC.playSFX("Boomerang", 9999);
}
}
function stopSound() {
if (sndBoomerang != undefined) {
_global.AOC.stopSFX(sndBoomerang);
}
}
}
Symbol 869 MovieClip [__Packages.game.visual.movieclip.MCBonus] Frame 0
class game.visual.movieclip.MCBonus extends MovieClip
{
var sState, gotoAndStop, onEnterFrame, state, removeMovieClip, nType;
function MCBonus () {
super();
sState = "appear";
gotoAndStop(sState);
onEnterFrame = update;
update();
}
function update() {
if (state._currentframe == state._totalframes) {
if (sState == "appear") {
sState = "idle";
gotoAndStop(sState);
} else if (sState == "idle") {
sState = "clicked";
gotoAndStop(sState);
} else {
removeMovieClip();
}
}
state.state.gotoAndStop(nType);
}
function clicked() {
sState = "clicked";
gotoAndStop(sState);
}
function setType(l_nType) {
nType = l_nType;
state.state.gotoAndStop(nType);
}
}
Symbol 870 MovieClip [__Packages.objHSNick] Frame 0
class objHSNick
{
var bHSAvailable, G_TestHighScore, bSubmitHS, bGetHS, G_GameID, mcHSZone;
function objHSNick () {
bHSAvailable = true;
G_TestHighScore = false;
bSubmitHS = false;
bGetHS = false;
G_GameID = "av_on";
mcHSZone = undefined;
if (G_TestHighScore == true) {
_global.gProxyObj.setServer("www.nick.com");
_global.gProxyObj.setScreenName("AangOn");
_global.gProxyObj.setIsLoggedIn(true);
}
}
function getScores() {
if (_global.gProxyObj == undefined) {
listScores();
} else {
_global.gProxyObj.getScores(cbFunc2);
}
}
function submitScore(theScore) {
addMessage("The high score list is updating!");
_global.gProxyObj.submitScore(theScore, cbFunc);
}
function initHiScores() {
_global.gProxyObj.setGame_Id(G_GameID);
}
function getScoreString() {
var _local8 = "Oops! The high score list is not available right now!";
if (_global.gProxyObj != undefined) {
var _local7 = _global.gProxyObj.getScoreCount();
if (_local7 > 0) {
var _local3;
var _local4;
var _local5;
var _local6;
removeMessage();
_local3 = 0;
while (_local3 < _local7) {
_local8 = "";
_local4 = _global.gProxyObj.getScoreItem(_local3);
_local5 = _local4[0];
_local6 = _local4[1];
_global.AOC.addHighScore(_local5, _local6);
_local3++;
}
} else {
_global.objHS.addMessage("Oops! The high score list is not available right now!");
}
} else {
_global.objHS.addMessage("Oops! The high score list is not available right now!");
}
return(_local8);
}
function listScores() {
getScoreString();
}
function cbFunc(thisBool) {
if (thisBool) {
_global.objHS.listScores();
} else {
addMessage("Oops! The high score list is not available right now!");
}
}
function cbFunc2(thisBool) {
if (thisBool) {
_global.objHS.listScores();
} else {
_global.objHS.addMessage("Oops! The high score list is not available right now!");
}
}
function fDoHSInit() {
initHiScores();
if (_global.gProxyObj.getIsLoggedIn()) {
mcHSZone.btnSubmitHS._visible = true;
} else {
mcHSZone.btnSubmitHS._visible = false;
}
}
function fDoSubmitHS(l_mcStage) {
bSubmitHS = true;
_global.AOC.startHighScore(true);
}
function fDoViewHS(l_mcStage, l_bFromGame) {
bGetHS = true;
_global.AOC.startHighScore(l_bFromGame);
}
function fSetHSBoard(P_mcRef) {
mcHSZone = P_mcRef;
if (_global.gProxyObj.getIsLoggedIn()) {
_global.objHS.fDoHSInit();
mcHSZone.btnSubmitHS._visible = true;
} else {
mcHSZone.btnSubmitHS._visible = false;
}
}
function addMessage(l_sMsg) {
if (mcHSZone.mcHighScore.mcHSMessage == undefined) {
mcHSZone.mcHighScore.attachMovie("OneMessage", "mcHSMessage", mcHSZone.mcHighScore.getNextHighestDepth());
}
mcHSZone.mcHighScore.mcHSMessage._x = 0;
mcHSZone.mcHighScore.mcHSMessage._y = 0;
mcHSZone.mcHighScore.mcHSMessage.txtMsg.text = l_sMsg;
}
function removeMessage() {
if (mcHSZone.mcHighScore.mcHSMessage != undefined) {
mcHSZone.mcHighScore.mcHSMessage.removeMovieClip();
} else {
_global.AOC.clearHighScores();
}
}
}
Symbol 871 MovieClip [__Packages.Controller] Frame 0
class Controller
{
var mcTimeline, sDifficulty, oTransitionManager, oGame, oHighScoreFacade, oTitleCardManager, __get__hud, __get__addScore;
function Controller (l_mcContainer) {
_global.AOC = this;
mcTimeline = l_mcContainer;
sarbakan.sound.SoundManager.init(l_mcContainer);
sDifficulty = "Easy";
oTransitionManager = new sarbakan.packaging.TransitionManager(mcTimeline.mcTransitionManager);
transitionToTitleCard();
sarbakan.sound.SoundManager.clearSounds();
sarbakan.sound.SoundManager.play("MusicPackaging", NUMBER_MUSIC_LEVEL, 99999, true);
}
function transitionToGame() {
var _local2 = new Object();
_local2.inID = "normalIn";
_local2.outID = "normalOut";
_local2.middleListener = new Array(sarbakan.utils.Delegate.create(this, startGame), sarbakan.utils.Delegate.create(this, destroyTitleCard));
oTransitionManager.startTransition(_local2);
}
function transitionToTitleCard() {
var _local2 = new Object();
_local2.inID = "normalIn";
_local2.outID = "normalOut";
_local2.middleListener = sarbakan.utils.Delegate.create(this, initTitleCard);
oTransitionManager.startTransition(_local2);
}
function transitionToHighScore(l_bSubmit) {
if (l_bSubmit) {
_global.objHS.submitScore(oGame.__get__score());
}
var _local3 = new Object();
_local3.inID = "normalIn";
_local3.outID = "normalOut";
_local3.middleListener = sarbakan.utils.Delegate.create(this, initToHighScore);
oTransitionManager.startTransition(_local3);
}
function setHighScore(l_mcStage, l_bFromGame) {
oHighScoreFacade = new HiScoreFacade(l_mcStage, l_bFromGame, oGame.__get__score());
}
function projCollide() {
oGame.projCollide();
}
function restartGame() {
oGame.restart();
}
function initTitleCard() {
mcTimeline.gotoAndStop("TitleCard");
oTitleCardManager = new TitleCardManager(mcTimeline.mcGame);
mcTimeline._visible = false;
mcTimeline.onEnterFrame = function () {
this._visible = true;
delete this.onEnterFrame;
};
}
function initToHighScore() {
initTitleCard();
oTitleCardManager.initToHighScore();
}
function destroyTitleCard() {
oTitleCardManager.destroy();
}
function startGame() {
mcTimeline.gotoAndPlay("game");
}
function frameStartGame() {
oGame = undefined;
delete oGame;
oGame = new game.Game(mcTimeline, sDifficulty);
var _local2 = oTransitionManager.__get__transition();
_local2.endListener = sarbakan.utils.Delegate.create(oGame, oGame.setSequence);
oTransitionManager.__set__transition(_local2);
sarbakan.sound.SoundManager.clearSounds();
sarbakan.sound.SoundManager.play("MusicGame", NUMBER_MUSIC_LEVEL, 99999, true);
}
function endGame(l_bSuccess) {
var _local2 = new Object();
_local2.inID = "normalIn";
_local2.outID = "normalOut";
_local2.middleListener = new Array(sarbakan.utils.Delegate.create(this, setWinLoseCard, l_bSuccess));
oTransitionManager.startTransition(_local2);
}
function setWinLoseCard(l_bSuccess) {
sarbakan.sound.SoundManager.clearSounds();
sarbakan.sound.SoundManager.play("MusicPackaging", NUMBER_MUSIC_LEVEL, 99999, true);
if (l_bSuccess) {
mcTimeline.gotoAndStop("Win");
mcTimeline.mcAgain.gotoAndStop(1);
} else {
mcTimeline.gotoAndStop("Lose");
mcTimeline.mcAgain.gotoAndStop(2);
}
delete mcTimeline.mcGameUpdater.onEnterFrame;
mcTimeline.mcAgain.onRelease = sarbakan.utils.Delegate.create(this, transitionToGame);
var _local3 = Math.ceil(Math.random() * 4);
mcTimeline.mcText.gotoAndStop(_local3);
mcTimeline.txtScore.text = sarbakan.utils.MoreMath.padZero(oGame.__get__score(), 6);
mcTimeline.btnQuit.onRelease = sarbakan.utils.Delegate.create(this, returnToTitleCard);
if (_global.gProxyObj.getIsLoggedIn()) {
mcTimeline.btnScore.gotoAndStop("Submit");
} else {
mcTimeline.btnScore.gotoAndStop("View");
}
}
function playSFX(l_sSound, l_nRepeat) {
var _local2 = false;
if (l_nRepeat > 1000) {
_local2 = true;
}
return(sarbakan.sound.SoundManager.play(l_sSound, NUMBER_SFX_LEVEL, l_nRepeat, _local2));
}
function stopSFX(l_sndShake) {
sarbakan.sound.SoundManager.stop(l_sndShake);
}
function toggleMute() {
if (sarbakan.sound.SoundManager.isMuted()) {
sarbakan.sound.SoundManager.unmute();
} else {
sarbakan.sound.SoundManager.mute();
}
return(sarbakan.sound.SoundManager.isMuted());
}
function returnToTitleCard() {
var _local2 = new Object();
_local2.inID = "normalIn";
_local2.outID = "normalOut";
_local2.middleListener = new Array(sarbakan.utils.Delegate.create(this, initTitleCard));
oTransitionManager.startTransition(_local2);
}
function startHighScore(bFromGame) {
oHighScoreFacade = new HiScoreFacade(mcTimeline, bFromGame, oGame.__get__score());
}
function addHighScore(l_sName, l_nScore) {
oHighScoreFacade.addHighScore(l_sName, l_nScore);
}
function clearHighScores() {
oHighScoreFacade.clearHighScores();
}
function get difficulty() {
return(sDifficulty);
}
function set difficulty(l_sDifficulty) {
sDifficulty = l_sDifficulty;
//return(difficulty);
}
function getTitlePressFunction(l_mcTitleArrow) {
return(oTitleCardManager.getTitlePressFunction(l_mcTitleArrow));
}
function set hud(l_mcHud) {
oGame.__set__hud(l_mcHud);
//return(__get__hud());
}
function set addScore(l_nScore) {
oGame.__set__addScore(l_nScore);
//return(__get__addScore());
}
function get pause() {
return(oGame.__get__pause());
}
function set pause(l_bPause) {
oGame.__set__pause(l_bPause);
//return(pause);
}
function get easterEggState() {
return(oGame.__get__easterEggState());
}
function get isMute() {
return(sarbakan.sound.SoundManager.isMuted());
}
var NUMBER_MUSIC_LEVEL = 20;
var NUMBER_SFX_LEVEL = 70;
}
Symbol 872 MovieClip [__Packages.sarbakan.packaging.TransitionManager] Frame 0
class sarbakan.packaging.TransitionManager
{
var mc, oEnterFrameListener, oCurrentTransition, sState;
function TransitionManager (l_mc) {
mc = l_mc;
mc.gotoAndStop("inactive");
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = sarbakan.utils.Delegate.create(this, update);
}
function startTransition(l_oTransition) {
oCurrentTransition = l_oTransition;
sState = "Out";
mc.gotoAndStop(oCurrentTransition.outID);
MovieClip.addListener(oEnterFrameListener);
}
function endTransition() {
MovieClip.removeListener(oEnterFrameListener);
if (typeof(oCurrentTransition.endListener) != "function") {
for (var _local2 in oCurrentTransition.endListener) {
oCurrentTransition.endListener[_local2];
}
} else {
oCurrentTransition.endListener();
}
delete oCurrentTransition;
sState = "";
mc.gotoAndStop("inactive");
}
function update() {
if (sState == "Out") {
if (stateFinished()) {
mc.gotoAndStop(oCurrentTransition.inID);
sState = "In";
if (typeof(oCurrentTransition.middleListener) != "function") {
for (var _local2 in oCurrentTransition.middleListener) {
oCurrentTransition.middleListener[_local2]();
}
} else {
oCurrentTransition.middleListener();
}
}
} else if (sState == "In") {
if (stateFinished()) {
endTransition();
}
}
}
function stateStarting() {
return(mc.state._currentframe == 1);
}
function stateFinished() {
return(mc.state._currentframe == mc.state._totalframes);
}
function get transition() {
return(oCurrentTransition);
}
function set transition(l_oCurrentTransition) {
oCurrentTransition = l_oCurrentTransition;
//return(transition);
}
}
Symbol 873 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 874 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 875 MovieClip [__Packages.sarbakan.utils.Delegate] Frame 0
class sarbakan.utils.Delegate extends Object
{
var func;
function Delegate () {
super();
}
function DelegateArgs(f) {
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local3 = arguments.callee.target;
var _local4 = arguments.callee.func;
var _local2 = arguments.callee.arg;
_local2 = _local2.concat(arguments);
return(_local4.apply(_local3, _local2));
};
_local2.target = obj;
_local2.func = func;
_local2.arg = arguments.slice(2);
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 876 MovieClip [__Packages.TitleCardManager] Frame 0
class TitleCardManager
{
static var oEnterFrameListener;
var mcContainer, nSpeedX, nSpeedY, nCenterPosX, nPosX, nCenterPosY, nPosY, fEasing, nInitMouseX, nInitMouseY, oCam, oCurrentMenu, oHighScoreCoord, oElementHS, nTargetX, nTargetY, oLayerManager, oLayerSun, oLayerSky, oLayerBackTrees, oLayerBackCliff, oLayerWater, oLayerLeftCliff, oLayerBackPillars, oLayerFrontPillars, oLayerRightCliff, oElementLayer, aScreenList, aElementList;
function TitleCardManager (l_mcContainer) {
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = sarbakan.utils.Delegate.create(this, update);
MovieClip.addListener(oEnterFrameListener);
mcContainer = l_mcContainer;
initLayers();
initElements();
nSpeedX = 0;
nSpeedY = 0;
nCenterPosX = (nPosX = INIT_CAM_COORD.x);
nCenterPosY = (nPosY = INIT_CAM_COORD.y);
fEasing = mx.transitions.easing.Regular.easeOut;
nInitMouseX = MainProperties.STAGE_WIDTH / 2;
nInitMouseY = MainProperties.STAGE_HEIGHT / 2;
setTarget();
setBounceCam();
if (_global.objHS.bHSAvailable) {
_global.objHS.fDoHSInit();
}
}
function getCamCoord() {
return({x:nPosX, y:nPosY});
}
function transitionTo(l_nTargetX, l_nTargetY, l_oTarget) {
var _local9;
var _local6;
var _local8;
var _local7;
oCam.unlock();
oCam.setSpeed(MOVE_SPEED);
oCam.setEasing(fEasing);
nCenterPosX = l_nTargetX;
nCenterPosY = l_nTargetY;
oCam.travelTo(l_nTargetX, l_nTargetY, sarbakan.utils.Delegate.create(l_oTarget, l_oTarget.endTravelTo));
oCurrentMenu = l_oTarget;
if (oCurrentMenu.__get__isHighScore()) {
_global.AOC.startHighScore(false);
}
}
function initToHighScore() {
oCam.unlock();
oCam.setSpeed(MOVE_SPEED);
oCam.setEasing(fEasing);
nCenterPosX = oHighScoreCoord.x;
nCenterPosY = oHighScoreCoord.y;
setTarget();
setBounceCam();
oCurrentMenu = oElementHS;
oCurrentMenu.setMouseMove();
if (oCurrentMenu.__get__isHighScore()) {
_global.AOC.startHighScore(false);
}
}
function setBounceCam() {
nInitMouseX = mcContainer._xmouse;
nInitMouseY = mcContainer._ymouse;
nTargetX = nInitMouseX;
nTargetY = nInitMouseY;
nPosX = nCenterPosX;
nPosY = nCenterPosY;
oCam.moveTo(nPosX, nPosY);
oCam.lockOn(sarbakan.utils.Delegate.create(this, getCamCoord), true);
}
function destroy() {
MovieClip.removeListener(oEnterFrameListener);
oLayerManager.destroy();
}
function update() {
setTarget();
setSpeed();
setPos();
oLayerManager.update();
}
function setTarget() {
var _local3;
var _local2;
_local3 = mcContainer._xmouse - nInitMouseX;
if (_local3 > 0) {
_local3 = Math.max(0, _local3 - NUMBER_STATIC_SPAN);
} else {
_local3 = Math.min(0, _local3 + NUMBER_STATIC_SPAN);
}
_local3 = nPosX + _local3;
var _local5 = nCenterPosX + NUMBER_BOUNCE_DISTANCE;
var _local4 = nCenterPosX - NUMBER_BOUNCE_DISTANCE;
var _local6 = nCenterPosY - NUMBER_BOUNCE_DISTANCE;
var _local7 = nCenterPosY + NUMBER_BOUNCE_DISTANCE;
if (_local3 > _local5) {
nTargetX = _local5;
} else if (_local3 < _local4) {
nTargetX = _local4;
} else {
nTargetX = _local3;
}
_local2 = mcContainer._ymouse - nInitMouseY;
if (_local2 > 0) {
_local2 = Math.max(0, _local2 - NUMBER_STATIC_SPAN);
} else {
_local2 = Math.min(0, _local2 + NUMBER_STATIC_SPAN);
}
_local2 = nPosY + _local2;
if (_local2 > _local7) {
nTargetY = _local7;
} else if (_local2 < _local6) {
nTargetY = _local6;
} else {
nTargetY = _local2;
}
}
function setSpeed() {
var _local3 = (nTargetX - nPosX) * SPRING;
var _local2 = (nTargetY - nPosY) * SPRING;
nSpeedX = nSpeedX + _local3;
nSpeedX = nSpeedX * FRICTION;
nSpeedY = nSpeedY + _local2;
nSpeedY = nSpeedY * FRICTION;
}
function setPos() {
nPosX = nPosX + nSpeedX;
nPosY = nPosY + nSpeedY;
}
function initLayers() {
oLayerManager = new sarbakan.visual.layer.LayerManager(1600, 2000, 600, 600);
oCam = oLayerManager.getCamera();
oLayerSun = new sarbakan.visual.layer.Layer(mcContainer.mcSun, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(oLayerSun, SPEED_SUN, 1);
oLayerSky = new sarbakan.visual.layer.Layer(mcContainer.mcSky, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(oLayerSky, SPEED_SKY, 1);
oLayerBackTrees = new sarbakan.visual.layer.Layer(mcContainer.mcBackTrees, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(oLayerBackTrees, SPEED_BACK_TREES, 1);
oLayerBackCliff = new sarbakan.visual.layer.Layer(mcContainer.mcBackCliff, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(oLayerBackCliff, SPEED_BACK_CLIFF, 1);
oLayerWater = new sarbakan.visual.layer.Layer(mcContainer.mcWater, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(oLayerWater, SPEED_WATER, 0.923);
oLayerLeftCliff = new sarbakan.visual.layer.Layer(mcContainer.mcLeftCliff, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(oLayerLeftCliff, SPEED_LEFT_CLIFF, 1);
oLayerBackPillars = new sarbakan.visual.layer.Layer(mcContainer.mcBackPillars, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(oLayerBackPillars, SPEED_BACK_PILLARS, 1);
oLayerFrontPillars = new sarbakan.visual.layer.Layer(mcContainer.mcFrontPillars, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(oLayerFrontPillars, SPEED_FRONT_PILLARS, 2);
oLayerRightCliff = new sarbakan.visual.layer.Layer(mcContainer.mcRightCliff, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(oLayerRightCliff, SPEED_RIGHT_CLIFF, 1);
}
function initElements() {
oElementLayer = new sarbakan.visual.layer.Layer(mcContainer.mcElements, new sarbakan.visual.activation.NoActivation());
aScreenList = new Array();
var _local6 = new TitleElement(mcContainer.mcElements.mcTitle, true, this);
oElementLayer.addDynamicElement(_local6);
aScreenList.push(_local6);
var _local9 = new TitleElement(mcContainer.mcElements.mcInstructions, true, this);
oElementLayer.addDynamicElement(_local9);
aScreenList.push(_local9);
oElementHS = new TitleElement(mcContainer.mcElements.mcHighScore, true, this);
oElementLayer.addDynamicElement(oElementHS);
aElementList.push(oElementHS);
oElementHS.setAsHighScore();
var _local8 = new TitleElement(mcContainer.mcElements.mcDifficulty, true, this);
oElementLayer.addDynamicElement(_local8);
aScreenList.push(_local8);
var _local7 = new TitleElement(mcContainer.mcElements.mcPlay, true, this);
oElementLayer.addDynamicElement(_local7);
aScreenList.push(_local7);
oCurrentMenu = _local6;
oCurrentMenu.setMouseMove();
var _local10 = new Object({x:560, y:330});
var _local14 = new Object({x:560, y:0});
var _local11 = new Object({x:170, y:330});
oHighScoreCoord = _local11;
var _local13 = new Object({x:970, y:330});
var _local12 = new Object({x:560, y:645});
var _local4 = new Object({x:-290, y:-325});
var _local5 = new Object({x:335, y:320});
var _local3 = new Object({x:_local4.x + SIZE_EDGES});
var _local2 = new Object({x:_local5.x - SIZE_EDGES, y:_local4.y + SIZE_EDGES});
_local6.addTransitionElement(_local3, _local2, _local14, _local9, "mcArrowUp");
_local3 = new Object({y:_local4.y + SIZE_EDGES});
_local2 = new Object({x:_local4.x + SIZE_EDGES, y:_local5.y - SIZE_EDGES});
_local6.addTransitionElement(_local3, _local2, _local11, oElementHS, "mcArrowLeft");
_local3 = new Object({x:_local5.x - SIZE_EDGES, y:_local4.y + SIZE_EDGES});
_local2 = new Object({y:_local5.y - SIZE_EDGES});
_local6.addTransitionElement(_local3, _local2, _local13, _local8, "mcArrowRight");
_local3 = new Object({x:_local4.x + SIZE_EDGES, y:_local5.y - SIZE_EDGES});
_local2 = new Object({x:_local5.x - SIZE_EDGES});
_local6.addTransitionElement(_local3, _local2, _local12, _local7, "mcArrowDown");
_local4 = new Object({x:-330, y:-320});
_local5 = new Object({x:310, y:320});
_local3 = new Object({y:_local4.y + SIZE_EDGES});
_local2 = new Object({x:_local4.x + SIZE_EDGES, y:_local5.y - SIZE_EDGES});
_local9.addTransitionElement(_local3, _local2, _local11, oElementHS, "mcArrowLeft");
_local3 = new Object({x:_local5.x - SIZE_EDGES, y:_local4.y + SIZE_EDGES});
_local2 = new Object({y:_local5.y - SIZE_EDGES});
_local9.addTransitionElement(_local3, _local2, _local13, _local8, "mcArrowRight");
_local3 = new Object({x:_local4.x + SIZE_EDGES, y:_local5.y - SIZE_EDGES});
_local2 = new Object({x:_local5.x - SIZE_EDGES});
_local9.addTransitionElement(_local3, _local2, _local10, _local6, "mcArrowDown");
_local4 = new Object({x:-310, y:-300});
_local5 = new Object({x:320, y:260});
_local3 = new Object({x:_local4.x + SIZE_EDGES});
_local2 = new Object({x:_local5.x - SIZE_EDGES, y:_local4.y + SIZE_EDGES});
oElementHS.addTransitionElement(_local3, _local2, _local14, _local9, "mcArrowUp");
_local3 = new Object({x:_local5.x - SIZE_EDGES, y:_local4.y + SIZE_EDGES});
_local2 = new Object({y:_local5.y - SIZE_EDGES});
oElementHS.addTransitionElement(_local3, _local2, _local10, _local6, "mcArrowRight");
_local3 = new Object({x:_local4.x + SIZE_EDGES, y:_local5.y - SIZE_EDGES});
_local2 = new Object({x:_local5.x - SIZE_EDGES});
oElementHS.addTransitionElement(_local3, _local2, _local12, _local7, "mcArrowDown");
_local4 = new Object({x:-320, y:-360});
_local5 = new Object({x:410, y:290});
_local3 = new Object({x:_local4.x + SIZE_EDGES});
_local2 = new Object({x:_local5.x - SIZE_EDGES, y:_local4.y + SIZE_EDGES});
_local8.addTransitionElement(_local3, _local2, _local14, _local9, "mcArrowUp");
_local3 = new Object({y:_local4.y + SIZE_EDGES});
_local2 = new Object({x:_local4.x + SIZE_EDGES, y:_local5.y - SIZE_EDGES});
_local8.addTransitionElement(_local3, _local2, _local10, _local6, "mcArrowLeft");
_local3 = new Object({x:_local4.x + SIZE_EDGES, y:_local5.y - SIZE_EDGES});
_local2 = new Object({x:_local5.x - SIZE_EDGES});
_local8.addTransitionElement(_local3, _local2, _local12, _local7, "mcArrowDown");
_local4 = new Object({x:-330, y:-340});
_local5 = new Object({x:325, y:310});
_local3 = new Object({x:_local4.x + SIZE_EDGES, y:_local4.y});
_local2 = new Object({x:_local5.x - SIZE_EDGES, y:_local4.y + SIZE_EDGES});
_local7.addTransitionElement(_local3, _local2, _local10, _local6, "mcArrowUp");
_local3 = new Object({y:_local4.y + SIZE_EDGES});
_local2 = new Object({x:_local4.x + SIZE_EDGES, y:_local5.y - SIZE_EDGES});
_local7.addTransitionElement(_local3, _local2, _local11, oElementHS, "mcArrowLeft");
_local3 = new Object({x:_local5.x - SIZE_EDGES, y:_local4.y + SIZE_EDGES});
_local2 = new Object({y:_local5.y - SIZE_EDGES});
_local7.addTransitionElement(_local3, _local2, _local13, _local8, "mcArrowRight");
oLayerManager.addLayer(oElementLayer, SPEED_ELEMENTS, SPEED_ELEMENTS);
}
function getTitlePressFunction(l_mcTitleArrow) {
var _local2 = oElementLayer.findDynamicElementByMC(l_mcTitleArrow);
var _local3;
if (_local2 != undefined) {
_local3 = _local2.getTitlePressFunction(l_mcTitleArrow);
}
return(_local3);
}
static var SIZE_EDGES = 60;
static var NUMBER_STATIC_SPAN = 150;
static var INIT_CAM_COORD = {x:565, y:330};
static var NUMBER_BOUNCE_DISTANCE = 20;
static var MOVE_SPEED = 10;
static var SPRING = 0.1;
static var FRICTION = 0.8;
static var SPEED_SUN = 0.05;
static var SPEED_SKY = 0.4;
static var SPEED_BACK_TREES = 0.5;
static var SPEED_BACK_CLIFF = 0.6;
static var SPEED_WATER = 0.7;
static var SPEED_LEFT_CLIFF = 0.8;
static var SPEED_BACK_PILLARS = 0.85;
static var SPEED_FRONT_PILLARS = 1.6;
static var SPEED_RIGHT_CLIFF = 0.8;
static var SPEED_ELEMENTS = 1.5;
}
Symbol 877 MovieClip [__Packages.sarbakan.visual.layer.Layer] Frame 0
class sarbakan.visual.layer.Layer
{
var mc, oDynamicElements, oStaticElements, oCollisionMaps, oActivationManager, nStageWHalf, nStageHHalf;
function Layer (l_mc, l_oActivationManager) {
mc = l_mc;
oDynamicElements = {};
oStaticElements = [];
oCollisionMaps = {};
oActivationManager = l_oActivationManager;
}
function init(l_nStageW, l_nStageH) {
nStageWHalf = l_nStageW / 2;
nStageHHalf = l_nStageH / 2;
oActivationManager.init(l_nStageW, l_nStageH);
}
function addDynamicElement(l_oElement) {
oDynamicElements[l_oElement.id] = l_oElement;
l_oElement.setOwner(this);
if (!l_oElement.bAlwaysActive) {
var _local3 = l_oElement.getGlobalPos(l_oElement.mc);
oActivationManager.addDynamicElement(l_oElement, _local3.x, _local3.y, l_oElement.mc._width, l_oElement.mc._height);
} else {
oActivationManager.addAlwaysActiveElement(l_oElement);
}
}
function changeDynamicElementID(l_oElement, l_sNewID) {
delete oDynamicElements[l_oElement.id];
l_oElement.id = l_sNewID;
oDynamicElements[l_oElement.id] = l_oElement;
}
function removeDynamicElement(l_oElement) {
oActivationManager.removeDynamicElement(l_oElement);
delete oDynamicElements[l_oElement.id];
}
function findDynamicElementByMC(l_mcElement) {
var _local2;
var _local3;
for (_local2 in oDynamicElements) {
if (oDynamicElements[_local2].getMC() == l_mcElement._parent) {
_local3 = oDynamicElements[_local2];
break;
}
}
return(_local3);
}
function addStaticElement(l_oElement) {
l_oElement.mc._visible = false;
l_oElement.setOwner(this);
oActivationManager.addStaticElement(l_oElement.mc, l_oElement.mc._x, l_oElement.mc._y, l_oElement.mc._width, l_oElement.mc._height);
oStaticElements.push(l_oElement.mc);
}
function addCollisionMap(l_oCollisionMap) {
oCollisionMaps[l_oCollisionMap.id] = l_oCollisionMap;
}
function update() {
oActivationManager.updateActivation((mc._x - nStageWHalf) * -1, (mc._y - nStageHHalf) * -1);
var _local2;
_local2 = oActivationManager.getActiveElements();
for (var _local3 in _local2) {
_local2[_local3].update();
}
}
function reset() {
for (var _local2 in oDynamicElements) {
oDynamicElements[_local2].reset();
}
}
function pause() {
var _local2;
_local2 = oActivationManager.getActiveElements();
for (var _local3 in _local2) {
_local2[_local3].pause();
}
}
function unpause() {
var _local2;
_local2 = oActivationManager.getActiveElements();
for (var _local3 in _local2) {
_local2[_local3].unpause();
}
}
function destroy() {
for (var _local2 in oDynamicElements) {
oDynamicElements[_local2].remove();
}
for (var _local2 in oStaticElements) {
oStaticElements[_local2].removeMovieClip();
}
for (var _local2 in oCollisionMaps) {
oCollisionMaps[_local2].remove();
}
}
}
Symbol 878 MovieClip [__Packages.sarbakan.visual.activation.ActivationManager] Frame 0
class sarbakan.visual.activation.ActivationManager
{
var nZoneWidth, nZoneHeight;
function ActivationManager () {
}
function init(l_nZoneWidth, l_nZoneHeight) {
nZoneWidth = l_nZoneWidth;
nZoneHeight = l_nZoneHeight;
}
function addDynamicElement(l_oElement, l_nX, l_nY, l_nWidth, l_nHeight) {
}
function addAlwaysActiveElement(l_oElement) {
}
function removeDynamicElement(l_oElement) {
}
function addStaticElement(l_oElement, l_nX, l_nY, l_nWidth, l_nHeight) {
}
function removeStaticElement(l_oElement) {
}
function updateActivation(l_nX, l_nY) {
}
function getActiveElements() {
return([]);
}
}
Symbol 879 MovieClip [__Packages.sarbakan.visual.element.BaseElement] Frame 0
class sarbakan.visual.element.BaseElement
{
static var nNextID;
var id, oOwner, mc;
function BaseElement (l_sID) {
id = l_sID;
}
function setOwner(l_oOwner) {
oOwner = l_oOwner;
}
function setMC(l_mc) {
mc = l_mc;
}
function getMC() {
return(mc);
}
function attachMC() {
}
function toString() {
return(("[Element " + id) + "]");
}
static function resetID() {
nNextID = undefined;
}
static function getNextID() {
if (!nNextID) {
nNextID = 0;
}
return(nNextID++);
}
}
Symbol 880 MovieClip [__Packages.sarbakan.visual.element.DynamicElement] Frame 0
class sarbakan.visual.element.DynamicElement extends sarbakan.visual.element.BaseElement
{
var nSpeedX, nSpeedXLast, nSpeedY, nSpeedYLast, bAlwaysActive, bStaticMovieClip, mc, oOwner, sNextState, sState;
function DynamicElement (l_sID) {
super(l_sID);
nSpeedX = 0;
nSpeedXLast = 0;
nSpeedY = 0;
nSpeedYLast = 0;
bAlwaysActive = false;
bStaticMovieClip = false;
}
function update() {
updateState();
updateMove();
}
function enable() {
setState(DEFAULT_STATE);
updateState();
}
function disable() {
setState("inactive");
updateState();
}
function pause() {
mc.state.stop();
}
function unpause() {
mc.state.play();
}
function remove() {
disable();
if (!bStaticMovieClip) {
mc.removeMovieClip();
}
oOwner.removeDynamicElement(this);
}
function reset() {
}
function setState(l_sState) {
sNextState = l_sState;
}
function getState() {
return(sState);
}
function getCoord() {
var _local2 = new Object();
_local2.x = mc._x;
_local2.y = mc._y;
return(_local2);
}
function setCoord(l_oPos) {
mc._x = l_oPos.x;
mc._y = l_oPos.y;
}
function collideWithMap(l_sCollisionMapID) {
var _local3;
if (typeof(arguments[1]) == "movieclip") {
_local3 = getGlobalPos(arguments[1]);
} else if (typeof(arguments[1]) == "object") {
_local3 = arguments[1];
} else {
_local3 = getGlobalPos(mc);
}
return(oOwner.oCollisionMaps[l_sCollisionMapID].mc.hitTest(_local3.x, _local3.y, true));
}
function collideWithElement(l_sElementID) {
var _local3;
if (arguments[1]) {
_local3 = getGlobalPos(arguments[1]);
} else {
_local3 = getGlobalPos(mc);
}
return(oOwner.oDynamicElements[l_sElementID].mc.hitTest(_local3.x, _local3.y, false));
}
function collideWithElementBox(l_sElementID) {
var _local3;
if (arguments[1]) {
_local3 = arguments[1];
} else {
_local3 = mc;
}
return(oOwner.oDynamicElements[l_sElementID].mc.hitTest(_local3));
}
function setMC(l_mc) {
super.setMC(l_mc);
sNextState = sState;
updateState();
}
function getElement(l_sElementID) {
return(oOwner.oDynamicElements[l_sElementID]);
}
function stateStarting() {
return(mc.state._currentframe == 1);
}
function stateFinished() {
return(mc.state._currentframe == mc.state._totalframes);
}
function stateCurrentFrame() {
return(mc.state._currentframe);
}
function getGlobalPos(l_mc) {
var _local1 = new Object();
_local1.x = 0;
_local1.y = 0;
_local1.x = l_mc._x;
_local1.y = l_mc._y;
l_mc._parent.localToGlobal(_local1);
return(_local1);
}
function updateState() {
if (sNextState != undefined) {
sState = sNextState;
sNextState = undefined;
mc.state.gotoAndPlay(1);
mc.gotoAndStop(sState);
}
this[sState]();
}
function updateMove() {
mc._x = nSpeedX + mc._x;
mc._y = nSpeedY + mc._y;
}
var DEFAULT_STATE = "idle";
}
Symbol 881 MovieClip [__Packages.sarbakan.visual.element.StaticElement] Frame 0
class sarbakan.visual.element.StaticElement extends sarbakan.visual.element.BaseElement
{
function StaticElement (l_sID) {
super(l_sID);
}
}
Symbol 882 MovieClip [__Packages.sarbakan.visual.layer.CollisionMap] Frame 0
class sarbakan.visual.layer.CollisionMap
{
static var nDepth;
var id, oLayer, mc, nColor;
function CollisionMap (l_sID, l_oLayer, l_nColor) {
if (!nDepth) {
nDepth = BASE_DEPTH;
}
id = l_sID;
oLayer = l_oLayer;
mc = oLayer.mc.createEmptyMovieClip(id, nDepth++);
mc._visible = false;
if (!l_nColor) {
nColor = 16711935 /* 0xFF00FF */;
} else {
nColor = l_nColor;
}
}
function show(l_nAlpha) {
mc._visible = true;
if (l_nAlpha) {
mc._alpha = l_nAlpha;
} else {
mc._alpha = 100;
}
}
function hide() {
mc._visible = false;
mc._alpha = 100;
}
function drawRect(l_nX, l_nY, l_nWidth, l_nHeight) {
mc.moveTo(l_nX, l_nY);
mc.beginFill(nColor);
mc.lineTo(l_nX + l_nWidth, l_nY);
mc.lineTo(l_nX + l_nWidth, l_nY + l_nHeight);
mc.lineTo(l_nX, l_nY + l_nHeight);
mc.lineTo(l_nX, l_nY);
}
function setNewSource(l_mcSource) {
remove();
mc = l_mcSource;
mc._visible = false;
}
function attachMC(l_sLinkage, l_nX, l_nY, l_sName) {
if (!l_sName) {
l_sName = String(mc.getNextHighestDepth());
}
return(mc.attachMovie(l_sLinkage, l_sName, mc.getNextHighestDepth(), {_x:l_nX, _y:l_nY}));
}
function remove() {
mc.removeMovieClip();
}
static var BASE_DEPTH = 64000;
}
Symbol 883 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 884 MovieClip [__Packages.sarbakan.visual.Camera] Frame 0
class sarbakan.visual.Camera
{
static var oEnterFrameListener;
var nX, nY, nViewZoneW, nViewZoneH, nStageW, nStageH, bLockedOn, bPaused, nSpeed, bTravelling, oTweenX, fEasing, oTweenY, nTravelDestX, nTravelDestY, fEndListener, fLockedFunction, __get__x, __get__y;
function Camera (l_viewZoneW, l_viewZoneH, l_nStageW, l_nStageH) {
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = mx.utils.Delegate.create(this, update);
MovieClip.addListener(oEnterFrameListener);
nX = 0;
nY = 0;
nViewZoneW = l_viewZoneW;
nViewZoneH = l_viewZoneH;
nStageW = l_nStageW;
nStageH = l_nStageH;
setSpeed(DEFAULT_SPEED);
setEasing(DEFAULT_EASING);
bLockedOn = false;
bPaused = false;
}
function travelTo(l_nDestX, l_nDestY, l_fListener) {
var _local2 = Math.round(sarbakan.utils.MoreMath.getDistance(nX * -1, nY * -1, l_nDestX, l_nDestY) / nSpeed);
if (!bTravelling) {
oTweenX = new mx.transitions.Tween(this, "x", fEasing, nX * -1, l_nDestX, _local2, false);
oTweenY = new mx.transitions.Tween(this, "y", fEasing, nY * -1, l_nDestY, _local2, false);
oTweenX.onMotionFinished = mx.utils.Delegate.create(this, onTravelFinished);
} else {
oTweenX.continueTo(l_nDestX, _local2);
oTweenY.continueTo(l_nDestY, _local2);
}
nTravelDestX = l_nDestX;
nTravelDestY = l_nDestY;
if (l_fListener) {
fEndListener = l_fListener;
}
bTravelling = true;
}
function moveTo(l_nDestX, l_nDestY) {
x = (l_nDestX);
y = (l_nDestY);
}
function lockOn(l_fLockFunction, l_bInstant) {
bLockedOn = true;
fLockedFunction = l_fLockFunction;
var _local2 = fLockedFunction();
if ((_local2.x != nX) || (_local2.y != nY)) {
if (l_bInstant) {
moveTo(_local2.x, _local2.y);
} else {
travelTo(_local2.x, _local2.y);
}
}
}
function unlock() {
bLockedOn = false;
fLockedFunction = undefined;
}
function setSpeed(l_nSpeed) {
if (l_nSpeed) {
nSpeed = l_nSpeed;
} else {
setSpeed(DEFAULT_SPEED);
}
}
function setEasing(l_fEasing) {
if (l_fEasing) {
fEasing = l_fEasing;
} else {
setEasing(DEFAULT_EASING);
}
}
function pause() {
bPaused = true;
if (oTweenX.__get__position() < oTweenX.__get__finish()) {
oTweenX.stop();
}
if (oTweenY.__get__position() < oTweenY.__get__finish()) {
oTweenY.stop();
}
}
function unpause() {
bPaused = false;
if (oTweenX.__get__position() < oTweenX.__get__finish()) {
oTweenX.resume();
}
if (oTweenY.__get__position() < oTweenY.__get__finish()) {
oTweenY.resume();
}
}
function togglePause() {
if (!bPaused) {
pause();
} else {
unpause();
}
}
function set x(l_nX) {
nX = l_nX;
if (nX < 0) {
nX = 0;
}
if (nX > (nViewZoneW - nStageW)) {
nX = Math.round(nViewZoneW - nStageW);
}
nX = nX * -1;
//return(__get__x());
}
function set y(l_nY) {
nY = l_nY;
if (nY < 0) {
nY = 0;
}
if (nY > (nViewZoneH - nStageH)) {
nY = Math.round(nViewZoneH - nStageH);
}
nY = nY * -1;
//return(__get__y());
}
function getX() {
return(nX);
}
function getY() {
return(nY);
}
function destroy() {
MovieClip.removeListener(oEnterFrameListener);
}
function update() {
if (bLockedOn) {
var _local2 = fLockedFunction();
if ((!bTravelling) && (bLockedOn)) {
moveTo(_local2.x, _local2.y);
} else if ((_local2.x != nTravelDestX) || (_local2.y != nTravelDestY)) {
travelTo(_local2.x, _local2.y);
}
}
}
function onTravelFinished() {
bTravelling = false;
if (fEndListener) {
fEndListener();
fEndListener = undefined;
}
}
static var DEFAULT_SPEED = 5;
static var DEFAULT_EASING = mx.transitions.easing.Regular.easeOut;
}
Symbol 885 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 886 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 887 MovieClip [__Packages.sarbakan.utils.MoreMath] Frame 0
class sarbakan.utils.MoreMath
{
function MoreMath () {
}
static function random(l_nMin, l_nMax) {
return(Math.floor(Math.random() * l_nMax) + l_nMin);
}
static function getDistance(l_x1, l_y1, l_x2, l_y2) {
return(Math.sqrt(Math.pow(Math.abs(l_x2 - l_x1), 2) + Math.pow(Math.abs(l_y2 - l_y1), 2)));
}
static function getManhattanDistance(l_x1, l_y1, l_x2, l_y2) {
return(Math.abs(l_x1 - l_x2) + Math.abs(l_y1 - l_y2));
}
static function getAngle(l_oPt1, l_oPt2) {
var _local2 = 0;
var _local3 = 0;
var _local1 = 0;
var _local4 = 0;
_local2 = (l_oPt1.x - l_oPt2.x) * -1;
_local3 = (l_oPt1.y - l_oPt2.y) * -1;
_local1 = Math.atan2(_local3, _local2);
_local1 = (_local1 * 180) / Math.PI;
if (_local1 < 0) {
_local1 = _local1 * -1;
_local4 = 180 - _local1;
_local1 = 180 + _local4;
}
if (_local1 < 0) {
_local1 = _local1 + 360;
}
return(_local1);
}
static function angleDirection(x1, y1, x2, y2) {
var _local7 = Math.abs(x2 - x1);
var _local6 = getDistance(x1, y1, x2, y2);
var _local1 = Math.asin(_local7 / _local6) * 57.2957795130823;
if ((x2 >= x1) && (y2 >= y1)) {
_local1 = 90 + (90 - _local1);
} else if ((x2 <= x1) && (y2 >= y1)) {
_local1 = _local1 + 180;
} else if ((x2 <= x1) && (y2 <= y1)) {
_local1 = 270 + (90 - _local1);
}
return(_local1);
}
static function getRadian(l_oPt1, l_oPt2) {
var _local1 = 0;
var _local2 = 0;
var _local3 = 0;
_local1 = (l_oPt1.x - l_oPt2.x) * -1;
_local2 = (l_oPt1.y - l_oPt2.y) * -1;
_local3 = Math.atan2(_local2, _local1);
return(_local3);
}
static function between(small, large, compare, include) {
var _local1 = false;
if ((include === true) || (include === undefined)) {
if ((small <= compare) && (large >= compare)) {
_local1 = true;
}
} else if ((small < compare) && (large > compare)) {
_local1 = true;
}
return(_local1);
}
static function angleBetween(small, large, compare, include) {
var _local1 = false;
if (small < large) {
if ((small <= compare) && (large >= compare)) {
_local1 = true;
}
} else if ((small <= compare) || (large >= compare)) {
_local1 = true;
}
if (include === false) {
if ((small == compare) || (large == compare)) {
_local1 = false;
}
}
return(_local1);
}
static function angleRange(angle1, angle2) {
var _local1 = Math.abs(angle2 - angle1);
return(Math.min(360 - _local1, _local1));
}
static function positionCompare(l_o2, l_o1, l_nVariation) {
var _local1 = false;
if (isNaN(l_nVariation)) {
l_nVariation = 0;
}
if ((l_o1 != undefined) && (l_o2 != undefined)) {
_local1 = (Math.abs(l_o1.x2 - l_o2.x1) <= l_nVariation) && (Math.abs(l_o1.y2 - l_o2.y1) <= l_nVariation);
}
return(_local1);
}
static function padZero(l_nNumber, l_nSize) {
var _local2 = "";
var _local1;
var _local3 = l_nSize - l_nNumber.toString().length;
_local1 = 0;
while (_local1 < _local3) {
_local2 = _local2 + "0";
_local1++;
}
return(_local2 + l_nNumber.toString());
}
}
Symbol 888 MovieClip [__Packages.sarbakan.visual.layer.LayerManager] Frame 0
class sarbakan.visual.layer.LayerManager
{
var nStageW, nStageH, oCam, aLayers, bPaused, bWillPause;
function LayerManager (l_nViewZoneW, l_nViewZoneH, l_nStageW, l_nStageH) {
nStageW = l_nStageW;
nStageH = l_nStageH;
oCam = new sarbakan.visual.Camera(l_nViewZoneW, l_nViewZoneH, nStageW, nStageH);
aLayers = [];
bPaused = false;
bWillPause = false;
}
function addLayer(l_oLayer, l_parallaxRatioX, l_parallaxRatioY) {
aLayers.push({layer:l_oLayer, mc:l_oLayer.mc, ratioX:l_parallaxRatioX, ratioY:l_parallaxRatioY});
l_oLayer.init(nStageW, nStageH);
}
function getCamera() {
return(oCam);
}
function destroy() {
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.destroy();
_local2++;
}
oCam.destroy();
}
function pause() {
bWillPause = true;
oCam.pause();
}
function unpause() {
if (bPaused) {
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.unpause();
_local2++;
}
sarbakan.visual.PauseManager.unpause();
}
oCam.unpause();
bPaused = false;
bWillPause = false;
}
function togglePause() {
if (!bPaused) {
pause();
} else {
unpause();
}
}
function update() {
if (bWillPause) {
bPaused = true;
bWillPause = false;
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.pause();
_local2++;
}
sarbakan.visual.PauseManager.pause();
}
if (!bPaused) {
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.update();
_local2++;
}
var _local4 = oCam.getX();
var _local3 = oCam.getY();
_local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].mc._x = _local4 * aLayers[_local2].ratioX;
aLayers[_local2].mc._y = _local3 * aLayers[_local2].ratioY;
_local2++;
}
}
}
}
Symbol 889 MovieClip [__Packages.TitleElement] Frame 0
class TitleElement extends sarbakan.visual.element.DynamicElement
{
var aMoves, setMC, oManager, bHighScore, mc;
function TitleElement (l_mcContainer, l_sVisible, l_oManager, l_nTargetX, l_nTargetY) {
super(l_mcContainer._name);
aMoves = new Array();
setMC(l_mcContainer);
oManager = l_oManager;
l_mcContainer._visible = l_sVisible;
bHighScore = false;
}
function removeMouseMove() {
delete mc.onMouseMove;
}
function setMouseMove() {
mc.onMouseMove = sarbakan.utils.Delegate.create(this, mouseMove);
}
function mouseMove() {
var _local2;
_local2 = 0;
while (_local2 < aMoves.length) {
if ((((isNaN(aMoves[_local2].topLeft.x) || (mc._xmouse >= aMoves[_local2].topLeft.x)) && (isNaN(aMoves[_local2].bottomRight.x) || (mc._xmouse <= aMoves[_local2].bottomRight.x))) && (isNaN(aMoves[_local2].topLeft.y) || (mc._ymouse >= aMoves[_local2].topLeft.y))) && (isNaN(aMoves[_local2].bottomRight.y) || (mc._ymouse <= aMoves[_local2].bottomRight.y))) {
changeScreen(_local2);
break;
}
_local2++;
}
}
function changeScreen(l_nCpt) {
removeMouseMove();
oManager.transitionTo(aMoves[l_nCpt].oTarget.x, aMoves[l_nCpt].oTarget.y, aMoves[l_nCpt].oElement);
}
function addTransitionElement(l_oTopLeft, l_oBottomRight, l_oTarget, l_oElement, l_mcButton) {
var _local2 = new Object();
_local2.topLeft = l_oTopLeft;
_local2.bottomRight = l_oBottomRight;
_local2.oTarget = l_oTarget;
_local2.oElement = l_oElement;
_local2.mcButton = mc[l_mcButton];
_local2.fOnPress = sarbakan.utils.Delegate.create(this, changeScreen, aMoves.length);
aMoves.push(_local2);
}
function endTravelTo() {
setMouseMove();
oManager.setBounceCam();
}
function getTitlePressFunction(l_mcTitleArrow) {
var _local2;
var _local3;
for (_local2 in aMoves) {
if (l_mcTitleArrow == aMoves[_local2].mcButton) {
_local3 = aMoves[_local2].fOnPress;
break;
}
}
return(_local3);
}
function setAsHighScore() {
bHighScore = true;
}
function get isHighScore() {
return(bHighScore);
}
}
Symbol 890 MovieClip [__Packages.game.visual.movieclip.MCTitleArrow] Frame 0
class game.visual.movieclip.MCTitleArrow extends MovieClip
{
var onRollOver, onRollOut, onPress, onRelease, onReleaseOutside, play, gotoAndStop, _totalframes, fPressFunction;
function MCTitleArrow () {
super();
out();
onRollOver = over;
onRollOut = out;
onPress = press;
onRelease = over;
onReleaseOutside = out;
setPressFunction(_global.AOC.getTitlePressFunction(this));
}
function over() {
play();
}
function out() {
gotoAndStop(1);
}
function press() {
gotoAndStop(_totalframes);
fPressFunction();
}
function setPressFunction(l_fPressFunction) {
fPressFunction = l_fPressFunction;
}
}
Symbol 891 MovieClip [__Packages.MenuElement] Frame 0
class MenuElement extends sarbakan.visual.element.DynamicElement
{
var setMC, nDefaultX, nDefaultY, nTargetX, nTargetY, oTarget, oManager, bReturnTitle, oTitle, setState, mc, bAlwaysActive, enable, aOtherElement, stateStarting, stateFinished, __get__returnTitle;
function MenuElement (l_mcContainer, l_oManager, l_nTargetX, l_nTargetY, l_oTarget, l_oTitle) {
super(l_mcContainer._name);
setMC(l_mcContainer);
l_mcContainer._alpha = 100;
nDefaultX = l_mcContainer._x;
nDefaultY = l_mcContainer._y;
nTargetX = l_nTargetX;
nTargetY = l_nTargetY;
oTarget = l_oTarget;
oManager = l_oManager;
bReturnTitle = false;
oTitle = l_oTitle;
mc.onRollOver = sarbakan.utils.Delegate.create(this, setState, "selected");
mc.onPress = sarbakan.utils.Delegate.create(this, setState, "selected");
mc.onRollOut = sarbakan.utils.Delegate.create(this, setState, "unselected");
bAlwaysActive = true;
enable();
aOtherElement = new Array();
}
function reset() {
mc.onRollOver = sarbakan.utils.Delegate.create(this, setState, "selected");
mc.onRollOut = sarbakan.utils.Delegate.create(this, setState, "unselected");
mc.onPress = sarbakan.utils.Delegate.create(this, setState, "selected");
}
function setBackMenuCoord(l_oElement, l_nPosX, l_nPosY, l_bReturnCenter) {
aOtherElement.push({element:l_oElement, x:l_nPosX, y:l_nPosY, returnCenter:l_bReturnCenter});
}
function getBackMenuCoord(l_oElement) {
for (var _local5 in aOtherElement) {
if (aOtherElement[_local5].element == l_oElement) {
l_oElement.__set__returnTitle(aOtherElement[_local5].returnCenter);
return({x:aOtherElement[_local5].x, y:aOtherElement[_local5].y});
}
}
}
function endTravelTo(oManager) {
setState("show");
oManager.setBounceCam();
}
function selected() {
if (mc._visible && (mc._alpha == 100)) {
if (bReturnTitle) {
} else {
oManager.transitionTo(nTargetX, nTargetY, oTarget, this);
}
} else {
mc.useHandCursor = false;
}
}
function unselected() {
if (!stateStarting()) {
mc.state.prevFrame();
}
mc.state.stop();
}
function show() {
if (stateStarting()) {
delete mc.onRollOver;
delete mc.onRollOut;
}
}
function wait() {
delete mc.onRollOver;
delete mc.onRollOut;
}
function hide() {
if (stateStarting()) {
reset();
}
if (stateFinished()) {
setState("unselected");
}
}
function set returnTitle(l_bReturnTitle) {
bReturnTitle = l_bReturnTitle;
//return(__get__returnTitle());
}
function get defaultX() {
return(nDefaultX);
}
function get defaultY() {
return(nDefaultY);
}
var DEFAULT_STATE = "unselected";
var NUMBER_SPEED_ALPHA = 8;
}
Symbol 892 MovieClip [__Packages.MainProperties] Frame 0
class MainProperties
{
function MainProperties () {
}
static var STAGE_WIDTH = 600;
static var STAGE_HEIGHT = 600;
}
Symbol 893 MovieClip [__Packages.sarbakan.visual.activation.NoActivation] Frame 0
class sarbakan.visual.activation.NoActivation extends sarbakan.visual.activation.ActivationManager
{
var aDynamicElements;
function NoActivation () {
super();
aDynamicElements = [];
}
function addDynamicElement(l_oElement, l_nX, l_nY, l_nWidth, l_nHeight) {
l_oElement.enable();
aDynamicElements.push(l_oElement);
}
function addAlwaysActiveElement(l_oElement) {
l_oElement.enable();
aDynamicElements.push(l_oElement);
}
function removeDynamicElement(l_oElement) {
for (var _local3 in aDynamicElements) {
if (aDynamicElements[_local3] == l_oElement) {
aDynamicElements.splice(_local3, 1);
break;
}
}
}
function addStaticElement(l_oElement, l_nX, l_nY, l_nWidth, l_nHeight) {
l_oElement._visible = true;
}
function getActiveElements() {
return(aDynamicElements);
}
}
Symbol 894 MovieClip [__Packages.game.Game] Frame 0
class game.Game
{
var mcTimeline, bWrong, bPause, bLockScore, bWillDie, bSpacebarOff, sState, oData, aLevel, oVisual, oButtonManager, oHud, oPatterns, oPowerups, bFirst, bSecond, sDifficulty, oTime, fTimeOut, sElement, nPatternSeries, sProjDir, __get__hud, __get__addScore;
function Game (l_mcTimeline, l_sDifficulty) {
mcTimeline = l_mcTimeline;
spacebarManage(false);
bWrong = false;
bPause = false;
bLockScore = false;
bWillDie = false;
bSpacebarOff = true;
l_mcTimeline.mcGameUpdater.onEnterFrame = sarbakan.utils.Delegate.create(this, update);
sState = "wait";
Init(l_sDifficulty);
}
function Init(l_sDifficulty) {
oData = new Data();
aLevel = oData.getDifficulty(l_sDifficulty);
oVisual = new game.visual.Visual(mcTimeline, aLevel.length);
oButtonManager = new game.input.ButtonManager(oVisual.__get__player().getMC());
oHud = new game.hud.Hud(oData.getScoreMultiplier(l_sDifficulty));
oPatterns = new game.PatternGenerator(mcTimeline);
oPowerups = new game.PowerupGenerator(new sarbakan.utils.Time(0, 3), mcTimeline);
bFirst = true;
bSecond = true;
sDifficulty = l_sDifficulty;
}
function update() {
if (!bPause) {
this[sState]();
oHud.update();
}
if (bWillDie) {
bWillDie = false;
_global.AOC.transitionToGame();
}
oVisual.update();
}
function waitForJump() {
var _local2 = oButtonManager.update();
if (_local2.aKeyboard[0] == "Space") {
if (aLevel[0].bWeakPillar) {
oVisual.setShake("Crumble");
}
aLevel.shift();
spacebarManage(false);
bWrong = false;
advance();
} else {
oTime.update();
if (oTime.__get__timeOut()) {
spacebarManage(false);
if (aLevel[0].bWeakPillar) {
oVisual.__get__player().death();
oVisual.setShake("Crumble");
sState = "wait";
} else {
fTimeOut();
}
}
}
}
function setPowerup() {
oPowerups.__set__time(new sarbakan.utils.Time(0, aLevel[0].nTimeBonus));
oPowerups.setNextPowerup();
sState = "waitPowerup";
}
function setPattern() {
sElement = undefined;
if (((nPatternSeries == 1) && (aLevel[0].nSequences == 2)) && (oVisual.__get__player().getElement(0) == "Water")) {
sElement = "Ice";
} else if ((nPatternSeries == 1) && (aLevel[0].nSequences > 1)) {
sElement = "Switch";
} else if ((nPatternSeries == 2) && (aLevel[0].nSequences == 3)) {
var _local3 = new Array("Water", "Air", "Earth");
do {
var _local2 = Math.floor(Math.random() * 3);
sElement = _local3[_local2];
} while (oVisual.__get__player().getElement(0) == sElement);
}
oPatterns.generateSequence(aLevel[0].nArrows, oPowerups.__get__position(), sElement);
sState = "runPattern";
nPatternSeries--;
oTime = new sarbakan.utils.Time(0, aLevel[0].nTimeArrows);
fTimeOut = PatternTimeOut;
oButtonManager.resetMouse();
}
function setSequence() {
nPatternSeries = aLevel[0].nSequences;
bSpacebarOff = true;
if (bFirst || (bSecond)) {
sProjDir = "Right";
bSecond = bFirst;
bFirst = false;
} else if (aLevel.length <= 2) {
sProjDir = "Left";
} else {
var _local2 = Math.floor(Math.random() * 2);
if (_local2 == 0) {
sProjDir = "Right";
} else {
sProjDir = "Left";
}
}
setPowerup();
}
function runPattern() {
oTime.update();
if (oTime.__get__timeOut()) {
fTimeOut();
} else {
var _local2 = oButtonManager.update();
switch (oPatterns.compareSequence(_local2)) {
case "Correct" :
if ((nPatternSeries == 0) && (aLevel[0].bWeakPillar)) {
oVisual.setShake("Small Shake");
}
break;
case "Complete" :
executeMove();
addScore = (50 * aLevel[0].nArrows);
addTimeScore(oTime);
break;
case "Wrong" :
oVisual.__get__player().__set__addErrors(oPatterns.remainingSize);
nPatternSeries = 0;
bWrong = true;
endBending();
break;
case "TimeOut" :
nPatternSeries = 0;
bWrong = true;
oVisual.__get__player().__set__addErrors(oPatterns.remainingSize);
endBending();
break;
case "Easter Egg" :
oVisual.easterEgg();
break;
case "Ongoing" :
}
}
}
function restart() {
bWillDie = true;
oVisual.destroy();
}
function PatternTimeOut() {
oPatterns.timeOut();
runPattern();
oTime = undefined;
}
function addTimeScore(l_oTime) {
var _local3 = l_oTime.__get__frames() + (l_oTime.__get__totalSeconds() * l_oTime.__get__framerate());
addScore = (_local3 * 5);
}
function waitPowerup() {
if (oPowerups.update()) {
setPattern();
}
}
function advance() {
oVisual.advance(this);
sState = "wait";
}
function wait() {
}
function endAdvance() {
if (oVisual.__get__noPillars()) {
oHud.setEndPoints(oData.timeLimit(sDifficulty));
oVisual.__get__player().win();
} else {
bLockScore = false;
sState = "setSequence";
}
}
function endBending() {
if (nPatternSeries > 0) {
setPowerup();
} else {
if (aLevel.length < 3) {
sProjDir = "Left";
oVisual.__get__player().setDirection(sProjDir);
}
if (!bWrong) {
addScore = (1000);
}
oVisual.sendProjectile(sarbakan.utils.Delegate.create(this, endProjectileThrow), oData, sProjDir);
sState = "wait";
bLockScore = true;
}
}
function endProjectileThrow() {
if ((oHud.__get__life() > 0) && (bSpacebarOff)) {
oVisual.__get__player().resetErrors();
oTime = new sarbakan.utils.Time(0, aLevel[0].nTimeJump);
fTimeOut = setSequence;
sState = "waitForJump";
spacebarManage(true);
bSpacebarOff = false;
}
}
function projCollide() {
var _local2 = 0;
if (oVisual.__get__player().__get__errors() > 0) {
_local2 = oData.projectileDamage(oVisual.__get__projectile(), oVisual.__get__projSize());
} else {
setSoundProj(oVisual.__get__projectile(), oVisual.__get__element());
}
oHud.loseBalance(_local2);
oVisual.projCollide(oHud.__get__life() > 0, _local2);
if (aLevel[0].bWeakPillar) {
oVisual.setShake("Big Shake");
}
}
function spacebarManage(l_bVisible) {
mcTimeline.mcSpacebar._visible = l_bVisible;
if (l_bVisible) {
mcTimeline.mcSpacebar._y = 95;
} else {
mcTimeline.mcSpacebar._y = -95;
}
}
function setSoundProj(l_sProjectile, l_sElement) {
var _local3 = oData.getImpactSound(l_sProjectile, l_sElement);
if (_local3 != "") {
_global.AOC.playSFX(_local3, 1);
}
}
function executeMove() {
if (oPatterns.__get__remainingSize() == 0) {
var _local3 = false;
var _local2;
if (((aLevel.length < 3) && (aLevel[0].nSequences == 2)) || (((aLevel.length < 3) && (aLevel[0].nSequences == 3)) && (nPatternSeries == 1))) {
sProjDir = "Right";
if (sElement == "Ice") {
sElement = "Switch";
}
} else if (((aLevel[0].nSequences == 3) && (nPatternSeries == 1)) || (((aLevel[0].nSequences == 2) && (sElement == "Ice")) && (sElement == "Water"))) {
if (sProjDir == "Left") {
sProjDir = "Right";
} else {
sProjDir = "Left";
}
}
oVisual.__get__player().setDirection(sProjDir);
if (sElement == undefined) {
switch (oPatterns.__get__sequence()) {
case "Down" :
case "Up" :
sElement = "Earth";
break;
case "Left" :
case "Right" :
sElement = "Water";
break;
default :
sElement = "Air";
}
}
if (oPatterns.__get__size() >= 5) {
_local2 = "Big";
} else {
_local2 = "Small";
}
if (sElement != "Switch") {
oVisual.addElement(_local2 + sElement);
} else {
_local3 = oVisual.switchElement(sarbakan.utils.Delegate.create(this, endBending));
}
if (_local3) {
oVisual.__get__player().bendingMove(_local2, undefined, sElement);
} else {
oVisual.__get__player().bendingMove(_local2, sarbakan.utils.Delegate.create(this, endBending), sElement);
}
sState = "wait";
} else {
endBending();
}
}
function willDie(l_bWillDie) {
bWillDie = l_bWillDie;
}
function set hud(l_mcHud) {
oHud.setHudMC(l_mcHud);
//return(__get__hud());
}
function set addScore(l_nScore) {
if (!bLockScore) {
oHud.addScore(l_nScore);
}
//return(__get__addScore());
}
function get score() {
return(oHud.__get__score());
}
function get pause() {
return(bPause);
}
function set pause(l_bPause) {
bPause = l_bPause;
oVisual.__set__pause(l_bPause);
oPowerups.__set__pause(l_bPause);
//return(pause);
}
function get easterEggState() {
return(oVisual.__get__easterEggState());
}
}
Symbol 895 MovieClip [__Packages.Data] Frame 0
class Data
{
var oDifficulty, oBlocked, oCross, OBJECT_PROJ_SOUNDS;
function Data () {
oDifficulty = new Object();
oDifficulty.Easy = setEasy();
oDifficulty.Medium = setMedium();
oDifficulty.Hard = setHard();
OBJECT_TIME_LIMIT.Easy = new sarbakan.utils.Time(4, 30);
OBJECT_TIME_LIMIT.Medium = new sarbakan.utils.Time(6, 0);
OBJECT_TIME_LIMIT.Hard = new sarbakan.utils.Time(8, 0);
setBlockedGrid();
setCrossGrid();
setSounds();
}
function setEasy() {
var _local2 = new Array();
_local2.push(addNode(1, 2, 2, 5, 2, false));
_local2.push(addNode(1, 2, 2, 5, 2, false));
_local2.push(addNode(1, 2, 2, 4, 2, false));
_local2.push(addNode(1, 2, 2, 4, 2, false));
_local2.push(addNode(2, 2, 2, 3, 2, false));
_local2.push(addNode(1, 3, 2, 4, 2, false));
_local2.push(addNode(2, 2, 2, 4, 2, false));
_local2.push(addNode(1, 3, 2, 3, 2, true));
_local2.push(addNode(2, 3, 2, 4, 2, false));
_local2.push(addNode(2, 3, 2, 3, 2, false));
return(_local2);
}
function setMedium() {
var _local2 = new Array();
_local2.push(addNode(1, 3, 2, 4, 2, false));
_local2.push(addNode(1, 3, 2, 3, 2, false));
_local2.push(addNode(1, 4, 2, 5, 2, false));
_local2.push(addNode(2, 4, 2, 4, 2, false));
_local2.push(addNode(1, 4, 2, 4, 2, true));
_local2.push(addNode(1, 4, 2, 3, 2, false));
_local2.push(addNode(2, 5, 2, 6, 2, false));
_local2.push(addNode(2, 5, 2, 5, 2, false));
_local2.push(addNode(3, 5, 2, 5, 2, false));
_local2.push(addNode(2, 5, 2, 5, 2, false));
_local2.push(addNode(2, 6, 2, 7, 2, false));
_local2.push(addNode(2, 6, 2, 6, 2, true));
_local2.push(addNode(3, 6, 2, 5, 2, false));
return(_local2);
}
function setHard() {
var _local2 = new Array();
_local2.push(addNode(1, 5, 2, 5, 2, false));
_local2.push(addNode(1, 6, 2, 6, 2, false));
_local2.push(addNode(1, 6, 2, 5, 2, false));
_local2.push(addNode(2, 5, 2, 5, 2, false));
_local2.push(addNode(2, 6, 2, 6, 2, true));
_local2.push(addNode(3, 6, 2, 5, 2, false));
_local2.push(addNode(3, 7, 2, 7, 2, false));
_local2.push(addNode(2, 8, 2, 7, 2, false));
_local2.push(addNode(2, 7, 2, 6, 2, false));
_local2.push(addNode(3, 6, 2, 6, 2, true));
_local2.push(addNode(3, 6, 2, 5, 2, false));
_local2.push(addNode(3, 7, 2, 7, 2, false));
_local2.push(addNode(2, 8, 2, 8, 2, true));
_local2.push(addNode(3, 8, 2, 7, 2, false));
_local2.push(addNode(3, 10, 2, 9, 2, true));
_local2.push(addNode(3, 10, 2, 8, 2, false));
return(_local2);
}
function setOriginalHard() {
var _local2 = new Array();
_local2.push(addNode(1, 12, 2, 10, 1, false));
_local2.push(addNode(1, 13, 2, 10, 1, true));
_local2.push(addNode(2, 10, 2, 8, 1, true));
_local2.push(addNode(2, 10, 2, 7, 1, false));
_local2.push(addNode(2, 11, 1, 7, 1, true));
_local2.push(addNode(2, 12, 1, 8, 1, false));
_local2.push(addNode(2, 14, 2, 10, 1, true));
_local2.push(addNode(2, 16, 2, 12, 1, true));
_local2.push(addNode(3, 12, 1, 9, 1, false));
_local2.push(addNode(3, 12, 1, 8, 1, true));
_local2.push(addNode(3, 13, 2, 10, 1, false));
_local2.push(addNode(3, 13, 1, 9, 1, true));
_local2.push(addNode(3, 15, 1, 12, 1, true));
_local2.push(addNode(2, 17, 2, 13, 1, true));
_local2.push(addNode(1, 20, 1, 15, 1, true));
_local2.push(addNode(2, 17, 1, 12, 1, true));
_local2.push(addNode(3, 20, 1, 16, 1, true));
_local2.push(addNode(3, 25, 1, 19, 1, true));
return(_local2);
}
function addNode(l_nSequences, l_nArrows, l_nTimeBonus, l_nTimeArrows, l_nTimeJump, l_bWeakPillar) {
var _local1 = new Object();
_local1.nSequences = l_nSequences;
_local1.nArrows = l_nArrows;
_local1.bWeakPillar = l_bWeakPillar;
_local1.nTimeBonus = l_nTimeBonus;
_local1.nTimeArrows = l_nTimeArrows;
_local1.nTimeJump = l_nTimeJump;
return(_local1);
}
function setBlockedGrid() {
oBlocked = new Object();
oBlocked.Small = new Object();
oBlocked.Small[WATER] = new Array(WOOD, WATER);
oBlocked.Small[ICE] = ARRAY_ALL_PROJECTILE;
oBlocked.Small[EARTH] = ARRAY_ALL_PROJECTILE;
oBlocked.Small[AIR] = new Array(WOOD, WATER, CANTEEN, ROCK);
oBlocked.Small[WATEREARTH] = ARRAY_ALL_PROJECTILE;
oBlocked.Small[WATERAIR] = ARRAY_ALL_PROJECTILE;
oBlocked.Small[EARTHAIR] = ARRAY_ALL_PROJECTILE;
oBlocked.Big = new Object();
oBlocked.Big[WATER] = new Array(WOOD, CANTEEN, WATER, WATER);
oBlocked.Big[ICE] = ARRAY_ALL_PROJECTILE;
oBlocked.Big[EARTH] = ARRAY_ALL_PROJECTILE;
oBlocked.Big[AIR] = new Array(WOOD, CANTEEN, BOOM, ROCK, WATER, ROCK, WATER);
oBlocked.Big[WATEREARTH] = ARRAY_ALL_PROJECTILE;
oBlocked.Big[WATERAIR] = ARRAY_ALL_PROJECTILE;
oBlocked.Big[EARTHAIR] = ARRAY_ALL_PROJECTILE;
}
function setCrossGrid() {
oCross = new Object();
oCross.Small = new Object();
oCross.Small[WATER] = new Array(CANTEEN, BOOM, ROCK, ICE, EARTH);
oCross.Small[ICE] = new Array(BOOM, ICE, EARTH);
oCross.Small[EARTH] = new Array(BOOM, ICE, EARTH);
oCross.Small[AIR] = new Array(WATER, BOOM, ROCK, ICE, EARTH);
oCross.Small[WATEREARTH] = ARRAY_ALL_PROJECTILE;
oCross.Small[WATERAIR] = ARRAY_ALL_PROJECTILE;
oCross.Small[EARTHAIR] = ARRAY_ALL_PROJECTILE;
oCross.Small.All = ARRAY_ALL_PROJECTILE;
oCross.Big = new Object();
oCross.Big[WATER] = new Array(ICE, EARTH);
oCross.Big[ICE] = new Array(ICE, EARTH);
oCross.Big[EARTH] = new Array(ICE, EARTH);
oCross.Big[AIR] = new Array(BOOM, WATER, ICE, EARTH, WATER, ICE, EARTH);
oCross.Big[WATEREARTH] = ARRAY_ALL_PROJECTILE;
oCross.Big[WATERAIR] = ARRAY_ALL_PROJECTILE;
oCross.Big[EARTHAIR] = ARRAY_ALL_PROJECTILE;
oCross.Big.All = ARRAY_ALL_PROJECTILE;
}
function setSounds() {
OBJECT_PROJ_SOUNDS = new Object();
OBJECT_PROJ_SOUNDS[WOOD] = new Object();
OBJECT_PROJ_SOUNDS[WOOD][AIR] = "";
OBJECT_PROJ_SOUNDS[WOOD][WATERAIR] = "";
OBJECT_PROJ_SOUNDS[WOOD].Default = "ImpactWood";
OBJECT_PROJ_SOUNDS[CANTEEN] = new Object();
OBJECT_PROJ_SOUNDS[CANTEEN][AIR] = "";
OBJECT_PROJ_SOUNDS[CANTEEN][WATERAIR] = "";
OBJECT_PROJ_SOUNDS[CANTEEN].Default = "ImpactCanteen";
OBJECT_PROJ_SOUNDS[BOOM] = new Object();
OBJECT_PROJ_SOUNDS[BOOM][AIR] = "";
OBJECT_PROJ_SOUNDS[BOOM][WATERAIR] = "";
OBJECT_PROJ_SOUNDS[BOOM][EARTH] = "ImpactMetal";
OBJECT_PROJ_SOUNDS[BOOM][ICE] = "ImpactMetal";
OBJECT_PROJ_SOUNDS[BOOM][WATEREARTH] = "ImpactMetal";
OBJECT_PROJ_SOUNDS[BOOM][EARTHAIR] = "ImpactMetal";
OBJECT_PROJ_SOUNDS[ROCK] = new Object();
OBJECT_PROJ_SOUNDS[ROCK][AIR] = "";
OBJECT_PROJ_SOUNDS[ROCK][WATERAIR] = "";
OBJECT_PROJ_SOUNDS[ROCK].Default = "ImpactWood";
OBJECT_PROJ_SOUNDS[ICE] = new Object();
OBJECT_PROJ_SOUNDS[ICE].Default = "IceBreak";
OBJECT_PROJ_SOUNDS[EARTH] = new Object();
OBJECT_PROJ_SOUNDS[EARTH].Default = "EarthBreak";
OBJECT_PROJ_SOUNDS[WATER] = new Object();
OBJECT_PROJ_SOUNDS[WATER].Default = "WaterBreak";
}
function getDifficulty(l_sLevel) {
return(oDifficulty[l_sLevel]);
}
function getImpactSound(l_sProj, l_sElement) {
var _local2 = "";
if (OBJECT_PROJ_SOUNDS[l_sProj][l_sElement] != undefined) {
_local2 = OBJECT_PROJ_SOUNDS[l_sProj][l_sElement];
} else if (OBJECT_PROJ_SOUNDS[l_sProj].Default != undefined) {
_local2 = OBJECT_PROJ_SOUNDS[l_sProj].Default;
}
return(_local2);
}
function projectileDamage(l_sProjectile, l_sSize) {
var _local2;
var _local3;
for (_local2 in ARRAY_ALL_PROJECTILE) {
if (ARRAY_ALL_PROJECTILE[_local2] == l_sProjectile) {
_local3 = _local2;
break;
}
}
var _local5 = 0;
if ((!isNaN(_local2)) || (l_sSize == "Small")) {
_local5 = ARRAY_SMALL_PROJ[_local2];
} else if (l_sSize == "Big") {
_local5 = ARRAY_BIG_PROJ[_local2];
}
return(_local5);
}
function chooseProjectile(l_sElement, l_sSize, l_bBlocked) {
if (l_sSize == undefined) {
l_sSize = "Small";
}
if (l_sElement == undefined) {
l_sElement = "All";
}
var _local2;
if (l_bBlocked) {
_local2 = oBlocked[l_sSize][l_sElement];
} else {
_local2 = oCross[l_sSize][l_sElement];
}
var _local5 = Math.floor(Math.random() * _local2.length);
return(_local2[_local5]);
}
function timeLimit(l_sElement) {
return(OBJECT_TIME_LIMIT[l_sElement]);
}
function getScoreMultiplier(l_sDifficulty) {
return(OBJECT_SCORE_MULTIPLIER[l_sDifficulty]);
}
var WOOD = "2";
var BOOM = "3";
var ROCK = "1";
var CANTEEN = "4";
var ICE = "Ice";
var WATER = "Water";
var EARTH = "Earth";
var AIR = "Air";
var WATEREARTH = "WaterEarth";
var WATERAIR = "WaterAir";
var EARTHAIR = "EarthAir";
var ARRAY_ALL_PROJECTILE = new Array(Data.prototype.WOOD, Data.prototype.CANTEEN, Data.prototype.BOOM, Data.prototype.ROCK, Data.prototype.WATER, Data.prototype.ICE, Data.prototype.EARTH, Data.prototype.WATER, Data.prototype.ICE, Data.prototype.EARTH);
var ARRAY_SMALL_PROJ = new Array(1, 1, 2, 2, 3, 3, 3, 3, 3, 3);
var ARRAY_BIG_PROJ = new Array(1, 1, 2, 2, 4, 5, 5, 4, 5, 5);
var OBJECT_SCORE_MULTIPLIER = new Object({Easy:3, Medium:4, Hard:5});
var OBJECT_TIME_LIMIT = new Object();
}
Symbol 896 MovieClip [__Packages.sarbakan.utils.Time] Frame 0
class sarbakan.utils.Time
{
var nSeconds, nMinutes, nFrames, bForward;
function Time (l_nMinutes, l_nSeconds, l_bForward) {
nSeconds = l_nSeconds;
nMinutes = l_nMinutes;
nFrames = NUMBER_FRAME_RATE;
bForward = l_bForward;
}
function update() {
if (bForward) {
addFrame();
} else {
removeFrame();
}
}
function removeFrame() {
nFrames--;
if (nFrames <= 0) {
nSeconds--;
if (nSeconds < 0) {
nMinutes = Math.max(nMinutes - 1, 0);
nSeconds = 59;
}
nFrames = NUMBER_FRAME_RATE;
}
}
function addFrame() {
nFrames++;
if (nFrames >= NUMBER_FRAME_RATE) {
nSeconds++;
if (nSeconds >= 60) {
nMinutes++;
nSeconds = 0;
}
nFrames = 0;
}
}
function addTime(l_oTime) {
nSeconds = nSeconds + l_oTime.seconds;
while (nSeconds >= 60) {
nSeconds = nSeconds - 60;
nMinutes++;
}
nMinutes = nMinutes + l_oTime.minutes;
}
function get timeOut() {
return((nSeconds <= 0) && (nMinutes <= 0));
}
function get framerate() {
return(NUMBER_FRAME_RATE);
}
function get frames() {
return(nFrames);
}
function get seconds() {
return(nSeconds);
}
function get minutes() {
return(nMinutes);
}
function set seconds(l_nSeconds) {
nSeconds = l_nSeconds;
nFrames = NUMBER_FRAME_RATE;
//return(seconds);
}
function get totalSeconds() {
var _local2 = nSeconds;
_local2 = _local2 + (nMinutes * 60);
return(_local2);
}
function get exactSecond() {
return(nFrames == NUMBER_FRAME_RATE);
}
function set minutes(l_nMinutes) {
nMinutes = l_nMinutes;
//return(minutes);
}
var NUMBER_FRAME_RATE = 30;
}
Symbol 897 MovieClip [__Packages.game.visual.Visual] Frame 0
class game.visual.Visual
{
var oPlayer, bPause, bEasterEgg, fEasing, oElementManager, oLayerAang, aPillars, oLayerManager, oCam, sndShake, sProjectileSize, sProjectile, mcProj, fNextFunction, __get__pause;
function Visual (l_mcContainer, l_nPillars) {
oPlayer = new game.visual.Player(l_mcContainer.mcAangLayer.mcAang);
bPause = false;
bEasterEgg = false;
fEasing = mx.transitions.easing.Strong.easeOut;
initLayers(l_mcContainer, l_nPillars);
oPlayer.setCoord();
oElementManager = new game.elements.ElementManager(oLayerAang);
setPlayerCam(true);
}
function destroy() {
_global.AOC.pause = false;
sarbakan.visual.PauseManager.remove(aPillars[0].getMC());
delete oPlayer;
oLayerAang = undefined;
oLayerManager.destroy();
}
function update() {
oLayerManager.update();
}
function getCamCoord() {
return(oPlayer.getCamCoord());
}
function easterEgg() {
if (!bEasterEgg) {
bEasterEgg = true;
var _local2 = oLayerAang.mc.getNextHighestDepth();
var _local3 = oLayerAang.mc.attachMovie("EasterEgg", "EasterEgg" + _local2, _local2);
var _local4 = new game.visual.EasterEgg(_local3, oPlayer.getMC(), oLayerAang, sarbakan.utils.Delegate.create(this, endEasterEgg));
oLayerAang.addDynamicElement(_local4);
}
}
function advance(l_oGame) {
aPillars.shift();
oCam.setSpeed(MOVE_SPEED);
oCam.setEasing(fEasing);
oPlayer.setJump(aPillars[0], l_oGame);
}
function setShake(l_sIntensity) {
aPillars[0].getMC().gotoAndStop(l_sIntensity);
switch (l_sIntensity) {
case "Small Shake" :
sndShake = _global.AOC.playSFX(l_sIntensity, 9999);
oPlayer.__set__setShake("Small");
break;
case "Big Shake" :
_global.AOC.stopSFX(sndShake);
sndShake = _global.AOC.playSFX(l_sIntensity, 9999);
oPlayer.__set__setShake("Big");
break;
case "Crumble" :
_global.AOC.stopSFX(sndShake);
sndShake = _global.AOC.playSFX(l_sIntensity, 1);
oPlayer.__set__setShake("");
}
}
function setPlayerCam(l_bInstant) {
oCam.unlock();
oCam.setSpeed();
oCam.lockOn(sarbakan.utils.Delegate.create(this, getCamCoord), l_bInstant);
}
function addElement(l_sElement) {
oElementManager.addElement(l_sElement, oPlayer.getMC());
}
function switchElement(l_fNextFunction) {
return(oElementManager.switchElement(l_fNextFunction));
}
function sendProjectile(l_fNextFunction, l_oData, l_sProjDir) {
var _local2;
var _local5;
sProjectileSize = oElementManager.size;
if (oPlayer.__get__errors() > 0) {
_local2 = l_oData.chooseProjectile(oElementManager.__get__mainElement(), oElementManager.__get__size(), false);
} else {
_local2 = l_oData.chooseProjectile(oElementManager.__get__mainElement(), oElementManager.__get__size(), true);
}
sProjectile = _local2;
if (!isNaN(_local2)) {
_local5 = Number(_local2);
_local2 = "Sokka";
}
var _local4 = oLayerAang.mc.getNextHighestDepth();
mcProj = oLayerAang.mc.attachMovie("Proj" + _local2, "Proj" + _local4, _local4);
var _local3 = new game.visual.Projectile(mcProj, oPlayer.getMC(), oPlayer.__get__errors(), sarbakan.utils.Delegate.create(this, endElement, oPlayer.__get__errors()), oLayerAang);
if (oPlayer.__get__errors() > 0) {
oElementManager.breakElement(_local3.getMC(), l_sProjDir);
}
if (_local2 == "Sokka") {
_local3.getMC().setProj(_local5);
} else if ((_local2 != "Sokka") && (oElementManager.__get__size() == "Big")) {
_local3.getMC().state._xscale = 125;
_local3.getMC().state._yscale = 125;
}
fNextFunction = l_fNextFunction;
oLayerAang.addDynamicElement(_local3);
oCam.setSpeed(10);
oCam.unlock();
oCam.lockOn(sarbakan.utils.Delegate.create(_local3, _local3.getCamCoord), false);
}
function endElement(l_nErrors) {
if (l_nErrors > 0) {
fNextFunction = undefined;
}
oElementManager.removeElement(false, fNextFunction);
}
function endEasterEgg() {
bEasterEgg = false;
}
function projCollide(l_bAlive, l_nDamage) {
setPlayerCam(true);
if (!l_bAlive) {
oPlayer.death();
oElementManager.drop();
} else if (l_nDamage >= 3) {
oPlayer.hurt("BigHurt", fNextFunction);
_global.AOC.playSFX("BigHit", 1);
oElementManager.drop();
} else if (l_nDamage >= 1) {
oPlayer.hurt("SmallHurt", fNextFunction);
_global.AOC.playSFX("SmallHit", 1);
oElementManager.drop();
} else if (oElementManager.__get__mainElement() == "Water") {
oElementManager.drop();
}
mcProj.stopSound();
}
function initLayers(l_mcContainer, l_nPillars) {
oLayerManager = new sarbakan.visual.layer.LayerManager(10000, 1200, 600, 600);
oCam = oLayerManager.getCamera();
var _local2;
aPillars = new Array();
var _local5 = new sarbakan.visual.layer.Layer(l_mcContainer.mcFrontPillars, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(_local5, SPEED_FRONT_PILLARS, 1);
_local2 = createCliff(l_mcContainer.mcFrontPillars, "Left", _local2);
_local5.addStaticElement(_local2);
_local2 = undefined;
var _local3;
_local3 = 0;
while (_local3 < l_nPillars) {
_local2 = createPillar(l_mcContainer.mcFrontPillars, _local2);
_local5.addStaticElement(_local2);
aPillars.push(_local2);
_local3++;
}
_local2 = createCliff(l_mcContainer.mcFrontPillars, "Right", _local2);
_local5.addStaticElement(_local2);
aPillars.push(_local2);
var _local10 = new sarbakan.visual.layer.Layer(l_mcContainer.mcSky, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(_local10, SPEED_SKY, 1);
var _local9 = new sarbakan.visual.layer.Layer(l_mcContainer.mcSun, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(_local9, SPEED_SUN, 1);
var _local8 = new sarbakan.visual.layer.Layer(l_mcContainer.mcMountains, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(_local8, SPEED_MOUNTAINS, 1);
var _local7 = new sarbakan.visual.layer.Layer(l_mcContainer.mcBackTrees, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(_local7, SPEED_MOUNTAINS, 1);
oLayerAang = new sarbakan.visual.layer.Layer(l_mcContainer.mcAangLayer, new sarbakan.visual.activation.NoActivation());
oLayerManager.addLayer(oLayerAang, SPEED_FRONT_PILLARS, 1);
oLayerAang.addDynamicElement(oPlayer);
}
function createPillar(l_mcContainer, l_oPillar) {
var _local3;
var _local1 = l_mcContainer.getNextHighestDepth();
l_mcContainer.attachMovie("Pillar", "Pillar" + _local1, _local1);
_local3 = new game.visual.Pillar(l_mcContainer["Pillar" + _local1]);
if (l_oPillar != undefined) {
var _local4 = Math.ceil(Math.random() * 150) + 200;
l_mcContainer["Pillar" + _local1]._x = l_oPillar.mc._x + _local4;
l_mcContainer["Pillar" + _local1]._y = 750;
} else {
l_mcContainer["Pillar" + _local1]._x = 450;
l_mcContainer["Pillar" + _local1]._y = 750;
}
l_mcContainer.gotoAndStop("Idle");
return(_local3);
}
function createCliff(l_mcContainer, l_sSide, l_oPillar) {
var _local3;
var _local1 = l_mcContainer.getNextHighestDepth();
l_mcContainer.attachMovie("Cliff" + l_sSide, "Cliff" + _local1, _local1);
_local3 = new game.visual.Pillar(l_mcContainer["Cliff" + _local1]);
if (l_oPillar != undefined) {
var _local4 = Math.ceil(Math.random() * 150) + 200;
l_mcContainer["Cliff" + _local1]._x = l_oPillar.mc._x + _local4;
l_mcContainer["Cliff" + _local1]._y = -170;
} else {
l_mcContainer["Cliff" + _local1]._x = -100;
l_mcContainer["Cliff" + _local1]._y = -170;
}
return(_local3);
}
function get noPillars() {
return(aPillars.length <= 1);
}
function get player() {
return(oPlayer);
}
function set pause(l_bPause) {
bPause = l_bPause;
if (bPause) {
oLayerManager.pause();
oLayerManager.update();
} else {
oLayerManager.unpause();
}
//return(__get__pause());
}
function get projectile() {
return(sProjectile);
}
function get projSize() {
return(sProjectileSize);
}
function get element() {
return(oElementManager.__get__mainElement());
}
function get easterEggState() {
var _local1;
_local1 = "Miss";
return(_local1);
}
static var NUMBER_PROJECTILES = 4;
static var MOVE_SPEED = 11;
static var SPEED_FRONT_PILLARS = 1;
static var SPEED_SKY = 0.05;
static var SPEED_SUN = 0.01;
static var SPEED_MOUNTAINS = 0.1;
}
Symbol 898 MovieClip [__Packages.game.visual.Player] Frame 0
class game.visual.Player extends sarbakan.visual.element.DynamicElement
{
var setMC, aCurrentWalls, oShakeCoord, sShake, nErrors, SmallEarth, BigEarth, SmallWater, BigWater, SmallAir, BigAir, SmallIce, BigIce, SmallHurt, BigHurt, mc, sElementBend, fEndJump, sState, sNextState, nSpeedX, nTargetX, nSpeedY, bShake, getGlobalPos, __get__addErrors, __get__setShake;
function Player (l_mcContainer) {
super(l_mcContainer._name);
setMC(l_mcContainer);
aCurrentWalls = new Array();
oShakeCoord = new Object();
sShake = "";
setState("idle");
nErrors = 0;
SmallEarth = sarbakan.utils.Delegate.create(this, executeElement);
BigEarth = sarbakan.utils.Delegate.create(this, executeElement);
SmallWater = sarbakan.utils.Delegate.create(this, executeElement);
BigWater = sarbakan.utils.Delegate.create(this, executeElement);
SmallAir = sarbakan.utils.Delegate.create(this, executeElement);
BigAir = sarbakan.utils.Delegate.create(this, executeElement);
SmallIce = sarbakan.utils.Delegate.create(this, executeElement);
BigIce = sarbakan.utils.Delegate.create(this, executeElement);
SmallHurt = sarbakan.utils.Delegate.create(this, hurting);
BigHurt = sarbakan.utils.Delegate.create(this, hurting);
}
function update() {
super.update();
}
function win() {
mc.state.stop();
_global.AOC.endGame(true);
}
function death() {
setState("loseBalance");
}
function loseBalance() {
if (stateFinished()) {
mc.state.stop();
_global.AOC.endGame(false);
}
}
function bendingMove(l_sSize, l_fEndBending, l_sElement) {
if (l_sElement != "Switch") {
sElementBend = l_sSize + l_sElement;
if (mc._xscale > 0) {
aCurrentWalls.push({side:"Right", element:l_sElement, size:l_sSize});
} else {
aCurrentWalls.push({side:"Left", element:l_sElement, size:l_sSize});
}
setState(sElementBend);
} else {
setState("Switch");
sElementBend = aCurrentWalls[0].size;
if ((aCurrentWalls[0].element == "Water") || (aCurrentWalls[1].element == "Water")) {
if ((aCurrentWalls[0].element == "Air") || (aCurrentWalls[1].element == "Air")) {
sElementBend = sElementBend + "WaterAir";
} else {
sElementBend = sElementBend + "WaterEarth";
}
} else {
sElementBend = sElementBend + "EarthAir";
}
}
fEndJump = l_fEndBending;
}
function executeElement() {
if (stateFinished()) {
setState("idle");
fEndJump();
}
shake();
}
function hurt(l_sState, l_fEndJump) {
setState(l_sState);
fEndJump = l_fEndJump;
}
function hurting() {
if (stateFinished()) {
setState("idle");
fEndJump();
}
}
function idle() {
if ((sState != "idle") && (sNextState != "idle")) {
setState("idle");
} else if (sState == "idle") {
shake();
}
}
function jump() {
if (mc.state._currentframe == 6) {
nSpeedX = (nTargetX - mc._x) / 13;
}
if (Math.abs(mc._x - nTargetX) < 1) {
mc._x = nTargetX;
nSpeedX = 0;
}
if (stateFinished()) {
aCurrentWalls = new Array();
setState("idle");
fEndJump();
}
}
function Switch() {
if (stateFinished()) {
setState("idle");
mc._xscale = mc._xscale * -1;
fEndJump();
}
shake();
}
function setDirection(l_sDirection) {
if (l_sDirection == "Right") {
mc._xscale = 100;
} else {
mc._xscale = -100;
}
}
function getElement(l_nElement) {
return(aCurrentWalls[l_nElement].element);
}
function setJump(l_oPillar, l_oGame) {
setState("jump");
mc._xscale = 100;
nTargetX = l_oPillar.mc._x;
fEndJump = sarbakan.utils.Delegate.create(l_oGame, l_oGame.endAdvance);
_global.AOC.playSFX("Swoosh", 1);
}
function setSpeed(l_nSpeedX, l_nSpeedY) {
nSpeedX = l_nSpeedX;
nSpeedY = l_nSpeedY;
}
function getSpeed() {
var _local2 = new Object({nSpeedX:nSpeedX, nSpeedY:nSpeedY});
return(_local2);
}
function resetErrors() {
nErrors = 0;
}
function setState(l_sState) {
sState = l_sState;
mc.state.gotoAndPlay(1);
mc.gotoAndStop(l_sState);
}
function shake() {
var _local2 = 0;
switch (sShake) {
case "Small" :
_local2 = NUMBER_SMALL_SHAKE;
break;
case "Big" :
_local2 = NUMBER_BIG_SHAKE;
}
if (bShake) {
mc.state._x = mc.state._x + _local2;
} else {
mc.state._x = mc.state._x - _local2;
}
bShake = !bShake;
}
function getCamCoord() {
var _local2;
if (sShake == "Small") {
_local2 = new Object();
_local2.x = oShakeCoord.x;
_local2.y = oShakeCoord.y;
} else {
_local2 = getGlobalPos(mc.state);
}
mc._parent.globalToLocal(_local2);
return({x:_local2.x - 300, y:_local2.y - 600});
}
function stateStarting() {
return(mc.state._currentframe == 1);
}
function stateFinished() {
return(mc.state._currentframe == mc.state._totalframes);
}
function stateCurrentFrame() {
return(mc.state._currentframe);
}
function get elementBend() {
return(sElementBend);
}
function get errors() {
return(nErrors);
}
function set addErrors(l_nErrors) {
nErrors = nErrors + l_nErrors;
//return(__get__addErrors());
}
function set setShake(l_sShake) {
if (sShake != l_sShake) {
sShake = l_sShake;
oShakeCoord = getGlobalPos(mc.state);
if (sShake == "") {
bShake = false;
}
}
//return(__get__setShake());
}
var NUMBER_SMALL_SHAKE = 4;
var NUMBER_BIG_SHAKE = 8;
}
Symbol 899 MovieClip [__Packages.game.visual.Pillar] Frame 0
class game.visual.Pillar extends sarbakan.visual.element.StaticElement
{
var setMC;
function Pillar (l_mc) {
super(l_mc._name);
setMC(l_mc);
l_mc.gotoAndStop("Idle");
}
}
Symbol 900 MovieClip [__Packages.game.elements.ElementManager] Frame 0
class game.elements.ElementManager
{
var oLayer, aElements, sMainElement, sSize, fNextFunction;
function ElementManager (l_oLayer) {
oLayer = l_oLayer;
aElements = new Array();
}
function addElement(l_sElement, l_mcPlayer) {
var _local4;
if ((l_sElement == "SmallIce") || (l_sElement == "BigIce")) {
aElements[0].setElement = "Ice";
aElements[0].mc.setState("Iced", "Idle");
aElements[0].mc.setPrefix("Iced");
sMainElement = "Ice";
_local4 = "Ice";
} else {
var _local5 = oLayer.mc.getNextHighestDepth();
oLayer.mc.attachMovie(l_sElement, "Element" + _local5, _local5);
var _local6 = new game.visual.Element(oLayer.mc["Element" + _local5], l_mcPlayer, l_sElement);
aElements.push(_local6);
oLayer.addDynamicElement(_local6);
if (aElements.length == 1) {
sMainElement = l_sElement;
if (l_sElement.substring(0, 3) == "Big") {
sSize = "Big";
sMainElement = l_sElement.substr(3);
} else {
sSize = "Small";
sMainElement = l_sElement.substr(5);
}
}
if (l_sElement.substring(0, 3) == "Big") {
_local4 = l_sElement.substr(3);
} else {
_local4 = l_sElement.substr(5);
}
}
_global.AOC.playSFX(_local4 + "In");
}
function breakElement(l_mcProj, l_sProjDir) {
var _local2 = getElementPos(l_sProjDir);
if (_local2 >= 0) {
aElements[_local2].getMC().setWillBreak(l_mcProj);
oLayer.removeDynamicElement(aElements[_local2]);
aElements.splice(_local2, 1);
}
}
function removeElement(l_bBreak, l_fNextFunction) {
if (aElements.length > 0) {
if (l_bBreak) {
aElements[0].getMC().setBreak();
_global.AOC.playSFX(aElements[0].getElement + "Break");
if (aElements[1]) {
aElements[1].getMC().setBreak();
}
aElements = new Array();
} else {
drop(l_fNextFunction);
}
} else {
l_fNextFunction();
}
return(aElements[0].getMC()._name);
}
function switchElement(l_fNextFunction) {
var _local3 = false;
if (aElements.length == 1) {
aElements[0].switchSide();
_global.AOC.playSFX(aElements[0].getElement + "In");
} else {
aElements[1].switchSide(sarbakan.utils.Delegate.create(this, meldElements));
_global.AOC.playSFX(aElements[1].getElement + "In");
fNextFunction = l_fNextFunction;
_local3 = true;
}
return(_local3);
}
function meldElements() {
if ((aElements[0].getElement == "Air") || (aElements[1].getElement == "Air")) {
switch (true) {
case aElements[0].getElement == "Earth" :
aElements[0].mc.setMeld(fNextFunction, "EarthAir", "EarthAirIdle");
aElements[0].setElement = (sMainElement = "EarthAir");
break;
case aElements[1].getElement == "Earth" :
aElements[1].mc.setMeld(fNextFunction, "EarthAir", "EarthAirIdle");
aElements[0].setElement = (sMainElement = "EarthAir");
break;
case aElements[0].getElement == "Water" :
aElements[1].mc.setMeld(fNextFunction, "WaterAir", "Idle");
aElements[1].mc.setPrefix("WaterAir");
aElements[0].mc.setState("WaterAir");
aElements.shift();
aElements[0].setElement = (sMainElement = "WaterAir");
break;
case aElements[1].getElement == "Water" :
aElements[0].mc.setMeld(fNextFunction, "WaterAir", "Idle");
aElements[0].mc.setPrefix("WaterAir");
aElements[1].mc.setState("WaterAir");
aElements.pop();
aElements[0].setElement = (sMainElement = "WaterAir");
}
} else {
aElements[0].mc.setMeld(fNextFunction, "WaterEarth", "Idle");
aElements[0].mc.setPrefix("WaterEarth");
var _local2 = aElements.pop();
_local2.remove();
aElements[0].setElement = (sMainElement = "WaterEarth");
}
}
function drop(l_fNextFunction) {
var _local3 = 0;
while (_local3 < aElements.length) {
if (aElements[_local3].getElement == "Water") {
aElements[_local3].mc.setBreak(l_fNextFunction);
if (_local3 == 0) {
_global.AOC.playSFX(aElements[_local3].getElement + "Break");
}
} else {
aElements[_local3].mc.setOut(l_fNextFunction);
}
_local3++;
}
aElements = new Array();
}
function getElementPos(l_sElemDir) {
var _local2;
var _local3;
_local2 = 0;
while (_local2 < aElements.length) {
if (aElements[_local2].side == l_sElemDir) {
_local3 = _local2;
break;
}
_local2++;
}
return(_local3);
}
function getSideElement(l_sSide) {
var _local2 = getElementPos(l_sSide);
var _local3;
if (!isNaN(_local2)) {
_local3 = aElements[_local2].getElement;
}
return(_local3);
}
function get mainElement() {
return(sMainElement);
}
function get size() {
return(sSize);
}
}
Symbol 901 MovieClip [__Packages.game.visual.Element] Frame 0
class game.visual.Element extends sarbakan.visual.element.DynamicElement
{
var setMC, sElement, mc, __get__setElement;
function Element (l_mcElement, l_mcPlayer, l_sElement) {
super(l_mcElement._name);
setMC(l_mcElement);
sElement = l_sElement;
l_mcElement._x = l_mcPlayer._x;
l_mcElement._y = l_mcPlayer._y - 150;
if (l_mcPlayer._xscale > 0) {
l_mcElement.setSide("Right");
} else {
l_mcElement.setSide("Left");
}
l_mcElement.setState("In", "Idle");
}
function switchSide(l_fNextFunction) {
mc.setSwitch(l_fNextFunction);
}
function get getElement() {
var _local2;
if (sElement.substring(0, 5) == "Small") {
_local2 = sElement.substring(5);
} else {
_local2 = sElement.substring(3);
}
return(_local2);
}
function set setElement(l_sElement) {
sElement = l_sElement;
//return(__get__setElement());
}
function remove() {
mc.removeMovieClip();
}
function get side() {
return(mc.getSide());
}
}
Symbol 902 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 903 MovieClip [__Packages.game.visual.EasterEgg] Frame 0
class game.visual.EasterEgg extends sarbakan.visual.element.DynamicElement
{
var setMC, nSpeedX, nSpeedY, oLayer, fEndEasterEgg, stateFinished, mc;
function EasterEgg (l_mcEgg, l_mcPlayer, l_oLayer, l_fEndEasterEgg) {
super(l_mcEgg._name);
setMC(l_mcEgg);
l_mcEgg.gotoAndStop("Miss");
l_mcEgg._x = l_mcPlayer._x;
l_mcEgg._y = l_mcPlayer._y - 150;
nSpeedX = 0;
nSpeedY = 0;
oLayer = l_oLayer;
fEndEasterEgg = l_fEndEasterEgg;
}
function update() {
super.update();
if (stateFinished()) {
fEndEasterEgg();
oLayer.removeDynamicElement(this);
mc.removeMovieClip();
}
}
}
Symbol 904 MovieClip [__Packages.game.visual.Projectile] Frame 0
class game.visual.Projectile extends sarbakan.visual.element.DynamicElement
{
var setMC, nSpeedX, nSpeedY, fNextFunction, oLayer, stateFinished, mc;
function Projectile (l_mcProj, l_mcPlayer, l_nErrors, l_fNextFunction, l_oLayer) {
super(l_mcProj._name);
setMC(l_mcProj);
if (l_nErrors > 0) {
l_mcProj.gotoAndStop("Hit");
} else {
l_mcProj.gotoAndStop("Miss");
}
l_mcProj._x = l_mcPlayer._x;
l_mcProj._y = l_mcPlayer._y - 150;
l_mcProj._xscale = l_mcPlayer._xscale * -1;
nSpeedX = 0;
nSpeedY = 0;
fNextFunction = l_fNextFunction;
oLayer = l_oLayer;
}
function update() {
super.update();
if (stateFinished()) {
fNextFunction();
oLayer.removeDynamicElement(this);
mc.removeMovieClip();
}
}
function getCamCoord() {
var _local3 = 300;
if (mc._xscale > 0) {
_local3 = -300;
}
var _local2 = new Object({x:mc.state.state._x + _local3, y:mc.state._y - 300});
mc.state.localToGlobal(_local2);
mc._parent.globalToLocal(_local2);
return(_local2);
}
}
Symbol 905 MovieClip [__Packages.game.input.ButtonManager] Frame 0
class game.input.ButtonManager
{
var oCaptureMouse, oCaptureKeyboard;
function ButtonManager (l_mcAang) {
oCaptureMouse = new game.input.CaptureMouse();
oCaptureKeyboard = new game.input.CaptureKeyboard(l_mcAang);
}
function update() {
var _local2 = new Object();
_local2 = oCaptureMouse.getSequence(_local2);
if (_local2 != false) {
_local2 = oCaptureKeyboard.getSequence(_local2);
}
return(_local2);
}
function resetMouse() {
oCaptureMouse.resetMouse();
}
}
Symbol 906 MovieClip [__Packages.game.input.CaptureMouse] Frame 0
class game.input.CaptureMouse
{
function CaptureMouse () {
}
function getSequence() {
var _local2 = new Object();
if (_global.AODRAW.pattern == "") {
_local2 = false;
} else if (_global.AODRAW.pattern != undefined) {
_local2.mouse = _global.AODRAW.pattern;
}
_global.AODRAW.pattern = undefined;
return(_local2);
}
function resetMouse() {
_global.AODRAW.pattern = undefined;
}
}
Symbol 907 MovieClip [__Packages.game.input.CaptureKeyboard] Frame 0
class game.input.CaptureKeyboard
{
var aKeys, oKeyManager;
function CaptureKeyboard (l_mcAang) {
aKeys = new Array();
l_mcAang.KeyListener = sarbakan.input.KeyManager.getInstance();
oKeyManager = l_mcAang.KeyListener;
addKey("Space", 32);
addKey("E", 69);
}
function getSequence(l_oInput) {
var _local3 = new Array();
var _local2;
_local2 = 0;
while (_local2 < aKeys.length) {
if (oKeyManager[aKeys[_local2]]) {
_local3.push(aKeys[_local2]);
}
_local2++;
}
l_oInput.aKeyboard = _local3;
return(l_oInput);
}
function addKey(l_sName, l_nCode) {
aKeys.push(l_sName);
oKeyManager.addKeyListener(l_nCode, l_sName);
}
}
Symbol 908 MovieClip [__Packages.sarbakan.input.KeyManager] Frame 0
class sarbakan.input.KeyManager
{
static var oInstance;
var oKeyList;
function KeyManager () {
oKeyList = new Object();
}
static function getInstance() {
if (!oInstance) {
oInstance = new sarbakan.input.KeyManager();
}
initEnterFrame();
return(oInstance);
}
function addKeyListener(l_nKeyCode, l_sKeyName) {
oKeyList[l_sKeyName] = new Object();
oKeyList[l_sKeyName].nKeyCode = l_nKeyCode;
this[l_sKeyName] = false;
}
function onEnterFrame() {
setKey();
}
function setKey() {
var _local2;
for (_local2 in oKeyList) {
if (Key.isDown(oKeyList[_local2].nKeyCode)) {
this[_local2] = true;
} else {
this[_local2] = false;
}
}
}
static function initEnterFrame() {
mx.transitions.OnEnterFrameBeacon.init();
MovieClip.removeListener(oInstance);
MovieClip.addListener(oInstance);
}
}
Symbol 909 MovieClip [__Packages.game.hud.Hud] Frame 0
class game.hud.Hud
{
var nLives, nScore, nSeeScore, nMultiplier, oTime, mcHud;
function Hud (l_nMultiplier) {
nLives = NUMBER_TOTAL_LIFE;
nScore = 0;
nSeeScore = 0;
nMultiplier = l_nMultiplier;
oTime = new sarbakan.utils.Time(0, 0, true);
}
function update() {
oTime.update();
mcHud.setTime(oTime);
if (nSeeScore < nScore) {
var _local2 = Math.ceil(Math.random() * NUMBER_SCORE_RANDOM_INCREMENT) + NUMBER_SCORE_INCREMENT;
nSeeScore = Math.min(nSeeScore + (_local2 * nMultiplier), nScore);
mcHud.setScore(nSeeScore);
}
}
function setHudMC(l_mcHud) {
mcHud = l_mcHud;
mcHud.setLives(nLives);
mcHud.setScore(nSeeScore);
mcHud.setTime(oTime);
}
function setEndPoints(l_oTimeLimit) {
var _local2 = oTime.__get__totalSeconds();
var _local4 = l_oTimeLimit.__get__totalSeconds();
var _local3;
_local2 = _local2 - _local4;
if (_local2 < 0) {
_local3 = Math.max(0, 1000 - (_local2 * NUMBER_POINTS_SECONDS));
} else {
_local3 = 1000;
}
addScore(_local3);
}
function addScore(l_nScore) {
nScore = nScore + (l_nScore * nMultiplier);
}
function loseBalance(l_nLose) {
var _local2 = false;
nLives = nLives - l_nLose;
if (nLives <= 0) {
_local2 = true;
}
mcHud.setLives(nLives);
return(_local2);
}
function get score() {
return(nScore);
}
function get life() {
return(nLives);
}
var NUMBER_TOTAL_LIFE = 11;
var NUMBER_SCORE_INCREMENT = 20;
var NUMBER_SCORE_RANDOM_INCREMENT = 10;
var NUMBER_POINTS_SECONDS = 4;
}
Symbol 910 MovieClip [__Packages.game.hud.MCHud] Frame 0
class game.hud.MCHud extends MovieClip
{
var mcLives, txtScore, txtTime, oTxtFormat;
function MCHud () {
super();
_global.AOC.frameStartGame();
mcLives.gotoAndStop(3);
txtScore.text = sarbakan.utils.MoreMath.padZero(0, NUMBER_SCORE_SIZE);
_global.AOC.hud = this;
}
function setTime(l_oTime) {
txtTime.text = (l_oTime.__get__minutes() + ":") + sarbakan.utils.MoreMath.padZero(l_oTime.__get__seconds(), 2);
txtTime.setTextFormat(oTxtFormat);
}
function setLives(l_nLevel) {
mcLives.gotoAndStop(Math.max(0, l_nLevel) + 1);
}
function setScore(l_nScore) {
txtScore.text = sarbakan.utils.MoreMath.padZero(l_nScore, NUMBER_SCORE_SIZE);
txtScore.setTextFormat(oTxtFormat);
}
var NUMBER_SCORE_SIZE = 6;
}
Symbol 911 MovieClip [__Packages.game.PatternGenerator] Frame 0
class game.PatternGenerator
{
var mcTimeline, bTimeOut, OBJECT_PATTERNS, aSequence, nSequenceSize, sLastSequence;
function PatternGenerator (l_mcTimeline) {
mcTimeline = l_mcTimeline;
bTimeOut = false;
OBJECT_PATTERNS = new Object();
OBJECT_PATTERNS.TopLeft = new Array("Down", "BottomRight", "Right");
OBJECT_PATTERNS.TopRight = new Array("Down", "BottomLeft", "Left");
OBJECT_PATTERNS.BottomLeft = new Array("Up", "TopRight", "Right");
OBJECT_PATTERNS.BottomRight = new Array("Up", "TopLeft", "Left");
}
function generateSequence(l_nSize, l_sPos, l_sLastElement) {
aSequence = new Array();
nSequenceSize = l_nSize;
var _local4;
var _local5 = OBJECT_POSITION_VALUE[l_sPos];
var _local2;
var _local7;
_local4 = 0;
while (_local4 < l_nSize) {
if ((((_local4 + 1) == l_nSize) && (l_sLastElement == undefined)) || ((_local4 + 1) != l_nSize)) {
_local7 = Math.floor(Math.random() * OBJECT_PATTERNS[l_sPos].length);
_local2 = OBJECT_PATTERNS[l_sPos][_local7];
aSequence.push(_local2);
switch (_local2) {
case "Left" :
case "Right" :
case "Down" :
case "Up" :
_local5 = _local5 + OBJECT_POSITION_MOD[_local2];
l_sPos = ARRAY_POSITION_NAME[_local5 - 1];
break;
default :
_local5 = OBJECT_POSITION_VALUE[_local2];
l_sPos = _local2;
}
} else {
switch (l_sLastElement) {
case "Water" :
case "Ice" :
case "Switch" :
_local2 = OBJECT_PATTERNS[l_sPos][2];
aSequence.push(_local2);
break;
case "Earth" :
_local2 = OBJECT_PATTERNS[l_sPos][0];
aSequence.push(_local2);
break;
case "Air" :
_local2 = OBJECT_PATTERNS[l_sPos][1];
aSequence.push(_local2);
}
}
_local4++;
}
sLastSequence = aSequence[aSequence.length - 1];
mcTimeline["mc" + aSequence[0]].appear();
}
function compareSequence(l_oButtons) {
var _local2;
if (bTimeOut) {
bTimeOut = false;
_local2 = "TimeOut";
mcTimeline["mc" + aSequence[0]].disappear();
} else if (l_oButtons === false) {
_local2 = "Wrong";
mcTimeline["mc" + aSequence[0]].disappear();
} else if (l_oButtons.mouse != undefined) {
mcTimeline["mc" + aSequence[0]].disappear();
if (l_oButtons.mouse == aSequence[0]) {
aSequence.shift();
if (aSequence.length > 0) {
_local2 = "Correct";
mcTimeline["mc" + aSequence[0]].appear();
} else {
_local2 = "Complete";
}
} else {
_local2 = "Wrong";
}
} else if (l_oButtons.aKeyboard[0] == "E") {
_local2 = "Easter Egg";
} else {
_local2 = "Ongoing";
}
return(_local2);
}
function timeOut() {
bTimeOut = true;
mcTimeline["mc" + aSequence[0]].disappear();
}
function get sequence() {
var _local2 = aSequence[0];
if (_local2 == undefined) {
_local2 = sLastSequence;
}
return(_local2);
}
function get size() {
return(nSequenceSize);
}
function get remainingSize() {
return(aSequence.length);
}
var OBJECT_POSITION_VALUE = new Object({TopLeft:1, TopRight:2, BottomLeft:3, BottomRight:4});
var ARRAY_POSITION_NAME = new Array("TopLeft", "TopRight", "BottomLeft", "BottomRight");
var ARRAY_ALL_NAMES = new Array("TopLeft", "TopRight", "BottomLeft", "BottomRight", "Up", "Down", "Left", "Right");
var OBJECT_POSITION_MOD = new Object({Down:2, Up:-2, Left:-1, Right:1});
}
Symbol 912 MovieClip [__Packages.game.PowerupGenerator] Frame 0
class game.PowerupGenerator
{
var oMasterPowerupTime, mcScreen, oPowerupTime, nPowerup, mcPowerup, nBonus, sSound, __get__time, __get__pause;
function PowerupGenerator (l_oPowerupTimeDuration, l_mcScreen) {
oMasterPowerupTime = l_oPowerupTimeDuration;
mcScreen = l_mcScreen;
}
function update() {
var _local2 = false;
oPowerupTime.update();
if (oPowerupTime.__get__timeOut()) {
removePowerup();
_local2 = true;
}
return(_local2);
}
function setNextPowerup() {
nPowerup = Math.floor(Math.random() * ARRAY_POSITIONS.length);
var _local2 = Math.floor(Math.random() * ARRAY_POWERUP_TYPES.length);
var _local3 = mcScreen.getNextHighestDepth();
mcPowerup = mcScreen.mcBonus.attachMovie("ElementBonus", "Powerup" + _local3, _local3, {_x:ARRAY_POSITIONS[nPowerup][0], _y:ARRAY_POSITIONS[nPowerup][1], oTimeLimit:oPowerupTime});
mcPowerup.setType(_local2 + 1);
nBonus = ARRAY_POWERUP_VALUE[_local2];
sSound = ARRAY_POWERUP_SOUND[_local2];
oPowerupTime = new sarbakan.utils.Time(0, oMasterPowerupTime.__get__seconds());
mcPowerup.onRelease = sarbakan.utils.Delegate.create(this, activateBonus);
}
function activateBonus() {
_global.AOC.addScore = nBonus;
_global.AOC.playSFX(sSound, 1);
mcPowerup.clicked();
oPowerupTime = new sarbakan.utils.Time(0, 0);
}
function removePowerup() {
}
function get position() {
return(ARRAY_POSITION_NAMES[nPowerup]);
}
function set time(l_oTime) {
oPowerupTime = l_oTime;
oMasterPowerupTime = new sarbakan.utils.Time(l_oTime.__get__minutes(), l_oTime.__get__seconds());
//return(__get__time());
}
function set pause(l_bPause) {
if (l_bPause) {
mcPowerup.state.stop();
mcPowerup.state.text.stop();
mcPowerup.state.state.text.stop();
} else {
mcPowerup.state.play();
mcPowerup.state.text.play();
mcPowerup.state.state.text.play();
}
//return(__get__pause());
}
var ARRAY_POWERUP_SOUND = new Array("Ding", "Ding", "Ding");
var ARRAY_POWERUP_VALUE = new Array(100, 50, 25);
var ARRAY_POWERUP_TYPES = new Array("AirBonus", "WaterBonus", "EarthBonus");
var ARRAY_POSITIONS = new Array(new Array(150, 150), new Array(450, 150), new Array(150, 450), new Array(450, 450));
var ARRAY_POSITION_NAMES = new Array("TopLeft", "TopRight", "BottomLeft", "BottomRight");
var ARRAY_POSITION_BONUS = new Array(100, 50, 25);
}
Symbol 913 MovieClip [__Packages.HiScoreFacade] Frame 0
class HiScoreFacade
{
var nTotalScore, mcStage, nY, nScoreHeight;
function HiScoreFacade (l_mcStage, l_bFromGame, l_nTotalScore) {
nTotalScore = l_nTotalScore;
mcStage = l_mcStage.mcGame.mcElements.mcHighScore;
for (var _local2 in mcStage.mcHighScore) {
if (_local2.substring(0, 6) == "mcHigh") {
mcStage.mcHighScore[_local2].removeMovieClip();
}
}
nY = NUMBER_TOP_Y;
getHighScores(l_bFromGame);
}
function addHighScore(l_sName, l_nScore) {
var _local3 = "mcHigh" + mcStage.mcHighScore.getNextHighestDepth();
var _local2 = mcStage.mcHighScore.attachMovie("OneScoringPlayer", _local3, mcStage.mcHighScore.getNextHighestDepth());
_local2._x = 0;
_local2._y = nY;
nY = nY + (_local2._height - 5);
_local2.txtName.text = l_sName.toUpperCase();
_local2.txtScore.text = formatNumber(l_nScore, 7);
nScoreHeight = mcStage.mcHighScore._height;
}
function clearHighScores() {
for (var _local2 in mcStage.mcHighScore) {
if (_local2.substring(0, 6) == "mcHigh") {
mcStage.mcHighScore[_local2].removeMovieClip();
}
}
nY = NUMBER_TOP_Y;
}
function getHighScores() {
for (var _local3 in mcStage.mcHighScore) {
if (_local3.substring(0, 6) == "mcHigh") {
mcStage.mcHighScore[_local3].removeMovieClip();
}
}
nY = NUMBER_TOP_Y;
if (_global.objHS.bHSAvailable) {
_global.objHS.fDoHSInit();
}
_global.objHS.fSetHSBoard(mcStage);
_global.objHS.getScores();
}
function saveNGetHighScores() {
for (var _local3 in mcStage.mcHighScore) {
if (_local3.substring(0, 6) == "mcHigh") {
mcStage.mcHighScore[_local3].removeMovieClip();
}
}
nY = NUMBER_TOP_Y;
_global.objHS.submitScore(nTotalScore);
getHighScores();
}
function formatNumber(l_nNumber, l_nSize) {
var _local2 = "";
var _local1;
var _local3 = l_nSize - l_nNumber.toString().length;
_local1 = 0;
while (_local1 < _local3) {
_local2 = _local2 + "0";
_local1++;
}
return(_local2 + l_nNumber.toString());
}
var NUMBER_TOP_Y = 0;
}
Symbol 914 MovieClip [__Packages.sarbakan.sound.SoundManager] Frame 0
class sarbakan.sound.SoundManager
{
static var mc, aSounds, oRootSound, oEnterFrameListener, bMuted;
function SoundManager () {
}
static function init(l_mc) {
mc = l_mc;
aSounds = [];
oRootSound = new Sound(mc);
if (!oEnterFrameListener) {
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = sarbakan.utils.Delegate.create(sarbakan.sound.SoundManager, update);
MovieClip.addListener(oEnterFrameListener);
}
}
static function play(l_sLinkage, l_nVolume, l_nLoop, l_bUnique) {
if (!mc) {
}
var _local3 = canPlaySound(l_sLinkage);
if (_local3 == true) {
var _local1 = {};
_local1.mc = mc.createEmptyMovieClip(MOVIECLIP_BASE_NAME + mc.getNextHighestDepth(), mc.getNextHighestDepth());
_local1.sLinkage = l_sLinkage;
_local1.bUnique = l_bUnique;
_local1.aFade = [];
_local1.nFullVolume = l_nVolume;
_local1.oSound = new Sound(_local1.mc);
_local1.oSound.attachSound(l_sLinkage);
_local1.oSound.onSoundComplete = sarbakan.utils.Delegate.create(sarbakan.sound.SoundManager, remove, _local1.oSound);
_local1.oSound.start(0, l_nLoop);
_local1.oSound.setVolume(l_nVolume);
aSounds.push(_local1);
return(_local1.oSound);
}
return(_local3);
}
static function stop(l_oSound) {
l_oSound.stop();
remove(l_oSound);
}
static function stopString(l_sSound) {
var _local1;
_local1 = 0;
while (_local1 < aSounds) {
if (aSounds[_local1].sLinkage == l_sSound) {
stop(aSounds[_local1].oSound);
}
_local1++;
}
}
static function clearSounds() {
var _local1;
while (aSounds.length > 0) {
stop(aSounds[0].oSound);
}
}
static function mute() {
bMuted = true;
oRootSound.setVolume(0);
}
static function unmute() {
bMuted = false;
oRootSound.setVolume(100);
}
static function fade(l_oSound, l_nFadeType, l_nDestination, l_nSpeed) {
var _local3;
var _local4;
switch (l_nFadeType) {
case FADE_VOLUME :
_local3 = sarbakan.utils.Delegate.create(l_oSound, l_oSound.getVolume);
_local4 = sarbakan.utils.Delegate.create(l_oSound, l_oSound.setVolume);
break;
case FADE_PAN :
_local3 = sarbakan.utils.Delegate.create(l_oSound, l_oSound.getPan);
_local4 = sarbakan.utils.Delegate.create(l_oSound, l_oSound.setPan);
}
var _local2 = getSoundData(l_oSound);
if (l_nDestination < _local3()) {
l_nSpeed = l_nSpeed * -1;
}
if (((l_nFadeType == FADE_VOLUME) && (l_nSpeed > 0)) && (l_nDestination > _local2.oData.nFullVolume)) {
l_nDestination = _local2.oData.nFullVolume;
}
aSounds[_local2.nPosition].aFade[l_nFadeType] = {nDest:l_nDestination, nSpeed:l_nSpeed, fSet:_local4, fGet:_local3};
}
static function fadeInAll(l_nSpeed) {
if (!l_nSpeed) {
l_nSpeed = FADE_DEFAULT_SPEED;
}
fadeAll(FADE_VOLUME, 100, l_nSpeed);
}
static function fadeOutAll(l_nSpeed) {
if (!l_nSpeed) {
l_nSpeed = FADE_DEFAULT_SPEED;
}
fadeAll(FADE_VOLUME, 0, l_nSpeed);
}
static function getLinkage(l_oSound) {
return(getSoundData(l_oSound).oData.sLinkage);
}
static function isSoundPlaying(l_oSound) {
var _local1 = false;
if ((l_oSound.position != undefined) && (l_oSound.duration != undefined)) {
if (l_oSound.position < l_oSound.duration) {
_local1 = true;
}
}
return(_local1);
}
static function isMuted() {
return(bMuted);
}
static function remove(l_oSound) {
var _local1 = getSoundData(l_oSound);
_local1.oData.mc.removeMovieClip();
delete aSounds[_local1.nPosition].oSound;
delete aSounds[_local1.nPosition];
aSounds.splice(_local1.nPosition, 1);
}
static function update() {
for (var _local2 in aSounds) {
for (var _local1 in aSounds[_local2].aFade) {
if (aSounds[_local2].aFade[_local1]) {
aSounds[_local2].aFade[_local1].fSet(aSounds[_local2].aFade[_local1].fGet() + aSounds[_local2].aFade[_local1].nSpeed);
if (((aSounds[_local2].aFade[_local1].nSpeed > 0) && (aSounds[_local2].aFade[_local1].fGet() >= aSounds[_local2].aFade[_local1].nDest)) or ((aSounds[_local2].aFade[_local1].nSpeed < 0) && (aSounds[_local2].aFade[_local1].fGet() <= aSounds[_local2].aFade[_local1].nDest))) {
aSounds[_local2].aFade[_local1].fSet(aSounds[_local2].aFade[_local1].nDest);
delete aSounds[_local2].aFade[_local1];
}
}
}
}
}
static function canPlaySound(l_sLinkage) {
for (var _local2 in aSounds) {
if (aSounds[_local2].bUnique && (aSounds[_local2].sLinkage == l_sLinkage)) {
return(aSounds[_local2].oSound);
}
}
return(true);
}
static function getSoundData(l_oSound) {
var _local3;
for (var _local4 in aSounds) {
if (aSounds[_local4].oSound == l_oSound) {
_local3 = {oData:aSounds[_local4], nPosition:_local4};
}
}
return(_local3);
}
static function fadeAll(l_nFadeType, l_nDestination, l_nSpeed) {
for (var _local3 in aSounds) {
fade(aSounds[_local3].oSound, l_nFadeType, l_nDestination, l_nSpeed);
}
}
static var MOVIECLIP_BASE_NAME = "mcSounds";
static var FADE_DEFAULT_SPEED = 10;
static var FADE_VOLUME = 0;
static var FADE_PAN = 1;
}
Symbol 915 MovieClip [__Packages.game.input.mouse.cDraw] Frame 0
class game.input.mouse.cDraw
{
var bCanDraw, bIsDrawing, bWasDrawing, nXMouse, nYMouse, nFramesSince, mcField;
function cDraw () {
_global.AODRAW = this;
bCanDraw = false;
bIsDrawing = false;
bWasDrawing = false;
createDrawField(0, 0, 600, 600);
nXMouse = _global.AOROOT._xmouse;
nYMouse = _global.AOROOT._ymouse;
nFramesSince = 0;
}
function createDrawField(l_nX, l_nY, l_nWidth, l_nHeight) {
mcField = _global.AOROOT.attachMovie("drawField", "mcDraw" + _global.AOROOT.getNextHighestDepth(), _global.AOROOT.getNextHighestDepth());
mcField._x = l_nX;
mcField._y = l_nY;
mcField._width = l_nWidth;
mcField._height = l_nHeight;
_global.AODRAW.canDraw = true;
mcField.onRollOver = function () {
_global.AODRAW.canDraw = true;
this.useHandCursor = false;
};
mcField.onRollOut = function () {
_global.AODRAW.canDraw = false;
};
mcField.onMouseDown = function () {
if (_global.AODRAW.canDraw) {
_global.AODRAW.isDrawing = true;
_global.AODRAW.startDraw();
}
};
mcField.onMouseUp = function () {
_global.AODRAW.isDrawing = false;
_global.AODRAW.stopDraw();
};
mcField.onMouseMove = function () {
if (_global.AODRAW.isDrawing) {
_global.AODRAW.moveDraw();
}
};
}
function startDraw() {
_global.AODRAW.isDrawing = true;
_global.AODRAW.wasDrawing = true;
}
function moveDraw() {
}
function stopDraw() {
_global.AODRAW.isDrawing = false;
mcField.removeMovieClip();
createDrawField(100, 100, 640, 480);
}
function clearLines() {
mcField.removeMovieClip();
createDrawField(100, 100, 640, 480);
}
function removeThis() {
delete _global.AODRAW;
}
function set canDraw(l_bCanDraw) {
bCanDraw = l_bCanDraw;
//return(canDraw);
}
function get canDraw() {
return(bCanDraw);
}
function set isDrawing(l_bIsDrawing) {
bIsDrawing = l_bIsDrawing;
//return(isDrawing);
}
function get isDrawing() {
return(bIsDrawing);
}
function get framesSince() {
return(nFramesSince);
}
function set framesSince(l_nFramesSince) {
nFramesSince = l_nFramesSince;
//return(framesSince);
}
function get oldMousePos() {
var _local2 = new Object();
_local2.nMouseX = nXMouse;
_local2.nMouseY = nYMouse;
return(_local2);
}
function set oldMousePos(l_oMousePos) {
nXMouse = l_oMousePos.nMouseX;
nYMouse = l_oMousePos.nMouseY;
//return(oldMousePos);
}
function get wasDrawing() {
return(bWasDrawing);
}
function set wasDrawing(l_bWasDrawing) {
bWasDrawing = l_bWasDrawing;
//return(wasDrawing);
}
}
Symbol 916 MovieClip [__Packages.cRecog] Frame 0
class cRecog extends game.input.mouse.cDraw
{
var sPattern, nLastX, mcField, nLastY;
function cRecog (l_mcField) {
super(l_mcField);
_global.AODRAW = this;
sPattern = undefined;
oLineCapture = new game.input.mouse.cLineCapture();
oLineCompare = new game.input.mouse.cLineCompare();
}
function startDraw() {
super.startDraw();
nLastX = mcField.mcBrush._xmouse;
nLastY = mcField.mcBrush._ymouse;
oLineCapture.clearMemory();
}
function moveDraw() {
super.moveDraw();
var _local3 = new game.input.mouse.cUserLine(nLastX, nLastY, mcField.mcBrush._xmouse, mcField.mcBrush._ymouse);
if (oLineCapture.findCurve(_local3)) {
nLastX = mcField.mcBrush._xmouse;
nLastY = mcField.mcBrush._ymouse;
}
}
function stopDraw() {
super.stopDraw();
if (_global.AODRAW.wasDrawing) {
_global.AODRAW.wasDrawing = false;
var _local4 = new game.input.mouse.cUserLine(nLastX, nLastY, mcField.mcBrush._xmouse, mcField.mcBrush._ymouse);
oLineCapture.addLine(_local4);
if (oLineCapture.lines.length > 0) {
if (oLineCapture.lines[0].size > 100) {
if (oLineCapture.lines.length == 1) {
sPattern = oLineCompare.comparePattern(oLineCapture.lines);
} else {
sPattern = "";
}
nLastX = (nLastY = undefined);
}
}
}
clearLines();
}
function clearLines() {
super.clearLines();
oLineCapture.clearLines();
}
function get pattern() {
return(sPattern);
}
function set pattern(l_sPattern) {
sPattern = l_sPattern;
//return(pattern);
}
var oLineCapture = new Object();
var oLineCompare = new Object();
}
Symbol 917 MovieClip [__Packages.game.input.mouse.cLineCapture] Frame 0
class game.input.mouse.cLineCapture
{
function cLineCapture () {
}
function addLine(l_oObj) {
aLines.push(l_oObj);
aCurveMemory = new Array();
reduceLines();
}
function findCurve(l_oMainLine) {
var _local3 = false;
aCurveMemory.push(l_oMainLine);
if (aCurveMemory.length > 1) {
var _local4 = new game.input.mouse.cUserLine(aCurveMemory[aCurveMemory.length - 2].x2, aCurveMemory[aCurveMemory.length - 2].y2, l_oMainLine.x2, l_oMainLine.y2);
if (sarbakan.utils.MoreMath.angleRange(_local4.angle, l_oMainLine.angle) >= NUMBER_ANGLE_SENSITIVITY) {
addLine(l_oMainLine);
aCurveMemory = new Array();
aCurveMemory.push(l_oMainLine);
_local3 = true;
} else if (aCurveMemory.length > NUMBER_CURVE_MEMORY) {
aCurveMemory.shift();
}
}
return(_local3);
}
function reduceLines() {
var _local2;
var _local4;
var _local3;
for (_local2 in aLines) {
if (isNaN(aLines[_local2].size) || (isNaN(aLines[_local2].angle))) {
aLines.splice(_local2, 1);
continue;
}
if (aLines[_local2].size <= NUMBER_SMALL_SIZE_SENSITIVITY) {
if (_local2 > 0) {
aLines[_local2 - 1].modifyLine(undefined, undefined, aLines[_local2].x2, aLines[_local2].y2);
aLines.splice(_local2, 1);
} else if (aLines.length > 1) {
aLines[1].modifyLine(aLines[_local2].x1, aLines[_local2].y1);
aLines.splice(_local2, 1);
}
}
}
for (_local2 in aLines) {
if (aLines[_local2].curve == undefined) {
if ((((aLines[_local2 - 1] != undefined) && (aLines[_local2 - 1].curve == undefined)) && (sarbakan.utils.MoreMath.positionCompare(aLines[_local2], aLines[_local2 - 1], 5))) && (sarbakan.utils.MoreMath.angleRange(aLines[_local2].angle, aLines[_local2 - 1].angle) <= NUMBER_ANGLE_SENSITIVITY)) {
_local3 = new game.input.mouse.cUserLine(aLines[_local2 - 1].x1, aLines[_local2 - 1].y1, aLines[_local2].x2, aLines[_local2].y2);
aLines[_local2 - 1] = _local3;
aLines.splice(_local2, 1);
}
}
}
}
function clearLines() {
aLines = new Array();
clearMemory();
}
function clearMemory() {
aCurveMemory = new Array();
}
function get lines() {
return(aLines);
}
var NUMBER_ANGLE_SENSITIVITY = 20;
var NUMBER_SMALL_SIZE_SENSITIVITY = 100;
var NUMBER_CURVE_MEMORY = 25;
var aCurveMemory = new Array();
var aLines = new Array();
}
Symbol 918 MovieClip [__Packages.game.input.mouse.cUserLine] Frame 0
class game.input.mouse.cUserLine
{
var nX1, nX2, nY1, nY2, nOrigAngle, nAngle, nSize;
function cUserLine (l_nX1, l_nY1, l_nX2, l_nY2) {
nX1 = l_nX1;
nX2 = l_nX2;
nY1 = l_nY1;
nY2 = l_nY2;
calculateData();
nOrigAngle = nAngle;
}
function modifyLine(l_nX1, l_nY1, l_nX2, l_nY2) {
if ((l_nX1 != undefined) && (l_nY1 != undefined)) {
nX1 = l_nX1;
nY1 = l_nY1;
}
if ((l_nX2 != undefined) && (l_nY2 != undefined)) {
nX2 = l_nX2;
nY2 = l_nY2;
}
calculateData();
}
function calculateData() {
nAngle = sarbakan.utils.MoreMath.angleDirection(nX1, nY1, nX2, nY2);
nSize = sarbakan.utils.MoreMath.getDistance(nX1, nY1, nX2, nY2);
}
function get x1() {
return(nX1);
}
function get x2() {
return(nX2);
}
function get y1() {
return(nY1);
}
function get y2() {
return(nY2);
}
function get angle() {
return(nAngle);
}
function get size() {
return(nSize);
}
function get origangle() {
return(nOrigAngle);
}
function set origangle(l_origAngle) {
nOrigAngle = l_origAngle;
//return(origangle);
}
}
Symbol 919 MovieClip [__Packages.game.input.mouse.cLineCompare] Frame 0
class game.input.mouse.cLineCompare
{
function cLineCompare () {
}
function comparePattern(aLines) {
var _local4 = aLines.length;
var _local9;
var _local8;
var _local7;
var _local12;
var _local13;
var _local6;
var _local10;
var _local11;
var _local5 = false;
if (!compareStraightLine(aLines)) {
return("");
}
var _local2 = aLines[aLines.length - 1].angle;
_local2 = _local2 + 22.5;
_local2 = Math.max(0, _local2);
if (_local2 >= 360) {
_local2 = 0;
}
return(ARRAY_DIRECTIONS[Math.floor(_local2 / 45)]);
}
function compareStraightLine(l_aLines) {
var _local2 = false;
var _local1 = l_aLines.length - 1;
if (l_aLines[_local1].curve == undefined) {
var _local4 = l_aLines[_local1].size;
if (l_aLines[_local1].size >= _local4) {
_local2 = true;
}
}
return(_local2);
}
var ARRAY_DIRECTIONS = new Array("Up", "TopRight", "Right", "BottomRight", "Down", "BottomLeft", "Left", "TopLeft");
var NUMBER_COMPARE_SIZE = 25;
var NUMBER_CURVE_SENSITIVITY = 30;
}
Symbol 920 MovieClip [__Packages.game.visual.movieclip.HighScoresMC] Frame 0
class game.visual.movieclip.HighScoresMC extends MovieClip
{
var nXLimit, _x, nYHsStartPos, _parent, bDragging, onPress, onRelease, onReleaseOutside, onMouseMove;
function HighScoresMC () {
super();
nXLimit = _x;
nYHsStartPos = _parent.mcHighScore._y;
bDragging = false;
setCommands();
}
function setCommands() {
onPress = function () {
this.startDrag(true, this.nXLimit, this.NUMBER_TOP_LIMIT, this.nXLimit, this.NUMBER_BOTTOM_LIMIT);
this.bDragging = true;
};
onRelease = (onReleaseOutside = function () {
this.stopDrag();
this.bDragging = false;
});
onMouseMove = function () {
this._parent.mcHighScore._y = this.nYHsStartPos - ((this._parent.mcHighScore._height - this.NUMBER_VIEW_LIMIT) * ((this._y - this.NUMBER_TOP_LIMIT) / (this.NUMBER_BOTTOM_LIMIT - this.NUMBER_TOP_LIMIT)));
};
}
var NUMBER_TOP_LIMIT = -63.5;
var NUMBER_BOTTOM_LIMIT = 121.6;
var NUMBER_VIEW_LIMIT = 185.1;
}
Symbol 921 MovieClip [__Packages.game.visual.movieclip.MCButton] Frame 0
class game.visual.movieclip.MCButton extends MovieClip
{
var bDown, gotoAndStop, onRollOver, onRollOut, onPress, onRelease, onReleaseOutside, _name, _parent;
function MCButton () {
super();
bDown = false;
gotoAndStop("idle");
onRollOver = over;
onRollOut = out;
onPress = press;
onRelease = over;
onReleaseOutside = out;
if (_name == ("mc" + _global.AOC.difficulty)) {
bDown = true;
gotoAndStop("down");
_global.AOC.difficulty = _name.substring(2);
}
}
function over() {
gotoAndStop("over");
}
function out() {
if (bDown) {
gotoAndStop("down");
} else {
gotoAndStop("idle");
}
}
function press() {
_global.AOC.playSFX("Button", 1);
_parent.mcEasy.unpress();
_parent.mcMedium.unpress();
_parent.mcHard.unpress();
bDown = true;
gotoAndStop("down");
_global.AOC.difficulty = _name.substring(2);
}
function unpress() {
bDown = false;
out();
}
}
Symbol 922 MovieClip [__Packages.game.visual.movieclip.MCArrow] Frame 0
class game.visual.movieclip.MCArrow extends MovieClip
{
var stop, state, _visible, gotoAndStop, onEnterFrame;
function MCArrow () {
super();
stop();
state.stop();
_visible = false;
}
function updateAppear() {
if (state._currentframe == state._totalframes) {
gotoAndStop("Idle");
delete onEnterFrame;
}
}
function updateDisappear() {
if (state._currentframe == state._totalframes) {
state.stop();
_visible = false;
delete onEnterFrame;
}
}
function appear() {
state.gotoAndPlay(1);
gotoAndStop("Appear");
state.play();
onEnterFrame = updateAppear;
_visible = true;
}
function disappear() {
state.gotoAndPlay(1);
gotoAndStop("Disappear");
state.play();
onEnterFrame = updateDisappear;
}
}
Symbol 923 MovieClip [__Packages.game.visual.movieclip.MCLevelTitle] Frame 0
class game.visual.movieclip.MCLevelTitle extends MovieClip
{
var onEnterFrame, state, _currentframe;
function MCLevelTitle () {
super();
onEnterFrame = update;
update();
}
function update() {
if (titleFrame()) {
state.gotoAndStop(_global.AOC.difficulty);
}
}
function titleFrame() {
var _local2;
var _local3 = false;
_local2 = 0;
while (_local2 < ARRAY_TITLE_FRAMES.length) {
if (_currentframe == ARRAY_TITLE_FRAMES[_local2]) {
_local3 = true;
break;
}
_local2++;
}
return(_local3);
}
var ARRAY_TITLE_FRAMES = new Array(1, 20, 55, 75);
}
Symbol 924 MovieClip [__Packages.game.visual.movieclip.MCMusic] Frame 0
class game.visual.movieclip.MCMusic extends MovieClip
{
var stop, gotoAndStop, btnSnd;
function MCMusic () {
super();
stop();
setButton(_global.AOC.isMute);
}
function setSound() {
var _local3 = _global.AOC.toggleMute();
setButton(_local3);
}
function setButton(l_bIsMute) {
if (l_bIsMute) {
gotoAndStop("Off");
} else {
gotoAndStop("On");
}
btnSnd.onPress = function () {
this._parent.setSound();
};
}
}
Symbol 925 MovieClip [__Packages.game.hud.MCPauseMenu] Frame 0
class game.hud.MCPauseMenu extends MovieClip
{
var mcMenu, mcInstructions, sState, btnOpenMenu;
function MCPauseMenu () {
super();
mcMenu._visible = false;
mcInstructions._visible = false;
sState = "Closed";
btnOpenMenu.onRelease = mx.utils.Delegate.create(this, buttonPress);
setMenu();
}
function buttonPress() {
if (sState == "Closed") {
mcMenu._visible = true;
mcInstructions._visible = true;
_global.AOC.pause = true;
sState = "Open";
} else {
mcMenu._visible = false;
mcInstructions._visible = false;
_global.AOC.pause = false;
sState = "Closed";
}
}
function setMenu() {
mcMenu.gotoAndStop(1);
mcMenu.btnMusic.mcOnOff.stop();
mcMenu.btnMusic.onPress = function () {
_global.AOC.changeMute();
};
mcMenu.btnRestart.onPress = mx.utils.Delegate.create(this, setYesNoRestart);
mcMenu.btnInstructions.onPress = mx.utils.Delegate.create(this, setInstructions);
mcMenu.btnQuit.onPress = mx.utils.Delegate.create(this, setYesNoQuit);
mcMenu.btnContinue.onPress = (btnOpenMenu.onRelease = mx.utils.Delegate.create(this, buttonPress));
}
function setYesNoQuit() {
mcMenu.gotoAndStop(2);
mcMenu.btnYes.onPress = function () {
_global.AOC.endGame(false);
};
mcMenu.btnNo.onPress = mx.utils.Delegate.create(this, setMenu);
}
function setYesNoRestart() {
mcMenu.gotoAndStop(2);
mcMenu.btnYes.onPress = function () {
_global.AOC.restartGame();
};
mcMenu.btnNo.onPress = mx.utils.Delegate.create(this, setMenu);
}
function setInstructions() {
mcMenu.gotoAndStop(3);
mcMenu.mcInstructions.mcInstructions.gotoAndStop(1);
mcMenu.mcInstructions.btnLeftArrow.onPress = mx.utils.Delegate.create(this, setMenu);
mcMenu.mcInstructions.btnLeftArrow._visible = true;
mcMenu.mcInstructions.btnRightArrow.onPress = mx.utils.Delegate.create(this, setNextInstructions);
}
function setNextInstructions() {
mcMenu.mcInstructions.mcInstructions.gotoAndStop(2);
mcMenu.mcInstructions.btnLeftArrow.onPress = mx.utils.Delegate.create(this, setInstructions);
mcMenu.mcInstructions.btnRightArrow.onPress = mx.utils.Delegate.create(this, setMenu);
mcMenu.mcInstructions.btnRightArrow._visible = true;
}
}
Symbol 59 Button
on (keyPress "<Space>") {
return(undefined);
}
Symbol 101 MovieClip Frame 13
stop();
Symbol 108 MovieClip [SmallEarth] Frame 1
#initclip 71
Object.registerClass("SmallEarth", game.visual.movieclip.MCElement);
#endinitclip
Symbol 114 MovieClip [Pause ] Frame 1
#initclip 63
Object.registerClass("Pause ", sarbakan.visual.PauseManager);
#endinitclip
this._visible = false;
Symbol 124 MovieClip Frame 13
stop();
Symbol 130 MovieClip [BigEarth] Frame 1
#initclip 64
Object.registerClass("BigEarth", game.visual.movieclip.MCElement);
#endinitclip
Symbol 161 MovieClip Frame 13
stop();
this._parent._visible = false;
Symbol 162 MovieClip [SmallWater] Frame 1
#initclip 65
Object.registerClass("SmallWater", game.visual.movieclip.MCElement);
#endinitclip
Symbol 203 MovieClip Frame 14
stop();
this._parent._visible = false;
Symbol 206 MovieClip [BigWater] Frame 1
#initclip 66
Object.registerClass("BigWater", game.visual.movieclip.MCElement);
#endinitclip
Symbol 224 MovieClip [SmallAir] Frame 1
#initclip 67
Object.registerClass("SmallAir", game.visual.movieclip.MCElement);
#endinitclip
Symbol 242 MovieClip [BigAir] Frame 1
#initclip 68
Object.registerClass("BigAir", game.visual.movieclip.MCElement);
#endinitclip
Symbol 254 MovieClip Frame 1
this._parent.setProj();
Symbol 254 MovieClip Frame 22
this._parent.setProj();
_global.AOC.projCollide();
this.stopSound();
Symbol 254 MovieClip Frame 35
this._parent.setProj();
Symbol 254 MovieClip Frame 52
this._parent.setProj();
Symbol 255 MovieClip Frame 1
this._parent.setProj();
Symbol 255 MovieClip Frame 22
this._parent.setProj();
_global.AOC.projCollide();
Symbol 255 MovieClip Frame 35
this._parent.setProj();
Symbol 255 MovieClip Frame 52
this._parent.setProj();
Symbol 256 MovieClip [ProjSokka] Frame 1
#initclip 69
Object.registerClass("ProjSokka", game.visual.movieclip.MCSokaProjectile);
#endinitclip
Symbol 259 MovieClip Frame 28
_global.AOC.projCollide();
Symbol 263 MovieClip Frame 28
_global.AOC.projCollide();
Symbol 270 MovieClip Frame 19
this._parent.gotoAndStop("Out");
Symbol 271 MovieClip [Pillar] Frame 41
this._visible = false;
Symbol 307 MovieClip [ElementBonus] Frame 1
#initclip 70
Object.registerClass("ElementBonus", game.visual.movieclip.MCBonus);
#endinitclip
Symbol 361 MovieClip [AangOn_FlecheDirection01] Frame 1
#initclip 81
Object.registerClass("AangOn_FlecheDirection01", game.visual.movieclip.MCTitleArrow);
#endinitclip
Symbol 376 MovieClip [AangOn_Puce01] Frame 1
#initclip 72
Object.registerClass("AangOn_Puce01", game.visual.movieclip.HighScoresMC);
#endinitclip
Symbol 394 MovieClip Frame 1
this._visible = false;
_parent.hitArea = this;
Symbol 403 MovieClip [AangOn_TxtLevelLonger01] Frame 1
#initclip 73
Object.registerClass("AangOn_TxtLevelLonger01", game.visual.movieclip.MCButton);
#endinitclip
Symbol 407 MovieClip [AangOn_TxtLevelShort01] Frame 1
#initclip 74
Object.registerClass("AangOn_TxtLevelShort01", game.visual.movieclip.MCButton);
#endinitclip
Symbol 411 MovieClip [AangOn_TxtLevelLongest01] Frame 1
#initclip 75
Object.registerClass("AangOn_TxtLevelLongest01", game.visual.movieclip.MCButton);
#endinitclip
Symbol 420 Button
on (press) {
this.mcInstructions.nextFrame();
this.btnLeftArrow._visible = true;
this.btnRightArrow._visible = false;
}
Symbol 422 Button
on (press) {
this.mcInstructions.prevFrame();
this.btnRightArrow._visible = true;
this.btnLeftArrow._visible = false;
}
Symbol 437 MovieClip Frame 1
stop();
Symbol 458 MovieClip Frame 1
this._visible = false;
_parent.hitArea = this;
Instance of Symbol 459 MovieClip in Symbol 460 MovieClip Frame 1
on (release) {
_global.AOC.playSFX("Button", 1);
_global.AOC.transitionToGame();
}
Symbol 733 MovieClip [AangOn_Arrow01] Frame 1
#initclip 76
Object.registerClass("AangOn_Arrow01", game.visual.movieclip.MCArrow);
#endinitclip
Symbol 745 MovieClip [HUD] Frame 1
#initclip 77
Object.registerClass("HUD", game.hud.MCHud);
#endinitclip
Symbol 760 MovieClip [Level_Title_Appear] Frame 1
#initclip 78
Object.registerClass("Level_Title_Appear", game.visual.movieclip.MCLevelTitle);
#endinitclip
Symbol 760 MovieClip [Level_Title_Appear] Frame 76
stop();
Symbol 767 MovieClip Frame 1
this._alpha = 1;
Symbol 799 MovieClip [Music] Frame 1
#initclip 79
Object.registerClass("Music", game.visual.movieclip.MCMusic);
#endinitclip
Instance of Symbol 767 MovieClip in Symbol 810 MovieClip Frame 1
on (press) {
}
on (rollOver) {
this.useHandCursor = false;
}
Symbol 811 MovieClip [Pause Menu] Frame 1
#initclip 80
Object.registerClass("Pause Menu", game.hud.MCPauseMenu);
#endinitclip
Symbol 834 Button
on (press) {
_global.objHS.fDoSubmitHS(this);
_global.AOC.transitionToHighScore(false);
}
Symbol 838 Button
on (press) {
_global.objHS.fDoSubmitHS(this);
_global.AOC.transitionToHighScore(true);
}
Symbol 839 MovieClip Frame 1
Symbol 839 MovieClip Frame 6
Symbol 864 MovieClip Frame 1
_global.AOC = new Controller(this);
_global.AOROOT = this;
stop();
Symbol 864 MovieClip Frame 2
this.mcGame.mcElements.mcInstructions.btnLeftArrow._visible = false;
Symbol 864 MovieClip Frame 11
_global.AODRAW = new cRecog(this);
this.mcSpacebar._visible = false;
stop();