Section 1
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2CircleDef extends b2ShapeDef {
public var localPosition:b2Vec2;
public var radius:Number;
public function b2CircleDef(){
localPosition = new b2Vec2(0, 0);
super();
type = b2Shape.e_circleShape;
radius = 1;
}
}
}//package Box2D.Collision.Shapes
Section 2
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2CircleShape extends b2Shape {
public var m_radius:Number;
public var m_localPosition:b2Vec2;
public function b2CircleShape(_arg1:b2ShapeDef){
var _local2:b2CircleDef;
m_localPosition = new b2Vec2();
super(_arg1);
_local2 = (_arg1 as b2CircleDef);
m_type = e_circleShape;
m_localPosition.SetV(_local2.localPosition);
m_radius = _local2.radius;
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
_local3 = _arg1.R;
_local4 = (_arg1.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
_local5 = (_arg1.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_local4 = (_arg2.x - _local4);
_local5 = (_arg2.y - _local5);
return ((((_local4 * _local4) + (_local5 * _local5)) <= (m_radius * m_radius)));
}
public function GetLocalPosition():b2Vec2{
return (m_localPosition);
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):int{
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local6 = _arg1.R;
_local7 = (_arg1.position.x + ((_local6.col1.x * m_localPosition.x) + (_local6.col2.x * m_localPosition.y)));
_local8 = (_arg1.position.y + ((_local6.col1.y * m_localPosition.x) + (_local6.col2.y * m_localPosition.y)));
_local9 = (_arg4.p1.x - _local7);
_local10 = (_arg4.p1.y - _local8);
_local11 = (((_local9 * _local9) + (_local10 * _local10)) - (m_radius * m_radius));
if (_local11 < 0){
_arg2[0] = 0;
return (e_startsInsideCollide);
};
_local12 = (_arg4.p2.x - _arg4.p1.x);
_local13 = (_arg4.p2.y - _arg4.p1.y);
_local14 = ((_local9 * _local12) + (_local10 * _local13));
_local15 = ((_local12 * _local12) + (_local13 * _local13));
_local16 = ((_local14 * _local14) - (_local15 * _local11));
if ((((_local16 < 0)) || ((_local15 < Number.MIN_VALUE)))){
return (e_missCollide);
};
_local17 = -((_local14 + Math.sqrt(_local16)));
if ((((0 <= _local17)) && ((_local17 <= (_arg5 * _local15))))){
_local17 = (_local17 / _local15);
_arg2[0] = _local17;
_arg3.x = (_local9 + (_local17 * _local12));
_arg3.y = (_local10 + (_local17 * _local13));
_arg3.Normalize();
return (e_hitCollide);
};
return (e_missCollide);
}
override public function ComputeMass(_arg1:b2MassData):void{
_arg1.mass = (((m_density * b2Settings.b2_pi) * m_radius) * m_radius);
_arg1.center.SetV(m_localPosition);
_arg1.I = (_arg1.mass * (((0.5 * m_radius) * m_radius) + ((m_localPosition.x * m_localPosition.x) + (m_localPosition.y * m_localPosition.y))));
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = _arg2.R;
_local5 = (_arg2.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
_local6 = (_arg2.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_local4 = _arg3.R;
_local7 = (_arg3.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
_local8 = (_arg3.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((((_local5 < _local7)) ? _local5 : _local7 - m_radius), (((_local6 < _local8)) ? _local6 : _local8 - m_radius));
_arg1.upperBound.Set((((_local5 > _local7)) ? _local5 : _local7 + m_radius), (((_local6 > _local8)) ? _local6 : _local8 + m_radius));
}
public function GetRadius():Number{
return (m_radius);
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:Number;
var _local3:Number;
_local2 = (m_localPosition.x - _arg1.x);
_local3 = (m_localPosition.y - _arg1.y);
_local2 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
m_sweepRadius = ((_local2 + m_radius) - b2Settings.b2_toiSlop);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.R;
_local4 = (_arg2.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
_local5 = (_arg2.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((_local4 - m_radius), (_local5 - m_radius));
_arg1.upperBound.Set((_local4 + m_radius), (_local5 + m_radius));
}
}
}//package Box2D.Collision.Shapes
Section 3
//b2FilterData (Box2D.Collision.Shapes.b2FilterData)
package Box2D.Collision.Shapes {
public class b2FilterData {
public var maskBits:uint;// = 0xFFFF
public var groupIndex:int;// = 0
public var categoryBits:uint;// = 1
public function b2FilterData(){
categoryBits = 1;
maskBits = 0xFFFF;
groupIndex = 0;
super();
}
public function Copy():b2FilterData{
var _local1:b2FilterData;
_local1 = new b2FilterData();
_local1.categoryBits = categoryBits;
_local1.maskBits = maskBits;
_local1.groupIndex = groupIndex;
return (_local1);
}
}
}//package Box2D.Collision.Shapes
Section 4
//b2MassData (Box2D.Collision.Shapes.b2MassData)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2MassData {
public var mass:Number;// = 0
public var center:b2Vec2;
public var I:Number;// = 0
public function b2MassData(){
mass = 0;
center = new b2Vec2(0, 0);
I = 0;
super();
}
}
}//package Box2D.Collision.Shapes
Section 5
//b2PolygonDef (Box2D.Collision.Shapes.b2PolygonDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PolygonDef extends b2ShapeDef {
public var vertexCount:int;
public var vertices:Array;
private static var s_mat:b2Mat22 = new b2Mat22();
public function b2PolygonDef(){
var _local1:int;
vertices = new Array(b2Settings.b2_maxPolygonVertices);
super();
type = b2Shape.e_polygonShape;
vertexCount = 0;
_local1 = 0;
while (_local1 < b2Settings.b2_maxPolygonVertices) {
vertices[_local1] = new b2Vec2();
_local1++;
};
}
public function SetAsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):void{
var _local5:b2Vec2;
var _local6:b2Mat22;
var _local7:int;
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
if (_arg3){
_local5 = _arg3;
_local6 = s_mat;
_local6.Set(_arg4);
_local7 = 0;
while (_local7 < vertexCount) {
_arg3 = vertices[_local7];
_arg1 = (_local5.x + ((_local6.col1.x * _arg3.x) + (_local6.col2.x * _arg3.y)));
_arg3.y = (_local5.y + ((_local6.col1.y * _arg3.x) + (_local6.col2.y * _arg3.y)));
_arg3.x = _arg1;
_local7++;
};
};
}
public function SetAsBox(_arg1:Number, _arg2:Number):void{
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
}
}
}//package Box2D.Collision.Shapes
Section 6
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape)
package Box2D.Collision.Shapes {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolygonShape extends b2Shape {
public var m_vertices:Array;
public var m_normals:Array;
private var s_supportVec:b2Vec2;
public var m_obb:b2OBB;
public var m_coreVertices:Array;
public var m_centroid:b2Vec2;
public var m_vertexCount:int;
private static var s_computeMat:b2Mat22 = new b2Mat22();
private static var s_sweptAABB1:b2AABB = new b2AABB();
private static var s_sweptAABB2:b2AABB = new b2AABB();
public function b2PolygonShape(_arg1:b2ShapeDef){
var _local2:b2PolygonDef;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
s_supportVec = new b2Vec2();
m_obb = new b2OBB();
m_vertices = new Array(b2Settings.b2_maxPolygonVertices);
m_normals = new Array(b2Settings.b2_maxPolygonVertices);
m_coreVertices = new Array(b2Settings.b2_maxPolygonVertices);
super(_arg1);
m_type = e_polygonShape;
_local2 = (_arg1 as b2PolygonDef);
m_vertexCount = _local2.vertexCount;
_local4 = _local3;
_local5 = _local3;
_local3 = 0;
while (_local3 < m_vertexCount) {
m_vertices[_local3] = _local2.vertices[_local3].Copy();
_local3++;
};
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = _local3;
_local5 = (((_local3 + 1) < m_vertexCount)) ? (_local3 + 1) : 0;
_local6 = (m_vertices[_local5].x - m_vertices[_local4].x);
_local7 = (m_vertices[_local5].y - m_vertices[_local4].y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
m_normals[_local3] = new b2Vec2((_local7 / _local8), (-(_local6) / _local8));
_local3++;
};
m_centroid = ComputeCentroid(_local2.vertices, _local2.vertexCount);
ComputeOBB(m_obb, m_vertices, m_vertexCount);
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = (((_local3 - 1) >= 0)) ? (_local3 - 1) : (m_vertexCount - 1);
_local5 = _local3;
_local9 = m_normals[_local4].x;
_local10 = m_normals[_local4].y;
_local11 = m_normals[_local5].x;
_local12 = m_normals[_local5].y;
_local13 = (m_vertices[_local3].x - m_centroid.x);
_local14 = (m_vertices[_local3].y - m_centroid.y);
_local15 = (((_local9 * _local13) + (_local10 * _local14)) - b2Settings.b2_toiSlop);
_local16 = (((_local11 * _local13) + (_local12 * _local14)) - b2Settings.b2_toiSlop);
_local17 = (1 / ((_local9 * _local12) - (_local10 * _local11)));
m_coreVertices[_local3] = new b2Vec2(((_local17 * ((_local12 * _local15) - (_local10 * _local16))) + m_centroid.x), ((_local17 * ((_local9 * _local16) - (_local11 * _local15))) + m_centroid.y));
_local3++;
};
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:Number;
_local4 = _arg1.R;
_local5 = (_arg2.x - _arg1.position.x);
_local6 = (_arg2.y - _arg1.position.y);
_local7 = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y));
_local8 = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y));
_local9 = 0;
while (_local9 < m_vertexCount) {
_local3 = m_vertices[_local9];
_local5 = (_local7 - _local3.x);
_local6 = (_local8 - _local3.y);
_local3 = m_normals[_local9];
_local10 = ((_local3.x * _local5) + (_local3.y * _local6));
if (_local10 > 0){
return (false);
};
_local9++;
};
return (true);
}
public function GetCoreVertices():Array{
return (m_coreVertices);
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):int{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:Number;
var _local21:Number;
_local6 = 0;
_local7 = _arg5;
_local8 = (_arg4.p1.x - _arg1.position.x);
_local9 = (_arg4.p1.y - _arg1.position.y);
_local10 = _arg1.R;
_local12 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
_local13 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local8 = (_arg4.p2.x - _arg1.position.x);
_local9 = (_arg4.p2.y - _arg1.position.y);
_local10 = _arg1.R;
_local14 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
_local15 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local16 = (_local14 - _local12);
_local17 = (_local15 - _local13);
_local18 = -1;
_local19 = 0;
while (_local19 < m_vertexCount) {
_local11 = m_vertices[_local19];
_local8 = (_local11.x - _local12);
_local9 = (_local11.y - _local13);
_local11 = m_normals[_local19];
_local20 = ((_local11.x * _local8) + (_local11.y * _local9));
_local21 = ((_local11.x * _local16) + (_local11.y * _local17));
if ((((_local21 < 0)) && ((_local20 < (_local6 * _local21))))){
_local6 = (_local20 / _local21);
_local18 = _local19;
} else {
if ((((_local21 > 0)) && ((_local20 < (_local7 * _local21))))){
_local7 = (_local20 / _local21);
};
};
if (_local7 < _local6){
return (e_missCollide);
};
_local19++;
};
if (_local18 >= 0){
_arg2[0] = _local6;
_local10 = _arg1.R;
_local11 = m_normals[_local18];
_arg3.x = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_arg3.y = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
return (e_hitCollide);
};
_arg2[0] = 0;
return (e_startsInsideCollide);
}
public function GetCentroid():b2Vec2{
return (m_centroid);
}
override public function ComputeMass(_arg1:b2MassData):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = (1 / 3);
_local9 = 0;
while (_local9 < m_vertexCount) {
_local10 = m_vertices[_local9];
_local11 = (((_local9 + 1) < m_vertexCount)) ? m_vertices[int((_local9 + 1))] : m_vertices[0];
_local12 = (_local10.x - _local6);
_local13 = (_local10.y - _local7);
_local14 = (_local11.x - _local6);
_local15 = (_local11.y - _local7);
_local16 = ((_local12 * _local15) - (_local13 * _local14));
_local17 = (0.5 * _local16);
_local4 = (_local4 + _local17);
_local2 = (_local2 + ((_local17 * _local8) * ((_local6 + _local10.x) + _local11.x)));
_local3 = (_local3 + ((_local17 * _local8) * ((_local7 + _local10.y) + _local11.y)));
_local18 = _local6;
_local19 = _local7;
_local20 = _local12;
_local21 = _local13;
_local22 = _local14;
_local23 = _local15;
_local24 = ((_local8 * ((0.25 * (((_local20 * _local20) + (_local22 * _local20)) + (_local22 * _local22))) + ((_local18 * _local20) + (_local18 * _local22)))) + ((0.5 * _local18) * _local18));
_local25 = ((_local8 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19));
_local5 = (_local5 + (_local16 * (_local24 + _local25)));
_local9++;
};
_arg1.mass = (m_density * _local4);
_local2 = (_local2 * (1 / _local4));
_local3 = (_local3 * (1 / _local4));
_arg1.center.Set(_local2, _local3);
_arg1.I = (m_density * _local5);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local10:int;
var _local11:Number;
_local5 = _arg1.R;
_local6 = ((_arg2 * _local5.col1.x) + (_arg3 * _local5.col1.y));
_local7 = ((_arg2 * _local5.col2.x) + (_arg3 * _local5.col2.y));
_local8 = 0;
_local4 = m_coreVertices[0];
_local9 = ((_local4.x * _local6) + (_local4.y * _local7));
_local10 = 1;
while (_local10 < m_vertexCount) {
_local4 = m_coreVertices[_local10];
_local11 = ((_local4.x * _local6) + (_local4.y * _local7));
if (_local11 > _local9){
_local8 = _local10;
_local9 = _local11;
};
_local10++;
};
_local5 = _arg1.R;
_local4 = m_coreVertices[_local8];
s_supportVec.x = (_arg1.position.x + ((_local5.col1.x * _local4.x) + (_local5.col2.x * _local4.y)));
s_supportVec.y = (_arg1.position.y + ((_local5.col1.y * _local4.x) + (_local5.col2.y * _local4.y)));
return (s_supportVec);
}
public function GetVertexCount():int{
return (m_vertexCount);
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2AABB;
var _local5:b2AABB;
_local4 = s_sweptAABB1;
_local5 = s_sweptAABB2;
ComputeAABB(_local4, _arg2);
ComputeAABB(_local5, _arg3);
_arg1.lowerBound.Set(((_local4.lowerBound.x < _local5.lowerBound.x)) ? _local4.lowerBound.x : _local5.lowerBound.x, ((_local4.lowerBound.y < _local5.lowerBound.y)) ? _local4.lowerBound.y : _local5.lowerBound.y);
_arg1.upperBound.Set(((_local4.upperBound.x > _local5.upperBound.x)) ? _local4.upperBound.x : _local5.upperBound.x, ((_local4.upperBound.y > _local5.upperBound.y)) ? _local4.upperBound.y : _local5.upperBound.y);
}
public function GetVertices():Array{
return (m_vertices);
}
public function GetNormals():Array{
return (m_normals);
}
public function GetOBB():b2OBB{
return (m_obb);
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_coreVertices[0]));
}
public function Centroid(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_centroid));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:b2Vec2;
var _local3:int;
var _local4:Number;
var _local5:Number;
m_sweepRadius = 0;
_local3 = 0;
while (_local3 < m_vertexCount) {
_local2 = m_coreVertices[_local3];
_local4 = (_local2.x - _arg1.x);
_local5 = (_local2.y - _arg1.y);
_local4 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local4 > m_sweepRadius){
m_sweepRadius = _local4;
};
_local3++;
};
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local5 = s_computeMat;
_local3 = _arg2.R;
_local4 = m_obb.R.col1;
_local5.col1.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col1.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local4 = m_obb.R.col2;
_local5.col2.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col2.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local5.Abs();
_local6 = _local5;
_local4 = m_obb.extents;
_local7 = ((_local6.col1.x * _local4.x) + (_local6.col2.x * _local4.y));
_local8 = ((_local6.col1.y * _local4.x) + (_local6.col2.y * _local4.y));
_local3 = _arg2.R;
_local4 = m_obb.center;
_local9 = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)));
_local10 = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)));
_arg1.lowerBound.Set((_local9 - _local7), (_local10 - _local8));
_arg1.upperBound.Set((_local9 + _local7), (_local10 + _local8));
}
public static function ComputeCentroid(_arg1:Array, _arg2:int):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local3 = new b2Vec2();
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = (1 / 3);
_local8 = 0;
while (_local8 < _arg2) {
_local9 = _arg1[_local8];
_local10 = (((_local8 + 1) < _arg2)) ? _arg1[int((_local8 + 1))] : _arg1[0];
_local11 = (_local9.x - _local5);
_local12 = (_local9.y - _local6);
_local13 = (_local10.x - _local5);
_local14 = (_local10.y - _local6);
_local15 = ((_local11 * _local14) - (_local12 * _local13));
_local16 = (0.5 * _local15);
_local4 = (_local4 + _local16);
_local3.x = (_local3.x + ((_local16 * _local7) * ((_local5 + _local9.x) + _local10.x)));
_local3.y = (_local3.y + ((_local16 * _local7) * ((_local6 + _local9.y) + _local10.y)));
_local8++;
};
_local3.x = (_local3.x * (1 / _local4));
_local3.y = (_local3.y * (1 / _local4));
return (_local3);
}
public static function ComputeOBB(_arg1:b2OBB, _arg2:Array, _arg3:int):void{
var _local4:int;
var _local5:Array;
var _local6:Number;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:b2Mat22;
_local5 = new Array((b2Settings.b2_maxPolygonVertices + 1));
_local4 = 0;
while (_local4 < _arg3) {
_local5[_local4] = _arg2[_local4];
_local4++;
};
_local5[_arg3] = _local5[0];
_local6 = Number.MAX_VALUE;
_local4 = 1;
while (_local4 <= _arg3) {
_local7 = _local5[int((_local4 - 1))];
_local8 = (_local5[_local4].x - _local7.x);
_local9 = (_local5[_local4].y - _local7.y);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
_local11 = -(_local9);
_local12 = _local8;
_local13 = Number.MAX_VALUE;
_local14 = Number.MAX_VALUE;
_local15 = -(Number.MAX_VALUE);
_local16 = -(Number.MAX_VALUE);
_local17 = 0;
while (_local17 < _arg3) {
_local19 = (_local5[_local17].x - _local7.x);
_local20 = (_local5[_local17].y - _local7.y);
_local21 = ((_local8 * _local19) + (_local9 * _local20));
_local22 = ((_local11 * _local19) + (_local12 * _local20));
if (_local21 < _local13){
_local13 = _local21;
};
if (_local22 < _local14){
_local14 = _local22;
};
if (_local21 > _local15){
_local15 = _local21;
};
if (_local22 > _local16){
_local16 = _local22;
};
_local17++;
};
_local18 = ((_local15 - _local13) * (_local16 - _local14));
if (_local18 < (0.95 * _local6)){
_local6 = _local18;
_arg1.R.col1.x = _local8;
_arg1.R.col1.y = _local9;
_arg1.R.col2.x = _local11;
_arg1.R.col2.y = _local12;
_local23 = (0.5 * (_local13 + _local15));
_local24 = (0.5 * (_local14 + _local16));
_local25 = _arg1.R;
_arg1.center.x = (_local7.x + ((_local25.col1.x * _local23) + (_local25.col2.x * _local24)));
_arg1.center.y = (_local7.y + ((_local25.col1.y * _local23) + (_local25.col2.y * _local24)));
_arg1.extents.x = (0.5 * (_local15 - _local13));
_arg1.extents.y = (0.5 * (_local16 - _local14));
};
_local4++;
};
}
}
}//package Box2D.Collision.Shapes
Section 7
//b2Shape (Box2D.Collision.Shapes.b2Shape)
package Box2D.Collision.Shapes {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
public class b2Shape {
public var m_type:int;
public var m_sweepRadius:Number;
public var m_density:Number;
public var m_filter:b2FilterData;
public var m_friction:Number;
public var m_next:b2Shape;
public var m_restitution:Number;
public var m_userData;
public var m_isSensor:Boolean;
public var m_proxyId:uint;
public var m_body:b2Body;
public static const e_polygonShape:int = 1;
public static const e_hitCollide:int = 1;
public static const e_missCollide:int = 0;
public static const e_unknownShape:int = -1;
public static const e_circleShape:int = 0;
public static const e_shapeTypeCount:int = 2;
public static const e_startsInsideCollide:int = -1;
private static var s_resetAABB:b2AABB = new b2AABB();
private static var s_syncAABB:b2AABB = new b2AABB();
private static var s_proxyAABB:b2AABB = new b2AABB();
public function b2Shape(_arg1:b2ShapeDef){
m_userData = _arg1.userData;
m_friction = _arg1.friction;
m_restitution = _arg1.restitution;
m_density = _arg1.density;
m_body = null;
m_sweepRadius = 0;
m_next = null;
m_proxyId = b2Pair.b2_nullProxy;
m_filter = _arg1.filter.Copy();
m_isSensor = _arg1.isSensor;
}
public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
return (false);
}
public function GetSweepRadius():Number{
return (m_sweepRadius);
}
public function GetNext():b2Shape{
return (m_next);
}
public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
}
public function GetType():int{
return (m_type);
}
public function GetRestitution():Number{
return (m_restitution);
}
public function GetFriction():Number{
return (m_friction);
}
public function GetFilterData():b2FilterData{
return (m_filter.Copy());
}
public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):int{
return (e_missCollide);
}
public function RefilterProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB;
var _local4:Boolean;
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_arg1.DestroyProxy(m_proxyId);
_local3 = s_resetAABB;
ComputeAABB(_local3, _arg2);
_local4 = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetFilterData(_arg1:b2FilterData):void{
m_filter = _arg1.Copy();
}
public function GetUserData(){
return (m_userData);
}
public function Synchronize(_arg1:b2BroadPhase, _arg2:b2XForm, _arg3:b2XForm):Boolean{
var _local4:b2AABB;
if (m_proxyId == b2Pair.b2_nullProxy){
return (false);
};
_local4 = s_syncAABB;
ComputeSweptAABB(_local4, _arg2, _arg3);
if (_arg1.InRange(_local4)){
_arg1.MoveProxy(m_proxyId, _local4);
return (true);
};
return (false);
}
public function ComputeMass(_arg1:b2MassData):void{
}
public function IsSensor():Boolean{
return (m_isSensor);
}
public function DestroyProxy(_arg1:b2BroadPhase):void{
if (m_proxyId != b2Pair.b2_nullProxy){
_arg1.DestroyProxy(m_proxyId);
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function UpdateSweepRadius(_arg1:b2Vec2):void{
}
public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
}
public function GetBody():b2Body{
return (m_body);
}
public function CreateProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB;
var _local4:Boolean;
_local3 = s_proxyAABB;
ComputeAABB(_local3, _arg2);
_local4 = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public static function Destroy(_arg1:b2Shape, _arg2):void{
}
public static function Create(_arg1:b2ShapeDef, _arg2):b2Shape{
switch (_arg1.type){
case e_circleShape:
return (new b2CircleShape(_arg1));
case e_polygonShape:
return (new b2PolygonShape(_arg1));
default:
return (null);
};
}
}
}//package Box2D.Collision.Shapes
Section 8
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef)
package Box2D.Collision.Shapes {
public class b2ShapeDef {
public var isSensor:Boolean;// = false
public var density:Number;// = 0
public var type:int;// = -1
public var restitution:Number;// = 0
public var userData;// = null
public var filter:b2FilterData;
public var friction:Number;// = 0.2
public function b2ShapeDef(){
type = b2Shape.e_unknownShape;
userData = null;
friction = 0.2;
restitution = 0;
density = 0;
isSensor = false;
filter = new b2FilterData();
super();
}
}
}//package Box2D.Collision.Shapes
Section 9
//b2AABB (Box2D.Collision.b2AABB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2AABB {
public var upperBound:b2Vec2;
public var lowerBound:b2Vec2;
public function b2AABB(){
lowerBound = new b2Vec2();
upperBound = new b2Vec2();
super();
}
public function IsValid():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Boolean;
_local1 = (upperBound.x - lowerBound.x);
_local2 = (upperBound.y - lowerBound.y);
_local3 = (((_local1 >= 0)) && ((_local2 >= 0)));
_local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid()));
return (_local3);
}
}
}//package Box2D.Collision
Section 10
//b2Bound (Box2D.Collision.b2Bound)
package Box2D.Collision {
public class b2Bound {
public var proxyId:uint;
public var stabbingCount:uint;
public var value:uint;
public function Swap(_arg1:b2Bound):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
_local2 = value;
_local3 = proxyId;
_local4 = stabbingCount;
value = _arg1.value;
proxyId = _arg1.proxyId;
stabbingCount = _arg1.stabbingCount;
_arg1.value = _local2;
_arg1.proxyId = _local3;
_arg1.stabbingCount = _local4;
}
public function IsLower():Boolean{
return (((value & 1) == 0));
}
public function IsUpper():Boolean{
return (((value & 1) == 1));
}
}
}//package Box2D.Collision
Section 11
//b2BoundValues (Box2D.Collision.b2BoundValues)
package Box2D.Collision {
public class b2BoundValues {
public var lowerValues:Array;
public var upperValues:Array;
public function b2BoundValues(){
lowerValues = [0, 0];
upperValues = [0, 0];
super();
}
}
}//package Box2D.Collision
Section 12
//b2BroadPhase (Box2D.Collision.b2BroadPhase)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2BroadPhase {
public var m_worldAABB:b2AABB;
public var m_bounds:Array;
public var m_freeProxy:uint;
public var m_quantizationFactor:b2Vec2;
public var m_proxyCount:int;
public var m_proxyPool:Array;
public var m_querySortKeys:Array;
public var m_pairManager:b2PairManager;
public var m_queryResultCount:int;
public var m_timeStamp:uint;
public var m_queryResults:Array;
public static const b2_nullEdge:uint = b2Settings.USHRT_MAX;
public static const b2_invalid:uint = b2Settings.USHRT_MAX;
public static var s_validate:Boolean = false;
public function b2BroadPhase(_arg1:b2AABB, _arg2:b2PairCallback){
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:b2Proxy;
var _local7:int;
m_pairManager = new b2PairManager();
m_proxyPool = new Array(b2Settings.b2_maxPairs);
m_bounds = new Array((2 * b2Settings.b2_maxProxies));
m_querySortKeys = new Array(b2Settings.b2_maxProxies);
m_queryResults = new Array(b2Settings.b2_maxProxies);
m_quantizationFactor = new b2Vec2();
super();
m_pairManager.Initialize(this, _arg2);
m_worldAABB = _arg1;
m_proxyCount = 0;
_local3 = 0;
while (_local3 < b2Settings.b2_maxProxies) {
m_queryResults[_local3] = 0;
m_querySortKeys[_local3] = 0;
_local3++;
};
m_bounds = new Array(2);
_local3 = 0;
while (_local3 < 2) {
m_bounds[_local3] = new Array((2 * b2Settings.b2_maxProxies));
_local7 = 0;
while (_local7 < (2 * b2Settings.b2_maxProxies)) {
m_bounds[_local3][_local7] = new b2Bound();
_local7++;
};
_local3++;
};
_local4 = (_arg1.upperBound.x - _arg1.lowerBound.x);
_local5 = (_arg1.upperBound.y - _arg1.lowerBound.y);
m_quantizationFactor.x = (b2Settings.USHRT_MAX / _local4);
m_quantizationFactor.y = (b2Settings.USHRT_MAX / _local5);
_local3 = 0;
while (_local3 < (b2Settings.b2_maxProxies - 1)) {
_local6 = new b2Proxy();
m_proxyPool[_local3] = _local6;
_local6.SetNext((_local3 + 1));
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
_local3++;
};
_local6 = new b2Proxy();
m_proxyPool[int((b2Settings.b2_maxProxies - 1))] = _local6;
_local6.SetNext(b2Pair.b2_nullProxy);
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
m_freeProxy = 0;
m_timeStamp = 1;
m_queryResultCount = 0;
}
public function QueryAABB(_arg1:b2AABB, _arg2, _arg3:int):int{
var _local4:Array;
var _local5:Array;
var _local6:uint;
var _local7:uint;
var _local8:Array;
var _local9:Array;
var _local10:int;
var _local11:int;
var _local12:b2Proxy;
_local4 = new Array();
_local5 = new Array();
ComputeBounds(_local4, _local5, _arg1);
_local8 = [_local6];
_local9 = [_local7];
Query(_local8, _local9, _local4[0], _local5[0], m_bounds[0], (2 * m_proxyCount), 0);
Query(_local8, _local9, _local4[1], _local5[1], m_bounds[1], (2 * m_proxyCount), 1);
_local10 = 0;
_local11 = 0;
while ((((_local11 < m_queryResultCount)) && ((_local10 < _arg3)))) {
_local12 = m_proxyPool[m_queryResults[_local11]];
_arg2[_local11] = _local12.userData;
_local11++;
_local10++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local10);
}
public function Commit():void{
m_pairManager.Commit();
}
public function GetProxy(_arg1:int):b2Proxy{
var _local2:b2Proxy;
_local2 = m_proxyPool[_arg1];
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((_local2.IsValid() == false)))){
return (null);
};
return (_local2);
}
private function IncrementTimeStamp():void{
var _local1:uint;
if (m_timeStamp == b2Settings.USHRT_MAX){
_local1 = 0;
while (_local1 < b2Settings.b2_maxProxies) {
(m_proxyPool[_local1] as b2Proxy).timeStamp = 0;
_local1++;
};
m_timeStamp = 1;
} else {
m_timeStamp++;
};
}
private function Query(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:uint, _arg7:int):void{
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
var _local11:uint;
var _local12:int;
var _local13:int;
var _local14:b2Proxy;
_local8 = BinarySearch(_arg5, _arg6, _arg3);
_local9 = BinarySearch(_arg5, _arg6, _arg4);
_local11 = _local8;
while (_local11 < _local9) {
_local10 = _arg5[_local11];
if (_local10.IsLower()){
IncrementOverlapCount(_local10.proxyId);
};
_local11++;
};
if (_local8 > 0){
_local12 = (_local8 - 1);
_local10 = _arg5[_local12];
_local13 = _local10.stabbingCount;
while (_local13) {
_local10 = _arg5[_local12];
if (_local10.IsLower()){
_local14 = m_proxyPool[_local10.proxyId];
if (_local8 <= _local14.upperBounds[_arg7]){
IncrementOverlapCount(_local10.proxyId);
_local13--;
};
};
_local12--;
};
};
_arg1[0] = _local8;
_arg2[0] = _local9;
}
private function AddProxyResult(_arg1:uint, _arg2:b2Proxy, _arg3:Number, _arg4:Function):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:uint;
var _local9:Number;
var _local10:uint;
_local5 = _arg4(_arg2.userData);
if (_local5 < 0){
return;
};
_local6 = 0;
while ((((_local6 < m_queryResultCount)) && ((m_querySortKeys[_local6] < _local5)))) {
_local6++;
};
_local7 = _local5;
_local8 = _arg1;
m_queryResultCount = (m_queryResultCount + 1);
if (m_queryResultCount > _arg3){
m_queryResultCount = _arg3;
};
while (_local6 < m_queryResultCount) {
_local9 = m_querySortKeys[_local6];
_local10 = m_queryResults[_local6];
m_querySortKeys[_local6] = _local7;
m_queryResults[_local6] = _local8;
_local7 = _local9;
_local8 = _local10;
_local6++;
};
}
public function QuerySegment(_arg1:b2Segment, _arg2, _arg3:int, _arg4:Function):int{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:int;
var _local10:Number;
var _local11:Number;
var _local12:Array;
var _local13:Array;
var _local14:Array;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:b2Proxy;
var _local19:uint;
var _local20:uint;
var _local21:Array;
var _local22:Array;
var _local23:Boolean;
var _local24:Number;
var _local25:Number;
var _local26:int;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:uint;
_local5 = 1;
_local6 = ((_arg1.p2.x - _arg1.p1.x) * m_quantizationFactor.x);
_local7 = ((_arg1.p2.y - _arg1.p1.y) * m_quantizationFactor.y);
_local8 = ((_local6 < -(Number.MIN_VALUE))) ? -1 : ((_local6 > Number.MIN_VALUE)) ? 1 : 0;
_local9 = ((_local7 < -(Number.MIN_VALUE))) ? -1 : ((_local7 > Number.MIN_VALUE)) ? 1 : 0;
_local10 = (m_quantizationFactor.x * (_arg1.p1.x - m_worldAABB.lowerBound.x));
_local11 = (m_quantizationFactor.y * (_arg1.p1.y - m_worldAABB.lowerBound.y));
_local12 = new Array();
_local13 = new Array();
_local12[0] = (uint(_local10) & (b2Settings.USHRT_MAX - 1));
_local12[1] = (uint(_local11) & (b2Settings.USHRT_MAX - 1));
_local13[0] = (_local12[0] + 1);
_local13[1] = (_local12[1] + 1);
_local14 = new Array();
_local21 = [_local19];
_local22 = [_local20];
Query(_local21, _local22, _local12[0], _local13[0], m_bounds[0], (2 * m_proxyCount), 0);
if (_local8 >= 0){
_local15 = (_local22[0] - 1);
} else {
_local15 = _local21[0];
};
Query(_local21, _local22, _local12[1], _local13[1], m_bounds[1], (2 * m_proxyCount), 1);
if (_local9 >= 0){
_local16 = (_local22[0] - 1);
} else {
_local16 = _local21[0];
};
if (_arg4 != null){
_local27 = 0;
while (_local27 < m_queryResultCount) {
m_querySortKeys[_local27] = _arg4(m_proxyPool[m_queryResults[_local27]].userData);
_local27++;
};
_local27 = 0;
while (_local27 < (m_queryResultCount - 1)) {
_local28 = m_querySortKeys[_local27];
_local29 = m_querySortKeys[(_local27 + 1)];
if (((_local28)<0) ? (_local29 >= 0) : (((_local28 > _local29)) && ((_local29 >= 0)))){
m_querySortKeys[(_local27 + 1)] = _local28;
m_querySortKeys[_local27] = _local29;
_local30 = m_queryResults[(_local27 + 1)];
m_queryResults[(_local27 + 1)] = m_queryResults[_local27];
m_queryResults[_local27] = _local30;
--_local27;
if (_local27 == -1){
_local27 = 1;
};
} else {
_local27++;
};
};
while ((((m_queryResultCount > 0)) && ((m_querySortKeys[(m_queryResultCount - 1)] < 0)))) {
m_queryResultCount--;
};
};
_local23 = true;
if ((((_local15 < 0)) || ((_local15 >= (m_proxyCount * 2))))){
_local23 = false;
};
if ((((_local16 < 0)) || ((_local16 >= (m_proxyCount * 2))))){
_local23 = false;
};
if (_local23){
if (_local8 != 0){
if (_local8 > 0){
_local15++;
if (_local15 == (m_proxyCount * 2)){
_local23 = false;
};
} else {
--_local15;
if (_local15 < 0){
_local23 = false;
};
};
_local24 = ((m_bounds[0][_local15].value - _local10) / _local6);
};
if (_local9 != 0){
if (_local9 > 0){
_local16++;
if (_local16 == (m_proxyCount * 2)){
_local23 = false;
};
} else {
--_local16;
if (_local16 < 0){
_local23 = false;
};
};
_local25 = ((m_bounds[1][_local16].value - _local11) / _local7);
};
};
while (_local23) {
if ((((_local9 == 0)) || (((!((_local8 == 0))) && ((_local24 < _local25)))))){
if (_local24 > _local5){
break;
};
if (((_local8 > 0)) ? m_bounds[0][_local15].IsLower() : m_bounds[0][_local15].IsUpper()){
_local17 = m_bounds[0][_local15].proxyId;
_local18 = m_proxyPool[_local17];
if (_local9 >= 0){
if ((((_local18.lowerBounds[1] <= (_local16 - 1))) && ((_local18.upperBounds[1] >= _local16)))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
} else {
if ((((_local18.lowerBounds[1] <= _local16)) && ((_local18.upperBounds[1] >= (_local16 + 1))))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
};
};
if (((((((!((_arg4 == null))) && ((m_queryResultCount == _arg3)))) && ((m_queryResultCount > 0)))) && ((_local24 > m_querySortKeys[(m_queryResultCount - 1)])))){
break;
};
if (_local8 > 0){
_local15++;
if (_local15 == (m_proxyCount * 2)){
break;
};
} else {
--_local15;
if (_local15 < 0){
break;
};
};
_local24 = ((m_bounds[0][_local15].value - _local10) / _local6);
} else {
if (_local25 > _local5){
break;
};
if (((_local9 > 0)) ? m_bounds[1][_local16].IsLower() : m_bounds[1][_local16].IsUpper()){
_local17 = m_bounds[1][_local16].proxyId;
_local18 = m_proxyPool[_local17];
if (_local8 >= 0){
if ((((_local18.lowerBounds[0] <= (_local15 - 1))) && ((_local18.upperBounds[0] >= _local15)))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
} else {
if ((((_local18.lowerBounds[0] <= _local15)) && ((_local18.upperBounds[0] >= (_local15 + 1))))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
};
};
if (((((((!((_arg4 == null))) && ((m_queryResultCount == _arg3)))) && ((m_queryResultCount > 0)))) && ((_local25 > m_querySortKeys[(m_queryResultCount - 1)])))){
break;
};
if (_local9 > 0){
_local16++;
if (_local16 == (m_proxyCount * 2)){
break;
};
} else {
--_local16;
if (_local16 < 0){
break;
};
};
_local25 = ((m_bounds[1][_local16].value - _local11) / _local7);
};
};
_local26 = 0;
_local27 = 0;
while ((((_local27 < m_queryResultCount)) && ((_local26 < _arg3)))) {
_local18 = m_proxyPool[m_queryResults[_local27]];
_arg2[_local27] = _local18.userData;
_local27++;
_local26++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local26);
}
private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local4 = _arg3.lowerBound.x;
_local5 = _arg3.lowerBound.y;
_local4 = b2Math.b2Min(_local4, m_worldAABB.upperBound.x);
_local5 = b2Math.b2Min(_local5, m_worldAABB.upperBound.y);
_local4 = b2Math.b2Max(_local4, m_worldAABB.lowerBound.x);
_local5 = b2Math.b2Max(_local5, m_worldAABB.lowerBound.y);
_local6 = _arg3.upperBound.x;
_local7 = _arg3.upperBound.y;
_local6 = b2Math.b2Min(_local6, m_worldAABB.upperBound.x);
_local7 = b2Math.b2Min(_local7, m_worldAABB.upperBound.y);
_local6 = b2Math.b2Max(_local6, m_worldAABB.lowerBound.x);
_local7 = b2Math.b2Max(_local7, m_worldAABB.lowerBound.y);
_arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.lowerBound.x))) & (b2Settings.USHRT_MAX - 1));
_arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.lowerBound.x))) & 0xFFFF) | 1);
_arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.lowerBound.y))) & (b2Settings.USHRT_MAX - 1));
_arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.lowerBound.y))) & 0xFFFF) | 1);
}
public function CreateProxy(_arg1:b2AABB, _arg2):uint{
var _local3:uint;
var _local4:b2Proxy;
var _local5:uint;
var _local6:uint;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:int;
var _local11:Array;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:b2Bound;
var _local20:b2Bound;
var _local21:b2Bound;
var _local22:int;
var _local23:b2Proxy;
_local5 = m_freeProxy;
_local4 = m_proxyPool[_local5];
m_freeProxy = _local4.GetNext();
_local4.overlapCount = 0;
_local4.userData = _arg2;
_local6 = (2 * m_proxyCount);
_local7 = new Array();
_local8 = new Array();
ComputeBounds(_local7, _local8, _arg1);
_local9 = 0;
while (_local9 < 2) {
_local11 = m_bounds[_local9];
_local14 = [_local12];
_local15 = [_local13];
Query(_local14, _local15, _local7[_local9], _local8[_local9], _local11, _local6, _local9);
_local12 = _local14[0];
_local13 = _local15[0];
_local16 = new Array();
_local18 = (_local6 - _local13);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local13 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local13 + 2);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local16 = new Array();
_local18 = (_local13 - _local12);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local12 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local12 + 1);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local13++;
_local19 = _local11[_local12];
_local20 = _local11[_local13];
_local19.value = _local7[_local9];
_local19.proxyId = _local5;
_local20.value = _local8[_local9];
_local20.proxyId = _local5;
_local21 = _local11[int((_local12 - 1))];
_local19.stabbingCount = ((_local12 == 0)) ? 0 : _local21.stabbingCount;
_local21 = _local11[int((_local13 - 1))];
_local20.stabbingCount = _local21.stabbingCount;
_local3 = _local12;
while (_local3 < _local13) {
_local21 = _local11[_local3];
_local21.stabbingCount++;
_local3++;
};
_local3 = _local12;
while (_local3 < (_local6 + 2)) {
_local19 = _local11[_local3];
_local23 = m_proxyPool[_local19.proxyId];
if (_local19.IsLower()){
_local23.lowerBounds[_local9] = _local3;
} else {
_local23.upperBounds[_local9] = _local3;
};
_local3++;
};
_local9++;
};
m_proxyCount++;
_local10 = 0;
while (_local10 < m_queryResultCount) {
m_pairManager.AddBufferedPair(_local5, m_queryResults[_local10]);
_local10++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local5);
}
public function DestroyProxy(_arg1:uint):void{
var _local2:b2Bound;
var _local3:b2Bound;
var _local4:b2Proxy;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Array;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:int;
var _local19:b2Proxy;
_local4 = m_proxyPool[_arg1];
_local5 = (2 * m_proxyCount);
_local6 = 0;
while (_local6 < 2) {
_local8 = m_bounds[_local6];
_local9 = _local4.lowerBounds[_local6];
_local10 = _local4.upperBounds[_local6];
_local2 = _local8[_local9];
_local11 = _local2.value;
_local3 = _local8[_local10];
_local12 = _local3.value;
_local13 = new Array();
_local15 = ((_local10 - _local9) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local9 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = _local9;
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local13 = new Array();
_local15 = ((_local5 - _local10) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local10 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = (_local10 - 1);
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = (_local5 - 2);
_local17 = _local9;
while (_local17 < _local15) {
_local2 = _local8[_local17];
_local19 = m_proxyPool[_local2.proxyId];
if (_local2.IsLower()){
_local19.lowerBounds[_local6] = _local17;
} else {
_local19.upperBounds[_local6] = _local17;
};
_local17++;
};
_local15 = (_local10 - 1);
_local18 = _local9;
while (_local18 < _local15) {
_local2 = _local8[_local18];
_local2.stabbingCount--;
_local18++;
};
Query([0], [0], _local11, _local12, _local8, (_local5 - 2), _local6);
_local6++;
};
_local7 = 0;
while (_local7 < m_queryResultCount) {
m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local7]);
_local7++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
_local4.userData = null;
_local4.overlapCount = b2_invalid;
_local4.lowerBounds[0] = b2_invalid;
_local4.lowerBounds[1] = b2_invalid;
_local4.upperBounds[0] = b2_invalid;
_local4.upperBounds[1] = b2_invalid;
_local4.SetNext(m_freeProxy);
m_freeProxy = _arg1;
m_proxyCount--;
}
public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
var _local5:b2Bound;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg2.upperBounds[_local3]];
if (_arg1.lowerValues[_local3] > _local5.value){
return (false);
};
_local5 = _local4[_arg2.lowerBounds[_local3]];
if (_arg1.upperValues[_local3] < _local5.value){
return (false);
};
_local3++;
};
return (true);
}
public function Validate():void{
var _local1:b2Pair;
var _local2:b2Proxy;
var _local3:b2Proxy;
var _local4:Boolean;
var _local5:int;
var _local6:b2Bound;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
_local5 = 0;
while (_local5 < 2) {
_local6 = m_bounds[_local5];
_local7 = (2 * m_proxyCount);
_local8 = 0;
_local9 = 0;
while (_local9 < _local7) {
_local10 = _local6[_local9];
if (_local10.IsLower() == true){
_local8++;
} else {
_local8--;
};
_local9++;
};
_local5++;
};
}
private function IncrementOverlapCount(_arg1:uint):void{
var _local2:b2Proxy;
_local2 = m_proxyPool[_arg1];
if (_local2.timeStamp < m_timeStamp){
_local2.timeStamp = m_timeStamp;
_local2.overlapCount = 1;
} else {
_local2.overlapCount = 2;
m_queryResults[m_queryResultCount] = _arg1;
m_queryResultCount++;
};
}
public function InRange(_arg1:b2AABB):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.lowerBound.x;
_local3 = _arg1.lowerBound.y;
_local2 = (_local2 - m_worldAABB.upperBound.x);
_local3 = (_local3 - m_worldAABB.upperBound.y);
_local4 = m_worldAABB.lowerBound.x;
_local5 = m_worldAABB.lowerBound.y;
_local4 = (_local4 - _arg1.upperBound.x);
_local5 = (_local5 - _arg1.upperBound.y);
_local2 = b2Math.b2Max(_local2, _local4);
_local3 = b2Math.b2Max(_local3, _local5);
return ((b2Math.b2Max(_local2, _local3) < 0));
}
private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
var _local5:b2Bound;
var _local6:b2Bound;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg1.lowerBounds[_local3]];
_local6 = _local4[_arg2.upperBounds[_local3]];
if (_local5.value > _local6.value){
return (false);
};
_local5 = _local4[_arg1.upperBounds[_local3]];
_local6 = _local4[_arg2.lowerBounds[_local3]];
if (_local5.value < _local6.value){
return (false);
};
_local3++;
};
return (true);
}
public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{
var _local3:Array;
var _local4:int;
var _local5:uint;
var _local6:uint;
var _local7:b2Bound;
var _local8:b2Bound;
var _local9:b2Bound;
var _local10:uint;
var _local11:b2Proxy;
var _local12:uint;
var _local13:b2Proxy;
var _local14:b2BoundValues;
var _local15:b2BoundValues;
var _local16:Array;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:uint;
var _local21:int;
var _local22:int;
var _local23:uint;
var _local24:b2Proxy;
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){
return;
};
if (_arg2.IsValid() == false){
return;
};
_local12 = (2 * m_proxyCount);
_local13 = m_proxyPool[_arg1];
_local14 = new b2BoundValues();
ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2);
_local15 = new b2BoundValues();
_local5 = 0;
while (_local5 < 2) {
_local7 = m_bounds[_local5][_local13.lowerBounds[_local5]];
_local15.lowerValues[_local5] = _local7.value;
_local7 = m_bounds[_local5][_local13.upperBounds[_local5]];
_local15.upperValues[_local5] = _local7.value;
_local5++;
};
_local5 = 0;
while (_local5 < 2) {
_local16 = m_bounds[_local5];
_local17 = _local13.lowerBounds[_local5];
_local18 = _local13.upperBounds[_local5];
_local19 = _local14.lowerValues[_local5];
_local20 = _local14.upperValues[_local5];
_local7 = _local16[_local17];
_local21 = (_local19 - _local7.value);
_local7.value = _local19;
_local7 = _local16[_local18];
_local22 = (_local20 - _local7.value);
_local7.value = _local20;
if (_local21 < 0){
_local6 = _local17;
while ((((_local6 > 0)) && ((_local19 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local8.proxyId];
_local8.stabbingCount++;
if (_local8.IsUpper() == true){
if (TestOverlap(_local14, _local24)){
m_pairManager.AddBufferedPair(_arg1, _local23);
};
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
if (_local22 > 0){
_local6 = _local18;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local20)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount++;
if (_local9.IsLower() == true){
if (TestOverlap(_local14, _local11)){
m_pairManager.AddBufferedPair(_arg1, _local10);
};
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local21 > 0){
_local6 = _local17;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local19)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount--;
if (_local9.IsUpper()){
if (TestOverlap(_local15, _local11)){
m_pairManager.RemoveBufferedPair(_arg1, _local10);
};
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local22 < 0){
_local6 = _local18;
while ((((_local6 > 0)) && ((_local20 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local23];
_local8.stabbingCount--;
if (_local8.IsLower() == true){
if (TestOverlap(_local15, _local24)){
m_pairManager.RemoveBufferedPair(_arg1, _local23);
};
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
_local5++;
};
}
public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:b2Bound;
_local4 = 0;
_local5 = (_arg2 - 1);
while (_local4 <= _local5) {
_local6 = ((_local4 + _local5) / 2);
_local7 = _arg1[_local6];
if (_local7.value > _arg3){
_local5 = (_local6 - 1);
} else {
if (_local7.value < _arg3){
_local4 = (_local6 + 1);
} else {
return (uint(_local6));
};
};
};
return (uint(_local4));
}
}
}//package Box2D.Collision
Section 13
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
}
}//package Box2D.Collision
Section 14
//b2Collision (Box2D.Collision.b2Collision)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2Collision {
public static const b2_nullFeature:uint = 0xFF;
private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2();
public static function EdgeSeparation(_arg1:b2PolygonShape, _arg2:b2XForm, _arg3:int, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:b2Mat22;
var _local12:b2Vec2;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local6 = _arg1.m_vertexCount;
_local7 = _arg1.m_vertices;
_local8 = _arg1.m_normals;
_local9 = _arg4.m_vertexCount;
_local10 = _arg4.m_vertices;
_local11 = _arg2.R;
_local12 = _local8[_arg3];
_local13 = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y));
_local14 = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y));
_local11 = _arg5.R;
_local15 = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14));
_local16 = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14));
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local12 = _local10[_local19];
_local25 = ((_local12.x * _local15) + (_local12.y * _local16));
if (_local25 < _local18){
_local18 = _local25;
_local17 = _local19;
};
_local19++;
};
_local12 = _local7[_arg3];
_local11 = _arg2.R;
_local20 = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local21 = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local12 = _local10[_local17];
_local11 = _arg5.R;
_local22 = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local23 = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local22 = (_local22 - _local20);
_local23 = (_local23 - _local21);
_local24 = ((_local22 * _local13) + (_local23 * _local14));
return (_local24);
}
public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = _arg2.lowerBound;
_local4 = _arg1.upperBound;
_local5 = (_local3.x - _local4.x);
_local6 = (_local3.y - _local4.y);
_local3 = _arg1.lowerBound;
_local4 = _arg2.upperBound;
_local7 = (_local3.x - _local4.x);
_local8 = (_local3.y - _local4.y);
if ((((_local5 > 0)) || ((_local6 > 0)))){
return (false);
};
if ((((_local7 > 0)) || ((_local8 > 0)))){
return (false);
};
return (true);
}
public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:int, _arg5:b2PolygonShape, _arg6:b2XForm):void{
var _local7:int;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:Array;
var _local12:b2Mat22;
var _local13:b2Vec2;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:ClipVertex;
var _local21:int;
var _local22:int;
var _local23:Number;
_local7 = _arg2.m_vertexCount;
_local8 = _arg2.m_normals;
_local9 = _arg5.m_vertexCount;
_local10 = _arg5.m_vertices;
_local11 = _arg5.m_normals;
_local12 = _arg3.R;
_local13 = _local8[_arg4];
_local14 = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y));
_local15 = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y));
_local12 = _arg6.R;
_local16 = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15));
_local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15));
_local14 = _local16;
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local13 = _local11[_local19];
_local23 = ((_local14 * _local13.x) + (_local15 * _local13.y));
if (_local23 < _local18){
_local18 = _local23;
_local17 = _local19;
};
_local19++;
};
_local21 = _local17;
_local22 = (((_local21 + 1) < _local9)) ? (_local21 + 1) : 0;
_local20 = _arg1[0];
_local13 = _local10[_local21];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local21;
_local20.id.features.incidentVertex = 0;
_local20 = _arg1[1];
_local13 = _local10[_local22];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local22;
_local20.id.features.incidentVertex = 1;
}
public static function b2CollidePolygons(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):void{
var _local6:ClipVertex;
var _local7:int;
var _local8:Array;
var _local9:Number;
var _local10:int;
var _local11:Array;
var _local12:Number;
var _local13:b2PolygonShape;
var _local14:b2PolygonShape;
var _local15:b2XForm;
var _local16:b2XForm;
var _local17:int;
var _local18:uint;
var _local19:Number;
var _local20:Number;
var _local21:Array;
var _local22:int;
var _local23:Array;
var _local24:b2Vec2;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:b2Vec2;
var _local28:b2Vec2;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Array;
var _local33:Array;
var _local34:int;
var _local35:int;
var _local36:int;
var _local37:b2Vec2;
var _local38:Number;
var _local39:b2ManifoldPoint;
_arg1.pointCount = 0;
_local7 = 0;
_local8 = [_local7];
_local9 = FindMaxSeparation(_local8, _arg2, _arg3, _arg4, _arg5);
_local7 = _local8[0];
if (_local9 > 0){
return;
};
_local10 = 0;
_local11 = [_local10];
_local12 = FindMaxSeparation(_local11, _arg4, _arg5, _arg2, _arg3);
_local10 = _local11[0];
if (_local12 > 0){
return;
};
_local15 = new b2XForm();
_local16 = new b2XForm();
_local19 = 0.98;
_local20 = 0.001;
if (_local12 > ((_local19 * _local9) + _local20)){
_local13 = _arg4;
_local14 = _arg2;
_local15.Set(_arg5);
_local16.Set(_arg3);
_local17 = _local10;
_local18 = 1;
} else {
_local13 = _arg2;
_local14 = _arg4;
_local15.Set(_arg3);
_local16.Set(_arg5);
_local17 = _local7;
_local18 = 0;
};
_local21 = [new ClipVertex(), new ClipVertex()];
FindIncidentEdge(_local21, _local13, _local15, _local17, _local14, _local16);
_local22 = _local13.m_vertexCount;
_local23 = _local13.m_vertices;
_local24 = _local23[_local17];
_local25 = _local24.Copy();
if ((_local17 + 1) < _local22){
_local24 = _local23[int((_local17 + 1))];
_local37 = _local24.Copy();
} else {
_local24 = _local23[0];
_local37 = _local24.Copy();
};
_local26 = b2Math.SubtractVV(_local37, _local25);
_local27 = b2Math.b2MulMV(_local15.R, b2Math.SubtractVV(_local37, _local25));
_local27.Normalize();
_local28 = b2Math.b2CrossVF(_local27, 1);
_local25 = b2Math.b2MulX(_local15, _local25);
_local37 = b2Math.b2MulX(_local15, _local37);
_local29 = b2Math.b2Dot(_local28, _local25);
_local30 = -(b2Math.b2Dot(_local27, _local25));
_local31 = b2Math.b2Dot(_local27, _local37);
_local32 = [new ClipVertex(), new ClipVertex()];
_local33 = [new ClipVertex(), new ClipVertex()];
_local34 = ClipSegmentToLine(_local32, _local21, _local27.Negative(), _local30);
if (_local34 < 2){
return;
};
_local34 = ClipSegmentToLine(_local33, _local32, _local27, _local31);
if (_local34 < 2){
return;
};
_arg1.normal = (_local18) ? _local28.Negative() : _local28.Copy();
_local35 = 0;
_local36 = 0;
while (_local36 < b2Settings.b2_maxManifoldPoints) {
_local6 = _local33[_local36];
_local38 = (b2Math.b2Dot(_local28, _local6.v) - _local29);
if (_local38 <= 0){
_local39 = _arg1.points[_local35];
_local39.separation = _local38;
_local39.localPoint1 = b2Math.b2MulXT(_arg3, _local6.v);
_local39.localPoint2 = b2Math.b2MulXT(_arg5, _local6.v);
_local39.id.key = _local6.id._key;
_local39.id.features.flip = _local18;
_local35++;
};
_local36++;
};
_arg1.pointCount = _local35;
}
public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:b2Vec2;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:Number;
var _local16:int;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:int;
var _local21:Number;
var _local22:int;
var _local23:Number;
var _local24:int;
var _local25:Number;
_local6 = _arg2.m_vertexCount;
_local7 = _arg2.m_normals;
_local9 = _arg5.R;
_local8 = _arg4.m_centroid;
_local10 = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)));
_local11 = (_arg5.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y)));
_local9 = _arg3.R;
_local8 = _arg2.m_centroid;
_local10 = (_local10 - (_arg3.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y))));
_local11 = (_local11 - (_arg3.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y))));
_local12 = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y));
_local13 = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y));
_local14 = 0;
_local15 = -(Number.MAX_VALUE);
_local16 = 0;
while (_local16 < _local6) {
_local8 = _local7[_local16];
_local25 = ((_local8.x * _local12) + (_local8.y * _local13));
if (_local25 > _local15){
_local15 = _local25;
_local14 = _local16;
};
_local16++;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
_local18 = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1);
_local19 = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5);
if (_local19 > 0){
return (_local19);
};
_local20 = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0;
_local21 = EdgeSeparation(_arg2, _arg3, _local20, _arg4, _arg5);
if (_local21 > 0){
return (_local21);
};
if ((((_local19 > _local17)) && ((_local19 > _local21)))){
_local24 = -1;
_local22 = _local18;
_local23 = _local19;
} else {
if (_local21 > _local17){
_local24 = 1;
_local22 = _local20;
_local23 = _local21;
} else {
_arg1[0] = _local14;
return (_local17);
};
};
while (true) {
if (_local24 == -1){
_local14 = (((_local22 - 1) >= 0)) ? (_local22 - 1) : (_local6 - 1);
} else {
_local14 = (((_local22 + 1) < _local6)) ? (_local22 + 1) : 0;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
if (_local17 > _local23){
_local22 = _local14;
_local23 = _local17;
} else {
break;
};
};
_arg1[0] = _local22;
return (_local23);
}
public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{
var _local5:ClipVertex;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:b2Vec2;
var _local13:ClipVertex;
_local6 = 0;
_local5 = _arg2[0];
_local7 = _local5.v;
_local5 = _arg2[1];
_local8 = _local5.v;
_local9 = (b2Math.b2Dot(_arg3, _local7) - _arg4);
_local10 = (b2Math.b2Dot(_arg3, _local8) - _arg4);
if (_local9 <= 0){
var _temp1 = _local6;
_local6 = (_local6 + 1);
var _local14 = _temp1;
_arg1[_local14] = _arg2[0];
};
if (_local10 <= 0){
var _temp2 = _local6;
_local6 = (_local6 + 1);
_local14 = _temp2;
_arg1[_local14] = _arg2[1];
};
if ((_local9 * _local10) < 0){
_local11 = (_local9 / (_local9 - _local10));
_local5 = _arg1[_local6];
_local12 = _local5.v;
_local12.x = (_local7.x + (_local11 * (_local8.x - _local7.x)));
_local12.y = (_local7.y + (_local11 * (_local8.y - _local7.y)));
_local5 = _arg1[_local6];
if (_local9 > 0){
_local13 = _arg2[0];
_local5.id = _local13.id;
} else {
_local13 = _arg2[1];
_local5.id = _local13.id;
};
_local6++;
};
return (_local6);
}
public static function b2CollideCircles(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2Mat22;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:b2ManifoldPoint;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_arg1.pointCount = 0;
_local6 = _arg3.R;
_local7 = _arg2.m_localPosition;
_local8 = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local9 = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local6 = _arg5.R;
_local7 = _arg4.m_localPosition;
_local10 = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local11 = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local12 = (_local10 - _local8);
_local13 = (_local11 - _local9);
_local14 = ((_local12 * _local12) + (_local13 * _local13));
_local15 = _arg2.m_radius;
_local16 = _arg4.m_radius;
_local17 = (_local15 + _local16);
if (_local14 > (_local17 * _local17)){
return;
};
if (_local14 < Number.MIN_VALUE){
_local18 = -(_local17);
_arg1.normal.Set(0, 1);
} else {
_local24 = Math.sqrt(_local14);
_local18 = (_local24 - _local17);
_local25 = (1 / _local24);
_arg1.normal.x = (_local25 * _local12);
_arg1.normal.y = (_local25 * _local13);
};
_arg1.pointCount = 1;
_local19 = _arg1.points[0];
_local19.id.key = 0;
_local19.separation = _local18;
_local8 = (_local8 + (_local15 * _arg1.normal.x));
_local9 = (_local9 + (_local15 * _arg1.normal.y));
_local10 = (_local10 - (_local16 * _arg1.normal.x));
_local11 = (_local11 - (_local16 * _arg1.normal.y));
_local20 = (0.5 * (_local8 + _local10));
_local21 = (0.5 * (_local9 + _local11));
_local22 = (_local20 - _arg3.position.x);
_local23 = (_local21 - _arg3.position.y);
_local19.localPoint1.x = ((_local22 * _arg3.R.col1.x) + (_local23 * _arg3.R.col1.y));
_local19.localPoint1.y = ((_local22 * _arg3.R.col2.x) + (_local23 * _arg3.R.col2.y));
_local22 = (_local20 - _arg5.position.x);
_local23 = (_local21 - _arg5.position.y);
_local19.localPoint2.x = ((_local22 * _arg5.R.col1.x) + (_local23 * _arg5.R.col1.y));
_local19.localPoint2.y = ((_local22 * _arg5.R.col2.x) + (_local23 * _arg5.R.col2.y));
}
public static function b2CollidePolygonAndCircle(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2ManifoldPoint;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2Vec2;
var _local12:b2Mat22;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:Number;
var _local21:int;
var _local22:Array;
var _local23:Array;
var _local24:int;
var _local25:int;
var _local26:int;
var _local27:b2Vec2;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_arg1.pointCount = 0;
_local12 = _arg5.R;
_local11 = _arg4.m_localPosition;
_local13 = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)));
_local14 = (_arg5.position.y + ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y)));
_local7 = (_local13 - _arg3.position.x);
_local8 = (_local14 - _arg3.position.y);
_local12 = _arg3.R;
_local15 = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local16 = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local18 = 0;
_local19 = -(Number.MAX_VALUE);
_local20 = _arg4.m_radius;
_local21 = _arg2.m_vertexCount;
_local22 = _arg2.m_vertices;
_local23 = _arg2.m_normals;
_local24 = 0;
while (_local24 < _local21) {
_local11 = _local22[_local24];
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local11 = _local23[_local24];
_local34 = ((_local11.x * _local7) + (_local11.y * _local8));
if (_local34 > _local20){
return;
};
if (_local34 > _local19){
_local19 = _local34;
_local18 = _local24;
};
_local24++;
};
if (_local19 < Number.MIN_VALUE){
_arg1.pointCount = 1;
_local11 = _local23[_local18];
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y));
_arg1.normal.y = ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y));
_local6 = _arg1.points[0];
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = b2_nullFeature;
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local19 - _local20);
return;
};
_local25 = _local18;
_local26 = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0;
_local11 = _local22[_local25];
_local27 = _local22[_local26];
_local28 = (_local27.x - _local11.x);
_local29 = (_local27.y - _local11.y);
_local30 = Math.sqrt(((_local28 * _local28) + (_local29 * _local29)));
_local28 = (_local28 / _local30);
_local29 = (_local29 / _local30);
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local31 = ((_local7 * _local28) + (_local8 * _local29));
_local6 = _arg1.points[0];
if (_local31 <= 0){
_local32 = _local11.x;
_local33 = _local11.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local25;
} else {
if (_local31 >= _local30){
_local32 = _local27.x;
_local33 = _local27.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local26;
} else {
_local32 = ((_local28 * _local31) + _local11.x);
_local33 = ((_local29 * _local31) + _local11.y);
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = 0;
};
};
_local7 = (_local15 - _local32);
_local8 = (_local16 - _local33);
_local17 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local7 = (_local7 / _local17);
_local8 = (_local8 / _local17);
if (_local17 > _local20){
return;
};
_arg1.pointCount = 1;
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local7) + (_local12.col2.x * _local8));
_arg1.normal.y = ((_local12.col1.y * _local7) + (_local12.col2.y * _local8));
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local17 - _local20);
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
}
}
}//package Box2D.Collision
Section 15
//b2ContactID (Box2D.Collision.b2ContactID)
package Box2D.Collision {
public class b2ContactID {
public var _key:uint;
public var features:Features;
public function b2ContactID(){
features = new Features();
super();
features._m_id = this;
}
public function Set(_arg1:b2ContactID):void{
key = _arg1._key;
}
public function Copy():b2ContactID{
var _local1:b2ContactID;
_local1 = new b2ContactID();
_local1.key = key;
return (_local1);
}
public function get key():uint{
return (_key);
}
public function set key(_arg1:uint):void{
_key = _arg1;
features._referenceEdge = (_key & 0xFF);
features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF);
features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF);
features._flip = (((_key & 4278190080) >> 24) & 0xFF);
}
}
}//package Box2D.Collision
Section 16
//b2ContactPoint (Box2D.Collision.b2ContactPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2ContactPoint {
public var separation:Number;
public var normal:b2Vec2;
public var position:b2Vec2;
public var restitution:Number;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var id:b2ContactID;
public var friction:Number;
public var velocity:b2Vec2;
public function b2ContactPoint(){
position = new b2Vec2();
velocity = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 17
//b2Distance (Box2D.Collision.b2Distance)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2Distance {
private static var s_p2s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_points:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var gPoint:b2Point = new b2Point();
public static var g_GJK_Iterations:int = 0;
public static function InPoints(_arg1:b2Vec2, _arg2:Array, _arg3:int):Boolean{
var _local4:Number;
var _local5:int;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local4 = (100 * Number.MIN_VALUE);
_local5 = 0;
while (_local5 < _arg3) {
_local6 = _arg2[_local5];
_local7 = Math.abs((_arg1.x - _local6.x));
_local8 = Math.abs((_arg1.y - _local6.y));
_local9 = Math.max(Math.abs(_arg1.x), Math.abs(_local6.x));
_local10 = Math.max(Math.abs(_arg1.y), Math.abs(_local6.y));
if ((((_local7 < (_local4 * (_local9 + 1)))) && ((_local8 < (_local4 * (_local10 + 1)))))){
return (true);
};
_local5++;
};
return (false);
}
public static function DistanceGeneric(_arg1:b2Vec2, _arg2:b2Vec2, _arg3, _arg4:b2XForm, _arg5, _arg6:b2XForm):Number{
var _local7:b2Vec2;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:int;
var _local12:Number;
var _local13:int;
var _local14:int;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:int;
_local8 = s_p1s;
_local9 = s_p2s;
_local10 = s_points;
_local11 = 0;
_arg1.SetV(_arg3.GetFirstVertex(_arg4));
_arg2.SetV(_arg5.GetFirstVertex(_arg6));
_local12 = 0;
_local13 = 20;
_local14 = 0;
while (_local14 < _local13) {
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local17 = _arg3.Support(_arg4, _local15, _local16);
_local18 = _arg5.Support(_arg6, -(_local15), -(_local16));
_local12 = ((_local15 * _local15) + (_local16 * _local16));
_local19 = (_local18.x - _local17.x);
_local20 = (_local18.y - _local17.y);
_local21 = ((_local15 * _local19) + (_local16 * _local20));
if ((_local12 - ((_local15 * _local19) + (_local16 * _local20))) <= (0.01 * _local12)){
if (_local11 == 0){
_arg1.SetV(_local17);
_arg2.SetV(_local18);
};
g_GJK_Iterations = _local14;
return (Math.sqrt(_local12));
};
switch (_local11){
case 0:
_local7 = _local8[0];
_local7.SetV(_local17);
_local7 = _local9[0];
_local7.SetV(_local18);
_local7 = _local10[0];
_local7.x = _local19;
_local7.y = _local20;
_arg1.SetV(_local8[0]);
_arg2.SetV(_local9[0]);
_local11++;
break;
case 1:
_local7 = _local8[1];
_local7.SetV(_local17);
_local7 = _local9[1];
_local7.SetV(_local18);
_local7 = _local10[1];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessTwo(_arg1, _arg2, _local8, _local9, _local10);
break;
case 2:
_local7 = _local8[2];
_local7.SetV(_local17);
_local7 = _local9[2];
_local7.SetV(_local18);
_local7 = _local10[2];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessThree(_arg1, _arg2, _local8, _local9, _local10);
break;
};
if (_local11 == 3){
g_GJK_Iterations = _local14;
return (0);
};
_local22 = -(Number.MAX_VALUE);
_local23 = 0;
while (_local23 < _local11) {
_local7 = _local10[_local23];
_local22 = b2Math.b2Max(_local22, ((_local7.x * _local7.x) + (_local7.y * _local7.y)));
_local23++;
};
if ((((_local11 == 3)) || ((_local12 <= ((100 * Number.MIN_VALUE) * _local22))))){
g_GJK_Iterations = _local14;
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local12 = ((_local15 * _local15) + (_local16 * _local16));
return (Math.sqrt(_local12));
};
_local14++;
};
g_GJK_Iterations = _local13;
return (Math.sqrt(_local12));
}
public static function DistanceCC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2CircleShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local7 = _arg4.R;
_local8 = _arg3.m_localPosition;
_local9 = (_arg4.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local10 = (_arg4.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local7 = _arg6.R;
_local8 = _arg5.m_localPosition;
_local11 = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local12 = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = ((_local13 * _local13) + (_local14 * _local14));
_local16 = (_arg3.m_radius - b2Settings.b2_toiSlop);
_local17 = (_arg5.m_radius - b2Settings.b2_toiSlop);
_local18 = (_local16 + _local17);
if (_local15 > (_local18 * _local18)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_local20 = (_local19 - _local18);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = (_local11 - (_local17 * _local13));
_arg2.y = (_local12 - (_local17 * _local14));
return (_local20);
};
if (_local15 > (Number.MIN_VALUE * Number.MIN_VALUE)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
};
_arg1.x = _local9;
_arg1.y = _local10;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
}
public static function ProcessThree(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local14:b2Vec2;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg5[2];
_local9 = _arg3[0];
_local10 = _arg3[1];
_local11 = _arg3[2];
_local12 = _arg4[0];
_local13 = _arg4[1];
_local14 = _arg4[2];
_local15 = _local6.x;
_local16 = _local6.y;
_local17 = _local7.x;
_local18 = _local7.y;
_local19 = _local8.x;
_local20 = _local8.y;
_local21 = (_local17 - _local15);
_local22 = (_local18 - _local16);
_local23 = (_local19 - _local15);
_local24 = (_local20 - _local16);
_local25 = (_local19 - _local17);
_local26 = (_local20 - _local18);
_local27 = -(((_local15 * _local21) + (_local16 * _local22)));
_local28 = ((_local17 * _local21) + (_local18 * _local22));
_local29 = -(((_local15 * _local23) + (_local16 * _local24)));
_local30 = ((_local19 * _local23) + (_local20 * _local24));
_local31 = -(((_local17 * _local25) + (_local18 * _local26)));
_local32 = ((_local19 * _local25) + (_local20 * _local26));
if ((((_local30 <= 0)) && ((_local32 <= 0)))){
_arg1.SetV(_local11);
_arg2.SetV(_local14);
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (1);
};
_local33 = ((_local21 * _local24) - (_local22 * _local23));
_local34 = (_local33 * ((_local15 * _local18) - (_local16 * _local17)));
_local36 = (_local33 * ((_local17 * _local20) - (_local18 * _local19)));
if ((((((((_local36 <= 0)) && ((_local31 >= 0)))) && ((_local32 >= 0)))) && (((_local31 + _local32) > 0)))){
_local35 = (_local31 / (_local31 + _local32));
_arg1.x = (_local10.x + (_local35 * (_local11.x - _local10.x)));
_arg1.y = (_local10.y + (_local35 * (_local11.y - _local10.y)));
_arg2.x = (_local13.x + (_local35 * (_local14.x - _local13.x)));
_arg2.y = (_local13.y + (_local35 * (_local14.y - _local13.y)));
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (2);
};
_local37 = (_local33 * ((_local19 * _local16) - (_local20 * _local15)));
if ((((((((_local37 <= 0)) && ((_local29 >= 0)))) && ((_local30 >= 0)))) && (((_local29 + _local30) > 0)))){
_local35 = (_local29 / (_local29 + _local30));
_arg1.x = (_local9.x + (_local35 * (_local11.x - _local9.x)));
_arg1.y = (_local9.y + (_local35 * (_local11.y - _local9.y)));
_arg2.x = (_local12.x + (_local35 * (_local14.x - _local12.x)));
_arg2.y = (_local12.y + (_local35 * (_local14.y - _local12.y)));
_local10.SetV(_local11);
_local13.SetV(_local14);
_local7.SetV(_local8);
return (2);
};
_local38 = ((_local36 + _local37) + _local34);
_local38 = (1 / _local38);
_local39 = (_local36 * _local38);
_local40 = (_local37 * _local38);
_local41 = ((1 - _local39) - _local40);
_arg1.x = (((_local39 * _local9.x) + (_local40 * _local10.x)) + (_local41 * _local11.x));
_arg1.y = (((_local39 * _local9.y) + (_local40 * _local10.y)) + (_local41 * _local11.y));
_arg2.x = (((_local39 * _local12.x) + (_local40 * _local13.x)) + (_local41 * _local14.x));
_arg2.y = (((_local39 * _local12.y) + (_local40 * _local13.y)) + (_local41 * _local14.y));
return (3);
}
public static function DistancePC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2PolygonShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:b2Point;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local9 = gPoint;
_local8 = _arg5.m_localPosition;
_local7 = _arg6.R;
_local9.p.x = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local9.p.y = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local10 = DistanceGeneric(_arg1, _arg2, _arg3, _arg4, _local9, b2Math.b2XForm_identity);
_local11 = (_arg5.m_radius - b2Settings.b2_toiSlop);
if (_local10 > _local11){
_local10 = (_local10 - _local11);
_local12 = (_arg2.x - _arg1.x);
_local13 = (_arg2.y - _arg1.y);
_local14 = Math.sqrt(((_local12 * _local12) + (_local13 * _local13)));
_local12 = (_local12 / _local14);
_local13 = (_local13 / _local14);
_arg2.x = (_arg2.x - (_local11 * _local12));
_arg2.y = (_arg2.y - (_local11 * _local13));
} else {
_local10 = 0;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
};
return (_local10);
}
public static function Distance(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Shape, _arg4:b2XForm, _arg5:b2Shape, _arg6:b2XForm):Number{
var _local7:int;
var _local8:int;
_local7 = _arg3.m_type;
_local8 = _arg5.m_type;
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistanceCC(_arg1, _arg2, (_arg3 as b2CircleShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistancePC(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistancePC(_arg2, _arg1, (_arg5 as b2PolygonShape), _arg6, (_arg3 as b2CircleShape), _arg4));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistanceGeneric(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2PolygonShape), _arg6));
};
return (0);
}
public static function ProcessTwo(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg3[0];
_local9 = _arg3[1];
_local10 = _arg4[0];
_local11 = _arg4[1];
_local12 = -(_local7.x);
_local13 = -(_local7.y);
_local14 = (_local6.x - _local7.x);
_local15 = (_local6.y - _local7.y);
_local16 = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
_local14 = (_local14 / _local16);
_local15 = (_local15 / _local16);
_local17 = ((_local12 * _local14) + (_local13 * _local15));
if ((((_local17 <= 0)) || ((_local16 < Number.MIN_VALUE)))){
_arg1.SetV(_local9);
_arg2.SetV(_local11);
_local8.SetV(_local9);
_local10.SetV(_local11);
_local6.SetV(_local7);
return (1);
};
_local17 = (_local17 / _local16);
_arg1.x = (_local9.x + (_local17 * (_local8.x - _local9.x)));
_arg1.y = (_local9.y + (_local17 * (_local8.y - _local9.y)));
_arg2.x = (_local11.x + (_local17 * (_local10.x - _local11.x)));
_arg2.y = (_local11.y + (_local17 * (_local10.y - _local11.y)));
return (2);
}
}
}//package Box2D.Collision
Section 18
//b2Manifold (Box2D.Collision.b2Manifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Manifold {
public var points:Array;
public var pointCount:int;// = 0
public var normal:b2Vec2;
public function b2Manifold(){
var _local1:int;
pointCount = 0;
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ManifoldPoint();
_local1++;
};
normal = new b2Vec2();
}
public function Set(_arg1:b2Manifold):void{
var _local2:int;
pointCount = _arg1.pointCount;
_local2 = 0;
while (_local2 < b2Settings.b2_maxManifoldPoints) {
(points[_local2] as b2ManifoldPoint).Set(_arg1.points[_local2]);
_local2++;
};
normal.SetV(_arg1.normal);
}
public function Reset():void{
var _local1:int;
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
(points[_local1] as b2ManifoldPoint).Reset();
_local1++;
};
normal.SetZero();
pointCount = 0;
}
}
}//package Box2D.Collision
Section 19
//b2ManifoldPoint (Box2D.Collision.b2ManifoldPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2ManifoldPoint {
public var separation:Number;
public var localPoint2:b2Vec2;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var localPoint1:b2Vec2;
public var id:b2ContactID;
public function b2ManifoldPoint(){
localPoint1 = new b2Vec2();
localPoint2 = new b2Vec2();
id = new b2ContactID();
super();
}
public function Set(_arg1:b2ManifoldPoint):void{
localPoint1.SetV(_arg1.localPoint1);
localPoint2.SetV(_arg1.localPoint2);
separation = _arg1.separation;
normalImpulse = _arg1.normalImpulse;
tangentImpulse = _arg1.tangentImpulse;
id.key = _arg1.id.key;
}
public function Reset():void{
localPoint1.SetZero();
localPoint2.SetZero();
separation = 0;
normalImpulse = 0;
tangentImpulse = 0;
id.key = 0;
}
}
}//package Box2D.Collision
Section 20
//b2OBB (Box2D.Collision.b2OBB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2OBB {
public var R:b2Mat22;
public var center:b2Vec2;
public var extents:b2Vec2;
public function b2OBB(){
R = new b2Mat22();
center = new b2Vec2();
extents = new b2Vec2();
super();
}
}
}//package Box2D.Collision
Section 21
//b2Pair (Box2D.Collision.b2Pair)
package Box2D.Collision {
import Box2D.Common.*;
public class b2Pair {
public var userData;// = null
public var proxyId1:uint;
public var proxyId2:uint;
public var status:uint;
public var next:uint;
public static var e_pairFinal:uint = 4;
public static var b2_tableMask:int = (b2_tableCapacity - 1);
public static var e_pairRemoved:uint = 2;
public static var b2_nullPair:uint = b2Settings.USHRT_MAX;
public static var e_pairBuffered:uint = 1;
public static var b2_nullProxy:uint = b2Settings.USHRT_MAX;
public static var b2_tableCapacity:int = b2Settings.b2_maxPairs;
public function b2Pair(){
userData = null;
super();
}
public function SetBuffered():void{
status = (status | e_pairBuffered);
}
public function IsBuffered():Boolean{
return (((status & e_pairBuffered) == e_pairBuffered));
}
public function IsFinal():Boolean{
return (((status & e_pairFinal) == e_pairFinal));
}
public function ClearRemoved():void{
status = (status & ~(e_pairRemoved));
}
public function SetFinal():void{
status = (status | e_pairFinal);
}
public function IsRemoved():Boolean{
return (((status & e_pairRemoved) == e_pairRemoved));
}
public function ClearBuffered():void{
status = (status & ~(e_pairBuffered));
}
public function SetRemoved():void{
status = (status | e_pairRemoved);
}
}
}//package Box2D.Collision
Section 22
//b2PairCallback (Box2D.Collision.b2PairCallback)
package Box2D.Collision {
public class b2PairCallback {
public function PairRemoved(_arg1, _arg2, _arg3):void{
}
public function PairAdded(_arg1, _arg2){
return (null);
}
}
}//package Box2D.Collision
Section 23
//b2PairManager (Box2D.Collision.b2PairManager)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PairManager {
public var m_pairCount:int;
public var m_pairBuffer:Array;
public var m_callback:b2PairCallback;
public var m_pairs:Array;
public var m_pairBufferCount:int;
public var m_hashTable:Array;
public var m_broadPhase:b2BroadPhase;
public var m_freePair:uint;
public function b2PairManager(){
var _local1:uint;
super();
m_hashTable = new Array(b2Pair.b2_tableCapacity);
_local1 = 0;
while (_local1 < b2Pair.b2_tableCapacity) {
m_hashTable[_local1] = b2Pair.b2_nullPair;
_local1++;
};
m_pairs = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1] = new b2Pair();
_local1++;
};
m_pairBuffer = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairBuffer[_local1] = new b2BufferedPair();
_local1++;
};
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy;
m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy;
m_pairs[_local1].userData = null;
m_pairs[_local1].status = 0;
m_pairs[_local1].next = (_local1 + 1);
_local1++;
};
m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair;
m_pairCount = 0;
m_pairBufferCount = 0;
}
private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{
var _local4:b2Pair;
var _local5:uint;
_local5 = m_hashTable[_arg3];
_local4 = m_pairs[_local5];
while (((!((_local5 == b2Pair.b2_nullPair))) && ((Equals(_local4, _arg1, _arg2) == false)))) {
_local5 = _local4.next;
_local4 = m_pairs[_local5];
};
if (_local5 == b2Pair.b2_nullPair){
return (null);
};
return (_local4);
}
private function Find(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:uint;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
return (FindHash(_arg1, _arg2, _local3));
}
private function ValidateBuffer():void{
}
public function Commit():void{
var _local1:b2BufferedPair;
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:b2Pair;
var _local6:b2Proxy;
var _local7:b2Proxy;
_local3 = 0;
_local4 = m_broadPhase.m_proxyPool;
_local2 = 0;
while (_local2 < m_pairBufferCount) {
_local1 = m_pairBuffer[_local2];
_local5 = Find(_local1.proxyId1, _local1.proxyId2);
_local5.ClearBuffered();
_local6 = _local4[_local5.proxyId1];
_local7 = _local4[_local5.proxyId2];
if (_local5.IsRemoved()){
if (_local5.IsFinal() == true){
m_callback.PairRemoved(_local6.userData, _local7.userData, _local5.userData);
};
_local1 = m_pairBuffer[_local3];
_local1.proxyId1 = _local5.proxyId1;
_local1.proxyId2 = _local5.proxyId2;
_local3++;
} else {
if (_local5.IsFinal() == false){
_local5.userData = m_callback.PairAdded(_local6.userData, _local7.userData);
_local5.SetFinal();
};
};
_local2++;
};
_local2 = 0;
while (_local2 < _local3) {
_local1 = m_pairBuffer[_local2];
RemovePair(_local1.proxyId1, _local1.proxyId2);
_local2++;
};
m_pairBufferCount = 0;
if (b2BroadPhase.s_validate){
ValidateTable();
};
}
public function RemoveBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = Find(_arg1, _arg2);
if (_local4 == null){
return;
};
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.SetRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function RemovePair(_arg1:uint, _arg2:uint){
var _local3:b2Pair;
var _local4:uint;
var _local5:uint;
var _local6:b2Pair;
var _local7:uint;
var _local8:uint;
var _local9:*;
if (_arg1 > _arg2){
_local7 = _arg1;
_arg1 = _arg2;
_arg2 = _local7;
};
_local4 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local5 = m_hashTable[_local4];
_local6 = null;
while (_local5 != b2Pair.b2_nullPair) {
if (Equals(m_pairs[_local5], _arg1, _arg2)){
_local8 = _local5;
_local3 = m_pairs[_local5];
if (_local6){
_local6.next = _local3.next;
} else {
m_hashTable[_local4] = _local3.next;
};
_local3 = m_pairs[_local8];
_local9 = _local3.userData;
_local3.next = m_freePair;
_local3.proxyId1 = b2Pair.b2_nullProxy;
_local3.proxyId2 = b2Pair.b2_nullProxy;
_local3.userData = null;
_local3.status = 0;
m_freePair = _local8;
m_pairCount--;
return (_local9);
} else {
_local6 = m_pairs[_local5];
_local5 = _local6.next;
};
};
return (null);
}
public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{
m_broadPhase = _arg1;
m_callback = _arg2;
}
public function AddBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = AddPair(_arg1, _arg2);
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.ClearRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function AddPair(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:b2Pair;
var _local5:uint;
var _local6:uint;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local4 = FindHash(_arg1, _arg2, _local3);
if (_local4 != null){
return (_local4);
};
_local5 = m_freePair;
_local4 = m_pairs[_local5];
m_freePair = _local4.next;
_local4.proxyId1 = _arg1;
_local4.proxyId2 = _arg2;
_local4.status = 0;
_local4.userData = null;
_local4.next = m_hashTable[_local3];
m_hashTable[_local3] = _local5;
m_pairCount++;
return (_local4);
}
private function ValidateTable():void{
}
public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{
return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2))));
}
public static function Hash(_arg1:uint, _arg2:uint):uint{
var _local3:uint;
_local3 = (((_arg2 << 16) & 4294901760) | _arg1);
_local3 = (~(_local3) + ((_local3 << 15) & 4294934528));
_local3 = (_local3 ^ ((_local3 >> 12) & 1048575));
_local3 = (_local3 + ((_local3 << 2) & 4294967292));
_local3 = (_local3 ^ ((_local3 >> 4) & 268435455));
_local3 = (_local3 * 2057);
_local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF));
return (_local3);
}
public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{
return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3))));
}
}
}//package Box2D.Collision
Section 24
//b2Point (Box2D.Collision.b2Point)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Point {
public var p:b2Vec2;
public function b2Point(){
p = new b2Vec2();
super();
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (p);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
return (p);
}
}
}//package Box2D.Collision
Section 25
//b2Proxy (Box2D.Collision.b2Proxy)
package Box2D.Collision {
public class b2Proxy {
public var overlapCount:uint;
public var lowerBounds:Array;
public var upperBounds:Array;
public var userData;// = null
public var timeStamp:uint;
public function b2Proxy(){
lowerBounds = [uint(0), uint(0)];
upperBounds = [uint(0), uint(0)];
userData = null;
super();
}
public function GetNext():uint{
return (lowerBounds[0]);
}
public function IsValid():Boolean{
return (!((overlapCount == b2BroadPhase.b2_invalid)));
}
public function SetNext(_arg1:uint):void{
lowerBounds[0] = (_arg1 & 0xFFFF);
}
}
}//package Box2D.Collision
Section 26
//b2Segment (Box2D.Collision.b2Segment)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Segment {
public var p1:b2Vec2;
public var p2:b2Vec2;
public function b2Segment(){
p1 = new b2Vec2();
p2 = new b2Vec2();
super();
}
public function TestSegment(_arg1:Array, _arg2:b2Vec2, _arg3:b2Segment, _arg4:Number):Boolean{
var _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local5 = _arg3.p1;
_local6 = (_arg3.p2.x - _local5.x);
_local7 = (_arg3.p2.y - _local5.y);
_local8 = (p2.x - p1.x);
_local9 = (p2.y - p1.y);
_local10 = _local9;
_local11 = -(_local8);
_local12 = (100 * Number.MIN_VALUE);
_local13 = -(((_local6 * _local10) + (_local7 * _local11)));
if (_local13 > _local12){
_local14 = (_local5.x - p1.x);
_local15 = (_local5.y - p1.y);
_local16 = ((_local14 * _local10) + (_local15 * _local11));
if ((((0 <= _local16)) && ((_local16 <= (_arg4 * _local13))))){
_local17 = ((-(_local7) * _local15) + (_local7 * _local14));
if (((((-(_local12) * _local13) <= _local17)) && ((_local17 <= (_local13 * (1 + _local12)))))){
_local16 = (_local16 / _local13);
_local18 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
_local10 = (_local10 / _local18);
_local11 = (_local11 / _local18);
_arg1[0] = _local16;
_arg2.Set(_local10, _local11);
return (true);
};
};
};
return (false);
}
public function ExtendForward(_arg1:b2AABB):void{
var dX:Number;
var dY:Number;
var greaterthan0:*;
var lambda:Number;
var aabb = _arg1;
dX = (p2.x - p1.x);
dY = (p2.y - p1.y);
greaterthan0 = function (_arg1){
return ((_arg1 > 0));
};
lambda = Math.min(((dX > 0)) ? ((aabb.upperBound.x - p1.x) / dX) : ((dX < 0)) ? ((aabb.lowerBound.x - p1.x) / dX) : Number.POSITIVE_INFINITY, ((dY > 0)) ? ((aabb.upperBound.y - p1.y) / dY) : ((dY < 0)) ? ((aabb.lowerBound.y - p1.y) / dY) : Number.POSITIVE_INFINITY);
p2.x = (p1.x + (dX * lambda));
p2.y = (p1.y + (dY * lambda));
}
public function Extend(_arg1:b2AABB):void{
ExtendForward(_arg1);
ExtendBackward(_arg1);
}
public function ExtendBackward(_arg1:b2AABB):void{
var dX:Number;
var dY:Number;
var greaterthan0:*;
var lambda:Number;
var aabb = _arg1;
dX = (-(p2.x) + p1.x);
dY = (-(p2.y) + p1.y);
greaterthan0 = function (_arg1){
return ((_arg1 > 0));
};
lambda = Math.min(((dX > 0)) ? ((aabb.upperBound.x - p2.x) / dX) : ((dX < 0)) ? ((aabb.lowerBound.x - p2.x) / dX) : Number.POSITIVE_INFINITY, ((dY > 0)) ? ((aabb.upperBound.y - p2.y) / dY) : ((dY < 0)) ? ((aabb.lowerBound.y - p2.y) / dY) : Number.POSITIVE_INFINITY);
p1.x = (p2.x + (dX * lambda));
p1.y = (p2.y + (dY * lambda));
}
}
}//package Box2D.Collision
Section 27
//b2TimeOfImpact (Box2D.Collision.b2TimeOfImpact)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2TimeOfImpact {
public static var s_xf1:b2XForm = new b2XForm();
public static var s_xf2:b2XForm = new b2XForm();
public static var s_p1:b2Vec2 = new b2Vec2();
public static var s_p2:b2Vec2 = new b2Vec2();
public static function TimeOfImpact(_arg1:b2Shape, _arg2:b2Sweep, _arg3:b2Shape, _arg4:b2Sweep):Number{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:int;
var _local20:int;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:b2XForm;
var _local27:b2XForm;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
_local7 = _arg1.m_sweepRadius;
_local8 = _arg3.m_sweepRadius;
_local9 = _arg2.t0;
_local10 = (_arg2.c.x - _arg2.c0.x);
_local11 = (_arg2.c.y - _arg2.c0.y);
_local12 = (_arg4.c.x - _arg4.c0.x);
_local13 = (_arg4.c.y - _arg4.c0.y);
_local14 = (_arg2.a - _arg2.a0);
_local15 = (_arg4.a - _arg4.a0);
_local16 = 0;
_local17 = s_p1;
_local18 = s_p2;
_local19 = 20;
_local20 = 0;
_local21 = 0;
_local22 = 0;
_local23 = 0;
_local24 = 0;
while (true) {
_local25 = (((1 - _local16) * _local9) + _local16);
_local26 = s_xf1;
_local27 = s_xf2;
_arg2.GetXForm(_local26, _local25);
_arg4.GetXForm(_local27, _local25);
_local23 = b2Distance.Distance(_local17, _local18, _arg1, _local26, _arg3, _local27);
if (_local20 == 0){
if (_local23 > (2 * b2Settings.b2_toiSlop)){
_local24 = (1.5 * b2Settings.b2_toiSlop);
} else {
_local5 = (0.05 * b2Settings.b2_toiSlop);
_local6 = (_local23 - (0.5 * b2Settings.b2_toiSlop));
_local24 = ((_local5 > _local6)) ? _local5 : _local6;
};
};
if (((((_local23 - _local24) < (0.05 * b2Settings.b2_toiSlop))) || ((_local20 == _local19)))){
break;
};
_local21 = (_local18.x - _local17.x);
_local22 = (_local18.y - _local17.y);
_local28 = Math.sqrt(((_local21 * _local21) + (_local22 * _local22)));
_local21 = (_local21 / _local28);
_local22 = (_local22 / _local28);
_local29 = ((((_local21 * (_local10 - _local12)) + (_local22 * (_local11 - _local13))) + (((_local14 < 0)) ? -(_local14) : _local14 * _local7)) + (((_local15 < 0)) ? -(_local15) : _local15 * _local8));
if (_local29 == 0){
_local16 = 1;
break;
};
_local30 = ((_local23 - _local24) / _local29);
_local31 = (_local16 + _local30);
if ((((_local31 < 0)) || ((1 < _local31)))){
_local16 = 1;
break;
};
if (_local31 < ((1 + (100 * Number.MIN_VALUE)) * _local16)){
break;
};
_local16 = _local31;
_local20++;
};
return (_local16);
}
}
}//package Box2D.Collision
Section 28
//ClipVertex (Box2D.Collision.ClipVertex)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class ClipVertex {
public var v:b2Vec2;
public var id:b2ContactID;
public function ClipVertex(){
v = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 29
//Features (Box2D.Collision.Features)
package Box2D.Collision {
public class Features {
public var _referenceEdge:int;
public var _incidentEdge:int;
public var _flip:int;
public var _incidentVertex:int;
public var _m_id:b2ContactID;
public function get referenceEdge():int{
return (_referenceEdge);
}
public function set incidentVertex(_arg1:int):void{
_incidentVertex = _arg1;
_m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000));
}
public function get flip():int{
return (_flip);
}
public function get incidentEdge():int{
return (_incidentEdge);
}
public function set referenceEdge(_arg1:int):void{
_referenceEdge = _arg1;
_m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF));
}
public function set flip(_arg1:int):void{
_flip = _arg1;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function get incidentVertex():int{
return (_incidentVertex);
}
public function set incidentEdge(_arg1:int):void{
_incidentEdge = _arg1;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 30
//b2Mat22 (Box2D.Common.Math.b2Mat22)
package Box2D.Common.Math {
public class b2Mat22 {
public var col1:b2Vec2;
public var col2:b2Vec2;
public function b2Mat22(_arg1:Number=0, _arg2:b2Vec2=null, _arg3:b2Vec2=null){
var _local4:Number;
var _local5:Number;
col1 = new b2Vec2();
col2 = new b2Vec2();
super();
if (((!((_arg2 == null))) && (!((_arg3 == null))))){
col1.SetV(_arg2);
col2.SetV(_arg3);
} else {
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
col1.x = _local4;
col2.x = -(_local5);
col1.y = _local5;
col2.y = _local4;
};
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col1.y = 0;
col2.y = 1;
}
public function Set(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
col1.x = _local2;
col2.x = -(_local3);
col1.y = _local3;
col2.y = _local2;
}
public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col1.y = 0;
col2.y = 0;
}
public function SetM(_arg1:b2Mat22):void{
col1.SetV(_arg1.col1);
col2.SetV(_arg1.col2);
}
public function AddM(_arg1:b2Mat22):void{
col1.x = (col1.x + _arg1.col1.x);
col1.y = (col1.y + _arg1.col1.y);
col2.x = (col2.x + _arg1.col2.x);
col2.y = (col2.y + _arg1.col2.y);
}
public function Abs():void{
col1.Abs();
col2.Abs();
}
public function Copy():b2Mat22{
return (new b2Mat22(0, col1, col2));
}
public function Invert(_arg1:b2Mat22):b2Mat22{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = col1.x;
_local3 = col2.x;
_local4 = col1.y;
_local5 = col2.y;
_local6 = ((_local2 * _local5) - (_local3 * _local4));
_local6 = (1 / _local6);
_arg1.col1.x = (_local6 * _local5);
_arg1.col2.x = (-(_local6) * _local3);
_arg1.col1.y = (-(_local6) * _local4);
_arg1.col2.y = (_local6 * _local2);
return (_arg1);
}
public function GetAngle():Number{
return (Math.atan2(col1.y, col1.x));
}
public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = col1.x;
_local5 = col2.x;
_local6 = col1.y;
_local7 = col2.y;
_local8 = ((_local4 * _local7) - (_local5 * _local6));
_local8 = (1 / _local8);
_arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3)));
_arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2)));
return (_arg1);
}
}
}//package Box2D.Common.Math
Section 31
//b2Math (Box2D.Common.Math.b2Math)
package Box2D.Common.Math {
public class b2Math {
public static const b2Mat22_identity:b2Mat22 = new b2Mat22(0, new b2Vec2(1, 0), new b2Vec2(0, 1));
public static const b2XForm_identity:b2XForm = new b2XForm(b2Vec2_zero, b2Mat22_identity);
public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0, 0);
public static function b2CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x));
return (_local3);
}
public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y));
return (_local3);
}
public static function b2IsValid(_arg1:Number):Boolean{
return (isFinite(_arg1));
}
public static function b2MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Min(_arg1.x, _arg2.x), b2Min(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2MulX(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = b2MulMV(_arg1.R, _arg2);
_local3.x = (_local3.x + _arg1.position.x);
_local3.y = (_local3.y + _arg1.position.y);
return (_local3);
}
public static function b2DistanceSquared(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (((_local3 * _local3) + (_local4 * _local4)));
}
public static function b2Swap(_arg1:Array, _arg2:Array):void{
var _local3:*;
_local3 = _arg1[0];
_arg1[0] = _arg2[0];
_arg2[0] = _local3;
}
public static function b2AbsM(_arg1:b2Mat22):b2Mat22{
var _local2:b2Mat22;
_local2 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2));
return (_local2);
}
public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
return (_local3);
}
public static function b2MulXT(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
_local3 = SubtractVV(_arg2, _arg1.position);
_local4 = ((_local3.x * _arg1.R.col1.x) + (_local3.y * _arg1.R.col1.y));
_local3.y = ((_local3.x * _arg1.R.col2.x) + (_local3.y * _arg1.R.col2.y));
_local3.x = _local4;
return (_local3);
}
public static function b2Abs(_arg1:Number):Number{
return (((_arg1 > 0)) ? _arg1 : -(_arg1));
}
public static function b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (b2Max(_arg2, b2Min(_arg1, _arg3)));
}
public static function b2AbsV(_arg1:b2Vec2):b2Vec2{
var _local2:b2Vec2;
_local2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y));
return (_local2);
}
public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y));
return (_local3);
}
public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x));
return (_local3);
}
public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2));
return (_local3);
}
public static function b2Distance(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2Mat22;
_local3 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1));
_local4 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2));
_local5 = new b2Mat22(0, _local3, _local4);
return (_local5);
}
public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2IsPowerOfTwo(_arg1:uint):Boolean{
var _local2:Boolean;
_local2 = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0)));
return (_local2);
}
public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{
return (b2MaxV(_arg2, b2MinV(_arg1, _arg3)));
}
public static function b2RandomRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = Math.random();
_local3 = (((_arg2 - _arg1) * _local3) + _arg1);
return (_local3);
}
public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Dot(_arg2, _arg1.col1), b2Dot(_arg2, _arg1.col2));
return (_local3);
}
public static function b2Min(_arg1:Number, _arg2:Number):Number{
return (((_arg1 < _arg2)) ? _arg1 : _arg2);
}
public static function b2Random():Number{
return (((Math.random() * 2) - 1));
}
public static function b2MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, b2MulMV(_arg1, _arg2.col1), b2MulMV(_arg1, _arg2.col2));
return (_local3);
}
public static function b2NextPowerOfTwo(_arg1:uint):uint{
_arg1 = (_arg1 | ((_arg1 >> 1) & 2147483647));
_arg1 = (_arg1 | ((_arg1 >> 2) & 1073741823));
_arg1 = (_arg1 | ((_arg1 >> 4) & 268435455));
_arg1 = (_arg1 | ((_arg1 >> 8) & 0xFFFFFF));
_arg1 = (_arg1 | ((_arg1 >> 16) & 0xFFFF));
return ((_arg1 + 1));
}
public static function b2Max(_arg1:Number, _arg2:Number):Number{
return (((_arg1 > _arg2)) ? _arg1 : _arg2);
}
public static function b2MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y)));
return (_local3);
}
}
}//package Box2D.Common.Math
Section 32
//b2Sweep (Box2D.Common.Math.b2Sweep)
package Box2D.Common.Math {
public class b2Sweep {
public var localCenter:b2Vec2;
public var c:b2Vec2;
public var a:Number;
public var c0:b2Vec2;
public var a0:Number;
public var t0:Number;
public function b2Sweep(){
localCenter = new b2Vec2();
c0 = new b2Vec2();
c = new b2Vec2();
super();
}
public function Advance(_arg1:Number):void{
var _local2:Number;
if ((((t0 < _arg1)) && (((1 - t0) > Number.MIN_VALUE)))){
_local2 = ((_arg1 - t0) / (1 - t0));
c0.x = (((1 - _local2) * c0.x) + (_local2 * c.x));
c0.y = (((1 - _local2) * c0.y) + (_local2 * c.y));
a0 = (((1 - _local2) * a0) + (_local2 * a));
t0 = _arg1;
};
}
public function GetXForm(_arg1:b2XForm, _arg2:Number):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
if ((1 - t0) > Number.MIN_VALUE){
_local4 = ((_arg2 - t0) / (1 - t0));
_arg1.position.x = (((1 - _local4) * c0.x) + (_local4 * c.x));
_arg1.position.y = (((1 - _local4) * c0.y) + (_local4 * c.y));
_local5 = (((1 - _local4) * a0) + (_local4 * a));
_arg1.R.Set(_local5);
} else {
_arg1.position.SetV(c);
_arg1.R.Set(a);
};
_local3 = _arg1.R;
_arg1.position.x = (_arg1.position.x - ((_local3.col1.x * localCenter.x) + (_local3.col2.x * localCenter.y)));
_arg1.position.y = (_arg1.position.y - ((_local3.col1.y * localCenter.x) + (_local3.col2.y * localCenter.y)));
}
}
}//package Box2D.Common.Math
Section 33
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
public class b2Vec2 {
public var x:Number;
public var y:Number;
public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Set(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function Length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function LengthSquared():Number{
return (((x * x) + (y * y)));
}
public function SetZero():void{
x = 0;
y = 0;
}
public function Add(_arg1:b2Vec2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function MaxV(_arg1:b2Vec2):void{
x = ((x > _arg1.x)) ? x : _arg1.x;
y = ((y > _arg1.y)) ? y : _arg1.y;
}
public function SetV(_arg1:b2Vec2):void{
x = _arg1.x;
y = _arg1.y;
}
public function Negative():b2Vec2{
return (new b2Vec2(-(x), -(y)));
}
public function CrossVF(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (_arg1 * y);
y = (-(_arg1) * _local2);
}
public function Abs():void{
if (x < 0){
x = -(x);
};
if (y < 0){
y = -(y);
};
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function MulTM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = b2Math.b2Dot(this, _arg1.col1);
y = b2Math.b2Dot(this, _arg1.col2);
x = _local2;
}
public function IsValid():Boolean{
return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y))));
}
public function MinV(_arg1:b2Vec2):void{
x = ((x < _arg1.x)) ? x : _arg1.x;
y = ((y < _arg1.y)) ? y : _arg1.y;
}
public function MulM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = x;
x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y));
y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y));
}
public function Normalize():Number{
var _local1:Number;
var _local2:Number;
_local1 = Math.sqrt(((x * x) + (y * y)));
if (_local1 < Number.MIN_VALUE){
return (0);
};
_local2 = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
return (_local1);
}
public function Subtract(_arg1:b2Vec2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function CrossFV(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (-(_arg1) * y);
y = (_arg1 * _local2);
}
public static function Make(_arg1:Number, _arg2:Number):b2Vec2{
return (new b2Vec2(_arg1, _arg2));
}
}
}//package Box2D.Common.Math
Section 34
//b2XForm (Box2D.Common.Math.b2XForm)
package Box2D.Common.Math {
public class b2XForm {
public var R:b2Mat22;
public var position:b2Vec2;
public function b2XForm(_arg1:b2Vec2=null, _arg2:b2Mat22=null):void{
position = new b2Vec2();
R = new b2Mat22();
super();
if (_arg1){
position.SetV(_arg1);
R.SetM(_arg2);
};
}
public function Initialize(_arg1:b2Vec2, _arg2:b2Mat22):void{
position.SetV(_arg1);
R.SetM(_arg2);
}
public function Set(_arg1:b2XForm):void{
position.SetV(_arg1.position);
R.SetM(_arg1.R);
}
public function SetIdentity():void{
position.SetZero();
R.SetIdentity();
}
}
}//package Box2D.Common.Math
Section 35
//b2Color (Box2D.Common.b2Color)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Color {
private var _g:uint;// = 0
private var _b:uint;// = 0
private var _r:uint;// = 0
public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){
_r = 0;
_g = 0;
_b = 0;
super();
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function get color():uint{
return (((_r | (_g << 8)) | (_b << 16)));
}
public function set r(_arg1:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set b(_arg1:Number):void{
_b = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set g(_arg1:Number):void{
_g = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
}
}//package Box2D.Common
Section 36
//b2Settings (Box2D.Common.b2Settings)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Settings {
public static const b2_angularSleepTolerance:Number = 0.0111111111111111;
public static const b2_linearSleepTolerance:Number = 0.01;
public static const b2_angularSlop:Number = 0.0349065850398866;
public static const b2_linearSlop:Number = 0.005;
public static const b2_pi:Number = 3.14159265358979;
public static const b2_maxProxies:int = 0x0400;
public static const b2_maxAngularVelocitySquared:Number = 62500;
public static const b2_maxPolygonVertices:int = 16;
public static const b2_velocityThreshold:Number = 1;
public static const b2_contactBaumgarte:Number = 0.2;
public static const b2_maxPairs:int = 8192;
public static const b2_maxTOIContactsPerIsland:int = 32;
public static const b2_timeToSleep:Number = 0.5;
public static const b2_maxManifoldPoints:int = 2;
public static const b2_maxAngularVelocity:Number = 250;
public static const b2_maxAngularCorrection:Number = 0.139626340159546;
public static const USHRT_MAX:int = 0xFFFF;
public static const b2_maxLinearVelocity:Number = 200;
public static const b2_maxLinearCorrection:Number = 0.2;
public static const b2_toiSlop:Number = 0.04;
public static const b2_maxLinearVelocitySquared:Number = 40000;
public static function b2Assert(_arg1:Boolean):void{
var _local2:b2Vec2;
if (!_arg1){
_local2.x++;
};
}
}
}//package Box2D.Common
Section 37
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
public class b2CircleContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){
var _local3:b2ManifoldPoint;
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
_local3 = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactPoint;
var _local8:b2ManifoldPoint;
_local5 = m_shape1.m_body;
_local6 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), _local5.m_xf, (m_shape2 as b2CircleShape), _local6.m_xf);
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
m_manifoldCount = 1;
_local8 = m_manifold.points[0];
if (m0.pointCount == 0){
_local8.normalImpulse = 0;
_local8.tangentImpulse = 0;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Add(_local7);
};
} else {
_local4 = m0.points[0];
_local8.normalImpulse = _local4.normalImpulse;
_local8.tangentImpulse = _local4.tangentImpulse;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Persist(_local7);
};
};
} else {
m_manifoldCount = 0;
if ((((m0.pointCount > 0)) && (_arg1))){
_local4 = m0.points[0];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2CircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 38
//b2Contact (Box2D.Dynamics.Contacts.b2Contact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Contact {
public var m_shape1:b2Shape;
public var m_shape2:b2Shape;
public var m_prev:b2Contact;
public var m_toi:Number;
public var m_next:b2Contact;
public var m_friction:Number;
public var m_manifoldCount:int;
public var m_node1:b2ContactEdge;
public var m_node2:b2ContactEdge;
public var m_restitution:Number;
public var m_flags:uint;
public static var e_toiFlag:uint = 8;
public static var e_nonSolidFlag:uint = 1;
public static var e_slowFlag:uint = 2;
public static var e_islandFlag:uint = 4;
public static var s_registers:Array;
public static var s_initialized:Boolean = false;
public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){
m_node1 = new b2ContactEdge();
m_node2 = new b2ContactEdge();
super();
m_flags = 0;
if (((!(_arg1)) || (!(_arg2)))){
m_shape1 = null;
m_shape2 = null;
return;
};
if (((_arg1.IsSensor()) || (_arg2.IsSensor()))){
m_flags = (m_flags | e_nonSolidFlag);
};
m_shape1 = _arg1;
m_shape2 = _arg2;
m_manifoldCount = 0;
m_friction = Math.sqrt((m_shape1.m_friction * m_shape2.m_friction));
m_restitution = b2Math.b2Max(m_shape1.m_restitution, m_shape2.m_restitution);
m_prev = null;
m_next = null;
m_node1.contact = null;
m_node1.prev = null;
m_node1.next = null;
m_node1.other = null;
m_node2.contact = null;
m_node2.prev = null;
m_node2.next = null;
m_node2.other = null;
}
public function GetShape1():b2Shape{
return (m_shape1);
}
public function IsSolid():Boolean{
return (((m_flags & e_nonSolidFlag) == 0));
}
public function GetNext():b2Contact{
return (m_next);
}
public function GetManifolds():Array{
return (null);
}
public function GetShape2():b2Shape{
return (m_shape2);
}
public function GetManifoldCount():int{
return (m_manifoldCount);
}
public function Update(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:int;
var _local4:b2Body;
var _local5:b2Body;
_local2 = m_manifoldCount;
Evaluate(_arg1);
_local3 = m_manifoldCount;
_local4 = m_shape1.m_body;
_local5 = m_shape2.m_body;
if ((((_local3 == 0)) && ((_local2 > 0)))){
_local4.WakeUp();
_local5.WakeUp();
};
if (((((((_local4.IsStatic()) || (_local4.IsBullet()))) || (_local5.IsStatic()))) || (_local5.IsBullet()))){
m_flags = (m_flags & ~(e_slowFlag));
} else {
m_flags = (m_flags | e_slowFlag);
};
}
public function Evaluate(_arg1:b2ContactListener):void{
}
public static function InitializeRegisters():void{
var _local1:int;
var _local2:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
_local1 = 0;
while (_local1 < b2Shape.e_shapeTypeCount) {
s_registers[_local1] = new Array(b2Shape.e_shapeTypeCount);
_local2 = 0;
while (_local2 < b2Shape.e_shapeTypeCount) {
s_registers[_local1][_local2] = new b2ContactRegister();
_local2++;
};
_local1++;
};
AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);
AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape);
AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
var _local3:int;
var _local4:int;
var _local5:b2ContactRegister;
var _local6:Function;
if (_arg1.m_manifoldCount > 0){
_arg1.m_shape1.m_body.WakeUp();
_arg1.m_shape2.m_body.WakeUp();
};
_local3 = _arg1.m_shape1.m_type;
_local4 = _arg1.m_shape2.m_type;
_local5 = s_registers[_local3][_local4];
_local6 = _local5.destroyFcn;
_local6(_arg1, _arg2);
}
public static function AddType(_arg1:Function, _arg2:Function, _arg3:int, _arg4:int):void{
s_registers[_arg3][_arg4].createFcn = _arg1;
s_registers[_arg3][_arg4].destroyFcn = _arg2;
s_registers[_arg3][_arg4].primary = true;
if (_arg3 != _arg4){
s_registers[_arg4][_arg3].createFcn = _arg1;
s_registers[_arg4][_arg3].destroyFcn = _arg2;
s_registers[_arg4][_arg3].primary = false;
};
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
var _local4:int;
var _local5:int;
var _local6:b2ContactRegister;
var _local7:Function;
var _local8:b2Contact;
var _local9:int;
var _local10:b2Manifold;
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
_local4 = _arg1.m_type;
_local5 = _arg2.m_type;
_local6 = s_registers[_local4][_local5];
_local7 = _local6.createFcn;
if (_local7 != null){
if (_local6.primary){
return (_local7(_arg1, _arg2, _arg3));
};
_local8 = _local7(_arg2, _arg1, _arg3);
_local9 = 0;
while (_local9 < _local8.m_manifoldCount) {
_local10 = _local8.GetManifolds()[_local9];
_local8.GetManifolds()[_local9].normal = _local10.normal.Negative();
_local9++;
};
return (_local8);
//unresolved jump
};
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 39
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var points:Array;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var normal:b2Vec2;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
var _local1:int;
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 40
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
public class b2ContactConstraintPoint {
public var r2:b2Vec2;
public var separation:Number;
public var positionImpulse:Number;
public var normalImpulse:Number;
public var equalizedMass:Number;
public var tangentMass:Number;
public var tangentImpulse:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var normalMass:Number;
public var velocityBias:Number;
public var r1:b2Vec2;
public function b2ContactConstraintPoint(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
r1 = new b2Vec2();
r2 = new b2Vec2();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 41
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var next:b2ContactEdge;
public var other:b2Body;
public var contact:b2Contact;
public var prev:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 42
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn:Function;
public var destroyFcn:Function;
}
}//package Box2D.Dynamics.Contacts
Section 43
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
public class b2ContactResult {
public var normal:b2Vec2;
public var position:b2Vec2;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var id:b2ContactID;
public function b2ContactResult(){
position = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 44
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactSolver {
public var m_constraintCount:int;
public var m_constraints:Array;
public var m_allocator;
public var m_step:b2TimeStep;
public function b2ContactSolver(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4){
var _local5:b2Contact;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Mat22;
var _local9:int;
var _local10:b2Body;
var _local11:b2Body;
var _local12:int;
var _local13:Array;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:b2Manifold;
var _local24:Number;
var _local25:Number;
var _local26:b2ContactConstraint;
var _local27:uint;
var _local28:b2ManifoldPoint;
var _local29:b2ContactConstraintPoint;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
m_step = new b2TimeStep();
m_constraints = new Array();
super();
m_step.dt = _arg1.dt;
m_step.inv_dt = _arg1.inv_dt;
m_step.maxIterations = _arg1.maxIterations;
m_allocator = _arg4;
m_constraintCount = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
m_constraintCount = (m_constraintCount + _local5.m_manifoldCount);
_local6++;
};
_local6 = 0;
while (_local6 < m_constraintCount) {
m_constraints[_local6] = new b2ContactConstraint();
_local6++;
};
_local9 = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
_local10 = _local5.m_shape1.m_body;
_local11 = _local5.m_shape2.m_body;
_local12 = _local5.m_manifoldCount;
_local13 = _local5.GetManifolds();
_local14 = _local5.m_friction;
_local15 = _local5.m_restitution;
_local16 = _local10.m_linearVelocity.x;
_local17 = _local10.m_linearVelocity.y;
_local18 = _local11.m_linearVelocity.x;
_local19 = _local11.m_linearVelocity.y;
_local20 = _local10.m_angularVelocity;
_local21 = _local11.m_angularVelocity;
_local22 = 0;
while (_local22 < _local12) {
_local23 = _local13[_local22];
_local24 = _local23.normal.x;
_local25 = _local23.normal.y;
_local26 = m_constraints[_local9];
_local26.body1 = _local10;
_local26.body2 = _local11;
_local26.manifold = _local23;
_local26.normal.x = _local24;
_local26.normal.y = _local25;
_local26.pointCount = _local23.pointCount;
_local26.friction = _local14;
_local26.restitution = _local15;
_local27 = 0;
while (_local27 < _local26.pointCount) {
_local28 = _local23.points[_local27];
_local29 = _local26.points[_local27];
_local29.normalImpulse = _local28.normalImpulse;
_local29.tangentImpulse = _local28.tangentImpulse;
_local29.separation = _local28.separation;
_local29.positionImpulse = 0;
_local29.localAnchor1.SetV(_local28.localPoint1);
_local29.localAnchor2.SetV(_local28.localPoint2);
_local8 = _local10.m_xf.R;
_local32 = (_local28.localPoint1.x - _local10.m_sweep.localCenter.x);
_local33 = (_local28.localPoint1.y - _local10.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local32) + (_local8.col2.x * _local33));
_local33 = ((_local8.col1.y * _local32) + (_local8.col2.y * _local33));
_local32 = _local30;
_local29.r1.Set(_local32, _local33);
_local8 = _local11.m_xf.R;
_local34 = (_local28.localPoint2.x - _local11.m_sweep.localCenter.x);
_local35 = (_local28.localPoint2.y - _local11.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local34) + (_local8.col2.x * _local35));
_local35 = ((_local8.col1.y * _local34) + (_local8.col2.y * _local35));
_local34 = _local30;
_local29.r2.Set(_local34, _local35);
_local36 = ((_local32 * _local32) + (_local33 * _local33));
_local37 = ((_local34 * _local34) + (_local35 * _local35));
_local38 = ((_local32 * _local24) + (_local33 * _local25));
_local39 = ((_local34 * _local24) + (_local35 * _local25));
_local40 = (_local10.m_invMass + _local11.m_invMass);
_local40 = (_local40 + ((_local10.m_invI * (_local36 - (_local38 * _local38))) + (_local11.m_invI * (_local37 - (_local39 * _local39)))));
_local29.normalMass = (1 / _local40);
_local41 = ((_local10.m_mass * _local10.m_invMass) + (_local11.m_mass * _local11.m_invMass));
_local41 = (_local41 + (((_local10.m_mass * _local10.m_invI) * (_local36 - (_local38 * _local38))) + ((_local11.m_mass * _local11.m_invI) * (_local37 - (_local39 * _local39)))));
_local29.equalizedMass = (1 / _local41);
_local42 = _local25;
_local43 = -(_local24);
_local44 = ((_local32 * _local42) + (_local33 * _local43));
_local45 = ((_local34 * _local42) + (_local35 * _local43));
_local46 = (_local10.m_invMass + _local11.m_invMass);
_local46 = (_local46 + ((_local10.m_invI * (_local36 - (_local44 * _local44))) + (_local11.m_invI * (_local37 - (_local45 * _local45)))));
_local29.tangentMass = (1 / _local46);
_local29.velocityBias = 0;
if (_local29.separation > 0){
_local29.velocityBias = (-60 * _local29.separation);
};
_local30 = (((_local18 + (-(_local21) * _local35)) - _local16) - (-(_local20) * _local33));
_local31 = (((_local19 + (_local21 * _local34)) - _local17) - (_local20 * _local32));
_local47 = ((_local26.normal.x * _local30) + (_local26.normal.y * _local31));
if (_local47 < -(b2Settings.b2_velocityThreshold)){
_local29.velocityBias = (_local29.velocityBias + (-(_local26.restitution) * _local47));
};
_local27++;
};
_local9++;
_local22++;
};
_local6++;
};
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local5:int;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:b2ContactConstraintPoint;
var _local21:Number;
var _local22:Number;
var _local23:b2ContactConstraintPoint;
_local5 = 0;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_invMass;
_local10 = _local7.m_invI;
_local11 = _local8.m_invMass;
_local12 = _local8.m_invI;
_local13 = _local6.normal.x;
_local14 = _local6.normal.y;
_local15 = _local14;
_local16 = -(_local13);
if (_arg1.warmStarting){
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local20 = _local6.points[_local18];
_local6.points[_local18].normalImpulse = (_local20.normalImpulse * _arg1.dtRatio);
_local20.tangentImpulse = (_local20.tangentImpulse * _arg1.dtRatio);
_local21 = ((_local20.normalImpulse * _local13) + (_local20.tangentImpulse * _local15));
_local22 = ((_local20.normalImpulse * _local14) + (_local20.tangentImpulse * _local16));
_local7.m_angularVelocity = (_local7.m_angularVelocity - (_local10 * ((_local20.r1.x * _local22) - (_local20.r1.y * _local21))));
_local7.m_linearVelocity.x = (_local7.m_linearVelocity.x - (_local9 * _local21));
_local7.m_linearVelocity.y = (_local7.m_linearVelocity.y - (_local9 * _local22));
_local8.m_angularVelocity = (_local8.m_angularVelocity + (_local12 * ((_local20.r2.x * _local22) - (_local20.r2.y * _local21))));
_local8.m_linearVelocity.x = (_local8.m_linearVelocity.x + (_local11 * _local21));
_local8.m_linearVelocity.y = (_local8.m_linearVelocity.y + (_local11 * _local22));
_local18++;
};
} else {
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local23 = _local6.points[_local18];
_local23.normalImpulse = 0;
_local23.tangentImpulse = 0;
_local18++;
};
};
_local5++;
};
}
public function SolvePositionConstraints(_arg1:Number):Boolean{
var _local2:Number;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:b2Vec2;
var _local10:Number;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:int;
var _local20:int;
var _local21:b2ContactConstraintPoint;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
_local2 = 0;
_local5 = 0;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_sweep.c;
_local10 = _local7.m_sweep.a;
_local11 = _local8.m_sweep.c;
_local12 = _local8.m_sweep.a;
_local13 = (_local7.m_mass * _local7.m_invMass);
_local14 = (_local7.m_mass * _local7.m_invI);
_local15 = (_local8.m_mass * _local8.m_invMass);
_local16 = (_local8.m_mass * _local8.m_invI);
_local17 = _local6.normal.x;
_local18 = _local6.normal.y;
_local19 = _local6.pointCount;
_local20 = 0;
while (_local20 < _local19) {
_local21 = _local6.points[_local20];
_local3 = _local7.m_xf.R;
_local4 = _local7.m_sweep.localCenter;
_local22 = (_local21.localAnchor1.x - _local4.x);
_local23 = (_local21.localAnchor1.y - _local4.y);
_local26 = ((_local3.col1.x * _local22) + (_local3.col2.x * _local23));
_local23 = ((_local3.col1.y * _local22) + (_local3.col2.y * _local23));
_local22 = _local26;
_local3 = _local8.m_xf.R;
_local4 = _local8.m_sweep.localCenter;
_local24 = (_local21.localAnchor2.x - _local4.x);
_local25 = (_local21.localAnchor2.y - _local4.y);
_local26 = ((_local3.col1.x * _local24) + (_local3.col2.x * _local25));
_local25 = ((_local3.col1.y * _local24) + (_local3.col2.y * _local25));
_local24 = _local26;
_local27 = (_local9.x + _local22);
_local28 = (_local9.y + _local23);
_local29 = (_local11.x + _local24);
_local30 = (_local11.y + _local25);
_local31 = (_local29 - _local27);
_local32 = (_local30 - _local28);
_local33 = (((_local31 * _local17) + (_local32 * _local18)) + _local21.separation);
_local2 = b2Math.b2Min(_local2, _local33);
_local34 = (_arg1 * b2Math.b2Clamp((_local33 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0));
_local35 = (-(_local21.equalizedMass) * _local34);
_local36 = _local21.positionImpulse;
_local21.positionImpulse = b2Math.b2Max((_local36 + _local35), 0);
_local35 = (_local21.positionImpulse - _local36);
_local37 = (_local35 * _local17);
_local38 = (_local35 * _local18);
_local9.x = (_local9.x - (_local13 * _local37));
_local9.y = (_local9.y - (_local13 * _local38));
_local10 = (_local10 - (_local14 * ((_local22 * _local38) - (_local23 * _local37))));
_local7.m_sweep.a = _local10;
_local7.SynchronizeTransform();
_local11.x = (_local11.x + (_local15 * _local37));
_local11.y = (_local11.y + (_local15 * _local38));
_local12 = (_local12 + (_local16 * ((_local24 * _local38) - (_local25 * _local37))));
_local8.m_sweep.a = _local12;
_local8.SynchronizeTransform();
_local20++;
};
_local5++;
};
return ((_local2 >= (-1.5 * b2Settings.b2_linearSlop)));
}
public function SolveVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraintPoint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Mat22;
var _local18:b2Vec2;
var _local19:int;
var _local20:b2ContactConstraint;
var _local21:b2Body;
var _local22:b2Body;
var _local23:Number;
var _local24:Number;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:int;
var _local38:Number;
_local19 = 0;
while (_local19 < m_constraintCount) {
_local20 = m_constraints[_local19];
_local21 = _local20.body1;
_local22 = _local20.body2;
_local23 = _local21.m_angularVelocity;
_local24 = _local22.m_angularVelocity;
_local25 = _local21.m_linearVelocity;
_local26 = _local22.m_linearVelocity;
_local27 = _local21.m_invMass;
_local28 = _local21.m_invI;
_local29 = _local22.m_invMass;
_local30 = _local22.m_invI;
_local31 = _local20.normal.x;
_local32 = _local20.normal.y;
_local33 = _local32;
_local34 = -(_local31);
_local35 = _local20.friction;
_local37 = _local20.pointCount;
_local1 = 0;
while (_local1 < _local37) {
_local2 = _local20.points[_local1];
_local7 = (((_local26.x + (-(_local24) * _local2.r2.y)) - _local25.x) - (-(_local23) * _local2.r1.y));
_local8 = (((_local26.y + (_local24 * _local2.r2.x)) - _local25.y) - (_local23 * _local2.r1.x));
_local9 = ((_local7 * _local31) + (_local8 * _local32));
_local11 = (-(_local2.normalMass) * (_local9 - _local2.velocityBias));
_local10 = ((_local7 * _local33) + (_local8 * _local34));
_local12 = (_local2.tangentMass * -(_local10));
_local13 = b2Math.b2Max((_local2.normalImpulse + _local11), 0);
_local11 = (_local13 - _local2.normalImpulse);
_local38 = (_local35 * _local2.normalImpulse);
_local14 = b2Math.b2Clamp((_local2.tangentImpulse + _local12), -(_local38), _local38);
_local12 = (_local14 - _local2.tangentImpulse);
_local15 = ((_local11 * _local31) + (_local12 * _local33));
_local16 = ((_local11 * _local32) + (_local12 * _local34));
_local25.x = (_local25.x - (_local27 * _local15));
_local25.y = (_local25.y - (_local27 * _local16));
_local23 = (_local23 - (_local28 * ((_local2.r1.x * _local16) - (_local2.r1.y * _local15))));
_local26.x = (_local26.x + (_local29 * _local15));
_local26.y = (_local26.y + (_local29 * _local16));
_local24 = (_local24 + (_local30 * ((_local2.r2.x * _local16) - (_local2.r2.y * _local15))));
_local2.normalImpulse = _local13;
_local2.tangentImpulse = _local14;
_local1++;
};
_local21.m_angularVelocity = _local23;
_local22.m_angularVelocity = _local24;
_local19++;
};
}
public function FinalizeVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraint;
var _local3:b2Manifold;
var _local4:int;
var _local5:b2ManifoldPoint;
var _local6:b2ContactConstraintPoint;
_local1 = 0;
while (_local1 < m_constraintCount) {
_local2 = m_constraints[_local1];
_local3 = _local2.manifold;
_local4 = 0;
while (_local4 < _local2.pointCount) {
_local5 = _local3.points[_local4];
_local6 = _local2.points[_local4];
_local5.normalImpulse = _local6.normalImpulse;
_local5.tangentImpulse = _local6.tangentImpulse;
_local4++;
};
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 45
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2NullContact extends b2Contact {
override public function GetManifolds():Array{
return (null);
}
override public function Evaluate(_arg1:b2ContactListener):void{
}
}
}//package Box2D.Dynamics.Contacts
Section 46
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyAndCircleContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){
var _local3:b2ManifoldPoint;
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polygonShape));
b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape));
m_manifold.pointCount = 0;
_local3 = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2ManifoldPoint;
var _local6:b2Body;
var _local7:b2Body;
var _local8:Array;
var _local9:b2ContactPoint;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
_local6 = m_shape1.m_body;
_local7 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), _local6.m_xf, (m_shape2 as b2CircleShape), _local7.m_xf);
_local8 = [false, false];
_local9 = s_evalCP;
_local9.shape1 = m_shape1;
_local9.shape2 = m_shape2;
_local9.friction = m_friction;
_local9.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local2 = 0;
while (_local2 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local2];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local8[_local13] == true){
} else {
_local5 = m0.points[_local13];
if (_local5.id._key == _local12){
_local8[_local13] = true;
_local10.normalImpulse = _local5.normalImpulse;
_local10.tangentImpulse = _local5.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Persist(_local9);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Add(_local9);
};
_local2++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local2 = 0;
while (_local2 < m0.pointCount) {
if (_local8[_local2]){
} else {
_local5 = m0.points[_local2];
_local9.position = _local6.GetWorldPoint(_local5.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local5.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local5.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m0.normal);
_local9.separation = _local5.separation;
_local9.id.key = _local5.id._key;
_arg1.Remove(_local9);
};
_local2++;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolyAndCircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 47
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
public class b2PolygonContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolygonContact(_arg1:b2Shape, _arg2:b2Shape):void{
m0 = new b2Manifold();
m_manifolds = [new b2Manifold()];
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactPoint;
var _local8:int;
var _local9:Array;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
_local5 = m_shape1.m_body;
_local6 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygons(m_manifold, (m_shape1 as b2PolygonShape), _local5.m_xf, (m_shape2 as b2PolygonShape), _local6.m_xf);
_local9 = [false, false];
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local8 = 0;
while (_local8 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local8];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local9[_local13] == true){
} else {
_local4 = m0.points[_local13];
if (_local4.id._key == _local12){
_local9[_local13] = true;
_local10.normalImpulse = _local4.normalImpulse;
_local10.tangentImpulse = _local4.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Persist(_local7);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Add(_local7);
};
_local8++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local8 = 0;
while (_local8 < m0.pointCount) {
if (_local9[_local8]){
} else {
_local4 = m0.points[_local8];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
_local8++;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolygonContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 48
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2DistanceJoint extends b2Joint {
public var m_mass:Number;
public var m_u:b2Vec2;
public var m_impulse:Number;
public var m_dampingRatio:Number;
public var m_frequencyHz:Number;
public var m_localAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_bias:Number;
public var m_gamma:Number;
public var m_length:Number;
public function b2DistanceJoint(_arg1:b2DistanceJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u = new b2Vec2();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_length = _arg1.length;
m_frequencyHz = _arg1.frequencyHz;
m_dampingRatio = _arg1.dampingRatio;
m_impulse = 0;
m_gamma = 0;
m_bias = 0;
m_inv_dt = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = new b2Vec2();
_local1.SetV(m_u);
_local1.Multiply((m_inv_dt * m_impulse));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Mat22;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
if (m_frequencyHz > 0){
return (true);
};
_local2 = m_body1;
_local3 = m_body2;
_local1 = _local2.m_xf.R;
_local4 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local4) + (_local1.col2.x * _local5));
_local5 = ((_local1.col1.y * _local4) + (_local1.col2.y * _local5));
_local4 = _local6;
_local1 = _local3.m_xf.R;
_local7 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local8 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local7) + (_local1.col2.x * _local8));
_local8 = ((_local1.col1.y * _local7) + (_local1.col2.y * _local8));
_local7 = _local6;
_local9 = (((_local3.m_sweep.c.x + _local7) - _local2.m_sweep.c.x) - _local4);
_local10 = (((_local3.m_sweep.c.y + _local8) - _local2.m_sweep.c.y) - _local5);
_local11 = Math.sqrt(((_local9 * _local9) + (_local10 * _local10)));
_local9 = (_local9 / _local11);
_local10 = (_local10 / _local11);
_local12 = (_local11 - m_length);
_local12 = b2Math.b2Clamp(_local12, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local13 = (-(m_mass) * _local12);
m_u.Set(_local9, _local10);
_local14 = (_local13 * m_u.x);
_local15 = (_local13 * m_u.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x - (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y - (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a - (_local2.m_invI * ((_local4 * _local15) - (_local5 * _local14))));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + (_local3.m_invMass * _local14));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + (_local3.m_invMass * _local15));
_local3.m_sweep.a = (_local3.m_sweep.a + (_local3.m_invI * ((_local7 * _local15) - (_local8 * _local14))));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((b2Math.b2Abs(_local12) < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
m_inv_dt = _arg1.inv_dt;
_local4 = m_body1;
_local5 = m_body2;
_local2 = _local4.m_xf.R;
_local6 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7));
_local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7));
_local6 = _local3;
_local2 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local3;
m_u.x = (((_local5.m_sweep.c.x + _local8) - _local4.m_sweep.c.x) - _local6);
m_u.y = (((_local5.m_sweep.c.y + _local9) - _local4.m_sweep.c.y) - _local7);
_local10 = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y)));
if (_local10 > b2Settings.b2_linearSlop){
m_u.Multiply((1 / _local10));
} else {
m_u.SetZero();
};
_local11 = ((_local6 * m_u.y) - (_local7 * m_u.x));
_local12 = ((_local8 * m_u.y) - (_local9 * m_u.x));
_local13 = (((_local4.m_invMass + ((_local4.m_invI * _local11) * _local11)) + _local5.m_invMass) + ((_local5.m_invI * _local12) * _local12));
m_mass = (1 / _local13);
if (m_frequencyHz > 0){
_local14 = (_local10 - m_length);
_local15 = ((2 * Math.PI) * m_frequencyHz);
_local16 = (((2 * m_mass) * m_dampingRatio) * _local15);
_local17 = ((m_mass * _local15) * _local15);
m_gamma = (1 / (_arg1.dt * (_local16 + (_arg1.dt * _local17))));
m_bias = (((_local14 * _arg1.dt) * _local17) * m_gamma);
m_mass = (1 / (_local13 + m_gamma));
};
if (_arg1.warmStarting){
m_impulse = (m_impulse * _arg1.dtRatio);
_local18 = (m_impulse * m_u.x);
_local19 = (m_impulse * m_u.y);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local4.m_invMass * _local18));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local4.m_invMass * _local19));
_local4.m_angularVelocity = (_local4.m_angularVelocity - (_local4.m_invI * ((_local6 * _local19) - (_local7 * _local18))));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local5.m_invMass * _local18));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local5.m_invMass * _local19));
_local5.m_angularVelocity = (_local5.m_angularVelocity + (_local5.m_invI * ((_local8 * _local19) - (_local9 * _local18))));
} else {
m_impulse = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local3 = m_body1;
_local4 = m_body2;
_local2 = _local3.m_xf.R;
_local5 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6));
_local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6));
_local5 = _local7;
_local2 = _local4.m_xf.R;
_local8 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local7;
_local10 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local6));
_local11 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local5));
_local12 = (_local4.m_linearVelocity.x + (-(_local4.m_angularVelocity) * _local9));
_local13 = (_local4.m_linearVelocity.y + (_local4.m_angularVelocity * _local8));
_local14 = ((m_u.x * (_local12 - _local10)) + (m_u.y * (_local13 - _local11)));
_local15 = (-(m_mass) * ((_local14 + m_bias) + (m_gamma * m_impulse)));
m_impulse = (m_impulse + _local15);
_local16 = (_local15 * m_u.x);
_local17 = (_local15 * m_u.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x - (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y - (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity - (_local3.m_invI * ((_local5 * _local17) - (_local6 * _local16))));
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + (_local4.m_invMass * _local16));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + (_local4.m_invMass * _local17));
_local4.m_angularVelocity = (_local4.m_angularVelocity + (_local4.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
}
}
}//package Box2D.Dynamics.Joints
Section 49
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2DistanceJointDef extends b2JointDef {
public var length:Number;
public var dampingRatio:Number;
public var frequencyHz:Number;
public var localAnchor2:b2Vec2;
public var localAnchor1:b2Vec2;
public function b2DistanceJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_distanceJoint;
length = 1;
frequencyHz = 0;
dampingRatio = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
var _local5:Number;
var _local6:Number;
body1 = _arg1;
body2 = _arg2;
localAnchor1.SetV(body1.GetLocalPoint(_arg3));
localAnchor2.SetV(body2.GetLocalPoint(_arg4));
_local5 = (_arg4.x - _arg3.x);
_local6 = (_arg4.y - _arg3.y);
length = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
frequencyHz = 0;
dampingRatio = 0;
}
}
}//package Box2D.Dynamics.Joints
Section 50
//b2GearJoint (Box2D.Dynamics.Joints.b2GearJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2GearJoint extends b2Joint {
public var m_force:Number;
public var m_mass:Number;
public var m_prismatic1:b2PrismaticJoint;
public var m_prismatic2:b2PrismaticJoint;
public var m_ground1:b2Body;
public var m_ground2:b2Body;
public var m_constant:Number;
public var m_revolute1:b2RevoluteJoint;
public var m_revolute2:b2RevoluteJoint;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_ratio:Number;
public var m_J:b2Jacobian;
public function b2GearJoint(_arg1:b2GearJointDef){
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_J = new b2Jacobian();
super(_arg1);
_local2 = _arg1.joint1.m_type;
_local3 = _arg1.joint2.m_type;
m_revolute1 = null;
m_prismatic1 = null;
m_revolute2 = null;
m_prismatic2 = null;
m_ground1 = _arg1.joint1.m_body1;
m_body1 = _arg1.joint1.m_body2;
if (_local2 == b2Joint.e_revoluteJoint){
m_revolute1 = (_arg1.joint1 as b2RevoluteJoint);
m_groundAnchor1.SetV(m_revolute1.m_localAnchor1);
m_localAnchor1.SetV(m_revolute1.m_localAnchor2);
_local4 = m_revolute1.GetJointAngle();
} else {
m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint);
m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1);
m_localAnchor1.SetV(m_prismatic1.m_localAnchor2);
_local4 = m_prismatic1.GetJointTranslation();
};
m_ground2 = _arg1.joint2.m_body1;
m_body2 = _arg1.joint2.m_body2;
if (_local3 == b2Joint.e_revoluteJoint){
m_revolute2 = (_arg1.joint2 as b2RevoluteJoint);
m_groundAnchor2.SetV(m_revolute2.m_localAnchor1);
m_localAnchor2.SetV(m_revolute2.m_localAnchor2);
_local5 = m_revolute2.GetJointAngle();
} else {
m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint);
m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1);
m_localAnchor2.SetV(m_prismatic2.m_localAnchor2);
_local5 = m_prismatic2.GetJointTranslation();
};
m_ratio = _arg1.ratio;
m_constant = (_local4 + (m_ratio * _local5));
m_force = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local1 = 0;
_local2 = m_body1;
_local3 = m_body2;
if (m_revolute1){
_local4 = m_revolute1.GetJointAngle();
} else {
_local4 = m_prismatic1.GetJointTranslation();
};
if (m_revolute2){
_local5 = m_revolute2.GetJointAngle();
} else {
_local5 = m_prismatic2.GetJointTranslation();
};
_local6 = (m_constant - (_local4 + (m_ratio * _local5)));
_local7 = (-(m_mass) * _local6);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + ((_local2.m_invMass * _local7) * m_J.linear1.x));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + ((_local2.m_invMass * _local7) * m_J.linear1.y));
_local2.m_sweep.a = (_local2.m_sweep.a + ((_local2.m_invI * _local7) * m_J.angular1));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local3.m_invMass * _local7) * m_J.linear2.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local3.m_invMass * _local7) * m_J.linear2.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local3.m_invI * _local7) * m_J.angular2));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((_local1 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local2 = m_ground1;
_local3 = m_ground2;
_local4 = m_body1;
_local5 = m_body2;
_local14 = 0;
m_J.SetZero();
if (m_revolute1){
m_J.angular1 = -1;
_local14 = (_local14 + _local4.m_invI);
} else {
_local10 = _local2.m_xf.R;
_local11 = m_prismatic1.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local4.m_xf.R;
_local8 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear1.Set(-(_local6), -(_local7));
m_J.angular1 = -(_local12);
_local14 = (_local14 + (_local4.m_invMass + ((_local4.m_invI * _local12) * _local12)));
};
if (m_revolute2){
m_J.angular2 = -(m_ratio);
_local14 = (_local14 + ((m_ratio * m_ratio) * _local5.m_invI));
} else {
_local10 = _local3.m_xf.R;
_local11 = m_prismatic2.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear2.Set((-(m_ratio) * _local6), (-(m_ratio) * _local7));
m_J.angular2 = (-(m_ratio) * _local12);
_local14 = (_local14 + ((m_ratio * m_ratio) * (_local5.m_invMass + ((_local5.m_invI * _local12) * _local12))));
};
m_mass = (1 / _local14);
if (_arg1.warmStarting){
_local15 = (_arg1.dt * m_force);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * _local15) * m_J.linear1.x));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * _local15) * m_J.linear1.y));
_local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * _local15) * m_J.angular1));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + ((_local5.m_invMass * _local15) * m_J.linear2.x));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + ((_local5.m_invMass * _local15) * m_J.linear2.y));
_local5.m_angularVelocity = (_local5.m_angularVelocity + ((_local5.m_invI * _local15) * m_J.angular2));
} else {
m_force = 0;
};
}
override public function GetReactionTorque():Number{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = m_body2.m_xf.R;
_local2 = (m_localAnchor1.x - m_body2.m_sweep.localCenter.x);
_local3 = (m_localAnchor1.y - m_body2.m_sweep.localCenter.y);
_local4 = ((_local1.col1.x * _local2) + (_local1.col2.x * _local3));
_local3 = ((_local1.col1.y * _local2) + (_local1.col2.y * _local3));
_local2 = _local4;
_local4 = ((m_force * m_J.angular2) - ((_local2 * (m_force * m_J.linear2.y)) - (_local3 * (m_force * m_J.linear2.x))));
return (_local4);
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local5 = ((-(_arg1.inv_dt) * m_mass) * _local4);
m_force = (m_force + _local5);
_local6 = (_arg1.dt * _local5);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local6) * m_J.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local6) * m_J.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local6) * m_J.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local6) * m_J.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local6) * m_J.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local6) * m_J.angular2));
}
}
}//package Box2D.Dynamics.Joints
Section 51
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef)
package Box2D.Dynamics.Joints {
public class b2GearJointDef extends b2JointDef {
public var joint2:b2Joint;
public var joint1:b2Joint;
public var ratio:Number;
public function b2GearJointDef(){
type = b2Joint.e_gearJoint;
joint1 = null;
joint2 = null;
ratio = 1;
}
}
}//package Box2D.Dynamics.Joints
Section 52
//b2Jacobian (Box2D.Dynamics.Joints.b2Jacobian)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2Jacobian {
public var linear1:b2Vec2;
public var linear2:b2Vec2;
public var angular2:Number;
public var angular1:Number;
public function b2Jacobian(){
linear1 = new b2Vec2();
linear2 = new b2Vec2();
super();
}
public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{
linear1.SetV(_arg1);
angular1 = _arg2;
linear2.SetV(_arg3);
angular2 = _arg4;
}
public function SetZero():void{
linear1.SetZero();
angular1 = 0;
linear2.SetZero();
angular2 = 0;
}
public function Compute(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):Number{
return ((((((linear1.x * _arg1.x) + (linear1.y * _arg1.y)) + (angular1 * _arg2)) + ((linear2.x * _arg3.x) + (linear2.y * _arg3.y))) + (angular2 * _arg4)));
}
}
}//package Box2D.Dynamics.Joints
Section 53
//b2Joint (Box2D.Dynamics.Joints.b2Joint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2Joint {
public var m_islandFlag:Boolean;
public var m_body1:b2Body;
public var m_prev:b2Joint;
public var m_next:b2Joint;
public var m_type:int;
public var m_collideConnected:Boolean;
public var m_node1:b2JointEdge;
public var m_node2:b2JointEdge;
public var m_inv_dt:Number;
public var m_userData;
public var m_body2:b2Body;
public static const e_unknownJoint:int = 0;
public static const e_inactiveLimit:int = 0;
public static const e_atUpperLimit:int = 2;
public static const e_atLowerLimit:int = 1;
public static const e_gearJoint:int = 6;
public static const e_revoluteJoint:int = 1;
public static const e_equalLimits:int = 3;
public static const e_distanceJoint:int = 3;
public static const e_pulleyJoint:int = 4;
public static const e_prismaticJoint:int = 2;
public static const e_mouseJoint:int = 5;
public function b2Joint(_arg1:b2JointDef){
m_node1 = new b2JointEdge();
m_node2 = new b2JointEdge();
super();
m_type = _arg1.type;
m_prev = null;
m_next = null;
m_body1 = _arg1.body1;
m_body2 = _arg1.body2;
m_collideConnected = _arg1.collideConnected;
m_islandFlag = false;
m_userData = _arg1.userData;
}
public function GetAnchor1():b2Vec2{
return (null);
}
public function GetAnchor2():b2Vec2{
return (null);
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
}
public function GetType():int{
return (m_type);
}
public function GetBody2():b2Body{
return (m_body2);
}
public function GetNext():b2Joint{
return (m_next);
}
public function GetReactionTorque():Number{
return (0);
}
public function GetUserData(){
return (m_userData);
}
public function GetReactionForce():b2Vec2{
return (null);
}
public function SolvePositionConstraints():Boolean{
return (false);
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetBody1():b2Body{
return (m_body1);
}
public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
}
public function InitPositionConstraints():void{
}
public static function Destroy(_arg1:b2Joint, _arg2):void{
}
public static function Create(_arg1:b2JointDef, _arg2):b2Joint{
var _local3:b2Joint;
_local3 = null;
switch (_arg1.type){
case e_distanceJoint:
_local3 = new b2DistanceJoint((_arg1 as b2DistanceJointDef));
break;
case e_mouseJoint:
_local3 = new b2MouseJoint((_arg1 as b2MouseJointDef));
break;
case e_prismaticJoint:
_local3 = new b2PrismaticJoint((_arg1 as b2PrismaticJointDef));
break;
case e_revoluteJoint:
_local3 = new b2RevoluteJoint((_arg1 as b2RevoluteJointDef));
break;
case e_pulleyJoint:
_local3 = new b2PulleyJoint((_arg1 as b2PulleyJointDef));
break;
case e_gearJoint:
_local3 = new b2GearJoint((_arg1 as b2GearJointDef));
break;
default:
break;
};
return (_local3);
}
}
}//package Box2D.Dynamics.Joints
Section 54
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointDef {
public var collideConnected:Boolean;
public var body1:b2Body;
public var body2:b2Body;
public var userData;
public var type:int;
public function b2JointDef(){
type = b2Joint.e_unknownJoint;
userData = null;
body1 = null;
body2 = null;
collideConnected = false;
}
}
}//package Box2D.Dynamics.Joints
Section 55
//b2JointEdge (Box2D.Dynamics.Joints.b2JointEdge)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointEdge {
public var joint:b2Joint;
public var other:b2Body;
public var next:b2JointEdge;
public var prev:b2JointEdge;
}
}//package Box2D.Dynamics.Joints
Section 56
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2MouseJoint extends b2Joint {
public var m_beta:Number;
public var m_mass:b2Mat22;
public var m_target:b2Vec2;
public var m_impulse:b2Vec2;
public var m_localAnchor:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K:b2Mat22;
public var m_gamma:Number;
public var m_C:b2Vec2;
public var m_maxForce:Number;
public function b2MouseJoint(_arg1:b2MouseJointDef){
var _local2:Number;
var _local3:Number;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
m_localAnchor = new b2Vec2();
m_target = new b2Vec2();
m_impulse = new b2Vec2();
m_mass = new b2Mat22();
m_C = new b2Vec2();
super(_arg1);
m_target.SetV(_arg1.target);
_local2 = (m_target.x - m_body2.m_xf.position.x);
_local3 = (m_target.y - m_body2.m_xf.position.y);
_local4 = m_body2.m_xf.R;
m_localAnchor.x = ((_local2 * _local4.col1.x) + (_local3 * _local4.col1.y));
m_localAnchor.y = ((_local2 * _local4.col2.x) + (_local3 * _local4.col2.y));
m_maxForce = _arg1.maxForce;
m_impulse.SetZero();
_local5 = m_body2.m_mass;
_local6 = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz);
_local7 = (((2 * _local5) * _arg1.dampingRatio) * _local6);
_local8 = ((_arg1.timeStep * _local5) * (_local6 * _local6));
m_gamma = (1 / (_local7 + _local8));
m_beta = (_local8 / (_local7 + _local8));
}
override public function GetAnchor1():b2Vec2{
return (m_target);
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor));
}
override public function GetReactionForce():b2Vec2{
return (m_impulse);
}
override public function SolvePositionConstraints():Boolean{
return (true);
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local4 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local7 = _local2.m_invMass;
_local8 = _local2.m_invI;
K1.col1.x = _local7;
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = _local7;
K2.col1.x = ((_local8 * _local5) * _local5);
K2.col2.x = ((-(_local8) * _local4) * _local5);
K2.col1.y = ((-(_local8) * _local4) * _local5);
K2.col2.y = ((_local8 * _local4) * _local4);
K.SetM(K1);
K.AddM(K2);
K.col1.x = (K.col1.x + m_gamma);
K.col2.y = (K.col2.y + m_gamma);
K.Invert(m_mass);
m_C.x = ((_local2.m_sweep.c.x + _local4) - m_target.x);
m_C.y = ((_local2.m_sweep.c.y + _local5) - m_target.y);
_local2.m_angularVelocity = (_local2.m_angularVelocity * 0.98);
_local9 = (_arg1.dt * m_impulse.x);
_local10 = (_arg1.dt * m_impulse.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local7 * _local9));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local7 * _local10));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local8 * ((_local4 * _local10) - (_local5 * _local9))));
}
override public function GetReactionTorque():Number{
return (0);
}
public function SetTarget(_arg1:b2Vec2):void{
if (m_body2.IsSleeping()){
m_body2.WakeUp();
};
m_target = _arg1;
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local6 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local4 = ((_local3.col1.x * _local6) + (_local3.col2.x * _local7));
_local7 = ((_local3.col1.y * _local6) + (_local3.col2.y * _local7));
_local6 = _local4;
_local8 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local7));
_local9 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local6));
_local3 = m_mass;
_local4 = ((_local8 + ((m_beta * _arg1.inv_dt) * m_C.x)) + ((m_gamma * _arg1.dt) * m_impulse.x));
_local5 = ((_local9 + ((m_beta * _arg1.inv_dt) * m_C.y)) + ((m_gamma * _arg1.dt) * m_impulse.y));
_local10 = (-(_arg1.inv_dt) * ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)));
_local11 = (-(_arg1.inv_dt) * ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)));
_local12 = m_impulse.x;
_local13 = m_impulse.y;
m_impulse.x = (m_impulse.x + _local10);
m_impulse.y = (m_impulse.y + _local11);
_local14 = m_impulse.Length();
if (_local14 > m_maxForce){
m_impulse.Multiply((m_maxForce / _local14));
};
_local10 = (m_impulse.x - _local12);
_local11 = (m_impulse.y - _local13);
_local15 = (_arg1.dt * _local10);
_local16 = (_arg1.dt * _local11);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
}
}
}//package Box2D.Dynamics.Joints
Section 57
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2MouseJointDef extends b2JointDef {
public var frequencyHz:Number;
public var dampingRatio:Number;
public var maxForce:Number;
public var target:b2Vec2;
public var timeStep:Number;
public function b2MouseJointDef(){
target = new b2Vec2();
super();
type = b2Joint.e_mouseJoint;
maxForce = 0;
frequencyHz = 5;
dampingRatio = 0.7;
timeStep = (1 / 60);
}
}
}//package Box2D.Dynamics.Joints
Section 58
//b2PrismaticJoint (Box2D.Dynamics.Joints.b2PrismaticJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PrismaticJoint extends b2Joint {
public var m_limitForce:Number;
public var m_refAngle:Number;
public var m_lowerTranslation:Number;
public var m_localXAxis1:b2Vec2;
public var m_torque:Number;
public var m_enableLimit:Boolean;
public var m_motorForce:Number;
public var m_force:Number;
public var m_localYAxis1:b2Vec2;
public var m_motorMass:Number;
public var m_maxMotorForce:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_angularMass:Number;
public var m_limitState:int;
public var m_linearMass:Number;
public var m_upperTranslation:Number;
public var m_motorJacobian:b2Jacobian;
public var m_limitPositionImpulse:Number;
public var m_motorSpeed:Number;
public var m_linearJacobian:b2Jacobian;
public var m_enableMotor:Boolean;
public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_localXAxis1 = new b2Vec2();
m_localYAxis1 = new b2Vec2();
m_linearJacobian = new b2Jacobian();
m_motorJacobian = new b2Jacobian();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_localXAxis1.SetV(_arg1.localAxis1);
m_localYAxis1.x = -(m_localXAxis1.y);
m_localYAxis1.y = m_localXAxis1.x;
m_refAngle = _arg1.referenceAngle;
m_linearJacobian.SetZero();
m_linearMass = 0;
m_force = 0;
m_angularMass = 0;
m_torque = 0;
m_motorJacobian.SetZero();
m_motorMass = 0;
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerTranslation = _arg1.lowerTranslation;
m_upperTranslation = _arg1.upperTranslation;
m_maxMotorForce = _arg1.maxMotorForce;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetUpperLimit():Number{
return (m_upperTranslation);
}
public function GetLowerLimit():Number{
return (m_lowerTranslation);
}
public function GetJointTranslation():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:b2Vec2;
var _local9:Number;
_local1 = m_body1;
_local2 = m_body2;
_local4 = _local1.GetWorldPoint(m_localAnchor1);
_local5 = _local2.GetWorldPoint(m_localAnchor2);
_local6 = (_local5.x - _local4.x);
_local7 = (_local5.y - _local4.y);
_local8 = _local1.GetWorldVector(m_localXAxis1);
_local9 = ((_local8.x * _local6) + (_local8.y * _local7));
return (_local9);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerTranslation = _arg1;
m_upperTranslation = _arg2;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body1.m_xf.R;
_local2 = (m_limitForce * ((_local1.col1.x * m_localXAxis1.x) + (_local1.col2.x * m_localXAxis1.y)));
_local3 = (m_limitForce * ((_local1.col1.y * m_localXAxis1.x) + (_local1.col2.y * m_localXAxis1.y)));
_local4 = (m_force * ((_local1.col1.x * m_localYAxis1.x) + (_local1.col2.x * m_localYAxis1.y)));
_local5 = (m_force * ((_local1.col1.y * m_localYAxis1.x) + (_local1.col2.y * m_localYAxis1.y)));
return (new b2Vec2(((m_limitForce * _local2) + (m_force * _local4)), ((m_limitForce * _local3) + (m_force * _local5))));
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = _local3.m_invMass;
_local6 = _local4.m_invMass;
_local7 = _local3.m_invI;
_local8 = _local4.m_invI;
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local21 = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y));
_local22 = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y));
_local23 = ((_local21 * _local19) + (_local22 * _local20));
_local23 = b2Math.b2Clamp(_local23, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local24 = (-(m_linearMass) * _local23);
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local24) * m_linearJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local24) * m_linearJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local24) * m_linearJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local24) * m_linearJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local24) * m_linearJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local24) * m_linearJacobian.angular2));
_local25 = b2Math.b2Abs(_local23);
_local26 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_refAngle);
_local26 = b2Math.b2Clamp(_local26, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local27 = (-(m_angularMass) * _local26);
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local27));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local27));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
_local28 = b2Math.b2Abs(_local26);
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local29 = ((_local9.col1.x * m_localXAxis1.x) + (_local9.col2.x * m_localXAxis1.y));
_local30 = ((_local9.col1.y * m_localXAxis1.x) + (_local9.col2.y * m_localXAxis1.y));
_local31 = ((_local29 * _local19) + (_local30 * _local20));
_local32 = 0;
if (m_limitState == e_equalLimits){
_local1 = b2Math.b2Clamp(_local31, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local25 = b2Math.b2Max(_local25, b2Math.b2Abs(_local26));
} else {
if (m_limitState == e_atLowerLimit){
_local1 = (_local31 - m_lowerTranslation);
_local25 = b2Math.b2Max(_local25, -(_local1));
_local1 = b2Math.b2Clamp((_local1 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
} else {
if (m_limitState == e_atUpperLimit){
_local1 = (_local31 - m_upperTranslation);
_local25 = b2Math.b2Max(_local25, _local1);
_local1 = b2Math.b2Clamp((_local1 - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
};
};
};
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local32) * m_motorJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local32) * m_motorJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local32) * m_motorJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local32) * m_motorJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local32) * m_motorJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local32) * m_motorJacobian.angular2));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local25 <= b2Settings.b2_linearSlop)) && ((_local28 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:b2Vec2;
var _local16:b2Vec2;
var _local17:b2Vec2;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local1 = m_body1;
_local2 = m_body2;
_local3 = _local1.m_xf.R;
_local4 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local5 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local3 = _local2.m_xf.R;
_local7 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local8 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local7) + (_local3.col2.x * _local8));
_local8 = ((_local3.col1.y * _local7) + (_local3.col2.y * _local8));
_local7 = _local6;
_local9 = (_local1.m_sweep.c.x + _local4);
_local10 = (_local1.m_sweep.c.y + _local5);
_local11 = (_local2.m_sweep.c.x + _local7);
_local12 = (_local2.m_sweep.c.y + _local8);
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = _local1.GetWorldVector(m_localXAxis1);
_local16 = _local1.m_linearVelocity;
_local17 = _local2.m_linearVelocity;
_local18 = _local1.m_angularVelocity;
_local19 = _local2.m_angularVelocity;
_local20 = (((_local13 * (-(_local18) * _local15.y)) + (_local14 * (_local18 * _local15.x))) + ((_local15.x * (((_local17.x + (-(_local19) * _local8)) - _local16.x) - (-(_local18) * _local5))) + (_local15.y * (((_local17.y + (_local19 * _local7)) - _local16.y) - (_local18 * _local4)))));
return (_local20);
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local10 = _local2.m_invMass;
_local11 = _local3.m_invMass;
_local12 = _local2.m_invI;
_local13 = _local3.m_invI;
_local4 = _local2.m_xf.R;
_local14 = ((_local4.col1.x * m_localYAxis1.x) + (_local4.col2.x * m_localYAxis1.y));
_local15 = ((_local4.col1.y * m_localYAxis1.x) + (_local4.col2.y * m_localYAxis1.y));
_local16 = ((_local3.m_sweep.c.x + _local8) - _local2.m_sweep.c.x);
_local17 = ((_local3.m_sweep.c.y + _local9) - _local2.m_sweep.c.y);
m_linearJacobian.linear1.x = -(_local14);
m_linearJacobian.linear1.y = -(_local15);
m_linearJacobian.linear2.x = _local14;
m_linearJacobian.linear2.y = _local15;
m_linearJacobian.angular1 = -(((_local16 * _local15) - (_local17 * _local14)));
m_linearJacobian.angular2 = ((_local8 * _local15) - (_local9 * _local14));
m_linearMass = (((_local10 + ((_local12 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + _local11) + ((_local13 * m_linearJacobian.angular2) * m_linearJacobian.angular2));
m_linearMass = (1 / m_linearMass);
m_angularMass = (_local12 + _local13);
if (m_angularMass > Number.MIN_VALUE){
m_angularMass = (1 / m_angularMass);
};
if (((m_enableLimit) || (m_enableMotor))){
_local4 = _local2.m_xf.R;
_local18 = ((_local4.col1.x * m_localXAxis1.x) + (_local4.col2.x * m_localXAxis1.y));
_local19 = ((_local4.col1.y * m_localXAxis1.x) + (_local4.col2.y * m_localXAxis1.y));
m_motorJacobian.linear1.x = -(_local18);
m_motorJacobian.linear1.y = -(_local19);
m_motorJacobian.linear2.x = _local18;
m_motorJacobian.linear2.y = _local19;
m_motorJacobian.angular1 = -(((_local16 * _local19) - (_local17 * _local18)));
m_motorJacobian.angular2 = ((_local8 * _local19) - (_local9 * _local18));
m_motorMass = (((_local10 + ((_local12 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + _local11) + ((_local13 * m_motorJacobian.angular2) * m_motorJacobian.angular2));
m_motorMass = (1 / m_motorMass);
if (m_enableLimit){
_local20 = (_local16 - _local6);
_local21 = (_local17 - _local7);
_local22 = ((_local18 * _local20) + (_local19 * _local21));
if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
m_limitState = e_equalLimits;
} else {
if (_local22 <= m_lowerTranslation){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local22 >= m_upperTranslation){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
};
};
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit == false){
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local23 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.x)));
_local24 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.y)));
_local25 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.x)));
_local26 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.y)));
_local27 = (_arg1.dt * (((m_force * m_linearJacobian.angular1) - m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular1)));
_local28 = (_arg1.dt * (((m_force * m_linearJacobian.angular2) + m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular2)));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local10 * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local10 * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local12 * _local27));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local11 * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local11 * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local13 * _local28));
} else {
m_force = 0;
m_torque = 0;
m_limitForce = 0;
m_motorForce = 0;
};
m_limitPositionImpulse = 0;
}
public function GetMotorForce():Number{
return (m_motorForce);
}
public function SetMaxMotorForce(_arg1:Number):void{
m_maxMotorForce = _arg1;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
override public function GetReactionTorque():Number{
return (m_torque);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_invMass;
_local5 = _local3.m_invMass;
_local6 = _local2.m_invI;
_local7 = _local3.m_invI;
_local9 = m_linearJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local10 = ((-(_arg1.inv_dt) * m_linearMass) * _local9);
m_force = (m_force + _local10);
_local11 = (_arg1.dt * _local10);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_linearJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_linearJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_linearJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_linearJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_linearJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_linearJacobian.angular2));
_local12 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local13 = ((-(_arg1.inv_dt) * m_angularMass) * _local12);
m_torque = (m_torque + _local13);
_local14 = (_arg1.dt * _local13);
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local6 * _local14));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local7 * _local14));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local15 = (m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity) - m_motorSpeed);
_local16 = ((-(_arg1.inv_dt) * m_motorMass) * _local15);
_local17 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local16), -(m_maxMotorForce), m_maxMotorForce);
_local16 = (m_motorForce - _local17);
_local11 = (_arg1.dt * _local16);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local18 = m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local19 = ((-(_arg1.inv_dt) * m_motorMass) * _local18);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local19);
} else {
if (m_limitState == e_atLowerLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
} else {
if (m_limitState == e_atUpperLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
};
};
};
_local11 = (_arg1.dt * _local19);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
}
}
}//package Box2D.Dynamics.Joints
Section 59
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2PrismaticJointDef extends b2JointDef {
public var localAxis1:b2Vec2;
public var referenceAngle:Number;
public var maxMotorForce:Number;
public var motorSpeed:Number;
public var upperTranslation:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public var lowerTranslation:Number;
public function b2PrismaticJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
localAxis1 = new b2Vec2();
super();
type = b2Joint.e_prismaticJoint;
localAxis1.Set(1, 0);
referenceAngle = 0;
enableLimit = false;
lowerTranslation = 0;
upperTranslation = 0;
enableMotor = false;
maxMotorForce = 0;
motorSpeed = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
localAxis1 = body1.GetLocalVector(_arg4);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 60
//b2PulleyJoint (Box2D.Dynamics.Joints.b2PulleyJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PulleyJoint extends b2Joint {
public var m_ground:b2Body;
public var m_maxLength2:Number;
public var m_limitForce1:Number;
public var m_maxLength1:Number;
public var m_limitState1:int;
public var m_limitState2:int;
public var m_limitPositionImpulse2:Number;
public var m_force:Number;
public var m_limitPositionImpulse1:Number;
public var m_constant:Number;
public var m_state:int;
public var m_ratio:Number;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_positionImpulse:Number;
public var m_limitMass2:Number;
public var m_limitMass1:Number;
public var m_pulleyMass:Number;
public var m_u1:b2Vec2;
public var m_u2:b2Vec2;
public var m_limitForce2:Number;
public static const b2_minPulleyLength:Number = 2;
public function b2PulleyJoint(_arg1:b2PulleyJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u1 = new b2Vec2();
m_u2 = new b2Vec2();
super(_arg1);
m_ground = m_body1.m_world.m_groundBody;
m_groundAnchor1.x = (_arg1.groundAnchor1.x - m_ground.m_xf.position.x);
m_groundAnchor1.y = (_arg1.groundAnchor1.y - m_ground.m_xf.position.y);
m_groundAnchor2.x = (_arg1.groundAnchor2.x - m_ground.m_xf.position.x);
m_groundAnchor2.y = (_arg1.groundAnchor2.y - m_ground.m_xf.position.y);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_ratio = _arg1.ratio;
m_constant = (_arg1.length1 + (m_ratio * _arg1.length2));
m_maxLength1 = b2Math.b2Min(_arg1.maxLength1, (m_constant - (m_ratio * b2_minPulleyLength)));
m_maxLength2 = b2Math.b2Min(_arg1.maxLength2, ((m_constant - b2_minPulleyLength) / m_ratio));
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
}
public function GetGroundAnchor2():b2Vec2{
var _local1:b2Vec2;
_local1 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor2);
return (_local1);
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = m_u2.Copy();
_local1.Multiply(m_force);
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
_local1 = m_body1;
_local2 = m_body2;
_local4 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local5 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local6 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local7 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
_local23 = 0;
if (m_state == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local16 = m_u1.Length();
_local17 = m_u2.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local16));
} else {
m_u1.SetZero();
};
if (_local17 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = ((m_constant - _local16) - (m_ratio * _local17));
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_pulleyMass) * _local18);
_local20 = m_positionImpulse;
m_positionImpulse = b2Math.b2Max(0, (m_positionImpulse + _local19));
_local19 = (m_positionImpulse - _local20);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local14 = ((-(m_ratio) * _local19) * m_u2.x);
_local15 = ((-(m_ratio) * _local19) * m_u2.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local1.SynchronizeTransform();
_local2.SynchronizeTransform();
};
if (m_limitState1 == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
_local16 = m_u1.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.x = (m_u1.x * (1 / _local16));
m_u1.y = (m_u1.y * (1 / _local16));
} else {
m_u1.SetZero();
};
_local18 = (m_maxLength1 - _local16);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass1) * _local18);
_local21 = m_limitPositionImpulse1;
m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + _local19));
_local19 = (m_limitPositionImpulse1 - _local21);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local1.SynchronizeTransform();
};
if (m_limitState2 == e_atUpperLimit){
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local17 = m_u2.Length();
if (_local17 > b2Settings.b2_linearSlop){
m_u2.x = (m_u2.x * (1 / _local17));
m_u2.y = (m_u2.y * (1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = (m_maxLength2 - _local17);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass2) * _local18);
_local21 = m_limitPositionImpulse2;
m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + _local19));
_local19 = (m_limitPositionImpulse2 - _local21);
_local14 = (-(_local19) * m_u2.x);
_local15 = (-(_local19) * m_u2.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local2.SynchronizeTransform();
};
return ((_local23 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local5 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
_local10 = (_local2.m_sweep.c.x + _local5);
_local11 = (_local2.m_sweep.c.y + _local6);
_local12 = (_local3.m_sweep.c.x + _local8);
_local13 = (_local3.m_sweep.c.y + _local9);
_local14 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local15 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local16 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local17 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
m_u1.Set((_local10 - _local14), (_local11 - _local15));
m_u2.Set((_local12 - _local16), (_local13 - _local17));
_local18 = m_u1.Length();
_local19 = m_u2.Length();
if (_local18 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local18));
} else {
m_u1.SetZero();
};
if (_local19 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local19));
} else {
m_u2.SetZero();
};
_local20 = ((m_constant - _local18) - (m_ratio * _local19));
if (_local20 > 0){
m_state = e_inactiveLimit;
m_force = 0;
} else {
m_state = e_atUpperLimit;
m_positionImpulse = 0;
};
if (_local18 < m_maxLength1){
m_limitState1 = e_inactiveLimit;
m_limitForce1 = 0;
} else {
m_limitState1 = e_atUpperLimit;
m_limitPositionImpulse1 = 0;
};
if (_local19 < m_maxLength2){
m_limitState2 = e_inactiveLimit;
m_limitForce2 = 0;
} else {
m_limitState2 = e_atUpperLimit;
m_limitPositionImpulse2 = 0;
};
_local21 = ((_local5 * m_u1.y) - (_local6 * m_u1.x));
_local22 = ((_local8 * m_u2.y) - (_local9 * m_u2.x));
m_limitMass1 = (_local2.m_invMass + ((_local2.m_invI * _local21) * _local21));
m_limitMass2 = (_local3.m_invMass + ((_local3.m_invI * _local22) * _local22));
m_pulleyMass = (m_limitMass1 + ((m_ratio * m_ratio) * m_limitMass2));
m_limitMass1 = (1 / m_limitMass1);
m_limitMass2 = (1 / m_limitMass2);
m_pulleyMass = (1 / m_pulleyMass);
if (_arg1.warmStarting){
_local23 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.x);
_local24 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.y);
_local25 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.x);
_local26 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local24) - (_local6 * _local23))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local26) - (_local9 * _local25))));
} else {
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
public function GetRatio():Number{
return (m_ratio);
}
public function GetLength2():Number{
var _local1:b2Vec2;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body2.GetWorldPoint(m_localAnchor2);
_local2 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local3 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
_local4 = (_local1.x - _local2);
_local5 = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local5 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
if (m_state == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = (-(((m_u1.x * _local10) + (m_u1.y * _local11))) - (m_ratio * ((m_u2.x * _local12) + (m_u2.y * _local13))));
_local19 = ((-(_arg1.inv_dt) * m_pulleyMass) * _local18);
_local20 = m_force;
m_force = b2Math.b2Max(0, (m_force + _local19));
_local19 = (m_force - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local16 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.x);
_local17 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
if (m_limitState1 == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local18 = -(((m_u1.x * _local10) + (m_u1.y * _local11)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass1) * _local18);
_local20 = m_limitForce1;
m_limitForce1 = b2Math.b2Max(0, (m_limitForce1 + _local19));
_local19 = (m_limitForce1 - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
};
if (m_limitState2 == e_atUpperLimit){
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = -(((m_u2.x * _local12) + (m_u2.y * _local13)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass2) * _local18);
_local20 = m_limitForce2;
m_limitForce2 = b2Math.b2Max(0, (m_limitForce2 + _local19));
_local19 = (m_limitForce2 - _local20);
_local16 = ((-(_arg1.dt) * _local19) * m_u2.x);
_local17 = ((-(_arg1.dt) * _local19) * m_u2.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
}
public function GetLength1():Number{
var _local1:b2Vec2;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body1.GetWorldPoint(m_localAnchor1);
_local2 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local3 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local4 = (_local1.x - _local2);
_local5 = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
public function GetGroundAnchor1():b2Vec2{
var _local1:b2Vec2;
_local1 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor1);
return (_local1);
}
}
}//package Box2D.Dynamics.Joints
Section 61
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2PulleyJointDef extends b2JointDef {
public var maxLength2:Number;
public var length1:Number;
public var length2:Number;
public var maxLength1:Number;
public var ratio:Number;
public var groundAnchor1:b2Vec2;
public var groundAnchor2:b2Vec2;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public function b2PulleyJointDef(){
groundAnchor1 = new b2Vec2();
groundAnchor2 = new b2Vec2();
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_pulleyJoint;
groundAnchor1.Set(-1, 1);
groundAnchor2.Set(1, 1);
localAnchor1.Set(-1, 0);
localAnchor2.Set(1, 0);
length1 = 0;
maxLength1 = 0;
length2 = 0;
maxLength2 = 0;
ratio = 1;
collideConnected = true;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2, _arg5:b2Vec2, _arg6:b2Vec2, _arg7:Number):void{
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
body1 = _arg1;
body2 = _arg2;
groundAnchor1.SetV(_arg3);
groundAnchor2.SetV(_arg4);
localAnchor1 = body1.GetLocalPoint(_arg5);
localAnchor2 = body2.GetLocalPoint(_arg6);
_local8 = (_arg5.x - _arg3.x);
_local9 = (_arg5.y - _arg3.y);
length1 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local10 = (_arg6.x - _arg4.x);
_local11 = (_arg6.y - _arg4.y);
length2 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
ratio = _arg7;
_local12 = (length1 + (ratio * length2));
maxLength1 = (_local12 - (ratio * b2PulleyJoint.b2_minPulleyLength));
maxLength2 = ((_local12 - b2PulleyJoint.b2_minPulleyLength) / ratio);
}
}
}//package Box2D.Dynamics.Joints
Section 62
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2RevoluteJoint extends b2Joint {
public var m_limitForce:Number;
public var m_motorForce:Number;
public var m_pivotMass:b2Mat22;
public var m_enableLimit:Boolean;
public var m_limitState:int;
public var m_motorMass:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K3:b2Mat22;
private var K:b2Mat22;
public var m_pivotForce:b2Vec2;
public var m_motorSpeed:Number;
public var m_enableMotor:Boolean;
public var m_limitPositionImpulse:Number;
public var m_maxMotorTorque:Number;
public var m_referenceAngle:Number;
public var m_lowerAngle:Number;
public var m_upperAngle:Number;
public static var tImpulse:b2Vec2 = new b2Vec2();
public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
K3 = new b2Mat22();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_pivotForce = new b2Vec2();
m_pivotMass = new b2Mat22();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_referenceAngle = _arg1.referenceAngle;
m_pivotForce.Set(0, 0);
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerAngle = _arg1.lowerAngle;
m_upperAngle = _arg1.upperAngle;
m_maxMotorTorque = _arg1.maxMotorTorque;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetUpperLimit():Number{
return (m_upperAngle);
}
public function GetLowerLimit():Number{
return (m_lowerAngle);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerAngle = _arg1;
m_upperAngle = _arg2;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
return (m_pivotForce);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = 0;
_local6 = _local3.m_xf.R;
_local7 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local8 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local7) + (_local6.col2.x * _local8));
_local8 = ((_local6.col1.y * _local7) + (_local6.col2.y * _local8));
_local7 = _local9;
_local6 = _local4.m_xf.R;
_local10 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local10) + (_local6.col2.x * _local11));
_local11 = ((_local6.col1.y * _local10) + (_local6.col2.y * _local11));
_local10 = _local9;
_local12 = (_local3.m_sweep.c.x + _local7);
_local13 = (_local3.m_sweep.c.y + _local8);
_local14 = (_local4.m_sweep.c.x + _local10);
_local15 = (_local4.m_sweep.c.y + _local11);
_local16 = (_local14 - _local12);
_local17 = (_local15 - _local13);
_local5 = Math.sqrt(((_local16 * _local16) + (_local17 * _local17)));
_local18 = _local3.m_invMass;
_local19 = _local4.m_invMass;
_local20 = _local3.m_invI;
_local21 = _local4.m_invI;
K1.col1.x = (_local18 + _local19);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local18 + _local19);
K2.col1.x = ((_local20 * _local8) * _local8);
K2.col2.x = ((-(_local20) * _local7) * _local8);
K2.col1.y = ((-(_local20) * _local7) * _local8);
K2.col2.y = ((_local20 * _local7) * _local7);
K3.col1.x = ((_local21 * _local11) * _local11);
K3.col2.x = ((-(_local21) * _local10) * _local11);
K3.col1.y = ((-(_local21) * _local10) * _local11);
K3.col2.y = ((_local21 * _local10) * _local10);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Solve(tImpulse, -(_local16), -(_local17));
_local22 = tImpulse.x;
_local23 = tImpulse.y;
_local3.m_sweep.c.x = (_local3.m_sweep.c.x - (_local3.m_invMass * _local22));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y - (_local3.m_invMass * _local23));
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * ((_local7 * _local23) - (_local8 * _local22))));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + (_local4.m_invMass * _local22));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + (_local4.m_invMass * _local23));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * ((_local10 * _local23) - (_local11 * _local22))));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
_local24 = 0;
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local25 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_referenceAngle);
_local26 = 0;
if (m_limitState == e_equalLimits){
_local2 = b2Math.b2Clamp(_local25, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local24 = b2Math.b2Abs(_local2);
} else {
if (m_limitState == e_atLowerLimit){
_local2 = (_local25 - m_lowerAngle);
_local24 = b2Math.b2Max(0, -(_local2));
_local2 = b2Math.b2Clamp((_local2 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
} else {
if (m_limitState == e_atUpperLimit){
_local2 = (_local25 - m_upperAngle);
_local24 = b2Math.b2Max(0, _local2);
_local2 = b2Math.b2Clamp((_local2 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
};
};
};
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local26));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local26));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local5 <= b2Settings.b2_linearSlop)) && ((_local24 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity));
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function SetMaxMotorTorque(_arg1:Number):void{
m_maxMotorTorque = _arg1;
}
public function GetJointAngle():Number{
return (((m_body2.m_sweep.a - m_body1.m_sweep.a) - m_referenceAngle));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local10 = _local2.m_invMass;
_local11 = _local3.m_invMass;
_local12 = _local2.m_invI;
_local13 = _local3.m_invI;
K1.col1.x = (_local10 + _local11);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local10 + _local11);
K2.col1.x = ((_local12 * _local7) * _local7);
K2.col2.x = ((-(_local12) * _local6) * _local7);
K2.col1.y = ((-(_local12) * _local6) * _local7);
K2.col2.y = ((_local12 * _local6) * _local6);
K3.col1.x = ((_local13 * _local9) * _local9);
K3.col2.x = ((-(_local13) * _local8) * _local9);
K3.col1.y = ((-(_local13) * _local8) * _local9);
K3.col2.y = ((_local13 * _local8) * _local8);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Invert(m_pivotMass);
m_motorMass = (1 / (_local12 + _local13));
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit){
_local14 = ((_local3.m_sweep.a - _local2.m_sweep.a) - m_referenceAngle);
if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){
m_limitState = e_equalLimits;
} else {
if (_local14 <= m_lowerAngle){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local14 >= m_upperAngle){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
} else {
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - ((_arg1.dt * _local10) * m_pivotForce.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - ((_arg1.dt * _local10) * m_pivotForce.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_arg1.dt * _local12) * ((((_local6 * m_pivotForce.y) - (_local7 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_arg1.dt * _local11) * m_pivotForce.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_arg1.dt * _local11) * m_pivotForce.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_arg1.dt * _local13) * ((((_local8 * m_pivotForce.y) - (_local9 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
} else {
m_pivotForce.SetZero();
m_motorForce = 0;
m_limitForce = 0;
};
m_limitPositionImpulse = 0;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
public function GetMotorTorque():Number{
return (m_motorForce);
}
override public function GetReactionTorque():Number{
return (m_limitForce);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local11 = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local7));
_local12 = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local6));
_local13 = (-(_arg1.inv_dt) * ((m_pivotMass.col1.x * _local11) + (m_pivotMass.col2.x * _local12)));
_local14 = (-(_arg1.inv_dt) * ((m_pivotMass.col1.y * _local11) + (m_pivotMass.col2.y * _local12)));
m_pivotForce.x = (m_pivotForce.x + _local13);
m_pivotForce.y = (m_pivotForce.y + _local14);
_local15 = (_arg1.dt * _local13);
_local16 = (_arg1.dt * _local14);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local15));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local16));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local16) - (_local9 * _local15))));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local17 = ((_local3.m_angularVelocity - _local2.m_angularVelocity) - m_motorSpeed);
_local18 = ((-(_arg1.inv_dt) * m_motorMass) * _local17);
_local19 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local18), -(m_maxMotorTorque), m_maxMotorTorque);
_local18 = (m_motorForce - _local19);
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local18));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local18));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local20 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local21 = ((-(_arg1.inv_dt) * m_motorMass) * _local20);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local21);
} else {
if (m_limitState == e_atLowerLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
} else {
if (m_limitState == e_atUpperLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
};
};
};
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local21));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local21));
};
}
}
}//package Box2D.Dynamics.Joints
Section 63
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2RevoluteJointDef extends b2JointDef {
public var referenceAngle:Number;
public var upperAngle:Number;
public var lowerAngle:Number;
public var motorSpeed:Number;
public var maxMotorTorque:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public function b2RevoluteJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_revoluteJoint;
localAnchor1.Set(0, 0);
localAnchor2.Set(0, 0);
referenceAngle = 0;
lowerAngle = 0;
upperAngle = 0;
maxMotorTorque = 0;
motorSpeed = 0;
enableLimit = false;
enableMotor = false;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 64
//b2Body (Box2D.Dynamics.b2Body)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.Contacts.*;
public class b2Body {
public var m_next:b2Body;
public var m_contactList:b2ContactEdge;
public var m_angularVelocity:Number;
public var m_shapeList:b2Shape;
public var m_force:b2Vec2;
public var m_mass:Number;
public var m_sweep:b2Sweep;
public var m_xf:b2XForm;
public var m_torque:Number;
public var m_userData;
public var m_flags:uint;
public var m_world:b2World;
public var m_prev:b2Body;
public var m_invMass:Number;
public var m_type:int;
public var m_linearDamping:Number;
public var m_angularDamping:Number;
public var m_invI:Number;
public var m_linearVelocity:b2Vec2;
public var m_sleepTime:Number;
public var m_shapeCount:int;
public var m_jointList:b2JointEdge;
public var m_I:Number;
public static var e_fixedRotationFlag:uint = 64;
public static var e_frozenFlag:uint = 2;
public static var e_maxTypes:uint = 3;
public static var e_sleepFlag:uint = 8;
private static var s_massData:b2MassData = new b2MassData();
public static var e_bulletFlag:uint = 32;
public static var e_staticType:uint = 1;
public static var e_islandFlag:uint = 4;
public static var e_allowSleepFlag:uint = 16;
private static var s_xf1:b2XForm = new b2XForm();
public static var e_dynamicType:uint = 2;
public function b2Body(_arg1:b2BodyDef, _arg2:b2World){
var _local3:b2Mat22;
var _local4:b2Vec2;
m_xf = new b2XForm();
m_sweep = new b2Sweep();
m_linearVelocity = new b2Vec2();
m_force = new b2Vec2();
super();
m_flags = 0;
if (_arg1.isBullet){
m_flags = (m_flags | e_bulletFlag);
};
if (_arg1.fixedRotation){
m_flags = (m_flags | e_fixedRotationFlag);
};
if (_arg1.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (_arg1.isSleeping){
m_flags = (m_flags | e_sleepFlag);
};
m_world = _arg2;
m_xf.position.SetV(_arg1.position);
m_xf.R.Set(_arg1.angle);
m_sweep.localCenter.SetV(_arg1.massData.center);
m_sweep.t0 = 1;
m_sweep.a0 = (m_sweep.a = _arg1.angle);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_jointList = null;
m_contactList = null;
m_prev = null;
m_next = null;
m_linearDamping = _arg1.linearDamping;
m_angularDamping = _arg1.angularDamping;
m_force.Set(0, 0);
m_torque = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_sleepTime = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.massData.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.massData.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
m_userData = _arg1.userData;
m_shapeList = null;
m_shapeCount = 0;
}
public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_arg1.x - m_sweep.c.x)))));
}
public function SetLinearVelocity(_arg1:b2Vec2):void{
m_linearVelocity.SetV(_arg1);
}
public function WakeUp():void{
m_flags = (m_flags & ~(e_sleepFlag));
m_sleepTime = 0;
}
public function GetLocalCenter():b2Vec2{
return (m_sweep.localCenter);
}
public function ApplyTorque(_arg1:Number):void{
if (IsSleeping()){
WakeUp();
};
m_torque = (m_torque + _arg1);
}
public function IsFrozen():Boolean{
return (((m_flags & e_frozenFlag) == e_frozenFlag));
}
public function IsDynamic():Boolean{
return ((m_type == e_dynamicType));
}
public function GetLinearVelocity():b2Vec2{
return (m_linearVelocity);
}
public function SynchronizeTransform():void{
var _local1:b2Mat22;
var _local2:b2Vec2;
m_xf.R.Set(m_sweep.a);
_local1 = m_xf.R;
_local2 = m_sweep.localCenter;
m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y)));
m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y)));
}
public function GetInertia():Number{
return (m_I);
}
public function IsSleeping():Boolean{
return (((m_flags & e_sleepFlag) == e_sleepFlag));
}
public function SetMassFromShapes():void{
var _local1:b2Shape;
var _local2:Number;
var _local3:Number;
var _local4:b2MassData;
var _local5:b2Mat22;
var _local6:b2Vec2;
var _local7:int;
if (m_world.m_lock == true){
return;
};
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
_local2 = 0;
_local3 = 0;
_local4 = s_massData;
_local1 = m_shapeList;
while (_local1) {
_local1.ComputeMass(_local4);
m_mass = (m_mass + _local4.mass);
_local2 = (_local2 + (_local4.mass * _local4.center.x));
_local3 = (_local3 + (_local4.mass * _local4.center.y));
m_I = (m_I + _local4.I);
_local1 = _local1.m_next;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
_local2 = (_local2 * m_invMass);
_local3 = (_local3 * m_invMass);
};
if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (m_I - (m_mass * ((_local2 * _local2) + (_local3 * _local3))));
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
m_sweep.localCenter.Set(_local2, _local3);
_local5 = m_xf.R;
_local6 = m_sweep.localCenter;
m_sweep.c.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y));
m_sweep.c.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local1 = m_shapeList;
while (_local1) {
_local1.UpdateSweepRadius(m_sweep.localCenter);
_local1 = _local1.m_next;
};
_local7 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local7 != m_type){
_local1 = m_shapeList;
while (_local1) {
_local1.RefilterProxy(m_world.m_broadPhase, m_xf);
_local1 = _local1.m_next;
};
};
}
public function PutToSleep():void{
m_flags = (m_flags | e_sleepFlag);
m_sleepTime = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_force.SetZero();
m_torque = 0;
}
public function GetJointList():b2JointEdge{
return (m_jointList);
}
public function SetXForm(_arg1:b2Vec2, _arg2:Number):Boolean{
var _local3:b2Shape;
var _local4:b2Mat22;
var _local5:b2Vec2;
var _local6:Boolean;
var _local7:Boolean;
if (m_world.m_lock == true){
return (true);
};
if (IsFrozen()){
return (false);
};
m_xf.R.Set(_arg2);
m_xf.position.SetV(_arg1);
_local4 = m_xf.R;
_local5 = m_sweep.localCenter;
m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y));
m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_sweep.a0 = (m_sweep.a = _arg2);
_local6 = false;
_local3 = m_shapeList;
while (_local3) {
_local7 = _local3.Synchronize(m_world.m_broadPhase, m_xf, m_xf);
if (_local7 == false){
_local6 = true;
break;
};
_local3 = _local3.m_next;
};
if (_local6 == true){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local3 = m_shapeList;
while (_local3) {
_local3.DestroyProxy(m_world.m_broadPhase);
_local3 = _local3.m_next;
};
return (false);
};
m_world.m_broadPhase.Commit();
return (true);
}
public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulXT(m_xf, _arg1));
}
public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_force.x = (m_force.x + _arg1.x);
m_force.y = (m_force.y + _arg1.y);
m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)));
}
public function SynchronizeShapes():Boolean{
var _local1:b2XForm;
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:b2Shape;
var _local5:Boolean;
_local1 = s_xf1;
_local1.R.Set(m_sweep.a0);
_local2 = _local1.R;
_local3 = m_sweep.localCenter;
_local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y)));
_local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y)));
_local5 = true;
_local4 = m_shapeList;
while (_local4) {
_local5 = _local4.Synchronize(m_world.m_broadPhase, _local1, m_xf);
if (_local5 == false){
break;
};
_local4 = _local4.m_next;
};
if (_local5 == false){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local4 = m_shapeList;
while (_local4) {
_local4.DestroyProxy(m_world.m_broadPhase);
_local4 = _local4.m_next;
};
return (false);
};
return (true);
}
public function GetAngle():Number{
return (m_sweep.a);
}
public function GetXForm():b2XForm{
return (m_xf);
}
public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x));
m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y));
m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))));
}
public function GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_local3.x - m_sweep.c.x)))));
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function SetAngularVelocity(_arg1:Number):void{
m_angularVelocity = _arg1;
}
public function SetMass(_arg1:b2MassData):void{
var _local2:b2Shape;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
if (m_world.m_lock == true){
return;
};
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
m_sweep.localCenter.SetV(_arg1.center);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local2 = m_shapeList;
while (_local2) {
_local2.UpdateSweepRadius(m_sweep.localCenter);
_local2 = _local2.m_next;
};
_local5 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local5 != m_type){
_local2 = m_shapeList;
while (_local2) {
_local2.RefilterProxy(m_world.m_broadPhase, m_xf);
_local2 = _local2.m_next;
};
};
}
public function IsStatic():Boolean{
return ((m_type == e_staticType));
}
public function GetWorldVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulMV(m_xf.R, _arg1));
}
public function GetShapeList():b2Shape{
return (m_shapeList);
}
public function Advance(_arg1:Number):void{
m_sweep.Advance(_arg1);
m_sweep.c.SetV(m_sweep.c0);
m_sweep.a = m_sweep.a0;
SynchronizeTransform();
}
public function SetBullet(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_bulletFlag);
} else {
m_flags = (m_flags & ~(e_bulletFlag));
};
}
public function CreateShape(_arg1:b2ShapeDef):b2Shape{
var _local2:b2Shape;
if (m_world.m_lock == true){
return (null);
};
_local2 = b2Shape.Create(_arg1, m_world.m_blockAllocator);
_local2.m_next = m_shapeList;
m_shapeList = _local2;
m_shapeCount++;
_local2.m_body = this;
_local2.CreateProxy(m_world.m_broadPhase, m_xf);
_local2.UpdateSweepRadius(m_sweep.localCenter);
return (_local2);
}
public function IsConnected(_arg1:b2Body):Boolean{
var _local2:b2JointEdge;
_local2 = m_jointList;
while (_local2) {
if (_local2.other == _arg1){
return ((_local2.joint.m_collideConnected == false));
};
_local2 = _local2.next;
};
return (false);
}
public function DestroyShape(_arg1:b2Shape):void{
var _local2:b2Shape;
var _local3:b2Shape;
var _local4:Boolean;
if (m_world.m_lock == true){
return;
};
_arg1.DestroyProxy(m_world.m_broadPhase);
_local2 = m_shapeList;
_local3 = null;
_local4 = false;
while (_local2 != null) {
if (_local2 == _arg1){
if (_local3){
_local3.m_next = _arg1.m_next;
} else {
m_shapeList = _arg1.m_next;
};
_local4 = true;
break;
};
_local3 = _local2;
_local2 = _local2.m_next;
};
_arg1.m_body = null;
_arg1.m_next = null;
m_shapeCount--;
b2Shape.Destroy(_arg1, m_world.m_blockAllocator);
}
public function GetUserData(){
return (m_userData);
}
public function IsBullet():Boolean{
return (((m_flags & e_bulletFlag) == e_bulletFlag));
}
public function GetWorldCenter():b2Vec2{
return (m_sweep.c);
}
public function AllowSleeping(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
WakeUp();
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetLocalVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_xf.R, _arg1));
}
public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (_local3);
}
public function GetWorld():b2World{
return (m_world);
}
public function GetPosition():b2Vec2{
return (m_xf.position);
}
}
}//package Box2D.Dynamics
Section 65
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2BodyDef {
public var isSleeping:Boolean;
public var position:b2Vec2;
public var isBullet:Boolean;
public var allowSleep:Boolean;
public var userData;
public var angularDamping:Number;
public var fixedRotation:Boolean;
public var angle:Number;
public var linearDamping:Number;
public var massData:b2MassData;
public function b2BodyDef(){
massData = new b2MassData();
position = new b2Vec2();
super();
massData.center.SetZero();
massData.mass = 0;
massData.I = 0;
userData = null;
position.Set(0, 0);
angle = 0;
linearDamping = 0;
angularDamping = 0;
allowSleep = true;
isSleeping = false;
fixedRotation = false;
isBullet = false;
}
}
}//package Box2D.Dynamics
Section 66
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener)
package Box2D.Dynamics {
public class b2BoundaryListener {
public function Violation(_arg1:b2Body):void{
}
}
}//package Box2D.Dynamics
Section 67
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
public class b2ContactFilter {
public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function RayCollide(_arg1, _arg2:b2Shape):Boolean{
if (!_arg1){
return (true);
};
return (ShouldCollide((_arg1 as b2Shape), _arg2));
}
public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{
var _local3:b2FilterData;
var _local4:b2FilterData;
var _local5:Boolean;
_local3 = _arg1.GetFilterData();
_local4 = _arg2.GetFilterData();
if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){
return ((_local3.groupIndex > 0));
};
_local5 = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0))));
return (_local5);
}
}
}//package Box2D.Dynamics
Section 68
//b2ContactListener (Box2D.Dynamics.b2ContactListener)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactListener {
public function Add(_arg1:b2ContactPoint):void{
}
public function Remove(_arg1:b2ContactPoint):void{
}
public function Persist(_arg1:b2ContactPoint):void{
}
public function Result(_arg1:b2ContactResult):void{
}
}
}//package Box2D.Dynamics
Section 69
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactManager extends b2PairCallback {
public var m_world:b2World;
public var m_destroyImmediate:Boolean;
public var m_nullContact:b2NullContact;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2ContactManager(){
m_nullContact = new b2NullContact();
super();
m_world = null;
m_destroyImmediate = false;
}
override public function PairAdded(_arg1, _arg2){
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2Contact;
_local3 = (_arg1 as b2Shape);
_local4 = (_arg2 as b2Shape);
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((_local5.IsStatic()) && (_local6.IsStatic()))){
return (m_nullContact);
};
if (_local3.m_body == _local4.m_body){
return (m_nullContact);
};
if (_local6.IsConnected(_local5)){
return (m_nullContact);
};
if (((!((m_world.m_contactFilter == null))) && ((m_world.m_contactFilter.ShouldCollide(_local3, _local4) == false)))){
return (m_nullContact);
};
_local7 = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator);
if (_local7 == null){
return (m_nullContact);
};
_local3 = _local7.m_shape1;
_local4 = _local7.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local7.m_prev = null;
_local7.m_next = m_world.m_contactList;
if (m_world.m_contactList != null){
m_world.m_contactList.m_prev = _local7;
};
m_world.m_contactList = _local7;
_local7.m_node1.contact = _local7;
_local7.m_node1.other = _local6;
_local7.m_node1.prev = null;
_local7.m_node1.next = _local5.m_contactList;
if (_local5.m_contactList != null){
_local5.m_contactList.prev = _local7.m_node1;
};
_local5.m_contactList = _local7.m_node1;
_local7.m_node2.contact = _local7;
_local7.m_node2.other = _local5;
_local7.m_node2.prev = null;
_local7.m_node2.next = _local6.m_contactList;
if (_local6.m_contactList != null){
_local6.m_contactList.prev = _local7.m_node2;
};
_local6.m_contactList = _local7.m_node2;
m_world.m_contactCount++;
return (_local7);
}
override public function PairRemoved(_arg1, _arg2, _arg3):void{
var _local4:b2Contact;
if (_arg3 == null){
return;
};
_local4 = (_arg3 as b2Contact);
if (_local4 == m_nullContact){
return;
};
Destroy(_local4);
}
public function Destroy(_arg1:b2Contact):void{
var _local2:b2Shape;
var _local3:b2Shape;
var _local4:int;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Array;
var _local10:b2ContactPoint;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2Vec2;
var _local16:b2Vec2;
_local2 = _arg1.m_shape1;
_local3 = _arg1.m_shape2;
_local4 = _arg1.m_manifoldCount;
if ((((_local4 > 0)) && (m_world.m_contactListener))){
_local7 = _local2.m_body;
_local8 = _local3.m_body;
_local9 = _arg1.GetManifolds();
_local10 = s_evalCP;
_local10.shape1 = _arg1.m_shape1;
_local10.shape2 = _arg1.m_shape1;
_local10.friction = _arg1.m_friction;
_local10.restitution = _arg1.m_restitution;
_local11 = 0;
while (_local11 < _local4) {
_local12 = _local9[_local11];
_local10.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local10.position = _local7.GetWorldPoint(_local14.localPoint1);
_local15 = _local7.GetLinearVelocityFromLocalPoint(_local14.localPoint1);
_local16 = _local8.GetLinearVelocityFromLocalPoint(_local14.localPoint2);
_local10.velocity.Set((_local16.x - _local15.x), (_local16.y - _local15.y));
_local10.separation = _local14.separation;
_local10.id.key = _local14.id._key;
m_world.m_contactListener.Remove(_local10);
_local13++;
};
_local11++;
};
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_world.m_contactList){
m_world.m_contactList = _arg1.m_next;
};
_local5 = _local2.m_body;
_local6 = _local3.m_body;
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local5.m_contactList){
_local5.m_contactList = _arg1.m_node1.next;
};
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local6.m_contactList){
_local6.m_contactList = _arg1.m_node2.next;
};
b2Contact.Destroy(_arg1, m_world.m_blockAllocator);
m_world.m_contactCount--;
}
public function Collide():void{
var _local1:b2Contact;
var _local2:b2Body;
var _local3:b2Body;
_local1 = m_world.m_contactList;
while (_local1) {
_local2 = _local1.m_shape1.m_body;
_local3 = _local1.m_shape2.m_body;
if (((_local2.IsSleeping()) && (_local3.IsSleeping()))){
} else {
_local1.Update(m_world.m_contactListener);
};
_local1 = _local1.m_next;
};
}
}
}//package Box2D.Dynamics
Section 70
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw)
package Box2D.Dynamics {
import flash.display.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2DebugDraw {
public var m_xformScale:Number;// = 1
public var m_fillAlpha:Number;// = 1
public var m_alpha:Number;// = 1
public var m_lineThickness:Number;// = 1
public var m_drawFlags:uint;
public var m_sprite:Sprite;
public var m_drawScale:Number;// = 1
public static var e_coreShapeBit:uint = 4;
public static var e_shapeBit:uint = 1;
public static var e_centerOfMassBit:uint = 64;
public static var e_aabbBit:uint = 8;
public static var e_obbBit:uint = 16;
public static var e_pairBit:uint = 32;
public static var e_jointBit:uint = 2;
public function b2DebugDraw(){
m_drawScale = 1;
m_lineThickness = 1;
m_alpha = 1;
m_fillAlpha = 1;
m_xformScale = 1;
super();
m_drawFlags = 0;
}
public function DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
var _local4:int;
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.beginFill(_arg3.color, m_fillAlpha);
_local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.endFill();
}
public function DrawCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
}
public function DrawXForm(_arg1:b2XForm):void{
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col1.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col1.y)) * m_drawScale));
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col2.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col2.y)) * m_drawScale));
}
public function ClearFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags & ~(_arg1));
}
public function DrawSolidCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg4.color, m_alpha);
m_sprite.graphics.moveTo(0, 0);
m_sprite.graphics.beginFill(_arg4.color, m_fillAlpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
m_sprite.graphics.endFill();
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.x + (_arg3.x * _arg2)) * m_drawScale), ((_arg1.y + (_arg3.y * _arg2)) * m_drawScale));
}
public function SetFlags(_arg1:uint):void{
m_drawFlags = _arg1;
}
public function AppendFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags | _arg1);
}
public function DrawSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo((_arg2.x * m_drawScale), (_arg2.y * m_drawScale));
}
public function GetFlags():uint{
return (m_drawFlags);
}
public function DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
var _local4:int;
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
_local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
}
}
}//package Box2D.Dynamics
Section 71
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
public class b2DestructionListener {
public function SayGoodbyeJoint(_arg1:b2Joint):void{
}
public function SayGoodbyeShape(_arg1:b2Shape):void{
}
}
}//package Box2D.Dynamics
Section 72
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2Island {
public var m_joints:Array;
public var m_listener:b2ContactListener;
public var m_positionIterationCount:int;
public var m_bodyCapacity:int;
public var m_bodies:Array;
public var m_jointCapacity:int;
public var m_contactCount:int;
public var m_contacts:Array;
public var m_contactCapacity:int;
public var m_jointCount:int;
public var m_allocator;
public var m_bodyCount:int;
private static var s_reportCR:b2ContactResult = new b2ContactResult();
public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener){
var _local6:int;
super();
m_bodyCapacity = _arg1;
m_contactCapacity = _arg2;
m_jointCapacity = _arg3;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_allocator = _arg4;
m_listener = _arg5;
m_bodies = new Array(_arg1);
_local6 = 0;
while (_local6 < _arg1) {
m_bodies[_local6] = null;
_local6++;
};
m_contacts = new Array(_arg2);
_local6 = 0;
while (_local6 < _arg2) {
m_contacts[_local6] = null;
_local6++;
};
m_joints = new Array(_arg3);
_local6 = 0;
while (_local6 < _arg3) {
m_joints[_local6] = null;
_local6++;
};
m_positionIterationCount = 0;
}
public function AddBody(_arg1:b2Body):void{
var _local2 = m_bodyCount++;
m_bodies[_local2] = _arg1;
}
public function AddJoint(_arg1:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = _arg1;
}
public function Report(_arg1:Array):void{
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:int;
var _local5:b2Contact;
var _local6:b2ContactConstraint;
var _local7:b2ContactResult;
var _local8:b2Body;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2ContactConstraintPoint;
if (m_listener == null){
return;
};
_local4 = 0;
while (_local4 < m_contactCount) {
_local5 = m_contacts[_local4];
_local6 = _arg1[_local4];
_local7 = s_reportCR;
_local7.shape1 = _local5.m_shape1;
_local7.shape2 = _local5.m_shape2;
_local8 = _local7.shape1.m_body;
_local9 = _local5.m_manifoldCount;
_local10 = _local5.GetManifolds();
_local11 = 0;
while (_local11 < _local9) {
_local12 = _local10[_local11];
_local7.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local15 = _local6.points[_local13];
_local7.position = _local8.GetWorldPoint(_local14.localPoint1);
_local7.normalImpulse = _local15.normalImpulse;
_local7.tangentImpulse = _local15.tangentImpulse;
_local7.id.key = _local14.id.key;
m_listener.Result(_local7);
_local13++;
};
_local11++;
};
_local4++;
};
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{
var _local5:int;
var _local6:b2Body;
var _local7:b2Joint;
var _local8:b2ContactSolver;
var _local9:int;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x))));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y))));
_local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque));
_local6.m_force.SetZero();
_local6.m_torque = 0;
_local6.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1));
_local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1));
if (_local6.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){
_local6.m_linearVelocity.Normalize();
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity);
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity);
};
if ((_local6.m_angularVelocity * _local6.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){
if (_local6.m_angularVelocity < 0){
_local6.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity);
} else {
_local6.m_angularVelocity = b2Settings.b2_maxAngularVelocity;
};
};
};
_local5++;
};
_local8 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local8.InitVelocityConstraints(_arg1);
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitVelocityConstraints(_arg1);
_local5++;
};
_local5 = 0;
while (_local5 < _arg1.maxIterations) {
_local8.SolveVelocityConstraints();
_local9 = 0;
while (_local9 < m_jointCount) {
_local7 = m_joints[_local9];
_local7.SolveVelocityConstraints(_arg1);
_local9++;
};
_local5++;
};
_local8.FinalizeVelocityConstraints();
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_sweep.c0.SetV(_local6.m_sweep.c);
_local6.m_sweep.a0 = _local6.m_sweep.a;
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y));
_local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity));
_local6.SynchronizeTransform();
};
_local5++;
};
if (_arg3){
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitPositionConstraints();
_local5++;
};
m_positionIterationCount = 0;
while (m_positionIterationCount < _arg1.maxIterations) {
_local10 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local11 = true;
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local12 = _local7.SolvePositionConstraints();
_local11 = ((_local11) && (_local12));
_local5++;
};
if (((_local10) && (_local11))){
break;
};
m_positionIterationCount++;
};
};
Report(_local8.m_constraints);
if (_arg4){
_local13 = Number.MAX_VALUE;
_local14 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
_local15 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.m_invMass == 0){
} else {
if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){
_local6.m_sleepTime = 0;
_local13 = 0;
};
if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local15)))) || ((b2Math.b2Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local14)))){
_local6.m_sleepTime = 0;
_local13 = 0;
} else {
_local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt);
_local13 = b2Math.b2Min(_local13, _local6.m_sleepTime);
};
};
_local5++;
};
if (_local13 >= b2Settings.b2_timeToSleep){
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
m_bodies[_local5].m_flags = (_local6.m_flags | b2Body.e_sleepFlag);
_local6.m_linearVelocity.SetZero();
_local6.m_angularVelocity = 0;
_local5++;
};
};
};
}
public function AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:int;
var _local3:b2ContactSolver;
var _local4:Number;
var _local5:b2Body;
var _local6:Boolean;
_local3 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local3.SolveVelocityConstraints();
_local2++;
};
_local2 = 0;
while (_local2 < m_bodyCount) {
_local5 = m_bodies[_local2];
if (_local5.IsStatic()){
} else {
_local5.m_sweep.c0.SetV(_local5.m_sweep.c);
_local5.m_sweep.a0 = _local5.m_sweep.a;
_local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_arg1.dt * _local5.m_linearVelocity.x));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_arg1.dt * _local5.m_linearVelocity.y));
_local5.m_sweep.a = (_local5.m_sweep.a + (_arg1.dt * _local5.m_angularVelocity));
_local5.SynchronizeTransform();
};
_local2++;
};
_local4 = 0.75;
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local6 = _local3.SolvePositionConstraints(_local4);
if (_local6){
break;
};
_local2++;
};
Report(_local3.m_constraints);
}
}
}//package Box2D.Dynamics
Section 73
//b2TimeStep (Box2D.Dynamics.b2TimeStep)
package Box2D.Dynamics {
public class b2TimeStep {
public var warmStarting:Boolean;
public var positionCorrection:Boolean;
public var dt:Number;
public var maxIterations:int;
public var dtRatio:Number;
public var inv_dt:Number;
}
}//package Box2D.Dynamics
Section 74
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2World {
public var m_inv_dt0:Number;
public var m_boundaryListener:b2BoundaryListener;
public var m_contactList:b2Contact;
public var m_blockAllocator;
public var m_contactListener:b2ContactListener;
public var m_raycastSegment:b2Segment;
public var m_broadPhase:b2BroadPhase;
public var m_destructionListener:b2DestructionListener;
public var m_jointCount:int;
public var m_bodyCount:int;
public var m_lock:Boolean;
public var m_raycastUserData;
public var m_allowSleep:Boolean;
public var m_positionIterationCount:int;
public var m_groundBody:b2Body;
public var m_contactCount:int;
public var m_raycastNormal:b2Vec2;
public var m_contactFilter:b2ContactFilter;
public var m_bodyList:b2Body;
public var m_debugDraw:b2DebugDraw;
public var m_stackAllocator;
public var m_jointList:b2Joint;
public var m_gravity:b2Vec2;
public var m_contactManager:b2ContactManager;
private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8);
public static var m_continuousPhysics:Boolean;
public static var m_warmStarting:Boolean;
private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6);
public static var m_positionCorrection:Boolean;
private static var s_xf:b2XForm = new b2XForm();
public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){
var _local4:b2BodyDef;
m_raycastNormal = new b2Vec2();
m_contactManager = new b2ContactManager();
super();
m_destructionListener = null;
m_boundaryListener = null;
m_contactFilter = b2ContactFilter.b2_defaultFilter;
m_contactListener = null;
m_debugDraw = null;
m_bodyList = null;
m_contactList = null;
m_jointList = null;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_positionCorrection = true;
m_warmStarting = true;
m_continuousPhysics = true;
m_allowSleep = _arg3;
m_gravity = _arg2;
m_lock = false;
m_inv_dt0 = 0;
m_contactManager.m_world = this;
m_broadPhase = new b2BroadPhase(_arg1, m_contactManager);
_local4 = new b2BodyDef();
m_groundBody = CreateBody(_local4);
}
public function DrawJoint(_arg1:b2Joint):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2XForm;
var _local5:b2XForm;
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Color;
var _local11:b2PulleyJoint;
var _local12:b2Vec2;
var _local13:b2Vec2;
_local2 = _arg1.m_body1;
_local3 = _arg1.m_body2;
_local4 = _local2.m_xf;
_local5 = _local3.m_xf;
_local6 = _local4.position;
_local7 = _local5.position;
_local8 = _arg1.GetAnchor1();
_local9 = _arg1.GetAnchor2();
_local10 = s_jointColor;
switch (_arg1.m_type){
case b2Joint.e_distanceJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
case b2Joint.e_pulleyJoint:
_local11 = (_arg1 as b2PulleyJoint);
_local12 = _local11.GetGroundAnchor1();
_local13 = _local11.GetGroundAnchor2();
m_debugDraw.DrawSegment(_local12, _local8, _local10);
m_debugDraw.DrawSegment(_local13, _local9, _local10);
m_debugDraw.DrawSegment(_local12, _local13, _local10);
break;
case b2Joint.e_mouseJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
default:
if (_local2 != m_groundBody){
m_debugDraw.DrawSegment(_local6, _local8, _local10);
};
m_debugDraw.DrawSegment(_local8, _local9, _local10);
if (_local3 != m_groundBody){
m_debugDraw.DrawSegment(_local7, _local9, _local10);
};
};
}
public function Refilter(_arg1:b2Shape):void{
_arg1.RefilterProxy(m_broadPhase, _arg1.m_body.m_xf);
}
public function SetDebugDraw(_arg1:b2DebugDraw):void{
m_debugDraw = _arg1;
}
public function SetContinuousPhysics(_arg1:Boolean):void{
m_continuousPhysics = _arg1;
}
public function GetProxyCount():int{
return (m_broadPhase.m_proxyCount);
}
public function DrawDebugData():void{
var _local1:uint;
var _local2:int;
var _local3:b2Body;
var _local4:b2Shape;
var _local5:b2Joint;
var _local6:b2BroadPhase;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Color;
var _local11:b2XForm;
var _local12:b2AABB;
var _local13:b2AABB;
var _local14:Array;
var _local15:Boolean;
var _local16:uint;
var _local17:b2Pair;
var _local18:b2Proxy;
var _local19:b2Proxy;
var _local20:b2Vec2;
var _local21:b2Vec2;
var _local22:b2Proxy;
var _local23:b2PolygonShape;
var _local24:b2OBB;
var _local25:b2Vec2;
var _local26:b2Mat22;
var _local27:b2Vec2;
var _local28:Number;
if (m_debugDraw == null){
return;
};
m_debugDraw.m_sprite.graphics.clear();
_local1 = m_debugDraw.GetFlags();
_local7 = new b2Vec2();
_local8 = new b2Vec2();
_local9 = new b2Vec2();
_local10 = new b2Color(0, 0, 0);
_local12 = new b2AABB();
_local13 = new b2AABB();
_local14 = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];
if ((_local1 & b2DebugDraw.e_shapeBit)){
_local15 = ((_local1 & b2DebugDraw.e_coreShapeBit) == b2DebugDraw.e_coreShapeBit);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local3.IsStatic()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.9, 0.5), _local15);
} else {
if (_local3.IsSleeping()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.5, 0.9), _local15);
} else {
DrawShape(_local4, _local11, new b2Color(0.9, 0.9, 0.9), _local15);
};
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_jointBit)){
_local5 = m_jointList;
while (_local5) {
DrawJoint(_local5);
_local5 = _local5.m_next;
};
};
if ((_local1 & b2DebugDraw.e_pairBit)){
_local6 = m_broadPhase;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.9, 0.3);
_local2 = 0;
while (_local2 < b2Pair.b2_tableCapacity) {
_local16 = _local6.m_pairManager.m_hashTable[_local2];
while (_local16 != b2Pair.b2_nullPair) {
_local17 = _local6.m_pairManager.m_pairs[_local16];
_local18 = _local6.m_proxyPool[_local17.proxyId1];
_local19 = _local6.m_proxyPool[_local17.proxyId2];
_local12.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.lowerBounds[0]].value));
_local12.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.lowerBounds[1]].value));
_local12.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.upperBounds[0]].value));
_local12.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.upperBounds[1]].value));
_local13.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.lowerBounds[0]].value));
_local13.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.lowerBounds[1]].value));
_local13.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.upperBounds[0]].value));
_local13.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.upperBounds[1]].value));
_local8.x = (0.5 * (_local12.lowerBound.x + _local12.upperBound.x));
_local8.y = (0.5 * (_local12.lowerBound.y + _local12.upperBound.y));
_local9.x = (0.5 * (_local13.lowerBound.x + _local13.upperBound.x));
_local9.y = (0.5 * (_local13.lowerBound.y + _local13.upperBound.y));
m_debugDraw.DrawSegment(_local8, _local9, _local10);
_local16 = _local17.next;
};
_local2++;
};
};
if ((_local1 & b2DebugDraw.e_aabbBit)){
_local6 = m_broadPhase;
_local20 = _local6.m_worldAABB.lowerBound;
_local21 = _local6.m_worldAABB.upperBound;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.3, 0.9);
_local2 = 0;
while (_local2 < b2Settings.b2_maxProxies) {
_local22 = _local6.m_proxyPool[_local2];
if (_local22.IsValid() == false){
} else {
_local12.lowerBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.lowerBounds[0]].value));
_local12.lowerBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.lowerBounds[1]].value));
_local12.upperBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.upperBounds[0]].value));
_local12.upperBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.upperBounds[1]].value));
_local14[0].Set(_local12.lowerBound.x, _local12.lowerBound.y);
_local14[1].Set(_local12.upperBound.x, _local12.lowerBound.y);
_local14[2].Set(_local12.upperBound.x, _local12.upperBound.y);
_local14[3].Set(_local12.lowerBound.x, _local12.upperBound.y);
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local2++;
};
_local14[0].Set(_local20.x, _local20.y);
_local14[1].Set(_local21.x, _local20.y);
_local14[2].Set(_local21.x, _local21.y);
_local14[3].Set(_local20.x, _local21.y);
m_debugDraw.DrawPolygon(_local14, 4, new b2Color(0.3, 0.9, 0.9));
};
if ((_local1 & b2DebugDraw.e_obbBit)){
_local10.Set(0.5, 0.3, 0.5);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local4.m_type != b2Shape.e_polygonShape){
} else {
_local23 = (_local4 as b2PolygonShape);
_local24 = _local23.GetOBB();
_local25 = _local24.extents;
_local14[0].Set(-(_local25.x), -(_local25.y));
_local14[1].Set(_local25.x, -(_local25.y));
_local14[2].Set(_local25.x, _local25.y);
_local14[3].Set(-(_local25.x), _local25.y);
_local2 = 0;
while (_local2 < 4) {
_local26 = _local24.R;
_local27 = _local14[_local2];
_local28 = (_local24.center.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local24.center.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local26 = _local11.R;
_local28 = (_local11.position.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local11.position.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local2++;
};
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_centerOfMassBit)){
_local3 = m_bodyList;
while (_local3) {
_local11 = s_xf;
_local11.R = _local3.m_xf.R;
_local11.position = _local3.GetWorldCenter();
m_debugDraw.DrawXForm(_local11);
_local3 = _local3.m_next;
};
};
}
public function DestroyBody(_arg1:b2Body):void{
var _local2:b2JointEdge;
var _local3:b2Shape;
var _local4:b2JointEdge;
var _local5:b2Shape;
if (m_lock == true){
return;
};
_local2 = _arg1.m_jointList;
while (_local2) {
_local4 = _local2;
_local2 = _local2.next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeJoint(_local4.joint);
};
DestroyJoint(_local4.joint);
};
_local3 = _arg1.m_shapeList;
while (_local3) {
_local5 = _local3;
_local3 = _local3.m_next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeShape(_local5);
};
_local5.DestroyProxy(m_broadPhase);
b2Shape.Destroy(_local5, m_blockAllocator);
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_bodyList){
m_bodyList = _arg1.m_next;
};
m_bodyCount--;
}
public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{
var _local5:b2Color;
var _local6:b2CircleShape;
var _local7:b2Vec2;
var _local8:Number;
var _local9:b2Vec2;
var _local10:int;
var _local11:b2PolygonShape;
var _local12:int;
var _local13:Array;
var _local14:Array;
var _local15:Array;
_local5 = s_coreColor;
switch (_arg1.m_type){
case b2Shape.e_circleShape:
_local6 = (_arg1 as b2CircleShape);
_local7 = b2Math.b2MulX(_arg2, _local6.m_localPosition);
_local8 = _local6.m_radius;
_local9 = _arg2.R.col1;
m_debugDraw.DrawSolidCircle(_local7, _local8, _local9, _arg3);
if (_arg4){
m_debugDraw.DrawCircle(_local7, (_local8 - b2Settings.b2_toiSlop), _local5);
};
break;
case b2Shape.e_polygonShape:
_local11 = (_arg1 as b2PolygonShape);
_local12 = _local11.GetVertexCount();
_local13 = _local11.GetVertices();
_local14 = new Array(b2Settings.b2_maxPolygonVertices);
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local13[_local10]);
_local10++;
};
m_debugDraw.DrawSolidPolygon(_local14, _local12, _arg3);
if (_arg4){
_local15 = _local11.GetCoreVertices();
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local15[_local10]);
_local10++;
};
m_debugDraw.DrawPolygon(_local14, _local12, _local5);
};
break;
};
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function SetContactFilter(_arg1:b2ContactFilter):void{
m_contactFilter = _arg1;
}
public function Solve(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Island;
var _local4:b2Contact;
var _local5:b2Joint;
var _local6:int;
var _local7:Array;
var _local8:b2Body;
var _local9:int;
var _local10:int;
var _local11:b2Body;
var _local12:b2ContactEdge;
var _local13:b2JointEdge;
var _local14:Boolean;
m_positionIterationCount = 0;
_local3 = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator, m_contactListener);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2 = _local2.m_next;
};
_local4 = m_contactList;
while (_local4) {
_local4.m_flags = (_local4.m_flags & ~(b2Contact.e_islandFlag));
_local4 = _local4.m_next;
};
_local5 = m_jointList;
while (_local5) {
_local5.m_islandFlag = false;
_local5 = _local5.m_next;
};
_local6 = m_bodyCount;
_local7 = new Array(_local6);
_local8 = m_bodyList;
while (_local8) {
if ((_local8.m_flags & ((b2Body.e_islandFlag | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){
} else {
if (_local8.IsStatic()){
} else {
_local3.Clear();
_local9 = 0;
var _temp1 = _local9;
_local9 = (_local9 + 1);
var _local15 = _temp1;
_local7[_local15] = _local8;
_local8.m_flags = (_local8.m_flags | b2Body.e_islandFlag);
while (_local9 > 0) {
--_local9;
_local2 = _local7[_local9];
_local3.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local12 = _local2.m_contactList;
while (_local12) {
if ((_local12.contact.m_flags & (b2Contact.e_islandFlag | b2Contact.e_nonSolidFlag))){
} else {
if (_local12.contact.m_manifoldCount == 0){
} else {
_local3.AddContact(_local12.contact);
_local12.contact.m_flags = (_local12.contact.m_flags | b2Contact.e_islandFlag);
_local11 = _local12.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp2 = _local9;
_local9 = (_local9 + 1);
var _local16 = _temp2;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
};
_local12 = _local12.next;
};
_local13 = _local2.m_jointList;
while (_local13) {
if (_local13.joint.m_islandFlag == true){
} else {
_local3.AddJoint(_local13.joint);
_local13.joint.m_islandFlag = true;
_local11 = _local13.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp3 = _local9;
_local9 = (_local9 + 1);
_local16 = _temp3;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
_local13 = _local13.next;
};
};
};
_local3.Solve(_arg1, m_gravity, m_positionCorrection, m_allowSleep);
if (_local3.m_positionIterationCount > m_positionIterationCount){
m_positionIterationCount = _local3.m_positionIterationCount;
};
_local10 = 0;
while (_local10 < _local3.m_bodyCount) {
_local2 = _local3.m_bodies[_local10];
if (_local2.IsStatic()){
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
};
_local10++;
};
};
};
_local8 = _local8.m_next;
};
_local2 = m_bodyList;
while (_local2) {
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local14 = _local2.SynchronizeShapes();
if ((((_local14 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
};
};
_local2 = _local2.m_next;
};
m_broadPhase.Commit();
}
public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{
var _local4:Array;
var _local5:int;
var _local6:int;
_local4 = new Array(_arg3);
_local5 = m_broadPhase.QueryAABB(_arg1, _local4, _arg3);
_local6 = 0;
while (_local6 < _local5) {
_arg2[_local6] = _local4[_local6];
_local6++;
};
return (_local5);
}
public function GetContactCount():int{
return (m_contactCount);
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactEdge;
var _local8:b2Island;
var _local9:int;
var _local10:Array;
var _local11:b2Contact;
var _local12:b2Contact;
var _local13:Number;
var _local14:b2Body;
var _local15:int;
var _local16:b2TimeStep;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:b2Body;
var _local21:Boolean;
_local8 = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener);
_local9 = m_bodyCount;
_local10 = new Array(_local9);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2.m_sweep.t0 = 0;
_local2 = _local2.m_next;
};
_local11 = m_contactList;
while (_local11) {
_local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local11 = _local11.m_next;
};
while (true) {
_local12 = null;
_local13 = 1;
_local11 = m_contactList;
for (;_local11;(_local11 = _local11.m_next)) {
if ((_local11.m_flags & (b2Contact.e_slowFlag | b2Contact.e_nonSolidFlag))){
} else {
_local18 = 1;
if ((_local11.m_flags & b2Contact.e_toiFlag)){
_local18 = _local11.m_toi;
} else {
_local3 = _local11.m_shape1;
_local4 = _local11.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((((_local5.IsStatic()) || (_local5.IsSleeping()))) && (((_local6.IsStatic()) || (_local6.IsSleeping()))))){
continue;
};
_local19 = _local5.m_sweep.t0;
if (_local5.m_sweep.t0 < _local6.m_sweep.t0){
_local19 = _local6.m_sweep.t0;
_local5.m_sweep.Advance(_local19);
} else {
if (_local6.m_sweep.t0 < _local5.m_sweep.t0){
_local19 = _local5.m_sweep.t0;
_local6.m_sweep.Advance(_local19);
};
};
_local18 = b2TimeOfImpact.TimeOfImpact(_local11.m_shape1, _local5.m_sweep, _local11.m_shape2, _local6.m_sweep);
if ((((_local18 > 0)) && ((_local18 < 1)))){
_local18 = (((1 - _local18) * _local19) + _local18);
if (_local18 > 1){
_local18 = 1;
};
};
_local11.m_toi = _local18;
_local11.m_flags = (_local11.m_flags | b2Contact.e_toiFlag);
};
if ((((Number.MIN_VALUE < _local18)) && ((_local18 < _local13)))){
_local12 = _local11;
_local13 = _local18;
};
};
};
if ((((_local12 == null)) || (((1 - (100 * Number.MIN_VALUE)) < _local13)))){
break;
};
_local3 = _local12.m_shape1;
_local4 = _local12.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local5.Advance(_local13);
_local6.Advance(_local13);
_local12.Update(m_contactListener);
_local12.m_flags = (_local12.m_flags & ~(b2Contact.e_toiFlag));
if (_local12.m_manifoldCount == 0){
} else {
_local14 = _local5;
if (_local14.IsStatic()){
_local14 = _local6;
};
_local8.Clear();
_local15 = 0;
var _temp1 = _local15;
_local15 = (_local15 + 1);
var _local22 = _temp1;
_local10[_local22] = _local14;
_local14.m_flags = (_local14.m_flags | b2Body.e_islandFlag);
while (_local15 > 0) {
--_local15;
_local2 = _local10[_local15];
_local8.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local7 = _local2.m_contactList;
while (_local7) {
if (_local8.m_contactCount == _local8.m_contactCapacity){
} else {
if ((_local7.contact.m_flags & ((b2Contact.e_islandFlag | b2Contact.e_slowFlag) | b2Contact.e_nonSolidFlag))){
} else {
if (_local7.contact.m_manifoldCount == 0){
} else {
_local8.AddContact(_local7.contact);
_local7.contact.m_flags = (_local7.contact.m_flags | b2Contact.e_islandFlag);
_local20 = _local7.other;
if ((_local20.m_flags & b2Body.e_islandFlag)){
} else {
if (_local20.IsStatic() == false){
_local20.Advance(_local13);
_local20.WakeUp();
};
var _temp2 = _local15;
_local15 = (_local15 + 1);
var _local23 = _temp2;
_local10[_local23] = _local20;
_local20.m_flags = (_local20.m_flags | b2Body.e_islandFlag);
};
};
};
};
_local7 = _local7.next;
};
};
};
_local16 = new b2TimeStep();
_local16.dt = ((1 - _local13) * _arg1.dt);
_local16.inv_dt = (1 / _local16.dt);
_local16.maxIterations = _arg1.maxIterations;
_local8.SolveTOI(_local16);
_local17 = 0;
while (_local17 < _local8.m_bodyCount) {
_local2 = _local8.m_bodies[_local17];
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local21 = _local2.SynchronizeShapes();
if ((((_local21 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
_local7 = _local2.m_contactList;
while (_local7) {
_local7.contact.m_flags = (_local7.contact.m_flags & ~(b2Contact.e_toiFlag));
_local7 = _local7.next;
};
};
};
_local17++;
};
_local17 = 0;
while (_local17 < _local8.m_contactCount) {
_local11 = _local8.m_contacts[_local17];
_local8.m_contacts[_local17].m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local17++;
};
m_broadPhase.Commit();
};
};
}
public function GetJointList():b2Joint{
return (m_jointList);
}
public function SetGravity(_arg1:b2Vec2):void{
m_gravity = _arg1;
}
public function Validate():void{
m_broadPhase.Validate();
}
public function GetPairCount():int{
return (m_broadPhase.m_pairManager.m_pairCount);
}
public function GetBodyList():b2Body{
return (m_bodyList);
}
public function SetWarmStarting(_arg1:Boolean):void{
m_warmStarting = _arg1;
}
public function SetPositionCorrection(_arg1:Boolean):void{
m_positionCorrection = _arg1;
}
public function CreateJoint(_arg1:b2JointDef):b2Joint{
var _local2:b2Joint;
var _local3:b2Body;
var _local4:b2Shape;
_local2 = b2Joint.Create(_arg1, m_blockAllocator);
_local2.m_prev = null;
_local2.m_next = m_jointList;
if (m_jointList){
m_jointList.m_prev = _local2;
};
m_jointList = _local2;
m_jointCount++;
_local2.m_node1.joint = _local2;
_local2.m_node1.other = _local2.m_body2;
_local2.m_node1.prev = null;
_local2.m_node1.next = _local2.m_body1.m_jointList;
if (_local2.m_body1.m_jointList){
_local2.m_body1.m_jointList.prev = _local2.m_node1;
};
_local2.m_body1.m_jointList = _local2.m_node1;
_local2.m_node2.joint = _local2;
_local2.m_node2.other = _local2.m_body1;
_local2.m_node2.prev = null;
_local2.m_node2.next = _local2.m_body2.m_jointList;
if (_local2.m_body2.m_jointList){
_local2.m_body2.m_jointList.prev = _local2.m_node2;
};
_local2.m_body2.m_jointList = _local2.m_node2;
if (_arg1.collideConnected == false){
_local3 = ((_arg1.body1.m_shapeCount < _arg1.body2.m_shapeCount)) ? _arg1.body1 : _arg1.body2;
_local4 = _local3.m_shapeList;
while (_local4) {
_local4.RefilterProxy(m_broadPhase, _local3.m_xf);
_local4 = _local4.m_next;
};
};
return (_local2);
}
public function DestroyJoint(_arg1:b2Joint):void{
var _local2:Boolean;
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Body;
var _local6:b2Shape;
_local2 = _arg1.m_collideConnected;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_jointList){
m_jointList = _arg1.m_next;
};
_local3 = _arg1.m_body1;
_local4 = _arg1.m_body2;
_local3.WakeUp();
_local4.WakeUp();
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local3.m_jointList){
_local3.m_jointList = _arg1.m_node1.next;
};
_arg1.m_node1.prev = null;
_arg1.m_node1.next = null;
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local4.m_jointList){
_local4.m_jointList = _arg1.m_node2.next;
};
_arg1.m_node2.prev = null;
_arg1.m_node2.next = null;
b2Joint.Destroy(_arg1, m_blockAllocator);
m_jointCount--;
if (_local2 == false){
_local5 = ((_local3.m_shapeCount < _local4.m_shapeCount)) ? _local3 : _local4;
_local6 = _local5.m_shapeList;
while (_local6) {
_local6.RefilterProxy(m_broadPhase, _local5.m_xf);
_local6 = _local6.m_next;
};
};
}
public function SetContactListener(_arg1:b2ContactListener):void{
m_contactListener = _arg1;
}
public function Raycast(_arg1:b2Segment, _arg2:Array, _arg3:int, _arg4):int{
var _local5:Array;
var _local6:int;
var _local7:int;
_local5 = new Array(_arg3);
m_raycastSegment = _arg1;
m_raycastUserData = _arg4;
_local6 = m_broadPhase.QuerySegment(_arg1, _local5, _arg3, RaycastSortKey);
_local7 = 0;
while (_local7 < _local6) {
_arg2[_local7] = _local5[_local7];
_local7++;
};
return (_local6);
}
public function RaycastOne(_arg1:b2Segment, _arg2:Array, _arg3:b2Vec2, _arg4):b2Shape{
var _local5:Array;
var _local6:Number;
var _local7:b2Shape;
var _local8:b2XForm;
_local5 = new Array(1);
_local6 = Raycast(_arg1, _local5, 1, _arg4);
if (_local6 == 0){
return (null);
};
if (_local6 > 1){
trace(_local6);
};
_local7 = _local5[0];
_local8 = _local7.GetBody().GetXForm();
_local7.TestSegment(_local8, _arg2, _arg3, _arg1, 1);
return (_local7);
}
public function CreateBody(_arg1:b2BodyDef):b2Body{
var _local2:b2Body;
if (m_lock == true){
return (null);
};
_local2 = new b2Body(_arg1, this);
_local2.m_prev = null;
_local2.m_next = m_bodyList;
if (m_bodyList){
m_bodyList.m_prev = _local2;
};
m_bodyList = _local2;
m_bodyCount++;
return (_local2);
}
public function RaycastSortKey(_arg1:b2Shape){
var _local2:b2Body;
var _local3:b2XForm;
var _local4:Array;
if (((m_contactFilter) && (!(m_contactFilter.RayCollide(m_raycastUserData, _arg1))))){
return (-1);
};
_local2 = _arg1.GetBody();
_local3 = _local2.GetXForm();
_local4 = [0];
if (!_arg1.TestSegment(_local3, _local4, m_raycastNormal, m_raycastSegment, 1)){
return (-1);
};
return (_local4[0]);
}
public function SetBoundaryListener(_arg1:b2BoundaryListener):void{
m_boundaryListener = _arg1;
}
public function SetDestructionListener(_arg1:b2DestructionListener):void{
m_destructionListener = _arg1;
}
public function Step(_arg1:Number, _arg2:int):void{
var _local3:b2TimeStep;
m_lock = true;
_local3 = new b2TimeStep();
_local3.dt = _arg1;
_local3.maxIterations = _arg2;
if (_arg1 > 0){
_local3.inv_dt = (1 / _arg1);
} else {
_local3.inv_dt = 0;
};
_local3.dtRatio = (m_inv_dt0 * _arg1);
_local3.positionCorrection = m_positionCorrection;
_local3.warmStarting = m_warmStarting;
m_contactManager.Collide();
if (_local3.dt > 0){
Solve(_local3);
};
if (((m_continuousPhysics) && ((_local3.dt > 0)))){
SolveTOI(_local3);
};
DrawDebugData();
m_inv_dt0 = _local3.inv_dt;
m_lock = false;
}
public function GetBodyCount():int{
return (m_bodyCount);
}
public function GetJointCount():int{
return (m_jointCount);
}
}
}//package Box2D.Dynamics
Section 75
//assets_28 (CycloManiacs_fla.assets_28)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class assets_28 extends MovieClip {
public var rick:GameCompleteScreen;
public function assets_28(){
addFrameScript(0, frame1);
}
function frame1(){
rick.stop();
this.visible = false;
}
}
}//package CycloManiacs_fla
Section 76
//bubble_logo3_24 (CycloManiacs_fla.bubble_logo3_24)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class bubble_logo3_24 extends MovieClip {
public function bubble_logo3_24(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package CycloManiacs_fla
Section 77
//BubbleBoxLogoGraphicMc_26 (CycloManiacs_fla.BubbleBoxLogoGraphicMc_26)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class BubbleBoxLogoGraphicMc_26 extends MovieClip {
public var play_latest_text:MovieClip;
}
}//package CycloManiacs_fla
Section 78
//BubbleBoxSplash_22 (CycloManiacs_fla.BubbleBoxSplash_22)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class BubbleBoxSplash_22 extends MovieClip {
public var link:MovieClip;
public var play_latest_text:MovieClip;
public function BubbleBoxSplash_22(){
addFrameScript(0, frame1, 150, frame151, 160, frame161);
}
function frame151(){
MovieClip(parent).stop();
}
function frame161(){
stop();
MovieClip(parent).play();
}
function frame1(){
}
}
}//package CycloManiacs_fla
Section 79
//characters_244 (CycloManiacs_fla.characters_244)
package CycloManiacs_fla {
import flash.display.*;
import flash.text.*;
public dynamic class characters_244 extends MovieClip {
public var bikerName:TextField;
public var characterLock:MovieClip;
public var horn:MovieClip;
public var chosenBox:MovieClip;
}
}//package CycloManiacs_fla
Section 80
//flash_412 (CycloManiacs_fla.flash_412)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class flash_412 extends MovieClip {
public function flash_412(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package CycloManiacs_fla
Section 81
//Kongintro30fps_6 (CycloManiacs_fla.Kongintro30fps_6)
package CycloManiacs_fla {
import flash.events.*;
import flash.display.*;
public dynamic class Kongintro30fps_6 extends MovieClip {
public function Kongintro30fps_6(){
addFrameScript(1, frame2, 198, frame199);
}
function frame199(){
trace("stopping kong intro");
stop();
MovieClip(parent).play();
}
function frame2(){
addEventListener(MouseEvent.CLICK, TitleScreenState.buttonKongregatePressed);
trace("starting kong intro");
}
}
}//package CycloManiacs_fla
Section 82
//level1_271 (CycloManiacs_fla.level1_271)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class level1_271 extends MovieClip {
public var newlevel:MovieClip;
public var lock:MovieClip;
public var selectedMC:MovieClip;
}
}//package CycloManiacs_fla
Section 83
//levelBack_320 (CycloManiacs_fla.levelBack_320)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class levelBack_320 extends MovieClip {
public function levelBack_320(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package CycloManiacs_fla
Section 84
//LevelSelectButton_321 (CycloManiacs_fla.LevelSelectButton_321)
package CycloManiacs_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LevelSelectButton_321 extends MovieClip {
public var newlevel:MovieClip;
public var medal1:MovieClip;
public var medal2:MovieClip;
public var lock:MovieClip;
public var selectedOutline:MovieClip;
public var medal0:MovieClip;
public var textLevelNumber:TextField;
public var overOutline:MovieClip;
}
}//package CycloManiacs_fla
Section 85
//MainTimeline (CycloManiacs_fla.MainTimeline)
package CycloManiacs_fla {
import flash.events.*;
import flash.display.*;
public dynamic class MainTimeline extends MovieClip {
public var bubbleBoxIntro:MovieClip;
public var playBubbleBoxIntro:Boolean;
public var kongIntro:MovieClip;
public var playKongIntro:Boolean;
public var r:Number;
public var playArmorIntro:Boolean;
public var preloaderMC:MovieClip;
public var domain:String;
public var andkonIntro:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1, 5, frame6, 17, frame18);
}
public function myloading(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = stage.loaderInfo.bytesTotal;
_local3 = stage.loaderInfo.bytesLoaded;
_local4 = Math.round(((_local3 * 100) / _local2));
preloaderMC.gotoAndPlay(_local4);
if (_local3 >= _local2){
preloaderMC.stop();
removeEventListener(Event.ENTER_FRAME, myloading);
};
}
function frame18(){
if (preloaderMC != null){
removeChild(preloaderMC);
preloaderMC = null;
};
if (andkonIntro != null){
removeChild(andkonIntro);
andkonIntro = null;
};
if (kongIntro != null){
removeChild(kongIntro);
kongIntro = null;
};
if (bubbleBoxIntro != null){
removeChild(bubbleBoxIntro);
bubbleBoxIntro = null;
};
stop();
}
function frame6(){
if (playKongIntro){
stop();
kongIntro.visible = true;
kongIntro.gotoAndPlay(1);
};
if (playBubbleBoxIntro){
stop();
bubbleBoxIntro.visible = true;
bubbleBoxIntro.gotoAndPlay(1);
};
}
function frame1(){
kongIntro.visible = false;
kongIntro.stop();
bubbleBoxIntro.visible = false;
bubbleBoxIntro.stop();
andkonIntro.visible = false;
domain = Domain.GetDomain(this);
playKongIntro = false;
playBubbleBoxIntro = false;
playArmorIntro = false;
addEventListener(Event.ENTER_FRAME, myloading);
if ((((((((((((((((((((domain == "addictinggames.com")) || ((domain == "kaisergames.de")))) || ((domain == "bubblebox.com")))) || ((domain == "agame.com")))) || ((domain == "game.asia")))) || ((domain == "andkon.com")))) || ((domain == "sikids.com")))) || ((domain == "shockwave.com")))) || ((domain == "armorgames.com")))) || ((domain == "timeforkids.com")))){
if (domain == "andkon.com"){
andkonIntro.visible = true;
gotoAndPlay(10);
} else {
if (domain == "sikids.com"){
playKongIntro = false;
gotoAndPlay(10);
} else {
if (domain == "timeforkids.com"){
playKongIntro = false;
gotoAndPlay(10);
} else {
if (domain == "addictinggames.com"){
playKongIntro = false;
gotoAndPlay(10);
} else {
if (domain == "bubblebox.com"){
playBubbleBoxIntro = true;
gotoAndPlay(10);
} else {
if (domain == "armorgames.com"){
playArmorIntro = true;
gotoAndPlay(10);
} else {
if (domain == "agame.com"){
playKongIntro = true;
gotoAndPlay(10);
} else {
if (domain == "game.asia"){
playKongIntro = true;
gotoAndPlay(10);
} else {
if (domain == "shockwave.com"){
playKongIntro = false;
gotoAndPlay(10);
} else {
playKongIntro = true;
gotoAndPlay(2);
};
};
};
};
};
};
};
};
};
} else {
playKongIntro = true;
r = Math.random();
if (domain != "kongregate.com"){
if (r <= 0.5){
MochiAd.showPreGameAd({clip:root, id:"f26b6fbcebd54ddc", res:"640x480"});
} else {
MochiAd.showPreGameAd({clip:root, id:"586b0fe2dad8b359", res:"640x480"});
};
};
};
}
}
}//package CycloManiacs_fla
Section 86
//sponsorbar_248 (CycloManiacs_fla.sponsorbar_248)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class sponsorbar_248 extends MovieClip {
public var buttonLogoBubbleBox:SimpleButton;
public var background:MovieClip;
public var buttonLogoSIKids:SimpleButton;
public var buttonMoreGames:SimpleButton;
public var buttonAndkonArcade:SimpleButton;
public var buttonLogoAndkon:SimpleButton;
public var buttonLogoKongregate:SimpleButton;
public var buttonCheats:SimpleButton;
}
}//package CycloManiacs_fla
Section 87
//Symbol1_345 (CycloManiacs_fla.Symbol1_345)
package CycloManiacs_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Symbol1_345 extends MovieClip {
public var textTitle:TextField;
}
}//package CycloManiacs_fla
Section 88
//Symbol2_346 (CycloManiacs_fla.Symbol2_346)
package CycloManiacs_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Symbol2_346 extends MovieClip {
public var textTime:TextField;
}
}//package CycloManiacs_fla
Section 89
//Symbol3_347 (CycloManiacs_fla.Symbol3_347)
package CycloManiacs_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Symbol3_347 extends MovieClip {
public var textCash:TextField;
}
}//package CycloManiacs_fla
Section 90
//Symbol4_348 (CycloManiacs_fla.Symbol4_348)
package CycloManiacs_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Symbol4_348 extends MovieClip {
public var textStat0:TextField;
}
}//package CycloManiacs_fla
Section 91
//Symbol5_349 (CycloManiacs_fla.Symbol5_349)
package CycloManiacs_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Symbol5_349 extends MovieClip {
public var textStat1:TextField;
}
}//package CycloManiacs_fla
Section 92
//Symbol6_350 (CycloManiacs_fla.Symbol6_350)
package CycloManiacs_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Symbol6_350 extends MovieClip {
public var textStat2:TextField;
}
}//package CycloManiacs_fla
Section 93
//Symbol7_351 (CycloManiacs_fla.Symbol7_351)
package CycloManiacs_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Symbol7_351 extends MovieClip {
public var textStat3:TextField;
}
}//package CycloManiacs_fla
Section 94
//Symbol8_352 (CycloManiacs_fla.Symbol8_352)
package CycloManiacs_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Symbol8_352 extends MovieClip {
public var textStat4:TextField;
}
}//package CycloManiacs_fla
Section 95
//text1_406 (CycloManiacs_fla.text1_406)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class text1_406 extends MovieClip {
public function text1_406(){
addFrameScript(74, frame75);
}
function frame75(){
stop();
}
}
}//package CycloManiacs_fla
Section 96
//Text2_408 (CycloManiacs_fla.Text2_408)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class Text2_408 extends MovieClip {
public function Text2_408(){
addFrameScript(99, frame100);
}
function frame100(){
stop();
}
}
}//package CycloManiacs_fla
Section 97
//Text3_410 (CycloManiacs_fla.Text3_410)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class Text3_410 extends MovieClip {
public function Text3_410(){
addFrameScript(129, frame130);
}
function frame130(){
stop();
}
}
}//package CycloManiacs_fla
Section 98
//upgradeLine_328 (CycloManiacs_fla.upgradeLine_328)
package CycloManiacs_fla {
import flash.display.*;
import flash.text.*;
public dynamic class upgradeLine_328 extends MovieClip {
public var lv6:MovieClip;
public var lv5:MovieClip;
public var lv10:MovieClip;
public var textName:TextField;
public var buttonUpgrade:SimpleButton;
public var textCost:TextField;
public var lv2:MovieClip;
public var lv3:MovieClip;
public var lv7:MovieClip;
public var lv1:MovieClip;
public var lv9:MovieClip;
public var lv4:MovieClip;
public var lv8:MovieClip;
}
}//package CycloManiacs_fla
Section 99
//worldselectCloud1_269 (CycloManiacs_fla.worldselectCloud1_269)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class worldselectCloud1_269 extends MovieClip {
public var rand:Number;
public function worldselectCloud1_269(){
addFrameScript(0, frame1, 1034, frame1035);
}
function frame1(){
rand = Math.round((Math.random() * 300));
gotoAndPlay(rand);
}
function frame1035(){
gotoAndPlay(2);
}
}
}//package CycloManiacs_fla
Section 100
//worldSelectCloud2_264 (CycloManiacs_fla.worldSelectCloud2_264)
package CycloManiacs_fla {
import flash.display.*;
public dynamic class worldSelectCloud2_264 extends MovieClip {
public var rand:Number;
public function worldSelectCloud2_264(){
addFrameScript(0, frame1, 599, frame600);
}
function frame600(){
gotoAndPlay(2);
}
function frame1(){
rand = Math.round((Math.random() * 300));
gotoAndPlay(rand);
}
}
}//package CycloManiacs_fla
Section 101
//Achievement (Achievement)
package {
public class Achievement {
var testFunction:String;
var name:String;
var testFunctionParams:String;
var completeFunction:String;
var completeFunctionParams:String;
var complete:Boolean;
var description:String;
var specificLevel:int;
public function Achievement(){
name = "undefined";
description = "undefined";
complete = false;
testFunction = null;
completeFunction = null;
completeFunctionParams = null;
testFunctionParams = null;
specificLevel = -1;
}
}
}//package
Section 102
//AchievementBox (AchievementBox)
package {
import flash.display.*;
import flash.text.*;
public dynamic class AchievementBox extends MovieClip {
public var medalover:MovieClip;
public var selectedClip:MovieClip;
public var tick:MovieClip;
public var textNumber:TextField;
}
}//package
Section 103
//Achievements (Achievements)
package {
public class Achievements {
public var unlockedList:Array;
public var list:Array;
public function Achievements(){
trace("INITIALISING ACHIEVEMENTS");
list = new Array();
unlockedList = new Array();
Add(1, "&Level1 Timetrial", "Finish in 60 seconds to unlock &Level2", "AchTest_FinishLevel", "-1,1,60", "AchPass_UnlockLevel", "2");
Add(1, "&Level1 Backward Somersault Challenge", "Complete 2 backward somersaults to unlock &Level16", "AchTest_BackwardSomersault", "-1,1,2", "AchPass_UnlockLevel", "16");
Add(1, "&Level1 Air Time Challenge", "Get 5 seconds of air time to unlock &Bike1 Horn", "AchTest_AirTime", "-1,1,5", "AchPass_UnlockHorn", "1");
Add(2, "&Level2 Race", "Finish in the top 5 places to unlock &Level3", "AchTest_Place", "-1,2,5", "AchPass_UnlockLevel", "3");
Add(2, "&Level2 Pickups", "Collect 30 pickups to unlock &Bike2", "AchTest_Pickups", "-1,2,30", "AchPass_UnlockBike", "2");
Add(2, "&Level2 More Pickups", "Collect 40 pickups to unlock &Bike2 Horn", "AchTest_Pickups", "-1,2,40", "AchPass_UnlockHorn", "2");
Add(3, "&Level3 Timetrial", "Complete &Level3 in 90 seconds to unlock &Level21", "AchTest_FinishLevel", "-1,3,90", "AchPass_UnlockLevel", "21");
Add(3, "&Level3 Booster", "Reach level 3 boost to unlock &Bike4", "AchTest_BoostLevel", "-1,3,3", "AchPass_UnlockBike", "4");
Add(3, "&Level3 Air Time Challenge", "Get 20 seconds of air time to unlock &Bike4 Horn", "AchTest_AirTime", "-1,3,20", "AchPass_UnlockHorn", "4");
Add(4, "&Level4 Timetrial", "Finish in 90 seconds to unlock &Level5", "AchTest_FinishLevel", "-1,4,90", "AchPass_UnlockLevel", "5");
Add(4, "&Level4 Air Time Challenge", "Get 20 seconds of air time to unlock &Bike17", "AchTest_AirTime", "-1,4,20", "AchPass_UnlockBike", "17");
Add(4, "&Level4 Booster", "Reach Level 4 boost to unlock &Bike17 Horn", "AchTest_BoostLevel", "-1,4,4", "AchPass_UnlockHorn", "17");
Add(5, "&Level5 Challenge", "Don't get caught by the bubble", "AchTest_Place", "-1,5,1", "AchPass_BonusLevel", "");
Add(6, "&Level6 Booster", "Reach Level 1 boost to unlock &Level7", "AchTest_BoostLevel", "-1,6,1", "AchPass_UnlockLevel", "7");
Add(6, "&Level6 Race", "Finish in 3rd place or better unlock &Bike14", "AchTest_Place", "-1,6,3", "AchPass_UnlockBike", "14");
Add(6, "&Level6 Pickups", "Collect 75 pickups to unlock &Bike14 Horn", "AchTest_Pickups", "-1,6,75", "AchPass_UnlockHorn", "14");
Add(7, "&Level7 Race", "Finish in 3rd place or better to unlock &Level4", "AchTest_Place", "-1,7,3", "AchPass_UnlockLevel", "4");
Add(7, "&Level7 Wheelie Challenge", "Total 10 seconds of rear wheelie to unlock &Level11", "AchTest_TotalRearWheelie", "-1,7,10", "AchPass_UnlockLevel", "11");
Add(7, "&Level7 Air Time Challenge", "Get 15 seconds of air time to unlock &Bike9", "AchTest_AirTime", "-1,7,15", "AchPass_UnlockBike", "9");
Add(8, "&Level8 Timetrial", "Complete &Level8 in 70 seconds to unlock &Level9", "AchTest_FinishLevel", "-1,8,70", "AchPass_UnlockLevel", "9");
Add(8, "&Level8 Survival", "Don't crash to unlock &Bike11", "AchTest_Crash", "-1,8,0", "AchPass_UnlockBike", "11");
Add(8, "&Level8 Air Time Challenge", "Get 15 seconds of air time to unlock &Bike11 Horn", "AchTest_AirTime", "-1,8,15", "AchPass_UnlockHorn", "11");
Add(9, "&Level9 Race", "Finish in 3rd place or better to unlock &Level10", "AchTest_Place", "-1,9,3", "AchPass_UnlockLevel", "10");
Add(9, "&Level9 Air Time Challenge", "Get 30 seconds of air time to unlock &Bike20", "AchTest_AirTime", "-1,9,30", "AchPass_UnlockBike", "20");
Add(9, "&Level9 Booster", "Reach level 5 boost to unlock &Bike20 Horn", "AchTest_BoostLevel", "-1,9,5", "AchPass_UnlockHorn", "20");
Add(10, "&Level10 Challenge", "Stay ahead of the wall of fire", "AchTest_Place", "-1,10,1", "AchPass_BonusLevel", "");
Add(11, "&Level11 Race", "Finish in 3rd place or better to unlock &Level12", "AchTest_Place", "-1,11,3", "AchPass_UnlockLevel", "12");
Add(11, "&Level11 Air Time Challenge", "Get 10 seconds of air time to unlock &Bike7", "AchTest_AirTime", "-1,11,10", "AchPass_UnlockBike", "7");
Add(11, "&Level11 Pickups", "Collect 43 pickups to unlock &Bike7 Horn", "AchTest_Pickups", "-1,11,43", "AchPass_UnlockHorn", "7");
Add(12, "&Level12 Timetrial", "Finish in under 60 seconds to unlock &Level13", "AchTest_FinishLevel", "-1,12,60", "AchPass_UnlockLevel", "13");
Add(12, "&Level12 Rear Wheelie Challenge", "Rear wheelie for 10 seconds to unlock &Level18", "AchTest_TotalRearWheelie", "-1,12,10", "AchPass_UnlockLevel", "18");
Add(12, "&Level12 Front Wheelie Challenge", "Front wheelie for 5 seconds to unlock &Bike13", "AchTest_TotalFrontWheelie", "-1,12,5", "AchPass_UnlockBike", "13");
Add(13, "&Level13 Race", "Finish in 2nd place or better to unlock &Level19", "AchTest_Place", "-1,13,2", "AchPass_UnlockLevel", "19");
Add(13, "&Level13 Pickups", "Collect 46 pickups to unlock &Bike19", "AchTest_Pickups", "-1,13,46", "AchPass_UnlockBike", "19");
Add(13, "&Level13 Air Time Challenge", "Get 20 seconds of air time to unlock &Bike19 Horn", "AchTest_AirTime", "-1,13,20", "AchPass_UnlockHorn", "19");
Add(14, "&Level14 Timetrial", "Finish in under 50 seconds to unlock &Level20", "AchTest_FinishLevel", "-1,14,50", "AchPass_UnlockLevel", "20");
Add(14, "&Level14 Pickups", "Collect 47 pickups to unlock &Bike15", "AchTest_Pickups", "-1,14,47", "AchPass_UnlockBike", "15");
Add(14, "&Level14 Air Time Challenge", "Get a sneaky start to unlock &Bike15 Horn", "AchTest_SneakyStart", "-1,14", "AchPass_UnlockHorn", "15");
Add(15, "&Level15 Challenge", "Don't let the piano catch you.", "AchTest_Place", "-1,15,1", "AchPass_BonusLevel", "");
Add(16, "&Level16 Timetrial", "Finish in 45 seconds to unlock &Level17", "AchTest_FinishLevel", "-1,16,45", "AchPass_UnlockLevel", "17");
Add(16, "&Level16 Crash Test", "Don't crash to unlock &Bike3", "AchTest_Crash", "-1,16,0", "AchPass_UnlockBike", "3");
Add(16, "&Level16 Wheelie Challenge", "Total 5 seconds of rear wheelie to unlock &Bike3 Horn", "AchTest_TotalRearWheelie", "-1,16,5", "AchPass_UnlockHorn", "3");
Add(17, "&Level17 Timetrial", "Finish in 60 seconds to unlock &Level6", "AchTest_FinishLevel", "-1,17,60", "AchPass_UnlockLevel", "6");
Add(17, "&Level17 Forward Somersaults", "Complete 5 forward somersaults to unlock &Bike18", "AchTest_ForwardSomersault", "-1,17,5", "AchPass_UnlockBike", "18");
Add(17, "&Level17 Air Time Challenge", "Get 20 seconds of air time to unlock &Bike18 Horn", "AchTest_AirTime", "-1,17,20", "AchPass_UnlockHorn", "18");
Add(18, "&Level18 Race", "Finish in first place to unlock &Level14", "AchTest_Place", "-1,18,1", "AchPass_UnlockLevel", "14");
Add(18, "&Level18 Booster", "Reach level 5 boost to unlock &Bike12", "AchTest_BoostLevel", "-1,18,5", "AchPass_UnlockBike", "12");
Add(18, "&Level18 Front Wheelie Challenge", "Front wheelie for 5 seconds to unlock &Bike12 Horn", "AchTest_TotalFrontWheelie", "-1,18,5", "AchPass_UnlockHorn", "12");
Add(19, "&Level19 Timetrial", "Finish in 60 seconds to unlock &Level15", "AchTest_FinishLevel", "-1,19,60", "AchPass_UnlockLevel", "15");
Add(19, "&Level19 Crash Test", "Don't crash to unlock &Bike8", "AchTest_Crash", "-1,19,0", "AchPass_UnlockBike", "8");
Add(19, "&Level19 Best Jump", "Get a single jump of 3 seconds to unlock &Bike8 Horn", "AchTest_SingleAirTime", "-1,19,3", "AchPass_UnlockHorn", "8");
Add(20, "&Level20 Challenge", "Out run the walrus", "AchTest_Place", "-1,20,1", "AchPass_BonusLevel", "");
Add(21, "&Level21 Timetrial", "Beat 60 seconds to unlock &Level22", "AchTest_FinishLevel", "-1,21,60", "AchPass_UnlockLevel", "22");
Add(21, "&Level21 Double Somersault", "Perform a double somersault to unlock &Level8", "AchTest_MultiSomersault", "-1,21,2", "AchPass_UnlockLevel", "8");
Add(21, "&Level21 Wheelie Challenge", "Total 15 seconds of rear wheelie to unlock &Bike5", "AchTest_TotalRearWheelie", "-1,21,15", "AchPass_UnlockBike", "5");
Add(22, "&Level22 Race", "Finish in 3rd place or better to unlock &Level23", "AchTest_Place", "-1,22,3", "AchPass_UnlockLevel", "23");
Add(22, "&Level22 Back Somersaults", "Perform 15 backward somersaults to unlock &Bike16", "AchTest_BackwardSomersault", "-1,22,15", "AchPass_UnlockBike", "16");
Add(22, "&Level22 Booster", "Reach level 5 boost to unlock &Bike16 Horn", "AchTest_BoostLevel", "-1,22,5", "AchPass_UnlockHorn", "16");
Add(23, "&Level23 Timetrial", "Beat 65 seconds to unlock &Level24", "AchTest_FinishLevel", "-1,23,65", "AchPass_UnlockLevel", "24");
Add(23, "&Level23 Triple Somersault", "Get a triple somersault to unlock &Bike10", "AchTest_MultiSomersault", "-1,23,3", "AchPass_UnlockBike", "10");
Add(23, "&Level23 Wheelie", "Do a single rear wheeleie for 3 seconds to unlock &Bike10 Horn", "AchTest_SingleRearWheelie", "-1,23,3", "AchPass_UnlockHorn", "10");
Add(24, "&Level24 Race", "Finish in 2nd place or better to unlock &Level25", "AchTest_Place", "-1,24,2", "AchPass_UnlockLevel", "25");
Add(24, "&Level24 Air Time Challenge", "Get a massive 40 seconds air time to unlock &Bike6", "AchTest_AirTime", "-1,24,40", "AchPass_UnlockBike", "6");
Add(24, "&Level24 Wheelie", "Total 20 seconds of rear wheelie to unlock &Bike6 Horn", "AchTest_TotalRearWheelie", "-1,24,20", "AchPass_UnlockHorn", "6");
Add(25, "&Level25 Challenge", "Don't get haddocked!", "AchTest_Place", "-1,25,1", "AchPass_BonusLevel", "");
Add(26, "&Level26 Race", "Finish in 1st place to unlock &Bike5 Horn", "AchTest_Place", "-1,26,1", "AchPass_UnlockHorn", "5");
Add(26, "&Level26 Air Time", "Get 60 seconds of air time to unlock &Bike13 Horn", "AchTest_AirTime", "-1,26,60", "AchPass_UnlockHorn", "13");
Add(26, "&Level26 Wheelie", "Do a single rear wheeleie for 10 seconds to unlock &Bike9 Horn", "AchTest_SingleRearWheelie", "-1,26,10", "AchPass_UnlockHorn", "9");
Add(-1, "Bonus Level Challenge", "Beat all the Bonus Levels to unlock &Level26", "AchTest_BonusLevel", "", "AchPass_UnlockLevel", "26");
Add(-1, "Unlock everything", "Complete all achievements to WIN THE GAME", "AchTest_UnlockAll", "", "AchPass_WinGame", "");
}
function AchTest_Place(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = int(_local2[2]);
_local5--;
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.playerRacePosition <= _local5){
return (true);
};
return (false);
}
public function Add(_arg1:int, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:String){
var _local8:Achievement;
_local8 = new Achievement();
_local8.specificLevel = _arg1;
_local8.name = _arg2;
_local8.description = _arg3;
_local8.testFunction = _arg4;
_local8.testFunctionParams = _arg5;
_local8.completeFunction = _arg6;
_local8.completeFunctionParams = _arg7;
list.push(_local8);
}
function AchTest_MultiSomersault(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = int(_local2[2]);
trace(("testing multi somersault " + _local5));
if (_local4 != Game.currentLevel){
return (false);
};
if (_local5 >= Game.highestMultiSomersault){
return (true);
};
return (false);
}
function AchTest_SingleRearWheelie(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Number;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = Number(_local2[2]);
_local5 = (_local5 * Defs.fps);
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.bestRearWheelieTime >= _local5){
return (true);
};
return (false);
}
function AchTest_UnlockAll(_arg1:String):Boolean{
var _local2:int;
var _local3:Achievement;
_local2 = 0;
for each (_local3 in list) {
if (_local3.complete){
_local2++;
};
};
if (_local2 >= (list.length - 1)){
return (true);
};
return (false);
}
public function TestNone(){
unlockedList = new Array();
}
public function CountAchievementsComplete():int{
var _local1:int;
var _local2:Achievement;
_local1 = 0;
for each (_local2 in list) {
if (_local2.complete){
_local1++;
};
};
return (_local1);
}
function AchPass_UnlockBike(_arg1:String):void{
var _local2:Array;
var _local3:int;
var _local4:PlayerBikeData;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
_local3--;
trace(("unlocked bike - " + _local3));
_local4 = PlayerBikes.GetBikeData(_local3);
_local4.available = true;
}
function AchTest_BonusLevel(_arg1:String):Boolean{
var _local2:int;
var _local3:Achievement;
_local2 = 0;
for each (_local3 in list) {
if (_local3.completeFunction == "AchPass_BonusLevel"){
if (_local3.complete){
_local2++;
};
};
};
if (_local2 == 5){
return (true);
};
return (false);
}
function AchPass_Nothing(_arg1:String):void{
}
public function TestAll(){
var _local1:Achievement;
var _local2:Boolean;
unlockedList = new Array();
if ((((Game.playerRacePosition >= 9)) && (!((Game.currentLevel == 25))))){
return;
};
for each (_local1 in list) {
if (_local1.complete == false){
_local2 = this[_local1.testFunction](_local1.testFunctionParams);
if (_local2){
var _local5 = this;
_local5[_local1.completeFunction](_local1.completeFunctionParams);
_local1.complete = true;
unlockedList.push(_local1);
Game.AwardCashForAchievement();
};
};
};
}
function AchTest_SingleAirTime(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Number;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = Number(_local2[2]);
_local5 = (_local5 * Defs.fps);
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.bestSingleAirTime >= _local5){
return (true);
};
return (false);
}
function AchPass_UnlockLevel(_arg1:String):void{
var _local2:Array;
var _local3:int;
var _local4:Level;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
_local3--;
trace(("unlocked level - " + _local3));
_local4 = Game.GetLevel(_local3);
_local4.available = true;
_local4.played = false;
}
public function AllComplete():Boolean{
var _local1:Achievement;
for each (_local1 in list) {
if (_local1.complete == false){
return (false);
};
};
return (true);
}
function AchTest_BackwardSomersault(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Number;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = Number(_local2[2]);
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.levelBackSomersaults >= _local5){
return (true);
};
return (false);
}
public function GetFullString(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=true):String{
var _local4:int;
var _local5:String;
var _local6:Array;
var _local7:String;
var _local8:String;
var _local9:Level;
var _local10:PlayerBikeData;
_local6 = new Array();
_local6 = _arg1.split(" ");
_local7 = "";
for each (_local8 in _local6) {
if (_local8.match("&Level")){
_local5 = _local8.substr(6);
_local4 = int(_local5);
_local9 = Game.levels[(_local4 - 1)];
if (_arg2){
_local8 = (("'" + _local9.name) + "'");
_local7 = (_local7 + _local8);
_local7 = (_local7 + " ");
};
} else {
if (_local8.match("&Bike")){
_local5 = _local8.substr(5);
_local4 = int(_local5);
_local10 = PlayerBikes.GetBikeData((_local4 - 1));
if (_arg3){
_local8 = (("'" + _local10.name) + "'");
_local7 = (_local7 + _local8);
_local7 = (_local7 + " ");
};
} else {
_local7 = (_local7 + _local8);
_local7 = (_local7 + " ");
};
};
};
return (_local7);
}
function AchTest_ForwardSomersault(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Number;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = Number(_local2[2]);
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.levelForwardSomersaults >= _local5){
return (true);
};
return (false);
}
function AchTest_Crash(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = int(_local2[2]);
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.numCrashes <= _local5){
return (true);
};
return (false);
}
function AchPass_WinGame(_arg1:String):void{
trace("Game won");
}
function AchTest_FinishLevel(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:Number;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = Number(_local2[2]);
if (_local4 != Game.currentLevel){
return (false);
};
_local6 = (_local5 * Defs.fps);
if (Game.raceTimer <= _local6){
return (true);
};
return (false);
}
function AchTest_TotalFrontWheelie(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Number;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = Number(_local2[2]);
_local5 = (_local5 * Defs.fps);
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.levelFrontWheelieTime >= _local5){
return (true);
};
return (false);
}
function AchPass_BonusLevel(_arg1:String):void{
trace("Bonus level beaten");
}
function AchPass_UnlockHorn(_arg1:String):void{
var _local2:Array;
var _local3:int;
var _local4:PlayerBikeData;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
_local3--;
trace(("unlocked Horn - " + _local3));
_local4 = PlayerBikes.GetBikeData(_local3);
_local4.bellAvailable = true;
}
function AchTest_AirTime(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Number;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = Number(_local2[2]);
_local5 = (_local5 * Defs.fps);
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.levelAirTime >= _local5){
return (true);
};
return (false);
}
public function GetLevelAchievements(_arg1:int):Array{
var _local2:Array;
var _local3:Achievement;
_arg1++;
_local2 = new Array();
for each (_local3 in list) {
if (_local3.specificLevel == _arg1){
_local2.push(_local3);
};
};
return (_local2);
}
function AchTest_BoostLevel(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = int(_local2[2]);
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.highestBoostLevel >= _local5){
return (true);
};
return (false);
}
function AchTest_TotalRearWheelie(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Number;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = Number(_local2[2]);
_local5 = (_local5 * Defs.fps);
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.levelWheelieTime >= _local5){
return (true);
};
return (false);
}
function AchTest_Pickups(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
_local4--;
_local5 = int(_local2[2]);
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.numPickupsCollected >= _local5){
return (true);
};
return (false);
}
public function GetAchievementIndex(_arg1:Achievement):int{
var _local2:int;
var _local3:Achievement;
_local2 = 0;
for each (_local3 in list) {
if (_local3 == _arg1){
return (_local2);
};
_local2++;
};
return (0);
}
function AchTest_SneakyStart(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
_local2 = _arg1.split(",");
_local3 = int(_local2[0]);
if (_local3 != -1){
if ((_local3 - 1) != Game.currentBikeIndex){
return (false);
};
};
_local4 = int(_local2[1]);
--_local4;
if (_local4 != Game.currentLevel){
return (false);
};
if (Game.gotSneakyStart){
return (true);
};
return (false);
}
}
}//package
Section 104
//AchievementScreen (AchievementScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class AchievementScreen extends MovieClip {
public var buttonBack:SimpleButton;
public var textName:TextField;
public var textClickToPlay:TextField;
public var sponsorBar:MovieClip;
public var textDescription:TextField;
public var buttonViewGameCompleteScreen:SimpleButton;
}
}//package
Section 105
//AchievementUnlockedScreen (AchievementUnlockedScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class AchievementUnlockedScreen extends MovieClip {
public var medal:AchievementBox;
public var textTitle:TextField;
public var buttonNext:SimpleButton;
public var buttonAchievements:SimpleButton;
public var sponsorBar:MovieClip;
public var textAchievement:TextField;
public function AchievementUnlockedScreen(){
addFrameScript(35, frame36);
}
function frame36(){
stop();
}
}
}//package
Section 106
//AreYouSure (AreYouSure)
package {
import flash.display.*;
public dynamic class AreYouSure extends MovieClip {
public var buttonCancel:SimpleButton;
public var buttonOK:SimpleButton;
}
}//package
Section 107
//background1 (background1)
package {
import flash.display.*;
public dynamic class background1 extends MovieClip {
}
}//package
Section 108
//background2 (background2)
package {
import flash.display.*;
public dynamic class background2 extends MovieClip {
}
}//package
Section 109
//background3 (background3)
package {
import flash.display.*;
public dynamic class background3 extends MovieClip {
}
}//package
Section 110
//background4 (background4)
package {
import flash.display.*;
public dynamic class background4 extends MovieClip {
}
}//package
Section 111
//background5 (background5)
package {
import flash.display.*;
public dynamic class background5 extends MovieClip {
}
}//package
Section 112
//background6 (background6)
package {
import flash.display.*;
public dynamic class background6 extends MovieClip {
}
}//package
Section 113
//BackgroundPieces (BackgroundPieces)
package {
import flash.display.*;
public dynamic class BackgroundPieces extends MovieClip {
}
}//package
Section 114
//bellplayer01 (bellplayer01)
package {
import flash.media.*;
public dynamic class bellplayer01 extends Sound {
}
}//package
Section 115
//bellplayer02 (bellplayer02)
package {
import flash.media.*;
public dynamic class bellplayer02 extends Sound {
}
}//package
Section 116
//bellplayer03 (bellplayer03)
package {
import flash.media.*;
public dynamic class bellplayer03 extends Sound {
}
}//package
Section 117
//bellplayer04 (bellplayer04)
package {
import flash.media.*;
public dynamic class bellplayer04 extends Sound {
}
}//package
Section 118
//bellplayer05 (bellplayer05)
package {
import flash.media.*;
public dynamic class bellplayer05 extends Sound {
}
}//package
Section 119
//bellplayer06 (bellplayer06)
package {
import flash.media.*;
public dynamic class bellplayer06 extends Sound {
}
}//package
Section 120
//bellplayer07 (bellplayer07)
package {
import flash.media.*;
public dynamic class bellplayer07 extends Sound {
}
}//package
Section 121
//bellplayer08 (bellplayer08)
package {
import flash.media.*;
public dynamic class bellplayer08 extends Sound {
}
}//package
Section 122
//bellplayer09 (bellplayer09)
package {
import flash.media.*;
public dynamic class bellplayer09 extends Sound {
}
}//package
Section 123
//bellplayer10 (bellplayer10)
package {
import flash.media.*;
public dynamic class bellplayer10 extends Sound {
}
}//package
Section 124
//bellplayer11 (bellplayer11)
package {
import flash.media.*;
public dynamic class bellplayer11 extends Sound {
}
}//package
Section 125
//bellplayer12 (bellplayer12)
package {
import flash.media.*;
public dynamic class bellplayer12 extends Sound {
}
}//package
Section 126
//bellplayer13 (bellplayer13)
package {
import flash.media.*;
public dynamic class bellplayer13 extends Sound {
}
}//package
Section 127
//bellplayer14 (bellplayer14)
package {
import flash.media.*;
public dynamic class bellplayer14 extends Sound {
}
}//package
Section 128
//bellplayer15 (bellplayer15)
package {
import flash.media.*;
public dynamic class bellplayer15 extends Sound {
}
}//package
Section 129
//bellplayer16 (bellplayer16)
package {
import flash.media.*;
public dynamic class bellplayer16 extends Sound {
}
}//package
Section 130
//bellplayer17 (bellplayer17)
package {
import flash.media.*;
public dynamic class bellplayer17 extends Sound {
}
}//package
Section 131
//bellplayer18 (bellplayer18)
package {
import flash.media.*;
public dynamic class bellplayer18 extends Sound {
}
}//package
Section 132
//bellplayer19 (bellplayer19)
package {
import flash.media.*;
public dynamic class bellplayer19 extends Sound {
}
}//package
Section 133
//bellplayer20 (bellplayer20)
package {
import flash.media.*;
public dynamic class bellplayer20 extends Sound {
}
}//package
Section 134
//BikeBody01 (BikeBody01)
package {
import flash.display.*;
public dynamic class BikeBody01 extends MovieClip {
}
}//package
Section 135
//BikeBody02 (BikeBody02)
package {
import flash.display.*;
public dynamic class BikeBody02 extends MovieClip {
}
}//package
Section 136
//BikeBody03 (BikeBody03)
package {
import flash.display.*;
public dynamic class BikeBody03 extends MovieClip {
}
}//package
Section 137
//BikeBody04 (BikeBody04)
package {
import flash.display.*;
public dynamic class BikeBody04 extends MovieClip {
}
}//package
Section 138
//BikeBody05 (BikeBody05)
package {
import flash.display.*;
public dynamic class BikeBody05 extends MovieClip {
}
}//package
Section 139
//BikeBody06 (BikeBody06)
package {
import flash.display.*;
public dynamic class BikeBody06 extends MovieClip {
}
}//package
Section 140
//BikeBody07 (BikeBody07)
package {
import flash.display.*;
public dynamic class BikeBody07 extends MovieClip {
}
}//package
Section 141
//BikeBody08 (BikeBody08)
package {
import flash.display.*;
public dynamic class BikeBody08 extends MovieClip {
}
}//package
Section 142
//BikeBody09 (BikeBody09)
package {
import flash.display.*;
public dynamic class BikeBody09 extends MovieClip {
}
}//package
Section 143
//BikeBody10 (BikeBody10)
package {
import flash.display.*;
public dynamic class BikeBody10 extends MovieClip {
}
}//package
Section 144
//BikeBody11 (BikeBody11)
package {
import flash.display.*;
public dynamic class BikeBody11 extends MovieClip {
}
}//package
Section 145
//BikeBody12 (BikeBody12)
package {
import flash.display.*;
public dynamic class BikeBody12 extends MovieClip {
}
}//package
Section 146
//BikeBody13 (BikeBody13)
package {
import flash.display.*;
public dynamic class BikeBody13 extends MovieClip {
}
}//package
Section 147
//BikeBody13a (BikeBody13a)
package {
import flash.display.*;
public dynamic class BikeBody13a extends MovieClip {
}
}//package
Section 148
//BikeBody14 (BikeBody14)
package {
import flash.display.*;
public dynamic class BikeBody14 extends MovieClip {
}
}//package
Section 149
//BikeBody15 (BikeBody15)
package {
import flash.display.*;
public dynamic class BikeBody15 extends MovieClip {
}
}//package
Section 150
//BikeBody16 (BikeBody16)
package {
import flash.display.*;
public dynamic class BikeBody16 extends MovieClip {
}
}//package
Section 151
//BikeBody17 (BikeBody17)
package {
import flash.display.*;
public dynamic class BikeBody17 extends MovieClip {
}
}//package
Section 152
//BikeBody18 (BikeBody18)
package {
import flash.display.*;
public dynamic class BikeBody18 extends MovieClip {
}
}//package
Section 153
//BikeBody19 (BikeBody19)
package {
import flash.display.*;
public dynamic class BikeBody19 extends MovieClip {
}
}//package
Section 154
//BikeBody20 (BikeBody20)
package {
import flash.display.*;
public dynamic class BikeBody20 extends MovieClip {
}
}//package
Section 155
//BikeLegs01 (BikeLegs01)
package {
import flash.display.*;
public dynamic class BikeLegs01 extends MovieClip {
}
}//package
Section 156
//BikeLegs02 (BikeLegs02)
package {
import flash.display.*;
public dynamic class BikeLegs02 extends MovieClip {
}
}//package
Section 157
//BikeLegs03 (BikeLegs03)
package {
import flash.display.*;
public dynamic class BikeLegs03 extends MovieClip {
}
}//package
Section 158
//BikeLegs04 (BikeLegs04)
package {
import flash.display.*;
public dynamic class BikeLegs04 extends MovieClip {
}
}//package
Section 159
//BikeLegs05 (BikeLegs05)
package {
import flash.display.*;
public dynamic class BikeLegs05 extends MovieClip {
}
}//package
Section 160
//BikeLegs06 (BikeLegs06)
package {
import flash.display.*;
public dynamic class BikeLegs06 extends MovieClip {
}
}//package
Section 161
//BikeLegs07 (BikeLegs07)
package {
import flash.display.*;
public dynamic class BikeLegs07 extends MovieClip {
}
}//package
Section 162
//BikeLegs08 (BikeLegs08)
package {
import flash.display.*;
public dynamic class BikeLegs08 extends MovieClip {
}
}//package
Section 163
//BikeLegs09 (BikeLegs09)
package {
import flash.display.*;
public dynamic class BikeLegs09 extends MovieClip {
}
}//package
Section 164
//BikeLegs10 (BikeLegs10)
package {
import flash.display.*;
public dynamic class BikeLegs10 extends MovieClip {
}
}//package
Section 165
//BikeLegs11 (BikeLegs11)
package {
import flash.display.*;
public dynamic class BikeLegs11 extends MovieClip {
}
}//package
Section 166
//BikeLegs12 (BikeLegs12)
package {
import flash.display.*;
public dynamic class BikeLegs12 extends MovieClip {
}
}//package
Section 167
//BikeLegs13 (BikeLegs13)
package {
import flash.display.*;
public dynamic class BikeLegs13 extends MovieClip {
}
}//package
Section 168
//BikeLegs14 (BikeLegs14)
package {
import flash.display.*;
public dynamic class BikeLegs14 extends MovieClip {
}
}//package
Section 169
//BikeLegs15 (BikeLegs15)
package {
import flash.display.*;
public dynamic class BikeLegs15 extends MovieClip {
}
}//package
Section 170
//BikeLegs16 (BikeLegs16)
package {
import flash.display.*;
public dynamic class BikeLegs16 extends MovieClip {
}
}//package
Section 171
//BikeLegs17 (BikeLegs17)
package {
import flash.display.*;
public dynamic class BikeLegs17 extends MovieClip {
}
}//package
Section 172
//BikeLegs18 (BikeLegs18)
package {
import flash.display.*;
public dynamic class BikeLegs18 extends MovieClip {
}
}//package
Section 173
//BikeLegs19 (BikeLegs19)
package {
import flash.display.*;
public dynamic class BikeLegs19 extends MovieClip {
}
}//package
Section 174
//BikeLegs20 (BikeLegs20)
package {
import flash.display.*;
public dynamic class BikeLegs20 extends MovieClip {
}
}//package
Section 175
//BikeSelectScreen (BikeSelectScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class BikeSelectScreen extends MovieClip {
public var bike18:MovieClip;
public var textBikerName:TextField;
public var textBikerBio:TextField;
public var buttonBack:SimpleButton;
public var bike1:MovieClip;
public var bike2:MovieClip;
public var bike6:MovieClip;
public var bike7:MovieClip;
public var bike8:MovieClip;
public var bike5:MovieClip;
public var bike9:MovieClip;
public var chosen:MovieClip;
public var sponsorBar:MovieClip;
public var bike4:MovieClip;
public var bike11:MovieClip;
public var bike12:MovieClip;
public var bike13:MovieClip;
public var bike15:MovieClip;
public var bike19:MovieClip;
public var bike16:MovieClip;
public var bike17:MovieClip;
public var textUnlock:TextField;
public var bike14:MovieClip;
public var bike3:MovieClip;
public var noRiderOverlay:MovieClip;
public var bike20:MovieClip;
public var bike10:MovieClip;
}
}//package
Section 176
//BikeWheel01 (BikeWheel01)
package {
import flash.display.*;
public dynamic class BikeWheel01 extends MovieClip {
}
}//package
Section 177
//BikeWheel02 (BikeWheel02)
package {
import flash.display.*;
public dynamic class BikeWheel02 extends MovieClip {
}
}//package
Section 178
//BikeWheel03 (BikeWheel03)
package {
import flash.display.*;
public dynamic class BikeWheel03 extends MovieClip {
}
}//package
Section 179
//BikeWheel04 (BikeWheel04)
package {
import flash.display.*;
public dynamic class BikeWheel04 extends MovieClip {
}
}//package
Section 180
//BikeWheel05 (BikeWheel05)
package {
import flash.display.*;
public dynamic class BikeWheel05 extends MovieClip {
}
}//package
Section 181
//BikeWheel06 (BikeWheel06)
package {
import flash.display.*;
public dynamic class BikeWheel06 extends MovieClip {
}
}//package
Section 182
//BikeWheel07 (BikeWheel07)
package {
import flash.display.*;
public dynamic class BikeWheel07 extends MovieClip {
}
}//package
Section 183
//BikeWheel08 (BikeWheel08)
package {
import flash.display.*;
public dynamic class BikeWheel08 extends MovieClip {
}
}//package
Section 184
//BikeWheel09 (BikeWheel09)
package {
import flash.display.*;
public dynamic class BikeWheel09 extends MovieClip {
}
}//package
Section 185
//BikeWheel10 (BikeWheel10)
package {
import flash.display.*;
public dynamic class BikeWheel10 extends MovieClip {
}
}//package
Section 186
//BikeWheel11 (BikeWheel11)
package {
import flash.display.*;
public dynamic class BikeWheel11 extends MovieClip {
}
}//package
Section 187
//BikeWheel12 (BikeWheel12)
package {
import flash.display.*;
public dynamic class BikeWheel12 extends MovieClip {
}
}//package
Section 188
//BikeWheel13 (BikeWheel13)
package {
import flash.display.*;
public dynamic class BikeWheel13 extends MovieClip {
}
}//package
Section 189
//BikeWheel14 (BikeWheel14)
package {
import flash.display.*;
public dynamic class BikeWheel14 extends MovieClip {
}
}//package
Section 190
//BikeWheel15 (BikeWheel15)
package {
import flash.display.*;
public dynamic class BikeWheel15 extends MovieClip {
}
}//package
Section 191
//BikeWheel16 (BikeWheel16)
package {
import flash.display.*;
public dynamic class BikeWheel16 extends MovieClip {
}
}//package
Section 192
//BikeWheel17 (BikeWheel17)
package {
import flash.display.*;
public dynamic class BikeWheel17 extends MovieClip {
}
}//package
Section 193
//BikeWheel18 (BikeWheel18)
package {
import flash.display.*;
public dynamic class BikeWheel18 extends MovieClip {
}
}//package
Section 194
//BikeWheel19 (BikeWheel19)
package {
import flash.display.*;
public dynamic class BikeWheel19 extends MovieClip {
}
}//package
Section 195
//BikeWheel20 (BikeWheel20)
package {
import flash.display.*;
public dynamic class BikeWheel20 extends MovieClip {
}
}//package
Section 196
//bonusmusic (bonusmusic)
package {
import flash.media.*;
public dynamic class bonusmusic extends Sound {
}
}//package
Section 197
//boost (boost)
package {
import flash.media.*;
public dynamic class boost extends Sound {
}
}//package
Section 198
//boostBar (boostBar)
package {
import flash.display.*;
public dynamic class boostBar extends MovieClip {
}
}//package
Section 199
//BoostLevel (BoostLevel)
package {
import flash.display.*;
public dynamic class BoostLevel extends MovieClip {
}
}//package
Section 200
//Bubble (Bubble)
package {
import flash.display.*;
public dynamic class Bubble extends MovieClip {
}
}//package
Section 201
//bubblebox_score (bubblebox_score)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.filters.*;
import flash.ui.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
public dynamic class bubblebox_score extends MovieClip {
public var loader:URLLoader;
public var loadingStatus:String;
public var hexChars:String;
public var score:Number;
public var gameID:Number;
public var insertname:TextField;
public function bubblebox_score(){
addFrameScript(0, frame1);
}
public function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (tr(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public function hash(_arg1:String):String{
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
public function removeListeners():void{
loader.removeEventListener(Event.COMPLETE, completeHandler);
loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
loader.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
}
public function clicked(_arg1:MouseEvent):void{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:URLVariables;
var _local7:URLRequest;
if (loadingStatus == "insertName"){
if (((((!((_arg1.target.name == "insertName"))) && (!((this.insertname.text == "YOUR NAME"))))) && ((this.insertname.text.length > 0)))){
_local2 = this.insertname.text;
_local3 = ((((gameID + "_") + score) + "_") + _local2);
_local4 = ((((((((((gameID + "_") + "4234232143214421") + "_") + score) + "_") + "2537625476251") + "_") + _local2) + "_") + "desleutelistessa");
_local5 = hash(_local4);
_local6 = new URLVariables();
_local6.datastring = _local3;
_local6.hashstring = _local5;
_local7 = new URLRequest("http://www.bubblebox.com/scripts/insertscore2008.php");
_local7.data = _local6;
_local7.method = URLRequestMethod.POST;
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(Event.COMPLETE, completeHandler, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true);
loader.load(_local7);
this.gotoAndStop(2);
loadingStatus = "sending";
};
} else {
if (loadingStatus == "sending"){
} else {
if (loadingStatus == "completed"){
navigateToURL(new URLRequest((("http://www.bubblebox.com/highscores/" + gameID) + ".htm")), "_blank");
} else {
if (loadingStatus == "failed"){
loadingStatus = "insertName";
this.gotoAndStop(1);
};
};
};
};
}
public function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (tr(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public function failed():void{
loadingStatus = "failed";
removeListeners();
this.gotoAndStop(4);
}
public function setScore(_arg1:Number, _arg2:Number):void{
score = _arg1;
gameID = _arg2;
}
public function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
public function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
function frame1(){
hexChars = "0123456789abcdef";
this.stage.focus = this.insertname;
this.insertname.setSelection(0, this.insertname.text.length);
loader = new URLLoader();
loadingStatus = "insertName";
this.addEventListener(MouseEvent.CLICK, clicked, false, 0, true);
stop();
}
public function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
public function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
public function ioErrorHandler(_arg1:IOErrorEvent):void{
trace("ioError");
failed();
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
trace("securityError");
failed();
}
public function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
var _local4:int;
var _local5:int;
_local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
public function createBlocks(_arg1:ByteArray):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = new Array();
_local3 = (_arg1.length * 8);
_local4 = 0xFF;
_local5 = 0;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
public function hashBinary(_arg1:ByteArray):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:int;
_local2 = 1732584193;
_local3 = -271733879;
_local4 = -1732584194;
_local5 = 271733878;
_local10 = createBlocks(_arg1);
_local11 = _local10.length;
_local12 = 0;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
return ((((toHex(_local2) + toHex(_local3)) + toHex(_local4)) + toHex(_local5)));
}
public function tr(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int;
_local9 = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((rol(_local9, _arg7) + _arg3));
}
public function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public function completeHandler(_arg1:Event):void{
loadingStatus = "completed";
removeListeners();
this.gotoAndStop(3);
}
public function ror(_arg1:int, _arg2:int):uint{
var _local3:int;
_local3 = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (tr(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (tr(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
}
}//package
Section 202
//bunnyhop (bunnyhop)
package {
import flash.media.*;
public dynamic class bunnyhop extends Sound {
}
}//package
Section 203
//buttonPauseMute (buttonPauseMute)
package {
import flash.display.*;
public dynamic class buttonPauseMute extends SimpleButton {
}
}//package
Section 204
//c1 (c1)
package {
public dynamic class c1 extends Card {
}
}//package
Section 205
//c2 (c2)
package {
public dynamic class c2 extends Card {
}
}//package
Section 206
//c3 (c3)
package {
public dynamic class c3 extends Card {
}
}//package
Section 207
//c4 (c4)
package {
public dynamic class c4 extends Card {
}
}//package
Section 208
//Card (Card)
package {
import flash.events.*;
import flash.display.*;
dynamic class Card extends MovieClip {
public var orot:Number;
public var oSpeed:Number;
public var yDir:String;
public var speed:Number;
public var r:Number;
public var firstTime:Boolean;// = true
public var dir:String;
public var time:Number;
public var ox:Number;
public var oy:Number;
public static var WIDTH = 300;
public static var ranNum:Array = [9, 7, 3, 1, 2, 4, 5, 8, 6, 10];
public static var ranNumIndex:Number = 0;
public static var HEIGHT = 250;
function Card(){
firstTime = true;
super();
addEventListener("enterFrame", onEnterFrame);
}
public function randomNumber(){
ranNumIndex++;
if (ranNumIndex == ranNum.length){
ranNumIndex = 0;
};
return (ranNum[ranNumIndex]);
}
public function Init(){
cacheAsBitmap = true;
this.forceSmoothing = true;
ox = this.x;
oy = this.y;
orot = this.rotation;
time = 1;
speed = (randomNumber() + 5);
oSpeed = speed;
if (randomNumber() < 3){
r = (randomNumber() + 5);
} else {
r = 0;
};
if (this.x < (WIDTH / 2)){
dir = "left";
} else {
dir = "right";
};
if (this.y < (HEIGHT / 2)){
yDir = "up";
} else {
yDir = "down";
};
}
public function resetCards(){
}
public function onEnterFrame(_arg1:Event){
if (firstTime == true){
firstTime = false;
Init();
return;
};
time = (time + 1);
if (time > 30){
if (dir == "left"){
this.x = (this.x - speed);
speed = (speed * 1.1);
if (r != 0){
this.rotation = (this.rotation + r);
};
if (this.x <= -50){
dir = "stop";
};
};
if (dir == "right"){
this.x = (this.x + speed);
speed = (speed * 1.1);
if (r != 0){
this.rotation = (this.rotation + r);
};
if (this.x >= (WIDTH + 50)){
dir = "stop";
};
};
if (yDir == "up"){
this.y = (this.y - 2);
};
if (yDir == "down"){
this.y = (this.y + 2);
};
if (time > 250){
time = 1;
resetCards();
if (x < (WIDTH / 2)){
dir = "left";
} else {
dir = "right";
};
};
};
}
}
}//package
Section 209
//coasting (coasting)
package {
import flash.media.*;
public dynamic class coasting extends Sound {
}
}//package
Section 210
//coins (coins)
package {
import flash.display.*;
public dynamic class coins extends MovieClip {
}
}//package
Section 211
//ContactListener (ContactListener)
package {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
public class ContactListener extends b2ContactListener {
override public function Persist(_arg1:b2ContactPoint):void{
var _local2:GameObj;
var _local3:PhysObj_Instance;
var _local4:b2Body;
var _local5:PhysObj_BodyUserData;
var _local6:b2Body;
var _local7:PhysObj_BodyUserData;
var _local8:b2Vec2;
_local4 = _arg1.shape1.GetBody();
_local5 = _local4.GetUserData();
_local6 = _arg1.shape2.GetBody();
_local7 = _local6.GetUserData();
_local8 = new b2Vec2(0, 0);
Game.numCollisionTests++;
TestBikeWheelDown(_arg1);
}
override public function Add(_arg1:b2ContactPoint):void{
var _local2:GameObj;
var _local3:PhysObj_Instance;
var _local4:b2Body;
var _local5:PhysObj_BodyUserData;
var _local6:b2Body;
var _local7:PhysObj_BodyUserData;
var _local8:b2Vec2;
_local4 = _arg1.shape1.GetBody();
_local5 = _local4.GetUserData();
_local6 = _arg1.shape2.GetBody();
_local7 = _local6.GetUserData();
_local8 = new b2Vec2(0, 0);
Game.numCollisionTests++;
TestBikeWheelDown(_arg1);
if (((_local5.type.match("bike")) && ((_local7.type == "Pickup")))){
_local7.instance.collideFunction = Game.RemoveObj_Pickup;
if (_local7.instance.collidetimer == 0){
_local7.instance.collidetimer = 10;
};
};
if (((_local7.type.match("bike")) && ((_local5.type == "Pickup")))){
_local5.instance.collideFunction = Game.RemoveObj_Pickup;
if (_local5.instance.collidetimer == 0){
_local5.instance.collidetimer = 10;
};
};
if (((_local5.type.match("bike")) && ((_local7.type == "switch_to_back")))){
Game.SwitchToBack();
};
if (((_local7.type.match("bike")) && ((_local5.type == "switch_to_back")))){
Game.SwitchToBack();
};
if (((_local5.type.match("bike")) && ((_local7.type == "switch_to_front")))){
Game.SwitchToFront();
};
if (((_local7.type.match("bike")) && ((_local5.type == "switch_to_front")))){
Game.SwitchToFront();
};
if (((_local5.type.match("bike")) && ((_local7.type == "endrace")))){
Game.CrossedFinishLine();
};
if (((_local7.type.match("bike")) && ((_local5.type == "endrace")))){
Game.CrossedFinishLine();
};
if ((((_local7.type == "ball")) && ((_local5.type == "mover50")))){
_local8.x = Math.cos(Utils.DegToRad(_local5.instance.rot));
_local8.y = Math.sin(Utils.DegToRad(_local5.instance.rot));
_local8.Multiply(50);
_local6.ApplyForce(_local8, _local6.GetWorldCenter());
};
if ((((_local5.type == "ball")) && ((((_local7.type == "bouncer")) || ((_local7.type == "bouncer2")))))){
_local2 = GameObjects.objs[_local7.gameObjectID];
_local2.BouncerBounce();
SoundPlayer.Play("sfx_boing");
};
if ((((_local7.type == "ball")) && ((((_local5.type == "bouncer")) || ((_local5.type == "bouncer2")))))){
_local2 = GameObjects.objs[_local5.gameObjectID];
_local2.BouncerBounce();
SoundPlayer.Play("sfx_boing");
};
if ((((_local5.type == "ball")) && ((_local7.type == "conveyor100")))){
_local8.x = Math.cos(Utils.DegToRad(_local7.instance.rot));
_local8.y = Math.sin(Utils.DegToRad(_local7.instance.rot));
_local4.ApplyForce(_local8, _local4.GetLocalCenter());
};
if ((((_local7.type == "ball")) && ((_local5.type == "conveyor100")))){
_local8.x = Math.cos(Utils.DegToRad(_local5.instance.rot));
_local8.y = Math.sin(Utils.DegToRad(_local5.instance.rot));
_local6.ApplyForce(_local8, _local6.GetLocalCenter());
};
if ((((_local5.type == "ball")) && ((_local7.type == "gem")))){
_local7.instance.collideFunction = Game.RemoveObj_Gem;
if (_local7.instance.collidetimer == 0){
_local7.instance.collidetimer = 10;
};
};
if ((((_local7.type == "ball")) && ((_local5.type == "gem")))){
_local5.instance.collideFunction = Game.RemoveObj_Gem;
if (_local5.instance.collidetimer == 0){
_local5.instance.collidetimer = 10;
};
};
if ((((_local5.type == "cannonball")) && ((((_local7.type == "pin_disappear")) || ((_local7.type == "pin_disappear_broken")))))){
_local2 = GameObjects.objs[_local7.gameObjectID];
if (_local2.PinDisappearHit()){
_local7.instance.collideFunction = Game.RemoveObj_Standard;
if (_local7.instance.collidetimer == 0){
_local7.instance.collidetimer = 10;
};
};
};
if ((((_local7.type == "cannonball")) && ((((_local5.type == "pin_disappear")) || ((_local5.type == "pin_disappear_broken")))))){
SoundPlayer.Play("sfx_removepin", Utils.RandBetweenFloat(0.5, 1));
_local2 = GameObjects.objs[_local5.gameObjectID];
if (_local2.PinDisappearHit()){
_local5.instance.collideFunction = Game.RemoveObj_Standard;
if (_local5.instance.collidetimer == 0){
_local5.instance.collidetimer = 10;
};
};
};
}
public function TestBikeWheelDown(_arg1:b2ContactPoint):void{
var _local2:b2Body;
var _local3:PhysObj_BodyUserData;
var _local4:b2Body;
var _local5:PhysObj_BodyUserData;
_local2 = _arg1.shape1.GetBody();
_local3 = _local2.GetUserData();
_local4 = _arg1.shape2.GetBody();
_local5 = _local4.GetUserData();
if (_local3.type.match("bike")){
if (_local5.type.match("killer")){
Game.StartPlayerHitFloor();
};
if (_local3.bodyName == "body"){
if (((((!((_local5.type == "switch_to_front"))) && (!((_local5.type == "switch_to_back"))))) && (!((_local5.type == "Pickup"))))){
Game.StartPlayerHitFloor();
};
} else {
Game.BikeWheelIsDown();
if (_local3.bodyName == "wheel1"){
Game.BackWheelIsDown();
};
if (_local3.bodyName == "wheel2"){
Game.FrontWheelIsDown();
};
};
};
if (_local5.type.match("bike")){
if (_local3.type.match("killer")){
Game.StartPlayerHitFloor();
};
if (_local5.bodyName == "body"){
if (((((!((_local3.type == "switch_to_front"))) && (!((_local3.type == "switch_to_back"))))) && (!((_local3.type == "Pickup"))))){
Game.StartPlayerHitFloor();
};
} else {
Game.BikeWheelIsDown();
if (_local5.bodyName == "wheel1"){
Game.BackWheelIsDown();
};
if (_local5.bodyName == "wheel2"){
Game.FrontWheelIsDown();
};
};
};
}
}
}//package
Section 212
//Debug (Debug)
package {
public class Debug {
public static var debugMode:int = 0;
public static function IsSet(_arg1:int):Boolean{
if ((debugMode & _arg1) == 0){
return (false);
};
return (true);
}
public static function RenderCollision(){
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:uint;
var _local5:Line;
var _local6:Line;
var _local7:int;
var _local8:Poly;
return;
}
public static function RenderPlayerInfo(){
var _local1:String;
var _local2:GameObj;
}
}
}//package
Section 213
//Defs (Defs)
package {
import flash.geom.*;
public class Defs {
public static const zpos_PICKUP = 1100;
public static const zpos_ENEMY = 1000;
public static const displayarea_w = 640;
public static const zpos_OVERLAY = 500;
public static const zpos_PLAYER = 1000;
public static const fps:Number = 33;
public static const zpos_FAR = 10000;
public static const zpos_BACKGROUND = 10000;
public static const displayarea_h = 480;
public static const platformW2 = 15;
public static var screenRect:Rectangle = new Rectangle(0, 0, displayarea_w, displayarea_h);
public static var pointZero:Point = new Point(0, 0);
}
}//package
Section 214
//DisplayObj (DisplayObj)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public class DisplayObj {
var flags:int;
var frames:Array;
public var frame:int;
public function DisplayObj(_arg1:MovieClip, _arg2:Number, _arg3:int):void{
flags = _arg3;
frame = 0;
if (_arg1 != null){
CreateBitmapsFromMovieClip(_arg1, flags);
};
}
public function GetBitmap():Bitmap{
return (frames[frame].bitmap);
}
public function RenderAt(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{
frames[frame].RenderAt(_arg1, _arg2, _arg3, _arg4);
}
public function CreateFont(_arg1:TextFormat):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Matrix;
var _local7:Rectangle;
var _local8:Bitmap;
var _local9:BitmapData;
var _local10:Array;
var _local11:TextField;
var _local12:*;
frames = new Array();
_local10 = CreateAsciiStringTable();
_local2 = 0;
while (_local2 < _local10.length) {
_local11 = new TextField();
_local11.textColor = 4294967295;
_local11.selectable = false;
_local11.embedFonts = true;
_local11.autoSize = TextFieldAutoSize.LEFT;
_local11.x = 0;
_local11.y = 0;
_local11.text = _local10[_local2];
_local11.setTextFormat(_arg1);
_local12 = new DisplayObjFrame();
_local12.bitmaps = new Array();
_local12.xoffsets = new Array();
_local12.yoffsets = new Array();
_local12.mat = new Matrix();
_local12.colTrans = new ColorTransform();
_local7 = _local11.getBounds(null);
_local6 = new Matrix();
_local6.translate(-(_local7.x), -(_local7.y));
_local12.xoffsets.push(0);
_local12.yoffsets.push(0);
_local8 = new Bitmap();
_local9 = new BitmapData(_local7.width, _local7.height, true, 0);
_local9.draw(_local11, _local6, null, null, null, true);
_local8.bitmapData = _local9;
_local12.bitmaps.push(_local8);
frames.push(_local12);
_local2++;
};
}
public function CreateBitmapsFromMovieClip(_arg1:MovieClip, _arg2:int):void{
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Matrix;
var _local10:Rectangle;
var _local11:Bitmap;
var _local12:BitmapData;
var _local13:Bitmap;
var _local14:BitmapData;
var _local15:int;
var _local16:*;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Boolean;
var _local21:Number;
var _local22:*;
var _local23:Number;
var _local24:Point;
var _local25:Point;
var _local26:Point;
var _local27:Point;
var _local28:ColorTransform;
var _local29:ColorTransform;
_local3 = false;
_local4 = false;
if (_arg2 == 3){
_local4 = true;
_arg2 = 0;
};
if (_arg2 == 2){
_local3 = true;
_arg2 = 0;
};
if (_arg2 == 3){
};
frames = new Array();
_arg1.gotoAndStop(0);
_local15 = 32;
_local5 = 0;
while (_local5 < _arg1.totalFrames) {
_local16 = new DisplayObjFrame();
_local16.bitmaps = new Array();
_local16.burnedbitmaps = new Array();
_local16.xoffsets = new Array();
_local16.yoffsets = new Array();
_local16.mat = new Matrix();
_local16.colTrans = new ColorTransform();
if (_arg2 == 3){
_local17 = 1000;
_local10 = _arg1.getBounds(null);
_local18 = _local10.width;
_local19 = (_local18 + _local17);
_local20 = true;
_local21 = 0;
do {
_local9 = new Matrix();
_local9.translate(-(_local21), 0);
_local7 = _local21;
_local8 = 0;
_local16.xoffsets.push(Number(_local21));
_local16.yoffsets.push(Number(_local8));
_local21 = (_local21 + _local17);
_local22 = _local17;
_local19 = (_local19 - _local17);
if (_local19 < _local17){
_local20 = false;
_local22 = _local19;
};
trace(((("split: w:" + _local22) + " xoff:") + _local21));
_local11 = new Bitmap();
_local12 = new BitmapData(_local22, _arg1.height, true, 0);
_local12.draw(_arg1, _local9);
_local11.bitmapData = _local12;
_local16.bitmaps.push(_local11);
} while (_local20);
} else {
if (_arg2 == 1){
_local6 = 0;
while (_local6 < _local15) {
_local23 = (((Math.PI * 2) / Number(_local15)) * Number(_local6));
_local23 = -(_local23);
_local23 = (_local23 + (Math.PI / 2));
_local10 = _arg1.getBounds(null);
_local9 = new Matrix();
_local9.rotate(_local23);
_local9.translate(_local10.width, _local10.height);
_local24 = _local9.transformPoint(new Point(_local10.left, _local10.top));
_local25 = _local9.transformPoint(new Point(_local10.right, _local10.top));
_local26 = _local9.transformPoint(new Point(_local10.right, _local10.bottom));
_local27 = _local9.transformPoint(new Point(_local10.left, _local10.bottom));
if (((!((_arg1.width == 0))) && (!((_arg1.height == 0))))){
_local12 = new BitmapData((_local10.width * 2), (_local10.height * 2), true, 0);
_local12.draw(_arg1, _local9);
_local11 = new Bitmap(_local12);
_local16.bitmaps.push(_local11);
_local28 = new ColorTransform(1, 1, 1, 1, -100, -100, -100, 0);
_local14 = new BitmapData((_local10.width * 2), (_local10.height * 2), true, 0);
_local14.draw(_arg1, _local9, _local28);
_local13 = new Bitmap(_local14);
_local16.burnedbitmaps.push(_local13);
_local7 = (_local10.width / 2);
_local8 = (_local10.height / 2);
_local16.xoffsets.push(Number(-(_local10.width)));
_local16.yoffsets.push(Number(-(_local10.height)));
} else {
_local16.bitmaps.push(null);
_local16.burnedbitmaps.push(null);
_local16.xoffsets.push(0);
_local16.yoffsets.push(0);
};
_local6++;
};
} else {
_local10 = _arg1.getBounds(null);
_local10.x = Math.floor(_local10.x);
_local10.y = Math.floor(_local10.y);
_local10.width = Math.ceil(_local10.width);
_local10.height = Math.ceil(_local10.height);
_local8 = Math.floor(_local8);
_local9 = new Matrix();
_local7 = _local10.left;
_local8 = _local10.top;
_local9.translate(-(_local7), -(_local8));
_local16.xoffsets.push(Number(_local7));
_local16.yoffsets.push(Number(_local8));
if (((!((_arg1.width == 0))) && (!((_arg1.height == 0))))){
_local11 = new Bitmap();
_local12 = new BitmapData(_local10.width, _local10.height, true, 0);
_local12.draw(_arg1, _local9, null, null, null, true);
_local11.bitmapData = _local12;
_local16.bitmaps.push(_local11);
} else {
_local16.bitmaps.push(null);
};
if (_local3){
_local10 = _arg1.getBounds(null);
_local10.x = Math.floor(_local10.x);
_local10.y = Math.floor(_local10.y);
_local10.width = Math.floor(_local10.width);
_local10.height = Math.floor(_local10.height);
_local9 = new Matrix();
_local7 = _local10.left;
_local8 = _local10.top;
_local9.translate(-(_local7), -(_local8));
_local9.scale(-1, 1);
_local9.translate(_local10.width, 0);
_local16.xoffsets.push(Number(-(_local10.right)));
_local16.yoffsets.push(Number(_local8));
if (((!((_arg1.width == 0))) && (!((_arg1.height == 0))))){
_local11 = new Bitmap();
_local12 = new BitmapData(_local10.width, _local10.height, true, 0);
_local12.draw(_arg1, _local9, null, null, null, true);
_local11.bitmapData = _local12;
_local16.bitmaps.push(_local11);
} else {
_local16.bitmaps.push(null);
};
} else {
if (_local4){
_local29 = new ColorTransform(0.1, 0.1, 0.1, 0.3);
_local10 = _arg1.getBounds(null);
_local10.x = Math.floor(_local10.x);
_local10.y = Math.floor(_local10.y);
_local10.width = Math.floor((_local10.width + 1));
_local10.height = Math.floor((_local10.height + 1));
_local8 = Math.floor(_local8);
_local9 = new Matrix();
_local7 = _local10.left;
_local8 = _local10.top;
_local9.translate(-(_local7), -(_local8));
_local16.xoffsets.push(Number(_local7));
_local16.yoffsets.push(Number(_local8));
if (((!((_arg1.width == 0))) && (!((_arg1.height == 0))))){
_local11 = new Bitmap();
_local12 = new BitmapData(_local10.width, _local10.height, true, 0);
_local12.draw(_arg1, _local9, _local29);
_local11.bitmapData = _local12;
_local16.bitmaps.push(_local11);
} else {
_local16.bitmaps.push(null);
};
};
};
};
};
frames.push(_local16);
_arg1.nextFrame();
_local5++;
};
}
public function SetFrame(_arg1:int){
frame = _arg1;
if (frame < 0){
frame = 0;
};
if (frame >= frames.length){
frame = (frames.length - 1);
};
}
public function GetMaxFrames():int{
return (frames.length);
}
public function RenderAtRot(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean):void{
if (_arg5){
frames[frame].RenderAtRotBurned(_arg1, _arg2, _arg3, _arg4);
} else {
frames[frame].RenderAtRot(_arg1, _arg2, _arg3, _arg4);
};
}
public function GetFrame():int{
return (frame);
}
public function GetXOffset():Number{
return (frames[frame].xoffset);
}
public function GetYOffset():Number{
return (frames[frame].yoffset);
}
function CreateAsciiStringTable():Array{
var _local1:Array;
_local1 = new Array();
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push(" ");
_local1.push("!");
_local1.push("'");
_local1.push("#");
_local1.push("$");
_local1.push("%");
_local1.push("&");
_local1.push("'");
_local1.push("(");
_local1.push(")");
_local1.push("*");
_local1.push("+");
_local1.push(",");
_local1.push("-");
_local1.push(".");
_local1.push("/");
_local1.push("0");
_local1.push("1");
_local1.push("2");
_local1.push("3");
_local1.push("4");
_local1.push("5");
_local1.push("6");
_local1.push("7");
_local1.push("8");
_local1.push("9");
_local1.push(":");
_local1.push(";");
_local1.push("<");
_local1.push("=");
_local1.push(">");
_local1.push("?");
_local1.push("@");
_local1.push("A");
_local1.push("B");
_local1.push("C");
_local1.push("D");
_local1.push("E");
_local1.push("F");
_local1.push("G");
_local1.push("H");
_local1.push("I");
_local1.push("J");
_local1.push("K");
_local1.push("L");
_local1.push("M");
_local1.push("N");
_local1.push("O");
_local1.push("P");
_local1.push("Q");
_local1.push("R");
_local1.push("S");
_local1.push("T");
_local1.push("U");
_local1.push("V");
_local1.push("W");
_local1.push("X");
_local1.push("Y");
_local1.push("Z");
_local1.push("[");
_local1.push("\\");
_local1.push("]");
_local1.push("^");
_local1.push("_");
_local1.push("'");
_local1.push("a");
_local1.push("b");
_local1.push("c");
_local1.push("d");
_local1.push("e");
_local1.push("f");
_local1.push("g");
_local1.push("h");
_local1.push("i");
_local1.push("j");
_local1.push("k");
_local1.push("l");
_local1.push("m");
_local1.push("n");
_local1.push("o");
_local1.push("p");
_local1.push("q");
_local1.push("r");
_local1.push("s");
_local1.push("t");
_local1.push("u");
_local1.push("v");
_local1.push("w");
_local1.push("x");
_local1.push("y");
_local1.push("z");
_local1.push("{");
_local1.push("|");
_local1.push("}");
_local1.push("~");
return (_local1);
}
public function GetFrameWidth(_arg1:int):Number{
return (frames[_arg1].bitmap.width);
}
public function GetWidth():Number{
return (frames[frame].bitmap.width);
}
public function RenderAtColTrans(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:ColorTransform, _arg5:Boolean=false):void{
frames[frame].RenderAtColTrans(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function GetHeight():Number{
return (frames[frame].bitmap.height);
}
public function GetScaledBitmap():Bitmap{
return (frames[frame].scaledBitmap);
}
}
}//package
import flash.display.*;
import flash.geom.*;
class DisplayObjFrame {
public var mat:Matrix;
public var bitmaps:Array;
public var xoffsets:Array;
public var burnedbitmaps:Array;
public var colTrans:ColorTransform;
public var yoffsets:Array;
private function DisplayObjFrame(){
}
public function RenderAtScaled(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1):void{
var _local6:Bitmap;
var _local7:Number;
var _local8:Number;
_local6 = bitmaps[0];
_local7 = xoffsets[0];
_local8 = yoffsets[0];
if (_arg4){
_local6 = bitmaps[1];
_local7 = xoffsets[1];
_local8 = yoffsets[1];
};
mat.identity();
mat.scale(_arg5, _arg5);
mat.translate((_arg2 + (_local7 * _arg5)), (_arg3 + (_local8 * _arg5)));
if (_local6 != null){
if (_local6.bitmapData != null){
_arg1.draw(_local6.bitmapData, mat);
};
};
}
public function RenderAt(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local5 = bitmaps[0];
_local6 = xoffsets[0];
_local7 = yoffsets[0];
if (_arg4){
_local5 = bitmaps[1];
_local6 = xoffsets[1];
_local7 = yoffsets[1];
};
_arg1.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point((_arg2 + _local6), (_arg3 + _local7)), null, null, true);
}
public function RenderAtRotScaled(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0, _arg7:ColorTransform=null, _arg8:Boolean=false):void{
var _local9:Bitmap;
var _local10:Number;
var _local11:Number;
_local9 = bitmaps[0];
_local10 = xoffsets[0];
_local11 = yoffsets[0];
if (_arg4){
_local9 = bitmaps[1];
_local10 = xoffsets[1];
_local11 = yoffsets[1];
};
mat.identity();
mat.translate(_local10, _local11);
mat.rotate(_arg6);
mat.translate(-(_local10), -(_local11));
mat.scale(_arg5, _arg5);
mat.translate((_arg2 + (_local10 * _arg5)), (_arg3 + (_local11 * _arg5)));
if (_local9 != null){
if (_local9.bitmapData != null){
_arg1.draw(_local9.bitmapData, mat, _arg7, null, null, _arg8);
};
};
}
public function RenderAtSplit(_arg1:BitmapData, _arg2:Number, _arg3:Number):void{
var _local4:int;
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local4 = 0;
while (_local4 < bitmaps.length) {
_local5 = bitmaps[_local4];
_local6 = xoffsets[_local4];
_local7 = yoffsets[_local4];
_arg1.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point((_arg2 + _local6), (_arg3 + _local7)), null, null, true);
_local4++;
};
}
public function RenderAtColTrans(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:ColorTransform, _arg5:Boolean=false):void{
var _local6:Bitmap;
var _local7:Number;
var _local8:Number;
_local6 = bitmaps[0];
_local7 = xoffsets[0];
_local8 = yoffsets[0];
if (_arg5){
_local6 = bitmaps[1];
_local7 = xoffsets[1];
_local8 = yoffsets[1];
};
mat.identity();
mat.translate((_arg2 + _local7), (_arg3 + _local8));
if (_local6 != null){
if (_local6.bitmapData != null){
_arg1.draw(_local6.bitmapData, mat, _arg4);
};
};
}
public function RenderAtAdditive(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local5 = bitmaps[0];
_local6 = xoffsets[0];
_local7 = yoffsets[0];
mat.identity();
mat.translate((_arg2 + _local6), (_arg3 + _local7));
colTrans.alphaMultiplier = _arg4;
if (_local5 != null){
if (_local5.bitmapData != null){
_arg1.draw(_local5.bitmapData, mat, colTrans, "add");
};
};
}
public function RenderAtAlpha(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local5 = bitmaps[0];
_local6 = xoffsets[0];
_local7 = yoffsets[0];
mat.identity();
mat.translate((_arg2 + _local6), (_arg3 + _local7));
colTrans.alphaMultiplier = _arg4;
if (_local5 != null){
if (_local5.bitmapData != null){
_arg1.draw(_local5.bitmapData, mat, colTrans);
};
};
}
public function RenderAtRot(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:int;
var _local6:int;
var _local7:Bitmap;
var _local8:Number;
var _local9:Number;
_arg4 = (_arg4 - 0.01);
_local5 = bitmaps.length;
_arg4 = ((Number(_local5) / (Math.PI * 2)) * _arg4);
_local6 = _arg4;
while (_local6 < 0) {
_local6 = (_local6 + _local5);
};
while (_local6 > (_local5 - 1)) {
_local6 = (_local6 - _local5);
};
_local6 = ((_local5 - 1) - _local6);
_local7 = bitmaps[_local6];
_local8 = xoffsets[_local6];
_local9 = yoffsets[_local6];
_arg1.copyPixels(_local7.bitmapData, new Rectangle(0, 0, _local7.width, _local7.height), new Point((_arg2 + _local8), (_arg3 + _local9)));
}
}
Section 215
//Domain (Domain)
package {
public class Domain {
public static function GetDomain(_arg1:Object):String{
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Number;
var _local7:Number;
_local2 = _arg1.loaderInfo.url;
_local3 = (_local2.indexOf("://") + 3);
_local4 = _local2.indexOf("/", _local3);
_local5 = _local2.substring(_local3, _local4);
_local6 = (_local5.lastIndexOf(".") - 1);
_local7 = (_local5.lastIndexOf(".", _local6) + 1);
_local5 = _local5.substring(_local7, _local5.length);
return (_local5);
}
public static function IsLockedOut():Boolean{
var _local1:String;
_local1 = GetDomain(Main.theStage);
if (((!((_local1 == "flashgamelicense.com"))) && (!((_local1 == "longanimalsgames.com"))))){
return (true);
};
return (false);
}
}
}//package
Section 216
//Dust (Dust)
package {
import flash.display.*;
public dynamic class Dust extends MovieClip {
}
}//package
Section 217
//EnterCheatCodeScreen (EnterCheatCodeScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class EnterCheatCodeScreen extends MovieClip {
public var tick0:MovieClip;
public var tick2:MovieClip;
public var tick3:MovieClip;
public var tick1:MovieClip;
public var buttonBack:SimpleButton;
public var unlock1:TextField;
public var unlock2:TextField;
public var unlock3:TextField;
public var unlock0:TextField;
public var buttonOK:SimpleButton;
public var textInput:TextField;
public var buttonHints:SimpleButton;
}
}//package
Section 218
//ExternalData (ExternalData)
package {
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class ExternalData {
static var xmlLoader:URLLoader;
static var loader:URLLoader;
public static var xml:XML;
static var xxx:XML = <data>
<playerbike bike="1" selectframe="8" name="RobotJam" acc="200" vel="26" bio="RobotJam is king of the cyclists from the future. He has been sent back in time to attempt to alter the course of cycling history. In the future all they have is trikes!"/>
<playerbike bike="2" selectframe="14" name="Cycle King" acc="200" vel="26" bio="From an early age, cycling was always on his mind after being chased by a hound dog in the ghetto. He rides with amazing grace and just loves meat tender."/>
<playerbike bike="3" selectframe="13" name="Crouching Badger" acc="200" vel="26" bio="Very little is known about this cycling sensation from the orient. Can he ride? Sure-he-can"/>
<playerbike bike="4" selectframe="12" name="Mr. C" acc="200" vel="26" bio="Mr. Chopper is named after his favourite cycle. He loves decorating his ride and he aint gettin on no god damned plain bike."/>
<playerbike bike="5" selectframe="6" name="Letter F" acc="200" vel="27" bio="Held prisoner by unknown powers and refered to by only letters, F escaped from Wales on a souped up Penny Farthing. Little else is known about him other than his strange fear of party balloons."/>
<playerbike bike="6" selectframe="1" name="Pepe Velocipede" acc="200" vel="27" bio="Twice winner of the tour de France, Pepe lists his hobbies as smoking, eating ducks livers, swearing and head butting italian centre backs."/>
<playerbike bike="7" selectframe="4" name="The Wheel" acc="200" vel="27" bio="Some say his underpants are fire resistant and good for 300bhp and that his mother breast fed him on gasoline all we know about him is that his name is the Wheel."/>
<playerbike bike="8" selectframe="20" name="Sir Colin" acc="200" vel="27" bio="Sir Colin is a British genius and part time secret agent, his greatest achievement was making the See Five, A groundbreaking transport vehicle which revolutionised transport in the 1980's by breaking the world landspeed record."/>
<playerbike bike="9" selectframe="16" name="Campy The Man Bear" acc="200" vel="28" bio="Well know in the cycling world for his bungles, campy is famous for getting his zippy stuck in the chain in a rather embarrasing accident right outside the George Hotel."/>
<playerbike bike="10" selectframe="2" name="Farty Pants" acc="200" vel="28" bio="The lesser know pant brother, banished from the official cycling scene because rear air horns were barred. "/>
<playerbike bike="11" selectframe="18" name="Dragon Bracket" acc="200" vel="28" bio="The Big Boss of Hong Kong cycling, Dragon Bracket created his own unique style of cycling but he died from taking a paracetamol or someone shot him with a blank, we have recreated him digitally just for this game."/>
<playerbike bike="12" selectframe="10" name="The Bowler Brothers" acc="200" vel="28" bio="The bowlers were a comedy duo in the slient era of the 1930's making over 5000 films, they took to cycling after a particulary bad gig when people realised that kicking a fat bloke in the shins wasnt very funny any more. "/>
<playerbike bike="13" selectframe="5" name="Trikeceratops" acc="200" vel="29" bio="Taught to ride in the jurassic era, trikeceratops has 45 million years of cycling experience, unfortuntely he is also extinct."/>
<playerbike bike="14" selectframe="15" name="Billy Boneshaker" acc="200" vel="29" bio="After winning a part in Jason And The Argonauts as lead fighting skeleton, billy's glittering career took a nose dive after years of fast booze and strong women."/>
<playerbike bike="15" selectframe="17" name="Sir Walter Raleigh" acc="200" vel="29" bio="The fictional pirate who single handedly invented the potato, he also founded the very first commerical wind powered bike company in 1552."/>
<playerbike bike="16" selectframe="11" name="Spoke" acc="200" vel="29" bio="Traditionally zombies are said to be drawn to the places they frequented when they were alive. You'll often find Spoke hanging around outside fast food outlets and the social security office."/>
<playerbike bike="17" selectframe="7" name="Phoenix The Penguin" acc="200" vel="30" bio="After a highly successful career learning to fly at least 60,000 meters Phoenix gave it up as futile and opted for ground based transport instead."/>
<playerbike bike="18" selectframe="19" name="The Man With No Brakes" acc="200" vel="30" bio="More at home on the saddle of a horse than a bike, it brings out the bad and ugly in him while cycling, he is however good at stunts and will always go the extra mile for a few dollars more."/>
<playerbike bike="19" selectframe="9" name="Presta The Clown" acc="200" vel="30" bio="Presta was let down by his parents as a child and fled to the circus aged 14, he thrives on pressure but has a vastly over pumped up opinion of himself."/>
<playerbike bike="20" selectframe="3" name="Ron" acc="200" vel="30" bio="Ron was promised miniturization and a light cycle for his birthday. Unfortunately all he got was a Mini Milk and cycle light."/>
<bikeorder>
<bike name="robotJam"/>
<bike name="Cycle King"/>
<bike name="Crouching Badger"/>
<bike name="The Man With No Brakes"/>
<bike name="Billy Boneshaker"/>
<bike name="Mr. C"/>
<bike name="Letter F"/>
<bike name="Phoenix The Penguin"/>
<bike name="the Wheel"/>
<bike name="Dragon Bracket"/>
<bike name="Trikeceratops"/>
<bike name="Ron"/>
<bike name="Sir Walter Raleigh"/>
<bike name="The Bowler Brothers"/>
<bike name="Spoke"/>
<bike name="Presta The Clown"/>
<bike name="Pepe Velocipede"/>
<bike name="Farty Pants"/>
<bike name="Campy The Man Bear"/>
<bike name="Sir Colin"/>
</bikeorder>
<!-- World 0 Dunes -->
<level name="Dunes: Gentle Start" category="0" fillframe="1" surfaceframe="2" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1" exclusivechar="-1">
<obj type="Checkpoint" x="1586" y="232" rot="0"/>
<obj type="Checkpoint" x="4374" y="241" rot="0"/>
<obj type="Checkpoint" x="6760" y="120" rot="0"/>
<obj type="Checkpoint" x="9169" y="-47" rot="0"/>
<obj type="Checkpoint" x="12467" y="342" rot="0"/>
<obj type="Checkpoint" x="15599" y="386" rot="0"/>
<obj type="Checkpoint" x="18412" y="317" rot="0"/>
<obj type="endrace" x="21479" y="243" rot="0"/>
<obj type="nonInteractive01" x="3400" y="332" rot="0"/>
<obj type="nonInteractive01" x="3439" y="331" rot="10"/>
<obj type="nonInteractive01" x="3488" y="377" rot="10"/>
<obj type="nonInteractive02" x="4477" y="237" rot="0"/>
<obj type="nonInteractive01" x="4535" y="226" rot="0"/>
<obj type="nonInteractive11" x="6089" y="279" rot="0"/>
<obj type="nonInteractive01" x="6028" y="274" rot="10"/>
<obj type="nonInteractive01" x="7347" y="225" rot="0"/>
<obj type="nonInteractive01" x="7407" y="252" rot="0"/>
<obj type="nonInteractive01" x="7467" y="215" rot="0"/>
<obj type="nonInteractive01" x="7519" y="166" rot="0"/>
<obj type="nonInteractive01" x="7435" y="198" rot="0"/>
<obj type="nonInteractive02" x="9095" y="-46" rot="0"/>
<obj type="nonInteractive02" x="9926" y="170" rot="30"/>
<obj type="nonInteractive02" x="10001" y="206" rot="30"/>
<obj type="nonInteractive03" x="10736" y="303" rot="0"/>
<obj type="nonInteractive03" x="10797" y="295" rot="0"/>
<obj type="nonInteractive03" x="10857" y="285" rot="-10"/>
<obj type="nonInteractive03" x="10913" y="274" rot="-10"/>
<obj type="nonInteractive01" x="12945" y="290" rot="0"/>
<obj type="nonInteractive01" x="13146" y="299" rot="20"/>
<obj type="nonInteractive01" x="14625" y="331" rot="10"/>
<obj type="nonInteractive01" x="14598" y="334" rot="-10"/>
<obj type="nonInteractive01" x="14643" y="341" rot="50"/>
<obj type="nonInteractive02" x="17026" y="396" rot="0"/>
<obj type="nonInteractive02" x="17089" y="405" rot="0"/>
<obj type="nonInteractive02" x="19334" y="146" rot="0"/>
<obj type="nonInteractive01" x="19398" y="146" rot="0"/>
<obj type="nonInteractive01" x="19447" y="183" rot="0"/>
<obj type="nonInteractive11" x="19501" y="140" rot="0"/>
<obj type="nonInteractive11" x="20933" y="244" rot="0"/>
<obj type="nonInteractive11" x="21001" y="262" rot="0"/>
<obj type="nonInteractive15" x="2184" y="-13" rot="0"/>
<obj type="nonInteractive15" x="3143" y="-84" rot="0"/>
<obj type="nonInteractive15" x="3850" y="-66" rot="0"/>
<obj type="nonInteractive15" x="4345" y="-134" rot="0"/>
<obj type="nonInteractive15" x="4901" y="-225" rot="0"/>
<obj type="nonInteractive15" x="5642" y="-203" rot="0"/>
<obj type="nonInteractive15" x="6442" y="-112" rot="0"/>
<obj type="nonInteractive15" x="6771" y="-307" rot="0"/>
<obj type="nonInteractive15" x="7632" y="-213" rot="0"/>
<obj type="nonInteractive15" x="8390" y="-196" rot="0"/>
<obj type="nonInteractive15" x="9048" y="-417" rot="0"/>
<obj type="nonInteractive15" x="9507" y="-426" rot="0"/>
<obj type="nonInteractive15" x="9968" y="-210" rot="0"/>
<obj type="nonInteractive15" x="11180" y="-298" rot="0"/>
<obj type="nonInteractive15" x="11667" y="-443" rot="0"/>
<obj type="nonInteractive15" x="11630" y="-146" rot="0"/>
<obj type="nonInteractive15" x="12388" y="37" rot="0"/>
<obj type="nonInteractive15" x="12949" y="-35" rot="0"/>
<obj type="nonInteractive15" x="16170" y="40" rot="0"/>
<obj type="nonInteractive15" x="16970" y="35" rot="0"/>
<obj type="nonInteractive15" x="17856" y="-106" rot="0"/>
<obj type="nonInteractive15" x="19330" y="-189" rot="0"/>
<obj type="nonInteractive15" x="20967" y="-150" rot="0"/>
<line>
</line>
<line>
<points a="96,-462, 1186.25,-455, 1242.5,236, 1355,236, 1580,236, 2080,236, 2630,236, 2766,239, 2805,242, 2828,246"/>
<points a="2852,255, 2892,278, 2928,299, 2960,313, 2986,320, 3025,323, 3317,324, 3567,324, 3716,322, 3775,316"/>
<points a="3835,299, 3880,272, 3903,248, 3936,216, 3968,198, 4030,186, 4100,184, 4144,192, 4177,215, 4215,233"/>
<points a="4255,238, 4346,242, 4402,242, 4462,240, 4521,230, 4609,208, 4663,188, 4747,165, 4919,135, 4978,128"/>
<points a="5023,124, 5063,123, 5122,127, 5207,143, 5363,180, 5436,204, 5480,217, 5525,223, 5569,225, 5796,228"/>
<points a="5893,236, 5936,249, 5989,267, 6053,279, 6104,280, 6191,276, 6364,254, 6450,226, 6519,185, 6563,155"/>
<points a="6599,141, 6689,124, 6742,120, 6794,120, 6852,126, 6906,147, 6954,180, 7011,210, 7061,228, 7108,233"/>
<points a="7160,233, 7269,231, 7333,224, 7388,213, 7434,194, 7470,177, 7523,165, 7590,160, 7660,161, 7714,168"/>
<points a="7786,191, 7850,211, 7915,227, 7986,234, 8026,235, 8102,231, 8175,223, 8309,201, 8411,174, 8562,124"/>
<points a="8708,63, 8845,6, 8943,-22, 9040,-40, 9200,-46, 9302,-40, 9518,4, 9804,109, 9960,191, 10102,251"/>
<points a="10213,282, 10312,302, 10417,309, 10526,309, 10698,307, 10824,292, 10952,264, 11054,215, 11132,178, 11226,150"/>
<points a="11332,134, 11441,132, 11512,133, 11648,145, 11755,166, 11893,205, 12036,257, 12139,293, 12222,320, 12312,340"/>
<points a="12383,345, 12471,345, 12675,339, 12746,326, 12805,307, 12919,290, 13014,286, 13111,295, 13179,304, 13379,327"/>
<points a="13427,328, 13493,329, 13650,321, 13714,307, 13782,285, 13991,250, 14090,245, 14147,244, 14197,252, 14331,282"/>
<points a="14434,308, 14509,324, 14575,332, 14768,333, 14841,327, 14943,320, 14997,322, 15139,329, 15221,340, 15287,359"/>
<points a="15484,386, 15575,390, 15636,389, 15683,387, 15851,373, 15964,354, 16032,340, 16121,323, 16271,314, 16348,310"/>
<points a="16547,314, 16641,325, 16738,356, 16901,392, 17006,399, 17081,398, 17227,392, 17389,373, 17476,351, 17674,302"/>
<points a="17746,284, 17849,270, 17898,269, 17967,276, 18161,307, 18318,319, 18511,319, 18613,309, 18740,283, 18865,251"/>
<points a="18964,218, 19138,168, 19204,154, 19265,147, 19531,141, 19631,141, 19715,146, 19993,180, 20093,203, 20283,241"/>
<points a="20338,248, 20376,250, 20675,251, 20746,245, 20846,244, 21296,244, 21846,244, 22196,244, 22232,233, 22273,181"/>
<points a="22386,-648, 24286,-648"/>
</line>
</level>
<level name="Dunes: Getting Bigger" category="0" fillframe="1" surfaceframe="2" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1" exclusivechar="-1">
<obj type="endrace" x="38885" y="2200" rot="0"/>
<obj type="Checkpoint" x="902" y="786" rot="0"/>
<obj type="Checkpoint" x="11331" y="1411" rot="0"/>
<obj type="Checkpoint" x="16917" y="804" rot="0"/>
<obj type="Checkpoint" x="22235" y="-459" rot="0"/>
<obj type="Checkpoint" x="25990" y="-387" rot="0"/>
<obj type="Checkpoint" x="32645" y="1599" rot="0"/>
<obj type="Checkpoint" x="35962" y="2132" rot="0"/>
<obj type="furniture01" x="6091" y="17" rot="0"/>
<obj type="furniture01" x="16229" y="713" rot="0"/>
<obj type="furniture01" x="23300" y="-334" rot="0"/>
<obj type="furniture01" x="32644" y="1609" rot="0"/>
<obj type="nonInteractive11" x="2551" y="734" rot="0"/>
<obj type="nonInteractive11" x="2484" y="749" rot="0"/>
<obj type="nonInteractive11" x="2521" y="730" rot="0"/>
<obj type="nonInteractive01" x="5612" y="34" rot="0"/>
<obj type="nonInteractive01" x="5696" y="80" rot="0"/>
<obj type="nonInteractive01" x="5780" y="49" rot="0"/>
<obj type="nonInteractive01" x="5736" y="41" rot="0"/>
<obj type="nonInteractive02" x="7927" y="209" rot="0"/>
<obj type="nonInteractive02" x="8007" y="220" rot="10"/>
<obj type="nonInteractive02" x="8101" y="240" rot="20"/>
<obj type="nonInteractive03" x="8309" y="314" rot="20"/>
<obj type="nonInteractive03" x="8357" y="330" rot="20"/>
<obj type="nonInteractive01" x="11093" y="1420" rot="0"/>
<obj type="nonInteractive01" x="10939" y="1448" rot="0"/>
<obj type="nonInteractive01" x="10839" y="1422" rot="0"/>
<obj type="nonInteractive01" x="10651" y="1451" rot="0"/>
<obj type="nonInteractive01" x="10728" y="1432" rot="0"/>
<obj type="nonInteractive01" x="10795" y="1466" rot="0"/>
<obj type="nonInteractive01" x="13311" y="1069" rot="-60"/>
<obj type="nonInteractive01" x="13429" y="1018" rot="10"/>
<obj type="nonInteractive01" x="13397" y="1033" rot="-10"/>
<obj type="nonInteractive01" x="13362" y="1052" rot="-40"/>
<obj type="nonInteractive02" x="15093" y="543" rot="10"/>
<obj type="nonInteractive02" x="15022" y="544" rot="0"/>
<obj type="nonInteractive02" x="18483" y="730" rot="0"/>
<obj type="nonInteractive02" x="18598" y="783" rot="0"/>
<obj type="nonInteractive02" x="18692" y="752" rot="0"/>
<obj type="nonInteractive04" x="21785" y="-400" rot="0"/>
<obj type="nonInteractive04" x="21763" y="-394" rot="0"/>
<obj type="nonInteractive04" x="21652" y="-376" rot="0"/>
<obj type="nonInteractive04" x="23844" y="-177" rot="0"/>
<obj type="nonInteractive04" x="23877" y="-183" rot="0"/>
<obj type="nonInteractive04" x="25622" y="-387" rot="0"/>
<obj type="nonInteractive04" x="25655" y="-387" rot="0"/>
<obj type="nonInteractive04" x="25681" y="-385" rot="0"/>
<obj type="nonInteractive11" x="27311" y="-66" rot="20"/>
<obj type="nonInteractive11" x="27371" y="-34" rot="30"/>
<obj type="nonInteractive11" x="30035" y="953" rot="0"/>
<obj type="nonInteractive11" x="30162" y="959" rot="0"/>
<obj type="nonInteractive11" x="30271" y="957" rot="0"/>
<obj type="nonInteractive11" x="33344" y="1507" rot="0"/>
<obj type="nonInteractive11" x="33211" y="1506" rot="0"/>
<obj type="nonInteractive04" x="33458" y="1515" rot="10"/>
<obj type="nonInteractive04" x="34469" y="1712" rot="0"/>
<obj type="nonInteractive04" x="34438" y="1709" rot="0"/>
<obj type="nonInteractive04" x="36118" y="2124" rot="0"/>
<obj type="nonInteractive04" x="36147" y="2119" rot="0"/>
<obj type="nonInteractive04" x="36178" y="2114" rot="0"/>
<obj type="nonInteractive15" x="37021" y="1640" rot="0"/>
<obj type="nonInteractive15" x="36090" y="1804" rot="0"/>
<obj type="nonInteractive15" x="35597" y="1603" rot="0"/>
<obj type="nonInteractive15" x="35036" y="1510" rot="0"/>
<obj type="nonInteractive15" x="34690" y="1301" rot="0"/>
<obj type="nonInteractive15" x="33992" y="1363" rot="0"/>
<obj type="nonInteractive15" x="33071" y="1197" rot="0"/>
<obj type="nonInteractive15" x="31422" y="832" rot="0"/>
<obj type="nonInteractive15" x="27761" y="-268" rot="0"/>
<obj type="nonInteractive15" x="28225" y="160" rot="0"/>
<obj type="nonInteractive15" x="26988" y="-565" rot="0"/>
<obj type="nonInteractive15" x="25969" y="-644" rot="0"/>
<obj type="nonInteractive15" x="23631" y="-651" rot="0"/>
<obj type="nonInteractive15" x="23885" y="-467" rot="0"/>
<obj type="nonInteractive15" x="24159" y="-836" rot="0"/>
<obj type="nonInteractive15" x="21662" y="-651" rot="0"/>
<obj type="nonInteractive15" x="19811" y="155" rot="0"/>
<obj type="nonInteractive15" x="17140" y="512" rot="0"/>
<obj type="nonInteractive15" x="16784" y="318" rot="0"/>
<obj type="nonInteractive15" x="17556" y="215" rot="0"/>
<obj type="nonInteractive15" x="17637" y="449" rot="0"/>
<obj type="nonInteractive15" x="12734" y="973" rot="0"/>
<obj type="nonInteractive15" x="9039" y="127" rot="0"/>
<obj type="nonInteractive15" x="7352" y="-329" rot="0"/>
<obj type="nonInteractive15" x="5985" y="-296" rot="0"/>
<obj type="nonInteractive15" x="6369" y="-450" rot="0"/>
<obj type="nonInteractive15" x="6592" y="-265" rot="0"/>
<obj type="nonInteractive15" x="2135" y="444" rot="0"/>
<obj type="nonInteractive15" x="1725" y="489" rot="0"/>
<obj type="Pickup" x="2625" y="622" rot="0"/>
<obj type="Pickup" x="6275" y="-149" rot="0"/>
<obj type="Pickup" x="9595" y="921" rot="0"/>
<obj type="Pickup" x="11641" y="1289" rot="0"/>
<obj type="Pickup" x="14383" y="555" rot="0"/>
<obj type="Pickup" x="18324" y="512" rot="0"/>
<obj type="Pickup" x="22125" y="-497" rot="0"/>
<obj type="Pickup" x="22368" y="-508" rot="0"/>
<obj type="Pickup" x="23557" y="-536" rot="0"/>
<obj type="Pickup" x="29269" y="795" rot="0"/>
<obj type="Pickup" x="31939" y="1169" rot="0"/>
<obj type="Pickup" x="37473" y="1870" rot="0"/>
<obj type="girder01" x="454" y="436" rot="0"/>
<obj type="Pickup" x="5239" y="52" rot="0"/>
<obj type="Pickup" x="6208" y="-108" rot="0"/>
<obj type="Pickup" x="6344" y="-186" rot="0"/>
<obj type="Pickup" x="9790" y="1013" rot="0"/>
<obj type="Pickup" x="10031" y="1117" rot="0"/>
<obj type="Pickup" x="17660" y="721" rot="0"/>
<obj type="Pickup" x="17799" y="686" rot="0"/>
<obj type="Pickup" x="20458" y="9" rot="0"/>
<obj type="Pickup" x="20603" y="-83" rot="0"/>
<obj type="Pickup" x="20801" y="-179" rot="0"/>
<obj type="Pickup" x="23387" y="-432" rot="0"/>
<obj type="Pickup" x="23474" y="-486" rot="0"/>
<obj type="Pickup" x="25860" y="-500" rot="0"/>
<obj type="Pickup" x="27631" y="32" rot="0"/>
<obj type="Pickup" x="27752" y="130" rot="0"/>
<obj type="Pickup" x="27874" y="224" rot="0"/>
<obj type="Pickup" x="31382" y="1077" rot="0"/>
<obj type="Pickup" x="31528" y="1128" rot="0"/>
<obj type="Pickup" x="32819" y="1440" rot="0"/>
<obj type="Pickup" x="32752" y="1491" rot="0"/>
<obj type="Pickup" x="36678" y="1965" rot="0"/>
<obj type="Pickup" x="36803" y="1934" rot="0"/>
<obj type="Pickup" x="16374" y="608" rot="0"/>
<obj type="Pickup" x="16470" y="575" rot="0"/>
<obj type="Pickup" x="16575" y="563" rot="0"/>
<obj type="Pickup" x="25065" y="-367" rot="0"/>
<obj type="Pickup" x="25267" y="-418" rot="0"/>
<obj type="Pickup" x="25486" y="-435" rot="0"/>
<line>
<points a="40,110, 269,114, 388,782, 419,787, 581,788, 981,788, 1381,788, 1470,787, 1893,769, 2334,742"/>
<points a="2689,705, 2971,666, 3318,600, 3648,545, 4090,439, 4407,358, 4782,241, 5133,128, 5401,57, 5566,34"/>
<points a="5876,15, 6055,14, 6476,22, 7156,64, 7621,138, 8059,230, 8395,343, 8724,495, 9174,750, 9487,920"/>
<points a="9823,1081, 10194,1229, 10538,1353, 10812,1399, 10998,1413, 11398,1413, 11725,1409, 12080,1376, 12540,1295, 12882,1214"/>
<points a="13091,1142, 13391,1020, 13725,889, 13933,811, 14242,703, 14511,627, 14757,579, 15032,547, 15353,545, 15690,572"/>
<points a="16000,632, 16261,720, 16488,770, 16703,805, 16967,808, 17227,804, 17437,790, 17643,762, 17801,731, 18040,659"/>
<points a="18112,645, 18157,645, 18311,660, 18396,696, 18456,724, 18505,735, 18569,744, 18635,744, 18689,736, 18829,700"/>
<points a="18873,691, 18921,692, 18964,702, 19102,733, 19167,750, 19225,755, 19307,755, 19361,752, 19388,748, 19644,684"/>
<points a="19728,641, 20039,415, 20278,204, 20398,98, 20606,-36, 20859,-146, 21116,-239, 21473,-341, 21881,-417, 22175,-452"/>
<points a="22326,-459, 22494,-446, 22594,-404, 22692,-363, 22784,-334, 22865,-323, 22921,-320, 22972,-319, 23031,-322, 23068,-324"/>
<points a="23103,-329, 23132,-334, 23194,-345, 23241,-346, 23297,-343, 23376,-313, 23415,-301, 23481,-268, 23531,-245, 23602,-221"/>
<points a="23684,-190, 23722,-184, 23777,-177, 23823,-178, 23871,-182, 23921,-192, 24029,-210, 24103,-210, 24175,-201, 24222,-186"/>
<points a="24276,-180, 24324,-180, 24488,-187, 24544,-194, 24766,-232, 24878,-267, 25179,-355, 25331,-379, 25595,-386, 25897,-386"/>
<points a="26164,-377, 26479,-342, 26823,-271, 27129,-157, 27331,-63, 27645,126, 27884,308, 28142,503, 28376,650, 28583,742"/>
<points a="28888,844, 29157,896, 29470,939, 29736,949, 29936,949, 30231,949, 30603,965, 30903,1001, 31266,1085, 31657,1212"/>
<points a="31853,1286, 32156,1459, 32276,1525, 32384,1569, 32495,1604, 32543,1606, 32636,1601, 32771,1597, 32871,1590, 32931,1568"/>
<points a="33081,1531, 33166,1510, 33259,1501, 33353,1503, 33454,1517, 33606,1557, 33810,1628, 33891,1658, 33993,1692, 34050,1701"/>
<points a="34183,1710, 34263,1708, 34313,1705, 34356,1707, 34544,1714, 34604,1728, 34755,1784, 34936,1868, 35072,1953, 35144,1996"/>
<points a="35269,2046, 35417,2095, 35597,2123, 35733,2132, 35814,2135, 36003,2135, 36064,2131, 36261,2107, 36509,2056, 36665,2009"/>
<points a="36782,1989, 36883,1973, 36955,1971, 37251,1962, 37343,1963, 37441,1975, 37630,2018, 37870,2095, 38009,2142, 38095,2168"/>
<points a="38182,2189, 38241,2198, 38305,2201, 38361,2201, 38861,2201, 39211,2201, 39761,2201, 40016,2195, 40080,2190, 40108,2178"/>
<points a="40148,2158, 40167,2137, 40364,1059, 41914,1059, 42314,1059"/>
</line>
</level>
<level name="Dunes: Big Drift" category="0" fillframe="1" surfaceframe="2" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1" exclusivechar="-1">
<obj type="endrace" x="49330" y="2819" rot="0"/>
<obj type="Checkpoint" x="1680" y="1537" rot="0"/>
<obj type="Checkpoint" x="5035" y="1592" rot="0"/>
<obj type="Checkpoint" x="8792" y="1670" rot="0"/>
<obj type="Checkpoint" x="13077" y="1816" rot="0"/>
<obj type="Checkpoint" x="15476" y="1772" rot="0"/>
<obj type="Checkpoint" x="20133" y="2048" rot="0"/>
<obj type="Checkpoint" x="25815" y="1895" rot="0"/>
<obj type="Checkpoint" x="29576" y="2674" rot="0"/>
<obj type="Checkpoint" x="35980" y="2967" rot="0"/>
<obj type="Checkpoint" x="39526" y="2749" rot="0"/>
<obj type="nonInteractive02" x="11598" y="1788" rot="0"/>
<obj type="nonInteractive02" x="11598" y="1788" rot="0"/>
<obj type="nonInteractive07" x="12362" y="1760" rot="0"/>
<obj type="nonInteractive07" x="13023" y="1816" rot="0"/>
<obj type="nonInteractive07" x="14737" y="1705" rot="0"/>
<obj type="nonInteractive07" x="14737" y="1705" rot="0"/>
<obj type="nonInteractive05" x="14640" y="1707" rot="0"/>
<obj type="nonInteractive06" x="14608" y="1706" rot="0"/>
<obj type="nonInteractive06" x="14697" y="1704" rot="0"/>
<obj type="nonInteractive06" x="14808" y="1689" rot="0"/>
<obj type="nonInteractive06" x="15400" y="1777" rot="0"/>
<obj type="nonInteractive06" x="15979" y="1758" rot="0"/>
<obj type="nonInteractive06" x="18505" y="1148" rot="0"/>
<obj type="nonInteractive06" x="19659" y="2050" rot="0"/>
<obj type="nonInteractive06" x="21148" y="2014" rot="0"/>
<obj type="nonInteractive09" x="21960" y="2085" rot="0"/>
<obj type="nonInteractive09" x="21960" y="2085" rot="0"/>
<obj type="nonInteractive09" x="23877" y="2014" rot="0"/>
<obj type="nonInteractive09" x="26967" y="1714" rot="0"/>
<obj type="nonInteractive09" x="29486" y="2676" rot="0"/>
<obj type="nonInteractive09" x="31256" y="2584" rot="0"/>
<obj type="nonInteractive02" x="30818" y="2585" rot="0"/>
<obj type="nonInteractive02" x="31526" y="2579" rot="0"/>
<obj type="nonInteractive07" x="31906" y="2515" rot="0"/>
<obj type="nonInteractive07" x="32594" y="2515" rot="0"/>
<obj type="nonInteractive07" x="36083" y="2965" rot="0"/>
<obj type="nonInteractive07" x="39248" y="2751" rot="0"/>
<obj type="nonInteractive15" x="4306" y="1095" rot="0"/>
<obj type="nonInteractive15" x="4681" y="1266" rot="0"/>
<obj type="nonInteractive15" x="4801" y="961" rot="0"/>
<obj type="nonInteractive15" x="4801" y="961" rot="0"/>
<obj type="nonInteractive15" x="6050" y="915" rot="0"/>
<obj type="nonInteractive15" x="6378" y="1035" rot="0"/>
<obj type="nonInteractive15" x="6636" y="1244" rot="0"/>
<obj type="nonInteractive15" x="10227" y="997" rot="0"/>
<obj type="nonInteractive15" x="10488" y="1117" rot="0"/>
<obj type="nonInteractive15" x="10269" y="771" rot="0"/>
<obj type="nonInteractive15" x="9912" y="899" rot="0"/>
<obj type="nonInteractive15" x="10805" y="1335" rot="0"/>
<obj type="nonInteractive15" x="14385" y="1240" rot="0"/>
<obj type="nonInteractive15" x="14118" y="1462" rot="0"/>
<obj type="nonInteractive15" x="14803" y="1246" rot="0"/>
<obj type="nonInteractive15" x="19057" y="885" rot="0"/>
<obj type="nonInteractive15" x="19450" y="1256" rot="0"/>
<obj type="nonInteractive15" x="19712" y="1013" rot="0"/>
<obj type="nonInteractive15" x="19504" y="1579" rot="0"/>
<obj type="nonInteractive15" x="19958" y="1340" rot="0"/>
<obj type="nonInteractive15" x="20133" y="1744" rot="0"/>
<obj type="nonInteractive15" x="21749" y="1680" rot="0"/>
<obj type="nonInteractive15" x="22082" y="1516" rot="0"/>
<obj type="nonInteractive15" x="25183" y="1267" rot="0"/>
<obj type="nonInteractive15" x="25785" y="1285" rot="0"/>
<obj type="nonInteractive15" x="25726" y="1591" rot="0"/>
<obj type="nonInteractive15" x="26181" y="1373" rot="0"/>
<obj type="nonInteractive15" x="27618" y="1500" rot="0"/>
<obj type="nonInteractive15" x="33918" y="1889" rot="0"/>
<obj type="nonInteractive15" x="34324" y="1947" rot="0"/>
<obj type="nonInteractive15" x="37579" y="2363" rot="0"/>
<obj type="nonInteractive15" x="37919" y="2449" rot="0"/>
<obj type="nonInteractive15" x="37965" y="2080" rot="0"/>
<obj type="nonInteractive15" x="38794" y="2051" rot="0"/>
<obj type="nonInteractive15" x="38951" y="2248" rot="0"/>
<obj type="nonInteractive15" x="39300" y="2603" rot="0"/>
<obj type="nonInteractive15" x="39385" y="2362" rot="0"/>
<obj type="nonInteractive15" x="42794" y="1308" rot="0"/>
<obj type="nonInteractive15" x="43051" y="1201" rot="0"/>
<obj type="nonInteractive15" x="43287" y="1395" rot="0"/>
<line>
<points a="39,152, 854,150, 1053,155, 1095,180, 1251,1524, 1290,1540, 1358,1539, 2158,1539, 2908,1539, 3309,1539"/>
<points a="3704,1529, 3814,1518, 4005,1481, 4087,1445, 4135,1421, 4158,1404, 4169,1419, 4182,1461, 4200,1510, 4215,1523"/>
<points a="4235,1528, 4310,1532, 4419,1526, 4448,1520, 4475,1509, 4491,1496, 4502,1485, 4514,1501, 4521,1520, 4532,1556"/>
<points a="4544,1570, 4561,1579, 4639,1589, 4758,1598, 4826,1597, 5148,1595, 5279,1590, 5508,1578, 5618,1565, 5819,1539"/>
<points a="5886,1514, 5995,1462, 6057,1421, 6087,1379, 6111,1338, 6126,1352, 6147,1390, 6167,1451, 6198,1537, 6224,1564"/>
<points a="6266,1585, 6361,1598, 6542,1606, 6828,1602, 7087,1587, 7328,1561, 7590,1546, 7937,1556, 8226,1585, 8317,1601"/>
<points a="8647,1661, 8732,1673, 8802,1674, 9006,1664, 9106,1645, 9300,1599, 9419,1584, 9649,1562, 9763,1545, 9927,1509"/>
<points a="10023,1473, 10074,1435, 10127,1384, 10147,1351, 10192,1345, 10271,1353, 10332,1371, 10416,1405, 10472,1448, 10583,1546"/>
<points a="10654,1618, 10758,1692, 10843,1735, 10984,1770, 11247,1790, 11351,1795, 11559,1795, 11645,1788, 11874,1760, 11961,1755"/>
<points a="12044,1755, 12440,1763, 12511,1780, 12636,1809, 12704,1813, 12774,1815, 13148,1814, 13470,1813, 13785,1810, 14009,1795"/>
<points a="14120,1781, 14194,1760, 14293,1721, 14354,1683, 14387,1652, 14406,1625, 14421,1596, 14445,1602, 14479,1624, 14503,1655"/>
<points a="14541,1682, 14595,1699, 14674,1705, 14732,1706, 14770,1697, 14839,1670, 14869,1647, 14894,1612, 14924,1618, 14957,1634"/>
<points a="14984,1652, 15035,1692, 15102,1728, 15233,1758, 15367,1774, 15465,1776, 15721,1771, 16097,1750, 16382,1711, 16613,1676"/>
<points a="16867,1636, 17205,1556, 17518,1444, 17754,1359, 17886,1304, 18113,1217, 18355,1168, 18583,1140, 18707,1131, 18887,1133"/>
<points a="18915,1161, 18969,1342, 19076,1669, 19166,1915, 19187,1944, 19205,1962, 19242,1987, 19291,2008, 19419,2040, 19555,2048"/>
<points a="19814,2051, 20318,2052, 20718,2052, 20781,2047, 21047,2027, 21212,2007, 21408,1967, 21483,1943, 21553,1931, 21589,1931"/>
<points a="21605,1937, 21612,1963, 21629,2019, 21650,2037, 21696,2058, 21778,2075, 21855,2085, 22040,2084, 22316,2079, 22566,2079"/>
<points a="22932,2071, 23179,2061, 23425,2047, 23609,2035, 24029,1995, 24207,1971, 24457,1941, 24535,1925, 24675,1873, 24833,1800"/>
<points a="24988,1713, 25093,1625, 25132,1592, 25172,1562, 25214,1550, 25245,1548, 25303,1546, 25321,1560, 25330,1586, 25365,1726"/>
<points a="25394,1783, 25437,1827, 25481,1855, 25538,1871, 25701,1887, 25757,1895, 25822,1900, 25895,1893, 25953,1861, 25998,1823"/>
<points a="26044,1806, 26130,1802, 26186,1826, 26256,1856, 26310,1860, 26347,1856, 26419,1845, 26489,1832, 26563,1818, 26600,1807"/>
<points a="26636,1783, 26682,1750, 26713,1737, 26768,1718, 26844,1711, 26904,1710, 27106,1717, 27128,1723, 27214,1746, 27285,1783"/>
<points a="27402,1831, 27807,1996, 28229,2230, 28597,2405, 28840,2502, 29147,2618, 29356,2673, 29633,2676, 29845,2663, 30260,2619"/>
<points a="30534,2594, 30949,2583, 31399,2583, 31465,2583, 31533,2582, 31558,2579, 31652,2554, 31775,2524, 31841,2515, 31865,2515"/>
<points a="32465,2515, 32715,2515, 32851,2514, 33047,2514, 33347,2514, 33547,2514, 33575,2514, 33635,2514, 33699,2512, 33749,2508"/>
<points a="33822,2496, 33863,2485, 33891,2470, 33933,2440, 33964,2408, 33984,2373, 33996,2338, 34006,2299, 34020,2292, 34052,2294"/>
<points a="34156,2308, 34302,2348, 34499,2423, 34675,2501, 34757,2550, 34936,2662, 35024,2718, 35112,2765, 35208,2812, 35401,2893"/>
<points a="35526,2934, 35640,2953, 35913,2971, 36162,2963, 36438,2948, 36674,2915, 36919,2861, 37163,2787, 37249,2749, 37446,2679"/>
<points a="37502,2669, 37538,2672, 37551,2685, 37558,2721, 37568,2738, 37595,2758, 37647,2771, 37726,2764, 37866,2742, 37945,2710"/>
<points a="38010,2683, 38148,2597, 38252,2506, 38288,2463, 38319,2429, 38401,2372, 38466,2339, 38519,2321, 38570,2307, 38612,2304"/>
<points a="38643,2310, 38669,2345, 38684,2405, 38692,2526, 38704,2614, 38729,2657, 38786,2701, 38889,2740, 38981,2749, 39250,2751"/>
<points a="39754,2752, 40098,2736, 40387,2699, 40762,2620, 41141,2532, 41550,2422, 41830,2333, 42069,2245, 42340,2142, 42504,2070"/>
<points a="42602,1998, 42735,1873, 42795,1796, 42837,1716, 42866,1628, 42895,1623, 42977,1625, 43097,1643, 43178,1673, 43327,1745"/>
<points a="43476,1828, 43756,1987, 44103,2175, 44487,2330, 44754,2427, 45196,2571, 45519,2660, 45924,2746, 46349,2802, 46796,2820"/>
<points a="47346,2820, 47646,2820, 48346,2820, 48996,2820, 49646,2820, 50296,2820, 50328,2818, 50386,2807, 50414,2787, 50496,2483"/>
<points a="50553,1422, 50595,1045, 50635,990, 50677,973, 53021,970"/>
</line>
</level>
<level name="Dunes: Dried Up River Bed" category="0" fillframe="1" surfaceframe="2" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1" exclusivechar="-1">
<obj type="endrace" x="45549" y="1652" rot="0"/>
<obj type="Checkpoint" x="1982" y="1253" rot="0"/>
<obj type="Checkpoint" x="5377" y="1265" rot="0"/>
<obj type="Checkpoint" x="8750" y="1319" rot="0"/>
<obj type="Checkpoint" x="10936" y="1319" rot="0"/>
<obj type="Checkpoint" x="13798" y="3312" rot="0"/>
<obj type="Checkpoint" x="16846" y="3353" rot="0"/>
<obj type="Checkpoint" x="19586" y="3363" rot="0"/>
<obj type="Checkpoint" x="23735" y="3370" rot="0"/>
<obj type="Checkpoint" x="27589" y="3399" rot="0"/>
<obj type="Checkpoint" x="32935" y="1500" rot="0"/>
<obj type="Checkpoint" x="35069" y="1477" rot="0"/>
<obj type="Checkpoint" x="38355" y="1561" rot="0"/>
<obj type="Checkpoint" x="41622" y="1635" rot="0"/>
<obj type="Checkpoint" x="43813" y="1524" rot="0"/>
<obj type="furniture04" x="13022" y="3291" rot="0"/>
<obj type="furniture04" x="13090" y="3298" rot="0"/>
<obj type="furniture04" x="13165" y="3298" rot="0"/>
<obj type="furniture04" x="14349" y="3298" rot="0"/>
<obj type="furniture04" x="14850" y="3319" rot="0"/>
<obj type="furniture04" x="14900" y="3312" rot="0"/>
<obj type="furniture04" x="14952" y="3299" rot="0"/>
<obj type="furniture04" x="15040" y="3325" rot="0"/>
<obj type="furniture04" x="14912" y="3325" rot="0"/>
<obj type="furniture04" x="14966" y="3320" rot="0"/>
<obj type="furniture04" x="14998" y="3314" rot="0"/>
<obj type="furniture04" x="16462" y="3325" rot="10"/>
<obj type="furniture04" x="17336" y="3362" rot="0"/>
<obj type="furniture04" x="17293" y="3368" rot="0"/>
<obj type="furniture04" x="18256" y="3364" rot="0"/>
<obj type="furniture04" x="18333" y="3359" rot="0"/>
<obj type="furniture04" x="18359" y="3373" rot="0"/>
<obj type="furniture04" x="19522" y="3362" rot="0"/>
<obj type="furniture04" x="19488" y="3372" rot="0"/>
<obj type="furniture04" x="21588" y="3333" rot="0"/>
<obj type="furniture04" x="21675" y="3335" rot="0"/>
<obj type="furniture04" x="21634" y="3325" rot="0"/>
<obj type="furniture04" x="21554" y="3336" rot="0"/>
<obj type="furniture04" x="24316" y="3359" rot="0"/>
<obj type="furniture04" x="24382" y="3362" rot="0"/>
<obj type="furniture04" x="24275" y="3364" rot="0"/>
<obj type="furniture04" x="25139" y="3390" rot="0"/>
<obj type="furniture04" x="25196" y="3393" rot="0"/>
<obj type="furniture04" x="25098" y="3393" rot="0"/>
<obj type="furniture04" x="25051" y="3396" rot="0"/>
<obj type="furniture04" x="25180" y="3383" rot="0"/>
<obj type="furniture05" x="28577" y="3403" rot="0"/>
<obj type="furniture05" x="28502" y="3404" rot="0"/>
<obj type="furniture05" x="27797" y="3404" rot="0"/>
<obj type="furniture05" x="27717" y="3407" rot="0"/>
<obj type="furniture05" x="27003" y="3409" rot="0"/>
<obj type="furniture05" x="26952" y="3404" rot="0"/>
<obj type="furniture05" x="26922" y="3404" rot="0"/>
<obj type="furniture05" x="26890" y="3407" rot="0"/>
<obj type="furniture05" x="25529" y="3394" rot="0"/>
<obj type="furniture05" x="25496" y="3390" rot="0"/>
<obj type="furniture05" x="25474" y="3397" rot="0"/>
<obj type="furniture05" x="23652" y="3374" rot="0"/>
<obj type="furniture05" x="23622" y="3379" rot="0"/>
<obj type="furniture05" x="23598" y="3375" rot="0"/>
<obj type="furniture05" x="23637" y="3372" rot="0"/>
<obj type="furniture05" x="23620" y="3363" rot="0"/>
<obj type="furniture05" x="23571" y="3379" rot="0"/>
<obj type="furniture05" x="22424" y="3342" rot="0"/>
<obj type="furniture05" x="22477" y="3345" rot="0"/>
<obj type="furniture05" x="22452" y="3350" rot="0"/>
<obj type="furniture05" x="20764" y="3332" rot="0"/>
<obj type="furniture05" x="20818" y="3336" rot="0"/>
<obj type="furniture05" x="19407" y="3367" rot="0"/>
<obj type="furniture05" x="17532" y="3361" rot="0"/>
<obj type="furniture05" x="17390" y="3364" rot="0"/>
<obj type="furniture05" x="17441" y="3357" rot="0"/>
<obj type="furniture05" x="17473" y="3366" rot="0"/>
<obj type="furniture05" x="17417" y="3362" rot="0"/>
<obj type="furniture05" x="16408" y="3318" rot="0"/>
<obj type="furniture05" x="15494" y="3328" rot="0"/>
<obj type="furniture05" x="15521" y="3327" rot="0"/>
<obj type="furniture05" x="15540" y="3322" rot="0"/>
<obj type="furniture05" x="14446" y="3298" rot="0"/>
<obj type="furniture05" x="13440" y="3271" rot="0"/>
<obj type="furniture05" x="13427" y="3279" rot="0"/>
<obj type="furniture05" x="13126" y="3293" rot="0"/>
<obj type="SandRamp" x="4840" y="1282" rot="0"/>
<obj type="SandRamp" x="6110" y="1274" rot="0"/>
<obj type="SandRamp" x="9012" y="1362" rot="0"/>
<obj type="SandRamp" x="14158" y="3303" rot="0"/>
<obj type="SandRamp" x="16930" y="3372" rot="0"/>
<obj type="SandRamp" x="20361" y="3342" rot="0"/>
<obj type="SandRamp" x="24843" y="3393" rot="0"/>
<obj type="SandRamp" x="33241" y="1511" rot="0"/>
<obj type="SandRamp" x="33400" y="1517" rot="0"/>
<obj type="SandRamp" x="33572" y="1502" rot="0"/>
<obj type="SandRamp" x="23380" y="3380" rot="0"/>
<line>
<points a="23,231, 1308,235, 1344,258, 1424,341, 1539,1214, 1552,1229, 1575,1243, 1603,1253, 1624,1255, 1874,1255"/>
<points a="2324,1255, 2674,1255, 2981,1254, 3030,1253, 3066,1245, 3088,1245, 3102,1256, 3135,1260, 3176,1258, 3313,1249"/>
<points a="3362,1240, 3389,1245, 3418,1252, 3442,1258, 3480,1258, 3529,1256, 3552,1249, 3578,1243, 3635,1242, 3685,1244"/>
<points a="3771,1249, 4004,1253, 4434,1257, 4481,1257, 4511,1253, 4528,1248, 4543,1249, 4559,1253, 4587,1262, 4655,1264"/>
<points a="4707,1263, 4744,1255, 4773,1251, 4880,1252, 4925,1254, 4947,1258, 5097,1265, 5646,1262, 5692,1254, 5713,1241"/>
<points a="5736,1235, 5762,1235, 5790,1237, 5888,1254, 5925,1258, 5974,1258, 6014,1258, 6063,1256, 6475,1258, 6741,1253"/>
<points a="6766,1248, 6791,1239, 6823,1238, 6841,1240, 7008,1253, 7086,1266, 7168,1278, 7238,1289, 7289,1297, 7335,1302"/>
<points a="7395,1300, 7436,1296, 7467,1295, 7502,1295, 7527,1298, 7545,1303, 7691,1322, 7777,1324, 7846,1324, 7920,1318"/>
<points a="7942,1316, 7987,1314, 8030,1314, 8063,1318, 8078,1321, 8157,1337, 8227,1337, 8302,1340, 8374,1336, 8418,1328"/>
<points a="8435,1326, 8737,1321, 8808,1321, 8854,1329, 8882,1335, 8942,1339, 8998,1337, 9043,1332, 9068,1328, 9115,1322"/>
<points a="9173,1321, 9232,1323, 9313,1329, 9381,1330, 9414,1330, 9460,1323, 9491,1319, 9512,1319, 9533,1325, 9631,1353"/>
<points a="9746,1359, 9878,1361, 10165,1363, 10407,1362, 10461,1359, 10507,1354, 10526,1356, 10550,1362, 10584,1363, 10607,1360"/>
<points a="10682,1352, 10739,1350, 10790,1340, 10836,1332, 10909,1321, 10943,1321, 10986,1321, 11031,1322, 12730,3251, 12757,3269"/>
<points a="12793,3279, 12859,3291, 12924,3292, 13004,3288, 13049,3287, 13096,3290, 13144,3295, 13171,3295, 13189,3297, 13213,3286"/>
<points a="13366,3282, 13463,3268, 13530,3276, 13577,3297, 13686,3304, 13794,3314, 13915,3315, 14020,3313, 14070,3291, 14120,3287"/>
<points a="14142,3288, 14472,3298, 14551,3314, 14665,3314, 14725,3311, 14762,3307, 14788,3310, 15096,3325, 15193,3326, 15523,3325"/>
<points a="15531,3316, 15797,3314, 15866,3305, 15934,3305, 16334,3305, 16414,3312, 16477,3319, 16578,3339, 16666,3346, 16891,3355"/>
<points a="16981,3358, 17029,3358, 17507,3359, 17627,3355, 17691,3348, 17716,3346, 17946,3349, 18018,3357, 18094,3358, 18119,3358"/>
<points a="18395,3364, 18472,3367, 18550,3369, 18645,3360, 19153,3347, 19269,3349, 19346,3358, 19408,3364, 19730,3367, 19817,3352"/>
<points a="20522,3329, 21354,3334, 21410,3324, 22129,3333, 22275,3340, 22788,3349, 23486,3374, 24027,3371, 24071,3358, 24106,3358"/>
<points a="24782,3361, 24863,3366, 24922,3387, 24994,3389, 25085,3389, 25544,3390, 25669,3378, 25758,3373, 25793,3374, 26156,3385"/>
<points a="26323,3400, 26398,3402, 26437,3402, 26878,3401, 27818,3401, 28112,3383, 28199,3382, 28237,3401, 28293,3403, 28884,3393"/>
<points a="28942,3371, 29007,3369, 29062,3371, 29301,3358, 29374,3354, 29425,3344, 29483,3317, 30938,1861, 31280,1534, 31362,1491"/>
<points a="31414,1468, 31459,1465, 31502,1462, 31848,1475, 31928,1487, 31981,1489, 32042,1491, 32426,1503, 32535,1504, 32599,1497"/>
<points a="32631,1493, 32658,1480, 32684,1476, 32715,1486, 32745,1498, 33159,1503, 33266,1501, 33329,1490, 33355,1489, 33381,1503"/>
<points a="33409,1506, 33447,1503, 33464,1500, 33765,1490, 33806,1484, 33844,1494, 33867,1496, 33910,1493, 33959,1488, 33981,1474"/>
<points a="33998,1463, 34024,1457, 34041,1457, 34066,1462, 34087,1476, 34150,1490, 34205,1490, 34263,1488, 34304,1477, 34338,1477"/>
<points a="34371,1485, 34404,1486, 34582,1492, 34650,1482, 34698,1464, 34730,1460, 34752,1460, 34771,1463, 35073,1478, 35150,1475"/>
<points a="35229,1457, 35262,1434, 35306,1419, 35340,1409, 35391,1407, 35403,1408, 35434,1416, 35465,1418, 35484,1418, 35567,1416"/>
<points a="35600,1411, 35638,1407, 35679,1407, 35719,1418, 35750,1426, 35810,1428, 35841,1427, 35875,1427, 35906,1442, 35941,1456"/>
<points a="36050,1493, 36102,1517, 36156,1524, 36203,1523, 36246,1522, 36486,1519, 36581,1513, 36643,1505, 36684,1501, 36841,1481"/>
<points a="36926,1464, 37001,1452, 37043,1441, 37092,1437, 37119,1438, 37138,1449, 37172,1457, 37191,1462, 37285,1471, 37361,1470"/>
<points a="37428,1467, 37471,1465, 37506,1483, 37545,1490, 37583,1490, 37601,1490, 37815,1487, 37841,1487, 37882,1485, 37911,1497"/>
<points a="37927,1515, 37988,1541, 38010,1543, 38200,1565, 38269,1565, 38337,1565, 38385,1561, 38595,1547, 38610,1545, 38619,1556"/>
<points a="38644,1573, 38702,1579, 38763,1582, 38802,1581, 39119,1565, 39197,1548, 39257,1521, 39290,1504, 39323,1501, 39349,1500"/>
<points a="39493,1479, 39557,1476, 39585,1482, 39613,1494, 39657,1497, 39691,1497, 39720,1496, 39759,1490, 39790,1483, 39983,1465"/>
<points a="40044,1451, 40104,1449, 40144,1451, 40322,1465, 40409,1490, 40492,1507, 40526,1507, 40851,1543, 40961,1559, 41054,1576"/>
<points a="41106,1579, 41360,1602, 41456,1624, 41541,1635, 41592,1635, 41638,1635, 41845,1620, 41930,1606, 41985,1590, 42031,1569"/>
<points a="42080,1564, 42128,1557, 42222,1566, 42270,1578, 42331,1582, 42364,1581, 42412,1566, 42438,1565, 42467,1573, 42484,1575"/>
<points a="42681,1579, 42746,1574, 42766,1567, 42806,1550, 42863,1546, 42883,1553, 42914,1560, 42949,1559, 43102,1555, 43149,1538"/>
<points a="43190,1510, 43216,1482, 43236,1474, 43270,1470, 43414,1477, 43456,1484, 43491,1509, 43522,1524, 43563,1532, 43586,1531"/>
<points a="43879,1524, 43929,1502, 43979,1502, 44016,1519, 44050,1539, 44220,1562, 44285,1584, 44368,1586, 44458,1600, 44501,1620"/>
<points a="44561,1639, 44602,1649, 44663,1651, 44863,1651, 45513,1651, 46363,1651, 46913,1651, 46948,1649, 46979,1637, 47016,1614"/>
<points a="47040,1568, 47537,66, 49687,66"/>
</line>
</level>
<level name="Dunes: Prisoner Special" category="0" fillframe="1" surfaceframe="2" surfacethickness="10" type="chase" opponents="21" win="1" exclusivechar="5">
<obj type="endrace" x="27753" y="3196" rot="0"/>
<obj type="Checkpoint" x="1720" y="2385" rot="0"/>
<obj type="furniture04" x="7490" y="3087" rot="0"/>
<obj type="furniture04" x="8655" y="3363" rot="0"/>
<obj type="furniture04" x="9203" y="3284" rot="0"/>
<obj type="furniture04" x="10577" y="3051" rot="0"/>
<obj type="furniture04" x="11126" y="3075" rot="0"/>
<obj type="furniture04" x="12780" y="3381" rot="0"/>
<obj type="furniture04" x="13592" y="3399" rot="0"/>
<obj type="furniture04" x="14904" y="3289" rot="0"/>
<obj type="furniture04" x="16801" y="3079" rot="0"/>
<obj type="furniture04" x="16838" y="3088" rot="0"/>
<obj type="furniture04" x="18971" y="3368" rot="0"/>
<obj type="furniture04" x="20687" y="3102" rot="0"/>
<obj type="furniture04" x="22918" y="3110" rot="0"/>
<obj type="furniture04" x="24508" y="3200" rot="0"/>
<line>
<points a="64,279, 1168,279, 1275,2365, 1327,2386, 2410,2387, 2617,2400, 2926,2463, 3282,2571, 3576,2606, 4383,2777"/>
<points a="4970,2800, 5160,2808, 5235,2817, 5310,2835, 5495,2876, 5592,2892, 5643,2894, 6068,2895, 6105,2900, 6245,2931"/>
<points a="6357,2982, 6436,3013, 6513,3034, 6757,3098, 6844,3115, 6896,3119, 7008,3111, 7081,3100, 7266,3082, 7362,3081"/>
<points a="7422,3082, 7643,3091, 7718,3101, 7775,3115, 8061,3185, 8103,3200, 8185,3241, 8230,3294, 8283,3330, 8341,3354"/>
<points a="8404,3361, 8719,3363, 8870,3385, 9027,3317, 9084,3284, 9314,3283, 9340,3419, 9500,3410, 9583,3371, 9751,3278"/>
<points a="9882,3209, 9975,3154, 10133,3103, 10198,3079, 10291,3061, 10682,3042, 10800,3043, 10878,3049, 11439,3094, 11583,3115"/>
<points a="11671,3140, 11945,3211, 12192,3288, 12347,3328, 12631,3368, 13013,3394, 13427,3400, 13591,3398, 13648,3392, 13685,3383"/>
<points a="13756,3355, 13836,3341, 13919,3338, 13995,3341, 14090,3341, 14167,3332, 14193,3325, 14271,3302, 14346,3276, 14409,3263"/>
<points a="14458,3261, 14615,3263, 14710,3268, 14760,3280, 14828,3286, 14881,3286, 15041,3277, 15134,3258, 15172,3236, 15305,3166"/>
<points a="15362,3136, 15429,3108, 15477,3094, 15626,3077, 15897,3068, 16297,3068, 16702,3076, 17020,3089, 17142,3093, 17204,3103"/>
<points a="17348,3139, 17437,3169, 17511,3205, 17583,3242, 17642,3266, 17713,3291, 17784,3315, 17864,3325, 17981,3343, 18036,3348"/>
<points a="18246,3359, 18550,3363, 18950,3363, 19400,3363, 19650,3357, 19933,3318, 20100,3279, 20281,3204, 20400,3147, 20484,3120"/>
<points a="20595,3104, 20676,3099, 20738,3099, 21088,3099, 21562,3105, 21977,3131, 22041,3148, 22172,3189, 22275,3225, 22329,3239"/>
<points a="22383,3239, 22487,3232, 22569,3214, 22646,3173, 22697,3146, 22741,3127, 22844,3113, 22899,3106, 22955,3106, 23006,3114"/>
<points a="23046,3132, 23098,3141, 23218,3154, 23337,3155, 23409,3146, 23451,3133, 23496,3123, 23713,3112, 23762,3112, 23980,3123"/>
<points a="24045,3133, 24089,3148, 24222,3182, 24417,3196, 24458,3196, 25058,3196, 26108,3196, 27158,3196, 28308,3196, 29308,3196"/>
<points a="30258,3196"/>
</line>
</level>
<!-- World 1 Volcania -->
<level name="Volcania: Foothills" category="0" fillframe="3" surfaceframe="4" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8" win="1" exclusivechar="-1">
<obj type="endrace" x="38533" y="-1811" rot="0"/>
<obj type="Checkpoint" x="2362" y="2313" rot="0"/>
<obj type="Checkpoint" x="6312" y="2068" rot="0"/>
<obj type="Checkpoint" x="8826" y="1658" rot="0"/>
<obj type="Checkpoint" x="11689" y="1397" rot="0"/>
<obj type="Checkpoint" x="14315" y="691" rot="0"/>
<obj type="Checkpoint" x="17255" y="179" rot="0"/>
<obj type="Checkpoint" x="19756" y="-401" rot="0"/>
<obj type="Checkpoint" x="22515" y="-922" rot="0"/>
<obj type="Checkpoint" x="24848" y="-960" rot="0"/>
<obj type="Checkpoint" x="27334" y="-1383" rot="0"/>
<obj type="Checkpoint" x="29370" y="-1339" rot="0"/>
<obj type="Checkpoint" x="31502" y="-1788" rot="0"/>
<obj type="Checkpoint" x="34297" y="-1724" rot="0"/>
<obj type="nonInteractive15" x="3854" y="2043" rot="0"/>
<obj type="nonInteractive15" x="5241" y="1917" rot="0"/>
<obj type="nonInteractive15" x="6288" y="1753" rot="0"/>
<obj type="nonInteractive15" x="6706" y="1723" rot="0"/>
<obj type="nonInteractive15" x="7680" y="1489" rot="0"/>
<obj type="nonInteractive15" x="7962" y="1306" rot="0"/>
<obj type="nonInteractive15" x="8652" y="1323" rot="0"/>
<obj type="nonInteractive15" x="10000" y="1001" rot="0"/>
<obj type="nonInteractive15" x="10534" y="741" rot="0"/>
<obj type="nonInteractive15" x="11153" y="773" rot="0"/>
<obj type="nonInteractive15" x="11505" y="928" rot="0"/>
<obj type="nonInteractive15" x="11930" y="591" rot="0"/>
<obj type="nonInteractive15" x="12286" y="714" rot="0"/>
<obj type="nonInteractive15" x="12636" y="812" rot="0"/>
<obj type="nonInteractive15" x="13996" y="397" rot="0"/>
<obj type="nonInteractive15" x="15339" y="191" rot="0"/>
<obj type="nonInteractive15" x="15002" y="124" rot="0"/>
<obj type="nonInteractive15" x="16041" y="89" rot="0"/>
<obj type="nonInteractive15" x="16477" y="-212" rot="0"/>
<obj type="nonInteractive15" x="17041" y="-165" rot="0"/>
<obj type="nonInteractive15" x="18659" y="-647" rot="0"/>
<obj type="nonInteractive15" x="19088" y="-805" rot="0"/>
<obj type="nonInteractive15" x="19158" y="-606" rot="0"/>
<obj type="nonInteractive15" x="19543" y="-701" rot="0"/>
<obj type="nonInteractive15" x="19864" y="-879" rot="0"/>
<obj type="nonInteractive15" x="20341" y="-1087" rot="0"/>
<obj type="nonInteractive15" x="21056" y="-1159" rot="0"/>
<obj type="nonInteractive15" x="21670" y="-1310" rot="0"/>
<obj type="nonInteractive15" x="22020" y="-1535" rot="0"/>
<obj type="nonInteractive15" x="22414" y="-1509" rot="0"/>
<obj type="nonInteractive15" x="22245" y="-1398" rot="0"/>
<obj type="nonInteractive15" x="23736" y="-899" rot="0"/>
<obj type="nonInteractive15" x="24414" y="-1169" rot="0"/>
<obj type="nonInteractive15" x="24960" y="-1363" rot="0"/>
<obj type="nonInteractive15" x="25381" y="-1664" rot="0"/>
<obj type="nonInteractive15" x="25273" y="-1568" rot="0"/>
<obj type="nonInteractive15" x="25770" y="-1903" rot="0"/>
<obj type="nonInteractive15" x="26252" y="-1948" rot="0"/>
<obj type="nonInteractive15" x="26171" y="-1807" rot="0"/>
<obj type="nonInteractive15" x="28772" y="-1926" rot="0"/>
<obj type="nonInteractive15" x="29068" y="-1988" rot="0"/>
<obj type="nonInteractive15" x="29659" y="-1829" rot="0"/>
<obj type="nonInteractive15" x="30123" y="-2177" rot="0"/>
<obj type="nonInteractive15" x="30230" y="-2367" rot="0"/>
<obj type="nonInteractive15" x="30512" y="-2157" rot="0"/>
<obj type="nonInteractive15" x="31005" y="-2152" rot="0"/>
<obj type="nonInteractive15" x="32325" y="-1982" rot="0"/>
<obj type="nonInteractive15" x="32499" y="-2287" rot="0"/>
<obj type="nonInteractive15" x="35609" y="-2242" rot="0"/>
<obj type="furniture04" x="36212" y="-1810" rot="0"/>
<obj type="furniture04" x="37765" y="-1810" rot="0"/>
<obj type="Pickup" x="3460" y="2267" rot="0"/>
<obj type="Pickup" x="3612" y="2261" rot="0"/>
<obj type="Pickup" x="5289" y="2097" rot="0"/>
<obj type="Pickup" x="5356" y="2087" rot="0"/>
<obj type="Pickup" x="6936" y="1946" rot="0"/>
<obj type="Pickup" x="7083" y="1895" rot="0"/>
<obj type="Pickup" x="7238" y="1827" rot="0"/>
<obj type="Pickup" x="8453" y="1480" rot="0"/>
<obj type="Pickup" x="8399" y="1510" rot="0"/>
<obj type="Pickup" x="8509" y="1475" rot="0"/>
<obj type="Pickup" x="9503" y="1576" rot="0"/>
<obj type="Pickup" x="9603" y="1575" rot="0"/>
<obj type="Pickup" x="10176" y="1256" rot="0"/>
<obj type="Pickup" x="10118" y="1260" rot="0"/>
<obj type="Pickup" x="10776" y="1067" rot="0"/>
<obj type="Pickup" x="10869" y="1037" rot="0"/>
<obj type="Pickup" x="10968" y="1043" rot="0"/>
<obj type="Pickup" x="11067" y="1065" rot="0"/>
<obj type="Pickup" x="11171" y="1114" rot="0"/>
<obj type="Pickup" x="11253" y="1171" rot="0"/>
<obj type="Pickup" x="11336" y="1241" rot="0"/>
<obj type="Pickup" x="12978" y="952" rot="0"/>
<obj type="Pickup" x="13131" y="884" rot="0"/>
<obj type="Pickup" x="13299" y="774" rot="0"/>
<obj type="Pickup" x="14111" y="587" rot="0"/>
<obj type="Pickup" x="15276" y="355" rot="0"/>
<obj type="Pickup" x="15347" y="369" rot="0"/>
<obj type="Pickup" x="16357" y="258" rot="0"/>
<obj type="Pickup" x="16439" y="180" rot="0"/>
<obj type="Pickup" x="16548" y="103" rot="0"/>
<obj type="Pickup" x="17428" y="56" rot="0"/>
<obj type="Pickup" x="18282" y="-16" rot="0"/>
<obj type="Pickup" x="18409" y="-37" rot="0"/>
<obj type="Pickup" x="18541" y="-104" rot="0"/>
<obj type="Pickup" x="18918" y="-359" rot="0"/>
<obj type="Pickup" x="18920" y="-400" rot="0"/>
<obj type="Pickup" x="18915" y="-321" rot="0"/>
<obj type="Pickup" x="19641" y="-450" rot="0"/>
<obj type="Pickup" x="20138" y="-558" rot="0"/>
<obj type="Pickup" x="20278" y="-581" rot="0"/>
<obj type="Pickup" x="20404" y="-609" rot="0"/>
<obj type="Pickup" x="21483" y="-987" rot="0"/>
<obj type="Pickup" x="21983" y="-1183" rot="0"/>
<obj type="Pickup" x="22068" y="-1151" rot="0"/>
<obj type="Pickup" x="23021" y="-802" rot="0"/>
<obj type="Pickup" x="23154" y="-767" rot="0"/>
<obj type="Pickup" x="23285" y="-730" rot="0"/>
<obj type="Pickup" x="24005" y="-726" rot="0"/>
<obj type="Pickup" x="24082" y="-790" rot="0"/>
<obj type="Pickup" x="24904" y="-1073" rot="0"/>
<obj type="Pickup" x="25318" y="-1244" rot="0"/>
<obj type="Pickup" x="25425" y="-1275" rot="0"/>
<obj type="Pickup" x="25532" y="-1343" rot="0"/>
<obj type="Pickup" x="26475" y="-1503" rot="0"/>
<obj type="Pickup" x="26603" y="-1474" rot="0"/>
<obj type="Pickup" x="26711" y="-1456" rot="0"/>
<obj type="Pickup" x="27585" y="-1479" rot="0"/>
<obj type="Pickup" x="28250" y="-1506" rot="0"/>
<obj type="Pickup" x="29220" y="-1415" rot="0"/>
<obj type="Pickup" x="29298" y="-1394" rot="0"/>
<obj type="Pickup" x="29143" y="-1453" rot="0"/>
<obj type="Pickup" x="29702" y="-1537" rot="0"/>
<obj type="Pickup" x="29936" y="-1598" rot="0"/>
<obj type="Pickup" x="30645" y="-1803" rot="0"/>
<obj type="Pickup" x="30738" y="-1816" rot="0"/>
<obj type="Pickup" x="30828" y="-1848" rot="0"/>
<obj type="Pickup" x="30920" y="-1895" rot="0"/>
<obj type="Pickup" x="32149" y="-1694" rot="0"/>
<obj type="Pickup" x="32244" y="-1658" rot="0"/>
<obj type="Pickup" x="32353" y="-1638" rot="0"/>
<obj type="Pickup" x="32996" y="-1699" rot="0"/>
<obj type="Pickup" x="33059" y="-1712" rot="0"/>
<obj type="Pickup" x="34760" y="-1802" rot="0"/>
<obj type="Pickup" x="34886" y="-1817" rot="0"/>
<obj type="Pickup" x="35029" y="-1834" rot="0"/>
<obj type="Pickup" x="36442" y="-1841" rot="0"/>
<obj type="Pickup" x="36549" y="-1843" rot="0"/>
<obj type="Pickup" x="36670" y="-1843" rot="0"/>
<obj type="Pickup" x="37742" y="-1919" rot="0"/>
<obj type="Pickup" x="37830" y="-1917" rot="0"/>
<line>
<points a="42,219, 1442,219, 1460,231, 1602,2295, 1655,2314, 2083,2314, 3383,2314, 3817,2294, 4012,2255, 4078,2235"/>
<points a="4131,2222, 4316,2209, 4391,2211, 4711,2228, 4864,2234, 5210,2221, 5458,2178, 5553,2141, 5708,2104, 6015,2059"/>
<points a="6102,2059, 6188,2071, 6389,2070, 6694,2039, 6928,1989, 7119,1930, 7267,1869, 7340,1817, 7429,1784, 7470,1766"/>
<points a="7510,1753, 7560,1749, 7691,1752, 7781,1767, 7837,1776, 7887,1776, 8096,1763, 8155,1740, 8311,1646, 8361,1614"/>
<points a="8404,1606, 8468,1609, 8619,1625, 8687,1652, 8932,1663, 8979,1659, 9021,1640, 9155,1615, 9223,1597, 9307,1589"/>
<points a="9361,1588, 9432,1595, 9658,1605, 9745,1597, 9790,1567, 9900,1478, 9969,1421, 10012,1390, 10036,1373, 10066,1358"/>
<points a="10093,1351, 10149,1348, 10191,1352, 10235,1363, 10284,1367, 10333,1359, 10367,1344, 10483,1290, 10561,1243, 10599,1213"/>
<points a="10685,1156, 10741,1121, 10780,1107, 10846,1083, 10893,1076, 10942,1078, 11038,1095, 11122,1119, 11173,1154, 11263,1230"/>
<points a="11319,1273, 11427,1341, 11534,1384, 11639,1398, 11705,1400, 11788,1398, 11850,1385, 11935,1359, 12011,1314, 12057,1267"/>
<points a="12132,1188, 12182,1146, 12248,1117, 12318,1104, 12391,1105, 12435,1109, 12604,1095, 12767,1070, 12926,1033, 13010,999"/>
<points a="13150,934, 13223,892, 13296,838, 13356,799, 13500,734, 13574,702, 13683,677, 13735,670, 13949,665, 14037,671"/>
<points a="14103,685, 14175,690, 14326,694, 14440,692, 14516,687, 14635,675, 14879,645, 14959,634, 15005,620, 15061,591"/>
<points a="15100,551, 15169,496, 15199,477, 15230,466, 15268,464, 15317,461, 15352,447, 15413,430, 15472,401, 15522,386"/>
<points a="15579,383, 15810,389, 15899,405, 15943,410, 16139,415, 16216,408, 16257,394, 16268,382, 16324,336, 16369,303"/>
<points a="16460,219, 16529,159, 16595,132, 16650,126, 16740,115, 16836,117, 16950,123, 17016,141, 17091,161, 17212,178"/>
<points a="17281,180, 17330,175, 17473,150, 17549,139, 17616,111, 17729,69, 17866,29, 17930,10, 17997,10, 18071,23"/>
<points a="18162,28, 18245,26, 18372,18, 18453,1, 18542,-43, 18668,-137, 18743,-166, 18786,-169, 18833,-185, 18861,-210"/>
<points a="18880,-236, 18907,-250, 18937,-250, 18974,-247, 19026,-244, 19058,-249, 19088,-261, 19120,-260, 19152,-245, 19180,-218"/>
<points a="19224,-200, 19274,-193, 19315,-195, 19339,-202, 19374,-219, 19407,-236, 19527,-320, 19565,-363, 19599,-391, 19628,-400"/>
<points a="19655,-403, 19686,-404, 19724,-400, 19781,-397, 19840,-399, 19897,-417, 19915,-425, 19954,-451, 19970,-467, 19994,-493"/>
<points a="20030,-510, 20195,-533, 20529,-597, 20887,-685, 20946,-708, 20986,-726, 21010,-739, 21024,-753, 21040,-765, 21058,-771"/>
<points a="21100,-779, 21132,-781, 21183,-780, 21212,-783, 21261,-787, 21280,-796, 21520,-898, 21787,-1031, 21828,-1052, 21859,-1066"/>
<points a="21884,-1083, 21900,-1094, 21921,-1101, 21951,-1101, 21977,-1100, 22010,-1094, 22042,-1084, 22121,-1058, 22174,-1025, 22371,-961"/>
<points a="22611,-893, 22963,-774, 23251,-697, 23440,-662, 23612,-638, 23794,-625, 23868,-626, 23917,-633, 23982,-650, 24020,-676"/>
<points a="24063,-712, 24106,-750, 24133,-774, 24152,-791, 24177,-800, 24193,-800, 24218,-795, 24244,-787, 24283,-788, 24308,-791"/>
<points a="24321,-799, 24360,-819, 24397,-847, 24434,-869, 24456,-871, 24474,-871, 24510,-863, 24546,-861, 24596,-868, 24626,-885"/>
<points a="24749,-937, 24791,-952, 24838,-959, 24865,-959, 24900,-959, 24969,-986, 25030,-1020, 25133,-1120, 25169,-1165, 25195,-1184"/>
<points a="25218,-1195, 25343,-1212, 25452,-1232, 25490,-1253, 25583,-1313, 25636,-1367, 25722,-1462, 25771,-1496, 25817,-1523, 25850,-1535"/>
<points a="25962,-1549, 26018,-1549, 26083,-1543, 26212,-1519, 26288,-1498, 26511,-1449, 26612,-1424, 26705,-1416, 26903,-1396, 27109,-1386"/>
<points a="27417,-1380, 27671,-1380, 27921,-1380, 27967,-1380, 28023,-1385, 28252,-1390, 28291,-1398, 28348,-1422, 28462,-1454, 28520,-1488"/>
<points a="28550,-1512, 28590,-1532, 28622,-1545, 28779,-1548, 28827,-1541, 28846,-1538, 28889,-1518, 29007,-1460, 29094,-1414, 29157,-1387"/>
<points a="29181,-1379, 29259,-1355, 29309,-1344, 29405,-1333, 29437,-1332, 29479,-1333, 29548,-1353, 29589,-1385, 29635,-1428, 29666,-1437"/>
<points a="29712,-1454, 29771,-1451, 29813,-1450, 29847,-1461, 29872,-1482, 29903,-1503, 29945,-1508, 30038,-1496, 30102,-1503, 30136,-1515"/>
<points a="30192,-1566, 30212,-1604, 30270,-1706, 30331,-1726, 30397,-1725, 30443,-1711, 30500,-1713, 30539,-1722, 30581,-1750, 30604,-1760"/>
<points a="30700,-1760, 30764,-1766, 30810,-1781, 30830,-1793, 30860,-1808, 30874,-1812, 30898,-1812, 31031,-1798, 31113,-1791, 31170,-1785"/>
<points a="31180,-1787, 31236,-1797, 31269,-1802, 31298,-1802, 31335,-1797, 31491,-1785, 31558,-1780, 31594,-1781, 31636,-1785, 31836,-1791"/>
<points a="31871,-1802, 31887,-1802, 31911,-1786, 32022,-1709, 32091,-1655, 32180,-1616, 32357,-1588, 32576,-1578, 32876,-1578, 32893,-1583"/>
<points a="33163,-1607, 33718,-1646, 34011,-1687, 34331,-1726, 34717,-1759, 34990,-1789, 35055,-1795, 35258,-1809, 35399,-1812, 35899,-1812"/>
<points a="36549,-1812, 37399,-1812, 38949,-1812, 40199,-1812, 40295,-1930, 41028,-1932"/>
</line>
</level>
<level name="Volcania: Up The Mountain" category="0" fillframe="3" surfaceframe="4" surfacethickness="10" type="race" opponents="2,3,4,5,6,7" win="1">
<obj type="endrace" x="24437" y="-7066" rot="0"/>
<obj type="Checkpoint" x="1857" y="1903" rot="0"/>
<obj type="Checkpoint" x="6081" y="672" rot="0"/>
<obj type="Checkpoint" x="7465" y="-232" rot="0"/>
<obj type="Checkpoint" x="9474" y="-1455" rot="0"/>
<obj type="Checkpoint" x="10779" y="-2311" rot="0"/>
<obj type="Checkpoint" x="12418" y="-3044" rot="0"/>
<obj type="Checkpoint" x="14297" y="-3615" rot="0"/>
<obj type="Checkpoint" x="16449" y="-4896" rot="0"/>
<obj type="Checkpoint" x="17481" y="-5292" rot="0"/>
<obj type="Checkpoint" x="18898" y="-5773" rot="0"/>
<obj type="Checkpoint" x="20826" y="-6888" rot="0"/>
<line>
<points a="35,245, 835,245, 852,254, 965,1892, 979,1904, 2479,1904, 3779,1904, 3984,1886, 4080,1865, 4203,1814"/>
<points a="4255,1781, 4325,1717, 4426,1631, 4501,1571, 4565,1539, 4725,1479, 4786,1453, 4844,1439, 5012,1411, 5150,1378"/>
<points a="5283,1305, 5451,1179, 5639,993, 5829,799, 5873,749, 5905,720, 5927,703, 6014,684, 6104,671, 6196,666"/>
<points a="6250,661, 6333,620, 6399,577, 6451,525, 6573,345, 6653,234, 6696,208, 6805,173, 6851,157, 6897,121"/>
<points a="6953,54, 6977,11, 6994,-34, 7009,-59, 7045,-112, 7120,-203, 7157,-230, 7214,-248, 7258,-248, 7321,-248"/>
<points a="7365,-234, 7405,-231, 7453,-232, 7564,-235, 7615,-239, 7645,-245, 7682,-262, 7718,-287, 7780,-339, 7863,-445"/>
<points a="7907,-524, 7955,-646, 7973,-668, 8005,-696, 8057,-726, 8112,-745, 8169,-768, 8226,-797, 8277,-842, 8377,-921"/>
<points a="8422,-945, 8463,-961, 8511,-970, 8625,-981, 8665,-992, 8701,-1015, 8918,-1170, 9140,-1341, 9207,-1396, 9241,-1432"/>
<points a="9280,-1475, 9317,-1515, 9337,-1532, 9368,-1535, 9383,-1526, 9405,-1499, 9423,-1474, 9455,-1457, 9489,-1452, 9526,-1459"/>
<points a="9554,-1491, 9582,-1534, 9613,-1579, 9638,-1614, 9653,-1635, 9670,-1651, 9690,-1662, 9714,-1663, 9733,-1655, 9743,-1641"/>
<points a="9765,-1622, 9781,-1620, 9803,-1620, 9826,-1627, 9850,-1644, 9914,-1693, 9983,-1766, 10034,-1837, 10067,-1868, 10090,-1870"/>
<points a="10113,-1862, 10133,-1866, 10155,-1882, 10255,-1956, 10328,-2031, 10384,-2108, 10440,-2211, 10514,-2271, 10577,-2300, 10636,-2309"/>
<points a="10693,-2311, 10893,-2311, 10916,-2307, 11183,-2294, 11323,-2288, 11369,-2298, 11391,-2313, 11444,-2367, 11565,-2482, 11706,-2582"/>
<points a="11851,-2696, 12039,-2844, 12074,-2873, 12098,-2902, 12125,-2936, 12165,-2970, 12204,-2996, 12291,-3024, 12399,-3041, 12477,-3049"/>
<points a="12553,-3072, 12591,-3089, 12720,-3150, 12885,-3258, 13046,-3372, 13119,-3408, 13172,-3420, 13231,-3426, 13381,-3426, 13401,-3417"/>
<points a="13440,-3402, 13480,-3389, 13521,-3395, 13542,-3417, 13590,-3449, 13633,-3476, 13662,-3483, 13685,-3481, 13705,-3470, 13726,-3460"/>
<points a="13764,-3461, 13822,-3467, 13859,-3479, 13910,-3505, 13950,-3535, 13977,-3567, 14000,-3602, 14025,-3625, 14052,-3636, 14083,-3637"/>
<points a="14123,-3633, 14183,-3623, 14214,-3615, 14265,-3614, 14424,-3617, 14517,-3631, 14662,-3668, 14782,-3711, 14912,-3762, 14982,-3812"/>
<points a="15093,-3906, 15161,-3961, 15199,-4008, 15292,-4110, 15377,-4191, 15439,-4250, 15514,-4301, 15570,-4334, 15661,-4368, 15767,-4410"/>
<points a="15818,-4430, 15885,-4458, 15935,-4483, 15968,-4511, 16058,-4604, 16154,-4728, 16227,-4822, 16278,-4858, 16336,-4875, 16403,-4887"/>
<points a="16549,-4912, 16653,-4947, 16901,-5069, 17041,-5145, 17204,-5245, 17256,-5277, 17300,-5287, 17335,-5292, 17527,-5291, 17697,-5293"/>
<points a="17732,-5302, 17814,-5329, 17869,-5371, 17944,-5433, 18023,-5499, 18093,-5570, 18135,-5631, 18165,-5681, 18178,-5693, 18191,-5694"/>
<points a="18200,-5689, 18210,-5678, 18246,-5643, 18267,-5634, 18286,-5634, 18306,-5638, 18332,-5651, 18354,-5680, 18382,-5728, 18404,-5764"/>
<points a="18420,-5779, 18438,-5786, 18469,-5787, 18591,-5774, 18654,-5772, 18804,-5772, 19054,-5772, 19189,-5776, 19258,-5787, 19346,-5814"/>
<points a="19444,-5871, 19511,-5924, 19556,-5974, 19588,-6037, 19638,-6090, 19692,-6150, 19774,-6206, 19825,-6247, 19998,-6398, 20029,-6431"/>
<points a="20059,-6473, 20074,-6496, 20141,-6563, 20177,-6595, 20315,-6732, 20351,-6766, 20399,-6801, 20498,-6849, 20578,-6876, 20632,-6884"/>
<points a="20667,-6886, 20817,-6886, 20918,-6887, 20964,-6891, 21031,-6908, 21080,-6923, 21128,-6952, 21150,-6976, 21185,-7010, 21204,-7034"/>
<points a="21226,-7051, 21249,-7062, 21285,-7065, 21334,-7067, 21484,-7067, 22734,-7067, 23884,-7067, 24984,-7067, 25684,-7067, 26034,-7067"/>
</line>
</level>
<level name="Volcania: Rivers Of Fire" category="0" fillframe="3" surfaceframe="4" surfacethickness="10" type="race" opponents="2,3,4,5,6,7" win="1" exclusivechar="-1">
<obj type="endrace" x="35297" y="2219" rot="0"/>
<obj type="Checkpoint" x="1653" y="2187" rot="0"/>
<obj type="Checkpoint" x="5035" y="2395" rot="0"/>
<obj type="Checkpoint" x="7272" y="2709" rot="0"/>
<obj type="Checkpoint" x="10706" y="2483" rot="0"/>
<obj type="Checkpoint" x="13688" y="2396" rot="0"/>
<obj type="Checkpoint" x="16174" y="2531" rot="0"/>
<obj type="Checkpoint" x="18436" y="2457" rot="0"/>
<obj type="Checkpoint" x="21110" y="2456" rot="0"/>
<obj type="Checkpoint" x="23368" y="2843" rot="0"/>
<obj type="Checkpoint" x="26076" y="2557" rot="0"/>
<obj type="Checkpoint" x="29201" y="2801" rot="0"/>
<obj type="Checkpoint" x="31903" y="2220" rot="0"/>
<obj type="killer02" x="4155" y="2525" rot="0"/>
<obj type="killer02" x="4248" y="2524" rot="0"/>
<obj type="killer02" x="4343" y="2524" rot="0"/>
<obj type="killer02" x="5437" y="2513" rot="0"/>
<obj type="killer02" x="8052" y="2722" rot="0"/>
<obj type="killer02" x="8146" y="2722" rot="0"/>
<obj type="killer02" x="9540" y="2492" rot="0"/>
<obj type="killer02" x="11823" y="2612" rot="0"/>
<obj type="killer02" x="12127" y="2642" rot="0"/>
<obj type="killer02" x="14775" y="2366" rot="0"/>
<obj type="killer02" x="18011" y="2609" rot="0"/>
<obj type="killer02" x="19169" y="2403" rot="0"/>
<obj type="killer02" x="22007" y="2476" rot="0"/>
<obj type="killer02" x="23955" y="2858" rot="0"/>
<obj type="killer02" x="24785" y="2747" rot="0"/>
<obj type="killer02" x="24970" y="2747" rot="0"/>
<obj type="killer02" x="27532" y="2881" rot="0"/>
<obj type="killer02" x="27635" y="2885" rot="0"/>
<obj type="killer02" x="27734" y="2883" rot="0"/>
<obj type="killer02" x="27829" y="2881" rot="0"/>
<obj type="killer02" x="27925" y="2881" rot="0"/>
<obj type="killer02" x="30832" y="2764" rot="0"/>
<obj type="killer02" x="32947" y="2386" rot="0"/>
<obj type="killer02" x="33050" y="2385" rot="0"/>
<obj type="killer02" x="33152" y="2386" rot="0"/>
<obj type="killer02" x="33251" y="2385" rot="0"/>
<obj type="nonInteractive15" x="1144" y="82" rot="0"/>
<obj type="nonInteractive15" x="4640" y="2032" rot="0"/>
<obj type="nonInteractive15" x="4905" y="2105" rot="0"/>
<obj type="nonInteractive15" x="7606" y="2246" rot="0"/>
<obj type="nonInteractive15" x="7416" y="2352" rot="0"/>
<obj type="nonInteractive15" x="7868" y="1972" rot="0"/>
<obj type="nonInteractive15" x="8119" y="2156" rot="0"/>
<obj type="nonInteractive15" x="8778" y="2249" rot="0"/>
<obj type="nonInteractive15" x="9463" y="2064" rot="0"/>
<obj type="nonInteractive15" x="9152" y="1796" rot="0"/>
<obj type="nonInteractive15" x="9926" y="1904" rot="0"/>
<obj type="nonInteractive15" x="10209" y="2113" rot="0"/>
<obj type="nonInteractive15" x="10390" y="1827" rot="0"/>
<obj type="nonInteractive15" x="12982" y="2011" rot="0"/>
<obj type="nonInteractive15" x="13259" y="2119" rot="0"/>
<obj type="nonInteractive15" x="13476" y="1705" rot="0"/>
<obj type="nonInteractive15" x="13541" y="1919" rot="0"/>
<obj type="nonInteractive15" x="13925" y="1396" rot="0"/>
<obj type="nonInteractive15" x="13924" y="1730" rot="0"/>
<obj type="nonInteractive15" x="14195" y="1924" rot="0"/>
<obj type="nonInteractive15" x="16640" y="2103" rot="0"/>
<obj type="nonInteractive15" x="16984" y="1938" rot="0"/>
<obj type="nonInteractive15" x="17299" y="2195" rot="0"/>
<obj type="nonInteractive15" x="19089" y="1849" rot="0"/>
<obj type="nonInteractive15" x="19349" y="1938" rot="0"/>
<obj type="nonInteractive15" x="19538" y="1632" rot="0"/>
<obj type="nonInteractive15" x="19761" y="1767" rot="0"/>
<obj type="nonInteractive15" x="21040" y="1911" rot="0"/>
<obj type="nonInteractive15" x="20842" y="2047" rot="0"/>
<obj type="nonInteractive15" x="21284" y="2153" rot="0"/>
<obj type="nonInteractive15" x="23865" y="2286" rot="0"/>
<obj type="nonInteractive15" x="24087" y="2487" rot="0"/>
<obj type="nonInteractive15" x="25902" y="2258" rot="0"/>
<obj type="nonInteractive15" x="25513" y="2080" rot="0"/>
<obj type="nonInteractive15" x="27595" y="2371" rot="0"/>
<obj type="nonInteractive15" x="27981" y="2471" rot="0"/>
<obj type="nonInteractive15" x="28035" y="2195" rot="0"/>
<obj type="nonInteractive15" x="28427" y="2106" rot="0"/>
<obj type="nonInteractive15" x="29454" y="2355" rot="0"/>
<obj type="nonInteractive15" x="29863" y="2233" rot="0"/>
<obj type="nonInteractive15" x="29880" y="2399" rot="0"/>
<obj type="nonInteractive15" x="30688" y="2221" rot="0"/>
<obj type="nonInteractive15" x="31538" y="1941" rot="0"/>
<obj type="nonInteractive15" x="31755" y="1675" rot="0"/>
<obj type="nonInteractive15" x="32139" y="1884" rot="0"/>
<obj type="nonInteractive15" x="33034" y="2028" rot="0"/>
<obj type="nonInteractive15" x="33343" y="1776" rot="0"/>
<obj type="nonInteractive15" x="33649" y="1957" rot="0"/>
<line>
<points a="40,224, 940,224, 968,236, 1005,292, 1106,2133, 1123,2162, 1159,2182, 1194,2186, 2094,2186, 2644,2186"/>
<points a="2685,2196, 2728,2211, 2783,2235, 2857,2256, 2913,2283, 3003,2326, 3091,2358, 3159,2363, 3251,2366, 3297,2352"/>
<points a="3347,2351, 3419,2363, 3470,2384, 3532,2402, 3599,2411, 3715,2407, 3788,2399, 3841,2420, 3900,2421, 4100,2420"/>
<points a="4117,2526, 4368,2526, 4398,2416, 4455,2405, 4507,2380, 4577,2352, 4649,2352, 4672,2357, 4732,2375, 4784,2386"/>
<points a="4954,2396, 5186,2394, 5355,2395, 5379,2405, 5400,2514, 5482,2514, 5495,2413, 5509,2407, 5546,2403, 5684,2410"/>
<points a="5735,2445, 5857,2486, 6087,2521, 6255,2530, 6494,2555, 6721,2593, 6869,2634, 6995,2674, 7076,2693, 7140,2704"/>
<points a="7202,2709, 7326,2711, 7382,2704, 7489,2672, 7538,2641, 7568,2611, 7605,2592, 7644,2590, 7703,2616, 7816,2634"/>
<points a="7874,2634, 7912,2626, 7941,2615, 8035,2618, 8052,2711, 8161,2713, 8170,2649, 8187,2648, 8246,2642, 8281,2627"/>
<points a="8409,2592, 8463,2564, 8600,2532, 8705,2531, 8795,2543, 8954,2562, 9093,2555, 9233,2522, 9318,2473, 9381,2434"/>
<points a="9423,2405, 9457,2389, 9481,2389, 9499,2493, 9582,2495, 9589,2377, 9618,2362, 9705,2329, 9781,2327, 9855,2364"/>
<points a="9992,2410, 10151,2459, 10241,2484, 10316,2490, 10389,2466, 10433,2446, 10529,2435, 10565,2455, 10669,2484, 10742,2485"/>
<points a="10779,2464, 10907,2439, 10997,2424, 11057,2425, 11264,2436, 11475,2450, 11552,2481, 11602,2495, 11755,2493, 11779,2615"/>
<points a="11867,2615, 11875,2522, 11900,2517, 11982,2524, 12071,2534, 12086,2633, 12170,2636, 12174,2568, 12199,2564, 12248,2564"/>
<points a="12383,2579, 12462,2585, 12671,2583, 12774,2540, 12819,2523, 12876,2495, 12939,2455, 12985,2429, 13040,2378, 13089,2343"/>
<points a="13135,2343, 13162,2361, 13180,2386, 13214,2417, 13258,2424, 13347,2414, 13399,2395, 13487,2408, 13540,2414, 13595,2397"/>
<points a="13623,2398, 13777,2393, 13981,2347, 14086,2284, 14132,2252, 14191,2253, 14221,2285, 14336,2297, 14440,2285, 14529,2266"/>
<points a="14602,2234, 14643,2233, 14718,2232, 14740,2364, 14814,2365, 14822,2289, 14891,2285, 15024,2287, 15221,2301, 15539,2328"/>
<points a="15779,2414, 15858,2466, 15893,2487, 16005,2526, 16105,2528, 16203,2534, 16271,2530, 16431,2504, 16518,2467, 16581,2426"/>
<points a="16639,2414, 16703,2425, 16792,2458, 16968,2495, 17073,2501, 17375,2503, 17726,2476, 17931,2457, 17956,2462, 17973,2607"/>
<points a="18054,2609, 18062,2489, 18090,2481, 18197,2477, 18369,2465, 18603,2445, 18752,2414, 18834,2396, 18913,2372, 18955,2346"/>
<points a="19007,2305, 19064,2279, 19115,2264, 19132,2401, 19205,2401, 19212,2274, 19275,2274, 19377,2275, 19453,2286, 19577,2311"/>
<points a="19657,2337, 19704,2351, 19743,2359, 19821,2371, 20047,2379, 20148,2382, 20348,2382, 20406,2379, 20466,2373, 20556,2356"/>
<points a="20652,2333, 20798,2302, 20849,2301, 20885,2346, 20918,2399, 20960,2437, 21034,2453, 21103,2457, 21213,2452, 21326,2428"/>
<points a="21445,2387, 21533,2349, 21593,2343, 21647,2345, 21783,2351, 21860,2349, 21946,2335, 21968,2473, 22047,2474, 22059,2344"/>
<points a="22102,2342, 22180,2351, 22230,2388, 22311,2513, 22412,2687, 22448,2745, 22482,2779, 22523,2799, 22597,2822, 22677,2838"/>
<points a="22825,2849, 22901,2853, 22950,2852, 23196,2853, 23332,2849, 23518,2828, 23594,2818, 23655,2806, 23694,2791, 23782,2755"/>
<points a="23838,2722, 23868,2707, 23907,2699, 23922,2854, 23995,2857, 24001,2727, 24055,2728, 24119,2723, 24246,2706, 24359,2689"/>
<points a="24431,2658, 24566,2618, 24678,2601, 24736,2589, 24751,2747, 24822,2748, 24833,2620, 24922,2616, 24934,2741, 25014,2743"/>
<points a="25019,2639, 25063,2640, 25122,2640, 25183,2635, 25264,2626, 25331,2607, 25448,2577, 25525,2553, 25562,2561, 25601,2596"/>
<points a="25633,2623, 25692,2624, 25750,2609, 25816,2584, 26042,2556, 26145,2556, 26288,2566, 26367,2603, 26427,2664, 26467,2711"/>
<points a="26530,2739, 26610,2741, 26698,2742, 26782,2738, 26847,2722, 26998,2698, 27135,2691, 27397,2691, 27417,2687, 27437,2669"/>
<points a="27455,2664, 27496,2877, 27956,2878, 27982,2659, 28004,2656, 28082,2663, 28154,2687, 28276,2728, 28354,2748, 28410,2752"/>
<points a="28581,2749, 28682,2731, 28758,2705, 28825,2703, 28898,2707, 28993,2736, 29094,2778, 29161,2799, 29233,2801, 29319,2785"/>
<points a="29372,2746, 29416,2724, 29443,2732, 29487,2759, 29528,2773, 29603,2767, 29650,2740, 29706,2732, 29749,2753, 29836,2785"/>
<points a="29893,2775, 29930,2782, 30074,2808, 30285,2820, 30420,2811, 30480,2793, 30534,2761, 30655,2683, 30729,2636, 30767,2635"/>
<points a="30788,2766, 30875,2767, 30899,2613, 31021,2525, 31082,2492, 31256,2448, 31356,2404, 31449,2352, 31492,2315, 31520,2278"/>
<points a="31604,2237, 31670,2283, 31863,2219, 31945,2223, 32035,2250, 32128,2305, 32175,2310, 32213,2306, 32296,2297, 32585,2231"/>
<points a="32719,2193, 32885,2189, 32910,2385, 33216,2384, 33226,2306, 33395,2289, 33478,2257, 33548,2226, 33636,2221, 33773,2218"/>
<points a="33923,2218, 34223,2218, 34773,2218, 35273,2218, 36173,2218, 37073,2218"/>
</line>
</level>
<level name="Volcania: Down Down" category="0" fillframe="3" surfaceframe="4" surfacethickness="10" type="race" opponents="4,5,6,7,8,9,10" win="1">
<obj type="endrace" x="36583" y="22192" rot="0"/>
<obj type="Checkpoint" x="2225" y="1485" rot="0"/>
<obj type="Checkpoint" x="6198" y="3227" rot="0"/>
<obj type="Checkpoint" x="10936" y="6687" rot="0"/>
<obj type="Checkpoint" x="15906" y="10371" rot="0"/>
<obj type="Checkpoint" x="18806" y="12066" rot="0"/>
<obj type="Checkpoint" x="25175" y="16501" rot="0"/>
<obj type="Checkpoint" x="26789" y="17235" rot="0"/>
<line>
<points a="32,221, 1432,221, 1593,1468, 1609,1486, 2914,1487, 3664,1487, 3771,1496, 3919,1526, 4109,1608, 4204,1677"/>
<points a="4458,1898, 4720,2117, 4989,2339, 5246,2593, 5589,2973, 5735,3098, 5802,3133, 5927,3188, 5970,3203, 6057,3222"/>
<points a="6249,3228, 6287,3228, 6373,3241, 6495,3278, 6566,3322, 6786,3535, 7126,3793, 7472,3956, 7790,4084, 8172,4238"/>
<points a="8495,4395, 8769,4581, 9059,4795, 9337,5032, 9601,5324, 9863,5654, 10094,5960, 10345,6343, 10457,6521, 10524,6599"/>
<points a="10559,6638, 10585,6655, 10656,6676, 10697,6682, 10909,6687, 11007,6685, 11211,6700, 11308,6737, 11471,6810, 11625,6909"/>
<points a="11778,7021, 11863,7099, 11914,7185, 12016,7448, 12118,7727, 12143,7755, 12176,7779, 12220,7799, 12447,7878, 12554,7915"/>
<points a="12959,8090, 13292,8252, 13671,8445, 14033,8677, 14311,8893, 14595,9143, 14786,9406, 15089,9807, 15207,9949, 15351,10112"/>
<points a="15388,10159, 15439,10223, 15490,10269, 15535,10300, 15600,10323, 15787,10352, 16009,10385, 16294,10415, 16359,10421, 16508,10420"/>
<points a="16630,10408, 16737,10372, 16765,10355, 16817,10315, 16846,10286, 16859,10264, 16867,10239, 16873,10216, 16882,10202, 16909,10189"/>
<points a="16934,10188, 16959,10190, 16996,10222, 17025,10273, 17047,10345, 17075,10409, 17263,10701, 17459,11015, 17670,11293, 18003,11678"/>
<points a="18063,11723, 18306,11889, 18524,11992, 18591,12023, 18656,12054, 18687,12060, 18724,12065, 18749,12064, 18847,12067, 18898,12064"/>
<points a="18928,12058, 18957,12054, 18975,12054, 19051,12066, 19127,12093, 19181,12129, 19553,12350, 19918,12544, 20292,12663, 20536,12685"/>
<points a="20629,12701, 20673,12710, 20724,12735, 20770,12763, 20829,12816, 21038,13068, 21360,13426, 21642,13670, 21750,13757, 21786,13767"/>
<points a="21826,13785, 21851,13806, 21887,13858, 21903,13902, 21969,14081, 21988,14109, 22004,14135, 22029,14165, 22049,14191, 22076,14216"/>
<points a="22110,14236, 22173,14262, 22228,14271, 22279,14286, 22369,14312, 22536,14358, 22644,14398, 22789,14455, 22828,14476, 22891,14522"/>
<points a="23137,14750, 23416,15044, 23755,15353, 24081,15641, 24496,15977, 25004,16416, 25062,16462, 25091,16489, 25155,16501, 25229,16502"/>
<points a="25276,16483, 25314,16464, 25362,16468, 25479,16521, 25645,16710, 25689,16794, 25722,16833, 25779,16865, 25859,16873, 25958,16873"/>
<points a="26034,16867, 26078,16857, 26118,16840, 26168,16824, 26206,16824, 26248,16837, 26287,16872, 26415,17141, 26436,17168, 26494,17216"/>
<points a="26524,17226, 26576,17229, 26624,17229, 26766,17233, 26916,17234, 26967,17237, 27011,17245, 27057,17268, 27100,17301, 27140,17350"/>
<points a="27166,17390, 27213,17434, 27298,17473, 27675,17607, 27956,17674, 28348,17712, 28747,17727, 28776,17729, 28904,17735, 29055,17765"/>
<points a="29185,17796, 29277,17829, 29351,17869, 29490,17953, 29632,18060, 30052,18418, 30076,18442, 30092,18478, 30099,18516, 30103,18564"/>
<points a="30108,18606, 30124,18648, 30141,18673, 30316,18836, 30419,18906, 30643,19007, 30697,19038, 30735,19090, 30770,19177, 30882,19423"/>
<points a="31106,19882, 31472,20480, 31815,20949, 32194,21390, 32548,21766, 32842,22021, 32907,22062, 33123,22133, 33283,22177, 33382,22192"/>
<points a="33445,22192, 34195,22192, 35295,22192, 36195,22192, 36995,22192, 37795,22192, 38545,22192"/>
</line>
</level>
<level name="Volcania: Fire Race Special" category="0" fillframe="3" surfaceframe="4" surfacethickness="10" type="chase" opponents="22" win="1" exclusivechar="13">
<obj type="endrace" x="41698" y="1447" rot="0"/>
<obj type="Checkpoint" x="2167" y="1540" rot="0"/>
<obj type="Checkpoint" x="4814" y="1450" rot="0"/>
<obj type="Checkpoint" x="7123" y="1520" rot="0"/>
<obj type="Checkpoint" x="9043" y="1450" rot="0"/>
<obj type="Checkpoint" x="11199" y="1661" rot="0"/>
<obj type="Checkpoint" x="13804" y="1397" rot="0"/>
<obj type="Checkpoint" x="16338" y="1526" rot="0"/>
<obj type="Checkpoint" x="19349" y="1281" rot="0"/>
<obj type="Checkpoint" x="22604" y="1209" rot="0"/>
<obj type="Checkpoint" x="25439" y="1471" rot="0"/>
<obj type="Checkpoint" x="28819" y="1455" rot="0"/>
<obj type="Checkpoint" x="31025" y="1368" rot="0"/>
<obj type="Checkpoint" x="34103" y="1424" rot="0"/>
<obj type="Checkpoint" x="37224" y="1375" rot="0"/>
<line>
<points a="59,237, 1409,237, 1525,1513, 1608,1539, 2608,1539, 3558,1539, 3697,1536, 3821,1523, 4051,1487, 4346,1460"/>
<points a="4610,1452, 4893,1454, 5154,1461, 5363,1490, 5581,1500, 5872,1498, 6272,1498, 6305,1484, 6329,1608, 6543,1614"/>
<points a="6563,1483, 6580,1481, 6623,1498, 6870,1517, 7234,1522, 7884,1522, 8290,1506, 8773,1461, 9226,1443, 9630,1450"/>
<points a="9888,1474, 10176,1517, 10527,1609, 10652,1640, 10884,1661, 11088,1667, 11370,1658, 11636,1625, 11829,1597, 12054,1566"/>
<points a="12113,1547, 12135,1532, 12156,1532, 12216,1602, 12284,1620, 12349,1622, 12454,1620, 12496,1590, 12525,1547, 12540,1526"/>
<points a="12565,1526, 12597,1557, 12654,1595, 12740,1598, 12808,1593, 12962,1574, 13051,1546, 13150,1518, 13236,1484, 13332,1447"/>
<points a="13399,1436, 13493,1420, 13585,1406, 13654,1400, 13915,1399, 14002,1399, 14080,1405, 14146,1419, 14299,1446, 14606,1485"/>
<points a="14825,1514, 14931,1533, 15002,1535, 15159,1532, 15255,1525, 15323,1507, 15425,1489, 15519,1466, 15616,1450, 15677,1446"/>
<points a="15795,1456, 15906,1473, 15988,1500, 16087,1522, 16259,1525, 16485,1529, 16743,1528, 16980,1510, 17454,1503, 17491,1494"/>
<points a="17519,1608, 17783,1607, 17793,1486, 17806,1482, 17862,1503, 18079,1493, 18392,1447, 18521,1395, 18692,1327, 18807,1301"/>
<points a="18985,1273, 19087,1268, 19245,1277, 19593,1295, 20059,1334, 20420,1362, 20784,1368, 21127,1355, 21497,1325, 21836,1286"/>
<points a="22163,1235, 22405,1211, 22639,1210, 22864,1226, 23013,1244, 23227,1294, 23345,1330, 23587,1355, 23847,1359, 24056,1350"/>
<points a="24118,1331, 24148,1317, 24161,1326, 24196,1485, 24475,1485, 24496,1334, 24512,1323, 24546,1334, 24693,1389, 24897,1432"/>
<points a="25184,1461, 25301,1469, 25376,1471, 25421,1472, 25900,1473, 26374,1472, 26587,1468, 26713,1451, 26804,1443, 26868,1439"/>
<points a="27103,1443, 27167,1452, 27424,1469, 27521,1475, 27593,1475, 27878,1478, 28137,1475, 28248,1465, 28427,1452, 28510,1450"/>
<points a="28573,1449, 28782,1454, 28898,1461, 29107,1466, 29295,1462, 29352,1458, 29386,1442, 29405,1441, 29437,1479, 29501,1506"/>
<points a="29547,1508, 29653,1503, 29691,1483, 29715,1465, 29734,1465, 29759,1482, 29847,1510, 29979,1520, 30155,1523, 30256,1521"/>
<points a="30323,1514, 30371,1499, 30422,1481, 30484,1453, 30554,1431, 30639,1401, 30711,1384, 30814,1377, 30924,1369, 31110,1368"/>
<points a="31225,1374, 31417,1406, 31614,1442, 31774,1458, 32026,1465, 32235,1464, 32735,1464, 33185,1464, 33435,1464, 33462,1461"/>
<points a="33524,1441, 33563,1412, 33645,1391, 33741,1382, 33810,1386, 33935,1412, 34213,1431, 34283,1430, 34325,1423, 34456,1407"/>
<points a="34518,1396, 34556,1382, 34576,1490, 34832,1487, 34845,1378, 34863,1378, 34890,1397, 35083,1419, 35384,1429, 35599,1429"/>
<points a="36099,1429, 36599,1429, 36636,1424, 36787,1398, 36857,1383, 36932,1379, 36985,1376, 37349,1376, 37899,1376, 38299,1376"/>
<points a="38331,1380, 38491,1404, 38626,1436, 38697,1444, 38752,1446, 39002,1446, 39452,1446, 40352,1446, 41302,1446, 42252,1446"/>
<points a="43352,1446"/>
</line>
</level>
<!-- World 2 Sunset City-->
<level name="Sunset City: Slightly Urban" category="0" fillframe="5" surfaceframe="6" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1" exclusivechar="-1">
<obj type="Checkpoint" x="10716" y="2265" rot="0"/>
<obj type="Checkpoint" x="9336" y="2080" rot="0"/>
<obj type="Checkpoint" x="7914" y="1226" rot="0"/>
<obj type="Checkpoint" x="6819" y="897" rot="0"/>
<obj type="Checkpoint" x="5518" y="773" rot="0"/>
<obj type="Checkpoint" x="4902" y="701" rot="0"/>
<obj type="Checkpoint" x="4035" y="688" rot="0"/>
<obj type="Checkpoint" x="2967" y="147" rot="0"/>
<obj type="Checkpoint" x="1781" y="1100" rot="0"/>
<obj type="Checkpoint" x="693" y="243" rot="0"/>
<obj type="nonInteractive09" x="531" y="242" rot="0"/>
<obj type="nonInteractive09" x="1876" y="1091" rot="0"/>
<obj type="nonInteractive09" x="4171" y="692" rot="0"/>
<obj type="nonInteractive09" x="5000" y="707" rot="0"/>
<obj type="nonInteractive09" x="6019" y="533" rot="0"/>
<obj type="nonInteractive12" x="6066" y="524" rot="0"/>
<obj type="nonInteractive12" x="5035" y="702" rot="0"/>
<obj type="nonInteractive12" x="4157" y="691" rot="0"/>
<obj type="nonInteractive12" x="3070" y="134" rot="0"/>
<obj type="nonInteractive12" x="1892" y="1094" rot="0"/>
<obj type="nonInteractive12" x="7348" y="891" rot="0"/>
<obj type="nonInteractive12" x="8104" y="1249" rot="0"/>
<obj type="furniture04" x="9024" y="1823" rot="0"/>
<obj type="furniture01" x="2796" y="170" rot="0"/>
<obj type="nonInteractive04" x="6742" y="891" rot="0"/>
<obj type="nonInteractive04" x="6941" y="883" rot="0"/>
<obj type="nonInteractive04" x="7372" y="890" rot="0"/>
<obj type="nonInteractive04" x="8104" y="1244" rot="0"/>
<obj type="nonInteractive04" x="8537" y="1497" rot="0"/>
<obj type="nonInteractive04" x="8975" y="1810" rot="0"/>
<obj type="nonInteractive04" x="9075" y="1819" rot="0"/>
<obj type="nonInteractive04" x="9961" y="2264" rot="0"/>
<obj type="nonInteractive04" x="10078" y="2255" rot="0"/>
<obj type="nonInteractive04" x="10814" y="2269" rot="0"/>
<obj type="nonInteractive04" x="11005" y="2273" rot="0"/>
<obj type="nonInteractive04" x="11682" y="2245" rot="0"/>
<obj type="nonInteractive04" x="12366" y="2154" rot="0"/>
<obj type="nonInteractive04" x="12497" y="2124" rot="0"/>
<obj type="nonInteractive15" x="3544" y="-140" rot="0"/>
<obj type="nonInteractive15" x="3933" y="105" rot="0"/>
<obj type="nonInteractive15" x="4042" y="381" rot="0"/>
<obj type="nonInteractive15" x="4342" y="331" rot="0"/>
<obj type="nonInteractive15" x="4615" y="188" rot="0"/>
<obj type="nonInteractive15" x="4797" y="411" rot="0"/>
<obj type="nonInteractive15" x="5311" y="441" rot="0"/>
<obj type="nonInteractive15" x="5532" y="584" rot="0"/>
<obj type="nonInteractive15" x="5589" y="335" rot="0"/>
<obj type="nonInteractive15" x="6014" y="190" rot="0"/>
<obj type="nonInteractive15" x="6361" y="400" rot="0"/>
<obj type="nonInteractive15" x="6646" y="598" rot="0"/>
<obj type="nonInteractive15" x="6918" y="690" rot="0"/>
<obj type="nonInteractive15" x="7433" y="635" rot="0"/>
<obj type="nonInteractive15" x="7930" y="833" rot="0"/>
<obj type="nonInteractive15" x="8201" y="1005" rot="0"/>
<obj type="nonInteractive15" x="8477" y="1182" rot="0"/>
<obj type="nonInteractive15" x="8672" y="1297" rot="0"/>
<obj type="nonInteractive15" x="8909" y="1616" rot="0"/>
<obj type="nonInteractive15" x="9394" y="1910" rot="0"/>
<obj type="nonInteractive15" x="9589" y="1748" rot="0"/>
<obj type="nonInteractive15" x="9777" y="1941" rot="0"/>
<obj type="nonInteractive15" x="10082" y="2064" rot="0"/>
<obj type="nonInteractive15" x="10370" y="1868" rot="0"/>
<obj type="nonInteractive15" x="10857" y="2031" rot="0"/>
<obj type="nonInteractive15" x="11113" y="1886" rot="0"/>
<obj type="nonInteractive15" x="10795" y="1704" rot="0"/>
<obj type="nonInteractive15" x="11494" y="1971" rot="0"/>
<obj type="nonInteractive15" x="12206" y="1943" rot="0"/>
<obj type="endrace" x="18839" y="2630" rot="0"/>
<obj type="nonInteractive16" x="17498" y="2751" rot="0"/>
<obj type="nonInteractive16" x="16246" y="2679" rot="0"/>
<obj type="nonInteractive16" x="14951" y="2893" rot="0"/>
<obj type="nonInteractive16" x="13293" y="2125" rot="10"/>
<obj type="Checkpoint" x="16428" y="2671" rot="0"/>
<obj type="Checkpoint" x="15617" y="2728" rot="0"/>
<obj type="Checkpoint" x="14688" y="2835" rot="0"/>
<obj type="Checkpoint" x="12813" y="2062" rot="0"/>
<obj type="Checkpoint" x="11543" y="2246" rot="0"/>
<obj type="furniture01" x="10935" y="2270" rot="0"/>
<obj type="furniture01" x="10935" y="2270" rot="0"/>
<obj type="furniture01" x="10935" y="2270" rot="0"/>
<obj type="Pickup" x="1055" y="503" rot="0"/>
<obj type="Pickup" x="1137" y="620" rot="0"/>
<obj type="Pickup" x="1215" y="739" rot="0"/>
<obj type="Pickup" x="1858" y="1041" rot="0"/>
<obj type="Pickup" x="1976" y="952" rot="0"/>
<obj type="Pickup" x="2099" y="827" rot="0"/>
<obj type="Pickup" x="2249" y="660" rot="0"/>
<obj type="Pickup" x="3455" y="46" rot="0"/>
<obj type="Pickup" x="3521" y="52" rot="0"/>
<obj type="Pickup" x="3575" y="69" rot="0"/>
<obj type="Pickup" x="4516" y="460" rot="0"/>
<obj type="Pickup" x="4595" y="457" rot="0"/>
<obj type="Pickup" x="4688" y="443" rot="0"/>
<obj type="Pickup" x="5937" y="497" rot="0"/>
<obj type="Pickup" x="5856" y="518" rot="0"/>
<obj type="Pickup" x="7699" y="864" rot="0"/>
<obj type="Pickup" x="8249" y="1219" rot="0"/>
<obj type="Pickup" x="8651" y="1468" rot="0"/>
<obj type="Pickup" x="9133" y="1739" rot="0"/>
<obj type="Pickup" x="10080" y="2160" rot="0"/>
<obj type="Pickup" x="10145" y="2143" rot="0"/>
<obj type="Pickup" x="10590" y="1995" rot="0"/>
<obj type="Pickup" x="11311" y="2160" rot="0"/>
<obj type="Pickup" x="11392" y="2182" rot="0"/>
<obj type="Pickup" x="11483" y="2208" rot="0"/>
<obj type="Pickup" x="12149" y="2063" rot="0"/>
<obj type="Pickup" x="12210" y="2056" rot="0"/>
<obj type="Pickup" x="13034" y="2062" rot="0"/>
<obj type="Pickup" x="12961" y="2050" rot="0"/>
<obj type="Pickup" x="13819" y="2006" rot="0"/>
<obj type="Pickup" x="13899" y="1998" rot="0"/>
<obj type="Pickup" x="13983" y="1969" rot="0"/>
<obj type="Pickup" x="14050" y="1976" rot="0"/>
<obj type="Pickup" x="14122" y="2040" rot="0"/>
<obj type="Pickup" x="14172" y="2115" rot="0"/>
<obj type="Pickup" x="14224" y="2187" rot="0"/>
<obj type="Pickup" x="15345" y="2770" rot="0"/>
<obj type="Pickup" x="15437" y="2742" rot="0"/>
<obj type="Pickup" x="15532" y="2713" rot="0"/>
<obj type="Pickup" x="16272" y="2561" rot="0"/>
<obj type="Pickup" x="17725" y="2691" rot="0"/>
<obj type="Pickup" x="17794" y="2659" rot="0"/>
<obj type="Pickup" x="17864" y="2635" rot="0"/>
<line>
<points a="-439,240, 748,239, 795,263, 849,321, 962,459, 1065,606, 1147,726, 1219,831, 1311,899, 1485,984"/>
<points a="1513,966, 1548,966, 1571,1027, 1655,1058, 1775,1094, 1921,1087, 2249,727, 2792,169, 2996,139, 3326,121"/>
<points a="3375,88, 3401,148, 3537,186, 3594,134, 3619,182, 3672,234, 3715,313, 3763,475, 3819,597, 3860,635"/>
<points a="3923,661, 4098,696, 4238,683, 4344,644, 4423,565, 4468,520, 4528,490, 4584,484, 4646,525, 4690,573"/>
<points a="4730,632, 4826,684, 4974,711, 5070,706, 5104,685, 5133,659, 5175,637, 5225,621, 5284,625, 5321,653"/>
<points a="5349,680, 5384,713, 5441,744, 5522,769, 5597,769, 5706,717, 5751,654, 5810,592, 5866,561, 5992,524"/>
<points a="6103,529, 6197,560, 6252,619, 6316,705, 6411,790, 6472,832, 6616,884, 6796,895, 6969,881, 7011,843"/>
<points a="7044,809, 7088,788, 7153,778, 7219,787, 7271,820, 7271,820, 7309,859, 7353,886, 7429,900, 7572,905"/>
<points a="7667,899, 7727,1045, 7781,1209, 7986,1235, 8215,1253, 8285,1384, 8465,1481, 8620,1511, 8665,1681, 8754,1786"/>
<points a="8867,1798, 9034,1817, 9108,1825, 9160,1894, 9196,1962, 9220,2029, 9302,2074, 9377,2085, 9494,2086, 9595,2154"/>
<points a="9756,2262, 10014,2264, 10210,2240, 10401,2138, 10556,2045, 10599,2209, 10694,2264, 11066,2275, 11107,2217, 11166,2152"/>
<points a="11363,2206, 11543,2246, 11743,2246, 11934,2214, 12116,2178, 12302,2168, 12813,2061, 13563,2164, 13659,2130, 13725,2070"/>
<points a="13794,2049, 13908,2045, 13988,2011, 14050,2016, 14081,2079, 14190,2230, 14346,2264, 14454,2268, 14508,2317, 14565,2408"/>
<points a="14583,2648, 14616,2757, 14688,2836, 14834,2898, 15014,2900, 15201,2877, 15279,2836, 15588,2731, 15803,2701, 15857,2655"/>
<points a="15951,2633, 16004,2674, 16157,2685, 16507,2670, 16598,2639, 16656,2594, 16735,2570, 16785,2673, 16842,2721, 16956,2756"/>
<points a="17023,2749, 17074,2681, 17104,2647, 17225,2688, 17305,2744, 17467,2759, 17670,2756, 17814,2683, 17986,2637, 18064,2697"/>
<points a="18156,2763, 18247,2761, 18391,2734, 18524,2687, 18681,2630, 19494,2628"/>
</line>
</level>
<level name="Sunset City: Central Park" category="0" fillframe="13" surfaceframe="14" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1">
<obj type="endrace" x="20831" y="1716" rot="0"/>
<obj type="nonInteractive09" x="19842" y="1707" rot="0"/>
<obj type="nonInteractive09" x="18250" y="1772" rot="0"/>
<obj type="nonInteractive09" x="17594" y="1596" rot="0"/>
<obj type="nonInteractive09" x="16688" y="1848" rot="20"/>
<obj type="nonInteractive09" x="15945" y="1868" rot="20"/>
<obj type="nonInteractive09" x="14866" y="1730" rot="-20"/>
<obj type="nonInteractive09" x="13931" y="1575" rot="20"/>
<obj type="nonInteractive09" x="12794" y="1428" rot="-10"/>
<obj type="furniture04" x="10945" y="1132" rot="0"/>
<obj type="furniture04" x="11196" y="1098" rot="0"/>
<obj type="furniture04" x="8470" y="1298" rot="0"/>
<obj type="furniture04" x="8432" y="1289" rot="0"/>
<obj type="furniture04" x="8395" y="1272" rot="0"/>
<obj type="furniture04" x="7940" y="1080" rot="0"/>
<obj type="furniture04" x="7986" y="1077" rot="0"/>
<obj type="furniture04" x="7566" y="1051" rot="0"/>
<obj type="furniture04" x="7511" y="1043" rot="0"/>
<obj type="nonInteractive16" x="860" y="282" rot="0"/>
<obj type="nonInteractive16" x="860" y="282" rot="0"/>
<obj type="nonInteractive16" x="2811" y="475" rot="0"/>
<obj type="nonInteractive16" x="4416" y="553" rot="0"/>
<obj type="nonInteractive16" x="8757" y="1190" rot="-10"/>
<obj type="nonInteractive16" x="9517" y="1386" rot="7"/>
<obj type="nonInteractive16" x="11685" y="1079" rot="11"/>
<obj type="nonInteractive15" x="7340" y="441" rot="0"/>
<obj type="nonInteractive15" x="7573" y="708" rot="0"/>
<obj type="nonInteractive15" x="7794" y="510" rot="0"/>
<obj type="nonInteractive15" x="8439" y="718" rot="0"/>
<obj type="nonInteractive15" x="8679" y="934" rot="0"/>
<obj type="nonInteractive15" x="8817" y="806" rot="0"/>
<obj type="nonInteractive15" x="9344" y="946" rot="0"/>
<obj type="nonInteractive15" x="9459" y="756" rot="0"/>
<obj type="nonInteractive15" x="9743" y="1096" rot="0"/>
<obj type="nonInteractive15" x="10489" y="827" rot="0"/>
<obj type="nonInteractive15" x="10832" y="696" rot="0"/>
<obj type="nonInteractive15" x="12230" y="960" rot="0"/>
<obj type="nonInteractive15" x="12405" y="1115" rot="0"/>
<obj type="nonInteractive15" x="14674" y="1371" rot="0"/>
<obj type="nonInteractive15" x="15050" y="1255" rot="0"/>
<obj type="nonInteractive15" x="15117" y="1490" rot="0"/>
<obj type="nonInteractive15" x="15919" y="1509" rot="0"/>
<obj type="nonInteractive15" x="17526" y="1325" rot="0"/>
<obj type="nonInteractive15" x="17993" y="1095" rot="0"/>
<obj type="nonInteractive15" x="17989" y="1401" rot="0"/>
<obj type="nonInteractive15" x="18682" y="1003" rot="0"/>
<obj type="nonInteractive15" x="18907" y="1239" rot="0"/>
<obj type="nonInteractive15" x="18368" y="1239" rot="0"/>
<obj type="Checkpoint" x="1831" y="503" rot="0"/>
<obj type="Checkpoint" x="3028" y="450" rot="0"/>
<obj type="Checkpoint" x="3792" y="565" rot="0"/>
<obj type="Checkpoint" x="3792" y="565" rot="0"/>
<obj type="Checkpoint" x="4772" y="561" rot="0"/>
<obj type="Checkpoint" x="5837" y="548" rot="0"/>
<obj type="Checkpoint" x="7850" y="1070" rot="0"/>
<obj type="Checkpoint" x="7850" y="1070" rot="0"/>
<obj type="Checkpoint" x="8887" y="1170" rot="0"/>
<obj type="Checkpoint" x="10473" y="1142" rot="0"/>
<obj type="Checkpoint" x="12681" y="1440" rot="0"/>
<obj type="Checkpoint" x="15104" y="1763" rot="0"/>
<obj type="Checkpoint" x="16992" y="1871" rot="0"/>
<obj type="Checkpoint" x="19370" y="1702" rot="0"/>
<obj type="Checkpoint" x="226" y="283" rot="0"/>
<obj type="nonInteractive15" x="1479" y="204" rot="0"/>
<obj type="nonInteractive15" x="1860" y="95" rot="0"/>
<obj type="nonInteractive15" x="1929" y="256" rot="0"/>
<obj type="nonInteractive15" x="2452" y="239" rot="0"/>
<obj type="nonInteractive15" x="3100" y="127" rot="0"/>
<obj type="nonInteractive15" x="3385" y="203" rot="0"/>
<obj type="nonInteractive15" x="3755" y="291" rot="0"/>
<obj type="nonInteractive15" x="4302" y="116" rot="0"/>
<obj type="nonInteractive15" x="4507" y="367" rot="0"/>
<obj type="nonInteractive15" x="4829" y="268" rot="0"/>
<obj type="nonInteractive15" x="5117" y="150" rot="0"/>
<obj type="nonInteractive15" x="7111" y="290" rot="0"/>
<obj type="nonInteractive15" x="8414" y="852" rot="0"/>
<obj type="furniture01" x="7945" y="1054" rot="0"/>
<line>
<points a="-813,-472, -239,-471.0625, -150,285.875, 28,285.75, 384,285.5, 1096,285, 1338,406, 1382,393, 1408,368, 1447,353"/>
<points a="1513,378, 1533,428, 1669,495, 1882,505, 1916,482, 1961,462, 2040,448, 2078,477, 2082,507, 2190,537"/>
<points a="2241,531, 2317,490, 2371,462, 2443,457, 2565,464, 2598,444, 2640,431, 2678,443, 2701,469, 2854,482"/>
<points a="2939,467, 3079,438, 3140,387, 3208,365, 3284,371, 3330,411, 3436,443, 3493,527, 3643,513, 3700,533"/>
<points a="3755,565, 3806,565, 3858,533, 3918,510, 3981,500, 4009,469, 4055,460, 4197,495, 4219,532, 4305,557"/>
<points a="4563,557, 4572,542, 4595,526, 4627,519, 4656,533, 4678,550, 4812,564, 5011,563, 5103,546, 5126,530"/>
<points a="5179,504, 5203,525, 5247,525, 5282,544, 5347,577, 5417,582, 5477,555, 5577,515, 5663,497, 5700,511"/>
<points a="5787,543, 5845,543, 5924,516, 6021,469, 6149,466, 6221,512, 6347,553, 6478,621, 6530,618, 6674,595"/>
<points a="6746,571, 6895,543, 7007,574, 7007,574, 7135,662, 7215,756, 7275,915, 7353,971, 7471,1032, 7525,1049"/>
<points a="7577,1053, 7648,1029, 7673,1004, 7716,984, 7748,980, 7787,1005, 7802,1030, 7827,1066, 7905,1078, 7986,1079"/>
<points a="8022,1029, 8148,944, 8213,1001, 8278,1041, 8368,1266, 8476,1297, 8638,1210, 8723,1188, 8882,1166, 8950,1182"/>
<points a="8992,1214, 9047,1256, 9210,1349, 9353,1369, 9864,1433, 9925,1430, 9963,1408, 10000,1377, 10048,1353, 10149,1269"/>
<points a="10212,1230, 10242,1199, 10291,1148, 10386,1122, 10445,1143, 10505,1136, 10581,1130, 10611,1149, 10659,1137, 10698,1138"/>
<points a="10717,1148, 10881,1131, 10919,1120, 10942,1133, 11049,1121, 11058,1096, 11106,1073, 11153,1091, 11234,1099, 11257,1132"/>
<points a="11394,1102, 11422,1084, 11532,1027, 11568,1060, 11744,1095, 11802,1101, 11866,1129, 11918,1151, 11920,1181, 11955,1201"/>
<points a="12026,1283, 12071,1307, 12105,1328, 12130,1301, 12228,1342, 12276,1318, 12555,1436, 12656,1439, 12889,1412, 12961,1405"/>
<points a="13017,1428, 13058,1449, 13153,1488, 13225,1500, 13388,1493, 13431,1470, 13472,1456, 13501,1475, 13610,1508, 13662,1510"/>
<points a="13845,1537, 14151,1667, 14299,1653, 14447,1627, 14491,1654, 14682,1762, 14798,1755, 14867,1720, 14910,1707, 14961,1699"/>
<points a="15007,1722, 15040,1746, 15135,1769, 15199,1771, 15264,1749, 15311,1717, 15351,1686, 15411,1667, 15495,1654, 15643,1681"/>
<points a="15683,1721, 15796,1761, 15854,1821, 16051,1908, 16233,1897, 16273,1845, 16386,1787, 16556,1815, 16885,1902, 16970,1877"/>
<points a="17023,1854, 17079,1828, 17205,1760, 17357,1656, 17445,1631, 17496,1599, 17496,1599, 17639,1586, 17834,1644, 17959,1728"/>
<points a="18193,1775, 18345,1769, 18553,1723, 18598,1691, 18669,1543, 18705,1453, 18728,1415, 18796,1435, 18829,1480, 18913,1619"/>
<points a="19039,1655, 19108,1658, 19208,1683, 19381,1699, 19490,1667, 19625,1689, 19747,1707, 22511,1707"/>
</line>
</level>
<level name="Sunset City: Bus Jumper" category="0" fillframe="5" surfaceframe="6" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1" exclusivechar="-1">
<obj type="Bus" x="2285" y="1033" rot="0"/>
<obj type="Bus" x="2470" y="1028" rot="0"/>
<obj type="Bus" x="2656" y="1025" rot="0"/>
<obj type="Bus" x="2847" y="1027" rot="0"/>
<obj type="Bus" x="3030" y="1041" rot="0"/>
<obj type="Bus" x="3219" y="1052" rot="0"/>
<obj type="Bus" x="3455" y="1036" rot="-20"/>
<obj type="Bus" x="3616" y="990" rot="-10"/>
<obj type="nonInteractive16" x="-176" y="280" rot="0"/>
<obj type="nonInteractive16" x="712" y="314" rot="10"/>
<obj type="nonInteractive16" x="1477" y="869" rot="10"/>
<obj type="nonInteractive16" x="4028" y="1109" rot="40"/>
<obj type="nonInteractive16" x="6149" y="1687" rot="10"/>
<obj type="nonInteractive03" x="4798" y="1425" rot="0"/>
<obj type="nonInteractive03" x="5591" y="1397" rot="20"/>
<obj type="nonInteractive12" x="5995" y="1661" rot="0"/>
<obj type="nonInteractive12" x="8256" y="1694" rot="0"/>
<obj type="Bus" x="10465" y="2063" rot="8"/>
<obj type="furniture01" x="10001" y="1841" rot="20"/>
<obj type="killer01" x="10227" y="2045" rot="0"/>
<obj type="killer01" x="10321" y="2059" rot="0"/>
<obj type="nonInteractive16" x="11567" y="2351" rot="0"/>
<obj type="nonInteractive06" x="11665" y="2353" rot="0"/>
<obj type="nonInteractive14" x="17412" y="2669" rot="0"/>
<obj type="nonInteractive06" x="16848" y="2636" rot="0"/>
<obj type="nonInteractive06" x="17310" y="2658" rot="0"/>
<obj type="nonInteractive06" x="17587" y="2672" rot="0"/>
<obj type="nonInteractive06" x="17809" y="2675" rot="0"/>
<obj type="nonInteractive06" x="15914" y="2558" rot="0"/>
<obj type="nonInteractive06" x="15308" y="2697" rot="0"/>
<obj type="nonInteractive07" x="14513" y="2642" rot="0"/>
<obj type="nonInteractive07" x="12148" y="2351" rot="0"/>
<obj type="Bus" x="12838" y="2687" rot="20"/>
<obj type="furniture01" x="12563" y="2342" rot="20"/>
<obj type="killer01" x="12678" y="2591" rot="80"/>
<obj type="killer01" x="12656" y="2487" rot="80"/>
<obj type="endrace" x="19097" y="2680" rot="0"/>
<obj type="Checkpoint" x="16023" y="2553" rot="0"/>
<obj type="Checkpoint" x="14128" y="2602" rot="0"/>
<obj type="Checkpoint" x="13339" y="2703" rot="0"/>
<obj type="Checkpoint" x="12325" y="2320" rot="0"/>
<obj type="Checkpoint" x="10805" y="2217" rot="0"/>
<obj type="Checkpoint" x="9094" y="1821" rot="0"/>
<obj type="Checkpoint" x="6631" y="1686" rot="0"/>
<obj type="Checkpoint" x="5028" y="1373" rot="0"/>
<obj type="Checkpoint" x="1657" y="902" rot="0"/>
<obj type="nonInteractive12" x="1301" y="827" rot="0"/>
<obj type="nonInteractive12" x="4166" y="1239" rot="0"/>
<obj type="nonInteractive12" x="4830" y="1419" rot="0"/>
<obj type="nonInteractive12" x="5555" y="1389" rot="0"/>
<obj type="nonInteractive12" x="10955" y="2247" rot="0"/>
<obj type="nonInteractive12" x="11513" y="2347" rot="0"/>
<obj type="nonInteractive12" x="13489" y="2698" rot="0"/>
<obj type="nonInteractive12" x="14754" y="2643" rot="0"/>
<obj type="nonInteractive12" x="16654" y="2623" rot="0"/>
<obj type="nonInteractive12" x="17687" y="2667" rot="0"/>
<obj type="nonInteractive12" x="18829" y="2672" rot="0"/>
<obj type="nonInteractive15" x="1181" y="78" rot="0"/>
<obj type="nonInteractive15" x="1525" y="327" rot="0"/>
<obj type="nonInteractive15" x="1740" y="8" rot="0"/>
<obj type="nonInteractive15" x="1351" y="-259" rot="0"/>
<obj type="nonInteractive15" x="827" y="-464" rot="0"/>
<obj type="nonInteractive15" x="1664" y="588" rot="0"/>
<obj type="nonInteractive15" x="1298" y="478" rot="0"/>
<obj type="nonInteractive15" x="2089" y="475" rot="0"/>
<obj type="nonInteractive15" x="2363" y="600" rot="0"/>
<obj type="nonInteractive15" x="2737" y="230" rot="0"/>
<obj type="nonInteractive15" x="2848" y="507" rot="0"/>
<obj type="nonInteractive15" x="3834" y="494" rot="0"/>
<obj type="nonInteractive15" x="4138" y="726" rot="0"/>
<obj type="nonInteractive15" x="4424" y="964" rot="0"/>
<obj type="nonInteractive15" x="4652" y="580" rot="0"/>
<obj type="nonInteractive15" x="5384" y="999" rot="0"/>
<obj type="nonInteractive15" x="5797" y="815" rot="0"/>
<obj type="nonInteractive15" x="6033" y="1217" rot="0"/>
<obj type="nonInteractive15" x="6304" y="1105" rot="0"/>
<obj type="nonInteractive15" x="6028" y="936" rot="0"/>
<obj type="nonInteractive15" x="7067" y="1164" rot="0"/>
<obj type="nonInteractive15" x="7128" y="1397" rot="0"/>
<obj type="nonInteractive15" x="7447" y="1367" rot="0"/>
<obj type="nonInteractive15" x="8055" y="1027" rot="0"/>
<obj type="nonInteractive15" x="7941" y="1231" rot="0"/>
<obj type="nonInteractive15" x="8455" y="1059" rot="0"/>
<obj type="nonInteractive15" x="8615" y="1166" rot="0"/>
<obj type="nonInteractive15" x="8521" y="1352" rot="0"/>
<obj type="nonInteractive15" x="9522" y="1402" rot="0"/>
<obj type="nonInteractive15" x="9805" y="1209" rot="0"/>
<obj type="nonInteractive15" x="9982" y="1473" rot="0"/>
<obj type="nonInteractive15" x="10542" y="1598" rot="0"/>
<obj type="nonInteractive15" x="10346" y="1368" rot="0"/>
<obj type="nonInteractive15" x="10970" y="1410" rot="0"/>
<obj type="nonInteractive15" x="10916" y="1686" rot="0"/>
<obj type="nonInteractive15" x="11602" y="1995" rot="0"/>
<obj type="nonInteractive15" x="11869" y="1853" rot="0"/>
<obj type="nonInteractive15" x="11466" y="1542" rot="0"/>
<obj type="nonInteractive15" x="12214" y="1973" rot="0"/>
<obj type="nonInteractive15" x="12291" y="1614" rot="0"/>
<obj type="nonInteractive15" x="11920" y="1461" rot="0"/>
<obj type="nonInteractive15" x="12529" y="1818" rot="0"/>
<obj type="nonInteractive15" x="12879" y="2118" rot="0"/>
<obj type="nonInteractive15" x="13090" y="2297" rot="0"/>
<obj type="nonInteractive15" x="13450" y="2046" rot="0"/>
<obj type="nonInteractive15" x="13649" y="2300" rot="0"/>
<obj type="nonInteractive15" x="14056" y="2256" rot="0"/>
<obj type="nonInteractive15" x="14647" y="2177" rot="0"/>
<obj type="nonInteractive15" x="14415" y="2374" rot="0"/>
<obj type="nonInteractive15" x="15159" y="2173" rot="0"/>
<obj type="nonInteractive15" x="15351" y="2432" rot="0"/>
<obj type="nonInteractive15" x="15913" y="2282" rot="0"/>
<obj type="nonInteractive15" x="16350" y="2179" rot="0"/>
<obj type="nonInteractive15" x="16721" y="2111" rot="0"/>
<obj type="nonInteractive15" x="16841" y="2327" rot="0"/>
<obj type="nonInteractive15" x="17267" y="2188" rot="0"/>
<obj type="nonInteractive15" x="17597" y="2322" rot="0"/>
<obj type="nonInteractive15" x="18006" y="2431" rot="0"/>
<obj type="Checkpoint" x="101" y="283" rot="0"/>
<obj type="Bus" x="7230" y="1806" rot="0"/>
<obj type="Bus" x="7406" y="1811" rot="0"/>
<obj type="Bus" x="7582" y="1817" rot="0"/>
<obj type="Bus" x="7779" y="1764" rot="0"/>
<obj type="furniture01" x="7607" y="1570" rot="0"/>
<obj type="Pickup" x="928" y="348" rot="0"/>
<obj type="Pickup" x="1006" y="396" rot="0"/>
<obj type="Pickup" x="1138" y="571" rot="0"/>
<obj type="Pickup" x="1255" y="744" rot="0"/>
<obj type="Pickup" x="1758" y="857" rot="0"/>
<obj type="Pickup" x="1934" y="769" rot="0"/>
<obj type="Pickup" x="2290" y="761" rot="0"/>
<obj type="Pickup" x="2457" y="757" rot="0"/>
<obj type="Pickup" x="2637" y="760" rot="0"/>
<obj type="Pickup" x="2822" y="757" rot="0"/>
<obj type="Pickup" x="3026" y="770" rot="0"/>
<obj type="Pickup" x="3217" y="778" rot="0"/>
<obj type="Pickup" x="3355" y="777" rot="0"/>
<obj type="Pickup" x="3555" y="726" rot="0"/>
<obj type="Pickup" x="5610" y="1349" rot="0"/>
<obj type="Pickup" x="5733" y="1410" rot="0"/>
<obj type="Pickup" x="5812" y="1514" rot="0"/>
<obj type="Pickup" x="5938" y="1584" rot="0"/>
<obj type="Pickup" x="7216" y="1528" rot="0"/>
<obj type="Pickup" x="7328" y="1529" rot="0"/>
<obj type="Pickup" x="7443" y="1532" rot="0"/>
<obj type="Pickup" x="7561" y="1535" rot="0"/>
<obj type="Pickup" x="7664" y="1485" rot="0"/>
<obj type="Pickup" x="7769" y="1485" rot="0"/>
<obj type="Pickup" x="9873" y="1763" rot="0"/>
<obj type="Pickup" x="9947" y="1791" rot="0"/>
<obj type="Pickup" x="10033" y="1790" rot="0"/>
<obj type="Pickup" x="10440" y="1784" rot="0"/>
<obj type="Pickup" x="10498" y="1787" rot="0"/>
<obj type="Pickup" x="10551" y="1797" rot="0"/>
<obj type="Pickup" x="12458" y="2290" rot="0"/>
<obj type="Pickup" x="12543" y="2301" rot="0"/>
<obj type="Pickup" x="12618" y="2295" rot="0"/>
<obj type="Pickup" x="12858" y="2402" rot="0"/>
<obj type="Pickup" x="12912" y="2421" rot="0"/>
<obj type="Pickup" x="12970" y="2448" rot="0"/>
<obj type="Pickup" x="13086" y="2502" rot="0"/>
<obj type="Pickup" x="13150" y="2548" rot="0"/>
<obj type="Pickup" x="13195" y="2609" rot="0"/>
<obj type="Pickup" x="13266" y="2648" rot="0"/>
<obj type="Pickup" x="15554" y="2646" rot="0"/>
<obj type="Pickup" x="15643" y="2620" rot="0"/>
<obj type="Pickup" x="15718" y="2591" rot="0"/>
<obj type="Pickup" x="15809" y="2552" rot="0"/>
<obj type="Pickup" x="18099" y="2649" rot="0"/>
<obj type="Pickup" x="18208" y="2649" rot="0"/>
<obj type="Pickup" x="18336" y="2648" rot="0"/>
<obj type="Pickup" x="18526" y="2571" rot="0"/>
<line>
<points a="-319,285, 518,285, 862,344, 1067,479, 1127,653, 1271,819, 1451,867, 1639,902, 1869,874, 1924,828"/>
<points a="2018,738, 2088,770, 2092,830, 2196,1033, 2358,1045, 2573,1033, 2765,1023, 2972,1058, 3172,1059, 3357,1085"/>
<points a="3497,1033, 3606,1001, 3759,965, 3885,996, 4032,1119, 4173,1240, 4436,1383, 4757,1425, 4878,1423, 4937,1395"/>
<points a="4993,1371, 5061,1370, 5094,1345, 5148,1334, 5204,1350, 5237,1392, 5296,1428, 5394,1411, 5461,1414, 5534,1386"/>
<points a="5649,1410, 5687,1452, 5814,1587, 6012,1665, 6207,1701, 6420,1714, 6608,1695, 6786,1622, 6909,1544, 6947,1586"/>
<points a="6955,1653, 7137,1797, 7323,1827, 7522,1827, 7839,1707, 7884,1611, 7951,1535, 7999,1575, 8016,1613, 8163,1694"/>
<points a="8304,1698, 8382,1781, 8461,1849, 8596,1893, 8828,1898, 8873,1836, 8948,1818, 9005,1875, 9067,1822, 9150,1812"/>
<points a="9313,1771, 9442,1862, 9491,1821, 9537,1741, 9615,1691, 9752,1728, 9873,1822, 10006,1840, 10148,1949, 10182,2046"/>
<points a="10556,2088, 10670,2178, 10928,2249, 11070,2235, 11258,2196, 11372,2252, 11452,2355, 11704,2354, 11740,2330, 11803,2309"/>
<points a="11823,2281, 11865,2264, 11887,2286, 11887,2328, 11930,2356, 11963,2347, 12012,2349, 12033,2323, 12064,2343, 12124,2358"/>
<points a="12271,2339, 12292,2310, 12355,2328, 12436,2315, 12508,2327, 12628,2361, 12684,2646, 12913,2738, 12964,2575, 13041,2512"/>
<points a="13130,2572, 13168,2637, 13255,2681, 13413,2722, 13620,2669, 13740,2608, 13877,2567, 13932,2554, 13959,2526, 14000,2521"/>
<points a="14015,2549, 14033,2580, 14084,2593, 14227,2612, 14299,2576, 14354,2549, 14386,2589, 14436,2634, 14691,2660, 14769,2647"/>
<points a="14831,2610, 14855,2566, 14912,2545, 14983,2569, 15010,2616, 15072,2641, 15155,2650, 15195,2672, 15249,2697, 15485,2696"/>
<points a="15643,2653, 15873,2560, 16063,2549, 16235,2600, 16272,2580, 16304,2559, 16320,2533, 16357,2515, 16417,2508, 16448,2553"/>
<points a="16463,2611, 16594,2590, 16616,2621, 16724,2632, 16768,2612, 16956,2654, 16999,2569, 17158,2596, 17223,2653, 17666,2674"/>
<points a="20575,2675, 21070,2670"/>
</line>
</level>
<level name="Sunset City: The Car Park" category="0" fillframe="5" surfaceframe="6" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1" exclusivechar="-1">
<obj type="endrace" x="18085" y="1302" rot="0"/>
<obj type="nonInteractive12" x="14774" y="1205" rot="0"/>
<obj type="nonInteractive12" x="13698" y="1262" rot="0"/>
<obj type="nonInteractive12" x="12724" y="1136" rot="0"/>
<obj type="nonInteractive12" x="11431" y="990" rot="0"/>
<obj type="nonInteractive12" x="9944" y="896" rot="0"/>
<obj type="nonInteractive12" x="8684" y="962" rot="0"/>
<obj type="nonInteractive12" x="7737" y="832" rot="0"/>
<obj type="nonInteractive12" x="6270" y="376" rot="0"/>
<obj type="nonInteractive12" x="4986" y="481" rot="0"/>
<obj type="nonInteractive12" x="3432" y="585" rot="0"/>
<obj type="nonInteractive12" x="1493" y="534" rot="0"/>
<obj type="nonInteractive12" x="544" y="334" rot="0"/>
<obj type="nonInteractive12" x="-302" y="281" rot="0"/>
<obj type="killer01" x="2344" y="419" rot="-80"/>
<obj type="killer01" x="2326" y="521" rot="-80"/>
<obj type="nonInteractive16" x="1753" y="535" rot="0"/>
<obj type="nonInteractive16" x="1469" y="534" rot="0"/>
<obj type="nonInteractive16" x="3651" y="586" rot="0"/>
<obj type="nonInteractive16" x="4234" y="601" rot="0"/>
<obj type="nonInteractive16" x="5497" y="480" rot="0"/>
<obj type="nonInteractive16" x="6684" y="486" rot="0"/>
<obj type="Checkpoint" x="4063" y="600" rot="0"/>
<obj type="Checkpoint" x="221" y="328" rot="0"/>
<obj type="Checkpoint" x="2766" y="387" rot="0"/>
<obj type="Checkpoint" x="3759" y="590" rot="0"/>
<obj type="Checkpoint" x="6229" y="381" rot="0"/>
<obj type="Checkpoint" x="7019" y="423" rot="0"/>
<obj type="Checkpoint" x="7514" y="666" rot="0"/>
<obj type="Checkpoint" x="8172" y="1026" rot="0"/>
<obj type="Checkpoint" x="9070" y="848" rot="0"/>
<obj type="Checkpoint" x="10452" y="1159" rot="0"/>
<obj type="Checkpoint" x="11490" y="996" rot="0"/>
<obj type="Checkpoint" x="12632" y="1140" rot="0"/>
<obj type="Checkpoint" x="13811" y="1269" rot="0"/>
<obj type="Checkpoint" x="15725" y="1299" rot="0"/>
<obj type="nonInteractive03" x="15126" y="1372" rot="0"/>
<obj type="nonInteractive03" x="14344" y="1180" rot="0"/>
<obj type="nonInteractive03" x="13701" y="1270" rot="0"/>
<obj type="nonInteractive03" x="12731" y="1142" rot="0"/>
<obj type="nonInteractive03" x="11770" y="1054" rot="0"/>
<obj type="nonInteractive03" x="11437" y="995" rot="0"/>
<obj type="nonInteractive03" x="9970" y="904" rot="0"/>
<obj type="nonInteractive15" x="3069" y="-86" rot="0"/>
<obj type="nonInteractive15" x="3518" y="10" rot="0"/>
<obj type="nonInteractive15" x="2211" y="180" rot="0"/>
<obj type="nonInteractive15" x="2494" y="42" rot="0"/>
<obj type="nonInteractive15" x="4875" y="240" rot="0"/>
<obj type="nonInteractive15" x="5895" y="13" rot="0"/>
<obj type="nonInteractive15" x="6180" y="-197" rot="0"/>
<obj type="nonInteractive15" x="5550" y="-380" rot="0"/>
<obj type="nonInteractive15" x="7228" y="170" rot="0"/>
<obj type="nonInteractive15" x="7460" y="392" rot="0"/>
<obj type="nonInteractive15" x="7696" y="58" rot="0"/>
<obj type="nonInteractive15" x="8108" y="586" rot="0"/>
<obj type="nonInteractive15" x="8401" y="711" rot="0"/>
<obj type="nonInteractive15" x="9492" y="477" rot="0"/>
<obj type="nonInteractive15" x="10039" y="613" rot="0"/>
<obj type="nonInteractive15" x="10525" y="397" rot="0"/>
<obj type="nonInteractive15" x="10488" y="644" rot="0"/>
<obj type="nonInteractive15" x="11157" y="796" rot="0"/>
<obj type="nonInteractive15" x="11561" y="678" rot="0"/>
<obj type="nonInteractive15" x="12079" y="796" rot="0"/>
<obj type="nonInteractive15" x="12330" y="1011" rot="0"/>
<obj type="nonInteractive15" x="12911" y="618" rot="0"/>
<obj type="nonInteractive15" x="13166" y="1129" rot="0"/>
<obj type="nonInteractive15" x="13555" y="874" rot="0"/>
<obj type="nonInteractive15" x="14278" y="1070" rot="0"/>
<obj type="nonInteractive15" x="14545" y="813" rot="0"/>
<obj type="nonInteractive15" x="14837" y="902" rot="0"/>
<obj type="girder01" x="1847" y="549" rot="-30"/>
<obj type="girder01" x="3080" y="230" rot="-10"/>
<obj type="girder01" x="3486" y="160" rot="0"/>
<obj type="girder01" x="4097" y="160" rot="0"/>
<obj type="girder01" x="4722" y="149" rot="-10"/>
<obj type="girder01" x="5374" y="38" rot="10"/>
<obj type="CarFront" x="5172" y="471" rot="0"/>
<obj type="CarFront" x="5272" y="471" rot="0"/>
<obj type="CarFront" x="5374" y="470" rot="0"/>
<obj type="CarFront" x="6134" y="368" rot="0"/>
<obj type="CarFront" x="6807" y="477" rot="0"/>
<obj type="CarSide" x="3640" y="572" rot="0"/>
<obj type="CarSide" x="3640" y="572" rot="0"/>
<obj type="CarSide" x="5504" y="464" rot="0"/>
<obj type="CarSide" x="7348" y="643" rot="0"/>
<obj type="CarSide" x="8453" y="1002" rot="0"/>
<obj type="CarSide" x="10286" y="1132" rot="0"/>
<obj type="CarSide" x="12230" y="1223" rot="0"/>
<obj type="CarFront" x="13065" y="1233" rot="0"/>
<obj type="CarFront" x="14195" y="1200" rot="0"/>
<obj type="furniture01" x="15284" y="1366" rot="0"/>
<obj type="furniture01" x="14015" y="1218" rot="0"/>
<obj type="furniture01" x="14015" y="1218" rot="0"/>
<obj type="furniture01" x="12760" y="1141" rot="10"/>
<obj type="furniture01" x="11975" y="1063" rot="10"/>
<obj type="nonInteractive16" x="12295" y="1236" rot="0"/>
<obj type="nonInteractive16" x="12990" y="1251" rot="0"/>
<obj type="nonInteractive16" x="10246" y="1147" rot="0"/>
<obj type="nonInteractive16" x="9619" y="754" rot="0"/>
<obj type="nonInteractive03" x="4090" y="603" rot="0"/>
<obj type="nonInteractive03" x="4833" y="487" rot="0"/>
<obj type="furniture01" x="5043" y="484" rot="0"/>
<obj type="furniture01" x="6667" y="489" rot="0"/>
<obj type="CarFront" x="15462" y="1351" rot="0"/>
<obj type="girder01" x="10233" y="778" rot="-20"/>
<obj type="girder01" x="10637" y="686" rot="10"/>
<obj type="Pickup" x="1922" y="478" rot="0"/>
<obj type="Pickup" x="1977" y="446" rot="0"/>
<obj type="Pickup" x="2033" y="411" rot="0"/>
<obj type="Pickup" x="2088" y="379" rot="0"/>
<obj type="Pickup" x="2150" y="345" rot="0"/>
<obj type="Pickup" x="3103" y="203" rot="0"/>
<obj type="Pickup" x="3169" y="187" rot="0"/>
<obj type="Pickup" x="3238" y="173" rot="0"/>
<obj type="Pickup" x="3309" y="160" rot="0"/>
<obj type="Pickup" x="3375" y="147" rot="0"/>
<obj type="Pickup" x="3439" y="134" rot="0"/>
<obj type="Pickup" x="3506" y="132" rot="0"/>
<obj type="Pickup" x="3567" y="129" rot="0"/>
<obj type="Pickup" x="3632" y="130" rot="0"/>
<obj type="Pickup" x="3699" y="129" rot="0"/>
<obj type="Pickup" x="3758" y="128" rot="0"/>
<obj type="Pickup" x="3815" y="127" rot="0"/>
<obj type="Pickup" x="3870" y="128" rot="0"/>
<obj type="Pickup" x="4109" y="138" rot="0"/>
<obj type="Pickup" x="4184" y="137" rot="0"/>
<obj type="Pickup" x="4251" y="138" rot="0"/>
<obj type="Pickup" x="4320" y="133" rot="0"/>
<obj type="Pickup" x="4375" y="134" rot="0"/>
<obj type="Pickup" x="4438" y="133" rot="0"/>
<obj type="Pickup" x="4735" y="114" rot="0"/>
<obj type="Pickup" x="4810" y="102" rot="0"/>
<obj type="Pickup" x="4884" y="92" rot="0"/>
<obj type="Pickup" x="4951" y="81" rot="0"/>
<obj type="Pickup" x="5020" y="74" rot="0"/>
<obj type="Pickup" x="5088" y="59" rot="0"/>
<obj type="Pickup" x="5391" y="14" rot="0"/>
<obj type="Pickup" x="5458" y="22" rot="0"/>
<obj type="Pickup" x="5532" y="35" rot="0"/>
<obj type="Pickup" x="5593" y="50" rot="0"/>
<obj type="Pickup" x="5656" y="59" rot="0"/>
<obj type="Pickup" x="5717" y="69" rot="0"/>
<obj type="Pickup" x="5774" y="81" rot="0"/>
<obj type="Pickup" x="10248" y="730" rot="0"/>
<obj type="Pickup" x="10323" y="700" rot="0"/>
<obj type="Pickup" x="10393" y="676" rot="0"/>
<obj type="Pickup" x="10462" y="654" rot="0"/>
<obj type="Pickup" x="10538" y="628" rot="0"/>
<obj type="Pickup" x="10677" y="665" rot="0"/>
<obj type="Pickup" x="10761" y="678" rot="0"/>
<obj type="Pickup" x="10836" y="688" rot="0"/>
<obj type="Pickup" x="10910" y="700" rot="0"/>
<obj type="Pickup" x="10989" y="714" rot="0"/>
<line>
<points a="-620,282, -253,282, 131,331, 861,339, 1311,338, 1311,538, 1861,538, 2311,538, 2355,353, 2523,329"/>
<points a="2705,389, 2802,381, 2857,341, 2943,346, 2975,414, 3192,435, 3279,529, 3400,591, 3820,590, 3852,551"/>
<points a="3929,531, 3979,555, 4006,601, 4425,602, 4785,484, 5663,484, 5855,283, 6055,283, 6089,382, 6441,380"/>
<points a="6500,490, 6851,490, 6925,420, 7175,420, 7263,664, 7575,665, 7578,728, 7706,837, 7951,840, 7982,1022"/>
<points a="8534,1022, 8576,969, 8805,968, 8996,848, 9325,845, 9354,808, 9448,808, 9482,764, 9865,764, 9915,901"/>
<points a="10095,902, 10152,1103, 10203,1156, 10603,1156, 10634,1116, 10881,1117, 10954,1054, 11154,1054, 11185,1086, 11343,1086"/>
<points a="11395,994, 11645,994, 11706,1052, 12006,1052, 12146,1242, 12446,1242, 12474,1192, 12543,1191, 12596,1140, 12809,1140"/>
<points a="12857,1257, 13160,1255, 13197,1322, 13597,1322, 13651,1269, 13852,1268, 13887,1221, 14254,1222, 14298,1178, 14498,1178"/>
<points a="14535,1250, 14685,1250, 14718,1210, 14903,1210, 14996,1371, 15646,1371, 15695,1300, 19295,1300"/>
</line>
</level>
<level name="Sunset City: Piano Chase Special" category="0" fillframe="1" surfaceframe="5" surfacethickness="10" type="chase" opponents="24" win="1" exclusivechar="12">
<obj type="endrace" x="39790" y="1292" rot="0"/>
<obj type="Checkpoint" x="1783" y="1567" rot="0"/>
<obj type="Checkpoint" x="5051" y="1783" rot="0"/>
<obj type="girder01" x="6042" y="1740" rot="-30"/>
<obj type="girder01" x="6897" y="1784" rot="-150"/>
<obj type="girder01" x="9625" y="1715" rot="-20"/>
<obj type="girder01" x="10000.877048314363" y="1578.1919426697325" rot="0"/>
<obj type="girder01" x="10400.877048314363" y="1578.1919426697325" rot="20"/>
<obj type="girder01" x="10792" y="1808" rot="-40"/>
<obj type="girder01" x="11098.41777724759" y="1550.8849561253842" rot="0"/>
<obj type="girder01" x="11498.41777724759" y="1550.8849561253842" rot="0"/>
<obj type="girder01" x="11898.41777724759" y="1550.8849561253842" rot="0"/>
<obj type="girder01" x="12298.41777724759" y="1550.8849561253842" rot="40"/>
<obj type="girder01" x="14648" y="1719" rot="-20"/>
<obj type="girder01" x="15023.877048314363" y="1582.1919426697325" rot="0"/>
<obj type="girder01" x="15423.877048314363" y="1582.1919426697325" rot="-20"/>
<obj type="girder01" x="15799.754096628729" y="1445.383885339465" rot="-20"/>
<obj type="girder01" x="16175.63114494309" y="1308.5758280091975" rot="-10"/>
<obj type="girder01" x="17449" y="1306" rot="0"/>
<obj type="girder01" x="20810" y="1266" rot="-20"/>
<obj type="girder01" x="21185.877048314363" y="1129.1919426697325" rot="-10"/>
<obj type="girder01" x="21579.800149519247" y="1059.7326716029604" rot="0"/>
<obj type="girder01" x="21979.800149519247" y="1059.7326716029604" rot="20"/>
<obj type="girder01" x="27556" y="1185" rot="-30"/>
<obj type="girder01" x="27902.410161513777" y="985" rot="0"/>
<obj type="girder01" x="28302.410161513777" y="985" rot="-20"/>
<obj type="girder01" x="28678.28720982814" y="848.1919426697325" rot="-10"/>
<obj type="girder01" x="29072.210311033024" y="778.7326716029604" rot="0"/>
<obj type="girder01" x="29281" y="825" rot="90"/>
<obj type="Checkpoint" x="7926" y="1713" rot="0"/>
<obj type="Checkpoint" x="11612" y="1550" rot="0"/>
<obj type="Checkpoint" x="13939" y="1698" rot="0"/>
<obj type="Checkpoint" x="16757" y="1170" rot="0"/>
<obj type="Checkpoint" x="20375" y="1188" rot="0"/>
<obj type="Checkpoint" x="24017" y="1263" rot="0"/>
<obj type="Checkpoint" x="28027" y="985" rot="0"/>
<obj type="Checkpoint" x="32851" y="1507" rot="0"/>
<obj type="furniture04" x="7830" y="1718" rot="0"/>
<obj type="furniture04" x="9392" y="1629" rot="0"/>
<obj type="furniture01" x="12190" y="1554" rot="0"/>
<obj type="furniture04" x="13974" y="1700" rot="0"/>
<obj type="furniture04" x="13737" y="1700" rot="0"/>
<obj type="furniture04" x="18535" y="1171" rot="0"/>
<obj type="furniture04" x="20586" y="1193" rot="0"/>
<obj type="furniture01" x="24230" y="1265" rot="0"/>
<obj type="furniture04" x="30171" y="996" rot="0"/>
<obj type="furniture04" x="32386" y="1508" rot="0"/>
<obj type="furniture01" x="34498" y="1189" rot="0"/>
<line>
<points a="27,240, 977,240, 1115,1501, 1147,1556, 1192,1568, 2392,1568, 3792,1568, 4021,1606, 4323,1702, 4640,1763"/>
<points a="4974,1789, 5156,1786, 5411,1756, 5791,1689, 5908,1669, 6131,1642, 6553,1641, 7189,1664, 7727,1717, 8222,1708"/>
<points a="8721,1659, 9227,1610, 9469,1631, 9969,1709, 10717,1701, 11038,1623, 11144,1732, 11238,1654, 11317,1749, 11381,1655"/>
<points a="11447,1759, 11520,1664, 11613,1762, 11670,1675, 11771,1728, 11841,1643, 11890,1714, 11995,1609, 12079,1714, 12132,1632"/>
<points a="12243,1703, 12328,1613, 12426,1547, 12613,1549, 12874,1572, 13025,1645, 13209,1657, 13312,1717, 13560,1717, 13662,1699"/>
<points a="14162,1699, 14207,1678, 14588,1621, 14778,1631, 14907,1692, 14966,1755, 15031,1703, 15106,1754, 15155,1706, 15203,1757"/>
<points a="15263,1699, 15311,1764, 15371,1688, 15481,1753, 15634,1569, 15697,1607, 15737,1528, 15772,1575, 15901,1567, 15965,1495"/>
<points a="16006,1530, 16123,1412, 16206,1465, 16265,1383, 16405,1299, 16534,1201, 16648,1167, 16863,1172, 17102,1252, 17334,1292"/>
<points a="17705,1335, 17982,1248, 18154,1208, 18335,1178, 18737,1152, 19013,1152, 19429,1177, 19700,1246, 19867,1283, 20052,1262"/>
<points a="20120,1216, 20302,1192, 20519,1186, 20906,1207, 21556,1207, 22309,1132, 22778,1074, 23312,1146, 23872,1270, 24384,1252"/>
<points a="20120,1216, 20302,1192, 20519,1186, 20906,1207, 21556,1207, 22309,1132, 22778,1074, 23312,1146, 23872,1270, 24384,1252"/>
<points a="24770,1167, 24911,1144, 24973,1136, 25001,1136, 25026,1137, 25056,1152, 25076,1169, 25116,1212, 25146,1237, 25178,1252"/>
<points a="25226,1262, 25261,1263, 25383,1264, 25492,1258, 25532,1248, 25576,1232, 25635,1203, 25690,1184, 25737,1180, 25783,1180"/>
<points a="25829,1185, 25880,1195, 25948,1230, 26012,1265, 26064,1284, 26132,1319, 26179,1330, 26238,1344, 26315,1347, 26398,1344"/>
<points a="26450,1343, 26503,1331, 26558,1308, 26616,1266, 26665,1240, 26707,1225, 26745,1206, 26800,1184, 26851,1173, 26893,1161"/>
<points a="26960,1138, 27036,1130, 27109,1120, 27159,1120, 27207,1119, 27332,1124, 27471,1148, 27728,1158, 27925,1106, 28030,1154"/>
<points a="28122,1105, 28204,1167, 28310,1090, 28361,1154, 28447,1081, 28559,1167, 28622,1096, 28716,1146, 28768,1088, 29003,1124"/>
<points a="29115,967, 29222,912, 29397,919, 29601,987, 29851,927, 30019,1000, 30339,989, 30492,998, 30751,1059, 31023,1140"/>
<points a="31238,1222, 31402,1295, 31652,1388, 31890,1448, 32163,1491, 32476,1508, 32875,1510, 33273,1490, 33582,1425, 33804,1359"/>
<points a="33967,1282, 34056,1231, 34195,1192, 34306,1183, 34386,1182, 34758,1182, 34828,1237, 34929,1287, 35091,1290, 36541,1290"/>
<points a="37691,1290, 38841,1290, 40641,1290, 41941,1290"/>
</line>
</level>
<!-- World 3 Outlands -->
<level name="Outlands: The caves" category="0" fillframe="7" surfaceframe="8" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1" exclusivechar="-1">
<obj type="nonInteractive15" x="17335" y="436" rot="0"/>
<obj type="nonInteractive15" x="17576" y="237" rot="0"/>
<obj type="nonInteractive15" x="17780" y="484" rot="0"/>
<obj type="endrace" x="20649" y="836" rot="0"/>
<obj type="Checkpoint" x="18296" y="851" rot="0"/>
<obj type="Checkpoint" x="16690" y="757" rot="0"/>
<obj type="Checkpoint" x="14080" y="750" rot="0"/>
<obj type="Checkpoint" x="12724" y="627" rot="0"/>
<obj type="Checkpoint" x="11780" y="755" rot="0"/>
<obj type="Checkpoint" x="10761" y="606" rot="0"/>
<obj type="Checkpoint" x="8283" y="501" rot="0"/>
<obj type="Checkpoint" x="6790" y="786" rot="0"/>
<obj type="Checkpoint" x="5324" y="709" rot="0"/>
<obj type="Checkpoint" x="4122" y="603" rot="0"/>
<obj type="Checkpoint" x="1591" y="565" rot="0"/>
<obj type="Checkpoint" x="746" y="322" rot="0"/>
<obj type="nonInteractive08" x="1366" y="553" rot="0"/>
<obj type="nonInteractive08" x="1500" y="567" rot="0"/>
<obj type="nonInteractive08" x="5009" y="644" rot="0"/>
<obj type="nonInteractive08" x="5122" y="659" rot="0"/>
<obj type="nonInteractive08" x="5842" y="1078" rot="0"/>
<obj type="nonInteractive08" x="5986" y="1067" rot="0"/>
<obj type="nonInteractive15" x="5683" y="663" rot="0"/>
<obj type="nonInteractive15" x="7479" y="441" rot="0"/>
<obj type="nonInteractive15" x="7697" y="284" rot="0"/>
<obj type="nonInteractive15" x="7167" y="247" rot="0"/>
<obj type="nonInteractive15" x="9100" y="367" rot="0"/>
<obj type="nonInteractive15" x="9352" y="310" rot="0"/>
<obj type="nonInteractive15" x="8926" y="159" rot="0"/>
<obj type="nonInteractive15" x="11194" y="392" rot="0"/>
<obj type="nonInteractive15" x="11470" y="503" rot="0"/>
<obj type="nonInteractive15" x="19305" y="505" rot="0"/>
<obj type="nonInteractive15" x="19575" y="419" rot="0"/>
<obj type="nonInteractive09" x="4690" y="633" rot="0"/>
<obj type="nonInteractive09" x="6004" y="1059" rot="0"/>
<obj type="nonInteractive09" x="5862" y="1072" rot="0"/>
<obj type="nonInteractive09" x="6934" y="787" rot="0"/>
<obj type="nonInteractive09" x="7549" y="793" rot="0"/>
<obj type="nonInteractive09" x="8434" y="475" rot="-10"/>
<obj type="nonInteractive09" x="9089" y="664" rot="0"/>
<obj type="nonInteractive09" x="9852" y="648" rot="0"/>
<obj type="nonInteractive09" x="11485" y="752" rot="0"/>
<obj type="nonInteractive17" x="2270" y="560" rot="0"/>
<obj type="nonInteractive17" x="2522" y="562" rot="0"/>
<obj type="nonInteractive17" x="2522" y="562" rot="0"/>
<obj type="nonInteractive17" x="2524" y="308" rot="0"/>
<obj type="nonInteractive17" x="2772" y="476" rot="0"/>
<obj type="nonInteractive17" x="3025" y="440" rot="0"/>
<obj type="nonInteractive17" x="3280" y="507" rot="0"/>
<obj type="nonInteractive17" x="3280" y="260" rot="0"/>
<obj type="nonInteractive17" x="3535" y="422" rot="0"/>
<obj type="nonInteractive17" x="3537" y="523" rot="0"/>
<obj type="nonInteractive17" x="3484" y="650" rot="0"/>
<obj type="nonInteractive17" x="3780" y="401" rot="0"/>
<obj type="nonInteractive17" x="4000" y="316" rot="0"/>
<obj type="nonInteractive17" x="4029" y="561" rot="0"/>
<obj type="nonInteractive17" x="4261" y="441" rot="0"/>
<obj type="nonInteractive17" x="4186" y="466" rot="0"/>
<obj type="nonInteractive17" x="4262" y="573" rot="0"/>
<obj type="nonInteractive17" x="14838" y="635" rot="0"/>
<obj type="nonInteractive17" x="15093" y="572" rot="0"/>
<obj type="nonInteractive17" x="15345" y="547" rot="0"/>
<obj type="nonInteractive17" x="15345" y="683" rot="0"/>
<obj type="nonInteractive17" x="15600" y="583" rot="0"/>
<obj type="nonInteractive17" x="15600" y="583" rot="0"/>
<obj type="nonInteractive17" x="15855" y="657" rot="0"/>
<obj type="nonInteractive17" x="16104" y="667" rot="0"/>
<obj type="nonInteractive17" x="16242" y="436" rot="0"/>
<obj type="nonInteractive17" x="16361" y="641" rot="0"/>
<obj type="nonInteractive17" x="16285" y="667" rot="0"/>
<obj type="nonInteractive17" x="16600" y="640" rot="0"/>
<line>
<points a="-490,309, 56,314, 889,320, 1046,364, 1256,509, 1420,552, 1552,569, 1752,551, 1886,582, 2208,594"/>
<points a="2369,680, 2541,629, 2722,581, 2921,539, 3116,521, 3273,571, 3391,618, 3504,563, 3565,555, 3612,518"/>
<points a="3656,501, 3685,461, 3753,441, 3829,459, 3921,528, 4049,588, 4242,616, 4450,654, 4861,605, 5073,636"/>
<points a="5215,660, 5465,758, 5510,895, 5730,1030, 5846,1055, 5903,1067, 6095,1036, 6292,962, 6421,898, 6791,779"/>
<points a="7000,785, 7110,715, 7302,670, 7355,714, 7382,771, 7475,793, 7634,779, 7807,691, 8017,550, 8211,510"/>
<points a="8603,433, 8784,446, 8846,479, 9005,668, 9212,660, 9248,687, 9431,685, 9565,633, 9972,649, 10034,704"/>
<points a="10252,741, 10403,740, 10567,701, 10732,608, 10906,586, 11001,590, 11143,666, 11236,734, 11591,755, 11656,720"/>
<points a="11705,717, 11744,750, 11860,761, 12053,767, 12095,723, 12242,685, 12337,702, 12511,679, 12617,653, 12637,627"/>
<points a="12663,614, 12737,628, 12893,610, 12963,636, 13297,684, 13329,652, 13431,635, 13578,619, 13702,647, 13735,680"/>
<points a="13818,708, 13874,708, 13907,690, 13954,684, 13984,700, 14054,739, 14149,758, 14190,744, 14300,716, 14401,693"/>
<points a="14496,728, 14577,728, 14826,702, 14952,660, 15076,641, 15181,679, 15309,721, 15474,701, 15640,662, 15724,694"/>
<points a="15847,735, 16001,784, 16150,760, 16258,717, 16301,696, 16453,687, 16594,732, 16761,770, 16761,771, 16861,753"/>
<points a="17053,726, 17201,700, 17368,763, 17506,800, 17608,779, 17812,730, 17975,771, 18058,815, 18205,856, 18426,854"/>
<points a="18599,824, 18623,776, 18756,751, 18905,725, 18982,687, 19017,676, 19164,690, 19178,717, 19334,805, 19477,827"/>
<points a="19632,828, 21444,828"/>
</line>
<line type="1">
<points a="1888,-193, 1932,44, 1971,122, 2114,321, 2138,434, 2247,485, 2397,452, 2488,391, 2541,425, 2707,373"/>
<points a="2908,351, 2982,318, 3065,335, 3120,376, 3240,338, 3448,298, 3506,350, 3739,302, 3783,329, 3969,233"/>
<points a="4024,292, 4188,396, 4251,380, 4385,330, 4454,174, 4565,-294"/>
</line>
<line type="1">
<points a="14367,-63, 14438,122, 14529,387, 14605,478, 14719,574, 14787,595, 14873,559, 15098,472, 15347,433, 15502,490"/>
<points a="15681,526, 15891,577, 16094,564, 16176,522, 16320,550, 16442,573, 16498,574, 16729,515, 16827,387, 16891,264"/>
<points a="16975,43, 17102,-64, 17204,-127, 17341,-144, 17455,-319"/>
</line>
</level>
<level name="Outlands: Ski Jumps" category="0" fillframe="7" surfaceframe="8" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1">
<obj type="endrace" x="20285" y="4397" rot="0"/>
<obj type="Checkpoint" x="18575" y="4389" rot="0"/>
<obj type="Checkpoint" x="16338" y="3999" rot="0"/>
<obj type="Checkpoint" x="15050" y="3805" rot="0"/>
<obj type="Checkpoint" x="12163" y="3286" rot="0"/>
<obj type="Checkpoint" x="7045" y="2156" rot="0"/>
<obj type="Checkpoint" x="3137" y="1177" rot="0"/>
<obj type="Checkpoint" x="1702" y="97" rot="0"/>
<obj type="nonInteractive03" x="3343" y="1230" rot="0"/>
<obj type="nonInteractive08" x="5213" y="1473" rot="0"/>
<obj type="nonInteractive08" x="5070" y="1466" rot="0"/>
<obj type="nonInteractive08" x="4904" y="1451" rot="0"/>
<obj type="nonInteractive08" x="4745" y="1472" rot="0"/>
<obj type="nonInteractive08" x="4812" y="1420" rot="0"/>
<obj type="nonInteractive08" x="4589" y="1464" rot="0"/>
<obj type="nonInteractive08" x="4547" y="1502" rot="0"/>
<obj type="nonInteractive08" x="4415" y="1464" rot="0"/>
<obj type="nonInteractive08" x="4265" y="1450" rot="0"/>
<obj type="nonInteractive08" x="4135" y="1438" rot="0"/>
<obj type="nonInteractive08" x="4845" y="1472" rot="0"/>
<obj type="nonInteractive09" x="5821" y="1337" rot="20"/>
<obj type="nonInteractive09" x="6919" y="2143" rot="10"/>
<obj type="nonInteractive10" x="8030" y="2372" rot="0"/>
<obj type="nonInteractive10" x="8668" y="2411" rot="0"/>
<obj type="nonInteractive03" x="8488" y="2337" rot="20"/>
<obj type="nonInteractive03" x="9152" y="2305" rot="40"/>
<obj type="nonInteractive08" x="9716" y="2593" rot="0"/>
<obj type="nonInteractive08" x="9846" y="2598" rot="0"/>
<obj type="nonInteractive08" x="9996" y="2607" rot="0"/>
<obj type="nonInteractive10" x="10101" y="2607" rot="0"/>
<obj type="nonInteractive10" x="9918" y="2589" rot="0"/>
<obj type="nonInteractive10" x="10254" y="2614" rot="0"/>
<obj type="nonInteractive10" x="9546" y="2591" rot="0"/>
<obj type="nonInteractive10" x="11270" y="2505" rot="0"/>
<obj type="nonInteractive10" x="11309" y="2514" rot="0"/>
<obj type="nonInteractive03" x="11367" y="2507" rot="10"/>
<obj type="nonInteractive03" x="11214" y="2507" rot="0"/>
<obj type="nonInteractive08" x="12978" y="3572" rot="0"/>
<obj type="nonInteractive08" x="12843" y="3590" rot="0"/>
<obj type="nonInteractive08" x="12735" y="3576" rot="0"/>
<obj type="nonInteractive08" x="13114" y="3563" rot="0"/>
<obj type="nonInteractive08" x="14574" y="3926" rot="0"/>
<obj type="nonInteractive08" x="14435" y="3915" rot="0"/>
<obj type="nonInteractive09" x="15778" y="3974" rot="-20"/>
<obj type="nonInteractive09" x="16448" y="4026" rot="20"/>
<obj type="nonInteractive09" x="18344" y="4391" rot="0"/>
<obj type="nonInteractive15" x="4109" y="726" rot="0"/>
<obj type="nonInteractive15" x="4485" y="885" rot="0"/>
<obj type="nonInteractive15" x="4861" y="1167" rot="0"/>
<obj type="nonInteractive15" x="5104" y="816" rot="0"/>
<obj type="nonInteractive15" x="4558" y="512" rot="0"/>
<obj type="nonInteractive15" x="5348" y="703" rot="0"/>
<obj type="nonInteractive15" x="5245" y="1046" rot="0"/>
<obj type="nonInteractive15" x="7808" y="1887" rot="0"/>
<obj type="nonInteractive15" x="8109" y="1656" rot="0"/>
<obj type="nonInteractive15" x="8291" y="1892" rot="0"/>
<obj type="nonInteractive15" x="8494" y="1369" rot="0"/>
<obj type="nonInteractive15" x="8638" y="1634" rot="0"/>
<obj type="nonInteractive15" x="8885" y="1852" rot="0"/>
<obj type="nonInteractive15" x="9178" y="2000" rot="0"/>
<obj type="nonInteractive15" x="9631" y="1973" rot="0"/>
<obj type="nonInteractive15" x="12014" y="2442" rot="0"/>
<obj type="nonInteractive15" x="12207" y="2848" rot="0"/>
<obj type="nonInteractive15" x="13862" y="3124" rot="0"/>
<obj type="nonInteractive15" x="14092" y="3411" rot="0"/>
<obj type="nonInteractive15" x="14387" y="3102" rot="0"/>
<obj type="nonInteractive15" x="14530" y="3315" rot="0"/>
<obj type="nonInteractive15" x="14646" y="3544" rot="0"/>
<obj type="nonInteractive15" x="15087" y="3463" rot="0"/>
<obj type="nonInteractive15" x="15478" y="3786" rot="0"/>
<obj type="nonInteractive15" x="15568" y="3453" rot="0"/>
<obj type="Checkpoint" x="585" y="315" rot="0"/>
<line>
<points a="-800,-100, -520,-100, -500,316, -300,316, 51,316, 1155,317, 1246,295, 1344,241, 1401,184, 1526,100"/>
<points a="1609,75, 1769,110, 1873,228, 1992,355, 2120,464, 2349,658, 2647,902, 2972,1076, 3201,1210, 3324,1232"/>
<points a="3449,1213, 3572,1141, 3877,928, 4029,1354, 4102,1401, 4193,1438, 4275,1403, 4351,1465, 4442,1429, 4524,1483"/>
<points a="4610,1460, 4674,1412, 4762,1473, 4884,1417, 4949,1457, 5059,1410, 5171,1476, 5288,1433, 5402,1263, 5443,1177"/>
<points a="5487,1153, 5578,1208, 5660,1262, 5767,1314, 5911,1371, 6014,1476, 6079,1610, 6234,1773, 6451,1953, 6675,2085"/>
<points a="6816,2117, 7015,2160, 7228,2135, 7415,2046, 7559,1955, 7586,2145, 7659,2279, 7809,2346, 7912,2296, 7989,2370"/>
<points a="8139,2334, 8194,2386, 8313,2416, 8335,2381, 8378,2365, 8430,2325, 8551,2347, 8652,2412, 8750,2376, 8834,2315"/>
<points a="8902,2172, 8955,2155, 8990,2159, 9035,2231, 9231,2353, 9432,2543, 9597,2591, 9832,2566, 9985,2597, 10134,2585"/>
<points a="10268,2610, 10429,2566, 10535,2513, 10627,2497, 10692,2530, 10738,2573, 10852,2584, 10963,2599, 11046,2573, 11094,2529"/>
<points a="11178,2507, 11178,2507, 11385,2502, 11492,2532, 11570,2584, 11638,2687, 11774,2867, 11978,3127, 12202,3316, 12420,3442"/>
<points a="12651,3531, 12841,3555, 13054,3558, 13242,3526, 13548,3314, 13598,3513, 13712,3749, 13908,3859, 13966,3872, 14068,3806"/>
<points a="14223,3867, 14380,3839, 14433,3878, 14589,3925, 14666,3863, 14733,3828, 14787,3699, 14811,3655, 14854,3667, 14882,3706"/>
<points a="15052,3805, 15266,3918, 15506,3983, 15690,3997, 15781,3969, 15871,3939, 15907,4017, 16071,4076, 16151,4098, 16210,4064"/>
<points a="16239,3971, 16497,4038, 16758,4101, 16820,4112, 16917,4091, 16990,4057, 17027,4114, 17067,4265, 17087,4385, 17161,4438"/>
<points a="17255,4480, 17332,4483, 17400,4421, 17445,4331, 17504,4242, 17564,4173, 17617,4144, 17764,4247, 17913,4322, 18077,4363"/>
<points a="18259,4391, 20481,4389, 21180,4389, 21415,4389"/>
</line>
</level>
<level name="Outlands: Zigzag" category="0" fillframe="7" surfaceframe="8" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1">
<obj type="endrace" x="34328" y="1427" rot="0"/>
<obj type="Checkpoint" x="1650" y="1584" rot="0"/>
<obj type="Checkpoint" x="5124" y="1460" rot="0"/>
<obj type="Checkpoint" x="6963" y="1176" rot="0"/>
<obj type="Checkpoint" x="9706" y="1122" rot="0"/>
<obj type="Checkpoint" x="12425" y="837" rot="0"/>
<obj type="Checkpoint" x="14597" y="645" rot="0"/>
<obj type="Checkpoint" x="18009" y="987" rot="0"/>
<obj type="Checkpoint" x="20542" y="690" rot="0"/>
<obj type="Checkpoint" x="23855" y="591" rot="0"/>
<obj type="Checkpoint" x="25650" y="999" rot="0"/>
<obj type="Checkpoint" x="28322" y="1069" rot="0"/>
<line>
<points a="36,206, 886,206, 1035,1571, 1058,1586, 1817,1586, 3017,1586, 3087,1601, 3239,1643, 3542,1558, 3618,1589"/>
<points a="3785,1570, 3831,1597, 4213,1539, 4263,1558, 4613,1502, 4679,1520, 4734,1504, 4769,1511, 4990,1458, 5010,1470"/>
<points a="5245,1452, 5291,1475, 5483,1441, 5527,1450, 5646,1397, 5675,1412, 5828,1305, 5908,1317, 6030,1275, 6105,1290"/>
<points a="6363,1193, 6462,1207, 6679,1151, 6801,1185, 7116,1169, 7229,1198, 7499,1185, 7561,1193, 7715,1156, 7823,1175"/>
<points a="7965,1155, 8023,1184, 8322,1173, 8422,1227, 8647,1203, 8858,1242, 9109,1217, 9195,1230, 9495,1136, 9531,1157"/>
<points a="9833,1099, 9871,1118, 10045,1102, 10104,1124, 10237,1066, 10314,1078, 10425,1011, 10490,1029, 10673,971, 10723,991"/>
<points a="10991,961, 11032,972, 11143,912, 11236,928, 11374,884, 11415,903, 11470,875, 11660,920, 12040,649, 12211,780"/>
<points a="12373,845, 12603,823, 12645,856, 12930,826, 13391,729, 13804,429, 14069,650, 14318,600, 14456,668, 14710,632"/>
<points a="14996,850, 15167,837, 15446,1013, 15657,1062, 15834,998, 15996,1008, 16293,844, 16556,1018, 16886,847, 17252,1050"/>
<points a="17701,845, 18174,1063, 18576,855, 18849,987, 19276,667, 19416,784, 19670,674, 19834,770, 20299,668, 20810,716"/>
<points a="20902,684, 21105,723, 21342,617, 21397,656, 21636,599, 21682,608, 21721,587, 21919,691, 21989,682, 22018,712"/>
<points a="22285,681, 22336,711, 22422,687, 22465,698, 22821,613, 22872,644, 22942,616, 23158,664, 23264,641, 23320,670"/>
<points a="23616,543, 23833,594, 23934,588, 23984,611, 24218,545, 24394,593, 24491,574, 24660,627, 25004,842, 25269,983"/>
<points a="25452,979, 25482,998, 25710,1001, 25779,1035, 26033,1053, 26135,1077, 26465,1217, 26552,1212, 26841,1103, 27000,1155"/>
<points a="27364,1027, 27725,1131, 28074,1015, 28185,1083, 28542,1043, 28609,1093, 28766,1027, 28873,1111, 28934,1072, 29126,1157"/>
<points a="29750,1451, 29955,1508, 30242,1431, 30895,1427, 33195,1427, 35295,1427, 36228,1427, 37528,1427, 38778,1427"/>
</line>
</level>
<level name="Outlands: The Glacier" category="0" fillframe="11" surfaceframe="12" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1" exclusivechar="-1">
<obj type="Checkpoint" x="13412" y="1240" rot="0"/>
<obj type="Checkpoint" x="11441" y="947" rot="0"/>
<obj type="Checkpoint" x="9492" y="625" rot="0"/>
<obj type="Checkpoint" x="7711" y="517" rot="0"/>
<obj type="Checkpoint" x="6565" y="500" rot="0"/>
<obj type="Checkpoint" x="4938" y="436" rot="0"/>
<obj type="Checkpoint" x="2823" y="441" rot="0"/>
<obj type="Checkpoint" x="1281" y="430" rot="0"/>
<obj type="Checkpoint" x="-94" y="332" rot="0"/>
<obj type="Checkpoint" x="-968" y="251" rot="0"/>
<obj type="endrace" x="26010" y="2039" rot="0"/>
<obj type="Checkpoint" x="20481" y="1633" rot="0"/>
<obj type="Checkpoint" x="16767" y="1491" rot="0"/>
<obj type="Checkpoint" x="14900" y="1377" rot="0"/>
<obj type="Checkpoint" x="9807" y="743" rot="0"/>
<obj type="killerGlacier" x="843" y="568" rot="0"/>
<obj type="killerGlacier" x="3580" y="807" rot="0"/>
<obj type="killerGlacier" x="5681" y="735" rot="0"/>
<obj type="killerGlacier" x="7354" y="1088" rot="0"/>
<obj type="killerGlacier" x="10744" y="1095" rot="0"/>
<obj type="killerGlacier" x="13291" y="1785" rot="0"/>
<obj type="killerGlacier" x="13965" y="1608" rot="0"/>
<obj type="killerGlacier" x="14221" y="1608" rot="0"/>
<obj type="killerGlacier" x="18416" y="1601" rot="0"/>
<obj type="killerGlacier" x="18672" y="1601" rot="0"/>
<obj type="killerGlacier" x="21370" y="1652" rot="0"/>
<obj type="killerGlacier" x="22249" y="2572" rot="0"/>
<obj type="nonInteractive15" x="1249" y="141" rot="0"/>
<obj type="nonInteractive15" x="1640" y="-28" rot="0"/>
<obj type="nonInteractive15" x="1615" y="234" rot="0"/>
<obj type="nonInteractive15" x="2747" y="155" rot="0"/>
<obj type="nonInteractive15" x="3081" y="-71" rot="0"/>
<obj type="nonInteractive15" x="4290" y="77" rot="0"/>
<obj type="nonInteractive15" x="4552" y="306" rot="0"/>
<obj type="nonInteractive15" x="4868" y="143" rot="0"/>
<obj type="nonInteractive15" x="5857" y="-51" rot="0"/>
<obj type="nonInteractive15" x="5957" y="215" rot="0"/>
<obj type="nonInteractive15" x="6287" y="26" rot="0"/>
<obj type="nonInteractive15" x="6610" y="-63" rot="0"/>
<obj type="nonInteractive15" x="6620" y="257" rot="0"/>
<obj type="nonInteractive15" x="7341" y="215" rot="0"/>
<obj type="nonInteractive15" x="7648" y="311" rot="0"/>
<obj type="nonInteractive15" x="7816" y="110" rot="0"/>
<obj type="nonInteractive15" x="9099" y="245" rot="0"/>
<obj type="nonInteractive15" x="9416" y="411" rot="0"/>
<obj type="nonInteractive15" x="10345" y="440" rot="0"/>
<obj type="nonInteractive15" x="10764" y="482" rot="0"/>
<obj type="nonInteractive15" x="11046" y="592" rot="0"/>
<obj type="nonInteractive15" x="11231" y="369" rot="0"/>
<obj type="nonInteractive15" x="13297" y="843" rot="0"/>
<obj type="nonInteractive15" x="13357" y="1063" rot="0"/>
<obj type="nonInteractive15" x="13616" y="961" rot="0"/>
<obj type="nonInteractive15" x="14005" y="994" rot="0"/>
<obj type="nonInteractive15" x="14432" y="860" rot="0"/>
<obj type="nonInteractive15" x="14410" y="1139" rot="0"/>
<obj type="nonInteractive15" x="16061" y="963" rot="0"/>
<obj type="nonInteractive15" x="16164" y="1285" rot="0"/>
<obj type="nonInteractive15" x="18561" y="795" rot="0"/>
<obj type="nonInteractive15" x="18232" y="841" rot="0"/>
<obj type="nonInteractive15" x="18094" y="897" rot="0"/>
<obj type="nonInteractive15" x="18123" y="567" rot="0"/>
<obj type="nonInteractive15" x="18511" y="562" rot="0"/>
<obj type="nonInteractive15" x="18851" y="693" rot="0"/>
<obj type="nonInteractive15" x="18487" y="1082" rot="0"/>
<obj type="nonInteractive15" x="19039" y="1138" rot="0"/>
<obj type="nonInteractive15" x="19215" y="1314" rot="0"/>
<obj type="nonInteractive15" x="19292" y="931" rot="0"/>
<obj type="nonInteractive15" x="18856" y="959" rot="0"/>
<obj type="nonInteractive15" x="21066" y="1229" rot="0"/>
<obj type="nonInteractive15" x="21388" y="1255" rot="0"/>
<obj type="nonInteractive15" x="21712" y="1427" rot="0"/>
<obj type="nonInteractive15" x="21915" y="1614" rot="0"/>
<obj type="nonInteractive15" x="22277" y="1886" rot="0"/>
<obj type="nonInteractive15" x="22214" y="2101" rot="0"/>
<obj type="nonInteractive15" x="22547" y="2100" rot="0"/>
<obj type="nonInteractive15" x="22590" y="2260" rot="0"/>
<obj type="nonInteractive15" x="22937" y="2139" rot="0"/>
<obj type="nonInteractive15" x="22933" y="2377" rot="0"/>
<obj type="nonInteractive15" x="24026" y="1972" rot="0"/>
<obj type="nonInteractive15" x="24244" y="1780" rot="0"/>
<obj type="nonInteractive15" x="24489" y="2009" rot="0"/>
<obj type="nonInteractive15" x="24869" y="2028" rot="0"/>
<obj type="nonInteractive15" x="25245" y="1748" rot="0"/>
<obj type="nonInteractive15" x="25707" y="1792" rot="0"/>
<obj type="killerGlacier" x="1909" y="711" rot="0"/>
<obj type="killer03" x="942" y="780" rot="0"/>
<obj type="killer03" x="2005" y="714" rot="0"/>
<obj type="killer03" x="3684" y="809" rot="0"/>
<obj type="killer03" x="5782" y="736" rot="0"/>
<obj type="killer03" x="7454" y="1089" rot="0"/>
<obj type="killer03" x="10843" y="1095" rot="0"/>
<obj type="killer03" x="13392" y="1786" rot="0"/>
<obj type="killer03" x="18507" y="1607" rot="0"/>
<obj type="killer03" x="22347" y="2574" rot="0"/>
<line>
<points a="-2466,-1031, -1656.375,-1026.875, -1504.75,253.25, -308.5,253.5, -226,254, -112,328, 131,349, 266,280, 454,357, 746,332"/>
<points a="772,756, 897,768, 940,414, 1201,389, 1393,478, 1574,441, 1757,409, 1822,456, 1848,542, 1844,885"/>
<points a="1955,911, 2019,459, 2077,411, 2271,397, 2466,342, 2568,393, 2684,471, 2849,430, 3114,451, 3431,378"/>
<points a="3480,421, 3535,992, 3621,1008, 3692,432, 3724,398, 3992,355, 4085,392, 4235,468, 4519,491, 4727,428"/>
<points a="4790,459, 4845,415, 5106,461, 5194,405, 5356,321, 5473,299, 5566,271, 5601,922, 5726,939, 5752,706"/>
<points a="5784,510, 5817,446, 6077,507, 6292,463, 6517,507, 6690,481, 6794,503, 7094,440, 7119,694, 7246,750"/>
<points a="7265,842, 7317,1291, 7350,1290, 7457,512, 7523,495, 8015,558, 8188,537, 8531,600, 8618,569, 8699,599"/>
<points a="8815,600, 8851,554, 8916,536, 8989,576, 9009,611, 9125,631, 9275,631, 9284,607, 9314,590, 9390,583"/>
<points a="9419,619, 9421,619, 9640,651, 9777,736, 10019,791, 10208,698, 10474,664, 10647,703, 10677,1274, 10748,1286"/>
<points a="10842,806, 11002,796, 11117,871, 11304,894, 11429,943, 11789,1019, 12045,1006, 12229,1099, 12431,1036, 12491,989"/>
<points a="12755,957, 12963,1007, 13141,1052, 13217,1964, 13264,1978, 13369,1230, 13698,1302, 13849,1275, 13892,1765, 14108,1765"/>
<points a="14182,1328, 14300,1302, 14640,1366, 15150,1387, 15483.375,1387, 15822.75,1318, 16483.5,1522, 17790,1362, 17935,1292, 18055,1215"/>
<points a="18196,1098, 18234,1184, 18286,1311, 18315,1449, 18347,1787, 18510,1793, 18613,1449, 18641,1377, 18830,1439, 19050,1513"/>
<points a="19101,1477, 19194,1456, 19241,1522, 19480,1482, 19525,1408, 19671,1355, 19833,1407, 19995,1502, 20283,1508, 20433,1624"/>
<points a="20733,1683, 21056,1608, 21165,1550, 21277,1462, 21338,1781, 21393,1795, 21475,1503, 21613,1637, 21647,1712, 21779,1712"/>
<points a="21895,2048, 21965,2202, 22057,2301, 22123,2303, 22158,2773, 22279,2773, 22346,2387, 22435,2372, 22630,2459, 23352,2488"/>
<points a="23649,2407, 23985,2282, 24075,2318, 24180,2259, 24346,2222, 24484,2289, 24841,2285, 25165,2193, 25621,2040, 26372,2038"/>
<points a="27002,2030, 27489,2006, 28215,1975, 28982,1962, 29426,1910"/>
</line>
</level>
<level name="Outlands: Walrus Chase Special" category="0" fillframe="11" surfaceframe="12" surfacethickness="10" type="chase" opponents="23" win="1" exclusivechar="17">
<obj type="endrace" x="40575" y="2176" rot="0"/>
<obj type="Checkpoint" x="2060" y="1781" rot="0"/>
<obj type="Checkpoint" x="5652" y="1846" rot="0"/>
<obj type="Checkpoint" x="10280" y="2077" rot="0"/>
<obj type="Checkpoint" x="14380" y="2159" rot="0"/>
<obj type="Checkpoint" x="19933" y="1853" rot="0"/>
<obj type="Checkpoint" x="23595" y="2092" rot="0"/>
<obj type="Checkpoint" x="26836" y="2068" rot="0"/>
<obj type="Checkpoint" x="31213" y="2210" rot="0"/>
<obj type="Checkpoint" x="35390" y="2142" rot="0"/>
<obj type="furniture04" x="5836" y="1875" rot="0"/>
<obj type="furniture04" x="7543" y="1934" rot="0"/>
<obj type="furniture04" x="11107" y="2034" rot="0"/>
<obj type="furniture04" x="11153" y="2039" rot="0"/>
<obj type="furniture04" x="14711" y="2171" rot="0"/>
<obj type="furniture04" x="22324" y="2070" rot="0"/>
<obj type="furniture04" x="25826" y="2100" rot="0"/>
<obj type="furniture04" x="30218" y="2066" rot="0"/>
<obj type="furniture04" x="35205" y="2137" rot="0"/>
<obj type="furniture04" x="35281" y="2143" rot="0"/>
<line>
<points a="24,242, 1624,242, 1701,1752, 1719,1769, 1763,1781, 2813,1781, 3963,1781, 5131,1794, 6022,1888, 7494,1926"/>
<points a="8619,2025, 9909,2113, 10654,2044, 11428,2022, 12502,2035, 13453,2084, 13917,2145, 14608,2169, 15358,2169, 16551,2146"/>
<points a="18070,2079, 18942,2004, 19611,1912, 19718,1900, 19761,1891, 19787,1881, 19816,1869, 19857,1857, 19908,1854, 19944,1855"/>
<points a="20021,1858, 20113,1871, 20523,1917, 21862,2050, 23150,2093, 24259,2093, 24541,2079, 24684,2076, 24734,2079, 25177,2098"/>
<points a="25691,2098, 26299,2091, 26366,2089, 26429,2081, 26541,2069, 26613,2069, 26772,2069, 26850,2069, 26955,2067, 27037,2065"/>
<points a="27144,2057, 27184,2046, 27225,2015, 27248,1993, 27296,1960, 27339,1936, 27395,1911, 27465,1897, 27506,1893, 27589,1902"/>
<points a="27666,1907, 27739,1907, 27781,1905, 27839,1900, 28117,1902, 28428,1913, 28880,1947, 29598,2000, 30309,2071, 30923,2195"/>
<points a="31594,2234, 32394,2234, 32979,2210, 33722,2161, 34187,2152, 34301,2156, 34560,2183, 34657,2192, 34727,2193, 34779,2190"/>
<points a="34805,2184, 34876,2166, 34955,2144, 35021,2136, 35087,2134, 35213,2135, 35686,2155, 36104,2217, 36284,2261, 36370,2291"/>
<points a="36438,2317, 36496,2323, 36560,2326, 36807,2326, 37407,2326, 37958,2321, 38099,2308, 38175,2278, 38243,2241, 38307,2212"/>
<points a="38373,2189, 38421,2178, 38472,2176, 38531,2175, 39074,2174, 39824,2174, 40874,2174, 41924,2174, 42874,2174"/>
</line>
</level>
<!-- World 4 Lunar-->
<level name="Planetoid: Craters" category="0" fillframe="9" surfaceframe="10" surfacethickness="10" type="race" opponents="3,5,7,9" win="1" exclusivechar="-1">
<obj type="endrace" x="31820" y="2234" rot="0"/>
<obj type="Checkpoint" x="1371" y="1128" rot="0"/>
<obj type="Checkpoint" x="5065" y="1351" rot="0"/>
<obj type="Checkpoint" x="8720" y="1293" rot="0"/>
<obj type="Checkpoint" x="11049" y="1592" rot="0"/>
<obj type="Checkpoint" x="15284" y="1245" rot="0"/>
<obj type="Checkpoint" x="17608" y="1450" rot="0"/>
<obj type="Checkpoint" x="21445" y="1746" rot="0"/>
<obj type="Checkpoint" x="23462" y="1837" rot="0"/>
<obj type="Checkpoint" x="26491" y="1819" rot="0"/>
<obj type="Checkpoint" x="29266" y="1871" rot="0"/>
<obj type="nonInteractive15" x="2884" y="1109" rot="0"/>
<obj type="nonInteractive15" x="4181" y="1042" rot="0"/>
<obj type="nonInteractive15" x="4470" y="759" rot="0"/>
<obj type="nonInteractive15" x="4889" y="841" rot="0"/>
<obj type="nonInteractive15" x="5417" y="862" rot="0"/>
<obj type="nonInteractive15" x="5988" y="757" rot="0"/>
<obj type="nonInteractive15" x="7487" y="626" rot="0"/>
<obj type="nonInteractive15" x="8208" y="876" rot="0"/>
<obj type="nonInteractive15" x="7817" y="995" rot="0"/>
<obj type="nonInteractive15" x="8582" y="742" rot="0"/>
<obj type="nonInteractive15" x="8778" y="1087" rot="0"/>
<obj type="nonInteractive15" x="10310" y="1194" rot="0"/>
<obj type="nonInteractive15" x="11406" y="1230" rot="0"/>
<obj type="nonInteractive15" x="11656" y="1335" rot="0"/>
<obj type="nonInteractive15" x="11983" y="1205" rot="0"/>
<obj type="nonInteractive15" x="12432" y="1296" rot="0"/>
<obj type="nonInteractive15" x="12761" y="1053" rot="0"/>
<obj type="nonInteractive15" x="12975" y="1322" rot="0"/>
<obj type="nonInteractive15" x="13254" y="1483" rot="0"/>
<obj type="nonInteractive15" x="14254" y="1220" rot="0"/>
<obj type="nonInteractive15" x="14869" y="961" rot="0"/>
<obj type="nonInteractive15" x="16697" y="1055" rot="0"/>
<obj type="nonInteractive15" x="17402" y="1008" rot="0"/>
<obj type="nonInteractive15" x="17409" y="763" rot="0"/>
<obj type="nonInteractive15" x="17020" y="809" rot="0"/>
<obj type="nonInteractive15" x="17981" y="808" rot="0"/>
<obj type="nonInteractive15" x="17654" y="1287" rot="0"/>
<obj type="nonInteractive15" x="18521" y="1256" rot="0"/>
<obj type="nonInteractive15" x="19784" y="1159" rot="0"/>
<obj type="nonInteractive15" x="19422" y="1289" rot="0"/>
<obj type="nonInteractive15" x="20252" y="1256" rot="0"/>
<obj type="nonInteractive15" x="21193" y="1296" rot="0"/>
<obj type="nonInteractive15" x="21892" y="1157" rot="0"/>
<obj type="nonInteractive15" x="22175" y="1411" rot="0"/>
<obj type="nonInteractive15" x="22726" y="1567" rot="0"/>
<obj type="nonInteractive15" x="23037" y="1286" rot="0"/>
<obj type="nonInteractive15" x="23701" y="1528" rot="0"/>
<obj type="nonInteractive15" x="24898" y="1433" rot="0"/>
<obj type="nonInteractive15" x="25033" y="945" rot="0"/>
<obj type="nonInteractive15" x="24531" y="1140" rot="0"/>
<obj type="nonInteractive15" x="25375" y="1133" rot="0"/>
<obj type="nonInteractive15" x="26151" y="1367" rot="0"/>
<obj type="nonInteractive15" x="26931" y="1384" rot="0"/>
<obj type="nonInteractive15" x="27278" y="1445" rot="0"/>
<obj type="nonInteractive15" x="28704" y="1686" rot="0"/>
<obj type="nonInteractive15" x="29634" y="1578" rot="0"/>
<obj type="nonInteractive15" x="31029" y="1971" rot="0"/>
<line>
<points a="38,235, 205,234, 443,233, 580,1106, 599,1127, 1314,1128, 2064,1128, 2214,1140, 2366,1173, 2480,1205"/>
<points a="2594,1238, 2746,1273, 2945,1312, 3054,1327, 3319,1338, 3690,1338, 3867,1339, 3969,1336, 4024,1327, 4076,1308"/>
<points a="4098,1288, 4143,1315, 4201,1333, 4271,1336, 4327,1337, 4370,1328, 4400,1314, 4422,1288, 4460,1309, 4500,1325"/>
<points a="4581,1344, 4636,1348, 4808,1353, 4973,1354, 5261,1354, 5314,1348, 5517,1316, 5672,1271, 5726,1232, 5762,1204"/>
<points a="5834,1167, 5907,1154, 5978,1152, 6223,1160, 6308,1165, 6562,1178, 6871,1212, 7286,1269, 7356,1271, 7733,1271"/>
<points a="7818,1265, 7853,1252, 7884,1235, 7904,1213, 7932,1227, 7982,1238, 8015,1238, 8066,1238, 8101,1229, 8128,1222"/>
<points a="8151,1204, 8173,1227, 8202,1253, 8247,1275, 8287,1283, 8379,1292, 8664,1296, 8950,1288, 9033,1271, 9213,1244"/>
<points a="9296,1242, 9359,1257, 9689,1303, 9966,1352, 10104,1409, 10238,1491, 10317,1517, 10483,1555, 10592,1571, 10679,1582"/>
<points a="10882,1593, 11287,1593, 11350,1592, 11379,1587, 11399,1573, 11412,1583, 11435,1590, 11464,1593, 11518,1593, 11530,1592"/>
<points a="11557,1584, 11568,1578, 11577,1585, 11599,1596, 11625,1604, 11660,1613, 11685,1617, 11887,1623, 11999,1632, 12040,1628"/>
<points a="12065,1620, 12094,1604, 12104,1619, 12121,1634, 12170,1675, 12252,1721, 12324,1730, 12384,1733, 12499,1732, 12558,1716"/>
<points a="12620,1676, 12673,1636, 12688,1618, 12703,1594, 12718,1595, 12729,1613, 12757,1640, 12796,1660, 12864,1675, 13032,1695"/>
<points a="13281,1727, 13577,1740, 13789,1714, 13966,1670, 14119,1613, 14347,1483, 14477,1393, 14611,1314, 14752,1269, 14868,1258"/>
<points a="15058,1251, 15343,1247, 15587,1248, 15920,1259, 16399,1284, 16472,1290, 16520,1314, 16582,1358, 16654,1384, 16706,1390"/>
<points a="16966,1392, 17069,1390, 17115,1380, 17149,1364, 17188,1337, 17210,1309, 17221,1308, 17267,1367, 17330,1411, 17396,1436"/>
<points a="17499,1449, 17653,1454, 17759,1449, 17883,1414, 17951,1379, 17997,1341, 18017,1309, 18022,1294, 18037,1294, 18069,1334"/>
<points a="18125,1383, 18186,1425, 18266,1481, 18350,1507, 18433,1533, 18576,1557, 18667,1569, 18915,1581, 19114,1587, 19419,1584"/>
<points a="19510,1572, 19614,1547, 19666,1524, 19700,1503, 19717,1504, 19735,1528, 19774,1550, 19858,1555, 19918,1552, 19953,1534"/>
<points a="19972,1519, 19987,1505, 20005,1504, 20014,1523, 20031,1540, 20064,1560, 20072,1563, 20135,1591, 20202,1614, 20251,1621"/>
<points a="20317,1627, 20347,1625, 20375,1616, 20389,1604, 20400,1603, 20425,1639, 20460,1672, 20526,1715, 20566,1726, 20624,1731"/>
<points a="20680,1732, 20725,1729, 20760,1720, 20806,1703, 20843,1674, 20868,1644, 20877,1616, 20894,1616, 20904,1635, 20927,1660"/>
<points a="21024,1707, 21131,1733, 21215,1738, 21384,1748, 21596,1745, 21642,1742, 21875,1717, 21911,1707, 21937,1692, 21952,1678"/>
<points a="21969,1677, 21980,1691, 21996,1702, 22011,1705, 22035,1706, 22062,1706, 22088,1702, 22107,1692, 22123,1677, 22126,1669"/>
<points a="22145,1667, 22176,1682, 22206,1709, 22242,1733, 22279,1750, 22295,1750, 22366,1754, 22405,1767, 22424,1781, 22466,1801"/>
<points a="22502,1807, 22549,1809, 22692,1803, 22772,1790, 22818,1778, 22877,1773, 22927,1776, 22976,1791, 23089,1809, 23209,1835"/>
<points a="23255,1835, 23413,1838, 23581,1835, 23688,1828, 23774,1807, 23949,1777, 24039,1771, 24280,1771, 24400,1769, 24455,1768"/>
<points a="24521,1766, 24562,1758, 24667,1735, 24762,1712, 24813,1687, 24852,1660, 24871,1640, 24883,1641, 24925,1718, 24973,1776"/>
<points a="25017,1804, 25080,1823, 25142,1832, 25196,1836, 25246,1835, 25324,1830, 25366,1810, 25418,1777, 25443,1756, 25472,1719"/>
<points a="25487,1679, 25507,1680, 25522,1702, 25542,1722, 25569,1738, 25650,1776, 25739,1797, 25821,1801, 26105,1817, 26277,1821"/>
<points a="26668,1821, 26818,1814, 26858,1808, 26878,1795, 26888,1782, 26900,1783, 26913,1798, 26938,1809, 26949,1809, 26975,1808"/>
<points a="26994,1799, 27004,1787, 27011,1787, 27021,1798, 27034,1808, 27043,1813, 27081,1825, 27150,1845, 27175,1845, 27206,1846"/>
<points a="27232,1840, 27260,1835, 27276,1825, 27292,1813, 27301,1813, 27306,1822, 27319,1833, 27337,1841, 27364,1844, 27385,1842"/>
<points a="27408,1835, 27429,1819, 27441,1819, 27454,1825, 27494,1843, 27537,1872, 27656,1920, 27742,1953, 27842,1995, 27911,2020"/>
<points a="27977,2034, 28095,2040, 28321,2026, 28593,1985, 28662,1962, 28735,1918, 28802,1890, 28907,1874, 28990,1865, 29070,1866"/>
<points a="29283,1871, 29512,1867, 29540,1862, 29580,1850, 29594,1834, 29605,1833, 29647,1868, 29715,1933, 29821,2000, 29965,2055"/>
<points a="30124,2109, 30312,2160, 30547,2208, 30741,2230, 31017,2235, 31367,2235, 31767,2235, 32267,2235, 32967,2235, 33667,2235"/>
<points a="34017,2235"/>
</line>
</level>
<level name="Planetoid: Jaggies" category="0" fillframe="9" surfaceframe="10" surfacethickness="10" type="race" opponents="2,3,4,5,6" win="1">
<obj type="endrace" x="36883" y="2416" rot="0"/>
<obj type="Checkpoint" x="1749" y="1740" rot="0"/>
<obj type="Checkpoint" x="5461" y="1829" rot="0"/>
<obj type="Checkpoint" x="7918" y="1779" rot="0"/>
<obj type="Checkpoint" x="10226" y="1443" rot="0"/>
<obj type="Checkpoint" x="11877" y="1566" rot="0"/>
<obj type="Checkpoint" x="14198" y="1803" rot="0"/>
<obj type="Checkpoint" x="16557" y="2050" rot="0"/>
<obj type="Checkpoint" x="18743" y="1909" rot="0"/>
<obj type="Checkpoint" x="21331" y="1831" rot="0"/>
<obj type="Checkpoint" x="23442" y="2006" rot="0"/>
<obj type="Checkpoint" x="25524" y="2276" rot="0"/>
<obj type="Checkpoint" x="27597" y="2362" rot="0"/>
<obj type="Checkpoint" x="30218" y="2425" rot="0"/>
<line>
<points a="36,234, 486,234, 986,234, 1144,1422, 1203,1705, 1242,1741, 1313,1740, 2213,1740, 3413,1740, 4163,1740"/>
<points a="4309,1765, 4422,1788, 4502,1788, 4558,1775, 4640,1796, 4712,1792, 4751,1806, 4808,1808, 4871,1775, 4888,1785"/>
<points a="5033,1792, 5091,1821, 5151,1815, 5214,1816, 5240,1823, 5459,1833, 5571,1826, 5665,1784, 5689,1792, 5776,1774"/>
<points a="5831,1785, 5938,1748, 5966,1759, 6005,1739, 6175,1756, 6234,1747, 6274,1754, 6311,1748, 6433,1791, 6530,1797"/>
<points a="6625,1801, 6713,1799, 6907,1782, 6944,1786, 6986,1787, 7231,1769, 7461,1722, 7497,1735, 7571,1726, 7802,1781"/>
<points a="7946,1778, 8219,1747, 8350,1676, 8545,1560, 8597,1567, 8651,1552, 8675,1565, 8922,1522, 8940,1559, 9040,1564"/>
<points a="9069,1539, 9197,1555, 9272,1527, 9477,1538, 9488,1570, 9551,1574, 9705,1507, 9758,1531, 9896,1466, 9936,1477"/>
<points a="10051,1474, 10137,1440, 10322,1449, 10383,1478, 10575,1539, 10842,1556, 10931,1550, 10953,1561, 11037,1533, 11045,1544"/>
<points a="11108,1566, 11190,1571, 11314,1503, 11339,1531, 11635,1501, 11709,1572, 12036,1566, 12274,1807, 12387,1837, 12506,1805"/>
<points a="12540,1826, 12737,1831, 12855,1799, 13080,1816, 13440,1900, 13542,1851, 13774,1796, 13860,1813, 13916,1790, 14426,1819"/>
<points a="14700,1882, 14911,1953, 15248,2054, 15388,2042, 15464,2049, 15582,1991, 15620,2011, 15898,1986, 15942,2011, 16005,2040"/>
<points a="16075,2023, 16105,2050, 16209,2042, 16256,2048, 16314,2054, 16358,2042, 16394,2055, 16444,2039, 16673,2068, 16801,2036"/>
<points a="16842,2058, 16867,2047, 17190,2028, 17251,1960, 17359,1973, 17425,1942, 17477,1949, 17563,1881, 17589,1906, 17676,1931"/>
<points a="17793,1914, 17884,1915, 18041,1984, 18159,1990, 18222,1961, 18270,1990, 18592,1887, 18630,1918, 18671,1904, 18835,1922"/>
<points a="18950,1849, 19007,1890, 19095,1857, 19316,1922, 19426,1938, 19483,1934, 19536,1908, 19556,1932, 19734,1958, 19864,1944"/>
<points a="19894,1905, 19967,1906, 20103,1885, 20224,1941, 20283,1927, 20477,1955, 20639,1965, 20742,1917, 20996,1911, 21136,1873"/>
<points a="21633,1776, 21808,1817, 22030,1874, 22158,1841, 22265,1836, 22547,1857, 22624,1921, 22823,2025, 22896,2031, 23111,1953"/>
<points a="23202,2005, 23609,2005, 23746,1967, 23782,2020, 24052,2156, 24408,2282, 24687,2279, 24754,2227, 24793,2256, 24856,2238"/>
<points a="25172,2262, 25229,2275, 25288,2261, 25315,2273, 25335,2275, 25638,2281, 25708,2244, 25756,2201, 25778,2223, 25947,2213"/>
<points a="25979,2246, 26228,2192, 26434,2232, 26506,2221, 26562,2209, 26575,2204, 26599,2220, 26716,2212, 26750,2238, 26851,2306"/>
<points a="26916,2302, 26982,2267, 27018,2305, 27183,2360, 27277,2342, 27311,2370, 27414,2343, 27451,2365, 27477,2364, 27815,2364"/>
<points a="27909,2278, 27986,2323, 28270,2287, 28323,2335, 28612,2347, 28710,2322, 29036,2365, 29229,2459, 29334,2517, 29404,2492"/>
<points a="29461,2504, 29545,2499, 29618,2451, 29904,2382, 29975,2420, 30046,2405, 30072,2419, 30426,2433, 30637,2510, 30706,2512"/>
<points a="30736,2481, 30771,2502, 31020,2450, 31105,2507, 31303,2502, 31718,2431, 31756,2476, 31921,2494, 32083,2512, 32146,2458"/>
<points a="32426,2502, 32509,2453, 32580,2469, 33002,2474, 33039,2413, 33256,2415, 34106,2415, 35006,2415, 36906,2415, 38806,2415"/>
<points a="40506,2415"/>
</line>
</level>
<level name="Planetoid: Biscuit Hills" category="0" fillframe="9" surfaceframe="10" surfacethickness="10" type="race" opponents="4,5,6,7,8,9" win="1" exclusivechar="-1">
<obj type="endrace" x="32137" y="1358" rot="0"/>
<obj type="Checkpoint" x="2307" y="1610" rot="0"/>
<obj type="Checkpoint" x="5313" y="1537" rot="0"/>
<obj type="Checkpoint" x="7480" y="1638" rot="0"/>
<obj type="Checkpoint" x="9335" y="1740" rot="0"/>
<obj type="Checkpoint" x="12141" y="1896" rot="0"/>
<obj type="Checkpoint" x="14504" y="2242" rot="0"/>
<obj type="Checkpoint" x="16937" y="2178" rot="0"/>
<obj type="Checkpoint" x="19359" y="2147" rot="0"/>
<obj type="Checkpoint" x="21664" y="1995" rot="0"/>
<obj type="Checkpoint" x="24519" y="1272" rot="0"/>
<obj type="Checkpoint" x="26590" y="1427" rot="0"/>
<obj type="Checkpoint" x="29777" y="1421" rot="0"/>
<obj type="nonInteractive15" x="2942" y="1392" rot="0"/>
<obj type="nonInteractive15" x="4120" y="1140" rot="0"/>
<obj type="nonInteractive15" x="4477" y="662" rot="0"/>
<obj type="nonInteractive15" x="4909" y="679" rot="0"/>
<obj type="nonInteractive15" x="4561" y="1099" rot="0"/>
<obj type="nonInteractive15" x="5243" y="1287" rot="0"/>
<obj type="nonInteractive15" x="6011" y="1072" rot="0"/>
<obj type="nonInteractive15" x="6028" y="630" rot="0"/>
<obj type="nonInteractive15" x="6471" y="874" rot="0"/>
<obj type="nonInteractive15" x="6537" y="1334" rot="0"/>
<obj type="nonInteractive15" x="7117" y="1182" rot="0"/>
<obj type="nonInteractive15" x="7790" y="1254" rot="0"/>
<obj type="nonInteractive15" x="8101" y="955" rot="0"/>
<obj type="nonInteractive15" x="8378" y="1379" rot="0"/>
<obj type="nonInteractive15" x="8912" y="1202" rot="0"/>
<obj type="nonInteractive15" x="9259" y="1498" rot="0"/>
<obj type="nonInteractive15" x="9534" y="1394" rot="0"/>
<obj type="nonInteractive15" x="9766" y="1200" rot="0"/>
<obj type="nonInteractive15" x="10058" y="1485" rot="0"/>
<obj type="nonInteractive15" x="10758" y="1553" rot="0"/>
<obj type="nonInteractive15" x="11330" y="1282" rot="0"/>
<obj type="nonInteractive15" x="11553" y="1579" rot="0"/>
<obj type="nonInteractive15" x="12107" y="1346" rot="0"/>
<obj type="nonInteractive15" x="12542" y="1675" rot="0"/>
<obj type="nonInteractive15" x="13028" y="1484" rot="0"/>
<obj type="nonInteractive15" x="13447" y="1665" rot="0"/>
<obj type="nonInteractive15" x="13865" y="1798" rot="0"/>
<obj type="nonInteractive15" x="14588" y="1792" rot="0"/>
<obj type="nonInteractive15" x="15488" y="2046" rot="0"/>
<obj type="nonInteractive15" x="16125" y="1490" rot="0"/>
<obj type="nonInteractive15" x="15780" y="1622" rot="0"/>
<obj type="nonInteractive15" x="16319" y="1232" rot="0"/>
<obj type="nonInteractive15" x="16525" y="1762" rot="0"/>
<obj type="nonInteractive15" x="16861" y="1889" rot="0"/>
<obj type="nonInteractive15" x="17462" y="1671" rot="0"/>
<obj type="nonInteractive15" x="18183" y="1535" rot="0"/>
<obj type="nonInteractive15" x="18991" y="1825" rot="0"/>
<obj type="nonInteractive15" x="19383" y="1611" rot="0"/>
<obj type="nonInteractive15" x="19710" y="1909" rot="0"/>
<obj type="nonInteractive15" x="20424" y="1998" rot="0"/>
<obj type="nonInteractive15" x="20936" y="1446" rot="0"/>
<obj type="nonInteractive15" x="21261" y="1270" rot="0"/>
<obj type="nonInteractive15" x="21675" y="1439" rot="0"/>
<obj type="nonInteractive15" x="21598" y="1693" rot="0"/>
<obj type="nonInteractive15" x="22467" y="1476" rot="0"/>
<obj type="nonInteractive15" x="22729" y="1511" rot="0"/>
<obj type="nonInteractive15" x="23105" y="1573" rot="0"/>
<obj type="nonInteractive15" x="23378" y="1614" rot="0"/>
<obj type="nonInteractive15" x="23655" y="1117" rot="0"/>
<obj type="nonInteractive15" x="23435" y="1261" rot="0"/>
<obj type="nonInteractive15" x="23927" y="1281" rot="0"/>
<obj type="nonInteractive15" x="24210" y="960" rot="0"/>
<obj type="nonInteractive15" x="24019" y="791" rot="0"/>
<obj type="nonInteractive15" x="24583" y="790" rot="0"/>
<obj type="nonInteractive15" x="24879" y="1139" rot="0"/>
<obj type="nonInteractive15" x="25199" y="746" rot="0"/>
<obj type="nonInteractive15" x="25658" y="341" rot="0"/>
<obj type="nonInteractive15" x="25971" y="-19" rot="0"/>
<obj type="nonInteractive15" x="25753" y="546" rot="0"/>
<obj type="nonInteractive15" x="26220" y="604" rot="0"/>
<obj type="nonInteractive15" x="26556" y="1009" rot="0"/>
<obj type="nonInteractive15" x="27036" y="794" rot="0"/>
<obj type="nonInteractive15" x="27405" y="973" rot="0"/>
<obj type="nonInteractive15" x="27940" y="949" rot="0"/>
<obj type="nonInteractive15" x="28759" y="741" rot="0"/>
<obj type="nonInteractive15" x="29005" y="461" rot="0"/>
<obj type="nonInteractive15" x="29395" y="1005" rot="0"/>
<obj type="nonInteractive15" x="29809" y="1208" rot="0"/>
<obj type="nonInteractive15" x="30447" y="992" rot="0"/>
<obj type="nonInteractive15" x="31112" y="990" rot="0"/>
<line>
<points a="25,238, 1375,238, 1557,1586, 1608,1612, 2748,1611, 3598,1611, 3925,1612, 4030,1609, 4111,1601, 4187,1574"/>
<points a="4233,1539, 4296,1457, 4326,1424, 4361,1412, 4435,1410, 4635,1410, 4661,1414, 4690,1431, 4716,1472, 4739,1510"/>
<points a="4770,1527, 4826,1538, 4858,1538, 5208,1538, 5608,1538, 5808,1538, 5833,1536, 5873,1527, 5900,1513, 5985,1454"/>
<points a="6036,1409, 6062,1378, 6081,1360, 6116,1352, 6151,1350, 6204,1352, 6232,1366, 6251,1384, 6270,1443, 6284,1559"/>
<points a="6293,1595, 6306,1611, 6334,1632, 6363,1640, 6396,1641, 6696,1641, 7198,1640, 7598,1640, 7766,1634, 7845,1620"/>
<points a="7888,1606, 7914,1590, 7930,1567, 7939,1558, 7959,1552, 7985,1552, 8023,1553, 8047,1554, 8062,1566, 8070,1581"/>
<points a="8075,1619, 8081,1644, 8101,1667, 8134,1681, 8166,1685, 8202,1685, 8552,1685, 8811,1676, 8869,1658, 8895,1643"/>
<points a="8913,1629, 8936,1625, 8958,1626, 9019,1630, 9034,1644, 9044,1668, 9069,1705, 9108,1721, 9156,1738, 9223,1741"/>
<points a="9474,1740, 9534,1737, 9558,1727, 9586,1717, 9623,1716, 9647,1717, 9670,1720, 9681,1731, 9709,1768, 9720,1780"/>
<points a="9752,1788, 9789,1791, 9939,1791, 10339,1791, 10739,1791, 10940,1791, 11050,1788, 11112,1782, 11163,1783, 11302,1786"/>
<points a="11615,1787, 11639,1787, 11655,1793, 11673,1804, 11682,1819, 11688,1841, 11690,1862, 11699,1881, 11714,1891, 11736,1896"/>
<points a="11763,1897, 12363,1897, 12663,1897, 12695,1898, 12719,1905, 12738,1916, 12749,1932, 12754,1952, 12763,1973, 12777,1987"/>
<points a="12796,1997, 12824,2006, 12850,2006, 13100,2006, 13498,2006, 13898,2005, 13924,2009, 13944,2020, 13961,2036, 13971,2052"/>
<points a="13980,2073, 13989,2124, 14014,2198, 14032,2219, 14052,2233, 14075,2240, 14100,2242, 14269,2242, 14720,2242, 15470,2242"/>
<points a="15970,2242, 15990,2241, 16004,2237, 16025,2225, 16045,2207, 16064,2180, 16092,2136, 16116,2115, 16135,2103, 16156,2099"/>
<points a="16185,2097, 16351,2097, 16701,2097, 16713,2102, 16732,2111, 16748,2127, 16762,2149, 16781,2164, 16811,2177, 16833,2179"/>
<points a="17083,2179, 17136,2173, 17167,2169, 17191,2156, 17204,2142, 17214,2130, 17227,2121, 17247,2117, 17273,2116, 17473,2116"/>
<points a="17723,2116, 17923,2116, 17946,2112, 17960,2106, 17975,2095, 17986,2081, 18000,2073, 18018,2070, 18039,2070, 18051,2075"/>
<points a="18058,2084, 18069,2110, 18089,2171, 18100,2189, 18114,2198, 18138,2206, 18156,2209, 18176,2210, 18476,2210, 19076,2210"/>
<points a="19098,2212, 19136,2205, 19163,2191, 19197,2165, 19215,2152, 19242,2148, 19270,2148, 19468,2148, 19483,2153, 19500,2162"/>
<points a="19514,2180, 19529,2206, 19549,2251, 19582,2283, 19608,2291, 19700,2294, 20100,2294, 20550,2294, 20585,2294, 20653,2286"/>
<points a="20683,2270, 20791,2183, 20862,2116, 20913,2049, 20955,1970, 20969,1945, 20983,1930, 21003,1923, 21028,1921, 21276,1921"/>
<points a="21290,1927, 21302,1939, 21309,1953, 21312,1969, 21330,1987, 21343,1994, 21370,1998, 21770,1998, 21920,1998, 21939,1996"/>
<points a="21954,1993, 21975,1985, 21991,1969, 22015,1959, 22041,1955, 22060,1956, 22210,1956, 22223,1958, 22234,1965, 22247,1982"/>
<points a="22262,2006, 22286,2027, 22306,2032, 22331,2034, 22528,2034, 22783,2033, 22799,2031, 22835,2015, 22850,2001, 22866,1981"/>
<points a="22880,1975, 22903,1973, 22922,1975, 22944,1976, 23144,1976, 23394,1976, 23435,1975, 23479,1973, 23500,1968, 23515,1959"/>
<points a="23535,1941, 23570,1891, 23602,1841, 23636,1786, 23644,1779, 23659,1772, 23673,1770, 23712,1770, 23739,1769, 23767,1768"/>
<points a="23785,1764, 23799,1757, 23815,1744, 23894,1626, 23952,1527, 23963,1516, 23978,1506, 23997,1501, 24018,1499, 24118,1499"/>
<points a="24153,1495, 24169,1490, 24182,1481, 24197,1464, 24262,1380, 24311,1308, 24331,1288, 24341,1281, 24356,1277, 24383,1276"/>
<points a="24419,1275, 24669,1275, 24695,1275, 24707,1276, 24721,1286, 24734,1305, 24751,1319, 24777,1321, 24877,1321, 25077,1321"/>
<points a="25227,1321, 25245,1318, 25271,1311, 25294,1295, 25369,1216, 25485,1080, 25580,947, 25626,880, 25645,858, 25666,847"/>
<points a="25690,840, 25773,839, 25821,839, 25848,841, 25861,848, 25877,860, 25909,908, 26019,1123, 26132,1390, 26158,1413"/>
<points a="26181,1424, 26216,1427, 26244,1428, 26644,1428, 26844,1428, 26868,1422, 26889,1406, 26904,1380, 26917,1366, 26943,1356"/>
<points a="27266,1355, 27296,1355, 27326,1354, 27349,1357, 27364,1367, 27374,1380, 27388,1392, 27416,1399, 27441,1397, 27785,1397"/>
<points a="27854,1396, 27873,1392, 27893,1382, 27908,1367, 27920,1351, 27937,1339, 27959,1337, 27988,1337, 28029,1337, 28379,1337"/>
<points a="28631,1338, 28655,1334, 28687,1325, 28714,1310, 28767,1277, 28793,1252, 28813,1229, 28828,1206, 28839,1196, 28862,1195"/>
<points a="28907,1195, 28932,1195, 28950,1204, 28969,1222, 29004,1276, 29011,1326, 29038,1396, 29060,1415, 29087,1421, 29111,1421"/>
<points a="29611,1421, 29911,1421, 30209,1421, 30245,1418, 30267,1409, 30292,1397, 30324,1367, 30341,1342, 30356,1313, 30379,1271"/>
<points a="30399,1250, 30418,1238, 30438,1233, 30458,1234, 30658,1234, 30776,1233, 30796,1236, 30817,1245, 30838,1259, 30848,1281"/>
<points a="30862,1312, 30886,1350, 30938,1357, 31094,1357, 31694,1357, 32794,1357, 33644,1357, 34594,1357, 35644,1357, 36644,1357"/>
<points a="37294,1357"/>
</line>
</level>
<level name="Planetoid: Big Craters" category="0" fillframe="9" surfaceframe="10" surfacethickness="10" type="race" opponents="2,3,4,5,6,7,8,9" win="1" exclusivechar="-1">
<obj type="endrace" x="43357" y="3670" rot="0"/>
<obj type="Checkpoint" x="2160" y="1916" rot="0"/>
<obj type="Checkpoint" x="7287" y="1224" rot="0"/>
<obj type="Checkpoint" x="10405" y="388" rot="0"/>
<obj type="Checkpoint" x="15307" y="1451" rot="0"/>
<obj type="Checkpoint" x="18495" y="2275" rot="0"/>
<obj type="Checkpoint" x="24040" y="749" rot="0"/>
<obj type="Checkpoint" x="26743" y="756" rot="0"/>
<obj type="Checkpoint" x="29735" y="785" rot="0"/>
<obj type="Checkpoint" x="31422" y="2911" rot="0"/>
<obj type="Checkpoint" x="34036" y="4575" rot="0"/>
<obj type="Checkpoint" x="36806" y="4362" rot="0"/>
<obj type="nonInteractive15" x="3889" y="1607" rot="0"/>
<obj type="nonInteractive15" x="4402" y="1458" rot="0"/>
<obj type="nonInteractive15" x="5745" y="1046" rot="0"/>
<obj type="nonInteractive15" x="5876" y="745" rot="0"/>
<obj type="nonInteractive15" x="7306" y="983" rot="0"/>
<obj type="nonInteractive15" x="8381" y="1149" rot="0"/>
<obj type="nonInteractive15" x="9375" y="890" rot="0"/>
<obj type="nonInteractive15" x="9833" y="328" rot="0"/>
<obj type="nonInteractive15" x="10142" y="-276" rot="0"/>
<obj type="nonInteractive15" x="10182" y="-835" rot="0"/>
<obj type="nonInteractive15" x="10709" y="-828" rot="0"/>
<obj type="nonInteractive15" x="10486" y="-395" rot="0"/>
<obj type="nonInteractive15" x="10972" y="244" rot="0"/>
<obj type="nonInteractive15" x="11580" y="560" rot="0"/>
<obj type="nonInteractive15" x="11723" y="1325" rot="0"/>
<obj type="nonInteractive15" x="12796" y="1737" rot="0"/>
<obj type="nonInteractive15" x="13671" y="1923" rot="0"/>
<obj type="nonInteractive15" x="14678" y="1441" rot="0"/>
<obj type="nonInteractive15" x="14972" y="747" rot="0"/>
<obj type="nonInteractive15" x="14606" y="479" rot="0"/>
<obj type="nonInteractive15" x="15155" y="176" rot="0"/>
<obj type="nonInteractive15" x="15336" y="1212" rot="0"/>
<obj type="nonInteractive15" x="15919" y="911" rot="0"/>
<obj type="nonInteractive15" x="16206" y="1547" rot="0"/>
<obj type="nonInteractive15" x="17375" y="1995" rot="0"/>
<obj type="nonInteractive15" x="18194" y="1873" rot="0"/>
<obj type="nonInteractive15" x="17899" y="1439" rot="0"/>
<obj type="nonInteractive15" x="18798" y="1881" rot="0"/>
<obj type="nonInteractive15" x="19114" y="1575" rot="0"/>
<obj type="nonInteractive15" x="19558" y="2179" rot="0"/>
<obj type="nonInteractive15" x="21138" y="1880" rot="0"/>
<obj type="nonInteractive15" x="21738" y="1330" rot="0"/>
<obj type="nonInteractive15" x="22757" y="679" rot="0"/>
<obj type="nonInteractive15" x="22883" y="443" rot="0"/>
<obj type="nonInteractive15" x="23442" y="181" rot="0"/>
<obj type="nonInteractive15" x="23148" y="-231" rot="0"/>
<obj type="nonInteractive15" x="23626" y="-31" rot="0"/>
<obj type="nonInteractive15" x="24078" y="165" rot="0"/>
<obj type="nonInteractive15" x="24436" y="474" rot="0"/>
<obj type="nonInteractive15" x="25605" y="465" rot="0"/>
<obj type="nonInteractive15" x="26357" y="35" rot="0"/>
<obj type="nonInteractive15" x="26122" y="-369" rot="0"/>
<obj type="nonInteractive15" x="25889" y="-18" rot="0"/>
<obj type="nonInteractive15" x="26732" y="-329" rot="0"/>
<obj type="nonInteractive15" x="27188" y="301" rot="0"/>
<obj type="nonInteractive15" x="27487" y="43" rot="0"/>
<obj type="nonInteractive15" x="29013" y="846" rot="0"/>
<obj type="nonInteractive15" x="29482" y="432" rot="0"/>
<obj type="nonInteractive15" x="29410" y="-57" rot="0"/>
<obj type="nonInteractive15" x="29881" y="-86" rot="0"/>
<obj type="nonInteractive15" x="30485" y="394" rot="0"/>
<obj type="nonInteractive15" x="30823" y="980" rot="0"/>
<obj type="nonInteractive15" x="31014" y="1582" rot="0"/>
<obj type="nonInteractive15" x="31521" y="2358" rot="0"/>
<obj type="nonInteractive15" x="31988" y="2558" rot="0"/>
<obj type="nonInteractive15" x="32281" y="2816" rot="0"/>
<obj type="nonInteractive15" x="32228" y="3407" rot="0"/>
<obj type="nonInteractive15" x="32841" y="4186" rot="0"/>
<obj type="nonInteractive15" x="33494" y="3683" rot="0"/>
<obj type="nonInteractive15" x="33949" y="4277" rot="0"/>
<obj type="nonInteractive15" x="34628" y="4291" rot="0"/>
<obj type="nonInteractive15" x="35188" y="4050" rot="0"/>
<obj type="nonInteractive15" x="37150" y="3939" rot="0"/>
<obj type="nonInteractive15" x="38349" y="3176" rot="0"/>
<obj type="nonInteractive15" x="37779" y="2823" rot="0"/>
<obj type="nonInteractive15" x="37589" y="3277" rot="0"/>
<obj type="nonInteractive15" x="38575" y="2663" rot="0"/>
<obj type="nonInteractive15" x="38707" y="3376" rot="0"/>
<obj type="nonInteractive15" x="40096" y="3463" rot="0"/>
<obj type="nonInteractive15" x="41701" y="3418" rot="0"/>
<line>
<points a="46,231, 1246,231, 1403,1899, 1428,1914, 1498,1917, 1698,1917, 2698,1917, 3248,1917, 3476,1913, 3873,1882"/>
<points a="4213,1825, 4518,1757, 4760,1650, 5080,1494, 5268,1441, 5534,1351, 5627,1316, 5754,1274, 5823,1253, 6030,1213"/>
<points a="6139,1209, 6839,1209, 7199,1217, 7651,1258, 7711,1266, 7779,1279, 7950,1317, 8000,1327, 8056,1328, 8320,1325"/>
<points a="8630,1312, 8952,1286, 9187,1244, 9383,1187, 9564,1103, 9761,983, 9892,873, 9957,800, 10013,718, 10073,586"/>
<points a="10136,411, 10145,391, 10620,390, 10631,391, 10639,398, 10695,479, 10811,649, 11027,1016, 11205,1274, 11412,1530"/>
<points a="11614,1726, 11858,1915, 12014,2023, 12194,2114, 12405,2184, 12627,2239, 12861,2269, 12967,2275, 13303,2275, 13623,2272"/>
<points a="13837,2248, 14093,2203, 14287,2149, 14480,2075, 14616,1995, 14725,1901, 14832,1770, 14947,1578, 14999,1467, 15014,1454"/>
<points a="15580,1452, 15592,1456, 15631,1515, 15767,1761, 15871,1912, 16027,2083, 16154,2188, 16270,2264, 16391,2321, 16554,2364"/>
<points a="16703,2382, 16892,2387, 17092,2387, 17268,2386, 17437,2376, 17564,2352, 17713,2312, 17872,2245, 17918,2207, 17951,2159"/>
<points a="18039,2160, 18097,2198, 18220,2261, 18280,2275, 18472,2277, 18703,2269, 18732,2259, 18750,2251, 18791,2250, 18848,2280"/>
<points a="18955,2323, 19119,2357, 19356,2404, 19594,2430, 19717,2435, 19942,2435, 20390,2429, 20613,2414, 20824,2378, 21044,2322"/>
<points a="21235,2255, 21354,2195, 21588,2076, 21936,1864, 22205,1687, 22442,1513, 22631,1367, 22861,1159, 23097,904, 23275,699"/>
<points a="23307,660, 23340,623, 23361,608, 23444,606, 23598,611, 23687,656, 23722,692, 23765,725, 23799,744, 23845,749"/>
<points a="24078,750, 24241,750, 24324,749, 24463,738, 24650,716, 24713,712, 24779,718, 25084,769, 25157,796, 25207,825"/>
<points a="25240,860, 25287,907, 25347,940, 25383,945, 25546,950, 25615,950, 25837,945, 25904,933, 26071,885, 26146,845"/>
<points a="26208,796, 26251,749, 26289,664, 26312,596, 26324,540, 26391,538, 26399,574, 26420,636, 26453,689, 26487,719"/>
<points a="26561,746, 26647,759, 26708,761, 26770,757, 26900,741, 27062,704, 27110,680, 27142,654, 27164,629, 27177,604"/>
<points a="27220,605, 27236,625, 27274,667, 27333,714, 27512,815, 27652,872, 27915,955, 28174,1020, 28414,1049, 28688,1073"/>
<points a="28938,1075, 29215,1069, 29306,1048, 29447,989, 29555,919, 29611,866, 29638,820, 29649,787, 29845,787, 29881,864"/>
<points a="29944,977, 30123,1275, 30337,1659, 30595,2017, 30917,2449, 31306,2893, 31327,2910, 31359,2923, 31400,2922, 31411,2913"/>
<points a="31454,2912, 31583,3118, 31747,3392, 31940,3712, 32185,4076, 32438,4449, 32469,4491, 32497,4504, 32545,4516, 32634,4525"/>
<points a="32690,4527, 32859,4527, 32895,4525, 32932,4512, 32943,4503, 32963,4485, 32977,4461, 33018,4461, 33044,4492, 33104,4540"/>
<points a="33153,4555, 33205,4563, 33235,4563, 33312,4555, 33351,4537, 33368,4516, 33498,4517, 33512,4531, 33663,4562, 33843,4576"/>
<points a="34135,4577, 34511,4561, 34658,4548, 34734,4523, 34811,4499, 34851,4480, 34871,4460, 34882,4443, 34931,4443, 34944,4468"/>
<points a="34983,4509, 35039,4538, 35116,4542, 35172,4541, 35211,4526, 35284,4492, 35383,4427, 35500,4391, 35593,4373, 35888,4370"/>
<points a="36288,4370, 36588,4370, 36836,4361, 37126,4325, 37251,4290, 37507,4211, 37797,4140, 37928,4088, 37994,4043, 38052,3986"/>
<points a="38160,3856, 38199,3799, 38220,3740, 38242,3670, 40269,3670, 41619,3670, 42869,3670, 44269,3670"/>
</line>
</level>
<level name="Planetoid: Haddock Chase Special" category="0" fillframe="1" surfaceframe="5" surfacethickness="10" type="chase" opponents="25" win="1" exclusivechar="19">
<obj type="endrace" x="32236" y="1299" rot="0"/>
<obj type="Checkpoint" x="1879" y="1960" rot="0"/>
<obj type="furniture04" x="6997" y="1990" rot="0"/>
<obj type="furniture04" x="8982" y="1989" rot="0"/>
<line>
<points a="19,276, 1219,276, 1312,1930, 1333,1949, 1395,1959, 2545,1959, 2660,1971, 2781,1995, 2826,2010, 2883,2014"/>
<points a="2946,2013, 3004,2008, 3047,1996, 3094,1987, 3158,1983, 3194,1984, 3243,1990, 3306,2000, 3385,2021, 3453,2038"/>
<points a="3517,2044, 3617,2049, 3690,2049, 3771,2044, 3839,2027, 3996,1981, 4052,1956, 4115,1938, 4155,1934, 4193,1933"/>
<points a="4226,1936, 4289,1954, 4389,1979, 4591,2007, 4679,2007, 4790,2002, 4869,1990, 4926,1987, 4984,1987, 5148,1994"/>
<points a="5212,2013, 5276,2038, 5342,2072, 5405,2101, 5469,2113, 5531,2116, 5603,2110, 5669,2092, 5746,2062, 5824,2033"/>
<points a="5911,2016, 5983,2008, 6041,2008, 6114,2022, 6245,2068, 6331,2098, 6379,2104, 6469,2112, 6558,2109, 6617,2098"/>
<points a="6677,2080, 6738,2053, 6798,2026, 6837,2008, 6880,1997, 6922,1992, 6984,1987, 7027,1987, 7074,1990, 7133,2003"/>
<points a="7207,2036, 7245,2054, 7297,2071, 7345,2080, 7417,2089, 7484,2092, 7579,2092, 7663,2091, 7725,2088, 7773,2082"/>
<points a="7869,2069, 7942,2062, 7998,2062, 8030,2067, 8080,2082, 8123,2083, 8248,2080, 8347,2078, 8444,2066, 8566,2049"/>
<points a="8618,2031, 8664,2006, 8690,1993, 8723,1993, 8878,1983, 8953,1984, 9126,1986, 9186,1982, 9279,1957, 9367,1928"/>
<points a="9417,1896, 9445,1879, 9493,1860, 9559,1853, 9625,1857, 9688,1852, 9727,1840, 9850,1820, 9954,1800, 10045,1793"/>
<points a="10174,1786, 10266,1779, 10396,1778, 10440,1778, 10486,1778, 10620,1784, 10696,1787, 10752,1789, 10782,1795, 10877,1827"/>
<points a="10926,1848, 10975,1855, 11021,1859, 11141,1879, 11204,1879, 11291,1877, 11361,1875, 11440,1862, 11490,1855, 11569,1850"/>
<points a="11641,1850, 11711,1853, 11761,1858, 11848,1876, 11938,1894, 11989,1897, 12047,1898, 12084,1897, 12159,1896, 12227,1893"/>
<points a="12280,1889, 12329,1882, 12384,1864, 12437,1844, 12498,1828, 12552,1814, 12606,1805, 12655,1801, 12703,1798, 12807,1799"/>
<points a="12905,1802, 12961,1806, 13001,1813, 13076,1836, 13133,1858, 13180,1877, 13217,1884, 13262,1897, 13313,1904, 13365,1908"/>
<points a="13439,1910, 13499,1909, 13557,1906, 13598,1898, 13650,1889, 13707,1879, 13758,1869, 13820,1861, 13876,1860, 13930,1861"/>
<points a="13993,1866, 14049,1880, 14117,1894, 14198,1897, 14289,1896, 14338,1893, 14444,1888, 14522,1881, 14576,1874, 14646,1868"/>
<points a="14692,1868, 14813,1873, 14889,1882, 14932,1891, 14978,1892, 15109,1887, 15252,1873, 15359,1844, 15555,1772, 15636,1732"/>
<points a="15677,1706, 15715,1690, 15763,1684, 15799,1690, 15896,1720, 15947,1728, 15993,1730, 16097,1737, 16171,1726, 16240,1701"/>
<points a="16284,1676, 16328,1641, 16369,1621, 16425,1605, 16481,1600, 16529,1600, 16600,1614, 16694,1624, 16770,1625, 16799,1622"/>
<points a="16860,1612, 16945,1591, 17037,1565, 17107,1544, 17162,1528, 17218,1517, 17281,1516, 17340,1521, 17372,1528, 17421,1544"/>
<points a="17495,1567, 17581,1574, 17678,1576, 17731,1572, 17845,1563, 17935,1543, 18006,1520, 18070,1497, 18167,1453, 18222,1422"/>
<points a="18260,1399, 18296,1382, 18335,1369, 18380,1354, 18445,1344, 18601,1332, 18699,1328, 18801,1328, 19052,1333, 19174,1340"/>
<points a="19270,1350, 19331,1363, 19393,1386, 19444,1402, 19513,1413, 19609,1425, 19695,1431, 19765,1432, 19834,1433, 19957,1428"/>
<points a="20097,1411, 20220,1381, 20298,1358, 20424,1314, 20506,1282, 20555,1268, 20619,1254, 20676,1245, 20732,1242, 20811,1242"/>
<points a="20871,1251, 20929,1261, 21000,1283, 21086,1311, 21184,1334, 21238,1343, 21283,1348, 21337,1349, 21504,1353, 21673,1350"/>
<points a="21910,1338, 21985,1333, 22057,1323, 22129,1308, 22198,1292, 22305,1267, 22390,1245, 22440,1235, 22532,1228, 22602,1233"/>
<points a="22665,1250, 22728,1265, 22771,1267, 22820,1262, 22861,1256, 22903,1258, 22965,1268, 23014,1288, 23136,1334, 23229,1361"/>
<points a="23269,1363, 23355,1362, 23400,1357, 23477,1340, 23504,1326, 23565,1297, 23616,1277, 23670,1257, 23710,1244, 23783,1225"/>
<points a="23845,1224, 23910,1230, 23956,1247, 24035,1279, 24083,1293, 24147,1301, 24198,1301, 24279,1300, 24325,1295, 24380,1282"/>
<points a="24440,1264, 24522,1237, 24587,1223, 24630,1219, 24678,1219, 24758,1226, 24846,1241, 24910,1264, 24963,1281, 25014,1293"/>
<points a="25089,1297, 25224,1300, 25339,1295, 25469,1278, 25546,1256, 25654,1221, 25729,1196, 25794,1178, 25856,1165, 25896,1159"/>
<points a="25946,1165, 26006,1184, 26077,1212, 26116,1214, 26203,1212, 26300,1204, 26443,1194, 26534,1184, 26583,1163, 26645,1133"/>
<points a="26688,1105, 26721,1076, 26760,1045, 26802,1017, 26848,997, 26912,976, 26979,962, 27038,952, 27100,947, 27181,947"/>
<points a="27233,953, 27319,976, 27378,999, 27423,1026, 27482,1064, 27534,1091, 27585,1106, 27681,1127, 27755,1144, 27829,1162"/>
<points a="27945,1181, 28023,1182, 28085,1172, 28171,1154, 28270,1135, 28328,1133, 28420,1134, 28504,1142, 28565,1155, 28654,1183"/>
<points a="28734,1215, 28794,1248, 28841,1270, 28918,1303, 28998,1321, 29061,1328, 29104,1328, 29307,1323, 29376,1305, 29480,1280"/>
<points a="29559,1270, 29650,1268, 29716,1268, 29753,1277, 29807,1288, 29840,1289, 30053,1294, 30292,1298, 30542,1298, 31192,1298"/>
<points a="31842,1298, 32392,1298, 32942,1298, 33892,1298, 34342,1298"/>
</line>
</level>
<level name="Moon Bonus Level" category="0" fillframe="15" surfaceframe="16" surfacethickness="10" type="race" opponents="2,3,4,5,6,7" win="1">
<obj type="endrace" x="63514" y="8089" rot="0"/>
<obj type="Checkpoint" x="1597" y="1356" rot="0"/>
<obj type="Checkpoint" x="5964" y="1122" rot="0"/>
<obj type="Checkpoint" x="7891" y="1196" rot="0"/>
<obj type="Checkpoint" x="10180" y="1195" rot="0"/>
<obj type="Checkpoint" x="12214" y="1147" rot="0"/>
<obj type="Checkpoint" x="14571" y="775" rot="0"/>
<obj type="Checkpoint" x="16643" y="725" rot="0"/>
<obj type="Checkpoint" x="18754" y="730" rot="0"/>
<obj type="Checkpoint" x="22268" y="958" rot="0"/>
<obj type="Checkpoint" x="24541" y="1445" rot="0"/>
<obj type="Checkpoint" x="27176" y="4254" rot="0"/>
<obj type="Checkpoint" x="29580" y="4424" rot="0"/>
<obj type="Checkpoint" x="31829" y="4338" rot="0"/>
<obj type="Checkpoint" x="32961" y="4019" rot="0"/>
<obj type="Checkpoint" x="34567" y="4518" rot="0"/>
<obj type="Checkpoint" x="37407" y="4421" rot="0"/>
<obj type="Checkpoint" x="41496" y="5011" rot="0"/>
<obj type="Checkpoint" x="43875" y="4920" rot="0"/>
<obj type="Checkpoint" x="45684" y="4930" rot="0"/>
<obj type="Checkpoint" x="46881" y="6016" rot="0"/>
<obj type="Checkpoint" x="48542" y="6938" rot="0"/>
<obj type="Checkpoint" x="50983" y="7265" rot="0"/>
<obj type="Checkpoint" x="52548" y="6801" rot="0"/>
<obj type="Checkpoint" x="54361" y="6931" rot="0"/>
<obj type="Checkpoint" x="56760" y="7679" rot="0"/>
<obj type="Checkpoint" x="58575" y="7984" rot="0"/>
<line>
<points a="30,257, 930,257, 1081,1320, 1117,1356, 2367,1356, 3167,1356, 4117,1356, 4618,1351, 4964,1330, 5094,1313"/>
<points a="5256,1282, 5332,1247, 5481,1192, 5712,1138, 5835,1116, 5921,1116, 6085,1142, 6197,1180, 6462,1196, 6693,1180"/>
<points a="6807,1105, 6892,1176, 7044,1191, 7130,1211, 7193,1208, 7256,1205, 7296,1194, 7334,1176, 7513,1132, 7588,1129"/>
<points a="7623,1134, 7664,1158, 7777,1186, 7852,1196, 7923,1196, 8011,1187, 8068,1185, 8130,1188, 8475,1192, 8531,1180"/>
<points a="8587,1159, 8923,1140, 9041,1127, 9106,1110, 9164,1096, 9225,1084, 9270,1099, 9313,1120, 9424,1147, 9511,1150"/>
<points a="9663,1162, 9831,1181, 10088,1193, 10239,1197, 10448,1198, 10774,1191, 10921,1182, 10981,1164, 11182,1130, 11299,1128"/>
<points a="11423,1108, 11600,1121, 11739,1127, 12034,1146, 12274,1146, 12574,1146, 12698,1066, 12784,1148, 12844,1116, 12886,1149"/>
<points a="12924,1132, 12948,1151, 13125,1151, 13209,1147, 13408,1123, 13498,1099, 13668,1045, 13828,988, 13973,930, 14139,880"/>
<points a="14254,851, 14538,782, 14671,767, 14840,764, 14954,767, 15116,1161, 15357,1162, 15603,1156, 15704,1152, 15770,1127"/>
<points a="15907,1074, 15970,1021, 16073,958, 16180,897, 16254,866, 16401,788, 16473,758, 16524,732, 16586,726, 16704,724"/>
<points a="16809,758, 16873,802, 17037,843, 17145,865, 17205,877, 17314,882, 17605,880, 17713,865, 17786,829, 17831,791"/>
<points a="17934,759, 18013,736, 18125,730, 18384,729, 18734,729, 19184,729, 19295,630, 19395,734, 19507,734, 19566,692"/>
<points a="19620,738, 19768,737, 19786,715, 19809,736, 20059,736, 20306,724, 20341,682, 20389,640, 20452,602, 20516,574"/>
<points a="20583,550, 20782,504, 20892,509, 20946,522, 21055,542, 21218,598, 21380,685, 21493,737, 21635,802, 21776,880"/>
<points a="21899,920, 22052,947, 22167,957, 22356,959, 22765,961, 22934,948, 23116,905, 23168,863, 23201,818, 23228,760"/>
<points a="23252,734, 23281,722, 23299,723, 23352,740, 23384,787, 23413,859, 23466,1011, 23502,1085, 23556,1128, 23643,1188"/>
<points a="23791,1274, 23907,1343, 24029,1385, 24178,1415, 24361,1439, 24595,1446, 24707,1442, 24980,1423, 25111,1398, 25196,1373"/>
<points a="25257,1325, 25296,1273, 25314,1229, 25332,1167, 25349,1151, 25372,1141, 25397,1147, 25425,1166, 25453,1208, 25479,1272"/>
<points a="25550,1524, 25629,1810, 25744,2229, 25806,2574, 25901,3027, 25966,3319, 26051,3604, 26111,3746, 26162,3822, 26244,3929"/>
<points a="26338,4006, 26450,4076, 26553,4140, 26654,4191, 26771,4224, 26895,4251, 26965,4258, 27271,4259, 27583,4253, 27785,4245"/>
<points a="28034,4223, 28108,4125, 28176,4214, 28265,4207, 28291,4163, 28338,4202, 28442,4195, 28458,4175, 28511,4194, 28798,4194"/>
<points a="28883,4214, 29093,4297, 29195,4347, 29309,4393, 29406,4418, 29521,4428, 29701,4423, 29817,4411, 29892,4395, 29962,4364"/>
<points a="30021,4328, 30115,4283, 30188,4252, 30321,4220, 30429,4189, 30559,4184, 30681,4235, 30769,4280, 30816,4286, 30853,4271"/>
<points a="30894,4265, 30920,4283, 31052,4286, 31086,4323, 31143,4339, 31190,4332, 31219,4314, 31257,4298, 31272,4305, 31304,4283"/>
<points a="31329,4244, 31376,4208, 31447,4191, 31481,4211, 31506,4238, 31547,4245, 31560,4236, 31642,4222, 31694,4227, 31729,4265"/>
<points a="31747,4305, 31785,4342, 31863,4340, 31925,4323, 31957,4292, 31990,4277, 32022,4280, 32092,4315, 32157,4316, 32195,4289"/>
<points a="32234,4295, 32264,4267, 32320,4244, 32358,4253, 32413,4220, 32445,4231, 32527,4210, 32634,4170, 32685,4119, 32727,4092"/>
<points a="32768,4069, 32800,4067, 32852,4066, 32865,4049, 32883,4030, 32942,4021, 33006,4019, 33046,4037, 33117,4090, 33168,4134"/>
<points a="33245,4226, 33311,4311, 33369,4346, 33436,4372, 33524,4388, 33582,4380, 33631,4351, 33679,4345, 33718,4377, 33752,4400"/>
<points a="33856,4416, 33918,4463, 33971,4500, 34039,4538, 34107,4544, 34136,4528, 34229,4508, 34297,4470, 34363,4442, 34389,4450"/>
<points a="34456,4498, 34535,4520, 34598,4516, 34618,4506, 34701,4479, 34733,4468, 34798,4445, 34836,4442, 34870,4444, 35095,4488"/>
<points a="35348,4511, 35398,4511, 35648,4511, 35948,4511, 36008,4441, 36074,4511, 36143,4513, 36179,4471, 36221,4514, 36319,4515"/>
<points a="36344,4495, 36366,4517, 36566,4517, 36654,4507, 36911,4495, 37083,4482, 37268,4456, 37556,4386, 37812,4280, 38074,4161"/>
<points a="38395,3986, 38635,3800, 38838,3648, 39011,3511, 39056,3573, 39121,3541, 39238,3672, 39271,3648, 39420,3802, 39453,3806"/>
<points a="39510,3870, 39590,3876, 39733,4034, 39776,4035, 39951,4219, 40071,4235, 40254,4432, 40542,4517, 40788,4772, 40931,4882"/>
<points a="41049,4943, 41185,4996, 41458,5012, 41657,5011, 41888,4999, 42125,4965, 42247,4907, 42333,4839, 42380,4813, 42421,4806"/>
<points a="42455,4826, 42569,4887, 42655,4953, 42737,4984, 42855,5008, 42982,5028, 43047,5030, 43124,5019, 43172,4993, 43205,4963"/>
<points a="43258,4933, 43301,4912, 43354,4911, 43393,4925, 43430,4949, 43488,4975, 43560,5000, 43616,5005, 43662,5001, 43710,4984"/>
<points a="43757,4957, 43798,4934, 43858,4920, 43882,4920, 43921,4924, 44004,4933, 44061,4948, 44486,4949, 44569,4869, 44645,4946"/>
<points a="44695,4903, 44745,4949, 44792,4927, 44825,4951, 45094,4948, 45303,4948, 45487,4934, 45827,4931, 45857,4923, 45885,4908"/>
<points a="45911,4888, 45931,4883, 45996,4886, 46182,5222, 46460,5645, 46644,5901, 46723,5975, 46804,6018, 46863,6019, 46989,6012"/>
<points a="47032,5999, 47078,5975, 47122,5967, 47213,5979, 47292,6038, 47367,6117, 47568,6385, 47813,6790, 47860,6835, 47933,6870"/>
<points a="47998,6885, 48057,6888, 48089,6884, 48130,6872, 48170,6862, 48202,6861, 48240,6877, 48274,6908, 48299,6938, 48459,6939"/>
<points a="48703,6936, 48738,6913, 48768,6893, 48805,6885, 48840,6880, 48865,6880, 48893,6888, 48929,6905, 48948,6925, 48972,6945"/>
<points a="49272,6945, 49572,6945, 49605,6917, 49638,6890, 49671,6877, 49706,6872, 49748,6873, 49779,6883, 49813,6913, 49844,6949"/>
<points a="50109,6951, 50222,6966, 50316,7010, 50450,7093, 50620,7194, 50732,7244, 50811,7255, 51009,7269, 51123,7266, 51223,7255"/>
<points a="51276,7219, 51310,7181, 51388,7113, 51462,7059, 51554,7016, 51648,7046, 51710,7085, 51825,7094, 51853,7084, 52032,6954"/>
<points a="52110,6879, 52195,6935, 52250,6932, 52296,6913, 52351,6900, 52378,6874, 52473,6843, 52524,6805, 52583,6800, 52632,6842"/>
<points a="52655,6860, 52692,6873, 52785,6914, 52932,6941, 53083,6942, 53433,6942, 53522,6868, 53598,6942, 53748,6942, 53770,6913"/>
<points a="53794,6939, 53962,6939, 53977,6928, 53991,6939, 54291,6939, 54388,6932, 54567,6895, 54621,6863, 54658,6833, 54697,6819"/>
<points a="54729,6820, 54803,6886, 54875,6953, 54911,6974, 54978,6948, 55022,6915, 55066,6959, 55133,6968, 55160,6988, 55215,7074"/>
<points a="55339,7207, 55414,7253, 55484,7220, 55593,7202, 55637,7255, 55701,7266, 55735,7287, 55818,7320, 56038,7355, 56221,7573"/>
<points a="56324,7542, 56367,7585, 56423,7620, 56478,7676, 56588,7732, 56676,7732, 56707,7709, 56723,7679, 56791,7679, 56812,7717"/>
<points a="56862,7782, 56966,7841, 57021,7834, 57047,7834, 57122,7880, 57191,7894, 57221,7851, 57394,7808, 57422,7836, 57481,7899"/>
<points a="57541,7875, 57649,7832, 57722,7805, 57764,7827, 57790,7889, 57836,7939, 57958,7962, 58036,7935, 58050,7906, 58097,7892"/>
<points a="58277,7909, 58282,7956, 58338,7980, 58615,7987, 58852,8014, 59179,8119, 59410,8139, 59660,8139, 59757,8050, 59834,8139"/>
<points a="60027,8139, 60091,8088, 60140,8140, 60440,8140, 60464,8114, 60493,8140, 60843,8140, 61051,8130, 61324,8108, 61603,8091"/>
<points a="61649,8089, 61899,8089, 62549,8089, 63049,8089, 63599,8089, 64199,8089, 64849,8089"/>
</line>
</level>
<physobj name="girder01" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="BackgroundPieces" frame="14" pos="0,0" rot="0" zoffset="100"/>
<shape type="poly" name="" col="2,7" vertices="0,0, 400,0, 400,50, 0,50" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="girderup" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="BackgroundPieces" frame="13" pos="0,0" rot="0" zoffset="100"/>
</body>
</physobj>
<physobj name="furniture01" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="1" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="0,0, 70,-50, 70,50, 0,50" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="furniture02" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="2" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="0,0, 115,0, 115,100, 0,100" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="furniture03" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="4" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="0,-40, 70,0, 70,20, 0,20" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="furniture04" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="5" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="-40,0, 0,-22, 40,0" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="furniture05" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="6" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="-17,0, 0,-12, 17,0" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="killer01" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="8" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="-50,-44, 40,-46, 50,0, -50,0" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="killer02" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="9" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="-50,-44, 40,-46, 50,0, -50,0" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="killer03" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<shape type="poly" name="" col="2,7" vertices="0,0, 400,0, 400,40, 0,40" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="Bus" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="10" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="-93,-241, 63,-245, 69,19, -92,18" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="Igloo" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="11" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="-97,8, -71,-59, -6,-83, 82,-38, 101,0" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="SandRamp" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="16" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="0,0, 86,-75, 108,-72, 164,10" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="CarSide" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="13" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="-80,13, -70,-30, -30,-54, 30,-58, 72,-24, 75,12" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="CarFront" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="14" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="-45,15, -46,-42, -4,-59, 45,-43, 41,15" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="killerGlacier" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="Furniture" frame="12" pos="0,0" rot="0" zoffset="50"/>
<shape type="poly" name="" col="2,7" vertices="-100,0, 100,0, 100,300, -100,300" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="nonInteractive01" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="1" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive02" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="2" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive03" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="3" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive04" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="4" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive05" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="5" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive06" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="6" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive07" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="7" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive08" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="8" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive09" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="9" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive10" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="10" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive11" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="11" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive12" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="12" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive13" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="13" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive14" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="14" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive15" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="15" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive16" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="17" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive17" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="18" pos="0,0" rot="0" zoffset="500"/>
</body>
</physobj>
<physobj name="nonInteractive18" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="19" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="nonInteractive19" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="false">
<graphic clip="nonInteractive" frame="20" pos="0,0" rot="0" zoffset="150"/>
</body>
</physobj>
<physobj name="switch_to_back" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="true">
<shape type="poly" name="" col="2,7" vertices="0,0, 20,0, 20,20, 0,20" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="switch_to_front" inlibrary="true">
<body name="fix" pos="0,0" fixed="true" sensor="true">
<shape type="poly" name="" col="4,7" vertices="0,0, 20,0, 20,20, 0,20" density="1" friction="0.5" restitution="0.2"/>
</body>
</physobj>
<physobj name="screenborder" inlibrary="false">
<body name="body" pos="0,0" fixed="true" sensor="true">
<shape type="poly" name="" col="1,6" vertices="0,-32,640,-32,640,0,0,0" density="1" friction="1" restitution="0"/>
<shape type="poly" name="" col="1,6" vertices="-50,540,740,540,740,580,-50,580" density="1" friction="1" restitution="0"/>
<shape type="poly" name="" col="1,6" vertices="-30,0,-20,0,-20,580,-20,580" density="1" friction="1" restitution="0"/>
<shape type="poly" name="" col="1,6" vertices="660,0,680,0,680,580,660,580" density="1" friction="1" restitution="0"/>
</body>
</physobj>
<physobj name="endrace" inlibrary="true">
<body name="body" pos="0,0" fixed="true" sensor="true">
<graphic clip="Furniture" frame="3" pos="0,0" rot="0"/>
<shape type="poly" name="" col="1,7" vertices="-10,-2000,10,-2000,10,300,-10,300" density="1" friction="1" restitution="0"/>
</body>
</physobj>
<physobj name="Checkpoint" inlibrary="true">
<body name="body" pos="0,0" fixed="true" sensor="true">
<graphic clip="Furniture" frame="7" pos="0,0" rot="0" zoffset="800" gameobjfunction="InitCheckpoint"/>
</body>
</physobj>
<physobj name="Pickup" inlibrary="true">
<body name="pickup" pos="0,0" fixed="true" sensor="true">
<graphic clip="Pickups" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitPickup"/>
<shape type="circle" pos="0,0" name="" col="2,7" radius="30" density="0.3" friction="0.2" restitution="0.5"/>
</body>
</physobj>
<physobj name="bike1" description="robo" inlibrary="false">
<body name="axle1" pos="-27,10" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="23,8" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-27,10" fixed="false" sensor="false">
<graphic clip="BikeWheel01" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,7" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="23,8" fixed="false" sensor="false">
<graphic clip="BikeWheel01" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,7" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs01" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody01,-8,-18"/>
<shape type="poly" name="" col="1,6" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-27,10" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="23,8" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-27,10" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="23,8" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike2" description="Elvis chopper" inlibrary="false">
<body name="axle1" pos="-22,17" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="25,20" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-22,17" fixed="false" sensor="false">
<graphic clip="BikeWheel02" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="25,20" fixed="false" sensor="false">
<graphic clip="BikeWheel02" frame="2" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="8" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs02" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody02,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-22,17" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="25,20" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-22,17" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="25,20" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike3" description="ninja" inlibrary="false">
<body name="axle1" pos="-21,16" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="20,14" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-21,16" fixed="false" sensor="false">
<graphic clip="BikeWheel03" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,7" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="20,14" fixed="false" sensor="false">
<graphic clip="BikeWheel03" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,7" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs03" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody03,-8,-18"/>
<shape type="poly" name="" col="1,6" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-21,16" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="20,14" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-21,16" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="20,14" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike4" description="Mr T chopper" inlibrary="false">
<body name="axle1" pos="-22,18" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="40,18" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-22,18" fixed="false" sensor="false">
<graphic clip="BikeWheel04" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="40,18" fixed="false" sensor="false">
<graphic clip="BikeWheel04" frame="2" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="8" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs04" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody04,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-22,18" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="40,18" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-22,18" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="40,18" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike5" description="Matrick McGooghan on a penny farthing" inlibrary="false">
<body name="axle1" pos="-40,23" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="-2,8" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-40,23" fixed="false" sensor="false">
<graphic clip="BikeWheel05" frame="2" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="6" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="-2,8" fixed="false" sensor="false">
<graphic clip="BikeWheel05" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="20" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs05" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody05,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-40,23" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="-2,8" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-40,23" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="-2,8" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike6" description="Frenchman" inlibrary="false">
<body name="axle1" pos="-30,15" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="20,12" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-30,15" fixed="false" sensor="false">
<graphic clip="BikeWheel06" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,7" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="20,12" fixed="false" sensor="false">
<graphic clip="BikeWheel06" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,7" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs06" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody06,-8,-18"/>
<shape type="poly" name="" col="1,6" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-30,15" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="20,12" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-30,15" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="20,12" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike7" description="Blue Stig" inlibrary="false">
<body name="axle1" pos="-29,12" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="17,11" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-29,12" fixed="false" sensor="false">
<graphic clip="BikeWheel07" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,7" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="17,11" fixed="false" sensor="false">
<graphic clip="BikeWheel07" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,7" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs07" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody07,-8,-18"/>
<shape type="poly" name="" col="1,6" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-29,12" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="17,11" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-29,12" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="17,11" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike8" description="Sir Clive" inlibrary="false">
<body name="axle1" pos="-24,4" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="28,8" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-24,4" fixed="false" sensor="false">
<graphic clip="BikeWheel08" frame="1" pos="0,0" rot="0" zoffset="-3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="8" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="28,8" fixed="false" sensor="false">
<graphic clip="BikeWheel08" frame="2" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="6" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs08" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody08,-10,-13"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,-10,20,-10,20,0,-20,0" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-24,4" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="28,8" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-24,4" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="28,8" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike9" description="Bungle" inlibrary="false">
<body name="axle1" pos="-28,18" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="14,17" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-28,18" fixed="false" sensor="false">
<graphic clip="BikeWheel09" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="14" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="14,17" fixed="false" sensor="false">
<graphic clip="BikeWheel09" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="14" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs09" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody09,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-28,18" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="14,17" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-28,18" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="14,17" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike10" description="Stick Man" inlibrary="false">
<body name="axle1" pos="-20,17" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="18,7" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-20,17" fixed="false" sensor="false">
<graphic clip="BikeWheel10" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="8" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="18,7" fixed="false" sensor="false">
<graphic clip="BikeWheel10" frame="2" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="13" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs10" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody10,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,0,0,0,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-20,17" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="18,7" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-20,17" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="18,7" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike11" description="Bruce Lee" inlibrary="false">
<body name="axle1" pos="-29,12" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="17,11" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-29,12" fixed="false" sensor="false">
<graphic clip="BikeWheel11" frame="2" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="17,11" fixed="false" sensor="false">
<graphic clip="BikeWheel11" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs11" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody11,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-29,12" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="17,11" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-29,12" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="17,11" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike12" description="tandem (laurel and hardy)" inlibrary="false">
<body name="axle1" pos="-31,15" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="66,16" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-31,15" fixed="false" sensor="false">
<graphic clip="BikeWheel12" frame="1" pos="0,0" rot="0" zoffset="-3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="13" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="66,16" fixed="false" sensor="false">
<graphic clip="BikeWheel12" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="13" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs12" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody12,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-31,15" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="66,16" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-31,15" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="66,16" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike13" description="Dino with trailer" inlibrary="false">
<body name="axle1" pos="-22,16" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="20,14" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-22,16" fixed="false" sensor="false">
<graphic clip="BikeWheel13" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,7" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="20,14" fixed="false" sensor="false">
<graphic clip="BikeWheel13" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,7" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs13" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody13,-8,-18"/>
<shape type="poly" name="" col="1,6" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="trailer" pos="-75,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeBody13a" frame="1" pos="0,0" rot="0"/>
<shape type="poly" name="" col="1,6" vertices="-10,-10, 10,-10, 10,0, -10,0" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="trailerwheel" pos="-75,12" fixed="false" sensor="false">
<graphic clip="BikeWheel13" frame="2" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,7" radius="7" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-22,16" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="20,14" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="rev" name="trailerwheel" body0="trailer" body1="trailerwheel" pos="-75,12" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="trailer2body" body0="trailer" body1="body" pos="-32,5" enablelimit="true" lowerangle="-30" upperangle="30" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-22,16" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="20,14" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike14" description="Skeleton" inlibrary="false">
<body name="axle1" pos="-25,14" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="21,19" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-25,14" fixed="false" sensor="false">
<graphic clip="BikeWheel14" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="21,19" fixed="false" sensor="false">
<graphic clip="BikeWheel14" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs14" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody14,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-25,14" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="21,19" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-25,14" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="21,19" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike15" description="Pirate" inlibrary="false">
<body name="axle1" pos="-22,19" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="26,20" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-22,19" fixed="false" sensor="false">
<graphic clip="BikeWheel15" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="26,20" fixed="false" sensor="false">
<graphic clip="BikeWheel15" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs15" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody15,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-22,19" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="26,20" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-22,19" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="26,20" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike16" description="Zombie" inlibrary="false">
<body name="axle1" pos="-22,18" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="26,19" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-22,18" fixed="false" sensor="false">
<graphic clip="BikeWheel16" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="26,19" fixed="false" sensor="false">
<graphic clip="BikeWheel16" frame="2" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="8" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs16" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody16,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-22,18" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="26,19" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-22,18" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="26,19" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike17" description="Penguin" inlibrary="false">
<body name="axle1" pos="-21,17" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="15,14" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-21,17" fixed="false" sensor="false">
<graphic clip="BikeWheel17" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="15,14" fixed="false" sensor="false">
<graphic clip="BikeWheel17" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs17" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody17,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-21,17" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="15,14" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-21,17" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="15,14" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike18" description="Cowboy" inlibrary="false">
<body name="axle1" pos="-22,18" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="25,19" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-22,18" fixed="false" sensor="false">
<graphic clip="BikeWheel18" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="25,19" fixed="false" sensor="false">
<graphic clip="BikeWheel18" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs18" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody18,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-22,18" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="25,19" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-22,18" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="25,19" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike19" description="clown bike" inlibrary="false">
<body name="axle1" pos="-29,18" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="14,18" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-29,18" fixed="false" sensor="false">
<graphic clip="BikeWheel19" frame="1" pos="0,0" rot="0" zoffset="-3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="13" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="14,18" fixed="false" sensor="false">
<graphic clip="BikeWheel19" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="13" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs19" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody19,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-29,18" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="14,18" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-31,18" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="16,18" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
<physobj name="bike20" description="tron" inlibrary="false">
<body name="axle1" pos="-17,17" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="axle2" pos="12,18" fixed="false" sensor="false">
<shape type="poly" name="" col="0,0" vertices="-5,-5, 5,-5, 5,5, -5,5" density="0.3" friction="0.5" restitution="0"/>
</body>
<body name="wheel1" pos="-17,17" fixed="false" sensor="false">
<graphic clip="BikeWheel20" frame="1" pos="0,0" rot="0" zoffset="-3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="wheel2" pos="12,18" fixed="false" sensor="false">
<graphic clip="BikeWheel20" frame="1" pos="0,0" rot="0" zoffset="3" gameobjfunction="InitWheel"/>
<shape type="circle" pos="0,0" name="" col="1,3" radius="12" density="0.3" friction="0.2" restitution="0.5"/>
</body>
<body name="body" pos="0,0" fixed="false" sensor="false" angulardamping="10">
<graphic clip="BikeLegs20" frame="1" pos="0,0" rot="0" gameobjfunction="InitPlayer" gameobjvars="BikeBody20,-10,-20"/>
<shape type="poly" name="" col="1,2" vertices="-8,-20,0,-40,8,-20" density="0.3" friction="0.5" restitution="0"/>
<shape type="poly" name="" col="0,0" vertices="-20,0,20,0,20,10,-20,10" density="0.3" friction="0.5" restitution="0"/>
</body>
<joint type="prismatic" name="jointp1" body0="body" body1="axle1" pos="-17,17" axisangle="210" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="20" maxmotorforce="20"/>
<joint type="prismatic" name="jointp2" body0="body" body1="axle2" pos="12,18" axisangle="150" enablelimit="true" lowertranslation="-5" uppertranslation="0" enablemotor="true" motorspeed="40" maxmotorforce="40"/>
<joint type="rev" name="joint1" body0="axle1" body1="wheel1" pos="-17,17" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
<joint type="rev" name="joint2" body0="axle2" body1="wheel2" pos="12,18" enablelimit="false" lowerangle="0" upperangle="0" enablemotor="false" motorspeed="0" maxmotortorque="0"/>
</physobj>
</data>
;
static var cb:Function;
public static function SendLevelStatsToServer(){
var path:String;
var vars:URLVariables;
var request:URLRequest;
path = "http://www.longanimals.co.uk/AddBikeStat.php";
vars = new URLVariables();
vars.bikeID = Game.currentBikeIndex;
vars.courseID = Game.currentLevel;
vars.playerLevel0 = Player.GetLevel(0);
vars.playerLevel1 = Player.GetLevel(1);
vars.playerLevel2 = Player.GetLevel(2);
vars.playerLevel3 = Player.GetLevel(3);
vars.playerLevel4 = Player.GetLevel(4);
vars.levelStat0 = Game.levelAirTime;
vars.levelStat1 = Game.levelWheelieTime;
vars.levelStat2 = Game.levelFrontWheelieTime;
vars.levelStat3 = Game.levelBackSomersaults;
vars.levelStat4 = Game.levelForwardSomersaults;
vars.numcrashes = Game.numCrashes;
vars.time = Game.raceTimer;
vars.userID = 0;
request = new URLRequest(path);
request.method = URLRequestMethod.POST;
request.data = vars;
trace("Stats sent to server");
try {
sendToURL(request);
} catch(e:Error) {
trace(e.message);
};
}
public static function Load(_arg1:Function){
cb = _arg1;
XmlLoadedInternal();
}
public static function poo(_arg1:Event){
trace(loader.data.status);
}
public static function OutputString(_arg1:String){
System.setClipboard(_arg1);
}
static function XmlLoadedInternal(){
var _local1:int;
XML.ignoreWhitespace = true;
xml = new XML(xxx);
cb();
}
public static function xmlLoaded(_arg1:Event){
var _local2:int;
XML.ignoreWhitespace = true;
xml = new XML(_arg1.target.data);
cb();
}
}
}//package
Section 219
//FailedBonusLevelScreen (FailedBonusLevelScreen)
package {
import flash.display.*;
public dynamic class FailedBonusLevelScreen extends MovieClip {
public var buttonNext:SimpleButton;
}
}//package
Section 220
//Fills (Fills)
package {
import flash.display.*;
public dynamic class Fills extends MovieClip {
}
}//package
Section 221
//FinishedLastScreen (FinishedLastScreen)
package {
import flash.display.*;
public dynamic class FinishedLastScreen extends MovieClip {
public var buttonOK:SimpleButton;
}
}//package
Section 222
//FlameLine (FlameLine)
package {
import flash.display.*;
public dynamic class FlameLine extends MovieClip {
}
}//package
Section 223
//Font20 (Font20)
package {
import flash.text.*;
public dynamic class Font20 extends Font {
}
}//package
Section 224
//frontground1 (frontground1)
package {
import flash.display.*;
public dynamic class frontground1 extends MovieClip {
}
}//package
Section 225
//frontground2 (frontground2)
package {
import flash.display.*;
public dynamic class frontground2 extends MovieClip {
}
}//package
Section 226
//frontground3 (frontground3)
package {
import flash.display.*;
public dynamic class frontground3 extends MovieClip {
}
}//package
Section 227
//frontground4 (frontground4)
package {
import flash.display.*;
public dynamic class frontground4 extends MovieClip {
}
}//package
Section 228
//frontground5 (frontground5)
package {
import flash.display.*;
public dynamic class frontground5 extends MovieClip {
}
}//package
Section 229
//frontground6 (frontground6)
package {
import flash.display.*;
public dynamic class frontground6 extends MovieClip {
}
}//package
Section 230
//Furniture (Furniture)
package {
import flash.display.*;
public dynamic class Furniture extends MovieClip {
}
}//package
Section 231
//Game (Game)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import flash.media.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
import flash.ui.*;
import flash.system.*;
public class Game {
static const levelState_PostRace = 4;
static const levelFinishedState_WON = 1;
static const levelState_Play = 1;
static const colCategory_Background:int = 1;
static const colCategory_Pellet:int = 4;
static const levelFinishedState_NOT = 0;
static const levelState_Editor = 3;
static const levelFinishedState_LOST = 2;
static const colCategory_Ball:int = 2;
static const levelState_Null = 2;
static const levelState_LevelStart = 0;
public static var scrollCX:Number;
public static var scrollCY:Number;
static var startTimer:int;
static var playerRecording:Array;
public static var backWheelUpTimer:int = 0;
public static var coastSound:SoundChannel;
static var boostModifier_BackSomersault:Number = 0.08;
static var stuntAddedTimerMax:int;
static var bgFrame:int;
static var cheat0String:String = "CHEESE";
public static var numCrashes:int = 0;
public static var playerHitFloorTimerMax:int;
static var player_calculated_boostmul:Number;
public static var bikeWheelUpTimer:int;
public static var bellPlayingTimer:int;
static var currentStartPointIndex:int;
public static var currentWorldID:int = 0;
public static var maxFallSpeed;
static var helpTimer:int;
static var physObjs:PhysObjs;
static var numLevels:int;
static var numMessagesActive:int;
static var currentScore:int;
public static var playerRacePosition:int;
public static var frontWheelieTimer:int = 0;
static var pickupSoundIndex:int = 0;
public static var boostTimerMax:int;
public static var multiSomersaultCount:int;
static var PauseButton:SimpleButton;
public static var playerHitFloorMaxRot:Number;
public static var LevelUpdateCallback:Object;
static var canShootPellet:Boolean;
static var stuntAddedTimer:int;
static var switchFlag:int = 0;
public static var levelForwardSomersaults:int = 0;
static var scrollMaxVel:Number;
static var scrollToDX:Number = 0;
static var numBikes:int;
public static var oldPlayerRot:Number = 0;
static var scrollToDY:Number = 0;
static var version:String = "v 1.04";
static var shootHeldTime:int = 0;
public static var bikeWheelDownTimer:int;
static var helpScreenID:int;
public static var polygonList:Array;
static var numCreds:int;
public static var timesList:Array;
static var sitelocked:Boolean = false;
static var cheatMode:int;
static var numLives:int;
static var startMode:int;
public static var playerHitFloorTimer:int;
static var usedebug:Boolean = false;
static var w2p:Number = (1 / p2w);
static var somersaultText:Array = new Array("", "Double ", "Triple ", "Quadruple ", "Quintuple ", "Multi ");
public static var highestMultiSomersault:int;
static var shakeCamDX:Number = 0;
static var shakeCamDY:Number = 0;
public static var playerRaceFinishCash:int;
public static var boostTimer:int;
public static var highestBoostLevel:int;
static var levels:Array;
public static var backWheelDown:Boolean;
static var previousStaticPoints:Array;
static var currentLevel:int;
public static var totalPickups:int;
static var shakeCamToX:Number = 0;
static var shakeCamToY:Number = 0;
public static var playerX:Number = 0;
public static var playerY:Number = 0;
public static var boostLevel:Number;
static var levelStateCount:int;
static var scrollVel:Number;
public static var failedChase:Boolean;
static var main:Main;
static var mousetimer:int = 0;
static var multiplier:int;
public static var boostMultiplier:int;
static var numRacesCompleted;
static var lastGeneratedGameObj:GameObj;
static var helpOverlay:MovieClip = null;
public static var squeakSound:SoundChannel;
static var shakeCamTimer:int = 50;
static var goPlayer:GameObj;
static var chase_caught:Boolean;
static var shakeCamTimerMax:int = 50;
static var cheat3String:String = "HADDOCK";
static var pause:Boolean;
public static var playerRotMode:int;
static var oldRecordPosX:Number;
static var oldRecordPosY:Number;
public static var playerRotLeaveGround:Number;
static var panelRect:Rectangle = new Rectangle(200, 10, 200, 10);
static var cheatUnlocked0:Boolean;
static var levelFinishedState:int;
static var cheatUnlocked2:Boolean;
static var cheatUnlocked3:Boolean;
static var levelTimer:int;
static var player_acc:Number = 400;
static var cheatUnlocked1:Boolean;
static var boostModifier_RearWheelie:Number = 0.08;
public static var playerHitFloor:Boolean;
public static var bestSingleAirTime:int = 0;
public static var gravity;
static var startTimerMax:int;
static var shootMode:int = 0;
public static var bestRearWheelieTime:int;
public static var frontWheelUpTimer:int = 0;
static var messageSlots:Array;
public static var frontWheelDown:Boolean;
static var scrollAcc:Number;
static var scrollScale:Number = 1;
static var shakeCamY:Number = 0;
public static var scrollXa:Number;
public static var levelBackSomersaults:int = 0;
static var currentProjectileType:int = 0;
static var shakeCamX:Number = 0;
static var boost_minAirTime:Number = 40;
static var cheat2String:String = "ELVIS";
public static var scrollYa:Number;
static var helpIsAvailable:Boolean;
static var player_maxvel:Number = 30;
static var physGravity:Number = (500 * w2p);
public static var levelFrontWheelieTime:int = 0;
static var mouseJoint:b2MouseJoint = null;
static var pickupSounds:Array = new Array(3, 3, 4, 5, 5, 4, 3, 2, 1, 1, 2, 3, 3, 2, 2, 3, 3, 4, 5, 5, 4, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 2, 3, 1, 2, 3, 4, 3, 1, 2, 3, 4, 3, 2, 1, 2, 0, 3, 3, 3, 4, 5, 5, 4, 3, 2, 1, 1, 2, 3, 2, 1, 1);
static var pauseGameplayInput:Boolean;
static var raceTimer:int;
static var p2w:Number = 20;
public static var levelWheelieTime:int = 0;
static var player_calculated_brake:Number;
public static var levelAirTime:int = 0;
public static var scrollH:Number;
public static var achievements:Achievements;
static var panelRect1:Rectangle = new Rectangle(200, 3, 200, 5);
public static var scrollW:Number;
public static var scrollX:Number;
public static var scrollY:Number;
static var soundon:Boolean = true;
static var cash:int;
public static var playerRot:Number = 0;
public static var numPickupsCollected:int;
static var player_calculated_angvel:Number;
public static var numCollisionTests:int;
static var gotSneakyStart:Boolean;
static var physNumIterations:int = 20;
static var levelState:int;
static var cheat1String:String = "GERBIL";
static var numWeapons:int = 5;
static var boostModifier_AirTime:Number = 0.08;
static var player_calculated_maxvel:Number;
static var physObjInstances:PhysObj_Instances;
static var level_instances:Array;
public static var playerRotCount:int;
static var boost_minWheelieTime:Number = 20;
static var boostModifier_ForwardSomersault:Number = 0.12;
public static var world:b2World;
static var playerRecordingFlag:int = 0;
static var player_calculated_acc:Number;
static var zsortoffset:Number = 0;
static var numFirstPlaces;
public static var bikeWheelDown:Boolean;
public static var maxBoostMultiplier:int = 5;
static var cursorY:Number = 0;
static var groundBody:b2Body;
public static var wheelieTimer:int = 0;
static var levelStateTimer:int;
static var currentGameMusic:int;
public static var jumptimer:int;
static var scrollMaxX;
static var cursorX:Number = 0;
static var startPoints:Array;
public static var boostMode:int;
static var scrollMaxY;
static var boostModifier_FrontWheelie:Number = 0.12;
static var currentBikeIndex:int = 0;
public static function RemoveObj_Standard(_arg1:PhysObj_Instance){
physObjInstances.Remove(_arg1);
}
public static function RemoveObj_BallInHopper(_arg1:PhysObj_Instance){
physObjInstances.Remove(_arg1);
}
public static function ApplyImpulseToObjectsFromPoint(_arg1:b2Body, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local6:b2Body;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
_local6 = world.GetBodyList();
while (_local6) {
if (_local6 != _arg1){
_local7 = new b2Vec2((_local6.GetWorldCenter().x - _arg2), (_local6.GetWorldCenter().y - _arg3));
_local8 = _local7.Length();
if (_local8 <= _arg5){
_local7.Normalize();
_local9 = Utils.ScaleTo(0, _arg4, 0, _arg5, (_arg5 - _local8));
_local7.Multiply(_local9);
_local6.ApplyImpulse(_local7, _local6.GetWorldCenter());
};
};
_local6 = _local6.GetNext();
};
}
static function AddPhysObjAt(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String=""):PhysObj_Instance{
var _local6:PhysObj;
var _local7:PhysObj_Instance;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2BodyDef;
var _local12:b2Body;
var _local13:b2PolygonDef;
var _local14:b2CircleDef;
var _local15:int;
var _local16:b2Joint;
var _local17:Matrix;
var _local18:PhysObj_Body;
var _local19:PhysObj_Joint;
var _local20:Number;
var _local21:Number;
var _local22:Point;
var _local23:PhysObj_BodyUserData;
var _local24:PhysObj_Shape;
var _local25:PhysObj_Graphic;
var _local26:b2FilterData;
var _local27:Point;
var _local28:Number;
var _local29:Number;
var _local30:Point;
var _local31:int;
var _local32:int;
var _local33:b2Body;
var _local34:b2Body;
var _local35:b2RevoluteJointDef;
var _local36:b2PrismaticJointDef;
var _local37:Number;
var _local38:b2Vec2;
var _local39:b2DistanceJointDef;
var _local40:Number;
var _local41:Number;
var _local42:b2MouseJointDef;
_local6 = physObjs.FindByName(_arg1);
_local7 = new PhysObj_Instance();
_local7.typeName = _arg1;
_local7.x = _arg2;
_local7.y = _arg3;
_local7.rot = _arg4;
_local7.bodies = new Array();
_local7.instanceName = _arg5;
_local7.hitballsound = _local6.hitballsound;
physObjInstances.list.push(_local7);
_local7.Init();
_local8 = Utils.DegToRad(_arg4);
_arg2 = (_arg2 * w2p);
_arg3 = (_arg3 * w2p);
_local17 = new Matrix();
_local17.rotate(_local8);
for each (_local18 in _local6.bodies) {
_local11 = new b2BodyDef();
_local20 = (_local18.pos.x * w2p);
_local21 = (_local18.pos.y * w2p);
_local22 = new Point(_local20, _local21);
_local22 = _local17.transformPoint(_local22);
_local20 = _local22.x;
_local21 = _local22.y;
_local11.position.Set((_arg2 + _local20), (_arg3 + _local21));
_local11.angularDamping = _local18.angularDamping;
_local11.linearDamping = _local18.linearDamping;
_local11.angle = _local8;
_local12 = world.CreateBody(_local11);
_local23 = new PhysObj_BodyUserData();
_local23.type = _arg1;
_local23.bodyName = _local18.name;
_local23.instance = _local7;
_local12.SetUserData(_local23);
if (_local18.graphics.length != 0){
_local25 = _local18.graphics[0];
_local23.gameObjectID = InitPhysicsGO(_arg2, _arg3, _local25, _local25.graphicID, _local25.frame, 1000);
};
for each (_local24 in _local18.shapes) {
_local26 = new b2FilterData();
_local26.categoryBits = _local24.collisionCategory;
_local26.maskBits = _local24.collisionMask;
if (_local24.type == PhysObj_Shape.Type_Poly){
_local13 = new b2PolygonDef();
_local13.vertexCount = _local24.poly_points.length;
_local13.filter = _local26;
_local13.isSensor = _local18.sensor;
_local15 = 0;
while (_local15 < _local24.poly_points.length) {
_local27 = _local24.poly_points[_local15].clone();
_local28 = (_local27.x * w2p);
_local29 = (_local27.y * w2p);
if (_local18.fixed){
_local30 = AlignWithPreviousVerts(_local28, _local29, _arg2, _arg3, _local8);
if (_local30 != null){
_local28 = (_local28 + _local30.x);
_local29 = (_local29 + _local30.y);
};
};
_local13.vertices[_local15].Set(_local28, _local29);
_local15++;
};
_local13.friction = _local24.friction;
_local13.restitution = _local24.restitution;
_local13.density = _local24.density;
_local12.CreateShape(_local13);
} else {
if (_local24.type == PhysObj_Shape.Type_Circle){
_local14 = new b2CircleDef();
_local14.radius = (_local24.circle_radius * w2p);
_local14.filter = _local26;
_local14.isSensor = _local18.sensor;
_local14.localPosition.x = _local24.circle_pos.x;
_local14.localPosition.y = _local24.circle_pos.y;
_local14.friction = _local24.friction;
_local14.restitution = _local24.restitution;
_local14.density = _local24.density;
_local12.CreateShape(_local14);
};
};
};
if (_local18.fixed){
_local12.PutToSleep();
_local12.SetMass(new b2MassData());
} else {
_local12.SetMassFromShapes();
_local12.SetBullet(true);
};
_local7.bodies.push(_local12);
};
for each (_local19 in _local6.joints) {
_local31 = _local6.BodyIndexFromName(_local19.obj0Name);
_local32 = _local6.BodyIndexFromName(_local19.obj1Name);
_local33 = _local7.bodies[_local31];
_local34 = _local7.bodies[_local32];
if (_local19.type == PhysObj_Joint.Type_Rev){
_local35 = new b2RevoluteJointDef();
_local9 = (_local19.rev_pos.x * w2p);
_local10 = (_local19.rev_pos.y * w2p);
_local22 = new Point(_local9, _local10);
_local22 = _local17.transformPoint(_local22);
_local9 = _local22.x;
_local10 = _local22.y;
_local35.Initialize(_local33, _local34, new b2Vec2((_arg2 + _local9), (_arg3 + _local10)));
_local35.enableLimit = _local19.rev_enableLimit;
_local35.lowerAngle = _local19.rev_lowerAngle;
_local35.upperAngle = _local19.rev_upperAngle;
_local35.enableMotor = _local19.rev_enableMotor;
_local35.motorSpeed = _local19.rev_motorSpeed;
_local35.maxMotorTorque = _local19.rev_maxMotorTorque;
_local35.collideConnected = false;
_local16 = world.CreateJoint(_local35);
};
if (_local19.type == PhysObj_Joint.Type_Prismatic){
_local36 = new b2PrismaticJointDef();
_local9 = (_local19.prism_pos.x * w2p);
_local10 = (_local19.prism_pos.y * w2p);
_local22 = new Point(_local9, _local10);
_local22 = _local17.transformPoint(_local22);
_local9 = _local22.x;
_local10 = _local22.y;
_local37 = Utils.DegToRad(_local19.prism_axisangle);
_local37 = (_local37 + _local8);
_local38 = new b2Vec2(Math.cos(_local37), Math.sin(_local37));
_local36.Initialize(_local33, _local34, new b2Vec2((_arg2 + _local9), (_arg3 + _local10)), _local38);
_local36.enableLimit = _local19.prism_enableLimit;
_local36.lowerTranslation = (_local19.prism_lowerTranslation * w2p);
_local36.upperTranslation = (_local19.prism_upperTranslation * w2p);
_local36.enableMotor = _local19.prism_enableMotor;
_local36.motorSpeed = _local19.prism_motorSpeed;
_local36.maxMotorForce = _local19.prism_maxMotorForce;
_local36.collideConnected = false;
_local16 = world.CreateJoint(_local36);
};
if (_local19.type == PhysObj_Joint.Type_Distance){
_local39 = new b2DistanceJointDef();
_local9 = (_local19.dist_pos0.x * w2p);
_local10 = (_local19.dist_pos0.y * w2p);
_local40 = (_local19.dist_pos1.x * w2p);
_local41 = (_local19.dist_pos1.y * w2p);
_local22 = new Point(_local9, _local10);
_local22 = _local17.transformPoint(_local22);
_local9 = _local22.x;
_local10 = _local22.y;
_local22 = new Point(_local40, _local41);
_local22 = _local17.transformPoint(_local22);
_local40 = _local22.x;
_local41 = _local22.y;
_local39.Initialize(_local33, _local34, new b2Vec2((_arg2 + _local9), (_arg3 + _local10)), new b2Vec2((_arg2 + _local40), (_arg3 + _local41)));
_local39.length = (_local39.length + (_local19.dist_distance * w2p));
_local39.dampingRatio = 0.1;
_local39.collideConnected = false;
_local16 = world.CreateJoint(_local39);
};
if (_local19.type == PhysObj_Joint.Type_Mouse){
_local42 = new b2MouseJointDef();
_local42.target.Set(_local33.GetPosition().x, _local33.GetPosition().y);
_local42.body1 = world.GetGroundBody();
_local42.body2 = _local33;
_local42.maxForce = (30000 * _local33.GetMass());
_local42.dampingRatio = 0.7;
_local42.frequencyHz = 10;
_local42.timeStep = (1 / 60);
_local16 = world.CreateJoint(_local42);
mouseJoint = (_local16 as b2MouseJoint);
};
_local7.joints.push(_local16);
};
return (_local7);
}
static function GetInitialStartPoint():Point{
var _local1:Point;
var _local2:Point;
var _local3:Number;
_local1 = null;
_local3 = 999999;
for each (_local2 in startPoints) {
if (_local2.x < _local3){
_local3 = _local2.x;
_local1 = _local2;
};
};
return (_local1);
}
public static function InitHelp_nextButtonPressed(_arg1:MouseEvent){
helpScreenID++;
if (helpScreenID < 7){
helpOverlay.gotoAndStop((helpScreenID + 1));
} else {
helpIsAvailable = false;
helpOverlay.removeEventListener(Event.ENTER_FRAME, UpdateHelpOverlay);
Game.main.removeChild(helpOverlay);
helpOverlay = null;
pause = false;
KeyReader.InitOnce(main.stage);
};
}
public static function SubmitAllKongStats(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
Kong.SubmitStat(achievements.CountAchievementsComplete(), "NumAchievementsComplete");
_local1 = PlayerBikes.GetNumBikesUnlocked();
_local2 = GetNumLevelsUnlocked();
_local3 = PlayerBikes.GetNumHornsUnlocked();
_local4 = ((((Player.GetLevel(0) + Player.GetLevel(1)) + Player.GetLevel(2)) + Player.GetLevel(3)) + Player.GetLevel(4));
Kong.SubmitStat(_local1, "NumCharactersUnlocked");
Kong.SubmitStat(_local2, "NumLevelsUnlocked");
Kong.SubmitStat(_local3, "NumHornsUnlocked");
Kong.SubmitStat(numFirstPlaces, "NumFirstPlaces");
Kong.SubmitStat(numRacesCompleted, "NumRacesCompleted");
Kong.SubmitStat(_local4, "NumUpgrades");
}
public static function InitLevel(){
InitLevel1();
}
public static function StartLevelPlay2():void{
var _local1:Level;
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:GameObj;
var _local6:int;
var _local7:int;
var _local8:*;
var _local9:int;
var _local10:*;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:*;
KeyReader.InitOnce(main.stage);
totalPickups = 0;
MusicPlayer.StopMusic();
if (int((currentLevel % 5)) == 4){
MusicPlayer.StartStream(6);
} else {
MusicPlayer.StartStream(currentGameMusic);
};
currentGameMusic++;
if (currentGameMusic > 2){
currentGameMusic = 0;
};
main.InitStageForGame();
main.addChild(PauseButton);
PauseButton.x = (Defs.displayarea_w - 128);
PauseButton.y = 438;
_local1 = GetCurrentLevel();
_local1.played = true;
startPoints = new Array();
Particles.Reset();
InitBox2D();
previousStaticPoints = new Array();
mouseJoint = null;
GameObjects.ClearAll();
physObjInstances = new PhysObj_Instances();
InitLevelPlayFromEditorObjects();
InitLevelState(levelState_LevelStart);
_local2 = 100;
_local3 = 100;
if (startPoints.length != 0){
_local2 = GetInitialStartPoint().x;
_local3 = GetInitialStartPoint().y;
};
_local4 = ("bike" + int((currentBikeIndex + 1)).toString());
AddPhysObjAt(_local4, _local2, (_local3 - 50), 0, "player");
InitFloor();
bgFrame = 0;
pause = false;
pauseGameplayInput = false;
if (_local1.eventType == "chase"){
_local7 = int(_local1.eventOpponentsString);
trace(((("Chase " + _local1.eventOpponentsString) + " ") + _local7));
_local5 = GameObjects.AddObj(0, 0, 1000);
_local5.InitAIPlayer(0, 0, _local7, true);
} else {
if (_local1.eventType == "race"){
_local8 = new Array();
_local6 = 1;
while (_local6 <= 20) {
_local8.push(_local6);
_local6++;
};
_local9 = PlayerRecordings.GetNumRoutes(currentLevel);
_local10 = new Array();
_local6 = 0;
while (_local6 < 20) {
_local14 = (_local6 % _local9);
_local10.push(_local14);
_local6++;
};
Utils.RandomizeArray(_local8);
Utils.RandomizeArray(_local10);
_local11 = 9;
if (currentLevel == 25){
_local11 = 19;
};
_local12 = 0;
_local13 = 0;
do {
_local7 = _local8[_local13];
_local15 = _local10[_local13];
if ((_local7 - 1) != currentBikeIndex){
_local5 = GameObjects.AddObj(0, 0, 1000);
_local5.InitAIPlayer(_local15, _local12, _local7);
_local12++;
};
_local13++;
} while (_local12 < _local11);
};
};
playerHitFloor = false;
playerHitFloorTimer = 0;
bikeWheelDown = false;
ResetBoost();
levelAirTime = 0;
levelWheelieTime = 0;
levelFrontWheelieTime = 0;
levelBackSomersaults = 0;
levelForwardSomersaults = 0;
bestSingleAirTime = 0;
bestRearWheelieTime = 0;
multiSomersaultCount = 0;
highestMultiSomersault = 0;
highestBoostLevel = 0;
numCrashes = 0;
playerRacePosition = 0;
bellPlayingTimer = 0;
stuntAddedTimer = 0;
stuntAddedTimerMax = 0;
startTimer = 0;
startMode = 0;
chase_caught = false;
failedChase = false;
numMessagesActive = 0;
messageSlots = new Array();
_local6 = 0;
while (_local6 < 10) {
messageSlots.push(false);
_local6++;
};
jumptimer = 0;
QuietLoops();
numPickupsCollected = 0;
pickupSoundIndex = 0;
helpTimer = 20;
gotSneakyStart = false;
}
static function UpdateBoost(){
if (boostMode == 1){
boostTimer--;
if (boostTimer <= 0){
BoostFinished();
};
};
}
public static function InitHelp_buttonNoMoreHelpPressed(_arg1:MouseEvent){
helpIsAvailable = false;
Game.main.removeChild(helpOverlay);
helpOverlay = null;
pause = false;
KeyReader.InitOnce(main.stage);
}
static function UpdateControl(){
var _local1:PlayerBikeData;
var _local2:Boolean;
var _local3:Boolean;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:PhysObj_Instance;
var _local26:b2Vec2;
var _local27:Number;
var _local28:int;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Point;
var _local34:Point;
var _local35:Matrix;
var _local36:Point;
var _local37:Number;
var _local38:Number;
_local1 = PlayerBikes.GetBikeData(currentBikeIndex);
_local2 = false;
_local3 = false;
_local4 = false;
_local5 = false;
_local6 = false;
_local7 = false;
if (KeyReader.Down(KeyReader.KEY_LEFT)){
_local6 = true;
};
if (KeyReader.Down(KeyReader.KEY_RIGHT)){
_local7 = true;
};
if (KeyReader.Down(KeyReader.KEY_UP)){
_local2 = true;
};
if (KeyReader.Down(KeyReader.KEY_DOWN)){
_local3 = true;
};
if (KeyReader.Down(KeyReader.KEY_A)){
_local6 = true;
};
if (KeyReader.Down(KeyReader.KEY_D)){
_local7 = true;
};
if (KeyReader.Down(KeyReader.KEY_W)){
_local2 = true;
};
if (KeyReader.Down(KeyReader.KEY_S)){
_local3 = true;
};
if (KeyReader.Pressed(KeyReader.KEY_X)){
_local5 = true;
};
if (usedebug == false){
if (KeyReader.Pressed(KeyReader.KEY_SPACE)){
_local5 = true;
};
};
if (KeyReader.Pressed(KeyReader.KEY_B)){
_local4 = true;
};
if (levelState == levelState_LevelStart){
if ((((startMode == 0)) && (_local2))){
if ((((levelStateCount == 2)) && ((levelStateTimer < (Defs.fps * 0.33))))){
startMode = 1;
startTimer = (startTimerMax = 20);
} else {
startMode = 2;
};
};
SoundPlayer.SetVolume(coastSound, 0);
SoundPlayer.SetVolume(squeakSound, 0);
return;
};
if (KeyReader.Down(KeyReader.KEY_NUM_1)){
player_maxvel = (player_maxvel - 0.1);
};
if (KeyReader.Down(KeyReader.KEY_NUM_2)){
player_maxvel = (player_maxvel + 0.1);
};
if (KeyReader.Down(KeyReader.KEY_NUM_4)){
player_acc = (player_acc - 1);
};
if (KeyReader.Down(KeyReader.KEY_NUM_5)){
player_acc = (player_acc + 1);
};
if (bellPlayingTimer > 0){
bellPlayingTimer--;
} else {
if (((_local4) && (_local1.bellAvailable))){
_local28 = SoundPlayer.GetId("bellplayer01");
if (_local28 != -1){
bellPlayingTimer = 20;
SoundPlayer.PlayById((_local28 + currentBikeIndex));
};
};
};
if (playerRecordingFlag == 1){
if (((((((((_local5) || (_local7))) || (_local2))) || (_local3))) || (_local5))){
playerRecordingFlag = 2;
};
};
_local8 = (player_acc * w2p);
_local9 = (player_acc * w2p);
_local10 = (80 * w2p);
_local11 = 60;
_local12 = 1;
_local13 = player_maxvel;
player_calculated_acc = player_acc;
player_calculated_maxvel = player_maxvel;
_local14 = 250;
_local15 = 300;
_local16 = 30.5;
_local17 = 33;
_local18 = 250;
_local19 = 300;
_local20 = 50;
_local21 = 60;
_local22 = 1.2;
_local23 = 1.4;
if (playerRecordingFlag != 2){
player_calculated_angvel = Utils.ScaleTo(_local20, _local21, 0, 10, Player.GetLevel(Player.upg_spin));
_local11 = player_calculated_angvel;
player_calculated_brake = Utils.ScaleTo(_local18, _local19, 0, 10, Player.GetLevel(Player.upg_brake));
_local9 = (player_calculated_brake * w2p);
player_calculated_acc = Utils.ScaleTo(_local14, _local15, 0, 10, Player.GetLevel(Player.upg_accel));
_local8 = (player_calculated_acc * w2p);
_local13 = Utils.ScaleTo(_local16, _local17, 0, 10, Player.GetLevel(Player.upg_speed));
player_calculated_maxvel = _local13;
};
_local24 = Utils.ScaleTo(_local22, _local23, 0, 10, Player.GetLevel(Player.upg_boost));
player_calculated_boostmul = _local24;
if (boostMode == 1){
_local29 = (boostMultiplier * 0.01);
_local30 = (_local24 + _local29);
_local8 = (_local8 * _local30);
_local10 = (_local10 * _local30);
_local13 = (_local13 * _local30);
};
if (startMode == 1){
startTimer--;
if (startTimer == 0){
startMode = 0;
} else {
_local31 = Utils.ScaleTo(1, 1.3, 0, startTimerMax, (startTimerMax - startTimer));
_local8 = (_local8 * _local31);
_local10 = (_local10 * _local31);
};
};
_local25 = GetPhysObjInstanceByName("player");
_local25.WakeUp();
if (jumptimer > 0){
jumptimer--;
};
if (bikeWheelDown){
_local32 = _local25.GetBodyAngle(4);
_local33 = new Point(_local8, 0);
_local34 = new Point(_local9, 0);
_local35 = new Matrix();
_local35.rotate(_local32);
_local33 = _local35.transformPoint(_local33);
_local34 = _local35.transformPoint(_local34);
if (_local2){
_local25.ApplyForce(_local33.x, _local33.y);
_local25.LimitLinearVelocity(_local13);
};
if (_local3){
_local25.ApplyForce(-(_local34.x), -(_local34.y));
_local25.LimitLinearVelocity(_local13);
};
if (_local5){
if (jumptimer == 0){
SoundPlayer.Play("bunnyhop");
jumptimer = 10;
_local36 = new Point(0, -(_local10));
_local35.identity();
_local35.rotate(_local32);
_local36 = _local35.transformPoint(_local36);
_local25.ApplyImpulse(_local36.x, _local36.y);
};
};
};
if (_local6){
_local25.ApplyAngularVelocity(4, -(_local11));
_local25.LimitAngularVelocity(4, 10);
};
if (_local7){
_local25.ApplyAngularVelocity(4, _local11);
_local25.LimitAngularVelocity(4, 10);
};
_local25.LimitLinearVelocity(_local13);
_local26 = _local25.GetBodyLinearVelocity(0);
_local27 = Utils.LimitNumber(0, _local13, _local26.Length());
if (((_local3) || (_local2))){
SoundPlayer.SetVolume(coastSound, 0);
_local37 = Utils.ScaleTo(0, 0.5, 0, _local13, _local27);
SoundPlayer.SetVolume(squeakSound, _local37);
} else {
_local38 = 0;
if (_local26.Length() > 1){
_local38 = Utils.ScaleTo(0, 1, 0, _local13, _local27);
};
SoundPlayer.SetVolume(coastSound, _local38);
SoundPlayer.SetVolume(squeakSound, 0);
};
}
static function UpdatePlayerRot(){
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local7:String;
var _local8:Number;
_local1 = (Math.PI * 2);
_local2 = Math.PI;
_local3 = playerRotCount;
_local4 = (oldPlayerRot % _local1);
_local5 = (playerRot % _local1);
if (_local4 < 0){
_local4 = (_local1 + _local4);
};
if (_local5 < 0){
_local5 = (_local1 + _local5);
};
if (Math.abs((_local5 - _local2)) < 0.5){
if (playerRotMode == 0){
if ((((_local4 < _local2)) && ((_local5 >= _local2)))){
trace("Rotated CW first time");
playerRotMode = 1;
playerRotLeaveGround = (playerRot + _local2);
playerRotCount++;
multiSomersaultCount = 0;
} else {
if ((((_local4 > _local2)) && ((_local5 <= _local2)))){
trace("Rotated CCW first time");
playerRotMode = -1;
playerRotLeaveGround = (playerRot - _local2);
playerRotCount++;
multiSomersaultCount = 0;
};
};
} else {
if (playerRotMode == 1){
if ((((_local4 < _local2)) && ((_local5 >= _local2)))){
if (playerRot > playerRotLeaveGround){
trace("Rotated CW");
playerRotLeaveGround = (playerRot + _local2);
playerRotCount++;
};
};
} else {
if (playerRotMode == -1){
if ((((_local4 > _local2)) && ((_local5 <= _local2)))){
if (playerRot < playerRotLeaveGround){
trace("Rotated CCW");
playerRotLeaveGround = (playerRot - _local2);
playerRotCount++;
};
};
};
};
};
};
if (_local3 != playerRotCount){
_local6 = multiSomersaultCount;
if (_local6 >= somersaultText.length){
_local6 = (somersaultText.length - 1);
};
_local7 = somersaultText[_local6];
if (playerRotMode == 1){
levelForwardSomersaults++;
_local8 = AddToBoost((playerRotCount * boostModifier_ForwardSomersault));
InitMessage((_local7 + "Forward Somersault"));
};
if (playerRotMode == -1){
levelBackSomersaults++;
_local8 = AddToBoost((playerRotCount * boostModifier_BackSomersault));
InitMessage((_local7 + "Back Somersault"));
};
multiSomersaultCount++;
if (multiSomersaultCount > highestMultiSomersault){
highestMultiSomersault = multiSomersaultCount;
};
};
}
static function CreatePhysObjInstanceAt(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String=""):PhysObj_Instance{
var _local6:PhysObj_Instance;
_local6 = new PhysObj_Instance();
_local6.typeName = _arg1;
_local6.x = _arg2;
_local6.y = _arg3;
_local6.rot = _arg4;
_local6.bodies = new Array();
_local6.instanceName = _arg5;
return (_local6);
}
static function InitBoost(){
boostMode = 1;
boostTimer = (Defs.fps * 10);
boostTimerMax = boostTimer;
}
static function UpdatePlayerPosition(){
var _local1:GameObj;
var _local2:GameObj;
_local1 = null;
playerRacePosition = 0;
for each (_local2 in GameObjects.objs) {
if (((_local2.active) && (_local2.colFlag_isPlayer))){
_local1 = _local2;
break;
};
};
for each (_local2 in GameObjects.objs) {
if (((_local2.active) && (_local2.colFlag_isEnemy))){
if (_local2.xpos > _local1.xpos){
playerRacePosition++;
};
};
};
}
static function UpdateMouseControl(){
var _local1:Number;
var _local2:Number;
_local1 = cursorX;
_local2 = cursorY;
cursorX = (cursorX + ((MouseControl.mousePosX - cursorX) * 0.4));
cursorY = (cursorY + ((MouseControl.mousePosY - cursorY) * 0.4));
}
public static function LevelsCheat(){
var _local1:Level;
for each (_local1 in levels) {
_local1.available = true;
};
}
static function UpdateChase(){
var _local1:GameObj;
var _local2:GameObj;
chase_caught = false;
_local1 = null;
for each (_local2 in GameObjects.objs) {
if (((_local2.active) && (_local2.colFlag_isPlayer))){
_local1 = _local2;
break;
};
};
for each (_local2 in GameObjects.objs) {
if (((_local2.active) && (_local2.colFlag_isEnemy))){
if (_local2.xpos > (_local1.xpos + 20)){
chase_caught = true;
failedChase = true;
return;
};
};
};
}
static function InitHelp(){
helpScreenID = 0;
pause = true;
helpOverlay = new PlayerControls();
helpOverlay.buttonNext.addEventListener(MouseEvent.CLICK, InitHelp_nextButtonPressed, false, 0, true);
helpOverlay.buttonNoMoreHelp.addEventListener(MouseEvent.CLICK, InitHelp_buttonNoMoreHelpPressed, false, 0, true);
helpOverlay.gotoAndStop((helpScreenID + 1));
helpOverlay.addEventListener(Event.ENTER_FRAME, UpdateHelpOverlay, false, 0, true);
main.addChild(helpOverlay);
}
static function UpdatePhysObjs():void{
var _local1:PhysObj_Instance;
for each (_local1 in physObjInstances.list) {
_local1.Update();
};
}
public static function BackWheelIsDown():void{
backWheelDown = true;
}
static function InitObjectAtMouse():void{
var _local1:Point;
var _local2:Matrix;
var _local3:Number;
var _local4:Number;
var _local5:Array;
var _local6:int;
var _local7:PhysObj_Instance;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:PhysObj_Instance;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:b2Body;
var _local17:b2Shape;
_local1 = new Point(MouseControl.mousePosX, MouseControl.mousePosY);
_local2 = new Matrix();
_local2.translate(scrollX, scrollY);
_local2.translate(-(scrollCX), -(scrollCY));
_local2.scale((1 / scrollScale), (1 / scrollScale));
_local2.translate(scrollCX, scrollCY);
_local1 = _local2.transformPoint(_local1);
_local3 = _local1.x;
_local4 = _local1.y;
_local5 = new Array();
_local5.push("cannonball0");
_local5.push("cannonball1");
_local5.push("cannonball2");
_local5.push("cannonball3");
_local5.push("cannonball4");
_local5.push("cannonball0");
_local5.push("cannonball1");
_local5.push("cannonball2");
_local5.push("cannonball3");
_local5.push("cannonball4");
if (mousetimer > 0){
return;
};
canShootPellet = true;
mousetimer = 10;
_local6 = _local10;
zsortoffset = 0;
_local7 = GetPhysObjInstanceByName("player");
_local8 = _local7.GetBodyWorldPos(0);
_local9 = (_local8.x * p2w);
_local10 = (_local8.y * p2w);
_local11 = Utils.RandCircle();
_local12 = AddPhysObjAt(_local5[currentProjectileType], _local9, _local10, Utils.RadToDeg(_local11), "");
_local13 = Utils.ScaleTo(50, 100, 0, 100, shootHeldTime);
_local11 = Math.atan2((_local4 - _local10), (_local3 - _local9));
_local14 = (Math.cos(_local11) * _local13);
_local15 = (Math.sin(_local11) * _local13);
_local12.SetLinearVelocity(_local14, _local15);
for each (_local16 in _local12.bodies) {
_local16.SetBullet(true);
_local17 = _local16.GetShapeList();
_local17.SetUserData(_local12);
};
}
static function QuietLoops(){
SoundPlayer.SetVolume(squeakSound, 0);
SoundPlayer.SetVolume(coastSound, 0);
}
static function InitMessage(_arg1:String, _arg2:Number=0){
var _local3:int;
var _local4:GameObj;
_local3 = 0;
while (_local3 < messageSlots.length) {
if (messageSlots[_local3] == false){
messageSlots[_local3] = true;
_local4 = GameObjects.AddObj(0, 0, 100);
_local4.InitTextMessage(_arg1, _local3);
return;
};
_local3++;
};
}
static function InitFloor(){
var _local1:b2BodyDef;
var _local2:b2Body;
var _local3:b2PolygonDef;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:Point;
var _local9:int;
var _local10:PhysObj_BodyUserData;
var _local11:Number;
var _local12:Level;
var _local13:b2FilterData;
var _local14:int;
var _local15:Array;
var _local16:int;
_local10 = new PhysObj_BodyUserData();
_local11 = 50;
_local12 = GetCurrentLevel();
_local13 = new b2FilterData();
_local13.categoryBits = 2;
_local13.maskBits = 7;
_local14 = 0;
for each (_local15 in _local12.lines) {
_local16 = _local12.linetypes[_local14];
_local14++;
if (_local15.length >= 2){
if (_local16 == 0){
_local9 = 0;
while (_local9 < (_local15.length - 1)) {
_local5 = _local15[_local9].clone();
_local6 = _local15[(_local9 + 1)].clone();
_local7 = _local6.clone();
_local6.clone().y = (_local7.y + _local11);
_local8 = _local5.clone();
_local5.clone().y = (_local8.y + _local11);
_local1 = new b2BodyDef();
_local1.position.Set(0, 0);
_local2 = world.CreateBody(_local1);
if (_local2 != null){
_local3 = new b2PolygonDef();
_local3.filter = _local13;
_local3.vertexCount = 4;
_local3.vertices[0].Set((_local5.x * w2p), (_local5.y * w2p));
_local3.vertices[1].Set((_local6.x * w2p), (_local6.y * w2p));
_local3.vertices[2].Set((_local7.x * w2p), (_local7.y * w2p));
_local3.vertices[3].Set((_local8.x * w2p), (_local8.y * w2p));
_local3.friction = 0.5;
_local3.restitution = 0.2;
_local3.density = 1;
_local2.CreateShape(_local3);
_local2.SetUserData(_local10);
};
_local9++;
};
};
if (_local16 == 1){
_local9 = 0;
while (_local9 < (_local15.length - 1)) {
_local5 = _local15[_local9].clone();
_local6 = _local15[(_local9 + 1)].clone();
_local7 = _local6.clone();
_local6.clone().y = (_local7.y - _local11);
_local8 = _local5.clone();
_local5.clone().y = (_local8.y - _local11);
_local1 = new b2BodyDef();
_local1.position.Set(0, 0);
_local2 = world.CreateBody(_local1);
if (_local2 != null){
_local3 = new b2PolygonDef();
_local3.filter = _local13;
_local3.vertexCount = 4;
_local3.vertices[3].Set((_local5.x * w2p), (_local5.y * w2p));
_local3.vertices[2].Set((_local6.x * w2p), (_local6.y * w2p));
_local3.vertices[1].Set((_local7.x * w2p), (_local7.y * w2p));
_local3.vertices[0].Set((_local8.x * w2p), (_local8.y * w2p));
_local3.friction = 0.5;
_local3.restitution = 0.2;
_local3.density = 1;
_local2.CreateShape(_local3);
_local2.SetUserData(_local10);
};
_local9++;
};
};
};
};
}
public static function InitLevelState(_arg1:int){
levelState = _arg1;
levelStateTimer = 0;
if (levelState == levelState_LevelStart){
levelStateTimer = 10;
levelStateCount = 0;
};
if (levelState == levelState_PostRace){
levelStateTimer = (Defs.fps * 3);
levelStateTimer = (Defs.fps * 0.5);
};
if (levelState == levelState_Play){
raceTimer = 0;
};
if (levelState == levelState_Editor){
PhysEditor.InitEditor();
PhysEditor.currentLevel = currentLevel;
};
}
static function InitNinjaProjectile(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:PhysObj_Instance;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:PhysObj_Instance;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:b2Body;
var _local15:b2Shape;
_local3 = (_arg1 * p2w);
_local4 = (_arg2 * p2w);
_local5 = GetPhysObjInstanceByName("player");
_local6 = _local5.GetBodyWorldPos(0);
_local7 = (_local6.x * p2w);
_local8 = (_local6.y * p2w);
_local8 = (_local8 - 300);
_local9 = Utils.RandCircle();
_local10 = AddPhysObjAt("ninja_projectile", _local3, _local4, 0, "");
_local11 = Utils.RandBetweenFloat(20, 50);
_local9 = Math.atan2((_local8 - _local4), (_local7 - _local3));
_local12 = (Math.cos(_local9) * _local11);
_local13 = (Math.sin(_local9) * _local11);
_local10.SetLinearVelocity(_local12, _local13);
for each (_local14 in _local10.bodies) {
_local14.SetBullet(true);
_local15 = _local14.GetShapeList();
_local15.SetUserData(_local10);
};
}
static function SetWeapon(_arg1:int):void{
currentProjectileType = _arg1;
}
static function BoostFinished(){
boostMode = 0;
boostTimer = 0;
boostMultiplier = 0;
}
static function UpdateScroll(){
var _local1:PhysObj_Instance;
var _local2:b2Vec2;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Level;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local1 = GetPhysObjInstanceByName("player");
if (_local1 == null){
return;
};
_local2 = _local1.GetBodyWorldPos(0);
_local5 = (_local2.x * p2w);
_local6 = (_local2.y * p2w);
_local7 = 320;
_local8 = 240;
_local9 = GetCurrentLevel();
if (_local9.eventType == "chase"){
_local7 = 500;
};
scrollCX = _local5;
scrollCY = _local6;
_local10 = _local1.GetBodyLinearVelocity(4);
_local11 = Math.atan2(_local10.y, _local10.x);
_local12 = _local10.Length();
if (_local12 < 3){
_local3 = 0;
_local4 = 0;
} else {
_local12 = Utils.LimitNumber(3, 30, _local12);
_local13 = Utils.ScaleTo(0, 150, 0, 30, _local12);
_local3 = (Math.cos(_local11) * _local13);
_local4 = (Math.sin(_local11) * _local13);
};
scrollToDX = (scrollToDX + ((_local3 - scrollToDX) * 0.1));
scrollToDY = (scrollToDY + ((_local4 - scrollToDY) * 0.1));
scrollX = ((_local5 - _local7) + scrollToDX);
scrollY = ((_local6 - _local8) + scrollToDY);
scrollX = (scrollX + shakeCamX);
scrollY = (scrollY + shakeCamY);
scrollScale = 1;
UpdateShakeCam(_local12);
}
static function AlignWithPreviousVerts(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Point{
var _local6:Matrix;
var _local7:Point;
var _local8:Number;
var _local9:Point;
var _local10:Number;
var _local11:Number;
_local6 = new Matrix();
_local6.rotate(_arg5);
_local7 = new Point(_arg1, _arg2);
var _temp1 = _local6.transformPoint(_local7);
_local7 = _local6.transformPoint(_local7);
_temp1.x = (_local7.x + _arg3);
_local7.y = (_local7.y + _arg4);
_local8 = (2 * w2p);
for each (_local9 in previousStaticPoints) {
if (Math.abs((_local9.x - _local7.x)) < _local8){
if (Math.abs((_local9.y - _local7.y)) < _local8){
_local10 = (_local9.x - _local7.x);
_local11 = (_local9.y - _local7.y);
return (new Point(_local10, _local11));
};
};
};
previousStaticPoints.push(_local7.clone());
return (null);
}
public static function UpdateHelpOverlay(_arg1:Event){
if (KeyReader.Pressed(KeyReader.KEY_SPACE)){
trace("help space pressed");
helpOverlay.removeEventListener(Event.ENTER_FRAME, UpdateHelpOverlay);
Game.main.removeChild(helpOverlay);
helpOverlay = null;
pause = false;
KeyReader.InitOnce(main.stage);
};
}
public static function Init(_arg1:Main){
main = _arg1;
currentScore = 0;
multiplier = 1;
numLevels = 8;
currentLevel = 0;
PlayerBikes.InitOnce();
Player.InitOnce();
cheatMode = 0;
numFirstPlaces = 0;
numRacesCompleted = 0;
}
static function RenderBox2D():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:b2Body;
var _local6:b2Shape;
var _local7:b2Vec2;
var _local8:Number;
var _local9:*;
var _local10:b2PolygonShape;
var _local11:Array;
var _local12:int;
var _local13:int;
var _local14:b2Vec2;
var _local15:b2Vec2;
var _local16:Matrix;
var _local17:Point;
var _local18:Point;
var _local19:b2CircleShape;
var _local20:Number;
if (Debug.IsSet(1) == false){
return;
};
_local1 = scrollX;
_local2 = scrollY;
_local3 = p2w;
_local5 = world.GetBodyList();
while (_local5) {
_local7 = _local5.GetPosition();
_local8 = _local5.GetAngle();
_local6 = _local5.GetShapeList();
while (_local6) {
_local9 = _local6.GetType();
if (_local9 == b2Shape.e_polygonShape){
_local10 = b2PolygonShape(_local6);
_local11 = _local10.GetVertices();
_local12 = _local10.GetVertexCount();
_local4 = 0;
while (_local4 < _local12) {
_local13 = (_local4 + 1);
if (_local13 >= _local12){
_local13 = 0;
};
_local14 = _local11[_local4].Copy();
_local15 = _local11[_local13].Copy();
_local16 = new Matrix();
_local16.rotate(_local8);
_local17 = new Point(_local14.x, _local14.y);
_local18 = new Point(_local15.x, _local15.y);
_local17 = _local16.transformPoint(_local17);
_local18 = _local16.transformPoint(_local18);
_local14.x = _local17.x;
_local14.y = _local17.y;
_local15.x = _local18.x;
_local15.y = _local18.y;
_local14.Add(_local7);
_local15.Add(_local7);
Utils.RenderDotLine(main.scrollScreenBD, ((_local14.x * _local3) - _local1), ((_local14.y * _local3) - _local2), ((_local15.x * _local3) - _local1), ((_local15.y * _local3) - _local2), 50, 4294967295);
_local4++;
};
};
if (_local9 == b2Shape.e_circleShape){
_local19 = b2CircleShape(_local6);
_local20 = (_local19.GetRadius() * _local3);
Utils.RenderCircle(main.scrollScreenBD, ((_local7.x * _local3) - _local1), ((_local7.y * _local3) - _local2), _local20, 4294967295);
};
_local6 = _local6.GetNext();
};
_local5 = _local5.GetNext();
};
}
public static function InitGame(){
Debug.debugMode = 0;
numLives = 3;
polygonList = new Array();
startPoints = new Array();
currentStartPointIndex = 0;
currentLevel = 0;
pause = true;
timesList = new Array();
cash = 0;
currentGameMusic = 0;
squeakSound = SoundPlayer.StartLoop(SoundPlayer.GetId("pedalling"), 0);
coastSound = SoundPlayer.StartLoop(SoundPlayer.GetId("coasting"), 0);
helpIsAvailable = true;
cheatUnlocked0 = false;
cheatUnlocked1 = false;
cheatUnlocked2 = false;
PauseButton = new buttonPauseMute();
PauseButton.addEventListener(MouseEvent.CLICK, PauseButtonPressed);
}
public static function CrossedFinishLine(){
var _local1:Point;
if (levelState == levelState_Play){
_local1 = new Point(currentLevel, raceTimer);
timesList.push(_local1);
InitLevelState(levelState_PostRace);
};
}
public static function UpdateBikeWheelDown():void{
var _local1:Number;
if (bikeWheelDown){
bikeWheelDownTimer++;
bikeWheelUpTimer = 0;
} else {
if (bikeWheelUpTimer == 0){
InitPlayerUpdateRot();
};
bikeWheelUpTimer++;
bikeWheelDownTimer = 0;
};
if (backWheelDown == false){
backWheelUpTimer++;
} else {
backWheelUpTimer = 0;
};
if (frontWheelDown == false){
frontWheelUpTimer++;
} else {
frontWheelUpTimer = 0;
};
if ((((backWheelUpTimer < 10)) && ((frontWheelDown == false)))){
wheelieTimer++;
} else {
if (wheelieTimer > boost_minWheelieTime){
_local1 = AddToBoost(((wheelieTimer / Defs.fps) * boostModifier_RearWheelie));
levelWheelieTime = (levelWheelieTime + wheelieTimer);
if (wheelieTimer > bestRearWheelieTime){
bestRearWheelieTime = wheelieTimer;
};
InitMessage((("Rear Wheelie: " + Utils.CounterToSecondsString(int(wheelieTimer))) + " s"));
};
wheelieTimer = 0;
};
if ((((frontWheelUpTimer < 10)) && ((backWheelDown == false)))){
frontWheelieTimer++;
} else {
if (frontWheelieTimer > boost_minWheelieTime){
_local1 = AddToBoost(((frontWheelieTimer / Defs.fps) * boostModifier_FrontWheelie));
levelFrontWheelieTime = (levelFrontWheelieTime + frontWheelieTimer);
InitMessage((("FrontWheelie: " + Utils.CounterToSecondsString(int(frontWheelieTimer))) + " s"));
};
frontWheelieTimer = 0;
};
}
public static function BikeWheelIsDown():void{
var _local1:Number;
bikeWheelDown = true;
if (bikeWheelUpTimer > boost_minAirTime){
_local1 = AddToBoost(((bikeWheelUpTimer / Defs.fps) * boostModifier_AirTime));
levelAirTime = (levelAirTime + bikeWheelUpTimer);
if (bikeWheelUpTimer > bestSingleAirTime){
bestSingleAirTime = bikeWheelUpTimer;
};
InitMessage((("Air Time " + Utils.CounterToSecondsString(int(bikeWheelUpTimer))) + " s"));
bikeWheelUpTimer = 0;
};
}
public static function ZeroStuntTimers():void{
bikeWheelDownTimer = 0;
bikeWheelUpTimer = 0;
frontWheelieTimer = 0;
wheelieTimer = 0;
backWheelUpTimer = 0;
frontWheelUpTimer = 0;
}
static function AwardCashForFinalPosition(){
playerRaceFinishCash = 0;
if (playerRacePosition == 0){
playerRaceFinishCash = 100;
};
if (playerRacePosition == 1){
playerRaceFinishCash = 50;
};
if (playerRacePosition == 2){
playerRaceFinishCash = 25;
};
if (playerRacePosition == 3){
playerRaceFinishCash = 10;
};
if (playerRacePosition == 4){
playerRaceFinishCash = 6;
};
if (playerRacePosition == 5){
playerRaceFinishCash = 5;
};
if (playerRacePosition == 6){
playerRaceFinishCash = 4;
};
if (playerRacePosition == 7){
playerRaceFinishCash = 3;
};
if (playerRacePosition == 8){
playerRaceFinishCash = 2;
};
if (playerRacePosition == 9){
playerRaceFinishCash = 1;
};
cash = (cash + playerRaceFinishCash);
}
static function Render(){
var _local1:BitmapData;
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:Array;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:Matrix;
var _local16:ColorTransform;
var _local17:Graphics;
var _local18:Number;
var _local19:Number;
var _local20:Number;
if (pause){
return;
};
if (levelState == levelState_Null){
return;
};
if (levelState == levelState_Editor){
_local17 = main.fillScreenMC.graphics;
_local17.clear();
PhysEditor.RenderEditor();
return;
};
_local1 = main.scrollScreenBD;
_local7 = new Array(1, 3, 0, 2, 4, 5);
_local8 = _local7[currentWorldID];
_local9 = (GraphicObjects.gfx_back01 + _local8);
_local10 = (GraphicObjects.gfx_back07 + _local8);
_local11 = (GraphicObjects.gfx_back13 + _local8);
_local12 = GraphicObjects.GetWidth(_local9, 0);
_local13 = GraphicObjects.GetWidth(_local10, 0);
_local14 = GraphicObjects.GetWidth(_local11, 0);
GraphicObjects.RenderAt(_local9, 0, _local1, 0, 0);
_local6 = 200;
_local5 = (int((scrollX * 0.025)) % _local13);
GraphicObjects.RenderAt(_local10, 0, _local1, -(_local5), _local6);
GraphicObjects.RenderAt(_local10, 0, _local1, (-(_local5) + _local13), _local6);
_local6 = 130;
_local5 = (int((scrollX * 0.05)) % _local14);
GraphicObjects.RenderAt(_local11, 0, _local1, -(_local5), _local6);
GraphicObjects.RenderAt(_local11, 0, _local1, (-(_local5) + _local14), _local6);
GameObjects.Render();
Particles.Render(Game.main);
RenderFloor();
RenderMiniMapFloor();
_local15 = new Matrix();
RenderBox2D();
_local1.draw(main.fillScreenMC);
_local15 = new Matrix();
_local15.translate(0, (Defs.displayarea_h - 100));
_local16 = new ColorTransform(1, 1, 1, 1, 0, 0, 0, -128);
_local1.draw(main.fillScreenMC1, _local15, _local16, null, new Rectangle(0, (Defs.displayarea_h - 100), 160, 100));
if (playerHitFloorTimer > 0){
_local15.identity();
_local18 = Utils.ScaleTo(1, 6, 0, playerHitFloorTimerMax, (playerHitFloorTimerMax - playerHitFloorTimer));
_local19 = Utils.ScaleTo(0, playerHitFloorMaxRot, 0, playerHitFloorTimerMax, (playerHitFloorTimerMax - playerHitFloorTimer));
_local20 = Utils.ScaleTo(0, 0xFF, 0, playerHitFloorTimerMax, (playerHitFloorTimerMax - playerHitFloorTimer));
_local15.translate(-320, -240);
_local15.scale(_local18, _local18);
_local15.rotate(_local19);
_local15.translate(320, 240);
_local16 = new ColorTransform(1, 1, 1, 1, _local20, -(_local20), -(_local20), 0);
main.screenBD.draw(_local1, _local15, _local16, null, null, true);
} else {
main.screenBD.copyPixels(_local1, Defs.screenRect, Defs.pointZero);
};
RenderPanel();
}
static function AwardCashForAchievement(){
cash = (cash + 200);
}
public static function RemoveObj_Pellet(_arg1:PhysObj_Instance){
physObjInstances.Remove(_arg1);
}
static function GetLevel(_arg1:int):Level{
if (_arg1 >= levels.length){
return (null);
};
return (levels[_arg1]);
}
static function RenderPanel(){
var _local1:Level;
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:BitmapData;
var _local6:Number;
var _local7:int;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:String;
_local1 = GetCurrentLevel();
_local5 = main.screenBD;
if (usedebug){
_local2 = 20;
_local3 = 50;
_local11 = "not recording";
if (playerRecordingFlag == 1){
_local11 = "recording PRIMED";
};
if (playerRecordingFlag == 2){
_local11 = "Recording!!";
};
_local4 = ((("FPS: " + Utils.DP2(main.fps).toString()) + " Level: ") + (currentLevel + 1));
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, _local2, _local3, _local4, null);
_local3 = (_local3 + 20);
_local4 = _local11;
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, _local2, _local3, _local4, null);
};
_local4 = _local1.name;
if (((!((cheatMode == 0))) && (((raceTimer & 16) == 0)))){
_local4 = "CHEAT MODE ACTIVE";
};
_local2 = (Defs.displayarea_w - 140);
_local3 = (Defs.displayarea_h - 22);
_local8 = GraphicObjects.GetStringWidth(main.screenBD, GraphicObjects.gfx_font1, _local2, _local3, _local4);
_local2 = (_local2 - _local8);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, _local2, _local3, _local4, null);
_local2 = 10;
_local3 = 20;
_local4 = Utils.CounterToSecondsString(raceTimer);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font2, _local2, _local3, _local4, null);
_local2 = 140;
_local3 = 20;
_local7 = GraphicObjects.gfx_boostbar;
_local6 = Utils.ScaleTo(0, (GraphicObjects.GetNumFrames(_local7) - 1), 0, boostTimerMax, boostTimer);
if (boostTimer > 0){
_local10 = (1.2 + ((Math.sin((boostTimerMax - boostTimer)) * 0.1) * 0.4));
_local8 = GraphicObjects.GetWidth(_local7, int(_local6));
_local9 = GraphicObjects.GetHeught(_local7, int(_local6));
_local2 = (_local2 - (((_local8 * _local10) - _local8) * 0.5));
_local3 = (_local3 - (((_local9 * _local10) - _local9) * 0.5));
GraphicObjects.RenderAtRotScaled(_local7, int(_local6), _local5, _local2, _local3, false, _local10);
} else {
GraphicObjects.RenderAt(_local7, int(_local6), _local5, _local2, _local3);
};
_local7 = GraphicObjects.gfx_stuntbar;
_local6 = Utils.ScaleTo(0, (GraphicObjects.GetNumFrames(_local7) - 1), 0, 1, boostLevel);
_local2 = 400;
_local3 = 20;
if (stuntAddedTimer != 0){
_local8 = GraphicObjects.GetWidth(_local7, int(_local6));
_local9 = GraphicObjects.GetHeught(_local7, int(_local6));
_local10 = Utils.ScaleTo(1, 1.4, 0, stuntAddedTimerMax, stuntAddedTimer);
_local2 = (_local2 - (((_local8 * _local10) - _local8) * 0.5));
_local3 = (_local3 - (((_local9 * _local10) - _local9) * 0.5));
GraphicObjects.RenderAtRotScaled(_local7, int(_local6), _local5, _local2, _local3, false, _local10);
} else {
GraphicObjects.RenderAt(_local7, int(_local6), _local5, _local2, _local3);
};
_local7 = GraphicObjects.gfx_boostlevel;
_local6 = boostMultiplier;
if (boostMode == 0){
_local6 = 0;
};
GraphicObjects.RenderAt(_local7, int(_local6), _local5, 390, 40);
}
static function GetNumLevelsUnlocked():int{
var _local1:int;
var _local2:Level;
_local1 = 0;
for each (_local2 in levels) {
if (_local2.available){
_local1++;
};
};
return (_local1);
}
static function InitBox2D():void{
var _local1:b2AABB;
var _local2:b2Vec2;
var _local3:Boolean;
var _local4:ContactListener;
physGravity = (500 * w2p);
if (cheatMode == 1){
physGravity = (250 * w2p);
};
if (cheatMode == 2){
physGravity = (1000 * w2p);
};
_local1 = new b2AABB();
_local1.lowerBound.Set(-250000, -250000);
_local1.upperBound.Set(250000, 250000);
_local2 = new b2Vec2(0, physGravity);
_local3 = true;
world = new b2World(_local1, _local2, _local3);
groundBody = world.GetGroundBody();
groundBody.SetUserData(-1);
_local4 = new ContactListener();
world.SetContactListener(_local4);
}
public static function LoadLevels(){
var _local1:XML;
var _local2:*;
var _local3:int;
levels = new Array();
_local1 = ExternalData.xml;
_local2 = _local1.level.length();
_local3 = 0;
while (_local3 < _local2) {
LoadLevel(_local3);
_local3++;
};
GetLevel(0).available = true;
GetLevel(0).played = false;
}
public static function LoadLevel(_arg1:int){
var _local2:XML;
var _local3:Level;
var _local4:int;
var _local5:int;
var _local6:XML;
var _local7:XML;
var _local8:int;
var _local9:Array;
var _local10:XML;
var _local11:String;
var _local12:Array;
var _local13:Point;
var _local14:XML;
var _local15:String;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:PhysObj_Instance;
_local2 = ExternalData.xml;
_local2 = _local2.level[_arg1];
_local3 = new Level();
_local3.name = XmlHelper.GetAttrString(_local2.@name, "undefined");
_local3.category = XmlHelper.GetAttrInt(_local2.@category, 0);
_local3.fillFrame = XmlHelper.GetAttrInt(_local2.@fillframe, 1);
_local3.surfaceFrame = XmlHelper.GetAttrInt(_local2.@surfaceframe, 2);
_local3.surfaceThickness = XmlHelper.GetAttrInt(_local2.@surfacethickness, 10);
_local3.eventType = XmlHelper.GetAttrString(_local2.@type, "race");
_local3.eventOpponentsString = XmlHelper.GetAttrString(_local2.@opponents, "1");
_local3.exclusiveChar = XmlHelper.GetAttrInt(_local2.@exclusivechar, -1);
_local3.eventWinParam = XmlHelper.GetAttrNumber(_local2.@win, 1);
_local4 = 0;
while (_local4 < _local2.helpscreen.length()) {
_local6 = _local2.helpscreen[_local4];
_local3.helpscreenFrames.push(XmlHelper.GetAttrInt(_local6.@frame, 0));
_local4++;
};
_local3.Calculate();
_local3.lines = new Array();
_local3.linetypes = new Array();
_local4 = 0;
while (_local4 < _local2.line.length()) {
_local7 = _local2.line[_local4];
_local8 = XmlHelper.GetAttrInt(_local7.@type, 0);
_local9 = new Array();
_local5 = 0;
while (_local5 < _local7.points.length()) {
_local10 = _local7.points[_local5];
_local11 = XmlHelper.GetAttrString(_local10.@a, "");
_local12 = Utils.PointArrayFromString(_local11);
for each (_local13 in _local12) {
_local9.push(_local13);
};
_local5++;
};
_local3.lines.push(_local9);
_local3.linetypes.push(_local8);
_local4++;
};
_local4 = 0;
while (_local4 < _local2.obj.length()) {
_local14 = _local2.obj[_local4];
_local15 = _local14.@type;
_local16 = Number(_local14.@x);
_local17 = Number(_local14.@y);
_local18 = Number(_local14.@rot);
_local19 = CreatePhysObjInstanceAt(_local15, _local16, _local17, _local18, "");
_local3.instances.push(_local19);
_local4++;
};
levels.push(_local3);
}
static function InitPhysicsGO(_arg1:Number, _arg2:Number, _arg3:PhysObj_Graphic, _arg4:int=0, _arg5:int=0, _arg6:Number=1000):int{
var _local7:GameObj;
_arg6 = (_arg6 + _arg3.zoffset);
if (_arg3 == null){
_local7 = GameObjects.AddObj((_arg1 * p2w), (_arg2 * p2w), (_arg6 + zsortoffset));
_local7.InitPhysicsObject(_arg4, _arg5, 0, 0, "", false);
} else {
if (_arg3.goInitFuntion == ""){
_local7 = GameObjects.AddObj((_arg1 * p2w), (_arg2 * p2w), (_arg6 + zsortoffset));
_local7.InitPhysicsObject(_arg4, _arg5, _arg3.offset.x, _arg3.offset.y, _arg3.goInitFuntionVarString, _arg3.hasShadow);
} else {
_local7 = GameObjects.AddObj((_arg1 * p2w), (_arg2 * p2w), (_arg6 + zsortoffset));
_local7.InitPhysicsObject(_arg4, _arg5, _arg3.offset.x, _arg3.offset.y, _arg3.goInitFuntionVarString, _arg3.hasShadow);
var _local8 = _local7;
_local8[_arg3.goInitFuntion]();
};
};
lastGeneratedGameObj = _local7;
return (GameObjects.lastGenIndex);
}
static function AddToBoost(_arg1:Number):Number{
if (playerRecordingFlag == 2){
return (0);
};
if (cheatMode != 3){
SoundPlayer.Play("trick");
};
boostLevel = (boostLevel + _arg1);
do {
if (boostLevel >= 1){
boostLevel = (boostLevel - 1);
InitBoost();
SoundPlayer.Play("boost");
boostMultiplier++;
if (boostMultiplier > maxBoostMultiplier){
boostMultiplier = maxBoostMultiplier;
};
if (boostMultiplier > highestBoostLevel){
highestBoostLevel = boostMultiplier;
};
};
} while (boostLevel > 1);
stuntAddedTimerMax = (stuntAddedTimer = 15);
return ((_arg1 * 100));
}
public static function UpdateGameplay():void{
var _local1:int;
var _local2:int;
var _local3:PhysObj_Instance;
var _local4:Array;
var _local5:GameObj;
var _local6:Level;
if (pause){
return;
};
if (levelState == levelState_Editor){
PhysEditor.UpdateEditor();
return;
};
if (usedebug){
if (KeyReader.Pressed(KeyReader.KEY_SPACE)){
InitLevelState(levelState_Editor);
};
};
if (levelState == levelState_Null){
return;
};
if (mousetimer > 0){
mousetimer--;
};
if (LevelUpdateCallback != null){
LevelUpdateCallback();
};
_local1 = 1;
if (usedebug){
if (KeyReader.Pressed(KeyReader.KEY_1)){
StartRecordPlayer();
};
if (KeyReader.Pressed(KeyReader.KEY_2)){
StopRecordPlayer();
};
if (KeyReader.Pressed(KeyReader.KEY_3)){
Debug.debugMode = (Debug.debugMode ^ 1);
};
if (KeyReader.Pressed(KeyReader.KEY_4)){
PrintPlayerPosition();
};
if (KeyReader.Pressed(KeyReader.KEY_5)){
achievements.TestAll();
InitLevelState(levelState_Null);
TitleScreenState.InitLevelEndScreen();
};
if (KeyReader.Pressed(KeyReader.KEY_6)){
currentBikeIndex--;
if (currentBikeIndex < 0){
currentBikeIndex = 0;
};
StartLevelPlay();
};
if (KeyReader.Pressed(KeyReader.KEY_7)){
currentBikeIndex++;
if (currentBikeIndex >= (numBikes - 1)){
currentBikeIndex = (numBikes - 1);
};
currentBikeIndex = (currentBikeIndex % numBikes);
StartLevelPlay();
};
if (KeyReader.Pressed(KeyReader.KEY_8)){
currentLevel--;
if (currentLevel < 0){
currentLevel = (levels.length - 1);
};
StartLevelPlay();
};
if (KeyReader.Pressed(KeyReader.KEY_9)){
currentLevel++;
if (currentLevel >= levels.length){
currentLevel = 0;
};
StartLevelPlay();
};
};
if (levelFinishedState == levelFinishedState_WON){
};
if (levelFinishedState == levelFinishedState_LOST){
};
if (levelState == levelState_LevelStart){
levelStateTimer--;
if (levelStateTimer <= 0){
levelStateTimer = Defs.fps;
levelStateCount++;
_local5 = GameObjects.AddObj(320, 100, 100);
if (levelStateCount == 3){
InitLevelState(levelState_Play);
if (startMode == 1){
gotSneakyStart = true;
_local5.InitMessage(3);
} else {
_local5.InitMessage((levelStateCount - 1));
};
} else {
_local5.InitMessage((levelStateCount - 1));
};
};
};
if (levelState == levelState_PostRace){
levelStateTimer--;
if (levelStateTimer <= 0){
if (playerRecordingFlag == 2){
StopRecordPlayer();
};
if (cheatMode == 0){
AwardCashForFinalPosition();
achievements.TestAll();
PostRaceStatTest();
SubmitAllKongStats();
} else {
achievements.TestNone();
};
SaveData.Save();
InitLevelState(levelState_Null);
TitleScreenState.InitLevelEndScreen(failedChase);
};
};
UpdatePlayerHitFloor();
if (stuntAddedTimer > 0){
stuntAddedTimer--;
};
_local2 = 0;
while (_local2 < _local1) {
levelTimer++;
bikeWheelDown = false;
backWheelDown = false;
frontWheelDown = false;
numCollisionTests = 0;
world.Step((1 / 60), physNumIterations);
world.Step((1 / 60), physNumIterations);
UpdateGOsFromPhysics();
if ((((levelState == levelState_Play)) || ((levelState == levelState_LevelStart)))){
GameObjects.Update();
Particles.Update(1);
};
_local2++;
};
UpdatePlayerRot();
if (levelState == levelState_Play){
if (cheatMode == 3){
AddToBoost(0.01);
};
UpdateBikeWheelDown();
} else {
ZeroStuntTimers();
};
UpdateRecordPlayer();
UpdatePhysObjs();
UpdateBoost();
UpdateHelp();
if ((((levelState == levelState_Play)) || ((levelState == levelState_LevelStart)))){
UpdatePlayerPosition();
_local6 = GetCurrentLevel();
if (_local6.eventType == "chase"){
UpdateChase();
};
if (playerHitFloor == false){
UpdateControl();
};
};
for each (_local3 in physObjInstances.list) {
if (_local3.collidetimer != 0){
_local3.collidetimer++;
if (_local3.collidetimer >= 5){
if (_local3.collideFunction != null){
_local3.collideFunction(_local3);
};
};
};
};
_local4 = new Array();
for each (_local3 in physObjInstances.list) {
if (_local3.removeFlag){
_local4.push(_local3);
};
};
for each (_local3 in _local4) {
physObjInstances.Remove(_local3);
};
UpdateScroll();
if (switchFlag == 1){
DoSwitchToBack();
switchFlag = 0;
};
if (switchFlag == 2){
DoSwitchToFront();
switchFlag = 0;
};
if (levelState == levelState_Play){
raceTimer++;
};
if (chase_caught){
PlayerCaught();
chase_caught = false;
};
if ((((levelState == levelState_Play)) || ((levelState == levelState_LevelStart)))){
if (KeyReader.Pressed(KeyReader.KEY_P)){
if (PauseMenu.IsPaused() == false){
QuietLoops();
PauseMenu.Pause();
};
};
};
}
static function UpdateRecordPlayer(){
var _local1:PlayerRecord;
var _local2:GameObj;
var _local3:int;
var _local4:PlayerRecord;
var _local5:Number;
var _local6:Number;
if (playerRecordingFlag != 2){
return;
};
_local2 = null;
_local3 = 0;
for each (_local2 in GameObjects.objs) {
if (((_local2.active) && (_local2.colFlag_isPlayer))){
if (playerRecording.length == 0){
oldRecordPosX = Math.floor(_local2.xpos);
oldRecordPosY = Math.floor(_local2.ypos);
_local1 = new PlayerRecord(oldRecordPosX, oldRecordPosY, Utils.DP2(_local2.dir), _local2.frame);
} else {
_local4 = playerRecording[(playerRecording.length - 1)];
_local5 = Math.floor(_local2.xpos);
_local6 = Math.floor(_local2.ypos);
_local1 = new PlayerRecord(_local5, _local6, Utils.DP2(_local2.dir), _local2.frame);
oldRecordPosX = Math.floor(_local2.xpos);
oldRecordPosY = Math.floor(_local2.ypos);
};
playerRecording.push(_local1);
};
};
}
public static function PauseButtonPressed(_arg1:MouseEvent){
if ((((levelState == levelState_Play)) && ((helpOverlay == null)))){
if (PauseMenu.IsPaused() == false){
QuietLoops();
PauseMenu.Pause();
};
};
}
public static function FrontWheelIsDown():void{
frontWheelDown = true;
}
static function RenderMiniMapFloor(){
var _local1:Rectangle;
var _local2:Level;
var _local3:Graphics;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:BitmapData;
var _local9:BitmapData;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Point;
var _local16:Point;
var _local17:Point;
var _local18:Point;
var _local19:Point;
var _local20:Point;
var _local21:Point;
var _local22:int;
var _local23:int;
var _local24:int;
var _local25:Array;
var _local26:GameObj;
var _local27:*;
_local1 = new Rectangle(0, 0, 160, 100);
_local2 = GetCurrentLevel();
_local3 = main.fillScreenMC1.graphics;
_local3.clear();
_local3.beginFill(0, 1);
_local3.drawRect(_local1.x, _local1.y, _local1.width, _local1.height);
_local3.endFill();
_local4 = 500;
_local5 = GraphicObjects.GetNumFrames(GraphicObjects.gfx_fills);
_local6 = (_local2.fillFrame - 1);
_local6 = (_local6 % _local5);
_local7 = (_local2.surfaceFrame - 1);
_local7 = (_local7 % _local5);
_local8 = GraphicObjects.GetBitmap(GraphicObjects.gfx_fills, _local6).bitmapData;
_local9 = GraphicObjects.GetBitmap(GraphicObjects.gfx_fills, _local7).bitmapData;
_local10 = _local8.width;
_local11 = _local8.height;
_local12 = 0.05;
_local13 = ((scrollCX * _local12) - 40);
_local14 = ((scrollCY * _local12) - 50);
_local2 = GetCurrentLevel();
if (_local2.lines.length == 0){
return;
};
_local23 = _local2.surfaceThickness;
_local3.lineStyle(NaN, 0, 1, true);
_local24 = 0;
for each (_local25 in _local2.lines) {
_local27 = _local2.linetypes[_local24];
_local24++;
if (_local27 == 0){
if (_local25.length >= 2){
_local22 = 0;
while (_local22 < (_local25.length - 1)) {
_local16 = _local25[_local22].clone();
_local17 = _local25[(_local22 + 1)].clone();
_local16.x = (_local16.x * _local12);
_local16.y = (_local16.y * _local12);
_local17.x = (_local17.x * _local12);
_local17.y = (_local17.y * _local12);
_local16.x = (_local16.x - _local13);
_local16.y = (_local16.y - _local14);
_local17.x = (_local17.x - _local13);
_local17.y = (_local17.y - _local14);
_local16.x = Math.floor(_local16.x);
_local16.y = Math.floor(_local16.y);
_local17.x = Math.floor(_local17.x);
_local17.y = Math.floor(_local17.y);
if ((((_local16.y > (_local1.height + 5))) && ((_local17.y > (_local1.height + 5))))){
} else {
_local18 = _local17.clone();
_local18.y = _local1.height;
_local19 = _local16.clone();
_local19.y = _local1.height;
if ((((_local17.x < -20)) || ((_local16.x > (_local1.width + 10))))){
} else {
_local3.beginFill(4286611584, 1);
_local3.moveTo(_local16.x, _local16.y);
_local3.lineTo(_local17.x, _local17.y);
_local3.lineTo(_local18.x, _local18.y);
_local3.lineTo(_local19.x, _local19.y);
_local3.endFill();
};
};
_local22++;
};
};
};
};
for each (_local26 in GameObjects.objs) {
if (_local26.active){
_local16.x = _local26.xpos;
_local16.y = _local26.ypos;
_local16.x = (_local16.x * _local12);
_local16.y = (_local16.y * _local12);
_local16.x = (_local16.x - _local13);
_local16.y = (_local16.y - _local14);
if (_local26.colFlag_isPlayer){
_local3.beginFill(0xFFFFFF, 1);
_local3.drawRect((_local16.x - 3), (_local16.y - 5), 5, 5);
_local3.endFill();
} else {
if (_local26.colFlag_isEnemy){
_local3.beginFill(0xFF00FF, 1);
_local3.drawRect((_local16.x - 3), (_local16.y - 5), 5, 5);
_local3.endFill();
} else {
if (_local26.colFlag_canBePickedUp){
_local3.beginFill(0xFFFF00, 1);
_local3.drawRect((_local16.x - 3), (_local16.y - 3), 5, 5);
_local3.endFill();
};
};
};
};
};
}
static function GetLastStartPoint(_arg1:Number):Point{
var _local2:Point;
var _local3:Point;
var _local4:Number;
_local2 = startPoints[0];
_local4 = -1000;
for each (_local3 in startPoints) {
if (_local3.x < _arg1){
if (_local3.x > _local4){
_local4 = _local3.x;
_local2 = _local3;
};
};
};
return (_local2);
}
public static function SwitchToBack(){
switchFlag = 1;
trace("SwitchToBack");
}
public static function RemoveObj_BallInWrongHopper(_arg1:PhysObj_Instance){
physObjInstances.Remove(_arg1);
}
public static function SwitchToFront(){
switchFlag = 2;
}
public static function InitLevel1(){
trace("INIT LEVEL ");
PlayerRecordings.Load();
TitleScreenState.InitWorldSelect();
}
public static function InitLevel2(){
var _local1:GameObj;
KeyReader.InitOnce(main.stage);
numBikes = PlayerBikes.bikes.length;
Particles.Reset();
ObjectDefs.Init();
GameObjects.ClearAll();
levelFinishedState = levelFinishedState_NOT;
scrollX = 0;
scrollY = 0;
LevelUpdateCallback = null;
scrollW = 10000;
scrollH = 1000;
scrollMaxX = (scrollW - Defs.displayarea_w);
scrollMaxY = (scrollH - Defs.displayarea_h);
gravity = 0.2;
maxFallSpeed = 6;
polygonList = new Array();
startPoints = new Array();
InitBox2D();
levelTimer = 0;
physObjs = new PhysObjs();
physObjs.InitFromXml(ExternalData.xml);
scrollAcc = 0.01;
scrollVel = 0;
scrollMaxVel = 2;
physObjInstances = new PhysObj_Instances();
pause = false;
StartLevelPlay();
}
static function CycleWeapon(_arg1:int):void{
currentProjectileType = (currentProjectileType + _arg1);
if (currentProjectileType >= numWeapons){
currentProjectileType = 0;
};
if (currentProjectileType < 0){
currentProjectileType = (numWeapons - 1);
};
}
public static function AddScore(_arg1:int):void{
currentScore = (currentScore + (_arg1 * multiplier));
}
static function ExamineBox2D():void{
var _local1:int;
var _local2:b2Body;
var _local3:b2Vec2;
return;
}
public static function DoSwitchToBack(){
var _local1:PhysObj_Instance;
_local1 = GetPhysObjInstanceByName("player");
if (_local1 == null){
return;
};
_local1.SetBodyCollisionMask(-1, 7);
}
public static function RemoveObj_Gem(_arg1:PhysObj_Instance){
physObjInstances.Remove(_arg1);
}
public static function RemoveObj_Pickup(_arg1:PhysObj_Instance){
var _local2:int;
var _local3:String;
numPickupsCollected++;
InitMessage(((("Pickup " + numPickupsCollected) + " / ") + totalPickups));
_local2 = pickupSounds[pickupSoundIndex];
pickupSoundIndex++;
if (pickupSoundIndex >= pickupSounds.length){
pickupSoundIndex = (pickupSounds.length - 1);
};
_local3 = ("pickup" + _local2);
SoundPlayer.Play(_local3);
physObjInstances.Remove(_arg1);
}
public static function StartLevelPlay():void{
StartLevelPlay2();
}
public static function InitLevelPlayFromEditorObjects(){
var _local1:PhysObj_Instance;
zsortoffset = 0;
level_instances = GetCurrentLevelInstances();
for each (_local1 in level_instances) {
AddPhysObjAt(_local1.typeName, _local1.x, _local1.y, _local1.rot, _local1.instanceName);
zsortoffset = (zsortoffset + 0.01);
};
}
static function GetPhysObjInstanceByName(_arg1:String):PhysObj_Instance{
var _local2:PhysObj_Instance;
for each (_local2 in physObjInstances.list) {
if (_local2.instanceName == _arg1){
return (_local2);
};
};
return (null);
}
static function UpdateGOsFromPhysics():void{
var _local1:Number;
var _local2:GameObj;
var _local3:b2Body;
var _local4:PhysObj_BodyUserData;
var _local5:int;
var _local6:b2Vec2;
var _local7:Number;
_local1 = p2w;
_local3 = world.GetBodyList();
while (_local3) {
_local4 = (_local3.GetUserData() as PhysObj_BodyUserData);
if (_local4 != null){
_local5 = _local4.gameObjectID;
if (_local5 != -1){
_local6 = _local3.GetPosition();
_local7 = _local3.GetAngle();
_local2 = GameObjects.objs[_local5];
_local2.xpos = ((_local6.x * _local1) + _local2.physObjOffsetX);
_local2.ypos = ((_local6.y * _local1) + _local2.physObjOffsetY);
_local2.dir = _local7;
};
};
_local3 = _local3.GetNext();
};
}
public static function PlayerCaught():void{
InitLevelState(levelState_PostRace);
}
static function InitPhysicsFloorGO(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number):int{
var _local5:GameObj;
_local5 = GameObjects.AddObj(_arg2, _arg3, 1000);
_local5.InitPhysicsFloorObject(_arg1, _arg4);
return (GameObjects.lastGenIndex);
}
static function UpdateShakeCam(_arg1:Number):void{
var _local2:Number;
shakeCamTimer--;
if (shakeCamTimer <= 0){
shakeCamTimer = Utils.RandBetweenInt(5, 20);
shakeCamTimerMax = shakeCamTimer;
_local2 = Utils.ScaleTo(2, 20, 0, 30, _arg1);
shakeCamToX = Utils.RandBetweenFloat(-(_local2), _local2);
shakeCamToY = Utils.RandBetweenFloat(-(_local2), _local2);
shakeCamDX = ((shakeCamToX - shakeCamX) / shakeCamTimer);
shakeCamDY = ((shakeCamToY - shakeCamY) / shakeCamTimer);
};
shakeCamX = (shakeCamX + shakeCamDX);
shakeCamY = (shakeCamY + shakeCamDY);
}
static function PrintPlayerPosition(){
var _local1:PhysObj_Instance;
var _local2:b2Vec2;
_local1 = GetPhysObjInstanceByName("player");
if (_local1 == null){
return;
};
_local2 = _local1.GetBodyWorldPos(0);
trace((((("x=\"" + int((_local2.x * p2w))) + "\" y=\"") + int((_local2.y * p2w))) + "\""));
}
static function InitPlayerUpdateRot(){
playerRotLeaveGround = playerRot;
playerRotMode = 0;
playerRotCount = 0;
}
public static function StartPlayerHitFloor():void{
if (playerRecordingFlag == 2){
return;
};
if (levelState != levelState_Play){
return;
};
if (playerHitFloor){
return;
};
playerHitFloorTimer = (playerHitFloorTimerMax = 50);
playerHitFloorMaxRot = Utils.RandBetweenFloat(1, 3);
if (Utils.RandBetweenInt(0, 1000) < 500){
playerHitFloorMaxRot = (playerHitFloorMaxRot * -1);
};
playerHitFloor = true;
numCrashes++;
}
public static function RemoveObj_BallDie(_arg1:PhysObj_Instance){
physObjInstances.Remove(_arg1);
}
public static function UpdatePlayerHitFloor():void{
var _local1:PhysObj_Instance;
var _local2:b2Vec2;
var _local3:Point;
if (playerHitFloor == false){
return;
};
_local1 = GetPhysObjInstanceByName("player");
_local2 = _local1.GetBodyWorldPos(0);
_local3 = GetLastStartPoint((_local2.x * p2w));
_local1.SetLinearVelocity(0, 0);
_local1.SetAngularVelocity(-1, 0);
if (playerHitFloorTimer > 0){
ZeroStuntTimers();
ResetBoost();
playerHitFloorTimer--;
if (playerHitFloorTimer <= 0){
SoundPlayer.Play("pump");
_local1 = GetPhysObjInstanceByName("player");
_local1.SetLinearVelocity(0, 0);
_local1.SetAngularVelocity(-1, 0);
_local1.SetXForm((_local3.x * w2p), ((_local3.y - 50) * w2p), 0);
playerHitFloorTimer = 0;
playerHitFloor = false;
ResetBoost();
ZeroStuntTimers();
};
};
}
static function GetCurrentLevelInstances():Array{
return (levels[currentLevel].instances);
}
static function GetPhysObjInstanceByTypeName(_arg1:String):PhysObj_Instance{
var _local2:PhysObj_Instance;
for each (_local2 in physObjInstances.list) {
if (_local2.typeName == _arg1){
return (_local2);
};
};
return (null);
}
public static function DoSwitchToFront(){
var _local1:PhysObj_Instance;
_local1 = GetPhysObjInstanceByName("player");
if (_local1 == null){
return;
};
_local1.SetBodyCollisionMask(-1, 3);
trace("SwitchToFront");
}
static function ResetBoost(){
boostMode = 0;
boostTimer = 0;
boostLevel = 0;
boostMultiplier = 0;
}
static function UpdateHelp(){
if (helpIsAvailable == false){
return;
};
if (helpTimer > 0){
helpTimer--;
if (helpTimer == 0){
InitHelp();
};
};
}
static function StopRecordPlayer(){
var _local1:String;
var _local2:String;
var _local3:PlayerRecord;
var _local4:int;
var _local5:int;
var _local6:String;
var _local7:int;
playerRecordingFlag = 0;
_local1 = "";
_local2 = "";
_local1 = (((currentLevel.toString() + ", ") + int(playerRecording.length).toString()) + ", ");
_local1 = (_local1 + "\n");
for each (_local3 in playerRecording) {
_local1 = (_local1 + int(_local3.x));
_local1 = (_local1 + ", ");
_local1 = (_local1 + int(_local3.y));
_local1 = (_local1 + ", ");
_local1 = (_local1 + int((_local3.rot * 1000)));
_local1 = (_local1 + ", ");
};
trace("Player recording copied to clipboard");
System.setClipboard(_local1);
return;
if (_local7 != 0){
_local6 = (_local6 + "));");
_local7 = 0;
_local2 = (_local2 + (_local6 + "\n"));
_local6 = "";
};
_local6 = "StopData();";
_local2 = (_local2 + (_local6 + "\n"));
trace("Player recording copied to clipboard");
System.setClipboard(_local2);
}
static function PostRaceStatTest(){
if (playerRacePosition == 0){
numFirstPlaces++;
};
numRacesCompleted++;
}
static function GetCurrentLevel():Level{
return (levels[currentLevel]);
}
static function StartRecordPlayer(){
playerRecording = new Array();
playerRecordingFlag = 1;
}
static function RenderFloor(){
var _local1:Level;
var _local2:Graphics;
var _local3:Number;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:BitmapData;
var _local8:BitmapData;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Matrix;
var _local16:Point;
var _local17:Point;
var _local18:Point;
var _local19:Point;
var _local20:Point;
var _local21:Point;
var _local22:Point;
var _local23:int;
var _local24:int;
var _local25:int;
var _local26:Array;
var _local27:*;
_local1 = GetCurrentLevel();
_local2 = main.fillScreenMC.graphics;
_local2.clear();
_local3 = 500;
_local4 = GraphicObjects.GetNumFrames(GraphicObjects.gfx_fills);
_local5 = (_local1.fillFrame - 1);
_local6 = (_local1.surfaceFrame - 1);
_local7 = GraphicObjects.GetBitmap(GraphicObjects.gfx_fills, _local5).bitmapData;
_local8 = GraphicObjects.GetBitmap(GraphicObjects.gfx_fills, _local6).bitmapData;
_local9 = _local7.width;
_local10 = _local7.height;
_local11 = scrollX;
_local12 = scrollY;
_local13 = (scrollX % _local9);
_local14 = (scrollY % _local10);
_local15 = new Matrix();
_local15.translate(-(Math.floor(_local13)), -(Math.floor(_local14)));
_local1 = GetCurrentLevel();
if (_local1.lines.length == 0){
return;
};
_local24 = _local1.surfaceThickness;
_local2.lineStyle(NaN, 0, 1, true);
_local25 = 0;
for each (_local26 in _local1.lines) {
_local27 = _local1.linetypes[_local25];
_local25++;
if (_local26.length >= 2){
if (_local27 == 0){
_local23 = 0;
while (_local23 < (_local26.length - 1)) {
_local17 = _local26[_local23].clone();
_local18 = _local26[(_local23 + 1)].clone();
_local17.x = (_local17.x - _local11);
_local17.y = (_local17.y - _local12);
_local18.x = (_local18.x - _local11);
_local18.y = (_local18.y - _local12);
_local17.x = Math.floor(_local17.x);
_local17.y = Math.floor(_local17.y);
_local18.x = Math.floor(_local18.x);
_local18.y = Math.floor(_local18.y);
if ((((_local17.y > (Defs.displayarea_h + 5))) && ((_local18.y > (Defs.displayarea_h + 5))))){
} else {
_local19 = _local18.clone();
_local19.y = Defs.displayarea_h;
_local20 = _local17.clone();
_local20.y = Defs.displayarea_h;
if ((((_local18.x < -20)) || ((_local17.x > (Defs.displayarea_w + 10))))){
} else {
_local2.beginBitmapFill(_local7, _local15);
_local2.moveTo(_local17.x, _local17.y);
_local2.lineTo(_local18.x, _local18.y);
_local2.lineTo(_local19.x, _local19.y);
_local2.lineTo(_local20.x, _local20.y);
_local2.endFill();
};
_local19 = _local18.clone();
_local18.clone().y = (_local19.y + _local24);
_local20 = _local17.clone();
_local17.clone().y = (_local20.y + _local24);
if ((((_local18.x < -20)) || ((_local17.x > (Defs.displayarea_w + 10))))){
} else {
_local2.beginBitmapFill(_local8, _local15);
_local2.moveTo(_local17.x, _local17.y);
_local2.lineTo(_local18.x, _local18.y);
_local2.lineTo(_local19.x, _local19.y);
_local2.lineTo(_local20.x, _local20.y);
_local2.endFill();
};
};
_local23++;
};
} else {
if (_local27 == 1){
_local23 = 0;
while (_local23 < (_local26.length - 1)) {
_local17 = _local26[_local23].clone();
_local18 = _local26[(_local23 + 1)].clone();
_local17.x = (_local17.x - _local11);
_local17.y = (_local17.y - _local12);
_local18.x = (_local18.x - _local11);
_local18.y = (_local18.y - _local12);
_local17.x = Math.floor(_local17.x);
_local17.y = Math.floor(_local17.y);
_local18.x = Math.floor(_local18.x);
_local18.y = Math.floor(_local18.y);
if ((((_local17.y < -5)) && ((_local18.y < -5)))){
} else {
_local19 = _local18.clone();
_local19.y = 0;
_local20 = _local17.clone();
_local20.y = 0;
if ((((_local18.x < -20)) || ((_local17.x > (Defs.displayarea_w + 10))))){
} else {
_local2.beginBitmapFill(_local7, _local15);
_local2.moveTo(_local20.x, _local20.y);
_local2.lineTo(_local19.x, _local19.y);
_local2.lineTo(_local18.x, _local18.y);
_local2.lineTo(_local17.x, _local17.y);
_local2.endFill();
};
_local19 = _local18.clone();
_local18.clone().y = (_local19.y - _local24);
_local20 = _local17.clone();
_local17.clone().y = (_local20.y - _local24);
if ((((_local18.x < -20)) || ((_local17.x > (Defs.displayarea_w + 10))))){
} else {
_local2.beginBitmapFill(_local8, _local15);
_local2.moveTo(_local20.x, _local20.y);
_local2.lineTo(_local19.x, _local19.y);
_local2.lineTo(_local18.x, _local18.y);
_local2.lineTo(_local17.x, _local17.y);
_local2.endFill();
};
};
_local23++;
};
};
};
};
};
_local2.lineStyle(3, 0, 1);
_local25 = 0;
for each (_local26 in _local1.lines) {
if (_local26.length >= 2){
_local27 = _local1.linetypes[_local25];
_local25++;
_local23 = 0;
while (_local23 < (_local26.length - 1)) {
_local17 = _local26[_local23].clone();
_local18 = _local26[(_local23 + 1)].clone();
_local17.x = (_local17.x - _local11);
_local17.y = (_local17.y - _local12);
_local18.x = (_local18.x - _local11);
_local18.y = (_local18.y - _local12);
_local17.x = Math.floor(_local17.x);
_local17.y = Math.floor(_local17.y);
_local18.x = Math.floor(_local18.x);
_local18.y = Math.floor(_local18.y);
if ((((_local18.x < -20)) || ((_local17.x > (Defs.displayarea_w + 10))))){
} else {
if ((((_local17.y > (Defs.displayarea_h + 5))) && ((_local18.y > (Defs.displayarea_h + 5))))){
} else {
if ((((_local17.y < -5)) && ((_local18.y < -5)))){
} else {
_local2.moveTo(_local17.x, _local17.y);
_local2.lineTo(_local18.x, _local18.y);
};
};
};
_local23++;
};
};
};
}
}
}//package
Section 232
//GameCompleteScreen (GameCompleteScreen)
package {
import flash.display.*;
public dynamic class GameCompleteScreen extends MovieClip {
}
}//package
Section 233
//GameObj (GameObj)
package {
import flash.events.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class GameObj {
public var graphicID:int;
var textMessage:String;
var bikeBodyGraphicID:int;
public var xvel:Number;
var path:Poly;
public var todir:Number;
var minFrame:int;
var rotVel:Number;
public var speed:Number;
public var colFlag_isEnemy:Boolean;
public var yoffset:Number;
var objectDef:ObjectDef;
var waveDef:WaveDef;
public var ypos1:Number;
public var ypos2:Number;
public var startz:Number;
public var colFlag_canBeShot:Boolean;
var health:Number;
public var startx:Number;
public var starty:Number;
var aiRouteIndex:int;
public var colFlag_playercanbekilled:Boolean;
public var frame1:Number;
public var movementVec:Vec;
var maxFrame:int;
var ct:ColorTransform;
public var visible:Boolean;
public var colFlag_isPlayer:Boolean;
public var yvel:Number;
public var colFlag_isPhysObj:Boolean;
public var name:String;
public var dir:Number;
public var graphicID1:int;
public var radius:Number;
public var colFlag_isPowerup:Boolean;
var aiPlayerSpeed:Number;
public var controlMode:int;
public var colFlag_isHose:Boolean;
public var colFlag_isCheckpoint:Boolean;
public var origspeed:Number;
var aiPlayerSpeedOffsetCountStep:Number;
var uniqueID:int;
var EnemyUpdateFunctionCallback:Function;
var aiPlayerSpeedOffsetCount:Number;
var EnemyHitByBulletFunctionCallback:Function;
var aiWheelRot:Number;
public var colFlag_isBullet:Boolean;
public var xpos1:Number;
public var xpos2:Number;
public var colFlag_isPlatform:Boolean;
public var xpos:Number;
public var renderShadowFlag:Boolean;
public var zvel:Number;
var isChase:Boolean;
var xflip:Boolean;
public var physObjInitVarString:String;
var currentPoly:Poly;
public var colFlag_canBePickedUp:Boolean;
public var frameVel:Number;
var currentWeapon:int;
public var colFlag_killPlayer:Boolean;
var renderSmooth:Boolean;
var shotControllers:Array;
public var colFlag_isBall:Boolean;
var aiLegsFrame:Number;
var hopperIndex:int;
public var xacc:Number;
public var xoffset:Number;
public var active:Boolean;
public var count:int;
public var colFlag_jumpon:Boolean;
public var colFlag_isEnemyBullet:Boolean;
var aiPlayerSpeedOffsetMul:Number;
var flashTimer:int;
var textMessageSlot:int;
public var type:int;
public var ypos:Number;
var aiPhysObj:PhysObj;
var maxSpeed:Number;
public var timer:Number;
var scale:Number;
var alpha:Number;
public var yacc:Number;
var bulletTimer:int;
public var frame:Number;
public var controlIndex:int;
public var hitTimer:Number;
public var subtype:int;
var flashFlag:Boolean;
public var oldxpos:Number;
var bikeBodyOffsetX:Number;
var bikeBodyOffsetY:Number;
public var timer1:Number;
public var renderFunction:Function;
var aiRoutePos:Number;
var aiLegRotSpeed:Number;
public var zpos:Number;
public var toPosX:Number;
public var toPosY:Number;
public var colFlag_isBouncyPad:Boolean;
var aiUpperBodyLean:Number;
var aiBodyFrame:Number;
var dist:Number;
var aiBikeSpecialType:int;
public var driveVec:Vec;
var playerWeapons:Array;
public var main:Main;
public var updateFunction:Function;
public var additive:Boolean;
var inFrontZone:Poly;
var oldAiPosX:Number;
var oldAiPosY:Number;
var aiBikeOffsets:Array;
var currentMaxSpeed:Number;
public var timerMax:Number;
public var physObjOffsetY:Number;
public var oldypos:Number;
public var physObjOffsetX:Number;
public var colFlag_isShop:Boolean;
var parentObj:GameObj;
var flashTimerMax:int;
var isPhysObj:Boolean;
public function GameObj(_arg1, _arg2, _arg3){
ct = new ColorTransform(0.1, 0.1, 0.1, 0.3);
super();
xpos = _arg2;
ypos = _arg3;
zpos = 1;
starty = _arg2;
startx = _arg2;
active = false;
main = _arg1;
zpos = 0;
graphicID = 0;
frame = 0;
frameVel = 0;
controlIndex = 0;
timer = 0;
timer1 = 0;
radius = 14;
minFrame = 0;
maxFrame = 0;
movementVec = new Vec();
}
public function UpdatePellet(){
}
function InitWheel():void{
renderSmooth = true;
}
function InitPlayer():void{
var _local1:Array;
colFlag_isPlayer = true;
updateFunction = UpdatePlayer;
renderFunction = RenderPlayer;
frame = 0;
frameVel = 0;
frame1 = 7;
renderSmooth = true;
_local1 = physObjInitVarString.split(",");
bikeBodyGraphicID = GraphicObjects.GetIndexByName((_local1[0] as String));
bikeBodyOffsetX = Number(_local1[1]);
bikeBodyOffsetY = Number(_local1[2]);
}
function RenderPlayer():void{
var _local1:Number;
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Point;
var _local6:Matrix;
var _local7:int;
if (Game.cheatMode == 4){
graphicID = GraphicObjects.GetIndexByName("Haddock");
RenderNormally();
return;
};
RenderNormally();
_local1 = frame;
_local2 = graphicID;
_local3 = xpos;
_local4 = ypos;
_local5 = new Point(bikeBodyOffsetX, bikeBodyOffsetY);
_local6 = new Matrix();
_local6.rotate(dir);
_local5 = _local6.transformPoint(_local5);
xpos = (xpos + _local5.x);
ypos = (ypos + _local5.y);
frame = frame1;
graphicID = bikeBodyGraphicID;
RenderNormally();
frame = _local1;
graphicID = _local2;
xpos = _local3;
ypos = _local4;
_local7 = Game.playerRacePosition;
if (_local7 < 0){
_local7 = 0;
};
if (_local7 > 19){
_local7 = 19;
};
GraphicObjects.RenderAt(GraphicObjects.gfx_posmarker, _local7, main.scrollScreenBD, (xpos - Game.scrollX), ((ypos - Game.scrollY) - 90));
}
function InitObj_Bouncer(){
xoffset = 0;
yoffset = 0;
updateFunction = UpdateBouncer;
renderFunction = RenderBouncer;
controlMode = 0;
timer = 0;
}
function ClearColFlags(){
colFlag_jumpon = false;
colFlag_killPlayer = false;
colFlag_playercanbekilled = false;
colFlag_canBePickedUp = false;
colFlag_canBeShot = false;
colFlag_isBullet = false;
colFlag_isPlatform = false;
colFlag_isPowerup = false;
colFlag_isBouncyPad = false;
colFlag_isCheckpoint = false;
colFlag_isShop = false;
colFlag_isEnemyBullet = false;
colFlag_isEnemy = false;
colFlag_isBall = false;
colFlag_isHose = false;
colFlag_isPlayer = false;
colFlag_isPhysObj = false;
}
public function GetOffsetObjectRectangle():Rectangle{
var _local1:Rectangle;
_local1 = objectDef.colRects[0].clone();
_local1.x = (_local1.x + xpos);
_local1.y = (_local1.y + ypos);
return (_local1);
}
function RenderBouncer(){
var _local1:Number;
var _local2:Number;
_local1 = xpos;
_local2 = ypos;
xpos = (xpos + xoffset);
ypos = (ypos + yoffset);
RenderNormally();
xpos = _local1;
ypos = _local2;
}
function InitAIPlayer(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean=false):void{
var _local5:Array;
var _local6:Array;
var _local7:int;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:PlayerRecord;
isChase = _arg4;
colFlag_isEnemy = true;
aiBikeOffsets = new Array();
aiBikeOffsets.push(new Point(0, 0), 0);
aiBikeOffsets.push(new Point(0, -10), 0);
aiBikeOffsets.push(new Point(0, -8), 0);
aiBikeOffsets.push(new Point(0, -10), 4);
aiBikeOffsets.push(new Point(0, -7), 0);
aiBikeOffsets.push(new Point(0, -7), 0);
aiBikeOffsets.push(new Point(0, -4), -2);
aiBikeOffsets.push(new Point(0, 7), -5);
aiBikeOffsets.push(new Point(0, -10), 0);
aiBikeOffsets.push(new Point(0, 0), 2);
aiBikeOffsets.push(new Point(0, -3), -2);
aiBikeOffsets.push(new Point(0, -8), -1);
aiBikeOffsets.push(new Point(0, -8), 0);
aiBikeOffsets.push(new Point(0, -8), -10);
aiBikeOffsets.push(new Point(0, -10), -3);
aiBikeOffsets.push(new Point(0, -10), 1);
aiBikeOffsets.push(new Point(0, -3), 0);
aiBikeOffsets.push(new Point(0, -9), -2);
aiBikeOffsets.push(new Point(0, -9), -2);
aiBikeOffsets.push(new Point(0, -10), -2);
aiBikeOffsets.push(new Point(0, 0), 0);
aiBikeOffsets.push(new Point(0, 0), 0);
aiBikeOffsets.push(new Point(0, 0), 0);
aiBikeOffsets.push(new Point(0, 0), 0);
aiBikeOffsets.push(new Point(0, 0), 0);
_local5 = new Array();
_local6 = new Array();
_local5.push(28.030303030303, 56.454545454545, 68.636363636364, 80.787878787879, 38.939393939394, 63.121212121212, 58.212121212121, 57.393939393939, 53.181818181818, 57.333333333333, 42.575757575758, 46.69696969697, 42.212121212121, 42.575757575758, 58.606060606061, 39.848484848485, 39.181818181818, 59.060606060606, 52.242424242424, 54.333333333333, 46.393939393939, 66.575757575758, 60.424242424242, 75.121212121212, 47.121212121212, 121.9696969697);
_local6.push(33.525251515152, 61.034963636364, 81.953536363636, 85.737372727273, 38.939393939394, 70.931818181818, 60.340909090909, 66.109090909091, 55.654545454545, 57.333333333333, 48.975757575758, 52.787878787879, 55.007575757576, 51.404039393939, 58.606060606061, 40.287878787879, 43.929293939394, 60.310606060606, 56.854545454545, 54.333333333333, 53.797978787879, 74.929293939394, 65.310606060606, 81.163636363636, 54.136363636364, 140.37121212121);
type = (_arg3 - 1);
renderSmooth = true;
zpos = (zpos + (50 + type));
_local7 = _arg1;
aiRouteIndex = PlayerRecordings.GetRouteIndex(Game.currentLevel, _local7);
aiRoutePos = 0;
updateFunction = UpdateAIPlayer;
renderFunction = RenderAIPlayer;
frame = 0;
frameVel = 1;
if (type < 20){
aiPhysObj = Game.physObjs.FindByName(("bike" + int((type + 1)).toString()));
};
trace(((("Initing AI bike. type: " + int((type + 1))) + " route: ") + _local7));
_local8 = _local6[Game.currentLevel];
_local9 = _local5[Game.currentLevel];
_local8 = (_local8 * 1.33);
_local10 = Utils.ScaleTo(_local8, _local9, 0, 9, (_arg2 % 12));
CalcAIPlaybackSpeed(_local10, aiRouteIndex);
timer = 0;
_local11 = PlayerRecordings.GetItem(aiRouteIndex, int(aiRoutePos));
xpos = (oldAiPosX = _local11.x);
ypos = (oldAiPosY = _local11.y);
aiRoutePos = 1;
aiBodyFrame = 0;
aiLegsFrame = 0;
aiWheelRot = 0;
aiUpperBodyLean = 0.5;
aiLegRotSpeed = 0;
aiPlayerSpeedOffsetMul = Utils.RandBetweenFloat(0.1, 0.2);
aiPlayerSpeedOffsetCount = Utils.RandCircle();
aiPlayerSpeedOffsetCountStep = Utils.RandBetweenFloat(0.01, 0.03);
if (isChase){
aiPlayerSpeed = 0;
};
aiBikeSpecialType = 0;
if (type == 20){
aiBikeSpecialType = 1;
graphicID = GraphicObjects.GetIndexByName("Bubble");
frame = 0;
frameVel = 1;
renderFunction = RenderAIPlayerSpecial;
};
if (type == 21){
aiBikeSpecialType = 2;
graphicID = GraphicObjects.GetIndexByName("WallOfFire");
frame = 0;
frameVel = 1;
renderFunction = RenderAIPlayerSpecial;
};
if (type == 22){
aiBikeSpecialType = 3;
graphicID = GraphicObjects.GetIndexByName("Walrus");
frame = 0;
frameVel = 1;
renderFunction = RenderAIPlayerSpecial;
};
if (type == 23){
aiBikeSpecialType = 4;
graphicID = GraphicObjects.GetIndexByName("Piano");
frame = 0;
frameVel = 1;
renderFunction = RenderAIPlayerSpecial;
};
if (type == 24){
aiBikeSpecialType = 5;
graphicID = GraphicObjects.GetIndexByName("Haddock");
frame = 0;
frameVel = 1;
renderFunction = RenderAIPlayerSpecial;
};
}
public function PlayerHitEnemyBullet(_arg1:GameObj){
}
function RenderWallCollision():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if ((Debug.debugMode & 8) == 0){
return;
};
if (objectDef == null){
return;
};
if (objectDef.collisionCircleOffsets.length == 0){
return;
};
_local1 = 0;
while (_local1 < objectDef.collisionCircleOffsets.length) {
_local2 = objectDef.collisionCircleOffsets[_local1].x;
_local3 = objectDef.collisionCircleOffsets[_local1].y;
_local4 = objectDef.collisionCircleRadii[_local1];
_local2 = (_local2 + xpos);
_local2 = (_local2 - Game.scrollX);
_local3 = (_local3 + ypos);
_local3 = (_local3 - Game.scrollY);
Utils.RenderCircle(main.scrollScreenBD, _local2, _local3, _local4, 4294967295);
_local1++;
};
}
function RenderBlockCollision():void{
var _local1:Rectangle;
var _local2:Rectangle;
if ((Debug.debugMode & 4) == 0){
return;
};
if (objectDef == null){
return;
};
if (objectDef.colRects.length == 0){
return;
};
for each (_local2 in objectDef.colRects) {
_local1 = _local2.clone();
_local1.x = (_local1.x + xpos);
_local1.y = (_local1.y + ypos);
_local1.x = (_local1.x - Game.scrollX);
_local1.y = (_local1.y - Game.scrollY);
main.scrollScreenBD.fillRect(_local1, 1082163328);
};
for each (_local2 in objectDef.shieldColRects) {
_local1 = _local2.clone();
_local1.x = (_local1.x + xpos);
_local1.y = (_local1.y + ypos);
_local1.x = (_local1.x - Game.scrollX);
_local1.y = (_local1.y - Game.scrollY);
main.scrollScreenBD.fillRect(_local1, 1082163200);
};
}
function InitObj_Conveyor(){
frame = 0;
frameVel = 0.5;
updateFunction = UpdateObj_Conveyor;
}
public function RenderShadow():void{
var _local1:Number;
var _local2:Number;
if (renderShadowFlag == false){
return;
};
if (visible == false){
return;
};
_local1 = (xpos - Game.scrollX);
_local2 = (ypos - Game.scrollY);
GraphicObjects.RenderAtRotScaled(graphicID, frame, main.scrollScreenBD, (_local1 + 5), (_local2 + 5), true, 1, dir);
}
function CalcAIPlaybackSpeed(_arg1:Number, _arg2:int){
var _local3:Number;
var _local4:Number;
_local3 = PlayerRecordings.GetRouteLen(_arg2);
_local4 = (_local3 / Defs.fps);
aiPlayerSpeed = (_local4 / _arg1);
trace(((((("route. time: " + _arg1) + " ") + _local4) + " speed: ") + aiPlayerSpeed));
}
public function PlayAnimation():Boolean{
var _local1:int;
_local1 = (GraphicObjects.GetNumFrames(graphicID) - 1);
frame = (frame + frameVel);
if (frame >= _local1){
frame = _local1;
return (true);
};
return (false);
}
function RenderNormally(){
var _local1:Number;
var _local2:Number;
var _local3:ColorTransform;
_local1 = ((xpos + xpos1) - Game.scrollX);
_local2 = ((ypos + ypos1) - Game.scrollY);
if (_local1 < -1000){
return;
};
if (_local1 > (Defs.displayarea_w + 500)){
return;
};
if (_local2 < -1000){
return;
};
if (_local2 > (Defs.displayarea_h + 500)){
return;
};
if (((((!((scale == 1))) || (!((dir == 0))))) || (!((alpha == 1))))){
_local3 = new ColorTransform();
_local3.alphaMultiplier = alpha;
GraphicObjects.RenderAtRotScaled(graphicID, frame, main.scrollScreenBD, _local1, _local2, false, scale, dir, _local3, renderSmooth);
} else {
if (additive){
GraphicObjects.RenderAtAdditive(graphicID, frame, main.scrollScreenBD, _local1, _local2, alpha);
} else {
GraphicObjects.RenderAt(graphicID, frame, main.scrollScreenBD, _local1, _local2, false);
};
};
}
function RenderTextMessage(){
var _local1:Number;
_local1 = GraphicObjects.GetStringWidth(Game.main.scrollScreenBD, GraphicObjects.gfx_font2, xpos, ypos, textMessage, null);
GraphicObjects.RenderStringAt(Game.main.scrollScreenBD, GraphicObjects.gfx_font2, xpos, ypos, textMessage, null);
}
public function InitNextPieceGO(){
subtype = 0;
frame = subtype;
updateFunction = UpdateNextPieceGO;
dir = 0;
}
public function GetDirBetween(_arg1, _arg2, _arg3, _arg4):Number{
var _local5:*;
_local5 = Math.atan2((_arg4 - _arg2), (_arg3 - _arg1));
return (_local5);
}
function UpdateObj_Ship(){
var _local1:Number;
timer++;
_local1 = (Math.sin((timer * 0.1)) * 5);
ypos1 = _local1;
}
public function InitPinDisappear_Broken(){
health = 32;
frame = (health / 2);
}
public function CycleAnimationEx():Boolean{
var _local1:Boolean;
var _local2:*;
_local1 = false;
frame = (frame + frameVel);
_local2 = (maxFrame - minFrame);
if (frame > maxFrame){
frame = (frame - _local2);
_local1 = true;
};
if (frame < minFrame){
frame = (frame + _local2);
_local1 = true;
};
return (_local1);
}
public function InitMessage(_arg1:int):void{
updateFunction = UpdateMessage;
timer = (Defs.fps * 0.8);
frame = _arg1;
graphicID = GraphicObjects.GetIndexByName("StartRaceText");
}
function IsInWorld(_arg1:Number):Boolean{
if (xpos < (0 - _arg1)){
return (false);
};
if (ypos < (0 - _arg1)){
return (false);
};
if (xpos > (Defs.displayarea_w + _arg1)){
return (false);
};
if (ypos > (Defs.displayarea_h + _arg1)){
return (false);
};
return (true);
}
public function UpdatePickup(){
CycleAnimation();
}
function UpdateObj_Conveyor(){
CycleAnimation();
}
public function InitTextMessage(_arg1:String, _arg2:int):void{
var _local3:Number;
textMessageSlot = _arg2;
textMessage = _arg1;
updateFunction = UpdateTextMessage;
renderFunction = RenderTextMessage;
timer = Defs.fps;
controlMode = 0;
_local3 = GraphicObjects.GetStringWidth(Game.main.scrollScreenBD, GraphicObjects.gfx_font2, xpos, ypos, textMessage, null);
xpos = ((Defs.displayarea_w - _local3) - 20);
ypos = (60 + (textMessageSlot * 20));
xacc = 0;
Game.numMessagesActive++;
}
function RenderHomingBullet(){
GraphicObjects.RenderAtRotScaled(graphicID, frame, main.screenBD, xpos, ypos, false, scale, movementVec.rot);
}
function InitCheckpoint():void{
Game.startPoints.push(new Point(xpos, ypos));
}
function UpdateMessage(){
xpos = (320 + Game.scrollX);
ypos = (100 + Game.scrollY);
timer--;
if (timer <= 0){
active = false;
};
}
function RenderAIPlayer(){
var _local1:Number;
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:PhysObj_Body;
var _local10:Point;
var _local11:PhysObj_Graphic;
var _local12:Point;
var _local13:Number;
var _local14:Matrix;
var _local15:int;
var _local16:Array;
_local1 = frame;
_local2 = graphicID;
_local3 = xpos;
_local4 = ypos;
_local5 = xpos;
_local6 = ypos;
_local7 = dir;
_local8 = dir;
_local10 = new Point(0, 0);
_local12 = aiBikeOffsets[((type * 2) + 0)];
_local13 = aiBikeOffsets[((type * 2) + 1)];
_local3 = (_local3 + _local12.x);
_local4 = (_local4 + _local12.y);
dir = (dir + Utils.DegToRad(_local13));
_local7 = dir;
_local14 = new Matrix();
_local14.rotate(dir);
_local9 = aiPhysObj.BodyFromName("body");
_local11 = _local9.graphics[0];
_local10.x = _local9.pos.x;
_local10.y = _local9.pos.y;
_local10 = _local14.transformPoint(_local10);
xpos = (_local3 + _local10.x);
ypos = (_local4 + _local10.y);
graphicID = _local11.graphicID;
_local15 = GraphicObjects.GetNumFrames(graphicID);
aiLegsFrame = (aiLegsFrame + aiLegRotSpeed);
if (aiLegsFrame >= _local15){
aiLegsFrame = 0;
};
frame = aiLegsFrame;
RenderNormally();
_local9 = aiPhysObj.BodyFromName("wheel1");
_local11 = _local9.graphics[0];
_local10.x = _local9.pos.x;
_local10.y = _local9.pos.y;
_local10 = _local14.transformPoint(_local10);
xpos = (_local3 + _local10.x);
ypos = (_local4 + _local10.y);
frame = _local11.frame;
graphicID = _local11.graphicID;
dir = aiWheelRot;
RenderNormally();
_local9 = aiPhysObj.BodyFromName("wheel2");
_local11 = _local9.graphics[0];
_local10.x = _local9.pos.x;
_local10.y = _local9.pos.y;
_local10 = _local14.transformPoint(_local10);
xpos = (_local3 + _local10.x);
ypos = (_local4 + _local10.y);
frame = _local11.frame;
graphicID = _local11.graphicID;
dir = aiWheelRot;
RenderNormally();
dir = _local7;
_local9 = aiPhysObj.BodyFromName("body");
_local11 = _local9.graphics[0];
_local16 = _local11.goInitFuntionVarString.split(",");
bikeBodyGraphicID = GraphicObjects.GetIndexByName((_local16[0] as String));
bikeBodyOffsetX = Number(_local16[1]);
bikeBodyOffsetY = Number(_local16[2]);
_local10.x = (_local9.pos.x + bikeBodyOffsetX);
_local10.y = (_local9.pos.y + bikeBodyOffsetY);
_local10 = _local14.transformPoint(_local10);
xpos = (_local3 + _local10.x);
ypos = (_local4 + _local10.y);
graphicID = bikeBodyGraphicID;
_local15 = GraphicObjects.GetNumFrames(graphicID);
frame = Utils.ScaleTo(0, (_local15 - 1), 0, 1, aiUpperBodyLean);
RenderNormally();
frame = _local1;
graphicID = _local2;
xpos = _local5;
ypos = _local6;
dir = _local8;
}
function RenderAIPlayerSpecial(){
RenderNormally();
}
public function Update():void{
oldxpos = xpos;
oldypos = ypos;
if (updateFunction != null){
updateFunction();
};
}
public function InitPinDisappear(){
health = 0;
frame = (health / 2);
}
public function GetObjectRectangle():Rectangle{
return (objectDef.colRects[0]);
}
public function RenderPellet(){
}
public function PinDisappearHit():Boolean{
health++;
frame = (health / 2);
if (health > 40){
health = 40;
frame = (health / 2);
return (true);
};
return (false);
}
function UpdateAIPlayer(){
var _local1:Number;
var _local2:int;
var _local3:Number;
var _local4:PlayerRecord;
var _local5:PlayerRecord;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local1 = dir;
oldxpos = xpos;
oldypos = ypos;
if (Game.levelState == Game.levelState_Play){
_local2 = int(Math.floor(aiRoutePos));
_local3 = (aiRoutePos - Math.floor(aiRoutePos));
_local2 = int(Math.floor(aiRoutePos));
_local4 = PlayerRecordings.GetItem(aiRouteIndex, _local2);
_local5 = PlayerRecordings.GetItem1(aiRouteIndex, (_local2 + 1));
if (_local4){
dir = _local4.rot;
xpos = _local4.x;
ypos = _local4.y;
if (_local5 != null){
xpos = Utils.ScaleTo(_local4.x, _local5.x, 0, 1, _local3);
ypos = Utils.ScaleTo(_local4.y, _local5.y, 0, 1, _local3);
dir = Utils.ScaleTo(_local4.rot, _local5.rot, 0, 1, _local3);
};
};
if (isChase == false){
_local6 = 1;
if (xpos > (Game.playerX + 1000)){
_local6 = (xpos - (Game.playerX + 1000));
if (_local6 > 500){
_local6 = 500;
};
_local6 = Utils.ScaleTo(0.6, 1, 0, 500, (500 - _local6));
};
aiRoutePos = (aiRoutePos + (aiPlayerSpeed * _local6));
_local7 = ((Math.sin(aiPlayerSpeedOffsetCount) * aiPlayerSpeed) * aiPlayerSpeedOffsetMul);
aiRoutePos = (aiRoutePos + _local7);
aiPlayerSpeedOffsetCount = (aiPlayerSpeedOffsetCount + aiPlayerSpeedOffsetCountStep);
} else {
aiRoutePos = (aiRoutePos + aiPlayerSpeed);
_local8 = 200;
_local9 = 0.4;
if (type == 24){
_local8 = 350;
_local9 = 0.25;
};
_local10 = ((Game.playerX - _local8) - xpos);
if (_local10 < -10){
_local10 = -10;
};
if (_local10 > 10){
_local10 = 10;
};
aiPlayerSpeed = (aiPlayerSpeed + (_local10 * _local8));
aiPlayerSpeed = Utils.LimitNumber(0.25, _local9, aiPlayerSpeed);
};
};
if (aiBikeSpecialType == 0){
CycleAnimation();
_local10 = Utils.DistBetweenPoints(xpos, ypos, oldxpos, oldypos);
_local10 = Utils.LimitNumber(0, 20, _local10);
aiLegRotSpeed = Utils.ScaleTo(0, 1, 0, 3, _local10);
aiWheelRot = (aiWheelRot + (_local10 * 0.1));
_local11 = (dir - _local1);
if (Math.abs(_local11) < 0.2){
if (_local11 > 0){
aiUpperBodyLean = (aiUpperBodyLean + 0.11);
if (aiUpperBodyLean > 1){
aiUpperBodyLean = 1;
};
} else {
if (_local11 < 0){
aiUpperBodyLean = (aiUpperBodyLean - 0.1);
if (aiUpperBodyLean < 0){
aiUpperBodyLean = 0;
};
} else {
if (aiUpperBodyLean < 0.5){
aiUpperBodyLean = (aiUpperBodyLean + 0.1);
if (aiUpperBodyLean > 0.5){
aiUpperBodyLean = 0.5;
};
} else {
if (aiUpperBodyLean > 0.5){
aiUpperBodyLean = (aiUpperBodyLean - 0.1);
if (aiUpperBodyLean < 0.5){
aiUpperBodyLean = 0.5;
};
};
};
};
};
};
} else {
if (aiBikeSpecialType == 1){
dir = 0;
CycleAnimation();
} else {
if (aiBikeSpecialType == 2){
CycleAnimation();
dir = 0;
ypos = Game.scrollY;
} else {
if (aiBikeSpecialType == 3){
CycleAnimation();
} else {
if (aiBikeSpecialType == 4){
CycleAnimation();
} else {
if (aiBikeSpecialType == 5){
CycleAnimation();
};
};
};
};
};
};
if (aiBikeSpecialType == 0){
_local12 = Utils.DistBetweenPoints(xpos, ypos, Game.playerX, Game.playerY);
if (_local12 > 100){
_local12 = 100;
};
alpha = Utils.ScaleTo(0.5, 1, 0, 100, _local12);
} else {
alpha = 1;
};
}
function RenderEnemyBullet(){
}
public function InitPhysicsObject(_arg1:int, _arg2:int, _arg3:Number=0, _arg4:Number=0, _arg5:String="", _arg6:Boolean=false){
colFlag_isPhysObj = true;
physObjOffsetX = _arg3;
physObjOffsetY = _arg4;
isPhysObj = true;
graphicID = _arg1;
frame = _arg2;
updateFunction = UpdatePhysicsObject;
renderShadowFlag = _arg6;
physObjInitVarString = _arg5;
}
public function InitPhysicsFloorObject(_arg1:int, _arg2:Number){
frame = _arg1;
dir = _arg2;
}
function UpdatePlayer():void{
var _local1:Boolean;
var _local2:Boolean;
var _local3:Boolean;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:PhysObj_Instance;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:int;
var _local12:Particle;
var _local13:Matrix;
var _local14:Point;
if (Game.cheatMode == 4){
frameVel = 1;
CycleAnimation();
return;
};
CycleAnimation();
_local1 = false;
_local2 = false;
_local3 = false;
_local4 = false;
if (KeyReader.Down(KeyReader.KEY_LEFT)){
_local1 = true;
};
if (KeyReader.Down(KeyReader.KEY_RIGHT)){
_local2 = true;
};
if (KeyReader.Down(KeyReader.KEY_UP)){
_local3 = true;
};
if (KeyReader.Down(KeyReader.KEY_DOWN)){
_local4 = true;
};
if (KeyReader.Down(KeyReader.KEY_A)){
_local1 = true;
};
if (KeyReader.Down(KeyReader.KEY_D)){
_local2 = true;
};
if (KeyReader.Down(KeyReader.KEY_W)){
_local3 = true;
};
if (KeyReader.Down(KeyReader.KEY_S)){
_local4 = true;
};
_local5 = 0.1;
if (_local3){
frameVel = (frameVel + _local5);
if (frameVel > 4){
frameVel = 4;
};
} else {
if (_local4){
frameVel = (frameVel - _local5);
if (frameVel < -4){
frameVel = -4;
};
} else {
if (frameVel > 0){
frameVel = (frameVel - _local5);
if (frameVel <= 0){
frameVel = 0;
};
} else {
if (frameVel < 0){
frameVel = (frameVel + _local5);
if (frameVel >= 0){
frameVel = 0;
};
};
};
};
};
_local6 = 0.5;
if (_local2){
frame1 = (frame1 - _local6);
if (frame1 <= 0){
frame1 = 0;
};
} else {
if (_local1){
frame1 = (frame1 + _local6);
if (frame1 >= 14){
frame1 = 14;
};
} else {
if (frame1 < 7){
frame1 = (frame1 + _local6);
if (frame1 >= 7){
frame1 = 7;
};
};
if (frame1 > 7){
frame1 = (frame1 - _local6);
if (frame1 <= 7){
frame1 = 7;
};
};
};
};
_local7 = Game.GetPhysObjInstanceByName("player");
if (_local7 != null){
_local8 = _local7.GetBodyLinearVelocity(0);
_local9 = _local8.Length();
if (_local9 > 3){
_local10 = Math.atan2(_local8.y, _local8.x);
if (Game.boostMode == 1){
if (Game.backWheelUpTimer < 2){
_local11 = 0;
while (_local11 < 5) {
_local12 = Particles.Add((xpos + Utils.RandBetweenFloat(-15, -3)), (ypos + Utils.RandBetweenInt(28, 32)));
_local12.InitFireTrail();
_local11++;
};
};
if (_local9 > 17){
_local11 = 0;
while (_local11 < 2) {
_local13 = new Matrix();
_local13.rotate(_local10);
_local14 = new Point(Utils.RandBetweenFloat(-20, -10), Utils.RandBetweenInt(-40, 28));
_local14 = _local13.transformPoint(_local14);
_local12 = Particles.Add((xpos + _local14.x), (ypos + _local14.y));
_local12.InitSpeedLine(_local10, (Game.boostMultiplier - 1));
_local11++;
};
};
};
};
};
Game.oldPlayerRot = Game.playerRot;
Game.playerRot = dir;
Game.playerX = xpos;
Game.playerY = ypos;
}
public function Init(_arg1:int):void{
var _local2:int;
var _local3:Number;
_local2 = 0;
_local3 = 0;
type = _arg1;
controlMode = _local2;
xvel = _local3;
yvel = _local3;
frame = _local3;
frameVel = _local3;
timer = _local3;
hitTimer = _local3;
flashTimer = _local2;
flashFlag = false;
dir = 0;
todir = 0;
health = 1;
zvel = 0;
name = "";
scale = 1;
objectDef = null;
xflip = false;
updateFunction = null;
renderFunction = null;
visible = true;
renderShadowFlag = false;
ClearColFlags();
isPhysObj = false;
additive = false;
alpha = 1;
xpos1 = 0;
ypos1 = 0;
renderSmooth = false;
}
public function UpdateNextPieceGO(){
var _local1:Number;
var _local2:Number;
_local1 = MouseControl.mousePosX;
_local2 = MouseControl.mousePosY;
xpos = (_local1 + Game.scrollX);
ypos = (_local2 + Game.scrollY);
if (MouseControl.delta != 0){
dir = (dir + (Number(MouseControl.delta) * 0.1));
MouseControl.delta = 0;
};
}
public function PlayAnimationEx():Boolean{
var _local1:Boolean;
var _local2:*;
_local1 = false;
frame = (frame + frameVel);
_local2 = (maxFrame - minFrame);
if (frame > maxFrame){
if (frame > maxFrame){
frame = maxFrame;
_local1 = true;
};
};
if (frame < minFrame){
frame = minFrame;
_local1 = true;
};
return (_local1);
}
function Anim_FromVel():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:*;
_local1 = GraphicObjects.GetNumFrames(graphicID);
_local2 = xvel;
_local3 = yvel;
_local4 = Math.atan2(_local3, _local2);
frame = ((_local1 / (Math.PI * 2)) * -(_local4));
if (frame < 0){
frame = (frame + _local1);
};
if (frame > _local1){
frame = (frame - _local1);
};
frame = (frame + (_local1 / 2));
if (frame > _local1){
frame = (frame - _local1);
};
}
function UpdateTextMessage(){
if (controlMode == 0){
timer--;
if (timer <= 0){
controlMode = 1;
xvel = -20;
xacc = 3;
};
} else {
if (controlMode == 1){
xvel = (xvel + xacc);
xpos = (xpos + xvel);
if (xpos > (Defs.displayarea_w + 20)){
active = false;
Game.messageSlots[textMessageSlot] = false;
Game.numMessagesActive--;
};
};
};
}
function RenderEnemy(){
if (movementVec == null){
RenderNormally();
return;
};
GraphicObjects.RenderAtRotScaled(graphicID, frame, main.scrollScreenBD, xpos, ypos, false, scale, movementVec.rot);
}
public function CycleAnimation():void{
var _local1:Number;
var _local2:int;
_local1 = frameVel;
_local2 = GraphicObjects.GetNumFrames(graphicID);
frame = (frame + _local1);
if (frame >= _local2){
frame = (frame - _local2);
};
if (frame < 0){
frame = (frame + _local2);
};
}
function SetAnim(_arg1:int){
var _local2:int;
graphicID = _arg1;
_local2 = (GraphicObjects.GetNumFrames(graphicID) - 1);
if (frame >= _local2){
frame = 0;
};
}
public function Render():void{
if (visible == false){
return;
};
if (renderFunction != null){
renderFunction();
} else {
RenderNormally();
};
RenderBlockCollision();
RenderWallCollision();
}
public function PlayerHitEnemy(_arg1:GameObj){
}
function UpdateBouncer(){
var _local1:Number;
if (controlMode == 1){
_local1 = (dir - (Math.PI * 0.5));
xoffset = ((Math.cos(_local1) * timer) * 2);
yoffset = ((Math.sin(_local1) * timer) * 2);
timer++;
if (timer > 3){
yoffset = 0;
xoffset = 0;
controlMode = 0;
};
};
}
public function InitPickup(){
Game.totalPickups++;
colFlag_canBePickedUp = true;
graphicID = GraphicObjects.GetIndexByName("coins");
frame = Utils.RandBetweenInt(0, (GraphicObjects.GetNumFrames(graphicID) - 1));
frameVel = 1;
updateFunction = UpdatePickup;
}
function BouncerBounce(){
if (controlMode == 0){
timer = 0;
controlMode = 1;
};
}
function InitObj_Ship(){
updateFunction = UpdateObj_Ship;
timer = 0;
}
function UpdateAIPlayer_Step(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:PlayerRecord;
_local2 = 0;
while (_local2 < _arg1) {
_local3 = int(aiRoutePos);
_local4 = PlayerRecordings.GetItem(aiRouteIndex, _local3);
xpos = _local4.x;
ypos = _local4.y;
aiRoutePos = (aiRoutePos + aiPlayerSpeed);
_local2++;
};
}
public function GetVelFromDir(_arg1:Number){
xvel = (Math.cos(dir) * _arg1);
yvel = (Math.sin(dir) * _arg1);
}
public function UpdatePhysicsObject(){
}
}
}//package
Section 234
//GameObjects (GameObjects)
package {
import flash.events.*;
class GameObjects {
public static var numobjs;
static var m:Main;
public static var zorder:Array;
public static var objs:Array;
public static var lastGenIndex:int;
public function GameObjGroup(){
}
public static function Update():void{
var _local1:int;
_local1 = 0;
while (_local1 < objs.length) {
if (objs[_local1].active == true){
objs[_local1].Update();
};
_local1++;
};
}
public static function Render():void{
var _local1:GameObj;
var _local2:Array;
_local2 = new Array();
for each (_local1 in objs) {
if (((_local1.active) && (_local1.visible))){
_local2.push(_local1);
};
};
_local2.sortOn("zpos", (Array.NUMERIC | Array.DESCENDING));
for each (_local1 in _local2) {
_local1.Render();
};
}
public static function InitOnce(_arg1:Main, _arg2:int){
var _local3:*;
numobjs = _arg2;
m = _arg1;
objs = new Array();
zorder = new Array(numobjs);
_local3 = 0;
while (_local3 < numobjs) {
objs.push(new GameObj(m, 0, 0));
_local3++;
};
}
public static function ClearAll(){
var _local1:int;
_local1 = 0;
while (_local1 < numobjs) {
objs[_local1].active = false;
_local1++;
};
}
public static function CountActive():int{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < objs.length) {
if (objs[_local2].active == true){
_local1++;
};
_local2++;
};
return (_local1);
}
public static function AddObj(_arg1:Number, _arg2:Number, _arg3:Number):GameObj{
var _local4:int;
var _local5:GameObj;
_local4 = 0;
while (_local4 < numobjs) {
if (objs[_local4].active == false){
_local5 = objs[_local4];
_local5.active = true;
_local5.zpos = _arg3;
_local5.xpos = _arg1;
_local5.ypos = _arg2;
_local5.startx = _arg1;
_local5.starty = _arg2;
_local5.startz = _arg3;
_local5.Init(0);
lastGenIndex = _local4;
return (objs[_local4]);
};
_local4++;
};
trace("ERROR! NO FREE OBJECTS");
lastGenIndex = -1;
return (null);
}
public static function ForEachActive(_arg1:Function):void{
var _local2:GameObj;
var _local3:Array;
_local3 = new Array();
for each (_local2 in objs) {
if (_local2.active){
_arg1(_local2);
};
};
}
public static function GetGOByIndex(_arg1:int):GameObj{
return (objs[_arg1]);
}
}
}//package
Section 235
//GraphicObjects (GraphicObjects)
package {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
public class GraphicObjects {
public static var stringCharY:Number;
public static var gfx_fills:int;
static var count:int;
public static var gfx_boostbar:int;
public static var stringCharBitmap:Bitmap;
public static var gfx_back01:int;
public static var gfx_back02:int;
public static var gfx_back03:int;
public static var gfx_back04:int;
public static var gfx_back05:int;
public static var gfx_back06:int;
public static var gfx_back07:int;
public static var gfx_back08:int;
public static var gfx_back09:int;
public static var gfx_dust:int;
static var main:Main;
public static var gfx_font2black:int;
public static var gfx_backgrounds:int;
public static var stringCharX:Number;
public static var gfx_boostlevel:int;
public static var gfx_posmarker:int;
static var nameList:Array;
public static var gfx_fontblack:int;
static var graphicobjs:Array;
public static var gfx_back10:int;
public static var gfx_back11:int;
public static var gfx_back12:int;
public static var gfx_back13:int;
public static var gfx_back14:int;
public static var gfx_back15:int;
public static var gfx_back16:int;
public static var gfx_back17:int;
public static var gfx_back18:int;
static var nextID:int;
static var idList:Array;
public static var gfx_stuntbar:int;
public static var gfx_flame:int;
public static var gfx_speedline:int;
public static var gfx_font1:int;
public static var gfx_font2:int;
public static function GetHeught(_arg1:int, _arg2:int):int{
var _local3:int;
_local3 = idList[_arg1];
return (graphicobjs[_local3].frames[_arg2].bitmaps[0].height);
}
public static function Add(_arg1:String, _arg2:int):int{
var _local3:*;
var _local4:Class;
var _local5:MovieClip;
_local3 = nextID;
nextID++;
_local4 = (getDefinitionByName(_arg1) as Class);
_local5 = (new (_local4) as MovieClip);
Add1(_local3, new DisplayObj(_local5, 1, _arg2), _arg1);
return (_local3);
}
public static function RenderAtAlpha(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Number){
var _local7:int;
_local7 = idList[_arg1];
graphicobjs[_local7].frames[_arg2].RenderAtAlpha(_arg3, _arg4, _arg5, _arg6);
}
public static function RenderAtAdditive(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Number){
var _local7:int;
_local7 = idList[_arg1];
graphicobjs[_local7].frames[_arg2].RenderAtAdditive(_arg3, _arg4, _arg5, _arg6);
}
public static function GetBitmap(_arg1:int, _arg2:int):Bitmap{
var _local3:int;
_local3 = idList[_arg1];
return (graphicobjs[_local3].frames[_arg2].bitmaps[0]);
}
public static function RenderAt(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Boolean=false){
var _local7:int;
_local7 = idList[_arg1];
graphicobjs[_local7].frames[_arg2].RenderAt(_arg3, _arg4, _arg5, _arg6);
}
public static function RenderAtSplit(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number){
var _local6:int;
_local6 = idList[_arg1];
graphicobjs[_local6].frames[_arg2].RenderAtSplit(_arg3, _arg4, _arg5);
}
public static function RenderAtRot(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean){
var _local8:int;
_local8 = idList[_arg1];
if (_arg7){
graphicobjs[_local8].frames[_arg2].RenderAtRotBurned(_arg3, _arg4, _arg5, _arg6);
} else {
graphicobjs[_local8].frames[_arg2].RenderAtRot(_arg3, _arg4, _arg5, _arg6);
};
}
public static function RenderAtRotScaled(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Boolean=false, _arg7:Number=1, _arg8:Number=0, _arg9:ColorTransform=null, _arg10:Boolean=false){
var _local11:int;
_local11 = idList[_arg1];
graphicobjs[_local11].frames[_arg2].RenderAtRotScaled(_arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10);
}
public static function GetStringWidth(_arg1:BitmapData, _arg2:int, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Object=null, _arg7:int=0):int{
var _local8:int;
var _local9:int;
var _local10:int;
stringCharX = _arg3;
stringCharY = _arg4;
_local8 = 0;
_local9 = 0;
while (_local9 < _arg5.length) {
_local10 = int(_arg5.charCodeAt(_local9));
if (_local10 < 0){
_local10 = 0;
};
if (_local10 > 127){
_local10 = 127;
};
stringCharBitmap = GetBitmap(_arg2, _local10);
if (_arg6 != null){
} else {
_local8 = (_local8 + (stringCharBitmap.width - 3));
_local8 = (_local8 + _arg7);
};
_local9++;
};
return (_local8);
}
public static function RenderStringAt(_arg1:BitmapData, _arg2:int, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Object=null, _arg7:int=0){
var _local8:int;
var _local9:int;
stringCharX = _arg3;
stringCharY = _arg4;
_local8 = 0;
while (_local8 < _arg5.length) {
_local9 = int(_arg5.charCodeAt(_local8));
if (_local9 < 0){
_local9 = 0;
};
if (_local9 > 127){
_local9 = 127;
};
RenderAt((_arg2 + 1), _local9, _arg1, (stringCharX + 1), (stringCharY + 1));
RenderAt(_arg2, _local9, _arg1, stringCharX, stringCharY);
stringCharBitmap = GetBitmap(_arg2, _local9);
if (_arg6 != null){
_arg6();
} else {
stringCharX = (stringCharX + (stringCharBitmap.width - 3));
stringCharX = (stringCharX + _arg7);
};
_local8++;
};
}
public static function GetWidth(_arg1:int, _arg2:int):int{
var _local3:int;
_local3 = idList[_arg1];
return (graphicobjs[_local3].frames[_arg2].bitmaps[0].width);
}
public static function GetNumFrames(_arg1:int):int{
var _local2:int;
_local2 = idList[_arg1];
return (graphicobjs[_local2].frames.length);
}
public static function RenderAtScaled(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Boolean=false, _arg7:Number=1){
var _local8:int;
_local8 = idList[_arg1];
graphicobjs[_local8].frames[_arg2].RenderAtScaled(_arg3, _arg4, _arg5, _arg6, _arg7);
}
public static function Add1(_arg1:int, _arg2:DisplayObj, _arg3:String=""):void{
idList[_arg1] = count;
nameList[_arg1] = _arg3;
graphicobjs.push(_arg2);
count++;
}
public static function InitOnce(_arg1:Main):void{
var _local2:int;
main = _arg1;
graphicobjs = new Array();
idList = new Array(200);
nameList = new Array(200);
_local2 = 0;
while (_local2 < 200) {
idList[_local2] = int(0);
nameList[_local2] = String("");
_local2++;
};
count = 0;
nextID = 0;
gfx_font1 = AddFont(main.tf_scorespr);
gfx_fontblack = AddFont(main.tf_scoresprblack);
gfx_font2 = AddFont(main.tf_scorespr1);
gfx_font2black = AddFont(main.tf_scorespr2);
gfx_fills = Add("Fills", 0);
Add("BackgroundPieces", 0);
Add("nonInteractive", 0);
Add("Furniture", 0);
gfx_back01 = Add("sky1", 0);
gfx_back02 = Add("sky2", 0);
gfx_back03 = Add("sky3", 0);
gfx_back04 = Add("sky4", 0);
gfx_back05 = Add("sky5", 0);
gfx_back06 = Add("sky6", 0);
gfx_back07 = Add("background1", 0);
gfx_back08 = Add("background2", 0);
gfx_back09 = Add("background3", 0);
gfx_back10 = Add("background4", 0);
gfx_back11 = Add("background5", 0);
gfx_back12 = Add("background6", 0);
gfx_back13 = Add("frontground1", 0);
gfx_back14 = Add("frontground2", 0);
gfx_back15 = Add("frontground3", 0);
gfx_back16 = Add("frontground4", 0);
gfx_back17 = Add("frontground5", 0);
gfx_back18 = Add("frontground6", 0);
gfx_boostbar = Add("boostBar", 0);
gfx_stuntbar = Add("stuntBar", 0);
gfx_boostlevel = Add("BoostLevel", 0);
Add("BikeBody01", 0);
Add("BikeLegs01", 0);
Add("BikeWheel01", 0);
Add("BikeBody02", 0);
Add("BikeLegs02", 0);
Add("BikeWheel02", 0);
Add("BikeBody03", 0);
Add("BikeLegs03", 0);
Add("BikeWheel03", 0);
Add("BikeBody04", 0);
Add("BikeLegs04", 0);
Add("BikeWheel04", 0);
Add("BikeBody05", 0);
Add("BikeLegs05", 0);
Add("BikeWheel05", 0);
Add("BikeBody06", 0);
Add("BikeLegs06", 0);
Add("BikeWheel06", 0);
Add("BikeBody07", 0);
Add("BikeLegs07", 0);
Add("BikeWheel07", 0);
Add("BikeBody08", 0);
Add("BikeLegs08", 0);
Add("BikeWheel08", 0);
Add("BikeBody09", 0);
Add("BikeLegs09", 0);
Add("BikeWheel09", 0);
Add("BikeBody10", 0);
Add("BikeLegs10", 0);
Add("BikeWheel10", 0);
Add("BikeBody11", 0);
Add("BikeLegs11", 0);
Add("BikeWheel11", 0);
Add("BikeBody12", 0);
Add("BikeLegs12", 0);
Add("BikeWheel12", 0);
Add("BikeBody13", 0);
Add("BikeBody13a", 0);
Add("BikeLegs13", 0);
Add("BikeWheel13", 0);
Add("BikeBody14", 0);
Add("BikeLegs14", 0);
Add("BikeWheel14", 0);
Add("BikeBody15", 0);
Add("BikeLegs15", 0);
Add("BikeWheel15", 0);
Add("BikeBody16", 0);
Add("BikeLegs16", 0);
Add("BikeWheel16", 0);
Add("BikeBody17", 0);
Add("BikeLegs17", 0);
Add("BikeWheel17", 0);
Add("BikeBody18", 0);
Add("BikeLegs18", 0);
Add("BikeWheel18", 0);
Add("BikeBody19", 0);
Add("BikeLegs19", 0);
Add("BikeWheel19", 0);
Add("BikeBody20", 0);
Add("BikeLegs20", 0);
Add("BikeWheel20", 0);
Add("StartRaceText", 0);
gfx_flame = Add("FlameLine", 0);
gfx_speedline = Add("SpeedLine", 0);
Add("SpeedLine01", 0);
Add("SpeedLine02", 0);
Add("SpeedLine03", 0);
Add("SpeedLine04", 0);
Add("Pickups", 0);
Add("coins", 0);
Add("Bubble", 0);
Add("WallOfFire", 0);
Add("Walrus", 0);
Add("Piano", 0);
Add("Haddock", 0);
Add("Routes", 0);
gfx_dust = Add("Dust", 0);
gfx_posmarker = Add("PosMarker", 0);
}
public static function GetPixelAt(_arg1:int, _arg2:int, _arg3:int, _arg4:int):uint{
var _local5:int;
var _local6:Bitmap;
var _local7:uint;
_local5 = idList[_arg1];
_local6 = graphicobjs[_local5].frames[_arg2].bitmaps[0];
_local7 = _local6.bitmapData.getPixel32(_arg3, _arg4);
return (_local7);
}
public static function GetIndexByName(_arg1:String):int{
var _local2:int;
var _local3:String;
_local2 = 0;
for each (_local3 in nameList) {
if (_local3 == _arg1){
return (_local2);
};
_local2++;
};
trace(("cant find graphic obj by name: " + _arg1));
return (0);
}
public static function RenderNumberAt(_arg1:BitmapData, _arg2:int, _arg3:Number, _arg4:Number, _arg5:int){
var _local6:Array;
var _local7:int;
var _local8:int;
var _local9:Boolean;
var _local10:int;
var _local11:int;
var _local12:Bitmap;
_local6 = new Array();
_local7 = _arg5;
_local8 = 0;
while (_local8 < 11) {
_local10 = (_local7 % 10);
_local6.push(_local10);
_local7 = (_local7 / 10);
_local8++;
};
_local9 = false;
_local8 = (_local6.length - 1);
while (_local8--) {
_local11 = _local6[_local8];
if ((((_local9 == false)) && (!((_local11 == 0))))){
_local9 = true;
};
if (_local9){
RenderAt(_arg2, (_local11 + 48), _arg1, _arg3, _arg4);
_local12 = GetBitmap(_arg2, (_local11 + 48));
_arg3 = (_arg3 + _local12.width);
};
(_local8 >= 0);
};
return (_arg3);
}
public static function AddFont(_arg1:TextFormat):int{
var _local2:*;
var _local3:DisplayObj;
_local2 = nextID;
nextID++;
_local3 = new DisplayObj(null, 0, 0);
_local3.CreateFont(_arg1);
idList[_local2] = count;
graphicobjs.push(_local3);
count++;
return (_local2);
}
}
}//package
Section 236
//Haddock (Haddock)
package {
import flash.display.*;
public dynamic class Haddock extends MovieClip {
}
}//package
Section 237
//HighScore (HighScore)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class HighScore {
public static const hiscoretype_NONE = 0;
public static const hiscoretype_MOCHI = 1;
public static const hiscoretype_GAMEZHERO = 4;
public static const hiscoretype_MINDJOLT_VIRAL = 3;
public static const hiscoretype_CANDYSTAND = 6;
public static const hiscoretype_SHOCKWAVE = 5;
public static const hiscoretype_MINDJOLT = 2;
static var difficulty:int;
static var callback:Object;
static var shockwave_HighscoreObject:Object;
static var newButton;
static var mochiConnectIDs:Array;
static var mochiBoardIDs:Array;
static var main:Main;
static var s:int;
static var SubmitScore_mc:MovieClip;
static var mochiMovieClip:MovieClip;
static function buttonShockwaveBackPressed(_arg1:MouseEvent){
Game.main.removeChild(SubmitScore_mc);
SubmitScore_mc = null;
if (callback != null){
callback();
};
}
public static function ViewScores_Shockwave():void{
difficulty = 0;
if (Licensors.GetHighScoreType() == hiscoretype_SHOCKWAVE){
Shockwave_createHSobj();
shockwave_HighscoreObject.openHub("view", 0);
};
}
public static function InitOnce(_arg1:Main){
main = _arg1;
}
public static function SubmitScore(_arg1:int, _arg2:int, _arg3=null):void{
var _local4:String;
var _local5:String;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:int;
var _local10:URLRequest;
s = _arg1;
difficulty = _arg2;
callback = _arg3;
if (Licensors.GetLicensor() == Licensors.LICENSOR_SIKIDS){
_local4 = "http://www.sikids.com/sikscores";
_local4 = (_local4 + "?");
_local5 = "";
_local5 = ("sid=" + Licensors.sikids_sid);
_local4 = (_local4 + _local5);
_local4 = (_local4 + "&");
_local5 = ("nid=" + Licensors.sikids_nid);
_local4 = (_local4 + _local5);
_local4 = (_local4 + "&");
_local5 = "kid=1";
_local4 = (_local4 + _local5);
_local4 = (_local4 + "&");
_local6 = s.toString();
_local5 = "k=";
_local5 = (_local5 + _local6.charAt(0));
_local7 = _local6.charAt(0);
_local8 = _local6.charAt((_local6.length - 1));
_local9 = (int(_local7) + int(_local8));
_local5 = (_local5 + _local9.toString());
_local4 = (_local4 + _local5);
_local4 = (_local4 + "&");
_local5 = ("s=" + s.toString());
_local4 = (_local4 + _local5);
trace(("SIKIDS URL: " + _local4));
_local10 = new URLRequest(_local4);
navigateToURL(_local10, "_blank");
callback();
};
}
static function Shockwave_createHSobj():void{
var _local1:Object;
_local1 = new Object();
_local1.gameTitle = "Drift Runners";
_local1.gameId = "driftrunners";
_local1.screenWidth = 640;
_local1.screenHeight = 480;
_local1.scoreDescriptor = "Points";
}
static function buttonShockwaveSubmitPressed(_arg1:MouseEvent){
SubmitScore_mc.buttonSubmit.visible = false;
Shockwave_createHSobj();
trace("jsopening hub");
shockwave_HighscoreObject.openHub("submit", s);
trace("jsopened hub");
}
public static function PlayAgain():void{
trace("shockwave play again");
main.SetGameState(Main.gameState_TITLE);
}
}
}//package
Section 238
//KeyReader (KeyReader)
package {
import flash.events.*;
import flash.display.*;
public class KeyReader {
static const KEY_LEFT = 37;
static const KEY_HASH = 222;
static const KEY_LEFTSQUAREBRACKET = 219;
static const KEY_0 = 58;
static const KEY_1 = 49;
static const KEY_2 = 50;
static const KEY_3 = 51;
static const KEY_4 = 52;
static const KEY_5 = 53;
static const KEY_7 = 55;
static const KEY_8 = 56;
static const KEY_9 = 57;
static const KEY_6 = 54;
static const KEY_A = 65;
static const KEY_B = 66;
static const KEY_C = 67;
static const KEY_E = 69;
static const KEY_F = 70;
static const KEY_G = 71;
static const KEY_H = 72;
static const KEY_I = 73;
static const KEY_J = 74;
static const KEY_D = 68;
static const KEY_L = 76;
static const KEY_M = 77;
static const KEY_N = 78;
static const KEY_O = 79;
static const KEY_P = 80;
static const KEY_Q = 81;
static const KEY_R = 82;
static const KEY_S = 83;
static const KEY_T = 84;
static const KEY_U = 85;
static const KEY_V = 86;
static const KEY_W = 87;
static const KEY_X = 88;
static const KEY_Y = 89;
static const KEY_K = 75;
static const KEY_RIGHTSQUAREBRACKET = 221;
static const KEY_Z = 90;
static const KEY_SHIFT = 16;
static const KEY_CONTROL = 17;
static const KEY_SEMICOLON = 186;
static const KEY_NUM_0 = 96;
static const KEY_NUM_2 = 98;
static const KEY_UP = 38;
static const KEY_NUM_6 = 102;
static const KEY_NUM_1 = 97;
static const KEY_NUM_3 = 99;
static const KEY_DOWN = 40;
static const KEY_NUM_5 = 101;
static const KEY_NUM_7 = 103;
static const KEY_NUM_9 = 105;
static const KEY_NUM_4 = 100;
static const KEY_NUM_8 = 104;
static const KEY_TOPLEFT = 223;
static const KEY_BACKSLASH = 220;
static const KEY_FORWARDSLASH = 191;
static const KEY_SPACE = 32;
static const KEY_RIGHT = 39;
static var keysPressed:Array;
static var keysDown:Array;
public static function Pressed(_arg1:int):Boolean{
return (keysPressed[_arg1]);
}
static function keyUpListener(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = _arg1.keyCode;
keysDown[_local2] = 0;
}
static function keyDownListener(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = _arg1.keyCode;
var _local3 = keysDown;
var _local4 = _local2;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
}
public static function UpdateOncePerFrame():void{
var _local1:int;
_local1 = 0;
while (_local1 < 0x0100) {
if (keysDown[_local1] == 1){
keysPressed[_local1] = true;
var _local2 = keysDown;
var _local3 = _local1;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
} else {
keysPressed[_local1] = false;
};
_local1++;
};
}
public static function Down(_arg1:int):Boolean{
return (!((keysDown[_arg1] == 0)));
}
public static function InitOnce(_arg1:Stage){
var _local2:int;
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyUpListener);
_arg1.focus = _arg1;
keysDown = new Array(0x0100);
keysPressed = new Array(0x0100);
_local2 = 0;
while (_local2 < 0x0100) {
keysDown[_local2] = int(0);
keysPressed[_local2] = Boolean(false);
_local2++;
};
}
}
}//package
Section 239
//Kong (Kong)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class Kong {
static var root:Object;
static var kongregate;
static var isLoaded:Boolean = false;
public static function InitOnce(_arg1:Object){
var _local2:Object;
var _local3:Object;
var _local4:String;
var _local5:URLRequest;
var _local6:Loader;
if (Licensors.IsAtKongregate() == false){
return;
};
root = _arg1;
_local2 = root.loaderInfo.loader;
_local3 = LoaderInfo(root.loaderInfo).parameters;
_local4 = ((_local3.api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
trace(("API path: " + _local4));
isLoaded = false;
_local5 = new URLRequest(_local4);
_local6 = new Loader();
_local6.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
_local6.load(_local5);
root.addChild(_local6);
}
static function loadComplete(_arg1:Event):void{
kongregate = _arg1.target.content;
kongregate.services.connect();
trace(("\n" + kongregate.services));
trace(("\n" + kongregate.user));
trace(("\n" + kongregate.scores));
trace(("\n" + kongregate.stats));
isLoaded = true;
}
public static function SubmitScore(_arg1:Number, _arg2:String){
if (isLoaded == false){
return;
};
trace(((("Kong Score: " + _arg2) + " ") + _arg1));
if (Licensors.IsAtKongregate() == false){
return;
};
kongregate.scores.submit(_arg1, _arg2);
}
public static function SubmitStat(_arg1:Number, _arg2:String){
if (isLoaded == false){
return;
};
trace(((("Kong Stat: " + _arg2) + " ") + _arg1));
if (Licensors.IsAtKongregate() == false){
return;
};
kongregate.stats.submit(_arg2, _arg1);
}
}
}//package
Section 240
//KongregateKongAIAd (KongregateKongAIAd)
package {
import flash.events.*;
import flash.display.*;
public dynamic class KongregateKongAIAd extends MovieClip {
public var flash:MovieClip;
public function KongregateKongAIAd(){
addFrameScript(0, frame1, 219, frame220);
}
function frame220(){
stop();
dispatchEvent(new Event("finished"));
}
function frame1(){
this.stage.frameRate = 30;
}
}
}//package
Section 241
//Level (Level)
package {
public class Level {
var surfaceFrame:uint;
var linetypes:Array;
var available:Boolean;
var name:String;
var surfaceThickness:int;
var played:Boolean;
var eventOpponentsString:String;
var exclusiveChar:int;
var instances:Array;
var eventWinParam:Number;
var fillFrame:int;
var helpscreenFrames:Array;
var eventType:String;
var category:int;
var lines:Array;
public function Level(){
name = "";
instances = new Array();
helpscreenFrames = new Array();
lines = new Array();
linetypes = new Array();
category = 0;
fillFrame = 1;
surfaceFrame = 5;
surfaceThickness = 10;
available = false;
played = false;
eventType = "none";
eventOpponentsString = "";
eventWinParam = 1;
exclusiveChar = 1;
}
public function Calculate(){
}
}
}//package
Section 242
//LevelEndScreen (LevelEndScreen)
package {
import flash.display.*;
public dynamic class LevelEndScreen extends MovieClip {
public var symStat3:MovieClip;
public var symTime:MovieClip;
public var buttonNext:SimpleButton;
public var sponsorBar:MovieClip;
public var symCash:MovieClip;
public var buttonRetry:SimpleButton;
public var buttonSubmitData:SimpleButton;
public var symTitle:MovieClip;
public var symStat0:MovieClip;
public var symStat1:MovieClip;
public var symStat2:MovieClip;
public var symStat4:MovieClip;
public function LevelEndScreen(){
addFrameScript(56, frame57);
}
function frame57(){
stop();
}
}
}//package
Section 243
//levelSelect (levelSelect)
package {
import flash.display.*;
import flash.text.*;
public dynamic class levelSelect extends MovieClip {
public var textTrackInfo:TextField;
public var level1:MovieClip;
public var level2:MovieClip;
public var level3:MovieClip;
public var level5:MovieClip;
public var level4:MovieClip;
public var buttonBack:SimpleButton;
public var levelback:MovieClip;
public var buttonAchievements:SimpleButton;
public var upgrade1:MovieClip;
public var upgrade3:MovieClip;
public var upgrade4:MovieClip;
public var sponsorBar:MovieClip;
public var textMoney:TextField;
public var upgrade2:MovieClip;
public var upgrade0:MovieClip;
public var textTrackName:TextField;
}
}//package
Section 244
//LevelStartScreen (LevelStartScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LevelStartScreen extends MovieClip {
public var complete0:MovieClip;
public var textTitle:TextField;
public var complete1:MovieClip;
public var complete2:MovieClip;
public var buttonNext:SimpleButton;
public var buttonBack:SimpleButton;
public var sponsorBar:MovieClip;
public var textAchievement1:TextField;
public var textAchievement2:TextField;
public var textAchievement0:TextField;
}
}//package
Section 245
//Licensors (Licensors)
package {
import flash.display.*;
public class Licensors {
public static const LICENSOR_BIGFISH = 6;
public static const LICENSOR_SIKIDS = 14;
public static const LICENSOR_SHOCKWAVE = 11;
public static const LICENSOR_ANDKON = 5;
public static const LICENSOR_NOBRANDING = 12;
public static const LICENSOR_KING = 10;
public static const LICENSOR_KONGREGATE = 1;
public static const LICENSOR_KIBA = 13;
public static const LICENSOR_MINDJOLT = 4;
public static const LICENSOR_ARMORGAMES = 8;
public static const LICENSOR_MINICLIP = 2;
public static const LICENSOR_DOOF = 3;
public static const LICENSOR_BUBBLEBOX = 7;
public static const LICENSOR_GAMEZHERO = 9;
public static const LICENSOR_NONE = 0;
public static var sikids_nid:String;
public static var sikids_sid:String;
static var licensor:int = 1;
public static function IsHosted():Boolean{
if (licensor == LICENSOR_NONE){
return (false);
};
if (licensor == LICENSOR_ANDKON){
return (true);
};
if (licensor == LICENSOR_BIGFISH){
return (true);
};
if (licensor == LICENSOR_KONGREGATE){
if (SiteLock.GetDomain() == "kongregate.com"){
return (true);
};
return (false);
};
if (licensor == LICENSOR_MINICLIP){
if (SiteLock.GetDomain() == "miniclip.com"){
return (true);
};
return (false);
};
if (licensor == LICENSOR_DOOF){
if (SiteLock.GetDomain() == "doof.com"){
return (true);
};
return (false);
};
if (licensor == LICENSOR_MINDJOLT){
return (false);
};
return (false);
}
public static function InitOnce(_arg1:Main):void{
var _local2:String;
var _local3:Object;
_local2 = Domain.GetDomain(Main.theStage);
if (licensor == LICENSOR_SIKIDS){
_local3 = LoaderInfo(_arg1.root.loaderInfo).parameters;
sikids_sid = _local3.sid;
sikids_nid = _local3.nid;
};
if ((((licensor == LICENSOR_KONGREGATE)) && ((_local2 == "addictinggames.com")))){
licensor = LICENSOR_NOBRANDING;
};
if ((((licensor == LICENSOR_KONGREGATE)) && ((_local2 == "kaisergames.de")))){
licensor = LICENSOR_KIBA;
};
}
public static function IsAtKongregate():Boolean{
if (licensor != LICENSOR_KONGREGATE){
return (false);
};
if (SiteLock.GetDomain() == "kongregate.com"){
return (true);
};
return (false);
}
public static function GetHighScoreType():int{
if (licensor == LICENSOR_SHOCKWAVE){
return (HighScore.hiscoretype_SHOCKWAVE);
};
return (HighScore.hiscoretype_NONE);
}
public static function CanUseMochiAds():Boolean{
if (licensor == LICENSOR_NONE){
return (true);
};
if (licensor == LICENSOR_KONGREGATE){
return (true);
};
if (licensor == LICENSOR_MINICLIP){
return (false);
};
if (licensor == LICENSOR_DOOF){
return (false);
};
if (licensor == LICENSOR_MINDJOLT){
return (true);
};
if (licensor == LICENSOR_ANDKON){
return (false);
};
if (licensor == LICENSOR_BIGFISH){
return (false);
};
if (licensor == LICENSOR_ARMORGAMES){
return (false);
};
if (licensor == LICENSOR_GAMEZHERO){
return (false);
};
if (licensor == LICENSOR_KING){
return (false);
};
if (licensor == LICENSOR_SHOCKWAVE){
return (false);
};
return (true);
}
public static function GetLicensor():int{
return (licensor);
}
public static function SetLicensor(_arg1:int):void{
licensor = _arg1;
}
public static function CanUseMochiBot():Boolean{
if (licensor == LICENSOR_ARMORGAMES){
return (false);
};
if (licensor == LICENSOR_SHOCKWAVE){
return (false);
};
return (true);
}
}
}//package
Section 246
//Line (Line)
package {
import flash.geom.*;
public class Line {
public var udx:Number;
public var nx:Number;
public var ny:Number;
public var dir:Number;
public var udy:Number;
public var dy:Number;
public var y0:Number;
public var y1:Number;
public var dx:Number;
public var normalDir:Number;
public var length:Number;
public var boundingRect:Rectangle;
public var x0:Number;
public var x1:Number;
public function Line(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
x0 = _arg1;
y0 = _arg2;
x1 = _arg3;
y1 = _arg4;
CalcNormal();
CalcBoundingRect();
}
function CalcNormal():void{
dir = Math.atan2((y1 - y0), (x1 - x0));
normalDir = (dir - (Math.PI * 0.5));
nx = Math.cos(normalDir);
ny = Math.sin(normalDir);
dx = (x1 - x0);
dy = (y1 - y0);
length = Math.sqrt(((dx * dx) + (dy * dy)));
udx = Math.cos(dir);
udy = Math.sin(dir);
}
function CalcBoundingRect():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = x0;
_local2 = x1;
if (_local1 > _local2){
_local1 = x1;
_local2 = x0;
};
_local3 = y0;
_local4 = y1;
if (_local3 > _local4){
_local3 = y1;
_local4 = y0;
};
boundingRect = new Rectangle(_local1, _local3, ((_local2 - _local1) + 1), ((_local4 - _local3) + 1));
}
}
}//package
Section 247
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class Main extends MovieClip {
public var tf_scorespr:TextFormat;
var framecounter:int;// = 0
public var tf_scorespr2:TextFormat;
var cheatMode:Boolean;
public var fillScreenMC1:MovieClip;
var levelTimer:Number;
var ftime:Number;
public var tf_scorespr1:TextFormat;
public var screenB:Bitmap;
public var backgroundMC:MovieClip;
var levelTimerMax:Number;
public var mochiScores;
var scrollY:Number;// = 0
public var scrollScreenBD:BitmapData;
public var screenBD:BitmapData;
public var fillScreenMC:MovieClip;
public var scrollScreenB:Bitmap;
var gameState:int;// = 0
var currentTime:Number;// = 0
var secondCounter:Number;// = 0
public var fps:Number;
public var tf_scoresprblack:TextFormat;
static const gameState_HIGHSCORES = 5;
static const gameState_TITLE = 0;
static const gameState_LEVEL_PLAY = 2;
public static var theStage:Stage;
static var theRoot:MovieClip;
public function Main(){
currentTime = 0;
gameState = gameState_TITLE;
scrollY = 0;
framecounter = 0;
secondCounter = 0;
super();
theRoot = this;
theStage = this.root.stage;
SetEverythingUpOnce();
}
function calcFrameTime(){
var _local1:Number;
_local1 = currentTime;
currentTime = getTimer();
if (currentTime < _local1){
_local1 = (currentTime - 100);
};
if (currentTime > (_local1 + (100 * 10))){
_local1 = (100 * 10);
};
ftime = ((1 / (1000 / Defs.fps)) * (currentTime - _local1));
framecounter++;
secondCounter = (secondCounter + (currentTime - _local1));
if (secondCounter > 1000){
fps = ((Number(framecounter) / secondCounter) * 1000);
framecounter = 0;
secondCounter = 0;
};
ftime = 1;
}
function addedToStage(_arg1:Event){
SetEverythingUpOnce2();
}
private function CreateTextField(_arg1:TextFormat, _arg2:Number, _arg3:Number, _arg4:String):TextField{
var _local5:TextField;
_local5 = new TextField();
_local5.selectable = false;
_local5.embedFonts = true;
_local5.autoSize = TextFieldAutoSize.CENTER;
_local5.x = _arg2;
_local5.y = _arg3;
_local5.text = _arg4;
_local5.setTextFormat(_arg1);
addChild(_local5);
return (_local5);
}
function AddMovieClip(_arg1:Number, _arg2:Number, _arg3:MovieClip):MovieClip{
_arg3.x = _arg1;
_arg3.y = _arg2;
addChild(_arg3);
return (_arg3);
}
function InitLevel(){
InitStageForGame();
Particles.Reset();
MouseControl.Reset();
Particles.Reset();
GameObjects.ClearAll();
Game.InitLevel();
}
function run(_arg1:Event):void{
KeyReader.UpdateOncePerFrame();
SoundPlayer.UpdateOncePerFrame();
MusicPlayer.UpdateOncePerFrame();
if (Game.sitelocked){
if (SiteLock.IsLocked()){
return;
};
};
calcFrameTime();
switch (gameState){
case gameState_TITLE:
TitleScreenState.Update(this);
break;
case gameState_HIGHSCORES:
break;
case gameState_LEVEL_PLAY:
RunLevel();
break;
};
}
function InitStageNoBackground(){
var _local1:int;
_local1 = (this.numChildren - 1);
while (_local1 >= 0) {
removeChildAt(_local1);
_local1--;
};
}
function SetEverythingUpOnce2():void{
Licensors.InitOnce(this);
Kong.InitOnce(this.root);
MusicPlayer.InitOnce();
KeyReader.InitOnce(theStage);
MouseControl.InitOnce(theStage);
SoundPlayer.InitOnce(this);
PauseMenu.InitOnce(this);
Particles.InitOnce(this, 500);
GameObjects.InitOnce(this, 1000);
InitDrawScreen();
InitFonts();
GraphicObjects.InitOnce(this);
Stats.InitOnce();
MochiBot.track(this, "2e838754");
addEventListener(Event.ENTER_FRAME, run);
ExternalData.Load(SetEverythingUpOnce3);
}
function SetEverythingUpOnce3(){
InitStage();
Game.Init(this);
Game.LoadLevels();
Game.achievements = new Achievements();
SetGameState(gameState_TITLE);
}
function RunTitle(){
}
function SetEverythingUpOnce():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedToStage);
} else {
SetEverythingUpOnce2();
};
}
function InitFonts():void{
var _local1:Font;
_local1 = new Font20();
tf_scorespr = new TextFormat();
tf_scorespr1 = new TextFormat();
tf_scorespr2 = new TextFormat();
tf_scoresprblack = new TextFormat();
tf_scorespr.font = _local1.fontName;
tf_scorespr.size = 12;
tf_scorespr.color = 4294967295;
tf_scorespr1.font = _local1.fontName;
tf_scorespr1.size = 20;
tf_scorespr1.color = 4294967295;
tf_scorespr2.font = _local1.fontName;
tf_scorespr2.size = 20;
tf_scorespr2.color = 0;
tf_scoresprblack.font = _local1.fontName;
tf_scoresprblack.size = 12;
tf_scoresprblack.color = 0;
}
function Render(){
this.x = 0;
this.y = 0;
Game.Render();
}
function SetGameState(_arg1:int):void{
gameState = _arg1;
Mouse.show();
switch (gameState){
case gameState_TITLE:
TitleScreenState.Init(this);
break;
case gameState_HIGHSCORES:
break;
case gameState_LEVEL_PLAY:
InitLevel();
break;
};
}
function InitStageForGame(){
var _local1:int;
_local1 = (this.numChildren - 1);
while (_local1 >= 0) {
removeChildAt(_local1);
_local1--;
};
addChild(screenB);
screenB.x = 0;
screenB.y = 0;
}
function InitStage(){
var _local1:int;
_local1 = (this.numChildren - 1);
while (_local1 >= 0) {
removeChildAt(_local1);
_local1--;
};
addChild(screenB);
screenB.x = 0;
screenB.y = 0;
}
function RunLevel(){
if (PauseMenu.IsPaused() == false){
Game.UpdateGameplay();
};
Render();
}
function InitDrawScreen():void{
screenBD = new BitmapData(Defs.displayarea_w, Defs.displayarea_h, true, 0);
screenB = new Bitmap(screenBD);
scrollScreenBD = new BitmapData(Defs.displayarea_w, Defs.displayarea_w, true, 0);
scrollScreenB = new Bitmap(scrollScreenBD);
fillScreenMC = new MovieClip();
fillScreenMC.x = 0;
fillScreenMC.y = 0;
fillScreenMC1 = new MovieClip();
fillScreenMC1.x = 0;
fillScreenMC1.y = 0;
}
}
}//package
Section 248
//menusmusic (menusmusic)
package {
import flash.media.*;
public dynamic class menusmusic extends Sound {
}
}//package
Section 249
//MochiAd (MochiAd)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.3");
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
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 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 f:Function;
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;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
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 sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
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 _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
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 unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
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");
}};
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.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);
};
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 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
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 _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 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 _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
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.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
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 r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, 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");
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0){
options.ad_started();
options.ad_finished();
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);
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.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;
};
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);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
options.ad_failed();
_local4 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
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 fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
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 250
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 251
//MouseControl (MouseControl)
package {
import flash.events.*;
import flash.display.*;
public class MouseControl {
public static var mouseVelX:Number = 0;
public static var mouseVelY:Number = 0;
public static var mouseOldPosX:Number = 0;
public static var mouseOldPosY:Number = 0;
public static var mousePosX:Number = 0;
public static var mousePosY:Number = 0;
public static var buttonPressed:Boolean = false;
public static var buttonReleased:Boolean = false;
public static var delta:int = 0;
public static function MouseHandler(_arg1:MouseEvent):void{
mousePosX = _arg1.stageX;
mousePosY = _arg1.stageY;
mouseVelX = (mousePosX - mouseOldPosX);
mouseVelY = (mousePosY - mouseOldPosY);
mouseOldPosX = mousePosX;
mouseOldPosY = mousePosY;
}
public static function MouseClickHandler(_arg1:MouseEvent):void{
buttonPressed = true;
buttonReleased = false;
}
public static function InitOnce(_arg1:Stage):void{
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, MouseHandler);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, MouseClickHandler);
_arg1.addEventListener(MouseEvent.MOUSE_UP, MouseUpHandler);
_arg1.addEventListener(MouseEvent.MOUSE_WHEEL, MouseWheelHandler);
}
public static function MouseUpHandler(_arg1:MouseEvent):void{
buttonPressed = false;
buttonReleased = true;
}
public static function MouseWheelHandler(_arg1:MouseEvent):void{
delta = _arg1.delta;
}
public static function Reset():void{
buttonPressed = false;
buttonReleased = false;
}
}
}//package
Section 252
//MusicPlayer (MusicPlayer)
package {
import flash.media.*;
import flash.utils.*;
public class MusicPlayer {
static var musicSound1:Sound;
static var volumeMod:Number = 0.2;
static var lastMusicID = -1;
static var musicSoundTransform1:SoundTransform;
static var musicChannel1:SoundChannel = null;
static var currentMusicID:int = -1;
static var doMusic:Boolean;
static var musicChannel:SoundChannel = null;
static var streamChannelFlags:Array;
static var musicSoundTransform:SoundTransform;
static var musicSound:Sound;
static var streamSound:Sound = null;
static var streamChannels:Array;
static var streamChannelVolumes:Array;
public static var currentStreamID:int = -1;
public static function StartMusic(_arg1:String){
var classRef:Class;
var m:Sound;
var musicName = _arg1;
if (doMusic == false){
return;
};
if (musicChannel != null){
musicChannel.stop();
};
try {
classRef = (getDefinitionByName(musicName) as Class);
} catch(e:Object) {
classRef = null;
};
if (classRef == null){
trace(("Music Error: Can't find sound " + musicName));
} else {
m = (new (classRef) as Sound);
musicSoundTransform = new SoundTransform(1, 0);
musicSound = m;
musicChannel = musicSound.play(0, 999999, musicSoundTransform);
};
lastMusicID = 0;
}
public static function InitOnce():void{
doMusic = Game.soundon;
lastMusicID = -1;
currentMusicID = -1;
streamChannels = new Array();
streamChannelFlags = new Array();
streamChannelVolumes = new Array();
}
public static function StopMusic(){
var _local1:int;
var _local2:SoundChannel;
var _local3:int;
_local1 = 0;
while (_local1 < streamChannels.length) {
_local3 = streamChannelFlags[_local1];
if ((((_local3 == 0)) || ((_local3 == 1)))){
_local3 = 2;
};
streamChannelFlags[_local1] = _local3;
_local1++;
};
if (musicChannel != null){
musicChannel.stop();
};
}
public static function ToggleMute(){
doMusic = (doMusic == false);
}
public static function StartStream(_arg1:int){
var _local2:String;
var _local3:Class;
var _local4:Sound;
var _local5:SoundTransform;
if (doMusic == false){
return;
};
_local2 = "";
if (_arg1 == 0){
_local2 = "track1music";
};
if (_arg1 == 1){
_local2 = "track2music";
};
if (_arg1 == 2){
_local2 = "track3music";
};
if (_arg1 == 5){
_local2 = "menusmusic";
};
if (_arg1 == 6){
_local2 = "bonusmusic";
};
_local3 = (getDefinitionByName(_local2) as Class);
_local4 = (new (_local3) as Sound);
_local5 = new SoundTransform(0);
streamChannels.push(_local4.play(0, 999999, _local5));
streamChannelFlags.push(int(0));
streamChannelVolumes.push(Number(0));
}
public static function UpdateOncePerFrame(){
var _local1:Number;
var _local2:Boolean;
var _local3:SoundTransform;
var _local4:int;
var _local5:SoundChannel;
var _local6:int;
var _local7:Number;
var _local8:*;
var _local9:*;
var _local10:*;
_local1 = 0.02;
_local2 = false;
_local4 = 0;
while (_local4 < streamChannels.length) {
_local5 = streamChannels[_local4];
_local6 = streamChannelFlags[_local4];
_local7 = streamChannelVolumes[_local4];
if (_local6 == 0){
_local3 = _local5.soundTransform;
_local7 = (_local7 + _local1);
if (_local7 >= 1){
_local7 = 1;
_local6 = 1;
};
_local3.volume = (_local7 * volumeMod);
_local5.soundTransform = _local3;
} else {
if (_local6 == 1){
_local3 = _local5.soundTransform;
_local3.volume = (_local7 * volumeMod);
_local5.soundTransform = _local3;
} else {
if (_local6 == 2){
_local3 = _local5.soundTransform;
_local7 = (_local7 - _local1);
if (_local7 <= 0){
_local5.stop();
_local6 = 3;
_local2 = true;
};
_local3.volume = (_local7 * volumeMod);
_local5.soundTransform = _local3;
} else {
if (_local6 == 3){
};
};
};
};
streamChannelFlags[_local4] = _local6;
streamChannels[_local4] = _local5;
streamChannelVolumes[_local4] = _local7;
if (!doMusic){
_local3 = _local5.soundTransform;
_local3.volume = 0;
_local5.soundTransform = _local3;
};
_local4++;
};
if (_local2){
_local8 = new Array();
_local9 = new Array();
_local10 = new Array();
_local4 = 0;
while (_local4 < streamChannels.length) {
_local5 = streamChannels[_local4];
_local6 = streamChannelFlags[_local4];
_local7 = streamChannelVolumes[_local4];
if (_local6 != 3){
_local8.push(_local6);
_local9.push(_local5);
_local10.push(_local7);
};
_local4++;
};
streamChannelFlags = _local8;
streamChannels = _local9;
streamChannelVolumes = _local10;
};
if (!doMusic){
if (musicChannel != null){
_local3 = musicChannel.soundTransform;
_local3.volume = 0;
musicChannel.soundTransform = _local3;
};
} else {
if (musicChannel != null){
_local3 = musicChannel.soundTransform;
_local3.volume = 1;
musicChannel.soundTransform = _local3;
};
};
}
}
}//package
Section 253
//nonInteractive (nonInteractive)
package {
import flash.display.*;
public dynamic class nonInteractive extends MovieClip {
}
}//package
Section 254
//ObjectDef (ObjectDef)
package {
import flash.geom.*;
public class ObjectDef {
var type:int;
var exportName:String;
var collisionCircleOffsets:Array;
var animIDs:Array;
var particleExplodeID:int;
var initFuncName:String;
var maxHealth:Number;
var colRects:Array;
var collisionCircleRadii:Array;
var animNames:Array;
var shieldColRects:Array;
var shotControllers:Array;
var pathAnimType:int;
public function ObjectDef(_arg1:String, _arg2:int, _arg3:Rectangle){
animNames = new Array();
animIDs = new Array();
colRects = new Array();
shieldColRects = new Array();
collisionCircleOffsets = new Array();
collisionCircleRadii = new Array();
exportName = _arg1;
type = _arg2;
colRects.push(_arg3.clone());
maxHealth = 1;
initFuncName = "";
shotControllers = new Array();
}
public function AddColRect(_arg1:Rectangle){
colRects.push(_arg1.clone());
}
public function GetAnimIDFromName(_arg1:String):int{
var _local2:int;
var _local3:int;
_local2 = animNames.length;
_local3 = 0;
while (_local3 < _local2) {
if (animNames[_local3] == _arg1){
return (animIDs[_local3]);
};
_local3++;
};
trace(((("ERROR: Can't find anim name " + _arg1) + " on object ") + exportName));
return (40);
}
public function SetPathAnimType(_arg1:int){
pathAnimType = _arg1;
}
public function AddShotController(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number){
var _local5:ShotController;
_local5 = new ShotController();
_local5.Set(_arg1, _arg2, _arg3, _arg4);
shotControllers.push(_local5);
}
public function DoesAnimIDExist(_arg1:String):Boolean{
var _local2:int;
var _local3:int;
_local2 = animNames.length;
_local3 = 0;
while (_local3 < _local2) {
if (animNames[_local3] == _arg1){
return (true);
};
_local3++;
};
return (false);
}
public function AddShieldColRect(_arg1:Rectangle){
shieldColRects.push(_arg1.clone());
}
public function SetInitFunc(_arg1:String){
initFuncName = _arg1;
}
public function AddCollisionCircle(_arg1:Number, _arg2:Number, _arg3:Number){
collisionCircleOffsets.push(new Point(_arg1, _arg2));
collisionCircleRadii.push(_arg3);
}
public function SetParticle(_arg1:int){
particleExplodeID = _arg1;
}
public function SetHealth(_arg1:Number){
maxHealth = _arg1;
}
public function AddAnim(_arg1:String, _arg2:int){
animNames.push(_arg1);
animIDs.push(_arg2);
}
}
}//package
Section 255
//ObjectDefs (ObjectDefs)
package {
import flash.geom.*;
public class ObjectDefs {
static var list:Array;
public static function Init(){
var _local1:ObjectDef;
list = new Array();
_local1 = new ObjectDef("Player", 0, new Rectangle(-10, -30, 20, 40));
_local1.AddCollisionCircle(0, -17, 15);
_local1.AddCollisionCircle(0, -31, 15);
_local1.AddCollisionCircle(0, -45, 15);
list.push(_local1);
}
public static function GetObjectDefByExportName(_arg1:String){
var _local2:ObjectDef;
var _local3:int;
var _local4:int;
_local4 = list.length;
_local3 = 0;
while (_local3 < _local4) {
_local2 = list[_local3];
if (_local2.exportName == _arg1){
return (_local2);
};
_local3++;
};
trace(("ERROR: ObjectDefs can't find object exportname " + _arg1));
return (null);
}
}
}//package
Section 256
//Particle (Particle)
package {
class Particle {
var graphicID:int;
public var yvel:Number;
var active:Boolean;
var maxframe:int;
var dir:Number;
var mode:int;
public var xvel:Number;
var updateFunction:Function;
var ypos:Number;
var timer:Number;
var speed:Number;
var angle:Number;
var startx:Number;
var starty:Number;
var xpos:Number;
var alpha:Number;
var alphaAdd:Number;
var color:uint;
var frame:Number;
var frameVel:Number;
var visible:Boolean;
var counter:int;
public function InitSpeedLine(_arg1:Number, _arg2:int):void{
angle = _arg1;
frame = 0;
frameVel = Utils.RandBetweenFloat(1, 2);
updateFunction = UpdateSpeedLine;
graphicID = (GraphicObjects.gfx_speedline + _arg2);
maxframe = GraphicObjects.GetNumFrames(graphicID);
timer = 10;
}
public function InitSlime():void{
var _local1:Number;
var _local2:Number;
_local1 = (Utils.RandBetweenFloat(-1, 1) - (Math.PI * 0.5));
_local2 = Utils.RandBetweenFloat(11, 19);
xvel = (Math.cos(_local1) * _local2);
yvel = (Math.sin(_local1) * _local2);
frame = 0;
graphicID = 0;
updateFunction = UpdateSlime;
mode = 0;
}
public function InitDust():void{
frame = 0;
updateFunction = UpdateDust;
graphicID = GraphicObjects.gfx_dust;
timer = 50;
frame = Utils.RandBetweenInt(0, (GraphicObjects.GetNumFrames(graphicID) - 1));
xvel = Utils.RandBetweenFloat(0, 2);
yvel = Utils.RandBetweenFloat(-0.5, 0.5);
}
function UpdateVelsTimer(){
xpos = (xpos + xvel);
ypos = (ypos + yvel);
timer--;
if (timer <= 0){
active = false;
};
}
public function UpdateFireTrail():void{
if (PlayAnimation()){
active = false;
};
}
function PlayAnimation():Boolean{
frame = (frame + frameVel);
if (frame >= maxframe){
frame = maxframe;
return (true);
};
return (false);
}
public function InitFireTrail():void{
frame = 0;
frameVel = 1;
updateFunction = UpdateFireTrail;
graphicID = GraphicObjects.gfx_flame;
maxframe = GraphicObjects.GetNumFrames(graphicID);
}
public function UpdateWater():void{
xpos = (xpos + xvel);
ypos = (ypos + yvel);
yvel = (yvel + 0.3);
timer--;
if (timer <= 0){
};
frame++;
if (frame >= 29){
frame = 29;
active = false;
};
}
public function UpdateDust():void{
xpos = (xpos + xvel);
ypos = (ypos + yvel);
timer--;
if (timer < 0){
active = false;
};
}
public function InitWater():void{
var _local1:Number;
var _local2:Number;
_local1 = Utils.RandCircle();
_local2 = Utils.RandBetweenFloat(3, 5);
xvel = (Math.cos(_local1) * _local2);
yvel = (Math.sin(_local1) * _local2);
frame = 0;
updateFunction = UpdateWater;
mode = 0;
color = 4278190335;
timer = 10;
frame = 20;
}
function UpdateSlime():void{
}
function CycleAnimation():Boolean{
frame = (frame + frameVel);
if (frame >= maxframe){
frame = 0;
return (true);
};
return (false);
}
public function UpdateSpeedLine():void{
if (PlayAnimation()){
active = false;
};
}
function UpdateAnimAndStop(){
xpos = (xpos + xvel);
ypos = (ypos + yvel);
if (PlayAnimation()){
active = false;
};
}
}
}//package
Section 257
//Particles (Particles)
package {
import flash.display.*;
import flash.geom.*;
public class Particles {
public static const type_dust = 0;
static var max:int;
static var list:Array;
static var main:Main;
static var nextIndex:int;
public function Particles():void{
}
public static function Add(_arg1:Number, _arg2:Number):Particle{
var _local3:Number;
var _local4:Number;
var _local5:Particle;
_local5 = list[nextIndex];
nextIndex++;
if (nextIndex >= max){
nextIndex = 0;
};
_local5.active = true;
_local5.timer = 0;
_local5.alpha = 1;
_local5.alphaAdd = 0;
_local5.visible = true;
_local5.xpos = _arg1;
_local5.ypos = _arg2;
_local5.angle = 0;
return (_local5);
}
public static function GetNextIndex():int{
return (nextIndex);
}
public static function Reset(){
var _local1:int;
nextIndex = 0;
_local1 = 0;
while (_local1 < max) {
list[_local1].active = false;
_local1++;
};
}
public static function Update(_arg1:Number){
var _local2:int;
var _local3:Particle;
_local2 = 0;
while (_local2 < max) {
_local3 = list[_local2];
if (_local3.active == true){
_local3.updateFunction();
};
_local2++;
};
}
public static function InitOnce(_arg1:Main, _arg2:int):void{
var _local3:int;
var _local4:int;
main = _arg1;
max = _arg2;
nextIndex = 0;
list = new Array(max);
_local3 = 0;
while (_local3 < max) {
list[_local3] = new Particle();
list[_local3].active = false;
_local3++;
};
}
public static function CountActive():int{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < max) {
if (list[_local2].active){
_local1++;
};
_local2++;
};
return (_local1);
}
public static function Render(_arg1:Main){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:int;
var _local10:BitmapData;
var _local11:Particle;
var _local12:Number;
var _local13:Number;
_local2 = (0 - 16);
_local3 = (Defs.displayarea_w + 16);
_local4 = (0 - 16);
_local5 = (Defs.displayarea_h + 16);
_local6 = Game.scrollX;
_local7 = Game.scrollY;
_local10 = Game.main.scrollScreenBD;
_local8 = 0;
while (_local8 < max) {
_local11 = list[_local8];
if (((_local11.active) && (_local11.visible))){
_local12 = (_local11.xpos - _local6);
_local13 = (_local11.ypos - _local7);
if (_local11.angle == 0){
GraphicObjects.RenderAt(_local11.graphicID, int(_local11.frame), _local10, _local12, _local13);
} else {
GraphicObjects.RenderAtRotScaled(_local11.graphicID, int(_local11.frame), _local10, _local12, _local13, false, 1, _local11.angle);
};
};
_local8++;
};
}
}
}//package
Section 258
//PauseMenu (PauseMenu)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
public class PauseMenu {
static var active:Boolean;
static var pauseMC:MovieClip;
static var main:Main;
public function PauseMenu():void{
}
public static function pressed_buttonRestartLevel(_arg1:MouseEvent){
Unpause();
Game.StartLevelPlay();
}
public static function pressed_buttonMusic(_arg1:MouseEvent){
MusicPlayer.ToggleMute();
SetTicks();
}
public static function IsPaused():Boolean{
return (active);
}
public static function pressed_buttonContinue(_arg1:MouseEvent){
Unpause();
}
public static function pressed_buttonHelp(_arg1:MouseEvent){
Game.InitHelp();
}
public static function InitOnce(_arg1:Main):void{
main = _arg1;
active = false;
}
static function SetTicks(){
if (SoundPlayer.doSFX){
pauseMC.tickSFX.gotoAndStop(2);
} else {
pauseMC.tickSFX.gotoAndStop(1);
};
if (MusicPlayer.doMusic){
pauseMC.tickMusic.gotoAndStop(2);
} else {
pauseMC.tickMusic.gotoAndStop(1);
};
}
public static function Unpause():void{
active = false;
main.removeChild(pauseMC);
pauseMC = null;
KeyReader.InitOnce(Game.main.stage);
}
public static function pressed_buttonSFX(_arg1:MouseEvent){
SoundPlayer.ToggleMute();
SetTicks();
}
public static function Pause():void{
pauseMC = AddMovieClip(0, 0, new PauseMenuScreen());
main.addChild(pauseMC);
pauseMC.buttonSFX.addEventListener(MouseEvent.CLICK, pressed_buttonSFX);
pauseMC.buttonMusic.addEventListener(MouseEvent.CLICK, pressed_buttonMusic);
pauseMC.buttonQuit.addEventListener(MouseEvent.CLICK, pressed_buttonQuit);
pauseMC.buttonRestartLevel.addEventListener(MouseEvent.CLICK, pressed_buttonRestartLevel);
pauseMC.buttonContinue.addEventListener(MouseEvent.CLICK, pressed_buttonContinue);
pauseMC.buttonHelp.addEventListener(MouseEvent.CLICK, pressed_buttonHelp);
active = true;
SetTicks();
}
public static function pressed_buttonQuit(_arg1:MouseEvent){
Unpause();
Game.QuietLoops();
Game.main.SetGameState(Main.gameState_TITLE);
}
static function AddMovieClip(_arg1:Number, _arg2:Number, _arg3:MovieClip):MovieClip{
_arg3.x = _arg1;
_arg3.y = _arg2;
main.addChild(_arg3);
return (_arg3);
}
}
}//package
Section 259
//PauseMenuScreen (PauseMenuScreen)
package {
import flash.display.*;
public dynamic class PauseMenuScreen extends MovieClip {
public var buttonSFX:SimpleButton;
public var buttonRestartLevel:SimpleButton;
public var buttonMusic:SimpleButton;
public var tickMusic:MovieClip;
public var buttonHelp:SimpleButton;
public var buttonQuit:SimpleButton;
public var tickSFX:MovieClip;
public var buttonContinue:SimpleButton;
}
}//package
Section 260
//pedalling (pedalling)
package {
import flash.media.*;
public dynamic class pedalling extends Sound {
}
}//package
Section 261
//PhysEditor (PhysEditor)
package {
import flash.display.*;
import flash.geom.*;
import flash.ui.*;
public class PhysEditor {
static const editMode_Commands1:int = 4;
static const editMode_Library:int = 1;
static const editMode_Normal:int = 0;
static const editMode_Eraser:int = 2;
static const editMode_Commands:int = 3;
static const editMode_Adjust:int = 5;
static const editMode_Lines:int = 6;
static var boxNumW:Number = 5;
static var boxNumH:Number = 4;
static var editor_currentPiece:int = 0;
static var currentLevel:int = 0;
static var renderMiniMap:Boolean = true;
static var library_page:int = 0;
static var prevEditMode:int = 0;
static var scrollX:Number = 0;
static var scrollY:Number = 0;
static var renderObjects:Boolean = true;
static var currentLineIndex:int;
public static var currentAdjustObject:PhysObj_Instance;
static var editMode:int = 0;
static var editor_currentPieceRot:Number = 0;
static var boxSizeH:Number = (Defs.displayarea_h / boxNumH);
static var guideLines:Array;
static var boxSizeW:Number = (Defs.displayarea_w / boxNumW);
static var currentPointIndex:int;
static var updateTimer:int = 0;
public static function Editor_PreviousLevel():void{
currentLevel--;
if (currentLevel < 0){
currentLevel = 0;
};
currentLineIndex = -1;
currentPointIndex = -1;
}
static function Editor_GetNearbyGuidelines(_arg1:PhysObj_Instance, _arg2:Number, _arg3:Number, _arg4:Number=50){
var _local5:Number;
var _local6:PhysObj_Body;
var _local7:PhysObj_Shape;
var _local8:Point;
var _local9:Point;
var _local10:Array;
var _local11:Matrix;
var _local12:Array;
var _local13:PhysObj_Instance;
var _local14:PhysObj;
var _local15:Point;
var _local16:Point;
var _local17:PhysObj;
var _local18:Point;
var _local19:Number;
var _local20:Number;
var _local21:Boolean;
var _local22:PhysEd_GuideLine;
_local5 = 3;
_local10 = GetCurrentLevelInstances();
_local11 = new Matrix();
_local12 = new Array();
if (_arg1 != null){
_local14 = Game.physObjs.FindByName(_arg1.typeName);
if (_local14 != null){
for each (_local6 in _local14.bodies) {
for each (_local7 in _local6.shapes) {
if (_local7.type == PhysObj_Shape.Type_Poly){
for each (_local8 in _local7.poly_points) {
_local11.identity();
_local11.rotate(Utils.DegToRad(_arg1.rot));
_local15 = new Point(_local8.x, _local8.y);
_local15 = _local11.transformPoint(_local15);
_local16 = new Point(((_local15.x + _arg1.x) + _local6.pos.x), ((_local15.y + _arg1.y) + _local6.pos.y));
_local12.push(_local16);
};
};
};
};
};
} else {
_local12.push(new Point(_arg2, _arg3));
};
guideLines = new Array();
for each (_local13 in _local10) {
if (_local13 != _arg1){
_local17 = Game.physObjs.FindByName(_local13.typeName);
if (_local17 != null){
for each (_local6 in _local17.bodies) {
for each (_local7 in _local6.shapes) {
if (_local7.type == PhysObj_Shape.Type_Poly){
for each (_local8 in _local7.poly_points) {
_local11.identity();
_local11.rotate(Utils.DegToRad(_local13.rot));
_local15 = new Point(_local8.x, _local8.y);
_local15 = _local11.transformPoint(_local15);
_local18 = new Point(((_local15.x + _local13.x) + _local6.pos.x), ((_local15.y + _local13.y) + _local6.pos.y));
for each (_local9 in _local12) {
_local19 = Math.abs((_local18.x - _local9.x));
_local20 = Math.abs((_local18.y - _local9.y));
_local21 = false;
if ((((_local20 < _local5)) && ((_local19 < _arg4)))){
_local21 = false;
if (Math.floor(_local18.y) == Math.floor(_local9.y)){
_local21 = true;
};
_local22 = new PhysEd_GuideLine((_local18.x - 100), (_local18.x + 100), _local18.y, 0, _local21);
guideLines.push(_local22);
};
if ((((_local19 < _local5)) && ((_local20 < _arg4)))){
_local21 = false;
if (Math.floor(_local18.x) == Math.floor(_local9.x)){
_local21 = true;
};
_local22 = new PhysEd_GuideLine((_local18.y - 100), (_local18.y + 100), _local18.x, 1, _local21);
guideLines.push(_local22);
};
};
};
};
};
};
};
};
};
}
static function Library_PickPiece(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:PhysObj;
_local1 = MouseControl.mousePosX;
_local2 = MouseControl.mousePosY;
_local3 = (_local1 / boxSizeW);
_local4 = (_local2 / boxSizeH);
_local5 = (_local3 + (_local4 * boxNumW));
_local6 = (boxNumW * boxNumH);
_local5 = (_local5 + (library_page * _local6));
_local7 = (Game.physObjs.GetNum() - 1);
if (_local5 > _local7){
_local5 = _local7;
};
_local8 = 0;
_local9 = 0;
_local10 = 0;
for each (_local11 in Game.physObjs.list) {
if (_local8 == _local5){
_local10 = _local9;
};
if (_local11.displayInLibrary){
_local8++;
};
_local9++;
};
editor_currentPiece = _local10;
editor_currentPieceRot = 0;
}
static function Editor_RenderLineToCursor(){
var _local1:Level;
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Point;
var _local7:BitmapData;
_local1 = GetCurrentLevel();
if (currentLineIndex == -1){
return;
};
if (_local1.lines.length == 0){
return;
};
if (currentLineIndex >= _local1.lines.length){
return;
};
_local2 = _local1.lines[currentLineIndex];
_local3 = MouseControl.mousePosX;
_local4 = MouseControl.mousePosY;
if (_local2.length == 0){
return;
};
_local5 = (_local2.length - 1);
_local6 = _local2[_local5].clone();
_local2[_local5].clone().x = (_local6.x - scrollX);
_local6.y = (_local6.y - scrollY);
_local7 = Game.main.screenBD;
Utils.RenderDotLine(_local7, _local3, _local4, _local6.x, _local6.y, 200, 4278255615);
}
static function Lines_SelectLine(_arg1:Number, _arg2:Number){
var _local3:Array;
var _local4:Level;
var _local5:int;
var _local6:Point;
_local3 = new Array();
_local4 = GetCurrentLevel();
_local4.lines.push(_local3);
_local5 = 0;
currentLineIndex = -1;
for each (_local3 in _local4.lines) {
for each (_local6 in _local3) {
if (Utils.DistBetweenPoints(_local6.x, _local6.y, _arg1, _arg2) < 3){
currentLineIndex = _local5;
return;
};
};
_local5++;
};
}
static function SetCurrentLevelInstances(_arg1:Array):void{
Game.levels[currentLevel].instances = _arg1;
}
static function Lines_MovePoints(_arg1:Number, _arg2:Number){
var _local3:Level;
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Point;
if (currentLineIndex == -1){
return;
};
_local3 = GetCurrentLevel();
_local4 = _local3.lines[currentLineIndex];
_local5 = 100;
for each (_local7 in _local4) {
_local6 = Utils.DistBetweenPoints(_local7.x, _local7.y, _arg1, _arg2);
if (_local6 < _local5){
_local6 = (_local5 - _local6);
_local6 = Utils.ScaleTo(0, 5, 0, _local5, _local6);
if (_local7.y < _arg2){
_local7.y = (_local7.y - _local6);
} else {
if (_local7.y > _arg2){
_local7.y = (_local7.y + _local6);
};
};
};
};
}
static function Lines_ScrollToLastPointOfSelectedLine(){
var _local1:Level;
var _local2:Array;
var _local3:Point;
if (currentLineIndex == -1){
return;
};
_local1 = GetCurrentLevel();
_local2 = _local1.lines[currentLineIndex];
_local3 = _local2[(_local2.length - 1)];
scrollX = (_local3.x - (Defs.displayarea_w * 0.5));
scrollY = (_local3.y - (Defs.displayarea_h * 0.5));
}
static function UpdateScroll(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (KeyReader.Down(KeyReader.KEY_SHIFT) == false){
_local1 = 50;
_local2 = 0;
_local3 = 0;
if (KeyReader.Down(KeyReader.KEY_CONTROL)){
_local1 = (_local1 * 0.2);
};
if (KeyReader.Down(KeyReader.KEY_LEFT)){
_local2 = -(_local1);
};
if (KeyReader.Down(KeyReader.KEY_RIGHT)){
_local2 = _local1;
};
if (KeyReader.Down(KeyReader.KEY_UP)){
_local3 = -(_local1);
};
if (KeyReader.Down(KeyReader.KEY_DOWN)){
_local3 = _local1;
};
scrollX = (scrollX + _local2);
scrollY = (scrollY + _local3);
};
}
static function GetCurrentLevelInstances():Array{
return (Game.levels[currentLevel].instances);
}
static function Lines_DeletePoint(_arg1:Number, _arg2:Number){
var _local3:Level;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Array;
var _local8:int;
var _local9:Point;
var _local10:Array;
var _local11:Array;
var _local12:int;
var _local13:Array;
_local3 = GetCurrentLevel();
_local4 = 0;
_local5 = -1;
_local6 = -1;
for each (_local7 in _local3.lines) {
_local8 = 0;
for each (_local9 in _local7) {
if (Utils.DistBetweenPoints(_local9.x, _local9.y, _arg1, _arg2) < 3){
_local5 = _local4;
_local6 = _local8;
};
_local8++;
};
_local4++;
};
if (((!((_local5 == -1))) && (!((_local6 == -1))))){
_local10 = _local3.lines[_local5];
_local11 = new Array();
_local12 = 0;
while (_local12 < _local10.length) {
if (_local12 != _local6){
_local11.push(_local10[_local12].clone());
};
_local12++;
};
_local3.lines[_local5] = _local11;
_local13 = new Array();
for each (_local10 in _local3.lines) {
if (_local10.length != 0){
_local13.push(_local10);
} else {
currentLineIndex = -1;
};
};
_local3.lines = _local13;
currentPointIndex = -1;
};
}
static function Editor_RenderNearbyGuidelines(){
var _local1:BitmapData;
var _local2:PhysEd_GuideLine;
var _local3:uint;
_local1 = Game.main.screenBD;
for each (_local2 in guideLines) {
_local3 = 4294901760;
if (_local2.level){
_local3 = 4278255615;
};
Utils.RenderDotLine(_local1, (_local2.x0 - scrollX), (_local2.y0 - scrollY), (_local2.x1 - scrollX), (_local2.y1 - scrollY), 100, _local3);
};
}
public static function UpdateEditor():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:PhysObj;
var _local6:Level;
var _local7:PhysObj_Instance;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Point;
var _local17:String;
var _local18:Array;
var _local19:Number;
var _local20:Number;
var _local21:Point;
updateTimer++;
_local1 = MouseControl.mousePosX;
_local2 = MouseControl.mousePosY;
_local3 = (MouseControl.mousePosX + scrollX);
_local4 = (MouseControl.mousePosY + scrollY);
_local6 = GetCurrentLevel();
if (editMode == editMode_Commands){
if (KeyReader.Pressed(KeyReader.KEY_1)){
editMode = editMode_Normal;
};
if (KeyReader.Pressed(KeyReader.KEY_2)){
editMode = editMode_Library;
library_page++;
if (library_page >= GetNumLibraryPages()){
library_page = 0;
};
};
if (KeyReader.Pressed(KeyReader.KEY_3)){
editMode = editMode_Eraser;
};
if (KeyReader.Pressed(KeyReader.KEY_5)){
currentAdjustObject = null;
editMode = editMode_Adjust;
};
if (KeyReader.Pressed(KeyReader.KEY_6)){
editMode = editMode_Lines;
};
if (KeyReader.Pressed(KeyReader.KEY_SPACE)){
editMode = editMode_Commands1;
};
return;
};
if (editMode == editMode_Commands1){
if (KeyReader.Pressed(KeyReader.KEY_1)){
Editor_ClearLevel();
editMode = prevEditMode;
};
if (KeyReader.Pressed(KeyReader.KEY_2)){
Editor_AddLevel();
editMode = prevEditMode;
};
if (KeyReader.Pressed(KeyReader.KEY_9)){
Game.StartLevelPlay();
return;
};
if (KeyReader.Pressed(KeyReader.KEY_4)){
ExportLevelAsXml();
editMode = prevEditMode;
};
if (KeyReader.Pressed(KeyReader.KEY_5)){
ExportAllLevelsAsXml();
editMode = prevEditMode;
};
if (KeyReader.Pressed(KeyReader.KEY_SPACE)){
editMode = prevEditMode;
};
return;
};
if (KeyReader.Pressed(KeyReader.KEY_8)){
Editor_PreviousLevel();
};
if (KeyReader.Pressed(KeyReader.KEY_9)){
Editor_NextLevel();
};
if (KeyReader.Pressed(KeyReader.KEY_X)){
renderMiniMap = (renderMiniMap == false);
};
if (KeyReader.Pressed(KeyReader.KEY_SPACE)){
prevEditMode = editMode;
editMode = editMode_Commands;
};
if (editMode == editMode_Library){
if (MouseControl.buttonPressed){
MouseControl.buttonPressed = false;
Library_PickPiece();
editMode = editMode_Normal;
};
return;
};
if (editMode == editMode_Eraser){
if (MouseControl.buttonPressed){
MouseControl.buttonPressed = false;
_local7 = HitTestPhysObjGraphics(_local1, _local2);
if (_local7){
RemoveFromLevelInstances(_local7);
};
};
UpdateScroll();
return;
};
if (editMode == editMode_Adjust){
if (MouseControl.buttonPressed){
MouseControl.buttonPressed = false;
_local7 = HitTestPhysObjGraphics(_local1, _local2);
if (_local7){
currentAdjustObject = _local7;
} else {
currentAdjustObject = null;
};
};
if (currentAdjustObject != null){
_local8 = 1;
_local9 = 1;
_local10 = 0;
_local11 = 0;
_local12 = 0;
if (KeyReader.Down(KeyReader.KEY_CONTROL)){
_local8 = (_local8 * 10);
_local9 = (_local9 * 10);
};
if (KeyReader.Down(KeyReader.KEY_SHIFT)){
if (KeyReader.Down(KeyReader.KEY_LEFT)){
_local11 = -(_local8);
};
if (KeyReader.Down(KeyReader.KEY_RIGHT)){
_local11 = _local8;
};
if (KeyReader.Down(KeyReader.KEY_UP)){
_local12 = -(_local8);
};
if (KeyReader.Down(KeyReader.KEY_DOWN)){
_local12 = _local8;
};
currentAdjustObject.x = (currentAdjustObject.x + _local11);
currentAdjustObject.y = (currentAdjustObject.y + _local12);
};
if (KeyReader.Down(KeyReader.KEY_6)){
_local10 = -(_local9);
};
if (KeyReader.Down(KeyReader.KEY_7)){
_local10 = _local9;
};
currentAdjustObject.rot = (currentAdjustObject.rot + _local10);
};
UpdateScroll();
return;
};
if (editMode == editMode_Lines){
if (MouseControl.buttonPressed){
if (KeyReader.Down(KeyReader.KEY_7)){
Lines_MovePoints(_local3, _local4);
return;
};
MouseControl.buttonPressed = false;
if (KeyReader.Down(KeyReader.KEY_1)){
Lines_SelectLine(_local3, _local4);
return;
};
if (KeyReader.Down(KeyReader.KEY_2)){
Lines_DeletePoint(_local3, _local4);
return;
};
if (KeyReader.Down(KeyReader.KEY_3)){
Lines_InsertPoint(_local3, _local4);
return;
};
if (KeyReader.Down(KeyReader.KEY_4)){
Lines_SelectPoint(_local3, _local4);
return;
};
if (KeyReader.Down(KeyReader.KEY_5)){
Lines_NewLine();
};
if (KeyReader.Down(KeyReader.KEY_6)){
Lines_Subdivide(_local3, _local4);
return;
};
Lines_AddPoint(_local3, _local4);
};
if (KeyReader.Pressed(KeyReader.KEY_LEFTSQUAREBRACKET)){
Lines_ScrollToFirstPointOfSelectedLine();
};
if (KeyReader.Pressed(KeyReader.KEY_RIGHTSQUAREBRACKET)){
Lines_ScrollToLastPointOfSelectedLine();
};
if (((!((currentLineIndex == -1))) && (!((currentPointIndex == -1))))){
_local13 = 1;
_local14 = 0;
_local15 = 0;
if (KeyReader.Down(KeyReader.KEY_CONTROL)){
_local13 = (_local13 * 10);
};
if (KeyReader.Down(KeyReader.KEY_SHIFT)){
if (KeyReader.Down(KeyReader.KEY_LEFT)){
_local14 = -(_local13);
};
if (KeyReader.Down(KeyReader.KEY_RIGHT)){
_local14 = _local13;
};
if (KeyReader.Down(KeyReader.KEY_UP)){
_local15 = -(_local13);
};
if (KeyReader.Down(KeyReader.KEY_DOWN)){
_local15 = _local13;
};
};
_local16 = _local6.lines[currentLineIndex][currentPointIndex];
_local6.lines[currentLineIndex][currentPointIndex].x = (_local16.x + _local14);
_local16.y = (_local16.y + _local15);
};
UpdateScroll();
return;
};
if (editMode == editMode_Normal){
if (KeyReader.Down(KeyReader.KEY_SHIFT) == true){
if (KeyReader.Pressed(KeyReader.KEY_UP)){
editor_currentPiece++;
if (editor_currentPiece > (Game.physObjs.GetNum() - 1)){
editor_currentPiece = 0;
};
};
if (KeyReader.Pressed(KeyReader.KEY_DOWN)){
editor_currentPiece--;
if (editor_currentPiece < 0){
editor_currentPiece = (Game.physObjs.GetNum() - 1);
};
};
_local9 = 1;
if (KeyReader.Down(KeyReader.KEY_CONTROL) == false){
_local9 = (_local9 * 10);
};
if (KeyReader.Down(KeyReader.KEY_LEFT)){
editor_currentPieceRot = (editor_currentPieceRot - _local9);
};
if (KeyReader.Down(KeyReader.KEY_RIGHT)){
editor_currentPieceRot = (editor_currentPieceRot + _local9);
};
};
_local5 = Game.physObjs.GetByIndex(editor_currentPiece);
_local17 = _local5.name;
if (MouseControl.buttonPressed){
MouseControl.buttonPressed = false;
_local18 = GetCurrentLevelInstances();
_local19 = _local3;
_local20 = _local4;
if (KeyReader.Down(KeyReader.KEY_1)){
_local21 = SnapToObjects(_local3, _local4);
if (_local21 != null){
trace(((((((("snapped to point :" + _local3) + " ") + _local4) + " -> ") + _local21.x) + " ") + _local21.y));
_local19 = _local21.x;
_local20 = _local21.y;
};
};
_local18.push(Game.CreatePhysObjInstanceAt(_local17, _local19, _local20, editor_currentPieceRot, ""));
SetCurrentLevelInstances(_local18);
};
UpdateScroll();
};
}
static function Editor_RenderLines(){
var _local1:Level;
var _local2:BitmapData;
var _local3:int;
var _local4:Array;
var _local5:uint;
var _local6:int;
var _local7:Point;
var _local8:Point;
var _local9:Rectangle;
_local1 = GetCurrentLevel();
_local2 = Game.main.screenBD;
_local3 = 0;
for each (_local4 in _local1.lines) {
_local5 = 4290822336;
if (_local3 == currentLineIndex){
_local5 = 4294967295;
};
if (_local4.length >= 2){
_local6 = 0;
while (_local6 < (_local4.length - 1)) {
_local7 = _local4[_local6].clone();
_local8 = _local4[(_local6 + 1)].clone();
Utils.RenderDotLine(_local2, (_local7.x - scrollX), (_local7.y - scrollY), (_local8.x - scrollX), (_local8.y - scrollY), 200, _local5);
_local6++;
};
};
_local6 = 0;
while (_local6 < _local4.length) {
_local5 = 4294901760;
if ((((_local3 == currentLineIndex)) && ((currentPointIndex == _local6)))){
_local5 = 4294967040;
};
_local9 = new Rectangle(((_local4[_local6].x - 2) - scrollX), ((_local4[_local6].y - 2) - scrollY), 4, 4);
Utils.RenderRectangle(_local2, _local9, _local5);
_local6++;
};
_local3++;
};
}
static function Lines_NewLine(){
var _local1:Array;
var _local2:Level;
_local1 = new Array();
_local2 = GetCurrentLevel();
_local2.lines.push(_local1);
currentLineIndex = (_local2.lines.length - 1);
}
public static function InitEditor():void{
var _local1:Level;
Mouse.show();
Game.InitBox2D();
GameObjects.ClearAll();
updateTimer = 0;
editMode = editMode_Normal;
currentLineIndex = -1;
currentPointIndex = -1;
_local1 = GetCurrentLevel();
currentLineIndex = (_local1.lines.length - 1);
}
static function Editor_RenderMiniMap(){
var _local1:Number;
var _local2:Array;
var _local3:BitmapData;
var _local4:PhysObj_Instance;
var _local5:PhysObj;
_local1 = (1 / 20);
_local2 = GetCurrentLevelInstances();
_local3 = Game.main.screenBD;
for each (_local4 in _local2) {
_local5 = Game.physObjs.FindByName(_local4.typeName);
if (_local5 != null){
PhysObj.RenderAt(_local5, (_local4.x - scrollX), ((_local4.y - scrollY) + (240 / _local1)), _local4.rot, _local3, false, _local1);
};
};
}
static function Lines_Subdivide(_arg1:Number, _arg2:Number){
var _local3:Level;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Array;
var _local8:int;
var _local9:Point;
var _local10:int;
var _local11:int;
var _local12:Array;
var _local13:int;
var _local14:Array;
var _local15:int;
var _local16:Point;
var _local17:Point;
var _local18:Point;
if ((((currentLineIndex == -1)) || ((currentPointIndex == -1)))){
return;
};
_local3 = GetCurrentLevel();
_local4 = 0;
_local5 = -1;
_local6 = -1;
for each (_local7 in _local3.lines) {
_local8 = 0;
for each (_local9 in _local7) {
if (Utils.DistBetweenPoints(_local9.x, _local9.y, _arg1, _arg2) < 3){
_local5 = _local4;
_local6 = _local8;
};
_local8++;
};
_local4++;
};
trace(((_local6 + " ") + currentPointIndex));
if (((!((_local5 == -1))) && (!((_local6 == -1))))){
if (_local6 == currentPointIndex){
return;
};
_local10 = currentPointIndex;
_local11 = _local6;
if (_local11 < _local10){
_local15 = _local10;
_local11 = _local10;
_local10 = _local15;
};
trace(((("subdividing betwen " + _local10) + " and ") + _local11));
_local12 = new Array();
_local7 = _local3.lines[_local5];
_local13 = _local10;
while (_local13 < _local11) {
_local16 = _local7[_local13].clone();
_local17 = _local7[(_local13 + 1)].clone();
_local18 = new Point(((_local16.x + _local17.x) / 2), ((_local16.y + _local17.y) / 2));
_local12.push(_local18);
_local12.push(_local17);
_local13++;
};
_local14 = new Array();
_local13 = 0;
while (_local13 <= _local10) {
_local14.push(_local7[_local13].clone());
_local13++;
};
for each (_local18 in _local12) {
_local14.push(_local18.clone());
};
_local13 = (_local11 + 1);
while (_local13 < _local7.length) {
_local14.push(_local7[_local13].clone());
_local13++;
};
_local3.lines[_local5] = _local14;
};
}
public static function Editor_ClearLevel():void{
var _local1:Array;
_local1 = new Array();
Game.levels[currentLevel].instances = _local1;
currentLineIndex = -1;
currentPointIndex = -1;
}
static function RenderEditor(){
var _local1:int;
var _local2:int;
var _local3:Number;
var _local4:String;
var _local5:BitmapData;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:PhysObj;
var _local18:PhysObj;
var _local19:PhysObj_Instance;
_local5 = Game.main.screenBD;
_local6 = MouseControl.mousePosX;
_local7 = MouseControl.mousePosY;
_local8 = (MouseControl.mousePosX + scrollX);
_local9 = (MouseControl.mousePosY + scrollY);
if (editMode == editMode_Commands){
_local5.fillRect(Defs.screenRect, 4285542576);
};
if (editMode == editMode_Commands1){
_local5.fillRect(Defs.screenRect, 4285542592);
};
if (editMode == editMode_Library){
_local5.fillRect(Defs.screenRect, 4284498112);
_local10 = 0;
_local11 = 0;
_local10 = 0;
while (_local10 < Defs.displayarea_w) {
Utils.RenderDotLine(_local5, _local10, 0, _local10, 640, 100, 4282433600);
_local10 = (_local10 + boxSizeW);
};
_local10 = 0;
while (_local10 < Defs.displayarea_h) {
Utils.RenderDotLine(_local5, 0, _local10, 640, _local10, 100, 4282433600);
_local10 = (_local10 + boxSizeH);
};
_local12 = (boxNumW * boxNumH);
_local13 = (library_page * _local12);
_local14 = (_local13 + (_local12 - 1));
_local10 = 0;
_local11 = 0;
_local15 = Game.physObjs.GetNum();
_local16 = 0;
for each (_local17 in Game.physObjs.list) {
if (_local17.displayInLibrary){
if ((((_local16 >= _local13)) && ((_local16 <= _local14)))){
PhysObj.RenderAt(_local17, (_local10 + (boxSizeW / 2)), (_local11 + (boxSizeH / 2)), 0, _local5);
_local4 = _local17.name;
GraphicObjects.RenderStringAt(_local5, GraphicObjects.gfx_font1, (_local10 + 8), ((_local11 + boxSizeH) - 16), _local4, null);
_local10 = (_local10 + boxSizeW);
if (_local10 >= Defs.displayarea_w){
_local10 = 0;
_local11 = (_local11 + boxSizeH);
};
};
};
_local16++;
};
};
if (editMode == editMode_Eraser){
_local5.fillRect(Defs.screenRect, 4281549909);
GraphicObjects.RenderAt(GraphicObjects.gfx_backgrounds, 0, _local5, -(scrollX), -(scrollY));
if (renderObjects){
Editor_RenderObjects();
};
if (renderMiniMap){
Editor_RenderMiniMap();
};
Editor_RenderLines();
};
if (editMode == editMode_Normal){
_local5.fillRect(Defs.screenRect, 4282668390);
GraphicObjects.RenderAt(GraphicObjects.gfx_backgrounds, 0, _local5, -(scrollX), -(scrollY));
if (renderObjects){
Editor_RenderObjects();
};
if (renderMiniMap){
Editor_RenderMiniMap();
};
Editor_RenderLines();
_local18 = Game.physObjs.GetByIndex(editor_currentPiece);
PhysObj.RenderAt(_local18, _local6, _local7, editor_currentPieceRot, _local5);
if (_local18 != null){
_local19 = Game.CreatePhysObjInstanceAt(_local18.name, _local8, _local9, editor_currentPieceRot, "");
Editor_GetNearbyGuidelines(_local19, 0, 0);
Editor_RenderNearbyGuidelines();
};
};
if (editMode == editMode_Adjust){
_local5.fillRect(Defs.screenRect, 4282668390);
GraphicObjects.RenderAt(GraphicObjects.gfx_backgrounds, 0, _local5, -(scrollX), -(scrollY));
if (renderObjects){
Editor_RenderObjects_AdjustMode();
};
if (renderMiniMap){
Editor_RenderMiniMap();
};
Editor_RenderLines();
if (currentAdjustObject != null){
Editor_GetNearbyGuidelines(currentAdjustObject, 0, 0);
Editor_RenderNearbyGuidelines();
};
};
if (editMode == editMode_Lines){
_local5.fillRect(Defs.screenRect, 4282668390);
GraphicObjects.RenderAt(GraphicObjects.gfx_backgrounds, 0, _local5, -(scrollX), -(scrollY));
if (renderObjects){
Editor_RenderObjects();
};
if (renderMiniMap){
Editor_RenderMiniMap();
};
Editor_RenderLines();
Editor_RenderLineToCursor();
};
RenderPanel_Editor();
}
public static function HitTestPhysObjGraphics(_arg1:Number, _arg2:Number):PhysObj_Instance{
var _local3:Array;
var _local4:PhysObj_Instance;
var _local5:BitmapData;
var _local6:PhysObj;
var _local7:uint;
_local3 = GetCurrentLevelInstances();
for each (_local4 in _local3) {
_local5 = Game.main.screenBD;
_local5.fillRect(Defs.screenRect, 0);
_local6 = Game.physObjs.FindByName(_local4.typeName);
PhysObj.RenderAt(_local6, (_local4.x - scrollX), (_local4.y - scrollY), _local4.rot, _local5);
_local7 = _local5.getPixel32(_arg1, _arg2);
if (_local7 != 0){
return (_local4);
};
};
return (null);
}
static function Editor_RenderObjects(){
var _local1:Array;
var _local2:BitmapData;
var _local3:PhysObj_Instance;
var _local4:PhysObj;
_local1 = GetCurrentLevelInstances();
_local2 = Game.main.screenBD;
for each (_local3 in _local1) {
_local4 = Game.physObjs.FindByName(_local3.typeName);
if (_local4 != null){
PhysObj.RenderAt(_local4, (_local3.x - scrollX), (_local3.y - scrollY), _local3.rot, _local2);
};
};
}
static function Lines_ScrollToFirstPointOfSelectedLine(){
var _local1:Level;
var _local2:Array;
var _local3:Point;
if (currentLineIndex == -1){
return;
};
_local1 = GetCurrentLevel();
_local2 = _local1.lines[currentLineIndex];
_local3 = _local2[0];
scrollX = (_local3.x - (Defs.displayarea_w * 0.5));
scrollY = (_local3.y - (Defs.displayarea_h * 0.5));
}
static function SnapToObjects(_arg1:Number, _arg2:Number):Point{
var _local3:PhysObj;
var _local4:PhysObj_Instance;
var _local5:BitmapData;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:PhysEd_GuideLine;
var _local10:Point;
_local3 = Game.physObjs.GetByIndex(editor_currentPiece);
if (_local3 == null){
return (null);
};
_local4 = Game.CreatePhysObjInstanceAt(_local3.name, _arg1, _arg2, editor_currentPieceRot, "");
Editor_GetNearbyGuidelines(null, _arg1, _arg2, 20);
trace(("guidelines: " + guideLines.length));
_local5 = Game.main.screenBD;
_local6 = 99999999;
_local7 = _local6;
_local8 = _local6;
for each (_local9 in guideLines) {
if (_local9.type == 1){
if (Math.abs((_local9.x0 - _arg1)) < _local7){
_local7 = _local9.x0;
};
} else {
if (Math.abs((_local9.y0 - _arg2)) < _local8){
_local8 = _local9.y0;
};
};
};
if (((!((_local7 == _local6))) && (!((_local8 == _local6))))){
_local10 = new Point(_local7, _local8);
return (_local10);
};
return (null);
}
static function CountLibraryPieces():int{
var _local1:int;
var _local2:PhysObj;
_local1 = 0;
for each (_local2 in Game.physObjs.list) {
if (_local2.displayInLibrary){
_local1++;
};
};
return (_local1);
}
static function Editor_RenderObjects_AdjustMode(){
var _local1:Array;
var _local2:BitmapData;
var _local3:PhysObj_Instance;
var _local4:PhysObj;
_local1 = GetCurrentLevelInstances();
_local2 = Game.main.screenBD;
for each (_local3 in _local1) {
_local4 = Game.physObjs.FindByName(_local3.typeName);
if (_local3 == currentAdjustObject){
if ((updateTimer & 2)){
PhysObj.RenderAt(_local4, (_local3.x - scrollX), (_local3.y - scrollY), _local3.rot, _local2);
};
} else {
PhysObj.RenderAt(_local4, (_local3.x - scrollX), (_local3.y - scrollY), _local3.rot, _local2);
};
};
}
public static function ExportLevelAsXml(){
var _local1:Level;
var _local2:String;
var _local3:String;
var _local4:int;
var _local5:Array;
var _local6:PhysObj_Instance;
var _local7:Point;
var _local8:Array;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:String;
_local1 = GetCurrentLevel();
_local2 = "";
_local3 = "";
_local2 = (("<level name=\"" + _local1.name) + "\"");
_local2 = (_local2 + ((" category=\"" + _local1.category.toString()) + "\""));
_local2 = (_local2 + ((" fillframe=\"" + _local1.fillFrame.toString()) + "\""));
_local2 = (_local2 + ((" surfaceframe=\"" + _local1.surfaceFrame.toString()) + "\""));
_local2 = (_local2 + ((" surfacethickness=\"" + _local1.surfaceThickness.toString()) + "\""));
_local2 = (_local2 + ((" type=\"" + _local1.eventType.toString()) + "\""));
_local2 = (_local2 + ((" opponents=\"" + _local1.eventOpponentsString.toString()) + "\""));
_local2 = (_local2 + ((" win=\"" + _local1.eventWinParam.toString()) + "\""));
_local2 = (_local2 + ((" exclusivechar=\"" + _local1.exclusiveChar.toString()) + "\""));
_local2 = (_local2 + " >");
_local3 = (_local3 + (_local2 + "\n"));
trace(_local2);
for each (_local4 in _local1.helpscreenFrames) {
_local2 = (("<helpscreen frame=\"" + _local4) + "\" />");
_local3 = (_local3 + (_local2 + "\n"));
trace(_local2);
};
_local5 = GetCurrentLevelInstances();
for each (_local6 in _local5) {
_local2 = (((((((("<obj type=\"" + _local6.typeName) + "\" x=\"") + _local6.x) + "\" y=\"") + _local6.y) + "\" rot=\"") + _local6.rot) + "\" />");
_local3 = (_local3 + (_local2 + "\n"));
trace(_local2);
};
for each (_local8 in _local1.lines) {
_local2 = "<line>";
_local3 = (_local3 + (_local2 + "\n"));
trace(_local2);
_local11 = _local8.length;
_local12 = 10;
_local13 = (_local11 / _local12);
_local14 = (_local11 % _local12);
_local15 = 0;
_local9 = 0;
while (_local9 < _local13) {
_local16 = "<points a=\"";
_local10 = 0;
while (_local10 < _local12) {
var _temp1 = _local15;
_local15 = (_local15 + 1);
_local7 = _local8[_temp1];
_local16 = (_local16 + ((_local7.x + ",") + _local7.y));
if (_local10 != (_local12 - 1)){
_local16 = (_local16 + ", ");
};
_local10++;
};
_local16 = (_local16 + "\" />");
_local2 = _local16;
_local3 = (_local3 + (_local2 + "\n"));
trace(_local2);
_local9++;
};
if (_local14 != 0){
_local16 = "<points a=\"";
_local10 = 0;
while (_local10 < _local14) {
var _temp2 = _local15;
_local15 = (_local15 + 1);
_local7 = _local8[_temp2];
_local16 = (_local16 + ((_local7.x + ",") + _local7.y));
if (_local10 != (_local14 - 1)){
_local16 = (_local16 + ", ");
};
_local10++;
};
_local16 = (_local16 + "\" />");
_local2 = _local16;
_local3 = (_local3 + (_local2 + "\n"));
trace(_local2);
};
_local2 = "</line>";
_local3 = (_local3 + (_local2 + "\n"));
trace(_local2);
};
_local2 = "</level>";
_local3 = (_local3 + (_local2 + "\n"));
trace(_local2);
ExternalData.OutputString(_local3);
}
static function Lines_InsertPoint(_arg1:Number, _arg2:Number){
var _local3:Level;
var _local4:Point;
var _local5:Array;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Array;
var _local10:int;
var _local11:Array;
var _local12:Point;
var _local13:Point;
var _local14:Point;
_local3 = GetCurrentLevel();
_local4 = new Point(_arg1, _arg2);
_local5 = _local3.lines[currentLineIndex];
_local3 = GetCurrentLevel();
_local6 = 0;
_local7 = -1;
_local8 = -1;
for each (_local9 in _local3.lines) {
_local10 = 0;
for each (_local4 in _local9) {
if (Utils.DistBetweenPoints(_local4.x, _local4.y, _arg1, _arg2) < 3){
_local7 = _local6;
_local8 = _local10;
};
_local10++;
};
_local6++;
};
if (((!((_local7 == -1))) && (!((_local8 == -1))))){
_local11 = _local3.lines[_local7];
if (_local8 == (_local11.length - 1)){
return;
};
_local12 = _local11[_local8].clone();
_local13 = _local11[(_local8 + 1)].clone();
_local14 = new Point(0, 0);
_local14.x = ((_local12.x + _local13.x) * 0.5);
_local14.y = ((_local12.y + _local13.y) * 0.5);
trace(_local8);
_local11.splice((_local8 + 1), 0, _local14);
_local3.lines[_local7] = _local11;
};
}
static function GetNumLibraryPages():int{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = (boxNumW * boxNumH);
_local2 = CountLibraryPieces();
_local3 = (_local2 / _local1);
_local4 = (_local2 % _local1);
if (_local4 != 0){
_local3++;
};
return (_local3);
}
static function Lines_AddPoint(_arg1:Number, _arg2:Number){
var _local3:Level;
var _local4:Point;
var _local5:Array;
if (currentLineIndex == -1){
return;
};
_local3 = GetCurrentLevel();
_local4 = new Point(_arg1, _arg2);
_local5 = _local3.lines[currentLineIndex];
_local5.push(_local4);
_local3.lines[currentLineIndex] = _local5;
}
public static function ExportAllLevelsAsXml(){
var _local1:int;
var _local2:int;
_local2 = currentLevel;
_local1 = 0;
while (_local1 < Game.levels.length) {
currentLevel = _local1;
ExportLevelAsXml();
_local1++;
};
currentLevel = _local2;
}
static function Lines_SelectPoint(_arg1:Number, _arg2:Number){
var _local3:Array;
var _local4:Level;
var _local5:int;
var _local6:int;
var _local7:Point;
_local3 = new Array();
_local4 = GetCurrentLevel();
_local4.lines.push(_local3);
_local5 = 0;
currentLineIndex = -1;
currentPointIndex = -1;
for each (_local3 in _local4.lines) {
_local6 = 0;
for each (_local7 in _local3) {
if (Utils.DistBetweenPoints(_local7.x, _local7.y, _arg1, _arg2) < 3){
currentLineIndex = _local5;
currentPointIndex = _local6;
return;
};
_local6++;
};
_local5++;
};
}
public static function Editor_AddLevel():void{
var _local1:Level;
_local1 = new Level();
currentLevel = Game.levels.length;
Game.levels.push(_local1);
currentLineIndex = -1;
currentPointIndex = -1;
}
static function RemoveFromLevelInstances(_arg1:PhysObj_Instance){
var _local2:Array;
var _local3:Array;
var _local4:PhysObj_Instance;
_local2 = GetCurrentLevelInstances();
_local3 = new Array();
for each (_local4 in _local2) {
if (_local4 == _arg1){
} else {
_local3.push(_local4);
};
};
_local2 = _local3;
Game.levels[currentLevel].instances = _local2;
}
static function GetCurrentLevel():Level{
return (Game.levels[currentLevel]);
}
static function RenderPanel_Editor(){
var _local1:Number;
var _local2:Number;
var _local3:String;
var _local4:BitmapData;
_local4 = Game.main.screenBD;
if (editMode == editMode_Commands){
_local3 = "Editor: Mode = Commands";
_local1 = 10;
_local2 = 10;
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local1 = 50;
_local2 = 50;
_local3 = "1: Place Pieces";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "2: Library (cycle)";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "3: Eraser";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "4: Commands";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "5: Adjust Placement";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "6: Edit Lines";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "8: Prev Level";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "9: Next Level";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
return;
};
if (editMode == editMode_Commands1){
_local3 = "Editor: Mode = Commands1";
_local1 = 10;
_local2 = 10;
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local1 = 50;
_local2 = 50;
_local3 = "1: Erase Level";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "2: Add New Level (at end)";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "4: Export current level";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "5: Export all levels";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "9: Quit To Game";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
return;
};
_local3 = "Editor: Mode = ";
if (editMode == editMode_Normal){
_local3 = (_local3 + "Placement");
};
if (editMode == editMode_Library){
_local3 = (_local3 + ((("Library Page " + int((library_page + 1)).toString()) + " / ") + int(GetNumLibraryPages()).toString()));
};
if (editMode == editMode_Eraser){
_local3 = (_local3 + "Eraser");
};
if (editMode == editMode_Adjust){
_local3 = (_local3 + "Adjust");
};
if (editMode == editMode_Lines){
_local3 = (_local3 + "Lines");
};
_local1 = 10;
_local2 = 10;
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
if (editMode == editMode_Lines){
_local3 = "1: Select Line (hold and click on point)";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "2: Delete Point (hold and click to delete)";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "3: Insert Point after clicked point";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "4: Select Point for editing with arrow keys";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "5: New line (hold and click new point)";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "6: Subdivide between this point and selected point";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "7: Push line points";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "[ and ]: Move to first / last point of selected line";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = ((("ScrollPos: " + scrollX) + " ") + scrollY);
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = ((("CursorPos: " + int((MouseControl.mousePosX + scrollX))) + " ") + int((MouseControl.mousePosY + scrollY)));
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
};
if (editMode == editMode_Adjust){
_local3 = "Shift + Arrows: Move Piece";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "6: Rotate Left";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "7: Rotate Right";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
};
if (editMode == editMode_Normal){
_local3 = ((("ScrollPos: " + scrollX) + " ") + scrollY);
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = ((("CursorPos: " + int((MouseControl.mousePosX + scrollX))) + " ") + int((MouseControl.mousePosY + scrollY)));
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
_local3 = "1: Snap to nearby objects";
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
};
if (editMode == editMode_Adjust){
if (currentAdjustObject != null){
_local3 = ((((("Pos: " + currentAdjustObject.x) + " ") + currentAdjustObject.y) + " Rot: ") + currentAdjustObject.rot);
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
_local2 = (_local2 + 15);
};
};
_local1 = 350;
_local3 = ("Level=" + currentLevel.toString());
GraphicObjects.RenderStringAt(_local4, GraphicObjects.gfx_font1, _local1, _local2, _local3, null);
}
public static function Editor_NextLevel():void{
currentLevel++;
if (currentLevel > (Game.levels.length - 1)){
currentLevel = (Game.levels.length - 1);
};
currentLineIndex = -1;
currentPointIndex = -1;
}
}
}//package
class PhysEd_GuideLine {
private var level:Boolean;
private var x0:Number;
private var x1:Number;
private var type:int;
private var y0:Number;
private var y1:Number;
private function PhysEd_GuideLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean){
type = _arg4;
level = _arg5;
if (type == 0){
x0 = _arg1;
x1 = _arg2;
y0 = _arg3;
y1 = _arg3;
} else {
y0 = _arg1;
y1 = _arg2;
x0 = _arg3;
x1 = _arg3;
};
}
}
Section 262
//PhysObj (PhysObj)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Common.Math.*;
public class PhysObj {
public var bodies:Array;
public var joints:Array;
public var name:String;
public var initFunctionName:String;
public var displayInLibrary:Boolean;
public var hitballsound:int;
public function PhysObj(){
hitballsound = 0;
}
function PointFromString(_arg1:String):Point{
var _local2:Array;
var _local3:Point;
_local2 = _arg1.split(",");
_local3 = new Point(0, 0);
if (_local2.length != 2){
trace(((("PointfromString. Error, numpoints=" + _local2.length) + " ") + _arg1));
return (_local3);
};
_local3.x = Number(_local2[0]);
_local3.y = Number(_local2[1]);
return (_local3);
}
function PointArrayFromString(_arg1:String):Array{
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:Point;
_local2 = new Array();
_local3 = _arg1.split(",");
if ((((_local3.length < 2)) || (((_local3.length % 2) == 1)))){
trace(((("PointArrayFromString. Error, numpoints=" + _local3.length) + " , string= ") + _arg1));
return (_local2);
};
_local5 = (_local3.length / 2);
_local4 = 0;
while (_local4 < _local5) {
_local6 = new Point(0, 0);
_local6.x = Number(_local3[((_local4 * 2) + 0)]);
_local6.y = Number(_local3[((_local4 * 2) + 1)]);
_local2.push(_local6);
_local4++;
};
return (_local2);
}
public function BodyIndexFromName(_arg1:String):int{
var _local2:int;
var _local3:PhysObj_Body;
_local2 = 0;
while (_local2 < bodies.length) {
_local3 = bodies[_local2];
if (_local3.name == _arg1){
return (_local2);
};
_local2++;
};
trace(("ERROR PhysObj BodyIndexFromName " + _arg1));
return (0);
}
function BooleanFromString(_arg1:String):Boolean{
var _local2:Boolean;
_local2 = false;
_arg1 = _arg1.toUpperCase();
if (_arg1 == "1"){
_local2 = true;
};
if (_arg1 == "TRUE"){
_local2 = true;
};
return (_local2);
}
public function JointIndexFromName(_arg1:String):int{
var _local2:int;
var _local3:PhysObj_Joint;
_local2 = 0;
while (_local2 < joints.length) {
_local3 = joints[_local2];
if (_local3.name == _arg1){
return (_local2);
};
_local2++;
};
trace(("ERROR PhysObj JointIndexFromName " + _arg1));
return (0);
}
public function FromXml(_arg1:XML):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:String;
var _local6:XML;
var _local7:PhysObj_Body;
var _local8:XML;
var _local9:PhysObj_Graphic;
var _local10:XML;
var _local11:PhysObj_Shape;
var _local12:Point;
var _local13:XML;
var _local14:PhysObj_Joint;
bodies = new Array();
joints = new Array();
name = _arg1.@name;
displayInLibrary = XmlHelper.GetAttrBoolean(_arg1.@inlibrary, false);
initFunctionName = XmlHelper.GetAttrString(_arg1.@initfunction, null);
_local2 = 0;
while (_local2 < _arg1.sound.length()) {
hitballsound = int(_arg1.sound[_local2].@hitball);
_local2++;
};
_local2 = 0;
while (_local2 < _arg1.body.length()) {
_local6 = _arg1.body[_local2];
_local7 = new PhysObj_Body();
_local7.name = _local6.@name;
_local7.fixed = BooleanFromString(_local6.@fixed);
_local7.sensor = BooleanFromString(_local6.@sensor);
_local7.pos = PointFromString(_local6.@pos);
if (_local6.@lineardamping != undefined){
_local7.linearDamping = Number(_local6.@lineardamping);
};
if (_local6.@angulardamping != undefined){
_local7.angularDamping = Number(_local6.@angulardamping);
};
_local3 = 0;
while (_local3 < _local6.graphic.length()) {
_local8 = _local6.graphic[_local3];
_local9 = new PhysObj_Graphic();
_local9.goInitFuntion = _local8.@gameobjfunction;
_local9.goInitFuntionVarString = _local8.@gameobjvars;
_local9.graphicName = _local8.@clip;
_local9.graphicID = 0;
_local9.frame = (int(_local8.@frame) - 1);
_local9.offset = PointFromString(_local8.@pos);
_local9.zoffset = XmlHelper.GetAttrNumber(_local8.@zoffset, 0);
_local9.hasShadow = XmlHelper.GetAttrBoolean(_local8.@shadow, true);
_local9.rot = Number(_local8.@rot);
_local9.Calculate();
_local7.graphics.push(_local9);
_local3++;
};
_local3 = 0;
while (_local3 < _local6.shape.length()) {
_local10 = _local6.shape[_local3];
_local11 = new PhysObj_Shape();
_local11.name = _local10.@name;
_local5 = _local10.@type;
_local12 = PointFromString(_local10.@col);
_local11.collisionCategory = int(_local12.x);
_local11.collisionMask = int(_local12.y);
_local11.density = Number(_local10.@density);
_local11.friction = Number(_local10.@friction);
_local11.restitution = Number(_local10.@restitution);
if (_local5 == "circle"){
_local11.type = PhysObj_Shape.Type_Circle;
_local11.circle_pos = PointFromString(_local10.@pos);
_local11.circle_radius = Number(_local10.@radius);
} else {
if (_local5 == "poly"){
_local11.type = PhysObj_Shape.Type_Poly;
_local11.poly_points = PointArrayFromString(_local10.@vertices);
_local11.poly_rot = Utils.DegToRad(Number(_local10.@rot));
};
};
_local11.Caclulate();
_local7.shapes.push(_local11);
_local3++;
};
bodies.push(_local7);
_local2++;
};
_local2 = 0;
while (_local2 < _arg1.joint.length()) {
_local13 = _arg1.joint[_local2];
_local14 = new PhysObj_Joint();
_local14.name = _local13.@name;
_local14.obj0Name = _local13.@body0;
_local14.obj1Name = _local13.@body1;
_local5 = _local13.@type;
if (_local5 == "rev"){
_local14.type = PhysObj_Joint.Type_Rev;
_local14.rev_pos = PointFromString(_local13.@pos);
_local14.rev_enableLimit = BooleanFromString(_local13.@enablelimit);
_local14.rev_lowerAngle = Utils.DegToRad(Number(_local13.@lowerangle));
_local14.rev_upperAngle = Utils.DegToRad(Number(_local13.@upperangle));
_local14.rev_enableMotor = BooleanFromString(_local13.@enablemotor);
_local14.rev_motorSpeed = Number(_local13.@motorspeed);
_local14.rev_maxMotorTorque = Number(_local13.@maxmotortorque);
} else {
if (_local5 == "distance"){
_local14.type = PhysObj_Joint.Type_Distance;
_local14.dist_pos0 = PointFromString(_local13.@pos);
_local14.dist_pos1 = PointFromString(_local13.@pos1);
_local14.dist_distance = Number(_local13.@distance);
} else {
if (_local5 == "mouse"){
_local14.type = PhysObj_Joint.Type_Mouse;
} else {
if (_local5 == "prismatic"){
_local14.type = PhysObj_Joint.Type_Prismatic;
_local14.prism_pos = PointFromString(_local13.@pos);
_local14.prism_enableLimit = BooleanFromString(_local13.@enablelimit);
_local14.prism_lowerTranslation = Number(_local13.@lowertranslation);
_local14.prism_upperTranslation = Number(_local13.@uppertranslation);
_local14.prism_enableMotor = BooleanFromString(_local13.@enablemotor);
_local14.prism_axisangle = (Number(_local13.@axisangle) - Number(90));
_local14.prism_motorSpeed = Number(_local13.@motorspeed);
_local14.prism_maxMotorForce = Number(_local13.@maxmotorforce);
};
};
};
};
joints.push(_local14);
_local2++;
};
}
public function BodyFromName(_arg1:String):PhysObj_Body{
var _local2:int;
var _local3:PhysObj_Body;
_local2 = 0;
while (_local2 < bodies.length) {
_local3 = bodies[_local2];
if (_local3.name == _arg1){
return (_local3);
};
_local2++;
};
trace(("ERROR PhysObj BodyFromName " + _arg1));
return (null);
}
public static function RenderAt(_arg1:PhysObj, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:BitmapData, _arg6:Boolean=true, _arg7:Number=1){
var _local8:Boolean;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Matrix;
var _local13:PhysObj_Body;
var _local14:PhysObj_Graphic;
var _local15:Point;
var _local16:Matrix;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:PhysObj_Shape;
var _local21:Number;
var _local22:Array;
var _local23:int;
var _local24:b2Vec2;
var _local25:b2Vec2;
var _local26:Matrix;
var _local27:Point;
var _local28:Point;
_local8 = _arg6;
_local9 = _arg7;
_local10 = _arg2;
_local11 = _arg3;
for each (_local13 in _arg1.bodies) {
for each (_local14 in _local13.graphics) {
_local15 = new Point((_local13.pos.x + _local14.offset.x), (_local13.pos.y + _local14.offset.y));
_local16 = new Matrix();
_local16.rotate(Utils.DegToRad(_arg4));
_local16.scale(_local9, _local9);
_local15 = _local16.transformPoint(_local15);
_local10 = ((_arg2 * _local9) + _local15.x);
_local11 = ((_arg3 * _local9) + _local15.y);
_local17 = Utils.DegToRad((_arg4 + _local14.rot));
GraphicObjects.RenderAtRotScaled(_local14.graphicID, _local14.frame, _arg5, _local10, _local11, false, _local9, _local17);
};
if (_local8){
for each (_local20 in _local13.shapes) {
if (_local20.type == PhysObj_Shape.Type_Circle){
_local21 = _local20.circle_radius;
Utils.RenderCircle(_arg5, (_arg2 + _local20.circle_pos.x), (_arg3 + _local20.circle_pos.y), _local21, 4294967295);
};
if (_local20.type == PhysObj_Shape.Type_Poly){
_local22 = _local20.poly_points;
_local23 = _local20.poly_points.length;
_local18 = 0;
while (_local18 < _local23) {
_local19 = (_local18 + 1);
if (_local19 >= _local23){
_local19 = 0;
};
_local24 = new b2Vec2(_local22[_local18].x, _local22[_local18].y);
_local25 = new b2Vec2(_local22[_local19].x, _local22[_local19].y);
_local26 = new Matrix();
_local26.rotate(Utils.DegToRad(_arg4));
_local27 = new Point(_local24.x, _local24.y);
_local28 = new Point(_local25.x, _local25.y);
_local27 = _local26.transformPoint(_local27);
_local28 = _local26.transformPoint(_local28);
_local24.x = _local27.x;
_local24.y = _local27.y;
_local25.x = _local28.x;
_local25.y = _local28.y;
_local24.x = (_local24.x + _arg2);
_local25.x = (_local25.x + _arg2);
_local24.y = (_local24.y + _arg3);
_local25.y = (_local25.y + _arg3);
Utils.RenderDotLine(_arg5, _local24.x, _local24.y, _local25.x, _local25.y, 50, 4294967295);
_local18++;
};
};
};
};
};
}
}
}//package
Section 263
//PhysObj_Body (PhysObj_Body)
package {
import flash.geom.*;
public class PhysObj_Body {
public var angularDamping:Number;
public var name:String;
public var graphics:Array;
public var linearDamping:Number;
public var pos:Point;
public var shapes:Array;
public var fixed:Boolean;
public var sensor:Boolean;
public function PhysObj_Body(){
shapes = new Array();
graphics = new Array();
name = "";
pos = new Point();
fixed = true;
sensor = false;
linearDamping = 0.1;
angularDamping = 0.1;
}
}
}//package
Section 264
//PhysObj_BodyUserData (PhysObj_BodyUserData)
package {
public class PhysObj_BodyUserData {
public var type:String;
public var gameObjectID:int;
public var bodyName:String;
public var instance:PhysObj_Instance;
public function PhysObj_BodyUserData(){
type = "";
bodyName = "";
gameObjectID = -1;
instance = null;
}
}
}//package
Section 265
//PhysObj_Graphic (PhysObj_Graphic)
package {
import flash.geom.*;
public class PhysObj_Graphic {
public var graphicName:String;
public var graphicID:int;
public var frame:int;
public var offset:Point;
public var zoffset:Number;
public var rot:Number;
public var goInitFuntion:String;
public var hasShadow:Boolean;
public var goInitFuntionVarString:String;
public function PhysObj_Graphic(){
graphicName = "";
graphicID = 0;
frame = 0;
offset = new Point(0, 0);
rot = 0;
goInitFuntion = "";
goInitFuntionVarString = "";
zoffset = 0;
hasShadow = true;
}
public function Calculate(){
graphicID = GraphicObjects.GetIndexByName(graphicName);
if (frame < 0){
trace("ERROR: PhysObj Graphic has negative frame. Are you counting from 0 or 1?");
frame = 0;
};
}
}
}//package
Section 266
//PhysObj_Instance (PhysObj_Instance)
package {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class PhysObj_Instance {
public var removeFlag:Boolean;
public var joints:Array;
public var collideFunction:Function;
public var instanceName:String;
public var updateFunction:Function;
public var timer:int;
public var bodies:Array;
public var hitballsound:int;
public var collidetimer:int;
public var rot:Number;
public var typeName:String;
public var updateFunctionName:String;
public var x:Number;
public var y:Number;
public function PhysObj_Instance(){
bodies = new Array();
joints = new Array();
timer = 0;
collidetimer = 0;
collideFunction = null;
updateFunction = null;
hitballsound = 0;
removeFlag = false;
updateFunctionName = null;
}
public function SetLinearVelocity(_arg1:Number, _arg2:Number):void{
var _local3:b2Body;
for each (_local3 in bodies) {
_local3.SetLinearVelocity(new b2Vec2(_arg1, _arg2));
};
}
function InitPhysObj_Cannonball1(){
updateFunction = UpdatePhysObj_Cannonball1;
timer = 100;
}
public function SetBodyCollisionMask(_arg1:int, _arg2:int):void{
var _local3:b2Body;
var _local4:b2Shape;
var _local5:b2FilterData;
if (_arg1 == -1){
for each (_local3 in bodies) {
_local4 = _local3.GetShapeList();
while (_local4) {
_local5 = _local4.GetFilterData();
_local5.maskBits = _arg2;
_local4.SetFilterData(_local5);
Game.world.Refilter(_local4);
_local4 = _local4.GetNext();
};
};
} else {
_local3 = bodies[_arg1];
_local4 = _local3.GetShapeList();
while (_local4) {
_local5 = _local4.GetFilterData();
_local5.maskBits = _arg2;
_local4.SetFilterData(_local5);
Game.world.Refilter(_local4);
_local4 = _local4.GetNext();
};
};
}
public function LimitLinearVelocity(_arg1:Number):void{
var _local2:b2Body;
var _local3:b2Vec2;
for each (_local2 in bodies) {
_local3 = _local2.GetLinearVelocity();
if (_local3.Length() > _arg1){
_local3.Normalize();
_local3.Multiply(_arg1);
_local2.SetLinearVelocity(_local3);
};
};
}
public function Remove(){
var _local1:b2Joint;
var _local2:b2Body;
var _local3:PhysObj_BodyUserData;
var _local4:int;
var _local5:GameObj;
for each (_local1 in joints) {
Game.world.DestroyJoint(_local1);
};
for each (_local2 in bodies) {
_local3 = (_local2.GetUserData() as PhysObj_BodyUserData);
if (_local3 != null){
_local4 = _local3.gameObjectID;
if (_local4 != -1){
_local5 = GameObjects.objs[_local4];
_local5.active = false;
};
};
Game.world.DestroyBody(_local2);
};
}
public function Init(){
var _local1:PhysObj;
_local1 = Game.physObjs.FindByName(typeName);
if (_local1.initFunctionName != null){
var _local2 = this;
_local2[_local1.initFunctionName]();
};
}
public function ApplyAngularVelocity(_arg1:int, _arg2:Number):void{
var _local3:b2Body;
if (_arg1 == -1){
for each (_local3 in bodies) {
_local3.ApplyTorque(_arg2);
};
} else {
bodies[_arg1].ApplyTorque(_arg2);
};
}
public function SetPos(_arg1:Number, _arg2:Number):void{
var _local3:b2Body;
var _local4:b2Vec2;
var _local5:Number;
var _local6:b2Vec2;
x = _arg1;
y = _arg2;
for each (_local3 in bodies) {
_local4 = _local3.GetPosition();
_local5 = Utils.DistBetweenPoints(x, y, _local4.x, _local4.y);
if (_local5 > 1){
_local5 = 1;
};
_local6 = new b2Vec2(((x - _local4.x) * 0.1), ((y - _local4.y) * 0.01));
_local3.ApplyImpulse(_local6, new b2Vec2(0, 0));
};
}
function UpdatePhysObj_Cannonball1(){
var _local1:b2Vec2;
var _local2:b2Body;
timer--;
if (timer <= 0){
removeFlag = true;
for each (_local2 in bodies) {
_local1 = _local2.GetWorldCenter();
};
Game.ApplyImpulseToObjectsFromPoint(_local2, _local1.x, _local1.y, 400, 100);
};
}
public function GetBodyLinearVelocity(_arg1:int):b2Vec2{
var _local2:b2Vec2;
var _local3:b2Body;
var _local4:b2Vec2;
_local2 = new b2Vec2(0, 0);
_local3 = bodies[_arg1];
_local4 = _local3.GetLinearVelocity();
return (_local4);
}
public function GetBodyAngle(_arg1:int):Number{
var _local2:b2Vec2;
var _local3:b2Body;
_local2 = new b2Vec2(0, 0);
_local3 = bodies[_arg1];
return (_local3.GetAngle());
}
public function ApplyForce(_arg1:Number, _arg2:Number):void{
var _local3:b2Body;
for each (_local3 in bodies) {
_local3.ApplyForce(new b2Vec2(_arg1, _arg2), _local3.GetWorldCenter());
};
}
public function SetAngularVelocity(_arg1:int, _arg2:Number):void{
var _local3:b2Body;
if (_arg1 == -1){
for each (_local3 in bodies) {
_local3.SetAngularVelocity(_arg2);
};
} else {
_local3 = bodies[_arg1];
_local3.SetAngularVelocity(_arg2);
};
}
public function SetXForm(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:b2Vec2;
var _local5:b2Body;
_local4 = new b2Vec2(_arg1, _arg2);
for each (_local5 in bodies) {
_local5.SetXForm(_local4, _arg3);
};
}
public function LimitAngularVelocity(_arg1:int, _arg2:Number):void{
var _local3:b2Body;
var _local4:Number;
if (_arg1 == -1){
for each (_local3 in bodies) {
_local4 = _local3.GetAngularVelocity();
if (_local4 >= _arg2){
_local4 = _arg2;
};
if (_local4 <= -(_arg2)){
_local4 = -(_arg2);
};
_local3.SetAngularVelocity(_local4);
};
} else {
_local3 = bodies[_arg1];
_local4 = _local3.GetAngularVelocity();
if (_local4 >= _arg2){
_local4 = _arg2;
};
if (_local4 <= -(_arg2)){
_local4 = -(_arg2);
};
_local3.SetAngularVelocity(_local4);
};
}
public function ApplyImpulse(_arg1:Number, _arg2:Number):void{
var _local3:b2Body;
for each (_local3 in bodies) {
_local3.ApplyImpulse(new b2Vec2(_arg1, _arg2), _local3.GetWorldCenter());
};
}
public function AddToPos(_arg1:int, _arg2:b2Vec2):void{
var _local3:b2XForm;
var _local4:b2Body;
if (_arg1 == -1){
for each (_local4 in bodies) {
_local3 = _local4.GetXForm();
_local3.position.Add(_arg2);
_local4.SetXForm(_local3.position, 0);
};
} else {
_local3 = _local4.GetXForm();
_local3.position.Add(_arg2);
_local4.SetXForm(_local3.position, 0);
};
}
function InitPhysObj_Ninja(){
updateFunction = UpdatePhysObj_Ninja;
timer = Utils.RandBetweenInt(100, 150);
}
public function Update(){
if (updateFunction != null){
updateFunction();
};
}
function UpdatePhysObj_Ninja(){
var _local1:b2Vec2;
timer--;
if (timer <= 0){
timer = 100;
_local1 = GetBodyWorldPos(0);
Game.InitNinjaProjectile(_local1.x, _local1.y);
};
}
public function GetBodyWorldPos(_arg1:int):b2Vec2{
var _local2:b2Vec2;
var _local3:int;
var _local4:b2Body;
_local2 = new b2Vec2(0, 0);
_local3 = 0;
for each (_local4 in bodies) {
if (_local3 == _arg1){
_local2 = _local4.GetWorldCenter().Copy();
};
};
return (_local2);
}
public function WakeUp():void{
var _local1:b2Body;
for each (_local1 in bodies) {
_local1.WakeUp();
};
}
}
}//package
Section 267
//PhysObj_Instances (PhysObj_Instances)
package {
public class PhysObj_Instances {
public var list:Array;
public function PhysObj_Instances(){
list = new Array();
}
public function Exists(_arg1:PhysObj_Instance):Boolean{
var _local2:PhysObj_Instance;
for each (_local2 in list) {
if (_local2 == _arg1){
return (true);
};
};
return (false);
}
public function GetByIndex(_arg1:int):PhysObj_Instance{
return (list[_arg1]);
}
public function RemoveByName(_arg1:String):void{
var _local2:PhysObj_Instance;
_local2 = FindByName(_arg1);
if (_local2 == null){
return;
};
Remove(_local2);
}
public function FindByName(_arg1:String):PhysObj_Instance{
var _local2:PhysObj_Instance;
for each (_local2 in list) {
if (_local2.instanceName == _arg1){
return (_local2);
};
};
return (null);
}
public function Remove(_arg1:PhysObj_Instance):Boolean{
var _local2:Array;
var _local3:PhysObj_Instance;
if (Exists(_arg1) == false){
return (false);
};
_arg1.Remove();
_local2 = new Array();
for each (_local3 in list) {
if (_local3 == _arg1){
} else {
_local2.push(_local3);
};
};
list = _local2;
return (true);
}
}
}//package
Section 268
//PhysObj_Joint (PhysObj_Joint)
package {
import flash.geom.*;
public class PhysObj_Joint {
public var prism_pos:Point;
public var obj0Name:String;
public var obj1Name:String;
public var dist_distance:Number;
public var name:String;
public var prism_lowerTranslation:Number;
public var prism_enableLimit:Boolean;
public var prism_maxMotorForce:Number;
public var dist_pos0:Point;
public var prism_enableMotor:Boolean;
public var prism_axisangle:Number;
public var rev_enableMotor:Boolean;
public var prism_motorSpeed:Number;
public var rev_enableLimit:Boolean;
public var dist_pos1:Point;
public var rev_upperAngle:Number;
public var rev_lowerAngle:Number;
public var rev_maxMotorTorque:Number;
public var rev_pos:Point;
public var type:int;
public var prism_upperTranslation:Number;
public var rev_motorSpeed:Number;
public static const Type_Mouse:int = 3;
public static const Type_Prismatic:int = 2;
public static const Type_Distance:int = 1;
public static const Type_Rev:int = 0;
public function PhysObj_Joint(){
type = 0;
name = "";
obj0Name = "";
obj1Name = "";
rev_pos = new Point(0, 0);
rev_enableLimit = false;
rev_lowerAngle = 0;
rev_upperAngle = 0;
rev_enableMotor = false;
rev_motorSpeed = 0;
rev_maxMotorTorque = 0;
prism_pos = new Point(0, 0);
prism_lowerTranslation = 0;
prism_upperTranslation = 0;
prism_enableLimit = false;
prism_enableMotor = false;
prism_motorSpeed = 0;
prism_maxMotorForce = 0;
prism_axisangle = 0;
dist_pos0 = new Point(0, 0);
dist_pos1 = new Point(0, 0);
dist_distance = 1;
}
}
}//package
Section 269
//PhysObj_Shape (PhysObj_Shape)
package {
import flash.geom.*;
public class PhysObj_Shape {
public var type:int;
public var name:String;
public var collisionCategory:int;
public var circle_radius:Number;
public var poly_rot:Number;
public var circle_pos:Point;
public var density:Number;
public var restitution:Number;
public var poly_points:Array;
public var friction:Number;
public var collisionMask:int;
public static const Type_Poly:int = 0;
public static const Type_Circle:int = 1;
public function PhysObj_Shape(){
type = 0;
name = "";
poly_points = new Array();
circle_pos = new Point();
circle_radius = 0;
poly_rot = 0;
collisionCategory = 0;
collisionMask = 0;
}
public function Caclulate(){
var _local1:Matrix;
var _local2:Array;
var _local3:Point;
var _local4:Point;
if (type == Type_Poly){
_local1 = new Matrix();
_local1.rotate(poly_rot);
_local2 = new Array();
for each (_local3 in poly_points) {
_local4 = _local1.transformPoint(_local3);
_local2.push(_local4);
};
poly_points = _local2;
};
}
}
}//package
Section 270
//PhysObjs (PhysObjs)
package {
public class PhysObjs {
public var list:Array;
public function PhysObjs(){
list = new Array();
}
public function GetNum():int{
return (list.length);
}
public function GetByIndex(_arg1:int):PhysObj{
return (list[_arg1]);
}
public function FindByName(_arg1:String):PhysObj{
var _local2:PhysObj;
for each (_local2 in list) {
if (_local2.name == _arg1){
return (_local2);
};
};
trace(("ERROR PhysObjs FindByName " + _arg1));
return (null);
}
public function InitFromXml(_arg1:XML):void{
var _local2:int;
var _local3:XML;
var _local4:PhysObj;
list = new Array();
_local2 = 0;
while (_local2 < _arg1.physobj.length()) {
_local3 = _arg1.physobj[_local2];
_local4 = new PhysObj();
_local4.FromXml(_local3);
list.push(_local4);
_local2++;
};
}
}
}//package
Section 271
//Piano (Piano)
package {
import flash.display.*;
public dynamic class Piano extends MovieClip {
}
}//package
Section 272
//pickup0 (pickup0)
package {
import flash.media.*;
public dynamic class pickup0 extends Sound {
}
}//package
Section 273
//pickup1 (pickup1)
package {
import flash.media.*;
public dynamic class pickup1 extends Sound {
}
}//package
Section 274
//pickup2 (pickup2)
package {
import flash.media.*;
public dynamic class pickup2 extends Sound {
}
}//package
Section 275
//pickup3 (pickup3)
package {
import flash.media.*;
public dynamic class pickup3 extends Sound {
}
}//package
Section 276
//pickup4 (pickup4)
package {
import flash.media.*;
public dynamic class pickup4 extends Sound {
}
}//package
Section 277
//pickup5 (pickup5)
package {
import flash.media.*;
public dynamic class pickup5 extends Sound {
}
}//package
Section 278
//Pickups (Pickups)
package {
import flash.display.*;
public dynamic class Pickups extends MovieClip {
}
}//package
Section 279
//Player (Player)
package {
public class Player {
static const upg_total:int = 5;
static const upg_speed:int = 0;
static const upg_accel:int = 1;
static const upg_boost:int = 3;
static const upg_brake:int = 2;
static const upg_spin:int = 4;
public static var costs:Array;
static var levels:Array;
public static function GetCost(_arg1):int{
var _local2:int;
var _local3:int;
_local2 = levels[_arg1];
_local3 = costs[(_local2 + 1)];
return (_local3);
}
public static function LevelsCheat():void{
levels[0] = 10;
levels[1] = 10;
levels[2] = 10;
levels[3] = 10;
levels[4] = 10;
}
public static function Upgrade(_arg1):void{
var _local2:int;
_local2 = levels[_arg1];
_local2++;
if (_local2 > 10){
_local2 = 0;
};
levels[_arg1] = _local2;
}
public static function GetLevel(_arg1:int):int{
return (levels[_arg1]);
}
public static function InitOnce(){
var _local1:int;
levels = new Array();
costs = new Array();
levels.push(0, 0, 0, 0, 0);
costs.push(0);
_local1 = 1;
while (_local1 <= 10) {
costs.push(((_local1 * _local1) * _local1));
_local1++;
};
costs[0] = 0;
costs[1] = 5;
costs[2] = 10;
costs[3] = 30;
costs[4] = 60;
costs[5] = 120;
costs[6] = 200;
costs[7] = 330;
costs[8] = 500;
costs[9] = 1000;
costs[10] = 2000;
}
public static function SetLevel(_arg1:int, _arg2:int):void{
levels[_arg1] = _arg2;
}
}
}//package
Section 280
//PlayerBikeData (PlayerBikeData)
package {
public class PlayerBikeData {
var bellAvailable:Boolean;
var acc:Number;
var name:String;
var physObjIndex:int;
var selectFrame:int;
var bio:String;
var available:Boolean;
var maxvel:Number;
public function PlayerBikeData(){
name = "";
physObjIndex = 0;
acc = 200;
maxvel = 30;
selectFrame = 1;
bio = "";
available = false;
bellAvailable = false;
}
}
}//package
Section 281
//PlayerBikes (PlayerBikes)
package {
public class PlayerBikes {
static var bikes:Array;
public static function GetBikeData(_arg1:int):PlayerBikeData{
return (bikes[_arg1]);
}
static function InitOnce(){
var _local1:XML;
var _local2:int;
var _local3:int;
var _local4:XML;
var _local5:PlayerBikeData;
bikes = new Array();
_local1 = ExternalData.xml;
_local2 = _local1.playerbike.length();
_local3 = 0;
while (_local3 < _local2) {
_local4 = _local1.playerbike[_local3];
_local5 = new PlayerBikeData();
_local5.name = XmlHelper.GetAttrString(_local4.@name, "undefined");
_local5.physObjIndex = XmlHelper.GetAttrInt(_local4.@bike, 1);
_local5.acc = XmlHelper.GetAttrNumber(_local4.@acc, 200);
_local5.maxvel = XmlHelper.GetAttrNumber(_local4.@vel, 30);
_local5.selectFrame = XmlHelper.GetAttrInt(_local4.@selectframe, 1);
_local5.bio = XmlHelper.GetAttrString(_local4.@bio, "undefined");
bikes.push(_local5);
_local3++;
};
bikes[0].available = true;
}
public static function GetNumHornsUnlocked():int{
var _local1:int;
var _local2:PlayerBikeData;
_local1 = 0;
for each (_local2 in bikes) {
if (_local2.bellAvailable == true){
_local1++;
};
};
return (_local1);
}
public static function GetNumBikesUnlocked():int{
var _local1:int;
var _local2:PlayerBikeData;
_local1 = 0;
for each (_local2 in bikes) {
if (_local2.available == true){
_local1++;
};
};
return (_local1);
}
public static function BikesCheat(){
var _local1:PlayerBikeData;
for each (_local1 in bikes) {
_local1.available = true;
};
}
public static function HornsCheat(){
var _local1:PlayerBikeData;
for each (_local1 in bikes) {
_local1.bellAvailable = true;
};
}
}
}//package
Section 282
//PlayerControls (PlayerControls)
package {
import flash.display.*;
public dynamic class PlayerControls extends MovieClip {
public var buttonNext:SimpleButton;
public var buttonNoMoreHelp:SimpleButton;
}
}//package
Section 283
//PlayerRecord (PlayerRecord)
package {
public class PlayerRecord {
var frame:int;
var rot:Number;
var x:Number;
var y:Number;
public function PlayerRecord(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:int){
x = _arg1;
y = _arg2;
rot = _arg3;
frame = _arg4;
}
}
}//package
Section 284
//PlayerRecordings (PlayerRecordings)
package {
import flash.display.*;
public class PlayerRecordings {
static var pr:PlayerRecord = new PlayerRecord(0, 0, 0, 0);
static var currentData:Array;
static var outputstring:String;
static var routeInfo:Array;
static var arrayindex:int = 0;
static var currenty:Number;
static var recordings:Array;
static var currentx:Number;
static var pr1:PlayerRecord = new PlayerRecord(0, 0, 0, 0);
static var firsttime:Boolean;
static function AddData(_arg1:Array){
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local3 = (_arg1.length / 3);
_local2 = 0;
while (_local2 < _local3) {
_local5 = _arg1[((_local2 * 3) + 0)];
_local6 = _arg1[((_local2 * 3) + 1)];
_local7 = _arg1[((_local2 * 3) + 2)];
if (firsttime){
firsttime = false;
currentData.push(_local5);
currentData.push(_local6);
currentData.push(_local7);
currentx = _local5;
currenty = _local6;
} else {
currentx = (currentx + _local5);
currenty = (currenty + _local6);
currentData.push(currentx);
currentData.push(currenty);
currentData.push(_local7);
};
_local2++;
};
for each (_local4 in _arg1) {
if (firsttime == true){
currentData.push(_local4);
};
};
}
static function StartData(_arg1:int){
currentData = new Array();
routeInfo.push(_arg1);
firsttime = true;
}
static function Load(){
InitOnce();
trace("HERE");
GetDataFromBitmap();
}
static function InitOnce(){
recordings = new Array();
routeInfo = new Array();
outputstring = "";
arrayindex = 0;
}
static function GetNumRoutes(_arg1:int):int{
var _local2:int;
var _local3:int;
if ((((_arg1 < 0)) || ((_arg1 >= recordings.length)))){
return (0);
};
_local2 = 0;
for each (_local3 in routeInfo) {
if (_local3 == _arg1){
_local2++;
};
};
return (_local2);
}
public static function GetRouteIndex(_arg1:int, _arg2:int){
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:int;
var _local7:int;
_local3 = 0;
_local4 = 0;
_local5 = new Array();
_local4 = 0;
while (_local4 < 100) {
_local5.push(0);
_local4++;
};
for each (_local6 in routeInfo) {
var _local10 = _local5;
var _local11 = _local6;
var _local12 = (_local10[_local11] + 1);
_local10[_local11] = _local12;
};
_local4 = 0;
_local7 = _local5[_arg1];
for each (_local6 in routeInfo) {
if (_local6 == _arg1){
if (_local3 == _arg2){
return (_local4);
};
_local3++;
if (_local3 >= _local7){
_local3 = 0;
};
};
_local4++;
};
return (0);
}
static function GetDataFromBitmap(){
var _local1:BitmapData;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:uint;
var _local8:uint;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
_local1 = GraphicObjects.GetBitmap(GraphicObjects.GetIndexByName("Routes"), 0).bitmapData;
trace(((("bitmap: " + _local1.width) + " x ") + _local1.height));
_local2 = _local1.width;
_local3 = _local1.height;
_local4 = 0;
_local6 = 0;
do {
_local5 = false;
if (_local6 == 0){
_local7 = _local1.getPixel((_local4 % _local2), (_local4 / _local2));
_local4++;
_local8 = _local1.getPixel((_local4 % _local2), (_local4 / _local2));
_local4++;
if (_local8 == 0){
_local5 = false;
} else {
_local5 = true;
currentData = new Array();
routeInfo.push(_local7);
_local12 = 0;
while (_local12 < _local8) {
_local9 = _local1.getPixel((_local4 % _local2), (_local4 / _local2));
_local4++;
_local10 = _local1.getPixel((_local4 % _local2), (_local4 / _local2));
_local4++;
_local11 = _local1.getPixel((_local4 % _local2), (_local4 / _local2));
_local4++;
_local13 = (_local9 & 0x800000);
_local9 = (_local9 & 8388607);
if (_local13 != 0){
_local9 = -(_local9);
};
_local13 = (_local10 & 0x800000);
_local10 = (_local10 & 8388607);
if (_local13 != 0){
_local10 = -(_local10);
};
_local13 = (_local11 & 0x800000);
_local11 = (_local11 & 8388607);
if (_local13 != 0){
_local11 = -(_local11);
};
_local14 = false;
if ((_local12 % 3) == 0){
_local14 = true;
};
_local14 = true;
if (_local14){
currentData.push(_local9);
currentData.push(_local10);
_local15 = (Number(_local11) / 1000);
currentData.push(_local15);
};
_local12++;
};
recordings.push(currentData);
};
};
} while (_local5 == true);
}
static function StopData(){
recordings.push(currentData);
}
static function GetItem(_arg1:int, _arg2:int):PlayerRecord{
var _local3:PlayerRecord;
var _local4:Array;
_local3 = new PlayerRecord(0, 0, 0, 0);
if ((((_arg1 < 0)) || ((_arg1 >= recordings.length)))){
return (null);
};
_local4 = recordings[_arg1];
if ((((_arg2 < 0)) || ((_arg2 >= (_local4.length / 3))))){
return (null);
};
_local3.x = (_local4[((_arg2 * 3) + 0)] as Number);
_local3.y = (_local4[((_arg2 * 3) + 1)] as Number);
_local3.rot = (_local4[((_arg2 * 3) + 2)] as Number);
_local3.frame = 0;
return (_local3);
}
static function GetRouteLen(_arg1:int):int{
var _local2:Array;
if ((((_arg1 < 0)) || ((_arg1 >= recordings.length)))){
return (-1);
};
_local2 = recordings[_arg1];
return ((_local2.length / 3));
}
static function GetItem1(_arg1:int, _arg2:int):PlayerRecord{
var _local3:Array;
if ((((_arg1 < 0)) || ((_arg1 >= recordings.length)))){
return (null);
};
_local3 = recordings[_arg1];
if ((((_arg2 < 0)) || ((_arg2 >= (_local3.length / 3))))){
return (null);
};
pr1.x = (_local3[((_arg2 * 3) + 0)] as Number);
pr1.y = (_local3[((_arg2 * 3) + 1)] as Number);
pr1.rot = (_local3[((_arg2 * 3) + 2)] as Number);
pr1.frame = 0;
return (pr1);
}
}
}//package
Section 285
//Poly (Poly)
package {
import flash.display.*;
import flash.geom.*;
public class Poly {
var param0:String;
var param1:String;
var subTypeName:String;
var active:Boolean;
var name:String;
var pointList:Array;
var typeName:String;
var boundingRectangle:Rectangle;
var iparam0:int;
var lineList:Array;
var closed:Boolean;
var hitCallback:Object;
var type:int;
var catmullRomLength:Number;
public static const polytype_WALL = 1;
public static const polytype_CEILING = 6;
public static const polytype_ZONE = 3;
public static const polytype_PATH = 0;
public static const polytype_FLOOR = 5;
public static const polytype_OVERLAY = 4;
public static const polytype_TRIGGER = 2;
public function Poly(_arg1:String, _arg2:int, _arg3:Number, _arg4:Number):void{
lineList = new Array();
active = true;
type = _arg2;
name = _arg1;
boundingRectangle = null;
hitCallback = null;
closed = false;
pointList = new Array();
pointList.push(new Point(_arg3, _arg4));
}
function PointOnCurve(_arg1:Number, _arg2:Point, _arg3:Point, _arg4:Point, _arg5:Point):Point{
var _local6:Point;
var _local7:Number;
var _local8:Number;
_local6 = new Point();
_local7 = (_arg1 * _arg1);
_local8 = (_local7 * _arg1);
_local6.x = (0.5 * ((((2 * _arg3.x) + ((-(_arg2.x) + _arg4.x) * _arg1)) + (((((2 * _arg2.x) - (5 * _arg3.x)) + (4 * _arg4.x)) - _arg5.x) * _local7)) + ((((-(_arg2.x) + (3 * _arg3.x)) - (3 * _arg4.x)) + _arg5.x) * _local8)));
_local6.y = (0.5 * ((((2 * _arg3.y) + ((-(_arg2.y) + _arg4.y) * _arg1)) + (((((2 * _arg2.y) - (5 * _arg3.y)) + (4 * _arg4.y)) - _arg5.y) * _local7)) + ((((-(_arg2.y) + (3 * _arg3.y)) - (3 * _arg4.y)) + _arg5.y) * _local8)));
return (_local6);
}
public function GetPoint(_arg1:int):Point{
return (new Point(pointList[_arg1].x, pointList[_arg1].y));
}
public function GetPointNormal(_arg1:int):Point{
return (new Point(lineList[_arg1].nx, lineList[_arg1].ny));
}
public function GetPointOnCatmullRom(_arg1:Number):Point{
var _local2:int;
var _local3:int;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:Number;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Point;
_local2 = GetNumPoints();
if (_local2 < 4){
return (new Point(0, 0));
};
_local3 = (_local2 - 1);
_local8 = (Number(_local3) * _arg1);
_local9 = _local8;
_local10 = (_local9 - 1);
_local11 = _local9;
_local12 = (_local9 + 1);
_local13 = (_local9 + 2);
if (_local10 < 0){
_local10 = 0;
};
if (_local12 > (_local2 - 1)){
_local12 = (_local2 - 1);
};
if (_local13 > (_local2 - 1)){
_local13 = (_local2 - 1);
};
_local4 = pointList[_local10];
_local5 = pointList[_local11];
_local6 = pointList[_local12];
_local7 = pointList[_local13];
_local14 = (_local9 + 1);
_local15 = ((1 / Number(_local3)) * _local9);
_local16 = ((1 / Number(_local3)) * _local14);
_local17 = ((1 / (_local16 - _local15)) * (_arg1 - _local15));
_local18 = PointOnCurve(_local17, _local4, _local5, _local6, _local7);
return (_local18);
}
public function AddLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Line;
var _local6:Rectangle;
_local5 = new Line(_arg1, _arg2, _arg3, _arg4);
lineList.push(_local5);
pointList.push(new Point(_arg3, _arg4));
if (boundingRectangle == null){
boundingRectangle = _local5.boundingRect;
} else {
_local6 = boundingRectangle.clone();
boundingRectangle = _local6.union(_local5.boundingRect);
};
}
public function GetLine(_arg1:int):Line{
return (lineList[_arg1]);
}
public function CalculateCatmullRomLength(){
var _local1:Array;
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Point;
var _local6:Point;
var _local7:Point;
_local1 = new Array();
_local3 = GetNumPoints();
if (_local3 < 4){
catmullRomLength = 0;
} else {
_local4 = 0;
while (_local4 < 1) {
_local5 = GetPointOnCatmullRom(_local4);
_local1.push(_local5);
_local4 = (_local4 + 0.025);
};
};
catmullRomLength = 0;
_local2 = 0;
while (_local2 < (_local1.length - 2)) {
_local6 = _local1[_local2];
_local7 = _local1[(_local2 + 1)];
catmullRomLength = (catmullRomLength + Utils.DistBetweenPoints(_local6.x, _local6.y, _local7.x, _local7.y));
_local2++;
};
_local1 = null;
}
public function Finish(_arg1:Boolean){
var _local2:Line;
var _local3:Line;
var _local4:Line;
var _local5:Rectangle;
if (_arg1){
_local2 = lineList[0];
_local3 = lineList[(lineList.length - 1)];
_local4 = new Line(_local3.x1, _local3.y1, _local2.x0, _local2.y0);
lineList.push(_local4);
_local5 = boundingRectangle.clone();
boundingRectangle = _local5.union(_local4.boundingRect);
};
closed = _arg1;
}
public function GetCatmullRomLength():Number{
return (catmullRomLength);
}
public function GetNumLines():int{
return (lineList.length);
}
public function OffsetFromStartPoint(){
var _local1:*;
var _local2:*;
var _local3:int;
var _local4:Line;
_local1 = -(pointList[0].x);
_local2 = -(pointList[0].y);
_local3 = 0;
while (_local3 < pointList.length) {
pointList[_local3].x = (pointList[_local3].x + _local1);
pointList[_local3].y = (pointList[_local3].y + _local2);
_local3++;
};
_local3 = 0;
while (_local3 < lineList.length) {
_local4 = lineList[_local3];
lineList[_local3].x0 = (_local4.x0 + _local1);
_local4.x1 = (_local4.x1 + _local1);
_local4.y0 = (_local4.y0 + _local2);
_local4.y1 = (_local4.y1 + _local2);
_local3++;
};
}
public function DrawCatmullRom(_arg1:BitmapData, _arg2:uint, _arg3:Number, _arg4:Number){
var _local5:int;
var _local6:Number;
var _local7:Point;
_local5 = GetNumPoints();
if (_local5 < 4){
return;
};
_local6 = 0;
while (_local6 < 1) {
_local7 = GetPointOnCatmullRom(_local6);
_arg1.setPixel32((_local7.x + _arg3), (_local7.y + _arg4), _arg2);
_local6 = (_local6 + 0.001);
};
}
public function GetNumPoints():int{
return (pointList.length);
}
public static function MakeSplineFromPointList(_arg1:Array):Poly{
var _local2:Point;
var _local3:Point;
var _local4:Poly;
var _local5:int;
var _local6:int;
_local2 = _arg1[0];
_local4 = new Poly("", 0, _local2.x, _local2.y);
_local5 = _arg1.length;
_local6 = 0;
while (_local6 < (_local5 - 1)) {
_local2 = _arg1[_local6];
_local3 = _arg1[(_local6 + 1)];
_local4.AddLine(_local2.x, _local2.y, _local3.x, _local3.y);
_local6++;
};
_local4.Finish(false);
_local4.CalculateCatmullRomLength();
return (_local4);
}
public static function FindAllByType(_arg1:int, _arg2:Array):Array{
var _local3:Array;
var _local4:Poly;
_local3 = new Array();
for each (_local4 in _arg2) {
if (_local4.type == _arg1){
_local3.push(_local4);
};
};
return (_local3);
}
public static function FindByName(_arg1:String, _arg2:Array):Poly{
var _local3:Poly;
for each (_local3 in _arg2) {
if (_local3.name == _arg1){
return (_local3);
};
};
return (null);
}
public static function FindIndexByName(_arg1:String, _arg2:Array):int{
var _local3:int;
var _local4:Poly;
_local3 = 0;
for each (_local4 in _arg2) {
if (_local4.name == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
}
}//package
Section 286
//PosMarker (PosMarker)
package {
import flash.display.*;
public dynamic class PosMarker extends MovieClip {
}
}//package
Section 287
//pump (pump)
package {
import flash.media.*;
public dynamic class pump extends Sound {
}
}//package
Section 288
//rickMovie (rickMovie)
package {
import flash.display.*;
public dynamic class rickMovie extends MovieClip {
public function rickMovie(){
addFrameScript(719, frame720);
}
function frame720(){
stop();
}
}
}//package
Section 289
//Routes (Routes)
package {
import flash.display.*;
public dynamic class Routes extends MovieClip {
}
}//package
Section 290
//SaveData (SaveData)
package {
import flash.net.*;
public class SaveData {
static var id:String = "CycloManiacs01";
public static function Clear():void{
var _local1:SharedObject;
var _local2:int;
var _local3:PlayerBikeData;
var _local4:Level;
var _local5:Achievement;
_local1 = SharedObject.getLocal(id);
_local1.clear();
_local1.close();
_local1.flush();
trace("SaveData Data Cleared");
trace(("len: " + _local1.size));
_local2 = 0;
while (_local2 < 20) {
_local3 = PlayerBikes.GetBikeData(_local2);
_local3.available = false;
_local3.bellAvailable = false;
_local2++;
};
PlayerBikes.GetBikeData(0).available = true;
_local2 = 0;
while (_local2 < 100) {
_local4 = Game.GetLevel(_local2);
if (_local4 != null){
_local4.available = false;
_local4.played = false;
};
_local2++;
};
Game.GetLevel(0).available = true;
_local2 = 0;
while (_local2 < 100) {
if (_local2 < Game.achievements.list.length){
_local5 = Game.achievements.list[_local2];
_local5.complete = false;
};
_local2++;
};
Player.SetLevel(0, 0);
Player.SetLevel(1, 0);
Player.SetLevel(2, 0);
Player.SetLevel(3, 0);
Player.SetLevel(4, 0);
Game.cash = 0;
Game.helpIsAvailable = true;
Game.cheatUnlocked0 = false;
Game.cheatUnlocked1 = false;
Game.cheatUnlocked2 = false;
Game.cheatUnlocked3 = false;
Game.numFirstPlaces = 0;
Game.numRacesCompleted = 0;
}
public static function Save():void{
var _local1:int;
var _local2:SharedObject;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:Array;
var _local7:Array;
var _local8:Array;
var _local9:PlayerBikeData;
var _local10:Level;
var _local11:Achievement;
_local2 = SharedObject.getLocal(id);
if (_local2 == null){
trace("SO null");
return;
};
if (_local2.size == 0){
trace("SO size 0");
};
_local2.clear();
_local3 = new Array();
_local4 = new Array();
_local1 = 0;
while (_local1 < 20) {
_local9 = PlayerBikes.GetBikeData(_local1);
_local3.push(_local9.available);
_local4.push(_local9.bellAvailable);
_local1++;
};
_local5 = new Array();
_local6 = new Array();
_local1 = 0;
while (_local1 < 100) {
_local10 = Game.GetLevel(_local1);
if (_local10 != null){
_local5.push(_local10.available);
_local6.push(_local10.played);
};
_local1++;
};
_local7 = new Array();
_local1 = 0;
while (_local1 < 100) {
if (_local1 < Game.achievements.list.length){
_local11 = Game.achievements.list[_local1];
_local7.push(_local11.complete);
};
_local1++;
};
_local8 = new Array();
_local8.push(Player.GetLevel(0));
_local8.push(Player.GetLevel(1));
_local8.push(Player.GetLevel(2));
_local8.push(Player.GetLevel(3));
_local8.push(Player.GetLevel(4));
_local2.data.bikes = _local3;
_local2.data.bells = _local4;
_local2.data.levels = _local5;
_local2.data.levelsplayed = _local6;
_local2.data.upgrades = _local8;
_local2.data.achievements = _local7;
_local2.data.cash = Game.cash;
_local2.data.helpavailable = Game.helpIsAvailable;
_local2.data.cheat0 = Game.cheatUnlocked0;
_local2.data.cheat1 = Game.cheatUnlocked1;
_local2.data.cheat2 = Game.cheatUnlocked2;
_local2.data.cheat3 = Game.cheatUnlocked3;
_local2.data.numfirstplaces = Game.numFirstPlaces;
_local2.data.numracescomplete = Game.numRacesCompleted;
_local2.close();
trace("Saved Data OK");
}
public static function Load():void{
var _local1:SharedObject;
var _local2:int;
var _local3:PlayerBikeData;
var _local4:Level;
var _local5:Achievement;
_local1 = SharedObject.getLocal(id);
if (_local1 == null){
trace((("Shared Object: " + id) + " is null"));
return;
};
if (_local1.size == 0){
trace((("Shared Object: " + id) + " size=0"));
_local1.close();
return;
};
_local2 = 0;
while (_local2 < 20) {
_local3 = PlayerBikes.GetBikeData(_local2);
_local3.available = _local1.data.bikes[_local2];
_local3.bellAvailable = _local1.data.bells[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < 100) {
_local4 = Game.GetLevel(_local2);
if (_local4 != null){
_local4.available = _local1.data.levels[_local2];
_local4.played = _local1.data.levelsplayed[_local2];
};
_local2++;
};
_local2 = 0;
while (_local2 < 100) {
if (_local2 < Game.achievements.list.length){
_local5 = Game.achievements.list[_local2];
_local5.complete = _local1.data.achievements[_local2];
};
_local2++;
};
Player.SetLevel(0, _local1.data.upgrades[0]);
Player.SetLevel(1, _local1.data.upgrades[1]);
Player.SetLevel(2, _local1.data.upgrades[2]);
Player.SetLevel(3, _local1.data.upgrades[3]);
Player.SetLevel(4, _local1.data.upgrades[4]);
Game.cash = _local1.data.cash;
Game.helpIsAvailable = _local1.data.helpavailable;
Game.cheatUnlocked0 = _local1.data.cheat0;
Game.cheatUnlocked1 = _local1.data.cheat1;
Game.cheatUnlocked2 = _local1.data.cheat2;
Game.cheatUnlocked3 = _local1.data.cheat3;
if (_local1.data.numfirstplaces != undefined){
Game.numFirstPlaces = _local1.data.numfirstplaces;
};
if (_local1.data.numracescomplete != undefined){
Game.numRacesCompleted = _local1.data.numracescomplete;
};
_local1.close();
trace("Loaded data OK");
}
public static function DontLoad():void{
}
public static function Exists():Boolean{
var _local1:SharedObject;
_local1 = SharedObject.getLocal(id);
if (_local1 == null){
trace((("Shared Object: " + id) + " null"));
return (false);
};
if (_local1.size == 0){
trace((("Shared Object: " + id) + " size 0"));
_local1.close();
return (false);
};
_local1.close();
return (true);
}
public static function DontSave():void{
}
}
}//package
Section 291
//ShockwaveLogo (ShockwaveLogo)
package {
import flash.display.*;
public dynamic class ShockwaveLogo extends MovieClip {
}
}//package
Section 292
//ShopItem (ShopItem)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ShopItem extends MovieClip {
public var upgradeText:TextField;
public var upgradeIndicator:MovieClip;
public var costText:TextField;
public var upgradeIcon:MovieClip;
}
}//package
Section 293
//ShopScreen (ShopScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ShopScreen extends MovieClip {
public var textCash:TextField;
public var item2:ShopItem;
public var item0:ShopItem;
public var item3:ShopItem;
public var item4:ShopItem;
public var item1:ShopItem;
}
}//package
Section 294
//ShotController (ShotController)
package {
public class ShotController {
public var timer:int;
public var shotTypeName:String;
public var yoff:Number;
public var xoff:Number;
public var shotDefIndex:int;
public function Set(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number){
timer = 0;
shotTypeName = _arg1;
shotDefIndex = WaveDefs.GetShotDefIndexByName(_arg2);
xoff = _arg3;
yoff = _arg4;
}
public function clone():ShotController{
var _local1:ShotController;
_local1 = new ShotController();
_local1.timer = timer;
_local1.shotTypeName = shotTypeName;
_local1.shotDefIndex = shotDefIndex;
_local1.xoff = xoff;
_local1.yoff = yoff;
return (_local1);
}
}
}//package
Section 295
//ShotDef (ShotDef)
package {
public class ShotDef {
var spreadRange:Number;
var name:String;
var spreadAng:Number;
var intervalTicks:Number;
var numShots:int;
var type:int;
public function ShotDef(_arg1:String){
name = _arg1;
type = 0;
intervalTicks = 0;
}
public function SetSpreadPulse(_arg1:Number, _arg2:int, _arg3:Number, _arg4=-1){
intervalTicks = (Defs.fps * _arg1);
type = 1;
numShots = _arg2;
spreadRange = Utils.DegToRad(_arg3);
spreadAng = -1;
if (_arg4 != -1){
spreadAng = Utils.DegToRad(_arg4);
};
}
public function SetNormal(_arg1:Number){
intervalTicks = (Defs.fps * _arg1);
type = 0;
}
}
}//package
Section 296
//SiteLock (SiteLock)
package {
import flash.events.*;
public class SiteLock {
static var miniclip_locked:Boolean = false;
static var sitelockActive:Boolean = false;
public static function InitOnce():void{
}
static function onValidDomain(_arg1:Event):void{
trace("Miniclip sitelock OK");
miniclip_locked = false;
}
public static function IsLocked():Boolean{
var _local1:String;
_local1 = GetDomain();
if (Licensors.GetLicensor() == Licensors.LICENSOR_SIKIDS){
if (((!((_local1 == "timeforkids.com"))) && (!((_local1 == "sikids.com"))))){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_KONGREGATE){
if (_local1 != "kongregate.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_SHOCKWAVE){
if (_local1 != "shockwave.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_KING){
if (((!((_local1 == "king.com"))) && (!((_local1 == "midasplayer.com"))))){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_GAMEZHERO){
if (_local1 != "gamezhero.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_ARMORGAMES){
if (_local1 != "armorgames.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_BUBBLEBOX){
if (_local1 != "bubblebox.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_ANDKON){
if (_local1 != "andkon.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_BIGFISH){
if (((((((((((!((_local1 == "bigfishgames.com"))) && (!((_local1 == "bigfishgames.de"))))) && (!((_local1 == "bigfishgames.fr"))))) && (!((_local1 == "bigfishgames.es"))))) && (!((_local1 == "bigfishgames.mx"))))) && (!((_local1 == "bigfishgames.jp"))))){
return (true);
};
return (false);
};
return (false);
}
public static function GetDomain():String{
var _local1:String;
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local1 = Main.theStage.loaderInfo.url;
_local2 = (_local1.indexOf("://") + 3);
_local3 = _local1.indexOf("/", _local2);
_local4 = _local1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
return (_local4);
}
public static function GetDomainFromUrl(_arg1:String):String{
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local2 = (_arg1.indexOf("://") + 3);
_local3 = _arg1.indexOf("/", _local2);
_local4 = _arg1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
return (_local4);
}
static function onInvalidDomain(_arg1:Event):void{
trace("Miniclip sitelock INVALID");
miniclip_locked = true;
}
}
}//package
Section 297
//sky1 (sky1)
package {
import flash.display.*;
public dynamic class sky1 extends MovieClip {
}
}//package
Section 298
//sky2 (sky2)
package {
import flash.display.*;
public dynamic class sky2 extends MovieClip {
}
}//package
Section 299
//sky3 (sky3)
package {
import flash.display.*;
public dynamic class sky3 extends MovieClip {
}
}//package
Section 300
//sky4 (sky4)
package {
import flash.display.*;
public dynamic class sky4 extends MovieClip {
}
}//package
Section 301
//sky5 (sky5)
package {
import flash.display.*;
public dynamic class sky5 extends MovieClip {
}
}//package
Section 302
//sky6 (sky6)
package {
import flash.display.*;
public dynamic class sky6 extends MovieClip {
}
}//package
Section 303
//SoundPlayer (SoundPlayer)
package {
import flash.media.*;
import flash.utils.*;
public class SoundPlayer {
public static const minPlayTime = 3;
static var doSFX:Boolean;
static var channel:SoundChannel;
public static var startTimes:Array;
static var timer:Timer;
static var active = false;
public static var sounds:Array;
public static var sound:Sound;
public static var times:Array;
public static var volumes:Array;
public static var lengths:Array;
public static var soundTransform:SoundTransform;
static var Instances:Array;
public static var names:Array;
static var st:SoundTransform = new SoundTransform(1, 0);
public static var soundTransforms:Array;
static var main:Main;
static var playingFlag:Boolean;
public static var soundChannels:Array;
static function AddSound(_arg1:String){
var classRef:Class;
var s:Sound;
var _soundName = _arg1;
try {
classRef = (getDefinitionByName(_soundName) as Class);
} catch(e:Object) {
classRef = null;
};
if (classRef == null){
trace(("AddSound Error: Can't find sound " + _soundName));
sounds.push(null);
} else {
s = (new (classRef) as Sound);
sounds.push(s);
};
names.push(_soundName);
startTimes.push(0);
lengths.push(0);
volumes.push(1);
times.push(0);
}
public static function InitOnce(_arg1:Main):void{
doSFX = Game.soundon;
main = _arg1;
startTimes = new Array();
lengths = new Array();
sounds = new Array();
names = new Array();
times = new Array();
volumes = new Array();
soundChannels = new Array();
soundTransforms = new Array();
AddSound("bellplayer01");
AddSound("bellplayer02");
AddSound("bellplayer03");
AddSound("bellplayer04");
AddSound("bellplayer05");
AddSound("bellplayer06");
AddSound("bellplayer07");
AddSound("bellplayer08");
AddSound("bellplayer09");
AddSound("bellplayer10");
AddSound("bellplayer11");
AddSound("bellplayer12");
AddSound("bellplayer13");
AddSound("bellplayer14");
AddSound("bellplayer15");
AddSound("bellplayer16");
AddSound("bellplayer17");
AddSound("bellplayer18");
AddSound("bellplayer19");
AddSound("bellplayer20");
AddSound("pedalling");
AddSound("coasting");
AddSound("boost");
AddSound("bunnyhop");
AddSound("trick");
AddSound("pump");
AddSound("pickup0");
AddSound("pickup1");
AddSound("pickup2");
AddSound("pickup3");
AddSound("pickup4");
AddSound("pickup5");
soundTransform = new SoundTransform(1, 0);
active = true;
playingFlag = false;
}
public static function UpdateOncePerFrame():void{
var _local1:int;
var _local2:int;
_local2 = times.length;
_local1 = 0;
while (_local1 < _local2) {
if (times[_local1] > 0){
var _local3 = times;
var _local4 = _local1;
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
};
_local1++;
};
}
public static function PlayRandomBetween(_arg1:String, _arg2:String, _arg3:Number=1):void{
var _local4:int;
var _local5:int;
var _local6:int;
if (doSFX == false){
return;
};
_local4 = names.indexOf(_arg1);
_local5 = names.indexOf(_arg2);
_local6 = Utils.RandBetweenInt(_local4, _local5);
PlayById(_local6, _arg3);
}
public static function Play(_arg1:String, _arg2:Number=1):void{
var _local3:int;
if (doSFX == false){
return;
};
_local3 = names.indexOf(_arg1);
PlayById(_local3, _arg2);
}
public static function PlayById(_arg1:int, _arg2:Number=1):void{
var _local3:SoundTransform;
var _local4:Sound;
if (doSFX == false){
return;
};
if (times[_arg1] > 0){
return;
};
if (sounds[_arg1] != null){
_local4 = sounds[_arg1];
_local3 = new SoundTransform();
_local3.volume = _arg2;
_local4.play(0, 0, _local3);
times[_arg1] = 5;
} else {
trace(("SoundPlayer: Cant find sound " + _arg1));
};
}
public static function SetVolume(_arg1:SoundChannel, _arg2:Number){
if (_arg1 == null){
return;
};
st.volume = _arg2;
if (doSFX == false){
st.volume = 0;
};
_arg1.soundTransform = st;
}
public static function ToggleMute(){
doSFX = (doSFX == false);
}
public static function GetId(_arg1:String):int{
var _local2:int;
_local2 = names.indexOf(_arg1);
return (_local2);
}
public static function StartLoop(_arg1:int, _arg2:Number=1):SoundChannel{
var _local3:SoundChannel;
var _local4:Sound;
if (sounds[_arg1] != null){
_local4 = sounds[_arg1];
_local3 = _local4.play(0, 9999999, new SoundTransform(0, 0));
SetVolume(_local3, _arg2);
return (_local3);
};
return (null);
}
}
}//package
import flash.events.*;
import flash.media.*;
import flash.utils.*;
class SoundPlay {
private var channel:SoundChannel;
private var timer:Timer;
private var playingFlag;
private function SoundPlay(){
}
private function timerHandler(_arg1:TimerEvent):void{
timer.stop();
channel.stop();
playingFlag = false;
}
public function Clear():void{
playingFlag = false;
timer = null;
}
public function Active():Boolean{
return (playingFlag);
}
public function Play(_arg1:int):void{
channel = SoundPlayer.sound.play(SoundPlayer.startTimes[_arg1], 1, SoundPlayer.soundTransform);
timer = new Timer(SoundPlayer.lengths[_arg1]);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
playingFlag = true;
}
}
Section 304
//SpeedLine (SpeedLine)
package {
import flash.display.*;
public dynamic class SpeedLine extends MovieClip {
}
}//package
Section 305
//SpeedLine01 (SpeedLine01)
package {
import flash.display.*;
public dynamic class SpeedLine01 extends MovieClip {
}
}//package
Section 306
//SpeedLine02 (SpeedLine02)
package {
import flash.display.*;
public dynamic class SpeedLine02 extends MovieClip {
}
}//package
Section 307
//SpeedLine03 (SpeedLine03)
package {
import flash.display.*;
public dynamic class SpeedLine03 extends MovieClip {
}
}//package
Section 308
//SpeedLine04 (SpeedLine04)
package {
import flash.display.*;
public dynamic class SpeedLine04 extends MovieClip {
}
}//package
Section 309
//StartRaceText (StartRaceText)
package {
import flash.display.*;
public dynamic class StartRaceText extends MovieClip {
}
}//package
Section 310
//Stat (Stat)
package {
public class Stat {
var value:Number;
var name:String;
public function Stat(_arg1:String, _arg2:Number){
name = _arg1;
value = _arg2;
}
}
}//package
Section 311
//Stats (Stats)
package {
public class Stats {
static var list:Array;
public static function InitOnce(){
list = new Array();
}
public static function Add(_arg1:String, _arg2:Number){
var _local3:Stat;
_local3 = FindByName(_arg1);
_local3.value = (_local3.value + _arg2);
}
public static function FindByName(_arg1:String):Stat{
var _local2:Stat;
for each (_local2 in list) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
public static function Create(_arg1:String, _arg2:Number){
list.push(new Stat(_arg1, _arg2));
}
}
}//package
Section 312
//stuntBar (stuntBar)
package {
import flash.display.*;
public dynamic class stuntBar extends MovieClip {
}
}//package
Section 313
//titleScreen (titleScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class titleScreen extends MovieClip {
public var textVersion:TextField;
public var buttonClearSaveData:SimpleButton;
public var logoShockwave:ShockwaveLogo;
public var logoBubbleBox:SimpleButton;
public var logoSIKids:SimpleButton;
public var buttonEnterCheats:SimpleButton;
public var logoKiba:SimpleButton;
public var buttonPlay:SimpleButton;
public var sponsorBar:MovieClip;
public var logoArmorGames:SimpleButton;
public var logoAndkon:SimpleButton;
public var logoKongregate:SimpleButton;
public var buttonViewGameCompleteScreen:SimpleButton;
public function titleScreen(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package
Section 314
//TitleScreenState (TitleScreenState)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.ui.*;
public class TitleScreenState {
static const numLevelsPerWorld:int = 5;
static var selectedBikeIndex:int;
static var levelEndScreenFailed:Boolean;
static var levelSelect_selectedLevel:int;
static var greyFilter:ColorMatrixFilter = new ColorMatrixFilter([0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0, 0, 0, 1, 0]);
static var gameCompleteSoundOn:Boolean;
static var gameCompleteOverlay:MovieClip;
static var selectedAchievementIndex:int;
public static var goToWorldSelect:Boolean = false;
static var enterCheatMC:MovieClip;
public static var worldInfoText:Array = new Array("Dunes, full of undulating curves and big dunes. Inhabited by a scary bubble", "Volcania, home of steep slopes and lava floes", "Sunset City. Leap over buses and cars, and beware the killer piano.", "Outlands, for demanding off-roading. Beware the walrus", "Planetoid, a barren wasteland of craters, biscuits, and haddock.", "Moon. A bonus level where you can race 20 riders at once!");
static var main:Main;
static var overlayMC:MovieClip = null;
static var titleMC:MovieClip;
static var itemNames:Array;
static var currentAchievement:int;
public static function buttonStart1Pressed(_arg1:MouseEvent){
}
public static function LevelStart_buttonBackPressed(_arg1:MouseEvent){
Game.main.removeChild(titleMC);
titleMC = null;
InitLevelSelect();
}
public static function LevelSelect_levelOut(_arg1:MouseEvent){
levelSelect_selectedLevel = -1;
Game.currentLevel = levelSelect_selectedLevel;
LevelSelect_Update();
}
public static function buttonArmorGamesPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.armorgames.com"), "_blank");
}
public static function LevelEnd_buttonRetryPressed(_arg1:MouseEvent){
Game.main.removeChild(titleMC);
titleMC = null;
Game.InitLevel2();
}
public static function GameCompleteMovieButton(_arg1:SimpleButton){
var _local2:Boolean;
_arg1.addEventListener(MouseEvent.CLICK, buttonViewGameCompletePressed, false, 0, true);
_local2 = (Game.achievements.AllComplete() == false);
if (_local2 == false){
_arg1.filters = [];
} else {
_arg1.filters = [greyFilter];
};
}
public static function BikeSelect_SetSelected(){
var _local1:int;
var _local2:int;
var _local3:PlayerBikeData;
var _local4:Achievement;
var _local5:MovieClip;
_local1 = Game.currentBikeIndex;
if (_local1 == -1){
titleMC.chosen.visible = false;
titleMC.textBikerName.text = "";
titleMC.textBikerBio.text = "";
titleMC.textUnlock.text = "";
} else {
_local3 = PlayerBikes.GetBikeData(_local1);
titleMC.chosen.visible = true;
titleMC.chosen.gotoAndStop(_local3.selectFrame);
titleMC.textBikerName.text = _local3.name;
titleMC.textBikerBio.text = _local3.bio;
titleMC.textUnlock.text = "";
for each (_local4 in Game.achievements.list) {
if (_local4.completeFunction == "AchPass_UnlockBike"){
if (int(_local4.completeFunctionParams) == (Game.currentBikeIndex + 1)){
if (_local4.complete == false){
titleMC.textUnlock.text = ((("To unlock:\nAchievement " + int((Game.achievements.GetAchievementIndex(_local4) + 1))) + "\n") + Game.achievements.GetFullString(_local4.name));
};
};
};
};
};
_local2 = 0;
while (_local2 < 20) {
_local3 = PlayerBikes.GetBikeData(_local2);
_local5 = titleMC[("bike" + (_local2 + 1).toString())];
if (_local1 == _local2){
_local5.chosenBox.visible = true;
} else {
_local5.chosenBox.visible = false;
};
_local2++;
};
}
static function ShopUpgradePressed(_arg1:MouseEvent){
var _local2:int;
var _local3:Boolean;
_local2 = _arg1.currentTarget.parent.itemIndex;
_local3 = false;
if ((((Game.cash >= Player.GetCost(_local2))) && ((Player.GetLevel(_local2) < 10)))){
_local3 = true;
};
if (Game.usedebug){
_local3 = true;
};
if (!_local3){
return;
};
Game.cash = (Game.cash - Player.GetCost(_local2));
Player.Upgrade(_local2);
UpdateShop();
}
public static function LevelSelect_buttonNextPressed(_arg1:MouseEvent){
var _local2:Level;
var _local3:Boolean;
var _local4:int;
var _local5:int;
var _local6:MovieClip;
_local2 = Game.GetLevel(_arg1.currentTarget.levelID);
_local3 = _local2.available;
_local4 = _arg1.currentTarget.levelID;
if ((((_local4 == 4)) && ((PlayerBikes.GetBikeData((5 - 1)).available == false)))){
_local3 = false;
};
if ((((_local4 == 9)) && ((PlayerBikes.GetBikeData((13 - 1)).available == false)))){
_local3 = false;
};
if ((((_local4 == 14)) && ((PlayerBikes.GetBikeData((12 - 1)).available == false)))){
_local3 = false;
};
if ((((_local4 == 19)) && ((PlayerBikes.GetBikeData((17 - 1)).available == false)))){
_local3 = false;
};
if ((((_local4 == 24)) && ((PlayerBikes.GetBikeData((19 - 1)).available == false)))){
_local3 = false;
};
if (Game.usedebug){
_local3 = true;
};
if (!_local3){
return;
};
_local5 = 0;
while (_local5 < 5) {
_local6 = titleMC[("level" + (_local5 + 1).toString())];
_local6.removeEventListener(MouseEvent.CLICK, LevelSelect_buttonNextPressed);
_local6.removeEventListener(MouseEvent.MOUSE_OVER, LevelSelect_levelOver);
_local6.removeEventListener(MouseEvent.MOUSE_OUT, LevelSelect_levelOut);
_local5++;
};
Game.main.removeChild(titleMC);
titleMC = null;
SaveData.Save();
InitLevelStartScreen();
}
public static function EnterCheatCodeScreen_HintsPressed(_arg1:MouseEvent){
SponsorBar_GoToCheatsUrl();
}
static function MainLogo(_arg1:MovieClip):void{
_arg1.logoKongregate.visible = false;
_arg1.logoKiba.visible = false;
_arg1.logoBubbleBox.visible = false;
_arg1.logoAndkon.visible = false;
_arg1.logoSIKids.visible = false;
_arg1.logoShockwave.visible = false;
_arg1.logoArmorGames.visible = false;
_arg1.logoKongregate.addEventListener(MouseEvent.CLICK, SponsorBar_logoPressed, false, 0, true);
_arg1.logoKiba.addEventListener(MouseEvent.CLICK, SponsorBar_logoPressed, false, 0, true);
_arg1.logoBubbleBox.addEventListener(MouseEvent.CLICK, SponsorBar_logoPressed, false, 0, true);
_arg1.logoAndkon.addEventListener(MouseEvent.CLICK, SponsorBar_logoPressed, false, 0, true);
_arg1.logoSIKids.addEventListener(MouseEvent.CLICK, SponsorBar_logoPressed, false, 0, true);
_arg1.logoArmorGames.addEventListener(MouseEvent.CLICK, SponsorBar_logoPressed, false, 0, true);
if (Licensors.GetLicensor() == Licensors.LICENSOR_KONGREGATE){
_arg1.logoKongregate.visible = true;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_KIBA){
_arg1.logoKiba.visible = true;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_BUBBLEBOX){
_arg1.logoBubbleBox.visible = true;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_ANDKON){
_arg1.logoAndkon.visible = true;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_SIKIDS){
_arg1.logoSIKids.visible = true;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_SHOCKWAVE){
_arg1.logoShockwave.visible = true;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_ARMORGAMES){
_arg1.logoArmorGames.visible = true;
};
};
};
};
};
};
};
}
public static function EnterCheatCodeScreen_OkClicked(_arg1:MouseEvent){
var _local2:String;
_local2 = enterCheatMC.textInput.text;
_local2 = _local2.toUpperCase();
if (_local2 == Game.cheat0String){
Game.cheatUnlocked0 = true;
};
if (_local2 == Game.cheat1String){
Game.cheatUnlocked1 = true;
};
if (_local2 == Game.cheat2String){
Game.cheatUnlocked2 = true;
};
if (_local2 == Game.cheat3String){
Game.cheatUnlocked3 = true;
};
enterCheatMC.textInput.text = "";
InitEnterCheatCodeScreen_Update();
SaveData.Save();
}
public static function InitAchievementScreen(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:*;
var _local7:int;
var _local8:Achievement;
var _local9:MovieClip;
Mouse.show();
overlayMC = main.AddMovieClip(0, 0, new AchievementScreen());
overlayMC.buttonBack.addEventListener(MouseEvent.CLICK, AchievementScreen_buttonBackPressed, false, 0, true);
GameCompleteMovieButton(overlayMC.buttonViewGameCompleteScreen);
SponsorBar(overlayMC.sponsorBar);
_local2 = 50;
_local1 = 50;
_local3 = _local1;
_local4 = 40;
_local5 = 55;
_local6 = (Defs.displayarea_w - 50);
_local7 = 0;
for each (_local8 in Game.achievements.list) {
_local9 = new AchievementBox();
_local9.name = ("ach" + _local7);
overlayMC.addChild(_local9);
_local9.x = _local1;
_local9.y = _local2;
_local9.addEventListener(MouseEvent.MOUSE_OVER, AchievementScreen_achievementOver, false, 0, true);
_local9.addEventListener(MouseEvent.CLICK, AchievementScreen_achievementPressed, false, 0, true);
_local9.achID = _local7;
_local9.textNumber.text = (_local7 + 1).toString();
_local9.tick.visible = false;
if (_local8.complete){
_local9.tick.visible = true;
};
_local9.selectedClip.visible = false;
_local9.medalover.visible = false;
_local9.cacheAsBitmap = true;
_local7++;
_local1 = (_local1 + _local4);
if (_local1 > _local6){
_local1 = _local3;
_local2 = (_local2 + _local5);
};
};
selectedAchievementIndex = -1;
overlayMC.textName.text = "";
overlayMC.textDescription.text = "";
overlayMC.textClickToPlay.text = "";
}
public static function InitWorldSelect_buttonQuitPressed(_arg1:MouseEvent){
var _local2:int;
var _local3:MovieClip;
_local2 = 0;
while (_local2 < 6) {
_local3 = titleMC[("level" + (_local2 + 1).toString())];
_local3.removeEventListener(MouseEvent.CLICK, WorldSelect_worldPressed);
_local3.removeEventListener(MouseEvent.MOUSE_OVER, WorldSelect_worldOver);
_local3.removeEventListener(MouseEvent.MOUSE_OUT, WorldSelect_worldOut);
_local2++;
};
Game.main.removeChild(titleMC);
titleMC = null;
Init(main);
}
public static function AchievementUnlocked_buttonNextPressed(_arg1:MouseEvent){
Game.main.removeChild(titleMC);
titleMC = null;
currentAchievement++;
if (currentAchievement < Game.achievements.unlockedList.length){
InitAchievementUnlockedScreen();
} else {
InitLevelEndScreen1();
};
}
public static function Init(_arg1:Main){
Mouse.show();
main = _arg1;
MusicPlayer.StopMusic();
MusicPlayer.StartStream(5);
main.InitStage();
titleMC = main.AddMovieClip(0, 0, new titleScreen());
titleMC.textVersion.text = Game.version;
if (goToWorldSelect){
goToWorldSelect = false;
main.removeChild(titleMC);
titleMC = null;
Game.InitGame();
SaveData.Load();
Game.SubmitAllKongStats();
InitWorldSelect();
} else {
Game.InitGame();
SaveData.Load();
Game.SubmitAllKongStats();
MainLogo(titleMC);
titleMC.buttonPlay.addEventListener(MouseEvent.CLICK, buttonStartPressed, false, 0, true);
titleMC.buttonClearSaveData.addEventListener(MouseEvent.CLICK, buttonClearSaveDataPressed, false, 0, true);
titleMC.buttonEnterCheats.addEventListener(MouseEvent.CLICK, buttonEnterCheatsPressed, false, 0, true);
SponsorBar(titleMC.sponsorBar);
GameCompleteMovieButton(titleMC.buttonViewGameCompleteScreen);
};
}
public static function WorldSelect_Update(){
var _local1:int;
var _local2:MovieClip;
_local1 = 0;
while (_local1 < 6) {
_local2 = titleMC[("level" + (_local1 + 1).toString())];
_local2.selectedMC.visible = false;
if (_local1 == Game.currentWorldID){
_local2.selectedMC.visible = true;
};
_local1++;
};
}
public static function buttonAndkonPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.andkon.com/arcade/"), "_blank");
}
public static function InitLevelEndScreen1(){
titleMC = main.AddMovieClip(0, 0, new LevelEndScreen());
SponsorBar(titleMC.sponsorBar);
if (levelEndScreenFailed){
titleMC.symTitle.textTitle.text = "FAIL! You were caught";
titleMC.symStat0.textStat0.text = "";
titleMC.symStat1.textStat1.text = "";
titleMC.symStat2.textStat2.text = "";
titleMC.symStat3.textStat3.text = "";
titleMC.symStat4.textStat4.text = "";
titleMC.symTime.textTime.text = "";
titleMC.symCash.textCash.text = "";
InitBonusLevelFailedScreen();
} else {
titleMC.symStat0.textStat0.text = ("Air Time: " + Utils.CounterToSecondsString(Game.levelAirTime));
titleMC.symStat1.textStat1.text = ("Rear Wheelie Time: " + Utils.CounterToSecondsString(Game.levelWheelieTime));
titleMC.symStat2.textStat2.text = ("Front Wheelie Time: " + Utils.CounterToSecondsString(Game.levelFrontWheelieTime));
titleMC.symStat3.textStat3.text = ("Forward Somersaults: " + Game.levelForwardSomersaults);
titleMC.symStat4.textStat4.text = ("Backward Somersaults: " + Game.levelBackSomersaults);
titleMC.symTitle.textTitle.text = "Level Finished";
titleMC.symTime.textTime.text = ("Time: " + Utils.CounterToSecondsString(Game.raceTimer));
titleMC.symCash.textCash.text = (((("Position: " + (Game.playerRacePosition + 1)) + " ( you won $") + Game.playerRaceFinishCash) + ")");
};
titleMC.buttonNext.addEventListener(MouseEvent.CLICK, LevelEnd_buttonNextPressed, false, 0, true);
titleMC.buttonRetry.addEventListener(MouseEvent.CLICK, LevelEnd_buttonRetryPressed, false, 0, true);
titleMC.buttonSubmitData.addEventListener(MouseEvent.CLICK, LevelEnd_buttonSubmitPressed, false, 0, true);
if (Game.usedebug == false){
titleMC.buttonSubmitData.visible = false;
};
if ((((Game.playerRacePosition >= 9)) && (!((Game.currentLevel == 25))))){
overlayMC = main.AddMovieClip(0, 0, new FinishedLastScreen());
overlayMC.buttonOK.addEventListener(MouseEvent.CLICK, FinishedLast_buttonNextPressed, false, 0, true);
};
}
public static function InitEnterCheatCodeScreen_Update(){
enterCheatMC.unlock0.text = "Low Gravity LOCKED";
enterCheatMC.unlock1.text = "Super Gravity LOCKED";
enterCheatMC.unlock2.text = "Auto Boost LOCKED";
enterCheatMC.unlock3.text = "Haddock Costume LOCKED";
if (Game.cheatUnlocked0){
enterCheatMC.unlock0.text = "Low Gravity";
};
if (Game.cheatUnlocked1){
enterCheatMC.unlock1.text = "Super Gravity";
};
if (Game.cheatUnlocked2){
enterCheatMC.unlock2.text = "Auto Boost";
};
if (Game.cheatUnlocked3){
enterCheatMC.unlock3.text = "Haddock Costume";
};
enterCheatMC.tick0.visible = false;
enterCheatMC.tick1.visible = false;
enterCheatMC.tick2.visible = false;
enterCheatMC.tick3.visible = false;
if (Game.cheatUnlocked0){
enterCheatMC.tick0.visible = true;
};
if (Game.cheatUnlocked1){
enterCheatMC.tick1.visible = true;
};
if (Game.cheatUnlocked2){
enterCheatMC.tick2.visible = true;
};
if (Game.cheatUnlocked3){
enterCheatMC.tick3.visible = true;
};
enterCheatMC.tick0.gotoAndStop(1);
enterCheatMC.tick1.gotoAndStop(1);
enterCheatMC.tick2.gotoAndStop(1);
enterCheatMC.tick3.gotoAndStop(1);
if (Game.cheatMode == 1){
enterCheatMC.tick0.gotoAndStop(2);
};
if (Game.cheatMode == 2){
enterCheatMC.tick1.gotoAndStop(2);
};
if (Game.cheatMode == 3){
enterCheatMC.tick2.gotoAndStop(2);
};
if (Game.cheatMode == 4){
enterCheatMC.tick3.gotoAndStop(2);
};
}
public static function InitShop(){
var _local1:int;
var _local2:MovieClip;
itemNames = new Array();
itemNames.push("Top Speed");
itemNames.push("Accel");
itemNames.push("Brake");
itemNames.push("Boost");
itemNames.push("Spin");
_local1 = 0;
while (_local1 < 5) {
_local2 = (titleMC.getChildByName(("upgrade" + _local1.toString())) as MovieClip);
_local2.itemIndex = _local1;
_local2.buttonUpgrade.addEventListener(MouseEvent.CLICK, ShopUpgradePressed, false, 0, true);
_local2.textName.text = itemNames[_local1];
_local1++;
};
UpdateShop();
}
public static function BikeSelect_buttonBackPressed(_arg1:MouseEvent){
Game.main.removeChild(titleMC);
titleMC = null;
InitLevelStartScreen();
}
public static function SponsorBar_andkonPressed(_arg1:MouseEvent){
buttonAndkonPressed(_arg1);
}
public static function InitEnterCheatCodeScreen(){
enterCheatMC = new EnterCheatCodeScreen();
main.addChild(enterCheatMC);
enterCheatMC.textInput.text = "";
enterCheatMC.buttonOK.addEventListener(MouseEvent.CLICK, EnterCheatCodeScreen_OkClicked, false, 0, true);
enterCheatMC.buttonBack.addEventListener(MouseEvent.CLICK, EnterCheatCodeScreen_BackClicked, false, 0, true);
enterCheatMC.tick0.addEventListener(MouseEvent.CLICK, EnterCheatCodeScreen_tick0Pressed, false, 0, true);
enterCheatMC.tick1.addEventListener(MouseEvent.CLICK, EnterCheatCodeScreen_tick1Pressed, false, 0, true);
enterCheatMC.tick2.addEventListener(MouseEvent.CLICK, EnterCheatCodeScreen_tick2Pressed, false, 0, true);
enterCheatMC.tick3.addEventListener(MouseEvent.CLICK, EnterCheatCodeScreen_tick3Pressed, false, 0, true);
enterCheatMC.buttonHints.addEventListener(MouseEvent.CLICK, EnterCheatCodeScreen_HintsPressed, false, 0, true);
InitEnterCheatCodeScreen_Update();
enterCheatMC.buttonHints.visible = true;
}
public static function InitLevelSelect(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Level;
var _local5:MovieClip;
var _local6:Boolean;
var _local7:Array;
var _local8:int;
var _local9:Achievement;
var _local10:MovieClip;
Mouse.show();
levelSelect_selectedLevel = -1;
titleMC = main.AddMovieClip(0, 0, new levelSelect());
titleMC.buttonBack.addEventListener(MouseEvent.CLICK, LevelSelect_buttonBackPressed, false, 0, true);
titleMC.buttonAchievements.addEventListener(MouseEvent.CLICK, buttonAchievementsPressed, false, 0, true);
SponsorBar(titleMC.sponsorBar);
_local1 = (Game.currentWorldID + 1);
if (Game.currentWorldID == 5){
_local1 = 5;
};
titleMC.levelback.gotoAndStop(_local1);
_local2 = 5;
if (Game.currentWorldID == 5){
_local2 = 1;
};
titleMC.level1.visible = false;
titleMC.level2.visible = false;
titleMC.level3.visible = false;
titleMC.level4.visible = false;
titleMC.level5.visible = false;
_local3 = 0;
while (_local3 < _local2) {
_local4 = Game.GetLevel((_local3 + (Game.currentWorldID * numLevelsPerWorld)));
_local5 = titleMC[("level" + (_local3 + 1).toString())];
_local5.visible = true;
_local5.textLevelNumber.text = (_local3 + 1).toString();
_local5.gotoAndStop(1);
_local5.addEventListener(MouseEvent.CLICK, LevelSelect_buttonNextPressed, false, 0, true);
_local5.addEventListener(MouseEvent.MOUSE_OVER, LevelSelect_levelOver, false, 0, true);
_local5.addEventListener(MouseEvent.MOUSE_OUT, LevelSelect_levelOut, false, 0, true);
_local5.levelID = (_local3 + (Game.currentWorldID * numLevelsPerWorld));
_local5.overOutline.visible = false;
_local5.useHandCursor = true;
_local5.buttonMode = true;
if (_local4.available){
_local5.lock.visible = false;
_local5.medal0.visible = false;
_local5.medal1.visible = false;
_local5.medal2.visible = false;
_local7 = Game.achievements.GetLevelAchievements(_local5.levelID);
_local8 = 0;
for each (_local9 in _local7) {
_local10 = _local5[("medal" + _local8)];
_local10.visible = true;
if (_local9.complete){
_local10.gotoAndStop(2);
} else {
_local10.gotoAndStop(1);
};
_local8++;
};
} else {
_local5.lock.visible = true;
_local5.medal0.visible = false;
_local5.medal1.visible = false;
_local5.medal2.visible = false;
};
_local6 = false;
if (((_local4.available) && ((_local4.played == false)))){
_local6 = true;
};
_local5.newlevel.visible = _local6;
if (_local5.lock.visible){
_local5.filters = [greyFilter];
} else {
_local5.filters = [];
};
_local3++;
};
titleMC.textTrackName.text = "";
titleMC.textTrackInfo.text = "";
InitShop();
LevelSelect_Update();
}
public static function buttonAndkonGuidePressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("walkthrough.html"), "_blank");
}
public static function InitLevelEndScreen(_arg1:Boolean=false){
levelEndScreenFailed = _arg1;
Mouse.show();
Game.QuietLoops();
if (Game.achievements.unlockedList.length != 0){
currentAchievement = 0;
InitAchievementUnlockedScreen();
} else {
InitLevelEndScreen1();
};
}
public static function EnterCheatCodeScreen_tick3Pressed(_arg1:MouseEvent){
var _local2:MovieClip;
Game.cheatMode = 0;
_local2 = enterCheatMC.tick3;
if (_local2.currentFrame == 1){
Game.cheatMode = 4;
};
InitEnterCheatCodeScreen_Update();
}
public static function AchievementScreen_achievementPressed(_arg1:MouseEvent){
var _local2:Boolean;
var _local3:Achievement;
_local2 = false;
selectedAchievementIndex = _arg1.currentTarget.achID;
_local3 = Game.achievements.list[selectedAchievementIndex];
if (_local3.specificLevel != -1){
_local2 = true;
};
if (_local2){
if (_local3.specificLevel != -1){
if (IsLevelAvailable(_local3.specificLevel)){
Game.main.removeChild(overlayMC);
overlayMC = null;
Game.main.removeChild(titleMC);
titleMC = null;
Game.currentLevel = (_local3.specificLevel - 1);
Game.currentWorldID = (Game.currentLevel / numLevelsPerWorld);
InitLevelStartScreen();
};
};
};
}
public static function closeGameComplete(_arg1:MouseEvent){
if (titleMC != null){
titleMC.visible = true;
};
if (overlayMC != null){
overlayMC.visible = true;
};
main.removeChild(gameCompleteOverlay);
gameCompleteOverlay = null;
MusicPlayer.doMusic = gameCompleteSoundOn;
}
public static function GameOverScreenComplete(){
main.removeChild(titleMC);
titleMC = null;
Game.main.SetGameState(Main.gameState_TITLE);
}
public static function WorldSelect_worldOut(_arg1:MouseEvent){
Game.currentWorldID = -1;
WorldSelect_Update();
titleMC.textInfo.text = "";
}
public static function LevelEnd_buttonSubmitPressed(_arg1:MouseEvent){
ExternalData.SendLevelStatsToServer();
titleMC.buttonSubmitData.visible = false;
}
public static function SponsorBar_logoPressed(_arg1:MouseEvent){
if (Licensors.GetLicensor() == Licensors.LICENSOR_KONGREGATE){
navigateToURL(new URLRequest("http://www.kongregate.com/?gamereferral=cyclomaniacs"), "_blank");
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_ANDKON){
buttonAndkonPressed(_arg1);
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_BUBBLEBOX){
buttonBubbleBoxPressed(_arg1);
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_KIBA){
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_SIKIDS){
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_SHOCKWAVE){
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_ARMORGAMES){
buttonArmorGamesPressed(_arg1);
};
};
};
};
};
};
};
}
public static function EnterCheatCodeScreen_BackClicked(_arg1:MouseEvent){
SaveData.Save();
main.removeChild(enterCheatMC);
enterCheatMC = null;
}
public static function EnterCheatCodeScreen_tick2Pressed(_arg1:MouseEvent){
var _local2:MovieClip;
Game.cheatMode = 0;
_local2 = enterCheatMC.tick2;
if (_local2.currentFrame == 1){
Game.cheatMode = 3;
};
InitEnterCheatCodeScreen_Update();
}
public static function LevelSelect_levelOver(_arg1:MouseEvent){
var _local2:int;
_local2 = _arg1.currentTarget.levelID;
levelSelect_selectedLevel = _local2;
Game.currentLevel = _local2;
LevelSelect_Update();
}
public static function LevelStart_buttonNextPressed(_arg1:MouseEvent){
Game.main.removeChild(titleMC);
titleMC = null;
InitBikeSelect();
}
static function UpdateShop():void{
var _local1:int;
var _local2:int;
var _local3:MovieClip;
var _local4:int;
var _local5:MovieClip;
titleMC.textMoney.text = ("Money: $" + Game.cash);
_local1 = 0;
while (_local1 < 5) {
_local3 = (titleMC.getChildByName(("upgrade" + _local1.toString())) as MovieClip);
_local4 = Player.GetLevel(_local1);
_local2 = 1;
while (_local2 <= 10) {
_local5 = _local3[("lv" + _local2.toString())];
if (_local2 <= _local4){
_local5.gotoAndStop(2);
} else {
_local5.gotoAndStop(1);
};
_local2++;
};
_local3.textCost.text = ("$" + Player.GetCost(_local1).toString());
if ((((Game.cash >= Player.GetCost(_local1))) && ((Player.GetLevel(_local1) < 10)))){
_local3.buttonUpgrade.filters = [];
} else {
_local3.buttonUpgrade.filters = [greyFilter];
};
_local1++;
};
}
static function buttonLonganimalsPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.longanimalsgames.com?referal=bike"), "_blank");
}
static function LevelSelect_Update(){
var _local1:int;
var _local2:Level;
var _local3:Boolean;
var _local4:Achievement;
var _local5:String;
var _local6:int;
var _local7:MovieClip;
if (levelSelect_selectedLevel == -1){
titleMC.textTrackName.text = "";
titleMC.textTrackInfo.text = "";
} else {
_local2 = Game.GetLevel(levelSelect_selectedLevel);
titleMC.textTrackName.text = _local2.name;
titleMC.textTrackInfo.text = "";
_local3 = false;
for each (_local4 in Game.achievements.list) {
if (_local4.completeFunction == "AchPass_UnlockLevel"){
if (int(_local4.completeFunctionParams) == (levelSelect_selectedLevel + 1)){
if (_local4.complete == false){
titleMC.textTrackInfo.text = ((("To unlock get Achievement " + Game.achievements.GetAchievementIndex(_local4)) + ": ") + Game.achievements.GetFullString(_local4.name));
_local3 = true;
};
};
};
};
if (_local3 == false){
_local5 = "";
if (levelSelect_selectedLevel == 4){
_local5 = "You need &Bike5 to play this course";
};
if (levelSelect_selectedLevel == 9){
_local5 = "You need &Bike13 to play this course";
};
if (levelSelect_selectedLevel == 14){
_local5 = "You need &Bike12 to play this course";
};
if (levelSelect_selectedLevel == 19){
_local5 = "You need &Bike17 to play this course";
};
if (levelSelect_selectedLevel == 24){
_local5 = "You need &Bike19 to play this course";
};
_local5 = Game.achievements.GetFullString(_local5);
titleMC.textTrackInfo.text = _local5;
};
};
_local1 = 0;
while (_local1 < 5) {
_local6 = (_local1 + (Game.currentWorldID * numLevelsPerWorld));
_local7 = titleMC[("level" + (_local1 + 1).toString())];
if (_local6 == levelSelect_selectedLevel){
_local7.overOutline.visible = true;
} else {
_local7.overOutline.visible = false;
};
_local1++;
};
}
public static function InitBikeSelect(){
var _local1:Level;
var _local2:int;
var _local3:PlayerBikeData;
var _local4:MovieClip;
var _local5:int;
Mouse.show();
_local1 = Game.GetCurrentLevel();
Game.currentBikeIndex = -1;
titleMC = main.AddMovieClip(0, 0, new BikeSelectScreen());
titleMC.buttonBack.addEventListener(MouseEvent.CLICK, BikeSelect_buttonBackPressed, false, 0, true);
SponsorBar(titleMC.sponsorBar);
titleMC.noRiderOverlay.visible = false;
if (_local1.exclusiveChar != -1){
if (PlayerBikes.GetBikeData((_local1.exclusiveChar - 1)).available == false){
titleMC.noRiderOverlay.visible = true;
};
};
_local2 = 0;
while (_local2 < 20) {
_local3 = PlayerBikes.GetBikeData(_local2);
_local4 = titleMC[("bike" + (_local2 + 1).toString())];
_local4.bikeID = _local2;
_local4.bikerName.text = _local3.name;
_local4.gotoAndStop(_local3.selectFrame);
_local4.addEventListener(MouseEvent.CLICK, BikeSelect_buttonNextPressed, false, 0, true);
_local4.addEventListener(MouseEvent.MOUSE_OVER, BikeSelect_bikeOver, false, 0, true);
_local4.addEventListener(MouseEvent.MOUSE_OUT, BikeSelect_bikeOut, false, 0, true);
_local4.chosenBox.visible = false;
if (_local3.available){
_local4.filters = [];
_local4.characterLock.visible = false;
if (_local1.exclusiveChar != -1){
_local5 = (_local1.exclusiveChar - 1);
if (_local5 == _local2){
_local4.characterLock.visible = false;
_local4.filters = [];
} else {
_local4.characterLock.visible = true;
_local4.filters = [greyFilter];
};
};
} else {
_local4.filters = [greyFilter];
_local4.characterLock.visible = true;
};
if (_local3.bellAvailable){
_local4.horn.visible = true;
} else {
_local4.horn.visible = false;
};
_local4.useHandCursor = true;
_local4.buttonMode = true;
_local2++;
};
BikeSelect_SetSelected();
}
static function IsLevelAvailable(_arg1:int):Boolean{
var _local2:Level;
var _local3:Boolean;
_local2 = Game.GetLevel((_arg1 - 1));
_local3 = true;
if (_local2.available == false){
_local3 = false;
};
if ((((_arg1 == 4)) && ((PlayerBikes.GetBikeData((5 - 1)).available == false)))){
_local3 = false;
};
if ((((_arg1 == 9)) && ((PlayerBikes.GetBikeData((13 - 1)).available == false)))){
_local3 = false;
};
if ((((_arg1 == 14)) && ((PlayerBikes.GetBikeData((12 - 1)).available == false)))){
_local3 = false;
};
if ((((_arg1 == 19)) && ((PlayerBikes.GetBikeData((17 - 1)).available == false)))){
_local3 = false;
};
if ((((_arg1 == 24)) && ((PlayerBikes.GetBikeData((19 - 1)).available == false)))){
_local3 = false;
};
return (_local3);
}
public static function WorldSelect_worldOver(_arg1:MouseEvent){
var _local2:int;
_local2 = _arg1.currentTarget.worldID;
Game.currentWorldID = _local2;
WorldSelect_Update();
titleMC.textInfo.text = worldInfoText[_local2];
}
public static function AreYouSureScreen_OkClicked(_arg1:MouseEvent){
main.removeChild(overlayMC);
overlayMC = null;
Game.cash = 0;
SaveData.Clear();
SaveData.Load();
Game.SubmitAllKongStats();
Game.cheatMode = 0;
}
public static function EnterCheatCodeScreen_tick1Pressed(_arg1:MouseEvent){
var _local2:MovieClip;
Game.cheatMode = 0;
_local2 = enterCheatMC.tick1;
if (_local2.currentFrame == 1){
Game.cheatMode = 2;
};
InitEnterCheatCodeScreen_Update();
}
public static function InitLevelStartScreen(){
var _local1:Level;
var _local2:int;
var _local3:Achievement;
var _local4:TextField;
var _local5:MovieClip;
Mouse.show();
Game.pause = true;
_local1 = Game.GetCurrentLevel();
titleMC = main.AddMovieClip(0, 0, new LevelStartScreen());
SponsorBar(titleMC.sponsorBar);
titleMC.textTitle.text = _local1.name;
titleMC.textAchievement0.text = "";
titleMC.textAchievement1.text = "";
titleMC.textAchievement2.text = "";
titleMC.complete0.gotoAndStop(1);
titleMC.complete1.gotoAndStop(1);
titleMC.complete2.gotoAndStop(1);
_local2 = 0;
for each (_local3 in Game.achievements.list) {
if ((_local3.specificLevel - 1) == Game.currentLevel){
_local4 = titleMC[("textAchievement" + _local2)];
_local4.text = Game.achievements.GetFullString(_local3.description);
_local5 = titleMC[("complete" + _local2)];
if (_local3.complete){
_local5.gotoAndStop(2);
} else {
_local5.gotoAndStop(1);
};
_local2++;
};
};
titleMC.buttonNext.addEventListener(MouseEvent.CLICK, LevelStart_buttonNextPressed, false, 0, true);
titleMC.buttonBack.addEventListener(MouseEvent.CLICK, LevelStart_buttonBackPressed, false, 0, true);
}
public static function InitBonusLevelFailedScreen(){
overlayMC = new FailedBonusLevelScreen();
main.addChild(overlayMC);
overlayMC.addEventListener(MouseEvent.CLICK, BonusLevelFailedScreenClicked, false, 0, true);
overlayMC.gotoAndStop((Game.currentWorldID + 1));
}
public static function buttonClearSaveDataPressed(_arg1:MouseEvent){
InitAreYouSureScreen();
}
static function buttonRobotJamPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.robotjamgames.com?referal=bike"), "_blank");
}
public static function LevelSelect_buttonBackPressed(_arg1:MouseEvent){
Game.main.removeChild(titleMC);
titleMC = null;
SaveData.Save();
InitWorldSelect();
}
static function buttonNickPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.nick.com/kids-choice-awards/kca.jhtml"), "_blank");
}
public static function buttonStartPressed(_arg1:MouseEvent){
main.removeChild(titleMC);
titleMC = null;
Game.InitLevel();
Game.main.SetGameState(Main.gameState_LEVEL_PLAY);
}
public static function WorldSelect_Next(){
var _local1:int;
var _local2:MovieClip;
_local1 = 0;
while (_local1 < 6) {
_local2 = titleMC[("level" + (_local1 + 1).toString())];
_local2.removeEventListener(MouseEvent.CLICK, WorldSelect_worldPressed);
_local2.removeEventListener(MouseEvent.MOUSE_OVER, WorldSelect_worldOver);
_local2.removeEventListener(MouseEvent.MOUSE_OUT, WorldSelect_worldOut);
_local1++;
};
Game.main.removeChild(titleMC);
titleMC = null;
InitLevelSelect();
}
public static function LevelEnd_buttonNextPressed(_arg1:MouseEvent){
Game.main.removeChild(titleMC);
titleMC = null;
InitWorldSelect();
}
public static function WorldSelect_buttonBackPressed(_arg1:MouseEvent){
}
public static function AreYouSureScreen_CancelClicked(_arg1:MouseEvent){
main.removeChild(overlayMC);
overlayMC = null;
}
public static function BikeSelect_buttonNextPressed(_arg1:MouseEvent){
var _local2:int;
var _local3:PlayerBikeData;
var _local4:Boolean;
var _local5:Level;
var _local6:int;
var _local7:MovieClip;
_local2 = _arg1.currentTarget.bikeID;
_local3 = PlayerBikes.GetBikeData(_local2);
_local4 = _local3.available;
_local5 = Game.GetCurrentLevel();
if (_local5.exclusiveChar != -1){
if ((_local5.exclusiveChar - 1) != _local2){
_local4 = false;
};
};
if (Game.usedebug){
_local4 = true;
};
if (!_local4){
return;
};
_local6 = 0;
while (_local6 < 20) {
_local7 = titleMC[("bike" + (_local6 + 1).toString())];
_local7.removeEventListener(MouseEvent.CLICK, BikeSelect_buttonNextPressed);
_local7.removeEventListener(MouseEvent.MOUSE_OVER, BikeSelect_bikeOver);
_local7.removeEventListener(MouseEvent.MOUSE_OUT, BikeSelect_bikeOut);
_local6++;
};
Game.main.removeChild(titleMC);
titleMC = null;
Game.InitLevel2();
Game.pause = false;
KeyReader.InitOnce(Game.main.stage);
}
public static function InitAreYouSureScreen(){
overlayMC = new AreYouSure();
main.addChild(overlayMC);
overlayMC.buttonOK.addEventListener(MouseEvent.CLICK, AreYouSureScreen_OkClicked, false, 0, true);
overlayMC.buttonCancel.addEventListener(MouseEvent.CLICK, AreYouSureScreen_CancelClicked, false, 0, true);
}
public static function AchievementScreen_achievementOver(_arg1:MouseEvent){
var _local2:Achievement;
var _local3:int;
var _local4:MovieClip;
selectedAchievementIndex = _arg1.currentTarget.achID;
_local2 = Game.achievements.list[selectedAchievementIndex];
overlayMC.textClickToPlay.text = "";
if (_local2.specificLevel != -1){
if (IsLevelAvailable(_local2.specificLevel)){
overlayMC.textClickToPlay.text = ("Click to play " + Game.GetLevel((_local2.specificLevel - 1)).name);
};
};
overlayMC.textName.text = Game.achievements.GetFullString(_local2.name);
overlayMC.textDescription.text = Game.achievements.GetFullString(_local2.description);
_local3 = 0;
for each (_local2 in Game.achievements.list) {
_local4 = (overlayMC.getChildByName(("ach" + _local3.toString())) as MovieClip);
if (_local4 != null){
_local4.medalover.visible = false;
if (_local3 == selectedAchievementIndex){
_local4.medalover.visible = true;
};
};
_local3++;
};
}
static function SponsorBar(_arg1:MovieClip):void{
_arg1.visible = true;
_arg1.buttonLogoKongregate.addEventListener(MouseEvent.CLICK, SponsorBar_logoPressed, false, 0, true);
_arg1.buttonLogoAndkon.addEventListener(MouseEvent.CLICK, SponsorBar_logoPressed, false, 0, true);
_arg1.buttonLogoBubbleBox.addEventListener(MouseEvent.CLICK, SponsorBar_logoPressed, false, 0, true);
_arg1.buttonLogoSIKids.addEventListener(MouseEvent.CLICK, SponsorBar_logoPressed, false, 0, true);
_arg1.buttonMoreGames.addEventListener(MouseEvent.CLICK, SponsorBar_moreGamesPressed, false, 0, true);
_arg1.buttonAndkonArcade.addEventListener(MouseEvent.CLICK, SponsorBar_moreGamesPressed, false, 0, true);
_arg1.buttonCheats.addEventListener(MouseEvent.CLICK, SponsorBar_cheatsPressed, false, 0, true);
_arg1.buttonAndkonArcade.visible = false;
_arg1.buttonLogoAndkon.visible = false;
_arg1.buttonLogoBubbleBox.visible = false;
_arg1.buttonLogoKongregate.visible = false;
_arg1.buttonLogoSIKids.visible = false;
if (Licensors.GetLicensor() == Licensors.LICENSOR_KONGREGATE){
_arg1.buttonLogoKongregate.visible = true;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_NOBRANDING){
_arg1.background.visible = false;
_arg1.buttonMoreGames.visible = false;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_KIBA){
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_BUBBLEBOX){
_arg1.background.visible = false;
_arg1.buttonLogoBubbleBox.visible = true;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_ANDKON){
_arg1.buttonAndkonArcade.visible = true;
_arg1.buttonMoreGames.visible = false;
_arg1.buttonLogoAndkon.visible = true;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_SIKIDS){
_arg1.buttonLogoSIKids.visible = true;
_arg1.background.visible = false;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_SHOCKWAVE){
_arg1.buttonMoreGames.visible = false;
_arg1.background.visible = false;
_arg1.buttonCheats.visible = false;
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_ARMORGAMES){
_arg1.buttonMoreGames.visible = false;
_arg1.background.visible = false;
_arg1.buttonCheats.visible = false;
};
};
};
};
};
};
};
};
}
public static function EnterCheatCodeScreen_tick0Pressed(_arg1:MouseEvent){
var _local2:MovieClip;
Game.cheatMode = 0;
_local2 = enterCheatMC.tick0;
if (_local2.currentFrame == 1){
Game.cheatMode = 1;
};
InitEnterCheatCodeScreen_Update();
}
public static function buttonKongregatePressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.kongregate.com/?gamereferral=cyclomaniacs"), "_blank");
}
public static function AchievementScreen_buttonBackPressed(_arg1:MouseEvent){
Game.main.removeChild(overlayMC);
overlayMC = null;
}
public static function WorldSelect_worldPressed(_arg1:MouseEvent){
var _local2:Boolean;
var _local3:MovieClip;
_local2 = false;
_local3 = (_arg1.currentTarget as MovieClip);
_local2 = (_local3.lock.visible == false);
if (Game.usedebug){
_local2 = true;
};
if (_local2){
WorldSelect_Next();
};
}
public static function BikeSelect_bikeOut(_arg1:MouseEvent){
}
public static function buttonAchievementsPressed(_arg1:MouseEvent){
InitAchievementScreen();
}
public static function buttonBubbleBoxPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.bubblebox.com"), "_blank");
}
public static function BonusLevelFailedScreenClicked(_arg1:MouseEvent){
main.removeChild(overlayMC);
overlayMC = null;
}
public static function InitWorldSelect(){
var _local1:int;
var _local2:int;
var _local3:MovieClip;
var _local4:Boolean;
var _local5:Boolean;
Mouse.show();
titleMC = main.AddMovieClip(0, 0, new worldSelect());
titleMC.textInfo.text = "";
Game.currentWorldID = -1;
titleMC.buttonQuit.addEventListener(MouseEvent.CLICK, InitWorldSelect_buttonQuitPressed, false, 0, true);
titleMC.buttonAchievements.addEventListener(MouseEvent.CLICK, buttonAchievementsPressed, false, 0, true);
SponsorBar(titleMC.sponsorBar);
_local1 = 0;
while (_local1 < 6) {
_local3 = titleMC[("level" + (_local1 + 1).toString())];
_local3.addEventListener(MouseEvent.CLICK, WorldSelect_worldPressed, false, 0, true);
_local3.addEventListener(MouseEvent.MOUSE_OVER, WorldSelect_worldOver, false, 0, true);
_local3.addEventListener(MouseEvent.MOUSE_OUT, WorldSelect_worldOut, false, 0, true);
_local3.worldID = _local1;
_local3.gotoAndStop((_local1 + 1));
_local3.useHandCursor = true;
_local3.buttonMode = true;
_local4 = false;
_local5 = false;
if (_local1 == 5){
if (Game.GetLevel((_local1 * numLevelsPerWorld)).available){
_local5 = true;
if (Game.GetLevel((_local1 * numLevelsPerWorld)).played == false){
_local4 = true;
};
};
} else {
_local2 = (_local1 * numLevelsPerWorld);
while (_local2 < ((_local1 * numLevelsPerWorld) + 5)) {
if (Game.GetLevel(_local2).available){
_local5 = true;
if (Game.GetLevel(_local2).played == false){
_local4 = true;
};
};
_local2++;
};
};
_local3.newlevel.visible = _local4;
if (_local5){
_local3.filters = [];
_local3.lock.visible = false;
} else {
_local3.filters = [greyFilter];
_local3.lock.visible = true;
};
_local3.selectedMC.visible = false;
_local1++;
};
WorldSelect_Update();
}
public static function KongAIAdClicked(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.kongregate.com/games/Kongregate/Kongai?gamereferral=cyclomaniacs"), "_blank");
}
public static function buttonViewGameCompletePressed(_arg1:MouseEvent){
var _local2:Boolean;
_local2 = (Game.achievements.AllComplete() == false);
if (Game.usedebug){
_local2 = false;
};
if (_local2){
return;
};
if (titleMC != null){
titleMC.visible = false;
};
if (overlayMC != null){
overlayMC.visible = false;
};
gameCompleteOverlay = new rickMovie();
main.addChild(gameCompleteOverlay);
gameCompleteOverlay.addEventListener(MouseEvent.CLICK, closeGameComplete, false, 0, true);
gameCompleteSoundOn = MusicPlayer.doMusic;
MusicPlayer.doMusic = false;
}
public static function SponsorBar_moreGamesPressed(_arg1:MouseEvent){
if (Licensors.GetLicensor() == Licensors.LICENSOR_KONGREGATE){
navigateToURL(new URLRequest("http://www.kongregate.com/?gamereferral=cyclomaniacs"), "_blank");
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_ANDKON){
buttonAndkonPressed(_arg1);
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_BUBBLEBOX){
buttonBubbleBoxPressed(_arg1);
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_SIKIDS){
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_SHOCKWAVE){
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_ARMORGAMES){
};
};
};
};
};
};
}
public static function FinishedLast_buttonNextPressed(_arg1:MouseEvent){
Game.main.removeChild(overlayMC);
overlayMC = null;
}
public static function InitEndGameScreen(){
}
public static function buttonEnterCheatsPressed(_arg1:MouseEvent){
InitEnterCheatCodeScreen();
}
public static function Update(_arg1:Main){
}
public static function BikeSelect_bikeOver(_arg1:MouseEvent){
var _local2:int;
_local2 = _arg1.currentTarget.bikeID;
Game.currentBikeIndex = _local2;
BikeSelect_SetSelected();
}
public static function SponsorBar_cheatsPressed(_arg1:MouseEvent){
SponsorBar_GoToCheatsUrl();
}
public static function InitAchievementUnlockedScreen(){
var _local1:Achievement;
var _local2:String;
titleMC = main.AddMovieClip(0, 0, new AchievementUnlockedScreen());
titleMC.buttonNext.addEventListener(MouseEvent.CLICK, AchievementUnlocked_buttonNextPressed, false, 0, true);
titleMC.buttonAchievements.addEventListener(MouseEvent.CLICK, buttonAchievementsPressed, false, 0, true);
SponsorBar(titleMC.sponsorBar);
_local1 = Game.achievements.unlockedList[currentAchievement];
titleMC.medal.textNumber.text = (Game.achievements.GetAchievementIndex(_local1) + 1).toString();
_local2 = "";
_local2 = (_local2 + Game.achievements.GetFullString(_local1.name));
_local2 = (_local2 + "\n");
_local2 = (_local2 + "\n");
_local2 = (_local2 + Game.achievements.GetFullString(_local1.description));
titleMC.textAchievement.text = _local2;
}
public static function SponsorBar_GoToCheatsUrl(){
if (Licensors.GetLicensor() == Licensors.LICENSOR_BUBBLEBOX){
navigateToURL(new URLRequest("http://www.bubblebox.com/gameinfo/water-werks.htm"), "_blank");
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_ANDKON){
buttonAndkonGuidePressed(null);
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_SIKIDS){
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_SHOCKWAVE){
} else {
if (Licensors.GetLicensor() == Licensors.LICENSOR_ARMORGAMES){
} else {
navigateToURL(new URLRequest(" http://www.kongregate.com/games/LongAnimals/cyclomaniacs-guide?gamereferral=cyclomaniacs"), "_blank");
};
};
};
};
};
}
}
}//package
Section 315
//track1music (track1music)
package {
import flash.media.*;
public dynamic class track1music extends Sound {
}
}//package
Section 316
//track2music (track2music)
package {
import flash.media.*;
public dynamic class track2music extends Sound {
}
}//package
Section 317
//track3music (track3music)
package {
import flash.media.*;
public dynamic class track3music extends Sound {
}
}//package
Section 318
//trick (trick)
package {
import flash.media.*;
public dynamic class trick extends Sound {
}
}//package
Section 319
//Utils (Utils)
package {
import flash.display.*;
import flash.geom.*;
public class Utils {
static function RandBetweenFloat(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = (Math.random() * (_arg2 - _arg1));
_local3 = (_local3 + _arg1);
return (_local3);
}
public static function DegToRad(_arg1:Number):Number{
return ((((Math.PI * 2) / 360) * _arg1));
}
public static function PointArrayFromString(_arg1:String):Array{
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:Point;
_local2 = new Array();
_local3 = _arg1.split(",");
if ((((_local3.length < 2)) || (((_local3.length % 2) == 1)))){
trace(((("PointArrayFromString. Error, numpoints=" + _local3.length) + " , string= ") + _arg1));
return (_local2);
};
_local5 = (_local3.length / 2);
_local4 = 0;
while (_local4 < _local5) {
_local6 = new Point(0, 0);
_local6.x = Number(_local3[((_local4 * 2) + 0)]);
_local6.y = Number(_local3[((_local4 * 2) + 1)]);
_local2.push(_local6);
_local4++;
};
return (_local2);
}
public static function ScaleTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local6 = (_arg4 - _arg3);
_local7 = (_arg2 - _arg1);
_local8 = ((1 / _local6) * (_arg5 - _arg3));
_local8 = ((_local7 * _local8) + _arg1);
return (_local8);
}
public static function DP2(_arg1:Number):Number{
var _local2:Number;
_local2 = (Math.ceil((_arg1 * 100)) / 100);
return (_local2);
}
static function RenderDotLine(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:int, _arg7:uint):void{
var _local8:int;
var _local9:int;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local9 = _arg6;
_local10 = ((_arg4 - _arg2) / Number(_local9));
_local11 = ((_arg5 - _arg3) / Number(_local9));
_arg1.setPixel32(int(_arg2), int(_arg3), _arg7);
_local12 = _arg2;
_local13 = _arg3;
_local8 = 0;
while (_local8 < _local9) {
_arg2 = (_arg2 + _local10);
_arg3 = (_arg3 + _local11);
_arg1.setPixel32(int(_arg2), int(_arg3), _arg7);
_local8++;
};
}
public static function RandomizeArray(_arg1:Array, _arg2:int=500):Array{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Object;
_local4 = (_arg1.length - 1);
_local3 = 0;
while (_local3 < _arg2) {
_local5 = RandBetweenInt(0, _local4);
_local6 = RandBetweenInt(0, _local4);
_local7 = _arg1[_local5];
_arg1[_local5] = _arg1[_local6];
_arg1[_local6] = _local7;
_local3++;
};
return (_arg1);
}
public static function NumberToString2DP(_arg1:Number):String{
var _local2:String;
var _local3:int;
var _local4:int;
_local2 = DP2(_arg1).toString();
_local3 = _local2.lastIndexOf(".");
if (_local3 == -1){
_local2.concat(".00");
} else {
_local4 = _local2.length;
if (_local3 == (_local4 - 1)){
_local2.concat("0");
};
};
return (_local2);
}
public static function LimitNumber(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg3 < _arg1){
_arg3 = _arg1;
};
if (_arg3 > _arg2){
_arg3 = _arg2;
};
return (_arg3);
}
public static function DP1(_arg1:Number):Number{
var _local2:Number;
_local2 = (Math.ceil((_arg1 * 10)) / 10);
return (_local2);
}
static function DotProduct(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
_local5 = ((_arg1 * _arg3) + (_arg2 * _arg4));
return (_local5);
}
static function Dist2BetweenPoints(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (((_local5 * _local5) + (_local6 * _local6)));
}
static function SideOfLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Boolean{
var _local7:Number;
_local7 = DotProduct((_arg3 - _arg1), (_arg4 - _arg2), (_arg5 - _arg1), (_arg6 - _arg2));
if (_local7 < 0){
return (false);
};
return (true);
}
static function RenderRectangle(_arg1:BitmapData, _arg2:Rectangle, _arg3:uint):void{
RenderDotLine(_arg1, _arg2.left, _arg2.top, _arg2.right, _arg2.top, 100, _arg3);
RenderDotLine(_arg1, _arg2.left, _arg2.bottom, _arg2.right, _arg2.bottom, 100, _arg3);
RenderDotLine(_arg1, _arg2.left, _arg2.top, _arg2.left, _arg2.bottom, 100, _arg3);
RenderDotLine(_arg1, _arg2.right, _arg2.top, _arg2.right, _arg2.bottom, 100, _arg3);
}
public static function rgbToHex(_arg1:uint):String{
var _local2:String;
var _local3:String;
var _local4:int;
_local2 = _arg1.toString(16);
_local3 = ("00000" + _local2);
_local4 = _local3.length;
_local3 = _local3.substring((_local4 - 6), _local4);
return (_local3.toUpperCase());
}
static function DotProductAng(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local5 = Math.cos(_arg2);
_local6 = Math.sin(_arg2);
_local7 = ((_local3 * _local5) + (_local4 * _local6));
return (_local7);
}
public static function RandCircle():Number{
return ((Math.random() * (Math.PI * 2)));
}
public static function RadToDeg(_arg1:Number):Number{
return (((360 / (Math.PI * 2)) * _arg1));
}
public static function CounterToSecondsString(_arg1:int):String{
var _local2:String;
var _local3:int;
var _local4:int;
var _local5:Number;
_local2 = "";
_local3 = (_arg1 / int(Defs.fps));
_local4 = (_arg1 % int(Defs.fps));
_local2 = (_local2 + (_local3.toString() + ":"));
_local5 = ((100 / Defs.fps) * Number(_local4));
_local2 = (_local2 + Math.floor(_local5).toString());
return (_local2);
}
public static function LineLength(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
static function RandBetweenInt(_arg1:int, _arg2:int):int{
var _local3:int;
_local3 = (Math.random() * ((_arg2 - _arg1) + 1));
_local3 = (_local3 + _arg1);
return (_local3);
}
static function DistBetweenPoints(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
public static function ScaleBetween(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number;
_local4 = ((_arg2 - _arg1) * _arg3);
_local4 = (_arg1 + _local4);
return (_local4);
}
static function RenderCircle(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:uint):void{
var _local6:int;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local6 = 50;
_local7 = ((Math.PI * 2) / _local6);
_local9 = 0;
_local8 = 0;
while (_local8 < _local6) {
_local10 = (_arg2 + (Math.cos(_local9) * _arg4));
_local11 = (_arg3 + (Math.sin(_local9) * _arg4));
_local9 = (_local9 + _local7);
_arg1.setPixel32(int(_local10), int(_local11), _arg5);
_local8++;
};
}
}
}//package
Section 320
//WallOfFire (WallOfFire)
package {
import flash.display.*;
public dynamic class WallOfFire extends MovieClip {
}
}//package
Section 321
//Walrus (Walrus)
package {
import flash.display.*;
public dynamic class Walrus extends MovieClip {
}
}//package
Section 322
//WaveDef (WaveDef)
package {
public class WaveDef {
public var pathID:int;
public var absoluteGenTime:int;
public var gapSeconds:Number;
public var actionLen:Number;
public var actionType:Number;
public var pos:Number;
public var side:int;
public var waveID:int;
public var pathSpeed:Number;
public var numInWave:int;
public var typeName:String;
public var xflip:Boolean;
public var type:int;
public var actionPos:Number;
public var pathType:int;
public function WaveDef(_arg1:int, _arg2:int, _arg3:Number, _arg4:String, _arg5:int, _arg6:int, _arg7:Number){
type = 0;
side = _arg2;
pos = _arg3;
typeName = _arg4;
pathID = _arg5;
pathType = _arg6;
absoluteGenTime = _arg1;
pathSpeed = _arg7;
numInWave = 0;
waveID = -1;
actionLen = 0;
actionPos = 0;
actionType = -1;
xflip = false;
}
public function SetID(_arg1:int, _arg2:int){
waveID = _arg1;
numInWave = _arg2;
}
}
}//package
Section 323
//WaveDefs (WaveDefs)
package {
public class WaveDefs {
static const s_bxf = 4;
static const p_sm = 1;
static const s_b = 3;
static const s_txf = 5;
static const s_l = 0;
static const s_r = 1;
static const p_sp = 2;
static const s_t = 2;
static const p_ln = 0;
static var startTime:int;
static var startPos:int;
static var waveID:int;
public static var currentPos:int;
static var list:Array;
static var currentTime:int;
static var shotDefList:Array;
public static var nextWaveDef:WaveDef;
static function WaitForBoss(_arg1:Number){
var _local2:WaveDef;
var _local3:int;
currentTime = (currentTime + (_arg1 * Defs.fps));
_local3 = currentTime;
_local2 = new WaveDef(_local3, 2, 0, "WaitForBoss", 0, 0, 0);
list.push(_local2);
waveID++;
currentPos = (currentPos + 1);
}
static function addPause1(_arg1:WaveDef){
_arg1.actionPos = 400;
_arg1.actionLen = (Defs.fps * 2);
_arg1.actionType = 0;
}
public static function GetCurrentDef():WaveDef{
return (nextWaveDef);
}
public static function InitOnce(){
}
static function AddShop(_arg1:Number, _arg2:Number){
var _local3:WaveDef;
var _local4:int;
currentTime = (currentTime + (_arg1 * Defs.fps));
_local4 = currentTime;
_local3 = new WaveDef(_local4, 2, _arg2, "Shop", 0, 0, 0);
_local3.SetID(waveID, 1);
list.push(_local3);
waveID++;
currentPos = (currentPos + 1);
}
static function AddWave(_arg1:Number, _arg2:int, _arg3:Object, _arg4:int, _arg5:Number, _arg6:String, _arg7:String, _arg8:int, _arg9:Number, _arg10:Function=null){
var _local11:WaveDef;
var _local12:int;
var _local13:Array;
var _local14:int;
var _local15:Number;
var _local16:int;
if ((_arg3 is Array)){
_local13 = (_arg3 as Array);
};
if ((_arg3 is Number)){
_local13 = new Array();
_local13.push(Number(_arg3));
};
_local14 = Poly.FindIndexByName(_arg7, Game.polygonList);
if (_local14 == -1){
_local14 = 0;
trace(("ERROR: AddWave = Path not found: " + _arg7));
};
currentTime = (currentTime + (_arg1 * Defs.fps));
for each (_local15 in _local13) {
_local12 = 0;
while (_local12 < _arg4) {
_local16 = currentTime;
_local16 = (_local16 + ((_local12 * _arg5) * Defs.fps));
if (_arg2 == s_t){
_local11 = new WaveDef(_local16, 2, _local15, _arg6, _local14, _arg8, _arg9);
_local11.SetID(waveID, (_arg4 * _local13.length));
if (_arg10 != null){
_arg10(_local11);
};
list.push(_local11);
};
if (_arg2 == s_txf){
_local11 = new WaveDef(_local16, 2, _local15, _arg6, _local14, _arg8, _arg9);
_local11.xflip = true;
_local11.SetID(waveID, (_arg4 * _local13.length));
if (_arg10 != null){
_arg10(_local11);
};
list.push(_local11);
};
if (_arg2 == s_b){
_local11 = new WaveDef(_local16, 3, _local15, _arg6, _local14, _arg8, _arg9);
_local11.SetID(waveID, (_arg4 * _local13.length));
if (_arg10 != null){
_arg10(_local11);
};
list.push(_local11);
};
if (_arg2 == s_bxf){
_local11 = new WaveDef(_local16, 4, _local15, _arg6, _local14, _arg8, _arg9);
_local11.xflip = true;
_local11.SetID(waveID, (_arg4 * _local13.length));
if (_arg10 != null){
_arg10(_local11);
};
list.push(_local11);
};
if (_arg2 == s_l){
_local11 = new WaveDef(_local16, 0, _local15, _arg6, _local14, _arg8, _arg9);
_local11.SetID(waveID, (_arg4 * _local13.length));
if (_arg10 != null){
_arg10(_local11);
};
list.push(_local11);
};
if (_arg2 == s_r){
_local11 = new WaveDef(_local16, 1, _local15, _arg6, _local14, _arg8, _arg9);
_local11.xflip = true;
_local11.SetID(waveID, (_arg4 * _local13.length));
if (_arg10 != null){
_arg10(_local11);
};
list.push(_local11);
};
_local12++;
};
};
waveID++;
currentPos = (currentPos + (_arg4 * _local13.length));
}
public static function GetShotDefIndexByName(_arg1:String):int{
var _local2:int;
var _local3:int;
var _local4:ShotDef;
_local3 = shotDefList.length;
_local2 = 0;
while (_local2 < _local3) {
_local4 = shotDefList[_local2];
if (_local4.name == _arg1){
return (_local2);
};
_local2++;
};
return (0);
}
static function StartHere(){
startTime = currentTime;
startPos = currentPos;
trace(((startPos + " ") + startTime));
}
public static function AdvanceWave(){
currentPos++;
if (currentPos >= list.length){
nextWaveDef = null;
};
nextWaveDef = list[currentPos];
}
public static function Reset(){
currentPos = startPos;
nextWaveDef = list[currentPos];
}
}
}//package
Section 324
//Vec (Vec)
package {
import flash.geom.*;
public class Vec {
public var speed:Number;
public var rot:Number;
public function Vec(){
rot = 0;
speed = 0;
}
public function Add(_arg1:Vec){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = (Math.cos(rot) * speed);
_local3 = (Math.sin(rot) * speed);
_local4 = (Math.cos(_arg1.rot) * _arg1.speed);
_local5 = (Math.sin(_arg1.rot) * _arg1.speed);
_local6 = (_local2 + _local4);
_local7 = (_local3 + _local5);
rot = Math.atan2(_local7, _local6);
speed = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
}
public function Set(_arg1:Number, _arg2:Number){
rot = _arg1;
speed = _arg2;
}
public function GetUnitYComponent():Number{
return (Math.sin(rot));
}
public function dotRot(_arg1:Number):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = Math.cos(rot);
_local3 = Math.sin(rot);
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
_local6 = ((_local2 * _local4) + (_local3 * _local5));
return (_local6);
}
function NormalizeRot():void{
while (rot < 0) {
rot = (rot + (Math.PI * 2));
};
while (rot > (Math.PI * 2)) {
rot = (rot - (Math.PI * 2));
};
}
public function GetUnitTangent():Point{
var _local1:Number;
var _local2:Point;
_local1 = (rot + (Math.PI * 0.5));
_local2 = new Point(Math.cos(_local1), Math.sin(_local1));
return (_local2);
}
public function NearRot(_arg1:Number, _arg2:Number):Boolean{
var _local3:Number;
var _local4:Number;
_local3 = (rot - _arg1);
_local4 = Math.abs(_local3);
if (_local3 > Math.PI){
if (_arg1 < rot){
_arg1 = (_arg1 + (Math.PI * 2));
} else {
_arg1 = (_arg1 - (Math.PI * 2));
};
_local3 = (rot - _arg1);
};
if (Math.abs(_local3) <= _arg2){
return (true);
};
return (false);
}
public function SetAng(_arg1:Number){
rot = _arg1;
}
public function GetYComponent():Number{
return ((Math.sin(rot) * speed));
}
public function GetXComponent():Number{
return ((Math.cos(rot) * speed));
}
public function AddRot(_arg1:Number):void{
rot = (rot + _arg1);
NormalizeRot();
}
public function GetUnitXComponent():Number{
return (Math.cos(rot));
}
}
}//package
Section 325
//worldSelect (worldSelect)
package {
import flash.display.*;
import flash.text.*;
public dynamic class worldSelect extends MovieClip {
public var level1:MovieClip;
public var level2:MovieClip;
public var level4:MovieClip;
public var level5:MovieClip;
public var level3:MovieClip;
public var level6:MovieClip;
public var buttonAchievements:SimpleButton;
public var textInfo:TextField;
public var sponsorBar:MovieClip;
public var buttonQuit:SimpleButton;
}
}//package
Section 326
//XmlHelper (XmlHelper)
package {
public class XmlHelper {
public static function GetAttrString(_arg1:Object, _arg2:String=""):String{
var _local3:String;
_local3 = _arg2;
if (_arg1 != undefined){
_local3 = String(_arg1);
};
return (_local3);
}
public static function GetAttrBoolean(_arg1:Object, _arg2:Boolean=false):Boolean{
var _local3:Boolean;
var _local4:String;
_local3 = _arg2;
if (_arg1 != null){
_local3 = false;
_local4 = String(_arg1);
_local4 = _local4.toLowerCase();
if (_arg1 == "true"){
_local3 = true;
};
};
return (_local3);
}
public static function GetAttrInt(_arg1:Object, _arg2:int=0):int{
var _local3:int;
_local3 = _arg2;
if (_arg1 != undefined){
_local3 = int(_arg1);
};
return (_local3);
}
public static function GetAttrNumber(_arg1:Object, _arg2:Number=0):Number{
var _local3:Number;
_local3 = _arg2;
if (_arg1 != undefined){
_local3 = Number(_arg1);
};
return (_local3);
}
}
}//package