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);
}
};
stop();
Frame 2
function loadGame() {
var _local1 = Math.floor((getBytesLoaded() / getBytesTotal()) * 100);
if (_local1 > 1) {
preload_mc.done_txt.text = _local1 + "%";
}
if (_local1 >= 100) {
clearInterval(loadInt2);
gotoAndStop ("start");
preload_mc.gotoAndPlay(2);
}
}
preload_mc.swapDepths(500000);
loadInt2 = setInterval(loadGame, 50);
stop();
Symbol 21 MovieClip Frame 1
stop();
Symbol 34 MovieClip [loseScreen_noInvaded] Frame 41
stop();
Symbol 44 MovieClip Frame 12
gotoAndPlay (1);
Symbol 56 MovieClip Frame 30
gotoAndPlay (1);
Symbol 59 MovieClip Frame 1
stop();
Symbol 59 MovieClip Frame 40
stop();
Symbol 60 MovieClip [gameEntry] Frame 1
#initclip 35
Object.registerClass("gameEntry", Base.GameEntry);
#endinitclip
Symbol 412 MovieClip Frame 1
stop();
Symbol 428 MovieClip [starHit] Frame 52
stop();
Symbol 433 MovieClip [comboBurst] Frame 52
stop();
Symbol 461 MovieClip [shootingStar_clicked] Frame 36
stop();
Symbol 467 MovieClip [star_clicked] Frame 26
stop();
Symbol 469 MovieClip [longShotPop] Frame 50
stop();
Symbol 483 MovieClip Frame 117
stop();
Symbol 491 MovieClip Frame 117
stop();
Symbol 501 MovieClip Frame 1
stop();
Symbol 506 MovieClip Frame 1
stop();
Symbol 522 MovieClip [loseScreen] Frame 41
stop();
Symbol 530 MovieClip Frame 1
stop();
Symbol 531 MovieClip [instructions] Frame 41
stop();
Symbol 547 MovieClip Frame 1
stop();
Symbol 553 MovieClip [tallyScreen] Frame 41
stop();
Symbol 557 MovieClip [getReady] Frame 41
stop();
Symbol 598 MovieClip Frame 1
stop();
Symbol 599 MovieClip [__Packages.Base.GameEntry] Frame 0
class Base.GameEntry extends MovieClip
{
var _timeMgr, _uiMgr, _padMgr, _gameData, _gameMgr, _profiler, _background, _gameLoaded, _stageLoaded, onEnterFrame, _parent, _multiplayer, _sndMgr;
function GameEntry () {
super();
_timeMgr = new Base.Time();
_uiMgr = new UI.UIManager(this);
_padMgr = new Pad.PadManager();
_gameData = new Game.GameData(this);
_gameMgr = new Game.GameManager(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);
return(undefined);
}
}
Symbol 600 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 601 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 (!_cursor) {
return(undefined);
}
if (_cursorOn == true) {
return(undefined);
}
_cursorOn = true;
updateCursor();
_cursor.setVisibility(true);
Mouse.hide();
}
function cursorOff() {
if (!_cursor) {
return(undefined);
}
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 602 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);
_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 setText(tName, str) {
_mc[tName].text = str;
}
function setChildText(childName, tName, str) {
_mc[childName][tName].text = str;
}
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]._currentChildFrame = 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 603 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 604 MovieClip [__Packages.Base.SoundModule] Frame 0
class Base.SoundModule
{
var _mc, _hash, _num, _active_sounds, _fade_interval, _defaultVol, _musicVol, _musicOff, _music_mute, _curr_music, _fade_interval2;
function SoundModule (mc) {
_mc = mc;
_hash = {};
_num = 0;
_active_sounds = [];
_fade_interval = null;
_defaultVol = 100;
_musicVol = 50;
_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] == _curr_music) {
StopSound(_active_sounds[_local2]);
break;
}
}
_curr_music = "none";
}
function StopAllSounds() {
var _local2 = _active_sounds.length;
while (_local2--) {
if (_active_sounds[_local2] != _curr_music) {
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);
}
_hash[_curr_music].setVolume(vol);
}
function GetCurMusic(Void) {
return(_curr_music);
}
function getMusicOff() {
return(_musicOff);
}
function setMusicOff(toSet) {
_musicOff = toSet;
}
function setMusicVol(n) {
_musicVol = n;
_hash[_curr_music].setVolume(n);
}
function PlayMusic(str, useCurrentVolume) {
if (_musicOff) {
return(undefined);
}
if (str == _curr_music) {
return(undefined);
}
if (str == "none") {
FadeSound(_curr_music, _musicVol, 0, 2);
_curr_music = "none";
} else {
CrossFade(_curr_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) {
for (var _local3 in _active_sounds) {
if (_active_sounds[_local3] == snd) {
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 _local2 = _musicVol;
if (useCurrentVolume != undefined) {
_local2 = _hash[snd1].getVolume();
}
FadeSound(snd1, _local2, 0, dur);
PlaySound(snd2, 0, 0, 0, 9999);
FadeSound2(snd2, 0, _local2, 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 605 MovieClip [__Packages.Game.GameManager] Frame 0
class Game.GameManager
{
var _gameContext, _currentGameState, _pauseGameState, _nextGameState, _followingGameState;
function GameManager (gameContext) {
_gameContext = gameContext;
_currentGameState = null;
_pauseGameState = null;
setNextState(Game.GameStates.G_TitleCard);
}
function setNextState(state) {
_nextGameState = new state[undefined](_gameContext);
}
function setPauseState(state) {
_pauseGameState = new state[undefined](_gameContext);
}
function setFollowingGameState(state) {
_followingGameState = state;
}
function getFollowingGameState() {
return(_followingGameState);
}
function Update() {
if (_nextGameState.isTransitioning()) {
return(undefined);
}
if (_pauseGameState != null) {
_pauseGameState.Update();
return(undefined);
}
if (_currentGameState != _nextGameState) {
_currentGameState = _nextGameState;
_currentGameState.Entry();
} else if (_currentGameState == _nextGameState) {
_currentGameState.PadInput();
_currentGameState.Update();
if (_currentGameState != _nextGameState) {
_currentGameState.Exit();
delete _currentGameState;
if (!_nextGameState) {
}
}
}
}
}
Symbol 606 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 607 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 608 MovieClip [__Packages.Game.GameStates.G_TitleCard] Frame 0
class Game.GameStates.G_TitleCard extends Base.GameState
{
var _gameContext, _gameData, _screen;
function G_TitleCard (gameContext) {
super();
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
}
function Entry() {
var _local2 = _gameData.getScreen(0);
_gameContext.getUIManager().showScreen(_local2);
_screen = _gameContext.getUIManager().getScreen();
if (!_gameData._invaded) {
_screen.getChild("btn_backtohub")._visible = false;
}
_gameData.getSoundModule().PlayMusic("music_title");
}
function Update() {
if (_screen.isMouseOverChild("btn_start") && (_gameContext.getPadManager().getMouseJustPressed())) {
_screen.moveChildToFrame("btn_start", 7);
_gameData.getTracker().sendEventCustom("fosters_play");
}
if (_gameContext.getUIManager().getUIReturnVal() == 1) {
_gameData.getSoundModule().PlaySound("bell15", 30);
_gameContext.getGameManager().setNextState(Game.GameStates.G_Instructions);
}
if (_gameData._invaded) {
if (_gameContext.getUIManager().getUIReturnVal() == 2) {
_gameData.getSoundModule().PlaySound("bell15", 30);
_gameData.exit();
}
}
}
function Exit() {
}
}
Symbol 609 MovieClip [__Packages.Game.GameData] Frame 0
class Game.GameData
{
var _gameContext, _soundList, _soundMC, _soundModule, _starGrid, _timer, _drawPoints, _cPoints, _starPoints, _stars, _connectionTimeLimit, _comboTimeLimit, _connectionTimerStart, _comboTimerStart, _totalCombos, _hitComet, _longShot, _shatter, _levelMaxCombos, _levelMaxConnections, _totalMaxCombos, _totalMaxConnections, _totalStars, _clock, _ui, _characters, _timeCheat, _levelTimeout, _enemyTimeout, _cometTimeout, _levelPoints, _levelQuota, _levelTimerStart, _levelTimeLimit, _levelStars, _timeExpiring, _bg, _bg2, _starContainer, _constellation, _drawContainer, _starHitMC, _comboMC, _longShotMC, _cursorSprite, _particles, _comet, _enemy, _currEnemySound, _levelTimeRemaining, _starPointList, _adjComboTimeLimit, _shatterMCList, _tracker, _so, _bestScore;
function GameData (gameContext) {
_gameContext = gameContext;
loadTracking();
_soundList = ["music_title", "music_inPlay", "music_levelComplete", "music_gameOver", "sfx_shatter", "sfx_fireworks", "sfx_comet", "sfx_combo", "sfx_jet", "sfx_plane", "sfx_ufo", "sfx_tally", "sfx_helicopter", "sfx_warning"];
var _local2 = 1;
while (_local2 < 19) {
_soundList.push("bell" + _local2);
_local2++;
}
_soundMC = _gameContext.createEmptyMovieClip("sound_mc", _SOUND_DEPTH);
_soundModule = new Base.SoundModule(_soundMC);
_soundModule.setMusicVol(60);
_local2 = 0;
while (_local2 < _soundList.length) {
var _local3 = _soundModule.LoadSound(_soundList[_local2]);
_local3.attachSound(_soundList[_local2]);
_local2++;
}
_starGrid = new Game.StarGrid();
initSO();
}
function getScreen(num) {
return(_screens[num]);
}
function init() {
_timer = _gameContext.getTimeManager();
initParticles();
initCanvas();
_drawPoints = new Array();
_cPoints = new Array();
_starPoints = new Array();
_stars = new Array();
nextLevel();
cheatKeys();
}
function reset() {
_levelIndex = -1;
_starCount = 0;
_drawing = false;
_connectionTimeLimit = 0.6;
_comboTimeLimit = 6;
_connectionTimerStart = 0;
_connectionCount = 0;
_comboCount = 0;
_comboTimerStart = 0;
_totalCombos = 0;
_score = 0;
_hitComet = false;
_longShot = false;
_shatter = false;
_levelMaxCombos = 0;
_levelMaxConnections = 0;
_totalMaxCombos = 0;
_totalMaxConnections = 0;
_totalStars = 0;
_clock = 0;
_cPoints = [];
}
function updateClock() {
if (_levelOver) {
return(undefined);
}
_clock = _clock + _gameContext.getDT();
}
function checkUIButtons() {
if (_ui.isMouseOverChild("btn_ins")) {
_ui.moveChildToFrame("btn_ins", 2);
if (_gameContext.getPadManager().getMouseJustPressed()) {
_gameContext.getGameManager().setPauseState(Game.GameStates.G_Pause);
}
} else {
_ui.moveChildToFrame("btn_ins", 1);
}
if (_ui.isMouseOverChild("btn_music")) {
if (_soundModule.getMusicOff()) {
_ui.moveChildToFrame("btn_music", 4);
} else {
_ui.moveChildToFrame("btn_music", 2);
}
if (_gameContext.getPadManager().getMouseJustPressed()) {
if (_soundModule.getMusicOff()) {
_soundModule.setMusicOff(false);
_soundModule.setMusicVol(60);
_soundModule.PlayMusic("music_inPlay");
} else {
_soundModule.setMusicOff(true);
_soundModule.setMusicVol(0);
}
}
} else if (_soundModule.getMusicOff()) {
_ui.moveChildToFrame("btn_music", 3);
} else {
_ui.moveChildToFrame("btn_music", 1);
}
}
function playCharacterAnimation(animType) {
var _local2 = 0;
while (_local2 < _animData.length) {
if (_animData[_local2].anim == animType) {
var _local3 = _animData[_local2].startFrame;
var _local5 = _animData[_local2].endFrame;
var _local6 = _animData[_local2].frameRate;
var _local4 = _animData[_local2].looping;
_characters.startAnimating(_local3, _local5, _local6, _local4);
return(undefined);
}
_local2++;
}
}
function getReadyMessage() {
var _local2 = ["Make big connections for big scores! Fill your star bar before time runs out.", "Make a connection before your previous one fades away to make combos.", "Shooting stars mean big points!", "The bigger the combo, the faster it fades away.", "Watch out for obstacles like planes and helicopters.", "Missing a connection breaks your combo.", "Fill up your Star Bar fast for a big time bonus!", "", "", "Watch out for fireworks!", "Did you see a UFO?"];
if (_levelIndex < 11) {
return(_local2[_levelIndex]);
}
return("");
}
function nextLevel() {
_clock = 0;
_timeCheat = false;
_global.clearTimeout(_levelTimeout);
_global.clearTimeout(_enemyTimeout);
_global.clearTimeout(_cometTimeout);
_levelIndex++;
_levelPoints = 0;
_starPoints = 0;
_comboCount = 0;
_connectionCount = 0;
var _local3 = [10000, 12000, 14000, 16000, 18000, 20000, 22000, 25000, 30000, 32000];
if (_levelIndex < 10) {
_levelQuota = _local3[_levelIndex];
} else {
_levelQuota = 32000 + (500 * (_levelIndex - 9));
}
_levelTimerStart = _clock;
if (_levelIndex < 5) {
_levelTimeLimit = 120;
} else {
_levelTimeLimit = 180;
}
_levelStars = 0;
_levelMaxCombos = 0;
_levelMaxConnections = 0;
_ui.setText("level", String(_levelIndex + 1));
_levelOver = false;
clearStars();
_cPoints = [];
initStars();
setParticleParams();
_timeExpiring = false;
updateLevelBar();
updateLevelTimer();
_enemyTimeout = _global.setTimeout(this, "spawnEnemy", 4000 + Math.floor(3000 * Math.random()));
if (_levelIndex > 1) {
_cometTimeout = _global.setTimeout(this, "spawnComet", 30000 + Math.floor(30000 * Math.random()));
}
}
function initBG() {
_bg = new Base.SpriteEntity(_gameContext, 1, 1, "bg", "bg", _BG_DEPTH, 0, 0, 2, -1, -1);
_bg2 = new Base.SpriteEntity(_gameContext, 1, 1, "bg2", "bg2", _BG2_DEPTH, 0, 0, 2, -1, -1);
_characters = new Base.SpriteEntity(_gameContext, 1, 1, "characters", "characters", _CHAR_DEPTH, 530, 360, 2, -1, -1);
_characters.scaleSprite(0.35);
}
function initCanvas() {
_starContainer = new Base.SpriteEntity(_gameContext, 1, 1, "blank", "starContainer", _STAR_DEPTH, 0, 0, 2, -1, -1);
_constellation = new Base.SpriteEntity(_gameContext, 1, 1, "blank", "constellation", _CONSTELLATION_DEPTH, 0, 0, 2, -1, -1);
_drawContainer = new Base.SpriteEntity(_gameContext, 1, 1, "blank", "drawContainer", _DRAWING_DEPTH, 0, 0, 2, -1, -1);
_starHitMC = _gameContext.getParent().attachMovie("starHit", "starHit", _POPUP_DEPTH);
_comboMC = _gameContext.getParent().attachMovie("comboBurst", "comboBurst", _POPUP_DEPTH + 1);
_comboMC._x = -800;
_longShotMC = _gameContext.getParent().attachMovie("longShotPop", "longShotPop", _POPUP_DEPTH + 2);
_longShotMC._x = -800;
_cursorSprite = new Base.SpriteEntity(_gameContext, 1, 1, "cursor", "cursor", _CURSOR_DEPTH, 0, 0, 2, -1, -1);
_cursorSprite.setPositionX(-200);
showCursor();
_ui = new Base.SpriteEntity(_gameContext, 1, 1, "ui", "ui", _UI_DEPTH, 0, 0, 2, -1, -1);
_ui.addChild("levelBar", 212, 11, 180, 2, 0, 0);
_ui.addChild("timeBar", 440, 11, 180, 2, 0, 0);
_ui.addChild("btn_music", 0, 0, 20, 20, 129, 1);
_ui.addChild("btn_ins", 0, 0, 20, 20, 129, 2);
}
function getUI() {
return(_ui);
}
function initParticles() {
var _local2 = _gameContext.getParent().createEmptyMovieClip("particleContainer", _PARTICLE_DEPTH);
_particles = new Game.ParticleSystem(_local2);
setParticleParams();
}
function initStars() {
var _local2 = 0;
while (_local2 < 8) {
addStar();
_local2++;
}
}
function spawnComet() {
if (_levelOver) {
_global.clearTimeout(_cometTimeout);
return(undefined);
}
if (_comet) {
_comet.remove();
}
_comet = new Game.Comet(_gameContext, _COMET_DEPTH, 35, 5, "Comet");
_comet.launch();
}
function spawnEnemy(n) {
_global.clearTimeout(_enemyTimeout);
if ((_levelIndex < 4) && (n == null)) {
return(undefined);
}
if (_enemy) {
_enemy.remove();
}
var _local5 = [0, 1, 2, 3, 4, 5];
var _local3;
if ((_levelIndex == 4) || (_levelIndex == 5)) {
_local3 = 0;
} else {
_local3 = random(_levelIndex - 4) % 6;
}
if (n != null) {
_local3 = n;
}
switch (_local3) {
case 0 :
_enemy = new Game.Plane(_gameContext, _ENEMY_DEPTH, 75, 2, 1, "Plane");
_currEnemySound = "sfx_jet";
break;
case 1 :
_enemy = new Game.Balloon(_gameContext, _ENEMY_DEPTH, "Balloon");
_currEnemySound = null;
break;
case 2 :
_enemy = new Game.Plane(_gameContext, _ENEMY_DEPTH, 180, 5, 2, "BannerPlane");
_currEnemySound = "sfx_plane";
break;
case 3 :
_enemy = new Game.Heli(_gameContext, _ENEMY_DEPTH, 80, 5, "Helicopter");
_currEnemySound = "sfx_helicopter";
break;
case 4 :
_enemy = new Game.Fireworks(_gameContext, _ENEMY_DEPTH, 75, "Fireworks1");
_soundModule.PlaySound("sfx_fireworks");
_bg.startAnimating(2, 78, 30, false);
break;
case 5 :
_enemy = new Game.Plane(_gameContext, _ENEMY_DEPTH, 45, 7, 6, "UFO");
_currEnemySound = "sfx_ufo";
}
if ((_local3 != 1) && (_local3 != 4)) {
_soundModule.PlaySound(_currEnemySound, 0, 0, 0, 999999);
_soundModule.FadeSound(_currEnemySound, 1, 60, 2);
}
_enemy.launch();
}
function finishEnemy() {
if (!_levelOver) {
_enemyTimeout = _global.setTimeout(this, "spawnEnemy", 4000 + Math.floor(3000 * Math.random()));
}
_soundModule.FadeSound(_currEnemySound, 50, 0, 2);
}
function finishComet() {
if (!_levelOver) {
_cometTimeout = _global.setTimeout(this, "spawnComet", 30000 + Math.floor(60000 * Math.random()));
}
}
function cheatKeys() {
_gameContext.getPadManager().clearKeyControls();
_gameContext.getPadManager().setKeyControls([{keyID:70, keyAction:"spawnFireworks"}, {keyID:85, keyAction:"spawnUFO"}, {keyID:84, keyAction:"add30"}]);
}
function checkForCheat() {
switch (_gameContext.getPadManager().getCurrentKeyAction()) {
case "add30" :
if (!_timeCheat) {
_levelTimeLimit = _levelTimeLimit + 30;
_timeCheat = true;
_soundModule.StopSound("sfx_warning");
_timeExpiring = false;
}
break;
case "spawnComet" :
spawnComet();
break;
case "spawnPlane" :
spawnEnemy(0);
break;
case "spawnBalloon" :
spawnEnemy(1);
break;
case "spawnBannerPlane" :
spawnEnemy(2);
break;
case "spawnHelicopter" :
spawnEnemy(3);
break;
case "spawnFireworks" :
spawnEnemy(4);
break;
case "spawnUFO" :
spawnEnemy(5);
break;
case "levelUp" :
clearConstellation();
killCombo();
stopDrawing();
nextLevel();
break;
case "levelDown" :
clearConstellation();
killCombo();
stopDrawing();
_levelIndex = _levelIndex - 2;
nextLevel();
break;
case "levelWin" :
levelWin();
break;
case "levelLose" :
levelLose();
}
}
function updateDrawing() {
if (_levelOver) {
return(undefined);
}
var _local2 = _gameContext.getPadManager().getMousePosX();
var _local3 = _gameContext.getPadManager().getMousePosY();
_drawPoints.push({x:_local2, y:_local3});
if (_drawPoints.length > _maxPoints) {
_drawPoints.shift();
}
drawInk();
if (_mousebtn) {
if (_drawing && ((_clock - _connectionTimerStart) >= _connectionTimeLimit)) {
stopDrawing();
}
checkMouseCollision();
}
}
function updateSky() {
_bg.animateSprite();
}
function setParticleParams() {
_particles.setParam("_multiple", 1 + Math.min(4, _comboCount));
_particles.setParam("_initScale", 80 + (10 * Math.min(6, _comboCount)));
_particles.setParam("_xvel", 1 + (Math.min(10, _comboCount) / 2));
_particles.setParam("_yvel", 1 + (Math.min(10, _comboCount) / 2));
_particles.setParam("_alphaVel", 4 + (2 * Math.min(5, _comboCount)));
}
function updateParticles() {
_particles.update();
}
function updateCharacters() {
_characters.animateSprite();
if (!_characters.isAnimating()) {
if (Math.random() < 0.1) {
playCharacterAnimation("idle2");
} else {
playCharacterAnimation("idle1");
}
}
}
function updateCursor() {
var _local2 = _gameContext.getPadManager().getMousePosX();
var _local3 = _gameContext.getPadManager().getMousePosY();
_cursorSprite.setPositionXY(_local2, _local3);
_particles.moveTo(_local2, _local3);
}
function hideCursor() {
Mouse.show();
_cursorSprite.setVisibility(false);
}
function showCursor() {
Mouse.hide();
_cursorSprite.setVisibility(true);
}
function updateLevelBar() {
_starPoints = _starPoints - 1;
if (_starPoints < 0) {
_starPoints = 0;
}
var _local2 = 1 + Math.floor((100 * _starPoints) / _levelQuota);
if (_local2 > 101) {
_local2 = 101;
}
var _local3 = _ui.getChildCurrentAnimFrame("levelBar");
if (_local3 < _local2) {
_ui.moveChildToFrame("levelBar", _local3 + 1);
} else if (_local3 > _local2) {
_ui.moveChildToFrame("levelBar", _local2);
}
}
function updateEntities() {
_enemy.updateSprite();
_comet.updateSprite();
}
function checkForWin() {
_levelTimeRemaining = Math.floor(_levelTimeLimit - (_clock - _levelTimerStart));
if ((!_levelOver) && (_starPoints >= _levelQuota)) {
levelWin();
}
if ((_levelTimeRemaining == 0) && (!_levelOver)) {
levelLose();
}
}
function levelLose() {
if (!_levelOver) {
_levelOver = true;
_ui.getChild("timeBar").gotoAndPlay(102);
_soundModule.StopSound("sfx_warning");
_soundModule.StopSound(_currEnemySound);
clearConstellation();
clearDrawContainer();
clearEntities();
clearParticles();
clearStars();
playCharacterAnimation("idle1");
loseGame();
}
}
function levelWin() {
_levelOver = true;
resetInk();
finishEnemy();
clearParticles();
clearConstellation();
clearDrawContainer();
clearEntities();
clearStars();
playCharacterAnimation("jump");
_global.setTimeout(this, "showTally", 3000);
_soundModule.StopSound(_currEnemySound);
_soundModule.StopSound("sfx_warning");
_soundModule.PlayMusic("none");
_soundModule.PlaySound("music_levelComplete");
}
function showTally() {
_gameContext.getGameManager().setNextState(Game.GameStates.G_Tally);
}
function loseGame() {
_gameContext.getGameManager().setNextState(Game.GameStates.G_LoseGame);
}
function checkMouse() {
if (_levelOver) {
return(undefined);
}
if (_gameContext.getPadManager().getMouseJustPressed() && (!_levelOver)) {
_mousebtn = true;
_drawing = true;
_particles.resume();
_connectionTimerStart = _clock;
_starPointList = [];
}
if (_gameContext.getPadManager().getMouseReleased()) {
_mousebtn = false;
if (_drawing) {
stopDrawing();
}
_particles.pause();
}
}
function stopDrawing() {
_drawing = false;
_cPoints = [];
var _local2 = 0;
while (_local2 < _starPointList.length) {
_cPoints.push(_starPointList[_local2]);
_local2++;
}
_starPointList = [];
drawConstellation();
if (_connectionCount < 2) {
killCombo();
clearConstellation();
}
if (_connectionCount > 1) {
_comboTimerStart = _clock;
if (!comboTimerExpired()) {
addCombo();
} else {
var _local3 = 0;
var _local5 = 0;
if (_hitComet) {
_local3 = 1000;
}
if (_longShot) {
_local5 = 500;
}
addScore(((_connectionCount * 100) + _local3) + _local5);
showAddScore(((_connectionCount * 100) + _local3) + _local5, _gameContext.getPadManager().getMousePosX(), _gameContext.getPadManager().getMousePosY() + 30);
}
} else if (_connectionCount == 1) {
var _local4;
if (_hitComet) {
_local4 = 1000;
} else {
_local4 = 100;
}
addScore(_local4);
showAddScore(_local4, _gameContext.getPadManager().getMousePosX(), _gameContext.getPadManager().getMousePosY() + 30);
}
_hitComet = false;
_longShot = false;
_connectionCount = 0;
}
function addCombo() {
_comboCount++;
_adjComboTimeLimit = Math.pow(0.9, _comboCount) * _comboTimeLimit;
_levelMaxCombos = Math.max(_levelMaxCombos, _comboCount);
_totalMaxCombos = Math.max(_totalMaxCombos, _comboCount);
var _local3 = 100 * _connectionCount;
var _local4 = 1000 * Number(_hitComet == true);
var _local6 = 500 * Number(_longShot == true);
var _local5 = 1 + (0.5 * (_comboCount - 1));
var _local2 = _local5 * ((_local3 + _local4) + _local6);
addScore(_local2);
if (_comboCount > 1) {
showCombo(_local2, _gameContext.getPadManager().getMousePosX(), _gameContext.getPadManager().getMousePosY() + 30);
_ui.getMovieClip().combos.text = _totalCombos;
} else if (_comboCount == 1) {
showAddScore(_local2, _gameContext.getPadManager().getMousePosX(), _gameContext.getPadManager().getMousePosY() + 30);
}
_totalCombos++;
setParticleParams();
playCharacterAnimation(_animData[Math.min(7, _comboCount)].anim);
}
function clearConstellation() {
var _local2 = _constellation.getMovieClip();
for (var _local3 in _local2) {
_local2[_local3].removeMovieClip();
}
_local2.clear();
}
function clearParticles() {
_particles.cleanUp();
}
function clearEntities() {
if (_enemy) {
_enemy.remove();
}
_global.clearTimeout(_enemyTimeout);
if (_comet) {
_comet.remove();
}
_global.clearTimeout(_cometTimeout);
}
function fadeConstellation() {
_constellation.getMovieClip()._alpha = (100 * (_adjComboTimeLimit - (_clock - _comboTimerStart))) / _adjComboTimeLimit;
}
function resetInk() {
clearDrawContainer();
_drawPoints = [];
}
function clearDrawContainer() {
_drawContainer.getMovieClip().clear();
}
function clearStars() {
var _local2 = _stars.length;
while (_local2--) {
_stars[_local2].removeMovieClip();
}
_starGrid.initGrid();
}
function drawInk() {
clearDrawContainer();
var _local3 = _drawContainer.getMovieClip();
_local3.moveTo(_drawPoints[0].x, _drawPoints[0].y);
var _local2 = 0;
while (_local2 < _drawPoints.length) {
if (_drawing) {
_local3.blendMode = "screen";
_local3.lineStyle(_local2, 11184640, 100);
} else {
_local3.blendMode = "darken";
_local3.lineStyle(_local2, 1118634, 100);
}
_local3.lineTo(_drawPoints[_local2].x, _drawPoints[_local2].y);
_local2++;
}
}
function addStar() {
_starCount++;
var _local2 = _starContainer.getMovieClip().attachMovie("star", "star" + _starCount, 10000 + _starCount);
var _local3 = _starGrid.newStar();
_local2._x = _local3.x;
_local2._y = _local3.y;
_local2.active = true;
_local2.gotoAndPlay(random(100));
_stars.push(_local2);
}
function resetUI() {
_ui.moveChildToFrame("timeBar", 1);
_ui.moveChildToFrame("levelBar", 1);
_ui.setText("time", "0");
}
function updateLevelTimer() {
var _local3 = Math.floor(_levelTimeLimit - (_clock - _levelTimerStart));
var _local5 = Math.floor(_local3 / 60);
var _local2 = String(_local3 % 60);
if (_local2 < 10) {
_local2 = "0" + _local2;
}
if (_local3 < 10) {
if (!_timeExpiring) {
_ui.startAnimatingChild("timeBar", 101, 104, 30, true);
_soundModule.PlaySound("sfx_warning", 100, 0, 0, 9999);
_timeExpiring = true;
} else {
_ui.animateChild("timeBar");
}
} else {
var _local4 = 101 - Math.floor((100 * _local3) / _levelTimeLimit);
_ui.moveChildToFrame("timeBar", _local4);
}
_ui.setText("time", String((_local5 + ":") + _local2));
}
function updateComboTimer() {
fadeConstellation();
if (comboTimerExpired()) {
killCombo();
clearConstellation();
_cPoints = [];
}
}
function comboTimerExpired() {
return((_clock - _comboTimerStart) >= _adjComboTimeLimit);
}
function killCombo() {
_comboCount = 0;
_adjComboTimeLimit = _comboTimeLimit;
_comboTimerStart = _clock;
setParticleParams();
}
function checkMouseCollision() {
if (!_drawing) {
return(undefined);
}
if (!_mousebtn) {
return(undefined);
}
var _local2 = _stars.length;
while (_local2--) {
if (!_stars[_local2].active) {
continue;
}
var _local5 = _gameContext.getPadManager().getMousePosX();
var _local6 = _gameContext.getPadManager().getMousePosY();
if (_stars[_local2].hitbox.hitTest(_local5, _local6, false)) {
_connectionCount++;
_levelMaxConnections = Math.max(_levelMaxConnections, _connectionCount);
_totalMaxConnections = Math.max(_totalMaxConnections, _connectionCount);
_levelStars++;
_totalStars++;
_connectionTimerStart = _clock;
var _local4 = _stars[_local2]._x;
var _local3 = _stars[_local2]._y;
var _local8 = _stars[_local2].getDepth();
showStarHit(_local4, _local3);
_starGrid.removeStar(_stars[_local2]._x, _stars[_local2]._y);
_stars[_local2] = _starContainer.getMovieClip().attachMovie("star_clicked", "starClicked" + _starCount, _local8);
_stars[_local2]._x = _local4;
_stars[_local2]._y = _local3;
var _local7 = new flash.geom.Point(_local4, _local3);
_starPointList.push(_local7);
_stars.splice(_local2, 1);
addStar();
break;
}
}
}
function hitComet() {
_hitComet = true;
_starCount++;
_connectionCount++;
var _local4 = _comet.getMC()._x;
var _local3 = _comet.getMC()._y;
var _local5 = new flash.geom.Point(_local4, _local3);
_starPointList.push(_local5);
var _local6 = _comet.getMC().getDepth();
_comet.finish();
var _local2 = _starContainer.getMovieClip().attachMovie("shootingStar_clicked", "shootingStarClicked" + _starCount, _local6);
_local2._x = _local4;
_local2._y = _local3;
_soundModule.PlaySound("sfx_comet", 80);
_levelMaxConnections = Math.max(_levelMaxConnections, _connectionCount);
_totalMaxConnections = Math.max(_totalMaxConnections, _connectionCount);
_levelStars++;
_totalStars++;
_connectionTimerStart = _clock;
if (_connectionCount == 1) {
_cPoints = [];
}
}
function checkForLongShot(pt1, pt2) {
var _local3 = pt2.x - pt1.x;
var _local2 = pt2.y - pt1.y;
var _local1 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (_local1 > 300) {
return(true);
}
return(false);
}
function checkEnemyCollision() {
if (comboTimerExpired()) {
return(undefined);
}
if (_levelOver) {
return(undefined);
}
if (!_enemy.isActive()) {
return(undefined);
}
if (_shatter) {
return(undefined);
}
var _local2 = 0;
while (_local2 < (_cPoints.length - 1)) {
if (_enemy instanceof Game.Fireworks) {
if (Game.Geometry.lineSegmentCircleCollision(_cPoints[_local2], _cPoints[_local2 + 1], _enemy.getCenter(), _enemy.getRadius())) {
killCombo();
shatterConstellation();
}
} else if (Game.Geometry.lineSegmentRectCollision(_cPoints[_local2], _cPoints[_local2 + 1], _enemy.getCollisionRect())) {
killCombo();
shatterConstellation();
}
_local2++;
}
}
function checkCometCollision() {
var _local2 = _gameContext.getPadManager().getMousePosX();
var _local3 = _gameContext.getPadManager().getMousePosY();
if (_drawing) {
if (_comet.getMC().star.hitTest(_local2, _local3, false)) {
hitComet();
}
return(undefined);
}
}
function addScore(n) {
_score = _score + n;
_ui.setText("score", _score);
_levelPoints = _levelPoints + n;
_starPoints = _starPoints + n;
}
function setScore(n) {
_score = n;
_ui.setText("score", _score);
}
function getScore() {
return(_score);
}
function getLevelIndex() {
return(_levelIndex);
}
function getTallyData() {
var _local2 = new Object();
_local2.levelIndex = _levelIndex;
_local2.stars = _levelStars;
_local2.timeRemaining = _levelTimeRemaining;
_local2.maxConnections = _levelMaxConnections;
_local2.maxCombos = _levelMaxCombos;
_local2.levelPoints = _levelPoints;
return(_local2);
}
function getEndGameData() {
var _local2 = new Object();
_local2.totalStars = _totalStars;
_local2.maxCombos = _totalMaxCombos;
_local2.maxConnections = _totalMaxConnections;
_local2.totalScore = _score;
return(_local2);
}
function drawConstellation() {
_constellation.getMovieClip()._alpha = 100;
if (_cPoints.length > 1) {
clearConstellation();
var _local3 = _constellation.getMovieClip();
var _local2 = 0;
while (_local2 < _cPoints.length) {
var _local4 = _local3.attachMovie("conStar", "star" + _local2, 100 + _local2);
_local4._x = _cPoints[_local2].x;
_local4._y = _cPoints[_local2].y;
if (_local2 == 0) {
} else {
_local3.moveTo(_cPoints[_local2 - 1].x, _cPoints[_local2 - 1].y);
_local3.lineStyle(3, 16777215, 50);
_local3.lineTo(_cPoints[_local2].x, _cPoints[_local2].y);
if ((_local2 > 0) && (checkForLongShot(_cPoints[_local2], _cPoints[_local2 - 1]))) {
showLongShot(_cPoints[_local2], _cPoints[_local2 - 1]);
}
}
_local2++;
}
}
_shatter = false;
}
function shatterConstellation() {
_soundModule.PlaySound("sfx_shatter", 50);
clearConstellation();
_shatterMCList = [];
var _local5 = 0;
var _local8 = _constellation.getMovieClip();
var _local3 = 0;
while (_local3 < (_cPoints.length - 1)) {
_local5++;
var _local7 = new flash.geom.Point(0, 0);
var _local6 = new flash.geom.Point(_cPoints[_local3 + 1].x - _cPoints[_local3].x, _cPoints[_local3 + 1].y - _cPoints[_local3].y);
var _local4 = flash.geom.Point.interpolate(_local6, _local7, 0.5);
var _local2 = _local8.createEmptyMovieClip("shatter" + _local5, 100000 + _local5);
_local2.lineStyle(3, 16777215, 50);
_local2._x = _cPoints[_local3].x;
_local2._y = _cPoints[_local3].y;
_local2.lineTo(_local4.x, _local4.y);
_local2.vr = -4 + (4 * random(2));
_local2.vy = 0;
_shatterMCList.push(_local2);
_local5++;
_local2 = _local8.createEmptyMovieClip("shatter" + _local5, 100000 + _local5);
_local2.lineStyle(3, 16777215, 50);
_local2._x = _cPoints[_local3].x + _local4.x;
_local2._y = _cPoints[_local3].y + _local4.y;
_local2.lineTo(_local4.x, _local4.y);
_local2.vr = -4 + (4 * random(2));
_local2.vy = 0;
_shatterMCList.push(_local2);
_local3++;
}
_shatter = true;
}
function updateShatter() {
if (!_shatter) {
return(undefined);
}
var _local2 = _shatterMCList.length;
var _local3 = false;
while (_local2--) {
_shatterMCList[_local2]._alpha = _shatterMCList[_local2]._alpha - 5;
if (_shatterMCList[_local2]._alpha < 10) {
_shatterMCList[_local2].removeMovieClip();
_local3 = true;
} else {
_shatterMCList[_local2]._rotation = _shatterMCList[_local2]._rotation + _shatterMCList[_local2].vr;
_shatterMCList[_local2].vy = _shatterMCList[_local2].vy + 2;
_shatterMCList[_local2]._y = _shatterMCList[_local2]._y + _shatterMCList[_local2].vy;
}
}
if (_local3) {
_cPoints = [];
_shatter = false;
}
}
function showLongShot(pt1, pt2) {
_longShot = true;
var _local3 = flash.geom.Point.interpolate(pt1, pt2, 0.5);
var _local2 = 57.3248407643312 * Math.atan2(pt2.y - pt1.y, pt2.x - pt1.x);
if (_local2 < 0) {
_local2 = _local2 + 360;
}
if ((_local2 > 90) && (_local2 < 270)) {
_local2 = _local2 + 180;
}
_longShotMC._x = _local3.x;
_longShotMC._y = _local3.y;
_longShotMC._rotation = _local2;
_longShotMC.gotoAndPlay(2);
}
function showStarHit(x, y) {
_starHitMC._x = x;
_starHitMC._y = y;
_starHitMC.gotoAndPlay(1);
_starHitMC.mult.value.text = _connectionCount;
if (_connectionCount < 18) {
_soundModule.PlaySound("bell" + _connectionCount, 30, 0, 0, 0, true);
} else {
_soundModule.PlaySound("bell18", 30, 0, 0, 0, true);
}
}
function showCombo(pts, x, y) {
if (x < 80) {
x = 80;
}
if (x > 520) {
x = 520;
}
if (y < 180) {
y = 180;
}
if (y > 320) {
y = 320;
}
_comboMC._x = x;
_comboMC._y = y - 50;
_comboMC.gotoAndPlay(1);
_comboMC.mult.gotoAndStop(1);
_comboMC.mult.value.text = (("Combo " + _comboCount) + newline) + pts;
_soundModule.PlaySound("sfx_combo", 40, 0, 0, 0, true);
}
function showAddScore(pts, x, y) {
if (x < 80) {
x = 80;
}
if (x > 520) {
x = 520;
}
if (y < 180) {
y = 180;
}
if (y > 320) {
y = 320;
}
_comboMC._x = x;
_comboMC._y = y - 50;
_comboMC.gotoAndPlay(1);
_comboMC.mult.gotoAndStop(2);
_comboMC.mult.value.text = pts;
}
function getSoundModule() {
return(_soundModule);
}
function toString(Void) {
return("GameData()");
}
function loadTracking() {
_tracker = new GameTrack_AS2(10000);
}
function getTracker() {
return(_tracker);
}
function initSO(Void) {
_so = new CartoonSO("OuterSpaceTrace");
if (_so.__get___info()._bestStars == undefined) {
_so.__get___info()._bestStars = 0;
}
if (_so.__get___info()._bestConnections == undefined) {
_so.__get___info()._bestConnections = 0;
}
if (_so.__get___info()._bestCombos == undefined) {
_so.__get___info()._bestCombos = 0;
}
if (_so.__get___info()._bestScore == undefined) {
_so.__get___info()._bestScore = 0;
}
}
function checkBestScore() {
if (_score > _bestScore) {
return(true);
}
return(false);
}
function checkBestData() {
var _local2 = new Array();
if (_totalStars > _so.__get___info()._bestStars) {
_so.__get___info()._bestStars = _totalStars;
_local2.push(true);
} else {
_local2.push(false);
}
if (_totalMaxConnections > _so.__get___info()._bestConnections) {
_so.__get___info()._bestConnections = _totalMaxConnections;
_local2.push(true);
} else {
_local2.push(false);
}
if (_totalMaxCombos > _so.__get___info()._bestCombos) {
_so.__get___info()._bestCombos = _totalMaxCombos;
_local2.push(true);
} else {
_local2.push(false);
}
if (_score > _so.__get___info()._bestScore) {
_so.__get___info()._bestScore = _score;
_local2.push(true);
} else {
_local2.push(false);
}
return(_local2);
}
function exit() {
_parent.onGameExit();
}
var _invaded = false;
var _maxPoints = 20;
var _starCount = 0;
var _maxStars = 10;
var _connectionCount = 0;
var _comboCount = 0;
var _score = 0;
var _levelIndex = 0;
var _mousebtn = false;
var _drawing = false;
var _levelOver = false;
var _screens = [{id:1, idx:1, spriteName:"titlecard", clipName:"titlecard", depth:1000, xPos:0, yPos:0, regPt:2, w:-1, h:-1, numChild:2, children:[["btn_start", 0, 0, 200, 100, 1, 6, 30, false, 1, 1], ["btn_backtohub", 0, 0, 150, 75, 1, 2, 30, false, 1, 2]]}, {id:1, idx:1, spriteName:"instructions", clipName:"instructions", depth:1000, xPos:0, yPos:0, regPt:2, w:-1, h:-1, numChild:1, children:[["btn_play", 0, 0, 200, 100, 1, 6, 30, false, 1, 1]]}, {id:1, idx:1, spriteName:"loseScreen", clipName:"loseScreen", depth:1000, xPos:0, yPos:0, regPt:2, w:-1, h:-1, numChild:2, children:[["btn_playagain", 0, 0, 200, 100, 1, 6, 30, false, 1, 1], ["btn_backtohub", 0, 0, 150, 75, 1, 2, 30, false, 1, 2]]}, {id:1, idx:1, spriteName:"tallyScreen", clipName:"tallyScreen", depth:1000, xPos:0, yPos:0, regPt:2, w:-1, h:-1, numChild:1, children:[["btn_continue", 30, 0, 90, 60, 1, 6, 30, false, 1, 1]]}, {id:1, idx:1, spriteName:"getReady", clipName:"getReady", depth:1000, xPos:0, yPos:0, regPt:2, w:-1, h:-1, numChild:0}, {id:1, idx:1, spriteName:"loseScreen_noInvaded", clipName:"loseScreen_noInvaded", depth:1000, xPos:0, yPos:0, regPt:2, w:-1, h:-1, numChild:1, children:[["btn_playagain", 0, 0, 200, 100, 1, 6, 30, false, 1, 1]]}];
var _animData = [{anim:"idle1", startFrame:1, endFrame:23, looping:true, frameRate:32}, {anim:"idle2", startFrame:24, endFrame:60, looping:false, frameRate:32}, {anim:"look", startFrame:61, endFrame:137, looping:false, frameRate:32}, {anim:"point", startFrame:138, endFrame:153, looping:false, frameRate:32}, {anim:"clap", startFrame:210, endFrame:268, looping:false, frameRate:32}, {anim:"jump", startFrame:154, endFrame:209, looping:false, frameRate:32}, {anim:"dance", startFrame:269, endFrame:369, looping:false, frameRate:32}, {anim:"hi5", startFrame:370, endFrame:416, looping:false, frameRate:32}];
var _SOUND_DEPTH = 5;
var _BG_DEPTH = 10;
var _PARTICLE_DEPTH = 100;
var _CONSTELLATION_DEPTH = 200;
var _DRAWING_DEPTH = 300;
var _STAR_DEPTH = 400;
var _COMET_DEPTH = 450;
var _ENEMY_DEPTH = 500;
var _BG2_DEPTH = 600;
var _POPUP_DEPTH = 700;
var _CHAR_DEPTH = 800;
var _UI_DEPTH = 900;
var _SCREEN_DEPTH = 1000;
var _CURSOR_DEPTH = 1100;
}
Symbol 610 MovieClip [__Packages.Game.StarGrid] Frame 0
class Game.StarGrid
{
var _grid, _numRows, _numCols;
function StarGrid () {
initGrid();
}
function initGrid() {
_grid = new Array();
_numRows = Math.floor(_totalHeight / _cellHeight);
_numCols = Math.floor(_totalWidth / _cellWidth);
var _local3 = 0;
while (_local3 < _numRows) {
var _local4 = new Array();
var _local2 = 0;
while (_local2 < _numCols) {
_local4[_local2] = 0;
_local2++;
}
_grid.push(_local4);
_local3++;
}
lockRow(0);
lockRow(7);
var _local5 = [5, 6, 5, 10, 5, 11, 6, 0, 6, 4, 6, 5, 6, 6, 6, 7, 6, 8, 6, 9, 6, 10, 6, 11];
while (_local5.length > 0) {
var _local7 = _local5.shift();
var _local6 = _local5.shift();
lockCell(_local7, _local6);
}
_local3 = 0;
while (_local3 < _grid.length) {
_local3++;
}
}
function lockCell(row, col) {
_grid[row][col] = -1;
}
function lockRow(row) {
var _local2 = 0;
while (_local2 < _grid[row].length) {
_grid[row][_local2] = -1;
_local2++;
}
}
function newStar() {
var _local4 = -1;
var _local3;
var _local2;
while (_local4 != 0) {
_local3 = random(_numRows);
_local2 = random(_numCols);
_local4 = _grid[_local3][_local2];
}
_grid[_local3][_local2] = 1;
var _local6 = _cellWidth * (_local2 + Math.random());
if (_local6 < 25) {
_local6 = _local6 + 25;
} else if (_local6 > (_totalWidth - 25)) {
_local6 = _local6 - 25;
}
var _local5 = _cellHeight * (_local3 + Math.random());
if (_local5 < 25) {
_local5 = _local5 + 25;
} else if (_local5 > (_totalHeight - 25)) {
_local5 = _local5 - 25;
}
return(new flash.geom.Point(_local6, _local5));
}
function removeStar(x, y) {
var _local3 = Math.floor(x / _cellWidth);
var _local2 = Math.floor(y / _cellHeight);
_grid[_local2][_local3] = 0;
}
var _totalWidth = 600;
var _totalHeight = 400;
var _cellHeight = 50;
var _cellWidth = 50;
}
Symbol 611 MovieClip [__Packages.Game.ParticleSystem] Frame 0
class Game.ParticleSystem extends MovieClip
{
var _mc, _bmp, _bmpRect, _xvel, _yvel, _radial, _xvar, _yvar, _rotVar, _rotVel, _initScale, _scaleVel, _varDelay, _initAlpha, _alphaVel, _genInterval, _particleLinkage, _blend, _multiple, _particles, _trashcan, _count, _paused, _mcPool, _x, _y;
function ParticleSystem (mc, dataObj) {
super();
_mc = mc;
_mc.createEmptyMovieClip("buffer", 999999);
_mc.buffer._visible = false;
_bmp = new flash.display.BitmapData(600, 400, true, 0);
_bmpRect = new flash.geom.Rectangle(0, 0, 600, 400);
_mc.attachBitmap(_bmp, 20000);
if (!dataObj) {
_xvel = 1;
_yvel = 1;
_radial = true;
_xvar = 3;
_yvar = 3;
_rotVar = 20;
_rotVel = 0;
_initScale = 60;
_scaleVel = -2;
_varDelay = 5;
_initAlpha = 100;
_alphaVel = 5;
_genInterval = 1;
_particleLinkage = "particle";
_blend = "add";
_multiple = 1;
} else {
_xvel = dataObj.xvel;
_yvel = dataObj.yvel;
_radial = dataObj.radial;
_xvar = dataObj.xvar;
_yvar = dataObj.yvar;
_rotVar = dataObj.rotVar;
_initScale = dataObj.initScale;
_scaleVel = dataObj.scaleVel;
_varDelay = dataObj.varDelay;
_initAlpha = dataObj.initAlpha;
_alphaVel = dataObj.alphaVel;
_genInterval = dataObj.genInterval;
_particleLinkage = dataObj.particleLinkage;
}
init();
}
function setParam(pName, pValue) {
this[pName] = pValue;
}
function init() {
_particles = [];
_trashcan = [];
_count = 0;
_paused = true;
_mcPool = new Array();
var _local3 = 0;
while (_local3 < 20) {
_count++;
var _local2 = _mc.attachMovie(_particleLinkage, "p" + _count, _baseDepth + _count);
_local2._x = -100;
_local2._y = -100;
_mcPool.push(_local2);
_local3++;
}
}
function onMouseDown() {
resume();
}
function onMouseUp() {
pause();
}
function pause() {
_paused = true;
}
function resume() {
_paused = false;
}
function update() {
var _local8 = _multiple;
if (_paused == false) {
while (_local8--) {
_count++;
if ((_count % _genInterval) != 0) {
return(undefined);
}
var _local7 = _x + random(_yvar);
var _local6 = (_y + random(_xvar)) - ((_xvar - 1) / 2);
var _local3;
if (_mcPool.length == 0) {
_local3 = _mc.buffer.attachMovie(_particleLinkage, "p" + (100 + _count), 100 + _count);
_mcPool.push(_local3);
} else {
_local3 = _mcPool.pop();
_local3._visible = true;
}
_local3._xscale = (_local3._yscale = _initScale);
_local3._x = _local7;
_local3._y = _local6;
if (_radial == true) {
var _local4 = 57.2958279087978 * random(360);
_local3.vx = _xvel * Math.cos(_local4);
_local3.vy = _yvel * Math.sin(_local4);
} else {
_local3.vx = _xvel;
_local3.vy = _yvel;
}
_local3._rotation = random(_rotVar);
_local3._alpha = _initAlpha;
_local3.delay = _varDelay;
_local3.tick = 0;
_particles.push(_local3);
}
}
var _local5 = _particles.length;
while (_local5--) {
var _local2 = _particles[_local5];
_local2.tick++;
_local2.vy = _local2.vy - _grav;
_local2._y = _local2._y - _local2.vy;
_local2._x = _local2._x + _local2.vx;
_local2._rotation = _local2._rotation - _rotVel;
if (_local2.tick > _local2.delay) {
_local2._alpha = _local2._alpha - _alphaVel;
}
_local2._xscale = (_local2._yscale = _local2._yscale + _scaleVel);
if ((_local2._alpha <= 10) || (_local2._xscale <= 10)) {
_particles.splice(_local5, 1);
_local2._x = -100;
_local2._y = -100;
_local2._visible = false;
_mcPool.push(_local2);
}
_local2.blendMode = _blend;
}
_bmp.fillRect(_bmpRect, 0);
_bmp.draw(_mc.buffer);
}
function cleanUp() {
_paused = true;
var _local3 = _particles.length;
while (_local3--) {
var _local2 = _particles[_local3];
_local2._x = -100;
_local2._y = -100;
_local2._visible = false;
_mcPool.push(_local2);
}
_bmp.fillRect(_bmpRect, 0);
_particles = [];
}
function moveTo(x, y) {
_x = x;
_y = y;
}
var _movesMax = 16;
var _grav = 0;
var _baseDepth = 500;
}
Symbol 612 MovieClip [__Packages.Base.Entity] Frame 0
class Base.Entity
{
var _gameContext, _currentAIState, _nextAIState, _id, _type, _cpuControlled, _networkControlled, _moveSpeed, _destPosX, _destPosY, _startingPositionX, _startingPositionY, _followingAIState;
function Entity (gameContext, entType, id, cpuControlled, networkControlled, state) {
_gameContext = gameContext;
_currentAIState = null;
_nextAIState = new state[undefined](this);
_id = id;
_type = entType;
}
function getID() {
return(_id);
}
function getType(Void) {
return(_type);
}
function isCPUControlled() {
return(_cpuControlled);
}
function isNetworkControlled() {
return(_networkControlled);
}
function setMoveSpeed(speed) {
_moveSpeed = speed;
}
function setDestPosX(pos) {
_destPosX = pos;
}
function setDestPosY(pos) {
_destPosY = pos;
}
function setStartingPositionToPosition() {
_startingPositionX = 0;
_startingPositionY = 0;
}
function getMoveSpeed() {
return(_moveSpeed);
}
function getDestPosX() {
return(_destPosX);
}
function getDestPosY() {
return(_destPosY);
}
function getStartingPositionX() {
return(_startingPositionX);
}
function getStartingPositionY() {
return(_startingPositionY);
}
function isAtDestination() {
return(true);
}
function setNextState(state) {
_nextAIState = new state[undefined](this);
}
function setFollowingState(state) {
_followingAIState = state;
}
function getFollowingState() {
return(_followingAIState);
}
function Update() {
if (_currentAIState != _nextAIState) {
_currentAIState = _nextAIState;
_currentAIState.Entry(_gameContext);
} else if (_currentAIState == _nextAIState) {
_currentAIState.PadInput(_gameContext);
_currentAIState.Update(_gameContext);
if (_currentAIState != _nextAIState) {
_currentAIState.Exit(_gameContext);
delete _currentAIState;
if (!_nextAIState) {
return(1);
}
}
}
return(0);
}
function toString(Void) {
return("Entity()");
}
}
Symbol 613 MovieClip [__Packages.Base.AIState] Frame 0
class Base.AIState extends Base.State
{
function AIState () {
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);
}
}
Symbol 614 MovieClip [__Packages.Game.Comet] Frame 0
class Game.Comet extends Base.Entity
{
var _gameContext, _gameData, _type, _id, _x, _y, _vx, _vy, _speed, _width, _sprite, _cRect, _dir, setNextState;
function Comet (gameContext, dp, w, sp, name) {
super(gameContext, 2, 1, false, false, Game.AIStates.Enemy_Init);
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
_type = 2;
_id = 1;
_x = -200;
_y = -200;
_vx = 0;
_vy = 0;
_speed = sp;
_width = w;
_sprite = new Base.SpriteEntity(_gameContext, _type, _id, name, name, dp, -200, -200, 2, -1, -1);
_cRect = new flash.geom.Rectangle(0, 0, _width, 35);
}
function updateSprite() {
if (_active) {
_sprite.animateSprite();
_x = _x + _vx;
_vy = _vy + 0.05;
_y = _y + _vy;
var _local2 = 57.3248407643312 * Math.atan2(_vy, _vx);
if (_dir == "right") {
_sprite.setRotation(_local2);
} else {
_sprite.setRotation(180 + _local2);
}
_sprite.setPositionXY(_x, _y);
if (_y > 500) {
finish();
}
_cRect.width = _width;
_cRect.height = 35;
}
}
function launch() {
_sprite.startAnimating(1, 25, 30, true);
if (Math.random() < 0.5) {
startFromRight();
} else {
startFromLeft();
}
_active = true;
}
function finish() {
_active = false;
_sprite.setPositionXY(-300, -300);
_gameData.finishComet();
}
function startFromRight() {
_x = 600 + _width;
_y = 75 + Math.random(300);
_vx = -_speed;
_vy = 0;
_sprite.playUnflipped();
_sprite.setPositionXY(_x, _y);
_sprite.setRotation(180 + (57.3248407643312 * Math.atan2(_vy, _vx)));
_dir = "left";
setNextState(Game.AIStates.Enemy_Fly);
_cRect.topLeft = new flash.geom.Point(3, 3);
}
function startFromLeft() {
_x = 1;
_y = 75 + Math.random(300);
_vx = _speed;
_vy = 0;
_sprite.setPositionXY(_x, _y);
_sprite.playFlipped();
_sprite.setRotation(57.3248407643312 * Math.atan2(_vy, _vx));
_dir = "right";
setNextState(Game.AIStates.Enemy_Fly);
_cRect.topLeft = new flash.geom.Point(-_width, 3);
}
function isActive() {
return(_active);
}
function getMC() {
return(_sprite.getMovieClip());
}
function getCollisionRect() {
return(_cRect);
}
function remove() {
_sprite.removeSprite();
}
function toString() {
return("Comet()");
}
var _active = false;
}
Symbol 615 MovieClip [__Packages.Game.AIStates.Enemy_Init] Frame 0
class Game.AIStates.Enemy_Init extends Base.AIState
{
var _entity;
function Enemy_Init (entity) {
super();
_entity = entity;
}
function Entry(gameContext) {
return(undefined);
}
function Update(gameContext) {
return(undefined);
}
function Exit(gameContext) {
return(undefined);
}
function toString(Void) {
return("Enemy_Init()");
}
}
Symbol 616 MovieClip [__Packages.Game.Plane] Frame 0
class Game.Plane extends Base.Entity
{
var _gameContext, _gameData, _type, _id, _x, _y, _vx, _vy, _speed, _width, _frames, _sprite, _cRect, _dir, setNextState;
function Plane (gameContext, dp, w, sp, fr, name) {
super(gameContext, 2, 1, false, false, Game.AIStates.Enemy_Init);
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
_type = 2;
_id = 1;
_x = -200;
_y = -200;
_vx = 0;
_vy = 0;
_speed = sp;
_width = w;
_frames = fr;
_sprite = new Base.SpriteEntity(_gameContext, _type, _id, name, name, dp, -200, -200, 2, -1, -1);
_cRect = new flash.geom.Rectangle(0, 0, _width, 35);
}
function updateSprite() {
if (_active) {
_sprite.animateSprite();
_x = _x + _vx;
_y = _y + _vy;
_sprite.setPositionXY(_x, _y);
if (_dir == "left") {
_cRect.topLeft = new flash.geom.Point(_x - _width, _y);
if (_x < 0) {
finish();
}
} else {
_cRect.topLeft = new flash.geom.Point(_x, _y);
if (_x > 600) {
finish();
}
}
_cRect.width = _width;
_cRect.height = 35;
}
}
function launch() {
if (Math.random() < 0.5) {
startFromRight();
} else {
startFromLeft();
}
_active = true;
_sprite.startAnimating(1, _frames, 31, true);
}
function finish() {
_active = false;
_gameData.finishEnemy();
}
function startFromRight() {
_x = 600 + _width;
_y = 75 + (200 * Math.random());
_vx = -_speed;
_sprite.playFlipped();
_sprite.setPositionXY(_x, _y);
_dir = "left";
setNextState(Game.AIStates.Enemy_Fly);
_cRect.topLeft = new flash.geom.Point(3, 3);
var _local2 = _sprite.getMovieClip();
_local2.banner.gotoAndStop(2);
}
function startFromLeft() {
_x = -_width;
_y = 75 + (200 * Math.random());
_vx = _speed;
_sprite.setPositionXY(_x, _y);
_sprite.playUnflipped();
_dir = "right";
setNextState(Game.AIStates.Enemy_Fly);
_cRect.topLeft = new flash.geom.Point(-_width, 3);
var _local2 = _sprite.getMovieClip();
_local2.banner.gotoAndStop(1);
}
function isActive() {
return(_active);
}
function getMC() {
return(_sprite.getMovieClip());
}
function getCollisionRect() {
return(_cRect);
}
function remove() {
_sprite.removeSprite();
}
function toString() {
return("Plane()");
}
var _active = false;
}
Symbol 617 MovieClip [__Packages.Game.AIStates.Enemy_Fly] Frame 0
class Game.AIStates.Enemy_Fly extends Base.AIState
{
var _entity;
function Enemy_Fly (entity) {
super();
_entity = entity;
}
function Entry(gameContext) {
return(undefined);
}
function Update(gameContext) {
_entity.updateSprite();
return(undefined);
}
function Exit(gameContext) {
return(undefined);
}
function toString(Void) {
return("Enemy_Fly()");
}
}
Symbol 618 MovieClip [__Packages.Game.Balloon] Frame 0
class Game.Balloon extends Base.Entity
{
var _gameContext, _gameData, _type, _id, _x, _y, _vx, _vy, _sprite, _cRect, setNextState;
function Balloon (gameContext, dp, name) {
super(gameContext, 2, 1, false, false, Game.AIStates.Enemy_Init);
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
_type = 2;
_id = 1;
_x = -200;
_y = -200;
_vx = 0;
_vy = 0;
_sprite = new Base.SpriteEntity(_gameContext, _type, _id, name, name, dp, -200, -200, 2, -1, -1);
_cRect = new flash.geom.Rectangle(0, 0, 73, 35);
}
function updateSprite() {
if (_active) {
_sprite.animateSprite();
_x = _x + _vx;
_y = _y + _vy;
_sprite.setPositionXY(_x, _y);
_cRect.topLeft = new flash.geom.Point(_x, _y);
if (_y < -100) {
finish();
}
_cRect.width = 35;
_cRect.height = 35;
}
}
function finish() {
_active = false;
_gameData.finishEnemy();
}
function launch() {
_x = 50 + (500 * Math.random());
_y = 420;
_vx = 0;
_vy = -2;
_sprite.setPositionXY(_x, _y);
_sprite.playUnflipped();
setNextState(Game.AIStates.Enemy_Fly);
_cRect.topLeft = new flash.geom.Point(3, 3);
_active = true;
}
function isActive() {
return(_active);
}
function getMC() {
return(_sprite.getMovieClip());
}
function getCollisionRect() {
return(_cRect);
}
function remove() {
_sprite.removeSprite();
}
function toString() {
return("Balloon()");
}
var _active = false;
}
Symbol 619 MovieClip [__Packages.CartoonSO] Frame 0
class CartoonSO
{
var _$gameName, _$so;
function CartoonSO (gName) {
_$gameName = gName;
_$so = SharedObject.getLocal(_$USERS_SO, _$USERS_SO_PATH);
}
function get _info() {
if (_$so.data[_$gameName] == undefined) {
_$so.data[_$gameName] = {};
}
return(_$so.data[_$gameName]);
}
static var _$USERS_SO = "CN_users";
static var _$USERS_SO_PATH = "/";
}
Symbol 620 MovieClip [__Packages.GameTrack_AS2] Frame 0
class GameTrack_AS2
{
var trkConnection;
function GameTrack_AS2 (level) {
trkConnection = new LocalConnection();
var _local2 = new Date().getTime();
loadMovieNum ("tracker.swf", level);
}
function sendEventReplay() {
trackNewEvent("replay");
}
function sendEventWin() {
trackNewEvent("win");
}
function sendEventLose() {
trackNewEvent("lose");
}
function sendEventCustom(event) {
trackNewEvent("cust_" + event);
}
function trackNewEvent(eventName) {
trkConnection.send("trkConnection", "sendTracking", eventName);
}
}
Symbol 621 MovieClip [__Packages.Game.GameStates.G_Pause] Frame 0
class Game.GameStates.G_Pause extends Base.GameState
{
var _gameContext, _gameData, _screen;
function G_Pause (gameContext) {
super();
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
}
function Entry() {
}
function Update() {
if (_screen == null) {
_gameData.hideCursor();
var _local2 = _gameData.getScreen(1);
_gameContext.getUIManager().showScreen(_local2);
_screen = _gameContext.getUIManager().getScreen();
_screen.startAnimating(1, 11, 30, false);
} else {
_screen.animateSprite();
}
if (_exit && (!_screen.isAnimating())) {
_gameContext.getGameManager().setNextState(Game.GameStates.G_Init);
}
if (_gameContext.getUIManager().getUIReturnVal() == 1) {
_gameData.showCursor();
_screen.moveChildToFrame("btn_play", 6);
_screen.startAnimating(30, 41, 30, false);
_exit = true;
_gameData.getSoundModule().PlaySound("bell15", 30);
}
if (_exit) {
_gameContext.getUIManager().removeScreen();
_gameContext.getGameManager().setPauseState(null);
}
}
function Exit() {
}
var _exit = false;
}
Symbol 622 MovieClip [__Packages.Game.GameStates.G_Init] Frame 0
class Game.GameStates.G_Init extends Base.GameState
{
var _gameContext, _gameData;
function G_Init (gameContext) {
super();
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
}
function Entry() {
_gameContext.getUIManager().removeScreen();
_gameData.reset();
_gameData.init();
}
function Update() {
_gameContext.getGameManager().setNextState(Game.GameStates.G_GetReady);
}
function Exit() {
}
}
Symbol 623 MovieClip [__Packages.Game.GameStates.G_GetReady] Frame 0
class Game.GameStates.G_GetReady extends Base.GameState
{
var _gameContext, _gameData, _timerStart, _screen;
function G_GetReady (gameContext) {
super();
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
}
function Entry() {
_timerStart = _gameContext.getTimeManager().getCurTime();
_gameData.getSoundModule().PlayMusic("music_inPlay");
var _local2 = _gameData.getScreen(4);
_gameContext.getUIManager().showScreen(_local2);
_screen = _gameContext.getUIManager().getScreen();
var _local3 = String("Level " + (_gameData.getLevelIndex() + 1));
_screen.setChildText("lvlprompt", "lvltxt", _local3);
_screen.setChildText("lvlprompt", "subtext", _gameData.getReadyMessage());
_screen.startAnimating(1, 11, 30, false);
}
function Update() {
_screen.animateSprite();
_gameData.updateCursor();
if (_exit && (!_screen.isAnimating())) {
_gameContext.getGameManager().setNextState(Game.GameStates.G_InPlay);
}
if ((!_exit) && ((_gameContext.getTimeManager().getCurTime() - _timerStart) > _delay)) {
_screen.startAnimating(30, 41, 30, false);
_exit = true;
}
}
function Exit() {
_gameContext.getUIManager().removeScreen();
}
var _delay = 4;
var _exit = false;
}
Symbol 624 MovieClip [__Packages.Game.GameStates.G_InPlay] Frame 0
class Game.GameStates.G_InPlay extends Base.GameState
{
var _gameContext, _gameData;
function G_InPlay (gameContext) {
super();
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
}
function Entry() {
_gameData.showCursor();
_gameData.getSoundModule().PlayMusic("music_inPlay");
}
function Update() {
_gameData.updateClock();
_gameData.checkForCheat();
_gameData.checkUIButtons();
_gameData.updateSky();
_gameData.updateCursor();
_gameData.checkMouse();
_gameData.updateDrawing();
_gameData.updateEntities();
_gameData.checkCometCollision();
_gameData.checkEnemyCollision();
_gameData.updateComboTimer();
_gameData.updateParticles();
_gameData.updateLevelBar();
_gameData.updateLevelTimer();
_gameData.updateCharacters();
_gameData.updateShatter();
_gameData.checkForWin();
}
function Exit() {
_gameData.hideCursor();
}
}
Symbol 625 MovieClip [__Packages.Game.Heli] Frame 0
class Game.Heli extends Base.Entity
{
var _gameContext, _gameData, _type, _id, _x, _y, _vx, _vy, _speed, _width, _sprite, _cRect, _dir, _goalX, _timeout, _ydir, setNextState;
function Heli (gameContext, dp, w, sp, name) {
super(gameContext, 2, 1, false, false, Game.AIStates.Enemy_Init);
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
_type = 2;
_id = 1;
_x = -200;
_y = -200;
_vx = 0;
_vy = 0;
_speed = sp;
_width = w;
_sprite = new Base.SpriteEntity(_gameContext, _type, _id, name, name, dp, -200, -200, 2, -1, -1);
_cRect = new flash.geom.Rectangle(0, 0, _width, 35);
}
function updateSprite() {
_sprite.animateSprite();
if (_active && (!_hover)) {
_x = _x + _vx;
_y = _y + _vy;
_sprite.setPositionXY(_x, _y);
_cRect.topLeft = new flash.geom.Point(_x - (_width / 2), _y);
if (_dir == -1) {
if (_x < -100) {
finish();
}
if (_x < _goalX) {
_hover = true;
_timeout = _global.setTimeout(this, "stopHovering", 3000);
}
} else {
_cRect.topLeft = new flash.geom.Point(_x, _y);
if (_x > 700) {
finish();
}
if (_x > _goalX) {
_hover = true;
_timeout = _global.setTimeout(this, "stopHovering", 3000);
}
}
if (_ydir == -1) {
if (_y < _ymin) {
_hover = true;
_timeout = _global.setTimeout(this, "stopHovering", 3000);
}
} else if (_y > _ymax) {
_hover = true;
_timeout = _global.setTimeout(this, "stopHovering", 3000);
}
_cRect.width = _width;
_cRect.height = 40;
}
}
function stopHovering() {
_hover = false;
if ((_vy < 0) || (_vy > 0)) {
_vy = 0;
_vx = _speed * _dir;
_ydir = -_ydir;
} else if ((_vx < 0) || (_vx > 0)) {
_vx = 0;
_vy = _speed * _ydir;
}
_goalX = _goalX + (_dir * 100);
}
function launch() {
_global.clearTimeout(_timeout);
if (Math.random() < 0.5) {
startFromRight();
} else {
startFromLeft();
}
_active = true;
_sprite.startAnimating(1, 2, 15, true);
}
function finish() {
_active = false;
_global.clearTimeout(_timeout);
_gameData.finishEnemy();
}
function startFromRight() {
_x = 600 + _width;
_y = 75 + Math.random(300);
_vx = -_speed;
_sprite.playUnflipped();
_sprite.setPositionXY(_x, _y);
_dir = -1;
_ydir = 1;
setNextState(Game.AIStates.Enemy_Fly);
_cRect.topLeft = new flash.geom.Point(3, 3);
_goalX = 500;
}
function startFromLeft() {
_x = -_width;
_y = 75 + Math.random(300);
_vx = _speed;
_sprite.setPositionXY(_x, _y);
_sprite.playFlipped();
_dir = 1;
_ydir = 1;
setNextState(Game.AIStates.Enemy_Fly);
_cRect.topLeft = new flash.geom.Point(-_width, 3);
_goalX = 100;
}
function isActive() {
return(_active);
}
function getMC() {
return(_sprite.getMovieClip());
}
function getCollisionRect() {
return(_cRect);
}
function remove() {
_sprite.removeSprite();
}
function toString() {
return("Heli()");
}
var _ymin = 75;
var _ymax = 250;
var _active = false;
var _hover = false;
}
Symbol 626 MovieClip [__Packages.Game.Fireworks] Frame 0
class Game.Fireworks extends Base.Entity
{
var _gameContext, _gameData, _type, _id, _x, _y, _vx, _vy, _radius, _centerPoint, _sprite;
function Fireworks (gameContext, dp, r, name) {
super(gameContext, 2, 1, false, false, Game.AIStates.Enemy_Init);
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
_type = 2;
_id = 1;
_x = -200;
_y = -200;
_vx = 0;
_vy = 0;
_radius = r;
_centerPoint = new flash.geom.Point(_x, _y);
_sprite = new Base.SpriteEntity(_gameContext, _type, _id, name, name, dp, -200, -200, 2, -1, -1);
}
function updateSprite() {
_sprite.animateSprite();
if (_sprite.getCurrentFrame() == 49) {
_active = true;
}
if (_active && (!_sprite.isAnimating())) {
finish();
}
}
function getCenter() {
return(_centerPoint);
}
function getRadius() {
return(_radius);
}
function launch() {
var _local4 = random(3);
switch (_local4) {
case 0 :
_sprite.changeSprite("Fireworks1", "Fireworks1");
_radius = 60;
break;
case 1 :
_sprite.changeSprite("Fireworks2", "Fireworks2");
_radius = 75;
break;
case 2 :
_sprite.changeSprite("Fireworks3", "Fireworks3");
_radius = 60;
}
var _local3 = 50 + (500 * Math.random());
var _local2 = 50 + (200 * Math.random());
_centerPoint = new flash.geom.Point(_local3, _local2);
_sprite.setPositionXY(_local3, _local2);
_sprite.startAnimating(1, 77, 30, false);
}
function finish() {
_active = false;
_gameData.finishEnemy();
}
function isActive() {
return(_active);
}
function getMC() {
return(_sprite.getMovieClip());
}
function remove() {
_active = false;
_sprite.removeSprite();
_centerPoint = new flash.geom.Point(-400, -400);
}
function toString() {
return("Fireworks()");
}
var _active = false;
}
Symbol 627 MovieClip [__Packages.Game.GameStates.G_Tally] Frame 0
class Game.GameStates.G_Tally extends Base.GameState
{
var _gameContext, _gameData, _ui, _screen;
function G_Tally (gameContext) {
super();
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
_ui = _gameData.getUI();
}
function Entry() {
_gameData.playCharacterAnimation("idle1");
var _local2 = _gameData.getScreen(3);
_gameContext.getUIManager().showScreen(_local2);
_screen = _gameContext.getUIManager().getScreen();
_gameData.getSoundModule().PlaySound("sfx_tally", 80);
tabulate();
_screen.startAnimating(1, 11, 30, false);
}
function Update() {
_screen.animateSprite();
if (_exit && (!_screen.isAnimating())) {
_gameData.nextLevel();
_gameContext.getGameManager().setNextState(Game.GameStates.G_GetReady);
}
_gameData.updateCursor();
if (_gameContext.getUIManager().getUIReturnVal() == 1) {
_ui.getChild("levelBar").play();
_gameData.getSoundModule().PlaySound("bell15", 30);
_screen.moveChildToFrame("btn_continue", 6);
_screen.startAnimating(30, 41, 30, false);
_exit = true;
}
if (_screen.getCurrentFrame() == 109) {
_ui.getChild("timerBar").gotoAndStop(1);
}
if (_screen.isMouseOverChild("btn_continue") && (_gameContext.getPadManager().getMouseJustPressed())) {
_screen.moveChildToFrame("btn_continue", 7);
}
}
function Exit() {
_gameContext.getUIManager().removeScreen();
_gameData.getSoundModule().PlayMusic("music_inPlay");
}
function tabulate() {
var _local3 = _screen.getMovieClip().content;
var _local2 = _gameData.getTallyData();
var _local7 = 0;
_local3.levelComplete.text = ("Level " + (_local2.levelIndex + 1)) + " Complete!";
_local3.stars.text = _local2.stars + " stars";
var _local4 = _local2.timeRemaining * 100;
_local3.timeBonus.text = _local2.timeRemaining + " x 100";
var _local6 = _local2.maxConnections * 100;
_local3.connectionBonus.text = _local2.maxConnections + " x 100";
var _local5 = _local2.maxCombos * 100;
_local3.comboBonus.text = _local2.maxCombos + " x 100";
_local3.levelScore.text = _local2.levelPoints;
_local7 = ((_local4 + _local6) + _local5) + _local2.levelPoints;
_local3.totalScore.text = _local7;
_gameData.addScore((_local4 + _local6) + _local5);
}
var _exit = false;
}
Symbol 628 MovieClip [__Packages.Game.GameStates.G_LoseGame] Frame 0
class Game.GameStates.G_LoseGame extends Base.GameState
{
var _gameContext, _gameData, _screen;
function G_LoseGame (gameContext) {
super();
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
}
function Entry() {
_parent.onWin(1);
_gameData.getTracker().sendEventCustom("fosters_lose");
_gameData.getSoundModule().PlayMusic("none");
_gameData.getSoundModule().PlaySound("music_gameOver");
var _local3;
if (_gameData._invaded) {
_local3 = _gameData.getScreen(2);
} else {
_local3 = _gameData.getScreen(5);
}
_gameContext.getUIManager().showScreen(_local3);
_screen = _gameContext.getUIManager().getScreen();
_screen.startAnimating(1, 11, 30, false);
tabulate();
}
function Update() {
_screen.animateSprite();
_gameData.updateCursor();
if (_gameContext.getUIManager().getUIReturnVal() == 1) {
_gameData.getTracker().sendEventReplay();
_gameData.getSoundModule().PlaySound("bell15", 30);
_gameData.resetUI();
_gameContext.getGameManager().setNextState(Game.GameStates.G_TitleCard);
}
if (_gameData._invaded) {
if (_gameContext.getUIManager().getUIReturnVal() == 2) {
_gameData.getSoundModule().PlaySound("bell15", 30);
_gameData.exit();
}
}
}
function Exit() {
}
function tabulate() {
var _local4 = _gameData.getEndGameData();
var _local5 = 0;
_screen.setChildText("content", "stars", String(_local4.totalStars + " stars"));
_screen.setChildText("content", "maxConnections", String(_local4.maxConnections));
_screen.setChildText("content", "maxCombos", String(_local4.maxCombos));
_screen.setChildText("content", "totalScore", String(_local4.totalScore));
var _local2 = _screen.getMovieClip().content;
var _local3 = _gameData.checkBestData();
if (_local3[0]) {
_local2.starsBest.gotoAndStop(2);
} else {
_local2.starsBest.gotoAndStop(1);
}
if (_local3[1]) {
_local2.connectionsBest.gotoAndStop(2);
} else {
_local2.connectionsBest.gotoAndStop(1);
}
if (_local3[2]) {
_local2.combosBest.gotoAndStop(2);
} else {
_local2.combosBest.gotoAndStop(1);
}
if (_local3[3]) {
_local2.scoreBest.gotoAndStop(2);
} else {
_local2.scoreBest.gotoAndStop(1);
}
}
}
Symbol 629 MovieClip [__Packages.Game.Geometry] Frame 0
class Game.Geometry
{
function Geometry () {
}
static function lineRectCollision(pt0, pt1, crect) {
var _local7 = crect.topLeft;
var _local6 = new flash.geom.Point(crect.right, crect.top);
var _local5 = crect.bottomRight;
var _local4 = new flash.geom.Point(crect.left, crect.bottom);
if (pointAboveLine(_local7, pt0, pt1) && (!pointAboveLine(_local6, pt0, pt1))) {
return(true);
}
if (pointAboveLine(_local6, pt0, pt1) && (!pointAboveLine(_local5, pt0, pt1))) {
return(true);
}
if (pointAboveLine(_local5, pt0, pt1) && (!pointAboveLine(_local4, pt0, pt1))) {
return(true);
}
if (pointAboveLine(_local4, pt0, pt1) && (!pointAboveLine(_local7, pt0, pt1))) {
return(true);
}
return(false);
}
static function pointAboveLine(pt, pt0, pt1) {
var _local1 = pt1.x - pt0.x;
if (_local1 == 0) {
_local1 = 1E-9;
}
var _local3 = (pt1.y - pt0.y) / _local1;
var _local4 = pt0.y - (_local3 * pt0.x);
var _local5 = (_local3 * pt.x) + _local4;
if (_local5 > pt.y) {
return(true);
}
return(false);
}
static function lineSegmentRectCollision(pt1, pt2, rect) {
var _local3 = 0.05;
var _local1 = 0;
while (_local1 < 1) {
var _local2 = flash.geom.Point.interpolate(pt1, pt2, _local1);
if (rect.containsPoint(_local2)) {
return(true);
}
_local1 = _local1 + _local3;
}
return(false);
}
static function lineSegmentCircleCollision(pt1, pt2, ptCirc, r) {
var _local7 = 0.05;
var _local1 = 0;
while (_local1 < 1) {
var _local4 = flash.geom.Point.interpolate(pt1, pt2, _local1);
var _local3 = _local4.x - ptCirc.x;
var _local2 = _local4.y - ptCirc.y;
if (((_local3 * _local3) + (_local2 * _local2)) < (r * r)) {
return(true);
}
_local1 = _local1 + _local7;
}
return(false);
}
}
Symbol 630 MovieClip [__Packages.Game.GameStates.G_Instructions] Frame 0
class Game.GameStates.G_Instructions extends Base.GameState
{
var _gameContext, _gameData, _screen;
function G_Instructions (gameContext) {
super();
_gameContext = gameContext;
_gameData = _gameContext.getGameData();
}
function Entry() {
var _local2 = _gameData.getScreen(1);
_gameContext.getUIManager().showScreen(_local2);
_screen = _gameContext.getUIManager().getScreen();
_screen.startAnimating(1, 11, 30, false);
_gameData.initBG();
}
function Update() {
_screen.animateSprite();
if (_screen.isMouseOverChild("btn_play") && (_gameContext.getPadManager().getMouseJustPressed())) {
_screen.moveChildToFrame("btn_play", 7);
}
if (_exit && (!_screen.isAnimating())) {
_gameContext.getGameManager().setNextState(Game.GameStates.G_Init);
}
if (_gameContext.getUIManager().getUIReturnVal() == 1) {
_screen.moveChildToFrame("btn_play", 6);
_screen.startAnimating(30, 41, 30, false);
_exit = true;
_gameData.getSoundModule().PlaySound("bell15", 30, 0, 0, 0, true);
}
}
function Exit() {
}
var _exit = false;
}
Symbol 631 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 632 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;
}
}