STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228090
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/64878951?noj=FRM64878951-4DC" width="1" height="1"></div>

Steer Wheels 2.swf

This is the info page for
Flash #46183

(Click the ID number above for more basic data on this flash file.)


Text
TUDWAY

Level 1 Complete

Press Space to Continue

Press Shift to Play More Games

Credits

Press Space to return

SteerWheels was made by Tudway
Made using Adobe Flash CS3 and APE
(ActionScript Physics Engine)
Sponsered by www.ugoplayer.com

Tested By:  UnionJackson, Henry, Stronghand, Dibs, Wedgeley,
Evets, Maxwell, Jamie G, Ballard, Wragg, Nikki

You Need Help!

Press Space to Continue

In this version of the game there is 2 modes
of play! The classic time trial mode that you
saw in the first SteerWheels with highscores
And the new practise mode where you arn't
timed or scored so you can complete the
game without any pressure. Both modes
unlock the levels in the level select so you
can come back to them any time.

Time Trial mode!

The aim of the game is get the yellow ball to
the yellow exit in the least time possible!

If you fall off the screen or get stuck press
the DOWN key.

If you want a break just press space. This
pauses time as well. Only 4 pauses per
level to stop cheaters!

If the time reaches 0 you lose a life.

Practice mode!

Use the Left and Right arrow keys to push
the yellow ball to the yellow exit.
If the ball or the cart falls off or gets stuck
press the DOWN key.
You can pause at any time by pressing
space and you have unlimited pauses!

General Stuff

Press Space to Return

Press the "M" key to quit and return to the
menu at any time, be careful this doesnt
pause the game!
Press the "S" key to mute the game.
Your progress is saved along with your top
score, so when you come back to play this
again you can go and play your favourite
levels in the level select menu.

SteerWheels 2

Use the left and right arrow keys to move
Move onto the option you want and press space to select.

Made by Tudway

V 0.997

Level
Select

Play

Help

Credits

Play More
Games

No Levels Unlocked

You either haven't played SteerWheels
2 before, or you are playing it on a
different website. Go now and unlock
some levels for you to play anytime!

Game Mode

Time Trial

Practice

Hold one of the arrow keys to highlight and then press
the space bar to choose a mode.
If you want to return to the menu, release the arrows
and press space.

Pause

Use left and right arrow keys to move

Push the yellow ball to the yellow bar

are you sure you want to quit
and return to the menu?
space to quit
m to return to game

Press Space to Submit
or M to Quit




You have Failed!

Press Shift to Play More Games

brought to you by:

Please Wait

Please play this on another site!

ActionScript [AS3]

