Section 1
//NpContextMenu (noponies.ui.NpContextMenu)
package noponies.ui {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
public class NpContextMenu extends EventDispatcher {
private var target:InteractiveObject;
private var selectedMenuItem:String;
private var customCM:ContextMenu;
public function NpContextMenu(_arg1:InteractiveObject){
this.target = _arg1;
customCM = new ContextMenu();
removeDefaultItems();
_arg1.contextMenu = customCM;
}
public function hideMenuItem(_arg1:String):void{
var _local2:Array;
var _local3:Object;
_local2 = customCM.customItems;
for (_local3 in _local2) {
if (_local2[_local3].caption == _arg1){
customCM.customItems[_local3].enabled = false;
break;
};
};
}
public function addMenuItem(_arg1:String, _arg2:Boolean):void{
var _local3:ContextMenuItem;
_local3 = new ContextMenuItem(_arg1, _arg2);
_local3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, dispatchMenuEvent);
customCM.customItems.push(_local3);
}
public function get selectedMenu():String{
return (selectedMenuItem);
}
private function dispatchMenuEvent(_arg1:ContextMenuEvent):void{
selectedMenuItem = _arg1.target.caption;
dispatchEvent(_arg1);
}
private function removeDefaultItems():void{
customCM.hideBuiltInItems();
}
public function get currentMenuItems():Array{
return (customCM.customItems);
}
public function showMenuItem(_arg1:String):void{
var _local2:Array;
var _local3:Object;
_local2 = customCM.customItems;
for (_local3 in _local2) {
if (_local2[_local3].caption == _arg1){
customCM.customItems[_local3].enabled = true;
break;
};
};
}
public function removeMenuItem(_arg1:String):void{
var _local2:Array;
var _local3:Object;
_local2 = customCM.customItems;
for (_local3 in _local2) {
if (_local2[_local3].caption == _arg1){
_local2[_local3].removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, dispatchMenuEvent);
customCM.customItems.splice(_local3, 1);
break;
};
};
}
}
}//package noponies.ui
Section 2
//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 3
//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 4
//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 5
//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 6
//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 7
//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 8
//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 9
//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 10
//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 11
//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 12
//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 13
//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 14
//IForce (org.cove.ape.IForce)
package org.cove.ape {
public interface IForce {
function getValue(_arg1:Number):Vector;
}
}//package org.cove.ape
Section 15
//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 16
//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 17
//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 18
//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 19
//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 20
//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 21
//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 22
//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 23
//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 24
//MainTimeline (ShapeEscapeExtended_Mochi_fla.MainTimeline)
package ShapeEscapeExtended_Mochi_fla {
import flash.display.*;
import flash.events.*;
import org.cove.ape.*;
import noponies.ui.*;
import flash.ui.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.xml.*;
import mochi.*;
public dynamic class MainTimeline extends MovieClip {
public var RestartButton:SimpleButton;
public var GameOver:TextField;
public var scoreLevel;
public var ExpertButton:SimpleButton;
public var currLevelName;
public var logolink:SimpleButton;
public var deathCountinfo:TextField;
public var blue400x10A:DisplayObject;
public var green10x200A:DisplayObject;
public var levelName:TextField;
public var BeginnerButton:SimpleButton;
public var wheel1;
public var MenuInfo_mc:MovieClip;
public var green80x10A:DisplayObject;
public var exit10x50:DisplayObject;
public var blue100x10A:DisplayObject;
public var blue100x10B:DisplayObject;
public var blue80x10A:DisplayObject;
public var green50x10A:DisplayObject;
public var blue100x10D:DisplayObject;
public var intro:MovieClip;
public var black200x10A:DisplayObject;
public var PreLoader:MovieClip;
public var wheely;
public var blue50x10A:DisplayObject;
public var playerBall:DisplayObject;
public var wheelx;
public var blue50x10B:DisplayObject;
public var currLevel;
public var blue50x10C:DisplayObject;
public var green20x10A:DisplayObject;
public var blue10x100A:DisplayObject;
public var BGM:BGMusic;
public var info:TextField;
public var blue100x10C:DisplayObject;
public var blue10x100B:DisplayObject;
public var colA:uint;
public var colB:uint;
public var colC:uint;
public var bounceIntro:TextField;
public var colE:uint;
public var colF:uint;
public var colG:uint;
public var colI:uint;
public var colD:uint;
public var colH:uint;
public var green200x10A:DisplayObject;
public var unlocked;
public var exit300x10:DisplayObject;
public var blue300x10A:DisplayObject;
public var blue10x200A:DisplayObject;
public var BGMsc:SoundChannel;
public var playerColor;
public var lockedintermediate:MovieClip;
public var viewscores:SimpleButton;
public var green60x10B:DisplayObject;
public var green60x10A:DisplayObject;
public var addbutton:SimpleButton;
public var PreLoaderOutput:TextField;
public var black100x10A:DisplayObject;
public var exit:RectangleParticle;
public var myMenu:NpContextMenu;
public var submitscoreinfo:TextField;
public var blue300x10B:DisplayObject;
public var block1;
public var block2;
public var block4;
public var block5;
public var block3;
public var deathCount:TextField;
public var black10x100B:DisplayObject;
public var blue10x150A:DisplayObject;
public var black10x100A:DisplayObject;
public var blue10x300A:DisplayObject;
public var currDeaths;
public var buttonClick;
public var blue150x10A:DisplayObject;
public var blue150x10B:DisplayObject;
public var SubmitButton:SimpleButton;
public var blue800x10A:DisplayObject;
public var green100x10A:DisplayObject;
public var group1:Group;
public var green100x10C:DisplayObject;
public var numLevel;
public var green100x10B:DisplayObject;
public var wall1:RectangleParticle;
public var wall2:RectangleParticle;
public var wall3:RectangleParticle;
public var doOnce;
public var black10x200A:DisplayObject;
public var wall4:RectangleParticle;
public var IntermediateButton:SimpleButton;
public var blue200x10C:DisplayObject;
public var lockedexpert:MovieClip;
public var wall5:RectangleParticle;
public var blue200x10B:DisplayObject;
public var exit100x10:DisplayObject;
public var exit50x10:DisplayObject;
public var black40x10A:DisplayObject;
public var nm:TextField;
public var blue200x10A:DisplayObject;
public var black40x10B:DisplayObject;
public var tarIntro:TextField;
public var green10x100A:DisplayObject;
public var blue40x10A:DisplayObject;
public var green10x100B:DisplayObject;
public var blue100x100A:DisplayObject;
public var blue100x100B:DisplayObject;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
function frame3(){
stop();
}
function frame4(){
stop();
MenuInfo_mc.MenuInfo.text = "";
MenuInfo_mc.alpha = 0;
BGMsc.stop();
BGMsc = BGM.play(1, 100);
myMenu.removeMenuItem("Controls");
myMenu.removeMenuItem("Objectives");
myMenu.removeMenuItem("Block Types");
myMenu.removeMenuItem("Quit Information Screen");
myMenu.removeMenuItem("Quit to Main Menu");
buttonClick = 0;
if (unlocked >= 2){
removeChild(lockedintermediate);
};
if (unlocked >= 3){
removeChild(lockedexpert);
};
if (unlocked >= 4){
playerColor = 2;
};
BeginnerButton.addEventListener(MouseEvent.MOUSE_UP, buttonPressed);
IntermediateButton.addEventListener(MouseEvent.MOUSE_UP, buttonPressed2);
ExpertButton.addEventListener(MouseEvent.MOUSE_UP, buttonPressed3);
addbutton.addEventListener(MouseEvent.MOUSE_UP, linkPressed2);
logolink.addEventListener(MouseEvent.MOUSE_UP, linkPressed);
}
public function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:Number;
_local2 = 0.08;
if ((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))){
wheel1.angularVelocity = -(_local2);
};
if ((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))){
wheel1.angularVelocity = _local2;
};
}
public function linkPressed2(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://play4all.net/download.php"));
}
function frame5(){
stop();
MenuInfo_mc.MenuInfo.text = "";
MenuInfo_mc.alpha = 0;
myMenu.addMenuItem("Controls", true);
myMenu.addMenuItem("Objectives", false);
myMenu.addMenuItem("Block Types", false);
myMenu.addMenuItem("Quit Information Screen", false);
myMenu.addMenuItem("Quit to Main Menu", true);
stop();
colA = 0;
colB = 3368618;
colC = 11189179;
colD = 6724010;
colE = 7833719;
colF = 0xAA0000;
colG = 0xCC9900;
colH = 0xCC00;
colI = 0x555555;
GameOver.text = "";
bounceIntro.text = "";
tarIntro.text = "";
currLevel = numLevel;
scoreLevel = 0;
currDeaths = 0;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
stage.addEventListener(MouseEvent.MOUSE_UP, platformClick);
addEventListener(Event.ENTER_FRAME, run);
if (playerColor == 1){
playerBall = new player();
} else {
if (playerColor == 2){
playerBall = new playerRed();
};
};
if (doOnce == 1){
wheelx = 20;
wheely = 40;
currLevelName = "Walk in the Park";
APEngine.init((1 / 4));
APEngine.container = this;
APEngine.addForce(new VectorForce(false, 0, 2));
group1 = new Group();
group1.collideInternal = true;
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
wall1 = new RectangleParticle(200, 60, 400, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(450, 120, 200, 10, -0.5, true, 1, 0.15);
wall3 = new RectangleParticle(300, 200, 200, 10, 0.5, true, 1, 0.15);
wall4 = new RectangleParticle(450, 280, 200, 10, -0.5, true, 1, 0.15);
wall5 = new RectangleParticle(400, 450, 800, 10, 0, true, 1, 0.15);
exit = new RectangleParticle(500, 440, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit";
black10x100A = new blackBlock10x100();
black10x100B = new blackBlock10x100();
black10x200A = new blackBlock10x200();
black40x10A = new blackBlock40x10();
black40x10B = new blackBlock40x10();
black100x10A = new blackBlock100x10();
black200x10A = new blackBlock200x10();
green10x100A = new greenBlock10x100();
green10x100B = new greenBlock10x100();
green10x200A = new greenBlock10x200();
green20x10A = new greenBlock20x10();
green50x10A = new greenBlock50x10();
green60x10A = new greenBlock60x10();
green60x10B = new greenBlock60x10();
green80x10A = new greenBlock80x10();
green100x10A = new greenBlock100x10();
green100x10B = new greenBlock100x10();
green100x10C = new greenBlock100x10();
green200x10A = new greenBlock200x10();
blue10x100A = new blueBlock10x100();
blue10x100B = new blueBlock10x100();
blue10x150A = new blueBlock10x150();
blue10x200A = new blueBlock10x200();
blue10x300A = new blueBlock10x300();
blue40x10A = new blueBlock40x10();
blue50x10A = new blueBlock50x10();
blue50x10B = new blueBlock50x10();
blue50x10C = new blueBlock50x10();
blue80x10A = new blueBlock80x10();
blue100x10A = new blueBlock100x10();
blue100x10B = new blueBlock100x10();
blue100x10C = new blueBlock100x10();
blue100x10D = new blueBlock100x10();
blue100x100A = new blueBlock100x100();
blue100x100B = new blueBlock100x100();
blue150x10A = new blueBlock150x10();
blue150x10B = new blueBlock150x10();
blue200x10A = new blueBlock200x10();
blue200x10B = new blueBlock200x10();
blue200x10C = new blueBlock200x10();
blue300x10A = new blueBlock300x10();
blue300x10B = new blueBlock300x10();
blue400x10A = new blueBlock400x10();
blue800x10A = new blueBlock800x10();
exit300x10 = new exitBlock300x10();
exit100x10 = new exitBlock100x10();
exit50x10 = new exitBlock50x10();
exit10x50 = new exitBlock10x50();
wall1.setDisplay(blue400x10A, 0, 0, 0);
wall2.setDisplay(blue200x10A, 0, 0, 0);
wall3.setDisplay(blue200x10B, 0, 0, 0);
wall4.setDisplay(blue200x10C, 0, 0, 0);
wall5.setDisplay(blue800x10A, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
APEngine.addGroup(group1);
doOnce = 0;
};
}
function frame6(){
stop();
myMenu.removeMenuItem("Controls");
myMenu.removeMenuItem("Objectives");
myMenu.removeMenuItem("Block Types");
myMenu.removeMenuItem("Quit Information Screen");
myMenu.removeMenuItem("Quit to Main Menu");
submitscoreinfo.text = "";
deathCountinfo.text = (("Deaths" + " ") + currDeaths);
SubmitButton.addEventListener(MouseEvent.MOUSE_UP, buttonPressed5);
RestartButton.addEventListener(MouseEvent.MOUSE_UP, buttonPressed6);
viewscores.addEventListener(MouseEvent.MOUSE_UP, buttonPressed7);
}
function frame2(){
unlocked = 1;
numLevel = 0;
doOnce = 1;
playerColor = 1;
BGM = new BGMusic();
BGMsc = BGM.play(1, 100);
BGMsc.stop();
MenuInfo_mc.MenuInfo.text = "";
MenuInfo_mc.alpha = 0;
block1 = "Gold - Exit Block \n";
block2 = "Blue - Normal Block \n";
block3 = "";
block4 = "";
block5 = "";
myMenu = new NpContextMenu(this);
myMenu.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, handleMenuSelection);
myMenu.addMenuItem("Shape Escape Extended", false);
myMenu.addMenuItem("A Game By Nicolas 'Plumpman' Picouet", false);
myMenu.addMenuItem("Graphics By Chris 'Slasher145' Jeffrey", false);
myMenu.addMenuItem("Music By Davide 'No1r' Cecchi", false);
myMenu.addMenuItem("Start Music", true);
myMenu.addMenuItem("Stop Music", false);
}
function frame1(){
stop();
MochiAd.showPreGameAd({clip:root, id:"65f60e3ecf12f3d6", res:"600x500", background:7095330, color:16300400, outline:0, no_bg:true});
logolink.addEventListener(MouseEvent.MOUSE_UP, linkPressed);
}
public function buttonPressed(_arg1:MouseEvent){
numLevel = 1;
doOnce = 1;
gotoAndStop(5);
MenuInfo_mc.MenuInfo.text = "";
MenuInfo_mc.alpha = 0;
}
public function run(_arg1:Event):void{
var _local2:Number;
if ((((((currLevel == 10)) && ((unlocked >= 2)))) && ((buttonClick == 1)))){
numLevel++;
currLevel++;
currLevelName = "Precision Decision";
wheelx = 160;
wheely = 130;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(150, 150, 200, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(30, 150, 60, 10, 0, true, 1, 1);
wall2.sprite.name = "Bounce";
wall3 = new RectangleParticle(400, 150, 60, 10, 0, true, 1, 0.8);
wall3.sprite.name = "Bounce";
wall4 = new RectangleParticle(300, 350, 100, 10, 0, true, 1, 0.6);
wall5 = new RectangleParticle(300, 150, 100, 10, 0, true, 1, 0.6);
exit = new RectangleParticle(360, 30, 100, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit11";
wall1.setDisplay(blue200x10A, 0, 0, 0);
wall2.setDisplay(green60x10A, 0, 0, 0);
wall3.setDisplay(green60x10B, 0, 0, 0);
wall4.setDisplay(green100x10A, 0, 0, 0);
wall5.setDisplay(green100x10B, 0, 0, 0);
exit.setDisplay(exit100x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(exit);
group1.addParticle(wheel1);
buttonClick = 0;
};
if ((((((currLevel == 20)) && ((unlocked >= 3)))) && ((buttonClick == 1)))){
numLevel++;
currLevel++;
currLevelName = "Bottoms Up";
wheelx = 100;
wheely = 130;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 150, 200, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(190, 210, 10, 100, 0, true, 1, 0.15);
wall3 = new RectangleParticle(350, 350, 100, 10, 0, true, 1, 0.75);
wall3.sprite.name = "Bounce";
wall4 = new RectangleParticle(150, 320, 100, 10, 0.7854, true, 1, 0.75);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(300, 150, 100, 10, 0, true, 1, 0.6);
exit = new RectangleParticle(100, 160, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit21";
wall1.setDisplay(blue200x10A, 0, 0, 0);
wall2.setDisplay(blue10x100A, 0, 0, 0);
wall3.setDisplay(green100x10A, 0, 0, 0);
wall4.setDisplay(green100x10B, 0, 0, 0);
wall5.setDisplay(green100x10C, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(exit);
group1.addParticle(wheel1);
buttonClick = 0;
};
info.text = (("Level" + " ") + currLevel);
levelName.text = currLevelName;
deathCount.text = (("Deaths" + " ") + currDeaths);
_local2 = (group1.particles.length - 1);
while (_local2 > 0) {
if (group1.particles[_local2].py > 500){
currDeaths++;
group1.removeParticle(group1.particles[_local2]);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
group1.addParticle(wheel1);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
};
if (group1.particles[_local2].py < 0){
currDeaths++;
group1.removeParticle(group1.particles[_local2]);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
group1.addParticle(wheel1);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
};
if (group1.particles[_local2].px > 600){
currDeaths++;
group1.removeParticle(group1.particles[_local2]);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
group1.addParticle(wheel1);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
};
if (group1.particles[_local2].px < 0){
currDeaths++;
group1.removeParticle(group1.particles[_local2]);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
group1.addParticle(wheel1);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
};
_local2--;
};
APEngine.step();
APEngine.paint();
}
public function linkPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.play4all.net"));
}
public function platformClick(_arg1:MouseEvent){
if (wall1.sprite.name == "Bounce"){
wall1.angle = (wall1.angle + 45);
wall1.paint();
};
if (wall2.sprite.name == "Bounce"){
wall2.angle = (wall2.angle + 45);
wall2.paint();
};
if (wall3.sprite.name == "Bounce"){
wall3.angle = (wall3.angle + 45);
wall3.paint();
};
if (wall4.sprite.name == "Bounce"){
wall4.angle = (wall4.angle + 45);
wall4.paint();
};
if (wall5.sprite.name == "Bounce"){
wall5.angle = (wall5.angle + 45);
wall5.paint();
};
}
public function keyUpHandler(_arg1:KeyboardEvent):void{
wheel1.angularVelocity = 0;
}
public function buttonPressed2(_arg1:MouseEvent){
if (unlocked >= 2){
numLevel = 10;
buttonClick = 1;
gotoAndStop(5);
MenuInfo_mc.MenuInfo.text = "";
MenuInfo_mc.alpha = 0;
};
}
public function buttonPressed3(_arg1:MouseEvent){
if (unlocked >= 3){
numLevel = 20;
buttonClick = 1;
gotoAndStop(5);
MenuInfo_mc.MenuInfo.text = "";
MenuInfo_mc.alpha = 0;
};
}
public function buttonPressed6(_arg1:MouseEvent){
gotoAndStop(4);
}
public function buttonPressed7(_arg1:MouseEvent){
if (scoreLevel == 1){
navigateToURL(new URLRequest("http://www.play4all.net/highscores_tmp.php?gameid=395&type=daily"));
};
if (scoreLevel == 2){
navigateToURL(new URLRequest("http://www.play4all.net/highscores_tmp.php?gameid=396&type=daily"));
};
if (scoreLevel == 3){
navigateToURL(new URLRequest("http://www.play4all.net/highscores_tmp.php?gameid=397&type=daily"));
};
}
public function handleMenuSelection(_arg1:ContextMenuEvent):void{
var _local2:URLRequest;
var _local3:URLRequest;
var _local4:URLRequest;
var _local5:URLRequest;
switch (myMenu.selectedMenu){
case "Shape Escape Extended":
_local2 = new URLRequest("http://plumpman.newgrounds.com/");
navigateToURL(_local2);
break;
case "A Game By Nicolas 'Plumpman' Picouet":
_local3 = new URLRequest("http://plumpman.newgrounds.com/");
navigateToURL(_local3);
break;
case "Graphics By Chris 'Slasher145' Jeffrey":
_local4 = new URLRequest("http://slasher145.newgrounds.com/");
navigateToURL(_local4);
break;
case "Music By Davide 'No1r' Cecchi":
_local5 = new URLRequest("http://no1r.newgrounds.com/");
navigateToURL(_local5);
break;
case "Controls":
MenuInfo_mc.MenuInfo.text = "Controls: \n Use the Left and Right Arrow Keys to Move. \n You can also use A and D to move.";
MenuInfo_mc.alpha = 1;
addChild(MenuInfo_mc);
break;
case "Objectives":
MenuInfo_mc.MenuInfo.text = "Objectives: \n Reach the Golden Exit. \n Get the least amount of deaths, because your deaths are tallied for a highscore board at the end!";
MenuInfo_mc.alpha = 1;
addChild(MenuInfo_mc);
break;
case "Block Types":
MenuInfo_mc.MenuInfo.text = ((((("Block Types: \n" + block1) + block2) + block3) + block4) + block5);
MenuInfo_mc.alpha = 1;
addChild(MenuInfo_mc);
break;
case "Quit Information Screen":
MenuInfo_mc.MenuInfo.text = "";
MenuInfo_mc.alpha = 0;
removeChild(MenuInfo_mc);
break;
case "Start Music":
BGMsc.stop();
BGMsc = BGM.play(1, 100);
break;
case "Stop Music":
BGMsc.stop();
break;
case "Quit to Main Menu":
currLevelName = "";
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
addEventListener(Event.ENTER_FRAME, run);
gotoAndStop(4);
MenuInfo_mc.MenuInfo.text = "";
MenuInfo_mc.alpha = 0;
break;
};
}
public function check_coll(_arg1:CollisionEvent):void{
var _local2:*;
_local2 = _arg1.collidingItem.sprite.name;
if ((((_local2 == "exit")) && ((currLevel == 1)))){
currLevel++;
currLevelName = "Getting your feet wet";
wheelx = 100;
wheely = 100;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 120, 200, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(190, 120, 40, 10, -0.4, true, 1, 0.15);
wall3 = new RectangleParticle(300, 250, 10, 300, 0, true, 1, 0.15);
wall4 = new RectangleParticle(450, 280, 200, 10, 0, true, 1, 0.15);
wall5 = new RectangleParticle(550, 280, 10, 100, 0, true, 1, 0.15);
exit = new RectangleParticle(350, 440, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit2";
wall1.setDisplay(blue200x10A, 0, 0, 0);
wall2.setDisplay(blue40x10A, 0, 0, 0);
wall3.setDisplay(blue10x300A, 0, 0, 0);
wall4.setDisplay(blue200x10B, 0, 0, 0);
wall5.setDisplay(blue10x100A, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit2")) && ((currLevel == 2)))){
currLevel++;
currLevelName = "Mind the Gap";
wheelx = 50;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 100, 200, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(200, 150, 100, 10, 0, true, 1, 0.15);
wall3 = new RectangleParticle(300, 200, 100, 10, 0, true, 1, 0.15);
wall4 = new RectangleParticle(400, 250, 100, 10, 0, true, 1, 0.15);
wall5 = new RectangleParticle(500, 300, 100, 10, 0, true, 1, 0.15);
exit = new RectangleParticle(550, 440, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit3";
wall1.setDisplay(blue200x10A, 0, 0, 0);
wall2.setDisplay(blue100x10A, 0, 0, 0);
wall3.setDisplay(blue100x10B, 0, 0, 0);
wall4.setDisplay(blue100x10C, 0, 0, 0);
wall5.setDisplay(blue100x10D, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit3")) && ((currLevel == 3)))){
block3 = "Green - Bounce Block \n";
block5 = "\n Remember, left-click to rotate all green blocks! \n";
bounceIntro.text = "Left-Click to rotate all green blocks! These blocks are bouncy!";
currLevel++;
currLevelName = "Green for Go!";
wheelx = 50;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 100, 300, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(550, 400, 100, 10, 0, true, 1, 0.15);
wall3 = new RectangleParticle(300, 200, 100, 10, -0.5, true, 1, 0.15);
wall4 = new RectangleParticle(400, 450, 50, 10, -0.7854, true, 1, 1);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(200, 300, 200, 10, 0.5, true, 1, 0.15);
exit = new RectangleParticle(590, 220, 10, 50, 0, true, 1, 0.15);
exit.sprite.name = "exit4";
wall1.setDisplay(blue300x10A, 0, 0, 0);
wall2.setDisplay(blue100x10A, 0, 0, 0);
wall3.setDisplay(blue100x10B, 0, 0, 0);
wall4.setDisplay(green50x10A, 0, 0, 0);
wall5.setDisplay(blue200x10A, 0, 0, 0);
exit.setDisplay(exit10x50, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit4")) && ((currLevel == 4)))){
bounceIntro.text = "";
currLevel++;
currLevelName = "Power Trip";
wheelx = 50;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(50, 120, 200, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(400, 100, 150, 10, 0, true, 1, 0.15);
wall3 = new RectangleParticle(470, 240, 10, 150, 0, true, 1, 0.15);
wall4 = new RectangleParticle(400, 40, 150, 10, 0, true, 1, 0.15);
wall5 = new RectangleParticle(200, 450, 80, 10, -0.7854, true, 1, 0.8);
wall5.sprite.name = "Bounce";
exit = new RectangleParticle(500, 340, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit5";
wall1.setDisplay(blue200x10A, 0, 0, 0);
wall2.setDisplay(blue150x10A, 0, 0, 0);
wall3.setDisplay(blue10x150A, 0, 0, 0);
wall4.setDisplay(blue150x10B, 0, 0, 0);
wall5.setDisplay(green80x10A, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit5")) && ((currLevel == 5)))){
currLevel++;
currLevelName = "sdrawkcaB";
wheelx = 50;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 100, 300, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(500, 200, 300, 10, 0, true, 1, 0.15);
wall3 = new RectangleParticle(500, 480, 200, 10, 0, true, 1, 0.15);
wall4 = new RectangleParticle(200, 450, 50, 10, 0, true, 1, 0.8);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(580, 400, 10, 200, 0, true, 1, 0.15);
exit = new RectangleParticle(500, 470, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit6";
wall1.setDisplay(blue300x10A, 0, 0, 0);
wall2.setDisplay(blue300x10B, 0, 0, 0);
wall3.setDisplay(blue200x10A, 0, 0, 0);
wall4.setDisplay(green50x10A, 0, 0, 0);
wall5.setDisplay(blue10x200A, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit6")) && ((currLevel == 6)))){
currLevel++;
currLevelName = "SsSsSerpent";
wheelx = 50;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 100, 300, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(300, 200, 200, 10, 0.2, true, 1, 0.15);
wall3 = new RectangleParticle(350, 380, 200, 10, -0.2, true, 1, 0.15);
wall4 = new RectangleParticle(200, 420, 50, 10, 0.2, true, 1, 0.15);
wall5 = new RectangleParticle(250, 300, 300, 10, -0.2, true, 1, 0.15);
exit = new RectangleParticle(170, 450, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit7";
wall1.setDisplay(blue300x10A, 0, 0, 0);
wall2.setDisplay(blue200x10A, 0, 0, 0);
wall3.setDisplay(blue200x10B, 0, 0, 0);
wall4.setDisplay(blue50x10A, 0, 0, 0);
wall5.setDisplay(blue300x10B, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit7")) && ((currLevel == 7)))){
currLevel++;
currLevelName = "Minor Leap";
wheelx = 50;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 100, 200, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(230, 200, 50, 10, 0, true, 1, 0.15);
wall3 = new RectangleParticle(320, 300, 50, 10, 0, true, 1, 0.15);
wall4 = new RectangleParticle(400, 400, 50, 10, 0.7854, true, 1, 1);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(500, 300, 10, 100, 0, true, 1, 0.15);
exit = new RectangleParticle(550, 300, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit8";
wall1.setDisplay(blue200x10A, 0, 0, 0);
wall2.setDisplay(blue50x10A, 0, 0, 0);
wall3.setDisplay(blue50x10B, 0, 0, 0);
wall4.setDisplay(green50x10A, 0, 0, 0);
wall5.setDisplay(blue10x100A, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit8")) && ((currLevel == 8)))){
block4 = "Black - Tar Block \n";
tarIntro.text = "Watch it! Tar slows you down!";
currLevel++;
currLevelName = "Get Stuck Yet?";
wheelx = 50;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 100, 300, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(200, 200, 200, 10, 0, true, 1, 0.1, 0.05);
wall3 = new RectangleParticle(400, 350, 80, 10, -0.7854, true, 1, 0.8);
wall3.sprite.name = "Bounce";
wall4 = new RectangleParticle(200, 420, 50, 10, 0.2, true, 1, 0.15);
wall5 = new RectangleParticle(250, 300, 300, 10, -0.2, true, 1, 0.15);
exit = new RectangleParticle(430, 50, 100, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit9";
wall1.setDisplay(blue300x10A, 0, 0, 0);
wall2.setDisplay(black200x10A, 0, 0, 0);
wall3.setDisplay(green80x10A, 0, 0, 0);
wall4.setDisplay(blue50x10A, 0, 0, 0);
wall5.setDisplay(blue300x10B, 0, 0, 0);
exit.setDisplay(exit100x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit9")) && ((currLevel == 9)))){
tarIntro.text = "";
currLevel++;
currLevelName = "Shades of Green";
wheelx = 60;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 100, 100, 10, 0, true, 1, 0.1, 0.05);
wall2 = new RectangleParticle(200, 250, 10, 100, 0, true, 1, 0.6);
wall2.sprite.name = "Bounce";
wall3 = new RectangleParticle(400, 250, 10, 100, 0, true, 1, 0.6);
wall3.sprite.name = "Bounce";
wall4 = new RectangleParticle(300, 350, 100, 10, 0, true, 1, 0.6);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(300, 150, 100, 10, 0, true, 1, 0.6);
wall5.sprite.name = "Bounce";
exit = new RectangleParticle(300, 250, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit10";
wall1.setDisplay(black100x10A, 0, 0, 0);
wall2.setDisplay(green10x100A, 0, 0, 0);
wall3.setDisplay(green10x100B, 0, 0, 0);
wall4.setDisplay(green100x10A, 0, 0, 0);
wall5.setDisplay(green100x10B, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit10")) && ((currLevel == 10)))){
currLevelName = "";
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
if (unlocked < 2){
unlocked = 2;
};
removeEventListener(Event.ENTER_FRAME, run);
scoreLevel = 1;
gotoAndStop(6);
MenuInfo_mc.MenuInfo.text = "";
MenuInfo_mc.alpha = 0;
};
if ((((_local2 == "exit11")) && ((currLevel == 11)))){
currLevel++;
currLevelName = "Rebounce";
wheelx = 300;
wheely = 430;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(300, 450, 200, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(200, 450, 10, 100, 0, true, 1, 0.6);
wall2.sprite.name = "Bounce";
wall3 = new RectangleParticle(400, 450, 10, 100, 0, true, 1, 0.6);
wall3.sprite.name = "Bounce";
wall4 = new RectangleParticle(300, 350, 100, 10, 0, true, 1, 0.6);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(300, 150, 100, 10, 0, true, 1, 0.6);
wall5.sprite.name = "Bounce";
exit = new RectangleParticle(300, 200, 300, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit12";
wall1.setDisplay(blue200x10A, 0, 0, 0);
wall2.setDisplay(green10x100A, 0, 0, 0);
wall3.setDisplay(green10x100B, 0, 0, 0);
wall4.setDisplay(green100x10A, 0, 0, 0);
wall5.setDisplay(green100x10B, 0, 0, 0);
exit.setDisplay(exit300x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit12")) && ((currLevel == 12)))){
currLevel++;
currLevelName = "Flying V";
wheelx = 100;
wheely = 180;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 200, 200, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(250, 220, 100, 10, 0.2, true, 1, 0.1, 0.05);
wall3 = new RectangleParticle(450, 450, 100, 10, -0.7854, true, 1, 0.9);
wall3.sprite.name = "Bounce";
wall4 = new RectangleParticle(400, 450, 100, 10, 0.7854, true, 1, 0.9);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(300, 150, 10, 100, 0, true, 1, 0.6);
wall5.sprite.name = "Bounce";
exit = new RectangleParticle(250, 150, 100, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit13";
wall1.setDisplay(blue200x10A, 0, 0, 0);
wall2.setDisplay(black100x10A, 0, 0, 0);
wall3.setDisplay(green100x10A, 0, 0, 0);
wall4.setDisplay(green100x10B, 0, 0, 0);
wall5.setDisplay(green10x100A, 0, 0, 0);
exit.setDisplay(exit100x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit13")) && ((currLevel == 13)))){
currLevel++;
currLevelName = "Major Leap";
wheelx = 80;
wheely = 330;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 350, 100, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(300, 450, 200, 10, 0, true, 1, 0.8);
wall2.sprite.name = "Bounce";
wall3 = new RectangleParticle(250, 50, 300, 10, 0, true, 1, 0.15);
wall4 = new RectangleParticle(400, 300, 10, 200, 0, true, 1, 0.15);
wall5 = new RectangleParticle(300, 150, 100, 10, 0, true, 1, 0.15);
exit = new RectangleParticle(500, 350, 100, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit14";
wall1.setDisplay(blue100x10A, 0, 0, 0);
wall2.setDisplay(green200x10A, 0, 0, 0);
wall3.setDisplay(blue300x10A, 0, 0, 0);
wall4.setDisplay(blue10x200A, 0, 0, 0);
wall5.setDisplay(blue100x10B, 0, 0, 0);
exit.setDisplay(exit100x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit14")) && ((currLevel == 14)))){
currLevel++;
currLevelName = "Ricochet";
wheelx = 80;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 100, 200, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(200, 150, 100, 10, 0, true, 1, 0.1, 0.05);
wall3 = new RectangleParticle(300, 450, 100, 10, -0.7854, true, 1, 0.75);
wall3.sprite.name = "Bounce";
wall4 = new RectangleParticle(400, 300, 100, 10, 0.7854, true, 1, 0.75);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(500, 150, 100, 10, 0, true, 1, 0.75);
wall5.sprite.name = "Bounce";
exit = new RectangleParticle(450, 50, 100, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit15";
wall1.setDisplay(blue200x10A, 0, 0, 0);
wall2.setDisplay(black100x10A, 0, 0, 0);
wall3.setDisplay(green100x10A, 0, 0, 0);
wall4.setDisplay(green100x10B, 0, 0, 0);
wall5.setDisplay(green100x10C, 0, 0, 0);
exit.setDisplay(exit100x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit15")) && ((currLevel == 15)))){
currLevel++;
currLevelName = "Twice the Tier";
wheelx = 300;
wheely = 230;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(300, 250, 200, 10, 0, true, 1, 0.75);
wall1.sprite.name = "Bounce";
wall2 = new RectangleParticle(200, 200, 10, 100, 0, true, 1, 0.1, 0.05);
wall3 = new RectangleParticle(400, 200, 10, 100, 0, true, 1, 0.1, 0.05);
wall4 = new RectangleParticle(300, 450, 10, 200, 0, true, 1, 0.75);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(500, 230, 200, 10, 0, true, 1, 0.15);
exit = new RectangleParticle(500, 200, 100, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit16";
wall1.setDisplay(green200x10A, 0, 0, 0);
wall2.setDisplay(black10x100A, 0, 0, 0);
wall3.setDisplay(black10x100B, 0, 0, 0);
wall4.setDisplay(green10x200A, 0, 0, 0);
wall5.setDisplay(blue200x10A, 0, 0, 0);
exit.setDisplay(exit100x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit16")) && ((currLevel == 16)))){
currLevel++;
currLevelName = "Be Very Squared";
wheelx = 80;
wheely = 230;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 250, 200, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(300, 250, 100, 100, 0, true, 1, 0.15);
wall3 = new RectangleParticle(100, 350, 200, 10, 0, true, 1, 0.15);
wall4 = new RectangleParticle(300, 450, 10, 100, 0, true, 1, 0.75);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(500, 350, 100, 10, 0, true, 1, 0.75);
wall5.sprite.name = "Bounce";
exit = new RectangleParticle(360, 225, 10, 50, 0, true, 1, 0.15);
exit.sprite.name = "exit17";
wall1.setDisplay(blue200x10A, 0, 0, 0);
wall2.setDisplay(blue100x100A, 0, 0, 0);
wall3.setDisplay(blue200x10B, 0, 0, 0);
wall4.setDisplay(green10x100A, 0, 0, 0);
wall5.setDisplay(green100x10A, 0, 0, 0);
exit.setDisplay(exit10x50, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit17")) && ((currLevel == 17)))){
currLevel++;
currLevelName = "Ventilation";
wheelx = 40;
wheely = 230;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(300, 250, 800, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(100, 200, 100, 10, 0, true, 1, 0.6);
wall2.sprite.name = "Bounce";
wall3 = new RectangleParticle(300, 200, 100, 10, 0.7854, true, 1, 0.8);
wall3.sprite.name = "Bounce";
wall4 = new RectangleParticle(200, 220, 10, 100, 0, true, 1, 0.8);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(450, 200, 10, 100, 0, true, 1, 0.15);
exit = new RectangleParticle(550, 200, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit18";
wall1.setDisplay(blue800x10A, 0, 0, 0);
wall2.setDisplay(green100x10A, 0, 0, 0);
wall3.setDisplay(green100x10B, 0, 0, 0);
wall4.setDisplay(green10x100A, 0, 0, 0);
wall5.setDisplay(blue10x100A, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit18")) && ((currLevel == 18)))){
currLevel++;
currLevelName = "Corridors";
wheelx = 220;
wheely = 230;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(200, 250, 400, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(250, 400, 100, 100, 0, true, 1, 0.15);
wall3 = new RectangleParticle(500, 300, 100, 10, 0, true, 1, 0.75);
wall3.sprite.name = "Bounce";
wall4 = new RectangleParticle(350, 475, 100, 10, 0, true, 1, 0.75);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(200, 450, 200, 10, 0, true, 1, 0.15);
exit = new RectangleParticle(150, 440, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit19";
wall1.setDisplay(blue400x10A, 0, 0, 0);
wall2.setDisplay(blue100x100A, 0, 0, 0);
wall3.setDisplay(green100x10A, 0, 0, 0);
wall4.setDisplay(green100x10B, 0, 0, 0);
wall5.setDisplay(blue200x10A, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit19")) && ((currLevel == 19)))){
currLevel++;
currLevelName = "Leaps and Bounds";
wheelx = 300;
wheely = 40;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(300, 150, 10, 200, 0, true, 1, 0.15);
wall2 = new RectangleParticle(360, 200, 100, 100, 0, true, 1, 0.15);
wall3 = new RectangleParticle(500, 400, 100, 10, 0, true, 1, 0.75);
wall3.sprite.name = "Bounce";
wall4 = new RectangleParticle(310, 350, 10, 100, -0.7854, true, 1, 0.75);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(240, 200, 100, 100, 0, true, 1, 0.15);
exit = new RectangleParticle(300, 275, 10, 50, 0, true, 1, 0.15);
exit.sprite.name = "exit20";
wall1.setDisplay(blue10x200A, 0, 0, 0);
wall2.setDisplay(blue100x100A, 0, 0, 0);
wall3.setDisplay(green100x10A, 0, 0, 0);
wall4.setDisplay(green10x100A, 0, 0, 0);
wall5.setDisplay(blue100x100B, 0, 0, 0);
exit.setDisplay(exit10x50, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit20")) && ((currLevel == 20)))){
currLevelName = "";
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
if (unlocked < 3){
unlocked = 3;
};
removeEventListener(Event.ENTER_FRAME, run);
scoreLevel = 2;
gotoAndStop(6);
MenuInfo_mc.MenuInfo.text = "";
MenuInfo_mc.alpha = 0;
};
if ((((_local2 == "exit21")) && ((currLevel == 21)))){
currLevel++;
currLevelName = "Falling Up";
wheelx = 60;
wheely = 180;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 200, 100, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(200, 400, 100, 10, 0, true, 1, 0.8);
wall2.sprite.name = "Bounce";
wall3 = new RectangleParticle(300, 300, 100, 10, -0.7854, true, 1, 0.8);
wall3.sprite.name = "Bounce";
wall4 = new RectangleParticle(400, 200, 10, 100, 0, true, 1, 1);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(500, 100, 100, 10, 0.7854, true, 1, 1);
wall5.sprite.name = "Bounce";
exit = new RectangleParticle(500, 40, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit22";
wall1.setDisplay(blue100x10A, 0, 0, 0);
wall2.setDisplay(green100x10A, 0, 0, 0);
wall3.setDisplay(green100x10B, 0, 0, 0);
wall4.setDisplay(green10x100A, 0, 0, 0);
wall5.setDisplay(green100x10C, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit22")) && ((currLevel == 22)))){
currLevel++;
currLevelName = "Sticky Situation";
wheelx = 60;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 100, 100, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(200, 200, 40, 10, 0, true, 1, 0.1, 0.05);
wall3 = new RectangleParticle(250, 300, 40, 10, 0, true, 1, 0.1, 0.05);
wall4 = new RectangleParticle(300, 450, 100, 10, 0, true, 1, 0.75);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(250, 315, 80, 10, 0, true, 1, 0.15);
exit = new RectangleParticle(250, 325, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit23";
wall1.setDisplay(blue100x10A, 0, 0, 0);
wall2.setDisplay(black40x10A, 0, 0, 0);
wall3.setDisplay(black40x10B, 0, 0, 0);
wall4.setDisplay(green100x10A, 0, 0, 0);
wall5.setDisplay(blue80x10A, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit23")) && ((currLevel == 23)))){
currLevel++;
currLevelName = "Calm Before the Storm";
wheelx = 100;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 100, 50, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(200, 250, 50, 10, -0.7854, true, 1, 0.8);
wall2.sprite.name = "Bounce";
wall3 = new RectangleParticle(300, 100, 100, 10, 0, true, 1, 0.15);
wall4 = new RectangleParticle(250, 210, 10, 200, 0, true, 1, 0.1, 0.05);
wall5 = new RectangleParticle(400, 120, 100, 10, 0.7854, true, 1, 0.8);
wall5.sprite.name = "Bounce";
exit = new RectangleParticle(280, 250, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit24";
wall1.setDisplay(blue50x10A, 0, 0, 0);
wall2.setDisplay(green50x10A, 0, 0, 0);
wall3.setDisplay(blue100x10A, 0, 0, 0);
wall4.setDisplay(black10x200A, 0, 0, 0);
wall5.setDisplay(green100x10A, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit24")) && ((currLevel == 24)))){
currLevel++;
currLevelName = "The Storm";
wheelx = 100;
wheely = 80;
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
wall1 = new RectangleParticle(100, 100, 50, 10, 0, true, 1, 0.15);
wall2 = new RectangleParticle(200, 200, 40, 10, -0.7854, true, 1, 0.75);
wall2.sprite.name = "Bounce";
wall3 = new RectangleParticle(450, 200, 200, 10, -0.6, true, 1, 0.1, 0.05);
wall4 = new RectangleParticle(400, 150, 50, 10, 0.7854, true, 1, 0.75);
wall4.sprite.name = "Bounce";
wall5 = new RectangleParticle(580, 150, 10, 200, 0, true, 1, 0.1, 0.05);
exit = new RectangleParticle(540, 290, 50, 10, 0, true, 1, 0.15);
exit.sprite.name = "exit25";
wall1.setDisplay(blue50x10A, 0, 0, 0);
wall2.setDisplay(green20x10A, 0, 0, 0);
wall3.setDisplay(black200x10A, 0, 0, 0);
wall4.setDisplay(green50x10A, 0, 0, 0);
wall5.setDisplay(black10x200A, 0, 0, 0);
exit.setDisplay(exit50x10, 0, 0, 0);
wheel1 = new WheelParticle(wheelx, wheely, 10, false, 1, 0.3, 0);
wheel1.setDisplay(playerBall, 0, 0, 0);
wheel1.addEventListener(CollisionEvent.COLLIDE, check_coll);
group1.addParticle(wall1);
group1.addParticle(wall2);
group1.addParticle(wall3);
group1.addParticle(wall4);
group1.addParticle(wall5);
group1.addParticle(exit);
group1.addParticle(wheel1);
};
if ((((_local2 == "exit25")) && ((currLevel == 25)))){
currLevelName = "";
group1.removeParticle(wall1);
group1.removeParticle(wall2);
group1.removeParticle(wall3);
group1.removeParticle(wall4);
group1.removeParticle(wall5);
group1.removeParticle(exit);
group1.removeParticle(wheel1);
if (unlocked < 4){
unlocked = 4;
};
removeEventListener(Event.ENTER_FRAME, run);
scoreLevel = 3;
gotoAndStop(6);
MenuInfo_mc.MenuInfo.text = "";
MenuInfo_mc.alpha = 0;
};
}
public function buttonPressed5(_arg1:MouseEvent){
var _local2:String;
var _local3:URLRequest;
var _local4:*;
_local2 = "http://www.play4all.net/highscores/submit/play4scores.php";
_local3 = new URLRequest(_local2);
_local3.method = URLRequestMethod.POST;
_local4 = new URLVariables();
if (scoreLevel == 1){
_local4.game_id = 395;
};
if (scoreLevel == 2){
_local4.game_id = 396;
};
if (scoreLevel == 3){
_local4.game_id = 397;
};
_local4.user_id = nm.text;
_local4.score = currDeaths;
_local3.data = _local4;
sendToURL(_local3);
nm.text = "";
removeChild(nm);
removeChild(SubmitButton);
submitscoreinfo.text = "Score Submitted!";
}
}
}//package ShapeEscapeExtended_Mochi_fla
Section 25
//MenuInfo_mc_4 (ShapeEscapeExtended_Mochi_fla.MenuInfo_mc_4)
package ShapeEscapeExtended_Mochi_fla {
import flash.display.*;
import flash.text.*;
public dynamic class MenuInfo_mc_4 extends MovieClip {
public var MenuInfo:TextField;
}
}//package ShapeEscapeExtended_Mochi_fla
Section 26
//play4allintro_5 (ShapeEscapeExtended_Mochi_fla.play4allintro_5)
package ShapeEscapeExtended_Mochi_fla {
import flash.display.*;
import flash.events.*;
public dynamic class play4allintro_5 extends MovieClip {
public var goButton:SimpleButton;
public function play4allintro_5(){
addFrameScript(252, frame253);
}
public function buttonPressed4(_arg1:MouseEvent){
MovieClip(parent).gotoAndStop(4);
}
function frame253(){
stop();
goButton.addEventListener(MouseEvent.MOUSE_UP, buttonPressed4);
}
}
}//package ShapeEscapeExtended_Mochi_fla
Section 27
//subline_7 (ShapeEscapeExtended_Mochi_fla.subline_7)
package ShapeEscapeExtended_Mochi_fla {
import flash.display.*;
public dynamic class subline_7 extends MovieClip {
public function subline_7(){
addFrameScript(45, frame46);
}
function frame46(){
stop();
}
}
}//package ShapeEscapeExtended_Mochi_fla
Section 28
//back (back)
package {
import flash.display.*;
public dynamic class back extends MovieClip {
}
}//package
Section 29
//BGMusic (BGMusic)
package {
import flash.media.*;
public dynamic class BGMusic extends Sound {
}
}//package
Section 30
//blackBlock100x10 (blackBlock100x10)
package {
import flash.display.*;
public dynamic class blackBlock100x10 extends MovieClip {
}
}//package
Section 31
//blackBlock10x100 (blackBlock10x100)
package {
import flash.display.*;
public dynamic class blackBlock10x100 extends MovieClip {
}
}//package
Section 32
//blackBlock10x200 (blackBlock10x200)
package {
import flash.display.*;
public dynamic class blackBlock10x200 extends MovieClip {
}
}//package
Section 33
//blackBlock200x10 (blackBlock200x10)
package {
import flash.display.*;
public dynamic class blackBlock200x10 extends MovieClip {
}
}//package
Section 34
//blackBlock40x10 (blackBlock40x10)
package {
import flash.display.*;
public dynamic class blackBlock40x10 extends MovieClip {
}
}//package
Section 35
//blueBlock100x10 (blueBlock100x10)
package {
import flash.display.*;
public dynamic class blueBlock100x10 extends MovieClip {
}
}//package
Section 36
//blueBlock100x100 (blueBlock100x100)
package {
import flash.display.*;
public dynamic class blueBlock100x100 extends MovieClip {
}
}//package
Section 37
//blueBlock10x100 (blueBlock10x100)
package {
import flash.display.*;
public dynamic class blueBlock10x100 extends MovieClip {
}
}//package
Section 38
//blueBlock10x150 (blueBlock10x150)
package {
import flash.display.*;
public dynamic class blueBlock10x150 extends MovieClip {
}
}//package
Section 39
//blueBlock10x200 (blueBlock10x200)
package {
import flash.display.*;
public dynamic class blueBlock10x200 extends MovieClip {
}
}//package
Section 40
//blueBlock10x300 (blueBlock10x300)
package {
import flash.display.*;
public dynamic class blueBlock10x300 extends MovieClip {
}
}//package
Section 41
//blueBlock150x10 (blueBlock150x10)
package {
import flash.display.*;
public dynamic class blueBlock150x10 extends MovieClip {
}
}//package
Section 42
//blueBlock200x10 (blueBlock200x10)
package {
import flash.display.*;
public dynamic class blueBlock200x10 extends MovieClip {
}
}//package
Section 43
//blueBlock300x10 (blueBlock300x10)
package {
import flash.display.*;
public dynamic class blueBlock300x10 extends MovieClip {
}
}//package
Section 44
//blueBlock400x10 (blueBlock400x10)
package {
import flash.display.*;
public dynamic class blueBlock400x10 extends MovieClip {
}
}//package
Section 45
//blueBlock40x10 (blueBlock40x10)
package {
import flash.display.*;
public dynamic class blueBlock40x10 extends MovieClip {
}
}//package
Section 46
//blueBlock50x10 (blueBlock50x10)
package {
import flash.display.*;
public dynamic class blueBlock50x10 extends MovieClip {
}
}//package
Section 47
//blueBlock800x10 (blueBlock800x10)
package {
import flash.display.*;
public dynamic class blueBlock800x10 extends MovieClip {
}
}//package
Section 48
//blueBlock80x10 (blueBlock80x10)
package {
import flash.display.*;
public dynamic class blueBlock80x10 extends MovieClip {
}
}//package
Section 49
//exitBlock100x10 (exitBlock100x10)
package {
import flash.display.*;
public dynamic class exitBlock100x10 extends MovieClip {
}
}//package
Section 50
//exitBlock10x50 (exitBlock10x50)
package {
import flash.display.*;
public dynamic class exitBlock10x50 extends MovieClip {
}
}//package
Section 51
//exitBlock300x10 (exitBlock300x10)
package {
import flash.display.*;
public dynamic class exitBlock300x10 extends MovieClip {
}
}//package
Section 52
//exitBlock50x10 (exitBlock50x10)
package {
import flash.display.*;
public dynamic class exitBlock50x10 extends MovieClip {
}
}//package
Section 53
//greenBlock100x10 (greenBlock100x10)
package {
import flash.display.*;
public dynamic class greenBlock100x10 extends MovieClip {
}
}//package
Section 54
//greenBlock10x100 (greenBlock10x100)
package {
import flash.display.*;
public dynamic class greenBlock10x100 extends MovieClip {
}
}//package
Section 55
//greenBlock10x200 (greenBlock10x200)
package {
import flash.display.*;
public dynamic class greenBlock10x200 extends MovieClip {
}
}//package
Section 56
//greenBlock200x10 (greenBlock200x10)
package {
import flash.display.*;
public dynamic class greenBlock200x10 extends MovieClip {
}
}//package
Section 57
//greenBlock20x10 (greenBlock20x10)
package {
import flash.display.*;
public dynamic class greenBlock20x10 extends MovieClip {
}
}//package
Section 58
//greenBlock50x10 (greenBlock50x10)
package {
import flash.display.*;
public dynamic class greenBlock50x10 extends MovieClip {
}
}//package
Section 59
//greenBlock60x10 (greenBlock60x10)
package {
import flash.display.*;
public dynamic class greenBlock60x10 extends MovieClip {
}
}//package
Section 60
//greenBlock80x10 (greenBlock80x10)
package {
import flash.display.*;
public dynamic class greenBlock80x10 extends MovieClip {
}
}//package
Section 61
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.5");
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var sendHostProgress:Boolean;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
setTimeout(options.ad_finished, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 62
//player (player)
package {
import flash.display.*;
public dynamic class player extends MovieClip {
public function player(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 63
//playerRed (playerRed)
package {
import flash.display.*;
public dynamic class playerRed extends MovieClip {
public function playerRed(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package