Frame 1
var LOCAL = true;
var domXML = new XML();
if (LOCAL) {
gotoAndPlay (2);
} else {
domXML.load("http://www.cartoonnetwork.com/crossdomain.xml");
}
domXML.onLoad = function () {
if (domXML.childNodes.length == 0) {
getURL ("http://www.cartoonnetwork.com");
stop();
} else {
gotoAndPlay (2);
}
};
Frame 3
function loadGame() {
var _local2 = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (_local2 > 1) {
Preloader.gotoAndStop(20 + _local2);
Preloader.counter_txt.text = _local2 + "%";
}
if (_local2 >= 100) {
clearInterval(loadInt);
gotoAndStop (10);
}
}
loadInt = setInterval(loadGame, 50);
stop();
Frame 5
Frame 9
stop();
Symbol 56 MovieClip Frame 20
stop();
Symbol 56 MovieClip Frame 120
stop();
Symbol 109 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 235
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 148
stop();
Symbol 237 MovieClip [introduction] Frame 2
var my_breath = new Sound();
my_breath.attachSound("cheese_breathes");
var my_scream = new Sound();
my_scream.attachSound("cheese_screams");
var my_aah = new Sound();
my_aah.attachSound("cheese_aah");
Symbol 237 MovieClip [introduction] Frame 12
cheese_car.cheese.gotoAndPlay(150);
Symbol 237 MovieClip [introduction] Frame 13
my_aah.start();
Symbol 237 MovieClip [introduction] Frame 97
stop();
Symbol 277 MovieClip [instr_pod] Frame 1
stop();
Symbol 304 MovieClip [GameEntry] Frame 1
#initclip 17
Object.registerClass("GameEntry", Base.GameEntry);
#endinitclip
Symbol 305 MovieClip [__Packages.Base.GameEntry] Frame 0
class Base.GameEntry extends MovieClip
{
static var _gamePaused, _gameOver;
var _timeMgr, _uiMgr, _padMgr, _gameMgr, _parent, _gameData, _profiler, _background, _gameLoaded, _stageLoaded, onEnterFrame, _multiplayer, _sndMgr;
function GameEntry () {
super();
_gamePaused = false;
_gameOver = false;
_timeMgr = new Base.Time();
_uiMgr = new UI.UIManager(this);
_padMgr = new Pad.PadManager();
_gameMgr = new Game.GameManager(_parent);
_gameData = new Game.GameData(this);
_profiler = new Base.Profile(this);
_profiler.RegisterProfile("Game");
_background = new Base.Background(this);
_gameLoaded = false;
_stageLoaded = 1;
onEnterFrame = Update;
}
function getDT() {
return(_timeMgr.getElapsedTime());
}
function getParent() {
return(_parent);
}
function getTimeManager() {
return(_timeMgr);
}
function getGameManager() {
return(_gameMgr);
}
function getPadManager() {
return(_padMgr);
}
function getGameData() {
return(_gameData);
}
function getUIManager() {
return(_uiMgr);
}
function isMultiplayer() {
return(_multiplayer);
}
function getSoundManager() {
return(_sndMgr);
}
function getProfiler() {
return(_profiler);
}
function getBackground() {
return(_background);
}
function getStageLoaded() {
return(_stageLoaded);
}
function Update() {
_timeMgr.markTimeThisTick();
_padMgr.Update(this);
_uiMgr.Update();
_gameMgr.Update(this);
_background.moveBack(this);
return(undefined);
}
}
Symbol 306 MovieClip [__Packages.Base.Time] Frame 0
class Base.Time
{
var _currentTime, _timeLastTick, _gameSpeed, _startTime, _averageTime, _currentPlaceInAvgArray;
function Time () {
_currentTime = 0;
_timeLastTick = 0.001;
_gameSpeed = INITIAL_GAME_SPEED;
_startTime = (getTimer() * INITIAL_GAME_SPEED) / 1000;
_averageTime = new Array(0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666, 0.01666);
_currentPlaceInAvgArray = 0;
_currentTime = getTimer();
}
function getElapsedTime() {
return(_timeLastTick);
}
function getCurTime() {
return(_currentTime);
}
function getGameSpeed() {
return(_gameSpeed);
}
function getAverageTime() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < 10) {
_local3 = _local3 + _averageTime[_local2];
_local2++;
}
_local3 = _local3 / 10;
return(_local3);
}
function getFramerate() {
return(Math.floor(1 / getAverageTime()));
}
function markTimeThisTick() {
var _local2 = ((getTimer() * _gameSpeed) / 1000) - _startTime;
_timeLastTick = _local2 - _currentTime;
_currentTime = _local2;
_averageTime[_currentPlaceInAvgArray++] = _timeLastTick;
if (_currentPlaceInAvgArray >= 10) {
_currentPlaceInAvgArray = 0;
}
if (_timeLastTick <= 0) {
_timeLastTick = 0.001;
}
}
function setGameSpeed(speed) {
_gameSpeed = speed;
if (_gameSpeed < MIN_GAME_SPEED) {
_gameSpeed = MIN_GAME_SPEED;
} else if (_gameSpeed > MAX_GAME_SPEED) {
_gameSpeed = MIN_GAME_SPEED;
}
}
static var INITIAL_GAME_SPEED = 1;
static var MIN_GAME_SPEED = 0.001;
static var MAX_GAME_SPEED = 100;
}
Symbol 307 MovieClip [__Packages.UI.UIManager] Frame 0
class UI.UIManager
{
var _gameContext, _uiReturnVal, _screen, _children, _cursor, _cursorOn, _nonBufferCursor, _scoreBoard;
function UIManager (gameContext) {
_gameContext = gameContext;
}
function Update() {
_uiReturnVal = -1;
updateCursor();
updateScoreboard();
var _local3 = 0;
while (_local3 < _screen.getNumChildren()) {
var _local2 = _screen.getChildName(_local3);
if (_screen.isChildAnimating(_local2)) {
_screen.animateChild(_local2);
}
if (!_screen.getChildSelectable(_local2)) {
} else {
var _local8 = _children[_local3][5];
var _local5 = _children[_local3][6];
var _local9 = _children[_local3][7];
var _local10 = _children[_local3][8];
switch (_screen.getChildSelectable(_local2)) {
case 1 :
if (_screen.isMouseOverChild(_local2)) {
if ((!_screen.isChildAnimating(_local2)) && (_screen.getChildCurrentAnimFrame(_local2) <= _local8)) {
cursorOn();
_screen.startAnimatingChild(_local2, _local8, _local5, _local9, _local10);
}
if (_screen.getChildSelectOnKeyDown(_local2) && (_gameContext.getPadManager().getMouseJustPressed())) {
cursorOff();
_uiReturnVal = _screen.getChildReturnVal(_local2);
} else if ((!_screen.getChildSelectOnKeyDown(_local2)) && (_gameContext.getPadManager().getMouseReleased())) {
cursorOff();
_uiReturnVal = _screen.getChildReturnVal(_local2);
}
} else if ((!_screen.isChildAnimating(_local2)) && (_screen.getChildCurrentAnimFrame(_local2) == _local5)) {
_local8 = _children[_local3][6];
_local5 = _children[_local3][5];
cursorOff();
_screen.startAnimatingChild(_local2, _local8, _local5, _local9, _local10);
}
break;
case 2 :
var _local11 = _screen.getChildMouseIsOver();
if (_local11 != null) {
cursorOn();
if (_screen.isMouseOverChild(_local2)) {
if (_screen.getChildSelectOnKeyDown(_local2) && (_gameContext.getPadManager().getMouseJustPressed())) {
_screen.moveChildToFrame(_local2, _local5);
setUIReturnVal(_screen.getChildReturnVal(_local2));
var _local4 = 0;
while (_children[_local3][11][_local4] != undefined) {
var _local6 = _screen.getChildName(_children[_local3][11][_local4]);
var _local7 = _children[_local4][5];
_screen.moveChildToFrame(_local6, _local7);
_local4++;
}
} else if ((!_screen.getChildSelectOnKeyDown(_local2)) && (_gameContext.getPadManager().getMouseReleased())) {
_screen.moveChildToFrame(_local2, _local5);
setUIReturnVal(_screen.getChildReturnVal(_local2));
var _local4 = 0;
while (_children[_local3][11][_local4] != undefined) {
var _local6 = _screen.getChildName(_children[_local3][11][_local4]);
var _local7 = _children[_local4][5];
_screen.moveChildToFrame(_local6, _local7);
_local4++;
}
}
}
} else {
cursorOff();
}
break;
}
}
_local3++;
}
}
function moveScreenToFrame(num) {
_screen.moveToFrame(num);
}
function setUIReturnVal(val) {
_uiReturnVal = val;
}
function getUIReturnVal() {
return(_uiReturnVal);
}
function getScreen() {
return(_screen);
}
function showScreen(screen, initFrame, defaultSetting) {
if (_screen != undefined) {
removeScreen();
}
_screen = new Base.SpriteEntity(_gameContext, screen.id, screen.idx, screen.spriteName, screen.clipName, screen.depth, screen.xPos, screen.yPos, screen.regPt, screen.w, screen.h);
_children = screen.children;
var _local3 = 0;
var _local8 = 0;
if (initFrame != undefined) {
_local8 = initFrame;
}
_screen.moveToFrame(_local8);
while (_children[_local3][0] != undefined) {
_screen.addChild(screen.children[_local3][0], screen.children[_local3][1], screen.children[_local3][2], screen.children[_local3][3], screen.children[_local3][4], screen.children[_local3][9], screen.children[_local3][10]);
_local3++;
}
var _local4 = 0;
while (defaultSetting[_local4] != undefined) {
var _local5 = _children[defaultSetting[_local4]][0];
var _local6 = _children[defaultSetting[_local4]][6];
_screen.moveChildToFrame(_local5, _local6);
_local4++;
}
}
function removeScreen() {
_screen.removeSprite();
delete _screen;
}
function setCursor(sprite) {
_cursor = new Base.SpriteEntity(_gameContext, sprite.id, sprite.idx, sprite.spriteName, sprite.clipName, sprite.depth, sprite.xPos, sprite.yPos, sprite.regPt, sprite.w, sprite.h);
_cursor.setVisibility(false);
_cursorOn = false;
}
function cursorOn() {
if (_cursorOn == true) {
return(undefined);
}
_cursorOn = true;
updateCursor();
_cursor.setVisibility(true);
Mouse.hide();
}
function cursorOff() {
if (_cursorOn == false) {
return(undefined);
}
_cursorOn = false;
_cursor.setVisibility(false);
Mouse.show();
}
function updateCursor() {
if (_cursorOn) {
_cursor.setPositionX(_gameContext.getPadManager().getMousePosX());
_cursor.setPositionY(_gameContext.getPadManager().getMousePosY());
}
}
function setNonBufferCursorPosition() {
_nonBufferCursor.setPositionX(_gameContext.getPadManager().getMousePosX());
_nonBufferCursor.setPositionY(_gameContext.getPadManager().getMousePosY());
}
function getCursor() {
return(_cursor);
}
function addScoreboard(sprite) {
}
function updateScoreboard() {
if (_scoreBoard == undefined) {
return(undefined);
}
}
}
Symbol 308 MovieClip [__Packages.Base.SpriteEntity] Frame 0
class Base.SpriteEntity
{
var _entityType, _id, _spName, _clName, _gameContext, _mc, _clipWidth, _clipHeight, _centerPoint, _startFrame, _endFrame, _framerate, _loopAnim, _animate, _animateTimer, _lastFrame, _c, _flipped, _mouseIsOver, _mouseRollOn, _mouseRollOff, _children, _collideOffsetX, _collideOffsetY, _moveSpeed, _destPosX, _destPosY, _startingPositionX, _startingPositionY, _depth, _faceDir;
function SpriteEntity (gameContext, eType, id, spName, clName, depth, posX, posY, centerPoint, wth, hgt) {
_entityType = eType;
_id = id;
_spName = spName;
_clName = clName;
_gameContext = gameContext;
_mc = _gameContext.getParent().attachMovie(spName, clName, depth);
_mc._visible = true;
_mc._x = posX;
_mc._y = posY;
_clipWidth = ((wth > 0) ? (wth) : (_mc._width));
_clipHeight = ((hgt > 0) ? (hgt) : (_mc._height));
_centerPoint = centerPoint;
_startFrame = 0;
_endFrame = 0;
_framerate = 30;
_loopAnim = false;
_animate = false;
_animateTimer = 0;
_lastFrame = 0;
_c = 1;
_flipped = false;
_mc.gotoAndStop(_c);
_mc.createEmptyMovieClip("lines", depth + 200000);
_mouseIsOver = false;
_mouseRollOn = false;
_mouseRollOff = false;
_children = [];
_collideOffsetX = 0;
_collideOffsetY = 0;
}
function setMoveSpeed(speed) {
_moveSpeed = speed;
}
function setDestPosX(pos) {
_destPosX = pos;
}
function setDestPosY(pos) {
_destPosY = pos;
}
function setStartingPositionToPosition() {
_startingPositionX = getPositionX();
_startingPositionY = getPositionY();
}
function getMoveSpeed() {
return(_moveSpeed);
}
function getDestPosX() {
return(_destPosX);
}
function getDestPosY() {
return(_destPosY);
}
function getStartingPositionX() {
return(_startingPositionX);
}
function getStartingPositionY() {
return(_startingPositionY);
}
function setCollideOffsetXY(x, y) {
_collideOffsetX = x;
_collideOffsetY = y;
}
function getCollideOffsetX() {
return(_collideOffsetX);
}
function getCollideOffsetY() {
return(_collideOffsetY);
}
function isAtDestination() {
return((((_mc._x == _destPosX) && (_mc._y == _destPosY)) ? true : false));
}
function createChild(childName, upperLeftX, upperLeftY, w, h, isSelectable, returnVal) {
_depth = getZDepth();
_children.push(childName + returnVal);
_mc[childName + returnVal] = _mc.attachMovie(childName, ("minor_token" + (_depth * 10)) + returnVal, (_depth * 10) + returnVal);
_mc[childName + returnVal]._x = w;
_mc[childName + returnVal]._animiateChild = false;
_mc[childName + returnVal]._lastChildFrame = 0;
_mc[childName + returnVal]._startChildFrame = 1;
_mc[childName + returnVal]._endChildFrame = 1;
_mc[childName + returnVal]._childFramerate = 60;
_mc[childName + returnVal]._childAnimateTimer = 0;
_mc[childName + returnVal]._looping = false;
_mc[childName + returnVal]._isSelectable = isSelectable & 127;
_mc[childName + returnVal]._selectOnKeyDown = isSelectable >> 7;
_mc[childName + returnVal]._returnVal = returnVal;
_mc[childName + returnVal]._currentChildFrame = 0;
_mc[childName + returnVal]._upperLeftX = upperLeftX;
_mc[childName + returnVal]._upperLeftY = upperLeftY;
_mc[childName + returnVal]._w = w;
_mc[childName + returnVal]._h = h;
_mc[childName + returnVal].gotoAndStop(_mc[childName]._startChildFrame);
}
function changeChild(oldChildName, newChildName) {
var _local3 = _mc[oldChildName].getDepth();
var _local5 = _mc[oldChildName]._x;
var _local4 = _mc[oldChildName]._y;
_mc[oldChildName].removeMovieClip();
_mc[oldChildName] = _mc.attachMovie(newChildName, newChildName + _local3, _local3);
_mc[oldChildName]._visible = true;
_mc[oldChildName]._x = _local5;
_mc[oldChildName]._y = _local4;
}
function addChild(childName, upperLeftX, upperLeftY, w, h, isSelectable, returnVal) {
_children.push(childName);
_mc[childName]._animiateChild = false;
_mc[childName]._lastChildFrame = 0;
_mc[childName]._startChildFrame = 1;
_mc[childName]._endChildFrame = 1;
_mc[childName]._childFramerate = 60;
_mc[childName]._childAnimateTimer = 0;
_mc[childName]._looping = false;
_mc[childName]._isSelectable = isSelectable & 127;
_mc[childName]._selectOnKeyDown = isSelectable >> 7;
_mc[childName]._returnVal = returnVal;
_mc[childName]._currentChildFrame = 0;
_mc[childName]._upperLeftX = upperLeftX;
_mc[childName]._upperLeftY = upperLeftY;
_mc[childName]._w = w;
_mc[childName]._h = h;
_mc[childName]._animateIncrement = 1;
_mc[childName].gotoAndStop(_mc[childName]._startChildFrame);
}
function getMovieClip() {
return(_mc);
}
function getType() {
return(_entityType);
}
function setZDepth(depth) {
_mc.swapDepths(depth);
}
function getZDepth() {
return(_mc.getDepth());
}
function moveToFrame(frame) {
_mc.gotoAndStop(frame);
_lastFrame = frame;
}
function getCurrentFrame() {
return(_mc._currentframe);
}
function setPosition(x, y) {
_mc._x = x;
_mc._y = y;
}
function setPositionX(x) {
_mc._x = x;
}
function setPositionY(y) {
_mc._y = y;
}
function setPositionXY(x, y) {
setPositionX(x);
setPositionY(y);
}
function movePositionXY(x, y) {
setPositionX(_mc._x + x);
setPositionY(_mc._y + y);
}
function setVisibility(vis) {
_mc._visible = vis;
}
function getVisibility(Void) {
return(_mc._visible);
}
function setRotation(angle) {
_mc._rotation = angle;
}
function setFaceDir(num) {
_faceDir = num;
}
function getFaceDir() {
return(_faceDir);
}
function setFlipped() {
_flipped = (_flipped ? false : true);
_mc._xscale = _mc._xscale * -1;
}
function isFlipped() {
return(_flipped);
}
function playFlipped() {
if (_flipped) {
return(undefined);
}
_flipped = true;
_mc._xscale = _mc._xscale * -1;
}
function playUnflipped() {
if (_flipped) {
_mc._xscale = _mc._xscale * -1;
}
_flipped = false;
}
function changeSprite(spName, clName) {
var _local4 = _mc.getDepth();
var _local3 = _mc._x;
var _local2 = _mc._y;
_mc.removeMovieClip();
_spName = spName;
_clName = clName;
_mc = _gameContext.getParent().attachMovie(spName, clName, _local4);
_mc._visible = true;
_mc._x = _local3;
_mc._y = _local2;
}
function startAnimating(startFrame, endFrame, framerate, loopAnim, fromFrame) {
_c = startFrame;
_startFrame = startFrame;
_endFrame = endFrame;
_framerate = 1 / framerate;
_loopAnim = loopAnim;
_animate = true;
_animateTimer = _framerate;
if (fromFrame != undefined) {
moveToFrame(fromFrame);
} else {
moveToFrame(startFrame);
}
}
function getStartFrame() {
return(_startFrame);
}
function animateSprite() {
_animateTimer = _animateTimer - _gameContext.getDT();
if (_animateTimer <= 0) {
_animateTimer = _framerate;
if (_startFrame <= _endFrame) {
_c++;
if (_c > _endFrame) {
if (_loopAnim) {
_c = _startFrame;
} else {
doneAnimating();
_c = _endFrame;
return(1);
}
}
} else {
_c--;
if (_c < _endFrame) {
if (_loopAnim) {
_c = _startFrame;
} else {
doneAnimating();
_c = _endFrame;
return(1);
}
}
}
moveToFrame(_c);
}
return(0);
}
function isAnimating() {
return(_animate);
}
function doneAnimating() {
_animate = false;
}
function startAnimatingChild(child, startFrame, endFrame, framerate, looping, fromFrame) {
_mc[child]._startChildFrame = startFrame;
_mc[child]._endChildFrame = endFrame;
_mc[child]._childFramerate = framerate;
_mc[child]._childAnimateTimer = 0;
_mc[child]._looping = looping;
if (fromFrame != undefined) {
_mc[child]._currentChildFrame = fromFrame;
} else {
_mc[child]._currentChildFrame = startFrame;
}
_mc[child]._animateChild = true;
_mc[child]._childAnimateTimer = 1 / _mc[child]._childFramerate;
_mc[child].gotoAndStop(_mc[child]._currentChildFrame);
}
function setChildAnimateIncrement(child, num) {
_mc[child]._animateIncrement = num;
}
function animateChild(child) {
if (!_mc[child]._animateChild) {
return(undefined);
}
if (_mc[child]._childFramerate == 0) {
return(undefined);
}
_mc[child]._childAnimateTimer = _mc[child]._childAnimateTimer - _gameContext.getDT();
if (_mc[child]._childAnimateTimer <= 0) {
_mc[child]._childAnimateTimer = 1 / _mc[child]._childFramerate;
if (_mc[child]._startChildFrame < _mc[child]._endChildFrame) {
_mc[child]._currentChildFrame = _mc[child]._currentChildFrame + _mc[child]._animateIncrement;
if (_mc[child]._currentChildFrame > _mc[child]._endChildFrame) {
if (_mc[child]._looping) {
_mc[child]._currentChildFrame = _mc[child]._startChildFrame + (_mc[child]._currentChildFrame - _mc[child]._endChildFrame);
} else {
childDoneAnimating(child);
_mc[child]._currentChildFrame = _mc[child]._endChildFrame;
}
}
} else {
_mc[child]._currentChildFrame--;
if (_mc[child]._currentChildFrame < _mc[child]._endChildFrame) {
if (_mc[child]._looping) {
_mc[child]._currentChildFrame = _mc[child]._startChildFrame;
} else {
childDoneAnimating(child);
_mc[child]._currentChildFrame = _mc[child]._endChildFrame;
}
}
}
_mc[child].gotoAndStop(_mc[child]._currentChildFrame);
}
}
function isMouseOverChild(child) {
if (_mc[child]._visible == false) {
return(false);
}
var _local4 = (_mc._x + _mc[child]._x) + _mc[child]._upperLeftX;
var _local6 = _local4 + _mc[child]._w;
var _local3 = (_mc._y + _mc[child]._y) + _mc[child]._upperLeftY;
var _local5 = _local3 + _mc[child]._h;
if ((((_gameContext.getPadManager().getMousePosX() < _local4) || (_gameContext.getPadManager().getMousePosX() > _local6)) || (_gameContext.getPadManager().getMousePosY() < _local3)) || (_gameContext.getPadManager().getMousePosY() > _local5)) {
return(false);
}
return(true);
}
function isBufferMouseOverChild(child) {
return(true);
}
function handCursor(child, use) {
_mc[child].useHandCursor = use;
}
function getNumChildren() {
return(_children.length);
}
function getChildName(idx) {
return(_children[idx]);
}
function getChild(child) {
return(_mc[child]);
}
function getChildMouseIsOver() {
var _local3 = _children.length;
var _local2 = 0;
while (_local2 < _local3) {
if (isMouseOverChild(_children[_local2])) {
return(_children[_local2]);
}
_local2++;
}
return(null);
}
function getChildCurrentAnimFrame(child) {
return(_mc[child]._currentChildFrame);
}
function getChildStartFrame(child) {
return(_mc[child]._startChildFrame);
}
function getChildEndFrame(child) {
return(_mc[child]._endChildFrame);
}
function setChildFramerate(child, rate) {
_mc[child]._childFramerate = rate;
}
function getChildFramerate(child) {
return(_mc[child]._childFramerate);
}
function getChildLooping(child) {
return(_mc[child]._looping);
}
function getChildSelectable(child) {
return(_mc[child]._isSelectable);
}
function getChildSelectOnKeyDown(child) {
return(_mc[child]._selectOnKeyDown);
}
function getChildReturnVal(child) {
return(_mc[child]._returnVal);
}
function childDoneAnimating(child) {
_mc[child]._animateChild = false;
}
function isChildAnimating(child) {
return(_mc[child]._animateChild);
}
function moveChildToFrame(child, frame) {
_mc[child].gotoAndStop(frame);
}
function getID() {
return(_id);
}
function getGameContext() {
return(_gameContext);
}
function getPositionX() {
return(_mc._x);
}
function getPositionY() {
return(_mc._y);
}
function getArea() {
return(_clipWidth * _clipHeight);
}
function setWidth(w) {
_clipWidth = w;
}
function getWidth() {
return(_clipWidth);
}
function getHeight() {
return(_clipHeight);
}
function getClipName() {
return(_clName);
}
function isVisible() {
return(_mc._visible);
}
function scaleSprite(scale) {
_mc._xscale = _mc._xscale * scale;
_mc._yscale = _mc._yscale * scale;
}
function removeSprite() {
_mc.removeMovieClip();
}
function isMouseRollOn() {
return(_mouseRollOn);
}
function isMouseRollOff() {
return(_mouseRollOff);
}
function isMouseOver(offsetX, offsetY) {
var _local6 = false;
if (offsetX == undefined) {
offsetX = 0;
}
if (offsetY == undefined) {
offsetY = 0;
}
if (_mouseIsOver) {
_mouseRollOn = false;
_local6 = true;
} else {
_mouseRollOn = true;
}
_mouseRollOff = false;
_mouseIsOver = false;
if (_mc._visible == false) {
return(false);
}
var _local4 = _mc._x - (_clipWidth / 2);
var _local5 = _mc._x + (_clipWidth / 2);
var _local2 = _mc._y - _clipHeight;
var _local3 = _mc._y;
if (_centerPoint == 1) {
_local2 = _mc._y - (_clipHeight / 2);
_local3 = _mc._y + (_clipHeight / 2);
}
if (_centerPoint == 2) {
_local4 = _mc._x;
_local5 = _mc._x + _clipWidth;
_local2 = _mc._y;
_local3 = _mc._y + _clipHeight;
}
if (_centerPoint == 3) {
_local4 = _mc.x - _clipWidth;
_local5 = _mc.x;
_local2 = _mc._y - (_clipHeight / 2);
_local3 = _mc._y + (_clipHeight / 2);
}
if (_centerPoint == 4) {
_local4 = _mc._x + 10;
_local5 = _mc._x + 40;
_local2 = _mc._y - 35;
_local3 = _mc._y + 35;
}
if (((((_gameContext.getPadManager().getMousePosX() + offsetX) < _local4) || ((_gameContext.getPadManager().getMousePosX() + offsetX) > _local5)) || ((_gameContext.getPadManager().getMousePosY() + offsetY) < _local2)) || ((_gameContext.getPadManager().getMousePosY() + offsetY) > _local3)) {
if (_local6) {
_mouseRollOff = true;
}
return(false);
}
_mouseIsOver = true;
return(true);
}
function getLeftX() {
var _local2 = _mc._x - (_clipWidth / 2);
if (_centerPoint == 2) {
_local2 = _mc._x;
}
if (_centerPoint == 3) {
_local2 = _mc.x - _clipWidth;
}
if (_centerPoint == 4) {
_local2 = _mc._x + 10;
}
_local2 = _local2 + _collideOffsetX;
return(_local2);
}
function getUpperY() {
var _local2 = _mc._y - _clipHeight;
if (_centerPoint == 1) {
_local2 = _mc._y - (_clipHeight / 2);
}
if (_centerPoint == 2) {
_local2 = _mc._y;
}
if (_centerPoint == 3) {
_local2 = _mc._y - (_clipHeight / 2);
}
if (_centerPoint == 4) {
_local2 = _mc._y - 35;
}
_local2 = _local2 + _collideOffsetY;
return(_local2);
}
function getRightX() {
var _local2 = _mc._x + (_clipWidth / 2);
if (_centerPoint == 2) {
_local2 = _mc._x + _clipWidth;
}
if (_centerPoint == 3) {
_local2 = _mc.x;
}
if (_centerPoint == 4) {
_local2 = _mc._x + 40;
}
return(_local2);
}
function getLowerY() {
var _local2 = _mc._y;
if (_centerPoint == 1) {
_local2 = _mc._y + (_clipHeight / 2);
}
if (_centerPoint == 2) {
_local2 = _mc._y + _clipHeight;
}
if (_centerPoint == 3) {
_local2 = _mc._y + (_clipHeight / 2);
}
if (_centerPoint == 4) {
_local2 = _mc._y + 35;
}
return(_local2);
}
function amCollidingWithStaticRectangle() {
var _local4 = _mc._x - (_clipWidth / 2);
var _local5 = _mc._x + (_clipWidth / 2);
var _local2 = _mc._y - _clipHeight;
var _local3 = _mc._y;
if (_centerPoint == 1) {
_local2 = _mc._y - (_clipHeight / 2);
_local3 = _mc._y + (_clipHeight / 2);
}
if (_centerPoint == 2) {
_local4 = _mc._x;
_local5 = _mc._x + _clipWidth;
_local2 = _mc._y;
_local3 = _mc._y + _clipHeight;
}
if (_centerPoint == 3) {
_local4 = _mc.x - _clipWidth;
_local5 = _mc.x;
_local2 = _mc._y - (_clipHeight / 2);
_local3 = _mc._y + (_clipHeight / 2);
}
if (_centerPoint == 4) {
_local4 = _mc._x + 10;
_local5 = _mc._x + 40;
_local2 = _mc._y - 35;
_local3 = _mc._y + 35;
}
return(false);
}
function drawDebugLines() {
var _local3 = -(_clipWidth / 2);
var _local2 = -_clipHeight;
var _local5 = _clipWidth / 2;
var _local4 = 0;
if (_centerPoint == 1) {
_local2 = -(_clipHeight / 2);
_local4 = _clipHeight / 2;
}
if (_centerPoint == 2) {
_local3 = 0;
_local2 = 0;
_local5 = _clipWidth;
_local4 = _clipHeight;
}
if (_centerPoint == 3) {
_local3 = -_clipWidth;
_local2 = -(_clipHeight / 2);
}
if (_centerPoint == 4) {
}
_mc.lines.clear();
_mc.lines.lineStyle(1, 16711935, 100);
_mc.lines.moveTo(_local3 + _collideOffsetX, _local2 + _collideOffsetY);
_mc.lines.lineTo(_local5 - _collideOffsetX, _local2 + _collideOffsetY);
_mc.lines.lineTo(_local5 - _collideOffsetX, _local4);
_mc.lines.lineTo(_local3 + _collideOffsetX, _local4);
_mc.lines.lineTo(_local3 + _collideOffsetX, _local2 + _collideOffsetY);
}
function drawAsSelected() {
var _local3 = -(_clipWidth / 2);
var _local2 = -_clipHeight;
var _local5 = _clipWidth / 2;
var _local4 = 0;
if (_centerPoint == 1) {
_local2 = -(_clipHeight / 2);
_local4 = _clipHeight / 2;
}
if (_centerPoint == 2) {
_local3 = 0;
_local2 = 0;
_local5 = _clipWidth;
_local4 = _clipHeight;
}
if (_centerPoint == 3) {
_local3 = -_clipWidth;
_local2 = -(_clipHeight / 2);
}
if (_centerPoint == 4) {
}
_mc.clear();
_mc.blendMode = "multiply";
_mc.beginFill(8355711, 100);
_mc.moveTo(_local3, _local2);
_mc.lineTo(_local5, _local2);
_mc.lineTo(_local5, _local4);
_mc.lineTo(_local3, _local4);
_mc.lineTo(_local3, _local2);
_mc.endFill();
}
function drawAsUnselected() {
_mc.clear();
_mc.blendMode = "normal";
}
var test = [];
}
Symbol 309 MovieClip [__Packages.Pad.PadManager] Frame 0
class Pad.PadManager
{
var _padData, _lastKeyPressed, _lastKeyReleaseTime, _keyTargeting, _mouseData, _keyTarget;
function PadManager () {
_padData = new Array();
_lastKeyPressed = 0;
_lastKeyReleaseTime = 0;
_keyTargeting = false;
_mouseData = new Object();
_mouseData.mouseJustPressed = false;
_mouseData.mouseStillPressed = false;
_mouseData.mouseReleased = false;
_mouseData.mouseTimePressed = 0;
_mouseData.mousePressedPosX = 0;
_mouseData.mousePressedPosY = 0;
_mouseData.mousePosX = 0;
_mouseData.mousePosY = 0;
Init();
}
function getPadData() {
return(_padData);
}
function getPadDataLength() {
return(_padData.length);
}
function getKeyJustPressed(id) {
return(_padData[id].keyPressed);
}
function getKeyStillPressed(id) {
return(_padData[id].keyStillPressed);
}
function getCtrlDown() {
if (Key.isDown(17)) {
return(true);
}
return(false);
}
function getShiftDown() {
if (Key.isDown(16)) {
return(true);
}
return(false);
}
function getCurrentKeyAction(Void) {
var _local2 = 0;
while (_local2 < _padData.length) {
if (_padData[_local2].keyPressed) {
return(_padData[_local2].keyAction);
}
_local2++;
}
return("");
}
function getCurrentKeyActionHeld(Void) {
var _local2 = 0;
while (_local2 < _padData.length) {
if (_padData[_local2].keyStillPressed) {
return(_padData[_local2].keyAction);
}
_local2++;
}
return("");
}
function getCurrentKeyActionUp(Void) {
var _local2 = 0;
while (_local2 < _padData.length) {
if (_padData[_local2].keyReleased) {
return(_padData[_local2].keyAction);
}
_local2++;
}
return("");
}
function getTimeKeyActionHeld(Void) {
var _local2 = 0;
while (_local2 < _padData.length) {
if (_padData[_local2].keyStillPressed) {
return(_padData[_local2].timePressed);
}
_local2++;
}
return(0);
}
function getKeyActionHeld(sAction) {
var _local2 = 0;
while (_local2 < _padData.length) {
if ((_padData[_local2].keyAction == sAction) && (_padData[_local2].keyStillPressed)) {
return(true);
}
_local2++;
}
return(false);
}
function getKeyDoubleTapped(sAction) {
var _local2 = 0;
while (_local2 < _padData.length) {
if ((_padData[_local2].keyAction == sAction) && (_padData[_local2].doubleTapped)) {
return(true);
}
_local2++;
}
return(false);
}
function getMouseJustPressed() {
return(_mouseData.mouseJustPressed);
}
function getMouseStillPressed() {
return(_mouseData.mouseStillPressed);
}
function getMouseReleased() {
return(_mouseData.mouseReleased);
}
function getMouseTimePressed() {
return(_mouseData.mouseTimePressed);
}
function getMousePressedPosX() {
return(_mouseData.mousePressedPosX);
}
function getMousePressedPosY() {
return(_mouseData.mousePressedPosY);
}
function getMousePosX() {
return(_mouseData.mousePosX);
}
function getMousePosY() {
return(_mouseData.mousePosY);
}
function Init() {
mouseListener.onMouseDown = function () {
_global.handleMousePress = true;
return(undefined);
};
mouseListener.onMouseUp = function () {
_global.handleMouseRelease = true;
return(undefined);
};
mouseListener.onMouseMove = null;
Mouse.addListener(mouseListener);
setKeyControls(_controls);
return(undefined);
}
function clearKeyControls() {
_padData = [];
}
function setKeyControls(oControls) {
var _local2 = 0;
while (_local2 < oControls.length) {
_padData.push({keyID:oControls[_local2].keyID, keyAction:oControls[_local2].keyAction, keyPressed:false, keyReleased:false, keyStillPressed:false, timePressed:0, doubleTapped:false});
_local2++;
}
}
function setKeyTarget(oTarget) {
_keyTargeting = true;
_keyTarget = oTarget;
}
function getKeyTarget(oTarget) {
return(_keyTarget);
}
function removeKeyTarget() {
_keyTargeting = false;
_keyTarget = null;
}
function Update(gameContext) {
if (_mouseData.mouseReleased) {
_mouseData.mouseReleased = false;
}
if (_global.handleMouseRelease) {
_global.handleMouseRelease = false;
_mouseData.mouseJustPressed = false;
_mouseData.mouseStillPressed = false;
_mouseData.mouseReleased = true;
} else {
if (_mouseData.mouseJustPressed) {
_mouseData.mouseJustPressed = false;
_mouseData.mouseReleased = false;
_mouseData.mouseStillPressed = true;
}
if (_mouseData.mouseStillPressed) {
_mouseData.mouseTimePressed = _mouseData.mouseTimePressed + gameContext.getDT();
}
}
if (_global.handleMousePress) {
_global.handleMousePress = false;
_mouseData.mouseJustPressed = true;
_mouseData.mousePressedPosX = _root._xmouse;
_mouseData.mousePressedPosY = _root._ymouse;
_mouseData.mouseReleased = false;
_mouseData.mouseStillPressed = false;
_mouseData.mouseTimePressed = 0;
}
_mouseData.mousePosX = _root._xmouse;
_mouseData.mousePosY = _root._ymouse;
var _local6 = Key.getCode();
var _local4 = 0;
while (_local4 < _padData.length) {
if (Key.isDown(_padData[_local4].keyID)) {
if ((!_padData[_local4].keyPressed) && (!_padData[_local4].keyStillPressed)) {
if (_padData[_local4].keyID == _lastKeyPressed) {
if ((gameContext.getTimeManager().getCurTime() - _lastKeyReleaseTime) < 0.18) {
_padData[_local4].doubleTapped = true;
}
}
_padData[_local4].keyPressed = true;
_padData[_local4].keyStillPressed = false;
_padData[_local4].keyReleased = false;
_padData[_local4].timePressed = 0;
if (_keyTargeting) {
_keyTarget.parseKeyAction(_padData[_local4].keyAction, "KEYDOWN", false);
}
} else if (_padData[_local4].keyPressed || (_padData[_local4].keyStillPressed)) {
_padData[_local4].keyPressed = false;
_padData[_local4].keyStillPressed = true;
_padData[_local4].keyReleased = false;
_padData[_local4].timePressed = _padData[_local4].timePressed + gameContext.getDT();
if (_keyTargeting) {
_keyTarget.parseKeyAction(_padData[_local4].keyAction, "KEYHELD", false);
}
}
} else if (_padData[_local4].keyStillPressed || (_padData[_local4].keyPressed)) {
_padData[_local4].keyPressed = false;
_padData[_local4].keyStillPressed = false;
_padData[_local4].keyReleased = true;
_padData[_local4].doubleTapped = false;
_lastKeyPressed = _padData[_local4].keyID;
_lastKeyReleaseTime = gameContext.getTimeManager().getCurTime();
if (_keyTargeting) {
_keyTarget.parseKeyAction(_padData[_local4].keyAction, "KEYUP", false);
}
}
_local4++;
}
return(undefined);
}
function toString(Void) {
return("PadManager()");
}
var mouseListener = new Object();
var _controls = [{keyAction:"a", keyID:65}, {keyAction:"b", keyID:66}, {keyAction:"c", keyID:67}, {keyAction:"d", keyID:68}, {keyAction:"e", keyID:69}, {keyAction:"f", keyID:70}, {keyAction:"g", keyID:71}, {keyAction:"h", keyID:72}, {keyAction:"i", keyID:73}, {keyAction:"j", keyID:74}, {keyAction:"k", keyID:75}, {keyAction:"l", keyID:76}, {keyAction:"m", keyID:77}, {keyAction:"o", keyID:78}, {keyAction:"p", keyID:79}, {keyAction:"q", keyID:80}, {keyAction:"r", keyID:81}, {keyAction:"s", keyID:82}, {keyAction:"t", keyID:83}, {keyAction:"u", keyID:84}, {keyAction:"v", keyID:85}, {keyAction:"w", keyID:86}, {keyAction:"x", keyID:87}, {keyAction:"y", keyID:88}, {keyAction:"z", keyID:89}, {keyAction:"upArrow", keyID:38}, {keyAction:"downArrow", keyID:40}, {keyAction:"leftArrow", keyID:37}, {keyAction:"rightArrow", keyID:39}];
}
Symbol 310 MovieClip [__Packages.Base.SoundModule] Frame 0
class Base.SoundModule
{
var _mc, _hash, _num, _active_sounds, _fade_interval, _music_mute, _defaultVol, _musicOff, _curr_music, _fade_interval2;
function SoundModule (mc) {
_mc = mc;
_hash = {};
_num = 0;
_active_sounds = [];
_fade_interval = null;
_music_mute = _global.MUSIC_MUTE;
_defaultVol = 150;
_musicOff = false;
}
function SoundAvailable() {
return(_active_sounds.length < 16);
}
function LoadSound(sound_name) {
_num++;
var _local3 = "mySound" + _num;
_mc.createEmptyMovieClip(_local3, _num);
var _local2 = new Sound(_mc[_local3]);
_local2.parent = this;
_local2.lastStart = 0;
_local2.onSoundComplete = function () {
this.parent.DeactivateSound(sound_name);
};
_hash[sound_name] = _local2;
return(_local2);
}
function createSoundInstance(sound_instance, ownerID) {
var snd_Name = ((sound_instance + "_") + ownerID);
_num++;
var _local3 = "mySound" + _num;
_mc.createEmptyMovieClip(_local3, _num);
var _local2 = new Sound(_mc[_local3]);
_local2.parent = this;
_local2.lastStart = 0;
_local2.onSoundComplete = function () {
this.parent.DeactivateSound(snd_Name);
};
_hash[snd_Name] = _local2;
_local2.attachSound(sound_instance);
return(snd_Name);
}
function SetMusicMute(oBool) {
_music_mute = oBool;
if (_music_mute == true) {
StopMusic();
} else {
PlayMusic(_curr_music);
}
}
function GetMusicMute() {
return(_music_mute);
}
function StopMusic() {
var _local2 = _active_sounds.length;
while (_local2--) {
if (_active_sounds[_local2].indexOf("music") != -1) {
StopSound(_active_sounds[_local2]);
break;
}
}
_curr_music = "none";
}
function StopAllSounds() {
var _local2 = _active_sounds.length;
while (_local2--) {
if (_active_sounds[_local2].indexOf("music") == -1) {
StopSound(_active_sounds[_local2]);
}
}
}
function isPlayingPrefix(str) {
var _local2 = _active_sounds.length;
while (_local2--) {
if (_active_sounds[_local2].indexOf(str) != -1) {
return(true);
}
}
return(false);
}
function AdjustMusicVolume(vol) {
if (_curr_music == "none") {
return(undefined);
}
var _local2 = "music_" + _curr_music;
_hash[_local2].setVolume(vol);
}
function GetCurMusic(Void) {
return(_curr_music);
}
function getMusicOff() {
return(_musicOff);
}
function setMusicOff(toSet) {
_musicOff = toSet;
}
function PlayMusic(str, useCurrentVolume) {
if (_musicOff) {
return(undefined);
}
if (str == _curr_music) {
return(undefined);
}
if (str == "none") {
FadeSound("music_" + _curr_music, _global.MUSIC_VOL, 0, 0.5);
} else {
CrossFade("music_" + _curr_music, "music_" + str, 0.5, useCurrentVolume);
_curr_music = str;
}
}
function DeactivateSound(snd) {
var _local2 = _active_sounds.length;
while (_local2--) {
if (snd == _active_sounds[_local2]) {
_active_sounds.splice(_local2, 1);
break;
}
}
}
function DeactivateAllSounds() {
_active_sounds = [];
}
function StopSound(snd) {
var _local2 = _hash[snd];
_local2.stop();
DeactivateSound(snd);
}
function soundIsPlaying(snd) {
for (var _local2 in _active_sounds) {
if (_active_sounds[_local2] == snd) {
return(true);
}
}
return(false);
}
function PlaySound(snd, vol, pan, offset, loop, force) {
if ((snd.indexOf("music") != -1) && (_music_mute == true)) {
return(undefined);
}
for (var _local3 in _active_sounds) {
if (_active_sounds[_local3] == snd) {
if (((snd != "sectionComplete") && (snd != "btn1")) && (snd != "sectionLightup")) {
if (force == undefined) {
return(undefined);
}
}
}
}
if (SoundAvailable()) {
var _local4 = _hash[snd];
if (vol == null) {
_local4.setVolume(_defaultVol);
} else {
_local4.setVolume(vol);
}
if (pan != null) {
_local4.setPan(pan);
}
if (offset == null) {
offset = 0;
}
if (loop == null) {
loop = 0;
}
_local4.start(offset, loop);
_active_sounds.push(snd);
}
}
function CrossFade(snd1, snd2, dur, useCurrentVolume) {
var _local3 = _global.MUSIC_VOL;
if (useCurrentVolume != undefined) {
_local3 = _hash[snd1].getVolume();
}
FadeSound(snd1, _local3, 0, dur);
PlaySound(snd2, 0, 0, 0, 9999);
FadeSound2(snd2, 0, _local3, dur);
}
function FadeSound(snd, startVol, endVol, duration) {
if (_fade_interval != null) {
clearInterval(_fade_interval);
}
_hash[snd].setVolume(startVol);
var _local2 = 1;
if (endVol < startVol) {
_local2 = -1;
}
var _local5 = (duration / Math.abs(endVol - startVol)) * 1000;
_fade_interval = setInterval(this, "Fade_Sound_Update", _local5, [snd, endVol, _local2]);
}
function FadeSound2(snd, startVol, endVol, duration) {
if (_fade_interval2 != null) {
clearInterval(_fade_interval2);
}
_hash[snd].setVolume(startVol);
var _local2 = 1;
if (endVol < startVol) {
_local2 = -1;
}
var _local5 = (duration / Math.abs(endVol - startVol)) * 1000;
_fade_interval2 = setInterval(this, "Fade_Sound_Update2", _local5, [snd, endVol, _local2]);
}
function Fade_Sound_Update(sndAr) {
var _local3 = sndAr[0];
var _local5 = sndAr[1];
var _local4 = sndAr[2];
var _local2 = _hash[_local3].getVolume() + _local4;
if (((_local4 > 0) && (_local2 <= _local5)) || ((_local4 < 0) && (_local2 >= _local5))) {
_hash[_local3].setVolume(_local2);
if (_local2 <= 0) {
StopSound(_local3);
}
} else {
clearInterval(_fade_interval);
}
}
function Fade_Sound_Update2(sndAr) {
var _local3 = sndAr[0];
var _local5 = sndAr[1];
var _local4 = sndAr[2];
var _local2 = _hash[_local3].getVolume() + _local4;
if (((_local4 > 0) && (_local2 <= _local5)) || ((_local4 < 0) && (_local2 >= _local5))) {
_hash[_local3].setVolume(_local2);
if (_local2 <= 0) {
StopSound(_local3);
}
} else {
clearInterval(_fade_interval2);
}
}
function getSound(snd) {
return(_hash[snd]);
}
function toString() {
return("SoundModule()");
}
function unload() {
for (var _local3 in _hash) {
delete _hash[_local3];
}
var _local2 = 0;
while (_local2 < _num) {
_mc["mySound" + _num].removeMovieClip();
_local2++;
}
delete _hash;
}
static var MAX_SOUNDS = 16;
}
Symbol 311 MovieClip [__Packages.Game.GameManager] Frame 0
class Game.GameManager
{
var _currentGameState, _nextGameState, _followingGameState;
function GameManager (parentMC) {
_currentGameState = null;
setNextState(Game.GameStates.G_TitleCard);
}
function setNextState(state) {
_nextGameState = new state[undefined]();
}
function setFollowingGameState(state) {
_followingGameState = state;
}
function getFollowingGameState() {
return(_followingGameState);
}
function Update(gameContext) {
if (_nextGameState.isTransitioning()) {
return(undefined);
}
if (_currentGameState != _nextGameState) {
_currentGameState = _nextGameState;
_currentGameState.Entry(gameContext);
} else if (_currentGameState == _nextGameState) {
_currentGameState.PadInput(gameContext);
_currentGameState.Update(gameContext);
if (_currentGameState != _nextGameState) {
_currentGameState.Exit(gameContext);
delete _currentGameState;
if (!_nextGameState) {
}
}
}
}
}
Symbol 312 MovieClip [__Packages.Base.State] Frame 0
class Base.State
{
function State () {
}
function CPUDecision(gameContext) {
return(undefined);
}
function NetworkDecision(gameContext) {
return(undefined);
}
function PadInput(gameContext) {
return(undefined);
}
function Entry(gameContext) {
return(undefined);
}
function Update(gameContext) {
return(undefined);
}
function Exit(gameContext) {
return(undefined);
}
}
Symbol 313 MovieClip [__Packages.Base.GameState] Frame 0
class Base.GameState extends Base.State
{
static var _transition, _lastTransitionFrame, _screenFade, _fadeSpeed, _levelToReach, _currentAlphaVal, _isFading;
function GameState () {
super();
}
function CPUDecision(gameContext) {
return(undefined);
}
function NetworkDecision(gameContext) {
return(undefined);
}
function PadInput(gameContext) {
return(undefined);
}
function Entry(gameContext) {
return(undefined);
}
function Update(gameContext) {
return(undefined);
}
function Exit(gameContext) {
return(undefined);
}
function startScreenTransition(gameContext, spriteName, startFrame, endFrame, frameRate, depth) {
_transition = new Base.SpriteEntity(gameContext, 5, 100, spriteName, spriteName, depth, 0, 2, -1, -1);
_transition.startAnimating(startFrame, endFrame, frameRate, false);
}
function getTransitionFrame() {
if (_transition) {
return(_transition.getCurrentFrame());
}
return(_lastTransitionFrame);
}
function isTransitioning() {
if (_transition) {
if (_transition.isAnimating()) {
_transition.animateSprite();
return(true);
}
_lastTransitionFrame = _transition.getCurrentFrame();
_transition.removeSprite();
delete _transition;
}
return(false);
}
function startFadeOut(gameContext, spriteName, clipName, depth, fadeSpeed, level) {
_screenFade = new Base.SpriteEntity(gameContext, 5, 100, spriteName, clipName, depth, 0, 0, 2, -1, -1);
_fadeSpeed = fadeSpeed;
_levelToReach = level;
_currentAlphaVal = 0;
_isFading = true;
_screenFade.getMovieClip()._alpha = _currentAlphaVal;
}
function handleFadeOut() {
if (_isFading) {
_currentAlphaVal = _currentAlphaVal + _fadeSpeed;
if (_currentAlphaVal >= _levelToReach) {
_currentAlphaVal = _levelToReach;
_isFading = false;
}
_screenFade.getMovieClip()._alpha = _currentAlphaVal;
}
}
function continueFadeOut(fadeSpeed, level) {
_isFading = true;
_levelToReach = level;
}
function startFadeIn(fadeSpeed) {
_isFading = true;
_levelToReach = 0;
_fadeSpeed = fadeSpeed;
}
function handleFadeIn() {
_currentAlphaVal = _currentAlphaVal - _fadeSpeed;
if (_currentAlphaVal <= _levelToReach) {
_currentAlphaVal = _levelToReach;
_isFading = false;
_screenFade.removeSprite();
delete _screenFade;
}
_screenFade.getMovieClip()._alpha = _currentAlphaVal;
}
function isFading() {
return(_isFading);
}
function setFadeDepth(depth) {
_screenFade.setZDepth(depth);
}
}
Symbol 314 MovieClip [__Packages.Game.GameStates.G_TitleCard] Frame 0
class Game.GameStates.G_TitleCard extends Base.GameState
{
var _stage, _screenFrameNum, _animationRate, _animationTimer, _state;
function G_TitleCard () {
super();
}
function Entry(gameContext) {
gameContext.getUIManager().showScreen(gameContext.getGameData().getScreen(0), 1);
_stage = SCREEN_SLIDING_ON;
_screenFrameNum = 25;
_animationRate = 0.0333333333333333;
_animationTimer = _animationRate;
gameContext.getGameData().getSoundModule().PlaySound("cheese_wee1", 100, 0, 0, false, 1);
_state = new Function(moveWeeOn);
}
function Update(gameContext) {
_state(gameContext);
}
function Exit(gameContext) {
}
function moveWeeOn(gameContext) {
_animationTimer = _animationTimer - gameContext.getDT();
if (_animationTimer <= 0) {
gameContext.getUIManager().moveScreenToFrame(_screenFrameNum);
_animationTimer = _animationRate;
_screenFrameNum++;
if (_screenFrameNum == 56) {
gameContext.getUIManager().getScreen().addChild("btn_start", 0, 0, 165, 72, 0, 1);
gameContext.getUIManager().getScreen().addChild("cheese", 0, 0, 414, 502, 0, 1);
gameContext.getUIManager().getScreen().moveChildToFrame("btn_start", 1);
gameContext.getUIManager().getScreen().moveChildToFrame("cheese", 1);
_stage++;
_state = screenIdle;
}
}
}
function screenIdle(gameContext) {
if (gameContext.getPadManager().getKeyActionHeld("a")) {
gameContext.getGameManager().setNextState(Game.GameStates.G_Instructions);
}
var _local3 = gameContext.getUIManager().getScreen().getChildCurrentAnimFrame("btn_start");
if (gameContext.getUIManager().getScreen().isMouseOverChild("btn_start")) {
if (_local3 == 1) {
gameContext.getUIManager().getScreen().startAnimatingChild("btn_start", 2, 11, 32, false);
}
if (gameContext.getPadManager().getMouseJustPressed()) {
_state = slideScreenOff;
}
} else if (!gameContext.getUIManager().getScreen().isChildAnimating()) {
if (_local3 != 1) {
gameContext.getUIManager().getScreen().startAnimatingChild("btn_start", _local3, 1, 32, false);
}
}
gameContext.getUIManager().getScreen().animateChild("btn_start");
}
function slideScreenOff(gameContext) {
gameContext.getGameManager().setNextState(Game.GameStates.G_Instructions);
}
static var SCREEN_SLIDING_ON = 0;
static var SCREEN_IDLING = 1;
static var SCREEN_SLIDING_OFF = 2;
}
Symbol 315 MovieClip [__Packages.Game.GameStates.G_Instructions] Frame 0
class Game.GameStates.G_Instructions extends Base.GameState
{
var _screenFrame, _introFrameRate, _introFrameTimer;
function G_Instructions () {
super();
}
function Entry(gameContext) {
gameContext.getUIManager().showScreen(gameContext.getGameData().getScreen(2), 1);
_screenFrame = 1;
_introFrameRate = 0.0333333333333333;
_introFrameTimer = _introFrameRate;
}
function Update(gameContext) {
gameContext.getGameData().animateInstructions();
_introFrameTimer = _introFrameTimer - gameContext.getDT();
if (_introFrameTimer <= 0) {
_screenFrame++;
_introFrameTimer = _introFrameRate;
gameContext.getUIManager().getScreen().moveToFrame(_screenFrame);
if (_screenFrame == 70) {
gameContext.getUIManager().getScreen().moveToFrame(97);
gameContext.getUIManager().getScreen().getMovieClip().cheese_car.gotoAndStop(10);
gameContext.getUIManager().getScreen().getMovieClip().bloo.gotoAndStop(79);
gameContext.getUIManager().getScreen().getMovieClip().mac.gotoAndStop(79);
gameContext.getUIManager().getScreen().addChild("hill", 0, 0, -1, -1, 0, 0);
gameContext.getUIManager().getScreen().startAnimatingChild("hill", 1, 500, 32, true);
gameContext.getUIManager().getScreen().setChildAnimateIncrement("hill", 5);
gameContext.getUIManager().getScreen().addChild("bushes", 0, 0, -1, -1, 0, 0);
gameContext.getUIManager().getScreen().startAnimatingChild("bushes", 1, 500, 32, true);
gameContext.getUIManager().getScreen().setChildAnimateIncrement("hill", 5);
gameContext.getUIManager().getScreen().addChild("trees", 0, 0, -1, -1, 0, 0);
gameContext.getUIManager().getScreen().startAnimatingChild("trees", 1, 500, 32, true, 70);
gameContext.getUIManager().getScreen().setChildAnimateIncrement("trees", 5);
gameContext.getUIManager().getScreen().addChild("sky", 0, 0, -1, -1, 0, 0);
gameContext.getUIManager().getScreen().startAnimatingChild("sky", 1, 44, 32, true, 26);
gameContext.getGameManager().setNextState(Game.GameStates.G_InPlay);
}
}
}
function Exit(gameContext) {
}
}
Symbol 316 MovieClip [__Packages.Game.GameStates.G_InPlay] Frame 0
class Game.GameStates.G_InPlay extends Base.GameState
{
var _gameContext, _cheeseAction, _cheeseStartFrame, _cheeseEndFrame, _cheeseFrame, _cheeseFramerate, _cheeseTimer, _cheeseStep, _action, _blooStartFrame, _blooEndFrame, _blooFramerate, _blooTimer, _blooCurrentFrame, _macStartFrame, _macEndFrame, _macFramerate, _macTimer, _macCurrentFrame, _previousAction, _cheeseAnimAction, _animatingQuitOver, _targetAnimateIncrement, _currentAnimateIncrement, _animateIncrementSpeed, _animateIncrementTimer, _currentFrameRate, _wheelTimer, _wheelCurrentFrame, _quitBtn;
function G_InPlay () {
super();
}
function Entry(gameContext) {
_gameContext = gameContext;
gameContext.getUIManager().setCursor(_screens[1]);
_cheeseAction = AM_CHASING_KART;
_cheeseStartFrame = 236;
_cheeseEndFrame = 302;
_cheeseFrame = 236;
_cheeseFramerate = 24;
_cheeseTimer = 1 / _cheeseFramerate;
_cheeseStep = amBreathingScared;
gameContext.getUIManager().getScreen().getMovieClip().cheese_car.cheese.gotoAndStop(_cheeseFrame);
gameContext.getGameData().getSoundModule().PlaySound("cheese_breathes", 100, 0, 0, false, 1);
_action = AM_CHASING_KART;
_blooStartFrame = 79;
_blooEndFrame = 89;
_blooFramerate = 30;
_blooTimer = 1 / _blooFramerate;
_blooCurrentFrame = _blooStartFrame;
_macStartFrame = 79;
_macEndFrame = 89;
_macFramerate = 30;
_macTimer = 1 / _macFramerate;
_macCurrentFrame = _macStartFrame;
_action = (_previousAction = AM_CHASING_KART);
_cheeseAction = AM_CHASING_KART;
_cheeseAnimAction = AM_CHASING_KART;
_animatingQuitOver = false;
gameContext.getGameData().showInstructions();
gameContext.getGameData().resetRemoveInstructions();
_targetAnimateIncrement = 20;
_currentAnimateIncrement = 5;
_animateIncrementSpeed = 2 / (_targetAnimateIncrement - _currentAnimateIncrement);
_animateIncrementTimer = _animateIncrementSpeed;
_currentFrameRate = 9.88;
_wheelTimer = 0;
_wheelCurrentFrame = 1;
if (gameContext.getGameData().getNumGameTimes() > 1) {
_quitBtn = new Base.SpriteEntity(gameContext, 1, 1, "overlay", "quit", 60002, 0, 0, 0, -1, -1);
_quitBtn.addChild("btn_quit", 41, 350, 54, 33, 129, 1);
gameContext.getGameData().shouldRemoveInstructions();
}
gameContext.getGameData().LoadTracking(0);
return(undefined);
}
function PadInput(gameContext) {
if (gameContext.getPadManager().getMouseJustPressed() || (gameContext.getPadManager().getMouseStillPressed())) {
if ((!gameContext.getGameData().instructionsAlreadyRemoved()) && (gameContext.getGameData().getNumGameTimes() == 1)) {
_quitBtn = new Base.SpriteEntity(gameContext, 1, 1, "overlay", "quit", 60002, 0, 0, 0, -1, -1);
_quitBtn.addChild("btn_quit", 41, 350, 54, 33, 129, 1);
}
gameContext.getGameData().shouldRemoveInstructions();
if ((_action != CONTINUE_HOLDING_KART) && (_action != AM_HOLDING_KART)) {
_action = SHOULD_HOLD_KART;
}
if (_quitBtn.isMouseOverChild("btn_quit")) {
gameContext.getGameManager().setNextState(Game.GameStates.G_DoItAgain);
_quitBtn.removeSprite();
delete _quitBtn;
}
return(undefined);
}
if (gameContext.getPadManager().getMouseReleased()) {
_cheeseAnimAction = SHOULD_RELEASE_KART;
}
if ((_action != CONTINUE_RELEASING_KART) && (_action != AM_CHASING_KART)) {
_action = SHOULD_RELEASE_KART;
}
if (gameContext.getGameData().instructionsAlreadyRemoved()) {
if (_quitBtn.isMouseOverChild("btn_quit")) {
if (!_animatingQuitOver) {
_animatingQuitOver = true;
_quitBtn.startAnimatingChild("btn_quit", _quitBtn.getChildCurrentAnimFrame("btn_quit"), 11, 32, false);
}
} else if (_animatingQuitOver) {
_animatingQuitOver = false;
_quitBtn.startAnimatingChild("btn_quit", _quitBtn.getChildCurrentAnimFrame("btn_quit"), 1, 32, false);
}
}
}
function handleWheels() {
_wheelTimer = _wheelTimer - _gameContext.getDT();
if (_wheelTimer <= 0) {
_wheelCurrentFrame++;
if (_wheelCurrentFrame > 31) {
_wheelCurrentFrame = 1;
}
_gameContext.getUIManager().getScreen().getMovieClip().cheese_car.wheel_back.gotoAndStop(_wheelCurrentFrame);
_gameContext.getUIManager().getScreen().getMovieClip().cheese_car.wheel_front.gotoAndStop(_wheelCurrentFrame);
_wheelTimer = 1 / _currentFrameRate;
}
}
function Update(gameContext) {
if (!gameContext.getGameData().instructionsAlreadyRemoved()) {
gameContext.getGameData().animateInstructions();
} else {
_quitBtn.animateChild("btn_quit");
}
if (_currentAnimateIncrement != _targetAnimateIncrement) {
if (_animateIncrementTimer > 0) {
_animateIncrementTimer = _animateIncrementTimer - gameContext.getDT();
if (_animateIncrementTimer <= 0) {
if (_currentAnimateIncrement > _targetAnimateIncrement) {
_currentAnimateIncrement = _currentAnimateIncrement - 1;
_currentFrameRate = _currentFrameRate - 1.47;
} else {
_currentAnimateIncrement = _currentAnimateIncrement + 1;
_currentFrameRate = _currentFrameRate + 1.47;
}
if (_currentFrameRate > 32) {
_currentFrameRate = 32;
}
if (_currentFrameRate <= 4) {
_currentFrameRate = 4;
}
gameContext.getUIManager().getScreen().setChildAnimateIncrement("hill", _currentAnimateIncrement);
gameContext.getUIManager().getScreen().setChildFramerate("hill", _currentFrameRate);
gameContext.getUIManager().getScreen().setChildAnimateIncrement("trees", _currentAnimateIncrement);
gameContext.getUIManager().getScreen().setChildFramerate("trees", _currentFrameRate / 2);
gameContext.getUIManager().getScreen().setChildAnimateIncrement("bushes", _currentAnimateIncrement);
gameContext.getUIManager().getScreen().setChildFramerate("bushes", _currentFrameRate / 1.5);
_animateIncrementTimer = _animateIncrementSpeed;
}
}
}
handleWheels();
if (_action == SHOULD_HOLD_KART) {
if (_previousAction == AM_CHASING_KART) {
_blooStartFrame = 90;
_blooEndFrame = 101;
_blooFramerate = 20;
_blooTimer = 1 / _blooFramerate;
_blooCurrentFrame = _blooStartFrame;
_macStartFrame = 90;
_macEndFrame = 101;
_macFramerate = 20;
_macTimer = 1 / _macFramerate;
_macCurrentFrame = _macStartFrame;
} else {
_blooStartFrame = 101 - (_blooCurrentFrame - 66);
_blooEndFrame = 101;
_blooFramerate = 20;
_blooTimer = 1 / _blooFramerate;
_blooCurrentFrame = _blooStartFrame;
_macStartFrame = 101 - (_macCurrentFrame - 66);
_macEndFrame = 101;
_macFramerate = 20;
_macTimer = 1 / _macFramerate;
_macCurrentFrame = _macStartFrame;
}
_action = CONTINUE_HOLDING_KART;
_cheeseAnimAction = SHOULD_HOLD_KART;
} else if (_action == SHOULD_RELEASE_KART) {
_targetAnimateIncrement = 20;
gameContext.getUIManager().getScreen().setChildAnimateIncrement("hill", _currentAnimateIncrement);
gameContext.getUIManager().getScreen().setChildAnimateIncrement("bushes", _currentAnimateIncrement);
gameContext.getUIManager().getScreen().setChildAnimateIncrement("trees", _currentAnimateIncrement);
gameContext.getUIManager().getScreen().setChildFramerate("sky", 32);
if (_previousAction == AM_HOLDING_KART) {
_blooStartFrame = 66;
_blooEndFrame = 78;
_blooFramerate = 20;
_blooTimer = 1 / _blooFramerate;
_blooCurrentFrame = _blooStartFrame;
_macStartFrame = 66;
_macEndFrame = 78;
_macFramerate = 30;
_macTimer = 1 / _macFramerate;
_macCurrentFrame = _macStartFrame;
} else {
_blooStartFrame = 78 - (_blooCurrentFrame - 90);
_blooEndFrame = 78;
_blooFramerate = 20;
_blooTimer = 1 / _blooFramerate;
_blooCurrentFrame = _blooStartFrame;
_macStartFrame = 78 - (_macCurrentFrame - 90);
_macEndFrame = 78;
_macFramerate = 30;
_macTimer = 1 / _macFramerate;
_macCurrentFrame = _macStartFrame;
}
_action = CONTINUE_RELEASING_KART;
}
updateBloo(gameContext);
updateMac(gameContext);
updateCheese(gameContext);
_previousAction = _action;
}
function updateBloo(gameContext) {
_blooTimer = _blooTimer - gameContext.getDT();
if (_blooTimer <= 0) {
_blooCurrentFrame++;
if (_blooCurrentFrame > _blooEndFrame) {
if (_blooEndFrame == 78) {
_cheeseAction = AM_CHASING_KART;
_action = AM_CHASING_KART;
_blooStartFrame = 79;
_blooEndFrame = 89;
_blooFramerate = 10;
_blooTimer = 1 / _blooFramerate;
_blooCurrentFrame = _blooStartFrame;
} else if (_blooEndFrame == 101) {
gameContext.getUIManager().getScreen().setChildAnimateIncrement("hill", _currentAnimateIncrement);
_targetAnimateIncrement = 1;
gameContext.getUIManager().getScreen().setChildAnimateIncrement("trees", _currentAnimateIncrement);
gameContext.getUIManager().getScreen().setChildAnimateIncrement("bushes", _currentAnimateIncrement);
gameContext.getUIManager().getScreen().setChildFramerate("sky", 0);
_cheeseAction = AM_HOLDING_KART;
_action = AM_HOLDING_KART;
_blooStartFrame = 1;
_blooEndFrame = 65;
_blooFramerate = 10;
_blooTimer = 1 / _blooFramerate;
_blooCurrentFrame = _blooStartFrame;
} else {
_blooCurrentFrame = _blooStartFrame;
}
}
_blooTimer = 1 / _blooFramerate;
}
gameContext.getUIManager().getScreen().getMovieClip().bloo.gotoAndStop(_blooCurrentFrame);
gameContext.getUIManager().getScreen().getMovieClip().cheese_car.gotoAndStop(_blooCurrentFrame);
}
function updateMac(gameContext) {
_macTimer = _macTimer - gameContext.getDT();
if (_macTimer <= 0) {
_macCurrentFrame++;
if (_macCurrentFrame > _macEndFrame) {
if (_macEndFrame == 78) {
_action = AM_CHASING_KART;
_macStartFrame = 79;
_macEndFrame = 89;
_macFramerate = 30;
_macTimer = 1 / _macFramerate;
_macCurrentFrame = _macStartFrame;
} else if (_macEndFrame == 101) {
_action = AM_HOLDING_KART;
_macStartFrame = 1;
_macEndFrame = 65;
_macFramerate = 10;
_macTimer = 1 / _macFramerate;
_macCurrentFrame = _macStartFrame;
} else {
_macCurrentFrame = _macStartFrame;
}
}
_macTimer = 1 / _macFramerate;
}
gameContext.getUIManager().getScreen().getMovieClip().mac.gotoAndStop(_macCurrentFrame);
}
function updateCheese(gameContext) {
_cheeseTimer = _cheeseTimer - gameContext.getDT();
if (_cheeseTimer < 0) {
if (_cheeseFrame < _cheeseEndFrame) {
_cheeseFrame++;
}
_cheeseTimer = 1 / _cheeseFramerate;
}
gameContext.getUIManager().getScreen().getMovieClip().cheese_car.cheese.gotoAndStop(_cheeseFrame);
gameContext.getUIManager().getScreen().getMovieClip().cheese_car.cheese.head.gotoAndStop(2);
_cheeseStep();
}
function Exit(gameContext) {
if (gameContext.getGameData().getInstructions() != undefined) {
gameContext.getGameData().getInstructions().removeSprite();
delete eval (gameContext.getGameData().getInstructions());
}
gameContext.getGameData().getSoundModule().StopAllSounds();
}
function amHappy() {
if ((_cheeseAction == AM_CHASING_KART) || (_cheeseAnimAction == SHOULD_RELEASE_KART)) {
_cheeseStartFrame = 303;
_cheeseEndFrame = 333;
_cheeseFramerate = 30;
_cheeseTimer = 1 / _cheeseFramerate;
_cheeseFrame = _cheeseStartFrame;
_cheeseStep = amScreaming;
_gameContext.getGameData().getSoundModule().StopAllSounds();
_gameContext.getGameData().getSoundModule().PlaySound("cheese_screams", 100, 0, 0, false, 1);
return(undefined);
}
if (((!_gameContext.getGameData().getSoundModule().soundIsPlaying("cheese_wee1")) && (!_gameContext.getGameData().getSoundModule().soundIsPlaying("cheese_screams"))) && (_cheeseFrame == _cheeseEndFrame)) {
if (_cheeseAction == AM_HOLDING_KART) {
_cheeseStartFrame = 120;
_cheeseEndFrame = 149;
_cheeseFramerate = 30;
_cheeseTimer = 1 / _cheeseFramerate;
_cheeseFrame = _cheeseStartFrame;
_cheeseStep = amBreathingHappy;
}
_gameContext.getGameData().getSoundModule().PlaySound("cheese_breathes", 100, 0, 0, false, 1);
}
}
function amScreaming() {
if ((_cheeseAction == AM_HOLDING_KART) && (_cheeseAnimAction != SHOULD_RELEASE_KART)) {
_cheeseStartFrame = 1;
_cheeseEndFrame = 95;
_cheeseFramerate = 40;
_cheeseTimer = 0.1;
_cheeseFrame = _cheeseStartFrame;
_cheeseStep = amHappy;
_gameContext.getGameData().getSoundModule().StopAllSounds();
_gameContext.getGameData().getSoundModule().PlaySound("cheese_wee1", 100, 0, 0, false, 1);
return(undefined);
}
if ((((!_gameContext.getGameData().getSoundModule().soundIsPlaying("cheese_wee1")) && (!_gameContext.getGameData().getSoundModule().soundIsPlaying("cheese_screams"))) && (!_gameContext.getGameData().getSoundModule().soundIsPlaying("cheese_aah"))) && (_cheeseFrame == _cheeseEndFrame)) {
if (_cheeseAction == AM_CHASING_KART) {
_cheeseStartFrame = 236;
_cheeseEndFrame = 265;
_cheeseFramerate = 30;
_cheeseTimer = 1 / _cheeseFramerate;
_cheeseFrame = _cheeseStartFrame;
_cheeseStep = amBreathingScared;
}
_gameContext.getGameData().getSoundModule().PlaySound("cheese_breathes", 100, 0, 0, false, 1);
}
}
function amBreathingHappy() {
if ((_cheeseAction == AM_CHASING_KART) || (_cheeseAnimAction == SHOULD_RELEASE_KART)) {
_cheeseStartFrame = 303;
_cheeseEndFrame = 333;
_cheeseFramerate = 30;
_cheeseTimer = 1 / _cheeseFramerate;
_cheeseFrame = _cheeseStartFrame;
_cheeseStep = amScreaming;
_gameContext.getGameData().getSoundModule().StopAllSounds();
_gameContext.getGameData().getSoundModule().PlaySound("cheese_screams", 100, 0, 0, false, 1);
return(undefined);
}
if ((!_gameContext.getGameData().getSoundModule().soundIsPlaying("cheese_breathes")) && (_cheeseFrame >= _cheeseEndFrame)) {
if (_cheeseAction == AM_HOLDING_KART) {
_cheeseStartFrame = 1;
_cheeseEndFrame = 95;
_cheeseFramerate = 40;
_cheeseTimer = 0.1;
_cheeseFrame = _cheeseStartFrame;
_cheeseStep = amHappy;
_gameContext.getGameData().getSoundModule().PlaySound("cheese_wee1", 100, 0, 0, false, 1);
} else if (_cheeseAction == AM_CHASING_KART) {
_cheeseStartFrame = 303;
_cheeseEndFrame = 333;
_cheeseFramerate = 30;
_cheeseTimer = 1 / _cheeseFramerate;
_cheeseFrame = _cheeseStartFrame;
_cheeseStep = amScreaming;
_gameContext.getGameData().getSoundModule().PlaySound("cheese_screams", 100, 0, 0, false, 1);
}
}
}
function amBreathingScared() {
if ((_cheeseAction == AM_HOLDING_KART) && (_cheeseAnimAction != SHOULD_RELEASE_KART)) {
_cheeseStartFrame = 1;
_cheeseEndFrame = 95;
_cheeseFramerate = 40;
_cheeseTimer = 0.1;
_cheeseFrame = _cheeseStartFrame;
_cheeseStep = amHappy;
_gameContext.getGameData().getSoundModule().StopAllSounds();
_gameContext.getGameData().getSoundModule().PlaySound("cheese_wee1", 100, 0, 0, false, 1);
return(undefined);
}
if ((!_gameContext.getGameData().getSoundModule().soundIsPlaying("cheese_breathes")) && (_cheeseFrame >= _cheeseEndFrame)) {
if (_cheeseAction == AM_HOLDING_KART) {
_cheeseStartFrame = 1;
_cheeseEndFrame = 95;
_cheeseFramerate = 40;
_cheeseTimer = 0.1;
_cheeseFrame = _cheeseStartFrame;
_cheeseStep = amHappy;
_gameContext.getGameData().getSoundModule().PlaySound("cheese_wee1", 100, 0, 0, false, 1);
} else if (_cheeseAction == AM_CHASING_KART) {
_cheeseStartFrame = 303;
_cheeseEndFrame = 333;
_cheeseFramerate = 30;
_cheeseTimer = 1 / _cheeseFramerate;
_cheeseFrame = _cheeseStartFrame;
_cheeseStep = amScreaming;
_gameContext.getGameData().getSoundModule().PlaySound("cheese_screams", 100, 0, 0, false, 1);
}
}
}
function doNothing() {
}
static var SHOULD_HOLD_KART = 1;
static var SHOULD_RELEASE_KART = 2;
static var CONTINUE_HOLDING_KART = 3;
static var CONTINUE_RELEASING_KART = 4;
static var AM_HOLDING_KART = 5;
static var AM_CHASING_KART = 6;
static var CHEESE_BREATHING_HAPPY = 1;
static var CHEESE_BREATHING_SCARED = 2;
static var CHEESE_SCREAMING = 3;
static var CHEESE_HAPPY = 4;
var _screens = [{id:6, idx:1, spriteName:"scene", clipName:"scene", depth:10, xPos:300, yPos:200, regPt:2, w:-1, h:-1, numChild:4, children:[["car", 0, 0, 239, 82, 1, 70, 60, true, 128, 1], ["hill", 0, 0, 3600, 2800, 1, 100, 60, true, 128, 1], ["bushes", 0, 0, 1200, 1085, 1, 100, 60, true, 128, 1], ["trees", 0, 0, 1200, 1085, 1, 100, 60, true, 128, 1], ["sky", 0, 0, 1200, 1085, 1, 22, 60, true, 128, 1]]}, {id:5, idx:1, spriteName:"cursor", clipName:"cursorClip", depth:111000, xPos:0, yPos:0, regPt:2, w:-1, h:-1}];
}
Symbol 317 MovieClip [__Packages.Game.GameStates.G_DoItAgain] Frame 0
class Game.GameStates.G_DoItAgain extends Base.GameState
{
var _screenFrame, _stage, _state, _animatingDoItAgain, _delay, _animRate, _btn;
function G_DoItAgain () {
super();
}
function Entry(gameContext) {
gameContext.getUIManager().showScreen(gameContext.getGameData().getScreen(3), 1);
_screenFrame = 1;
_stage = 0;
_state = new Function(moveWeeOn);
_animatingDoItAgain = false;
_delay = 0;
_animRate = 0;
}
function Update(gameContext) {
if (_animRate > 0) {
_animRate = _animRate - gameContext.getDT();
return(undefined);
}
if (_delay <= 0) {
_screenFrame++;
} else {
_delay = _delay - gameContext.getDT();
}
gameContext.getUIManager().moveScreenToFrame(_screenFrame);
_state(gameContext);
}
function Exit(gameContext) {
gameContext.getGameData().incNumGameTimes();
}
function moveWeeOn(gameContext) {
if (_screenFrame == 55) {
_btn = new Base.SpriteEntity(gameContext, 1, 1, "btn_doitagain", "btn_doitagain", 70002, 235, 300, 2, -1, -1);
gameContext.getGameData().getSoundModule().PlaySound("doitagain_snd", 100, 0, 0, false, 1);
_delay = 2.75;
_state = screenIdle;
}
}
function screenIdle(gameContext) {
_btn.animateSprite();
if (_screenFrame == 149) {
_screenFrame = 55;
gameContext.getGameData().getSoundModule().PlaySound("doitagain_snd", 100, 0, 0, false, 1);
_delay = 2.75;
}
if (_btn.isMouseOver()) {
if (!_animatingDoItAgain) {
_animatingDoItAgain = true;
_btn.startAnimating(_btn.getCurrentFrame(), 11, 32, false);
}
if (gameContext.getPadManager().getMouseJustPressed()) {
gameContext.getGameData().getSoundModule().StopAllSounds();
_screenFrame = 149;
_state = slideOff;
_btn.removeSprite();
delete _btn;
}
} else if (_animatingDoItAgain) {
_animatingDoItAgain = false;
_btn.startAnimating(_btn.getCurrentFrame(), 1, 32, false);
}
}
function slideOff(gameContext) {
if (_screenFrame == 178) {
gameContext.getGameManager().setNextState(Game.GameStates.G_Instructions);
}
}
}
Symbol 318 MovieClip [__Packages.Game.GameData] Frame 0
class Game.GameData
{
var _gameContext, _soundList, _soundMC, _soundModule, _instructionsRemoved, _numGameTimes, _instructions;
function GameData (gameContext) {
_gameContext = gameContext;
_soundList = ["cheese_aah", "cheese_wee1", "doitagain_snd", "cheese_breathes", "cheese_screams"];
_soundMC = _root.createEmptyMovieClip("sound_mc", 12000);
_soundModule = new Base.SoundModule(_soundMC);
_global.MUSIC_MUTE = false;
_global.MUSIC_VOL = 100;
var _local4 = 0;
while (_local4 < _soundList.length) {
var _local5 = _soundModule.LoadSound(_soundList[_local4]);
_local5.attachSound(_soundList[_local4]);
_local4++;
}
_instructionsRemoved = false;
_numGameTimes = 1;
}
function getScreen(num) {
return(_screens[num]);
}
function resetRemoveInstructions() {
_instructionsRemoved = false;
}
function incNumGameTimes() {
_numGameTimes++;
}
function getNumGameTimes() {
return(_numGameTimes);
}
function getInstructions() {
return(_instructions);
}
function getSoundModule() {
return(_soundModule);
}
function showInstructions() {
if (_numGameTimes == 1) {
_instructions = new Base.SpriteEntity(_gameContext, 1, 1, "instr_pod", "instructions", 600000, 0, 160, 2, -1, -1);
_instructions.startAnimating(1, 30, 32, false);
}
}
function animateInstructions() {
if (_numGameTimes > 1) {
return(undefined);
}
_instructions.animateSprite();
if (_instructions.getCurrentFrame() == 100) {
_instructionsRemoved = true;
_instructions.removeSprite();
delete _instructions;
}
}
function instructionsAlreadyRemoved() {
return(_instructionsRemoved);
}
function shouldRemoveInstructions() {
if (_numGameTimes > 1) {
_instructionsRemoved = true;
} else if (_instructions.getCurrentFrame() < 70) {
_instructions.startAnimating(70, 100, 32, false);
}
}
function toString(Void) {
return("GameData()");
}
function LoadTracking(num) {
var _local1 = new Date().getTime();
if (num == 0) {
loadMovieNum ("tracker.swf?" + _local1, 10000);
} else {
var _local2 = (("tracker" + num) + ".swf?") + _local1;
loadMovieNum (_local2, 10000);
}
}
var _screens = [{id:6, idx:1, spriteName:"Titlecard_mc", clipName:"Titlecard_mc", depth:10, xPos:0, yPos:0, regPt:2, w:-1, h:-1}, {id:5, idx:1, spriteName:"cursor", clipName:"cursorClip", depth:111000, xPos:0, yPos:0, regPt:2, w:-1, h:-1}, {id:5, idx:1, spriteName:"introduction", clipName:"intro", depth:3000, xPos:0, yPos:0, regPt:2, w:-1, h:-1}, {id:5, idx:1, spriteName:"DoItAgain", clipName:"doitagain_screen", depth:3000, xPos:0, yPos:0, regPt:2, w:-1, h:-1}];
}
Symbol 319 MovieClip [__Packages.Base.Profile] Frame 0
class Base.Profile
{
var _gameContext, _profiles;
function Profile (gameContext) {
_gameContext = gameContext;
_profiles = [];
}
function RegisterProfile(name) {
_profiles.push(new Object());
var _local2 = _profiles.length - 1;
_profiles[_local2].name = name;
_profiles[_local2].startTime = 0;
_profiles[_local2].endTime = 0;
}
function StartProfile(name) {
var _local2 = 0;
while (_local2 < _profiles.length) {
if (_profiles[_local2].name == name) {
_profiles[_local2].startTime = getTimer();
_profiles[_local2].endTime = 0;
}
_local2++;
}
}
function EndProfile(name) {
var _local2 = 0;
while (_local2 < _profiles.length) {
if (_profiles[_local2].name == name) {
_profiles[_local2].endTime = getTimer();
}
_local2++;
}
}
function ReportProfile() {
var _local2 = 0;
while (_local2 < _profiles.length) {
var _local3 = _profiles[_local2].endTime - _profiles[_local2].startTime;
_local2++;
}
}
}
Symbol 320 MovieClip [__Packages.Base.Background] Frame 0
class Base.Background
{
var _gameContext, _num, _scrollSpeed, _backgroundTimer, fg, _currentDepth, fg_bmp;
function Background (gameContext) {
_gameContext = gameContext;
_num = 196;
_scrollSpeed = 0.05;
_backgroundTimer = _scrollSpeed;
fg = [];
_currentDepth = 0;
}
function addBackground(graphicName, numBackgrounds, loop, offsetY) {
fg_bmp = flash.display.BitmapData.loadBitmap(graphicName);
var _local3 = new Object();
_local3.amountToMoveX = 0;
_local3.amountToMoveY = 0;
_local3.bitmapWidth = fg_bmp.width;
_local3.numBackgrounds = numBackgrounds;
_local3.loop = loop;
_local3._screen = [];
fg.push(_local3);
var _local2 = 0;
while (_local2 < numBackgrounds) {
var _local4 = (_local3.bitmapWidth * _local2) - 1;
_currentDepth++;
_local3._screen.push(_gameContext.getParent().createEmptyMovieClip("background" + _currentDepth, _currentDepth));
_local3._screen[_local2].attachBitmap(fg_bmp, 1);
_local3._screen[_local2].rect = new flash.geom.Rectangle(0, 0, Stage.width, Stage.height);
_local3._screen[_local2].bmp = fg_bmp;
if (_local2 == 0) {
_local3._screen[_local2].rect.offset(1, (fg_bmp.height + offsetY) - Stage.height);
} else {
_local3._screen[_local2].rect.offset(-_local4, (fg_bmp.height + offsetY) - Stage.height);
}
_local3._screen[_local2].scrollRect = _local3._screen[_local2].rect;
_local2++;
}
fg[fg.length - 1].amountToMoveX = 0;
fg[fg.length - 1].amountToMoveY = 0;
return(fg.length);
}
function scrollClip(mc, x, y) {
var _local2 = 0;
while (_local2 < mc.numBackgrounds) {
mc._screen[_local2].rect.offset(x, y);
_local2++;
}
if (mc._screen[0].rect.left <= 0) {
_local2 = 0;
while (_local2 < mc.numBackgrounds) {
mc._screen[_local2].rect.x = mc._screen[_local2].rect.x + mc.bitmapWidth;
_local2++;
}
} else if (mc._screen[0].rect.right > (mc.bitmapWidth + Stage.width)) {
_local2 = 0;
while (_local2 < mc.numBackgrounds) {
mc._screen[_local2].rect.x = mc._screen[_local2].rect.x - mc.bitmapWidth;
_local2++;
}
}
_local2 = 0;
while (_local2 < mc.numBackgrounds) {
mc._screen[_local2].scrollRect = mc._screen[_local2].rect;
_local2++;
}
}
function moveBack(gameContext) {
var _local2 = fg.length;
if (_local2 < 1) {
return(undefined);
}
while (_local2--) {
if ((fg[_local2].amountToMoveX == 0) && (fg[_local2].amountToMoveY == 0)) {
continue;
}
scrollClip(fg[_local2], fg[_local2].amountToMoveX, fg[_local2].amountToMoveY);
fg[_local2].amountToMoveX = 0;
fg[_local2].amountToMoveY = 0;
}
return(undefined);
}
function setAmountToMove(screenNum, x, y) {
fg[screenNum].amountToMoveX = x;
fg[screenNum].amountToMoveY = y;
}
function removeAllBackgrounds() {
var _local3 = fg.length;
while (_local3--) {
var _local2 = fg[_local3]._screen.length;
while (_local2--) {
fg[_local3]._screen[_local2].removeMovieClip();
}
}
_currentDepth = 0;
}
}