Section 1
//Animator (fl.motion.Animator) package fl.motion { import flash.display.*; import flash.events.*; import flash.geom.*; public class Animator extends EventDispatcher { private var targetState:Object; public var transformationPoint:Point; private var _isPlaying:Boolean;// = false private var _time:int;// = -1 private var _target:DisplayObject; public var repeatCount:int;// = 1 private var _lastRenderedTime:int;// = -1 private var playCount:int;// = 0 private var _motion:Motion; public var orientToPath:Boolean;// = false public var autoRewind:Boolean;// = false public var positionMatrix:Matrix; private static var enterFrameBeacon:MovieClip = new MovieClip(); public function Animator(_arg1:XML=null, _arg2:DisplayObject=null){ orientToPath = false; autoRewind = false; repeatCount = 1; _isPlaying = false; _lastRenderedTime = -1; _time = -1; playCount = 0; super(); this.motion = new Motion(_arg1); this.target = _arg2; } public function stop():void{ enterFrameBeacon.removeEventListener(Event.ENTER_FRAME, this.enterFrameHandler); this._isPlaying = false; this.playCount = 0; this.rewind(); this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_END)); } public function get target():DisplayObject{ return (this._target); } public function set time(_arg1:int):void{ var _local2:Motion; var _local3:Keyframe; var _local4:Boolean; var _local5:Number; var _local6:Number; var _local7:Point; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Matrix; var _local13:Point; var _local14:Number; var _local15:Number; var _local16:ColorTransform; var _local17:Number; var _local18:Number; var _local19:Number; if (_arg1 == this._time){ return; }; _local2 = this.motion; if (_arg1 > (_local2.duration - 1)){ _arg1 = (_local2.duration - 1); } else { if (_arg1 < 0){ _arg1 = 0; }; }; this._time = _arg1; this.dispatchEvent(new MotionEvent(MotionEvent.TIME_CHANGE)); _local3 = _local2.getCurrentKeyframe(_arg1); _local4 = (((_local3.index == this._lastRenderedTime)) && (!(_local3.tweens.length))); if (_local4){ return; }; this._target.visible = false; if (!_local3.blank){ _local5 = _local2.getValue(_arg1, Tweenables.X); _local6 = _local2.getValue(_arg1, Tweenables.Y); _local7 = new Point(_local5, _local6); if (this.positionMatrix){ _local7 = this.positionMatrix.transformPoint(_local7); }; _local7.x = (_local7.x + this.targetState.x); _local7.y = (_local7.y + this.targetState.y); _local8 = (_local2.getValue(_arg1, Tweenables.SCALE_X) * this.targetState.scaleX); _local9 = (_local2.getValue(_arg1, Tweenables.SCALE_Y) * this.targetState.scaleY); _local10 = 0; _local11 = 0; if (this.orientToPath){ _local17 = _local2.getValue((_arg1 + 1), Tweenables.X); _local18 = _local2.getValue((_arg1 + 1), Tweenables.Y); _local19 = (Math.atan2((_local18 - _local6), (_local17 - _local5)) * (180 / Math.PI)); if (!isNaN(_local19)){ _local10 = (_local19 + this.targetState.skewX); _local11 = (_local19 + this.targetState.skewY); }; } else { _local10 = (_local2.getValue(_arg1, Tweenables.SKEW_X) + this.targetState.skewX); _local11 = (_local2.getValue(_arg1, Tweenables.SKEW_Y) + this.targetState.skewY); }; _local12 = new Matrix((_local8 * Math.cos((_local11 * (Math.PI / 180)))), (_local8 * Math.sin((_local11 * (Math.PI / 180)))), (-(_local9) * Math.sin((_local10 * (Math.PI / 180)))), (_local9 * Math.cos((_local10 * (Math.PI / 180)))), _local7.x, _local7.y); _local13 = _local12.transformPoint(this.targetState.transformPointInternal); _local14 = (_local12.tx - _local13.x); _local15 = (_local12.ty - _local13.y); _local12.tx = (_local12.tx + _local14); _local12.ty = (_local12.ty + _local15); this._target.rotation = _local11; this._target.transform.matrix = _local12; this._target.scaleX = _local8; this._target.scaleY = _local9; _local16 = _local2.getColorTransform(_arg1); if (_local16){ this._target.transform.colorTransform = _local16; }; this._target.filters = _local2.getFilters(_arg1); this._target.blendMode = _local3.blendMode; this._target.cacheAsBitmap = _local3.cacheAsBitmap; this._target.visible = true; }; this._lastRenderedTime = this._time; this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_UPDATE)); } private function enterFrameHandler(_arg1:Event):void{ this.nextFrame(); } public function set target(_arg1:DisplayObject):void{ var _local2:Object; var _local3:Number; var _local4:Number; var _local5:Point; if (!_arg1){ return; }; this._target = _arg1; this.targetState = {}; this.targetState.scaleX = this._target.scaleX; this.targetState.scaleY = this._target.scaleY; this.targetState.skewX = MatrixTransformer.getSkewX(this._target.transform.matrix); this.targetState.skewY = MatrixTransformer.getSkewY(this._target.transform.matrix); this.targetState.matrix = this._target.transform.matrix; _local2 = (this.targetState.bounds = this._target.getBounds(this._target)); if (this.transformationPoint){ _local3 = ((this.transformationPoint.x * _local2.width) + _local2.left); _local4 = ((this.transformationPoint.y * _local2.height) + _local2.top); this.targetState.transformPointInternal = new Point(_local3, _local4); _local5 = this.targetState.matrix.transformPoint(this.targetState.transformPointInternal); this.targetState.x = _local5.x; this.targetState.y = _local5.y; } else { this.targetState.transformPointInternal = new Point(0, 0); this.targetState.x = this._target.x; this.targetState.y = this._target.y; }; } public function get isPlaying():Boolean{ return (_isPlaying); } public function resume():void{ enterFrameBeacon.addEventListener(Event.ENTER_FRAME, this.enterFrameHandler, false, 0, true); this._isPlaying = true; } private function handleLastFrame():void{ this.playCount++; if ((((this.repeatCount == 0)) || ((this.playCount < this.repeatCount)))){ this.rewind(); } else { this.end(); }; } public function get motion():Motion{ return (this._motion); } public function nextFrame():void{ if (this.time >= (this.motion.duration - 1)){ this.handleLastFrame(); } else { this.time++; }; } public function play():void{ if (!this._isPlaying){ enterFrameBeacon.addEventListener(Event.ENTER_FRAME, this.enterFrameHandler, false, 0, true); this._isPlaying = true; }; this.playCount = 0; this.rewind(); this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_START)); } public function rewind():void{ this.time = 0; } public function end():void{ enterFrameBeacon.removeEventListener(Event.ENTER_FRAME, this.enterFrameHandler); this._isPlaying = false; this.playCount = 0; if (this.autoRewind){ this.rewind(); } else { if (this.time != (this.motion.duration - 1)){ this.time = (this.motion.duration - 1); }; }; this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_END)); } public function get time():int{ return (this._time); } public function pause():void{ enterFrameBeacon.removeEventListener(Event.ENTER_FRAME, this.enterFrameHandler); this._isPlaying = false; } public function set motion(_arg1:Motion):void{ this._motion = _arg1; if (((_arg1.source) && (_arg1.source.transformationPoint))){ this.transformationPoint = _arg1.source.transformationPoint.clone(); }; } public static function fromXMLString(_arg1:String, _arg2:DisplayObject=null):Animator{ return (new Animator(new XML(_arg1), _arg2)); } } }//package fl.motion
Section 2
//BezierEase (fl.motion.BezierEase) package fl.motion { import flash.geom.*; public class BezierEase implements ITween { public var points:Array; private var firstNode:Point; private var _target:String;// = "" private var lastNode:Point; public function BezierEase(_arg1:XML=null){ _target = ""; super(); this.points = []; this.parseXML(_arg1); } public function set target(_arg1:String):void{ this._target = _arg1; } public function get target():String{ return (this._target); } public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ var _local5:Number; var _local6:Array; var _local7:Number; if (_arg4 <= 0){ return (NaN); }; _local5 = (_arg1 / _arg4); if (_local5 <= 0){ return (_arg2); }; if (_local5 >= 1){ return ((_arg2 + _arg3)); }; this.firstNode = new Point(0, _arg2); this.lastNode = new Point(1, (_arg2 + _arg3)); _local6 = [this.firstNode].concat(this.points); _local6.push(this.lastNode); _local7 = CustomEase.getYForPercent(_local5, _local6); return (_local7); } private function parseXML(_arg1:XML=null):BezierEase{ var _local2:XMLList; var _local3:XML; if (!_arg1){ return (this); }; if (_arg1.@target.length()){ this.target = _arg1.@target; }; _local2 = _arg1.elements(); for each (_local3 in _local2) { this.points.push(new Point(Number(_local3.@x), Number(_local3.@y))); }; return (this); } } }//package fl.motion
Section 3
//BezierSegment (fl.motion.BezierSegment) package fl.motion { import flash.geom.*; public class BezierSegment { public var a:Point; public var c:Point; public var b:Point; public var d:Point; public function BezierSegment(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point){ this.a = _arg1; this.b = _arg2; this.c = _arg3; this.d = _arg4; } public function getYForX(_arg1:Number, _arg2:Array=null):Number{ var _local3:Array; var _local4:Number; var _local5:Number; var _local6:Number; if (this.a.x < this.d.x){ if (_arg1 <= (this.a.x + 1E-16)){ return (this.a.y); }; if (_arg1 >= (this.d.x - 1E-16)){ return (this.d.y); }; } else { if (_arg1 >= (this.a.x + 1E-16)){ return (this.a.y); }; if (_arg1 <= (this.d.x - 1E-16)){ return (this.d.y); }; }; if (!_arg2){ _arg2 = getCubicCoefficients(this.a.x, this.b.x, this.c.x, this.d.x); }; _local3 = getCubicRoots(_arg2[0], _arg2[1], _arg2[2], (_arg2[3] - _arg1)); _local4 = NaN; if (_local3.length == 0){ _local4 = 0; } else { if (_local3.length == 1){ _local4 = _local3[0]; } else { for each (_local6 in _local3) { if ((((0 <= _local6)) && ((_local6 <= 1)))){ _local4 = _local6; break; }; }; }; }; if (isNaN(_local4)){ return (NaN); }; _local5 = getSingleValue(_local4, this.a.y, this.b.y, this.c.y, this.d.y); return (_local5); } public function getValue(_arg1:Number):Point{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local2 = this.a.x; _local3 = (((((_arg1 * _arg1) * (this.d.x - _local2)) + ((3 * (1 - _arg1)) * ((_arg1 * (this.c.x - _local2)) + ((1 - _arg1) * (this.b.x - _local2))))) * _arg1) + _local2); _local4 = this.a.y; _local5 = (((((_arg1 * _arg1) * (this.d.y - _local4)) + ((3 * (1 - _arg1)) * ((_arg1 * (this.c.y - _local4)) + ((1 - _arg1) * (this.b.y - _local4))))) * _arg1) + _local4); return (new Point(_local3, _local5)); } public static function getCubicCoefficients(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Array{ return ([(((-(_arg1) + (3 * _arg2)) - (3 * _arg3)) + _arg4), (((3 * _arg1) - (6 * _arg2)) + (3 * _arg3)), ((-3 * _arg1) + (3 * _arg2)), _arg1]); } public static function getSingleValue(_arg1:Number, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{ return ((((((_arg1 * _arg1) * (_arg5 - _arg2)) + ((3 * (1 - _arg1)) * ((_arg1 * (_arg4 - _arg2)) + ((1 - _arg1) * (_arg3 - _arg2))))) * _arg1) + _arg2)); } public static function getCubicRoots(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):Array{ var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:int; var _local16:Number; if (!_arg1){ return (BezierSegment.getQuadraticRoots(_arg2, _arg3, _arg4)); }; if (_arg1 != 1){ _arg2 = (_arg2 / _arg1); _arg3 = (_arg3 / _arg1); _arg4 = (_arg4 / _arg1); }; _local5 = (((_arg2 * _arg2) - (3 * _arg3)) / 9); _local6 = (((((_arg2 * _arg2) - (3 * _arg3)) / 9) * _local5) * _local5); _local7 = ((((((2 * _arg2) * _arg2) * _arg2) - ((9 * _arg2) * _arg3)) + (27 * _arg4)) / 54); _local8 = (_local6 - (_local7 * _local7)); if (_local8 >= 0){ if (!_local5){ return ([0]); }; _local9 = Math.acos((_local7 / Math.sqrt(_local6))); _local10 = Math.sqrt(_local5); _local11 = (((-2 * _local10) * Math.cos((_local9 / 3))) - (_arg2 / 3)); _local12 = (((-2 * _local10) * Math.cos(((_local9 + (2 * Math.PI)) / 3))) - (_arg2 / 3)); _local13 = (((-2 * _local10) * Math.cos(((_local9 + (4 * Math.PI)) / 3))) - (_arg2 / 3)); return ([_local11, _local12, _local13]); //unresolved jump }; _local14 = Math.pow((Math.sqrt(-(_local8)) + Math.abs(_local7)), (1 / 3)); _local15 = ((_local7)>0) ? 1 : ((_local7 < 0)) ? -1 : 0; _local16 = ((-(_local15) * (_local14 + (_local5 / _local14))) - (_arg2 / 3)); return ([_local16]); } public static function getQuadraticRoots(_arg1:Number, _arg2:Number, _arg3:Number):Array{ var _local4:Array; var _local5:Number; var _local6:int; var _local7:Number; _local4 = []; if (!_arg1){ if (!_arg2){ return ([]); }; _local4[0] = (-(_arg3) / _arg2); return (_local4); }; _local5 = ((_arg2 * _arg2) - ((4 * _arg1) * _arg3)); _local6 = ((_local5)>0) ? 1 : ((_local5 < 0)) ? -1 : 0; if (_local6 < 0){ return ([]); }; if (!_local6){ _local4[0] = (-(_arg2) / (2 * _arg1)); } else { _local4[0] = (_local4[1] = (-(_arg2) / (2 * _arg1))); _local7 = (Math.sqrt(_local5) / (2 * _arg1)); _local4[0] = (_local4[0] - _local7); _local4[1] = (_local4[1] + _local7); }; return (_local4); } } }//package fl.motion
Section 4
//Color (fl.motion.Color) package fl.motion { import flash.display.*; import flash.geom.*; public class Color extends ColorTransform { private var _tintMultiplier:Number;// = 0 private var _tintColor:Number;// = 0 public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){ _tintColor = 0; _tintMultiplier = 0; super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8); } public function setTint(_arg1:uint, _arg2:Number):void{ var _local3:uint; var _local4:uint; var _local5:uint; this._tintColor = _arg1; this._tintMultiplier = _arg2; this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2))); _local3 = ((_arg1 >> 16) & 0xFF); _local4 = ((_arg1 >> 8) & 0xFF); _local5 = (_arg1 & 0xFF); this.redOffset = Math.round((_local3 * _arg2)); this.greenOffset = Math.round((_local4 * _arg2)); this.blueOffset = Math.round((_local5 * _arg2)); } public function set tintColor(_arg1:uint):void{ this.setTint(_arg1, this.tintMultiplier); } public function get brightness():Number{ return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1)); } private function deriveTintColor():uint{ var _local1:Number; var _local2:uint; var _local3:uint; var _local4:uint; var _local5:uint; _local1 = (1 / this.tintMultiplier); _local2 = Math.round((this.redOffset * _local1)); _local3 = Math.round((this.greenOffset * _local1)); _local4 = Math.round((this.blueOffset * _local1)); _local5 = (((_local2 << 16) | (_local3 << 8)) | _local4); return (_local5); } public function get tintMultiplier():Number{ return (this._tintMultiplier); } public function get tintColor():uint{ return (this._tintColor); } public function set brightness(_arg1:Number):void{ var _local2:Number; var _local3:Number; if (_arg1 > 1){ _arg1 = 1; } else { if (_arg1 < -1){ _arg1 = -1; }; }; _local2 = (1 - Math.abs(_arg1)); _local3 = 0; if (_arg1 > 0){ _local3 = (_arg1 * 0xFF); }; this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2)); this.redOffset = (this.greenOffset = (this.blueOffset = _local3)); } public function set tintMultiplier(_arg1:Number):void{ this.setTint(this.tintColor, _arg1); } private function parseXML(_arg1:XML=null):Color{ var _local2:XML; var _local3:XML; var _local4:String; var _local5:uint; if (!_arg1){ return (this); }; _local2 = _arg1.elements()[0]; if (!_local2){ return (this); }; for each (_local3 in _local2.attributes()) { _local4 = _local3.localName(); if (_local4 == "tintColor"){ _local5 = (Number(_local3.toString()) as uint); this.tintColor = _local5; } else { this[_local4] = Number(_local3.toString()); }; }; return (this); } public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{ var _local4:Number; var _local5:uint; var _local6:uint; var _local7:uint; var _local8:uint; var _local9:uint; var _local10:uint; var _local11:uint; var _local12:uint; var _local13:uint; var _local14:uint; var _local15:uint; var _local16:uint; var _local17:uint; _local4 = (1 - _arg3); _local5 = ((_arg1 >> 24) & 0xFF); _local6 = ((_arg1 >> 16) & 0xFF); _local7 = ((_arg1 >> 8) & 0xFF); _local8 = (_arg1 & 0xFF); _local9 = ((_arg2 >> 24) & 0xFF); _local10 = ((_arg2 >> 16) & 0xFF); _local11 = ((_arg2 >> 8) & 0xFF); _local12 = (_arg2 & 0xFF); _local13 = ((_local5 * _local4) + (_local9 * _arg3)); _local14 = ((_local6 * _local4) + (_local10 * _arg3)); _local15 = ((_local7 * _local4) + (_local11 * _arg3)); _local16 = ((_local8 * _local4) + (_local12 * _arg3)); _local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16); return (_local17); } public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{ var _local4:Number; var _local5:ColorTransform; _local4 = (1 - _arg3); _local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3))); return (_local5); } public static function fromXML(_arg1:XML):Color{ return (Color(new (Color).parseXML(_arg1))); } } }//package fl.motion
Section 5
//CustomEase (fl.motion.CustomEase) package fl.motion { import flash.geom.*; public class CustomEase implements ITween { public var points:Array; private var firstNode:Point; private var _target:String;// = "" private var lastNode:Point; public function CustomEase(_arg1:XML=null){ _target = ""; super(); this.points = []; this.parseXML(_arg1); this.firstNode = new Point(0, 0); this.lastNode = new Point(1, 1); } public function set target(_arg1:String):void{ this._target = _arg1; } public function get target():String{ return (this._target); } public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ var _local5:Number; var _local6:Array; var _local7:Number; if (_arg4 <= 0){ return (NaN); }; _local5 = (_arg1 / _arg4); if (_local5 <= 0){ return (_arg2); }; if (_local5 >= 1){ return ((_arg2 + _arg3)); }; _local6 = [this.firstNode].concat(this.points); _local6.push(this.lastNode); _local7 = getYForPercent(_local5, _local6); return ((_arg2 + (_local7 * _arg3))); } private function parseXML(_arg1:XML=null):CustomEase{ var _local2:XMLList; var _local3:XML; if (!_arg1){ return (this); }; if (_arg1.@target.length()){ this.target = _arg1.@target; }; _local2 = _arg1.elements(); for each (_local3 in _local2) { this.points.push(new Point(Number(_local3.@x), Number(_local3.@y))); }; return (this); } static function getYForPercent(_arg1:Number, _arg2:Array):Number{ var _local3:BezierSegment; var _local4:Array; var _local5:int; var _local6:BezierSegment; var _local7:Number; var _local8:int; var _local9:BezierSegment; _local3 = new BezierSegment(_arg2[0], _arg2[1], _arg2[2], _arg2[3]); _local4 = [_local3]; _local5 = 3; while (_local5 < (_arg2.length - 3)) { _local4.push(new BezierSegment(_arg2[_local5], _arg2[(_local5 + 1)], _arg2[(_local5 + 2)], _arg2[(_local5 + 3)])); _local5 = (_local5 + 3); }; _local6 = _local3; if (_arg2.length >= 5){ _local8 = 0; while (_local8 < _local4.length) { _local9 = _local4[_local8]; if ((((_local9.a.x <= _arg1)) && ((_arg1 <= _local9.d.x)))){ _local6 = _local9; break; }; _local8++; }; }; _local7 = _local6.getYForX(_arg1); return (_local7); } } }//package fl.motion
Section 6
//FunctionEase (fl.motion.FunctionEase) package fl.motion { import flash.utils.*; public class FunctionEase implements ITween { private var _functionName:String;// = "" public var parameters:Array;// = null private var _target:String;// = "" public var easingFunction:Function;// = null public function FunctionEase(_arg1:XML=null){ _functionName = ""; easingFunction = null; parameters = null; _target = ""; super(); this.parseXML(_arg1); } public function get functionName():String{ return (this._functionName); } public function set functionName(_arg1:String):void{ var _local2:Array; var _local3:String; var _local4:String; var _local5:Class; _local2 = _arg1.split("."); _local3 = _local2.pop(); _local4 = _local2.join("."); _local5 = (getDefinitionByName(_local4) as Class); if ((_local5[_local3] is Function)){ this.easingFunction = _local5[_local3]; this._functionName = _arg1; }; } public function set target(_arg1:String):void{ this._target = _arg1; } public function get target():String{ return (this._target); } public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ var _local5:Array; if ((this.parameters is Array)){ _local5 = [_arg1, _arg2, _arg3, _arg4].concat(this.parameters); return (this.easingFunction.apply(null, _local5)); }; return (this.easingFunction(_arg1, _arg2, _arg3, _arg4)); } private function parseXML(_arg1:XML=null):FunctionEase{ if (!_arg1){ return (this); }; if (_arg1.@functionName.length()){ this.functionName = _arg1.@functionName; }; return (this); } } }//package fl.motion
Section 7
//ITween (fl.motion.ITween) package fl.motion { public interface ITween { function get target():String; function set target(_arg1:String):void; function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number; } }//package fl.motion
Section 8
//Keyframe (fl.motion.Keyframe) package fl.motion { import flash.display.*; import flash.filters.*; import flash.utils.*; public class Keyframe { public var skewX:Number;// = NAN public var blendMode:String; public var skewY:Number;// = NAN public var firstFrame:String; public var tweenScale:Boolean;// = true public var cacheAsBitmap:Boolean;// = false public var rotateTimes:uint;// = 0 public var tweenSync:Boolean;// = false public var loop:String; public var scaleX:Number;// = NAN private var _index:int;// = -1 public var blank:Boolean;// = false public var tweenSnap:Boolean;// = false public var scaleY:Number;// = NAN public var color:Color; public var rotateDirection:String; public var orientToPath:Boolean;// = false public var tweens:Array; public var label:String;// = "" public var x:Number;// = NAN public var y:Number;// = NAN public var filters:Array; public function Keyframe(_arg1:XML=null){ _index = -1; x = NaN; y = NaN; scaleX = NaN; scaleY = NaN; skewX = NaN; skewY = NaN; label = ""; tweenScale = true; tweenSnap = false; tweenSync = false; cacheAsBitmap = false; blendMode = BlendMode.NORMAL; rotateDirection = RotateDirection.AUTO; rotateTimes = 0; orientToPath = false; blank = false; super(); this.tweens = []; this.filters = []; this.parseXML(_arg1); } public function set index(_arg1:int):void{ this._index = ((_arg1)<0) ? 0 : _arg1; if (this._index == 0){ this.setDefaults(); }; } public function getTween(_arg1:String=""):ITween{ var _local2:ITween; for each (_local2 in this.tweens) { if ((((((((_local2.target == _arg1)) || ((((_local2.target == "rotation")) && ((((_arg1 == "skewX")) || ((_arg1 == "skewY")))))))) || ((((_local2.target == "position")) && ((((_arg1 == "x")) || ((_arg1 == "y")))))))) || ((((_local2.target == "scale")) && ((((_arg1 == "scaleX")) || ((_arg1 == "scaleY")))))))){ return (_local2); }; }; return (null); } public function setValue(_arg1:String, _arg2:Number):void{ this[_arg1] = _arg2; } public function getValue(_arg1:String):Number{ return (Number(this[_arg1])); } public function get index():int{ return (this._index); } private function setDefaults():void{ if (isNaN(this.x)){ this.x = 0; }; if (isNaN(this.y)){ this.y = 0; }; if (isNaN(this.scaleX)){ this.scaleX = 1; }; if (isNaN(this.scaleY)){ this.scaleY = 1; }; if (isNaN(this.skewX)){ this.skewX = 0; }; if (isNaN(this.skewY)){ this.skewY = 0; }; if (!this.color){ this.color = new Color(); }; } public function affectsTweenable(_arg1:String=""):Boolean{ return (((((((((((!(_arg1)) || (!(isNaN(this[_arg1]))))) || ((((_arg1 == "color")) && (this.color))))) || ((((_arg1 == "filters")) && (this.filters.length))))) || (this.blank))) || (this.getTween()))); } private function parseXML(_arg1:XML=null):Keyframe{ var indexString:String; var indexValue:int; var tweenableNames:Array; var tweenableName:String; var elements:XMLList; var filtersArray:Array; var child:XML; var attribute:XML; var attributeValue:String; var name:String; var tweenChildren:XMLList; var tweenChild:XML; var tweenName:String; var filtersChildren:XMLList; var filterXML:XML; var filterName:String; var filterClassName:String; var filterClass:Object; var filterInstance:BitmapFilter; var filterTypeInfo:XML; var accessorList:XMLList; var ratios:Array; var attrib:XML; var attribName:String; var accessor:XML; var attribType:String; var attribValue:String; var uintValue:uint; var valuesArray:Array; var xml = _arg1; if (!xml){ return (this); }; indexString = xml.@index.toXMLString(); indexValue = parseInt(indexString); if (indexString){ this.index = indexValue; } else { throw (new Error("<Keyframe> is missing the required attribute \"index\".")); }; if (xml.@label.length()){ this.label = xml.@label; }; if (xml.@tweenScale.length()){ this.tweenScale = (xml.@tweenScale.toString() == "true"); }; if (xml.@tweenSnap.length()){ this.tweenSnap = (xml.@tweenSnap.toString() == "true"); }; if (xml.@tweenSync.length()){ this.tweenSync = (xml.@tweenSync.toString() == "true"); }; if (xml.@blendMode.length()){ this.blendMode = xml.@blendMode; }; if (xml.@cacheAsBitmap.length()){ this.cacheAsBitmap = (xml.@cacheAsBitmap.toString() == "true"); }; if (xml.@rotateDirection.length()){ this.rotateDirection = xml.@rotateDirection; }; if (xml.@rotateTimes.length()){ this.rotateTimes = parseInt(xml.@rotateTimes); }; if (xml.@orientToPath.length()){ this.orientToPath = (xml.@orientToPath.toString() == "true"); }; if (xml.@blank.length()){ this.blank = (xml.@blank.toString() == "true"); }; tweenableNames = ["x", "y", "scaleX", "scaleY", "rotation", "skewX", "skewY"]; for each (tweenableName in tweenableNames) { attribute = xml.attribute(tweenableName)[0]; if (!attribute){ } else { attributeValue = attribute.toString(); if (attributeValue){ this[tweenableName] = Number(attributeValue); }; }; }; elements = xml.elements(); filtersArray = []; for each (child in elements) { name = child.localName(); if (name == "tweens"){ tweenChildren = child.elements(); for each (tweenChild in tweenChildren) { tweenName = tweenChild.localName(); if (tweenName == "SimpleEase"){ this.tweens.push(new SimpleEase(tweenChild)); } else { if (tweenName == "CustomEase"){ this.tweens.push(new CustomEase(tweenChild)); } else { if (tweenName == "BezierEase"){ this.tweens.push(new BezierEase(tweenChild)); } else { if (tweenName == "FunctionEase"){ this.tweens.push(new FunctionEase(tweenChild)); }; }; }; }; }; } else { if (name == "filters"){ filtersChildren = child.elements(); for each (filterXML in filtersChildren) { filterName = filterXML.localName(); filterClassName = ("flash.filters." + filterName); if (filterName == "AdjustColorFilter"){ } else { filterClass = getDefinitionByName(filterClassName); filterInstance = new (filterClass); filterTypeInfo = describeType(filterInstance); accessorList = filterTypeInfo.accessor; ratios = []; for each (attrib in filterXML.attributes()) { attribName = attrib.localName(); accessor = accessorList.(@name == attribName)[0]; attribType = accessor.@type; attribValue = attrib.toString(); if (attribType == "int"){ filterInstance[attribName] = parseInt(attribValue); } else { if (attribType == "uint"){ filterInstance[attribName] = (parseInt(attribValue) as uint); uintValue = (parseInt(attribValue) as uint); } else { if (attribType == "Number"){ filterInstance[attribName] = Number(attribValue); } else { if (attribType == "Boolean"){ filterInstance[attribName] = (attribValue == "true"); } else { if (attribType == "Array"){ attribValue = attribValue.substring(1, (attribValue.length - 1)); valuesArray = null; if ((((attribName == "ratios")) || ((attribName == "colors")))){ valuesArray = splitUint(attribValue); } else { if (attribName == "alphas"){ valuesArray = splitNumber(attribValue); }; }; if (attribName == "ratios"){ ratios = valuesArray; } else { if (valuesArray){ filterInstance[attribName] = valuesArray; }; }; } else { if (attribType == "String"){ filterInstance[attribName] = attribValue; }; }; }; }; }; }; }; if (ratios.length){ filterInstance["ratios"] = ratios; }; filtersArray.push(filterInstance); }; }; } else { if (name == "color"){ this.color = Color.fromXML(child); }; }; }; this.filters = filtersArray; }; return (this); } public function set rotation(_arg1:Number):void{ if (((isNaN(this.skewX)) || (isNaN(this.skewY)))){ this.skewX = _arg1; } else { this.skewX = (this.skewX + (_arg1 - this.skewY)); }; this.skewY = _arg1; } public function get rotation():Number{ return (this.skewY); } private static function splitNumber(_arg1:String):Array{ var _local2:Array; var _local3:int; _local2 = _arg1.split(","); _local3 = 0; while (_local3 < _local2.length) { _local2[_local3] = Number(_local2[_local3]); _local3++; }; return (_local2); } private static function splitUint(_arg1:String):Array{ var _local2:Array; var _local3:int; _local2 = _arg1.split(","); _local3 = 0; while (_local3 < _local2.length) { _local2[_local3] = (parseInt(_local2[_local3]) as uint); _local3++; }; return (_local2); } private static function splitInt(_arg1:String):Array{ var _local2:Array; var _local3:int; _local2 = _arg1.split(","); _local3 = 0; while (_local3 < _local2.length) { _local2[_local3] = (parseInt(_local2[_local3]) as int); _local3++; }; return (_local2); } } }//package fl.motion
Section 9
//MatrixTransformer (fl.motion.MatrixTransformer) package fl.motion { import flash.geom.*; public class MatrixTransformer { public static function getSkewY(_arg1:Matrix):Number{ return ((Math.atan2(_arg1.b, _arg1.a) * (180 / Math.PI))); } public static function getScaleX(_arg1:Matrix):Number{ return (Math.sqrt(((_arg1.a * _arg1.a) + (_arg1.b * _arg1.b)))); } public static function getScaleY(_arg1:Matrix):Number{ return (Math.sqrt(((_arg1.c * _arg1.c) + (_arg1.d * _arg1.d)))); } public static function setSkewXRadians(_arg1:Matrix, _arg2:Number):void{ var _local3:Number; _local3 = getScaleY(_arg1); _arg1.c = (-(_local3) * Math.sin(_arg2)); _arg1.d = (_local3 * Math.cos(_arg2)); } public static function setRotation(_arg1:Matrix, _arg2:Number):void{ setRotationRadians(_arg1, (_arg2 * (Math.PI / 180))); } public static function rotateAroundInternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{ var _local5:Point; _local5 = new Point(_arg2, _arg3); _local5 = _arg1.transformPoint(_local5); _arg1.tx = (_arg1.tx - _local5.x); _arg1.ty = (_arg1.ty - _local5.y); _arg1.rotate((_arg4 * (Math.PI / 180))); _arg1.tx = (_arg1.tx + _local5.x); _arg1.ty = (_arg1.ty + _local5.y); } public static function setSkewX(_arg1:Matrix, _arg2:Number):void{ setSkewXRadians(_arg1, (_arg2 * (Math.PI / 180))); } public static function setSkewY(_arg1:Matrix, _arg2:Number):void{ setSkewYRadians(_arg1, (_arg2 * (Math.PI / 180))); } public static function setScaleX(_arg1:Matrix, _arg2:Number):void{ var _local3:Number; var _local4:Number; var _local5:Number; _local3 = getScaleX(_arg1); if (_local3){ _local4 = (_arg2 / _local3); _arg1.a = (_arg1.a * _local4); _arg1.b = (_arg1.b * _local4); } else { _local5 = getSkewYRadians(_arg1); _arg1.a = (Math.cos(_local5) * _arg2); _arg1.b = (Math.sin(_local5) * _arg2); }; } public static function setScaleY(_arg1:Matrix, _arg2:Number):void{ var _local3:Number; var _local4:Number; var _local5:Number; _local3 = getScaleY(_arg1); if (_local3){ _local4 = (_arg2 / _local3); _arg1.c = (_arg1.c * _local4); _arg1.d = (_arg1.d * _local4); } else { _local5 = getSkewXRadians(_arg1); _arg1.c = (-(Math.sin(_local5)) * _arg2); _arg1.d = (Math.cos(_local5) * _arg2); }; } public static function setRotationRadians(_arg1:Matrix, _arg2:Number):void{ var _local3:Number; var _local4:Number; _local3 = getRotationRadians(_arg1); _local4 = getSkewXRadians(_arg1); setSkewXRadians(_arg1, ((_local4 + _arg2) - _local3)); setSkewYRadians(_arg1, _arg2); } public static function setSkewYRadians(_arg1:Matrix, _arg2:Number):void{ var _local3:Number; _local3 = getScaleX(_arg1); _arg1.a = (_local3 * Math.cos(_arg2)); _arg1.b = (_local3 * Math.sin(_arg2)); } public static function getSkewX(_arg1:Matrix):Number{ return ((Math.atan2(-(_arg1.c), _arg1.d) * (180 / Math.PI))); } public static function getSkewYRadians(_arg1:Matrix):Number{ return (Math.atan2(_arg1.b, _arg1.a)); } public static function getSkewXRadians(_arg1:Matrix):Number{ return (Math.atan2(-(_arg1.c), _arg1.d)); } public static function getRotation(_arg1:Matrix):Number{ return ((getRotationRadians(_arg1) * (180 / Math.PI))); } public static function rotateAroundExternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{ _arg1.tx = (_arg1.tx - _arg2); _arg1.ty = (_arg1.ty - _arg3); _arg1.rotate((_arg4 * (Math.PI / 180))); _arg1.tx = (_arg1.tx + _arg2); _arg1.ty = (_arg1.ty + _arg3); } public static function getRotationRadians(_arg1:Matrix):Number{ return (getSkewYRadians(_arg1)); } public static function matchInternalPointWithExternal(_arg1:Matrix, _arg2:Point, _arg3:Point):void{ var _local4:Point; var _local5:Number; var _local6:Number; _local4 = _arg1.transformPoint(_arg2); _local5 = (_arg3.x - _local4.x); _local6 = (_arg3.y - _local4.y); _arg1.tx = (_arg1.tx + _local5); _arg1.ty = (_arg1.ty + _local6); } } }//package fl.motion
Section 10
//Motion (fl.motion.Motion) package fl.motion { import flash.filters.*; import flash.geom.*; import flash.utils.*; public class Motion { private var _keyframesCompact:Array; public var keyframes:Array; public var source:Source; private var _duration:int;// = 0 private static var typeCache:Object = {}; public function Motion(_arg1:XML=null){ var _local2:Keyframe; _duration = 0; super(); this.keyframes = []; this.parseXML(_arg1); if (!this.source){ this.source = new Source(); }; if (this.duration == 0){ _local2 = new Keyframe(); _local2.index = 0; this.addKeyframe(_local2); }; } public function getFilters(_arg1:Number):Array{ var _local2:Array; var _local3:Keyframe; var _local4:Array; var _local5:Number; var _local6:ITween; var _local7:Keyframe; var _local8:Array; var _local9:Number; var _local10:Number; _local2 = null; _local3 = this.getCurrentKeyframe(_arg1, "filters"); if (((!(_local3)) || (!(_local3.filters.length)))){ return ([]); }; _local4 = _local3.filters; _local5 = (_arg1 - _local3.index); _local6 = ((_local3.getTween("filters")) || (_local3.getTween())); if ((((_local5 == 0)) || (!(_local6)))){ _local2 = _local4; } else { if (_local6){ _local7 = this.getNextKeyframe(_arg1, "filters"); if (((!(_local7)) || (!(_local7.filters.length)))){ _local2 = _local4; } else { _local8 = _local7.filters; _local9 = (_local7.index - _local3.index); _local10 = _local6.getValue(_local5, 0, 1, _local9); _local2 = interpolateFilters(_local4, _local8, _local10); }; }; }; return (_local2); } public function getCurrentKeyframe(_arg1:int, _arg2:String=""):Keyframe{ var _local3:int; var _local4:Keyframe; if (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1))))){ return (null); }; _local3 = _arg1; while (_local3 > 0) { _local4 = this.keyframes[_local3]; if (((_local4) && (_local4.affectsTweenable(_arg2)))){ return (_local4); }; _local3--; }; return (this.keyframes[0]); } public function get duration():int{ if (this._duration < this.keyframes.length){ this._duration = this.keyframes.length; }; return (this._duration); } public function get keyframesCompact():Array{ var _local1:Keyframe; this._keyframesCompact = []; for each (_local1 in this.keyframes) { if (_local1){ this._keyframesCompact.push(_local1); }; }; return (this._keyframesCompact); } private function parseXML(_arg1:XML):Motion{ var _local2:XMLList; var _local3:Number; var _local4:XML; var _local5:XML; if (!_arg1){ return (this); }; if (_arg1.@duration.length()){ this._duration = parseInt(_arg1.@duration); }; _local2 = _arg1.elements(); _local3 = 0; while (_local3 < _local2.length()) { _local4 = _local2[_local3]; if (_local4.localName() == "source"){ _local5 = _local4.children()[0]; this.source = new Source(_local5); } else { if (_local4.localName() == "Keyframe"){ this.addKeyframe(new Keyframe(_local4)); }; }; _local3++; }; return (this); } public function set duration(_arg1:int):void{ if (_arg1 < this.keyframes.length){ _arg1 = this.keyframes.length; }; this._duration = _arg1; } private function indexOutOfRange(_arg1:int):Boolean{ return (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1))))); } public function addKeyframe(_arg1:Keyframe):void{ this.keyframes[_arg1.index] = _arg1; if (this.duration < this.keyframes.length){ this.duration = this.keyframes.length; }; } public function setValue(_arg1:int, _arg2:String, _arg3:Number):void{ var _local4:Keyframe; if (_arg1 == 0){ return; }; _local4 = this.keyframes[_arg1]; if (!_local4){ _local4 = new Keyframe(); _local4.index = _arg1; this.addKeyframe(_local4); }; _local4.setValue(_arg2, _arg3); } public function getNextKeyframe(_arg1:int, _arg2:String=""):Keyframe{ var _local3:int; var _local4:Keyframe; if (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1))))){ return (null); }; _local3 = (_arg1 + 1); while (_local3 < this.keyframes.length) { _local4 = this.keyframes[_local3]; if (((_local4) && (_local4.affectsTweenable(_arg2)))){ return (_local4); }; _local3++; }; return (null); } public function getValue(_arg1:Number, _arg2:String):Number{ var _local3:Number; var _local4:Keyframe; var _local5:Number; var _local6:Number; var _local7:ITween; var _local8:String; var _local9:Keyframe; var _local10:Number; var _local11:Number; var _local12:Number; _local3 = NaN; _local4 = this.getCurrentKeyframe(_arg1, _arg2); if (((!(_local4)) || (_local4.blank))){ return (NaN); }; _local5 = _local4.getValue(_arg2); if (((isNaN(_local5)) && ((_local4.index > 0)))){ _local5 = this.getValue((_local4.index - 1), _arg2); }; if (isNaN(_local5)){ return (NaN); }; _local6 = (_arg1 - _local4.index); if (_local6 == 0){ return (_local5); }; _local7 = ((_local4.getTween(_arg2)) || (_local4.getTween())); if (((((!(_local7)) || (((!(_local4.tweenScale)) && ((((_arg2 == Tweenables.SCALE_X)) || ((_arg2 == Tweenables.SCALE_Y)))))))) || ((((_local4.rotateDirection == RotateDirection.NONE)) && ((((((_arg2 == Tweenables.ROTATION)) || ((_arg2 == Tweenables.SKEW_X)))) || ((_arg2 == Tweenables.SKEW_Y)))))))){ return (_local5); }; _local8 = _arg2; if (_local7.target == ""){ _local8 = ""; }; _local9 = this.getNextKeyframe(_arg1, _local8); if (((!(_local9)) || (_local9.blank))){ return (_local5); }; _local10 = _local9.getValue(_arg2); if (isNaN(_local10)){ _local10 = _local5; }; _local11 = (_local10 - _local5); if ((((((_arg2 == Tweenables.SKEW_X)) || ((_arg2 == Tweenables.SKEW_Y)))) || ((_arg2 == Tweenables.ROTATION)))){ if (_local4.rotateDirection == RotateDirection.AUTO){ _local11 = (_local11 % 360); if (_local11 > 180){ _local11 = (_local11 - 360); } else { if (_local11 < -180){ _local11 = (_local11 + 360); }; }; } else { if (_local4.rotateDirection == RotateDirection.CW){ if (_local11 < 0){ _local11 = ((_local11 % 360) + 360); }; _local11 = (_local11 + (_local4.rotateTimes * 360)); } else { if (_local11 > 0){ _local11 = ((_local11 % 360) - 360); }; _local11 = (_local11 - (_local4.rotateTimes * 360)); }; }; }; _local12 = (_local9.index - _local4.index); _local3 = _local7.getValue(_local6, _local5, _local11, _local12); return (_local3); } public function set keyframesCompact(_arg1:Array):void{ var _local2:Keyframe; this._keyframesCompact = _arg1.concat(); this.keyframes = []; for each (_local2 in this._keyframesCompact) { this.addKeyframe(_local2); }; } public function getColorTransform(_arg1:int):ColorTransform{ var _local2:ColorTransform; var _local3:Keyframe; var _local4:ColorTransform; var _local5:Number; var _local6:ITween; var _local7:Keyframe; var _local8:ColorTransform; var _local9:Number; var _local10:Number; _local2 = null; _local3 = this.getCurrentKeyframe(_arg1, "color"); if (((!(_local3)) || (!(_local3.color)))){ return (null); }; _local4 = _local3.color; _local5 = (_arg1 - _local3.index); _local6 = ((((_local3.getTween("color")) || (_local3.getTween("alpha")))) || (_local3.getTween())); if ((((_local5 == 0)) || (!(_local6)))){ _local2 = _local4; } else { if (_local6){ _local7 = this.getNextKeyframe(_arg1, "color"); if (((!(_local7)) || (!(_local7.color)))){ _local2 = _local4; } else { _local8 = _local7.color; _local9 = (_local7.index - _local3.index); _local10 = _local6.getValue(_local5, 0, 1, _local9); _local2 = Color.interpolateTransform(_local4, _local8, _local10); }; }; }; return (_local2); } private static function getTypeInfo(_arg1):XML{ var _local2:String; _local2 = ""; if ((_arg1 is String)){ _local2 = _arg1; } else { _local2 = getQualifiedClassName(_arg1); }; if ((_local2 in typeCache)){ return (typeCache[_local2]); }; if ((_arg1 is String)){ _arg1 = getDefinitionByName(_arg1); }; return ((typeCache[_local2] = describeType(_arg1))); } public static function interpolateFilter(_arg1:BitmapFilter, _arg2:BitmapFilter, _arg3:Number):BitmapFilter{ var _local4:Number; var _local5:BitmapFilter; var _local6:XML; var _local7:XMLList; var _local8:XML; var _local9:String; var _local10:String; var _local11:uint; var _local12:uint; var _local13:uint; var _local14:Array; var _local15:Array; var _local16:Array; var _local17:int; var _local18:int; var _local19:int; var _local20:int; var _local21:int; var _local22:Number; var _local23:uint; var _local24:Number; var _local25:int; var _local26:Number; var _local27:uint; var _local28:Number; var _local29:int; var _local30:uint; var _local31:Number; if (((!(_arg2)) || (!((_arg1["constructor"] == _arg2["constructor"]))))){ return (_arg1); }; if (_arg3 > 1){ _arg3 = 1; } else { if (_arg3 < 0){ _arg3 = 0; }; }; _local4 = (1 - _arg3); _local5 = _arg1.clone(); _local6 = getTypeInfo(_arg1); _local7 = _local6.accessor; for each (_local8 in _local7) { _local9 = _local8.@name.toString(); _local10 = _local8.@type; if ((((_local10 == "Number")) || ((_local10 == "int")))){ _local5[_local9] = ((_arg1[_local9] * _local4) + (_arg2[_local9] * _arg3)); } else { if (_local10 == "uint"){ switch (_local9){ case "color": case "highlightColor": case "shadowColor": _local11 = _arg1[_local9]; _local12 = _arg2[_local9]; _local13 = Color.interpolateColor(_local11, _local12, _arg3); _local5[_local9] = _local13; break; default: _local5[_local9] = ((_arg1[_local9] * _local4) + (_arg2[_local9] * _arg3)); break; }; }; }; }; if ((((_arg1 is GradientGlowFilter)) || ((_arg1 is GradientBevelFilter)))){ _local14 = []; _local15 = []; _local16 = []; _local17 = _arg1["ratios"].length; _local18 = _arg2["ratios"].length; _local19 = Math.max(_local17, _local18); _local20 = 0; while (_local20 < _local19) { _local21 = Math.min(_local20, (_local17 - 1)); _local22 = _arg1["ratios"][_local21]; _local23 = _arg1["colors"][_local21]; _local24 = _arg1["alphas"][_local21]; _local25 = Math.min(_local20, (_local18 - 1)); _local26 = _arg2["ratios"][_local25]; _local27 = _arg2["colors"][_local25]; _local28 = _arg2["alphas"][_local25]; _local29 = ((_local22 * _local4) + (_local26 * _arg3)); _local30 = Color.interpolateColor(_local23, _local27, _arg3); _local31 = ((_local24 * _local4) + (_local28 * _arg3)); _local14[_local20] = _local29; _local15[_local20] = _local30; _local16[_local20] = _local31; _local20++; }; _local5["colors"] = _local15; _local5["alphas"] = _local16; _local5["ratios"] = _local14; }; return (_local5); } public static function interpolateFilters(_arg1:Array, _arg2:Array, _arg3:Number):Array{ var _local4:Array; var _local5:int; var _local6:BitmapFilter; var _local7:BitmapFilter; var _local8:BitmapFilter; if (_arg1.length != _arg2.length){ return (null); }; _local4 = []; _local5 = 0; while (_local5 < _arg1.length) { _local6 = _arg1[_local5]; _local7 = _arg2[_local5]; _local8 = interpolateFilter(_local6, _local7, _arg3); if (_local8){ _local4.push(_local8); }; _local5++; }; return (_local4); } public static function fromXMLString(_arg1:String):Motion{ var _local2:XML; _local2 = new XML(_arg1); return (new Motion(_local2)); } } }//package fl.motion
Section 11
//MotionEvent (fl.motion.MotionEvent) package fl.motion { import flash.events.*; public class MotionEvent extends Event { public static const MOTION_UPDATE:String = "motionUpdate"; public static const TIME_CHANGE:String = "timeChange"; public static const MOTION_START:String = "motionStart"; public static const MOTION_END:String = "motionEnd"; public function MotionEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } override public function clone():Event{ return (new MotionEvent(this.type, this.bubbles, this.cancelable)); } } }//package fl.motion
Section 12
//RotateDirection (fl.motion.RotateDirection) package fl.motion { public class RotateDirection { public static const CW:String = "cw"; public static const CCW:String = "ccw"; public static const NONE:String = "none"; public static const AUTO:String = "auto"; } }//package fl.motion
Section 13
//SimpleEase (fl.motion.SimpleEase) package fl.motion { public class SimpleEase implements ITween { private var _ease:Number;// = 0 private var _target:String;// = "" public function SimpleEase(_arg1:XML=null){ _ease = 0; _target = ""; super(); this.parseXML(_arg1); } public function set target(_arg1:String):void{ this._target = _arg1; } private function parseXML(_arg1:XML=null):SimpleEase{ if (_arg1){ if (_arg1.@ease.length()){ this.ease = Number(_arg1.@ease); }; }; return (this); } public function get ease():Number{ return (this._ease); } public function get target():String{ return (this._target); } public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (easeQuadPercent(_arg1, _arg2, _arg3, _arg4, this.ease)); } public function set ease(_arg1:Number):void{ this._ease = ((_arg1 > 1)) ? 1 : ((_arg1 < -1)) ? -1 : (isNaN(_arg1)) ? 0 : _arg1; } public static function easeQuadPercent(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{ if (_arg4 <= 0){ return (NaN); }; if (_arg1 <= 0){ return (_arg2); }; _arg1 = (_arg1 / _arg4); if (_arg1 >= 1){ return ((_arg2 + _arg3)); }; if (!_arg5){ return (((_arg3 * _arg1) + _arg2)); }; if (_arg5 > 1){ _arg5 = 1; } else { if (_arg5 < -1){ _arg5 = -1; }; }; if (_arg5 < 0){ return ((((_arg3 * _arg1) * ((_arg1 * -(_arg5)) + (1 + _arg5))) + _arg2)); }; return ((((_arg3 * _arg1) * (((2 - _arg1) * _arg5) + (1 - _arg5))) + _arg2)); } public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ if (_arg4 <= 0){ return (NaN); }; if (_arg1 <= 0){ return (_arg2); }; if (_arg1 >= _arg4){ return ((_arg2 + _arg3)); }; return ((((_arg3 * _arg1) / _arg4) + _arg2)); } } }//package fl.motion
Section 14
//Source (fl.motion.Source) package fl.motion { import flash.geom.*; public class Source { public var instanceName:String;// = "" public var symbolName:String;// = "" public var dimensions:Rectangle; public var scaleX:Number;// = 1 public var skewY:Number;// = 0 public var skewX:Number;// = 0 public var scaleY:Number;// = 1 public var elementType:String;// = "" public var transformationPoint:Point; public var linkageID:String;// = "" public var frameRate:Number;// = NAN public var x:Number;// = 0 public var y:Number;// = 0 public var rotation:Number;// = 0 public function Source(_arg1:XML=null){ frameRate = NaN; elementType = ""; symbolName = ""; instanceName = ""; linkageID = ""; x = 0; y = 0; scaleX = 1; scaleY = 1; skewX = 0; skewY = 0; rotation = 0; super(); this.parseXML(_arg1); } private function parseXML(_arg1:XML=null):Source{ var _local2:XMLList; var _local3:XML; var _local4:XML; var _local5:XML; if (!_arg1){ return (this); }; if (_arg1.@instanceName){ this.instanceName = String(_arg1.@instanceName); }; if (_arg1.@symbolName){ this.symbolName = String(_arg1.@symbolName); }; if (_arg1.@linkageID){ this.linkageID = String(_arg1.@linkageID); }; if (!isNaN(_arg1.@frameRate)){ this.frameRate = Number(_arg1.@frameRate); }; _local2 = _arg1.elements(); for each (_local3 in _local2) { if (_local3.localName() == "transformationPoint"){ _local4 = _local3.children()[0]; this.transformationPoint = new Point(Number(_local4.@x), Number(_local4.@y)); } else { if (_local3.localName() == "dimensions"){ _local5 = _local3.children()[0]; this.dimensions = new Rectangle(Number(_local5.@left), Number(_local5.@top), Number(_local5.@width), Number(_local5.@height)); }; }; }; return (this); } } }//package fl.motion
Section 15
//Tweenables (fl.motion.Tweenables) package fl.motion { public class Tweenables { public static const SCALE_X:String = "scaleX"; public static const SCALE_Y:String = "scaleY"; public static const SKEW_X:String = "skewX"; public static const SKEW_Y:String = "skewY"; public static const X:String = "x"; public static const Y:String = "y"; public static const ROTATION:String = "rotation"; } }//package fl.motion
Section 16
//MochiScores (mochi.MochiScores) package mochi { import flash.display.*; import flash.text.*; public class MochiScores { private static var boardID:String; public static var onErrorHandler:Object; public static var onCloseHandler:Object; public static function showLeaderboard(_arg1:Object=null):void{ var options = _arg1; if (options != null){ if (options.clip != null){ if ((options.clip is Sprite)){ MochiServices.setContainer(options.clip); }; delete options.clip; } else { MochiServices.setContainer(); }; MochiServices.stayOnTop(); if (options.name != null){ if ((options.name is TextField)){ if (options.name.text.length > 0){ options.name = options.name.text; }; }; }; if (options.score != null){ if ((options.score is TextField)){ if (options.score.text.length > 0){ options.score = options.score.text; }; }; }; if (options.onDisplay != null){ options.onDisplay(); } else { if (MochiServices.clip != null){ if ((MochiServices.clip is MovieClip)){ MochiServices.clip.stop(); } else { trace("Warning: Container is not a MovieClip, cannot call default onDisplay."); }; }; }; } else { options = {}; if ((MochiServices.clip is MovieClip)){ MochiServices.clip.stop(); } else { trace("Warning: Container is not a MovieClip, cannot call default onDisplay."); }; }; if (options.onClose != null){ onCloseHandler = options.onClose; } else { onCloseHandler = function ():void{ if ((MochiServices.clip is MovieClip)){ MochiServices.clip.play(); } else { trace("Warning: Container is not a MovieClip, cannot call default onClose."); }; }; }; if (options.onError != null){ onErrorHandler = options.onError; } else { onErrorHandler = null; }; if (options.boardID == null){ if (MochiScores.boardID != null){ options.boardID = MochiScores.boardID; }; }; MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose); } public static function closeLeaderboard():void{ MochiServices.send("scores_closeLeaderboard"); } public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{ MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2); } public static function requestList(_arg1:Object, _arg2:Object=null):void{ MochiServices.send("scores_requestList", null, _arg1, _arg2); } public static function scoresArrayToObjects(_arg1:Object):Object{ var _local2:Object; var _local3:Number; var _local4:Number; var _local5:Object; var _local6:Object; var _local7:String; var _local8:String; _local2 = {}; for (_local7 in _arg1) { if (typeof(_arg1[_local7]) == "object"){ if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){ _local2[_local7] = []; _local5 = _arg1[_local7]; _local4 = 0; while (_local4 < _local5.rows.length) { _local6 = {}; _local3 = 0; while (_local3 < _local5.cols.length) { _local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3]; _local3++; }; _local2[_local7].push(_local6); _local4++; }; } else { _local2[_local7] = {}; for (_local8 in _arg1[_local7]) { _local2[_local7][_local8] = _arg1[_local7][_local8]; }; }; } else { _local2[_local7] = _arg1[_local7]; }; }; return (_local2); } public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{ MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4); } public static function onClose(_arg1:Object=null):void{ if (_arg1 != null){ if (_arg1.error != null){ if (_arg1.error == true){ if (onErrorHandler != null){ if (_arg1.errorCode == null){ _arg1.errorCode = "IOError"; }; onErrorHandler(_arg1.errorCode); MochiServices.doClose(); return; }; }; }; }; onCloseHandler(); MochiServices.doClose(); } public static function setBoardID(_arg1:String):void{ MochiScores.boardID = _arg1; MochiServices.send("scores_setBoardID", {boardID:_arg1}); } } }//package mochi
Section 17
//MochiServices (mochi.MochiServices) package mochi { import flash.display.*; import flash.events.*; import flash.net.*; import flash.utils.*; import flash.system.*; public class MochiServices { private static var _container:Object; private static var _connected:Boolean = false; private static var _swfVersion:String; private static var _sendChannel:LocalConnection; private static var _rcvChannelName:String; private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf"; private static var _clip:MovieClip; private static var _loader:Loader; private static var _id:String; private static var _listenChannel:LocalConnection; private static var _timer:Timer; private static var _sendChannelName:String; private static var _startTime:Number; private static var _connecting:Boolean = false; public static var onError:Object; private static var _listenChannelName:String = "__mochiservices"; private static var _rcvChannel:LocalConnection; public static function isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{ if (_connected){ _sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID}); } else { if ((((_clip == null)) || (!(_connecting)))){ onError("NotConnected"); handleError(_arg2, _arg3, _arg4); flush(true); return; }; _clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID}); }; if (_clip != null){ if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){ _clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4}; _clip._nextcallbackID++; }; }; } public static function get connected():Boolean{ return (_connected); } private static function flush(_arg1:Boolean):void{ var _local2:Object; var _local3:Object; if (_clip != null){ if (_clip._queue != null){ while (_clip._queue.length > 0) { _local2 = _clip._queue.shift(); _local3 = null; if (_local2 != null){ if (_local2.callbackID != null){ _local3 = _clip._callbacks[_local2.callbackID]; }; delete _clip._callbacks[_local2.callbackID]; if (((_arg1) && (!((_local3 == null))))){ handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod); }; }; }; }; }; } private static function init(_arg1:String, _arg2:Object):void{ _id = _arg1; if (_arg2 != null){ _container = _arg2; loadCommunicator(_arg1, _container); }; } public static function get childClip():Object{ return (_clip); } public static function get id():String{ return (_id); } public static function stayOnTop():void{ _container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true); if (_clip != null){ _clip.visible = true; }; } public static function getVersion():String{ return ("1.32"); } public static function disconnect():void{ if (((_connected) || (_connecting))){ if (_clip != null){ if (_clip.parent != null){ if ((_clip.parent is Sprite)){ Sprite(_clip.parent).removeChild(_clip); _clip = null; }; }; }; _connecting = (_connected = false); flush(true); try { _listenChannel.close(); _rcvChannel.close(); } catch(error:Error) { }; }; if (_timer != null){ try { _timer.stop(); } catch(error:Error) { }; }; } public static function allowDomains(_arg1:String):String{ var _local2:String; Security.allowDomain("*"); Security.allowInsecureDomain("*"); if (_arg1.indexOf("http://") != -1){ _local2 = _arg1.split("/")[2].split(":")[0]; Security.allowDomain(_local2); Security.allowInsecureDomain(_local2); }; return (_local2); } public static function doClose():void{ _container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop); if (_clip.parent != null){ Sprite(_clip.parent).removeChild(_clip); }; } public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{ if (_arg1 != null){ if ((_arg1 is Sprite)){ _container = _arg1; }; }; if (_arg2){ if ((_container is Sprite)){ Sprite(_container).addChild(_clip); }; }; } private static function onStatus(_arg1:StatusEvent):void{ switch (_arg1.level){ case "error": _connected = false; _listenChannel.connect(_listenChannelName); break; }; } private static function initComChannels():void{ if (!_connected){ _sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus); _sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"}); _sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion()}); _rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus); _clip.onReceive = function (_arg1:Object):void{ var cb:String; var cblst:Object; var method:*; var methodName:String; var obj:Object; var pkg = _arg1; cb = pkg.callbackID; cblst = this.client._callbacks[cb]; if (!cblst){ return; }; method = cblst.callbackMethod; methodName = ""; obj = cblst.callbackObject; if (((obj) && ((typeof(method) == "string")))){ methodName = method; if (obj[method] != null){ method = obj[method]; } else { trace((("Error: Method " + method) + " does not exist.")); }; }; if (method != undefined){ try { method.apply(obj, pkg.args); } catch(error:Error) { trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString())); }; } else { if (obj != null){ try { obj(pkg.args); } catch(error:Error) { trace(("Error invoking method on object: " + error.toString())); }; }; }; delete this.client._callbacks[cb]; }; _clip.onError = function ():void{ MochiServices.onError("IOError"); }; _rcvChannel.connect(_rcvChannelName); trace("connected!"); _connecting = false; _connected = true; _listenChannel.close(); while (_clip._queue.length > 0) { _sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift()); }; }; } private static function listen():void{ _listenChannel = new LocalConnection(); _listenChannel.client = _clip; _clip.handshake = function (_arg1:Object):void{ MochiServices.comChannelName = _arg1.newChannel; }; _listenChannel.allowDomain("*", "localhost"); _listenChannel.allowInsecureDomain("*", "localhost"); _listenChannel.connect(_listenChannelName); trace("Waiting for MochiAds services to connect..."); } private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{ var args = _arg1; var callbackObject = _arg2; var callbackMethod = _arg3; if (args != null){ if (args.onError != null){ args.onError.apply(null, ["NotConnected"]); }; if (((!((args.options == null))) && (!((args.options.onError == null))))){ args.options.onError.apply(null, ["NotConnected"]); }; }; if (callbackMethod != null){ args = {}; args.error = true; args.errorCode = "NotConnected"; if (((!((callbackObject == null))) && ((callbackMethod is String)))){ try { var _local5 = callbackObject; _local5[callbackMethod](args); } catch(error:Error) { }; } else { if (callbackMethod != null){ try { callbackMethod.apply(args); } catch(error:Error) { }; }; }; }; } public static function get clip():Object{ return (_container); } public static function set comChannelName(_arg1:String):void{ if (_arg1 != null){ if (_arg1.length > 3){ _sendChannelName = (_arg1 + "_fromgame"); _rcvChannelName = _arg1; initComChannels(); }; }; } private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{ var clipname:String; var f:Function; var req:URLRequest; var id = _arg1; var clip = _arg2; clipname = ("_mochiservices_com_" + id); if (_clip != null){ return (_clip); }; if (!MochiServices.isNetworkAvailable()){ return (null); }; MochiServices.allowDomains(_gatewayURL); _clip = createEmptyMovieClip(clip, clipname, 10336, false); _loader = new Loader(); _timer = new Timer(1000, 0); _startTime = getTimer(); _timer.addEventListener(TimerEvent.TIMER, connectWait); _timer.start(); f = function (_arg1:Object):void{ _clip._mochiad_ctr_failed = true; trace("MochiServices could not load."); MochiServices.disconnect(); MochiServices.onError("IOError"); }; _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f); req = new URLRequest(_gatewayURL); _loader.load(req); _clip.addChild(_loader); _clip._mochiservices_com = _loader; _sendChannel = new LocalConnection(); _clip._queue = []; _rcvChannel = new LocalConnection(); _rcvChannel.allowDomain("*", "localhost"); _rcvChannel.allowInsecureDomain("*", "localhost"); _rcvChannel.client = _clip; _clip._nextcallbackID = 0; _clip._callbacks = {}; listen(); return (_clip); } public static function bringToTop(_arg1:Event):void{ var e = _arg1; if (MochiServices.clip != null){ if (MochiServices.childClip != null){ try { if (MochiServices.clip.numChildren > 1){ MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1)); }; } catch(errorObject:Error) { trace("Warning: Depth sort error."); _container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop); }; }; }; } public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{ var id = _arg1; var clip = _arg2; var onError = _arg3; if ((clip is DisplayObject)){ if (((!(_connected)) && ((_clip == null)))){ trace("MochiServices Connecting..."); _connecting = true; init(id, clip); }; } else { trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage."); }; if (onError != null){ MochiServices.onError = onError; } else { if (MochiServices.onError == null){ MochiServices.onError = function (_arg1:String):void{ trace(_arg1); }; }; }; } public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{ var mc:MovieClip; var parent = _arg1; var name = _arg2; var depth = _arg3; var doAdd = _arg4; mc = new MovieClip(); if (doAdd){ if (((false) && (depth))){ parent.addChildAt(mc, depth); } else { parent.addChild(mc); }; }; try { parent[name] = mc; } catch(e:Error) { throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic.")); }; mc["_name"] = name; return (mc); } public static function connectWait(_arg1:TimerEvent):void{ if ((getTimer() - _startTime) > 10000){ if (!_connected){ _clip._mochiad_ctr_failed = true; trace("MochiServices could not load."); MochiServices.disconnect(); MochiServices.onError("IOError"); }; _timer.stop(); }; } } }//package mochi
Section 18
//AbstractCollection (org.cove.ape.AbstractCollection) package org.cove.ape { import flash.display.*; import flash.utils.*; public class AbstractCollection { private var _sprite:Sprite; private var _isParented:Boolean; private var _particles:Array; private var _constraints:Array; public function AbstractCollection(){ if (getQualifiedClassName(this) == "org.cove.ape::AbstractCollection"){ throw (new ArgumentError("AbstractCollection can't be instantiated directly")); }; _isParented = false; _particles = new Array(); _constraints = new Array(); } public function getAll():Array{ return (particles.concat(constraints)); } function checkCollisionsVsCollection(_arg1:AbstractCollection):void{ var _local2:int; var _local3:int; var _local4:int; var _local5:AbstractParticle; var _local6:int; var _local7:int; var _local8:int; var _local9:AbstractParticle; var _local10:SpringConstraint; var _local11:SpringConstraint; var _local12:int; _local2 = _particles.length; _local3 = 0; while (_local3 < _local2) { _local5 = _particles[_local3]; if ((((_local5 == null)) || (!(_local5.collidable)))){ } else { _local6 = _arg1.particles.length; _local7 = 0; while (_local7 < _local6) { _local9 = _arg1.particles[_local7]; if (((!((_local9 == null))) && (_local9.collidable))){ CollisionDetector.test(_local5, _local9); }; _local7++; }; _local8 = _arg1.constraints.length; _local7 = 0; while (_local7 < _local8) { _local10 = _arg1.constraints[_local7]; if (((((!((_local10 == null))) && (_local10.collidable))) && (!(_local10.isConnectedTo(_local5))))){ _local10.scp.updatePosition(); CollisionDetector.test(_local5, _local10.scp); }; _local7++; }; }; _local3++; }; _local4 = _constraints.length; _local3 = 0; while (_local3 < _local4) { _local11 = _constraints[_local3]; if ((((_local11 == null)) || (!(_local11.collidable)))){ } else { _local6 = _arg1.particles.length; _local12 = 0; while (_local12 < _local6) { _local9 = _arg1.particles[_local12]; if (((((!((_local9 == null))) && (_local9.collidable))) && (!(_local11.isConnectedTo(_local9))))){ _local11.scp.updatePosition(); CollisionDetector.test(_local9, _local11.scp); }; _local12++; }; }; _local3++; }; } public function get sprite():Sprite{ if (_sprite != null){ return (_sprite); }; if (APEngine.container == null){ throw (new Error("The container property of the APEngine class has not been set")); }; _sprite = new Sprite(); APEngine.container.addChild(_sprite); return (_sprite); } function checkInternalCollisions():void{ var _local1:int; var _local2:int; var _local3:AbstractParticle; var _local4:int; var _local5:int; var _local6:int; var _local7:AbstractParticle; var _local8:SpringConstraint; _local1 = _particles.length; _local2 = 0; while (_local2 < _local1) { _local3 = _particles[_local2]; if ((((_local3 == null)) || (!(_local3.collidable)))){ } else { _local4 = (_local2 + 1); while (_local4 < _local1) { _local7 = _particles[_local4]; if (((!((_local7 == null))) && (_local7.collidable))){ CollisionDetector.test(_local3, _local7); }; _local4++; }; _local5 = _constraints.length; _local6 = 0; while (_local6 < _local5) { _local8 = _constraints[_local6]; if (((((!((_local8 == null))) && (_local8.collidable))) && (!(_local8.isConnectedTo(_local3))))){ _local8.scp.updatePosition(); CollisionDetector.test(_local3, _local8.scp); }; _local6++; }; }; _local2++; }; } public function addParticle(_arg1:AbstractParticle):void{ particles.push(_arg1); if (isParented){ _arg1.init(); }; } public function removeConstraint(_arg1:AbstractConstraint):void{ var _local2:int; _local2 = constraints.indexOf(_arg1); if (_local2 == -1){ return; }; constraints.splice(_local2, 1); _arg1.cleanup(); } function get isParented():Boolean{ return (_isParented); } public function init():void{ var _local1:int; _local1 = 0; while (_local1 < particles.length) { particles[_local1].init(); _local1++; }; _local1 = 0; while (_local1 < constraints.length) { constraints[_local1].init(); _local1++; }; } function satisfyConstraints():void{ var _local1:int; var _local2:int; var _local3:AbstractConstraint; _local1 = _constraints.length; _local2 = 0; while (_local2 < _local1) { _local3 = _constraints[_local2]; _local3.resolve(); _local2++; }; } public function paint():void{ var _local1:AbstractParticle; var _local2:int; var _local3:int; var _local4:SpringConstraint; _local2 = _particles.length; _local3 = 0; while (_local3 < _local2) { _local1 = _particles[_local3]; if (((!(_local1.fixed)) || (_local1.alwaysRepaint))){ _local1.paint(); }; _local3++; }; _local2 = _constraints.length; _local3 = 0; while (_local3 < _local2) { _local4 = _constraints[_local3]; if (((!(_local4.fixed)) || (_local4.alwaysRepaint))){ _local4.paint(); }; _local3++; }; } public function addConstraint(_arg1:AbstractConstraint):void{ constraints.push(_arg1); if (isParented){ _arg1.init(); }; } function set isParented(_arg1:Boolean):void{ _isParented = _arg1; } public function removeParticle(_arg1:AbstractParticle):void{ var _local2:int; _local2 = particles.indexOf(_arg1); if (_local2 == -1){ return; }; particles.splice(_local2, 1); _arg1.cleanup(); } public function cleanup():void{ var _local1:int; _local1 = 0; while (_local1 < particles.length) { particles[_local1].cleanup(); _local1++; }; _local1 = 0; while (_local1 < constraints.length) { constraints[_local1].cleanup(); _local1++; }; } public function get particles():Array{ return (_particles); } function integrate(_arg1:Number):void{ var _local2:int; var _local3:int; var _local4:AbstractParticle; _local2 = _particles.length; _local3 = 0; while (_local3 < _local2) { _local4 = _particles[_local3]; _local4.update(_arg1); _local3++; }; } public function get constraints():Array{ return (_constraints); } } }//package org.cove.ape
Section 19
//AbstractConstraint (org.cove.ape.AbstractConstraint) package org.cove.ape { import flash.utils.*; public class AbstractConstraint extends AbstractItem { private var _stiffness:Number; public function AbstractConstraint(_arg1:Number){ if (getQualifiedClassName(this) == "org.cove.ape::AbstractConstraint"){ throw (new ArgumentError("AbstractConstraint can't be instantiated directly")); }; this.stiffness = _arg1; setStyle(); } public function get stiffness():Number{ return (_stiffness); } public function resolve():void{ } public function set stiffness(_arg1:Number):void{ _stiffness = _arg1; } } }//package org.cove.ape
Section 20
//AbstractItem (org.cove.ape.AbstractItem) package org.cove.ape { import flash.display.*; import flash.events.*; public class AbstractItem extends EventDispatcher { var displayObjectOffset:Vector; var fillColor:uint; var displayObject:DisplayObject; var fillAlpha:Number; private var _solid:Boolean; private var _visible:Boolean; var displayObjectRotation:Number; var lineColor:uint; var lineAlpha:Number; var lineThickness:Number; private var _sprite:Sprite; private var _alwaysRepaint:Boolean; public function AbstractItem(){ _solid = true; _visible = true; _alwaysRepaint = false; } public function setFill(_arg1:uint=0xFFFFFF, _arg2:Number=1):void{ fillColor = _arg1; fillAlpha = _arg2; } public function init():void{ } public function cleanup():void{ var _local1:int; sprite.graphics.clear(); _local1 = 0; while (_local1 < sprite.numChildren) { sprite.removeChildAt(_local1); _local1++; }; } public function get solid():Boolean{ return (_solid); } public function get sprite():Sprite{ if (_sprite != null){ return (_sprite); }; if (APEngine.container == null){ throw (new Error("The container property of the APEngine class has not been set")); }; _sprite = new Sprite(); APEngine.container.addChild(_sprite); return (_sprite); } public function set solid(_arg1:Boolean):void{ _solid = _arg1; } public function paint():void{ } public function set visible(_arg1:Boolean):void{ _visible = _arg1; sprite.visible = _arg1; } public function setStyle(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1, _arg4:uint=0xFFFFFF, _arg5:Number=1):void{ setLine(_arg1, _arg2, _arg3); setFill(_arg4, _arg5); } public function get visible():Boolean{ return (_visible); } public function setLine(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1):void{ lineThickness = _arg1; lineColor = _arg2; lineAlpha = _arg3; } final public function set alwaysRepaint(_arg1:Boolean):void{ _alwaysRepaint = _arg1; } final public function get alwaysRepaint():Boolean{ return (_alwaysRepaint); } } }//package org.cove.ape
Section 21
//AbstractParticle (org.cove.ape.AbstractParticle) package org.cove.ape { import flash.display.*; import flash.utils.*; public class AbstractParticle extends AbstractItem { private var forceList:Array; var curr:Vector; var prev:Vector; private var collision:Collision; private var _invMass:Number; private var _friction:Number; private var firstCollision:Boolean; private var _multisample:int; var samp:Vector; private var _center:Vector; private var _fixed:Boolean; private var _collidable:Boolean; private var _kfr:Number; var interval:Interval; private var _mass:Number; private var temp:Vector; private var forces:Vector; public function AbstractParticle(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number, _arg5:Number, _arg6:Number){ if (getQualifiedClassName(this) == "org.cove.ape::AbstractParticle"){ throw (new ArgumentError("AbstractParticle can't be instantiated directly")); }; interval = new Interval(0, 0); curr = new Vector(_arg1, _arg2); prev = new Vector(_arg1, _arg2); samp = new Vector(); temp = new Vector(); fixed = _arg3; forces = new Vector(); forceList = new Array(); collision = new Collision(new Vector(), new Vector()); collidable = true; firstCollision = false; this.mass = _arg4; this.elasticity = _arg5; this.friction = _arg6; setStyle(); _center = new Vector(); _multisample = 0; } public function get px():Number{ return (curr.x); } public function get py():Number{ return (curr.y); } public function set py(_arg1:Number):void{ curr.y = _arg1; prev.y = _arg1; } function getComponents(_arg1:Vector):Collision{ var _local2:Vector; var _local3:Number; _local2 = velocity; _local3 = _arg1.dot(_local2); collision.vn = _arg1.mult(_local3); collision.vt = _local2.minus(collision.vn); return (collision); } public function set px(_arg1:Number):void{ curr.x = _arg1; prev.x = _arg1; } public function setDisplay(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):void{ displayObject = _arg1; displayObjectRotation = _arg4; displayObjectOffset = new Vector(_arg2, _arg3); } public function get multisample():int{ return (_multisample); } public function get position():Vector{ return (new Vector(curr.x, curr.y)); } public function set multisample(_arg1:int):void{ _multisample = _arg1; } public function get center():Vector{ _center.setTo(px, py); return (_center); } public function set position(_arg1:Vector):void{ curr.copy(_arg1); prev.copy(_arg1); } function testParticleEvents(_arg1:AbstractParticle):void{ if (hasEventListener(CollisionEvent.COLLIDE)){ dispatchEvent(new CollisionEvent(CollisionEvent.COLLIDE, false, false, _arg1)); }; if (((hasEventListener(CollisionEvent.FIRST_COLLIDE)) && (!(firstCollision)))){ firstCollision = true; dispatchEvent(new CollisionEvent(CollisionEvent.FIRST_COLLIDE, false, false, _arg1)); }; } public function set elasticity(_arg1:Number):void{ _kfr = _arg1; } public function get fixed():Boolean{ return (_fixed); } function get invMass():Number{ return ((fixed) ? 0 : _invMass); } public function resetFirstCollision():void{ firstCollision = false; } function initDisplay():void{ displayObject.x = displayObjectOffset.x; displayObject.y = displayObjectOffset.y; displayObject.rotation = displayObjectRotation; sprite.addChild(displayObject); } private function clearForces():void{ forceList.length = 0; forces.setTo(0, 0); } function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{ testParticleEvents(_arg6); if (((((fixed) || (!(solid)))) || (!(_arg6.solid)))){ return; }; curr.copy(samp); curr.plusEquals(_arg1); velocity = _arg2; } public function get elasticity():Number{ return (_kfr); } public function set velocity(_arg1:Vector):void{ prev = curr.minus(_arg1); } public function set collidable(_arg1:Boolean):void{ _collidable = _arg1; } public function update(_arg1:Number):void{ var _local2:Vector; if (fixed){ return; }; accumulateForces(); temp.copy(curr); _local2 = velocity.plus(forces.multEquals(_arg1)); curr.plusEquals(_local2.multEquals(APEngine.damping)); prev.copy(temp); clearForces(); } public function addForce(_arg1:IForce):void{ forceList.push(_arg1); } public function get velocity():Vector{ return (curr.minus(prev)); } public function get collidable():Boolean{ return (_collidable); } public function set mass(_arg1:Number):void{ if (_arg1 <= 0){ throw (new ArgumentError("mass may not be set <= 0")); }; _mass = _arg1; _invMass = (1 / _mass); } public function set fixed(_arg1:Boolean):void{ _fixed = _arg1; } private function accumulateForces():void{ var _local1:IForce; var _local2:int; var _local3:int; var _local4:Array; _local2 = forceList.length; _local3 = 0; while (_local3 < _local2) { _local1 = forceList[_local3]; forces.plusEquals(_local1.getValue(_invMass)); _local3++; }; _local4 = APEngine.forces; _local2 = _local4.length; _local3 = 0; while (_local3 < _local2) { _local1 = _local4[_local3]; forces.plusEquals(_local1.getValue(_invMass)); _local3++; }; } public function get mass():Number{ return (_mass); } public function get friction():Number{ return (_friction); } public function set friction(_arg1:Number):void{ if ((((_arg1 < 0)) || ((_arg1 > 1)))){ throw (new ArgumentError("Legal friction must be >= 0 and <=1")); }; _friction = _arg1; } } }//package org.cove.ape
Section 22
//APEngine (org.cove.ape.APEngine) package org.cove.ape { import flash.display.*; public final class APEngine { private static var _damping:Number; private static var _container:DisplayObjectContainer; private static var _constraintCollisionCycles:int; private static var groups:Array; static var forces:Array; private static var _constraintCycles:int; private static var timeStep:Number; private static var numGroups:int; public static function get container():DisplayObjectContainer{ return (_container); } public static function get constraintCollisionCycles():int{ return (_constraintCollisionCycles); } public static function removeForce(_arg1:IForce):void{ var _local2:int; _local2 = forces.indexOf(_arg1); if (_local2 == -1){ return; }; forces.splice(_local2, 1); } public static function set damping(_arg1:Number):void{ _damping = _arg1; } public static function step():void{ var _local1:int; var _local2:int; integrate(); _local1 = 0; while (_local1 < _constraintCycles) { satisfyConstraints(); _local1++; }; _local2 = 0; while (_local2 < _constraintCollisionCycles) { satisfyConstraints(); checkCollisions(); _local2++; }; } public static function get constraintCycles():int{ return (_constraintCycles); } public static function set constraintCollisionCycles(_arg1:int):void{ _constraintCollisionCycles = _arg1; } public static function init(_arg1:Number=0.25):void{ timeStep = (_arg1 * _arg1); numGroups = 0; groups = new Array(); forces = new Array(); _damping = 1; _constraintCycles = 0; _constraintCollisionCycles = 1; } public static function addForce(_arg1:IForce):void{ forces.push(_arg1); } public static function get damping():Number{ return (_damping); } public static function set constraintCycles(_arg1:int):void{ _constraintCycles = _arg1; } public static function addGroup(_arg1:Group):void{ groups.push(_arg1); _arg1.isParented = true; numGroups++; _arg1.init(); } public static function set container(_arg1:DisplayObjectContainer):void{ _container = _arg1; } public static function paint():void{ var _local1:int; var _local2:Group; _local1 = 0; while (_local1 < numGroups) { _local2 = groups[_local1]; _local2.paint(); _local1++; }; } public static function removeGroup(_arg1:Group):void{ var _local2:int; _local2 = groups.indexOf(_arg1); if (_local2 == -1){ return; }; groups.splice(_local2, 1); _arg1.isParented = false; numGroups--; _arg1.cleanup(); } private static function satisfyConstraints():void{ var _local1:int; var _local2:Group; _local1 = 0; while (_local1 < numGroups) { _local2 = groups[_local1]; _local2.satisfyConstraints(); _local1++; }; } public static function removeAllForce():void{ forces = new Array(); } private static function checkCollisions():void{ var _local1:int; var _local2:Group; _local1 = 0; while (_local1 < numGroups) { _local2 = groups[_local1]; _local2.checkCollisions(); _local1++; }; } private static function integrate():void{ var _local1:int; var _local2:Group; _local1 = 0; while (_local1 < numGroups) { _local2 = groups[_local1]; _local2.integrate(timeStep); _local1++; }; } } }//package org.cove.ape
Section 23
//CircleParticle (org.cove.ape.CircleParticle) package org.cove.ape { public class CircleParticle extends AbstractParticle { private var _radius:Number; public function CircleParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0.3, _arg7:Number=0){ super(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7); _radius = _arg3; } function getProjection(_arg1:Vector):Interval{ var _local2:Number; _local2 = samp.dot(_arg1); interval.min = (_local2 - _radius); interval.max = (_local2 + _radius); return (interval); } override public function init():void{ cleanup(); if (displayObject != null){ initDisplay(); } else { sprite.graphics.clear(); sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha); sprite.graphics.beginFill(fillColor, fillAlpha); sprite.graphics.drawCircle(0, 0, radius); sprite.graphics.endFill(); }; paint(); } public function get radius():Number{ return (_radius); } function getIntervalY():Interval{ interval.min = (samp.y - _radius); interval.max = (samp.y + _radius); return (interval); } public function set radius(_arg1:Number):void{ _radius = _arg1; } override public function paint():void{ sprite.x = curr.x; sprite.y = curr.y; } function getIntervalX():Interval{ interval.min = (samp.x - _radius); interval.max = (samp.x + _radius); return (interval); } } }//package org.cove.ape
Section 24
//Collision (org.cove.ape.Collision) package org.cove.ape { import org.cove.ape.*; final class Collision { var vn:Vector; var vt:Vector; function Collision(_arg1:Vector, _arg2:Vector){ this.vn = _arg1; this.vt = _arg2; } } }//package org.cove.ape
Section 25
//CollisionDetector (org.cove.ape.CollisionDetector) package org.cove.ape { import org.cove.ape.*; final class CollisionDetector { private static var collNormal:Vector; private static var cpa:AbstractParticle; private static var cpb:AbstractParticle; private static var collDepth:Number; private static function testIntervals(_arg1:Interval, _arg2:Interval):Number{ var _local3:Number; var _local4:Number; if (_arg1.max < _arg2.min){ return (0); }; if (_arg2.max < _arg1.min){ return (0); }; _local3 = (_arg2.max - _arg1.min); _local4 = (_arg2.min - _arg1.max); return (((Math.abs(_local3))<Math.abs(_local4)) ? _local3 : _local4); } private static function testOBBvsOBB(_arg1:RectangleParticle, _arg2:RectangleParticle):Boolean{ var _local3:int; var _local4:Vector; var _local5:Number; var _local6:Vector; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Boolean; collDepth = Number.POSITIVE_INFINITY; _local3 = 0; while (_local3 < 2) { _local4 = _arg1.axes[_local3]; _local5 = testIntervals(_arg1.getProjection(_local4), _arg2.getProjection(_local4)); if (_local5 == 0){ return (false); }; _local6 = _arg2.axes[_local3]; _local7 = testIntervals(_arg1.getProjection(_local6), _arg2.getProjection(_local6)); if (_local7 == 0){ return (false); }; _local8 = Math.abs(_local5); _local9 = Math.abs(_local7); if ((((_local8 < Math.abs(collDepth))) || ((_local9 < Math.abs(collDepth))))){ _local10 = (_local8 < _local9); collNormal = (_local10) ? _local4 : _local6; collDepth = (_local10) ? _local5 : _local7; }; _local3++; }; cpa = _arg1; cpb = _arg2; return (true); } private static function testTypes(_arg1:AbstractParticle, _arg2:AbstractParticle):Boolean{ if ((((_arg1 is RectangleParticle)) && ((_arg2 is RectangleParticle)))){ return (testOBBvsOBB((_arg1 as RectangleParticle), (_arg2 as RectangleParticle))); }; if ((((_arg1 is CircleParticle)) && ((_arg2 is CircleParticle)))){ return (testCirclevsCircle((_arg1 as CircleParticle), (_arg2 as CircleParticle))); }; if ((((_arg1 is RectangleParticle)) && ((_arg2 is CircleParticle)))){ return (testOBBvsCircle((_arg1 as RectangleParticle), (_arg2 as CircleParticle))); }; if ((((_arg1 is CircleParticle)) && ((_arg2 is RectangleParticle)))){ return (testOBBvsCircle((_arg2 as RectangleParticle), (_arg1 as CircleParticle))); }; return (false); } private static function sampVsNorm(_arg1:AbstractParticle, _arg2:AbstractParticle):void{ var _local3:Number; var _local4:Number; var _local5:int; if (normVsNorm(_arg1, _arg2)){ return; }; _local3 = (1 / (_arg1.multisample + 1)); _local4 = _local3; _local5 = 0; while (_local5 <= _arg1.multisample) { _arg1.samp.setTo((_arg1.prev.x + (_local4 * (_arg1.curr.x - _arg1.prev.x))), (_arg1.prev.y + (_local4 * (_arg1.curr.y - _arg1.prev.y)))); if (testTypes(_arg1, _arg2)){ CollisionResolver.resolve(cpa, cpb, collNormal, collDepth); return; }; _local4 = (_local4 + _local3); _local5++; }; } private static function testCirclevsCircle(_arg1:CircleParticle, _arg2:CircleParticle):Boolean{ var _local3:Number; var _local4:Number; var _local5:Number; _local3 = testIntervals(_arg1.getIntervalX(), _arg2.getIntervalX()); if (_local3 == 0){ return (false); }; _local4 = testIntervals(_arg1.getIntervalY(), _arg2.getIntervalY()); if (_local4 == 0){ return (false); }; collNormal = _arg1.samp.minus(_arg2.samp); _local5 = collNormal.magnitude(); collDepth = ((_arg1.radius + _arg2.radius) - _local5); if (collDepth > 0){ collNormal.divEquals(_local5); cpa = _arg1; cpb = _arg2; return (true); }; return (false); } static function test(_arg1:AbstractParticle, _arg2:AbstractParticle):void{ if (((_arg1.fixed) && (_arg2.fixed))){ return; }; if ((((_arg1.multisample == 0)) && ((_arg2.multisample == 0)))){ normVsNorm(_arg1, _arg2); } else { if ((((_arg1.multisample > 0)) && ((_arg2.multisample == 0)))){ sampVsNorm(_arg1, _arg2); } else { if ((((_arg2.multisample > 0)) && ((_arg1.multisample == 0)))){ sampVsNorm(_arg2, _arg1); } else { if (_arg1.multisample == _arg2.multisample){ sampVsSamp(_arg1, _arg2); } else { normVsNorm(_arg1, _arg2); }; }; }; }; } private static function testOBBvsCircle(_arg1:RectangleParticle, _arg2:CircleParticle):Boolean{ var _local3:Array; var _local4:int; var _local5:Number; var _local6:Vector; var _local7:Number; var _local8:Vector; var _local9:Number; collDepth = Number.POSITIVE_INFINITY; _local3 = new Array(2); _local4 = 0; while (_local4 < 2) { _local6 = _arg1.axes[_local4]; _local7 = testIntervals(_arg1.getProjection(_local6), _arg2.getProjection(_local6)); if (_local7 == 0){ return (false); }; if (Math.abs(_local7) < Math.abs(collDepth)){ collNormal = _local6; collDepth = _local7; }; _local3[_local4] = _local7; _local4++; }; _local5 = _arg2.radius; if ((((Math.abs(_local3[0]) < _local5)) && ((Math.abs(_local3[1]) < _local5)))){ _local8 = closestVertexOnOBB(_arg2.samp, _arg1); collNormal = _local8.minus(_arg2.samp); _local9 = collNormal.magnitude(); collDepth = (_local5 - _local9); if (collDepth > 0){ collNormal.divEquals(_local9); } else { return (false); }; }; cpa = _arg1; cpb = _arg2; return (true); } private static function closestVertexOnOBB(_arg1:Vector, _arg2:RectangleParticle):Vector{ var _local3:Vector; var _local4:Vector; var _local5:int; var _local6:Number; _local3 = _arg1.minus(_arg2.samp); _local4 = new Vector(_arg2.samp.x, _arg2.samp.y); _local5 = 0; while (_local5 < 2) { _local6 = _local3.dot(_arg2.axes[_local5]); if (_local6 >= 0){ _local6 = _arg2.extents[_local5]; } else { if (_local6 < 0){ _local6 = -(_arg2.extents[_local5]); }; }; _local4.plusEquals(_arg2.axes[_local5].mult(_local6)); _local5++; }; return (_local4); } private static function normVsNorm(_arg1:AbstractParticle, _arg2:AbstractParticle):Boolean{ _arg1.samp.copy(_arg1.curr); _arg2.samp.copy(_arg2.curr); if (testTypes(_arg1, _arg2)){ CollisionResolver.resolve(cpa, cpb, collNormal, collDepth); return (true); }; return (false); } private static function sampVsSamp(_arg1:AbstractParticle, _arg2:AbstractParticle):void{ var _local3:Number; var _local4:Number; var _local5:int; if (normVsNorm(_arg1, _arg2)){ return; }; _local3 = (1 / (_arg1.multisample + 1)); _local4 = _local3; _local5 = 0; while (_local5 <= _arg1.multisample) { _arg1.samp.setTo((_arg1.prev.x + (_local4 * (_arg1.curr.x - _arg1.prev.x))), (_arg1.prev.y + (_local4 * (_arg1.curr.y - _arg1.prev.y)))); _arg2.samp.setTo((_arg2.prev.x + (_local4 * (_arg2.curr.x - _arg2.prev.x))), (_arg2.prev.y + (_local4 * (_arg2.curr.y - _arg2.prev.y)))); if (testTypes(_arg1, _arg2)){ CollisionResolver.resolve(cpa, cpb, collNormal, collDepth); return; }; _local4 = (_local4 + _local3); _local5++; }; } } }//package org.cove.ape
Section 26
//CollisionEvent (org.cove.ape.CollisionEvent) package org.cove.ape { import flash.events.*; public class CollisionEvent extends Event { private var _collidingItem:AbstractItem; public static const COLLIDE:String = "collide"; public static const FIRST_COLLIDE:String = "firstCollide"; public function CollisionEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:AbstractItem=null){ super(_arg1, _arg2, _arg3); _collidingItem = _arg4; } public function get collidingItem():AbstractItem{ var _local1:SpringConstraintParticle; if ((_collidingItem is SpringConstraintParticle)){ _local1 = (_collidingItem as SpringConstraintParticle); return (_local1.parent); }; return (_collidingItem); } } }//package org.cove.ape
Section 27
//CollisionResolver (org.cove.ape.CollisionResolver) package org.cove.ape { import org.cove.ape.*; final class CollisionResolver { static function resolve(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:Vector, _arg4:Number):void{ var _local5:Vector; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Collision; var _local10:Collision; var _local11:Vector; var _local12:Vector; var _local13:Vector; var _local14:Vector; _local5 = _arg3.mult(_arg4); _local6 = (_arg1.elasticity + _arg2.elasticity); _local7 = (_arg1.invMass + _arg2.invMass); _local8 = MathUtil.clamp((1 - (_arg1.friction + _arg2.friction)), 0, 1); _local9 = _arg1.getComponents(_arg3); _local10 = _arg2.getComponents(_arg3); _local11 = _local10.vn.mult(((_local6 + 1) * _arg1.invMass)).plus(_local9.vn.mult((_arg2.invMass - (_local6 * _arg1.invMass)))).divEquals(_local7); _local12 = _local9.vn.mult(((_local6 + 1) * _arg2.invMass)).plus(_local10.vn.mult((_arg1.invMass - (_local6 * _arg2.invMass)))).divEquals(_local7); _local9.vt.multEquals(_local8); _local10.vt.multEquals(_local8); _local13 = _local5.mult((_arg1.invMass / _local7)); _local14 = _local5.mult((-(_arg2.invMass) / _local7)); _local11.plusEquals(_local9.vt); _local12.plusEquals(_local10.vt); _arg1.resolveCollision(_local13, _local11, _arg3, _arg4, -1, _arg2); _arg2.resolveCollision(_local14, _local12, _arg3, _arg4, 1, _arg1); } } }//package org.cove.ape
Section 28
//Composite (org.cove.ape.Composite) package org.cove.ape { public class Composite extends AbstractCollection { private var delta:Vector; public function Composite(){ delta = new Vector(); } private function getRelativeAngle(_arg1:Vector, _arg2:Vector):Number{ delta.setTo((_arg2.x - _arg1.x), (_arg2.y - _arg1.y)); return (Math.atan2(delta.y, delta.x)); } public function rotateByRadian(_arg1:Number, _arg2:Vector):void{ var _local3:AbstractParticle; var _local4:Array; var _local5:int; var _local6:int; var _local7:Number; var _local8:Number; _local4 = particles; _local5 = _local4.length; _local6 = 0; while (_local6 < _local5) { _local3 = _local4[_local6]; _local7 = _local3.center.distance(_arg2); _local8 = (getRelativeAngle(_arg2, _local3.center) + _arg1); _local3.px = ((Math.cos(_local8) * _local7) + _arg2.x); _local3.py = ((Math.sin(_local8) * _local7) + _arg2.y); _local6++; }; } public function rotateByAngle(_arg1:Number, _arg2:Vector):void{ var _local3:Number; _local3 = (_arg1 * MathUtil.PI_OVER_ONE_EIGHTY); rotateByRadian(_local3, _arg2); } public function set fixed(_arg1:Boolean):void{ var _local2:int; _local2 = 0; while (_local2 < particles.length) { particles[_local2].fixed = _arg1; _local2++; }; } public function get fixed():Boolean{ var _local1:int; _local1 = 0; while (_local1 < particles.length) { if (!particles[_local1].fixed){ return (false); }; _local1++; }; return (true); } } }//package org.cove.ape
Section 29
//Group (org.cove.ape.Group) package org.cove.ape { public class Group extends AbstractCollection { private var _collideInternal:Boolean; private var _composites:Array; private var _collisionList:Array; public function Group(_arg1:Boolean=false){ _composites = new Array(); _collisionList = new Array(); this.collideInternal = _arg1; } function checkCollisions():void{ var _local1:int; var _local2:int; var _local3:Group; if (collideInternal){ checkCollisionGroupInternal(); }; _local1 = collisionList.length; _local2 = 0; while (_local2 < _local1) { _local3 = collisionList[_local2]; if (_local3 == null){ } else { checkCollisionVsGroup(_local3); }; _local2++; }; } public function get composites():Array{ return (_composites); } override public function init():void{ var _local1:int; super.init(); _local1 = 0; while (_local1 < composites.length) { composites[_local1].init(); _local1++; }; } public function removeCollidable(_arg1:Group):void{ var _local2:int; _local2 = collisionList.indexOf(_arg1); if (_local2 == -1){ return; }; collisionList.splice(_local2, 1); } private function checkCollisionVsGroup(_arg1:Group):void{ var _local2:Composite; var _local3:int; var _local4:int; var _local5:int; var _local6:Composite; var _local7:int; checkCollisionsVsCollection(_arg1); _local3 = _composites.length; _local4 = _arg1.composites.length; _local5 = 0; while (_local5 < _local3) { _local6 = _composites[_local5]; if (_local6 == null){ } else { _local6.checkCollisionsVsCollection(_arg1); _local7 = 0; while (_local7 < _local4) { _local2 = _arg1.composites[_local7]; if (_local2 == null){ } else { _local6.checkCollisionsVsCollection(_local2); }; _local7++; }; }; _local5++; }; _local7 = 0; while (_local7 < _local4) { _local2 = _arg1.composites[_local7]; if (_local2 == null){ } else { checkCollisionsVsCollection(_local2); }; _local7++; }; } override function satisfyConstraints():void{ var _local1:int; var _local2:int; var _local3:Composite; super.satisfyConstraints(); _local1 = _composites.length; _local2 = 0; while (_local2 < _local1) { _local3 = _composites[_local2]; _local3.satisfyConstraints(); _local2++; }; } public function get collideInternal():Boolean{ return (_collideInternal); } public function addCollidableList(_arg1:Array):void{ var _local2:int; var _local3:Group; _local2 = 0; while (_local2 < _arg1.length) { _local3 = _arg1[_local2]; collisionList.push(_local3); _local2++; }; } public function removeComposite(_arg1:Composite):void{ var _local2:int; _local2 = composites.indexOf(_arg1); if (_local2 == -1){ return; }; composites.splice(_local2, 1); _arg1.isParented = false; _arg1.cleanup(); } override public function cleanup():void{ var _local1:int; super.cleanup(); _local1 = 0; while (_local1 < composites.length) { composites[_local1].cleanup(); _local1++; }; } override public function paint():void{ var _local1:int; var _local2:int; var _local3:Composite; super.paint(); _local1 = _composites.length; _local2 = 0; while (_local2 < _local1) { _local3 = _composites[_local2]; _local3.paint(); _local2++; }; } public function addCollidable(_arg1:Group):void{ collisionList.push(_arg1); } override public function getAll():Array{ return (particles.concat(constraints).concat(composites)); } public function get collisionList():Array{ return (_collisionList); } override function integrate(_arg1:Number):void{ var _local2:int; var _local3:int; var _local4:Composite; super.integrate(_arg1); _local2 = _composites.length; _local3 = 0; while (_local3 < _local2) { _local4 = _composites[_local3]; _local4.integrate(_arg1); _local3++; }; } public function addComposite(_arg1:Composite):void{ composites.push(_arg1); _arg1.isParented = true; if (isParented){ _arg1.init(); }; } private function checkCollisionGroupInternal():void{ var _local1:int; var _local2:int; var _local3:Composite; var _local4:int; var _local5:Composite; checkInternalCollisions(); _local1 = _composites.length; _local2 = 0; while (_local2 < _local1) { _local3 = _composites[_local2]; if (_local3 == null){ } else { _local3.checkCollisionsVsCollection(this); _local4 = (_local2 + 1); while (_local4 < _local1) { _local5 = _composites[_local4]; if (_local5 != null){ _local3.checkCollisionsVsCollection(_local5); }; _local4++; }; }; _local2++; }; } public function set collideInternal(_arg1:Boolean):void{ _collideInternal = _arg1; } } }//package org.cove.ape
Section 30
//IForce (org.cove.ape.IForce) package org.cove.ape { public interface IForce { function getValue(_arg1:Number):Vector; } }//package org.cove.ape
Section 31
//Interval (org.cove.ape.Interval) package org.cove.ape { final class Interval { var min:Number; var max:Number; function Interval(_arg1:Number, _arg2:Number){ this.min = _arg1; this.max = _arg2; } function toString():String{ return (((min + " : ") + max)); } } }//package org.cove.ape
Section 32
//MathUtil (org.cove.ape.MathUtil) package org.cove.ape { final class MathUtil { static var ONE_EIGHTY_OVER_PI:Number = 57.2957795130823; static var PI_OVER_ONE_EIGHTY:Number = 0.0174532925199433; static function clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{ if (_arg1 < _arg2){ return (_arg2); }; if (_arg1 > _arg3){ return (_arg3); }; return (_arg1); } static function sign(_arg1:Number):int{ if (_arg1 < 0){ return (-1); }; return (1); } } }//package org.cove.ape
Section 33
//RectangleParticle (org.cove.ape.RectangleParticle) package org.cove.ape { public class RectangleParticle extends AbstractParticle { private var _axes:Array; private var _extents:Array; private var _radian:Number; public function RectangleParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Boolean=false, _arg7:Number=1, _arg8:Number=0.3, _arg9:Number=0){ super(_arg1, _arg2, _arg6, _arg7, _arg8, _arg9); _extents = new Array((_arg3 / 2), (_arg4 / 2)); _axes = new Array(new Vector(0, 0), new Vector(0, 0)); radian = _arg5; } function getProjection(_arg1:Vector):Interval{ var _local2:Number; var _local3:Number; _local2 = ((extents[0] * Math.abs(_arg1.dot(axes[0]))) + (extents[1] * Math.abs(_arg1.dot(axes[1])))); _local3 = samp.dot(_arg1); interval.min = (_local3 - _local2); interval.max = (_local3 + _local2); return (interval); } override public function init():void{ var _local1:Number; var _local2:Number; cleanup(); if (displayObject != null){ initDisplay(); } else { _local1 = (extents[0] * 2); _local2 = (extents[1] * 2); sprite.graphics.clear(); sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha); sprite.graphics.beginFill(fillColor, fillAlpha); sprite.graphics.drawRect((-(_local1) / 2), (-(_local2) / 2), _local1, _local2); sprite.graphics.endFill(); }; paint(); } public function set width(_arg1:Number):void{ _extents[0] = (_arg1 / 2); } function get extents():Array{ return (_extents); } function get axes():Array{ return (_axes); } public function get height():Number{ return ((_extents[1] * 2)); } private function setAxes(_arg1:Number):void{ var _local2:Number; var _local3:Number; _local2 = Math.sin(_arg1); _local3 = Math.cos(_arg1); axes[0].x = _local3; axes[0].y = _local2; axes[1].x = -(_local2); axes[1].y = _local3; } public function get radian():Number{ return (_radian); } public function set angle(_arg1:Number):void{ radian = (_arg1 * MathUtil.PI_OVER_ONE_EIGHTY); } public function set height(_arg1:Number):void{ _extents[1] = (_arg1 / 2); } public function get angle():Number{ return ((radian * MathUtil.ONE_EIGHTY_OVER_PI)); } public function set radian(_arg1:Number):void{ _radian = _arg1; setAxes(_arg1); } override public function paint():void{ sprite.x = curr.x; sprite.y = curr.y; sprite.rotation = angle; } public function get width():Number{ return ((_extents[0] * 2)); } } }//package org.cove.ape
Section 34
//RimParticle (org.cove.ape.RimParticle) package org.cove.ape { import org.cove.ape.*; class RimParticle { private var maxTorque:Number; var curr:Vector; var prev:Vector; private var av:Number; private var wr:Number; private var sp:Number; function RimParticle(_arg1:Number, _arg2:Number){ curr = new Vector(_arg1, 0); prev = new Vector(0, 0); sp = 0; av = 0; maxTorque = _arg2; wr = _arg1; } function update(_arg1:Number):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; sp = Math.max(-(maxTorque), Math.min(maxTorque, (sp + av))); _local2 = -(curr.y); _local3 = curr.x; _local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3))); _local2 = (_local2 / _local4); _local3 = (_local3 / _local4); curr.x = (curr.x + (sp * _local2)); curr.y = (curr.y + (sp * _local3)); _local5 = prev.x; _local6 = prev.y; _local7 = (prev.x = curr.x); _local8 = (prev.y = curr.y); curr.x = (curr.x + (APEngine.damping * (_local7 - _local5))); curr.y = (curr.y + (APEngine.damping * (_local8 - _local6))); _local9 = Math.sqrt(((curr.x * curr.x) + (curr.y * curr.y))); _local10 = ((_local9 - wr) / _local9); curr.x = (curr.x - (curr.x * _local10)); curr.y = (curr.y - (curr.y * _local10)); } function set speed(_arg1:Number):void{ sp = _arg1; } function get angularVelocity():Number{ return (av); } function set angularVelocity(_arg1:Number):void{ av = _arg1; } function get speed():Number{ return (sp); } } }//package org.cove.ape
Section 35
//SpringConstraint (org.cove.ape.SpringConstraint) package org.cove.ape { import flash.display.*; public class SpringConstraint extends AbstractConstraint { private var _collidable:Boolean; private var p1:AbstractParticle; private var p2:AbstractParticle; private var _scp:SpringConstraintParticle; private var _restLength:Number; public function SpringConstraint(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:Number=0.5, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=1, _arg7:Boolean=false){ super(_arg3); this.p1 = _arg1; this.p2 = _arg2; checkParticlesLocation(); _restLength = currLength; setCollidable(_arg4, _arg5, _arg6, _arg7); } public function get fixed():Boolean{ return (((p1.fixed) && (p2.fixed))); } public function set rectScale(_arg1:Number):void{ if (scp == null){ return; }; scp.rectScale = _arg1; } override public function init():void{ cleanup(); if (collidable){ scp.init(); } else { if (displayObject != null){ initDisplay(); }; }; paint(); } function initDisplay():void{ if (collidable){ scp.initDisplay(); } else { displayObject.x = displayObjectOffset.x; displayObject.y = displayObjectOffset.y; displayObject.rotation = displayObjectRotation; sprite.addChild(displayObject); }; } public function isConnectedTo(_arg1:AbstractParticle):Boolean{ return ((((_arg1 == p1)) || ((_arg1 == p2)))); } public function setDisplay(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):void{ if (collidable){ scp.setDisplay(_arg1, _arg2, _arg3, _arg4); } else { displayObject = _arg1; displayObjectRotation = _arg4; displayObjectOffset = new Vector(_arg2, _arg3); }; } function get scp():SpringConstraintParticle{ return (_scp); } private function checkParticlesLocation():void{ if ((((p1.curr.x == p2.curr.x)) && ((p1.curr.y == p2.curr.y)))){ p2.curr.x = (p2.curr.x + 0.0001); }; } public function get radian():Number{ var _local1:Vector; _local1 = delta; return (Math.atan2(_local1.y, _local1.x)); } public function get rectHeight():Number{ return (scp.rectHeight); } public function set restLength(_arg1:Number):void{ if (_arg1 <= 0){ throw (new ArgumentError("restLength must be greater than 0")); }; _restLength = _arg1; } public function get currLength():Number{ return (p1.curr.distance(p2.curr)); } public function get fixedEndLimit():Number{ return (scp.fixedEndLimit); } function get delta():Vector{ return (p1.curr.minus(p2.curr)); } public function get angle():Number{ return ((radian * MathUtil.ONE_EIGHTY_OVER_PI)); } public function get center():Vector{ return (p1.curr.plus(p2.curr).divEquals(2)); } public function set rectHeight(_arg1:Number):void{ if (scp == null){ return; }; scp.rectHeight = _arg1; } public function setCollidable(_arg1:Boolean, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{ _collidable = _arg1; _scp = null; if (_collidable){ _scp = new SpringConstraintParticle(p1, p2, this, _arg2, _arg3, _arg4); }; } override public function paint():void{ var _local1:Vector; if (collidable){ scp.paint(); } else { if (displayObject != null){ _local1 = center; sprite.x = _local1.x; sprite.y = _local1.y; sprite.rotation = angle; } else { sprite.graphics.clear(); sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha); sprite.graphics.moveTo(p1.px, p1.py); sprite.graphics.lineTo(p2.px, p2.py); }; }; } public function get rectScale():Number{ return (scp.rectScale); } public function get restLength():Number{ return (_restLength); } override public function resolve():void{ var _local1:Number; var _local2:Number; var _local3:Vector; if (((p1.fixed) && (p2.fixed))){ return; }; _local1 = currLength; _local2 = ((_local1 - restLength) / (_local1 * (p1.invMass + p2.invMass))); _local3 = delta.mult((_local2 * stiffness)); p1.curr.minusEquals(_local3.mult(p1.invMass)); p2.curr.plusEquals(_local3.mult(p2.invMass)); } public function get collidable():Boolean{ return (_collidable); } public function set fixedEndLimit(_arg1:Number):void{ if (scp == null){ return; }; scp.fixedEndLimit = _arg1; } } }//package org.cove.ape
Section 36
//SpringConstraintParticle (org.cove.ape.SpringConstraintParticle) package org.cove.ape { import flash.display.*; import org.cove.ape.*; class SpringConstraintParticle extends RectangleParticle { private var _fixedEndLimit:Number; private var rca:Vector; private var rcb:Vector; private var _rectScale:Number; private var s:Number; var parent:SpringConstraint; private var scaleToLength:Boolean; private var p1:AbstractParticle; private var p2:AbstractParticle; private var lambda:Vector; private var avgVelocity:Vector; private var _rectHeight:Number; function SpringConstraintParticle(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:SpringConstraint, _arg4:Number, _arg5:Number, _arg6:Boolean){ super(0, 0, 0, 0, 0, false); this.p1 = _arg1; this.p2 = _arg2; lambda = new Vector(0, 0); avgVelocity = new Vector(0, 0); parent = _arg3; this.rectScale = _arg5; this.rectHeight = _arg4; this.scaleToLength = _arg6; fixedEndLimit = 0; rca = new Vector(); rcb = new Vector(); } private function setCorners(_arg1:RectangleParticle, _arg2:int):void{ var _local3:Number; var _local4:Number; var _local5:Array; var _local6:Array; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; _local3 = _arg1.curr.x; _local4 = _arg1.curr.y; _local5 = _arg1.axes; _local6 = _arg1.extents; _local7 = (_local5[0].x * _local6[0]); _local8 = (_local5[0].y * _local6[0]); _local9 = (_local5[1].x * _local6[1]); _local10 = (_local5[1].y * _local6[1]); _local11 = (_local7 - _local9); _local12 = (_local8 - _local10); _local13 = (_local7 + _local9); _local14 = (_local8 + _local10); if (_arg2 == 0){ rca.x = (_local3 - _local13); rca.y = (_local4 - _local14); rcb.x = (_local3 + _local11); rcb.y = (_local4 + _local12); } else { if (_arg2 == 1){ rca.x = (_local3 + _local11); rca.y = (_local4 + _local12); rcb.x = (_local3 + _local13); rcb.y = (_local4 + _local14); } else { if (_arg2 == 2){ rca.x = (_local3 + _local13); rca.y = (_local4 + _local14); rcb.x = (_local3 - _local11); rcb.y = (_local4 - _local12); } else { if (_arg2 == 3){ rca.x = (_local3 - _local11); rca.y = (_local4 - _local12); rcb.x = (_local3 - _local13); rcb.y = (_local4 - _local14); }; }; }; }; } override public function init():void{ var _local1:Sprite; var _local2:Number; var _local3:Number; if (displayObject != null){ initDisplay(); } else { _local1 = new Sprite(); parent.sprite.addChild(_local1); _local1.name = "inner"; _local2 = (parent.currLength * rectScale); _local3 = rectHeight; _local1.graphics.clear(); _local1.graphics.lineStyle(parent.lineThickness, parent.lineColor, parent.lineAlpha); _local1.graphics.beginFill(parent.fillColor, parent.fillAlpha); _local1.graphics.drawRect((-(_local2) / 2), (-(_local3) / 2), _local2, _local3); _local1.graphics.endFill(); }; paint(); } function updatePosition():void{ var _local1:Vector; _local1 = parent.center; curr.setTo(_local1.x, _local1.y); width = (scaleToLength) ? (parent.currLength * rectScale) : (parent.restLength * rectScale); height = rectHeight; radian = parent.radian; } private function closestPtSegmentSegment():Number{ var _local1:Vector; var _local2:Vector; var _local3:Vector; var _local4:Vector; var _local5:Vector; var _local6:Vector; var _local7:Vector; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Vector; var _local16:Vector; var _local17:Vector; _local1 = p1.curr; _local2 = p2.curr; _local3 = rca; _local4 = rcb; _local5 = _local2.minus(_local1); _local6 = _local4.minus(_local3); _local7 = _local1.minus(_local3); _local9 = _local5.dot(_local5); _local10 = _local6.dot(_local6); _local11 = _local6.dot(_local7); _local12 = _local5.dot(_local7); _local13 = _local5.dot(_local6); _local14 = ((_local9 * _local10) - (_local13 * _local13)); if (_local14 != 0){ s = MathUtil.clamp((((_local13 * _local11) - (_local12 * _local10)) / _local14), 0, 1); } else { s = 0.5; }; _local8 = (((_local13 * s) + _local11) / _local10); if (_local8 < 0){ _local8 = 0; s = MathUtil.clamp((-(_local12) / _local9), 0, 1); } else { if (_local8 > 0){ _local8 = 1; s = MathUtil.clamp(((_local13 - _local12) / _local9), 0, 1); }; }; _local15 = _local1.plus(_local5.mult(s)); _local16 = _local3.plus(_local6.mult(_local8)); _local17 = _local15.minus(_local16); return (_local15.minus(_local16).dot(_local17)); } function get rectHeight():Number{ return (_rectHeight); } function get fixedEndLimit():Number{ return (_fixedEndLimit); } private function closestParamPoint(_arg1:Vector):Number{ var _local2:Vector; var _local3:Number; _local2 = p2.curr.minus(p1.curr); _local3 = (_local2.dot(_arg1.minus(p1.curr)) / _local2.dot(_local2)); return (MathUtil.clamp(_local3, 0, 1)); } override public function paint():void{ var _local1:Vector; var _local2:Sprite; _local1 = parent.center; _local2 = parent.sprite; if (scaleToLength){ _local2.getChildByName("inner").width = (parent.currLength * rectScale); } else { if (displayObject != null){ _local2.getChildByName("inner").width = (parent.restLength * rectScale); }; }; _local2.x = _local1.x; _local2.y = _local1.y; _local2.rotation = parent.angle; } function set rectHeight(_arg1:Number):void{ _rectHeight = _arg1; } private function getContactPointParam(_arg1:AbstractParticle):Number{ var _local2:Number; var _local3:Number; var _local4:Array; var _local5:Number; var _local6:int; var _local7:Number; if ((_arg1 is CircleParticle)){ _local2 = closestParamPoint(_arg1.curr); } else { if ((_arg1 is RectangleParticle)){ _local4 = new Array(4); _local5 = Number.POSITIVE_INFINITY; _local6 = 0; while (_local6 < 4) { setCorners((_arg1 as RectangleParticle), _local6); _local7 = closestPtSegmentSegment(); if (_local7 < _local5){ _local5 = _local7; _local3 = _local6; _local4[_local6] = s; }; _local6++; }; _local2 = _local4[_local3]; }; }; return (_local2); } function set fixedEndLimit(_arg1:Number):void{ _fixedEndLimit = _arg1; } override public function get fixed():Boolean{ return (parent.fixed); } override function get invMass():Number{ if (((p1.fixed) && (p2.fixed))){ return (0); }; return ((1 / ((p1.mass + p2.mass) / 2))); } override function initDisplay():void{ var _local1:Sprite; displayObject.x = displayObjectOffset.x; displayObject.y = displayObjectOffset.y; displayObject.rotation = displayObjectRotation; _local1 = new Sprite(); _local1.name = "inner"; _local1.addChild(displayObject); parent.sprite.addChild(_local1); } function set rectScale(_arg1:Number):void{ _rectScale = _arg1; } override function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{ var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:AbstractParticle; testParticleEvents(_arg6); if (((fixed) || (!(_arg6.solid)))){ return; }; _local7 = getContactPointParam(_arg6); _local8 = (1 - _local7); _local9 = _local7; if (p1.fixed){ if (_local9 <= fixedEndLimit){ return; }; lambda.setTo((_arg1.x / _local9), (_arg1.y / _local9)); p2.curr.plusEquals(lambda); p2.velocity = _arg2; } else { if (p2.fixed){ if (_local8 <= fixedEndLimit){ return; }; lambda.setTo((_arg1.x / _local8), (_arg1.y / _local8)); p1.curr.plusEquals(lambda); p1.velocity = _arg2; } else { _local10 = ((_local8 * _local8) + (_local9 * _local9)); if (_local10 == 0){ return; }; lambda.setTo((_arg1.x / _local10), (_arg1.y / _local10)); p1.curr.plusEquals(lambda.mult(_local8)); p2.curr.plusEquals(lambda.mult(_local9)); if (_local7 == 0.5){ p1.velocity = _arg2; p2.velocity = _arg2; } else { _local11 = ((_local7)<0.5) ? p1 : p2; _local11.velocity = _arg2; }; }; }; } override public function get elasticity():Number{ return (((p1.elasticity + p2.elasticity) / 2)); } function get rectScale():Number{ return (_rectScale); } override public function get velocity():Vector{ var _local1:Vector; var _local2:Vector; _local1 = p1.velocity; _local2 = p2.velocity; avgVelocity.setTo(((_local1.x + _local2.x) / 2), ((_local1.y + _local2.y) / 2)); return (avgVelocity); } override public function get mass():Number{ return (((p1.mass + p2.mass) / 2)); } override public function get friction():Number{ return (((p1.friction + p2.friction) / 2)); } } }//package org.cove.ape
Section 37
//Vector (org.cove.ape.Vector) package org.cove.ape { public class Vector { public var x:Number; public var y:Number; public function Vector(_arg1:Number=0, _arg2:Number=0){ x = _arg1; y = _arg2; } public function cross(_arg1:Vector):Number{ return (((x * _arg1.y) - (y * _arg1.x))); } public function magnitude():Number{ return (Math.sqrt(((x * x) + (y * y)))); } public function divEquals(_arg1:Number):Vector{ if (_arg1 == 0){ _arg1 = 0.0001; }; x = (x / _arg1); y = (y / _arg1); return (this); } public function times(_arg1:Vector):Vector{ return (new Vector((x * _arg1.x), (y * _arg1.y))); } public function plusEquals(_arg1:Vector):Vector{ x = (x + _arg1.x); y = (y + _arg1.y); return (this); } public function dot(_arg1:Vector):Number{ return (((x * _arg1.x) + (y * _arg1.y))); } public function normalizeEquals():Vector{ var _local1:Number; _local1 = magnitude(); if (_local1 == 0){ _local1 = 0.0001; }; return (multEquals((1 / _local1))); } public function normalize():Vector{ var _local1:Number; _local1 = magnitude(); if (_local1 == 0){ _local1 = 0.0001; }; return (mult((1 / _local1))); } public function copy(_arg1:Vector):void{ x = _arg1.x; y = _arg1.y; } public function minusEquals(_arg1:Vector):Vector{ x = (x - _arg1.x); y = (y - _arg1.y); return (this); } public function minus(_arg1:Vector):Vector{ return (new Vector((x - _arg1.x), (y - _arg1.y))); } public function plus(_arg1:Vector):Vector{ return (new Vector((x + _arg1.x), (y + _arg1.y))); } public function toString():String{ return (((x + " : ") + y)); } public function distance(_arg1:Vector):Number{ var _local2:Vector; _local2 = this.minus(_arg1); return (_local2.magnitude()); } public function setTo(_arg1:Number, _arg2:Number):void{ x = _arg1; y = _arg2; } public function multEquals(_arg1:Number):Vector{ x = (x * _arg1); y = (y * _arg1); return (this); } public function mult(_arg1:Number):Vector{ return (new Vector((x * _arg1), (y * _arg1))); } } }//package org.cove.ape
Section 38
//VectorForce (org.cove.ape.VectorForce) package org.cove.ape { public class VectorForce implements IForce { private var fvx:Number; private var fvy:Number; private var value:Vector; private var scaleMass:Boolean; public function VectorForce(_arg1:Boolean, _arg2:Number, _arg3:Number){ fvx = _arg2; fvy = _arg3; scaleMass = _arg1; value = new Vector(_arg2, _arg3); } public function set vx(_arg1:Number):void{ fvx = _arg1; value.x = _arg1; } public function set vy(_arg1:Number):void{ fvy = _arg1; value.y = _arg1; } public function set useMass(_arg1:Boolean):void{ scaleMass = _arg1; } public function getValue(_arg1:Number):Vector{ if (scaleMass){ value.setTo((fvx * _arg1), (fvy * _arg1)); }; return (value); } } }//package org.cove.ape
Section 39
//WheelParticle (org.cove.ape.WheelParticle) package org.cove.ape { public class WheelParticle extends CircleParticle { private var normSlip:Vector; private var rp:RimParticle; private var _traction:Number; private var tan:Vector; private var orientation:Vector; public function WheelParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0.3, _arg7:Number=0, _arg8:Number=1){ super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7); tan = new Vector(0, 0); normSlip = new Vector(0, 0); rp = new RimParticle(_arg3, 2); this.traction = _arg8; orientation = new Vector(); } override public function init():void{ cleanup(); if (displayObject != null){ initDisplay(); } else { sprite.graphics.clear(); sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha); sprite.graphics.beginFill(fillColor, fillAlpha); sprite.graphics.drawCircle(0, 0, radius); sprite.graphics.endFill(); sprite.graphics.moveTo(-(radius), 0); sprite.graphics.lineTo(radius, 0); sprite.graphics.moveTo(0, -(radius)); sprite.graphics.lineTo(0, radius); }; paint(); } public function get radian():Number{ orientation.setTo(rp.curr.x, rp.curr.y); return ((Math.atan2(orientation.y, orientation.x) + Math.PI)); } public function get traction():Number{ return ((1 - _traction)); } public function get speed():Number{ return (rp.speed); } override public function paint():void{ sprite.x = curr.x; sprite.y = curr.y; sprite.rotation = angle; } public function set traction(_arg1:Number):void{ _traction = (1 - _arg1); } public function set speed(_arg1:Number):void{ rp.speed = _arg1; } override function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{ super.resolveCollision(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6); resolve(_arg3.mult(MathUtil.sign((_arg4 * _arg5)))); } public function set angularVelocity(_arg1:Number):void{ rp.angularVelocity = _arg1; } override public function update(_arg1:Number):void{ super.update(_arg1); rp.update(_arg1); } public function get angle():Number{ return ((radian * MathUtil.ONE_EIGHTY_OVER_PI)); } public function get angularVelocity():Number{ return (rp.angularVelocity); } private function resolve(_arg1:Vector):void{ var _local2:Vector; var _local3:Vector; var _local4:Number; var _local5:Number; tan.setTo(-(rp.curr.y), rp.curr.x); tan = tan.normalize(); _local2 = tan.mult(rp.speed); _local3 = velocity.plusEquals(_local2); _local4 = _local3.cross(_arg1); tan.multEquals(_local4); rp.prev.copy(rp.curr.minus(tan)); _local5 = ((1 - _traction) * rp.speed); normSlip.setTo((_local5 * _arg1.y), (_local5 * _arg1.x)); curr.plusEquals(normSlip); rp.speed = (rp.speed * _traction); } } }//package org.cove.ape
Section 40
//MainTimeline (SteerWheels2_UGO2_fla.MainTimeline) package SteerWheels2_UGO2_fla { import flash.display.*; import org.cove.ape.*; import flash.events.*; import fl.motion.*; import flash.filters.*; import flash.geom.*; import mochi.*; import flash.media.*; import flash.text.*; import flash.net.*; import flash.utils.*; import flash.ui.*; import flash.system.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.printing.*; import flash.xml.*; public dynamic class MainTimeline extends MovieClip { public var size:int; public var slantlb17:RectangleParticle; public var bigf19:CircleParticle; public var floorslant2:RectangleParticle; public var floorslant3:RectangleParticle; public var noul:MovieClip; public var ugint:MovieClip; public var blackS:MovieClip; public var flooar11:RectangleParticle; public var blg12:Group; public var bha15:CircleParticle; public var bridgePAA:CircleParticle; public var th_animator:Animator; public var polc14:CircleParticle; public var pleasewait:MovieClip; public var rwall16:RectangleParticle; public var b:Number; public var creditscreenh:Boolean; public var floorbb12:RectangleParticle; public var sc15:SpringConstraint; public var bridgeConnB:SpringConstraint; public var origtime; public var nolevelscreen:Boolean; public var bridgeConnE:SpringConstraint; public var bridgeConnF:SpringConstraint; public var bridgeConnG:SpringConstraint; public var bridgeConnA:SpringConstraint; public var bridgeConnD:SpringConstraint; public var bigd19:CircleParticle; public var bridgeConnC:SpringConstraint; public var level12:Group; public var level13:Group; public var level15:Group; public var level16:Group; public var level11:Group; public var level17:Group; public var bridgePDD:CircleParticle; public var level18:Group; public var level10:Group; public var floori13:RectangleParticle; public var triga20:RectangleParticle; public var level14:Group; public var level19:Group; public var level20:Group; public var yslope:Number; public var vol:Number; public var pola14:CircleParticle; public var levelsm:RectangleParticle; public var zxc:Number; public var ts18:CircleParticle; public var bh15:CircleParticle; public var creds:MovieClip; public var rhh:CircleParticle; public var smute:Boolean; public var touchcred:Boolean; public var lvr6:RectangleParticle; public var bigb19:CircleParticle; public var pol14:CircleParticle; public var lstep:Number; public var requesttudin:URLRequest; public var instruct:MovieClip; public var floorg13:RectangleParticle; public var quitgameshow:Boolean; public var pyra6:RectangleParticle; public var helpm:RectangleParticle; public var pyrb6:RectangleParticle; public var bitmapLayer:Bitmap; public var rla:SpringConstraint; public var rlb:SpringConstraint; public var yellowhit1:Group; public var yellowhit2:Group; public var mutem:MovieClip; public var yellowhit4:Group; public var yellowhit5:Group; public var yellowhit3:Group; public var boldb20:CircleParticle; public var menulevel:Group; public var lvv2:RectangleParticle; public var lvv3:RectangleParticle; public var lvv4:RectangleParticle; public var lvv5:RectangleParticle; public var lvv6:RectangleParticle; public var lvv7:RectangleParticle; public var lvv8:RectangleParticle; public var lvv9:RectangleParticle; public var cg12:Group; public var htext:MovieClip; public var triggera20:RectangleParticle; public var boxm17:SpringConstraint; public var mpause; public var lscore; public var floore13:RectangleParticle; public var lvvm:Number; public var bridgeConnF2:SpringConstraint; public var lcl:Number; public var pi11:SpringConstraint; public var bpra11:CircleParticle; public var ulevel1:Boolean; public var ulevel2:Boolean; public var rect:Rectangle; public var ulevel4:Boolean; public var ulevel5:Boolean; public var ulevel6:Boolean; public var ulevel7:Boolean; public var ulevel8:Boolean; public var ulevel9:Boolean; public var ulevel3:Boolean; public var wc12:SpringConstraint; public var wc13:SpringConstraint; public var wc14:SpringConstraint; public var volc:SoundTransform; public var wc10:SpringConstraint; public var wc15:SpringConstraint; public var wc16:SpringConstraint; public var wc11:SpringConstraint; public var floort13:RectangleParticle; public var wc19:SpringConstraint; public var sca15:SpringConstraint; public var unlockedlevels:SharedObject; public var wc17:SpringConstraint; public var wc18:SpringConstraint; public var mute:Boolean; public var timeTextformat:TextFormat; public var wc20:SpringConstraint; public var stageholder:MovieClip; public var floorc17:RectangleParticle; public var floorc18:RectangleParticle; public var floorc12:RectangleParticle; public var slantrb17:RectangleParticle; public var floorc13:RectangleParticle; public var bs18:CircleParticle; public var countDown:Number; public var floorc20:RectangleParticle; public var pg11:SpringConstraint; public var urltudin:String; public var wa10:WheelParticle; public var wa14:WheelParticle; public var wa15:WheelParticle; public var wa16:WheelParticle; public var wa11:WheelParticle; public var planu:Number; public var wa17:WheelParticle; public var wa18:WheelParticle; public var wa19:WheelParticle; public var wa12:WheelParticle; public var particle2:BitmapData; public var wa13:WheelParticle; public var ulevel10:Boolean; public var ulevel11:Boolean; public var ulevel12:Boolean; public var ulevel13:Boolean; public var ulevel15:Boolean; public var ulevel16:Boolean; public var ulevel17:Boolean; public var ulevel18:Boolean; public var ulevel19:Boolean; public var ulevel14:Boolean; public var slanta18:RectangleParticle; public var ulevelholder:Array; public var boings; public var selectright:Boolean; public var slanta10:RectangleParticle; public var lseltext:MovieClip; public var wa1:WheelParticle; public var wa2:WheelParticle; public var rvm:RectangleParticle; public var wa4:WheelParticle; public var wa5:WheelParticle; public var ulevel20:Boolean; public var wa8:WheelParticle; public var wa9:WheelParticle; public var wa3:WheelParticle; public var slanta17:RectangleParticle; public var ulevelt1:TextField; public var wa20:WheelParticle; public var floora13:RectangleParticle; public var floora14:RectangleParticle; public var floora10:RectangleParticle; public var floora19:RectangleParticle; public var floora16:RectangleParticle; public var wa7:WheelParticle; public var wb1:WheelParticle; public var wb2:WheelParticle; public var wb3:WheelParticle; public var wb4:WheelParticle; public var wb5:WheelParticle; public var wb6:WheelParticle; public var cframesu:Number; public var wb8:WheelParticle; public var wb7:WheelParticle; public var wb9:WheelParticle; public var playmode:MovieClip; public var wa6:WheelParticle; public var floora20:RectangleParticle; public var wam:WheelParticle; public var wc1:SpringConstraint; public var bluecol:Number; public var wc3:SpringConstraint; public var wc5:SpringConstraint; public var wc7:SpringConstraint; public var wc6:SpringConstraint; public var touchplay:Boolean; public var wc9:SpringConstraint; public var wc2:SpringConstraint; public var wc4:SpringConstraint; public var yhit2:RectangleParticle; public var yhit4:RectangleParticle; public var wc8:SpringConstraint; public var yhit6:RectangleParticle; public var yhit7:RectangleParticle; public var yhit9:RectangleParticle; public var wbm:WheelParticle; public var bpr11:CircleParticle; public var yhit8:RectangleParticle; public var yhit5:RectangleParticle; public var yourdead:Boolean; public var helpscreenh:Boolean; public var wcm:SpringConstraint; public var practise:Boolean; public var big19:CircleParticle; public var bpa15:Number; public var trig12:RectangleParticle; public var trig13:RectangleParticle; public var hstep:Number; public var pe11:SpringConstraint; public var bitmapDataLayer:BitmapData; public var trig20:RectangleParticle; public var pc11:SpringConstraint; public var trig18:RectangleParticle; public var effectPt:Point; public var bpArrayb15:Array; public var oscore:Number; public var bold20:CircleParticle; public var slant10:RectangleParticle; public var slant17:RectangleParticle; public var slant18:RectangleParticle; public var blurAmount:int; public var ttext:MovieClip; public var playm:RectangleParticle; public var pa11:SpringConstraint; public var th_xml:XML; public var ba4:CircleParticle; public var ba5:CircleParticle; public var ba6:CircleParticle; public var ba1:CircleParticle; public var ba3:CircleParticle; public var ba7:CircleParticle; public var ba9:CircleParticle; public var ba2:CircleParticle; public var lv2:RectangleParticle; public var ba8:CircleParticle; public var slantl17:RectangleParticle; public var lvmArray:Array; public var bhb15:CircleParticle; public var floorl12:RectangleParticle; public var floor:RectangleParticle; public var modeselectplay:Boolean; public var pold14:CircleParticle; public var yhit12:RectangleParticle; public var yhit14:RectangleParticle; public var yhit16:RectangleParticle; public var yhit10:RectangleParticle; public var yhit18:RectangleParticle; public var lvm:RectangleParticle; public var yhit15:RectangleParticle; public var yhit17:RectangleParticle; public var yhit19:RectangleParticle; public var yhit13:RectangleParticle; public var c1:CircleParticle; public var floorbc12:RectangleParticle; public var ba:Number; public var bb:Number; public var bc:Number; public var vstep:Number; public var bg:CircleParticle; public var apiholder:MovieClip; public var yhit20:RectangleParticle; public var bd:Number; public var bige19:CircleParticle; public var highestScore:SharedObject; public var br:WheelParticle; public var bx:Number; public var by:Number; public var menulev:Boolean; public var Glowm:GlowFilter; public var slantla17:RectangleParticle; public var floorslant:RectangleParticle; public var dead:MovieClip; public var boxr17:CircleParticle; public var spacego:Boolean; public var bpl11:CircleParticle; public var floorj13:RectangleParticle; public var yhit:RectangleParticle; public var bg1:CircleParticle; public var bg2:CircleParticle; public var polb14:CircleParticle; public var uls:Number; public var tudinmusic:tudsynth; public var livesLost:Number; public var lwall14:RectangleParticle; public var lwall16:RectangleParticle; public var lwall15:RectangleParticle; public var lwall17:RectangleParticle; public var blurEffect:BlurFilter; public var go; public var lwall19:RectangleParticle; public var swingDoorSpring:SpringConstraint; public var floora2:RectangleParticle; public var floorh13:RectangleParticle; public var floora5:RectangleParticle; public var floora9:RectangleParticle; public var channel:SoundChannel; public var bigc19:CircleParticle; public var floorb2:RectangleParticle; public var floorb6:RectangleParticle; public var level1:Group; public var level3:Group; public var level4:Group; public var level5:Group; public var level6:Group; public var level8:Group; public var level2:Group; public var level7:Group; public var floorc2:RectangleParticle; public var pausePosition:int; public var level9:Group; public var floorb9:RectangleParticle; public var floorc6:RectangleParticle; public var bg12:Group; public var biga19:CircleParticle; public var _mochiads_game_id:String; public var ulsholder:Array; public var floorcirc2:CircleParticle; public var floord2:RectangleParticle; public var ngrscreenh:Boolean; public var slantre17:RectangleParticle; public var floorf13:RectangleParticle; public var SWtext:MovieClip; public var timeText:TextField; public var myCircle:Shape; public var ptext:MovieClip; public var minuteTimer:Timer; public var swingDoorAnchor:CircleParticle; public var swing18:SpringConstraint; public var floor2:RectangleParticle; public var floor3:RectangleParticle; public var floor4:RectangleParticle; public var floor5:RectangleParticle; public var floor7:RectangleParticle; public var floor9:RectangleParticle; public var floor6:RectangleParticle; public var floor8:RectangleParticle; public var scb15:SpringConstraint; public var bolda20:CircleParticle; public var spc:Number; public var tp11:CircleParticle; public var randxf:Number; public var floorm:RectangleParticle; public var tudmenu:ContextMenu; public var boxl17:CircleParticle; public var floorh7:RectangleParticle; public var bsound:boing; public var sitetextm:MovieClip; public var trigger20:RectangleParticle; public var ball:Shape; public var randyf:Number; public var pt:Point; public var slantrc17:RectangleParticle; public var bpf11:CircleParticle; public var floord13:RectangleParticle; public var mslanta10:RectangleParticle; public var bpArray15:Array; public var floord18:RectangleParticle; public var ph11:SpringConstraint; public var music:theme; public var wb11:WheelParticle; public var wb12:WheelParticle; public var wb13:WheelParticle; public var wb15:WheelParticle; public var wb10:WheelParticle; public var instruct2:MovieClip; public var wb18:WheelParticle; public var rstep:Number; public var liveAm:MovieClip; public var rh:CircleParticle; public var wb14:WheelParticle; public var wb16:WheelParticle; public var rl:SpringConstraint; public var wb19:WheelParticle; public var wb17:WheelParticle; public var floorl8:RectangleParticle; public var wb20:WheelParticle; public var smallw10:RectangleParticle; public var th:MovieClip; public var floorb12:RectangleParticle; public var volctudin:SoundTransform; public var floorb18:RectangleParticle; public var touchlev:Boolean; public var mslant10:RectangleParticle; public var particle:BitmapData; public var floorb13:RectangleParticle; public var floorb17:RectangleParticle; public var tr:WheelParticle; public var slantra17:RectangleParticle; public var floorb20:RectangleParticle; public var pf11:SpringConstraint; public var ba10:CircleParticle; public var ba11:CircleParticle; public var ba12:CircleParticle; public var ba13:CircleParticle; public var ba14:CircleParticle; public var ba15:CircleParticle; public var ba16:CircleParticle; public var ba17:CircleParticle; public var ba19:CircleParticle; public var floorb16:RectangleParticle; public var swingDoorP1:CircleParticle; public var swingDoorP2:CircleParticle; public var spacegono:Number; public var ba18:CircleParticle; public var ba20:CircleParticle; public var quitgame:MovieClip; public var colB:Number; public var colC:Number; public var pausesc:MovieClip; public var helpysave:String; public var levelend:MovieClip; public var tudmenuitem1:ContextMenuItem; public var tudmenuitem2:ContextMenuItem; public var tudmenuitem3:ContextMenuItem; public var tudmenuitem4:ContextMenuItem; public var localHighScore:Number; public var bp15:Number; public var bpb15:Number; public var touchhelp:Boolean; public var selectleft:Boolean; public var touchsite:Boolean; public var hidehit:MovieClip; public var floorr8:RectangleParticle; public var creditsm:RectangleParticle; public var pd11:SpringConstraint; public var effectRect:Rectangle; public var floorr6:RectangleParticle; public var floor10:RectangleParticle; public var floor11:RectangleParticle; public var floor12:RectangleParticle; public var floor13:RectangleParticle; public var floor14:RectangleParticle; public var floor15:RectangleParticle; public var floor18:RectangleParticle; public var floor19:RectangleParticle; public var levelCompletes:Boolean; public var yourDead:Boolean; public var floor16:RectangleParticle; public var floor17:RectangleParticle; public var bridgePA:CircleParticle; public var bridgePB:CircleParticle; public var bridgePC:CircleParticle; public var bridgePD:CircleParticle; public var bridgePF:CircleParticle; public var help:MovieClip; public var channeltudin:SoundChannel; public var lvv11:RectangleParticle; public var lvv12:RectangleParticle; public var bridgePE:CircleParticle; public var floor20:RectangleParticle; public var lead; public var textformat:TextFormat; public var bsize:Number; public var credtext:MovieClip; public var spcb:Number; public var spca:Number; public var floorv2:RectangleParticle; public var floorv7:RectangleParticle; public var floorv9:RectangleParticle; public var pb11:SpringConstraint; public var webm:RectangleParticle; public var bpla11:CircleParticle; public var particleSize:Number; public var bpArraya15:Array; public var clg12:Group; public var swingDoor:SpringConstraint; public var cheatSpace:Number; public function MainTimeline(){ addFrameScript(0, frame1, 1, frame2, 4, frame5, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 24, frame25, 25, frame26, 26, frame27, 27, frame28, 28, frame29, 39, frame40); } public function key_pressed20(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ level20.addParticle(triggera20); level20.addParticle(trig20); wa20.px = 30; wa20.py = 20; wb20.px = 70; wb20.py = 20; ba20.px = 900; ba20.py = 1300; bold20.px = -100; bold20.py = 50; bolda20.px = -80; bolda20.py = -100; boldb20.px = -50; boldb20.py = -300; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa20.angularVelocity = 0.6; wb20.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa20.angularVelocity = -0.6; wb20.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level20); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run20); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed20); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released20); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); gotoAndStop(40); minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); addChild(dead); dead.failtit.text = "You are Victorious!"; oscore = (oscore + ((lvmArray.length - livesLost) * 5000)); dead.finalScore.text = ((((("You had " + (lvmArray.length - livesLost)) + " lives left, so your life bonus is ") + ((lvmArray.length - livesLost) * 5000)) + " Which means your overall score is ") + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; th.removeChild(timeText); removeChild(th); } else { channel.stop(); gotoAndStop(5); }; APEngine.removeGroup(level20); removeChild(levelend); go = true; levelCompletes = false; removeEventListener(Event.ENTER_FRAME, run20); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed20); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released20); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed_shift(_arg1:KeyboardEvent):void{ var _local2:String; var _local3:URLRequest; if (_arg1.keyCode == Keyboard.SHIFT){ if (levelCompletes == true){ _local2 = "http://secure-us.imrworldwide.com/cgi-bin/b?cg=ugoplayer_flash_games&ci=us-ugclicks&tu=http://www.ugoplayer.com"; _local3 = new URLRequest(_local2); navigateToURL(_local3, "_blank"); }; }; } function frame10(){ addEventListener(Event.ENTER_FRAME, runx); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed); stage.addEventListener(KeyboardEvent.KEY_UP, key_released); removeChild(hidehit); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level1 = new Group(); yellowhit1 = new Group(); level1.collideInternal = true; yourdead = false; dead = new deadScreen(); dead.x = 0; dead.y = 0; yourDead = false; instruct.instructotext.text = "Use the left and right arrows to push the yellow ball to the yellow bar."; instruct.y = 50; instruct.x = 20; apiholder.addChild(instruct); instruct2.instructotext.text = "Press the 'S' key to mute"; instruct2.y = 50; instruct2.x = 520; apiholder.addChild(instruct2); levelend.levelname.text = "Level 1 Complete"; bg2 = new CircleParticle(420, 280, 55, true, 2); bg2.collidable = false; bg2.setStyle(30, 12058224, 1, 13434777, 1); level1.addParticle(bg2); bg1 = new CircleParticle(300, 200, 100, true, 2); bg1.collidable = false; bg1.setStyle(30, 12058224, 1, 13434777, 1); level1.addParticle(bg1); bg = new CircleParticle(100, 400, 200, true, 2); bg.collidable = false; bg.setStyle(30, 12058224, 1, 13434777, 1); level1.addParticle(bg); lv2 = new RectangleParticle(-5, 155, 10, 100, 0, true); lv2.setStyle(3, 3359795, 1, 11189162, 1); level1.addParticle(lv2); wa1 = new WheelParticle(30, 20, 15, false, 2); level1.addParticle(wa1); wb1 = new WheelParticle(70, 20, 15, false, 2); level1.addParticle(wb1); wc1 = new SpringConstraint(wa1, wb1, 0.5, true, 10); level1.addConstraint(wc1); wa1.setStyle(3, 3359795, 1, 11189179, 1); wb1.setStyle(3, 3359795, 1, 11189179, 1); wc1.setStyle(3, 3359795, 1, 11189179, 1); ba1 = new CircleParticle(120, 10, 15, false, 2); level1.addParticle(ba1); ba1.setStyle(3, 16040962, 1, 0xFFCC00, 1); floor = new RectangleParticle(300, 200, 600, 10, 0, true); floor.setStyle(3, 3359795, 1, 11189162, 1); level1.addParticle(floor); yhit = new RectangleParticle(595, 155, 10, 100, 0, true); yhit.sprite.name = "y"; yhit.setStyle(3, 16040962, 1, 0xFFCC00, 1); level1.addParticle(yhit); APEngine.addGroup(level1); oscore = 0; ba1.addEventListener(CollisionEvent.COLLIDE, bahitw); th = new timerholderblob(); th.x = 550; th.y = 470; addChild(th); origtime = 40; livesLost = 0; timeText = new TextField(); timeTextformat = new TextFormat(); timeTextformat.color = 3359795; timeTextformat.font = "Arial"; timeTextformat.size = 30; timeText.text = origtime; timeText.setTextFormat(timeTextformat); timeText.selectable = false; timeText.x = -60; timeText.y = -40; th.addChild(timeText); lvmArray = new Array(); lvvm = 0; while (lvvm < 5) { liveAm = new steerLife(); liveAm.x = (-250 - (lvvm * 50)); liveAm.y = -25; th.addChild(liveAm); lvmArray.push(liveAm); lvvm++; }; minuteTimer = new Timer(1000, origtime); minuteTimer.addEventListener(TimerEvent.TIMER, onTick); minuteTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); th_xml = <Motion duration="30" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*"> <source> <Source frameRate="30" x="487.95" y="464.2" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="timerholderblob" class="timerholderblob"> <dimensions> <geom:Rectangle left="-141.8" top="-64.45" width="159.5" height="109.45"/> </dimensions> <transformationPoint> <geom:Point x="0.5003134796238246" y="0.5002284148012791"/> </transformationPoint> </Source> </source> <Keyframe index="0" tweenSnap="true" tweenSync="true"> <tweens> <SimpleEase ease="200"/> </tweens> </Keyframe> <Keyframe index="29" y="-73.94999999999999"/> </Motion> ; th_animator = new Animator(th_xml, th); if (practise == false){ th_animator.play(); minuteTimer.start(); }; } function frame14(){ addEventListener(Event.ENTER_FRAME, run2); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed2); stage.addEventListener(KeyboardEvent.KEY_UP, key_released2); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level2 = new Group(); yellowhit2 = new Group(); level2.collideInternal = true; unlockedlevels.data.ulevel5 = true; unlockedlevels.flush(); instruct.instructotext.text = "Not all paths are as straight"; instruct.y = 50; instruct.x = 20; apiholder.addChild(instruct); levelend.levelname.text = "Level 5 Complete"; lvv2 = new RectangleParticle(-5, 155, 10, 100, 0, true); lvv2.setStyle(3, 3359795, 1, 11189162, 1); level2.addParticle(lvv2); wa2 = new WheelParticle(30, 20, 15, false, 2); level2.addParticle(wa2); wb2 = new WheelParticle(70, 20, 15, false, 2); level2.addParticle(wb2); wc2 = new SpringConstraint(wa2, wb2, 0.5, true, 10); level2.addConstraint(wc2); wa2.setStyle(3, 3359795, 1, 11189179, 1); wb2.setStyle(3, 3359795, 1, 11189179, 1); wc2.setStyle(3, 3359795, 1, 11189179, 1); ba2 = new CircleParticle(120, 10, 15, false, 2); level2.addParticle(ba2); ba2.setStyle(3, 16040962, 1, 0xFFCC00, 1); floor2 = new RectangleParticle(300, 200, 600, 10, 0, true); floor2.setStyle(3, 3359795, 1, 11189162, 1); level2.addParticle(floor2); floorv2 = new RectangleParticle(995, 750, 10, 300, 0, true); floorv2.setStyle(3, 3359795, 1, 11189162, 1); level2.addParticle(floorv2); floorcirc2 = new CircleParticle(600, 595, 400, true, 2); level2.addParticle(floorcirc2); floorcirc2.setStyle(3, 3359795, 1, 11189162, 1); floora2 = new RectangleParticle(1150, 900, 300, 10, 0.7525, true); floora2.setStyle(3, 3359795, 1, 11189162, 1); level2.addParticle(floora2); floorb2 = new RectangleParticle(1075, 850, 300, 10, 1, true); floorb2.setStyle(3, 3359795, 1, 11189162, 1); level2.addParticle(floorb2); floorc2 = new RectangleParticle(1225, 950, 300, 10, 0.35, true); floorc2.setStyle(3, 3359795, 1, 11189162, 1); level2.addParticle(floorc2); floord2 = new RectangleParticle(1700, 1000, 900, 10, 0, true); floord2.setStyle(3, 3359795, 1, 11189162, 1); level2.addParticle(floord2); yhit2 = new RectangleParticle(2145, 955, 10, 100, 0, true); yhit2.sprite.name = "y"; yhit2.setStyle(3, 16040962, 1, 0xFFCC00, 1); level2.addParticle(yhit2); APEngine.addGroup(level2); ba2.addEventListener(CollisionEvent.COLLIDE, bahitw2); } function frame15(){ addEventListener(Event.ENTER_FRAME, run6); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed6); stage.addEventListener(KeyboardEvent.KEY_UP, key_released6); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level6 = new Group(); level6.collideInternal = true; unlockedlevels.data.ulevel6 = true; unlockedlevels.flush(); instruct.instructotext.text = "The egyptians built them"; instruct.y = 50; instruct.x = 20; apiholder.addChild(instruct); instruct2.instructotext.text = "Just didn't finish them..."; instruct2.y = -590; instruct2.x = 2050; apiholder.addChild(instruct2); levelend.levelname.text = "Level 6 Complete"; lvv6 = new RectangleParticle(-5, 155, 10, 100, 0, true); lvv6.setStyle(3, 3359795, 1, 11189162, 1); level6.addParticle(lvv6); wa6 = new WheelParticle(30, 20, 15, false, 2); level6.addParticle(wa6); wb6 = new WheelParticle(70, 20, 15, false, 2); level6.addParticle(wb6); wc6 = new SpringConstraint(wa6, wb6, 0.5, true, 10); level6.addConstraint(wc6); wa6.setStyle(3, 3359795, 1, 11189179, 1); wb6.setStyle(3, 3359795, 1, 11189179, 1); wc6.setStyle(3, 3359795, 1, 11189179, 1); ba6 = new CircleParticle(120, 10, 15, false, 2); level6.addParticle(ba6); ba6.setStyle(3, 16040962, 1, 0xFFCC00, 1); floor6 = new RectangleParticle(300, 200, 600, 10, 0, true); floor6.setStyle(3, 3359795, 1, 11189162, 1); level6.addParticle(floor6); floorr6 = new RectangleParticle(3800, 200, 600, 10, 0, true); floorr6.setStyle(3, 3359795, 1, 11189162, 1); level6.addParticle(floorr6); floorb6 = new RectangleParticle(2000, -510, 10, 100, 0, true); floorb6.setStyle(3, 3359795, 1, 11189162, 1); level6.addParticle(floorb6); floorc6 = new RectangleParticle(2100, -510, 10, 100, 0, true); floorc6.setStyle(3, 3359795, 1, 11189162, 1); level6.addParticle(floorc6); pyra6 = new RectangleParticle(1300, -180, 1600, 10, -0.5, true); pyra6.setStyle(3, 3359795, 1, 11189162, 1); level6.addParticle(pyra6); pyrb6 = new RectangleParticle(2800, -180, 1600, 10, 0.5, true); pyrb6.setStyle(3, 3359795, 1, 11189162, 1); level6.addParticle(pyrb6); lvr6 = new RectangleParticle(4105, 155, 10, 100, 0, true); lvr6.setStyle(3, 3359795, 1, 11189162, 1); level6.addParticle(lvr6); yhit6 = new RectangleParticle(2050, -465, 100, 10, 0, true); yhit6.sprite.name = "y"; yhit6.setStyle(3, 16040962, 1, 0xFFCC00, 1); level6.addParticle(yhit6); APEngine.addGroup(level6); ba6.addEventListener(CollisionEvent.COLLIDE, bahitw6); } function frame12(){ addEventListener(Event.ENTER_FRAME, run3); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed3); stage.addEventListener(KeyboardEvent.KEY_UP, key_released3); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level3 = new Group(); yellowhit3 = new Group(); level3.collideInternal = true; unlockedlevels.data.ulevel3 = true; unlockedlevels.flush(); instruct.instructotext.text = "The rope bridge"; instruct.y = 50; instruct.x = 20; apiholder.addChild(instruct); instruct2.instructotext.text = "Press space to pause and m to quit"; instruct2.y = 50; instruct2.x = 550; apiholder.addChild(instruct2); levelend.levelname.text = "Level 3 Complete"; lvv3 = new RectangleParticle(-5, 155, 10, 100, 0, true); lvv3.setStyle(3, 3359795, 1, 11189162, 1); level3.addParticle(lvv3); wa3 = new WheelParticle(30, 20, 15, false, 2); level3.addParticle(wa3); wb3 = new WheelParticle(70, 20, 15, false, 2); level3.addParticle(wb3); wc3 = new SpringConstraint(wa3, wb3, 0.5, true, 10); level3.addConstraint(wc3); wa3.setStyle(3, 3359795, 1, 11189179, 1); wb3.setStyle(3, 3359795, 1, 11189179, 1); wc3.setStyle(3, 3359795, 1, 11189179, 1); ba3 = new CircleParticle(120, 10, 15, false, 2); level3.addParticle(ba3); ba3.setStyle(3, 16040962, 1, 0xFFCC00, 1); floor3 = new RectangleParticle(300, 200, 600, 10, 0, true); floor3.setStyle(3, 3359795, 1, 11189162, 1); level3.addParticle(floor3); colC = 3359795; colB = 11189162; bx = 600; by = 200; bsize = 51.5; yslope = 2.4; particleSize = 5; bridgePAA = new CircleParticle(bx, by, particleSize, true); bridgePAA.setStyle(3, colC, 1, colB); level3.addParticle(bridgePAA); bx = (bx + bsize); by = (by + yslope); bridgePA = new CircleParticle(bx, by, particleSize); bridgePA.setStyle(3, colC, 1, colB); level3.addParticle(bridgePA); bx = (bx + bsize); by = (by + yslope); bridgePB = new CircleParticle(bx, by, particleSize); bridgePB.setStyle(3, colC, 1, colB); level3.addParticle(bridgePB); bx = (bx + bsize); by = (by + yslope); bridgePC = new CircleParticle(bx, by, particleSize); bridgePC.setStyle(3, colC, 1, colB); level3.addParticle(bridgePC); bx = (bx + bsize); by = (by + yslope); bridgePD = new CircleParticle(bx, by, particleSize); bridgePD.setStyle(3, colC, 1, colB); level3.addParticle(bridgePD); bx = (bx + bsize); by = (by + yslope); bridgePDD = new CircleParticle(bx, by, particleSize); bridgePDD.setStyle(3, colC, 1, colB); level3.addParticle(bridgePDD); bx = (bx + bsize); by = (by + yslope); bridgePE = new CircleParticle(bx, by, particleSize, false); bridgePE.setStyle(3, colC, 1, colB); level3.addParticle(bridgePE); bx = (bx + bsize); by = (by + yslope); bridgePF = new CircleParticle(bx, by, particleSize, false); bridgePF.setStyle(3, colC, 1, colB); level3.addParticle(bridgePF); c1 = new CircleParticle(bx, (by - 100), particleSize, true); level3.addParticle(c1); c1.visible = false; bridgeConnA = new SpringConstraint(bridgePAA, bridgePA, 0.9, true, 10, 0.8); bridgeConnA.fixedEndLimit = 0.15; bridgeConnA.setStyle(3, colC, 1, colB); level3.addConstraint(bridgeConnA); bridgeConnB = new SpringConstraint(bridgePA, bridgePB, 0.9, true, 10, 0.8); bridgeConnB.setStyle(3, colC, 1, colB); level3.addConstraint(bridgeConnB); bridgeConnC = new SpringConstraint(bridgePB, bridgePC, 0.9, true, 10, 0.8); bridgeConnC.setStyle(3, colC, 1, colB); level3.addConstraint(bridgeConnC); bridgeConnD = new SpringConstraint(bridgePC, bridgePD, 0.9, true, 10, 0.8); bridgeConnD.setStyle(3, colC, 1, colB); level3.addConstraint(bridgeConnD); bridgeConnE = new SpringConstraint(bridgePD, bridgePDD, 0.9, true, 10, 0.8); bridgeConnE.fixedEndLimit = 0.25; bridgeConnE.setStyle(3, colC, 1, colB); level3.addConstraint(bridgeConnE); bridgeConnF = new SpringConstraint(bridgePDD, bridgePE, 0.9, true, 10, 0.8); bridgeConnF.fixedEndLimit = 0.25; bridgeConnF.setStyle(3, colC, 1, colB); level3.addConstraint(bridgeConnF); bridgeConnF2 = new SpringConstraint(bridgePE, bridgePF, 0.9, true, 10, 0.8); bridgeConnF2.fixedEndLimit = 0.25; bridgeConnF2.setStyle(3, colC, 1, colB); level3.addConstraint(bridgeConnF2); bridgeConnG = new SpringConstraint(bridgePF, c1, 0.9, true, 10, 0.9); bridgeConnG.fixedEndLimit = 0.25; bridgeConnG.setStyle(3, 16040962, 1, 0xFFCC00, 1); level3.addConstraint(bridgeConnG); bridgeConnG.sprite.name = "y"; APEngine.addGroup(level3); ba3.addEventListener(CollisionEvent.COLLIDE, bahitw3); } function frame17(){ addEventListener(Event.ENTER_FRAME, run8); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed8); stage.addEventListener(KeyboardEvent.KEY_UP, key_released8); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level8 = new Group(); level8.collideInternal = true; unlockedlevels.data.ulevel8 = true; unlockedlevels.flush(); instruct.instructotext.text = "Wheres the ball?"; instruct.y = 50; instruct.x = 20; apiholder.addChild(instruct); levelend.levelname.text = "Level 8 Complete"; lvv8 = new RectangleParticle(-5, 155, 10, 100, 0, true); lvv8.setStyle(3, 3359795, 1, 11189162, 1); level8.addParticle(lvv8); wa8 = new WheelParticle(30, 20, 15, false, 2); level8.addParticle(wa8); wb8 = new WheelParticle(70, 20, 15, false, 2); level8.addParticle(wb8); wc8 = new SpringConstraint(wa8, wb8, 0.5, true, 10); level8.addConstraint(wc8); wa8.setStyle(3, 3359795, 1, 11189179, 1); wb8.setStyle(3, 3359795, 1, 11189179, 1); wc8.setStyle(3, 3359795, 1, 11189179, 1); floor8 = new RectangleParticle(200, 200, 400, 10, 0, true); floor8.setStyle(3, 3359795, 1, 11189162, 1); level8.addParticle(floor8); yhit8 = new RectangleParticle(595, 600, 10, 110, 0, true); yhit8.sprite.name = "y"; yhit8.setStyle(3, 16040962, 1, 0xFFCC00, 1); level8.addParticle(yhit8); lstep = 0; while (lstep < 5) { floorl8 = new RectangleParticle(200, (200 + (lstep * 100)), 400, 10, 0, true); floorl8.setStyle(3, 3359795, 1, 11189162, 1); level8.addParticle(floorl8); lstep++; }; rstep = 0; while (rstep < 5) { floorr8 = new RectangleParticle(400, (250 + (rstep * 100)), 400, 10, 0, true); floorr8.setStyle(3, 3359795, 1, 11189162, 1); level8.addParticle(floorr8); rstep++; }; ba8 = new CircleParticle(200, 575, 15, false, 2); level8.addParticle(ba8); ba8.setStyle(3, 16040962, 1, 0xFFCC00, 1); APEngine.addGroup(level8); ba8.addEventListener(CollisionEvent.COLLIDE, bahitw8); } function frame18(){ addEventListener(Event.ENTER_FRAME, run9); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed9); stage.addEventListener(KeyboardEvent.KEY_UP, key_released9); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level9 = new Group(); level9.collideInternal = true; unlockedlevels.data.ulevel9 = true; unlockedlevels.flush(); instruct.instructotext.text = "Bridge the gap"; instruct.y = 50; instruct.x = 100; apiholder.addChild(instruct); levelend.levelname.text = "Level 9 Complete"; lvv9 = new RectangleParticle(-5, 155, 10, 100, 0, true); lvv9.setStyle(3, 3359795, 1, 11189162, 1); level9.addParticle(lvv9); wa9 = new WheelParticle(30, 20, 15, false, 2); level9.addParticle(wa9); wb9 = new WheelParticle(70, 20, 15, false, 2); level9.addParticle(wb9); wc9 = new SpringConstraint(wa9, wb9, 0.5, true, 10); level9.addConstraint(wc9); wa9.setStyle(3, 3359795, 1, 11189179, 1); wb9.setStyle(3, 3359795, 1, 11189179, 1); wc9.setStyle(3, 3359795, 1, 11189179, 1); ba9 = new CircleParticle(120, 10, 15, false, 2); level9.addParticle(ba9); ba9.setStyle(3, 16040962, 1, 0xFFCC00, 1); floor9 = new RectangleParticle(200, 200, 400, 10, 0, true); floor9.setStyle(3, 3359795, 1, 11189162, 1); level9.addParticle(floor9); floorv9 = new RectangleParticle(395, 245, 10, 100, 0, true); floorv9.setStyle(3, 3359795, 1, 11189162, 1); level9.addParticle(floorv9); floorb9 = new RectangleParticle(490, 300, 200, 10, 0, true); floorb9.setStyle(3, 11600129, 1, 14352898, 1); floorb9.elasticity = 1; level9.addParticle(floorb9); floora9 = new RectangleParticle(1000, 300, 400, 10, 0, true); floora9.setStyle(3, 3359795, 1, 11189162, 1); level9.addParticle(floora9); yhit9 = new RectangleParticle(1195, 0xFF, 10, 100, 0, true); yhit9.sprite.name = "y"; yhit9.setStyle(3, 16040962, 1, 0xFFCC00, 1); level9.addParticle(yhit9); APEngine.addGroup(level9); ba9.addEventListener(CollisionEvent.COLLIDE, bahitw9); } function frame19(){ addEventListener(Event.ENTER_FRAME, run10); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed10); stage.addEventListener(KeyboardEvent.KEY_UP, key_released10); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level10 = new Group(); level10.collideInternal = true; unlockedlevels.data.ulevel10 = true; unlockedlevels.flush(); instruct.instructotext.text = "Get ready to chase it"; instruct.y = 50; instruct.x = 100; apiholder.addChild(instruct); instruct2.instructotext.text = "Don't let it slip down a hole!"; instruct2.y = 270; instruct2.x = 150; apiholder.addChild(instruct2); levelend.levelname.text = "Level 10 Complete"; wa10 = new WheelParticle(30, 20, 15, false, 2); level10.addParticle(wa10); wb10 = new WheelParticle(70, 20, 15, false, 2); level10.addParticle(wb10); wc10 = new SpringConstraint(wa10, wb10, 0.5, true, 10); level10.addConstraint(wc10); wa10.setStyle(3, 3359795, 1, 11189179, 1); wb10.setStyle(3, 3359795, 1, 11189179, 1); wc10.setStyle(3, 3359795, 1, 11189179, 1); ba10 = new CircleParticle(120, 10, 5, false, 2); level10.addParticle(ba10); ba10.setStyle(3, 16040962, 1, 0xFFCC00, 1); slant10 = new RectangleParticle(617, 320, 500, 10, 0.5, true); slant10.setStyle(3, 3359795, 1, 11189162, 1); level10.addParticle(slant10); slanta10 = new RectangleParticle(617, 420, 500, 10, 0.5, true); slanta10.setStyle(3, 3359795, 1, 11189162, 1); level10.addParticle(slanta10); floor10 = new RectangleParticle(200, 200, 400, 10, 0, true); floor10.setStyle(3, 3359795, 1, 11189162, 1); level10.addParticle(floor10); floora10 = new RectangleParticle(150, 300, 500, 10, 0, true); floora10.setStyle(3, 3359795, 1, 11189162, 1); level10.addParticle(floora10); mslant10 = new RectangleParticle(1070, 335, 500, 10, -0.5, true); mslant10.setStyle(3, 3359795, 1, 11189162, 1); level10.addParticle(mslant10); yhit10 = new RectangleParticle(1340, 390, 10, 100, 0, true); yhit10.sprite.name = "y"; yhit10.setStyle(3, 16040962, 1, 0xFFCC00, 1); mslanta10 = new RectangleParticle(1100, 490, 500, 10, -0.2, true); mslanta10.setStyle(3, 3359795, 1, 11189162, 1); level10.addParticle(mslanta10); smallw10 = new RectangleParticle(395, 130, 10, 100, 0, true); smallw10.setStyle(3, 3359795, 1, 11189162, 1); level10.addParticle(smallw10); level10.addParticle(yhit10); APEngine.addGroup(level10); ba10.addEventListener(CollisionEvent.COLLIDE, bahitw10); } function frame11(){ addEventListener(Event.ENTER_FRAME, run5); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed5); stage.addEventListener(KeyboardEvent.KEY_UP, key_released5); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level5 = new Group(); yellowhit5 = new Group(); level5.collideInternal = true; bluecol = 3368618; unlockedlevels.data.ulevel2 = true; unlockedlevels.flush(); instruct.instructotext.text = "Something in your way?"; instruct.y = 50; instruct.x = 20; apiholder.addChild(instruct); instruct2.instructotext.text = "Press the DOWN key to reset"; instruct2.y = 50; instruct2.x = 720; apiholder.addChild(instruct2); levelend.levelname.text = "Level 2 Complete"; lvv5 = new RectangleParticle(-5, 155, 10, 100, 0, true); lvv5.setStyle(3, 3359795, 1, 11189162, 1); level5.addParticle(lvv5); wa5 = new WheelParticle(30, 20, 15, false, 2); level5.addParticle(wa5); wb5 = new WheelParticle(70, 20, 15, false, 2); level5.addParticle(wb5); wc5 = new SpringConstraint(wa5, wb5, 0.5, true, 10); level5.addConstraint(wc5); wa5.setStyle(3, 3359795, 1, 11189179, 1); wb5.setStyle(3, 3359795, 1, 11189179, 1); wc5.setStyle(3, 3359795, 1, 11189179, 1); ba5 = new CircleParticle(120, 10, 15, false, 2); level5.addParticle(ba5); ba5.setStyle(3, 16040962, 1, 0xFFCC00, 1); floor5 = new RectangleParticle(300, 200, 600, 10, 0, true); floor5.setStyle(3, 3359795, 1, 11189162, 1); level5.addParticle(floor5); floora5 = new RectangleParticle(900, 190, 400, 10, 0, true); floora5.setStyle(3, 3359795, 1, 11189162, 1); level5.addParticle(floora5); swingDoorP1 = new CircleParticle(610, 200, 7, true); swingDoorP1.mass = 0.001; swingDoorP1.setStyle(3, bluecol, 1, bluecol); level5.addParticle(swingDoorP1); swingDoorP2 = new CircleParticle(600, 100, 7); swingDoorP2.setStyle(3, bluecol, 1, bluecol); level5.addParticle(swingDoorP2); swingDoor = new SpringConstraint(swingDoorP1, swingDoorP2, 1, true, 13, 0.95); swingDoor.setStyle(3, bluecol, 1, bluecol); level5.addConstraint(swingDoor); swingDoorAnchor = new CircleParticle(650, 50, 2, true); swingDoorAnchor.visible = false; swingDoorAnchor.collidable = false; level5.addParticle(swingDoorAnchor); swingDoorSpring = new SpringConstraint(swingDoorP2, swingDoorAnchor, 0.2); swingDoorSpring.restLength = 100; swingDoorSpring.visible = false; level5.addConstraint(swingDoorSpring); yhit5 = new RectangleParticle(1095, 145, 10, 100, 0, true); yhit5.sprite.name = "y"; yhit5.setStyle(3, 16040962, 1, 0xFFCC00, 1); level5.addParticle(yhit5); APEngine.addGroup(level5); ba5.addEventListener(CollisionEvent.COLLIDE, bahitw5); } function frame13(){ addEventListener(Event.ENTER_FRAME, run4); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed4); stage.addEventListener(KeyboardEvent.KEY_UP, key_released4); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level4 = new Group(); yellowhit4 = new Group(); level4.collideInternal = true; unlockedlevels.data.ulevel4 = true; unlockedlevels.flush(); instruct.instructotext.text = "The two rollers"; instruct.y = 50; instruct.x = 20; apiholder.addChild(instruct); levelend.levelname.text = "Level 4 Complete"; lvv4 = new RectangleParticle(-5, 155, 10, 100, 0, true); lvv4.setStyle(3, 3359795, 1, 11189162, 1); level4.addParticle(lvv4); wa4 = new WheelParticle(30, 20, 15, false, 2); level4.addParticle(wa4); wb4 = new WheelParticle(70, 20, 15, false, 2); level4.addParticle(wb4); wc4 = new SpringConstraint(wa4, wb4, 0.5, true, 10); level4.addConstraint(wc4); wa4.setStyle(3, 3359795, 1, 11189179, 1); wb4.setStyle(3, 3359795, 1, 11189179, 1); wc4.setStyle(3, 3359795, 1, 11189179, 1); ba4 = new CircleParticle(120, 10, 15, false, 2); level4.addParticle(ba4); ba4.setStyle(3, 16040962, 1, 0xFFCC00, 1); floor4 = new RectangleParticle(300, 200, 600, 10, 0, true); floor4.setStyle(3, 3359795, 1, 11189162, 1); level4.addParticle(floor4); rh = new CircleParticle(650, -100, 5, true, 2); level4.addParticle(rh); rh.visible = false; rhh = new CircleParticle(650, 450, 5, true, 2); level4.addParticle(rhh); rhh.visible = false; tr = new WheelParticle(650, 65, 90, false, 2); level4.addParticle(tr); tr.setStyle(4, 4753864, 1, 3368618, 1); br = new WheelParticle(650, 265, 90, false, 2); level4.addParticle(br); br.setStyle(4, 4753864, 1, 3368618, 1); rl = new SpringConstraint(rh, tr, 0.5, false, 10); level4.addConstraint(rl); rl.visible = false; rla = new SpringConstraint(tr, br, 0.5, false, 10); level4.addConstraint(rla); rla.visible = false; rlb = new SpringConstraint(br, rhh, 0.5, false, 10); level4.addConstraint(rlb); rlb.visible = false; yhit4 = new RectangleParticle(790, 200, 10, 100, 0, true); yhit4.sprite.name = "y"; yhit4.setStyle(3, 16040962, 1, 0xFFCC00, 1); level4.addParticle(yhit4); APEngine.addGroup(level4); ba4.addEventListener(CollisionEvent.COLLIDE, bahitw4); } function frame16(){ addEventListener(Event.ENTER_FRAME, run7); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed7); stage.addEventListener(KeyboardEvent.KEY_UP, key_released7); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level7 = new Group(); level7.collideInternal = true; unlockedlevels.data.ulevel7 = true; unlockedlevels.flush(); instruct.instructotext.text = "5 steps to success"; instruct.y = 50; instruct.x = 20; apiholder.addChild(instruct); levelend.levelname.text = "Level 7 Complete"; lvv7 = new RectangleParticle(-5, 155, 10, 100, 0, true); lvv7.setStyle(3, 3359795, 1, 11189162, 1); level7.addParticle(lvv7); wa7 = new WheelParticle(30, 20, 15, false, 2); level7.addParticle(wa7); wb7 = new WheelParticle(70, 20, 15, false, 2); level7.addParticle(wb7); wc7 = new SpringConstraint(wa7, wb7, 0.5, true, 10); level7.addConstraint(wc7); wa7.setStyle(3, 3359795, 1, 11189179, 1); wb7.setStyle(3, 3359795, 1, 11189179, 1); wc7.setStyle(3, 3359795, 1, 11189179, 1); ba7 = new CircleParticle(120, 10, 15, false, 2); level7.addParticle(ba7); ba7.setStyle(3, 16040962, 1, 0xFFCC00, 1); floor7 = new RectangleParticle(102.5, 200, 205, 10, 0, true); floor7.setStyle(3, 3359795, 1, 11189162, 1); level7.addParticle(floor7); hstep = 0; while (hstep < 4) { floorh7 = new RectangleParticle((250 + (hstep * 100)), (300 + (hstep * 100)), 110, 10, 0, true); floorh7.setStyle(3, 3359795, 1, 11189162, 1); level7.addParticle(floorh7); hstep++; }; vstep = 0; while (vstep < 5) { floorv7 = new RectangleParticle((200 + (vstep * 100)), (250 + (vstep * 100)), 10, 110, 0, true); floorv7.setStyle(3, 3359795, 1, 11189162, 1); level7.addParticle(floorv7); vstep++; }; yhit7 = new RectangleParticle(650, 700, 100, 10, 0, true); yhit7.sprite.name = "y"; yhit7.setStyle(3, 16040962, 1, 0xFFCC00, 1); level7.addParticle(yhit7); APEngine.addGroup(level7); ba7.addEventListener(CollisionEvent.COLLIDE, bahitw7); } function frame21(){ addEventListener(Event.ENTER_FRAME, run12); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed12); stage.addEventListener(KeyboardEvent.KEY_UP, key_released12); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level12 = new Group(); level12.collideInternal = true; bg12 = new Group(); blg12 = new Group(); cg12 = new Group(); clg12 = new Group(); cg12.addCollidable(clg12); bg12.addCollidable(blg12); bg12.addCollidable(cg12); bg12.addCollidable(level12); cg12.addCollidable(level12); unlockedlevels.data.ulevel12 = true; unlockedlevels.flush(); instruct.instructotext.text = "It's a race!"; instruct.y = 0; instruct.x = 250; apiholder.addChild(instruct); levelend.levelname.text = "Level 12 Complete"; wa12 = new WheelParticle(30, 100, 15, false, 2); cg12.addParticle(wa12); wb12 = new WheelParticle(70, 100, 15, false, 2); cg12.addParticle(wb12); wc12 = new SpringConstraint(wa12, wb12, 0.5, true, 10); cg12.addConstraint(wc12); wa12.setStyle(3, 3359795, 1, 11189179, 1); wb12.setStyle(3, 3359795, 1, 11189179, 1); wc12.setStyle(3, 3359795, 1, 11189179, 1); ba12 = new CircleParticle(50, 50, 15, false, 2); bg12.addParticle(ba12); ba12.setStyle(3, 16040962, 1, 0xFFCC00, 1); lvv12 = new RectangleParticle(-5, 155, 10, 100, 0, true); lvv12.setStyle(3, 3359795, 1, 11189162, 1); clg12.addParticle(lvv12); floor12 = new RectangleParticle(50, 200, 100, 10, 0, true); floor12.setStyle(3, 3359795, 1, 11189162, 1); clg12.addParticle(floor12); floorbb12 = new RectangleParticle(100, 50, 100, 10, -0.5, true); floorbb12.setStyle(3, 7537379, 1, 5505449); blg12.addParticle(floorbb12); floorb12 = new RectangleParticle(250, 180, 500, 10, 0.5, true); floorb12.setStyle(3, 11189162, 1, 3359795, 1); blg12.addParticle(floorb12); floorc12 = new RectangleParticle(185, 152, 200, 10, -0.5, true); floorc12.setStyle(3, 3359795, 1, 11189162, 1); clg12.addParticle(floorc12); floorbc12 = new RectangleParticle(501, 176, 300, 10, 0.5, true); floorbc12.setStyle(3, 3359795, 1, 11189162, 1); clg12.addParticle(floorbc12); trig12 = new RectangleParticle(321, 104, 100, 10, 0, true); trig12.setStyle(3, 7537379, 1, 5505449); trig12.sprite.name = "trig"; clg12.addParticle(trig12); floorl12 = new RectangleParticle(600, 345, 550, 10, 0, true); floorl12.setStyle(3, 3359795, 1, 11189162, 1); level12.addParticle(floorl12); yhit12 = new RectangleParticle(330, 300, 10, 100, 0, true); yhit12.sprite.name = "y"; yhit12.setStyle(3, 16040962, 1, 0xFFCC00, 1); level12.addParticle(yhit12); APEngine.addGroup(level12); APEngine.addGroup(bg12); APEngine.addGroup(blg12); APEngine.addGroup(cg12); APEngine.addGroup(clg12); wa12.addEventListener(CollisionEvent.COLLIDE, trigfunk12); wb12.addEventListener(CollisionEvent.COLLIDE, trigfunk12); APEngine.addGroup(level12); ba12.addEventListener(CollisionEvent.COLLIDE, bahitw12); } function frame24(){ addEventListener(Event.ENTER_FRAME, run15); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed15); stage.addEventListener(KeyboardEvent.KEY_UP, key_released15); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level15 = new Group(); level15.collideInternal = true; unlockedlevels.data.ulevel15 = true; unlockedlevels.flush(); instruct.instructotext.text = "The big bouncy jump"; instruct.y = 50; instruct.x = 100; apiholder.addChild(instruct); levelend.levelname.text = "Level 15 Complete"; wa15 = new WheelParticle(30, 20, 15, false, 2); level15.addParticle(wa15); wb15 = new WheelParticle(70, 20, 15, false, 2); level15.addParticle(wb15); wc15 = new SpringConstraint(wa15, wb15, 0.5, true, 10); level15.addConstraint(wc15); wa15.setStyle(3, 3359795, 1, 11189179, 1); wb15.setStyle(3, 3359795, 1, 11189179, 1); wc15.setStyle(3, 3359795, 1, 11189179, 1); ba15 = new CircleParticle(120, 10, 15, false, 2); level15.addParticle(ba15); ba15.setStyle(3, 16040962, 1, 0xFFCC00, 1); lwall15 = new RectangleParticle(-45, 155, 10, 100, 0, true); lwall15.setStyle(3, 3359795, 1, 11189162, 1); level15.addParticle(lwall15); floor15 = new RectangleParticle(50, 200, 200, 10, 0, true); floor15.setStyle(3, 3359795, 1, 11189162, 1); level15.addParticle(floor15); bpArray15 = new Array(); bp15 = 0; while (bp15 < 10) { bh15 = new CircleParticle((157 + (bp15 * 60)), (200 + (bp15 * 5)), 5, false, 2); level15.addParticle(bh15); bh15.setStyle(0, 3368618, 1, 3368618, 1); bpArray15.push(bh15); if ((((bp15 == 0)) || ((bp15 == 9)))){ bh15.fixed = true; }; bp15++; }; spc = 0; while (spc < (bpArray15.length - 1)) { sc15 = new SpringConstraint(bpArray15[spc], bpArray15[(spc + 1)], 1.1, true, 10); level15.addConstraint(sc15); sc15.setStyle(0, 3368618, 1, 3368618, 1); if ((((spc == 0)) || ((spc == 8)))){ sc15.fixedEndLimit = 0.15; }; spc++; }; bpArraya15 = new Array(); bpa15 = 0; while (bpa15 < 10) { bha15 = new CircleParticle((900 + (bpa15 * 60)), (250 + (bpa15 * 10)), 5, false, 2); level15.addParticle(bha15); bha15.setStyle(0, 3368618, 1, 3368618, 1); bpArraya15.push(bha15); if ((((bpa15 == 0)) || ((bpa15 == 9)))){ bha15.fixed = true; }; bpa15++; }; spca = 0; while (spca < (bpArraya15.length - 1)) { sca15 = new SpringConstraint(bpArraya15[spca], bpArraya15[(spca + 1)], 1.1, true, 10); level15.addConstraint(sca15); sca15.setStyle(0, 3368618, 1, 3368618, 1); if ((((spca == 0)) || ((spca == 8)))){ sca15.fixedEndLimit = 0.15; }; spca++; }; bpArrayb15 = new Array(); bpb15 = 0; while (bpb15 < 10) { bhb15 = new CircleParticle(1650, (200 + (bpb15 * 40)), 5, false, 0.4); level15.addParticle(bhb15); bhb15.setStyle(0, 3368618, 1, 3368618, 1); bpArrayb15.push(bhb15); if ((bpb15 == 0)){ bhb15.fixed = true; }; bpb15++; }; spcb = 0; while (spcb < (bpArrayb15.length - 1)) { scb15 = new SpringConstraint(bpArrayb15[spcb], bpArrayb15[(spcb + 1)], 1, true, 10); level15.addConstraint(scb15); scb15.setStyle(0, 3368618, 1, 3368618, 1); spcb++; }; yhit15 = new RectangleParticle(1750, 550, 100, 10, 0, true); yhit15.sprite.name = "y"; yhit15.setStyle(3, 16040962, 1, 0xFFCC00, 1); level15.addParticle(yhit15); APEngine.addGroup(level15); ba15.addEventListener(CollisionEvent.COLLIDE, bahitw15); } function frame26(){ addEventListener(Event.ENTER_FRAME, run17); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed17); stage.addEventListener(KeyboardEvent.KEY_UP, key_released17); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level17 = new Group(); level17.collideInternal = true; unlockedlevels.data.ulevel17 = true; unlockedlevels.flush(); instruct.instructotext.text = "Any good at Building?"; instruct.y = 50; instruct.x = 100; apiholder.addChild(instruct); levelend.levelname.text = "Level 17 Complete"; wa17 = new WheelParticle(30, 150, 15, false, 2); level17.addParticle(wa17); wb17 = new WheelParticle(70, 150, 15, false, 2); level17.addParticle(wb17); wc17 = new SpringConstraint(wa17, wb17, 0.5, true, 10); level17.addConstraint(wc17); wa17.setStyle(3, 3359795, 1, 11189179, 1); wb17.setStyle(3, 3359795, 1, 11189179, 1); wc17.setStyle(3, 3359795, 1, 11189179, 1); ba17 = new CircleParticle(120, 180, 5, false, 2); level17.addParticle(ba17); ba17.setStyle(3, 16040962, 1, 0xFFCC00, 1); lwall17 = new RectangleParticle(150, 125, 10, 100, 0, true); lwall17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(lwall17); slant17 = new RectangleParticle(243, 225, 100, 10, 0.5, true); slant17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(slant17); slanta17 = new RectangleParticle(-43, 225, 100, 10, -0.5, true); slanta17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(slanta17); slantrc17 = new RectangleParticle(450, 300, 200, 10, -0.5, true); slantrc17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(slantrc17); slantre17 = new RectangleParticle(390, 430, 25, 10, -0.2, true); slantre17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(slantre17); slantra17 = new RectangleParticle(360, 425, 350, 10, 0.5, true); slantra17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(slantra17); slantrb17 = new RectangleParticle(670, 510, 400, 10, -0.5, true); slantrb17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(slantrb17); slantl17 = new RectangleParticle(-100, 300, 200, 10, 0.5, true); slantl17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(slantl17); slantla17 = new RectangleParticle(-25, 425, 200, 10, -0.5, true); slantla17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(slantla17); slantlb17 = new RectangleParticle(-120, 560, 200, 10, 0.5, true); slantlb17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(slantlb17); floorb17 = new RectangleParticle(200, 620, 400, 10, -0.02, true); floorb17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(floorb17); floorc17 = new RectangleParticle(475, 650, 100, 10, -0.1, true); floorc17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(floorc17); floor17 = new RectangleParticle(100, 200, 200, 10, 0, true); floor17.setStyle(3, 3359795, 1, 11189162, 1); level17.addParticle(floor17); boxl17 = new CircleParticle(300, 550, 25, false, 4, 0.3, 0.02); level17.addParticle(boxl17); boxr17 = new CircleParticle(350, 550, 25, false, 4, 0.3, 0.02); level17.addParticle(boxr17); boxm17 = new SpringConstraint(boxl17, boxr17, 0.5, true, 50); level17.addConstraint(boxm17); boxr17.setStyle(0, 3368618, 1, 3368618, 1); boxl17.setStyle(0, 3368618, 1, 3368618, 1); boxm17.setStyle(0, 3368618, 1, 3368618, 1); yhit17 = new RectangleParticle(-20, 614, 40, 10, 0.4, true); yhit17.sprite.name = "y"; yhit17.setStyle(3, 16040962, 1, 0xFFCC00, 1); level17.addParticle(yhit17); APEngine.addGroup(level17); ba17.addEventListener(CollisionEvent.COLLIDE, bahitw17); } function frame28(){ addEventListener(Event.ENTER_FRAME, run19); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed19); stage.addEventListener(KeyboardEvent.KEY_UP, key_released19); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level19 = new Group(); level19.collideInternal = true; unlockedlevels.data.ulevel19 = true; unlockedlevels.flush(); instruct.instructotext.text = "Which way to go slowly"; instruct.y = 50; instruct.x = 100; apiholder.addChild(instruct); levelend.levelname.text = "Level 19 Complete"; wa19 = new WheelParticle(130, 150, 15, false, 2); level19.addParticle(wa19); wb19 = new WheelParticle(170, 150, 15, false, 2); level19.addParticle(wb19); wc19 = new SpringConstraint(wa19, wb19, 0.5, true, 10); level19.addConstraint(wc19); wa19.setStyle(3, 3359795, 1, 11189179, 1); wb19.setStyle(3, 3359795, 1, 11189179, 1); wc19.setStyle(3, 3359795, 1, 11189179, 1); ba19 = new CircleParticle(220, 150, 15, false, 2); level19.addParticle(ba19); ba19.setStyle(3, 16040962, 1, 0xFFCC00, 1); lwall19 = new RectangleParticle(105, 160, 10, 100, 0, true); lwall19.setStyle(3, 3359795, 1, 11189162, 1); level19.addParticle(lwall19); floor19 = new RectangleParticle(200, 205, 200, 10, 0, true); floor19.setStyle(3, 3359795, 1, 11189162, 1); level19.addParticle(floor19); big19 = new CircleParticle(320, 450, 250, true, 2); big19.setStyle(3, 3359795, 1, 11189162, 1); level19.addParticle(big19); biga19 = new CircleParticle(720, 650, 250, true, 2); biga19.setStyle(3, 3359795, 1, 11189162, 1); level19.addParticle(biga19); bigb19 = new CircleParticle(1220, 850, 250, true, 2); bigb19.setStyle(3, 3359795, 1, 11189162, 1); level19.addParticle(bigb19); bigc19 = new CircleParticle(1120, 1050, 250, true, 2); bigc19.setStyle(3, 3359795, 1, 11189162, 1); level19.addParticle(bigc19); floora19 = new RectangleParticle(300, 1155, 800, 10, 0, true); floora19.setStyle(3, 3359795, 1, 11189162, 1); level19.addParticle(floora19); bigd19 = new CircleParticle(700, 1400, 250, true, 2); bigd19.setStyle(3, 3359795, 1, 11189162, 1); level19.addParticle(bigd19); bige19 = new CircleParticle(-100, 1400, 250, true, 2); bige19.setStyle(3, 3359795, 1, 11189162, 1); level19.addParticle(bige19); bigf19 = new CircleParticle(1650, 650, 250, true, 2); bigf19.setStyle(3, 3359795, 1, 11189162, 1); level19.addParticle(bigf19); yhit19 = new RectangleParticle(-100, 1200, 10, 300, 0, true); yhit19.sprite.name = "y"; yhit19.setStyle(3, 16040962, 1, 0xFFCC00, 1); level19.addParticle(yhit19); APEngine.addGroup(level19); ba19.addEventListener(CollisionEvent.COLLIDE, bahitw19); } function frame23(){ addEventListener(Event.ENTER_FRAME, run14); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed14); stage.addEventListener(KeyboardEvent.KEY_UP, key_released14); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level14 = new Group(); level14.collideInternal = true; unlockedlevels.data.ulevel14 = true; unlockedlevels.flush(); instruct.instructotext.text = "So many pegs!"; instruct.y = 50; instruct.x = 100; apiholder.addChild(instruct); levelend.levelname.text = "Level 14 Complete"; wa14 = new WheelParticle(30, 20, 15, false, 2); level14.addParticle(wa14); wb14 = new WheelParticle(70, 20, 15, false, 2); level14.addParticle(wb14); wc14 = new SpringConstraint(wa14, wb14, 0.5, true, 10); level14.addConstraint(wc14); wa14.setStyle(3, 3359795, 1, 11189179, 1); wb14.setStyle(3, 3359795, 1, 11189179, 1); wc14.setStyle(3, 3359795, 1, 11189179, 1); ba14 = new CircleParticle(120, 10, 15, false, 2); level14.addParticle(ba14); ba14.setStyle(3, 16040962, 1, 0xFFCC00, 1); lwall14 = new RectangleParticle(-45, 155, 10, 100, 0, true); lwall14.setStyle(3, 3359795, 1, 11189162, 1); level14.addParticle(lwall14); floor14 = new RectangleParticle(50, 200, 200, 10, 0, true); floor14.setStyle(3, 3359795, 1, 11189162, 1); level14.addParticle(floor14); b = 0; while (b < 10) { pol14 = new CircleParticle((150 + (b * 80)), 250, 15, true, 2); level14.addParticle(pol14); pol14.setStyle(3, 3359795, 1, 11189162, 1); b++; }; ba = 0; while (ba < 10) { pola14 = new CircleParticle((190 + (ba * 80)), 330, 15, true, 2); level14.addParticle(pola14); pola14.setStyle(3, 3359795, 1, 11189162, 1); ba++; }; bb = 0; while (bb < 10) { polb14 = new CircleParticle((150 + (bb * 80)), 410, 15, true, 2); level14.addParticle(polb14); polb14.setStyle(3, 3359795, 1, 11189162, 1); bb++; }; bc = 0; while (bc < 10) { polc14 = new CircleParticle((175 + (bc * 80)), 490, 15, true, 2); level14.addParticle(polc14); polc14.setStyle(3, 3359795, 1, 11189162, 1); bc++; }; bd = 0; while (bd < 10) { pold14 = new CircleParticle((150 + (bd * 80)), 410, 15, true, 2); level14.addParticle(pold14); pold14.setStyle(3, 3359795, 1, 11189162, 1); bd++; }; yhit14 = new RectangleParticle(550, 550, 300, 10, 0, true); yhit14.sprite.name = "y"; yhit14.setStyle(3, 16040962, 1, 0xFFCC00, 1); level14.addParticle(yhit14); floora14 = new RectangleParticle(550, 650, 2000, 10, 0, true); floora14.setStyle(3, 3359795, 1, 11189162, 1); level14.addParticle(floora14); APEngine.addGroup(level14); ba14.addEventListener(CollisionEvent.COLLIDE, bahitw14); } public function trigfunka20(_arg1:CollisionEvent):void{ var _local2:*; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "triga"){ level20.removeParticle(triggera20); }; } function frame20(){ addEventListener(Event.ENTER_FRAME, run11); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed11); stage.addEventListener(KeyboardEvent.KEY_UP, key_released11); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level11 = new Group(); level11.collideInternal = true; unlockedlevels.data.ulevel11 = true; unlockedlevels.flush(); instruct.instructotext.text = "Rock the Boat"; instruct.y = 50; instruct.x = 100; apiholder.addChild(instruct); levelend.levelname.text = "Level 11 Complete"; wa11 = new WheelParticle(30, 20, 15, false, 2); level11.addParticle(wa11); wb11 = new WheelParticle(70, 20, 15, false, 2); level11.addParticle(wb11); wc11 = new SpringConstraint(wa11, wb11, 0.5, true, 10); level11.addConstraint(wc11); wa11.setStyle(3, 3359795, 1, 11189179, 1); wb11.setStyle(3, 3359795, 1, 11189179, 1); wc11.setStyle(3, 3359795, 1, 11189179, 1); ba11 = new CircleParticle(120, 10, 15, false, 2); level11.addParticle(ba11); ba11.setStyle(3, 16040962, 1, 0xFFCC00, 1); lvv11 = new RectangleParticle(-5, 155, 10, 100, 0, true); lvv11.setStyle(3, 3359795, 1, 11189162, 1); level11.addParticle(lvv11); flooar11 = new RectangleParticle(600, 400, 400, 10, 0, true); flooar11.setStyle(3, 3359795, 1, 11189162, 1); level11.addParticle(flooar11); floor11 = new RectangleParticle(100, 200, 200, 10, 0, true); floor11.setStyle(3, 3359795, 1, 11189162, 1); level11.addParticle(floor11); tp11 = new CircleParticle(400, 400, 5, true, 2); level11.addParticle(tp11); tp11.setStyle(3, 3359795, 1, 11189162, 1); bpl11 = new CircleParticle(250, 600, 5, false, 1); level11.addParticle(bpl11); bpl11.setStyle(3, 4753864, 1, 4753864, 1); bpla11 = new CircleParticle(300, 650, 5, false, 1); level11.addParticle(bpla11); bpla11.setStyle(3, 4753864, 1, 4753864, 1); bpr11 = new CircleParticle(500, 600, 5, false, 1); level11.addParticle(bpr11); bpr11.setStyle(3, 4753864, 1, 4753864, 1); bpra11 = new CircleParticle(550, 650, 5, false, 1); level11.addParticle(bpra11); bpra11.setStyle(3, 4753864, 1, 4753864, 1); bpf11 = new CircleParticle(415, 600, 5, false, 1); level11.addParticle(bpf11); bpf11.visible = false; pa11 = new SpringConstraint(tp11, bpl11, 0.3, false, 10); level11.addConstraint(pa11); pb11 = new SpringConstraint(tp11, bpr11, 0.3, false, 10); level11.addConstraint(pb11); pc11 = new SpringConstraint(bpl11, bpr11, 0.5, false, 10); pc11.visible = false; level11.addConstraint(pc11); pd11 = new SpringConstraint(bpl11, bpla11, 1.2, true, 10); level11.addConstraint(pd11); pd11.setStyle(3, 4753864, 1, 4753864, 1); pe11 = new SpringConstraint(bpla11, bpra11, 0.5, true, 10); level11.addConstraint(pe11); pe11.setStyle(3, 4753864, 1, 4753864, 1); pf11 = new SpringConstraint(bpr11, bpra11, 1.2, true, 10); level11.addConstraint(pf11); pf11.setStyle(3, 4753864, 1, 4753864, 1); pg11 = new SpringConstraint(bpr11, bpf11, 0.5, true, 10); level11.addConstraint(pg11); pg11.sprite.name = "y"; pg11.setStyle(3, 16040962, 1, 0xFFCC00, 1); ph11 = new SpringConstraint(tp11, bpf11, 0.009, false, 10); level11.addConstraint(ph11); ph11.visible = false; pi11 = new SpringConstraint(bpl11, bpf11, 0.05, false, 10); level11.addConstraint(pi11); pi11.visible = false; APEngine.addGroup(level11); ba11.addEventListener(CollisionEvent.COLLIDE, bahitw11); } function frame29(){ addEventListener(Event.ENTER_FRAME, run20); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed20); stage.addEventListener(KeyboardEvent.KEY_UP, key_released20); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level20 = new Group(); level20.collideInternal = true; unlockedlevels.data.ulevel20 = true; unlockedlevels.flush(); instruct.instructotext.text = "chased?"; instruct.y = 50; instruct.x = 100; apiholder.addChild(instruct); levelend.levelname.text = "Level 20 Complete"; wa20 = new WheelParticle(30, 150, 15, false, 2); level20.addParticle(wa20); wb20 = new WheelParticle(70, 150, 15, false, 2); level20.addParticle(wb20); wc20 = new SpringConstraint(wa20, wb20, 0.5, true, 10); level20.addConstraint(wc20); wa20.setStyle(3, 3359795, 1, 11189179, 1); wb20.setStyle(3, 3359795, 1, 11189179, 1); wc20.setStyle(3, 3359795, 1, 11189179, 1); bold20 = new CircleParticle(-100, 50, 100, false, 30); level20.addParticle(bold20); bold20.setStyle(0, 3368618, 1, 3368618, 1); bolda20 = new CircleParticle(-80, -100, 100, false, 30); level20.addParticle(bolda20); bolda20.setStyle(0, 3368618, 1, 3368618, 1); boldb20 = new CircleParticle(-50, -300, 100, false, 30); level20.addParticle(boldb20); boldb20.setStyle(0, 3368618, 1, 3368618, 1); trig20 = new RectangleParticle(-45, 160, 10, 40, 0, true); trig20.setStyle(3, 7537379, 1, 5505449); level20.addParticle(trig20); floor20 = new RectangleParticle(50, 205, 600, 10, 0.3, true); floor20.setStyle(3, 3359795, 1, 11189162, 1); level20.addParticle(floor20); trigger20 = new RectangleParticle(55, 205, 50, 12, 0.3, true); trigger20.setStyle(3, 7537379, 1, 5505449); trigger20.sprite.name = "trig"; level20.addParticle(trigger20); floora20 = new RectangleParticle(200, 600, 1100, 10, -0.4, true); floora20.setStyle(3, 3359795, 1, 11189162, 1); level20.addParticle(floora20); floorb20 = new RectangleParticle(70, 1100, 1100, 10, 0.4, true); floorb20.setStyle(3, 3359795, 1, 11189162, 1); level20.addParticle(floorb20); triggera20 = new RectangleParticle(780, 1430, 95, 10, 0.4, true); triggera20.setStyle(3, 7537379, 1, 5505449); level20.addParticle(triggera20); floorc20 = new RectangleParticle(400, 1630, 1100, 10, -0.4, true); floorc20.setStyle(3, 3359795, 1, 11189162, 1); level20.addParticle(floorc20); triga20 = new RectangleParticle(400, 1625, 70, 10, -0.4, true); triga20.setStyle(3, 7537379, 1, 5505449); triga20.sprite.name = "triga"; level20.addParticle(triga20); ba20 = new CircleParticle(900, 1300, 60, false, 10); level20.addParticle(ba20); ba20.setStyle(3, 16040962, 1, 0xFFCC00, 1); yhit20 = new RectangleParticle(-150, 2030, 200, 10, 0.4, true); yhit20.sprite.name = "y"; yhit20.setStyle(3, 16040962, 1, 0xFFCC00, 1); level20.addParticle(yhit20); APEngine.addGroup(level20); wa20.addEventListener(CollisionEvent.COLLIDE, trigfunk20); wb20.addEventListener(CollisionEvent.COLLIDE, trigfunk20); wa20.addEventListener(CollisionEvent.COLLIDE, trigfunka20); wb20.addEventListener(CollisionEvent.COLLIDE, trigfunka20); ba20.addEventListener(CollisionEvent.COLLIDE, bahitw20); } function frame25(){ addEventListener(Event.ENTER_FRAME, run16); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed16); stage.addEventListener(KeyboardEvent.KEY_UP, key_released16); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level16 = new Group(); level16.collideInternal = true; unlockedlevels.data.ulevel16 = true; unlockedlevels.flush(); instruct.instructotext.text = "Catch the Ball"; instruct.y = 50; instruct.x = 100; apiholder.addChild(instruct); levelend.levelname.text = "Level 16 Complete"; wa16 = new WheelParticle(30, 150, 15, false, 2); level16.addParticle(wa16); wb16 = new WheelParticle(70, 150, 15, false, 2); level16.addParticle(wb16); wc16 = new SpringConstraint(wa16, wb16, 0.5, true, 10); level16.addConstraint(wc16); wa16.setStyle(3, 3359795, 1, 11189179, 1); wb16.setStyle(3, 3359795, 1, 11189179, 1); wc16.setStyle(3, 3359795, 1, 11189179, 1); ba16 = new CircleParticle(200, 50, 5, false, 2); level16.addParticle(ba16); ba16.setStyle(3, 16040962, 1, 0xFFCC00, 1); lwall16 = new RectangleParticle(-45, 155, 10, 100, 0, true); lwall16.setStyle(3, 3359795, 1, 11189162, 1); level16.addParticle(lwall16); floorb16 = new RectangleParticle(733, 182, 50, 10, -0.7, true); floorb16.setStyle(3, 3359795, 1, 11189162, 1); level16.addParticle(floorb16); floor16 = new RectangleParticle(350, 200, 800, 10, 0, true); floor16.setStyle(3, 3359795, 1, 11189162, 1); level16.addParticle(floor16); floora16 = new RectangleParticle(350, 100, 400, 10, -0.04, true); floora16.setStyle(3, 3359795, 1, 11189162, 1); level16.addParticle(floora16); rwall16 = new RectangleParticle(755, 130, 10, 150, 0, true); rwall16.setStyle(3, 3359795, 1, 11189162, 1); level16.addParticle(rwall16); yhit16 = new RectangleParticle(360, 50, 10, 100, 0, true); yhit16.sprite.name = "y"; yhit16.setStyle(3, 16040962, 1, 0xFFCC00, 1); level16.addParticle(yhit16); APEngine.addGroup(level16); ba16.addEventListener(CollisionEvent.COLLIDE, bahitw16); } function frame27(){ addEventListener(Event.ENTER_FRAME, run18); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed18); stage.addEventListener(KeyboardEvent.KEY_UP, key_released18); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level18 = new Group(); level18.collideInternal = true; unlockedlevels.data.ulevel18 = true; unlockedlevels.flush(); instruct.instructotext.text = "It's Hammertime!"; instruct.y = 50; instruct.x = 100; apiholder.addChild(instruct); levelend.levelname.text = "Level 18 Complete"; wa18 = new WheelParticle(30, 150, 15, false, 2); level18.addParticle(wa18); wb18 = new WheelParticle(70, 150, 15, false, 2); level18.addParticle(wb18); wc18 = new SpringConstraint(wa18, wb18, 0.5, true, 10); level18.addConstraint(wc18); wa18.setStyle(3, 3359795, 1, 11189179, 1); wb18.setStyle(3, 3359795, 1, 11189179, 1); wc18.setStyle(3, 3359795, 1, 11189179, 1); ba18 = new CircleParticle(860, 150, 15, false, 2); level18.addParticle(ba18); ba18.setStyle(3, 16040962, 1, 0xFFCC00, 1); ts18 = new CircleParticle(860, 10, 15, true, 2); level18.addParticle(ts18); ts18.visible = false; bs18 = new CircleParticle(1000, -50, 30, false, 70); level18.addParticle(bs18); bs18.setStyle(0, 3368618, 1, 3368618, 1); swing18 = new SpringConstraint(ts18, bs18, 0.5, true, 10); level18.addConstraint(swing18); swing18.setStyle(0, 3368618, 1, 3368618, 1); slant18 = new RectangleParticle(290, 160, 200, 10, -0.4, true); slant18.setStyle(3, 3359795, 1, 11189162, 1); level18.addParticle(slant18); slanta18 = new RectangleParticle(570, 160, 200, 10, 0.4, true); slanta18.setStyle(3, 3359795, 1, 11189162, 1); level18.addParticle(slanta18); floor18 = new RectangleParticle(100, 200, 200, 10, 0, true); floor18.setStyle(3, 3359795, 1, 11189162, 1); level18.addParticle(floor18); yhit18 = new RectangleParticle(430, 212, 100, 10, 0, true); yhit18.sprite.name = "y"; yhit18.setStyle(3, 16040962, 1, 0xFFCC00, 1); level18.addParticle(yhit18); floord18 = new RectangleParticle(761, 200, 200, 10, 0, true); floord18.setStyle(3, 7537379, 1, 5505449); floord18.sprite.name = "trig"; level18.addParticle(floord18); trig18 = new RectangleParticle(1000, 30, 100, 10, 0, true); trig18.setStyle(3, 7537379, 1, 5505449); level18.addParticle(trig18); floorb18 = new RectangleParticle(385, 167, 10, 100, 0, true); floorb18.setStyle(3, 3359795, 1, 11189162, 1); level18.addParticle(floorb18); floorc18 = new RectangleParticle(475, 167, 10, 100, 0, true); floorc18.setStyle(3, 3359795, 1, 11189162, 1); level18.addParticle(floorc18); APEngine.addGroup(level18); wa18.addEventListener(CollisionEvent.COLLIDE, trigfunk18); wb18.addEventListener(CollisionEvent.COLLIDE, trigfunk18); ba18.addEventListener(CollisionEvent.COLLIDE, bahitw18); } public function countframesu(_arg1:Event):void{ cframesu++; if (cframesu > 150){ gotoAndStop(2); stage.removeEventListener(Event.ENTER_FRAME, countframesu); }; } public function funrun(_arg1:Event):void{ ball.x = (ball.x + 7); pt.x = (ball.x - (size * 0.2)); pt.y = (ball.y - (size * 0.2)); bitmapDataLayer.copyPixels(particle, rect, pt); bitmapDataLayer.applyFilter(bitmapDataLayer, effectRect, effectPt, blurEffect); if (ball.x > 1400){ removeChild(blackS); removeChild(ttext); gotoAndStop(5); removeChild(bitmapLayer); blackS.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDowntudin); stage.removeEventListener(Event.ENTER_FRAME, funrun); }; } function frame40(){ pleasewait.visible = false; levelCompletes = true; stage.addEventListener(KeyboardEvent.KEY_DOWN, deadPress); } function frame22(){ addEventListener(Event.ENTER_FRAME, run13); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed13); stage.addEventListener(KeyboardEvent.KEY_UP, key_released13); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); level13 = new Group(); level13.collideInternal = true; unlockedlevels.data.ulevel13 = true; unlockedlevels.flush(); instruct.instructotext.text = "Hmmm, how to get across"; instruct.y = 0; instruct.x = 100; apiholder.addChild(instruct); levelend.levelname.text = "Level 13 Complete"; wa13 = new WheelParticle(30, 130, 15, false, 2); level13.addParticle(wa13); wb13 = new WheelParticle(70, 130, 15, false, 2); level13.addParticle(wb13); wc13 = new SpringConstraint(wa13, wb13, 0.5, true, 10); level13.addConstraint(wc13); wa13.setStyle(3, 3359795, 1, 11189179, 1); wb13.setStyle(3, 3359795, 1, 11189179, 1); wc13.setStyle(3, 3359795, 1, 11189179, 1); ba13 = new CircleParticle(150, 130, 15, false, 2); level13.addParticle(ba13); ba13.setStyle(3, 16040962, 1, 0xFFCC00, 1); floort13 = new RectangleParticle(-110, 157, 55, 10, 0.8, true); floort13.setStyle(3, 3359795, 1, 11189162, 1); level13.addParticle(floort13); floor13 = new RectangleParticle(50, 200, 200, 10, 0, true); floor13.setStyle(3, 3359795, 1, 11189162, 1); level13.addParticle(floor13); floora13 = new RectangleParticle(-90, 177, 100, 10, 0.5, true); floora13.setStyle(3, 3359795, 1, 11189162, 1); level13.addParticle(floora13); floorb13 = new RectangleParticle(-132, 108, 10, 100, 0, true); floorb13.setStyle(3, 3359795, 1, 11189162, 1); level13.addParticle(floorb13); trig13 = new RectangleParticle(1045, 75, 10, 100, 0, true); trig13.setStyle(3, 7537379, 1, 5505449); trig13.sprite.name = "trig"; level13.addParticle(trig13); floorc13 = new RectangleParticle(500, 120, 1100, 10, 0, true); floorc13.setStyle(3, 3359795, 1, 11189162, 1); level13.addParticle(floorc13); yhit13 = new RectangleParticle(1045, 165, 10, 80, 0, true); yhit13.sprite.name = "y"; yhit13.setStyle(3, 16040962, 1, 0xFFCC00, 1); level13.addParticle(yhit13); floord13 = new RectangleParticle(250, 200, 100, 10, 0, true); floord13.setStyle(3, 3359795, 1, 11189162, 1); level13.addParticle(floord13); floore13 = new RectangleParticle(400, 200, 100, 10, 0, true); floore13.setStyle(3, 3359795, 1, 11189162, 1); level13.addParticle(floore13); floorf13 = new RectangleParticle(550, 200, 100, 10, 0, true); floorf13.setStyle(3, 3359795, 1, 11189162, 1); level13.addParticle(floorf13); floorg13 = new RectangleParticle(700, 200, 100, 10, 0, true); floorg13.setStyle(3, 3359795, 1, 11189162, 1); level13.addParticle(floorg13); floorh13 = new RectangleParticle(850, 200, 100, 10, 0, true); floorh13.setStyle(3, 3359795, 1, 11189162, 1); level13.addParticle(floorh13); floori13 = new RectangleParticle(1000, 200, 100, 10, 0, true); floori13.setStyle(3, 3359795, 1, 11189162, 1); level13.addParticle(floori13); floorj13 = new RectangleParticle(500, 200, 1100, 10, 0, true); floorj13.setStyle(3, 3359795, 1, 11189162, 1); APEngine.addGroup(level13); wa13.addEventListener(CollisionEvent.COLLIDE, trigfunk13); wb13.addEventListener(CollisionEvent.COLLIDE, trigfunk13); ba13.addEventListener(CollisionEvent.COLLIDE, bahitw13); } public function donothing(_arg1:Event):void{ } public function clearsave(_arg1:Event):void{ highestScore.clear(); unlockedlevels.clear(); } public function run10(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa10.px + wb10.px) / 2)) + 275); APEngine.container.y = (-(((wa10.py + wb10.py) / 2)) + 200); }; } public function run13(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa13.px + wb13.px) / 2)) + 275); APEngine.container.y = (-(((wa13.py + wb13.py) / 2)) + 200); }; } public function run14(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa14.px + wb14.px) / 2)) + 275); APEngine.container.y = (-(((wa14.py + wb14.py) / 2)) + 200); }; } public function run15(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa15.px + wb15.px) / 2)) + 275); APEngine.container.y = (-(((wa15.py + wb15.py) / 2)) + 200); }; } public function key_released10(_arg1:KeyboardEvent):void{ wa10.angularVelocity = 0; wb10.angularVelocity = 0; } public function key_released11(_arg1:KeyboardEvent):void{ wa11.angularVelocity = 0; wb11.angularVelocity = 0; } public function key_released12(_arg1:KeyboardEvent):void{ wa12.angularVelocity = 0; wb12.angularVelocity = 0; } public function key_released13(_arg1:KeyboardEvent):void{ wa13.angularVelocity = 0; wb13.angularVelocity = 0; } public function key_released15(_arg1:KeyboardEvent):void{ wa15.angularVelocity = 0; wb15.angularVelocity = 0; } public function key_released16(_arg1:KeyboardEvent):void{ wa16.angularVelocity = 0; wb16.angularVelocity = 0; } public function run11(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa11.px + wb11.px) / 2)) + 275); APEngine.container.y = (-(((wa11.py + wb11.py) / 2)) + 200); }; } public function run12(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa12.px + wb12.px) / 2)) + 275); APEngine.container.y = (-(((wa12.py + wb12.py) / 2)) + 200); }; } public function key_released19(_arg1:KeyboardEvent):void{ wa19.angularVelocity = 0; wb19.angularVelocity = 0; } public function key_released14(_arg1:KeyboardEvent):void{ wa14.angularVelocity = 0; wb14.angularVelocity = 0; } public function run17(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa17.px + wb17.px) / 2)) + 275); APEngine.container.y = (-(((wa17.py + wb17.py) / 2)) + 200); }; } public function run20(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa20.px + wb20.px) / 2)) + 275); APEngine.container.y = (-(((wa20.py + wb20.py) / 2)) + 200); }; } public function key_released18(_arg1:KeyboardEvent):void{ wa18.angularVelocity = 0; wb18.angularVelocity = 0; } public function key_released17(_arg1:KeyboardEvent):void{ wa17.angularVelocity = 0; wb17.angularVelocity = 0; } public function run16(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa16.px + wb16.px) / 2)) + 275); APEngine.container.y = (-(((wa16.py + wb16.py) / 2)) + 200); }; } public function run18(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa18.px + wb18.px) / 2)) + 275); APEngine.container.y = (-(((wa18.py + wb18.py) / 2)) + 200); }; } public function run19(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa19.px + wb19.px) / 2)) + 275); APEngine.container.y = (-(((wa19.py + wb19.py) / 2)) + 200); }; } public function key_released20(_arg1:KeyboardEvent):void{ wa20.angularVelocity = 0; wb20.angularVelocity = 0; } public function key_pressed(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (yourDead == true){ removeChild(dead); } else { if (practise == true){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; } else { if (cheatSpace < 4){ if (quitgameshow == false){ minuteTimer.stop(); mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; cheatSpace++; minuteTimer.start(); removeChild(quitgame); quitgameshow = false; }; }; }; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa1.px = 30; wa1.py = 20; wb1.px = 70; wb1.py = 20; ba1.px = 120; ba1.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa1.angularVelocity = 0.6; wb1.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa1.angularVelocity = -0.6; wb1.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ menulev = true; if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level1); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, runx); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released); }; if (levelCompletes == true){ APEngine.removeGroup(level1); if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; removeChild(levelend); removeEventListener(Event.ENTER_FRAME, runx); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released); go = true; levelCompletes = false; nextFrame(); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function LeaderBoardClosed(){ channel.stop(); gotoAndStop(5); } public function onTimerComplete(_arg1:TimerEvent):void{ if (livesLost > (lvmArray.length - 1)){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); addChild(dead); dead.finalScore.text = (" Your final score is " + oscore); th.removeChild(timeText); removeChild(th); APEngine.removeGroup(level1); yourdead = true; removeEventListener(Event.ENTER_FRAME, runx); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released); removeEventListener(Event.ENTER_FRAME, run2); removeEventListener(Event.ENTER_FRAME, run3); removeEventListener(Event.ENTER_FRAME, run4); removeEventListener(Event.ENTER_FRAME, run5); removeEventListener(Event.ENTER_FRAME, run6); removeEventListener(Event.ENTER_FRAME, run7); removeEventListener(Event.ENTER_FRAME, run8); removeEventListener(Event.ENTER_FRAME, run9); removeEventListener(Event.ENTER_FRAME, run10); removeEventListener(Event.ENTER_FRAME, run11); removeEventListener(Event.ENTER_FRAME, run12); removeEventListener(Event.ENTER_FRAME, run13); removeEventListener(Event.ENTER_FRAME, run14); removeEventListener(Event.ENTER_FRAME, run15); removeEventListener(Event.ENTER_FRAME, run16); removeEventListener(Event.ENTER_FRAME, run17); removeEventListener(Event.ENTER_FRAME, run18); removeEventListener(Event.ENTER_FRAME, run19); removeEventListener(Event.ENTER_FRAME, run20); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed2); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed3); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed4); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed5); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed6); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed7); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed8); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed9); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed10); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed11); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed12); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed13); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed14); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed15); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed16); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed17); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed18); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed19); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed20); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released2); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released3); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released4); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released5); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released6); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released7); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released8); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released9); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released10); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released11); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released12); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released13); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released14); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released15); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released16); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released17); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released18); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released19); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_released20); gotoAndStop(40); } else { livesLost++; th.removeChild(lvmArray[(livesLost - 1)]); minuteTimer.reset(); minuteTimer.start(); }; } public function bahitw(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); addChild(levelend); if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; _local4 = 1; while (_local4 < 20) { frag(ba1.px, ba1.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; go = false; levelCompletes = true; level1.removeParticle(ba1); }; } public function truckhitm(_arg1:CollisionEvent):void{ var _local2:*; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "Helpcol"){ touchhelp = true; htext.filters = new Array(Glowm); } else { touchhelp = false; htext.filters = null; }; if (_local2 == "Playcol"){ touchplay = true; ptext.filters = new Array(Glowm); } else { touchplay = false; ptext.filters = null; }; if (_local2 == "creditcol"){ touchcred = true; credtext.filters = new Array(Glowm); } else { touchcred = false; credtext.filters = null; }; if (_local2 == "sitecol"){ touchsite = true; sitetextm.filters = new Array(Glowm); } else { touchsite = false; sitetextm.filters = null; }; if (_local2 == "LevSelcol"){ touchlev = true; lseltext.filters = new Array(Glowm); } else { touchlev = false; lseltext.filters = null; }; } public function onTick(_arg1:TimerEvent):void{ timeText.text = (origtime + -(_arg1.target.currentCount)); timeText.setTextFormat(timeTextformat); } public function onComplete(_arg1:Event):void{ } function frame5(){ stage.frameRate = 30; addEventListener(Event.ENTER_FRAME, runy); stop(); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressedm); stage.addEventListener(KeyboardEvent.KEY_UP, key_releasedm); APEngine.init((1 / 3)); APEngine.container = apiholder; APEngine.addForce(new VectorForce(false, 0, 2)); menulevel = new Group(); menulevel.collideInternal = true; hidehit = new MovieClip(); hidehit.graphics.lineStyle(2, 0); hidehit.graphics.drawCircle(0, 0, 5); hidehit.visible = false; addChild(hidehit); instruct = new instructotextholder(); instruct.y = 50; instruct.x = 20; instruct2 = new instructotextholder(); instruct.y = 50; instruct.x = 20; quitgame = new quitscreen(); quitgame.y = 200; quitgame.x = 275; SWtext = new SteerText(); SWtext.x = 275; SWtext.y = 130; apiholder.addChild(SWtext); mute = false; smute = false; menulev = true; mutem = new mutesym(); mutem.x = 242.4; mutem.y = 159; stage.addEventListener(Event.ENTER_FRAME, checkpause); stage.addEventListener(KeyboardEvent.KEY_DOWN, mutesound); bsound = new boing(); vol = 0.8; music = new theme(); volc = new SoundTransform(vol); channel = music.play(0, 999, volc); pausePosition = channel.position; spacego = false; helpysave = ("ulevel" + zxc); mpause = false; go = true; cheatSpace = 0; Glowm = new GlowFilter(0xFFFFFF, 0.8, 16, 16, 8, 3, false, false); touchhelp = false; touchplay = false; touchcred = false; touchlev = false; touchsite = false; helpscreenh = false; creditscreenh = false; modeselectplay = false; ngrscreenh = false; nolevelscreen = false; selectleft = false; selectright = false; levelCompletes = false; quitgameshow = false; highestScore = SharedObject.getLocal("SteerWheelsHighScore"); if (highestScore.size == 0){ SWtext.highScoreBack.text = "No Score Data Found"; highestScore.data.localHighScore = 0; highestScore.flush(); } else { SWtext.highScoreBack.text = ("Your High Score is " + highestScore.data.localHighScore); }; unlockedlevels = SharedObject.getLocal("SteerWheelsLevels"); ulevelholder = new Array(); if (unlockedlevels.size == 0){ ulevel1 = false; ulevel2 = false; ulevel3 = false; ulevel4 = false; ulevel5 = false; ulevel6 = false; ulevel7 = false; ulevel8 = false; ulevel9 = false; ulevel10 = false; ulevel11 = false; ulevel12 = false; ulevel13 = false; ulevel14 = false; ulevel15 = false; ulevel16 = false; ulevel17 = false; ulevel18 = false; ulevel19 = false; ulevel20 = false; unlockedlevels.data.ulevel1 = false; unlockedlevels.data.ulevel2 = false; unlockedlevels.data.ulevel3 = false; unlockedlevels.data.ulevel4 = false; unlockedlevels.data.ulevel6 = false; unlockedlevels.data.ulevel7 = false; unlockedlevels.data.ulevel8 = false; unlockedlevels.data.ulevel9 = false; unlockedlevels.data.ulevel10 = false; unlockedlevels.data.ulevel11 = false; unlockedlevels.data.ulevel12 = false; unlockedlevels.data.ulevel13 = false; unlockedlevels.data.ulevel14 = false; unlockedlevels.data.ulevel15 = false; unlockedlevels.data.ulevel16 = false; unlockedlevels.data.ulevel17 = false; unlockedlevels.data.ulevel18 = false; unlockedlevels.data.ulevel19 = false; unlockedlevels.data.ulevel20 = false; }; textformat = new TextFormat(); textformat.color = 4813692; textformat.font = "Arial"; textformat.size = 30; ulsholder = new Array(); uls = 1; while (uls < 21) { ulevelt1 = new TextField(); ulevelt1.x = 350; ulevelt1.y = 380; ulevelt1.width = 50; ulevelt1.text = ("" + uls); ulevelt1.setTextFormat(textformat); ulevelt1.selectable = false; ulsholder.push(ulevelt1); uls++; }; ulsholder[1].x = 300; ulsholder[1].y = 395; ulsholder[2].x = 250; ulsholder[2].y = 410; ulsholder[3].x = 200; ulsholder[3].y = 425; ulsholder[4].x = 150; ulsholder[4].y = 440; ulsholder[5].x = 100; ulsholder[5].y = 455; ulsholder[6].x = 50; ulsholder[6].y = 470; ulsholder[7].x = 100; ulsholder[7].y = 535; ulsholder[8].x = 150; ulsholder[8].y = 550; ulsholder[9].x = 200; ulsholder[9].y = 565; ulsholder[10].x = 250; ulsholder[10].y = 580; ulsholder[11].x = 300; ulsholder[11].y = 595; ulsholder[12].x = 350; ulsholder[12].y = 610; ulsholder[13].x = 400; ulsholder[13].y = 625; ulsholder[14].x = 500; ulsholder[14].y = 700; ulsholder[15].x = 450; ulsholder[15].y = 715; ulsholder[16].x = 400; ulsholder[16].y = 730; ulsholder[17].x = 350; ulsholder[17].y = 745; ulsholder[18].x = 300; ulsholder[18].y = 760; ulsholder[19].x = 250; ulsholder[19].y = 775; help = new helpscreen(); help.x = 82.8; help.y = 59; noul = new nolevels(); noul.x = 275; noul.y = 200; creds = new creditsscreen(); creds.x = 82.8; creds.y = 59; playmode = new modeselect(); playmode.x = 265.9; playmode.y = 383; levelend = new levelcomplete(); pausesc = new pausescreen(); pausesc.x = 275; pausesc.y = 200; lead = false; boings = false; lvm = new RectangleParticle(-20, 200, 20, 3000, 0, true); menulevel.addParticle(lvm); lvm.visible = false; rvm = new RectangleParticle(570, 200, 20, 3000, 0, true); menulevel.addParticle(rvm); rvm.visible = false; wam = new WheelParticle(10, 20, 15, false, 2); menulevel.addParticle(wam); wbm = new WheelParticle(50, 20, 15, false, 2); menulevel.addParticle(wbm); wcm = new SpringConstraint(wam, wbm, 0.5, true, 10); menulevel.addConstraint(wcm); wam.setStyle(3, 3359795, 1, 11189179, 1); wbm.setStyle(3, 3359795, 1, 11189179, 1); wcm.setStyle(3, 3359795, 1, 11189179, 1); floorm = new RectangleParticle(250, 320, 500, 10, 0, true); menulevel.addParticle(floorm); floorm.setStyle(3, 3359795, 1, 11189162, 1); floorslant = new RectangleParticle(310, 440, 520, 10, -0.3, true); menulevel.addParticle(floorslant); floorslant.setStyle(3, 3359795, 1, 11189162, 1); floorslant.visible = false; floorslant2 = new RectangleParticle(200, 610, 540, 10, 0.3, true); menulevel.addParticle(floorslant2); floorslant2.setStyle(3, 3359795, 1, 11189162, 1); floorslant3 = new RectangleParticle(310, 810, 700, 10, -0.3, true); menulevel.addParticle(floorslant3); floorslant3.setStyle(3, 3359795, 1, 11189162, 1); helpm = new RectangleParticle(275, 310, 50, 10, 0, true); menulevel.addParticle(helpm); helpm.setStyle(3, 3359795, 1, 0xFFCC00, 1); helpm.sprite.name = "Helpcol"; htext = new helptext(); htext.x = 275; htext.y = 350; apiholder.addChild(htext); playm = new RectangleParticle(25, 310, 50, 10, 0, true); menulevel.addParticle(playm); playm.setStyle(3, 3359795, 1, 0xFFCC00, 1); playm.sprite.name = "Playcol"; ptext = new playtext(); ptext.x = 25; ptext.y = 350; apiholder.addChild(ptext); levelsm = new RectangleParticle(525, 310, 50, 10, 0, true); menulevel.addParticle(levelsm); levelsm.setStyle(3, 3359795, 1, 0xFFCC00, 1); levelsm.sprite.name = "LevSelcol"; lseltext = new levelselect(); lseltext.x = 525; lseltext.y = 340; apiholder.addChild(lseltext); creditsm = new RectangleParticle(150, 310, 50, 10, 0, true); menulevel.addParticle(creditsm); creditsm.setStyle(3, 3359795, 1, 0xFFCC00, 1); creditsm.sprite.name = "creditcol"; credtext = new creditstext(); credtext.x = 150; credtext.y = 350; apiholder.addChild(credtext); webm = new RectangleParticle(400, 310, 50, 10, 0, true); menulevel.addParticle(webm); webm.setStyle(3, 3359795, 1, 0xFFCC00, 1); webm.sprite.name = "sitecol"; sitetextm = new sitetext(); sitetextm.x = 400; sitetextm.y = 350; apiholder.addChild(sitetextm); APEngine.addGroup(menulevel); APEngine.container.x = 0; APEngine.container.y = 0; wam.addEventListener(CollisionEvent.COLLIDE, truckhitm); wbm.addEventListener(CollisionEvent.COLLIDE, truckhitm); lcl = 0; randxf = (Math.random() * 550); randyf = (Math.random() * 400); stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed_shift); } function frame1(){ stop(); this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress); this.loaderInfo.addEventListener(Event.COMPLETE, onComplete); cframesu = 0; if (planu > 0){ stage.addEventListener(Event.ENTER_FRAME, countframesu); }; stage.frameRate = 30; _mochiads_game_id = "d502336e3cc68fcb"; MochiServices.connect("d502336e3cc68fcb", root); MochiBot.track(this, "916f235e"); tudmenu = new ContextMenu(); tudmenu.hideBuiltInItems(); tudmenuitem1 = new ContextMenuItem("Made by tudway"); tudmenuitem2 = new ContextMenuItem("Sponsored by www.ugoplayer.com"); tudmenuitem3 = new ContextMenuItem("-----"); tudmenuitem4 = new ContextMenuItem("clear saved game files?"); tudmenuitem4.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, clearsave); tudmenuitem3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, donothing); tudmenuitem2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, sponsorsite); tudmenuitem1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, tudsite); tudmenu.customItems.push(tudmenuitem1); tudmenu.customItems.push(tudmenuitem2); tudmenu.customItems.push(tudmenuitem3); tudmenu.customItems.push(tudmenuitem4); this.contextMenu = tudmenu; } function frame2(){ stage.frameRate = 30; stage.addEventListener(Event.ENTER_FRAME, funrun); blackS = new MovieClip(); blackS.graphics.beginFill(0); blackS.graphics.drawRect(0, 0, 550, 400); addChild(blackS); blackS.addEventListener(MouseEvent.MOUSE_DOWN, mouseDowntudin); urltudin = "http://www.tudway-experimental.com"; requesttudin = new URLRequest(urltudin); tudinmusic = new tudsynth(); volctudin = new SoundTransform(0.5); channeltudin = tudinmusic.play(0, 1, volctudin); size = 30; blurAmount = 10; blurEffect = new BlurFilter(blurAmount, blurAmount, 1); pt = new Point(); rect = new Rectangle(0, 0, 100, 100); effectRect = new Rectangle(0, 0, 550, 400); effectPt = new Point(0, 0); bitmapDataLayer = new BitmapData(550, 400, true, 0xFFCC00); bitmapLayer = new Bitmap(bitmapDataLayer); addChild(bitmapLayer); ball = new Shape(); ball.graphics.beginFill(0xFFFFFF, 0.4); ball.graphics.drawCircle(0, 0, 10); ball.x = -50; ball.y = 175; addChild(ball); ball.visible = false; myCircle = new Shape(); myCircle.graphics.beginFill((Math.random() * 0xFFFFFF)); myCircle.graphics.drawCircle((size * 0.2), (size * 0.2), 60); particle = new BitmapData(100, 100, true, 0xFF0000); particle.draw(myCircle); ttext = new tudText(); ttext.x = 275; ttext.y = 200; addChild(ttext); } public function bahitw2(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba2.px, ba2.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level2.removeParticle(ba2); }; } public function bahitw3(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba3.px, ba3.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level3.removeParticle(ba3); }; } public function bahitw4(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba4.px, ba4.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level4.removeParticle(ba4); }; } public function bahitw5(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba5.px, ba5.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level5.removeParticle(ba5); }; } public function bahitw6(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba6.px, ba6.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level6.removeParticle(ba6); }; } public function bahitw8(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba8.px, ba8.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level8.removeParticle(ba8); }; } public function bahitw9(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba9.px, ba9.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level9.removeParticle(ba9); }; } public function bahitw7(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba7.px, ba7.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level7.removeParticle(ba7); }; } public function key_released2(_arg1:KeyboardEvent):void{ wa2.angularVelocity = 0; wb2.angularVelocity = 0; } public function key_released4(_arg1:KeyboardEvent):void{ wa4.angularVelocity = 0; wb4.angularVelocity = 0; } public function key_released5(_arg1:KeyboardEvent):void{ wa5.angularVelocity = 0; wb5.angularVelocity = 0; } public function key_released6(_arg1:KeyboardEvent):void{ wa6.angularVelocity = 0; wb6.angularVelocity = 0; } public function key_released7(_arg1:KeyboardEvent):void{ wa7.angularVelocity = 0; wb7.angularVelocity = 0; } public function key_released8(_arg1:KeyboardEvent):void{ wa8.angularVelocity = 0; wb8.angularVelocity = 0; } public function key_released9(_arg1:KeyboardEvent):void{ wa9.angularVelocity = 0; wb9.angularVelocity = 0; } public function key_released3(_arg1:KeyboardEvent):void{ wa3.angularVelocity = 0; wb3.angularVelocity = 0; } public function key_releasedm(_arg1:KeyboardEvent):void{ wam.angularVelocity = 0; wbm.angularVelocity = 0; selectright = false; selectleft = false; if (modeselectplay == true){ playmode.practice.filters = null; playmode.timetrial.filters = null; }; } public function trigfunk12(_arg1:CollisionEvent):void{ var _local2:*; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "trig"){ blg12.removeParticle(floorbb12); }; } public function trigfunk18(_arg1:CollisionEvent):void{ var _local2:*; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "trig"){ level18.removeParticle(trig18); }; } public function trigfunk13(_arg1:CollisionEvent):void{ var _local2:*; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "trig"){ level13.addParticle(floorj13); }; } public function onProgress(_arg1:ProgressEvent):void{ var loaded:Number; var total:Number; var pct:Number; var xv:Number; var yv:Number; var particle:BitmapData; var bitmapDataLayer:BitmapData; var rect:Rectangle; var effectRect:Rectangle; var effectPt:Point; var pt:Point; var blurEffect:BlurFilter; var size:int; var blurAmount:int; var bitmapLayer:Bitmap; var myCircle:Shape; var run:Function; var e = _arg1; run = function (_arg1:Event):void{ xv = (xv + (2 * pct)); pt.x = xv; pt.y = yv; bitmapDataLayer.copyPixels(particle, rect, pt); bitmapDataLayer.applyFilter(bitmapDataLayer, effectRect, effectPt, blurEffect); if (xv > 375){ stage.removeEventListener(Event.ENTER_FRAME, run); particle = null; myCircle = null; removeChild(bitmapLayer); stage.addEventListener(Event.ENTER_FRAME, countframesu); }; }; loaded = e.target.bytesLoaded; total = e.target.bytesTotal; pct = (loaded / total); xv = 175; yv = 360; size = 30; blurAmount = 10; blurEffect = new BlurFilter(blurAmount, blurAmount, 1); pt = new Point(); rect = new Rectangle(0, 0, (size * 0.5), (size * 0.5)); effectRect = new Rectangle(0, 0, 550, 400); effectPt = new Point(0, 0); bitmapDataLayer = new BitmapData(550, 400, true, 0xFFCC00); bitmapLayer = new Bitmap(bitmapDataLayer); addChild(bitmapLayer); myCircle = new Shape(); myCircle.graphics.beginFill((Math.random() * 0xFFFFFF)); myCircle.graphics.drawCircle((size * 0.2), (size * 0.2), size); particle = new BitmapData((size * 0.5), (size * 0.5), true, 0xFF0000); particle.draw(myCircle); stage.addEventListener(Event.ENTER_FRAME, run); } public function trigfunk20(_arg1:CollisionEvent):void{ var _local2:*; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "trig"){ level20.removeParticle(trig20); }; } public function sponsorsite(_arg1:ContextMenuEvent):void{ var _local2:String; var _local3:URLRequest; _local2 = "http://secure-us.imrworldwide.com/cgi-bin/b?cg=ugoplayer_flash_games&ci=us-ugclicks&tu=http://www.ugoplayer.com"; _local3 = new URLRequest(_local2); navigateToURL(_local3, "_blank"); } public function bahitw10(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); apiholder.removeChild(instruct2); _local4 = 1; while (_local4 < 20) { frag(ba10.px, ba10.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level10.removeParticle(ba10); }; } public function bahitw12(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); wa12.removeEventListener(CollisionEvent.COLLIDE, trigfunk12); wb12.removeEventListener(CollisionEvent.COLLIDE, trigfunk12); ba12.removeEventListener(CollisionEvent.COLLIDE, bahitw12); _local4 = 1; while (_local4 < 20) { frag(ba12.px, ba12.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; bg12.removeParticle(ba12); }; } public function bahitw14(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba14.px, ba14.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level14.removeParticle(ba14); }; } public function bahitw15(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba15.px, ba15.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level15.removeParticle(ba15); }; } public function bahitw19(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba19.px, ba19.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level19.removeParticle(ba19); }; } public function bahitw13(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba13.px, ba13.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level13.removeParticle(ba13); }; } public function bahitw18(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba18.px, ba18.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level18.removeParticle(ba18); }; } public function bahitw17(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba17.px, ba17.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level17.removeParticle(ba17); }; } public function bahitw11(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba11.px, ba11.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level11.removeParticle(ba11); }; } public function bahitw20(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba20.px, ba20.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level20.removeParticle(ba20); }; } public function bahitw16(_arg1:CollisionEvent):void{ var _local2:*; var _local3:SoundChannel; var _local4:int; _local2 = _arg1.collidingItem.sprite.name; if (_local2 == "y"){ _local3 = bsound.play(0, 1); _local4 = 1; while (_local4 < 20) { frag(ba16.px, ba16.py, apiholder, (Math.random() * 0xFFFFFF)); _local4++; }; if (practise == false){ cheatSpace = 0; minuteTimer.stop(); levelend.leveltime.text = ("Seconds Left = " + timeText.text); lscore = timeText.text; levelend.levelscore.text = ("Level Score = " + (lscore * 100)); oscore = (oscore + (lscore * 100)); levelend.overscore.text = ("Overall Score = " + oscore); if (oscore > highestScore.data.localHighScore){ highestScore.data.localHighScore = oscore; highestScore.flush(); }; }; go = false; addChild(levelend); levelCompletes = true; level16.removeParticle(ba16); }; } public function checkpause(_arg1:Event):void{ if ((((((go == true)) && ((smute == false)))) && ((menulev == false)))){ if (mpause == true){ SoundMixer.soundTransform = new SoundTransform(0, 0); mute = true; } else { SoundMixer.soundTransform = new SoundTransform(0.8, 0); mute = false; }; }; } public function frag(_arg1:Number, _arg2:Number, _arg3:MovieClip, _arg4:Number):void{ var gravity:Number; var p:MovieClip; var pvelocity:*; var xveloc:Number; var yveloc:Number; var fragrun:Function; var startx = _arg1; var starty = _arg2; var cont = _arg3; var colourf = _arg4; fragrun = function (_arg1:Event){ cont.addChild(p); p.x = (p.x + xveloc); p.y = (p.y + pvelocity); p.y = (p.y - yveloc); pvelocity = (pvelocity + gravity); p.alpha = (p.alpha - 0.01); if (p.alpha < 0.001){ cont.removeChild(p); }; }; gravity = 0.2; p = new MovieClip(); pvelocity = 0; p.graphics.lineStyle(2, colourf); p.graphics.drawCircle(0, 0, 7); p.x = startx; p.y = starty; xveloc = (2 - (Math.random() * 4)); yveloc = (Math.random() * 10); p.addEventListener(Event.ENTER_FRAME, fragrun); } public function key_pressed2(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa2.px = 30; wa2.py = 20; wb2.px = 70; wb2.py = 20; ba2.px = 120; ba2.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa2.angularVelocity = 0.6; wb2.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa2.angularVelocity = -0.6; wb2.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level2); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run2); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed2); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released2); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level2); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run2); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed2); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released2); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed4(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa4.px = 30; wa4.py = 20; wb4.px = 70; wb4.py = 20; ba4.px = 120; ba4.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa4.angularVelocity = 0.6; wb4.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa4.angularVelocity = -0.6; wb4.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level4); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run4); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed4); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released4); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level4); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run4); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed4); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released4); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed5(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa5.px = 30; wa5.py = 20; wb5.px = 70; wb5.py = 20; ba5.px = 120; ba5.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa5.angularVelocity = 0.6; wb5.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa5.angularVelocity = -0.6; wb5.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level5); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run5); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed5); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released5); }; if (levelCompletes == true){ APEngine.removeGroup(level5); removeChild(levelend); if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run5); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed5); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released5); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed6(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa6.px = 30; wa6.py = 20; wb6.px = 70; wb6.py = 20; ba6.px = 120; ba6.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa6.angularVelocity = 0.6; wb6.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa6.angularVelocity = -0.6; wb6.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level6); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run6); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed6); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released6); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level6); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run6); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed6); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released6); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed7(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa7.px = 30; wa7.py = 20; wb7.px = 70; wb7.py = 20; ba7.px = 120; ba7.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa7.angularVelocity = 0.6; wb7.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa7.angularVelocity = -0.6; wb7.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level7); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run7); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed7); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released7); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level7); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run7); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed7); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released7); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed9(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa9.px = 30; wa9.py = 20; wb9.px = 70; wb9.py = 20; ba9.px = 120; ba9.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa9.angularVelocity = 0.6; wb9.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa9.angularVelocity = -0.6; wb9.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level9); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run9); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed9); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released9); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level9); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run9); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed9); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released9); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed3(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa3.px = 30; wa3.py = 20; wb3.px = 70; wb3.py = 20; ba3.px = 120; ba3.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa3.angularVelocity = 0.6; wb3.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa3.angularVelocity = -0.6; wb3.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level3); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run3); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed3); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released3); }; if (levelCompletes == true){ APEngine.removeGroup(level3); removeChild(levelend); apiholder.removeChild(instruct2); if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run3); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed3); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released3); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed8(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa8.px = 30; wa8.py = 20; wb8.px = 70; wb8.py = 20; ba8.px = 200; ba8.py = 575; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa8.angularVelocity = 0.6; wb8.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa8.angularVelocity = -0.6; wb8.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level8); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run8); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed8); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released8); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level8); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run8); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed8); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released8); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function deadPress(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.SPACE){ planu++; removeChild(dead); MochiScores.showLeaderboard({boardID:"e0cc63f1a0f06579", score:oscore, onClose:LeaderBoardClosed}); pleasewait.visible = true; stage.removeEventListener(Event.ENTER_FRAME, checkpause); stage.removeEventListener(KeyboardEvent.KEY_DOWN, deadPress); }; if (_arg1.keyCode == 77){ planu++; removeChild(dead); gotoAndStop(5); stage.removeEventListener(Event.ENTER_FRAME, checkpause); channel.stop(); stage.removeEventListener(KeyboardEvent.KEY_DOWN, deadPress); }; } public function key_pressedm(_arg1:KeyboardEvent):void{ var _local2:SoundChannel; var _local3:SoundChannel; var _local4:SoundChannel; var _local5:SoundChannel; var _local6:SoundChannel; var _local7:SoundChannel; var _local8:SoundChannel; var _local9:String; var _local10:URLRequest; if (_arg1.keyCode == Keyboard.RIGHT){ wam.angularVelocity = 0.6; wbm.angularVelocity = 0.6; if (modeselectplay == true){ playmode.timetrial.filters = new Array(Glowm); selectleft = false; selectright = true; }; }; if (_arg1.keyCode == Keyboard.LEFT){ wam.angularVelocity = -0.6; wbm.angularVelocity = -0.6; if (modeselectplay == true){ playmode.practice.filters = new Array(Glowm); selectleft = true; selectright = false; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (spacego == true){ _local2 = bsound.play(0, 1); gotoAndStop((spacegono + 10)); menulev = false; mpause = false; removeEventListener(Event.ENTER_FRAME, runy); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressedm); stage.removeEventListener(KeyboardEvent.KEY_UP, key_releasedm); }; if (touchplay == true){ if (modeselectplay == false){ addChild(playmode); modeselectplay = true; mpause = true; } else { if (selectleft == true){ _local3 = bsound.play(0, 1); menulev = false; practise = true; unlockedlevels.data.ulevel1 = true; unlockedlevels.flush(); gotoAndStop(10); mpause = false; removeChild(playmode); removeEventListener(Event.ENTER_FRAME, runy); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressedm); stage.removeEventListener(KeyboardEvent.KEY_UP, key_releasedm); } else { if (selectright == true){ _local4 = bsound.play(0, 1); menulev = false; practise = false; unlockedlevels.data.ulevel1 = true; unlockedlevels.flush(); gotoAndStop(10); mpause = false; removeChild(playmode); removeEventListener(Event.ENTER_FRAME, runy); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressedm); stage.removeEventListener(KeyboardEvent.KEY_UP, key_releasedm); } else { removeChild(playmode); modeselectplay = false; mpause = false; }; }; }; }; if (touchhelp == true){ if (helpscreenh == true){ if (help.currentFrame > 3){ removeChild(help); helpscreenh = false; mpause = false; } else { help.nextFrame(); }; } else { _local5 = bsound.play(0, 1); help.gotoAndStop(1); addChild(help); helpscreenh = true; mpause = true; }; }; if (touchlev == true){ _local6 = bsound.play(0, 1); if (unlockedlevels.data.ulevel1 == false){ if (nolevelscreen == true){ removeChild(noul); nolevelscreen = false; mpause = false; } else { addChild(noul); nolevelscreen = true; mpause = true; }; } else { practise = true; menulevel.removeParticle(levelsm); floorslant.visible = true; apiholder.addChild(ulsholder[0]); if (unlockedlevels.data.ulevel2 == true){ apiholder.addChild(ulsholder[1]); }; if (unlockedlevels.data.ulevel3 == true){ apiholder.addChild(ulsholder[2]); }; if (unlockedlevels.data.ulevel3 == true){ apiholder.addChild(ulsholder[2]); }; if (unlockedlevels.data.ulevel4 == true){ apiholder.addChild(ulsholder[3]); }; if (unlockedlevels.data.ulevel5 == true){ apiholder.addChild(ulsholder[4]); }; if (unlockedlevels.data.ulevel6 == true){ apiholder.addChild(ulsholder[5]); }; if (unlockedlevels.data.ulevel7 == true){ apiholder.addChild(ulsholder[6]); }; if (unlockedlevels.data.ulevel8 == true){ apiholder.addChild(ulsholder[7]); }; if (unlockedlevels.data.ulevel9 == true){ apiholder.addChild(ulsholder[8]); }; if (unlockedlevels.data.ulevel10 == true){ apiholder.addChild(ulsholder[9]); }; if (unlockedlevels.data.ulevel11 == true){ apiholder.addChild(ulsholder[10]); }; if (unlockedlevels.data.ulevel12 == true){ apiholder.addChild(ulsholder[11]); }; if (unlockedlevels.data.ulevel13 == true){ apiholder.addChild(ulsholder[12]); }; if (unlockedlevels.data.ulevel14 == true){ apiholder.addChild(ulsholder[13]); }; if (unlockedlevels.data.ulevel15 == true){ apiholder.addChild(ulsholder[14]); }; if (unlockedlevels.data.ulevel16 == true){ apiholder.addChild(ulsholder[15]); }; if (unlockedlevels.data.ulevel17 == true){ apiholder.addChild(ulsholder[16]); }; if (unlockedlevels.data.ulevel18 == true){ apiholder.addChild(ulsholder[17]); }; if (unlockedlevels.data.ulevel19 == true){ apiholder.addChild(ulsholder[18]); }; if (unlockedlevels.data.ulevel20 == true){ apiholder.addChild(ulsholder[19]); }; }; }; if (touchcred == true){ if (creditscreenh == true){ removeChild(creds); creditscreenh = false; mpause = false; } else { _local7 = bsound.play(0, 1); addChild(creds); creditscreenh = true; mpause = true; }; }; if (touchsite == true){ _local8 = bsound.play(0, 1); _local9 = "http://secure-us.imrworldwide.com/cgi-bin/b?cg=ugoplayer_flash_games&ci=us-ugclicks&tu=http://www.ugoplayer.com"; _local10 = new URLRequest(_local9); navigateToURL(_local10, "_blank"); }; }; } public function mutesound(_arg1:KeyboardEvent):void{ var fadeMute:Function; var fadeMute2:Function; var event = _arg1; if (event.keyCode == 83){ if (mute == false){ fadeMute = function (_arg1:Event):void{ addChild(mutem); mutem.alpha = (mutem.alpha - 0.03); if (mutem.alpha < 0.1){ removeChild(mutem); mutem.removeEventListener(Event.ENTER_FRAME, fadeMute); }; }; mutem.alpha = 1; mutem.gotoAndStop(1); mutem.addEventListener(Event.ENTER_FRAME, fadeMute); SoundMixer.soundTransform = new SoundTransform(0, 0); mute = true; smute = true; } else { fadeMute2 = function (_arg1:Event):void{ addChild(mutem); mutem.alpha = (mutem.alpha - 0.03); if (mutem.alpha < 0.1){ removeChild(mutem); mutem.removeEventListener(Event.ENTER_FRAME, fadeMute2); }; }; mutem.gotoAndStop(2); mutem.alpha = 1; mutem.addEventListener(Event.ENTER_FRAME, fadeMute2); SoundMixer.soundTransform = new SoundTransform(0.8, 0); mute = false; smute = false; }; }; } public function run2(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa2.px + wb2.px) / 2)) + 275); APEngine.container.y = (-(((wa2.py + wb2.py) / 2)) + 200); }; } public function run3(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa3.px + wb3.px) / 2)) + 275); APEngine.container.y = (-(((wa3.py + wb3.py) / 2)) + 200); }; } public function run4(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa4.px + wb4.px) / 2)) + 275); APEngine.container.y = (-(((wa4.py + wb4.py) / 2)) + 200); }; } public function run5(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa5.px + wb5.px) / 2)) + 275); APEngine.container.y = (-(((wa5.py + wb5.py) / 2)) + 200); }; } public function run6(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa6.px + wb6.px) / 2)) + 275); APEngine.container.y = (-(((wa6.py + wb6.py) / 2)) + 200); }; } public function run7(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa7.px + wb7.px) / 2)) + 275); APEngine.container.y = (-(((wa7.py + wb7.py) / 2)) + 200); }; } public function run8(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa8.px + wb8.px) / 2)) + 275); APEngine.container.y = (-(((wa8.py + wb8.py) / 2)) + 200); }; } public function run9(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(((wa9.px + wb9.px) / 2)) + 275); APEngine.container.y = (-(((wa9.py + wb9.py) / 2)) + 200); }; } public function key_released(_arg1:KeyboardEvent):void{ wa1.angularVelocity = 0; wb1.angularVelocity = 0; } public function runx(_arg1:Event):void{ if (mpause == false){ APEngine.step(); APEngine.paint(); APEngine.container.x = (-(wa1.px) + 275); }; } public function runy(_arg1:Event):void{ var _local2:Number; if (mpause == false){ hidehit.x = ((wam.px + wbm.px) * 0.5); hidehit.y = (((wam.py + wbm.py) * 0.5) + APEngine.container.y); APEngine.step(); APEngine.paint(); APEngine.container.y = (-(wam.py) + 200); if (APEngine.container.y > -100){ spacego = false; }; _local2 = 0; while (_local2 < 20) { if (ulsholder[_local2].hitTestPoint(hidehit.x, hidehit.y, true)){ spacego = true; spacegono = _local2; ulsholder[_local2].filters = new Array(Glowm); } else { ulsholder[_local2].filters = null; }; _local2++; }; }; } public function randfrag():void{ var _local1:int; lcl++; if (lcl > 39){ randxf = (Math.random() * 550); randyf = (Math.random() * 400); lcl = 0; }; if (lcl > 38){ _local1 = 1; while (_local1 < 20) { frag(randxf, randyf, stageholder, 16040962); _local1++; }; }; } public function tudsite(_arg1:ContextMenuEvent):void{ var _local2:String; var _local3:URLRequest; _local2 = "http://www.tudway-experimental.com"; _local3 = new URLRequest(_local2); navigateToURL(_local3, "_blank"); } public function mouseDowntudin(_arg1:MouseEvent):void{ navigateToURL(requesttudin, "_blank"); } public function key_pressed11(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa11.px = 30; wa11.py = 20; wb11.px = 70; wb11.py = 20; ba11.px = 120; ba11.py = 20; bpf11.px = 415; bpf11.py = 600; bpl11.px = 300; bpl11.py = 600; bpla11.px = 300; bpla11.py = 650; bpr11.px = 500; bpr11.py = 600; bpra11.px = 500; bpra11.py = 650; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa11.angularVelocity = 0.6; wb11.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa11.angularVelocity = -0.6; wb11.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level11); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run11); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed11); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released11); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level11); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run11); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed11); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released11); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed12(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ blg12.addParticle(floorbb12); wa12.px = 30; wa12.py = 100; wb12.px = 70; wb12.py = 100; ba12.px = 50; ba12.py = 50; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa12.angularVelocity = 0.6; wb12.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa12.angularVelocity = -0.6; wb12.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level12); APEngine.removeGroup(bg12); APEngine.removeGroup(blg12); APEngine.removeGroup(cg12); APEngine.removeGroup(clg12); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run12); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed12); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released12); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level12); APEngine.removeGroup(bg12); APEngine.removeGroup(blg12); APEngine.removeGroup(cg12); APEngine.removeGroup(clg12); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run12); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed12); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released12); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed13(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ level13.removeParticle(floorj13); wa13.px = 30; wa13.py = 130; wb13.px = 70; wb13.py = 130; ba13.px = 150; ba13.py = 130; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa13.angularVelocity = 0.6; wb13.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa13.angularVelocity = -0.6; wb13.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level13); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run13); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed13); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released13); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level13); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run13); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed13); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released13); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed14(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa14.px = 30; wa14.py = 20; wb14.px = 70; wb14.py = 20; ba14.px = 120; ba14.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa14.angularVelocity = 0.6; wb14.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa14.angularVelocity = -0.6; wb14.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level14); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run14); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed14); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released14); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level14); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run14); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed14); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released14); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed16(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa16.px = 30; wa16.py = 20; wb16.px = 70; wb16.py = 20; ba16.px = 200; ba16.py = 50; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa16.angularVelocity = 0.6; wb16.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa16.angularVelocity = -0.6; wb16.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level16); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run16); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed16); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released16); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level16); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run16); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed16); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released16); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed10(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa10.px = 30; wa10.py = 20; wb10.px = 70; wb10.py = 20; ba10.px = 120; ba10.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa10.angularVelocity = 0.6; wb10.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa10.angularVelocity = -0.6; wb10.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level10); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run10); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed10); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released10); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level10); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run10); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed10); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released10); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed18(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ level18.addParticle(trig18); bs18.px = 1000; bs18.py = -50; wa18.px = 30; wa18.py = 150; wb18.px = 70; wb18.py = 150; ba18.px = 860; ba18.py = 150; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa18.angularVelocity = 0.6; wb18.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa18.angularVelocity = -0.6; wb18.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level18); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run18); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed18); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released18); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level18); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run18); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed18); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released18); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed15(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa15.px = 30; wa15.py = 20; wb15.px = 70; wb15.py = 20; ba15.px = 120; ba15.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa15.angularVelocity = 0.6; wb15.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa15.angularVelocity = -0.6; wb15.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level15); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run15); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed15); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released15); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level15); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run15); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed15); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released15); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed17(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa17.px = 30; wa17.py = 150; wb17.px = 70; wb17.py = 150; ba17.px = 120; ba17.py = 180; boxl17.px = 300; boxl17.py = 550; boxr17.px = 350; boxr17.py = 550; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa17.angularVelocity = 0.6; wb17.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa17.angularVelocity = -0.6; wb17.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level17); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run17); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed17); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released17); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level17); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run17); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed17); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released17); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } public function key_pressed19(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == 77){ if (quitgameshow == false){ mpause = true; addChild(quitgame); quitgameshow = true; } else { mpause = false; removeChild(quitgame); quitgameshow = false; }; }; if (go == true){ if (mpause == false){ if (_arg1.keyCode == Keyboard.DOWN){ wa19.px = 130; wa19.py = 20; wb19.px = 170; wb19.py = 20; ba19.px = 220; ba19.py = 20; apiholder.x = 0; apiholder.y = 0; }; }; if (_arg1.keyCode == Keyboard.RIGHT){ wa19.angularVelocity = 0.6; wb19.angularVelocity = 0.6; }; if (_arg1.keyCode == Keyboard.LEFT){ wa19.angularVelocity = -0.6; wb19.angularVelocity = -0.6; }; }; if (_arg1.keyCode == Keyboard.SPACE){ if (quitgameshow == true){ channel.stop(); if (practise == false){ minuteTimer.removeEventListener(TimerEvent.TIMER, onTick); minuteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); minuteTimer.stop(); minuteTimer.reset(); th.removeChild(timeText); th.removeChild(liveAm); removeChild(th); }; removeChild(quitgame); APEngine.removeGroup(level19); gotoAndStop(5); removeEventListener(Event.ENTER_FRAME, run19); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed19); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released19); }; if (levelCompletes == true){ if (practise == false){ minuteTimer.reset(); minuteTimer.start(); }; APEngine.removeGroup(level19); removeChild(levelend); go = true; levelCompletes = false; nextFrame(); removeEventListener(Event.ENTER_FRAME, run19); stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_pressed19); stage.removeEventListener(KeyboardEvent.KEY_UP, key_released19); } else { if (practise == true){ if (mpause == false){ addChild(pausesc); mpause = true; } else { removeChild(pausesc); mpause = false; }; } else { if (cheatSpace < 4){ if (mpause == false){ minuteTimer.stop(); addChild(pausesc); mpause = true; } else { cheatSpace++; minuteTimer.start(); removeChild(pausesc); mpause = false; }; }; }; }; }; } } }//package SteerWheels2_UGO2_fla
Section 41
//ugointro_1 (SteerWheels2_UGO2_fla.ugointro_1) package SteerWheels2_UGO2_fla { import flash.display.*; import flash.events.*; import flash.net.*; public dynamic class ugointro_1 extends MovieClip { public var tag:SimpleButton; public var requestu:URLRequest; public var urlu:String; public function ugointro_1(){ addFrameScript(0, frame1, 20, frame21, 164, frame165); } function frame165(){ stop(); } function frame1(){ stage.frameRate = 60; nielsen("game_intro"); } public function mouseDownu(_arg1:MouseEvent):void{ navigateToURL(requestu, "_blank"); } function frame21(){ tag.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownu); urlu = "http://secure-us.imrworldwide.com/cgi-bin/b?cg=ugoplayer_flash_games&ci=us-ugclicks&tu=http://www.ugoplayer.com"; requestu = new URLRequest(urlu); } public function nielsen(_arg1){ var _local2:String; var _local3:String; var _local4:String; var _local5:URLRequest; var _local6:Loader; _local2 = "us-ugo"; _local3 = "ugoplayer_flashgames"; _local4 = escape(_arg1); _local5 = new URLRequest(((((((("http://secure-us.imrworldwide.com/cgi-bin/m?ci=" + _local2) + "&cg=") + _local3) + "&si=") + _local4) + "&rnd=") + Math.ceil((Math.random() * 100000000)))); _local6 = new Loader(); _local6.load(_local5); addChild(_local6); } } }//package SteerWheels2_UGO2_fla
Section 42
//boing (boing) package { import flash.media.*; public dynamic class boing extends Sound { } }//package
Section 43
//creditsscreen (creditsscreen) package { import flash.display.*; public dynamic class creditsscreen extends MovieClip { } }//package
Section 44
//creditstext (creditstext) package { import flash.display.*; public dynamic class creditstext extends MovieClip { } }//package
Section 45
//deadScreen (deadScreen) package { import flash.display.*; import flash.text.*; public dynamic class deadScreen extends MovieClip { public var bg:MovieClip; public var failtit:TextField; public var finalScore:TextField; } }//package
Section 46
//helpscreen (helpscreen) package { import flash.display.*; public dynamic class helpscreen extends MovieClip { public function helpscreen(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package
Section 47
//helptext (helptext) package { import flash.display.*; public dynamic class helptext extends MovieClip { } }//package
Section 48
//instructotextholder (instructotextholder) package { import flash.display.*; import flash.text.*; public dynamic class instructotextholder extends MovieClip { public var instructotext:TextField; } }//package
Section 49
//levelcomplete (levelcomplete) package { import flash.display.*; import flash.text.*; public dynamic class levelcomplete extends MovieClip { public var levelname:TextField; public var overscore:TextField; public var bg:MovieClip; public var leveltime:TextField; public var levelscore:TextField; } }//package
Section 50
//levelselect (levelselect) package { import flash.display.*; public dynamic class levelselect extends MovieClip { } }//package
Section 51
//MochiBot (MochiBot) package { import flash.display.*; import flash.net.*; import flash.system.*; public dynamic class MochiBot extends Sprite { public static function track(_arg1:Sprite, _arg2:String):MochiBot{ var _local3:MochiBot; var _local4:String; var _local5:URLVariables; var _local6:String; var _local7:URLRequest; var _local8:Loader; if (Security.sandboxType == "localWithFile"){ return (null); }; _local3 = new (MochiBot); _arg1.addChild(_local3); Security.allowDomain("*"); Security.allowInsecureDomain("*"); _local4 = "http://core.mochibot.com/my/core.swf"; _local5 = new URLVariables(); _local5["sb"] = Security.sandboxType; _local5["v"] = Capabilities.version; _local5["swfid"] = _arg2; _local5["mv"] = "8"; _local5["fv"] = "9"; _local6 = _local3.root.loaderInfo.loaderURL; if (_local6.indexOf("http") == 0){ _local5["url"] = _local6; } else { _local5["url"] = "local"; }; _local7 = new URLRequest(_local4); _local7.contentType = "application/x-www-form-urlencoded"; _local7.method = URLRequestMethod.POST; _local7.data = _local5; _local8 = new Loader(); _local3.addChild(_local8); _local8.load(_local7); return (_local3); } } }//package
Section 52
//modeselect (modeselect) package { import flash.display.*; public dynamic class modeselect extends MovieClip { public var practice:MovieClip; public var timetrial:MovieClip; } }//package
Section 53
//mutesym (mutesym) package { import flash.display.*; public dynamic class mutesym extends MovieClip { public function mutesym(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package
Section 54
//nolevels (nolevels) package { import flash.display.*; public dynamic class nolevels extends MovieClip { } }//package
Section 55
//pausescreen (pausescreen) package { import flash.display.*; public dynamic class pausescreen extends MovieClip { public var apiholder:MovieClip; } }//package
Section 56
//playtext (playtext) package { import flash.display.*; public dynamic class playtext extends MovieClip { } }//package
Section 57
//quitscreen (quitscreen) package { import flash.display.*; public dynamic class quitscreen extends MovieClip { } }//package
Section 58
//selectmode (selectmode) package { import flash.display.*; public dynamic class selectmode extends MovieClip { public var practise:MovieClip; public var timetrial:MovieClip; } }//package
Section 59
//sitetext (sitetext) package { import flash.display.*; public dynamic class sitetext extends MovieClip { } }//package
Section 60
//steerLife (steerLife) package { import flash.display.*; public dynamic class steerLife extends MovieClip { } }//package
Section 61
//SteerText (SteerText) package { import flash.display.*; import flash.text.*; public dynamic class SteerText extends MovieClip { public var highScoreBack:TextField; public var levelUnlockBack:TextField; } }//package
Section 62
//theme (theme) package { import flash.media.*; public dynamic class theme extends Sound { } }//package
Section 63
//timerholderblob (timerholderblob) package { import flash.display.*; public dynamic class timerholderblob extends MovieClip { } }//package
Section 64
//tudsynth (tudsynth) package { import flash.media.*; public dynamic class tudsynth extends Sound { } }//package
Section 65
//tudText (tudText) package { import flash.display.*; public dynamic class tudText extends MovieClip { } }//package

