Frame 1
var mContextMenu;
var tItemHandler = function (obj, item) {
};
var tMenuHandler = function (obj, menuObj) {
};
mContextMenu = new ContextMenu(tMenuHandler);
mContextMenu.hideBuiltInItems();
mContextMenu.customItems.push(new ContextMenuItem("\u00A9 Sean Cooper 2006", tItemHandler));
_root.menu = mContextMenu;
_global.mURLWindow = "_blank";
stop();
Frame 10
mTimeStamp = ((mTimeStamp == undefined) ? (getTimer()) : (mTimeStamp));
_Intro._Loader.gotoAndStop(int((this.getBytesLoaded() / this.getBytesTotal()) * 100) + 1);
if (this.getBytesTotal() == this.getBytesLoaded()) {
_Intro.mLoaded = true;
_Intro.play();
}
if ((this.getBytesTotal() == this.getBytesLoaded()) && (_Intro.mFinished)) {
gotoAndPlay ("FRONTEND");
}
Frame 11
gotoAndPlay ("LOAD");
Frame 40
_global.mStats = new CStats();
_global.mSFXActive = true;
this.mSecurityKEY = "SEANCOOPERSECURITYKEY";
gotoAndPlay ("Simple.Frontend");
Frame 51
play();
Frame 52
function PlayLevel(tLevelIndex) {
_global.mArenaIndex = tLevelIndex;
_global.mKeyControl = true;
delete onEnterFrame;
play();
}
function PanelProcess() {
_alpha = (_alpha + 10);
if (_alpha > 100) {
_alpha = 100;
}
if (mNewScreen == mCurrentScreen) {
return(undefined);
}
mCurrentScreen.mDX = 15;
mCurrentScreen.onEnterFrame = function () {
this._x = this._x + this.mDX;
this.mDX = this.mDX * 1.2;
if (this._x > (mScreenPos.x * 3)) {
this._visible = false;
delete this.onEnterFrame;
}
};
mCurrentScreen = mNewScreen;
_global.mCurrentScreen = mCurrentScreen;
mCurrentScreen.mScreenPos = mScreenPos;
mCurrentScreen._x = -mScreenPos.x;
mCurrentScreen._y = mScreenPos.y;
mCurrentScreen._visible = true;
mCurrentScreen.mDX = 50;
mCurrentScreen.onEnterFrame = function () {
this._x = this._x + this.mDX;
if ((mScreenPos.x - this._x) < 500) {
this.mDX = this.mDX * 0.95;
}
if (this.mDX < 1) {
this.mDX = 1;
}
if (this._x > mScreenPos.x) {
this._x = mScreenPos.x;
delete this.onEnterFrame;
}
};
}
_alpha = 0;
stop();
trace("FRONTEND");
_global.mArenaIndex = 0;
_global.mKeyControl = false;
_global.mStats.Update_FE(_StatsScreen, _PlayScreen);
var mCurrentScreen = undefined;
var mNewScreen = ((_global.mCurrentScreen != undefined) ? (_global.mCurrentScreen) : (_HelpScreen));
var mScreenPos = (new flash.geom.Point(_FE_Pos._x, _FE_Pos._y));
_FE_Pos._visible = false;
onEnterFrame = function () {
PanelProcess();
};
Frame 53
onEnterFrame = function () {
_alpha = (_alpha - 10);
if (_alpha < 0) {
_alpha = 0;
play();
delete onEnterFrame;
}
};
stop();
Frame 54
_alpha = 100;
Frame 55
function Pause() {
_Arena._TheArena.mState = ((_Arena._TheArena.mState == "play") ? "stop" : "play");
_PauseScreen._visible = _Arena._TheArena.mState == "stop";
UpdateStats(mWhich);
}
function UpdateStats(tWhich) {
mWhich = tWhich;
if (tWhich == "global") {
_global.mStats.Update_FE(_PauseScreen._StatsScreen);
if (_PauseScreen._TAB_Global.getDepth() < _PauseScreen._TAB_Level.getDepth()) {
_PauseScreen._TAB_Level.swapDepths(_PauseScreen._TAB_Global);
}
} else if (tWhich == "level") {
_Arena._TheArena.mStats.Update_FE(_PauseScreen._StatsScreen);
if (_PauseScreen._TAB_Global.getDepth() > _PauseScreen._TAB_Level.getDepth()) {
_PauseScreen._TAB_Level.swapDepths(_PauseScreen._TAB_Global);
}
}
}
stop();
var mTimer = getTimer();
_HUD._visible = false;
_PauseScreen._visible = false;
_Status.mState = "READY";
var mWhich = "level";
UpdateStats(mWhich);
var mFirstTime = true;
_Status.play();
onEnterFrame = function () {
if (mFirstTime) {
mTimer = getTimer();
mFirstTime = false;
}
if (_Status.mState != "GO") {
_Arena._TheArena.mState = "stop";
}
if (((getTimer() - mTimer) > 1500) && (_Status.mState == "READY")) {
_Status.play();
_Status.mState = "SET";
}
if (((getTimer() - mTimer) > 3000) && (_Status.mState == "SET")) {
_Status.play();
_Status.mState = "GO";
_Arena._TheArena.mState = "play";
_HUD._visible = true;
}
if ((getTimer() - mTimer) > 4500) {
_Status.play();
delete onEnterFrame;
}
};
var myListener = new Object();
myListener.onKeyDown = function () {
if (((Key.getCode() == 80) || (Key.getCode() == 27)) && (_Status.mState == "GO")) {
Pause();
}
};
Key.addListener(myListener);
Frame 56
Key.removeListener(myListener);
onEnterFrame = function () {
_alpha = (_alpha - 10);
if (_alpha < 0) {
_alpha = 0;
play();
delete onEnterFrame;
}
};
trace("FADE OUT ARENA");
stop();
Frame 57
gotoAndStop (51);
trace("END THE LEVEL");
Frame 58
stop();
stop();
onEnterFrame = function () {
trace(_Frontend.mShape);
};
Frame 59
stop();
_global.mArenaIndex = 1;
Frame 60
stop();
_global.mArenaIndex = 1;
Frame 61
stop();
_global.mArenaIndex = 1;
Frame 62
stop();
_global.mArenaIndex = 1;
Instance of Symbol 81 MovieClip [Wheel] in Frame 62
onClipEvent (load) {
_parent.AddWheel(this);
}
Frame 63
stop();
_global.mArenaIndex = 1;
Frame 64
stop();
_global.mArenaIndex = 1;
Symbol 25 MovieClip Frame 1
var mTimeStamp = getTimer();
var mFrameRate = 24;
onEnterFrame = function () {
if ((getTimer() - mTimeStamp) > (1000 / mFrameRate)) {
mTimeStamp = mTimeStamp + (1000 / mFrameRate);
this.nextFrame();
if (mFade == true) {
_alpha = (_alpha - 7);
}
}
};
onRelease = function () {
getURL ("http://www.crazymonkeygames.com", _global.mURLWindow);
};
Symbol 25 MovieClip Frame 100
mFade = true;
Symbol 25 MovieClip Frame 116
mFinished = true;
stop();
_parent.play();
Symbol 33 Button
on (release) {
getURL ("http://www.games.seantcooper.com", _global.mURLWindow);
}
Symbol 41 MovieClip Frame 1
stop();
Symbol 42 MovieClip Frame 95
if (mLoaded == true) {
_Loader._visible = false;
gotoAndPlay ("SKIPLOADER");
}
Symbol 42 MovieClip Frame 240
stop();
Symbol 42 MovieClip Frame 261
mFinished = true;
Symbol 253 MovieClip [__Packages.CArena] Frame 0
class CArena extends MovieClip
{
var mGravity, gCounter, mState, mFriction, mLineManager, mTimeSlice, mEdgeDraw, _FloorDP, mBackground, _parent, mCamera, mMap, mStats, mFirstTime, _visible, mWheel, mCollisionDraw, onEnterFrame, mSoundIndex, mSoundList;
function CArena () {
super();
mGravity = new flash.geom.Point(0, 3);
gCounter = 0;
mState = "step";
mFriction = 0;
mLineManager = new CLineManager(this);
mTimeSlice = getTimer();
mEdgeDraw = _FloorDP;
mEdgeDraw._x = 0;
mEdgeDraw._y = 0;
mBackground = _parent._Background;
mCamera = new CCamera(this, 720, 406);
mMap = new CMap(this);
mStats = new CStats(this);
mFirstTime = true;
mBackground._visible = (_visible = false);
_root._HUD._Space._visible = false;
}
function Start() {
mLineManager.Compile(mWheel.mRadius);
mCollisionDraw.clear();
mFirstTime = false;
Process();
mBackground._visible = (_visible = true);
mState = "play";
onEnterFrame = Process;
}
function AddLineCollection(tNodeList, tObject) {
if (tObject != undefined) {
}
var _local2 = 0;
while (_local2 < (tNodeList.length - 1)) {
AddLine(tNodeList[_local2], tNodeList[_local2 + 1]);
_local2++;
}
}
function AddLine(node1, node2) {
mLineManager.AddLine(node1, node2);
}
function AddWheel(mcWheel) {
mWheel = mcWheel;
mWheel.mArena = this;
mCamera.SetTrackObject(mWheel);
}
function AddObject(tObject, tType) {
mMap.AddObject(tObject, tType);
}
function Process() {
_root._FPS.Update();
if ((mState != "stop") || (mState == "step")) {
while ((getTimer() - mTimeSlice) > mFrameRate) {
gCounter++;
mWheel.Process();
mCamera.Process();
mTimeSlice = mTimeSlice + mFrameRate;
}
UpdateHUD();
mStats.Update();
} else {
mTimeSlice = getTimer();
}
if (mState == "step") {
mState = "stop";
}
if ((_global.mKeyControl && (Key.isDown(32))) && (mMap.mOverExit)) {
ExitArena();
}
}
function ExitArena() {
if (mMap.mOverExit) {
_global.mStats.CompareAndUpdate(mStats);
_global.mStats.ArenaComplete();
_parent._parent.play();
}
_parent._parent.play();
}
function UpdateHUD() {
var _local3 = _root._HUD;
_local3.mBarrelCount = Pad0(mMap.mBarrelCount, 2);
_local3.mStarCount = Pad0(mMap.mStarCount, 2);
if (mMap.mOverExit) {
_local3._Space._visible = true;
}
}
function Pad0(tNumber, tPAD) {
var _local1 = String(tNumber);
while (_local1.length < tPAD) {
_local1 = "0" + _local1;
}
return(_local1);
}
function PlayMusic() {
return(undefined);
}
function Music_NextLoop() {
mSoundIndex = (mSoundIndex + 1) % mSoundList.length;
trace(mSoundIndex);
mSoundList[mSoundIndex].start();
}
static var mFrameRate = 33.3333333333333;
static var mMusicVolume = 20;
}
Symbol 254 MovieClip [__Packages.CWheel] Frame 0
class CWheel extends MovieClip
{
var mRadius, _width, pRadius, mCircumference, mFriction, mMass, mDelta, mInertia, mPosition, _x, _y, mRotation, mAngularVelocity, mTrackPosition, mTrackPositionIndex, mControlLeft, mControlRight, _visible, mArena, _Interior, mCollide, mDeltaTravelledTotal, mDeltaTravelled;
function CWheel () {
super();
mRadius = _width / 2;
pRadius = new flash.geom.Point(mRadius, mRadius);
mCircumference = (mRadius * 2) * Math.PI;
mFriction = 1;
mMass = 1;
mDelta = new flash.geom.Point(0, 0);
mInertia = new flash.geom.Point(0, 0);
mPosition = new flash.geom.Point(_x, _y);
mRotation = 0;
mAngularVelocity = 0;
mTrackPosition = new Array(20);
mTrackPositionIndex = 0;
mControlLeft = (mControlRight = false);
_visible = true;
}
function Process() {
var _local5 = mPosition.clone();
mCount = 0;
mDelta = mDelta.add(mArena.mGravity);
mDelta.x = mDelta.x + (mAngularVelocity / 1000);
mAngularVelocity = mAngularVelocity * 0.99;
mRotation = mRotation + mAngularVelocity;
_root.mDebug = (Math.round(mAngularVelocity) + ", ") + Math.round(mDelta.length);
if (Math.abs(mAngularVelocity) >= 25) {
var _local4 = Math.round(Math.abs(mAngularVelocity) / 25);
if (_local4 > 4) {
_local4 = 4;
}
_Interior.filters = [new flash.filters.BlurFilter(_local4, _local4, 3)];
} else {
_Interior.filters = [];
}
mCount = 0;
mCollide = false;
Collide();
mArena.mMap.WheelCollide(this, _local5, mPosition);
_x = mPosition.x;
_y = mPosition.y;
_Interior._rotation = mRotation;
mTrackPositionIndex = (mTrackPositionIndex + 1) % mTrackPosition.length;
mTrackPosition[mTrackPositionIndex] = mPosition.clone();
if (_global.mKeyControl) {
mControlLeft = Key.isDown(37);
mControlRight = Key.isDown(39);
}
if (mControlLeft) {
if (mAngularVelocity > 0) {
mAngularVelocity = 0;
}
mAngularVelocity = mAngularVelocity - 4;
mControlLeft = false;
}
if (mControlRight) {
if (mAngularVelocity < 0) {
mAngularVelocity = 0;
}
mAngularVelocity = mAngularVelocity + 4;
mControlRight = false;
}
}
function Collide(tNotThisLine) {
mDeltaTravelledTotal = mDelta.length;
if (tNotThisLine == undefined) {
mDeltaTravelled = 1;
}
var _local5 = new flash.geom.Point(mDelta.x * mDeltaTravelled, mDelta.y * mDeltaTravelled);
var _local6 = mPosition.add(_local5);
var _local7 = mArena.mLineManager.GetLineList(mPosition, _local6, pRadius);
var _local2 = CLine.WheelToLineList(_local7, mPosition, _local6, mRadius);
if (_local2.length > 1) {
trace(" ********* 2 Intersections ***************");
}
for (var _local4 in _local2) {
if (tNotThisLine == _local2[_local4]) {
continue;
}
if (LineCollide(_local2[_local4])) {
mDeltaTravelled = mDeltaTravelled - (flash.geom.Point.distance(mPosition, _local2[_local4].mPointOfIntersection) / mDeltaTravelledTotal);
mPosition = _local2[_local4].mPointOfIntersection;
if (mDeltaTravelled <= 0) {
mDeltaTravelled = 0;
} else {
Collide(_local2[_local4]);
}
return(undefined);
}
}
mPosition = CLine.CollisionError(_local7, mPosition, _local5);
if (mArena.mState == "stop") {
trace("mDelta = " + mDelta);
trace("nDelta = " + _local5);
trace("nLineList = " + _local2.length);
trace("nLineList[0].POI = " + _local2[0].mPointOfIntersection);
trace("tNotThisLine.POI = " + tNotThisLine.mPointOfIntersection);
}
}
function LineCollide(tLine, tDeflectOnly) {
if (tLine == undefined) {
return(false);
}
var _local8 = tLine.mMatrix.transformPoint(tLine.mP1);
var _local7 = tLine.mMatrix.transformPoint(tLine.mP2);
var _local6 = tLine.mMatrix.transformPoint(mPosition);
var _local3 = tLine.mMatrix.transformPoint(mDelta);
var _local5 = (mAngularVelocity * Math.PI) / 180;
_local3.y = computeVyGarwin(_local3.y);
_local3.x = computeVxGarwin(_local3.x, _local5, mRadius);
mAngularVelocity = (computeAVGarwin(_local3.x, _local5, mRadius) * 180) / Math.PI;
mDelta = tLine.iMatrix.transformPoint(_local3);
tLine.mOnline = ((_local3.y == 0) ? true : false);
if (tLine.mOnline) {
var _local4 = new flash.geom.Point(tLine.mP2.x - tLine.mP1.x, tLine.mP2.y - tLine.mP1.y);
_local4.normalize(((_local3.x >= 0) ? (mDelta.length) : (-mDelta.length)));
mDelta = _local4;
}
mCollide = true;
return(true);
}
function computeVxGarwin(vx, av, r) {
return(((((1 - (GARWIN_ALPHA * Ex)) * vx) + (((GARWIN_ALPHA * (1 + Ex)) * r) * av)) / (1 + GARWIN_ALPHA)) * mFriction);
}
function computeVyGarwin(vy) {
var _local1 = -(Ey * vy);
if (_local1 >= -5) {
_local1 = 0;
}
return(_local1);
}
function computeAVGarwin(vx, av, r) {
return(((((1 + Ex) * vx) + (((GARWIN_ALPHA - Ex) * r) * av)) / (r * (1 + GARWIN_ALPHA))) * mFriction);
}
var mCount = 0;
static var mTime = 1;
static var GARWIN_ALPHA = 0.4;
static var Ex = 0.2;
static var Ey = 0.4;
}
Symbol 255 MovieClip [__Packages.CLine] Frame 0
class CLine
{
var mArena, mP1, mP2, mConcaveP1, mConcaveP2, mMatrix, iMatrix, mNormal, mPointOfIntersection;
function CLine (tArena, p1, p2, tConcaveP1, tConcaveP2) {
mArena = tArena;
mP1 = p1;
mP2 = p2;
mConcaveP1 = tConcaveP1;
mConcaveP2 = tConcaveP2;
var _local3 = Math.atan2(mP2.y - mP1.y, mP2.x - mP1.x);
mMatrix = new flash.geom.Matrix();
mMatrix.rotate(-_local3);
iMatrix = mMatrix.clone();
iMatrix.invert();
var _local2 = new flash.geom.Matrix();
_local2.rotate((Math.PI/2));
mNormal = new flash.geom.Point(mP2.x - mP1.x, mP2.y - mP1.y);
mNormal = _local2.transformPoint(mNormal);
mNormal = GetNormal(mP1, mP2);
}
function LineReflection(d) {
return(new flash.geom.Point(d.x - ((2 * DotProduct(d, mNormal)) * mNormal.x), d.y - ((2 * DotProduct(d, mNormal)) * mNormal.y)));
}
function DotProduct(p1, p2) {
return((p1.x * p2.x) + (p1.y * p2.y));
}
function CrossProduct(p1, p2) {
return(new flash.geom.Point((p1.y * p2.x) - (p1.x * p2.y), (p1.x * p2.y) - (p1.y * p2.x)));
}
static function WheelToLineList(tLineList, wp1, wp2, r) {
var _local2 = new Array();
for (var _local6 in tLineList) {
if (tLineList[_local6].WheelToLine(wp1, wp2, r) != undefined) {
_local2[_local2.length] = tLineList[_local6];
}
}
return(_local2);
}
static function CollisionError(tLineList, p, d) {
for (var _local8 in tLineList) {
var _local1 = tLineList[_local8];
if (_local1.SideOfLine(p.add(d)) < 0) {
var _local3 = _local1.mNormal.clone();
_local3.normalize(d.length * 2);
var _local6 = p.add(d).add(_local3);
var _local5;
_local5 = _local1._LOI_WithCorrection(p.add(d), _local6);
if (_local5 != undefined) {
return(_local5);
}
}
}
return(p.add(d));
}
function WheelToLine(wp1, wp2, r) {
return(((SideOfLine(wp1) < 0) ? undefined : ((mPointOfIntersection = _LOI_WithCorrection(wp1, wp2)))));
}
function SideOfLine(p) {
return(_SideOfLine(p, mP1, mP2));
}
static function _SideOfLine(p, p1, p2) {
return(-(((p2.x - p1.x) * (p.y - p1.y)) - ((p.x - p1.x) * (p2.y - p1.y))));
}
function _LOI_WithCorrection(p1, p2) {
var _local2 = _LOI(p1, p2);
if (_local2 == undefined) {
return(undefined);
}
var _local3 = mNormal.clone();
_local3.normalize(0.5);
return(_local2.add(_local3));
}
function _LOI(p1, p2) {
return(LOI(p1, p2, mP2, mP1));
}
static function LOI(l1p1, l1p2, l2p1, l2p2) {
var _local11 = l2p2.x - l2p1.x;
var _local10 = l2p2.y - l2p1.y;
var _local9 = l1p2.x - l1p1.x;
var _local8 = l1p2.y - l1p1.y;
var _local4 = (((l2p1.y - l1p1.y) * _local9) - ((l2p1.x - l1p1.x) * _local8)) / ((_local11 * _local8) - (_local10 * _local9));
var _local6 = new flash.geom.Point(l2p1.x + (_local4 * _local11), l2p1.y + (_local4 * _local10));
if (isNaN(_local6.x)) {
_local6 = (l2p1.equals(l2p2) ? (l2p2.clone()) : ((l1p1.equals(l1p2) ? (l1p1.clone()) : undefined)));
}
_local11 = l1p2.x - l1p1.x;
_local10 = l1p2.y - l1p1.y;
_local9 = l2p2.x - l2p1.x;
_local8 = l2p2.y - l2p1.y;
var _local7 = (((l1p1.y - l2p1.y) * _local9) - ((l1p1.x - l2p1.x) * _local8)) / ((_local11 * _local8) - (_local10 * _local9));
return((((((_local4 >= 0) && (_local4 <= 1)) && (_local7 >= 0)) && (_local7 <= 1)) ? (_local6) : undefined));
}
static function LOI2(l1p1, l1p2, l2p1, l2p2) {
var _local11 = l1p2.y - l1p1.y;
var _local9 = l1p1.x - l1p2.x;
var _local7 = (l1p2.x * l1p1.y) - (l1p1.x * l1p2.y);
var _local10 = l2p2.y - l2p1.y;
var _local8 = l2p1.x - l2p2.x;
var _local6 = (l2p2.x * l2p1.y) - (l2p1.x * l2p2.y);
var _local1 = (_local11 * _local8) - (_local10 * _local9);
if (_local1 == 0) {
return(undefined);
}
return(new flash.geom.Point(((_local9 * _local6) - (_local8 * _local7)) / _local1, ((_local10 * _local7) - (_local11 * _local6)) / _local1));
}
static function GetNormal(p1, p2) {
var _local1 = new flash.geom.Matrix();
_local1.rotate(-1.5707963267949);
var _local2 = _local1.transformPoint(new flash.geom.Point(p2.x - p1.x, p2.y - p1.y));
_local2.normalize(1);
return(_local2);
}
}
Symbol 256 MovieClip [__Packages.CLineManager] Frame 0
class CLineManager
{
var mArena, mLineList_Temp, mPointList_Temp, mLineList, mMap;
function CLineManager (tArena) {
mArena = tArena;
}
function AddLine(node1, node2) {
var _local4 = new flash.geom.Point(0, 0);
var _local3 = new flash.geom.Point(0, 0);
node1.localToGlobal(_local4);
mArena.globalToLocal(_local4);
node2.localToGlobal(_local3);
mArena.globalToLocal(_local3);
node1._visible = (node2._visible = false);
mLineList_Temp = ((mLineList_Temp == undefined) ? (new Array()) : (mLineList_Temp));
var _local2 = new Object();
_local2.mP1 = AddPoint(_local4, _local2);
_local2.mP2 = AddPoint(_local3, _local2);
mLineList_Temp[mLineList_Temp.length] = _local2;
_local2.mNormal = CLine.GetNormal(_local4, _local3);
_local2.mAdded = false;
}
function AddPoint(p, oLine) {
mPointList_Temp = ((mPointList_Temp == undefined) ? (new Array()) : (mPointList_Temp));
for (var _local4 in mPointList_Temp) {
if (flash.geom.Point.distance(mPointList_Temp[_local4].mP, p) <= JoinTolerance) {
mPointList_Temp[_local4].mLineList[mPointList_Temp[_local4].mLineList.length] = oLine;
return(mPointList_Temp[_local4]);
}
}
var _local5 = {mP:p, mLineList:[oLine]};
mPointList_Temp[mPointList_Temp.length] = _local5;
return(_local5);
}
function Compile(r) {
if (mLineList == undefined) {
mLineList = new Array();
var _local18 = 0;
while (_local18 < mLineList_Temp.length) {
var _local2 = mLineList_Temp[_local18];
while ((_local2 != undefined) && (!_local2.mAdded)) {
var _local17 = _local2.mNormal.clone();
_local17.normalize(r);
var _local5 = ((_local2.mP1.pNext == undefined) ? (_local2.mP1.mP.add(_local17)) : (_local2.mP1.pNext));
var _local6 = _local2.mP2.mP.add(_local17);
var _local14 = _local2.mP2.mP;
var _local10 = (_local2.mP1.pNext == undefined) && (_local2.mP1.mLineList.length > 1);
var _local3 = _local2.mP2.mLineList[((_local2.mP2.mLineList[0] == _local2) ? 1 : 0)];
if (_local3 == undefined) {
if (!_local10) {
_AddLine2p(_local5, _local6);
_local2.mAdded = true;
}
break;
}
var _local7 = _local3.mNormal.clone();
_local7.normalize(r);
var _local9 = _local3.mP1.mP.add(_local7);
var _local11 = _local3.mP2.mP.add(_local7);
if (_local2 == _local3) {
trace("***************** Lines are the same ***********************");
trace((((((_local5 + ",") + _local6) + ",") + _local9) + ",") + _local11);
break;
}
var _local8 = CLine.LOI(_local5, _local6, _local9, _local11);
if (_local8 == undefined) {
if (!_local10) {
_AddLine2p(_local5, _local6);
_local2.mAdded = true;
}
_RoundedLine(_local14, _local17, _local7, r);
_local3.mP1.pNext = _local9;
} else {
if (!_local10) {
_AddLine2p(_local5, _local8, false, true);
_local2.mAdded = true;
}
_local3.mP1.pNext = _local8;
_local3.mP1.mConcave = true;
}
_local2 = _local3;
}
_local18++;
}
var _local23 = mArena.mEdgeDraw;
var _local22 = flash.display.BitmapData.loadBitmap("Graphic.Edge");
var _local24 = flash.display.BitmapData.loadBitmap("Graphic.Edge.2");
var _local21 = _local22.height - 1;
_local18 = 0;
while (_local18 < mLineList_Temp.length) {
var _local4 = mLineList_Temp[_local18];
var _local12 = _local4.mP1.mLineList[((_local4.mP1.mLineList[0] == _local4) ? 1 : 0)];
var _local15 = _local4.mP2.mLineList[((_local4.mP2.mLineList[0] == _local4) ? 1 : 0)];
var _local17 = _local12.mNormal;
_local17.normalize(_local21);
var _local7 = _local4.mNormal;
_local7.normalize(_local21);
var _local16 = _local15.mNormal;
_local16.normalize(_local21);
var _local20 = ((_local12 == undefined) ? (_local4.mP1.mP.subtract(_local7)) : (CLine.LOI2(_local12.mP1.mP.subtract(_local17), _local12.mP2.mP.subtract(_local17), _local4.mP1.mP.subtract(_local7), _local4.mP2.mP.subtract(_local7))));
var _local19 = ((_local15 == undefined) ? (_local4.mP2.mP.subtract(_local7)) : (CLine.LOI2(_local15.mP1.mP.subtract(_local16), _local15.mP2.mP.subtract(_local16), _local4.mP1.mP.subtract(_local7), _local4.mP2.mP.subtract(_local7))));
if (_local20 == undefined) {
_local20 = _local4.mP1.mP.subtract(_local7);
}
if (_local19 == undefined) {
_local19 = _local4.mP2.mP.subtract(_local7);
}
_DrawEdge(_local23, _local22, _local4.mP1.mP, _local4.mP2.mP, _local19, _local20);
_local18++;
}
delete mLineList_Temp;
delete mPointList_Temp;
}
}
function _DrawEdge(dp, tBitmap, p1, p2, p3, p4) {
var _local3 = new flash.geom.Matrix();
_local3.rotate(Math.atan2(p2.y - p1.y, p2.x - p1.x));
_local3.translate(p1.x, p1.y);
dp.beginBitmapFill(tBitmap, _local3, true, true);
dp.moveTo(p1.x, p1.y);
dp.lineTo(p2.x, p2.y);
dp.lineTo(p3.x, p3.y);
dp.lineTo(p4.x, p4.y);
dp.lineTo(p1.x, p1.y);
dp.endFill();
}
function _RoundedLine(sharePoint, n1, n2, r) {
if (flash.geom.Point.distance(n1, n2) <= (r * 0.666666666666667)) {
var _local8 = sharePoint.add(n1);
var _local7 = sharePoint.add(n2);
_AddLine2p(_local8, _local7);
return(undefined);
}
var _local2 = n1.add(n2);
_local2.normalize(r);
_RoundedLine(sharePoint, n1, _local2, r);
_RoundedLine(sharePoint, _local2, n2, r);
}
function _AddLine2p(p1, p2, tConcaveP1, tConcaveP2) {
mArena.mCollisionDraw.lineStyle(0, 16711935, 50);
var _local4 = 0;
mArena.mCollisionDraw.moveTo(p1.x + _local4, p1.y + _local4);
mArena.mCollisionDraw.lineTo(p2.x + _local4, p2.y + _local4);
mArena.mCollisionDraw.moveTo(p1.x - 2, p1.y + 2);
mArena.mCollisionDraw.lineTo(p1.x + 2, p1.y - 2);
mArena.mCollisionDraw.moveTo(p1.x + 2, p1.y + 2);
mArena.mCollisionDraw.lineTo(p1.x - 2, p1.y - 2);
mArena.mCollisionDraw.moveTo(p2.x - 2, p2.y + 2);
mArena.mCollisionDraw.lineTo(p2.x + 2, p2.y - 2);
mArena.mCollisionDraw.moveTo(p2.x + 2, p2.y + 2);
mArena.mCollisionDraw.lineTo(p2.x - 2, p2.y - 2);
_AddLine(new CLine(mArena, p1, p2, tConcaveP1, tConcaveP2));
}
function _AddLine(tLine) {
mLineList = ((mLineList == undefined) ? (new Array()) : (mLineList));
mLineList[mLineList.length] = tLine;
MarkMap(tLine);
}
function GetLineList(oldPosition, newPosition, tSize) {
var _local5 = oldPosition.clone();
var _local3 = newPosition.clone();
if (_local5.x > _local3.x) {
var _local8 = _local5.x;
_local5.x = _local3.x;
_local3.x = _local8;
}
if (_local5.y > _local3.y) {
var _local8 = _local5.y;
_local5.y = _local3.y;
_local3.y = _local8;
}
_local5.x = Math.floor(_local5.x / mCellSize);
_local5.y = Math.floor(_local5.y / mCellSize);
_local3.x = Math.floor(_local3.x / mCellSize);
_local3.y = Math.floor(_local3.y / mCellSize);
var _local7 = new Array();
var _local4 = _local5.y;
while (_local4 <= _local3.y) {
var _local6 = mMap[_local4];
var _local2 = _local5.x;
while (_local2 <= _local3.x) {
AddToLL(_local7, _local6[_local2]);
_local2++;
}
_local4++;
}
return(_local7);
}
function AddToLL(ll, pll) {
for (var _local5 in pll) {
var _local2 = true;
for (var _local4 in ll) {
if (pll[_local5] == ll[_local4]) {
_local2 = false;
break;
}
}
if (_local2) {
ll[ll.length] = pll[_local5];
}
}
}
function MarkMap(tLine) {
var _local7 = tLine.mP1;
var _local6 = tLine.mP2;
var _local2 = _local6.subtract(_local7);
if (Math.abs(_local2.x) > Math.abs(_local2.y)) {
var _local3 = ((_local6.x > _local7.x) ? (_local7.clone()) : (_local6.clone()));
var _local9 = ((_local6.x > _local7.x) ? (_local6.clone()) : (_local7.clone()));
_local2 = _local9.subtract(_local3);
var _local8 = Math.ceil(_local2.x / mCellSize);
_local2.y = (_local2.y / _local2.x) * mCellSize;
_local2.x = mCellSize;
MarkMap_Cell(tLine, _local3);
var _local4;
while (_local8-- , _local8 >= 0) {
if (_local4 != undefined) {
_mmCell(tLine, _local3, _local4);
}
_local4 = _local3;
_local3 = _local3.add(_local2);
}
_mmCell(tLine, _local9, _local4);
} else {
var _local3 = ((_local6.y > _local7.y) ? (_local7.clone()) : (_local6.clone()));
var _local9 = ((_local6.y > _local7.y) ? (_local6.clone()) : (_local7.clone()));
_local2 = _local9.subtract(_local3);
var _local8 = Math.ceil(_local2.y / mCellSize);
_local2.x = (_local2.x / _local2.y) * mCellSize;
_local2.y = mCellSize;
MarkMap_Cell(tLine, _local3);
while (_local8-- , _local8 >= 0) {
if (_local4 != undefined) {
_mmCell(tLine, _local3, _local4);
}
var _local4 = _local3;
_local3 = _local3.add(_local2);
}
_mmCell(tLine, _local9, _local4);
}
}
function _mmCell(tLine, sp, lsp) {
MarkMap_Cell(tLine, new flash.geom.Point(sp.x, sp.y));
MarkMap_Cell(tLine, new flash.geom.Point(sp.x, lsp.y));
MarkMap_Cell(tLine, new flash.geom.Point(lsp.x, sp.y));
}
function MarkMap_Cell(tLine, p) {
p = p.clone();
p.x = Math.floor(p.x / mCellSize);
p.y = Math.floor(p.y / mCellSize);
if ((p.x < 0) || (p.y < 0)) {
return(undefined);
}
mMap = ((mMap == undefined) ? ((mMap = new Array())) : (mMap));
mMap[p.y] = ((mMap[p.y] == undefined) ? ((mMap[p.y] = new Array())) : (mMap[p.y]));
mMap[p.y][p.x] = ((mMap[p.y][p.x] == undefined) ? ((mMap[p.y][p.x] = new Array())) : (mMap[p.y][p.x]));
var _local3 = mMap[p.y][p.x];
var _local4 = false;
for (var _local8 in _local3) {
if (_local3[_local8] == tLine) {
_local4 = true;
break;
}
}
if (!_local4) {
_local3[_local3.length] = tLine;
}
return(undefined);
}
static var mCellSize = 40;
static var JoinTolerance = 5;
}
Symbol 257 MovieClip [__Packages.CCamera] Frame 0
class CCamera
{
var mMainObject, mContainerObject, mStageSize, mPosition, mScale, mTrackObject;
function CCamera (tMainObject) {
mMainObject = tMainObject;
mContainerObject = mMainObject._parent;
mStageSize = new flash.geom.Point(mContainerObject._Size._width, mContainerObject._Size._height);
mPosition = new flash.geom.Point(tMainObject._x, tMainObject._y);
mScale = 0.5;
mMainObject._xscale = 100;
mMainObject._yscale = 100;
mMainObject.mSize = new flash.geom.Point(mMainObject._width, mMainObject._height);
mMainObject.mBackground.mSize = new flash.geom.Point(mMainObject.mBackground._width, mMainObject.mBackground._height);
mContainerObject._Size._visible = false;
}
function SetTrackObject(tObject) {
mTrackObject = tObject;
mPosition = (new flash.geom.Point(0, 0)).subtract(mTrackObject.mPosition);
mMainObject._x = mPosition.x;
mMainObject._y = mPosition.y;
trace(mPosition);
}
function Process() {
var _local3 = mTrackObject.mDelta.clone();
_local3.x = _local3.x * 15;
_local3.y = _local3.y * 15;
if (_global.mKeyControl) {
if (Key.isDown(38) && (mScale < 0.5)) {
mScale = mScale + 0.01;
}
if (Key.isDown(40) && (mScale >= 0.3)) {
mScale = mScale - 0.01;
}
}
var _local4 = mTrackObject.mDelta.length;
if (_local4 > 10) {
_local4 = 10;
}
var _local7 = (1 - ((_local4 * 0.5) / 10)) * 100;
mContainerObject._xscale = (mContainerObject._yscale = mScale * 100);
var _local5 = (new flash.geom.Point(0, 0)).subtract(mTrackObject.mPosition.add(_local3));
mPosition.x = mPosition.x + ((_local5.x - mPosition.x) / 10);
mPosition.y = mPosition.y + ((_local5.y - mPosition.y) / 10);
mPosition.x = scidd.Math.CMath.Range(mPosition.x, (-mMainObject.mSize.x) + ((mStageSize.x / 2) * (1 / mScale)), ((-mStageSize.x) * (1 / mScale)) / 2);
mPosition.y = scidd.Math.CMath.Range(mPosition.y, (-mMainObject.mSize.y) + ((mStageSize.y / 2) * (1 / mScale)), ((-mStageSize.y) * (1 / mScale)) / 2);
mMainObject.mBackground._xscale = (mMainObject.mBackground._yscale = (1 / mScale) * 100);
var _local6 = mMainObject.mBackground.mSize.x / mMainObject.mSize.x;
mMainObject.mBackground._x = (mPosition.x * _local6) - ((mMainObject.mBackground._width - mMainObject.mBackground.mSize.x) / 2);
mMainObject.mBackground._y = (mPosition.y * _local6) - ((mMainObject.mBackground._height - mMainObject.mBackground.mSize.y) / 2);
mMainObject._x = mPosition.x;
mMainObject._y = mPosition.y;
}
}
Symbol 258 MovieClip [__Packages.scidd.Math.CMath] Frame 0
class scidd.Math.CMath
{
function CMath () {
}
static function Range(tNumber, tMin, tMax) {
return(((tNumber > tMax) ? (tMax) : (((tNumber < tMin) ? (tMin) : (tNumber)))));
}
static function Never0(tNumber) {
return(((tNumber == 0) ? 1E-6 : (tNumber)));
}
static function Sign(tNumber) {
return(((tNumber < 0) ? -1 : (((tNumber > 0) ? 1 : 0))));
}
static function Tween(tMin, tMax, tFactor, tEaseIn, pow) {
tEaseIn = ((tEaseIn == undefined) ? 0 : (tEaseIn));
if (tEaseIn != 0) {
pow = ((pow == undefined) ? 15 : (pow));
tFactor = ((tEaseIn > 0) ? (1 - Math.pow(1 - tFactor, (pow * tEaseIn) + 1)) : (Math.pow(tFactor, (pow * (-tEaseIn)) + 1)));
}
return(((tMax - tMin) * tFactor) + tMin);
}
static function Define(tObject, tDefault) {
return(((tObject == undefined) ? (tDefault) : (tObject)));
}
static function Round(tNumber, tAmount) {
return(Math.round(tNumber / tAmount) * tAmount);
}
static function DecimalPlaces(tNumber) {
var _local2 = 0;
while ((tNumber % 1) != 0) {
tNumber = tNumber * 10;
_local2++;
}
return(_local2);
}
static function GetLineNormal(p1, p2) {
var _local1 = new flash.geom.Matrix();
_local1.rotate(-1.5707963267949);
var _local2 = _local1.transformPoint(new flash.geom.Point(p2.x - p1.x, p2.y - p1.y));
_local2.normalize(1);
return(_local2);
}
var _CLASSID_ = "scidd.Math.CMath";
}
Symbol 259 MovieClip [__Packages.CMap] Frame 0
class CMap
{
var mArena, mBarrelCount, mStarCount, mStarIndex, mObjectList, mOverExit, mExitObject, mMap;
function CMap (tArena) {
mArena = tArena;
mBarrelCount = (mStarCount = (mStarIndex = 0));
mObjectList = new Array();
}
function WheelCollide(tWheel, oldPosition, newPosition) {
var _local6 = GetObjectList(tWheel, oldPosition, newPosition);
var _local8 = newPosition.subtract(oldPosition);
_local8.normalize(tWheel.mRadius);
var _local12 = oldPosition.clone().subtract(_local8);
var _local11 = newPosition.clone().add(_local8);
for (var _local7 in _local6) {
var _local3 = _local6[_local7];
if (!_local3.mActive) {
break;
}
switch (_local3.mType.toUpperCase()) {
case "LEFTSPIN" :
mArena.mWheel.mControlLeft = true;
break;
case "RIGHTSPIN" :
mArena.mWheel.mControlRight = true;
break;
case "BARREL" :
if (BoxCollide(_local3, tWheel, newPosition) || (Key.isDown(65) && (_global.mCheat != undefined))) {
_local3.mActive = false;
_local3.play();
if (_global.mSFXActive == true) {
var _local9 = new Sound(_local3);
_local9.attachSound("Barrel.Hit.wav");
_local9.start(0, 0);
}
mBarrelCount--;
}
break;
case "STAR" :
if (BoxCollide(_local3, tWheel, newPosition) || (Key.isDown(65) && (_global.mCheat != undefined))) {
_local3.mActive = false;
_local3.play();
if (_global.mSFXActive == true) {
var _local9 = new Sound(_local3);
_local9.attachSound("Star.Hit.wav");
_local9.start(0, 0);
}
mStarCount--;
mArena.mStats.CollectStar(_local3.mStarIndex, mStarIndex);
}
break;
case "EXIT" :
if ((mBarrelCount != 0) || (mOverExit == true)) {
} else {
mOverExit = ((Key.isDown(65) && (_global.mCheat != undefined)) ? true : (BoxCollide(_local3, tWheel, newPosition)));
}
}
}
if ((mBarrelCount == 0) && (mExitObject.mActive == false)) {
if (_global.mSFXActive == true) {
var _local9 = new Sound(mExitObject);
_local9.attachSound("Exit.Open.wav");
_local9.setVolume(40);
_local9.start(0, 0);
}
mExitObject.mActive = true;
mExitObject.gotoAndStop(2);
}
}
function BoxCollide(tObject, tWheel, newPosition) {
if (((((newPosition.x + tWheel.mRadius) >= tObject.mPList[0].x) && ((newPosition.x - tWheel.mRadius) <= tObject.mPList[2].x)) && ((newPosition.y + tWheel.mRadius) >= tObject.mPList[0].y)) && ((newPosition.y - tWheel.mRadius) <= tObject.mPList[2].y)) {
return(true);
}
return(false);
}
function LineCollide(tObject, p1, p2) {
return(((CLine.LOI(tObject.mPList[0], tObject.mPList[1], p1, p2) || (CLine.LOI(tObject.mPList[1], tObject.mPList[2], p1, p2))) || (CLine.LOI(tObject.mPList[2], tObject.mPList[3], p1, p2))) || (CLine.LOI(tObject.mPList[3], tObject.mPList[0], p1, p2)));
}
function GetObjectList(tWheel, oldPosition, newPosition) {
var _local4 = oldPosition.clone();
var _local3 = newPosition.clone();
if (_local4.x > _local3.x) {
var _local8 = _local4.x;
_local4.x = _local3.x;
_local3.x = _local8;
}
if (_local4.y > _local3.y) {
var _local8 = _local4.y;
_local4.y = _local3.y;
_local3.y = _local8;
}
_local4 = _local4.subtract(tWheel.pRadius);
_local3 = _local3.add(tWheel.pRadius);
_local4.x = Math.floor(_local4.x / mCellSize);
_local4.y = Math.floor(_local4.y / mCellSize);
_local3.x = Math.floor(_local3.x / mCellSize);
_local3.y = Math.floor(_local3.y / mCellSize);
var _local7 = new Array();
var _local5 = _local4.y;
while (_local5 <= _local3.y) {
var _local6 = mMap[_local5];
var _local2 = _local4.x;
while (_local2 <= _local3.x) {
AddToLL(_local7, _local6[_local2]);
_local2++;
}
_local5++;
}
return(_local7);
}
function AddToLL(ll, pll) {
for (var _local5 in pll) {
var _local2 = true;
for (var _local4 in ll) {
if (pll[_local5] == ll[_local4]) {
_local2 = false;
break;
}
}
if (_local2 && (pll[_local5].mActive)) {
ll[ll.length] = pll[_local5];
}
}
}
function AddObject(tObject, tType) {
tObject.mActive = true;
switch (tType.toUpperCase()) {
case "LEFTSPIN" :
case "RIGHTSPIN" :
tObject._visible = false;
break;
case "BARREL" :
mBarrelCount++;
break;
case "EXIT" :
mExitObject = tObject;
mExitObject.mActive = false;
break;
case "STAR" :
tObject.mStarIndex = mStarIndex;
mStarIndex++;
if (_global.mStats.mList_AllStars[_global.mArenaIndex][tObject.mStarIndex] == true) {
tObject._visible = false;
return(undefined);
}
mStarCount++;
}
tObject.mType = tType;
var _local4 = tObject.getBounds(tObject);
var _local8 = new flash.geom.Point(_local4.xMin, _local4.yMin);
var _local7 = new flash.geom.Point(_local4.xMax, _local4.yMin);
var _local6 = new flash.geom.Point(_local4.xMax, _local4.yMax);
var _local5 = new flash.geom.Point(_local4.xMin, _local4.yMax);
tObject.localToGlobal(_local8);
mArena.globalToLocal(_local8);
tObject.localToGlobal(_local7);
mArena.globalToLocal(_local7);
tObject.localToGlobal(_local6);
mArena.globalToLocal(_local6);
tObject.localToGlobal(_local5);
mArena.globalToLocal(_local5);
tObject.mPList = [_local8, _local7, _local6, _local5];
tObject.mPosition = new flash.geom.Point(tObject._x, tObject._y);
MarkMap(tObject);
tObject.cacheAsBitmap = true;
tObject.stop();
mObjectList[mObjectList.length] = tObject;
}
function MarkMap(tObject) {
var _local5 = tObject.mPList[0].clone();
var _local4 = tObject.mPList[0].clone();
for (var _local7 in tObject.mPList) {
if (tObject.mPList[_local7].x < _local5.x) {
_local5.x = tObject.mPList[_local7].x;
}
if (tObject.mPList[_local7].x > _local4.x) {
_local4.x = tObject.mPList[_local7].x;
}
if (tObject.mPList[_local7].y < _local5.y) {
_local5.y = tObject.mPList[_local7].y;
}
if (tObject.mPList[_local7].y > _local4.y) {
_local4.y = tObject.mPList[_local7].y;
}
}
_local5.x = Math.floor(_local5.x / mCellSize);
_local5.y = Math.floor(_local5.y / mCellSize);
_local4.x = Math.floor(_local4.x / mCellSize);
_local4.y = Math.floor(_local4.y / mCellSize);
var _local6 = _local5.y;
while (_local6 <= _local4.y) {
var _local3 = _local5.x;
while (_local3 <= _local4.x) {
MarkMap_Cell(tObject, new flash.geom.Point(_local3, _local6));
_local3++;
}
_local6++;
}
}
function MarkMap_Cell(tObject, p) {
p = p.clone();
if ((p.x < 0) || (p.y < 0)) {
return(undefined);
}
mMap = ((mMap == undefined) ? ((mMap = new Array())) : (mMap));
mMap[p.y] = ((mMap[p.y] == undefined) ? ((mMap[p.y] = new Array())) : (mMap[p.y]));
mMap[p.y][p.x] = ((mMap[p.y][p.x] == undefined) ? ((mMap[p.y][p.x] = new Array())) : (mMap[p.y][p.x]));
var _local3 = mMap[p.y][p.x];
var _local4 = false;
for (var _local8 in _local3) {
if (_local3[_local8] == tObject) {
_local4 = true;
break;
}
}
if (!_local4) {
_local3[_local3.length] = tObject;
}
var _local7 = p.add(new flash.geom.Point(1, 1));
mArena.mCollisionDraw.lineStyle(0, 0, 100);
var _local6 = (mMap[p.y][p.x].length - 1) * 4;
mArena.mCollisionDraw.moveTo((p.x * mCellSize) + _local6, (p.y * mCellSize) + _local6);
mArena.mCollisionDraw.lineTo(p.x * mCellSize, _local7.y * mCellSize);
mArena.mCollisionDraw.lineTo(_local7.x * mCellSize, _local7.y * mCellSize);
mArena.mCollisionDraw.lineTo(_local7.x * mCellSize, p.y * mCellSize);
mArena.mCollisionDraw.lineTo((p.x * mCellSize) + _local6, (p.y * mCellSize) + _local6);
}
static var mCellSize = 110;
}
Symbol 260 MovieClip [__Packages.CStats] Frame 0
class CStats
{
var mArena, mTime_CollectAllBarrels, mTime_CollectAllStars, mTime_Total, mNumber_TotalStars, mNumber_TotalSpins, mNumber_FastestSpin, mNumber_FastestSpeed, mNumber_TotalDistance, mNumber_HighestJumpVertical, mNumber_HighestJumpHorizontal, mList_AllStars, mList_AllStarsCount, mList_AllArenas, mStartTimer, mCollidePosition;
function CStats (tArena) {
mArena = tArena;
mTime_CollectAllBarrels = 0;
mTime_CollectAllStars = 0;
mTime_Total = 0;
mNumber_TotalStars = 0;
mNumber_TotalSpins = 0;
mNumber_FastestSpin = 0;
mNumber_FastestSpeed = 0;
mNumber_TotalDistance = 0;
mNumber_HighestJumpVertical = 0;
mNumber_HighestJumpHorizontal = 0;
mList_AllStars = new Array();
mList_AllStarsCount = new Array();
mList_AllArenas = [false, false, false, false, false, false, false, false, false, false, false, false];
}
function ArenaComplete() {
mList_AllArenas[_global.mArenaIndex] = true;
}
function CompareAndUpdate(tStats) {
mNumber_TotalSpins = mNumber_TotalSpins + ((tStats.mNumber_TotalSpins / Math.PI) / 2);
mNumber_FastestSpin = cau(mNumber_FastestSpin, tStats.mNumber_FastestSpin);
mNumber_FastestSpeed = cau(mNumber_FastestSpeed, tStats.mNumber_FastestSpeed);
mNumber_TotalDistance = mNumber_TotalDistance + tStats.mNumber_TotalDistance;
mNumber_HighestJumpVertical = cau(mNumber_HighestJumpVertical, tStats.mNumber_HighestJumpVertical);
mNumber_HighestJumpHorizontal = cau(mNumber_HighestJumpHorizontal, tStats.mNumber_HighestJumpHorizontal);
var _local2 = 1;
while (_local2 <= 5) {
mList_AllStarsCount[_local2] = ((tStats.mList_AllStarsCount[_local2] != undefined) ? (tStats.mList_AllStarsCount[_local2]) : (mList_AllStarsCount[_local2]));
if (tStats.mList_AllStars[_local2] == undefined) {
} else {
var _local3 = 0;
while (_local3 < 100) {
if (tStats.mList_AllStars[_local2][_local3] == undefined) {
} else {
mList_AllStars[_local2] = ((mList_AllStars[_local2] == undefined) ? (new Array()) : (mList_AllStars[_local2]));
mList_AllStars[_local2][_local3] = tStats.mList_AllStars[_local2][_local3];
}
_local3++;
}
}
_local2++;
}
}
function Update_FE(mcStats, mcPlay) {
var _local8 = 0.000281214848143982;
mcStats.mHighestJump = Math.round(mNumber_HighestJumpHorizontal);
mcStats.mFastestSpin = Math.round(((mNumber_FastestSpin / (Math.PI*2)) * 30) * 60);
var _local6 = Math.round(mNumber_TotalDistance);
if (_local6 > 1000000000) {
_local6 = Math.floor(mNumber_TotalDistance / 1000000) + "m";
} else if (_local6 > 100000) {
_local6 = Math.floor(mNumber_TotalDistance / 1000) + "k";
}
mcStats.mTotalDistance = _local6;
mcStats.mLongestJump = Math.round(mNumber_HighestJumpVertical);
mcStats.mFastestSpeed = Math.round(mNumber_FastestSpeed);
mcStats.mNumberOfStars = 0;
var _local5 = 0;
var _local3 = 1;
while (_local3 <= 5) {
_local5 = _local5 + ((mList_AllStarsCount[_local3] == undefined) ? 10000 : (mList_AllStarsCount[_local3]));
if (mList_AllStars[_local3] == undefined) {
} else {
var _local2 = 0;
while (_local2 < 100) {
if (mList_AllStars[_local3][_local2] == undefined) {
} else {
mcStats.mNumberOfStars = mcStats.mNumberOfStars + (mList_AllStars[_local3][_local2] ? 1 : 0);
}
_local2++;
}
}
_local3++;
}
trace((_local5 + ",") + mcStats.mNumberOfStars);
if (_local5 == mcStats.mNumberOfStars) {
mcPlay._LockedArena6.gotoAndStop(2);
}
mcPlay._Arena1._visible = mList_AllArenas[1];
mcPlay._Arena2._visible = mList_AllArenas[2];
mcPlay._Arena3._visible = mList_AllArenas[3];
mcPlay._Arena4._visible = mList_AllArenas[4];
mcPlay._Arena5._visible = mList_AllArenas[5];
mcPlay._Arena6._visible = mList_AllArenas[6];
}
function cau(n1, n2) {
return(((n1 > n2) ? (n1) : (n2)));
}
function CollectStar(tIndex, tAmount) {
mList_AllStars[_global.mArenaIndex] = ((mList_AllStars[_global.mArenaIndex] == undefined) ? (new Array()) : (mList_AllStars[_global.mArenaIndex]));
mList_AllStars[_global.mArenaIndex][tIndex] = true;
mList_AllStarsCount[_global.mArenaIndex] = tAmount;
}
function Update() {
if (mArena == undefined) {
return(undefined);
}
var _local2 = mArena.mWheel;
if ((mStartTimer == undefined) && (mArena.mState == "play")) {
mStartTimer = getTimer();
}
mNumber_FastestSpeed = ((_local2.mDelta.length > mNumber_FastestSpeed) ? (_local2.mDelta.length) : (mNumber_FastestSpeed));
mNumber_FastestSpin = ((_local2.mAngularVelocity > mNumber_FastestSpin) ? (_local2.mAngularVelocity) : (mNumber_FastestSpin));
mNumber_TotalSpins = ((mNumber_TotalSpins == undefined) ? (Math.abs(_local2.mAngularVelocity)) : (mNumber_TotalSpins + Math.abs(_local2.mAngularVelocity)));
mNumber_TotalDistance = ((mNumber_TotalDistance == undefined) ? (_local2.mDelta.length) : (mNumber_TotalDistance + _local2.mDelta.length));
if (_local2.mCollide == true) {
mCollidePosition = _local2.mPosition.clone();
}
if (mCollidePosition != undefined) {
mNumber_HighestJumpVertical = (((mCollidePosition.y - _local2.mPosition.y) > mNumber_HighestJumpVertical) ? (mCollidePosition.y - _local2.mPosition.y) : (mNumber_HighestJumpVertical));
mNumber_HighestJumpHorizontal = ((Math.abs(mCollidePosition.x - _local2.mPosition.x) > mNumber_HighestJumpHorizontal) ? (Math.abs(mCollidePosition.x - _local2.mPosition.x)) : (mNumber_HighestJumpHorizontal));
}
mTime_CollectAllBarrels = (((mTime_CollectAllBarrels == undefined) && (mArena.mMap.mBarrelCount == 0)) ? (getTimer() - mStartTimer) : (mTime_CollectAllBarrels));
mTime_CollectAllStars = (((mTime_CollectAllStars == undefined) && (mArena.mMap.mStarCount == 0)) ? (getTimer() - mStartTimer) : (mTime_CollectAllStars));
mTime_Total = (((mTime_Total == undefined) && (mArena.mMap.mExited == 0)) ? (getTimer() - mStartTimer) : (mTime_Total));
}
}
Symbol 47 MovieClip Frame 1
stop();
_parent.AddObject(this, "exit");
this.cacheAsBitmap = true;
Symbol 47 MovieClip Frame 2
this.cacheAsBitmap = true;
Symbol 53 MovieClip Frame 1
_parent.AddLine(this._node1, this._node2);
_visible = false;
Symbol 55 MovieClip Frame 1
var n = [_node1, _node2, _node3, _node4, _node5, _node6];
_parent.AddLineCollection(n, this);
_visible = false;
Symbol 57 MovieClip Frame 1
var n = [_node1, _node2, _node3, _node4, _node5];
_parent.AddLineCollection(n, this);
_visible = false;
Symbol 58 MovieClip Frame 1
_parent.AddLine(this._node1, this._node2);
_visible = false;
Symbol 61 MovieClip Frame 1
_parent.AddLine(this._node1, this._node2);
_visible = false;
Symbol 65 MovieClip Frame 1
_parent.AddObject(this, "barrel");
stop();
Symbol 65 MovieClip Frame 10
stop();
_visible = false;
mActive = false;
Symbol 70 MovieClip Frame 1
_parent.AddObject(this, "star");
Symbol 70 MovieClip Frame 10
stop();
_visible = false;
Symbol 72 MovieClip Frame 1
_parent.AddLine(this._node1, this._node2);
_visible = false;
Symbol 81 MovieClip [Wheel] Frame 1
#initclip 16
Object.registerClass("Wheel", CWheel);
#endinitclip
Symbol 82 MovieClip [Arena.2] Frame 1
#initclip 9
Object.registerClass("Arena.2", CArena);
#endinitclip
Instance of Symbol 81 MovieClip [Wheel] in Symbol 82 MovieClip [Arena.2] Frame 1
onClipEvent (load) {
_parent.AddWheel(this);
}
Symbol 90 MovieClip Frame 1
_parent.AddObject(this, "RIGHTSPIN");
stop();
Symbol 92 MovieClip Frame 1
_parent.AddObject(this, "LEFTSPIN");
stop();
Symbol 94 MovieClip Frame 1
var n = [_node1, _node2, _node3, _node4, _node5, _node6];
n.reverse();
_parent.AddLineCollection(n, this);
_visible = false;
Symbol 95 MovieClip [Arena.0] Frame 1
#initclip 10
Object.registerClass("Arena.0", CArena);
#endinitclip
Instance of Symbol 81 MovieClip [Wheel] in Symbol 95 MovieClip [Arena.0] Frame 1
onClipEvent (load) {
_parent.AddWheel(this);
}
Symbol 102 MovieClip Frame 1
_parent.AddLine(this._node1, this._node2);
_visible = false;
Symbol 104 MovieClip [Arena.1] Frame 1
#initclip 11
Object.registerClass("Arena.1", CArena);
#endinitclip
Instance of Symbol 81 MovieClip [Wheel] in Symbol 104 MovieClip [Arena.1] Frame 1
onClipEvent (load) {
_parent.AddWheel(this);
}
Symbol 107 MovieClip Frame 1
_parent.AddLine(this._node1, this._node2);
_visible = false;
Symbol 115 MovieClip Frame 1
var n = [_node1, _node2, _node3];
_parent.AddLineCollection(n, this);
_visible = false;
Symbol 116 MovieClip [Arena.3] Frame 1
#initclip 12
Object.registerClass("Arena.3", CArena);
#endinitclip
Instance of Symbol 81 MovieClip [Wheel] in Symbol 116 MovieClip [Arena.3] Frame 1
onClipEvent (load) {
_parent.AddWheel(this);
}
Symbol 119 MovieClip Frame 1
var n = [_node1, _node2, _node3, _node4];
_parent.AddLineCollection(n, this);
_visible = false;
Symbol 121 MovieClip Frame 1
var n = [_node1, _node2, _node3, _node4, _node5];
n.reverse();
_parent.AddLineCollection(n, this);
_visible = false;
Symbol 123 MovieClip Frame 1
var n = [_node1, _node2, _node3, _node4];
n.reverse();
_parent.AddLineCollection(n, this);
_visible = false;
Symbol 124 MovieClip [Arena.5] Frame 1
#initclip 13
Object.registerClass("Arena.5", CArena);
#endinitclip
Instance of Symbol 81 MovieClip [Wheel] in Symbol 124 MovieClip [Arena.5] Frame 1
onClipEvent (load) {
_parent.AddWheel(this);
}
Symbol 130 MovieClip [Arena.4] Frame 1
#initclip 14
Object.registerClass("Arena.4", CArena);
#endinitclip
Instance of Symbol 81 MovieClip [Wheel] in Symbol 130 MovieClip [Arena.4] Frame 1
onClipEvent (load) {
_parent.AddWheel(this);
}
Symbol 134 MovieClip [Arena.6] Frame 1
#initclip 15
Object.registerClass("Arena.6", CArena);
#endinitclip
Instance of Symbol 81 MovieClip [Wheel] in Symbol 134 MovieClip [Arena.6] Frame 1
onClipEvent (load) {
_parent.AddWheel(this);
}
Symbol 140 MovieClip Frame 1
_global.mArenaIndex = ((_global.mArenaIndex == undefined) ? 0 : (_global.mArenaIndex));
_global.mArenaControl = ((_global.mArenaControl == undefined) ? true : (_global.mArenaControl));
_global.mKeyControl = ((_global.mKeyControl == undefined) ? true : (_global.mKeyControl));
this.attachMovie("Arena.BG.1", "_Background", this.getNextHighestDepth());
this.attachMovie("Arena." + _global.mArenaIndex, "_TheArena", this.getNextHighestDepth());
Symbol 140 MovieClip Frame 2
_TheArena.Start();
stop();
Symbol 145 Button
on (press) {
mNewScreen = _PlayScreen;
}
Symbol 148 Button
on (press) {
mNewScreen = _StatsScreen;
}
Symbol 151 Button
on (press) {
mNewScreen = _HelpScreen;
}
Symbol 155 MovieClip Frame 1
gotoAndStop((_global.mSFXActive ? 2 : 3));
Symbol 155 MovieClip Frame 2
stop();
_global.mSFXActive = true;
this.onPress = function () {
this.nextFrame();
};
Symbol 155 MovieClip Frame 3
_global.mSFXActive = false;
this.onPress = function () {
this.prevFrame();
};
Symbol 159 MovieClip Frame 1
function Update() {
var _local3 = getTimer();
mSampleArray[mSampleIndex] = _local3 - mSampleTimeStamp;
mSampleTimeStamp = _local3;
var _local1 = 0;
var _local2 = 0;
while (_local1 < mSampleAmount) {
_local2 = _local2 + mSampleArray[_local1];
_local1++;
}
SetLow(GetFPS(mSampleArray[mSampleIndex]));
mTEXT_FPS = GetFPS(_local2 / mSampleAmount);
mSampleIndex = (++mSampleIndex) % mSampleAmount;
}
function GetFPS(tNumber) {
var _local1 = 1;
return(int((1000 / tNumber) * _local1) / _local1);
}
function SetLow(tNumber) {
if ((tNumber < mLowFPS) || ((getTimer() - mLowCount) >= 2000)) {
mLowFPS = tNumber;
mTEXT_LOW = (mLowFPS.toString() + ".") + mTEXT_LOW.substring(0, 20);
mLowCount = getTimer();
}
}
function Profile_Setup() {
var _local1 = mProfile_List.length - 1;
while (_local1 >= 0) {
mProfile_List[_local1].mTotalTime = 0;
_local1--;
}
}
function Profile_Start(tID, tRGB) {
var _local1 = FindID(tID);
if (_local1 == -1) {
_local1 = mProfile_List.length;
mProfile_List[_local1] = {mName:tID, mTimeStamp:0, mTotalTime:0, mRGB:tRGB};
}
mProfile_List[_local1].mTimeStamp = getTimer();
}
function Profile_End(tID) {
var _local2 = getTimer();
var _local1 = FindID(tID);
mProfile_List[_local1].mTotalTime = mProfile_List[_local1].mTotalTime + (_local2 - mProfile_List[_local1].mTimeStamp);
}
function Profile_Complete() {
var _local7 = 0;
var _local2 = mProfile_List.length - 1;
while (_local2 >= 0) {
_local7 = _local7 + mProfile_List[_local2].mTotalTime;
_local2--;
}
mTEXT_ProfileTime = _local7;
this.clear();
var _local3 = 40;
var _local5 = 24;
var _local9 = 140;
var _local10 = 12;
var _local8 = "";
_local2 = mProfile_List.length - 1;
while (_local2 >= 0) {
var _local4 = _local3 + ((mProfile_List[_local2].mTotalTime / _local7) * _local9);
var _local6 = _local5 + _local10;
this.beginFill(mProfile_List[_local2].mRGB, 100);
this.moveTo(_local3, _local5);
this.lineTo(_local4, _local5);
this.lineTo(_local4, _local6);
this.lineTo(_local3, _local6);
this.lineTo(_local3, _local5);
this.endFill();
_local3 = _local4;
_local8 = _local8 + ((((((Pad(mProfile_List[_local2].mName, 10) + "\t= ") + Pad(mProfile_List[_local2].mTotalTime.toString(), 4)) + "\t(") + Math.round((mProfile_List[_local2].mTotalTime / _local7) * 100)) + "%)") + newline);
_local2--;
}
mTEXT_Output = _local8;
}
function FindID(tID) {
var _local1 = mProfile_List.length - 1;
while (_local1 >= 0) {
if (mProfile_List[_local1].mName == tID) {
return(_local1);
}
_local1--;
}
return(-1);
}
function Pad(tString, tAmount) {
while (tString.length < tAmount) {
tString = tString + " ";
}
return(tString);
}
var mLowFPS = 0;
var mLowCount = 0;
var mSampleIndex = 0;
var mSampleAmount = 60;
var mSampleArray = new Array(mSampleAmount);
var mSampleTimeStamp = getTimer();
var mSampleTotalTime = 0;
_root.__FPS__ = this;
var mProfile_List = new Array();
Symbol 188 Button
on (press) {
_parent.PlayLevel(1);
}
Symbol 189 Button
on (press) {
_parent.PlayLevel(2);
}
Symbol 190 Button
on (press) {
_parent.PlayLevel(3);
}
Symbol 191 Button
on (press) {
_parent.PlayLevel(4);
}
Symbol 194 Button
on (press) {
_parent._parent.PlayLevel(6);
}
Symbol 195 MovieClip Frame 1
stop();
Symbol 195 MovieClip Frame 2
stop();
Symbol 196 Button
on (press) {
_parent.PlayLevel(5);
}
Instance of Symbol 195 MovieClip "_LockedArena6" in Symbol 197 MovieClip Frame 1
onClipEvent (load) {
mArenaIndex = 6;
}
Symbol 217 Button
on (release) {
getURL ("http://www.crazymonkeygames.com", _global.mURLWindow);
}
Symbol 219 MovieClip Frame 1
onRelease = function () {
getURL ("http://www.crazymonkeygames.com", _global.mURLWindow);
};
Symbol 226 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 6
stop();
Symbol 226 MovieClip Frame 16
stop();
Symbol 226 MovieClip Frame 26
Symbol 226 MovieClip Frame 33
stop();
_visible = false;
Symbol 245 Button
on (press) {
_parent._Arena._TheArena.ExitArena();
}
Symbol 250 Button
on (press) {
_parent.Pause();
}
Instance of Symbol 239 MovieClip "_TAB_Global" in Symbol 251 MovieClip Frame 1
onClipEvent (load) {
this.useHandCursor = true;
onPress = function () {
_parent._parent.UpdateStats("global");
};
}
Instance of Symbol 242 MovieClip "_TAB_Level" in Symbol 251 MovieClip Frame 1
onClipEvent (load) {
this.useHandCursor = true;
onPress = function () {
_parent._parent.UpdateStats("level");
};
}