Library Items

Symbol 1 Sound {tudsynth}
Symbol 2 Sound {theme}
Symbol 3 Sound {boing}
Symbol 4 FontUsed by:5 14 15 16 24 27 28 29 31 32 33 34 35 36 37 38 39 40 41 42 43 46 47 48 49 50 51 53 55 57 59 61 63 64 66 68 70 74 78 80 83 85 87 88 105 107
Symbol 5 TextUses:4Used by:6
Symbol 6 MovieClip {tudText}Uses:5
Symbol 7 GraphicUsed by:8
Symbol 8 MovieClip {steerLife}Uses:7
Symbol 9 GraphicUsed by:10
Symbol 10 MovieClip {timerholderblob}Uses:9
Symbol 11 GraphicUsed by:12
Symbol 12 MovieClipUses:11Used by:21 89
Symbol 13 GraphicUsed by:21 89
Symbol 14 EditableTextUses:4Used by:21
Symbol 15 TextUses:4Used by:21
Symbol 16 TextUses:4Used by:21
Symbol 17 FontUsed by:18 19 20 86
Symbol 18 EditableTextUses:17Used by:21
Symbol 19 EditableTextUses:17Used by:21
Symbol 20 EditableTextUses:17Used by:21
Symbol 21 MovieClip {levelcomplete}Uses:12 13 14 15 16 18 19 20
Symbol 22 GraphicUsed by:23
Symbol 23 MovieClipUses:22Used by:30 44 65 72
Symbol 24 TextUses:4Used by:30
Symbol 25 GraphicUsed by:26
Symbol 26 MovieClipUses:25Used by:30 44 65 72
Symbol 27 TextUses:4Used by:30
Symbol 28 TextUses:4Used by:30
Symbol 29 TextUses:4Used by:30
Symbol 30 MovieClip {creditsscreen}Uses:23 24 26 27 28 29
Symbol 31 TextUses:4Used by:44
Symbol 32 TextUses:4Used by:44 65
Symbol 33 TextUses:4Used by:44
Symbol 34 TextUses:4Used by:44
Symbol 35 TextUses:4Used by:44
Symbol 36 TextUses:4Used by:44
Symbol 37 TextUses:4Used by:44
Symbol 38 TextUses:4Used by:44
Symbol 39 TextUses:4Used by:44
Symbol 40 TextUses:4Used by:44
Symbol 41 TextUses:4Used by:44
Symbol 42 TextUses:4Used by:44
Symbol 43 TextUses:4Used by:44
Symbol 44 MovieClip {helpscreen}Uses:23 31 26 32 33 34 35 36 37 38 39 40 41 42 43
Symbol 45 GraphicUsed by:52
Symbol 46 TextUses:4Used by:52
Symbol 47 TextUses:4Used by:52
Symbol 48 TextUses:4Used by:52
Symbol 49 EditableTextUses:4Used by:52
Symbol 50 EditableTextUses:4Used by:52
Symbol 51 TextUses:4Used by:52
Symbol 52 MovieClip {SteerText}Uses:45 46 47 48 49 50 51
Symbol 53 TextUses:4Used by:54
Symbol 54 MovieClip {levelselect}Uses:53
Symbol 55 TextUses:4Used by:56
Symbol 56 MovieClip {playtext}Uses:55
Symbol 57 TextUses:4Used by:58
Symbol 58 MovieClip {helptext}Uses:57
Symbol 59 TextUses:4Used by:60
Symbol 60 MovieClip {creditstext}Uses:59
Symbol 61 TextUses:4Used by:62
Symbol 62 MovieClip {sitetext}Uses:61
Symbol 63 TextUses:4Used by:65
Symbol 64 TextUses:4Used by:65
Symbol 65 MovieClip {nolevels}Uses:23 63 26 32 64
Symbol 66 TextUses:4Used by:72
Symbol 67 GraphicUsed by:69 71
Symbol 68 TextUses:4Used by:69
Symbol 69 MovieClipUses:67 68Used by:72 75
Symbol 70 TextUses:4Used by:71
Symbol 71 MovieClipUses:67 70Used by:72 75
Symbol 72 MovieClip {selectmode}Uses:23 26 66 69 71
Symbol 73 GraphicUsed by:75
Symbol 74 TextUses:4Used by:75
Symbol 75 MovieClip {modeselect}Uses:71 69 73 74
Symbol 76 GraphicUsed by:79
Symbol 77 MovieClipUsed by:79  Timeline
Symbol 78 TextUses:4Used by:79
Symbol 79 MovieClip {pausescreen}Uses:76 77 78
Symbol 80 EditableTextUses:4Used by:81
Symbol 81 MovieClip {instructotextholder}Uses:80
Symbol 82 GraphicUsed by:84
Symbol 83 TextUses:4Used by:84
Symbol 84 MovieClip {quitscreen}Uses:82 83
Symbol 85 TextUses:4Used by:89
Symbol 86 EditableTextUses:17Used by:89
Symbol 87 EditableTextUses:4Used by:89
Symbol 88 TextUses:4Used by:89
Symbol 89 MovieClip {deadScreen}Uses:12 13 85 86 87 88
Symbol 90 GraphicUsed by:92
Symbol 91 GraphicUsed by:92
Symbol 92 MovieClip {mutesym}Uses:90 91
Symbol 93 GraphicUsed by:Timeline
Symbol 94 FontUsed by:95
Symbol 95 TextUses:94Used by:104
Symbol 96 BitmapUsed by:97
Symbol 97 GraphicUses:96Used by:104
Symbol 98 BitmapUsed by:99
Symbol 99 GraphicUses:98Used by:104
Symbol 100 GraphicUsed by:101
Symbol 101 ButtonUses:100Used by:104
Symbol 102 BitmapUsed by:103
Symbol 103 GraphicUses:102Used by:104
Symbol 104 MovieClip {SteerWheels2_UGO2_fla.ugointro_1}Uses:95 97 99 101 103Used by:Timeline
Symbol 105 EditableTextUses:4Used by:106
Symbol 106 MovieClipUses:105Used by:Timeline
Symbol 107 TextUses:4Used by:Timeline

Instance Names

"ugint"Frame 1Symbol 104 MovieClip {SteerWheels2_UGO2_fla.ugointro_1}
"apiholder"Frame 5Symbol 77 MovieClip
"stageholder"Frame 5Symbol 77 MovieClip
"apiholder"Frame 10Symbol 77 MovieClip
"pleasewait"Frame 40Symbol 106 MovieClip
"bg"Symbol 21 MovieClip {levelcomplete} Frame 1Symbol 12 MovieClip
"levelname"Symbol 21 MovieClip {levelcomplete} Frame 1Symbol 14 EditableText
"leveltime"Symbol 21 MovieClip {levelcomplete} Frame 1Symbol 18 EditableText
"levelscore"Symbol 21 MovieClip {levelcomplete} Frame 1Symbol 19 EditableText
"overscore"Symbol 21 MovieClip {levelcomplete} Frame 1Symbol 20 EditableText
"highScoreBack"Symbol 52 MovieClip {SteerText} Frame 1Symbol 49 EditableText
"levelUnlockBack"Symbol 52 MovieClip {SteerText} Frame 1Symbol 50 EditableText
"timetrial"Symbol 72 MovieClip {selectmode} Frame 1Symbol 69 MovieClip
"practise"Symbol 72 MovieClip {selectmode} Frame 1Symbol 71 MovieClip
"practice"Symbol 75 MovieClip {modeselect} Frame 1Symbol 71 MovieClip
"timetrial"Symbol 75 MovieClip {modeselect} Frame 1Symbol 69 MovieClip
"apiholder"Symbol 79 MovieClip {pausescreen} Frame 1Symbol 77 MovieClip
"instructotext"Symbol 81 MovieClip {instructotextholder} Frame 1Symbol 80 EditableText
"bg"Symbol 89 MovieClip {deadScreen} Frame 1Symbol 12 MovieClip
"finalScore"Symbol 89 MovieClip {deadScreen} Frame 1Symbol 86 EditableText
"failtit"Symbol 89 MovieClip {deadScreen} Frame 1Symbol 87 EditableText
"tag"Symbol 104 MovieClip {SteerWheels2_UGO2_fla.ugointro_1} Frame 21Symbol 101 Button

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata not present, AS3.
Protect (24)Timeline Frame 131 bytes "..$1$3k$ccyhTWZ4mnuY8ooJvk/ED/."

Labels

"deadFrame"Frame 40




http://swfchan.com/10/46183/info.shtml
Created: 4/5 -2019 04:54:41 Last modified: 4/5 -2019 04:54:41 Server time: 04/05 -2024 06:34:47