Section 1
//BonusBase (Bonus.BonusBase)
package Bonus {
import flash.display.*;
public class BonusBase extends Sprite {
private var val:int;// = 0
public function remove(){
parent.removeChild(this);
}
}
}//package Bonus
Section 2
//CuartoBonus (Bonus.CuartoBonus)
package Bonus {
public class CuartoBonus extends BonusBase {
public function getVal(){
return (1000);
}
public function getColorVal():Number{
return (0x330066);
}
}
}//package Bonus
Section 3
//PrimerBonus (Bonus.PrimerBonus)
package Bonus {
public class PrimerBonus extends BonusBase {
const BONUS_VAL:int = 250;
public function getColorVal():Number{
return (0xFFFF00);
}
public function getVal(){
return (BONUS_VAL);
}
}
}//package Bonus
Section 4
//SegundoBonus (Bonus.SegundoBonus)
package Bonus {
public class SegundoBonus extends BonusBase {
public function getVal(){
return (500);
}
public function getColorVal():Number{
return (0xFF);
}
}
}//package Bonus
Section 5
//TercerBonus (Bonus.TercerBonus)
package Bonus {
public class TercerBonus extends BonusBase {
public function getVal(){
return (750);
}
public function getColorVal():Number{
return (0xFF0000);
}
}
}//package Bonus
Section 6
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2CircleDef extends b2ShapeDef {
public var radius:Number;
public var localPosition:b2Vec2;
public function b2CircleDef(){
localPosition = new b2Vec2(0, 0);
super();
type = b2Shape.e_circleShape;
radius = 1;
}
}
}//package Box2D.Collision.Shapes
Section 7
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape)
package Box2D.Collision.Shapes {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2CircleShape extends b2Shape {
public var m_localPosition:b2Vec2;
public var m_radius:Number;
public function b2CircleShape(_arg1:b2ShapeDef){
m_localPosition = new b2Vec2();
super(_arg1);
var _local2:b2CircleDef = (_arg1 as b2CircleDef);
m_type = e_circleShape;
m_localPosition.SetV(_local2.localPosition);
m_radius = _local2.radius;
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local10:Number;
var _local6:b2Mat22 = _arg1.R;
var _local7:Number = (_arg1.position.x + ((_local6.col1.x * m_localPosition.x) + (_local6.col2.x * m_localPosition.y)));
var _local8:Number = (_arg1.position.x + ((_local6.col1.y * m_localPosition.x) + (_local6.col2.y * m_localPosition.y)));
var _local9:Number = (_arg4.p1.x - _local7);
_local10 = (_arg4.p1.y - _local8);
var _local11:Number = (((_local9 * _local9) + (_local10 * _local10)) - (m_radius * m_radius));
if (_local11 < 0){
return (false);
};
var _local12:Number = (_arg4.p2.x - _arg4.p1.x);
var _local13:Number = (_arg4.p2.y - _arg4.p1.y);
var _local14:Number = ((_local9 * _local12) + (_local10 * _local13));
var _local15:Number = ((_local12 * _local12) + (_local13 * _local13));
var _local16:Number = ((_local14 * _local14) - (_local15 * _local11));
if ((((_local16 < 0)) || ((_local15 < Number.MIN_VALUE)))){
return (false);
};
var _local17:Number = -((_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 (true);
};
return (false);
}
public function GetLocalPosition():b2Vec2{
return (m_localPosition);
}
public function GetRadius():Number{
return (m_radius);
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2Mat22;
_local4 = _arg2.R;
var _local5:Number = (_arg2.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
var _local6:Number = (_arg2.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_local4 = _arg3.R;
var _local7:Number = (_arg3.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
var _local8:Number = (_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));
}
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 UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:Number = (m_localPosition.x - _arg1.x);
var _local3:Number = (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 = _arg2.R;
var _local4:Number = (_arg2.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
var _local5:Number = (_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));
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Mat22 = _arg1.R;
var _local4:Number = (_arg1.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
var _local5:Number = (_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)));
}
}
}//package Box2D.Collision.Shapes
Section 8
//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 Copy():b2FilterData{
var _local1:b2FilterData = new b2FilterData();
_local1.categoryBits = categoryBits;
_local1.maskBits = maskBits;
_local1.groupIndex = groupIndex;
return (_local1);
}
}
}//package Box2D.Collision.Shapes
Section 9
//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(){
center = new b2Vec2(0, 0);
super();
}
}
}//package Box2D.Collision.Shapes
Section 10
//b2PolygonDef (Box2D.Collision.Shapes.b2PolygonDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PolygonDef extends b2ShapeDef {
public var vertices:Array;
public var vertexCount:int;
private static var s_mat:b2Mat22 = new b2Mat22();
public function b2PolygonDef(){
vertices = new Array(b2Settings.b2_maxPolygonVertices);
super();
type = b2Shape.e_polygonShape;
vertexCount = 0;
var _local1:int;
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 11
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape)
package Box2D.Collision.Shapes {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PolygonShape extends b2Shape {
public var m_coreVertices:Array;
public var m_vertices:Array;
private var s_supportVec:b2Vec2;
public var m_centroid:b2Vec2;
public var m_normals:Array;
public var m_obb:b2OBB;
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 _local3: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;
var _local2:b2PolygonDef = (_arg1 as b2PolygonDef);
m_vertexCount = _local2.vertexCount;
var _local4:int = _local3;
var _local5:int = _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 ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2AABB = s_sweptAABB1;
var _local5:b2AABB = 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 GetCoreVertices():Array{
return (m_coreVertices);
}
public function GetCentroid():b2Vec2{
return (m_centroid);
}
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 TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local20:Number;
var _local21:Number;
var _local6:Number = 0;
var _local7:Number = _arg5;
_local8 = (_arg4.p1.x - _arg1.position.x);
_local9 = (_arg4.p1.y - _arg1.position.y);
_local10 = _arg1.R;
var _local12:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
var _local13:Number = ((_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;
var _local14:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
var _local15:Number = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
var _local16:Number = (_local14 - _local12);
var _local17:Number = (_local15 - _local13);
var _local18 = -1;
var _local19:int;
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 (false);
};
_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 (true);
};
return (false);
}
override public function ComputeMass(_arg1:b2MassData):void{
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;
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:Number = 0;
var _local7:Number = 0;
var _local8:Number = (1 / 3);
var _local9:int;
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 GetNormals():Array{
return (m_normals);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local11:Number;
_local5 = _arg1.R;
var _local6:Number = ((_arg2 * _local5.col1.x) + (_arg3 * _local5.col1.y));
var _local7:Number = ((_arg2 * _local5.col2.x) + (_arg3 * _local5.col2.y));
var _local8:int;
_local4 = m_coreVertices[0];
var _local9:Number = ((_local4.x * _local6) + (_local4.y * _local7));
var _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 ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Mat22 = 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();
var _local6:b2Mat22 = _local5;
_local4 = m_obb.extents;
var _local7:Number = ((_local6.col1.x * _local4.x) + (_local6.col2.x * _local4.y));
var _local8:Number = ((_local6.col1.y * _local4.x) + (_local6.col2.y * _local4.y));
_local3 = _arg2.R;
_local4 = m_obb.center;
var _local9:Number = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)));
var _local10:Number = (_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));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:b2Vec2;
var _local4:Number;
var _local5:Number;
m_sweepRadius = 0;
var _local3:int;
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 TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Vec2;
var _local10:Number;
var _local4:b2Mat22 = _arg1.R;
var _local5:Number = (_arg2.x - _arg1.position.x);
var _local6:Number = (_arg2.y - _arg1.position.y);
var _local7:Number = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y));
var _local8:Number = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y));
var _local9:int;
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 static function ComputeCentroid(_arg1:Array, _arg2:int):b2Vec2{
var _local3:b2Vec2;
var _local7:Number;
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();
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:Number = 0;
_local7 = (1 / 3);
var _local8:int;
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 _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;
var _local5:Array = new Array((b2Settings.b2_maxPolygonVertices + 1));
_local4 = 0;
while (_local4 < _arg3) {
_local5[_local4] = _arg2[_local4];
_local4++;
};
_local5[_arg3] = _local5[0];
var _local6:Number = 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 12
//b2Shape (Box2D.Collision.Shapes.b2Shape)
package Box2D.Collision.Shapes {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2Shape {
public var m_next: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_isSensor:Boolean;
public var m_restitution:Number;
public var m_userData;
public var m_proxyId:uint;
public var m_body:b2Body;
public static const e_polygonShape:int = 1;
public static const e_unknownShape:int = -1;
public static const e_circleShape:int = 0;
public static const e_shapeTypeCount:int = 2;
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 SetUserData(_arg1):void{
m_userData = _arg1;
}
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):Boolean{
return (false);
}
public function RefilterProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_arg1.DestroyProxy(m_proxyId);
var _local3:b2AABB = s_resetAABB;
ComputeAABB(_local3, _arg2);
var _local4:Boolean = _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{
if (m_proxyId == b2Pair.b2_nullProxy){
return (false);
};
var _local4:b2AABB = 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 = s_proxyAABB;
ComputeAABB(_local3, _arg2);
var _local4:Boolean = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
return (false);
}
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 13
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef)
package Box2D.Collision.Shapes {
public class b2ShapeDef {
public var friction:Number;// = 0.2
public var isSensor:Boolean;// = false
public var density:Number;// = 0
public var restitution:Number;// = 0
public var userData;// = null
public var filter:b2FilterData;
public var type:int;
public function b2ShapeDef(){
type = b2Shape.e_unknownShape;
filter = new b2FilterData();
super();
}
}
}//package Box2D.Collision.Shapes
Section 14
//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 = (upperBound.x - lowerBound.x);
var _local2:Number = (upperBound.y - lowerBound.y);
var _local3:Boolean = (((_local1 >= 0)) && ((_local2 >= 0)));
_local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid()));
return (_local3);
}
}
}//package Box2D.Collision
Section 15
//b2Bound (Box2D.Collision.b2Bound)
package Box2D.Collision {
public class b2Bound {
public var value:uint;
public var proxyId:uint;
public var stabbingCount:uint;
public function Swap(_arg1:b2Bound):void{
var _local2:uint = value;
var _local3:uint = proxyId;
var _local4:uint = 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 16
//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 17
//b2BroadPhase (Box2D.Collision.b2BroadPhase)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2BroadPhase {
public var m_bounds:Array;
public var m_quantizationFactor:b2Vec2;
public var m_worldAABB:b2AABB;
public var m_freeProxy:uint;
public var m_proxyCount:int;
public var m_proxyPool:Array;
public var m_queryResultCount:int;
public var m_pairManager:b2PairManager;
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 _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_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;
_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++;
};
var _local4:Number = (_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 _local6:uint;
var _local7:uint;
var _local12:b2Proxy;
var _local4:Array = new Array();
var _local5:Array = new Array();
ComputeBounds(_local4, _local5, _arg1);
var _local8:Array = [_local6];
var _local9:Array = [_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);
var _local10:int;
var _local11:int;
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 = 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 _local10:b2Bound;
var _local12:int;
var _local13:int;
var _local14:b2Proxy;
var _local8:uint = BinarySearch(_arg5, _arg6, _arg3);
var _local9:uint = BinarySearch(_arg5, _arg6, _arg4);
var _local11:uint = _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 TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{
var _local4:Array;
var _local5:b2Bound;
var _local6:b2Bound;
var _local3:int;
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);
}
private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{
var _local4:Number = _arg3.lowerBound.x;
var _local5:Number = _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);
var _local6:Number = _arg3.upperBound.x;
var _local7:Number = _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 _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;
var _local5:uint = m_freeProxy;
_local4 = m_proxyPool[_local5];
m_freeProxy = _local4.GetNext();
_local4.overlapCount = 0;
_local4.userData = _arg2;
var _local6:uint = (2 * m_proxyCount);
var _local7:Array = new Array();
var _local8:Array = new Array();
ComputeBounds(_local7, _local8, _arg1);
var _local9:int;
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++;
var _local10:int;
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 _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;
var _local4:b2Proxy = m_proxyPool[_arg1];
var _local5:int = (2 * m_proxyCount);
var _local6:int;
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++;
};
var _local7:int;
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 _local4:Array;
var _local5:b2Bound;
var _local3:int;
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 _local6:b2Bound;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
var _local5:int;
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 = 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));
}
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 _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;
};
var _local12:uint = (2 * m_proxyCount);
var _local13:b2Proxy = m_proxyPool[_arg1];
var _local14:b2BoundValues = new b2BoundValues();
ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2);
var _local15:b2BoundValues = 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 _local6:int;
var _local7:b2Bound;
var _local4:int;
var _local5:int = (_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 18
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
}
}//package Box2D.Collision
Section 19
//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 _local11:b2Mat22;
var _local12:b2Vec2;
var _local25:Number;
var _local6:int = _arg1.m_vertexCount;
var _local7:Array = _arg1.m_vertices;
var _local8:Array = _arg1.m_normals;
var _local9:int = _arg4.m_vertexCount;
var _local10:Array = _arg4.m_vertices;
_local11 = _arg2.R;
_local12 = _local8[_arg3];
var _local13:Number = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y));
var _local14:Number = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y));
_local11 = _arg5.R;
var _local15:Number = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14));
var _local16:Number = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14));
var _local17:int;
var _local18:Number = Number.MAX_VALUE;
var _local19:int;
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;
var _local20:Number = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
var _local21:Number = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local12 = _local10[_local17];
_local11 = _arg5.R;
var _local22:Number = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
var _local23:Number = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local22 = (_local22 - _local20);
_local23 = (_local23 - _local21);
var _local24:Number = ((_local22 * _local13) + (_local23 * _local14));
return (_local24);
}
public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{
var _local3:b2Vec2 = _arg2.lowerBound;
var _local4:b2Vec2 = _arg1.upperBound;
var _local5:Number = (_local3.x - _local4.x);
var _local6:Number = (_local3.y - _local4.y);
_local3 = _arg1.lowerBound;
_local4 = _arg2.upperBound;
var _local7:Number = (_local3.x - _local4.x);
var _local8:Number = (_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 _local12:b2Mat22;
var _local13:b2Vec2;
var _local20:ClipVertex;
var _local23:Number;
var _local7:int = _arg2.m_vertexCount;
var _local8:Array = _arg2.m_normals;
var _local9:int = _arg5.m_vertexCount;
var _local10:Array = _arg5.m_vertices;
var _local11:Array = _arg5.m_normals;
_local12 = _arg3.R;
_local13 = _local8[_arg4];
var _local14:Number = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y));
var _local15:Number = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y));
_local12 = _arg6.R;
var _local16:Number = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15));
_local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15));
_local14 = _local16;
var _local17:int;
var _local18:Number = Number.MAX_VALUE;
var _local19:int;
while (_local19 < _local9) {
_local13 = _local11[_local19];
_local23 = ((_local14 * _local13.x) + (_local15 * _local13.y));
if (_local23 < _local18){
_local18 = _local23;
_local17 = _local19;
};
_local19++;
};
var _local21:int = _local17;
var _local22:int = (((_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 _local13:b2PolygonShape;
var _local14:b2PolygonShape;
var _local17:int;
var _local18:uint;
var _local34:int;
var _local37:b2Vec2;
var _local38:Number;
var _local39:b2ManifoldPoint;
_arg1.pointCount = 0;
var _local7:int;
var _local8:Array = [_local7];
var _local9:Number = FindMaxSeparation(_local8, _arg2, _arg3, _arg4, _arg5);
_local7 = _local8[0];
if (_local9 > 0){
return;
};
var _local10:int;
var _local11:Array = [_local10];
var _local12:Number = FindMaxSeparation(_local11, _arg4, _arg5, _arg2, _arg3);
_local10 = _local11[0];
if (_local12 > 0){
return;
};
var _local15:b2XForm = new b2XForm();
var _local16:b2XForm = new b2XForm();
var _local19:Number = 0.98;
var _local20:Number = 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;
};
var _local21:Array = [new ClipVertex(), new ClipVertex()];
FindIncidentEdge(_local21, _local13, _local15, _local17, _local14, _local16);
var _local22:int = _local13.m_vertexCount;
var _local23:Array = _local13.m_vertices;
var _local24:b2Vec2 = _local23[_local17];
var _local25:b2Vec2 = _local24.Copy();
if ((_local17 + 1) < _local22){
_local24 = _local23[int((_local17 + 1))];
_local37 = _local24.Copy();
} else {
_local24 = _local23[0];
_local37 = _local24.Copy();
};
var _local26:b2Vec2 = b2Math.SubtractVV(_local37, _local25);
var _local27:b2Vec2 = b2Math.b2MulMV(_local15.R, b2Math.SubtractVV(_local37, _local25));
_local27.Normalize();
var _local28:b2Vec2 = b2Math.b2CrossVF(_local27, 1);
_local25 = b2Math.b2MulX(_local15, _local25);
_local37 = b2Math.b2MulX(_local15, _local37);
var _local29:Number = b2Math.b2Dot(_local28, _local25);
var _local30:Number = -(b2Math.b2Dot(_local27, _local25));
var _local31:Number = b2Math.b2Dot(_local27, _local37);
var _local32:Array = [new ClipVertex(), new ClipVertex()];
var _local33:Array = [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();
var _local35:int;
var _local36:int;
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 _local8:b2Vec2;
var _local9:b2Mat22;
var _local22:int;
var _local23:Number;
var _local24:int;
var _local25:Number;
var _local6:int = _arg2.m_vertexCount;
var _local7:Array = _arg2.m_normals;
_local9 = _arg5.R;
_local8 = _arg4.m_centroid;
var _local10:Number = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)));
var _local11:Number = (_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))));
var _local12:Number = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y));
var _local13:Number = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y));
var _local14:int;
var _local15:Number = -(Number.MAX_VALUE);
var _local16:int;
while (_local16 < _local6) {
_local8 = _local7[_local16];
_local25 = ((_local8.x * _local12) + (_local8.y * _local13));
if (_local25 > _local15){
_local15 = _local25;
_local14 = _local16;
};
_local16++;
};
var _local17:Number = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
var _local18:int = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1);
var _local19:Number = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5);
if (_local19 > 0){
return (_local19);
};
var _local20:int = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0;
var _local21:Number = 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 _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);
var _local10:Number = (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 _local18:Number;
var _local24:Number;
var _local25:Number;
_arg1.pointCount = 0;
_local6 = _arg3.R;
_local7 = _arg2.m_localPosition;
var _local8:Number = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
var _local9:Number = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local6 = _arg5.R;
_local7 = _arg4.m_localPosition;
var _local10:Number = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
var _local11:Number = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
var _local12:Number = (_local10 - _local8);
var _local13:Number = (_local11 - _local9);
var _local14:Number = ((_local12 * _local12) + (_local13 * _local13));
var _local15:Number = _arg2.m_radius;
var _local16:Number = _arg4.m_radius;
var _local17:Number = (_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;
var _local19:b2ManifoldPoint = _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));
var _local20:Number = (0.5 * (_local8 + _local10));
var _local21:Number = (0.5 * (_local9 + _local11));
var _local22:Number = (_local20 - _arg3.position.x);
var _local23:Number = (_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 _local17:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_arg1.pointCount = 0;
_local12 = _arg5.R;
_local11 = _arg4.m_localPosition;
var _local13:Number = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)));
var _local14:Number = (_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;
var _local15:Number = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
var _local16:Number = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
var _local18:int;
var _local19:Number = -(Number.MAX_VALUE);
var _local20:Number = _arg4.m_radius;
var _local21:int = _arg2.m_vertexCount;
var _local22:Array = _arg2.m_vertices;
var _local23:Array = _arg2.m_normals;
var _local24:int;
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;
};
var _local25:int = _local18;
var _local26:int = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0;
_local11 = _local22[_local25];
var _local27:b2Vec2 = _local22[_local26];
var _local28:Number = (_local27.x - _local11.x);
var _local29:Number = (_local27.y - _local11.y);
var _local30:Number = Math.sqrt(((_local28 * _local28) + (_local29 * _local29)));
_local28 = (_local28 / _local30);
_local29 = (_local29 / _local30);
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
var _local31:Number = ((_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 20
//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 = new b2ContactID();
_local1.key = key;
return (_local1);
}
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);
}
public function get key():uint{
return (_key);
}
}
}//package Box2D.Collision
Section 21
//b2ContactPoint (Box2D.Collision.b2ContactPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2ContactPoint {
public var friction:Number;
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 velocity:b2Vec2;
public function b2ContactPoint(){
position = new b2Vec2();
velocity = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 22
//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 _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local4:Number = (100 * Number.MIN_VALUE);
var _local5:int;
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 _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;
var _local8:Array = s_p1s;
var _local9:Array = s_p2s;
var _local10:Array = s_points;
var _local11:int;
_arg1.SetV(_arg3.GetFirstVertex(_arg4));
_arg2.SetV(_arg5.GetFirstVertex(_arg6));
var _local12:Number = 0;
var _local13 = 20;
var _local14:int;
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 _local19:Number;
var _local20:Number;
_local7 = _arg4.R;
_local8 = _arg3.m_localPosition;
var _local9:Number = (_arg4.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
var _local10:Number = (_arg4.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local7 = _arg6.R;
_local8 = _arg5.m_localPosition;
var _local11:Number = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
var _local12:Number = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
var _local13:Number = (_local11 - _local9);
var _local14:Number = (_local12 - _local10);
var _local15:Number = ((_local13 * _local13) + (_local14 * _local14));
var _local16:Number = (_arg3.m_radius - b2Settings.b2_toiSlop);
var _local17:Number = (_arg5.m_radius - b2Settings.b2_toiSlop);
var _local18:Number = (_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 _local35: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];
var _local14:b2Vec2 = _arg4[2];
var _local15:Number = _local6.x;
var _local16:Number = _local6.y;
var _local17:Number = _local7.x;
var _local18:Number = _local7.y;
var _local19:Number = _local8.x;
var _local20:Number = _local8.y;
var _local21:Number = (_local17 - _local15);
var _local22:Number = (_local18 - _local16);
var _local23:Number = (_local19 - _local15);
var _local24:Number = (_local20 - _local16);
var _local25:Number = (_local19 - _local17);
var _local26:Number = (_local20 - _local18);
var _local27:Number = -(((_local15 * _local21) + (_local16 * _local22)));
var _local28:Number = ((_local17 * _local21) + (_local18 * _local22));
var _local29:Number = -(((_local15 * _local23) + (_local16 * _local24)));
var _local30:Number = ((_local19 * _local23) + (_local20 * _local24));
var _local31:Number = -(((_local17 * _local25) + (_local18 * _local26)));
var _local32:Number = ((_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);
};
var _local33:Number = ((_local21 * _local24) - (_local22 * _local23));
var _local34:Number = (_local33 * ((_local15 * _local18) - (_local16 * _local17)));
var _local36:Number = (_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);
};
var _local37:Number = (_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);
};
var _local38:Number = ((_local36 + _local37) + _local34);
_local38 = (1 / _local38);
var _local39:Number = (_local36 * _local38);
var _local40:Number = (_local37 * _local38);
var _local41:Number = ((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 _local12:Number;
var _local13:Number;
var _local14:Number;
var _local9:b2Point = 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)));
var _local10:Number = DistanceGeneric(_arg1, _arg2, _arg3, _arg4, _local9, b2Math.b2XForm_identity);
var _local11:Number = (_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 = _arg3.m_type;
var _local8:int = _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 _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local17:Number;
var _local6:b2Vec2 = _arg5[0];
var _local7:b2Vec2 = _arg5[1];
var _local8:b2Vec2 = _arg3[0];
_local9 = _arg3[1];
_local10 = _arg4[0];
_local11 = _arg4[1];
var _local12:Number = -(_local7.x);
var _local13:Number = -(_local7.y);
var _local14:Number = (_local6.x - _local7.x);
var _local15:Number = (_local6.y - _local7.y);
var _local16:Number = 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 23
//b2Manifold (Box2D.Collision.b2Manifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Manifold {
public var pointCount:int;// = 0
public var normal:b2Vec2;
public var points:Array;
public function b2Manifold(){
points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ManifoldPoint();
_local1++;
};
normal = new b2Vec2();
}
public function Set(_arg1:b2Manifold):void{
pointCount = _arg1.pointCount;
var _local2:int;
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;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
(points[_local1] as b2ManifoldPoint).Reset();
_local1++;
};
normal.SetZero();
pointCount = 0;
}
}
}//package Box2D.Collision
Section 24
//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 25
//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 26
//b2Pair (Box2D.Collision.b2Pair)
package Box2D.Collision {
import Box2D.Common.*;
public class b2Pair {
public var proxyId1:uint;
public var userData;// = null
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 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 27
//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 28
//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_hashTable:Array;
public var m_callback:b2PairCallback;
public var m_pairs:Array;
public var m_pairBufferCount:int;
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 = 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 _local4:uint;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
var _local3:uint = (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 _local5:b2Pair;
var _local6:b2Proxy;
var _local7:b2Proxy;
var _local3:int;
var _local4:Array = 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 = 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 _local7:uint;
var _local8:uint;
var _local9:*;
if (_arg1 > _arg2){
_local7 = _arg1;
_arg1 = _arg2;
_arg2 = _local7;
};
var _local4:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
var _local5:uint = m_hashTable[_local4];
var _local6:b2Pair;
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 = 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 _local6:uint;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
var _local3:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
var _local4 = FindHash(_arg1, _arg2, _local3);
if (_local4 != null){
return (_local4);
};
var _local5:uint = 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 = (((_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 29
//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 30
//b2Proxy (Box2D.Collision.b2Proxy)
package Box2D.Collision {
public class b2Proxy {
public var overlapCount:uint;
public var userData;// = null
public var lowerBounds:Array;
public var upperBounds:Array;
public var timeStamp:uint;
public function b2Proxy(){
lowerBounds = [uint(0), uint(0)];
upperBounds = [uint(0), uint(0)];
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 31
//b2Segment (Box2D.Collision.b2Segment)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
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 _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local5:b2Vec2 = _arg3.p1;
var _local6:Number = (_arg3.p2.x - _local5.x);
var _local7:Number = (_arg3.p2.y - _local5.y);
var _local8:Number = (p2.x - p1.x);
var _local9:Number = (p2.y - p1.y);
var _local10:Number = _local9;
var _local11:Number = -(_local8);
var _local12:Number = (100 * Number.MIN_VALUE);
var _local13:Number = -(((_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);
}
}
}//package Box2D.Collision
Section 32
//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 _local25:Number;
var _local26:b2XForm;
var _local27:b2XForm;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local7:Number = _arg1.m_sweepRadius;
var _local8:Number = _arg3.m_sweepRadius;
var _local9:Number = _arg2.t0;
var _local10:Number = (_arg2.c.x - _arg2.c0.x);
var _local11:Number = (_arg2.c.y - _arg2.c0.y);
var _local12:Number = (_arg4.c.x - _arg4.c0.x);
var _local13:Number = (_arg4.c.y - _arg4.c0.y);
var _local14:Number = (_arg2.a - _arg2.a0);
var _local15:Number = (_arg4.a - _arg4.a0);
var _local16:Number = 0;
var _local17:b2Vec2 = s_p1;
var _local18:b2Vec2 = s_p2;
var _local19 = 20;
var _local20:int;
var _local21:Number = 0;
var _local22:Number = 0;
var _local23:Number = 0;
var _local24:Number = 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 33
//ClipVertex (Box2D.Collision.ClipVertex)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class ClipVertex {
public var id:b2ContactID;
public var v:b2Vec2;
public function ClipVertex(){
v = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 34
//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 get incidentVertex():int{
return (_incidentVertex);
}
public function set flip(_arg1:int):void{
_flip = _arg1;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function set incidentEdge(_arg1:int):void{
_incidentEdge = _arg1;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 35
//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 SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
}
public function Set(_arg1:Number):void{
var _local2:Number;
_local2 = Math.cos(_arg1);
var _local3:Number = Math.sin(_arg1);
col1.x = _local2;
col2.x = -(_local3);
col1.y = _local3;
col2.y = _local2;
}
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 _local4:Number;
var _local6:Number;
_local2 = col1.x;
var _local3:Number = col2.x;
_local4 = col1.y;
var _local5:Number = 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 = col1.x;
var _local5:Number = col2.x;
var _local6:Number = col1.y;
var _local7:Number = col2.y;
var _local8:Number = ((_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 36
//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 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x));
return (_local3);
}
public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = 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 = 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 = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
return (((_local3 * _local3) + (_local4 * _local4)));
}
public static function b2Swap(_arg1:Array, _arg2:Array):void{
var _local3:* = _arg1[0];
_arg1[0] = _arg2[0];
_arg2[0] = _local3;
}
public static function b2AbsM(_arg1:b2Mat22):b2Mat22{
var _local2:b2Mat22 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2));
return (_local2);
}
public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = 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 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y));
return (_local2);
}
public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = 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 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x));
return (_local3);
}
public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22 = 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 = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Vec2 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1));
var _local4:b2Vec2 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2));
var _local5:b2Mat22 = new b2Mat22(0, _local3, _local4);
return (_local5);
}
public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2IsPowerOfTwo(_arg1:uint):Boolean{
var _local2:Boolean = (((_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 = Math.random();
_local3 = (((_arg2 - _arg1) * _local3) + _arg1);
return (_local3);
}
public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = 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 = 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 = 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 37
//b2Sweep (Box2D.Common.Math.b2Sweep)
package Box2D.Common.Math {
public class b2Sweep {
public var localCenter:b2Vec2;
public var a:Number;
public var c:b2Vec2;
public var a0:Number;
public var c0:b2Vec2;
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 _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);
};
var _local3:b2Mat22 = _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 38
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
public class b2Vec2 {
public var y:Number;
public var x:Number;
public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Add(_arg1:b2Vec2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
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 MulM(_arg1:b2Mat22):void{
var _local2:Number = x;
x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y));
y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y));
}
public function SetZero():void{
x = 0;
y = 0;
}
public function MinV(_arg1:b2Vec2):void{
x = ((x < _arg1.x)) ? x : _arg1.x;
y = ((y < _arg1.y)) ? y : _arg1.y;
}
public function Normalize():Number{
var _local1:Number = Math.sqrt(((x * x) + (y * y)));
if (_local1 < Number.MIN_VALUE){
return (0);
};
var _local2:Number = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
return (_local1);
}
public function CrossVF(_arg1:Number):void{
var _local2:Number = x;
x = (_arg1 * y);
y = (-(_arg1) * _local2);
}
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 CrossFV(_arg1:Number):void{
var _local2:Number = x;
x = (-(_arg1) * y);
y = (_arg1 * _local2);
}
public function Abs():void{
if (x < 0){
x = -(x);
};
if (y < 0){
y = -(y);
};
}
public function Subtract(_arg1:b2Vec2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function MulTM(_arg1:b2Mat22):void{
var _local2:Number = 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 static function Make(_arg1:Number, _arg2:Number):b2Vec2{
return (new b2Vec2(_arg1, _arg2));
}
}
}//package Box2D.Common.Math
Section 39
//b2XForm (Box2D.Common.Math.b2XForm)
package Box2D.Common.Math {
public class b2XForm {
public var position:b2Vec2;
public var R:b2Mat22;
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 40
//b2Color (Box2D.Common.b2Color)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Color {
private var _r:uint;// = 0
private var _g:uint;// = 0
private var _b:uint;// = 0
public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){
_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 set b(_arg1:Number):void{
_b = uint((0xFF * b2Math.b2Clamp(_arg1, 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 g(_arg1:Number):void{
_g = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
}
}//package Box2D.Common
Section 41
//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 = 0x0200;
public static const b2_maxAngularVelocitySquared:Number = 62500;
public static const b2_maxPolygonVertices:int = 8;
public static const b2_velocityThreshold:Number = 1;
public static const b2_contactBaumgarte:Number = 0.2;
public static const b2_maxPairs:int = 4096;
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 42
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2CircleContact extends b2Contact {
private var m_manifolds:Array;
public var m_manifold:b2Manifold;
private var m0:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
var _local3:b2ManifoldPoint = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local8:b2ManifoldPoint;
var _local5:b2Body = m_shape1.m_body;
var _local6:b2Body = 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);
var _local7:b2ContactPoint = 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);
};
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
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 43
//b2Contact (Box2D.Dynamics.Contacts.b2Contact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
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 IsSolid():Boolean{
return (((m_flags & e_nonSolidFlag) == 0));
}
public function GetShape1():b2Shape{
return (m_shape1);
}
public function GetShape2():b2Shape{
return (m_shape2);
}
public function GetNext():b2Contact{
return (m_next);
}
public function GetManifoldCount():int{
return (m_manifoldCount);
}
public function GetManifolds():Array{
return (null);
}
public function Update(_arg1:b2ContactListener):void{
var _local2:int = m_manifoldCount;
Evaluate(_arg1);
var _local3:int = m_manifoldCount;
var _local4:b2Body = m_shape1.m_body;
var _local5:b2Body = 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 _local2:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
var _local1:int;
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{
if (_arg1.m_manifoldCount > 0){
_arg1.m_shape1.m_body.WakeUp();
_arg1.m_shape2.m_body.WakeUp();
};
var _local3:int = _arg1.m_shape1.m_type;
var _local4:int = _arg1.m_shape2.m_type;
var _local5:b2ContactRegister = s_registers[_local3][_local4];
var _local6:Function = _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 _local8:b2Contact;
var _local9:int;
var _local10:b2Manifold;
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
var _local4:int = _arg1.m_type;
var _local5:int = _arg2.m_type;
var _local6:b2ContactRegister = s_registers[_local4][_local5];
var _local7:Function = _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 44
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var points:Array;
public var normal:b2Vec2;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 45
//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 tangentMass:Number;
public var equalizedMass: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 46
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var other:b2Body;
public var prev:b2ContactEdge;
public var contact:b2Contact;
public var next:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 47
//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 48
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2ContactResult {
public var position:b2Vec2;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var normalImpulse:Number;
public var normal:b2Vec2;
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 49
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
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 _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++;
};
var _local9:int;
_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 _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;
var _local5:int;
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 _local3:b2Mat22;
var _local4:b2Vec2;
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;
var _local2:Number = 0;
var _local5:int;
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 _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;
var _local19:int;
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 _local2:b2ContactConstraint;
var _local3:b2Manifold;
var _local4:int;
var _local5:b2ManifoldPoint;
var _local6:b2ContactConstraintPoint;
var _local1:int;
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 50
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2NullContact extends b2Contact {
override public function Evaluate(_arg1:b2ContactListener):void{
}
override public function GetManifolds():Array{
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 51
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2PolyAndCircleContact extends b2Contact {
private var m_manifolds:Array;
public var m_manifold:b2Manifold;
private var m0:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){
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;
var _local3:b2ManifoldPoint = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2ManifoldPoint;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
var _local6:b2Body = m_shape1.m_body;
var _local7:b2Body = 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);
var _local8:Array = [false, false];
var _local9:b2ContactPoint = 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++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
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 52
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
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 Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local7:b2ContactPoint;
var _local8:int;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
var _local5:b2Body = m_shape1.m_body;
var _local6:b2Body = 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);
var _local9:Array = [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++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
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 53
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2DistanceJoint extends b2Joint {
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_bias:Number;
public var m_gamma:Number;
public var m_u:b2Vec2;
public var m_mass:Number;
public var m_impulse:Number;
public var m_dampingRatio:Number;
public var m_frequencyHz: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 InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local8: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);
var _local7:Number = (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);
var _local9:Number = (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);
var _local10:Number = 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();
};
var _local11:Number = ((_local6 * m_u.y) - (_local7 * m_u.x));
var _local12:Number = ((_local8 * m_u.y) - (_local9 * m_u.x));
var _local13:Number = (((_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 GetReactionForce():b2Vec2{
var _local1:b2Vec2 = new b2Vec2();
_local1.SetV(m_u);
_local1.Multiply((m_inv_dt * m_impulse));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Mat22;
if (m_frequencyHz > 0){
return (true);
};
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local1 = _local2.m_xf.R;
var _local4:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local5:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
var _local6:Number = ((_local1.col1.x * _local4) + (_local1.col2.x * _local5));
_local5 = ((_local1.col1.y * _local4) + (_local1.col2.y * _local5));
_local4 = _local6;
_local1 = _local3.m_xf.R;
var _local7:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local8:Number = (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;
var _local9:Number = (((_local3.m_sweep.c.x + _local7) - _local2.m_sweep.c.x) - _local4);
var _local10:Number = (((_local3.m_sweep.c.y + _local8) - _local2.m_sweep.c.y) - _local5);
var _local11:Number = Math.sqrt(((_local9 * _local9) + (_local10 * _local10)));
_local9 = (_local9 / _local11);
_local10 = (_local10 / _local11);
var _local12:Number = (_local11 - m_length);
_local12 = b2Math.b2Clamp(_local12, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
var _local13:Number = (-(m_mass) * _local12);
m_u.Set(_local9, _local10);
var _local14:Number = (_local13 * m_u.x);
var _local15:Number = (_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 SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:b2Body = m_body1;
var _local4:b2Body = m_body2;
_local2 = _local3.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
var _local7:Number = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6));
_local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6));
_local5 = _local7;
_local2 = _local4.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
var _local9:Number = (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;
var _local10:Number = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local6));
var _local11:Number = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local5));
var _local12:Number = (_local4.m_linearVelocity.x + (-(_local4.m_angularVelocity) * _local9));
var _local13:Number = (_local4.m_linearVelocity.y + (_local4.m_angularVelocity * _local8));
var _local14:Number = ((m_u.x * (_local12 - _local10)) + (m_u.y * (_local13 - _local11)));
var _local15:Number = (-(m_mass) * ((_local14 + m_bias) + (m_gamma * m_impulse)));
m_impulse = (m_impulse + _local15);
var _local16:Number = (_local15 * m_u.x);
var _local17:Number = (_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 54
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2DistanceJointDef extends b2JointDef {
public var localAnchor1:b2Vec2;
public var length:Number;
public var dampingRatio:Number;
public var localAnchor2:b2Vec2;
public var frequencyHz:Number;
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{
body1 = _arg1;
body2 = _arg2;
localAnchor1.SetV(body1.GetLocalPoint(_arg3));
localAnchor2.SetV(body2.GetLocalPoint(_arg4));
var _local5:Number = (_arg4.x - _arg3.x);
var _local6:Number = (_arg4.y - _arg3.y);
length = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
frequencyHz = 0;
dampingRatio = 0;
}
}
}//package Box2D.Dynamics.Joints
Section 55
//b2GearJoint (Box2D.Dynamics.Joints.b2GearJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2GearJoint extends b2Joint {
public var m_ground2:b2Body;
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_revolute2:b2RevoluteJoint;
public var m_force:Number;
public var m_mass:Number;
public var m_prismatic2:b2PrismaticJoint;
public var m_ground1:b2Body;
public var m_revolute1:b2RevoluteJoint;
public var m_prismatic1:b2PrismaticJoint;
public var m_constant:Number;
public var m_J:b2Jacobian;
public function b2GearJoint(_arg1:b2GearJointDef){
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);
var _local2:int = _arg1.joint1.m_type;
var _local3:int = _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 InitVelocityConstraints(_arg1:b2TimeStep):void{
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 _local15:Number;
var _local2:b2Body = m_ground1;
var _local3:b2Body = m_ground2;
var _local4:b2Body = m_body1;
var _local5:b2Body = m_body2;
var _local14:Number = 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 = m_body2.m_xf.R;
var _local2:Number = (m_localAnchor1.x - m_body2.m_sweep.localCenter.x);
var _local3:Number = (m_localAnchor1.y - m_body2.m_sweep.localCenter.y);
var _local4:Number = ((_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);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local4:Number;
var _local5:Number;
var _local1:Number = 0;
var _local2:b2Body = m_body1;
var _local3:b2Body = 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();
};
var _local6:Number = (m_constant - (_local4 + (m_ratio * _local5)));
var _local7:Number = (-(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));
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
var _local4:Number = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
var _local5:Number = ((-(_arg1.inv_dt) * m_mass) * _local4);
m_force = (m_force + _local5);
var _local6:Number = (_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 56
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef)
package Box2D.Dynamics.Joints {
public class b2GearJointDef extends b2JointDef {
public var joint1:b2Joint;
public var joint2:b2Joint;
public var ratio:Number;
public function b2GearJointDef(){
type = b2Joint.e_gearJoint;
joint1 = null;
joint2 = null;
ratio = 1;
}
}
}//package Box2D.Dynamics.Joints
Section 57
//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 angular1:Number;
public var angular2: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 58
//b2Joint (Box2D.Dynamics.Joints.b2Joint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
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 GetBody2():b2Body{
return (m_body2);
}
public function GetAnchor1():b2Vec2{
return (null);
}
public function GetAnchor2():b2Vec2{
return (null);
}
public function GetNext():b2Joint{
return (m_next);
}
public function GetType():int{
return (m_type);
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
}
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;
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 59
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointDef {
public var body2:b2Body;
public var type:int;
public var userData;
public var collideConnected:Boolean;
public var body1:b2Body;
public function b2JointDef(){
type = b2Joint.e_unknownJoint;
userData = null;
body1 = null;
body2 = null;
collideConnected = false;
}
}
}//package Box2D.Dynamics.Joints
Section 60
//b2JointEdge (Box2D.Dynamics.Joints.b2JointEdge)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointEdge {
public var other:b2Body;
public var next:b2JointEdge;
public var prev:b2JointEdge;
public var joint:b2Joint;
}
}//package Box2D.Dynamics.Joints
Section 61
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2MouseJoint extends b2Joint {
private var K1:b2Mat22;
private var K:b2Mat22;
public var m_beta:Number;
public var m_mass:b2Mat22;
private var K2:b2Mat22;
public var m_target:b2Vec2;
public var m_gamma:Number;
public var m_impulse:b2Vec2;
public var m_C:b2Vec2;
public var m_localAnchor:b2Vec2;
public var m_maxForce:Number;
public function b2MouseJoint(_arg1:b2MouseJointDef){
var _local3: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);
var _local2:Number = (m_target.x - m_body2.m_xf.position.x);
_local3 = (m_target.y - m_body2.m_xf.position.y);
var _local4:b2Mat22 = 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();
var _local5:Number = m_body2.m_mass;
var _local6:Number = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz);
var _local7:Number = (((2 * _local5) * _arg1.dampingRatio) * _local6);
var _local8:Number = ((_arg1.timeStep * _local5) * (_local6 * _local6));
m_gamma = (1 / (_local7 + _local8));
m_beta = (_local8 / (_local7 + _local8));
}
public function SetTarget(_arg1:b2Vec2):void{
if (m_body2.IsSleeping()){
m_body2.WakeUp();
};
m_target = _arg1;
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local7:Number;
var _local8: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);
var _local6:Number = ((_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);
var _local9:Number = (_arg1.dt * m_impulse.x);
var _local10:Number = (_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 GetAnchor1():b2Vec2{
return (m_target);
}
override public function GetReactionTorque():Number{
return (0);
}
override public function GetReactionForce():b2Vec2{
return (m_impulse);
}
override public function SolvePositionConstraints():Boolean{
return (true);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local2:b2Body = m_body2;
_local3 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
var _local7:Number = (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;
var _local8:Number = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local7));
var _local9:Number = (_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));
var _local10:Number = (-(_arg1.inv_dt) * ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)));
var _local11:Number = (-(_arg1.inv_dt) * ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)));
var _local12:Number = m_impulse.x;
var _local13:Number = m_impulse.y;
m_impulse.x = (m_impulse.x + _local10);
m_impulse.y = (m_impulse.y + _local11);
var _local14:Number = m_impulse.Length();
if (_local14 > m_maxForce){
m_impulse.Multiply((m_maxForce / _local14));
};
_local10 = (m_impulse.x - _local12);
_local11 = (m_impulse.y - _local13);
var _local15:Number = (_arg1.dt * _local10);
var _local16:Number = (_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 62
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2MouseJointDef extends b2JointDef {
public var timeStep:Number;
public var target:b2Vec2;
public var maxForce:Number;
public var dampingRatio:Number;
public var frequencyHz: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 63
//b2PrismaticJoint (Box2D.Dynamics.Joints.b2PrismaticJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PrismaticJoint extends b2Joint {
public var m_limitForce:Number;
public var m_lowerTranslation:Number;
public var m_localXAxis1:b2Vec2;
public var m_refAngle:Number;
public var m_torque:Number;
public var m_motorForce:Number;
public var m_enableLimit:Boolean;
public var m_angularMass:Number;
public var m_maxMotorForce:Number;
public var m_localYAxis1:b2Vec2;
public var m_force:Number;
public var m_motorMass:Number;
public var m_upperTranslation:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_limitState:int;
public var m_linearMass:Number;
public var m_motorJacobian:b2Jacobian;
public var m_limitPositionImpulse:Number;
public var m_motorSpeed:Number;
public var m_enableMotor:Boolean;
public var m_linearJacobian:b2Jacobian;
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 SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local8:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
var _local4:Number = _local2.m_invMass;
var _local5:Number = _local3.m_invMass;
var _local6:Number = _local2.m_invI;
var _local7:Number = _local3.m_invI;
var _local9:Number = m_linearJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
var _local10:Number = ((-(_arg1.inv_dt) * m_linearMass) * _local9);
m_force = (m_force + _local10);
var _local11:Number = (_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));
var _local12:Number = (_local3.m_angularVelocity - _local2.m_angularVelocity);
var _local13:Number = ((-(_arg1.inv_dt) * m_angularMass) * _local12);
m_torque = (m_torque + _local13);
var _local14:Number = (_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));
};
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function GetUpperLimit():Number{
return (m_upperTranslation);
}
public function GetLowerLimit():Number{
return (m_lowerTranslation);
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetJointTranslation():Number{
var _local3:b2Mat22;
var _local1:b2Body = m_body1;
var _local2:b2Body = m_body2;
var _local4:b2Vec2 = _local1.GetWorldPoint(m_localAnchor1);
var _local5:b2Vec2 = _local2.GetWorldPoint(m_localAnchor2);
var _local6:Number = (_local5.x - _local4.x);
var _local7:Number = (_local5.y - _local4.y);
var _local8:b2Vec2 = _local1.GetWorldVector(m_localXAxis1);
var _local9:Number = ((_local8.x * _local6) + (_local8.y * _local7));
return (_local9);
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Mat22 = m_body1.m_xf.R;
var _local2:Number = (m_limitForce * ((_local1.col1.x * m_localXAxis1.x) + (_local1.col2.x * m_localXAxis1.y)));
var _local3:Number = (m_limitForce * ((_local1.col1.y * m_localXAxis1.x) + (_local1.col2.y * m_localXAxis1.y)));
var _local4:Number = (m_force * ((_local1.col1.x * m_localYAxis1.x) + (_local1.col2.x * m_localYAxis1.y)));
var _local5:Number = (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 _local9:b2Mat22;
var _local10:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local3:b2Body = m_body1;
var _local4:b2Body = m_body2;
var _local5:Number = _local3.m_invMass;
var _local6:Number = _local4.m_invMass;
var _local7:Number = _local3.m_invI;
var _local8:Number = _local4.m_invI;
_local9 = _local3.m_xf.R;
var _local11:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
var _local12:Number = (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;
var _local13:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
var _local14:Number = (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;
var _local15:Number = (_local3.m_sweep.c.x + _local11);
var _local16:Number = (_local3.m_sweep.c.y + _local12);
var _local17:Number = (_local4.m_sweep.c.x + _local13);
var _local18:Number = (_local4.m_sweep.c.y + _local14);
var _local19:Number = (_local17 - _local15);
var _local20:Number = (_local18 - _local16);
_local9 = _local3.m_xf.R;
var _local21:Number = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y));
var _local22:Number = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y));
var _local23:Number = ((_local21 * _local19) + (_local22 * _local20));
_local23 = b2Math.b2Clamp(_local23, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
var _local24:Number = (-(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));
var _local25:Number = b2Math.b2Abs(_local23);
var _local26:Number = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_refAngle);
_local26 = b2Math.b2Clamp(_local26, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
var _local27:Number = (-(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();
var _local28:Number = 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 SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function GetJointSpeed():Number{
var _local3:b2Mat22;
var _local1:b2Body = m_body1;
var _local2:b2Body = m_body2;
_local3 = _local1.m_xf.R;
var _local4:Number = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
var _local5:Number = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
var _local6:Number = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local3 = _local2.m_xf.R;
var _local7:Number = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
var _local8:Number = (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;
var _local9:Number = (_local1.m_sweep.c.x + _local4);
var _local10:Number = (_local1.m_sweep.c.y + _local5);
var _local11:Number = (_local2.m_sweep.c.x + _local7);
var _local12:Number = (_local2.m_sweep.c.y + _local8);
var _local13:Number = (_local11 - _local9);
var _local14:Number = (_local12 - _local10);
var _local15:b2Vec2 = _local1.GetWorldVector(m_localXAxis1);
var _local16:b2Vec2 = _local1.m_linearVelocity;
var _local17:b2Vec2 = _local2.m_linearVelocity;
var _local18:Number = _local1.m_angularVelocity;
var _local19:Number = _local2.m_angularVelocity;
var _local20:Number = (((_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);
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local5: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 _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local7:Number = (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;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (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;
var _local10:Number = _local2.m_invMass;
var _local11:Number = _local3.m_invMass;
var _local12:Number = _local2.m_invI;
var _local13:Number = _local3.m_invI;
_local4 = _local2.m_xf.R;
var _local14:Number = ((_local4.col1.x * m_localYAxis1.x) + (_local4.col2.x * m_localYAxis1.y));
var _local15:Number = ((_local4.col1.y * m_localYAxis1.x) + (_local4.col2.y * m_localYAxis1.y));
var _local16:Number = ((_local3.m_sweep.c.x + _local8) - _local2.m_sweep.c.x);
var _local17:Number = ((_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 EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
public function SetMaxMotorForce(_arg1:Number):void{
m_maxMotorForce = _arg1;
}
override public function GetReactionTorque():Number{
return (m_torque);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerTranslation = _arg1;
m_upperTranslation = _arg2;
}
}
}//package Box2D.Dynamics.Joints
Section 64
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PrismaticJointDef extends b2JointDef {
public var motorSpeed:Number;
public var localAxis1:b2Vec2;
public var referenceAngle:Number;
public var upperTranslation:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public var maxMotorForce:Number;
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 65
//b2PulleyJoint (Box2D.Dynamics.Joints.b2PulleyJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PulleyJoint extends b2Joint {
public var m_limitState1:int;
public var m_limitState2:int;
public var m_ground:b2Body;
public var m_maxLength2:Number;
public var m_maxLength1:Number;
public var m_limitPositionImpulse1:Number;
public var m_limitPositionImpulse2:Number;
public var m_force:Number;
public var m_constant:Number;
public var m_positionImpulse: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_limitMass1:Number;
public var m_limitMass2:Number;
public var m_pulleyMass:Number;
public var m_u1:b2Vec2;
public var m_limitForce1:Number;
public var m_limitForce2:Number;
public var m_u2:b2Vec2;
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 = 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 = m_u2.Copy();
_local1.Multiply(m_force);
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local3:b2Mat22;
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 _local1:b2Body = m_body1;
var _local2:b2Body = m_body2;
var _local4:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local5:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local6:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local7:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
var _local23:Number = 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 _local4:b2Mat22;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (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;
var _local10:Number = (_local2.m_sweep.c.x + _local5);
var _local11:Number = (_local2.m_sweep.c.y + _local6);
var _local12:Number = (_local3.m_sweep.c.x + _local8);
var _local13:Number = (_local3.m_sweep.c.y + _local9);
var _local14:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local15:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local16:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local17:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
m_u1.Set((_local10 - _local14), (_local11 - _local15));
m_u2.Set((_local12 - _local16), (_local13 - _local17));
var _local18:Number = m_u1.Length();
var _local19:Number = 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();
};
var _local20:Number = ((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;
};
var _local21:Number = ((_local5 * m_u1.y) - (_local6 * m_u1.x));
var _local22:Number = ((_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);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local4: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 _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (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 = m_body1.GetWorldPoint(m_localAnchor1);
var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local4:Number = (_local1.x - _local2);
var _local5:Number = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
public function GetLength2():Number{
var _local1:b2Vec2 = m_body2.GetWorldPoint(m_localAnchor2);
var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
var _local4:Number = (_local1.x - _local2);
var _local5:Number = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
public function GetGroundAnchor1():b2Vec2{
var _local1:b2Vec2 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor1);
return (_local1);
}
}
}//package Box2D.Dynamics.Joints
Section 66
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PulleyJointDef extends b2JointDef {
public var maxLength1:Number;
public var maxLength2:Number;
public var length1:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var groundAnchor1:b2Vec2;
public var groundAnchor2:b2Vec2;
public var ratio:Number;
public var length2:Number;
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{
body1 = _arg1;
body2 = _arg2;
groundAnchor1.SetV(_arg3);
groundAnchor2.SetV(_arg4);
localAnchor1 = body1.GetLocalPoint(_arg5);
localAnchor2 = body2.GetLocalPoint(_arg6);
var _local8:Number = (_arg5.x - _arg3.x);
var _local9:Number = (_arg5.y - _arg3.y);
length1 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
var _local10:Number = (_arg6.x - _arg4.x);
var _local11:Number = (_arg6.y - _arg4.y);
length2 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
ratio = _arg7;
var _local12:Number = (length1 + (ratio * length2));
maxLength1 = (_local12 - (ratio * b2PulleyJoint.b2_minPulleyLength));
maxLength2 = ((_local12 - b2PulleyJoint.b2_minPulleyLength) / ratio);
}
}
}//package Box2D.Dynamics.Joints
Section 67
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2RevoluteJoint extends b2Joint {
public var m_limitForce:Number;
public var m_pivotMass:b2Mat22;
public var m_motorForce:Number;
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_enableMotor:Boolean;
public var m_referenceAngle:Number;
public var m_limitPositionImpulse:Number;
public var m_motorSpeed:Number;
public var m_upperAngle:Number;
public var m_lowerAngle:Number;
public var m_maxMotorTorque: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 SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local5:Number;
var _local10:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local7:Number = (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;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (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;
var _local11:Number = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local7));
var _local12:Number = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local6));
var _local13:Number = (-(_arg1.inv_dt) * ((m_pivotMass.col1.x * _local11) + (m_pivotMass.col2.x * _local12)));
var _local14:Number = (-(_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);
var _local15:Number = (_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));
};
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function GetUpperLimit():Number{
return (m_upperAngle);
}
public function GetLowerLimit():Number{
return (m_lowerAngle);
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
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 _local6:b2Mat22;
var _local25:Number;
var _local26:Number;
var _local3:b2Body = m_body1;
var _local4:b2Body = m_body2;
var _local5:Number = 0;
_local6 = _local3.m_xf.R;
var _local7:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
var _local8:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
var _local9:Number = ((_local6.col1.x * _local7) + (_local6.col2.x * _local8));
_local8 = ((_local6.col1.y * _local7) + (_local6.col2.y * _local8));
_local7 = _local9;
_local6 = _local4.m_xf.R;
var _local10:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
var _local11:Number = (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;
var _local12:Number = (_local3.m_sweep.c.x + _local7);
var _local13:Number = (_local3.m_sweep.c.y + _local8);
var _local14:Number = (_local4.m_sweep.c.x + _local10);
var _local15:Number = (_local4.m_sweep.c.y + _local11);
var _local16:Number = (_local14 - _local12);
var _local17:Number = (_local15 - _local13);
_local5 = Math.sqrt(((_local16 * _local16) + (_local17 * _local17)));
var _local18:Number = _local3.m_invMass;
var _local19:Number = _local4.m_invMass;
var _local20:Number = _local3.m_invI;
var _local21:Number = _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));
var _local22:Number = tImpulse.x;
var _local23:Number = 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();
var _local24:Number = 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 SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function GetJointSpeed():Number{
return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity));
}
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));
}
public function GetMotorTorque():Number{
return (m_motorForce);
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local7:Number;
var _local14:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
var _local6:Number = (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;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (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;
var _local10:Number = _local2.m_invMass;
var _local11:Number = _local3.m_invMass;
var _local12:Number = _local2.m_invI;
var _local13:Number = _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;
}
override public function GetReactionTorque():Number{
return (m_limitForce);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerAngle = _arg1;
m_upperAngle = _arg2;
}
}
}//package Box2D.Dynamics.Joints
Section 68
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2RevoluteJointDef extends b2JointDef {
public var upperAngle:Number;
public var enableMotor:Boolean;
public var referenceAngle:Number;
public var motorSpeed:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var lowerAngle:Number;
public var maxMotorTorque:Number;
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 69
//b2Body (Box2D.Dynamics.b2Body)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
public class b2Body {
public var m_next:b2Body;
public var m_xf:b2XForm;
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_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_shapeCount:int;
public var m_angularDamping:Number;
public var m_invI:Number;
public var m_linearVelocity:b2Vec2;
public var m_sleepTime:Number;
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){
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);
var _local3:b2Mat22 = m_xf.R;
var _local4:b2Vec2 = 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{
m_xf.R.Set(m_sweep.a);
var _local1:b2Mat22 = m_xf.R;
var _local2:b2Vec2 = 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;
if (m_world.m_lock == true){
return;
};
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:b2MassData = 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);
var _local5:b2Mat22 = m_xf.R;
var _local6:b2Vec2 = 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;
};
var _local7:int = 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 _local7:Boolean;
if (m_world.m_lock == true){
return (true);
};
if (IsFrozen()){
return (false);
};
m_xf.R.Set(_arg2);
m_xf.position.SetV(_arg1);
var _local4:b2Mat22 = m_xf.R;
var _local5:b2Vec2 = 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);
var _local6:Boolean;
_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 _local4:b2Shape;
var _local1:b2XForm = s_xf1;
_local1.R.Set(m_sweep.a0);
var _local2:b2Mat22 = _local1.R;
var _local3:b2Vec2 = 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)));
var _local5:Boolean;
_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 GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22 = m_xf.R;
var _local3:b2Vec2 = 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 GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
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 GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function SetAngularVelocity(_arg1:Number):void{
m_angularVelocity = _arg1;
}
public function SetMass(_arg1:b2MassData):void{
var _local2:b2Shape;
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);
var _local3:b2Mat22 = m_xf.R;
var _local4:b2Vec2 = 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;
};
var _local5:int = 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 = 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{
if (m_world.m_lock == true){
return;
};
_arg1.DestroyProxy(m_world.m_broadPhase);
var _local2:b2Shape = m_shapeList;
var _local3:b2Shape;
var _local4:Boolean;
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 = m_xf.R;
var _local3:b2Vec2 = 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 70
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2BodyDef {
public var angularDamping:Number;
public var angle:Number;
public var isSleeping:Boolean;
public var position:b2Vec2;
public var isBullet:Boolean;
public var allowSleep:Boolean;
public var userData;
public var fixedRotation:Boolean;
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 71
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener)
package Box2D.Dynamics {
public class b2BoundaryListener {
public function Violation(_arg1:b2Body):void{
}
}
}//package Box2D.Dynamics
Section 72
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
public class b2ContactFilter {
public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{
var _local3:b2FilterData = _arg1.GetFilterData();
var _local4:b2FilterData = _arg2.GetFilterData();
if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){
return ((_local3.groupIndex > 0));
};
var _local5:Boolean = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0))));
return (_local5);
}
}
}//package Box2D.Dynamics
Section 73
//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 74
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
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 PairRemoved(_arg1, _arg2, _arg3):void{
if (_arg3 == null){
return;
};
var _local4:b2Contact = (_arg3 as b2Contact);
if (_local4 == m_nullContact){
return;
};
Destroy(_local4);
}
public function Destroy(_arg1:b2Contact):void{
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;
var _local2:b2Shape = _arg1.m_shape1;
var _local3:b2Shape = _arg1.m_shape2;
var _local4:int = _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;
};
var _local5:b2Body = _local2.m_body;
var _local6:b2Body = _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--;
}
override public function PairAdded(_arg1, _arg2){
var _local3:b2Shape = (_arg1 as b2Shape);
var _local4:b2Shape = (_arg2 as b2Shape);
var _local5:b2Body = _local3.m_body;
var _local6:b2Body = _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);
};
var _local7:b2Contact = 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);
}
public function Collide():void{
var _local2:b2Body;
var _local3:b2Body;
var _local1:b2Contact = 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 75
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import flash.display.*;
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_drawFlags:uint;
public var m_lineThickness:Number;// = 1
public var m_drawScale:Number;// = 1
public var m_sprite:Sprite;
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_drawFlags = 0;
}
public function ClearFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags & ~(_arg1));
}
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 DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
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);
var _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 DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
var _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));
}
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 GetFlags():uint{
return (m_drawFlags);
}
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));
}
}
}//package Box2D.Dynamics
Section 76
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener)
package Box2D.Dynamics {
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
public class b2DestructionListener {
public function SayGoodbyeShape(_arg1:b2Shape):void{
}
public function SayGoodbyeJoint(_arg1:b2Joint):void{
}
}
}//package Box2D.Dynamics
Section 77
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2Island {
public var m_listener:b2ContactListener;
public var m_positionIterationCount:int;
public var m_bodyCapacity:int;
public var m_bodies:Array;
public var m_joints: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 _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;
};
var _local4:int;
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 AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{
var _local5:int;
var _local6:b2Body;
var _local7:b2Joint;
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++;
};
var _local8:b2ContactSolver = 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 Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:int;
var _local5:b2Body;
var _local6:Boolean;
var _local3:b2ContactSolver = 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++;
};
var _local4:Number = 0.75;
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local6 = _local3.SolvePositionConstraints(_local4);
if (_local6){
break;
};
_local2++;
};
Report(_local3.m_constraints);
}
}
}//package Box2D.Dynamics
Section 78
//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 79
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
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_allowSleep:Boolean;
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_positionIterationCount:int;
public var m_groundBody:b2Body;
public var m_contactCount:int;
public var m_debugDraw:b2DebugDraw;
public var m_contactFilter:b2ContactFilter;
public var m_bodyList:b2Body;
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){
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);
var _local4:b2BodyDef = new b2BodyDef();
m_groundBody = CreateBody(_local4);
}
public function DrawJoint(_arg1:b2Joint):void{
var _local11:b2PulleyJoint;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local2:b2Body = _arg1.m_body1;
var _local3:b2Body = _arg1.m_body2;
var _local4:b2XForm = _local2.m_xf;
var _local5:b2XForm = _local3.m_xf;
var _local6:b2Vec2 = _local4.position;
var _local7:b2Vec2 = _local5.position;
var _local8:b2Vec2 = _arg1.GetAnchor1();
var _local9:b2Vec2 = _arg1.GetAnchor2();
var _local10:b2Color = 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 _local2:int;
var _local3:b2Body;
var _local4:b2Shape;
var _local5:b2Joint;
var _local6:b2BroadPhase;
var _local11:b2XForm;
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();
var _local1:uint = m_debugDraw.GetFlags();
var _local7:b2Vec2 = new b2Vec2();
var _local8:b2Vec2 = new b2Vec2();
var _local9:b2Vec2 = new b2Vec2();
var _local10:b2Color = new b2Color(0, 0, 0);
var _local12:b2AABB = new b2AABB();
var _local13:b2AABB = new b2AABB();
var _local14:Array = [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 _local4:b2JointEdge;
var _local5:b2Shape;
if (m_lock == true){
return;
};
var _local2:b2JointEdge = _arg1.m_jointList;
while (_local2) {
_local4 = _local2;
_local2 = _local2.next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeJoint(_local4.joint);
};
DestroyJoint(_local4.joint);
};
var _local3:b2Shape = _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 SetContactFilter(_arg1:b2ContactFilter):void{
m_contactFilter = _arg1;
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{
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;
var _local5:b2Color = 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 GetContactCount():int{
return (m_contactCount);
}
public function Solve(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local9:int;
var _local10:int;
var _local11:b2Body;
var _local12:b2ContactEdge;
var _local13:b2JointEdge;
var _local14:Boolean;
m_positionIterationCount = 0;
var _local3:b2Island = 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;
};
var _local4:b2Contact = m_contactList;
while (_local4) {
_local4.m_flags = (_local4.m_flags & ~(b2Contact.e_islandFlag));
_local4 = _local4.m_next;
};
var _local5:b2Joint = m_jointList;
while (_local5) {
_local5.m_islandFlag = false;
_local5 = _local5.m_next;
};
var _local6:int = m_bodyCount;
var _local7:Array = new Array(_local6);
var _local8:b2Body = 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 = new Array(_arg3);
var _local5:int = m_broadPhase.QueryAABB(_arg1, _local4, _arg3);
var _local6:int;
while (_local6 < _local5) {
_arg2[_local6] = _local4[_local6];
_local6++;
};
return (_local5);
}
public function SetGravity(_arg1:b2Vec2):void{
m_gravity = _arg1;
}
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 _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;
var _local8:b2Island = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener);
var _local9:int = m_bodyCount;
var _local10:Array = 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 GetBodyList():b2Body{
return (m_bodyList);
}
public function GetPairCount():int{
return (m_broadPhase.m_pairManager.m_pairCount);
}
public function Validate():void{
m_broadPhase.Validate();
}
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 _local3:b2Body;
var _local4:b2Shape;
var _local2:b2Joint = 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 _local5:b2Body;
var _local6:b2Shape;
var _local2:Boolean = _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;
};
var _local3:b2Body = _arg1.m_body1;
var _local4:b2Body = _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 CreateBody(_arg1:b2BodyDef):b2Body{
if (m_lock == true){
return (null);
};
var _local2:b2Body = 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 SetBoundaryListener(_arg1:b2BoundaryListener):void{
m_boundaryListener = _arg1;
}
public function SetDestructionListener(_arg1:b2DestructionListener):void{
m_destructionListener = _arg1;
}
public function Step(_arg1:Number, _arg2:int):void{
m_lock = true;
var _local3:b2TimeStep = 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 80
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function concatObjects(... _args):Object{
var _local3:Object;
var _local5:String;
var _local2:Object = {};
var _local4:int;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function isInArray(_arg1:String, _arg2:Array):Boolean{
var _local3:uint = _arg2.length;
var _local4:uint;
while (_local4 < _local3) {
if (_arg2[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
public static function getObjectLength(_arg1:Object):uint{
var _local3:String;
var _local2:uint;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
}
}//package caurina.transitions
Section 81
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2));
};
_arg1 = (_arg1 - 2);
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
--_arg1;
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
}
}//package caurina.transitions
Section 82
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var valueComplete:Number;
public var modifierFunction:Function;
public var extra:Object;
public var valueStart:Number;
public var hasModifier:Boolean;
public var arrayIndex:Number;
public var originalValueComplete:Object;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){
valueStart = _arg1;
valueComplete = _arg2;
originalValueComplete = _arg3;
arrayIndex = _arg4;
extra = _arg5;
isSpecialProperty = _arg6;
hasModifier = Boolean(_arg7);
modifierFunction = _arg7;
modifierParameters = _arg8;
}
public function toString():String{
var _local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("extra:" + String(extra)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("hasModifier:" + String(hasModifier)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 83
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var preProcess:Function;
public var setValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("preProcess:" + String(preProcess)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 84
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 85
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 86
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
if (!_inited){
init();
};
var _local4:SpecialPropertyModifier = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
if (!_inited){
init();
};
var _local6:SpecialProperty = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
var _local5:Object = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local6:Number = (isNaN(_local5.time)) ? 0 : _local5.time;
var _local7:Number = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local5:uint;
var _local6:String;
var _local7:Boolean;
var _local3:TweenListObj = _tweenList[_arg1];
var _local4:TweenListObj = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
var _local3:Number = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.31.71");
}
public static function onEnterFrame(_arg1:Event):void{
updateTime();
updateFrame();
var _local2:Boolean;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
var isOver:Boolean;
var cTime:Number = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e:Error) {
handleError(tTweening, e, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e:Error) {
handleError(tTweening, e, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e:Error) {
handleError(tTweening, e, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
var _local7:Object = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local8:Number = (isNaN(_local7.time)) ? 0 : _local7.time;
var _local9:Number = (isNaN(_local7.delay)) ? 0 : _local7.delay;
var _local10:Array = new Array();
var _local11:Object = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
var _local12:Object = new Object();
for (_local5 in _local7) {
if (!_local11[_local5]){
if (_specialPropertySplitterList[_local5]){
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters);
_local3 = 0;
while (_local3 < _local17.length) {
if (_specialPropertySplitterList[_local17[_local3].name]){
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
_local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
_local4++;
};
} else {
_local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false};
};
_local3++;
};
} else {
if (_specialPropertyModifierList[_local5] != undefined){
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]);
_local3 = 0;
while (_local3 < _local19.length) {
_local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue};
_local3++;
};
} else {
_local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]};
};
};
};
};
for (_local5 in _local10) {
if (_specialPropertyList[_local5] != undefined){
_local10[_local5].isSpecialProperty = true;
} else {
if (_local6[0][_local5] == undefined){
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property."));
};
};
};
for (_local5 in _local12) {
if (_local10[_local5] != undefined){
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters;
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction;
};
};
if (typeof(_local7.transition) == "string"){
_local20 = _local7.transition.toLowerCase();
_local13 = _transitionList[_local20];
} else {
_local13 = _local7.transition;
};
if (!Boolean(_local13)){
_local13 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local6.length) {
_local14 = new Object();
for (_local5 in _local10) {
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters);
};
if (_local7.useFrames == true){
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams);
} else {
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams);
};
_local15.properties = _local14;
_local15.onStart = _local7.onStart;
_local15.onUpdate = _local7.onUpdate;
_local15.onComplete = _local7.onComplete;
_local15.onOverwrite = _local7.onOverwrite;
_local15.onError = _local7.onError;
_local15.onStartParams = _local7.onStartParams;
_local15.onUpdateParams = _local7.onUpdateParams;
_local15.onCompleteParams = _local7.onCompleteParams;
_local15.onOverwriteParams = _local7.onOverwriteParams;
_local15.onStartScope = _local7.onStartScope;
_local15.onUpdateScope = _local7.onUpdateScope;
_local15.onCompleteScope = _local7.onCompleteScope;
_local15.onOverwriteScope = _local7.onOverwriteScope;
_local15.onErrorScope = _local7.onErrorScope;
_local15.rounded = _local7.rounded;
_local15.skipUpdates = _local7.skipUpdates;
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local4:Boolean;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
if (!Boolean(_tweenList)){
return ([]);
};
var _local4:Array = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
if (!Boolean(_tweenList)){
return (0);
};
var _local3:Number = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removedLocally:Boolean;
var i:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
var removed:Boolean;
var tl:uint = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
if (!_inited){
init();
};
var _local4:SpecialPropertySplitter = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 87
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var hasStarted:Boolean;
public var onUpdate:Function;
public var useFrames:Boolean;
public var count:Number;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
transitionParams = _arg6;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local3:String;
var _local2:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local3:String;
var _local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
var _local2:Boolean;
for (_local3 in properties) {
if (!_local2){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local2:Object = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 88
//PhisicBase (Clases.BasicEngine.PhisicBase)
package Clases.BasicEngine {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import flash.display.*;
import Box2D.Dynamics.Contacts.*;
import Clases.*;
public class PhisicBase extends Sprite {
private var myListener:BContactListener;
public var m_world:b2World;
public var m_iterations:Number;// = 120
public var m_timestep:Number;// = 0.0166666666666667
public var m_phys_scale:Number;// = 20
public var m_dbgSprite;
public function PhisicBase(){
myListener = new BContactListener();
var _local1:b2Vec2 = new b2Vec2(0, 30);
var _local2:b2AABB = new b2AABB();
_local2.lowerBound.Set(-1000, -1000);
_local2.upperBound.Set(1000, 1000);
m_world = new b2World(_local2, _local1, true);
m_world.SetContactListener(myListener);
}
public function desrtoyLevel(){
var _local2:b2Body;
var _local1:b2Body = m_world.GetBodyList();
while (_local1) {
_local2 = _local1;
_local1 = _local1.GetNext();
m_world.DestroyBody(_local2);
_local2 = null;
};
}
private function SetDebugDraw(){
var _local1:b2DebugDraw;
_local1 = new b2DebugDraw();
_local1.m_sprite = m_dbgSprite;
_local1.m_drawScale = m_phys_scale;
_local1.m_fillAlpha = 0.8;
_local1.m_lineThickness = 2;
_local1.m_drawFlags = (1 | 2);
m_world.SetDebugDraw(_local1);
}
public function updateLevel(){
m_world.Step(m_timestep, m_iterations);
var _local1:b2Body = m_world.m_bodyList;
while (_local1) {
if ((_local1.m_userData is Sprite)){
_local1.m_userData.x = (_local1.GetPosition().x * m_phys_scale);
_local1.m_userData.y = (_local1.GetPosition().y * m_phys_scale);
_local1.m_userData.rotation = ((_local1.GetAngle() * (180 / Math.PI)) % 360);
};
_local1 = _local1.m_next;
};
}
}
}//package Clases.BasicEngine
Section 89
//Rider (Clases.Car.Rider)
package Clases.Car {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import fl.motion.*;
import flash.geom.*;
import flash.display.*;
import Box2D.Dynamics.Contacts.*;
import flash.filters.*;
public class Rider extends MovieClip {
public var __motion_headAnimationFoward:MotionBase;
private var level:Object;
public var cabeza:Cabeza;
public var torosoAnimado3:MovieClip;
public var head2:MovieClip;
private var gameWorld:b2World;
private var head:Sprite;
public var headAnimationFoward:AnimatorFactory;
public var torsoAnimado2:Torzo2;
public var head3Animation:MovieClip;
public var torso:MovieClip;
private var motoChasis:b2Body;
public function Rider(){
if (__motion_headAnimationFoward == null){
__motion_headAnimationFoward = new Motion();
__motion_headAnimationFoward.duration = 25;
__motion_headAnimationFoward.overrideTargetTransform();
__motion_headAnimationFoward.addPropertyArray("x", [0, 3.05, 7.43912, 11.8283, 16.2174, 20.6065, 24.9956, 29.3848, 33.7739, 38.163, 42.5522, 46.9413, 51.3304, 55.7195, 60.1087, 64.4978, 68.8869, 73.2761, 77.6652, 82.0543, 86.4435, 90.8326, 95.2217, 99.6109, 104]);
__motion_headAnimationFoward.addPropertyArray("y", [0, -3.1, -4.70435, -6.30869, -7.91304, -9.51739, -11.1217, -12.7261, -14.3304, -15.9348, -17.5391, -19.1435, -20.7478, -22.3522, -23.9565, -25.5609, -27.1652, -28.7696, -30.3739, -31.9783, -33.5826, -35.187, -36.7913, -38.3956, -40]);
__motion_headAnimationFoward.addPropertyArray("scaleX", [1]);
__motion_headAnimationFoward.addPropertyArray("scaleY", [1]);
__motion_headAnimationFoward.addPropertyArray("skewX", [0]);
__motion_headAnimationFoward.addPropertyArray("skewY", [0]);
__motion_headAnimationFoward.addPropertyArray("rotationConcat", [0, -0.0833332, -0.166666, -0.25, -0.333333, -0.416666, -0.5, -0.583333, -0.666666, -0.75, -0.833333, -0.916666, -1, -1.08333, -1.16667, -1.25, -1.33333, -1.41667, -1.5, -1.58333, -1.66667, -1.75, -1.83333, -1.91667, -2]);
__motion_headAnimationFoward.addPropertyArray("blendMode", ["normal"]);
headAnimationFoward = new AnimatorFactory(__motion_headAnimationFoward);
headAnimationFoward.transformationPoint = new Point(0.5, 0.5);
};
}
public function createDeathRider(){
var _local3:b2BodyDef;
var _local4:b2Body;
var _local5:b2PolygonDef;
var _local6:b2CircleDef;
var _local7:b2RevoluteJointDef;
var _local8:b2DistanceJointDef;
var _local1 = -8;
var _local2 = 5;
var _local9:Array = new Array();
_local5 = new b2PolygonDef();
_local5.vertexCount = 4;
_local5.vertices[0].Set(0.25, -0.35);
_local5.vertices[1].Set(0.25, 0.35);
_local5.vertices[2].Set(-0.25, 0.35);
_local5.vertices[3].Set(-0.25, -0.35);
_local5.friction = 0.2;
_local5.restitution = 0.4;
_local5.density = 1;
_local5.filter.groupIndex = -1;
_local3 = new b2BodyDef();
_local3.position = new b2Vec2(((7.8305 + motoChasis.GetWorldCenter().x) + _local1), ((4.2 + motoChasis.GetWorldCenter().y) - _local2));
_local3.angle = motoChasis.GetAngle();
_local3.userData = new CabezaDestroy();
_local3.userData.width = 31;
_local3.userData.height = 31;
_local3.userData.x = -500;
_local3.userData.y = -500;
level.addChild(_local3.userData);
head = _local3.userData;
_local4 = gameWorld.CreateBody(_local3);
_local4.CreateShape(_local5);
_local4.SetMassFromShapes();
_local4.SetLinearVelocity(motoChasis.GetLinearVelocity());
_local5 = new b2PolygonDef();
_local5.vertexCount = 4;
_local5.vertices[0].Set(0.27, -0.0700000000000001);
_local5.vertices[1].Set(0.27, 0.0700000000000001);
_local5.vertices[2].Set(-0.27, 0.0700000000000001);
_local5.vertices[3].Set(-0.27, -0.0700000000000001);
_local5.friction = 0.2;
_local5.restitution = 0.4;
_local5.density = 1;
_local5.filter.groupIndex = -1;
_local3 = new b2BodyDef();
_local3.position = new b2Vec2(((8.8495 + motoChasis.GetWorldCenter().x) + _local1), ((4.81 + motoChasis.GetWorldCenter().y) - _local2));
_local3.angle = motoChasis.GetAngle();
_local3.userData = new ManoDestroy();
_local3.userData.width = 30;
_local3.userData.height = 30;
_local3.userData.x = -500;
_local3.userData.y = -500;
level.addChild(_local3.userData);
_local4 = gameWorld.CreateBody(_local3);
_local4.CreateShape(_local5);
_local4.SetMassFromShapes();
_local4.SetLinearVelocity(motoChasis.GetLinearVelocity());
_local5 = new b2PolygonDef();
_local5.vertexCount = 4;
_local5.vertices[0].Set(0.45, -0.0600000000000001);
_local5.vertices[1].Set(0.45, 0.0600000000000001);
_local5.vertices[2].Set(-0.45, 0.0600000000000001);
_local5.vertices[3].Set(-0.45, -0.0600000000000001);
_local5.friction = 0.2;
_local5.restitution = 0.4;
_local5.density = 1;
_local5.filter.groupIndex = -1;
_local3 = new b2BodyDef();
_local3.position = new b2Vec2(((8.2695 + motoChasis.GetWorldCenter().x) + _local1), ((4.82 + motoChasis.GetWorldCenter().y) - _local2));
_local3.angle = motoChasis.GetAngle();
_local3.userData = new BrazoDestroy();
_local3.userData.width = 35;
_local3.userData.height = 35;
_local3.userData.x = -500;
_local3.userData.y = -500;
level.addChild(_local3.userData);
_local4 = gameWorld.CreateBody(_local3);
_local4.CreateShape(_local5);
_local4.SetMassFromShapes();
_local4.SetLinearVelocity(motoChasis.GetLinearVelocity());
_local5 = new b2PolygonDef();
_local5.vertexCount = 4;
_local5.vertices[0].Set(0.0895000000000004, -0.37);
_local5.vertices[1].Set(0.0895000000000004, 0.37);
_local5.vertices[2].Set(-0.0895000000000006, 0.37);
_local5.vertices[3].Set(-0.0895000000000006, -0.37);
_local5.friction = 0.2;
_local5.restitution = 0.4;
_local5.density = 1;
_local5.filter.groupIndex = -1;
_local3 = new b2BodyDef();
_local3.position = new b2Vec2(((7.85 + motoChasis.GetWorldCenter().x) + _local1), ((7.19 + motoChasis.GetWorldCenter().y) - _local2));
_local3.angle = motoChasis.GetAngle();
_local3.userData = new PiernaDestroy();
_local3.userData.width = 40;
_local3.userData.height = 40;
_local3.userData.x = -500;
_local3.userData.y = -500;
level.addChild(_local3.userData);
_local4 = gameWorld.CreateBody(_local3);
_local4.CreateShape(_local5);
_local4.SetMassFromShapes();
_local4.SetLinearVelocity(motoChasis.GetLinearVelocity());
_local5 = new b2PolygonDef();
_local5.vertexCount = 4;
_local5.vertices[0].Set(0.0904999999999995, -0.52);
_local5.vertices[1].Set(0.0904999999999995, 0.52);
_local5.vertices[2].Set(-0.0904999999999996, 0.52);
_local5.vertices[3].Set(-0.0904999999999996, -0.52);
_local5.friction = 0.2;
_local5.restitution = 0.4;
_local5.density = 1;
_local5.filter.groupIndex = -1;
_local3 = new b2BodyDef();
_local3.position = new b2Vec2(((7.849 + motoChasis.GetWorldCenter().x) + _local1), ((6.38 + motoChasis.GetWorldCenter().y) - _local2));
_local3.angle = motoChasis.GetAngle();
_local3.userData = new PiesDestroy();
_local3.userData.width = 30;
_local3.userData.height = 30;
_local3.userData.x = -500;
_local3.userData.y = -500;
level.addChild(_local3.userData);
_local4 = gameWorld.CreateBody(_local3);
_local4.CreateShape(_local5);
_local4.SetMassFromShapes();
_local4.SetLinearVelocity(motoChasis.GetLinearVelocity());
_local5 = new b2PolygonDef();
_local5.vertexCount = 4;
_local5.vertices[0].Set(0.4, -0.85);
_local5.vertices[1].Set(0.4, 0.85);
_local5.vertices[2].Set(-0.4, 0.85);
_local5.vertices[3].Set(-0.4, -0.85);
_local5.friction = 0.2;
_local5.restitution = 0.4;
_local5.density = 1;
_local5.filter.groupIndex = -1;
_local3 = new b2BodyDef();
_local3.position = new b2Vec2(((7.8515 + motoChasis.GetWorldCenter().x) + _local1), ((5.31 + motoChasis.GetWorldCenter().y) - _local2));
_local3.angle = motoChasis.GetAngle();
_local3.userData = new TorzoDestroy();
_local3.userData.width = 40;
_local3.userData.height = 40;
_local3.userData.x = -500;
_local3.userData.y = -500;
level.addChild(_local3.userData);
_local4 = gameWorld.CreateBody(_local3);
_local4.CreateShape(_local5);
_local4.SetMassFromShapes();
_local4.SetLinearVelocity(motoChasis.GetLinearVelocity());
}
public function getHead():Sprite{
return (head);
}
public function setingUpRider(_arg1:b2World, _arg2:b2Body, _arg3:Object){
gameWorld = _arg1;
motoChasis = _arg2;
level = _arg3;
this.y = -180;
this.x = -80;
this.width = 250;
this.height = 360;
this.gotoAndPlay(56);
}
}
}//package Clases.Car
Section 90
//Truck (Clases.Car.Truck)
package Clases.Car {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import flash.display.*;
import flash.events.*;
import Box2D.Dynamics.Contacts.*;
import Clases.BasicEngine.*;
import Clases.*;
import flash.media.*;
public class Truck extends Sprite {
const animationCounterStart:int = 25;
private var bloodSplash:BloodSplash;
private var width_screen:int;// = 550
private var auxCabin:Sprite;
private var canal1:SoundChannel;
private var canal2:SoundChannel;
private var canal3:SoundChannel;
private var cart:b2Body;
private var abajo:Boolean;// = false
private var derecha:Boolean;// = false
private var myHud:GUI;
private var spinTwoPoints:Array;
private var myStage:Stage;
private var wheel1:b2Body;
private var wheel2:b2Body;
private var axle1:b2Body;
private var axle2:b2Body;
private var axle3:b2Body;
private var spring1:b2PrismaticJoint;
private var spring2:b2PrismaticJoint;
private var spring3:b2RevoluteJointDef;
private var spring4:b2DistanceJointDef;
private var onceSpinePerTime:Boolean;// = true
private var movieClipLevel:PhisicBase;
private var onceBackSpinePerTime:Boolean;// = true
private var higth_screen:int;// = 400
private var animationCounter:int;// = 25
private var motor1:b2RevoluteJoint;
private var motor2:b2RevoluteJoint;
private var izquierda:Boolean;// = false
private var phys_scale:int;// = 20
private var arriba:Boolean;// = false
private var ildleEngine:IdleEngine;
private var roockSound:RockSound;
private var rider:Rider;
public function Truck(_arg1:b2World, _arg2:Stage){
var _local3:b2Body;
var _local4:b2BodyDef;
var _local5:b2PolygonDef;
var _local6:b2CircleDef;
var _local7:b2RevoluteJointDef;
var _local8:b2PrismaticJointDef;
var _local9:Sprite;
var _local10:Sprite;
spinTwoPoints = new Array();
canal1 = new SoundChannel();
canal2 = new SoundChannel();
canal3 = new SoundChannel();
roockSound = new RockSound();
bloodSplash = new BloodSplash();
ildleEngine = new IdleEngine();
super();
spinTwoPoints[0] = false;
spinTwoPoints[1] = false;
var _local11 = 5;
var _local12 = 5;
myStage = _arg2;
canal3 = ildleEngine.play(0, 999);
_local4 = new b2BodyDef();
_local4.position.Set(_local11, _local12);
_local4.userData = new Carroceria();
_local4.userData.width = 140;
_local4.userData.height = 65;
_local4.userData.x = -500;
_local4.userData.y = -500;
auxCabin = _local4.userData;
cart = _arg1.CreateBody(_local4);
_local5 = new b2PolygonDef();
_local5.density = 0.25;
_local5.friction = 0.5;
_local5.restitution = 0;
_local5.SetAsOrientedBox(1.3, 0.25, new b2Vec2(0.3, -0.75), (-(Math.PI) / 4));
_local5.filter.groupIndex = -1;
cart.CreateShape(_local5);
_local5.SetAsOrientedBox(1, 0.25, new b2Vec2(-1, -0.75), (Math.PI / 4));
_local5.filter.groupIndex = -1;
cart.CreateShape(_local5);
_local5.SetAsOrientedBox(0.3, 0.2, new b2Vec2(-2.2, -0.5), (-(Math.PI) / 2));
_local5.filter.groupIndex = -1;
cart.CreateShape(_local5);
_local5.SetAsOrientedBox(0.75, 0.2, new b2Vec2(1.65, -0.85), (Math.PI / 2.9));
_local5.filter.groupIndex = -1;
cart.CreateShape(_local5);
cart.SetMassFromShapes();
_local5.density = 0.001;
_local4 = new b2BodyDef();
_local4.position.Set(_local11, _local12);
_local4.userData = new Amortiguador();
_local4.userData.width = 40;
_local4.userData.height = 60;
_local4.userData.x = -500;
_local4.userData.y = -500;
_local9 = _local4.userData;
_local5.filter.groupIndex = -1;
axle1 = _arg1.CreateBody(_local4);
_local5.SetAsOrientedBox(0.25, 0.1, new b2Vec2((1.95 + (0.6 * Math.cos((Math.PI / 3)))), (-0.25 + (0.6 * Math.sin((Math.PI / 3))))), (Math.PI / 3));
_local5.density = 0.51;
_local5.filter.groupIndex = -1;
axle1.CreateShape(_local5);
axle1.SetMassFromShapes();
_local8 = new b2PrismaticJointDef();
_local8.Initialize(cart, axle1, axle1.GetWorldCenter(), new b2Vec2(Math.cos((Math.PI / 3)), Math.sin((Math.PI / 3))));
_local8.lowerTranslation = -0.6;
_local8.upperTranslation = 1;
_local8.enableLimit = true;
_local8.enableMotor = true;
spring1 = (_arg1.CreateJoint(_local8) as b2PrismaticJoint);
_local5.filter.groupIndex = -1;
axle2 = _arg1.CreateBody(_local4);
_local5.SetAsOrientedBox(0.25, 0.1, new b2Vec2(-2.2, (0.25 - (0.6 * Math.sin((-(Math.PI) / 2))))), (-(Math.PI) / 2));
_local5.density = 0.51;
_local5.filter.groupIndex = -1;
axle2.CreateShape(_local5);
axle2.SetMassFromShapes();
_local8.Initialize(cart, axle2, axle2.GetWorldCenter(), new b2Vec2(-(Math.cos((Math.PI / 2))), Math.sin((Math.PI / 2))));
spring2 = (_arg1.CreateJoint(_local8) as b2PrismaticJoint);
_local4.userData = new AmortiguadorTrasero();
_local4.userData.width = 70;
_local4.userData.height = 65;
_local4.userData.x = -500;
_local4.userData.y = -500;
_local10 = _local4.userData;
axle3 = _arg1.CreateBody(_local4);
_local5.SetAsOrientedBox(0.5, 0.1, new b2Vec2(-1.5, 0.25), (-(Math.PI) / 9));
_local5.density = 0.51;
_local5.filter.groupIndex = -1;
axle3.CreateShape(_local5);
axle3.SetMassFromShapes();
spring3 = new b2RevoluteJointDef();
spring3.Initialize(cart, axle3, new b2Vec2(4.5, 5));
spring3.enableLimit = false;
spring3.lowerAngle = 0;
spring3.upperAngle = 0;
_arg1.CreateJoint(spring3);
spring4 = new b2DistanceJointDef();
spring4.Initialize(axle2, axle3, axle2.GetWorldCenter(), new b2Vec2((axle3.GetWorldCenter().x - 1), axle3.GetWorldCenter().y));
spring4.dampingRatio = 0;
spring4.frequencyHz = 0;
_arg1.CreateJoint(spring4);
_local6 = new b2CircleDef();
_local6.radius = 1;
_local6.density = 0.075;
_local6.friction = 1000;
_local6.restitution = 0.1;
_local6.filter.groupIndex = -1;
_local4 = new b2BodyDef();
_local4.position.Set(_local11, _local12);
_local4.userData = new RuedaDelantera();
_local4.userData.width = 48;
_local4.userData.height = 48;
_local4.userData.x = -500;
_local4.userData.y = -500;
addChild(_local4.userData);
_local4.position.Set((axle1.GetWorldCenter().x + (0.5 * Math.cos((Math.PI / 3)))), (axle1.GetWorldCenter().y + (0.3 * Math.sin((Math.PI / 3)))));
_local4.allowSleep = false;
_local5.filter.groupIndex = -1;
wheel1 = _arg1.CreateBody(_local4);
wheel1.CreateShape(_local6);
wheel1.SetMassFromShapes();
_local6 = new b2CircleDef();
_local6.radius = 1;
_local6.density = 0.075;
_local6.friction = 1000;
_local6.restitution = 0.1;
_local6.filter.groupIndex = -1;
_local4 = new b2BodyDef();
_local4.position.Set(_local11, _local12);
_local4.userData = new RuedaTrasera();
_local4.userData.width = 50;
_local4.userData.height = 50;
_local4.userData.x = -500;
_local4.userData.y = -500;
addChild(_local4.userData);
_local4.position.Set((axle2.GetWorldCenter().x - (0.3 * Math.cos((-(Math.PI) / 3)))), (axle2.GetWorldCenter().y - (0.3 * Math.sin((-(Math.PI) / 3)))));
_local4.allowSleep = false;
wheel2 = _arg1.CreateBody(_local4);
wheel2.CreateShape(_local6);
wheel2.SetMassFromShapes();
_local7 = new b2RevoluteJointDef();
_local7.enableMotor = true;
_local7.Initialize(axle1, wheel1, wheel1.GetWorldCenter());
motor1 = (_arg1.CreateJoint(_local7) as b2RevoluteJoint);
_local7.Initialize(axle2, wheel2, wheel2.GetWorldCenter());
motor2 = (_arg1.CreateJoint(_local7) as b2RevoluteJoint);
addChild(auxCabin);
addChild(_local10);
addChild(_local9);
rider = new Rider();
auxCabin.addChild(rider);
rider.setingUpRider(_arg1, cart, this);
rider.gotoAndStop(animationCounterStart);
myStage.addEventListener(KeyboardEvent.KEY_DOWN, checkKeysDownDown);
myStage.addEventListener(KeyboardEvent.KEY_UP, checkKeysDownUp);
myStage.focus = this;
}
private function fixCamera(_arg1:Object, _arg2:Object){
_arg1.x = (280 + (cart.GetWorldCenter().x * -(phys_scale)));
_arg1.y = (200 + (cart.GetWorldCenter().y * -(phys_scale)));
_arg2.x = -(_arg1.x);
myHud.x = -(_arg1.x);
myHud.y = -(_arg1.y);
}
public function updateTruck(_arg1:Object, _arg2:Object){
var movieClipLevel = _arg1;
var b = _arg2;
var restaruarAnumacion:Function = function (){
if (animationCounter > animationCounterStart){
animationCounter--;
rider.gotoAndStop(animationCounter);
};
if (animationCounter < animationCounterStart){
animationCounter++;
rider.gotoAndStop(animationCounter);
};
};
cart.ApplyTorque(((12 * Math.PI) * (derecha) ? 1 : (izquierda) ? -0.51 : 0));
motor2.SetMotorSpeed(((10 * Math.PI) * (arriba) ? 1 : (abajo) ? -0.1 : 0));
motor2.SetMaxMotorTorque((((arriba) || (abajo))) ? 85 : 0);
spring1.SetMaxMotorForce((10 + Math.abs((80 * Math.pow(spring1.GetJointTranslation(), 2)))));
spring1.SetMotorSpeed(((spring1.GetMotorSpeed() - (10 * spring1.GetJointTranslation())) * 0.25));
spring2.SetMaxMotorForce((10 + Math.abs((80 * Math.pow(spring2.GetJointTranslation(), 2)))));
spring2.SetMotorSpeed(((spring2.GetMotorSpeed() - (10 * spring2.GetJointTranslation())) * 0.25));
if (((!(derecha)) && (!(izquierda)))){
restaruarAnumacion();
} else {
if ((((animationCounter >= 0)) && ((animationCounter <= 50)))){
rider.gotoAndStop((derecha) ? animationCounter++ : (izquierda) ? animationCounter-- : animationCounter);
};
};
fixCamera(movieClipLevel, b);
}
public function getHeadAnimation1():MovieClip{
return (rider.head2);
}
public function getHeadAnimation2():MovieClip{
return (rider.head3Animation);
}
private function checkKeysDownDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 40){
abajo = true;
};
if (_arg1.keyCode == 38){
arriba = true;
};
if (_arg1.keyCode == 39){
derecha = true;
};
if (_arg1.keyCode == 37){
izquierda = true;
};
}
public function getWheel1Sprite():Sprite{
return (wheel1.GetUserData());
}
private function checkKeysDownUp(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 40){
abajo = false;
};
if (_arg1.keyCode == 38){
arriba = false;
};
if (_arg1.keyCode == 39){
derecha = false;
};
if (_arg1.keyCode == 37){
izquierda = false;
};
}
public function getGui(_arg1:GUI){
myHud = _arg1;
}
public function getWheel2Sprite():Sprite{
return (wheel2.GetUserData());
}
public function getRiderHead():MovieClip{
return (rider.cabeza);
}
public function getTorsoAnimation1():MovieClip{
return (rider.torsoAnimado2);
}
public function getCabinSprite():Sprite{
return (auxCabin);
}
public function getHeadForBlood():Sprite{
return (rider.getHead());
}
public function getRiderSprite():MovieClip{
return (rider.torso);
}
public function getTorsoAnimation2():MovieClip{
return (rider.torosoAnimado3);
}
public function removeRider(){
canal1 = roockSound.play();
canal2 = bloodSplash.play();
canal3.stop();
auxCabin.removeChild(rider);
}
public function stopSounds(){
canal3.stop();
}
public function getLevelMovieClip(_arg1:PhisicBase){
movieClipLevel = _arg1;
}
public function spinCombo(){
var _local1:int;
if (onceSpinePerTime){
if (((((cart.GetAngle() % (2 * Math.PI)) <= -2.4)) && (((cart.GetAngle() % (2 * Math.PI)) >= -2.6)))){
_local1 = 1;
spinTwoPoints[0] = true;
};
if (((((cart.GetAngle() % (2 * Math.PI)) <= -5.7)) && (((cart.GetAngle() % (2 * Math.PI)) >= -5.9)))){
_local1 = 2;
spinTwoPoints[1] = true;
};
if (((((cart.GetAngle() % (2 * Math.PI)) >= 2.4)) && (((cart.GetAngle() % (2 * Math.PI)) <= 2.6)))){
_local1 = 2;
spinTwoPoints[1] = true;
};
if (((((cart.GetAngle() % (2 * Math.PI)) >= 5.7)) && (((cart.GetAngle() % (2 * Math.PI)) <= 5.9)))){
_local1 = 1;
spinTwoPoints[0] = true;
};
};
var _local2:Boolean;
var _local3:int;
while (_local3 < spinTwoPoints.length) {
if (!spinTwoPoints[_local3]){
_local2 = false;
};
_local3++;
};
if (_local2){
if (_local1 == 1){
myHud.addFowardCombo();
};
if (_local1 == 2){
myHud.addBackCombo();
};
onceSpinePerTime = false;
spinTwoPoints[0] = false;
spinTwoPoints[1] = false;
};
if (((((((cart.GetAngle() % (2 * Math.PI)) >= -0.8)) && (((cart.GetAngle() % (2 * Math.PI)) <= 0)))) || (((((cart.GetAngle() % (2 * Math.PI)) >= 5.5)) && (((cart.GetAngle() % (2 * Math.PI)) >= 6.2)))))){
onceSpinePerTime = true;
spinTwoPoints[0] = false;
spinTwoPoints[1] = false;
};
}
public function disableKeys(){
myStage.removeEventListener(KeyboardEvent.KEY_DOWN, checkKeysDownDown);
myStage.removeEventListener(KeyboardEvent.KEY_UP, checkKeysDownUp);
abajo = false;
arriba = false;
derecha = false;
izquierda = false;
}
public function createFhisicRider(){
disableKeys();
rider.createDeathRider();
}
}
}//package Clases.Car
Section 91
//FreeGamesForYouSite (Clases.MoreGames.FreeGamesForYouSite)
package Clases.MoreGames {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class FreeGamesForYouSite extends SimpleButton {
public function FreeGamesForYouSite(){
addEventListener(MouseEvent.CLICK, saltoAPortal);
}
private function saltoAPortal(_arg1:MouseEvent){
var _local2:URLRequest = new URLRequest("http://www.i6.com/freegamesforyoursite.html?utm_source=games&utm_medium=trucksterfgwyws");
navigateToURL(_local2, "_blank");
}
}
}//package Clases.MoreGames
Section 92
//PlayMoreGames (Clases.MoreGames.PlayMoreGames)
package Clases.MoreGames {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class PlayMoreGames extends SimpleButton {
public function PlayMoreGames(){
addEventListener(MouseEvent.CLICK, saltoAPortal);
}
private function saltoAPortal(_arg1:MouseEvent){
var _local2:URLRequest = new URLRequest("http://www.i6.com/?utm_source=games&utm_medium=trucksterpmg");
navigateToURL(_local2, "_blank");
}
}
}//package Clases.MoreGames
Section 93
//SmallADSButton (Clases.MoreGames.SmallADSButton)
package Clases.MoreGames {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class SmallADSButton extends SimpleButton {
public function SmallADSButton(){
addEventListener(MouseEvent.CLICK, saltoAPortal);
}
private function saltoAPortal(_arg1:MouseEvent){
var _local2:URLRequest = new URLRequest("http://www.i6.com/?utm_source=games&utm_medium=trucksterspl");
navigateToURL(_local2, "_blank");
}
}
}//package Clases.MoreGames
Section 94
//BContactListener (Clases.BContactListener)
package Clases {
import Box2D.Collision.*;
import Box2D.Dynamics.*;
import flash.media.*;
public class BContactListener extends b2ContactListener {
private var canal4:SoundChannel;
private var blood:BloodSplash;
public function BContactListener(){
canal4 = new SoundChannel();
blood = new BloodSplash();
super();
}
override public function Add(_arg1:b2ContactPoint):void{
if (_arg1.shape2.GetBody().GetUserData()){
if ((_arg1.shape2.GetBody().GetUserData() is CabezaDestroy)){
if (_arg1.shape2.GetBody().GetLinearVelocity().Length() > 7){
canal4 = blood.play();
};
};
};
}
override public function Remove(_arg1:b2ContactPoint):void{
}
override public function Persist(_arg1:b2ContactPoint):void{
}
}
}//package Clases
Section 95
//GameOver (Clases.GameOver)
package Clases {
import flash.display.*;
import gs.*;
import Display.*;
import gs.easing.*;
import Clases.MoreGames.*;
public class GameOver extends Sprite {
public function GameOver(){
var addFilter:Function;
super();
addFilter = function (){
var _local1:TimeOverSpaceBar = new TimeOverSpaceBar();
addChild(_local1);
_local1.alpha = 1;
_local1.y = 250;
_local1.x = 330;
TweenMax.to(_local1, 3, {alpha:1, ease:Cubic.easeOut});
var _local2:DisplayButton = new DisplayButton();
_local2.setingUp(new PlayMoreGames(), "easeOutSine");
_local2.setXY(335, 300);
addChild(_local2);
var _local3:DisplayButton = new DisplayButton();
_local3.setingUp(new FreeGamesForYouSite(), "easeOutSine");
_local3.setXY(335, 350);
addChild(_local3);
};
var tm:TimeOver = new TimeOver();
addChild(tm);
tm.y = -50;
tm.x = 315;
TweenMax.to(tm, 2, {y:125, ease:Cubic.easeOut, onComplete:addFilter});
}
}
}//package Clases
Section 96
//GUI (Clases.GUI)
package Clases {
import flash.display.*;
import flash.events.*;
import gs.*;
import Display.*;
import gs.easing.*;
import flash.net.*;
public class GUI extends Sprite {
private var showTimer:DisplayTextField;
private var time:int;// = 0
private var score:int;// = 0
private var showScore:DisplayTextField;
private var i6small:I6introsmall;
public function GUI(){
i6small = new I6introsmall();
showScore = new DisplayTextField();
showTimer = new DisplayTextField();
super();
showTimer.setSizeFont(20);
showTimer.setXY(-80, 7);
showTimer.setW(200);
showTimer.setH(100);
showTimer.setTextStyle(new MyFont());
showTimer.setText("Score: 0");
addChild(showTimer);
TweenMax.to(showTimer, 3, {x:100, ease:Quint.easeOut});
i6small.x = 590;
i6small.y = 350;
i6small.width = 70;
i6small.height = 70;
addChild(i6small);
i6small.addEventListener(MouseEvent.CLICK, gotoI6PageFunction);
}
public function actualizarScore(_arg1:int){
time = (time + _arg1);
}
public function addBackCombo(){
var displayCombo1:BackSpin;
var transparent:Function;
var remove:Function;
transparent = function (){
TweenMax.to(displayCombo1, 0.31, {alpha:0, ease:Quart.easeOut, onComplete:remove});
};
remove = function (){
removeChild(displayCombo1);
};
displayCombo1 = new BackSpin();
addChild(displayCombo1);
displayCombo1.x = -60;
displayCombo1.y = 390;
actualizarScore(250);
TweenMax.to(displayCombo1, 2, {x:140, ease:Quart.easeOut, onComplete:transparent});
}
public function getActualScore():int{
return (time);
}
public function addFowardCombo(){
var displayCombo2:FowardSpinBonus;
var transparent:Function;
var remove:Function;
transparent = function (){
TweenMax.to(displayCombo2, 0.31, {alpha:0, ease:Quart.easeOut, onComplete:remove});
};
remove = function (){
removeChild(displayCombo2);
};
displayCombo2 = new FowardSpinBonus();
addChild(displayCombo2);
displayCombo2.x = -60;
displayCombo2.y = 390;
actualizarScore(1500);
TweenMax.to(displayCombo2, 2, {x:140, ease:Quart.easeOut, onComplete:transparent});
}
private function gotoI6PageFunction(_arg1:MouseEvent){
var _local2:URLRequest = new URLRequest("http://www.i6.com/free-games/78/racing?utm_source=games&utm_medium=dr2spr");
navigateToURL(_local2, "_blank");
}
public function getLevelTime(_arg1:int){
time = _arg1;
}
public function updateTimer(){
time--;
showTimer.setText(("Score: " + String(time)));
}
}
}//package Clases
Section 97
//HitTest (Clases.HitTest)
package Clases {
import flash.geom.*;
import flash.display.*;
public class HitTest {
protected static function getDrawMatrix(_arg1:DisplayObject, _arg2:Rectangle, _arg3:Number):Matrix{
var _local4:Point;
var _local5:Matrix;
var _local6:Matrix = _arg1.root.transform.concatenatedMatrix;
_local4 = _arg1.localToGlobal(new Point());
_local5 = _arg1.transform.concatenatedMatrix;
_local5.tx = (_local4.x - _arg2.x);
_local5.ty = (_local4.y - _arg2.y);
_local5.a = (_local5.a / _local6.a);
_local5.d = (_local5.d / _local6.d);
if (_arg3 != 1){
_local5.scale(_arg3, _arg3);
};
return (_local5);
}
public static function complexHitTestObject(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Number=1):Boolean{
return (!((complexIntersectionRectangle(_arg1, _arg2, _arg3).width == 0)));
}
public static function complexIntersectionRectangle(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Number=1):Rectangle{
if (_arg3 <= 0){
throw (new Error("ArgumentError: Error #5001: Invalid value for accurracy", 5001));
};
if (!_arg1.hitTestObject(_arg2)){
return (new Rectangle());
};
var _local4:Rectangle = intersectionRectangle(_arg1, _arg2);
if (((((_local4.width * _arg3) < 1)) || (((_local4.height * _arg3) < 1)))){
return (new Rectangle());
};
var _local5:BitmapData = new BitmapData((_local4.width * _arg3), (_local4.height * _arg3), false, 0);
_local5.draw(_arg1, HitTest.getDrawMatrix(_arg1, _local4, _arg3), new ColorTransform(1, 1, 1, 1, 0xFF, -255, -255, 0xFF));
_local5.draw(_arg2, HitTest.getDrawMatrix(_arg2, _local4, _arg3), new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0xFF), BlendMode.DIFFERENCE);
var _local6:Rectangle = _local5.getColorBoundsRect(4294967295, 4278255615);
_local5.dispose();
if (_arg3 != 1){
_local6.x = (_local6.x / _arg3);
_local6.y = (_local6.y / _arg3);
_local6.width = (_local6.width / _arg3);
_local6.height = (_local6.height / _arg3);
};
_local6.x = (_local6.x + _local4.x);
_local6.y = (_local6.y + _local4.y);
return (_local6);
}
public static function intersectionRectangle(_arg1:DisplayObject, _arg2:DisplayObject):Rectangle{
if (((((!(_arg1.root)) || (!(_arg2.root)))) || (!(_arg1.hitTestObject(_arg2))))){
return (new Rectangle());
};
var _local3:Rectangle = _arg1.getBounds(_arg1.root);
var _local4:Rectangle = _arg2.getBounds(_arg2.root);
var _local5:Rectangle = new Rectangle();
_local5.x = Math.max(_local3.x, _local4.x);
_local5.y = Math.max(_local3.y, _local4.y);
_local5.width = Math.min(((_local3.x + _local3.width) - _local5.x), ((_local4.x + _local4.width) - _local5.x));
_local5.height = Math.min(((_local3.y + _local3.height) - _local5.y), ((_local4.y + _local4.height) - _local5.y));
return (_local5);
}
}
}//package Clases
Section 98
//LevelSelection (Clases.LevelSelection)
package Clases {
import Box2D.Dynamics.*;
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import gs.*;
import Clases.BasicEngine.*;
import Clases.Car.*;
import Display.*;
import gs.easing.*;
import mochi.as3.*;
import flash.utils.*;
import flash.media.*;
import Levels.*;
import flash.net.*;
public class LevelSelection extends PhisicBase {
const LEVEL_END_TIMER:int = 2500;
const TIME_END:int = 5000;
const TIME_TO_LOSE:int = 0;
private var currentLevel:int;// = 0
private var canal4:SoundChannel;
private var levelStageArray:Array;
private var levelSelect:LevelSelection;
private var bloodCounter:int;// = 0
private var menuCounter:int;// = 1
private var onceCration:Boolean;// = true
private var arrayOfLevels:Array;
private var selectedButton:LevelActivated;
private var blockTimer:Boolean;// = true
private var main:Main;
private var levelSelected:Object;
private var myStage:Stage;
private var riderDeathTimer:Timer;
private var endgame:Boolean;// = true
private var car:Truck;
private var stopTimer:Boolean;// = true
private var back:LevelSelectBackground;
private var lts:LevelTransaction;
private var carStart:CarStart;
private var myGui:GUI;
private var backgroundLevel:BackgroundAnimation;
private var myTimer:Timer;
public var local_data:SharedObject;
public function LevelSelection(){
selectedButton = new LevelActivated();
backgroundLevel = new BackgroundAnimation();
local_data = SharedObject.getLocal("user_data_Dirt_Rider_II_BB");
canal4 = new SoundChannel();
carStart = new CarStart();
super();
}
private function actualizarCristales(_arg1:Array, _arg2:Truck, _arg3:GUI){
var displayVal:DisplayTextField;
var a = _arg1;
var c = _arg2;
var gui = _arg3;
var k:int;
while (k < a.length) {
if (((((HitTest.complexHitTestObject(c.getWheel1Sprite(), a[k], 1)) || (HitTest.complexHitTestObject(c.getWheel2Sprite(), a[k], 1)))) || (HitTest.complexHitTestObject(c.getCabinSprite(), a[k], 1)))){
var removerBonus:Function = function (){
removeChild(displayVal);
};
displayVal = new DisplayTextField();
displayVal.setXY(-60, 0);
displayVal.setW(120);
displayVal.setH(50);
displayVal.setTextStyle(new MyFont());
displayVal.setColor(0);
displayVal.setSizeFont(32);
displayVal.setText(("+ " + String(a[k].getVal())));
displayVal.x = a[k].x;
displayVal.y = a[k].y;
addChild(displayVal);
TweenMax.to(displayVal, 3, {y:((Math.random() * 100) - 50), ease:Quint.easeOut, onComplete:removerBonus});
TweenMax.to(displayVal, 0.25, {glowFilter:{color:a[k].getColorVal(), alpha:1, blurX:5, blurY:5, strength:7.5}});
myGui.actualizarScore(a[k].getVal());
a[k].remove();
a.splice(a.indexOf(a[k]), 1);
};
k = (k + 1);
};
}
private function level3Add(_arg1:int, _arg2:int){
var _local3:MainLevelButton = new MainLevelButton();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.addEventListener(MouseEvent.CLICK, getLevel3);
addChild(_local3);
levelStageArray.push(_local3);
}
private function level6Add(_arg1:int, _arg2:int){
var _local3:MainLevelButton = new MainLevelButton();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.addEventListener(MouseEvent.CLICK, getLevel6);
addChild(_local3);
levelStageArray.push(_local3);
}
private function level2Add(_arg1:int, _arg2:int){
var _local3:MainLevelButton = new MainLevelButton();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.addEventListener(MouseEvent.CLICK, getLevel2);
addChild(_local3);
levelStageArray.push(_local3);
}
private function levelSelectionInit(){
var resetGame:Function;
resetGame = function (_arg1:MouseEvent){
myStage.removeEventListener(KeyboardEvent.KEY_DOWN, vajar_O_subir_en_el_menu);
main.restartMain();
};
canal4 = carStart.play();
levelStageArray = new Array();
back = new LevelSelectBackground();
addChild(back);
levelStageArray.push(back);
this.x = 0;
this.y = 0;
back.x = 0;
back.y = 0;
var posX = 580;
bloodCounter = 0;
var arrayOfPositions:Array = new Array();
arrayOfPositions = [];
var j:int;
while (j < 8) {
arrayOfPositions[j] = (27 + (39 * j));
j = (j + 1);
};
if (local_data.data.cLevel){
currentLevel = local_data.data.cLevel;
} else {
local_data.data.cLevel = currentLevel;
};
switch (currentLevel){
case 0:
level1Add(posX, arrayOfPositions[currentLevel]);
levelLocked(posX, arrayOfPositions[1]);
levelLocked(posX, arrayOfPositions[2]);
levelLocked(posX, arrayOfPositions[3]);
levelLocked(posX, arrayOfPositions[4]);
levelLocked(posX, arrayOfPositions[5]);
levelLocked(posX, arrayOfPositions[6]);
levelLocked(posX, arrayOfPositions[7]);
break;
case 1:
level1Add(posX, arrayOfPositions[0]);
level2Add(posX, arrayOfPositions[currentLevel]);
levelLocked(posX, arrayOfPositions[2]);
levelLocked(posX, arrayOfPositions[3]);
levelLocked(posX, arrayOfPositions[4]);
levelLocked(posX, arrayOfPositions[5]);
levelLocked(posX, arrayOfPositions[6]);
levelLocked(posX, arrayOfPositions[7]);
break;
case 2:
level1Add(posX, arrayOfPositions[0]);
level2Add(posX, arrayOfPositions[1]);
level3Add(posX, arrayOfPositions[currentLevel]);
levelLocked(posX, arrayOfPositions[3]);
levelLocked(posX, arrayOfPositions[4]);
levelLocked(posX, arrayOfPositions[5]);
levelLocked(posX, arrayOfPositions[6]);
levelLocked(posX, arrayOfPositions[7]);
break;
case 3:
level1Add(posX, arrayOfPositions[0]);
level2Add(posX, arrayOfPositions[1]);
level3Add(posX, arrayOfPositions[2]);
level4Add(posX, arrayOfPositions[currentLevel]);
levelLocked(posX, arrayOfPositions[4]);
levelLocked(posX, arrayOfPositions[5]);
levelLocked(posX, arrayOfPositions[6]);
levelLocked(posX, arrayOfPositions[7]);
break;
case 4:
level1Add(posX, arrayOfPositions[0]);
level2Add(posX, arrayOfPositions[1]);
level3Add(posX, arrayOfPositions[2]);
level4Add(posX, arrayOfPositions[3]);
level5Add(posX, arrayOfPositions[currentLevel]);
levelLocked(posX, arrayOfPositions[5]);
levelLocked(posX, arrayOfPositions[6]);
levelLocked(posX, arrayOfPositions[7]);
break;
case 5:
level1Add(posX, arrayOfPositions[0]);
level2Add(posX, arrayOfPositions[1]);
level3Add(posX, arrayOfPositions[2]);
level4Add(posX, arrayOfPositions[3]);
level5Add(posX, arrayOfPositions[4]);
level6Add(posX, arrayOfPositions[currentLevel]);
levelLocked(posX, arrayOfPositions[6]);
levelLocked(posX, arrayOfPositions[7]);
break;
case 6:
level1Add(posX, arrayOfPositions[0]);
level2Add(posX, arrayOfPositions[1]);
level3Add(posX, arrayOfPositions[2]);
level4Add(posX, arrayOfPositions[3]);
level5Add(posX, arrayOfPositions[4]);
level6Add(posX, arrayOfPositions[5]);
level7Add(posX, arrayOfPositions[currentLevel]);
levelLocked(posX, arrayOfPositions[7]);
break;
case 7:
level1Add(posX, arrayOfPositions[0]);
level2Add(posX, arrayOfPositions[1]);
level3Add(posX, arrayOfPositions[2]);
level4Add(posX, arrayOfPositions[3]);
level5Add(posX, arrayOfPositions[4]);
level6Add(posX, arrayOfPositions[5]);
level7Add(posX, arrayOfPositions[6]);
level8Add(posX, arrayOfPositions[currentLevel]);
break;
default:
level1Add(posX, arrayOfPositions[0]);
level2Add(posX, arrayOfPositions[1]);
level3Add(posX, arrayOfPositions[2]);
level4Add(posX, arrayOfPositions[3]);
level5Add(posX, arrayOfPositions[4]);
level6Add(posX, arrayOfPositions[5]);
level7Add(posX, arrayOfPositions[6]);
level8Add(posX, arrayOfPositions[7]);
};
addChild(selectedButton);
myStage.addEventListener(KeyboardEvent.KEY_DOWN, vajar_O_subir_en_el_menu);
myStage.focus = this;
selectedButton.x = levelStageArray[menuCounter].x;
selectedButton.y = levelStageArray[menuCounter].y;
lts = new LevelTransaction();
back.addChild(lts);
lts.levelSelection("Level Selection", {x:750, y:10, destino:-590, sizeFont:20});
var backtomain:BackToMainButton = new BackToMainButton();
addChild(backtomain);
backtomain.x = 75;
backtomain.y = 25;
backtomain.addEventListener(MouseEvent.CLICK, resetGame);
}
private function removeLevelSelection(){
canal4.stop();
addChild(backgroundLevel);
backgroundLevel.y = -180;
var _local1:int;
while (_local1 < levelStageArray.length) {
removeChild(levelStageArray[_local1]);
_local1++;
};
}
private function actualizarPhisicGame(_arg1:Event){
var endLevelScreen:GameOver;
var checkSpaceBar:Function;
var e = _arg1;
super.updateLevel();
car.updateTruck(this, backgroundLevel);
car.spinCombo();
if (blockTimer){
if (myGui.getActualScore() <= TIME_TO_LOSE){
checkSpaceBar = function (_arg1:KeyboardEvent){
if ((((_arg1.keyCode == 32)) || ((_arg1.keyCode == 13)))){
removeChild(endLevelScreen);
removeChild(myGui);
removeChild(car);
car.stopSounds();
removeChild(backgroundLevel);
levelSelected.removeCurrentLevel();
levelSelected.removeHisChild();
levelSelectionInit();
myStage.removeEventListener(KeyboardEvent.KEY_DOWN, checkSpaceBar);
};
};
endLevelScreen = new GameOver();
addChild(endLevelScreen);
endLevelScreen.x = myGui.x;
endLevelScreen.y = myGui.y;
car.disableKeys();
removeLevel();
myStage.addEventListener(KeyboardEvent.KEY_DOWN, checkSpaceBar);
} else {
if (stopTimer){
myGui.updateTimer();
};
};
};
testLevelEnd();
actualizarCristales(levelSelected.setBonussArray(), car, myGui);
}
private function getLevel1(_arg1:MouseEvent){
startLevel1();
}
private function getLevel5(_arg1:MouseEvent){
startLevel5();
}
private function getLevel7(_arg1:MouseEvent){
startLevel7();
}
public function levelSelectionInitGame(){
levelSelectionInit();
}
private function getLevel2(_arg1:MouseEvent){
startLevel2();
}
private function getLevel3(_arg1:MouseEvent){
startLevel3();
}
private function levelLocked(_arg1:int, _arg2:int){
var _local3:MainLevelLockedButton = new MainLevelLockedButton();
_local3.x = _arg1;
_local3.y = _arg2;
addChild(_local3);
levelStageArray.push(_local3);
}
private function getLevel6(_arg1:MouseEvent){
startLevel6();
}
private function level5Add(_arg1:int, _arg2:int){
var _local3:MainLevelButton = new MainLevelButton();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.addEventListener(MouseEvent.CLICK, getLevel5);
addChild(_local3);
levelStageArray.push(_local3);
}
private function getLevel8(_arg1:MouseEvent){
startLevel4();
}
private function level1Add(_arg1:int, _arg2:int){
var _local3:MainLevelButton = new MainLevelButton();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.addEventListener(MouseEvent.CLICK, getLevel1);
addChild(_local3);
levelStageArray.push(_local3);
}
private function getLevel4(_arg1:MouseEvent){
startLevel8();
}
private function startLevel1(){
removeLevelSelection();
this.y = 138.8;
var _local1:Level1 = new Level1(m_world);
addChild(_local1);
levelSelected = _local1;
currentLevel = 0;
setLevel();
}
private function startLevel2(){
removeLevelSelection();
this.y = 138.8;
var _local1:Level2 = new Level2(m_world);
addChild(_local1);
levelSelected = _local1;
currentLevel = 1;
setLevel();
}
private function startLevel6(){
removeLevelSelection();
this.y = 138.8;
var _local1:Level6 = new Level6(m_world);
addChild(_local1);
levelSelected = _local1;
currentLevel = 5;
setLevel();
}
private function startLevel7(){
removeLevelSelection();
this.y = 138.8;
var _local1:Level7 = new Level7(m_world);
addChild(_local1);
levelSelected = _local1;
currentLevel = 6;
setLevel();
}
private function startLevel8(){
removeLevelSelection();
this.y = 138.8;
var _local1:Level8 = new Level8(m_world);
addChild(_local1);
levelSelected = _local1;
currentLevel = 7;
setLevel();
}
private function setLevel(){
myTimer = new Timer(LEVEL_END_TIMER);
riderDeathTimer = new Timer(TIME_END);
endgame = true;
stopTimer = true;
onceCration = true;
blockTimer = true;
car = new Truck(m_world, myStage);
addChild(car);
myGui = new GUI();
addChild(myGui);
myGui.getLevelTime(levelSelected.setTIME());
car.getGui(myGui);
addEventListener(Event.ENTER_FRAME, actualizarPhisicGame);
myStage.removeEventListener(KeyboardEvent.KEY_DOWN, vajar_O_subir_en_el_menu);
}
private function drawBlood(){
var _local1:Rectangle;
var _local2:Shape;
var _local3:*;
if (car.getHeadForBlood()){
if (HitTest.complexHitTestObject(car.getHeadForBlood(), levelSelected.getTerrainShape(), 0.1)){
bloodCounter++;
if (bloodCounter){
_local1 = HitTest.intersectionRectangle(car.getHeadForBlood(), levelSelected.getTerrainShape());
_local2 = new Shape();
levelSelected.getTerrainShape().addChild(_local2);
_local2.x = -(_local1.x);
_local2.y = -(_local1.y);
_local2.graphics.beginFill(0xFF0000, 20);
_local2.graphics.drawCircle((_local1.x + car.getHeadForBlood().x), (_local1.y + car.getHeadForBlood().y), 5);
_local2.graphics.endFill();
TweenMax.to(_local2, 0.65, {blurFilter:{blurX:15, blurY:15}});
TweenMax.to(_local2, 1.15, {alpha:0});
_local3 = 0;
while (_local3 < levelSelected.getTerrainShape().numChildren) {
if (levelSelected.getTerrainShape().getChildAt(_local3).alpha == 0){
levelSelected.getTerrainShape().removeChild(levelSelected.getTerrainShape().getChildAt(_local3));
};
_local3++;
};
};
};
};
}
private function level4Add(_arg1:int, _arg2:int){
var _local3:MainLevelButton = new MainLevelButton();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.addEventListener(MouseEvent.CLICK, getLevel4);
addChild(_local3);
levelStageArray.push(_local3);
}
private function startLevel3(){
removeLevelSelection();
this.y = 138.8;
var _local1:Level3 = new Level3(m_world);
addChild(_local1);
levelSelected = _local1;
currentLevel = 2;
setLevel();
}
private function startLevel4(){
removeLevelSelection();
this.y = 138.8;
var _local1:Level = new Level4(m_world);
addChild(_local1);
levelSelected = _local1;
currentLevel = 3;
setLevel();
}
private function startLevel5(){
removeLevelSelection();
this.y = 138.8;
var _local1:Level5 = new Level5(m_world);
addChild(_local1);
levelSelected = _local1;
currentLevel = 4;
setLevel();
}
private function level8Add(_arg1:int, _arg2:int){
var _local3:MainLevelButton = new MainLevelButton();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.addEventListener(MouseEvent.CLICK, getLevel8);
addChild(_local3);
levelStageArray.push(_local3);
}
private function testLevelEnd(){
var endLevel:Function;
var displayDethRiderScreen:Function;
if (endgame){
endLevel = function (_arg1:TimerEvent){
var endLevelScreen:WellDone;
var o:Object;
var boardID:String;
var checkSpaceBar:Function;
var e = _arg1;
var beginMatch:Function = function (){
if (local_data.data.cLevel == currentLevel){
currentLevel++;
};
if (local_data.data.cLevel < currentLevel){
local_data.data.cLevel = currentLevel;
};
removeChild(endLevelScreen);
removeChild(myGui);
car.stopSounds();
removeChild(car);
levelSelected.removeCurrentLevel();
levelSelected.removeHisChild();
levelSelectionInit();
myStage.removeEventListener(KeyboardEvent.KEY_DOWN, checkSpaceBar);
};
checkSpaceBar = function (_arg1:KeyboardEvent){
if (_arg1.keyCode == 13){
MochiScores.closeLeaderboard();
};
};
myTimer.stop();
myTimer.removeEventListener(TimerEvent.TIMER, endLevel);
endLevelScreen = new WellDone();
addChild(endLevelScreen);
endLevelScreen.x = myGui.x;
endLevelScreen.y = myGui.y;
myStage.addEventListener(KeyboardEvent.KEY_DOWN, checkSpaceBar);
var t:int = myGui.getActualScore();
switch (currentLevel){
case 0:
o = {n:[0, 14, 15, 6, 7, 7, 6, 13, 11, 3, 6, 8, 13, 15, 9, 11], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "6450b845beeaf6f7");
MochiScores.showLeaderboard({boardID:boardID, score:t, onClose:function ():void{
beginMatch();
}});
break;
case 1:
o = {n:[4, 8, 11, 4, 12, 10, 2, 0, 1, 1, 7, 10, 8, 10, 6, 10], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "0c50a38f2329554a");
MochiScores.showLeaderboard({boardID:boardID, score:t, onClose:function ():void{
beginMatch();
}});
break;
case 2:
o = {n:[4, 8, 11, 4, 12, 10, 2, 0, 1, 1, 7, 10, 8, 10, 6, 10], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "c2faf39a073812b1");
MochiScores.showLeaderboard({boardID:boardID, score:t, onClose:function ():void{
beginMatch();
}});
break;
case 3:
o = {n:[4, 8, 11, 4, 12, 10, 2, 0, 1, 1, 7, 10, 8, 10, 6, 10], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "9c7aa741b8655a2f");
MochiScores.showLeaderboard({boardID:boardID, score:t, onClose:function ():void{
beginMatch();
}});
break;
case 4:
o = {n:[4, 8, 11, 4, 12, 10, 2, 0, 1, 1, 7, 10, 8, 10, 6, 10], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "e6018d9229fb94f7");
MochiScores.showLeaderboard({boardID:boardID, score:t, onClose:function ():void{
beginMatch();
}});
break;
case 5:
o = {n:[4, 8, 11, 4, 12, 10, 2, 0, 1, 1, 7, 10, 8, 10, 6, 10], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "e31bea0106779bb6");
MochiScores.showLeaderboard({boardID:boardID, score:t, onClose:function ():void{
beginMatch();
}});
break;
case 6:
o = {n:[4, 8, 11, 4, 12, 10, 2, 0, 1, 1, 7, 10, 8, 10, 6, 10], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "e277e7ef47607388");
MochiScores.showLeaderboard({boardID:boardID, score:t, onClose:function ():void{
beginMatch();
}});
break;
default:
o = {n:[4, 8, 11, 4, 12, 10, 2, 0, 1, 1, 7, 10, 8, 10, 6, 10], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "e277e7ef47607388");
MochiScores.showLeaderboard({boardID:boardID, score:t, onClose:function ():void{
beginMatch();
}});
break;
};
removeLevel();
};
displayDethRiderScreen = function (_arg1:TimerEvent){
var endLevelScreen:TryAgain;
var checkSpaceBar:Function;
var e = _arg1;
checkSpaceBar = function (_arg1:KeyboardEvent){
if ((((_arg1.keyCode == 32)) || ((_arg1.keyCode == 13)))){
removeChild(endLevelScreen);
removeChild(myGui);
car.stopSounds();
removeChild(car);
removeChild(backgroundLevel);
levelSelected.removeCurrentLevel();
levelSelected.removeHisChild();
levelSelectionInit();
myStage.removeEventListener(KeyboardEvent.KEY_DOWN, checkSpaceBar);
};
};
riderDeathTimer.stop();
riderDeathTimer.removeEventListener(TimerEvent.TIMER, displayDethRiderScreen);
endLevelScreen = new TryAgain();
addChild(endLevelScreen);
endLevelScreen.x = myGui.x;
endLevelScreen.y = myGui.y;
removeLevel();
myStage.addEventListener(KeyboardEvent.KEY_DOWN, checkSpaceBar);
};
if (HitTest.complexHitTestObject(car.getCabinSprite(), levelSelected.getWarrayShape(), 1)){
if (blockTimer){
endgame = false;
myTimer.addEventListener(TimerEvent.TIMER, endLevel);
myTimer.start();
car.disableKeys();
stopTimer = false;
};
} else {
if (myGui.getActualScore() > 0){
drawBlood();
if (car.getRiderSprite()){
if (HitTest.complexHitTestObject(car.getRiderSprite(), levelSelected.getTerrainShape(), 0.1)){
if (onceCration){
riderDeathTimer.addEventListener(TimerEvent.TIMER, displayDethRiderScreen);
riderDeathTimer.start();
car.removeRider();
car.createFhisicRider();
onceCration = false;
blockTimer = false;
};
};
if (HitTest.complexHitTestObject(car.getRiderHead(), levelSelected.getTerrainShape(), 0.1)){
if (onceCration){
riderDeathTimer.addEventListener(TimerEvent.TIMER, displayDethRiderScreen);
riderDeathTimer.start();
car.removeRider();
car.createFhisicRider();
onceCration = false;
blockTimer = false;
};
};
};
if (car.getHeadAnimation1()){
if (HitTest.complexHitTestObject(car.getHeadAnimation1(), levelSelected.getTerrainShape(), 0.1)){
if (onceCration){
riderDeathTimer.addEventListener(TimerEvent.TIMER, displayDethRiderScreen);
riderDeathTimer.start();
car.removeRider();
car.createFhisicRider();
onceCration = false;
blockTimer = false;
};
};
if (HitTest.complexHitTestObject(car.getTorsoAnimation1(), levelSelected.getTerrainShape(), 0.1)){
if (onceCration){
riderDeathTimer.addEventListener(TimerEvent.TIMER, displayDethRiderScreen);
riderDeathTimer.start();
car.removeRider();
car.createFhisicRider();
onceCration = false;
blockTimer = false;
};
};
};
if (car.getHeadAnimation2()){
if (HitTest.complexHitTestObject(car.getHeadAnimation2(), levelSelected.getTerrainShape(), 0.1)){
if (onceCration){
riderDeathTimer.addEventListener(TimerEvent.TIMER, displayDethRiderScreen);
riderDeathTimer.start();
car.removeRider();
car.createFhisicRider();
onceCration = false;
blockTimer = false;
};
};
if (HitTest.complexHitTestObject(car.getTorsoAnimation2(), levelSelected.getTerrainShape(), 0.1)){
if (onceCration){
riderDeathTimer.addEventListener(TimerEvent.TIMER, displayDethRiderScreen);
riderDeathTimer.start();
car.removeRider();
car.createFhisicRider();
onceCration = false;
blockTimer = false;
};
};
};
};
};
};
}
private function level7Add(_arg1:int, _arg2:int){
var _local3:MainLevelButton = new MainLevelButton();
_local3.x = _arg1;
_local3.y = _arg2;
_local3.addEventListener(MouseEvent.CLICK, getLevel7);
addChild(_local3);
levelStageArray.push(_local3);
}
private function removeLevel(){
levelSelected.removeCurrentLevel();
desrtoyLevel();
removeEventListener(Event.ENTER_FRAME, actualizarPhisicGame);
super.updateLevel();
}
public function addMain(_arg1:Main){
main = _arg1;
}
public function setingUp(_arg1:Stage){
myStage = _arg1;
}
private function vajar_O_subir_en_el_menu(_arg1:KeyboardEvent){
if (_arg1.keyCode == 40){
if (menuCounter < 8){
menuCounter++;
} else {
menuCounter = 1;
};
};
if (_arg1.keyCode == 38){
if (menuCounter > 1){
menuCounter--;
} else {
menuCounter = 8;
};
};
if ((((_arg1.keyCode == 32)) || ((_arg1.keyCode == 13)))){
if ((levelStageArray[menuCounter] is MainLevelButton)){
switch (menuCounter){
case 1:
startLevel1();
break;
case 2:
startLevel2();
break;
case 3:
startLevel3();
break;
case 4:
startLevel8();
break;
case 5:
startLevel5();
break;
case 6:
startLevel6();
break;
case 7:
startLevel7();
break;
case 8:
startLevel4();
break;
};
};
};
TweenMax.to(selectedButton, 1, {x:levelStageArray[menuCounter].x, y:levelStageArray[menuCounter].y, ease:Cubic.easeOut});
this.stage.focus = null;
}
}
}//package Clases
Section 99
//LevelTransaction (Clases.LevelTransaction)
package Clases {
import flash.display.*;
import flash.events.*;
import gs.*;
import Display.*;
import gs.easing.*;
public class LevelTransaction extends Sprite {
public function levelSelection(_arg1:String, _arg2:Object){
var _local4:DisplayTextField;
var _local3:int;
while (_local3 < _arg1.length) {
_local4 = new DisplayTextField();
_local4.setTextStyle(new MyFont());
_local4.setSizeFont(_arg2.sizeFont);
_local4.setText(_arg1.charAt(_local3));
_local4.setW(35);
_local4.setH(50);
_local4.setXY((_arg2.x + (_local3 * 10)), _arg2.y);
addChild(_local4);
TweenMax.to(_local4, 0.8, {x:(_arg2.destino + (_local3 * 8)), delay:(_local3 * 0.1), ease:Cubic.easeOut});
_local3++;
};
}
public function levelSelectionY(_arg1:String, _arg2:Object){
var _local4:DisplayTextField;
var _local3:int;
while (_local3 < _arg1.length) {
_local4 = new DisplayTextField();
_local4.setTextStyle(new MyFont());
_local4.setSizeFont(_arg2.sizeFont);
_local4.setText(_arg1.charAt(_local3));
_local4.setW(35);
_local4.setH(50);
_local4.setXY((_arg2.x + (_local3 * 10)), _arg2.y);
addChild(_local4);
TweenMax.to(_local4, 0.8, {y:_arg2.destino, delay:(_local3 * 0.1), ease:Cubic.easeOut});
_local3++;
};
}
public function levelSpash(_arg1:String, _arg2:Object){
var counter:int;
var arrayOfLetters:Array;
var finalCounter:Function;
var dsp:DisplayTextField;
var strg = _arg1;
var vars = _arg2;
finalCounter = function (_arg1:Event){
var _local2:int;
counter--;
if (counter == 0){
removeEventListener(Event.ENTER_FRAME, finalCounter);
_local2 = 0;
while (_local2 < arrayOfLetters.length) {
TweenMax.to(arrayOfLetters[_local2], 2, {x:vars.desinoFinal, delay:(_local2 * 0.25), ease:Cubic.easeOut});
_local2++;
};
};
};
counter = 250;
arrayOfLetters = new Array();
var j:int;
while (j < strg.length) {
dsp = new DisplayTextField();
dsp.setTextStyle(new MyFont());
dsp.setSizeFont(vars.sizeFont);
dsp.setText(strg.charAt(j));
dsp.setW(35);
dsp.setH(50);
dsp.setXY((vars.x + (j * 10)), vars.y);
addChild(dsp);
arrayOfLetters.push(dsp);
TweenMax.to(dsp, 1.5, {x:(vars.destino + (j * 7)), delay:(j * 0.25), ease:Cubic.easeOut});
j = (j + 1);
};
addEventListener(Event.ENTER_FRAME, finalCounter);
}
}
}//package Clases
Section 100
//TryAgain (Clases.TryAgain)
package Clases {
import flash.display.*;
import gs.*;
import Display.*;
import gs.easing.*;
import Clases.MoreGames.*;
public class TryAgain extends Sprite {
public function TryAgain(){
var addFilter:Function;
super();
addFilter = function (){
var _local1:TimeOverSpaceBar = new TimeOverSpaceBar();
addChild(_local1);
_local1.alpha = 1;
_local1.y = 250;
_local1.x = 335;
TweenMax.to(_local1, 3, {alpha:1, ease:Cubic.easeOut});
var _local2:DisplayButton = new DisplayButton();
_local2.setingUp(new PlayMoreGames(), "easeOutSine");
_local2.setXY(335, 300);
addChild(_local2);
var _local3:DisplayButton = new DisplayButton();
_local3.setingUp(new FreeGamesForYouSite(), "easeOutSine");
_local3.setXY(335, 350);
addChild(_local3);
};
var tm:TryAgainShape = new TryAgainShape();
addChild(tm);
tm.y = -50;
tm.x = 335;
TweenMax.to(tm, 2, {y:125, ease:Cubic.easeOut, onComplete:addFilter});
}
}
}//package Clases
Section 101
//Warray (Clases.Warray)
package Clases {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import flash.display.*;
import flash.events.*;
import Box2D.Dynamics.Contacts.*;
public class Warray extends Sprite {
const k_bufferSize:int = 10;
var buffer:Array;
var m_w:b2World;
var aabb:b2AABB;
private var wara:WarrayBack;
public function Warray(){
wara = new WarrayBack();
buffer = [];
super();
}
private function testWarray(_arg1:Event){
var _local2:Number = m_w.Query(aabb, buffer, k_bufferSize);
var _local3:int;
while (_local3 < _local2) {
buffer[_local3].GetBody().m_linearDamping = 10;
buffer[_local3].GetBody().m_angularDamping = 10;
_local3++;
};
}
public function setingUp(_arg1:Number, _arg2:Number, _arg3:b2World){
this.alpha = 1;
wara.x = (_arg1 * 20);
wara.y = (_arg2 * 20);
addChild(wara);
addEventListener(Event.ENTER_FRAME, testWarray);
aabb = new b2AABB();
aabb.lowerBound.Set((_arg1 - 12), (_arg2 - 1));
aabb.upperBound.Set((_arg1 + 1), (_arg2 - 0.5));
buffer = [];
m_w = _arg3;
}
public function destroyWarray(){
removeEventListener(Event.ENTER_FRAME, testWarray);
}
}
}//package Clases
Section 102
//WellDone (Clases.WellDone)
package Clases {
import flash.display.*;
import gs.*;
import Display.*;
import gs.easing.*;
import Clases.MoreGames.*;
public class WellDone extends Sprite {
public function WellDone(){
var addFilter:Function;
super();
addFilter = function (){
var _local1:DisplayButton = new DisplayButton();
_local1.setingUp(new PlayMoreGames(), "easeOutSine");
_local1.setXY(110, 375);
addChild(_local1);
var _local2:DisplayButton = new DisplayButton();
_local2.setingUp(new FreeGamesForYouSite(), "easeOutSine");
_local2.setXY(530, 375);
addChild(_local2);
};
var tm:WhellDoneShape = new WhellDoneShape();
addChild(tm);
tm.y = 460;
tm.x = 345;
TweenMax.to(tm, 1.5, {y:375, ease:Cubic.easeOut, onComplete:addFilter});
}
}
}//package Clases
Section 103
//DisplayButton (Display.DisplayButton)
package Display {
import flash.display.*;
import flash.events.*;
import caurina.transitions.*;
public class DisplayButton extends MovieClip {
private var curveEfect:String;
private var myButton:SimpleButton;
private function restartEffect1(_arg1:MouseEvent){
Tweener.addTween(myButton, {scaleX:1, scaleY:1, time:1, transition:curveEfect});
}
public function getX():Number{
return (myButton.x);
}
public function getY():Number{
return (myButton.y);
}
public function setXY(_arg1:Number, _arg2:Number){
myButton.x = _arg1;
myButton.y = _arg2;
}
public function setingUp(_arg1:SimpleButton, _arg2:String){
myButton = _arg1;
addChild(myButton);
curveEfect = _arg2;
myButton.scaleX = 1;
myButton.scaleY = 1;
myButton.addEventListener(MouseEvent.MOUSE_OVER, startEffect1);
myButton.addEventListener(MouseEvent.MOUSE_OUT, restartEffect1);
}
private function startEffect1(_arg1:MouseEvent){
Tweener.addTween(myButton, {scaleX:1.3, scaleY:1.3, time:0.21, transition:curveEfect});
}
}
}//package Display
Section 104
//DisplayTextField (Display.DisplayTextField)
package Display {
import flash.display.*;
import flash.text.*;
public class DisplayTextField extends Sprite {
private var textStyle:TextFormat;
private var texto:TextField;
public function DisplayTextField(){
texto = new TextField();
textStyle = new TextFormat();
super();
texto.text = "Texto";
texto.x = 0;
texto.y = 0;
texto.width = 33;
texto.height = 18;
texto.selectable = false;
addChild(texto);
}
public function setColor(_arg1:Number){
textStyle.color = _arg1;
}
public function setSizeFont(_arg1:int){
textStyle.size = _arg1;
}
public function setW(_arg1:int){
texto.width = _arg1;
}
public function setH(_arg1:int){
texto.height = _arg1;
}
public function setXY(_arg1:Number, _arg2:Number){
texto.x = _arg1;
texto.y = _arg2;
}
public function setTextStyle(_arg1:Object){
textStyle.color = 0;
textStyle.font = _arg1.fontName;
textStyle.bold = true;
texto.setTextFormat(textStyle);
texto.embedFonts = true;
}
public function setText(_arg1:String){
texto.text = _arg1;
texto.setTextFormat(textStyle);
}
}
}//package Display
Section 105
//TimeUtil (Display.TimeUtil)
package Display {
public class TimeUtil {
public function formatTime(_arg1:Number):String{
var _local2:Number;
var _local3:Number = (_arg1 / (60 * 60));
_local2 = (_local3 - Math.floor(_local3));
_local3 = Math.floor(_local3);
var _local4:* = (_local2 * 60);
_local2 = (_local4 - Math.floor(_local4));
_local4 = Math.floor(_local4);
var _local5:* = (_local2 * 60);
_local2 = (_local5 - Math.floor(_local5));
_local5 = Math.floor(_local5);
var _local6:String = ((_local3 < 10)) ? ("0" + _local3) : ("" + _local3);
var _local7:String = ((_local4 < 10)) ? ("0" + _local4) : ("" + _local4);
var _local8:String = ((_local5 < 10)) ? ("0" + _local5) : ("" + _local5);
if ((((_arg1 < 0)) || (isNaN(_arg1)))){
return ("00:00");
};
if (_local3 > 0){
return (((((_local6 + ":") + _local7) + ":") + _local8));
};
return (((_local7 + ":") + _local8));
}
}
}//package Display
Section 106
//AdjustColor (fl.motion.AdjustColor)
package fl.motion {
public class AdjustColor {
private var m_brightnessMatrix:ColorMatrix;
private var m_saturationMatrix:ColorMatrix;
private var m_hueMatrix:ColorMatrix;
private var m_finalMatrix:ColorMatrix;
private var m_contrastMatrix:ColorMatrix;
private static var s_arrayOfDeltaIndex:Array = [0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.2, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.3, 0.32, 0.34, 0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68, 0.71, 0.74, 0.77, 0.8, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3, 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10];
private function CalculateFinalMatrix():Boolean{
if (!this.AllValuesAreSet()){
return (false);
};
this.m_finalMatrix = new ColorMatrix();
this.m_finalMatrix.Multiply(this.m_brightnessMatrix);
this.m_finalMatrix.Multiply(this.m_contrastMatrix);
this.m_finalMatrix.Multiply(this.m_saturationMatrix);
this.m_finalMatrix.Multiply(this.m_hueMatrix);
return (true);
}
public function set brightness(_arg1:Number):void{
if (this.m_brightnessMatrix == null){
this.m_brightnessMatrix = new ColorMatrix();
};
if (_arg1 != 0){
this.m_brightnessMatrix.SetBrightnessMatrix(_arg1);
};
}
public function set contrast(_arg1:Number):void{
var _local2:Number = _arg1;
if (_arg1 == 0){
_local2 = 127;
} else {
if (_arg1 > 0){
_local2 = ((s_arrayOfDeltaIndex[int(_arg1)] * 127) + 127);
} else {
_local2 = (((_arg1 / 100) * 127) + 127);
};
};
if (this.m_contrastMatrix == null){
this.m_contrastMatrix = new ColorMatrix();
};
this.m_contrastMatrix.SetContrastMatrix(_local2);
}
public function set hue(_arg1:Number):void{
if (this.m_hueMatrix == null){
this.m_hueMatrix = new ColorMatrix();
};
if (_arg1 != 0){
this.m_hueMatrix.SetHueMatrix(((_arg1 * Math.PI) / 180));
};
}
public function CalculateFinalFlatArray():Array{
if (this.CalculateFinalMatrix()){
return (this.m_finalMatrix.GetFlatArray());
};
return (null);
}
public function AllValuesAreSet():Boolean{
return (((((((this.m_brightnessMatrix) && (this.m_contrastMatrix))) && (this.m_saturationMatrix))) && (this.m_hueMatrix)));
}
public function set saturation(_arg1:Number):void{
var _local2:Number = _arg1;
if (_arg1 == 0){
_local2 = 1;
} else {
if (_arg1 > 0){
_local2 = (1 + ((3 * _arg1) / 100));
} else {
_local2 = ((_arg1 / 100) + 1);
};
};
if (this.m_saturationMatrix == null){
this.m_saturationMatrix = new ColorMatrix();
};
this.m_saturationMatrix.SetSaturationMatrix(_local2);
}
}
}//package fl.motion
Section 107
//Animator (fl.motion.Animator)
package fl.motion {
import flash.geom.*;
import flash.display.*;
public class Animator extends AnimatorBase {
public function Animator(_arg1:XML=null, _arg2:DisplayObject=null){
this.motion = new Motion(_arg1);
super(_arg1, _arg2);
}
override protected function setTimeClassic(_arg1:int, _arg2:MotionBase, _arg3:KeyframeBase):Boolean{
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Matrix;
var _local21:Number;
var _local4:Motion = (_arg2 as Motion);
if (!_local4){
return (false);
};
var _local5:Number = _local4.getValue(_arg1, Tweenables.X);
var _local6:Number = _local4.getValue(_arg1, Tweenables.Y);
var _local7:Point = new Point(_local5, _local6);
if (this.positionMatrix){
_local7 = this.positionMatrix.transformPoint(_local7);
};
_local7.x = (_local7.x + this.targetState.x);
_local7.y = (_local7.y + this.targetState.y);
var _local8:Number = (_local4.getValue(_arg1, Tweenables.SCALE_X) * this.targetState.scaleX);
var _local9:Number = (_local4.getValue(_arg1, Tweenables.SCALE_Y) * this.targetState.scaleY);
var _local10:Number = 0;
var _local11:Number = 0;
if (this.orientToPath){
_local17 = _local4.getValue((_arg1 + 1), Tweenables.X);
_local18 = _local4.getValue((_arg1 + 1), Tweenables.Y);
_local19 = (Math.atan2((_local18 - _local6), (_local17 - _local5)) * (180 / Math.PI));
if (!isNaN(_local19)){
_local10 = (_local19 + this.targetState.skewX);
_local11 = (_local19 + this.targetState.skewY);
};
} else {
_local10 = (_local4.getValue(_arg1, Tweenables.SKEW_X) + this.targetState.skewX);
_local11 = (_local4.getValue(_arg1, Tweenables.SKEW_Y) + this.targetState.skewY);
};
var _local12:Matrix = new Matrix((_local8 * Math.cos((_local11 * (Math.PI / 180)))), (_local8 * Math.sin((_local11 * (Math.PI / 180)))), (-(_local9) * Math.sin((_local10 * (Math.PI / 180)))), (_local9 * Math.cos((_local10 * (Math.PI / 180)))), 0, 0);
var _local13:Boolean;
if (_local4.useRotationConcat(_arg1)){
_local20 = new Matrix();
_local21 = _local4.getValue(_arg1, Tweenables.ROTATION_CONCAT);
_local20.rotate(_local21);
_local12.concat(_local20);
_local13 = true;
};
_local12.tx = _local7.x;
_local12.ty = _local7.y;
var _local14:Point = _local12.transformPoint(this.targetState.transformPointInternal);
var _local15:Number = (_local12.tx - _local14.x);
var _local16:Number = (_local12.ty - _local14.y);
_local12.tx = (_local12.tx + _local15);
_local12.ty = (_local12.ty + _local16);
if (!_local13){
this._target.rotation = _local11;
};
this._target.transform.matrix = _local12;
if (((((_local13) && ((this._target.scaleX == 0)))) && ((this._target.scaleY == 0)))){
this._target.scaleX = _local8;
this._target.scaleY = _local9;
};
this._target.cacheAsBitmap = _arg3.cacheAsBitmap;
return (true);
}
override public function set motion(_arg1:MotionBase):void{
super.motion = _arg1;
var _local2:Motion = (_arg1 as Motion);
if (((((_local2) && (_local2.source))) && (_local2.source.transformationPoint))){
this.transformationPoint = _local2.source.transformationPoint.clone();
};
}
override protected function setTargetState():void{
var _local2:Number;
var _local3:Number;
var _local4:Point;
this.targetState.scaleX = this._target.scaleX;
this.targetState.scaleY = this._target.scaleY;
this.targetState.skewX = MatrixTransformer.getSkewX(this._target.transform.matrix);
this.targetState.skewY = MatrixTransformer.getSkewY(this._target.transform.matrix);
var _local1:Object = (this.targetState.bounds = this._target.getBounds(this._target));
if (this.transformationPoint){
_local2 = ((this.transformationPoint.x * _local1.width) + _local1.left);
_local3 = ((this.transformationPoint.y * _local1.height) + _local1.top);
this.targetState.transformPointInternal = new Point(_local2, _local3);
_local4 = this._target.transform.matrix.transformPoint(this.targetState.transformPointInternal);
this.targetState.x = _local4.x;
this.targetState.y = _local4.y;
} else {
this.targetState.transformPointInternal = new Point(0, 0);
this.targetState.x = this._target.x;
this.targetState.y = this._target.y;
};
this.targetState.z = 0;
this.targetState.rotationX = (this.targetState.rotationY = 0);
}
public static function fromXMLString(_arg1:String, _arg2:DisplayObject=null):Animator{
return (new Animator(new XML(_arg1), _arg2));
}
}
}//package fl.motion
Section 108
//AnimatorBase (fl.motion.AnimatorBase)
package fl.motion {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class AnimatorBase extends EventDispatcher {
public var transformationPoint:Point;
protected var targetState:Object;
private var _isPlaying:Boolean;// = false
private var _time:int;// = -1
protected var _target:DisplayObject;
public var repeatCount:int;// = 1
private var _lastRenderedTime:int;// = -1
private var _spanStart:int;// = -1
public var transformationPointZ:int;
protected var _isAnimator3D:Boolean;
private var _sceneName:String;// = ""
public var positionMatrix:Matrix;
private var _frameEvent:String;// = "enterFrame"
public var autoRewind:Boolean;// = false
private var _motion:MotionBase;
private var _targetName:String;// = ""
private var _useCurrentFrame:Boolean;// = false
private var playCount:int;// = 0
public var orientToPath:Boolean;// = false
private var targetStateOriginal:Object;// = null
private var _targetState3D:Array;// = null
private var _targetParent:DisplayObjectContainer;// = null
private static var _registeredParents:Dictionary = new Dictionary(true);
private static var enterFrameBeacon:MovieClip = new MovieClip();
public function AnimatorBase(_arg1:XML=null, _arg2:DisplayObject=null){
this.target = _arg2;
this._isAnimator3D = false;
this.transformationPoint = new Point(0.5, 0.5);
this.transformationPointZ = 0;
this._sceneName = "";
}
protected function setTime3D(_arg1:int, _arg2:MotionBase):Boolean{
return (false);
}
private function handleLastFrame(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.playCount++;
if ((((this.repeatCount == 0)) || ((this.playCount < this.repeatCount)))){
this.rewind();
} else {
this.end(_arg1, _arg2);
};
}
public function get targetState3D():Array{
return (this._targetState3D);
}
public function get target():DisplayObject{
return (this._target);
}
private function get enterFrameHandler():Function{
if (AnimatorBase.hasRegisteredParents){
return (AnimatorBase.parentEnterFrameHandler);
};
return (this.handleEnterFrame);
}
public function get usingCurrentFrame():Boolean{
return (this._useCurrentFrame);
}
public function set initialPosition(_arg1:Array):void{
}
public function useCurrentFrame(_arg1:Boolean, _arg2:int):void{
this._useCurrentFrame = _arg1;
this._spanStart = _arg2;
}
public function set time(_arg1:int):void{
var _local5:ColorTransform;
var _local6:Array;
if (_arg1 == this._time){
return;
};
var _local2:MotionBase = this.motion;
if (_arg1 > (_local2.duration - 1)){
_arg1 = (_local2.duration - 1);
} else {
if (_arg1 < 0){
_arg1 = 0;
};
};
this._time = _arg1;
this.dispatchEvent(new MotionEvent(MotionEvent.TIME_CHANGE));
var _local3:KeyframeBase = _local2.getCurrentKeyframe(_arg1);
var _local4:Boolean = (((_local3.index == this._lastRenderedTime)) && (!(_local3.tweensLength)));
if (_local4){
return;
};
this._target.visible = false;
if (!_local3.blank){
if (this._isAnimator3D){
this.setTime3D(_arg1, _local2);
} else {
this.setTimeClassic(_arg1, _local2, _local3);
};
_local5 = _local2.getColorTransform(_arg1);
if (_local5){
this._target.transform.colorTransform = _local5;
};
_local6 = _local2.getFilters(_arg1);
if (_local6){
this._target.filters = _local6;
};
this._target.blendMode = _local3.blendMode;
this._target.visible = true;
};
this._lastRenderedTime = this._time;
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_UPDATE));
}
public function set target(_arg1:DisplayObject):void{
if (!_arg1){
return;
};
this._target = _arg1;
var _local2:Boolean;
if (((this.targetParent) && (!((this.targetName == ""))))){
if (this.targetStateOriginal){
this.targetState = this.targetStateOriginal;
return;
};
_local2 = true;
};
this.targetState = {};
this.setTargetState();
if (_local2){
this.targetStateOriginal = this.targetState;
};
}
public function get isPlaying():Boolean{
return (this._isPlaying);
}
public function startFrameEvents():void{
enterFrameBeacon.addEventListener(this.frameEvent, this.enterFrameHandler, false, 0, true);
}
public function get frameEvent():String{
return (this._frameEvent);
}
public function stop():void{
enterFrameBeacon.removeEventListener(this.frameEvent, this.enterFrameHandler);
this._isPlaying = false;
this.playCount = 0;
this.rewind();
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_END));
}
public function get spanEnd():int{
if (((this._motion) && ((this._motion.duration > 0)))){
return (((this._spanStart + this._motion.duration) - 1));
};
return (this._spanStart);
}
public function get targetParent():DisplayObjectContainer{
return (this._targetParent);
}
public function get spanStart():int{
return (this._spanStart);
}
public function play(_arg1:int=-1, _arg2:Boolean=true):void{
if (!this._isPlaying){
if ((((((this._target == null)) && (this._targetParent))) && (!((this._targetName == ""))))){
this.target = this._targetParent[this._targetName];
if (!this.target){
this.target = this._targetParent.getChildByName(this._targetName);
};
};
if (_arg2){
enterFrameBeacon.addEventListener(this.frameEvent, this.enterFrameHandler, false, 0, true);
};
if (!this.target){
return;
};
this._isPlaying = true;
};
this.playCount = 0;
if (_arg1 > -1){
this.time = _arg1;
} else {
this.rewind();
};
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_START));
}
public function get targetName():String{
return (this._targetName);
}
public function set targetParent(_arg1:DisplayObjectContainer):void{
this._targetParent = _arg1;
}
protected function setTargetState():void{
}
protected function setTimeClassic(_arg1:int, _arg2:MotionBase, _arg3:KeyframeBase):Boolean{
return (false);
}
private function handleEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get motion():MotionBase{
return (this._motion);
}
public function get sceneName():String{
return (this._sceneName);
}
public function nextFrame():void{
if (this.time >= (this.motion.duration - 1)){
this.handleLastFrame();
} else {
this.time++;
};
}
public function get time():int{
return (this._time);
}
public function resume():void{
enterFrameBeacon.addEventListener(this.frameEvent, this.enterFrameHandler, false, 0, true);
this._isPlaying = true;
}
public function rewind():void{
this.time = 0;
}
public function set frameEvent(_arg1:String):void{
this._frameEvent = _arg1;
}
public function set targetState3D(_arg1:Array):void{
this._targetState3D = _arg1;
}
public function end(_arg1:Boolean=false, _arg2:Boolean=true):void{
if (_arg2){
enterFrameBeacon.removeEventListener(this.frameEvent, this.enterFrameHandler);
};
this._isPlaying = false;
this.playCount = 0;
if (this.autoRewind){
this.rewind();
} else {
if (this.time != (this.motion.duration - 1)){
this.time = (this.motion.duration - 1);
};
};
if (_arg1){
if (((this._targetParent) && (!((this._targetName == ""))))){
this._target = null;
};
this._lastRenderedTime = -1;
this._time = -1;
};
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_END));
}
public function set motion(_arg1:MotionBase):void{
this._motion = _arg1;
}
public function set sceneName(_arg1:String):void{
this._sceneName = _arg1;
}
public function pause():void{
enterFrameBeacon.removeEventListener(this.frameEvent, this.enterFrameHandler);
this._isPlaying = false;
}
public function set targetName(_arg1:String):void{
this._targetName = _arg1;
}
public static function processCurrentFrame(_arg1:MovieClip, _arg2:AnimatorBase, _arg3:Boolean, _arg4:Boolean=false):void{
var _local5:int;
var _local6:int;
if (((_arg2) && (_arg1))){
if (!_arg1.root){
if (((((_arg2.usingCurrentFrame) && (!(_arg2.isPlaying)))) && (_arg4))){
_arg2.startFrameEvents();
};
return;
};
if (_arg2.usingCurrentFrame){
_local5 = (_arg1.currentFrame - 1);
if (_arg1.scenes.length > 1){
if (_arg1.currentScene.name != _arg2.sceneName){
_local5 = -1;
};
};
if ((((_local5 >= _arg2.spanStart)) && ((_local5 <= _arg2.spanEnd)))){
_local6 = (_local5 - _arg2.spanStart);
if (!_arg2.isPlaying){
_arg2.play(_local6, _arg3);
} else {
if (!_arg4){
if (_local5 == _arg2.spanEnd){
_arg2.handleLastFrame(true, false);
} else {
_arg2.time = _local6;
};
};
};
} else {
if (((_arg2.isPlaying) && (!(_arg4)))){
_arg2.end(true, false);
} else {
if (((!(_arg2.isPlaying)) && (_arg4))){
_arg2.startFrameEvents();
};
};
};
} else {
if (((((_arg2.targetParent) && ((_arg2.targetParent[_arg2.targetName] == null)))) && ((_arg2.targetParent.getChildByName(_arg2.targetName) == null)))){
if (_arg2.isPlaying){
_arg2.end(true, false);
} else {
if (_arg4){
_arg2.startFrameEvents();
};
};
} else {
if (!_arg2.isPlaying){
_arg2.play(0, _arg3);
} else {
if (!_arg4){
_arg2.nextFrame();
};
};
};
};
};
}
public static function registerParentFrameHandler(_arg1:MovieClip, _arg2:AnimatorBase, _arg3:int, _arg4:int=0, _arg5:Boolean=false):void{
var _local6:AnimatorParent = (_registeredParents[_arg1] as AnimatorParent);
if (_local6 == null){
_local6 = new AnimatorParent();
_local6.parent = _arg1;
_registeredParents[_arg1] = _local6;
};
if (_arg3 == -1){
_arg3 = (_arg1.currentFrame - 1);
};
if (_arg5){
_arg2.useCurrentFrame(true, _arg3);
} else {
_arg2.repeatCount = _arg4;
};
_local6.animators.push(_arg2);
}
private static function parentEnterFrameHandler(_arg1:Event):void{
var _local2:*;
var _local3:AnimatorParent;
var _local4:MovieClip;
var _local5:Array;
var _local6:int;
var _local7:AnimatorBase;
for (_local2 in _registeredParents) {
_local3 = (_registeredParents[_local2] as AnimatorParent);
if (!_local3){
} else {
_local4 = _local3.parent;
_local5 = _local3.animators;
if (((!(_local4)) || (!(_local5)))){
} else {
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = (_local5[_local6] as AnimatorBase);
if (((!(_local7.usingCurrentFrame)) || (!((_local4.currentFrame == _local3.lastFrameHandled))))){
processCurrentFrame(_local4, _local7, false);
};
_local6++;
};
_local3.lastFrameHandled = _local4.currentFrame;
};
};
};
}
public static function registerButtonState(_arg1:SimpleButton, _arg2:AnimatorBase, _arg3:int):void{
var _local4:DisplayObject = _arg1.upState;
switch (_arg3){
case 1:
_local4 = _arg1.overState;
break;
case 2:
_local4 = _arg1.downState;
break;
case 3:
_local4 = _arg1.hitTestState;
break;
};
if (!_local4){
return;
};
_arg2.target = _local4;
_arg2.time = 0;
}
private static function get hasRegisteredParents():Boolean{
var _local1:*;
for (_local1 in _registeredParents) {
return (true);
};
return (false);
}
}
}//package fl.motion
import flash.display.*;
class AnimatorParent {
public var parent:MovieClip;// = null
public var lastFrameHandled:int;// = -1
public var animators:Array;
private function AnimatorParent(){
this.animators = new Array();
super();
}
}
Section 109
//AnimatorFactory (fl.motion.AnimatorFactory)
package fl.motion {
public class AnimatorFactory extends AnimatorFactoryBase {
public function AnimatorFactory(_arg1:MotionBase){
super(_arg1);
}
override protected function getNewAnimator():AnimatorBase{
return (new Animator(null, null));
}
}
}//package fl.motion
Section 110
//AnimatorFactoryBase (fl.motion.AnimatorFactoryBase)
package fl.motion {
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class AnimatorFactoryBase {
protected var _transformationPoint:Point;
private var _animators:Dictionary;
protected var _transformationPointZ:int;
private var _motion:MotionBase;
protected var _sceneName:String;
protected var _is3D:Boolean;
public function AnimatorFactoryBase(_arg1:MotionBase){
this._motion = _arg1;
this._animators = new Dictionary();
this._transformationPoint = new Point(0.5, 0.5);
this._transformationPointZ = 0;
this._is3D = false;
this._sceneName = "";
}
public function addTargetInfo(_arg1:DisplayObject, _arg2:String, _arg3:int=0, _arg4:Boolean=true, _arg5:int=-1, _arg6:Boolean=false, _arg7:Array=null):AnimatorBase{
var _local11:Class;
if (((!((_arg1 is DisplayObjectContainer))) && (!((_arg1 is SimpleButton))))){
return (null);
};
var _local8:Dictionary = this._animators[_arg1];
if (!_local8){
_local8 = new Dictionary();
this._animators[_arg1] = _local8;
};
var _local9:AnimatorBase = _local8[_arg2];
var _local10:Boolean;
if (!_local9){
_local9 = this.getNewAnimator();
_local11 = (getDefinitionByName("flash.events.Event") as Class);
if (_local11.hasOwnProperty("FRAME_CONSTRUCTED")){
_local9.frameEvent = "frameConstructed";
};
_local8[_arg2] = _local9;
_local10 = true;
};
_local9.motion = this._motion;
_local9.transformationPoint = this._transformationPoint;
_local9.transformationPointZ = this._transformationPointZ;
_local9.sceneName = this._sceneName;
if (_local10){
if ((_arg1 is MovieClip)){
AnimatorBase.registerParentFrameHandler((_arg1 as MovieClip), _local9, _arg5, _arg3, _arg6);
};
};
if ((_arg1 is MovieClip)){
_local9.targetParent = MovieClip(_arg1);
_local9.targetName = _arg2;
} else {
if ((_arg1 is SimpleButton)){
AnimatorBase.registerButtonState((_arg1 as SimpleButton), _local9, _arg5);
};
};
if (_arg7){
_local9.initialPosition = _arg7;
};
if (_arg4){
AnimatorBase.processCurrentFrame((_arg1 as MovieClip), _local9, true, true);
};
return (_local9);
}
public function set transformationPointZ(_arg1:int):void{
this._transformationPointZ = _arg1;
}
public function set transformationPoint(_arg1:Point):void{
this._transformationPoint = _arg1;
}
protected function getNewAnimator():AnimatorBase{
return (null);
}
public function get motion():MotionBase{
return (this._motion);
}
public function addTarget(_arg1:DisplayObject, _arg2:int=0, _arg3:Boolean=true, _arg4:int=-1, _arg5:Boolean=false):AnimatorBase{
if (_arg1){
return (this.addTargetInfo(_arg1.parent, _arg1.name, _arg2, _arg3, _arg4, _arg5));
};
return (null);
}
public function set sceneName(_arg1:String):void{
this._sceneName = _arg1;
}
}
}//package fl.motion
Section 111
//BezierEase (fl.motion.BezierEase)
package fl.motion {
import flash.geom.*;
public class BezierEase implements ITween {
public var points:Array;
private var firstNode:Point;
private var _target:String;// = ""
private var lastNode:Point;
public function BezierEase(_arg1:XML=null){
this.points = [];
this.parseXML(_arg1);
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
private function parseXML(_arg1:XML=null):BezierEase{
var _local3:XML;
if (!_arg1){
return (this);
};
if (_arg1.@target.length()){
this.target = _arg1.@target;
};
var _local2:XMLList = _arg1.elements();
for each (_local3 in _local2) {
this.points.push(new Point(Number(_local3.@x), Number(_local3.@y)));
};
return (this);
}
public function get target():String{
return (this._target);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg4 <= 0){
return (NaN);
};
var _local5:Number = (_arg1 / _arg4);
if (_local5 <= 0){
return (_arg2);
};
if (_local5 >= 1){
return ((_arg2 + _arg3));
};
this.firstNode = new Point(0, _arg2);
this.lastNode = new Point(1, (_arg2 + _arg3));
var _local6:Array = [this.firstNode].concat(this.points);
_local6.push(this.lastNode);
var _local7:Number = CustomEase.getYForPercent(_local5, _local6);
return (_local7);
}
}
}//package fl.motion
Section 112
//BezierSegment (fl.motion.BezierSegment)
package fl.motion {
import flash.geom.*;
public class BezierSegment {
public var a:Point;
public var c:Point;
public var b:Point;
public var d:Point;
public function BezierSegment(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point){
this.a = _arg1;
this.b = _arg2;
this.c = _arg3;
this.d = _arg4;
}
public function getValue(_arg1:Number):Point{
var _local2:Number = this.a.x;
var _local3:Number = (((((_arg1 * _arg1) * (this.d.x - _local2)) + ((3 * (1 - _arg1)) * ((_arg1 * (this.c.x - _local2)) + ((1 - _arg1) * (this.b.x - _local2))))) * _arg1) + _local2);
var _local4:Number = this.a.y;
var _local5:Number = (((((_arg1 * _arg1) * (this.d.y - _local4)) + ((3 * (1 - _arg1)) * ((_arg1 * (this.c.y - _local4)) + ((1 - _arg1) * (this.b.y - _local4))))) * _arg1) + _local4);
return (new Point(_local3, _local5));
}
public function getYForX(_arg1:Number, _arg2:Array=null):Number{
var _local6:Number;
if (this.a.x < this.d.x){
if (_arg1 <= (this.a.x + 1E-16)){
return (this.a.y);
};
if (_arg1 >= (this.d.x - 1E-16)){
return (this.d.y);
};
} else {
if (_arg1 >= (this.a.x + 1E-16)){
return (this.a.y);
};
if (_arg1 <= (this.d.x - 1E-16)){
return (this.d.y);
};
};
if (!_arg2){
_arg2 = getCubicCoefficients(this.a.x, this.b.x, this.c.x, this.d.x);
};
var _local3:Array = getCubicRoots(_arg2[0], _arg2[1], _arg2[2], (_arg2[3] - _arg1));
var _local4:Number = NaN;
if (_local3.length == 0){
_local4 = 0;
} else {
if (_local3.length == 1){
_local4 = _local3[0];
} else {
for each (_local6 in _local3) {
if ((((0 <= _local6)) && ((_local6 <= 1)))){
_local4 = _local6;
break;
};
};
};
};
if (isNaN(_local4)){
return (NaN);
};
var _local5:Number = getSingleValue(_local4, this.a.y, this.b.y, this.c.y, this.d.y);
return (_local5);
}
public static function getCubicCoefficients(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Array{
return ([(((-(_arg1) + (3 * _arg2)) - (3 * _arg3)) + _arg4), (((3 * _arg1) - (6 * _arg2)) + (3 * _arg3)), ((-3 * _arg1) + (3 * _arg2)), _arg1]);
}
public static function getSingleValue(_arg1:Number, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return ((((((_arg1 * _arg1) * (_arg5 - _arg2)) + ((3 * (1 - _arg1)) * ((_arg1 * (_arg4 - _arg2)) + ((1 - _arg1) * (_arg3 - _arg2))))) * _arg1) + _arg2));
}
public static function getCubicRoots(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):Array{
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:int;
var _local16:Number;
if (!_arg1){
return (BezierSegment.getQuadraticRoots(_arg2, _arg3, _arg4));
};
if (_arg1 != 1){
_arg2 = (_arg2 / _arg1);
_arg3 = (_arg3 / _arg1);
_arg4 = (_arg4 / _arg1);
};
var _local5:Number = (((_arg2 * _arg2) - (3 * _arg3)) / 9);
var _local6:Number = (((((_arg2 * _arg2) - (3 * _arg3)) / 9) * _local5) * _local5);
var _local7:Number = ((((((2 * _arg2) * _arg2) * _arg2) - ((9 * _arg2) * _arg3)) + (27 * _arg4)) / 54);
var _local8:Number = (_local6 - (_local7 * _local7));
if (_local8 >= 0){
if (!_local5){
return ([0]);
};
_local9 = Math.acos((_local7 / Math.sqrt(_local6)));
_local10 = Math.sqrt(_local5);
_local11 = (((-2 * _local10) * Math.cos((_local9 / 3))) - (_arg2 / 3));
_local12 = (((-2 * _local10) * Math.cos(((_local9 + (2 * Math.PI)) / 3))) - (_arg2 / 3));
_local13 = (((-2 * _local10) * Math.cos(((_local9 + (4 * Math.PI)) / 3))) - (_arg2 / 3));
return ([_local11, _local12, _local13]);
//unresolved jump
};
_local14 = Math.pow((Math.sqrt(-(_local8)) + Math.abs(_local7)), (1 / 3));
_local15 = ((_local7)>0) ? 1 : ((_local7 < 0)) ? -1 : 0;
_local16 = ((-(_local15) * (_local14 + (_local5 / _local14))) - (_arg2 / 3));
return ([_local16]);
}
public static function getQuadraticRoots(_arg1:Number, _arg2:Number, _arg3:Number):Array{
var _local7:Number;
var _local4:Array = [];
if (!_arg1){
if (!_arg2){
return ([]);
};
_local4[0] = (-(_arg3) / _arg2);
return (_local4);
};
var _local5:Number = ((_arg2 * _arg2) - ((4 * _arg1) * _arg3));
var _local6:int = ((_local5)>0) ? 1 : ((_local5 < 0)) ? -1 : 0;
if (_local6 < 0){
return ([]);
};
if (!_local6){
_local4[0] = (-(_arg2) / (2 * _arg1));
} else {
_local4[0] = (_local4[1] = (-(_arg2) / (2 * _arg1)));
_local7 = (Math.sqrt(_local5) / (2 * _arg1));
_local4[0] = (_local4[0] - _local7);
_local4[1] = (_local4[1] + _local7);
};
return (_local4);
}
}
}//package fl.motion
Section 113
//Color (fl.motion.Color)
package fl.motion {
import flash.geom.*;
import flash.display.*;
public class Color extends ColorTransform {
private var _tintColor:Number;// = 0
private var _tintMultiplier:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
private function deriveTintColor():uint{
var _local1:Number = (1 / this.tintMultiplier);
var _local2:uint = Math.round((this.redOffset * _local1));
var _local3:uint = Math.round((this.greenOffset * _local1));
var _local4:uint = Math.round((this.blueOffset * _local1));
var _local5:uint = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function set brightness(_arg1:Number):void{
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
var _local2:Number = (1 - Math.abs(_arg1));
var _local3:Number = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
private function parseXML(_arg1:XML=null):Color{
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
var _local2:XML = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function setTint(_arg1:uint, _arg2:Number):void{
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
var _local3:uint = ((_arg1 >> 16) & 0xFF);
var _local4:uint = ((_arg1 >> 8) & 0xFF);
var _local5:uint = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = (1 - _arg3);
var _local5:uint = ((_arg1 >> 24) & 0xFF);
var _local6:uint = ((_arg1 >> 16) & 0xFF);
var _local7:uint = ((_arg1 >> 8) & 0xFF);
var _local8:uint = (_arg1 & 0xFF);
var _local9:uint = ((_arg2 >> 24) & 0xFF);
var _local10:uint = ((_arg2 >> 16) & 0xFF);
var _local11:uint = ((_arg2 >> 8) & 0xFF);
var _local12:uint = (_arg2 & 0xFF);
var _local13:uint = ((_local5 * _local4) + (_local9 * _arg3));
var _local14:uint = ((_local6 * _local4) + (_local10 * _arg3));
var _local15:uint = ((_local7 * _local4) + (_local11 * _arg3));
var _local16:uint = ((_local8 * _local4) + (_local12 * _arg3));
var _local17:uint = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number = (1 - _arg3);
var _local5:ColorTransform = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 114
//ColorMatrix (fl.motion.ColorMatrix)
package fl.motion {
public class ColorMatrix extends DynamicMatrix {
protected static const LUMINANCEB:Number = 0.082;
protected static const LUMINANCER:Number = 0.3086;
protected static const LUMINANCEG:Number = 0.6094;
public function ColorMatrix(){
super(5, 5);
LoadIdentity();
}
public function GetFlatArray():Array{
var _local4:int;
if (!m_matrix){
return (null);
};
var _local1:Array = new Array();
var _local2:int;
var _local3:int;
while (_local3 < 4) {
_local4 = 0;
while (_local4 < 5) {
_local1[_local2] = m_matrix[_local3][_local4];
_local2++;
_local4++;
};
_local3++;
};
return (_local1);
}
public function SetBrightnessMatrix(_arg1:Number):void{
if (!m_matrix){
return;
};
m_matrix[0][4] = _arg1;
m_matrix[1][4] = _arg1;
m_matrix[2][4] = _arg1;
}
public function SetContrastMatrix(_arg1:Number):void{
if (!m_matrix){
return;
};
var _local2:Number = (0.5 * (127 - _arg1));
_arg1 = (_arg1 / 127);
m_matrix[0][0] = _arg1;
m_matrix[1][1] = _arg1;
m_matrix[2][2] = _arg1;
m_matrix[0][4] = _local2;
m_matrix[1][4] = _local2;
m_matrix[2][4] = _local2;
}
public function SetHueMatrix(_arg1:Number):void{
var _local11:int;
if (!m_matrix){
return;
};
LoadIdentity();
var _local2:DynamicMatrix = new DynamicMatrix(3, 3);
var _local3:DynamicMatrix = new DynamicMatrix(3, 3);
var _local4:DynamicMatrix = new DynamicMatrix(3, 3);
var _local5:Number = Math.cos(_arg1);
var _local6:Number = Math.sin(_arg1);
var _local7:Number = 0.213;
var _local8:Number = 0.715;
var _local9:Number = 0.072;
_local2.SetValue(0, 0, _local7);
_local2.SetValue(1, 0, _local7);
_local2.SetValue(2, 0, _local7);
_local2.SetValue(0, 1, _local8);
_local2.SetValue(1, 1, _local8);
_local2.SetValue(2, 1, _local8);
_local2.SetValue(0, 2, _local9);
_local2.SetValue(1, 2, _local9);
_local2.SetValue(2, 2, _local9);
_local3.SetValue(0, 0, (1 - _local7));
_local3.SetValue(1, 0, -(_local7));
_local3.SetValue(2, 0, -(_local7));
_local3.SetValue(0, 1, -(_local8));
_local3.SetValue(1, 1, (1 - _local8));
_local3.SetValue(2, 1, -(_local8));
_local3.SetValue(0, 2, -(_local9));
_local3.SetValue(1, 2, -(_local9));
_local3.SetValue(2, 2, (1 - _local9));
_local3.MultiplyNumber(_local5);
_local4.SetValue(0, 0, -(_local7));
_local4.SetValue(1, 0, 0.143);
_local4.SetValue(2, 0, -((1 - _local7)));
_local4.SetValue(0, 1, -(_local8));
_local4.SetValue(1, 1, 0.14);
_local4.SetValue(2, 1, _local8);
_local4.SetValue(0, 2, (1 - _local9));
_local4.SetValue(1, 2, -0.283);
_local4.SetValue(2, 2, _local9);
_local4.MultiplyNumber(_local6);
_local2.Add(_local3);
_local2.Add(_local4);
var _local10:int;
while (_local10 < 3) {
_local11 = 0;
while (_local11 < 3) {
m_matrix[_local10][_local11] = _local2.GetValue(_local10, _local11);
_local11++;
};
_local10++;
};
}
public function SetSaturationMatrix(_arg1:Number):void{
if (!m_matrix){
return;
};
var _local2:Number = (1 - _arg1);
var _local3:Number = (_local2 * LUMINANCER);
m_matrix[0][0] = (_local3 + _arg1);
m_matrix[1][0] = _local3;
m_matrix[2][0] = _local3;
_local3 = (_local2 * LUMINANCEG);
m_matrix[0][1] = _local3;
m_matrix[1][1] = (_local3 + _arg1);
m_matrix[2][1] = _local3;
_local3 = (_local2 * LUMINANCEB);
m_matrix[0][2] = _local3;
m_matrix[1][2] = _local3;
m_matrix[2][2] = (_local3 + _arg1);
}
}
}//package fl.motion
class XFormData {
public var ox:Number;
public var oy:Number;
public var oz:Number;
private function XFormData(){
}
}
Section 115
//CustomEase (fl.motion.CustomEase)
package fl.motion {
import flash.geom.*;
public class CustomEase implements ITween {
public var points:Array;
private var firstNode:Point;
private var _target:String;// = ""
private var lastNode:Point;
public function CustomEase(_arg1:XML=null){
this.points = [];
this.parseXML(_arg1);
this.firstNode = new Point(0, 0);
this.lastNode = new Point(1, 1);
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
private function parseXML(_arg1:XML=null):CustomEase{
var _local3:XML;
if (!_arg1){
return (this);
};
if (_arg1.@target.length()){
this.target = _arg1.@target;
};
var _local2:XMLList = _arg1.elements();
for each (_local3 in _local2) {
this.points.push(new Point(Number(_local3.@x), Number(_local3.@y)));
};
return (this);
}
public function get target():String{
return (this._target);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg4 <= 0){
return (NaN);
};
var _local5:Number = (_arg1 / _arg4);
if (_local5 <= 0){
return (_arg2);
};
if (_local5 >= 1){
return ((_arg2 + _arg3));
};
var _local6:Array = [this.firstNode].concat(this.points);
_local6.push(this.lastNode);
var _local7:Number = getYForPercent(_local5, _local6);
return ((_arg2 + (_local7 * _arg3)));
}
static function getYForPercent(_arg1:Number, _arg2:Array):Number{
var _local8:int;
var _local9:BezierSegment;
var _local3:BezierSegment = new BezierSegment(_arg2[0], _arg2[1], _arg2[2], _arg2[3]);
var _local4:Array = [_local3];
var _local5 = 3;
while (_local5 < (_arg2.length - 3)) {
_local4.push(new BezierSegment(_arg2[_local5], _arg2[(_local5 + 1)], _arg2[(_local5 + 2)], _arg2[(_local5 + 3)]));
_local5 = (_local5 + 3);
};
var _local6:BezierSegment = _local3;
if (_arg2.length >= 5){
_local8 = 0;
while (_local8 < _local4.length) {
_local9 = _local4[_local8];
if ((((_local9.a.x <= _arg1)) && ((_arg1 <= _local9.d.x)))){
_local6 = _local9;
break;
};
_local8++;
};
};
var _local7:Number = _local6.getYForX(_arg1);
return (_local7);
}
}
}//package fl.motion
Section 116
//DynamicMatrix (fl.motion.DynamicMatrix)
package fl.motion {
public class DynamicMatrix {
protected var m_matrix:Array;
protected var m_width:int;
protected var m_height:int;
public static const MATRIX_ORDER_APPEND:int = 1;
public static const MATRIX_ORDER_PREPEND:int = 0;
public function DynamicMatrix(_arg1:int, _arg2:int){
this.Create(_arg1, _arg2);
}
public function Add(_arg1:DynamicMatrix):Boolean{
var _local5:int;
var _local6:Number;
if (((!(this.m_matrix)) || (!(_arg1)))){
return (false);
};
var _local2:int = _arg1.GetHeight();
var _local3:int = _arg1.GetWidth();
if (((!((this.m_width == _local3))) || (!((this.m_height == _local2))))){
return (false);
};
var _local4:int;
while (_local4 < this.m_height) {
_local5 = 0;
while (_local5 < this.m_width) {
_local6 = 0;
_local6 = (this.m_matrix[_local4][_local5] + _arg1.GetValue(_local4, _local5));
this.m_matrix[_local4][_local5] = _local6;
_local5++;
};
_local4++;
};
return (true);
}
public function LoadIdentity():void{
var _local1:int;
var _local2:int;
if (this.m_matrix){
_local1 = 0;
while (_local1 < this.m_height) {
_local2 = 0;
while (_local2 < this.m_width) {
if (_local1 == _local2){
this.m_matrix[_local1][_local2] = 1;
} else {
this.m_matrix[_local1][_local2] = 0;
};
_local2++;
};
_local1++;
};
};
}
public function LoadZeros():void{
var _local1:int;
var _local2:int;
if (this.m_matrix){
_local1 = 0;
while (_local1 < this.m_height) {
_local2 = 0;
while (_local2 < this.m_width) {
this.m_matrix[_local1][_local2] = 0;
_local2++;
};
_local1++;
};
};
}
public function Multiply(_arg1:DynamicMatrix, _arg2:int=0):Boolean{
var _local5:DynamicMatrix;
var _local6:int;
var _local7:int;
var _local8:Number;
var _local9:int;
var _local10:int;
if (((!(this.m_matrix)) || (!(_arg1)))){
return (false);
};
var _local3:int = _arg1.GetHeight();
var _local4:int = _arg1.GetWidth();
if (_arg2 == MATRIX_ORDER_APPEND){
if (this.m_width != _local3){
return (false);
};
_local5 = new DynamicMatrix(_local4, this.m_height);
_local6 = 0;
while (_local6 < this.m_height) {
_local7 = 0;
while (_local7 < _local4) {
_local8 = 0;
_local9 = 0;
_local10 = 0;
while ((((_local9 < Math.max(this.m_height, _local3))) && ((_local10 < Math.max(this.m_width, _local4))))) {
_local8 = (_local8 + (_arg1.GetValue(_local9, _local7) * this.m_matrix[_local6][_local10]));
_local9++;
_local10++;
};
_local5.SetValue(_local6, _local7, _local8);
_local7++;
};
_local6++;
};
this.Destroy();
this.Create(_local4, this.m_height);
_local6 = 0;
while (_local6 < _local3) {
_local7 = 0;
while (_local7 < this.m_width) {
this.m_matrix[_local6][_local7] = _local5.GetValue(_local6, _local7);
_local7++;
};
_local6++;
};
} else {
if (this.m_height != _local4){
return (false);
};
_local5 = new DynamicMatrix(this.m_width, _local3);
_local6 = 0;
while (_local6 < _local3) {
_local7 = 0;
while (_local7 < this.m_width) {
_local8 = 0;
_local9 = 0;
_local10 = 0;
while ((((_local9 < Math.max(_local3, this.m_height))) && ((_local10 < Math.max(_local4, this.m_width))))) {
_local8 = (_local8 + (this.m_matrix[_local9][_local7] * _arg1.GetValue(_local6, _local10)));
_local9++;
_local10++;
};
_local5.SetValue(_local6, _local7, _local8);
_local7++;
};
_local6++;
};
this.Destroy();
this.Create(this.m_width, _local3);
_local6 = 0;
while (_local6 < _local3) {
_local7 = 0;
while (_local7 < this.m_width) {
this.m_matrix[_local6][_local7] = _local5.GetValue(_local6, _local7);
_local7++;
};
_local6++;
};
};
return (true);
}
public function MultiplyNumber(_arg1:Number):Boolean{
var _local3:int;
var _local4:Number;
if (!this.m_matrix){
return (false);
};
var _local2:int;
while (_local2 < this.m_height) {
_local3 = 0;
while (_local3 < this.m_width) {
_local4 = 0;
_local4 = (this.m_matrix[_local2][_local3] * _arg1);
this.m_matrix[_local2][_local3] = _local4;
_local3++;
};
_local2++;
};
return (true);
}
public function SetValue(_arg1:int, _arg2:int, _arg3:Number):void{
if ((((((((_arg1 >= 0)) && ((_arg1 < this.m_height)))) && ((_arg2 >= 0)))) && ((_arg2 <= this.m_width)))){
this.m_matrix[_arg1][_arg2] = _arg3;
};
}
public function GetWidth():Number{
return (this.m_width);
}
protected function Destroy():void{
this.m_matrix = null;
}
public function GetValue(_arg1:int, _arg2:int):Number{
var _local3:Number = 0;
if ((((((((_arg1 >= 0)) && ((_arg1 < this.m_height)))) && ((_arg2 >= 0)))) && ((_arg2 <= this.m_width)))){
_local3 = this.m_matrix[_arg1][_arg2];
};
return (_local3);
}
protected function Create(_arg1:int, _arg2:int):void{
var _local3:int;
var _local4:int;
if ((((_arg1 > 0)) && ((_arg2 > 0)))){
this.m_width = _arg1;
this.m_height = _arg2;
this.m_matrix = new Array(_arg2);
_local3 = 0;
while (_local3 < _arg2) {
this.m_matrix[_local3] = new Array(_arg1);
_local4 = 0;
while (_local4 < _arg2) {
this.m_matrix[_local3][_local4] = 0;
_local4++;
};
_local3++;
};
};
}
public function GetHeight():Number{
return (this.m_height);
}
}
}//package fl.motion
Section 117
//FunctionEase (fl.motion.FunctionEase)
package fl.motion {
import flash.utils.*;
public class FunctionEase implements ITween {
private var _functionName:String;// = ""
public var parameters:Array;// = null
private var _target:String;// = ""
public var easingFunction:Function;// = null
public function FunctionEase(_arg1:XML=null){
this.parseXML(_arg1);
}
public function get functionName():String{
return (this._functionName);
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
public function set functionName(_arg1:String):void{
var _local2:Array = _arg1.split(".");
var _local3:String = _local2.pop();
var _local4:String = _local2.join(".");
var _local5:Class = (getDefinitionByName(_local4) as Class);
if ((_local5[_local3] is Function)){
this.easingFunction = _local5[_local3];
this._functionName = _arg1;
};
}
public function get target():String{
return (this._target);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Array;
if ((this.parameters is Array)){
_local5 = [_arg1, _arg2, _arg3, _arg4].concat(this.parameters);
return (this.easingFunction.apply(null, _local5));
};
return (this.easingFunction(_arg1, _arg2, _arg3, _arg4));
}
private function parseXML(_arg1:XML=null):FunctionEase{
if (!_arg1){
return (this);
};
if (_arg1.@functionName.length()){
this.functionName = _arg1.@functionName;
};
if (_arg1.@target.length()){
this.target = _arg1.@target;
};
return (this);
}
}
}//package fl.motion
Section 118
//ITween (fl.motion.ITween)
package fl.motion {
public interface ITween {
function get target():String;
function set target(_arg1:String):void;
function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number;
}
}//package fl.motion
Section 119
//Keyframe (fl.motion.Keyframe)
package fl.motion {
import flash.filters.*;
import flash.utils.*;
public class Keyframe extends KeyframeBase {
public var tweenSync:Boolean;// = false
public var tweens:Array;
public var tweenSnap:Boolean;// = false
public var tweenScale:Boolean;// = true
public function Keyframe(_arg1:XML=null){
super(_arg1);
this.tweens = [];
this.parseXML(_arg1);
}
private function parseXML(_arg1:XML=null):KeyframeBase{
var tweenableName:String;
var elements:XMLList;
var filtersArray:Array;
var child:XML;
var attribute:XML;
var attributeValue:String;
var name:String;
var tweenChildren:XMLList;
var tweenChild:XML;
var tweenName:String;
var filtersChildren:XMLList;
var filterXML:XML;
var filterName:String;
var filterClassName:String;
var filterClass:Object;
var filterInstance:BitmapFilter;
var filterTypeInfo:XML;
var accessorList:XMLList;
var ratios:Array;
var attrib:XML;
var attribName:String;
var accessor:XML;
var attribType:String;
var attribValue:String;
var uintValue:uint;
var valuesArray:Array;
var xml = _arg1;
if (!xml){
return (this);
};
var indexString:String = xml.@index.toXMLString();
var indexValue:int = parseInt(indexString);
if (indexString){
this.index = indexValue;
} else {
throw (new Error("<Keyframe> is missing the required attribute \"index\"."));
};
if (xml.@label.length()){
this.label = xml.@label;
};
if (xml.@tweenScale.length()){
this.tweenScale = (xml.@tweenScale.toString() == "true");
};
if (xml.@tweenSnap.length()){
this.tweenSnap = (xml.@tweenSnap.toString() == "true");
};
if (xml.@tweenSync.length()){
this.tweenSync = (xml.@tweenSync.toString() == "true");
};
if (xml.@blendMode.length()){
this.blendMode = xml.@blendMode;
};
if (xml.@cacheAsBitmap.length()){
this.cacheAsBitmap = (xml.@cacheAsBitmap.toString() == "true");
};
if (xml.@rotateDirection.length()){
this.rotateDirection = xml.@rotateDirection;
};
if (xml.@rotateTimes.length()){
this.rotateTimes = parseInt(xml.@rotateTimes);
};
if (xml.@orientToPath.length()){
this.orientToPath = (xml.@orientToPath.toString() == "true");
};
if (xml.@blank.length()){
this.blank = (xml.@blank.toString() == "true");
};
var tweenableNames:Array = ["x", "y", "scaleX", "scaleY", "rotation", "skewX", "skewY"];
for each (tweenableName in tweenableNames) {
attribute = xml.attribute(tweenableName)[0];
if (!attribute){
} else {
attributeValue = attribute.toString();
if (attributeValue){
this[tweenableName] = Number(attributeValue);
};
};
};
elements = xml.elements();
filtersArray = [];
for each (child in elements) {
name = child.localName();
if (name == "tweens"){
tweenChildren = child.elements();
for each (tweenChild in tweenChildren) {
tweenName = tweenChild.localName();
if (tweenName == "SimpleEase"){
this.tweens.push(new SimpleEase(tweenChild));
} else {
if (tweenName == "CustomEase"){
this.tweens.push(new CustomEase(tweenChild));
} else {
if (tweenName == "BezierEase"){
this.tweens.push(new BezierEase(tweenChild));
} else {
if (tweenName == "FunctionEase"){
this.tweens.push(new FunctionEase(tweenChild));
};
};
};
};
};
} else {
if (name == "filters"){
filtersChildren = child.elements();
for each (filterXML in filtersChildren) {
filterName = filterXML.localName();
filterClassName = ("flash.filters." + filterName);
if (filterName == "AdjustColorFilter"){
} else {
filterClass = getDefinitionByName(filterClassName);
filterInstance = new (filterClass);
filterTypeInfo = describeType(filterInstance);
accessorList = filterTypeInfo.accessor;
ratios = [];
for each (attrib in filterXML.attributes()) {
attribName = attrib.localName();
accessor = accessorList.(@name == attribName)[0];
attribType = accessor.@type;
attribValue = attrib.toString();
if (attribType == "int"){
filterInstance[attribName] = parseInt(attribValue);
} else {
if (attribType == "uint"){
filterInstance[attribName] = (parseInt(attribValue) as uint);
uintValue = (parseInt(attribValue) as uint);
} else {
if (attribType == "Number"){
filterInstance[attribName] = Number(attribValue);
} else {
if (attribType == "Boolean"){
filterInstance[attribName] = (attribValue == "true");
} else {
if (attribType == "Array"){
attribValue = attribValue.substring(1, (attribValue.length - 1));
valuesArray = null;
if ((((attribName == "ratios")) || ((attribName == "colors")))){
valuesArray = splitUint(attribValue);
} else {
if (attribName == "alphas"){
valuesArray = splitNumber(attribValue);
};
};
if (attribName == "ratios"){
ratios = valuesArray;
} else {
if (valuesArray){
filterInstance[attribName] = valuesArray;
};
};
} else {
if (attribType == "String"){
filterInstance[attribName] = attribValue;
};
};
};
};
};
};
};
if (ratios.length){
filterInstance["ratios"] = ratios;
};
filtersArray.push(filterInstance);
};
};
} else {
if (name == "color"){
this.color = Color.fromXML(child);
};
};
};
this.filters = filtersArray;
};
return (this);
}
override public function get tweensLength():int{
return (this.tweens.length);
}
override protected function hasTween():Boolean{
return (!((this.getTween() == null)));
}
public function getTween(_arg1:String=""):ITween{
var _local2:ITween;
for each (_local2 in this.tweens) {
if ((((((((_local2.target == _arg1)) || ((((_local2.target == "rotation")) && ((((_arg1 == "skewX")) || ((_arg1 == "skewY")))))))) || ((((_local2.target == "position")) && ((((_arg1 == "x")) || ((_arg1 == "y")))))))) || ((((_local2.target == "scale")) && ((((_arg1 == "scaleX")) || ((_arg1 == "scaleY")))))))){
return (_local2);
};
};
return (null);
}
private static function splitNumber(_arg1:String):Array{
var _local2:Array = _arg1.split(",");
var _local3:int;
while (_local3 < _local2.length) {
_local2[_local3] = Number(_local2[_local3]);
_local3++;
};
return (_local2);
}
private static function splitUint(_arg1:String):Array{
var _local2:Array = _arg1.split(",");
var _local3:int;
while (_local3 < _local2.length) {
_local2[_local3] = (parseInt(_local2[_local3]) as uint);
_local3++;
};
return (_local2);
}
private static function splitInt(_arg1:String):Array{
var _local2:Array = _arg1.split(",");
var _local3:int;
while (_local3 < _local2.length) {
_local2[_local3] = (parseInt(_local2[_local3]) as int);
_local3++;
};
return (_local2);
}
}
}//package fl.motion
Section 120
//KeyframeBase (fl.motion.KeyframeBase)
package fl.motion {
import flash.display.*;
import flash.filters.*;
import flash.utils.*;
public class KeyframeBase {
public var y:Number;// = NAN
public var filters:Array;
public var skewX:Number;// = NAN
public var skewY:Number;// = NAN
public var blendMode:String;
public var useRotationConcat:Boolean;// = false
public var rotationX:Number;// = NAN
public var rotationY:Number;// = NAN
public var firstFrame:String;
public var cacheAsBitmap:Boolean;// = false
public var rotateTimes:uint;// = 0
public var loop:String;
public var rotationConcat:Number;// = NAN
public var scaleX:Number;// = NAN
public var scaleY:Number;// = NAN
private var _index:int;// = -1
public var blank:Boolean;// = false
public var adjustColorObjects:Dictionary;// = null
public var color:Color;
public var orientToPath:Boolean;// = false
public var rotateDirection:String;// = "auto"
public var label:String;// = ""
public var x:Number;// = NAN
public var matrix3D:Object;// = null
public var z:Number;// = NAN
public function KeyframeBase(_arg1:XML=null){
this.blendMode = BlendMode.NORMAL;
super();
this.filters = [];
this.adjustColorObjects = new Dictionary();
}
public function set index(_arg1:int):void{
this._index = ((_arg1)<0) ? 0 : _arg1;
if (this._index == 0){
this.setDefaults();
};
}
public function getValue(_arg1:String):Number{
return (Number(this[_arg1]));
}
public function setValue(_arg1:String, _arg2:Number):void{
this[_arg1] = _arg2;
}
public function get index():int{
return (this._index);
}
private function setDefaults():void{
if (isNaN(this.x)){
this.x = 0;
};
if (isNaN(this.y)){
this.y = 0;
};
if (isNaN(this.z)){
this.z = 0;
};
if (isNaN(this.scaleX)){
this.scaleX = 1;
};
if (isNaN(this.scaleY)){
this.scaleY = 1;
};
if (isNaN(this.skewX)){
this.skewX = 0;
};
if (isNaN(this.skewY)){
this.skewY = 0;
};
if (isNaN(this.rotationConcat)){
this.rotationConcat = 0;
};
if (!this.color){
this.color = new Color();
};
}
public function setAdjustColorProperty(_arg1:int, _arg2:String, _arg3):void{
var _local5:ColorMatrixFilter;
var _local6:Array;
if (_arg1 >= this.filters.length){
return;
};
var _local4:AdjustColor = this.adjustColorObjects[_arg1];
if (_local4 == null){
_local4 = new AdjustColor();
this.adjustColorObjects[_arg1] = _local4;
};
switch (_arg2){
case "adjustColorBrightness":
_local4.brightness = _arg3;
break;
case "adjustColorContrast":
_local4.contrast = _arg3;
break;
case "adjustColorSaturation":
_local4.saturation = _arg3;
break;
case "adjustColorHue":
_local4.hue = _arg3;
break;
};
if (_local4.AllValuesAreSet()){
_local5 = (this.filters[_arg1] as ColorMatrixFilter);
if (_local5){
_local6 = _local4.CalculateFinalFlatArray();
if (_local6){
_local5.matrix = _local6;
};
};
};
}
public function affectsTweenable(_arg1:String=""):Boolean{
return (((((((((((((!(_arg1)) || (!(isNaN(this[_arg1]))))) || ((((_arg1 == "color")) && (this.color))))) || ((((_arg1 == "filters")) && (this.filters.length))))) || ((((_arg1 == "matrix3D")) && (this.matrix3D))))) || (this.blank))) || (this.hasTween())));
}
public function get tweensLength():int{
return (0);
}
protected function hasTween():Boolean{
return (false);
}
public function set rotation(_arg1:Number):void{
if (((isNaN(this.skewX)) || (isNaN(this.skewY)))){
this.skewX = _arg1;
} else {
this.skewX = (this.skewX + (_arg1 - this.skewY));
};
this.skewY = _arg1;
}
public function get rotation():Number{
return (this.skewY);
}
}
}//package fl.motion
Section 121
//MatrixTransformer (fl.motion.MatrixTransformer)
package fl.motion {
import flash.geom.*;
public class MatrixTransformer {
public static function getSkewY(_arg1:Matrix):Number{
return ((Math.atan2(_arg1.b, _arg1.a) * (180 / Math.PI)));
}
public static function getScaleX(_arg1:Matrix):Number{
return (Math.sqrt(((_arg1.a * _arg1.a) + (_arg1.b * _arg1.b))));
}
public static function getScaleY(_arg1:Matrix):Number{
return (Math.sqrt(((_arg1.c * _arg1.c) + (_arg1.d * _arg1.d))));
}
public static function setSkewXRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number = getScaleY(_arg1);
_arg1.c = (-(_local3) * Math.sin(_arg2));
_arg1.d = (_local3 * Math.cos(_arg2));
}
public static function setRotation(_arg1:Matrix, _arg2:Number):void{
setRotationRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function rotateAroundInternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Point = new Point(_arg2, _arg3);
_local5 = _arg1.transformPoint(_local5);
_arg1.tx = (_arg1.tx - _local5.x);
_arg1.ty = (_arg1.ty - _local5.y);
_arg1.rotate((_arg4 * (Math.PI / 180)));
_arg1.tx = (_arg1.tx + _local5.x);
_arg1.ty = (_arg1.ty + _local5.y);
}
public static function setSkewX(_arg1:Matrix, _arg2:Number):void{
setSkewXRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function setSkewY(_arg1:Matrix, _arg2:Number):void{
setSkewYRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function setScaleX(_arg1:Matrix, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
var _local3:Number = getScaleX(_arg1);
if (_local3){
_local4 = (_arg2 / _local3);
_arg1.a = (_arg1.a * _local4);
_arg1.b = (_arg1.b * _local4);
} else {
_local5 = getSkewYRadians(_arg1);
_arg1.a = (Math.cos(_local5) * _arg2);
_arg1.b = (Math.sin(_local5) * _arg2);
};
}
public static function setScaleY(_arg1:Matrix, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
var _local3:Number = getScaleY(_arg1);
if (_local3){
_local4 = (_arg2 / _local3);
_arg1.c = (_arg1.c * _local4);
_arg1.d = (_arg1.d * _local4);
} else {
_local5 = getSkewXRadians(_arg1);
_arg1.c = (-(Math.sin(_local5)) * _arg2);
_arg1.d = (Math.cos(_local5) * _arg2);
};
}
public static function setRotationRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number = getRotationRadians(_arg1);
var _local4:Number = getSkewXRadians(_arg1);
setSkewXRadians(_arg1, ((_local4 + _arg2) - _local3));
setSkewYRadians(_arg1, _arg2);
}
public static function setSkewYRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number = getScaleX(_arg1);
_arg1.a = (_local3 * Math.cos(_arg2));
_arg1.b = (_local3 * Math.sin(_arg2));
}
public static function getSkewX(_arg1:Matrix):Number{
return ((Math.atan2(-(_arg1.c), _arg1.d) * (180 / Math.PI)));
}
public static function getSkewYRadians(_arg1:Matrix):Number{
return (Math.atan2(_arg1.b, _arg1.a));
}
public static function getSkewXRadians(_arg1:Matrix):Number{
return (Math.atan2(-(_arg1.c), _arg1.d));
}
public static function getRotation(_arg1:Matrix):Number{
return ((getRotationRadians(_arg1) * (180 / Math.PI)));
}
public static function rotateAroundExternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{
_arg1.tx = (_arg1.tx - _arg2);
_arg1.ty = (_arg1.ty - _arg3);
_arg1.rotate((_arg4 * (Math.PI / 180)));
_arg1.tx = (_arg1.tx + _arg2);
_arg1.ty = (_arg1.ty + _arg3);
}
public static function getRotationRadians(_arg1:Matrix):Number{
return (getSkewYRadians(_arg1));
}
public static function matchInternalPointWithExternal(_arg1:Matrix, _arg2:Point, _arg3:Point):void{
var _local4:Point = _arg1.transformPoint(_arg2);
var _local5:Number = (_arg3.x - _local4.x);
var _local6:Number = (_arg3.y - _local4.y);
_arg1.tx = (_arg1.tx + _local5);
_arg1.ty = (_arg1.ty + _local6);
}
}
}//package fl.motion
Section 122
//Motion (fl.motion.Motion)
package fl.motion {
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
public class Motion extends MotionBase {
public var source:Source;
private var _keyframesCompact:Array;
private static var typeCache:Object = {};
public function Motion(_arg1:XML=null){
var _local2:Keyframe;
super();
this.keyframes = [];
this.parseXML(_arg1);
if (!this.source){
this.source = new Source();
};
if (this.duration == 0){
_local2 = (this.getNewKeyframe() as Keyframe);
_local2.index = 0;
this.addKeyframe(_local2);
};
}
override protected function findTweenedValue(_arg1:Number, _arg2:String, _arg3:KeyframeBase, _arg4:Number, _arg5:Number):Number{
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local6:Keyframe = (_arg3 as Keyframe);
if (!_local6){
return (NaN);
};
var _local7:ITween = ((_local6.getTween(_arg2)) || (_local6.getTween()));
if (((((!(_local7)) || (((!(_local6.tweenScale)) && ((((_arg2 == Tweenables.SCALE_X)) || ((_arg2 == Tweenables.SCALE_Y)))))))) || ((((_local6.rotateDirection == RotateDirection.NONE)) && ((((((_arg2 == Tweenables.ROTATION)) || ((_arg2 == Tweenables.SKEW_X)))) || ((_arg2 == Tweenables.SKEW_Y)))))))){
return (_arg5);
};
var _local8:String = _arg2;
if (_local7.target == ""){
_local8 = "";
};
var _local9:Keyframe = (this.getNextKeyframe(_arg1, _local8) as Keyframe);
if (((!(_local9)) || (_local9.blank))){
return (_arg5);
};
_local10 = _local9.getValue(_arg2);
if (isNaN(_local10)){
_local10 = _arg5;
};
_local11 = (_local10 - _arg5);
if ((((((_arg2 == Tweenables.SKEW_X)) || ((_arg2 == Tweenables.SKEW_Y)))) || ((_arg2 == Tweenables.ROTATION)))){
if (_local6.rotateDirection == RotateDirection.AUTO){
_local11 = (_local11 % 360);
if (_local11 > 180){
_local11 = (_local11 - 360);
} else {
if (_local11 < -180){
_local11 = (_local11 + 360);
};
};
} else {
if (_local6.rotateDirection == RotateDirection.CW){
if (_local11 < 0){
_local11 = ((_local11 % 360) + 360);
};
_local11 = (_local11 + (_local6.rotateTimes * 360));
} else {
if (_local11 > 0){
_local11 = ((_local11 % 360) - 360);
};
_local11 = (_local11 - (_local6.rotateTimes * 360));
};
};
};
_local12 = (_local9.index - _local6.index);
return (_local7.getValue(_arg4, _arg5, _local11, _local12));
}
private function parseXML(_arg1:XML):Motion{
var _local4:XML;
var _local5:XML;
if (!_arg1){
return (this);
};
if (_arg1.@duration.length()){
this.duration = parseInt(_arg1.@duration);
};
var _local2:XMLList = _arg1.elements();
var _local3:Number = 0;
while (_local3 < _local2.length()) {
_local4 = _local2[_local3];
if (_local4.localName() == "source"){
_local5 = _local4.children()[0];
this.source = new Source(_local5);
} else {
if (_local4.localName() == "Keyframe"){
this.addKeyframe(this.getNewKeyframe(_local4));
};
};
_local3++;
};
return (this);
}
override public function getFilters(_arg1:Number):Array{
var _local7:Keyframe;
var _local8:Array;
var _local9:Number;
var _local10:Number;
var _local2:Array;
var _local3:Keyframe = (this.getCurrentKeyframe(_arg1, "filters") as Keyframe);
if (((!(_local3)) || (((_local3.filters) && (!(_local3.filters.length)))))){
return ([]);
};
var _local4:Array = _local3.filters;
var _local5:Number = (_arg1 - _local3.index);
var _local6:ITween = ((_local3.getTween("filters")) || (_local3.getTween()));
if ((((_local5 == 0)) || (!(_local6)))){
_local2 = _local4;
} else {
if (_local6){
_local7 = (this.getNextKeyframe(_arg1, "filters") as Keyframe);
if (((!(_local7)) || (!(_local7.filters.length)))){
_local2 = _local4;
} else {
_local8 = _local7.filters;
_local9 = (_local7.index - _local3.index);
_local10 = _local6.getValue(_local5, 0, 1, _local9);
_local2 = interpolateFilters(_local4, _local8, _local10);
};
};
};
return (_local2);
}
override protected function getNewKeyframe(_arg1:XML=null):KeyframeBase{
return (new Keyframe(_arg1));
}
public function set keyframesCompact(_arg1:Array):void{
var _local2:KeyframeBase;
this._keyframesCompact = _arg1.concat();
this.keyframes = [];
for each (_local2 in this._keyframesCompact) {
this.addKeyframe(_local2);
};
}
public function get keyframesCompact():Array{
var _local1:KeyframeBase;
this._keyframesCompact = [];
for each (_local1 in this.keyframes) {
if (_local1){
this._keyframesCompact.push(_local1);
};
};
return (this._keyframesCompact);
}
override public function getColorTransform(_arg1:int):ColorTransform{
var _local7:Keyframe;
var _local8:ColorTransform;
var _local9:Number;
var _local10:Number;
var _local2:ColorTransform;
var _local3:Keyframe = (this.getCurrentKeyframe(_arg1, "color") as Keyframe);
if (((!(_local3)) || (!(_local3.color)))){
return (null);
};
var _local4:ColorTransform = _local3.color;
var _local5:Number = (_arg1 - _local3.index);
var _local6:ITween = ((((_local3.getTween("color")) || (_local3.getTween("alpha")))) || (_local3.getTween()));
if ((((_local5 == 0)) || (!(_local6)))){
_local2 = _local4;
} else {
if (_local6){
_local7 = (this.getNextKeyframe(_arg1, "color") as Keyframe);
if (((!(_local7)) || (!(_local7.color)))){
_local2 = _local4;
} else {
_local8 = _local7.color;
_local9 = (_local7.index - _local3.index);
_local10 = _local6.getValue(_local5, 0, 1, _local9);
_local2 = Color.interpolateTransform(_local4, _local8, _local10);
};
};
};
return (_local2);
}
private static function getTypeInfo(_arg1):XML{
var _local2 = "";
if ((_arg1 is String)){
_local2 = _arg1;
} else {
_local2 = getQualifiedClassName(_arg1);
};
if ((_local2 in typeCache)){
return (typeCache[_local2]);
};
if ((_arg1 is String)){
_arg1 = getDefinitionByName(_arg1);
};
return ((typeCache[_local2] = describeType(_arg1)));
}
public static function interpolateFilter(_arg1:BitmapFilter, _arg2:BitmapFilter, _arg3:Number):BitmapFilter{
var _local8:XML;
var _local9:String;
var _local10:String;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:Number;
var _local23:uint;
var _local24:Number;
var _local25:int;
var _local26:Number;
var _local27:uint;
var _local28:Number;
var _local29:int;
var _local30:uint;
var _local31:Number;
if (((!(_arg2)) || (!((_arg1["constructor"] == _arg2["constructor"]))))){
return (_arg1);
};
if (_arg3 > 1){
_arg3 = 1;
} else {
if (_arg3 < 0){
_arg3 = 0;
};
};
var _local4:Number = (1 - _arg3);
var _local5:BitmapFilter = _arg1.clone();
var _local6:XML = getTypeInfo(_arg1);
var _local7:XMLList = _local6.accessor;
for each (_local8 in _local7) {
_local9 = _local8.@name.toString();
_local10 = _local8.@type;
if ((((_local10 == "Number")) || ((_local10 == "int")))){
_local5[_local9] = ((_arg1[_local9] * _local4) + (_arg2[_local9] * _arg3));
} else {
if (_local10 == "uint"){
switch (_local9){
case "color":
case "highlightColor":
case "shadowColor":
_local11 = _arg1[_local9];
_local12 = _arg2[_local9];
_local13 = Color.interpolateColor(_local11, _local12, _arg3);
_local5[_local9] = _local13;
break;
default:
_local5[_local9] = ((_arg1[_local9] * _local4) + (_arg2[_local9] * _arg3));
break;
};
};
};
};
if ((((_arg1 is GradientGlowFilter)) || ((_arg1 is GradientBevelFilter)))){
_local14 = [];
_local15 = [];
_local16 = [];
_local17 = _arg1["ratios"].length;
_local18 = _arg2["ratios"].length;
_local19 = Math.max(_local17, _local18);
_local20 = 0;
while (_local20 < _local19) {
_local21 = Math.min(_local20, (_local17 - 1));
_local22 = _arg1["ratios"][_local21];
_local23 = _arg1["colors"][_local21];
_local24 = _arg1["alphas"][_local21];
_local25 = Math.min(_local20, (_local18 - 1));
_local26 = _arg2["ratios"][_local25];
_local27 = _arg2["colors"][_local25];
_local28 = _arg2["alphas"][_local25];
_local29 = ((_local22 * _local4) + (_local26 * _arg3));
_local30 = Color.interpolateColor(_local23, _local27, _arg3);
_local31 = ((_local24 * _local4) + (_local28 * _arg3));
_local14[_local20] = _local29;
_local15[_local20] = _local30;
_local16[_local20] = _local31;
_local20++;
};
_local5["colors"] = _local15;
_local5["alphas"] = _local16;
_local5["ratios"] = _local14;
};
return (_local5);
}
public static function interpolateFilters(_arg1:Array, _arg2:Array, _arg3:Number):Array{
var _local6:BitmapFilter;
var _local7:BitmapFilter;
var _local8:BitmapFilter;
if (_arg1.length != _arg2.length){
return (null);
};
var _local4:Array = [];
var _local5:int;
while (_local5 < _arg1.length) {
_local6 = _arg1[_local5];
_local7 = _arg2[_local5];
_local8 = interpolateFilter(_local6, _local7, _arg3);
if (_local8){
_local4.push(_local8);
};
_local5++;
};
return (_local4);
}
public static function fromXMLString(_arg1:String):Motion{
var _local2:XML = new XML(_arg1);
return (new Motion(_local2));
}
}
}//package fl.motion
Section 123
//MotionBase (fl.motion.MotionBase)
package fl.motion {
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
public class MotionBase {
private var _is3D:Boolean;// = false
public var keyframes:Array;
private var _overrideSkew:Boolean;
private var _overrideScale:Boolean;
private var _overrideRotate:Boolean;
private var _duration:int;// = 0
public function MotionBase(_arg1:XML=null){
var _local2:KeyframeBase;
super();
this.keyframes = [];
if (this.duration == 0){
_local2 = this.getNewKeyframe();
_local2.index = 0;
this.addKeyframe(_local2);
};
this._overrideScale = false;
this._overrideSkew = false;
this._overrideRotate = false;
}
public function addKeyframe(_arg1:KeyframeBase):void{
this.keyframes[_arg1.index] = _arg1;
if (this.duration < this.keyframes.length){
this.duration = this.keyframes.length;
};
}
public function initFilters(_arg1:Array, _arg2:Array, _arg3:int=-1, _arg4:int=-1):void{
var _local6:Class;
var _local7:int;
var _local8:KeyframeBase;
var _local9:BitmapFilter;
var _local10:int;
if ((((_arg3 == -1)) || ((_arg4 == -1)))){
_arg3 = 0;
_arg4 = this.duration;
};
var _local5:int;
while (_local5 < _arg1.length) {
_local6 = (getDefinitionByName(_arg1[_local5]) as Class);
_local7 = _arg3;
while (_local7 < _arg4) {
_local8 = KeyframeBase(this.keyframes[_local7]);
if (_local8 == null){
_local8 = this.getNewKeyframe();
_local8.index = _local7;
this.addKeyframe(_local8);
};
if (((_local8) && ((_local8.filters == null)))){
_local8.filters = new Array();
};
if (((_local8) && (_local8.filters))){
_local9 = null;
switch (_arg1[_local5]){
case "flash.filters.GradientBevelFilter":
case "flash.filters.GradientGlowFilter":
_local10 = _arg2[_local5];
_local9 = BitmapFilter(new _local6(4, 45, new Array(_local10), new Array(_local10), new Array(_local10)));
break;
default:
_local9 = BitmapFilter(new (_local6));
break;
};
if (_local9){
_local8.filters.push(_local9);
};
};
_local7++;
};
_local5++;
};
}
public function getCurrentKeyframe(_arg1:int, _arg2:String=""):KeyframeBase{
var _local4:KeyframeBase;
if (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1))))){
return (null);
};
var _local3:int = _arg1;
while (_local3 > 0) {
_local4 = this.keyframes[_local3];
if (((_local4) && (_local4.affectsTweenable(_arg2)))){
return (_local4);
};
_local3--;
};
return (this.keyframes[0]);
}
public function addFilterPropertyArray(_arg1:int, _arg2:String, _arg3:Array, _arg4:int=-1, _arg5:int=-1):void{
var _local10:KeyframeBase;
var _local11:*;
var _local12:int;
var _local6:int = _arg3.length;
var _local7:* = null;
var _local8:Boolean;
if (_local6 > 0){
if ((_arg3[0] is Number)){
_local8 = false;
};
};
if (this.duration < _local6){
this.duration = _local6;
};
if ((((_arg4 == -1)) || ((_arg5 == -1)))){
_arg4 = 0;
_arg5 = this.duration;
};
var _local9:int = _arg4;
while (_local9 < _arg5) {
_local10 = KeyframeBase(this.keyframes[_local9]);
if (_local10 == null){
_local10 = this.getNewKeyframe();
_local10.index = _local9;
this.addKeyframe(_local10);
};
_local11 = _local7;
_local12 = (_local9 - _arg4);
if (_local12 < _arg3.length){
if (((_arg3[_local12]) || (!(_local8)))){
_local11 = _arg3[_local12];
};
};
switch (_arg2){
case "adjustColorBrightness":
case "adjustColorContrast":
case "adjustColorSaturation":
case "adjustColorHue":
_local10.setAdjustColorProperty(_arg1, _arg2, _local11);
break;
default:
if (_arg1 < _local10.filters.length){
_local10.filters[_arg1][_arg2] = _local11;
};
break;
};
_local7 = _local11;
_local9++;
};
}
public function get duration():int{
if (this._duration < this.keyframes.length){
this._duration = this.keyframes.length;
};
return (this._duration);
}
public function useRotationConcat(_arg1:int):Boolean{
var _local2:KeyframeBase = this.getCurrentKeyframe(_arg1, "rotationConcat");
return ((_local2) ? _local2.useRotationConcat : false);
}
public function get is3D():Boolean{
return (this._is3D);
}
public function getFilters(_arg1:Number):Array{
var _local2:Array;
var _local3:KeyframeBase = this.getCurrentKeyframe(_arg1, "filters");
if (((!(_local3)) || (((_local3.filters) && (!(_local3.filters.length)))))){
return ([]);
};
var _local4:Array = _local3.filters;
var _local5:Number = (_arg1 - _local3.index);
if (_local5 == 0){
_local2 = _local4;
};
return (_local2);
}
protected function findTweenedValue(_arg1:Number, _arg2:String, _arg3:KeyframeBase, _arg4:Number, _arg5:Number):Number{
return (NaN);
}
public function addPropertyArray(_arg1:String, _arg2:Array, _arg3:int=-1, _arg4:int=-1):void{
var _local10:KeyframeBase;
var _local11:*;
var _local12:int;
var _local13:*;
var _local5:int = _arg2.length;
var _local6:* = null;
var _local7:Boolean;
var _local8:Number = 0;
if (_local5 > 0){
if ((_arg2[0] is Number)){
_local7 = false;
if ((_arg2[0] is Number)){
_local8 = Number(_arg2[0]);
};
};
};
if (this.duration < _local5){
this.duration = _local5;
};
if ((((_arg3 == -1)) || ((_arg4 == -1)))){
_arg3 = 0;
_arg4 = this.duration;
};
var _local9:int = _arg3;
while (_local9 < _arg4) {
_local10 = KeyframeBase(this.keyframes[_local9]);
if (_local10 == null){
_local10 = this.getNewKeyframe();
_local10.index = _local9;
this.addKeyframe(_local10);
};
if (((_local10.filters) && ((_local10.filters.length == 0)))){
_local10.filters = null;
};
_local11 = _local6;
_local12 = (_local9 - _arg3);
if (_local12 < _arg2.length){
if (((_arg2[_local12]) || (!(_local7)))){
_local11 = _arg2[_local12];
};
};
switch (_arg1){
case "blendMode":
_local10.blendMode = _local11;
break;
case "matrix3D":
_local10[_arg1] = _local11;
break;
case "rotationConcat":
_local10.useRotationConcat = true;
if (((!(this._overrideRotate)) && (!(_local7)))){
_local10.setValue(_arg1, (((_local11 - _local8) * Math.PI) / 180));
} else {
_local10.setValue(_arg1, ((_local11 * Math.PI) / 180));
};
break;
case "brightness":
case "tintMultiplier":
case "tintColor":
case "alphaMultiplier":
case "alphaOffset":
case "redMultiplier":
case "redOffset":
case "greenMultiplier":
case "greenOffset":
case "blueMultiplier":
case "blueOffset":
if (_local10.color == null){
_local10.color = new Color();
};
_local10.color[_arg1] = _local11;
break;
case "rotationZ":
_local10.useRotationConcat = true;
this._is3D = true;
if (((!(this._overrideRotate)) && (!(_local7)))){
_local10.setValue("rotationConcat", (_local11 - _local8));
} else {
_local10.setValue("rotationConcat", _local11);
};
break;
case "rotationX":
case "rotationY":
case "z":
this._is3D = true;
default:
_local13 = _local11;
if (!_local7){
switch (_arg1){
case "scaleX":
case "scaleY":
if (!this._overrideScale){
if (_local8 == 0){
_local13 = (_local11 + 1);
} else {
_local13 = (_local11 / _local8);
};
};
break;
case "skewX":
case "skewY":
if (!this._overrideSkew){
_local13 = (_local11 - _local8);
};
break;
case "rotationX":
case "rotationY":
if (!this._overrideRotate){
_local13 = (_local11 - _local8);
};
break;
};
};
_local10.setValue(_arg1, _local13);
break;
};
_local6 = _local11;
_local9++;
};
}
public function getMatrix3D(_arg1:int):Object{
var _local2:KeyframeBase = this.getCurrentKeyframe(_arg1, "matrix3D");
return ((_local2) ? _local2.matrix3D : null);
}
public function setValue(_arg1:int, _arg2:String, _arg3:Number):void{
if (_arg1 == 0){
return;
};
var _local4:KeyframeBase = this.keyframes[_arg1];
if (!_local4){
_local4 = this.getNewKeyframe();
_local4.index = _arg1;
this.addKeyframe(_local4);
};
_local4.setValue(_arg2, _arg3);
}
private function indexOutOfRange(_arg1:int):Boolean{
return (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1)))));
}
public function overrideTargetTransform(_arg1:Boolean=true, _arg2:Boolean=true, _arg3:Boolean=true):void{
this._overrideScale = _arg1;
this._overrideSkew = _arg2;
this._overrideRotate = _arg3;
}
public function set duration(_arg1:int):void{
if (_arg1 < this.keyframes.length){
_arg1 = this.keyframes.length;
};
this._duration = _arg1;
}
protected function getNewKeyframe(_arg1:XML=null):KeyframeBase{
return (new KeyframeBase(_arg1));
}
public function getValue(_arg1:Number, _arg2:String):Number{
var _local3:Number = NaN;
var _local4:KeyframeBase = this.getCurrentKeyframe(_arg1, _arg2);
if (((!(_local4)) || (_local4.blank))){
return (NaN);
};
var _local5:Number = _local4.getValue(_arg2);
if (((isNaN(_local5)) && ((_local4.index > 0)))){
_local5 = this.getValue((_local4.index - 1), _arg2);
};
if (isNaN(_local5)){
return (NaN);
};
var _local6:Number = (_arg1 - _local4.index);
if (_local6 == 0){
return (_local5);
};
_local3 = this.findTweenedValue(_arg1, _arg2, _local4, _local6, _local5);
return (_local3);
}
public function set is3D(_arg1:Boolean):void{
this._is3D = _arg1;
}
public function getNextKeyframe(_arg1:int, _arg2:String=""):KeyframeBase{
var _local4:KeyframeBase;
if (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1))))){
return (null);
};
var _local3:int = (_arg1 + 1);
while (_local3 < this.keyframes.length) {
_local4 = this.keyframes[_local3];
if (((_local4) && (_local4.affectsTweenable(_arg2)))){
return (_local4);
};
_local3++;
};
return (null);
}
public function getColorTransform(_arg1:int):ColorTransform{
var _local2:ColorTransform;
var _local3:KeyframeBase = this.getCurrentKeyframe(_arg1, "color");
if (((!(_local3)) || (!(_local3.color)))){
return (null);
};
var _local4:ColorTransform = _local3.color;
var _local5:Number = (_arg1 - _local3.index);
if (_local5 == 0){
_local2 = _local4;
};
return (_local2);
}
}
}//package fl.motion
Section 124
//MotionEvent (fl.motion.MotionEvent)
package fl.motion {
import flash.events.*;
public class MotionEvent extends Event {
public static const MOTION_UPDATE:String = "motionUpdate";
public static const TIME_CHANGE:String = "timeChange";
public static const MOTION_START:String = "motionStart";
public static const MOTION_END:String = "motionEnd";
public function MotionEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function clone():Event{
return (new MotionEvent(this.type, this.bubbles, this.cancelable));
}
}
}//package fl.motion
Section 125
//RotateDirection (fl.motion.RotateDirection)
package fl.motion {
public class RotateDirection {
public static const CW:String = "cw";
public static const CCW:String = "ccw";
public static const NONE:String = "none";
public static const AUTO:String = "auto";
}
}//package fl.motion
Section 126
//SimpleEase (fl.motion.SimpleEase)
package fl.motion {
public class SimpleEase implements ITween {
private var _ease:Number;// = 0
private var _target:String;// = ""
public function SimpleEase(_arg1:XML=null){
this.parseXML(_arg1);
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
private function parseXML(_arg1:XML=null):SimpleEase{
if (_arg1){
if (_arg1.@ease.length()){
this.ease = Number(_arg1.@ease);
};
if (_arg1.@target.length()){
this.target = _arg1.@target;
};
};
return (this);
}
public function get ease():Number{
return (this._ease);
}
public function get target():String{
return (this._target);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (easeQuadPercent(_arg1, _arg2, _arg3, _arg4, this.ease));
}
public function set ease(_arg1:Number):void{
this._ease = ((_arg1 > 1)) ? 1 : ((_arg1 < -1)) ? -1 : (isNaN(_arg1)) ? 0 : _arg1;
}
public static function easeQuadPercent(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
if (_arg4 <= 0){
return (NaN);
};
if (_arg1 <= 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 >= 1){
return ((_arg2 + _arg3));
};
if (!_arg5){
return (((_arg3 * _arg1) + _arg2));
};
if (_arg5 > 1){
_arg5 = 1;
} else {
if (_arg5 < -1){
_arg5 = -1;
};
};
if (_arg5 < 0){
return ((((_arg3 * _arg1) * ((_arg1 * -(_arg5)) + (1 + _arg5))) + _arg2));
};
return ((((_arg3 * _arg1) * (((2 - _arg1) * _arg5) + (1 - _arg5))) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg4 <= 0){
return (NaN);
};
if (_arg1 <= 0){
return (_arg2);
};
if (_arg1 >= _arg4){
return ((_arg2 + _arg3));
};
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.motion
Section 127
//Source (fl.motion.Source)
package fl.motion {
import flash.geom.*;
public class Source {
public var instanceName:String;// = ""
public var symbolName:String;// = ""
public var dimensions:Rectangle;
public var scaleX:Number;// = 1
public var skewX:Number;// = 0
public var skewY:Number;// = 0
public var elementType:String;// = ""
public var transformationPoint:Point;
public var linkageID:String;// = ""
public var scaleY:Number;// = 1
public var frameRate:Number;// = NAN
public var x:Number;// = 0
public var y:Number;// = 0
public var rotation:Number;// = 0
public function Source(_arg1:XML=null){
this.parseXML(_arg1);
}
private function parseXML(_arg1:XML=null):Source{
var _local3:XML;
var _local4:XML;
var _local5:XML;
if (!_arg1){
return (this);
};
if (_arg1.@instanceName){
this.instanceName = String(_arg1.@instanceName);
};
if (_arg1.@symbolName){
this.symbolName = String(_arg1.@symbolName);
};
if (_arg1.@linkageID){
this.linkageID = String(_arg1.@linkageID);
};
if (!isNaN(_arg1.@frameRate)){
this.frameRate = Number(_arg1.@frameRate);
};
var _local2:XMLList = _arg1.elements();
for each (_local3 in _local2) {
if (_local3.localName() == "transformationPoint"){
_local4 = _local3.children()[0];
this.transformationPoint = new Point(Number(_local4.@x), Number(_local4.@y));
} else {
if (_local3.localName() == "dimensions"){
_local5 = _local3.children()[0];
this.dimensions = new Rectangle(Number(_local5.@left), Number(_local5.@top), Number(_local5.@width), Number(_local5.@height));
};
};
};
return (this);
}
}
}//package fl.motion
Section 128
//Tweenables (fl.motion.Tweenables)
package fl.motion {
public class Tweenables {
public static const SCALE_X:String = "scaleX";
public static const SCALE_Y:String = "scaleY";
public static const SKEW_X:String = "skewX";
public static const SKEW_Y:String = "skewY";
public static const ROTATION_CONCAT:String = "rotationConcat";
public static const ROTATION_X:String = "rotationX";
public static const X:String = "x";
public static const Y:String = "y";
public static const Z:String = "z";
public static const ROTATION:String = "rotation";
public static const ROTATION_Y:String = "rotationY";
}
}//package fl.motion
Section 129
//Back (gs.easing.Back)
package gs.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package gs.easing
Section 130
//Cubic (gs.easing.Cubic)
package gs.easing {
public class Cubic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package gs.easing
Section 131
//Quart (gs.easing.Quart)
package gs.easing {
public class Quart {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
}
}//package gs.easing
Section 132
//Quint (gs.easing.Quint)
package gs.easing {
public class Quint {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package gs.easing
Section 133
//TweenEvent (gs.events.TweenEvent)
package gs.events {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const UPDATE:String = "update";
public static const START:String = "start";
public static const version:Number = 0.9;
public static const COMPLETE:String = "complete";
public function TweenEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.info = _arg2;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 134
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(!((_arg2 == 0)));
_tweenVisible = true;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 135
//BevelFilterPlugin (gs.plugins.BevelFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BevelFilterPlugin(){
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BevelFilter;
initFilter(_arg2, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 136
//BezierPlugin (gs.plugins.BezierPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _target:Object;
protected var _beziers:Object;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function killProps(_arg1:Object):void{
var _local2:String;
for (_local2 in _beziers) {
if ((_local2 in _arg1)){
delete _beziers[_local2];
};
};
super.killProps(_arg1);
}
protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{
var _local5:int;
var _local6:String;
_target = _arg1.target;
if (_arg1.exposedVars.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0]];
_orient = true;
} else {
if ((_arg1.exposedVars.orientToBezier is Array)){
_orientData = _arg1.exposedVars.orientToBezier;
_orient = true;
};
};
var _local4:Object = {};
_local5 = 0;
while (_local5 < _arg2.length) {
for (_local6 in _arg2[_local5]) {
if (_local4[_local6] == undefined){
_local4[_local6] = [_arg1.target[_local6]];
};
if (typeof(_arg2[_local5][_local6]) == "number"){
_local4[_local6].push(_arg2[_local5][_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg2[_local5][_local6])));
};
};
_local5++;
};
for (_local6 in _local4) {
this.overwriteProps[this.overwriteProps.length] = _local6;
if (_arg1.exposedVars[_local6] != undefined){
if (typeof(_arg1.exposedVars[_local6]) == "number"){
_local4[_local6].push(_arg1.exposedVars[_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg1.exposedVars[_local6])));
};
delete _arg1.exposedVars[_local6];
_local5 = (_arg1.tweens.length - 1);
while (_local5 > -1) {
if (_arg1.tweens[_local5].name == _local6){
_arg1.tweens.splice(_local5, 1);
};
_local5--;
};
};
};
_beziers = parseBeziers(_local4, _arg3);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), false);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:String;
var _local4:Object;
var _local5:Number;
var _local6:uint;
var _local7:Number;
var _local8:int;
var _local9:Object;
var _local10:Boolean;
var _local11:Number;
var _local12:Number;
var _local13:Array;
var _local14:Number;
if (_arg1 == 1){
for (_local3 in _beziers) {
_local2 = (_beziers[_local3].length - 1);
_target[_local3] = _beziers[_local3][_local2][2];
};
} else {
for (_local3 in _beziers) {
_local6 = _beziers[_local3].length;
if (_arg1 < 0){
_local2 = 0;
} else {
if (_arg1 >= 1){
_local2 = (_local6 - 1);
} else {
_local2 = int((_local6 * _arg1));
};
};
_local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6);
_local4 = _beziers[_local3][_local2];
if (this.round){
_local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
_local8 = ((_local7)<0) ? -1 : 1;
_target[_local3] = ((((_local7 % 1) * _local8))>0.5) ? (int(_local7) + _local8) : int(_local7);
} else {
_target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
};
};
};
if (_orient){
_local9 = _target;
_local10 = this.round;
_target = _future;
this.round = false;
_orient = false;
this.changeFactor = (_arg1 + 0.01);
_target = _local9;
this.round = _local10;
_orient = true;
_local2 = 0;
while (_local2 < _orientData.length) {
_local13 = _orientData[_local2];
_local14 = ((_local13[3]) || (0));
_local11 = (_future[_local13[0]] - _target[_local13[0]]);
_local12 = (_future[_local13[1]] - _target[_local13[1]]);
_target[_local13[2]] = ((Math.atan2(_local12, _local11) * _RAD2DEG) + _local14);
_local2++;
};
};
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]];
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]];
_local3++;
};
} else {
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)];
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)];
_local3++;
};
_local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]];
} else {
if (_local4.length == 3){
_local5[_local5.length] = [_local4[0], _local4[1], _local4[2]];
} else {
if (_local4.length == 2){
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
};
};
};
return (_local7);
}
}
}//package gs.plugins
Section 137
//BezierThroughPlugin (gs.plugins.BezierThroughPlugin)
package gs.plugins {
import gs.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BezierThroughPlugin(){
this.propName = "bezierThrough";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), true);
return (true);
}
}
}//package gs.plugins
Section 138
//BlurFilterPlugin (gs.plugins.BlurFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BlurFilterPlugin(){
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BlurFilter;
initFilter(_arg2, new BlurFilter(0, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 139
//ColorMatrixFilterPlugin (gs.plugins.ColorMatrixFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
public static const VERSION:Number = 1.1;
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = ColorMatrixFilter;
var _local4:Object = _arg2;
initFilter({remove:_arg2.remove, index:_arg2.index, addFilter:_arg2.addFilter}, new ColorMatrixFilter(_idMatrix.slice()));
_matrix = ColorMatrixFilter(_filter).matrix;
var _local5:Array = [];
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_local5 = _local4.matrix;
} else {
if (_local4.relative == true){
_local5 = _matrix.slice();
} else {
_local5 = _idMatrix.slice();
};
_local5 = setBrightness(_local5, _local4.brightness);
_local5 = setContrast(_local5, _local4.contrast);
_local5 = setHue(_local5, _local4.hue);
_local5 = setSaturation(_local5, _local4.saturation);
_local5 = setThreshold(_local5, _local4.threshold);
if (!isNaN(_local4.colorize)){
_local5 = colorize(_local5, _local4.colorize, _local4.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, _local5);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
_matrixTween.changeFactor = _arg1;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = _arg1;
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * _lumR);
var _local5:Number = (_local3 * _lumG);
var _local6:Number = (_local3 * _lumB);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
}
}//package gs.plugins
Section 140
//DropShadowFilterPlugin (gs.plugins.DropShadowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function DropShadowFilterPlugin(){
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = DropShadowFilter;
initFilter(_arg2, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout, _arg2.hideObject));
return (true);
}
}
}//package gs.plugins
Section 141
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
public function init(_arg1:Array, _arg2:Array):void{
_a = _arg1;
var _local3:int = (_arg2.length - 1);
while (_local3 > -1) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
}
}//package gs.plugins
Section 142
//FilterPlugin (gs.plugins.FilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
import gs.utils.tween.*;
public class FilterPlugin extends TweenPlugin {
protected var _remove:Boolean;
protected var _target:Object;
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function onCompleteTween():void{
var _local1:int;
var _local2:Array;
if (_remove){
_local2 = _target.filters;
if (!(_local2[_index] is _type)){
_local1 = (_local2.length - 1);
while (_local1 > -1) {
if ((_local2[_local1] is _type)){
_local2.splice(_local1, 1);
break;
};
_local1--;
};
} else {
_local2.splice(_index, 1);
};
_target.filters = _local2;
};
}
protected function initFilter(_arg1:Object, _arg2:BitmapFilter):void{
var _local4:String;
var _local5:int;
var _local6:HexColorsPlugin;
var _local3:Array = _target.filters;
_index = -1;
if (_arg1.index != null){
_index = _arg1.index;
} else {
_local5 = (_local3.length - 1);
while (_local5 > -1) {
if ((_local3[_local5] is _type)){
_index = _local5;
break;
};
_local5--;
};
};
if ((((((_index == -1)) || ((_local3[_index] == null)))) || ((_arg1.addFilter == true)))){
_index = ((_arg1.index)!=null) ? _arg1.index : _local3.length;
_local3[_index] = _arg2;
_target.filters = _local3;
};
_filter = _local3[_index];
_remove = Boolean((_arg1.remove == true));
if (_remove){
this.onComplete = onCompleteTween;
};
var _local7:Object = ((_arg1.isTV)==true) ? _arg1.exposedVars : _arg1;
for (_local4 in _local7) {
if (((((((((!((_local4 in _filter))) || ((_filter[_local4] == _local7[_local4])))) || ((_local4 == "remove")))) || ((_local4 == "index")))) || ((_local4 == "addFilter")))){
} else {
if ((((((_local4 == "color")) || ((_local4 == "highlightColor")))) || ((_local4 == "shadowColor")))){
_local6 = new HexColorsPlugin();
_local6.initColor(_filter, _local4, _filter[_local4], _local7[_local4]);
_tweens[_tweens.length] = new TweenInfo(_local6, "changeFactor", 0, 1, _local4, false);
} else {
if ((((((((_local4 == "quality")) || ((_local4 == "inner")))) || ((_local4 == "knockout")))) || ((_local4 == "hideObject")))){
_filter[_local4] = _local7[_local4];
} else {
addTween(_filter, _local4, _filter[_local4], _local7[_local4], _local4);
};
};
};
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Array = _target.filters;
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
if (!(_local4[_index] is _type)){
_index = (_local4.length - 1);
_local2 = (_local4.length - 1);
while (_local2 > -1) {
if ((_local4[_local2] is _type)){
_index = _local2;
break;
};
_local2--;
};
};
_local4[_index] = _filter;
_target.filters = _local4;
}
}
}//package gs.plugins
Section 143
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
protected var _target:MovieClip;
public var frame:int;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
}
}//package gs.plugins
Section 144
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function GlowFilterPlugin(){
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = GlowFilter;
initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout));
return (true);
}
}
}//package gs.plugins
Section 145
//HexColorsPlugin (gs.plugins.HexColorsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function HexColorsPlugin(){
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function killProps(_arg1:Object):void{
var _local2:int = (_colors.length - 1);
while (_local2 > -1) {
if (_arg1[_colors[_local2][1]] != undefined){
_colors.splice(_local2, 1);
};
_local2--;
};
super.killProps(_arg1);
}
public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg3 != _arg4){
_local5 = (_arg3 >> 16);
_local6 = ((_arg3 >> 8) & 0xFF);
_local7 = (_arg3 & 0xFF);
_colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)];
this.overwriteProps[this.overwriteProps.length] = _arg2;
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:Array;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
_local3 = _colors[_local2];
_local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7])));
_local2--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
for (_local4 in _arg2) {
initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4]));
};
return (true);
}
}
}//package gs.plugins
Section 146
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 147
//RoundPropsPlugin (gs.plugins.RoundPropsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class RoundPropsPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function RoundPropsPlugin(){
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
addTween(_arg1, _arg2, _arg3, (_arg3 + _arg4), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 148
//ShortRotationPlugin (gs.plugins.ShortRotationPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function ShortRotationPlugin(){
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
if (typeof(_arg2) == "number"){
trace("WARNING: You appear to be using the old shortRotation syntax. Instead of passing a number, please pass an object with properties that correspond to the rotations values For example, TweenMax.to(mc, 2, {shortRotation:{rotationX:-170, rotationY:25}})");
return (false);
};
for (_local4 in _arg2) {
initRotation(_arg1, _local4, _arg1[_local4], _arg2[_local4]);
};
return (true);
}
public function initRotation(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
var _local5:Number = ((_arg4 - _arg3) % 360);
if (((_arg4 - _arg3) % 360) != (_local5 % 180)){
_local5 = ((_local5)<0) ? (_local5 + 360) : (_local5 - 360);
};
addTween(_arg1, _arg2, _arg3, (_arg3 + _local5), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 149
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.geom.*;
import flash.display.*;
import gs.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _target:DisplayObject;
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_ct = _target.transform.colorTransform;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:ColorTransform = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _target.transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
}
}//package gs.plugins
Section 150
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var propName:String;
public var onComplete:Function;
public var round:Boolean;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new TweenInfo(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (this.overwriteProps.length - 1);
while (_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
_local2--;
};
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
if ((_tweens[_local2].name in _arg1)){
_tweens.splice(_local2, 1);
};
_local2--;
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
_local2 = (_arg1.length - 1);
while (_local2 > -1) {
_local3 = new (_arg1[_local2]);
TweenLite.plugins[_local3.propName] = _arg1[_local2];
_local2--;
};
return (true);
}
}
}//package gs.plugins
Section 151
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(_arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 152
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _target:Object;
protected var _st:SoundTransform;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
}
}//package gs.plugins
Section 153
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 154
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
}
}
}//package gs.utils.tween
Section 155
//OverwriteManager (gs.OverwriteManager)
package gs {
import flash.utils.*;
import gs.utils.tween.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL:int = 1;
public static const NONE:int = 0;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static const version:Number = 3.12;
public static var mode:int;
public static var enabled:Boolean;
public static function killVars(_arg1:Object, _arg2:Object, _arg3:Array):void{
var _local4:int;
var _local5:String;
var _local6:TweenInfo;
_local4 = (_arg3.length - 1);
while (_local4 > -1) {
_local6 = _arg3[_local4];
if ((_local6.name in _arg1)){
_arg3.splice(_local4, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_arg1);
if (_local6.target.overwriteProps.length == 0){
_arg3.splice(_local4, 1);
};
};
};
_local4--;
};
for (_local5 in _arg1) {
delete _arg2[_local5];
};
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Array):void{
var _local7:int;
var _local8:TweenLite;
var _local10:Array;
var _local11:Object;
var _local12:int;
var _local13:TweenInfo;
var _local14:Array;
var _local3:Object = _arg1.vars;
var _local4:int = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if ((((_local4 < 2)) || ((_arg2 == null)))){
return;
};
var _local5:Number = _arg1.startTime;
var _local6:Array = [];
var _local9 = -1;
_local7 = (_arg2.length - 1);
while (_local7 > -1) {
_local8 = _arg2[_local7];
if (_local8 == _arg1){
_local9 = _local7;
} else {
if ((((((_local7 < _local9)) && ((_local8.startTime <= _local5)))) && (((_local8.startTime + ((_local8.duration * 1000) / _local8.combinedTimeScale)) > _local5)))){
_local6[_local6.length] = _local8;
};
};
_local7--;
};
if ((((_local6.length == 0)) || ((_arg1.tweens.length == 0)))){
return;
};
if (_local4 == AUTO){
_local10 = _arg1.tweens;
_local11 = {};
_local7 = (_local10.length - 1);
while (_local7 > -1) {
_local13 = _local10[_local7];
if (_local13.isPlugin){
if (_local13.name == "_MULTIPLE_"){
_local14 = _local13.target.overwriteProps;
_local12 = (_local14.length - 1);
while (_local12 > -1) {
_local11[_local14[_local12]] = true;
_local12--;
};
} else {
_local11[_local13.name] = true;
};
_local11[_local13.target.propName] = true;
} else {
_local11[_local13.name] = true;
};
_local7--;
};
_local7 = (_local6.length - 1);
while (_local7 > -1) {
killVars(_local11, _local6[_local7].exposedVars, _local6[_local7].tweens);
_local7--;
};
} else {
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].enabled = false;
_local7--;
};
};
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 10.09){
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
}
}//package gs
Section 156
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import gs.utils.tween.*;
import gs.plugins.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var tweens:Array;
public var vars:Object;
public var ease:Function;
public var exposedVars:Object;
public var initTime:Number;
public var combinedTimeScale:Number;
public static const version:Number = 10.092;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if (((!((_arg1 in masterList))) || ((_local4 == 1)))){
masterList[_arg1] = [this];
} else {
masterList[_arg1].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
_local2[_local2.length] = this;
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && (this.target.hasOwnProperty("timeScale")))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (_local1 in this.exposedVars) {
if ((_local1 in _reservedProps)){
} else {
if ((_local1 in plugins)){
_local3 = new (plugins[_local1]);
if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
};
};
};
if (this.vars.runBackwards == true){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local4 = this.tweens[_local2];
this.tweens[_local2].start = (_local4.start + _local4.change);
_local4.change = -(_local4.change);
_local2--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.exposedVars, this.tweens);
};
}
public function complete(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){
this.tweens[_local2].target.onComplete();
};
_local2--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll(_arg1:Event=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local2:uint = (currentTime = getTimer());
var _local3:Dictionary = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && ((_arg1 in masterList)))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local3:Object;
var _local2:Dictionary = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 157
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import flash.utils.*;
import gs.utils.tween.*;
import gs.plugins.*;
import gs.events.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _dispatcher:EventDispatcher;
protected var _callbacks:Object;
public var pauseTime:Number;
protected var _repeatCount:Number;
protected var _timeScale:Number;
public static const version:Number = 10.12;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
protected static var _globalTimeScale:Number = 1;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _activatedPlugins:Boolean = TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin, HexColorsPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, BevelFilterPlugin, DropShadowFilterPlugin, GlowFilterPlugin, RoundPropsPlugin, BezierPlugin, BezierThroughPlugin, ShortRotationPlugin]);
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
if (TweenLite.version < 10.092){
trace("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
};
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenMax)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if ((((_arg2 == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
_repeatCount = 0;
if (((!(isNaN(this.vars.yoyo))) || (!(isNaN(this.vars.loop))))){
this.vars.persist = true;
};
if ((((this.delay == 0)) && (!((this.vars.startAt == null))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
}
public function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function set reversed(_arg1:Boolean):void{
if (this.reversed != _arg1){
reverse();
};
}
public function get progress():Number{
var _local1:Number = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
var _local2:Number = (((((_local1 - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (_local2 > 1){
return (1);
};
if (_local2 < 0){
return (0);
};
return (_local2);
}
override public function set enabled(_arg1:Boolean):void{
if (!_arg1){
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
super.enabled = _arg1;
if (_arg1){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local5:int;
var _local6:TweenInfo;
var _local7:Object;
var _local8:Object;
var _local9:Array;
var _local10:Boolean;
var _local11:Array;
var _local12:Object;
var _local4:Number = this.progress;
if (this.initted){
if (!_arg3){
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
_local6.target[_local6.property] = _local6.start;
};
_local5--;
};
};
_local7 = this.vars;
_local8 = this.exposedVars;
_local9 = this.tweens;
_local10 = _hasPlugins;
this.tweens = [];
this.vars = (this.exposedVars = {});
this.vars[_arg1] = _arg2;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((_local7.ease is Function)))){
this.ease = _local7.ease;
};
if (((_arg3) && (!((_local4 == 0))))){
adjustStartValues();
};
_local11 = this.tweens;
this.vars = _local7;
this.exposedVars = _local8;
this.tweens = _local9;
_local12 = {};
_local12[_arg1] = true;
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
this.tweens.splice(_local5, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_local12);
if (_local6.target.overwriteProps.length == 0){
this.tweens.splice(_local5, 1);
};
};
};
_local5--;
};
this.tweens = this.tweens.concat(_local11);
_hasPlugins = Boolean(((_local10) || (_hasPlugins)));
};
this.vars[_arg1] = (this.exposedVars[_arg1] = _arg2);
}
override public function initTweenVals():void{
var _local1:int;
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:Array;
var _local6:Object;
var _local7:TweenInfo;
if (((!((this.vars.startAt == null))) && (!((this.delay == 0))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
super.initTweenVals();
if ((((this.exposedVars.roundProps is Array)) && (!((TweenLite.plugins.roundProps == null))))){
_local5 = this.exposedVars.roundProps;
_local1 = (_local5.length - 1);
while (_local1 > -1) {
_local3 = _local5[_local1];
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local7 = this.tweens[_local2];
if (_local7.name == _local3){
if (_local7.isPlugin){
_local7.target.round = true;
} else {
if (_local6 == null){
_local6 = new TweenLite.plugins.roundProps();
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
_hasPlugins = true;
this.tweens[_local2] = new TweenInfo(_local6, "changeFactor", 0, 1, _local3, true);
} else {
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
this.tweens.splice(_local2, 1);
};
};
} else {
if (((((_local7.isPlugin) && ((_local7.name == "_MULTIPLE_")))) && (!(_local7.target.round)))){
_local4 = ((" " + _local7.target.overwriteProps.join(" ")) + " ");
if (_local4.indexOf(((" " + _local3) + " ")) != -1){
_local7.target.round = true;
};
};
};
_local2--;
};
_local1--;
};
};
}
public function restart(_arg1:Boolean=false):void{
if (_arg1){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
_repeatCount = 0;
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
_pausedTweens[this] = null;
delete _pausedTweens[this];
this.enabled = true;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if ((((_arg1 == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
protected function adjustStartValues():void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:TweenInfo;
var _local6:int;
var _local1:Number = this.progress;
if (_local1 != 0){
_local2 = this.ease(_local1, 0, 1, 1);
_local3 = (1 / (1 - _local2));
_local6 = (this.tweens.length - 1);
while (_local6 > -1) {
_local5 = this.tweens[_local6];
_local4 = (_local5.start + _local5.change);
if (_local5.isPlugin){
_local5.change = ((_local4 - _local2) * _local3);
} else {
_local5.change = ((_local4 - _local5.target[_local5.property]) * _local3);
};
_local5.start = (_local4 - _local5.change);
_local6--;
};
};
}
override public function render(_arg1:uint):void{
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
var _local2:Number = (((_arg1 - this.startTime) * 0.001) * this.combinedTimeScale);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
protected function initDispatcher():void{
var _local1:Object;
var _local2:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
if (this.vars.isTV == true){
this.vars = this.vars.clone();
} else {
_local1 = {};
for (_local2 in this.vars) {
_local1[_local2] = this.vars[_local2];
};
this.vars = _local1;
};
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
public function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
public function get repeatCount():Number{
return (_repeatCount);
}
public function reverse(_arg1:Boolean=true, _arg2:Boolean=true):void{
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
var _local3:Number = this.progress;
if (((_arg1) && ((_local3 > 0)))){
this.startTime = (currentTime - ((((1 - _local3) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (_arg2 != false){
if (_local3 < 1){
resume();
} else {
restart();
};
};
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
pause();
} else {
resume();
};
}
public function resume():void{
this.enabled = true;
if (!isNaN(this.pauseTime)){
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
public function get paused():Boolean{
return (!(isNaN(this.pauseTime)));
}
public function set repeatCount(_arg1:Number):void{
_repeatCount = _arg1;
}
public function reverseEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.ease((_arg4 - _arg1), _arg2, _arg3, _arg4));
}
public function killProperties(_arg1:Array):void{
var _local3:int;
var _local2:Object = {};
_local3 = (_arg1.length - 1);
while (_local3 > -1) {
_local2[_arg1[_local3]] = true;
_local3--;
};
killVars(_local2);
}
public function set progress(_arg1:Number):void{
this.startTime = (currentTime - ((this.duration * _arg1) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
override public function complete(_arg1:Boolean=false):void{
if (((((!(isNaN(this.vars.yoyo))) && ((((_repeatCount < this.vars.yoyo)) || ((this.vars.yoyo == 0)))))) || (((!(isNaN(this.vars.loop))) && ((((_repeatCount < this.vars.loop)) || ((this.vars.loop == 0)))))))){
_repeatCount++;
if (!isNaN(this.vars.yoyo)){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = (_arg1) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete(_arg1);
}
public function set timeScale(_arg1:Number):void{
if (_arg1 < 1E-5){
_arg1 = (_timeScale = 1E-5);
} else {
_timeScale = _arg1;
_arg1 = (_arg1 * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / _arg1))) - (this.delay * (1000 / _arg1)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / _arg1)));
};
this.combinedTimeScale = _arg1;
}
public function invalidate(_arg1:Boolean=true):void{
var _local2:Number;
if (this.initted){
_local2 = this.progress;
if (((!(_arg1)) && (!((_local2 == 0))))){
this.progress = 0;
};
this.tweens = [];
_hasPlugins = false;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (_local2 != 0){
if (_arg1){
adjustStartValues();
} else {
this.progress = _local2;
};
};
};
}
public function get timeScale():Number{
return (_timeScale);
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(true, _arg1, _arg2);
}
public static function killAllDelayedCalls(_arg1:Boolean=false):void{
killAll(_arg1, false, true);
}
public static function setGlobalTimeScale(_arg1:Number):void{
var _local3:int;
var _local4:Array;
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
var _local2:Dictionary = masterList;
_globalTimeScale = _arg1;
for each (_local4 in _local2) {
_local3 = (_local4.length - 1);
while (_local3 > -1) {
if ((_local4[_local3] is TweenMax)){
_local4[_local3].timeScale = (_local4[_local3].timeScale * 1);
};
_local3--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function getTweensOf(_arg1:Object):Array{
var _local4:TweenLite;
var _local5:int;
var _local2:Array = masterList[_arg1];
var _local3:Array = [];
if (_local2 != null){
_local5 = (_local2.length - 1);
while (_local5 > -1) {
if (!_local2[_local5].gc){
_local3[_local3.length] = _local2[_local5];
};
_local5--;
};
};
for each (_local4 in _pausedTweens) {
if (_local4.target == _arg1){
_local3[_local3.length] = _local4;
};
};
return (_local3);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, persist:_arg4, overwrite:0}));
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:Array = getTweensOf(_arg1);
var _local3:int = (_local2.length - 1);
while (_local3 > -1) {
if (((((_local2[_local3].active) || ((_local2[_local3].startTime == currentTime)))) && (!(_local2[_local3].gc)))){
return (true);
};
_local3--;
};
return (false);
}
public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local4[_local6] is TweenMax)) && ((((_local5 == _arg3)) || (!((_local5 == _arg2))))))){
_local4[_local6].paused = _arg1;
};
_local6--;
};
}
public static function killAllTweens(_arg1:Boolean=false):void{
killAll(_arg1, true, false);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local5:Boolean;
var _local6:int;
var _local4:Array = getAllTweens();
_local6 = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
_local4[_local6].clear();
} else {
TweenLite.removeTween(_local4[_local6], true);
};
};
_local6--;
};
}
public static function getAllTweens():Array{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
var _local1:Dictionary = masterList;
var _local2:Array = [];
for each (_local3 in _local1) {
_local4 = (_local3.length - 1);
while (_local4 > -1) {
if (!_local3[_local4].gc){
_local2[_local2.length] = _local3[_local4];
};
_local4--;
};
};
for each (_local5 in _pausedTweens) {
_local2[_local2.length] = _local5;
};
return (_local2);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(false, _arg1, _arg2);
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 158
//Level (Levels.Level)
package Levels {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import flash.geom.*;
import flash.display.*;
public class Level extends Sprite {
private var myTerrain:Sprite;
private var arrayOfGold:Array;
private var world:b2World;
public function setTerrain(_arg1:Sprite){
myTerrain = _arg1;
}
public function setBonussArray():Array{
return (arrayOfGold);
}
public function removeHisChild(){
parent.removeChild(this);
}
public function setTIME():int{
return (0);
}
public function addToBonusArray(_arg1:Object){
arrayOfGold.push(_arg1);
}
public function setWorld(_arg1:b2World){
world = _arg1;
arrayOfGold = new Array();
}
public function setCubePoints(_arg1:Point, _arg2:Point){
var newBody:b2Body;
var p1 = _arg1;
var p2 = _arg2;
var makeLine:Function = function (_arg1:b2Body, _arg2:Point, _arg3:Point){
var _local4:b2PolygonDef;
_local4 = new b2PolygonDef();
var _local5:Number = (_arg2.x - _arg3.x);
var _local6:Number = (_arg2.y - _arg3.y);
var _local7:* = (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))) * 0.5);
var _local8:* = Math.atan2(_local6, _local5);
_local4.SetAsBox(_local7, 0.1);
_local4.friction = 500;
_local4.restitution = 0;
_local4.filter.groupIndex = -2;
_arg1.CreateShape(_local4);
_arg1.SetXForm(new b2Vec2((_arg2.x - (Math.cos(_local8) * _local7)), (_arg2.y - (Math.sin(_local8) * _local7))), _local8);
};
var bodyDef:* = new b2BodyDef();
bodyDef.position = new b2Vec2(0, 0);
bodyDef.angle = 0;
newBody = world.CreateBody(bodyDef);
makeLine(newBody, p1, p2);
}
public function getWorld():b2World{
return (world);
}
public function getTerrain():Sprite{
return (myTerrain);
}
}
}//package Levels
Section 159
//Level1 (Levels.Level1)
package Levels {
import Box2D.Dynamics.*;
import flash.geom.*;
import flash.display.*;
import Clases.*;
import Bonus.*;
public class Level1 extends Level {
const TIME_LEVEL:int = 4000;
private var warry:Warray;
private var terrainShape:ShapeLevel1;
public function Level1(_arg1:b2World){
terrainShape = new ShapeLevel1();
warry = new Warray();
super();
super.setWorld(_arg1);
generateLevel();
}
public function getTerrainShape():Sprite{
return (terrainShape);
}
public function getWarrayShape():Sprite{
return (warry);
}
private function putTheBonuses(){
var _local1:PrimerBonus = new PrimerBonus();
_local1.x = 380;
_local1.y = 20;
addChild(_local1);
super.addToBonusArray(_local1);
var _local2:SegundoBonus = new SegundoBonus();
_local2.x = 1100;
_local2.y = 40;
addChild(_local2);
super.addToBonusArray(_local2);
var _local3:PrimerBonus = new PrimerBonus();
_local3.x = 1500;
_local3.y = 40;
addChild(_local3);
super.addToBonusArray(_local3);
var _local4:TercerBonus = new TercerBonus();
_local4.x = 1750;
_local4.y = -80;
addChild(_local4);
super.addToBonusArray(_local4);
var _local5:PrimerBonus = new PrimerBonus();
_local5.x = 2700;
_local5.y = 0;
addChild(_local5);
super.addToBonusArray(_local5);
var _local6:TercerBonus = new TercerBonus();
_local6.x = 5800;
_local6.y = -150;
addChild(_local6);
super.addToBonusArray(_local6);
}
public function generateLevel(){
addChild(warry);
addChild(terrainShape);
super.setTerrain(terrainShape);
drawTerrainOfLevel();
putTheBonuses();
}
public function removeCurrentLevel(){
warry.destroyWarray();
}
override public function setTIME():int{
return (TIME_LEVEL);
}
private function drawTerrainOfLevel(){
var _local2:Point;
var _local1:Array = new Array();
_local2 = new Point();
_local2.x = 0;
_local2.y = -10;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 0;
_local2.y = 8;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 10.7846;
_local2.y = 8;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 13.2845;
_local2.y = 5.9679;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 15.7691;
_local2.y = 6.1822;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 18.238;
_local2.y = 6.5698;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 20.6685;
_local2.y = 7.1477;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 23.1179;
_local2.y = 7.4363;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 25.3683;
_local2.y = 6.3614;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 27.843;
_local2.y = 6.1959;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 30.25;
_local2.y = 6.7552;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 32.5073;
_local2.y = 7.8274;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 34.964;
_local2.y = 8.287;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 37.3603;
_local2.y = 7.6877;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 39.5761;
_local2.y = 6.53;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 41.7518;
_local2.y = 5.3035;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 44.076;
_local2.y = 4.5947;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 46.2949;
_local2.y = 5.7134;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 48.3498;
_local2.y = 7.1356;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 50.4817;
_local2.y = 8.3812;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 52.9063;
_local2.y = 8.9904;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 55.3948;
_local2.y = 9.1785;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 57.8871;
_local2.y = 9.047;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 60.2921;
_local2.y = 8.5038;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 62.6262;
_local2.y = 7.6214;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 65.0147;
_local2.y = 6.8832;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 67.4106;
_local2.y = 6.1983;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 69.9027;
_local2.y = 6.0992;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 72.3854;
_local2.y = 5.9204;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.8396;
_local2.y = 6.3873;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 77.3165;
_local2.y = 6.727;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 79.8066;
_local2.y = 6.817;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 82.3055;
_local2.y = 6.7503;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 84.8052;
_local2.y = 6.7924;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 87.0568;
_local2.y = 6.0401;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 88.3254;
_local2.y = 3.9033;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 90.602;
_local2.y = 3.7872;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 92.9746;
_local2.y = 4.5653;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 95.4064;
_local2.y = 5.1301;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 97.8879;
_local2.y = 5.4199;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 100.3775;
_local2.y = 5.4172;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 102.8759;
_local2.y = 5.3777;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 105.3753;
_local2.y = 5.4324;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 107.8749;
_local2.y = 5.4688;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 110.3704;
_local2.y = 5.3613;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 112.6963;
_local2.y = 4.4918;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 115.0264;
_local2.y = 3.5982;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 117.513;
_local2.y = 3.5252;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 119.5805;
_local2.y = 4.6804;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 121.7551;
_local2.y = 5.8481;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 124.2449;
_local2.y = 6.0527;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 126.7442;
_local2.y = 6.0957;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 129.2153;
_local2.y = 5.7165;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 131.7118;
_local2.y = 5.5852;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 134.2108;
_local2.y = 5.5211;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 136.7103;
_local2.y = 5.4697;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 139.2098;
_local2.y = 5.5186;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 141.6591;
_local2.y = 5.9878;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 144.0825;
_local2.y = 6.601;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 146.5033;
_local2.y = 7.2253;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 148.9241;
_local2.y = 7.8496;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 151.2935;
_local2.y = 8.6395;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 153.7401;
_local2.y = 9.0295;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 156.2278;
_local2.y = 8.9212;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 158.4466;
_local2.y = 8.0015;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 160.5853;
_local2.y = 6.7268;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 162.8835;
_local2.y = 5.7805;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 165.2996;
_local2.y = 5.1385;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 167.7619;
_local2.y = 5.4633;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 170.2182;
_local2.y = 5.916;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 172.6161;
_local2.y = 6.6232;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 175.0981;
_local2.y = 6.7579;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 177.5973;
_local2.y = 6.7307;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 180.0882;
_local2.y = 6.5446;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 182.5524;
_local2.y = 6.1368;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 184.7746;
_local2.y = 5.0359;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 187.2304;
_local2.y = 4.8759;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 189.5714;
_local2.y = 5.7531;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 191.9474;
_local2.y = 6.4403;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 194.4442;
_local2.y = 6.5671;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 196.9437;
_local2.y = 6.6136;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 199.3487;
_local2.y = 5.9339;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 201.8103;
_local2.y = 5.5264;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 204.2523;
_local2.y = 4.9967;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 206.6522;
_local2.y = 4.4488;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 209.1359;
_local2.y = 4.6459;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 211.5661;
_local2.y = 5.1965;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 213.9408;
_local2.y = 5.9779;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 216.2991;
_local2.y = 6.805;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 218.7553;
_local2.y = 7.208;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 221.221;
_local2.y = 7.0588;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 223.5796;
_local2.y = 6.2311;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 225.9891;
_local2.y = 5.7098;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 228.4485;
_local2.y = 5.4115;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 230.8694;
_local2.y = 5.8372;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 233.2201;
_local2.y = 6.6851;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 235.1764;
_local2.y = 8.0244;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 237.6;
_local2.y = 8.4078;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 240.0931;
_local2.y = 8.2531;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 242.1991;
_local2.y = 6.9471;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 243.9333;
_local2.y = 5.152;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 246.2139;
_local2.y = 4.4366;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 248.7128;
_local2.y = 4.3628;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 251.2128;
_local2.y = 4.3767;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 253.6359;
_local2.y = 4.9009;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 256.0989;
_local2.y = 5.2418;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 258.5931;
_local2.y = 5.4106;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 261.0914;
_local2.y = 5.4994;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 263.591;
_local2.y = 5.526;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 266.0041;
_local2.y = 6.0722;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 268.3667;
_local2.y = 6.8882;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 270.8288;
_local2.y = 7.2997;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 273.3228;
_local2.y = 7.3468;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 275.8076;
_local2.y = 7.1703;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 278.1395;
_local2.y = 6.5;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 279.8004;
_local2.y = 4.6918;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 281.0013;
_local2.y = 2.5037;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 282.6465;
_local2.y = 0.7133;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 285.0729;
_local2.y = 0.5044;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 287.5696;
_local2.y = 0.6273;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 290.0428;
_local2.y = 0.3029;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 292.373;
_local2.y = -0.1478;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 294.0855;
_local2.y = 1.5546;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 295.904;
_local2.y = 3.268;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 297.7529;
_local2.y = 4.905;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 300.0661;
_local2.y = 5.8022;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 302.5647;
_local2.y = 5.8301;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 305.0647;
_local2.y = 5.8429;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 312.0213;
_local2.y = 4.1653;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 345.0213;
_local2.y = 4.1653;
_local1.push(_local2);
warry.setingUp(_local2.x, _local2.y, super.getWorld());
_local2 = new Point();
_local2.x = 345.0213;
_local2.y = -15;
_local1.push(_local2);
var _local3:int;
while (_local3 < (_local1.length - 1)) {
setCubePoints(_local1[_local3], _local1[(_local3 + 1)]);
_local3++;
};
}
}
}//package Levels
Section 160
//Level2 (Levels.Level2)
package Levels {
import Box2D.Dynamics.*;
import flash.geom.*;
import flash.display.*;
import Clases.*;
import Bonus.*;
public class Level2 extends Level {
const TIME_LEVEL:int = 2500;
private var warry:Warray;
private var terrainShape:ShapeLevel2;
public function Level2(_arg1:b2World){
terrainShape = new ShapeLevel2();
warry = new Warray();
super();
super.setWorld(_arg1);
generateLevel();
}
public function getTerrainShape():Sprite{
return (terrainShape);
}
public function getWarrayShape():Sprite{
return (warry);
}
private function putTheBonuses(){
var _local1:CuartoBonus = new CuartoBonus();
_local1.x = 1800;
_local1.y = -200;
addChild(_local1);
super.addToBonusArray(_local1);
var _local2:PrimerBonus = new PrimerBonus();
_local2.x = 2650;
_local2.y = 150;
addChild(_local2);
super.addToBonusArray(_local2);
var _local3:PrimerBonus = new PrimerBonus();
_local3.x = 3450;
_local3.y = 160;
addChild(_local3);
super.addToBonusArray(_local3);
var _local4:SegundoBonus = new SegundoBonus();
_local4.x = 5900;
_local4.y = -50;
addChild(_local4);
super.addToBonusArray(_local4);
var _local5:SegundoBonus = new SegundoBonus();
_local5.x = 7200;
_local5.y = 0;
addChild(_local5);
super.addToBonusArray(_local5);
var _local6:TercerBonus = new TercerBonus();
_local6.x = 7900;
_local6.y = -95;
addChild(_local6);
super.addToBonusArray(_local6);
}
public function generateLevel(){
addChild(warry);
addChild(terrainShape);
super.setTerrain(terrainShape);
drawTerrainOfLevel();
putTheBonuses();
}
public function removeCurrentLevel(){
warry.destroyWarray();
}
override public function setTIME():int{
return (TIME_LEVEL);
}
public function drawTerrainOfLevel(){
var _local2:Point;
var _local1:Array = new Array();
_local2 = new Point();
_local2.x = 0;
_local2.y = 0;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 0;
_local2.y = 8.4754;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 1.4425;
_local2.y = 8.4754;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 3.9423;
_local2.y = 8.5073;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 6.4193;
_local2.y = 8.6991;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 8.828;
_local2.y = 9.3685;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 11.2979;
_local2.y = 9.6885;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 13.7881;
_local2.y = 9.5537;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 16.226;
_local2.y = 9.0083;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 18.5737;
_local2.y = 8.149;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 21.0435;
_local2.y = 7.9457;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 23.5312;
_local2.y = 8.1321;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 25.9931;
_local2.y = 8.4802;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 28.4691;
_local2.y = 8.752;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 30.9456;
_local2.y = 8.7605;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 33.4013;
_local2.y = 8.3009;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 35.8935;
_local2.y = 8.1206;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 38.3909;
_local2.y = 8.0222;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 40.8501;
_local2.y = 7.6178;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 43.2759;
_local2.y = 7.0166;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 45.6876;
_local2.y = 6.3619;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 48.1467;
_local2.y = 6.0902;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 50.6108;
_local2.y = 6.482;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 52.8423;
_local2.y = 7.5364;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 55.0637;
_local2.y = 8.6155;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 57.4555;
_local2.y = 9.3429;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 59.9403;
_local2.y = 9.4359;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 62.372;
_local2.y = 10.0164;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 64.8156;
_local2.y = 10.4643;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 67.3146;
_local2.y = 10.4292;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 69.8077;
_local2.y = 10.2716;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 72.0757;
_local2.y = 9.2264;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.1467;
_local2.y = 7.8514;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 76.0629;
_local2.y = 6.2785;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 77.293;
_local2.y = 4.134;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 79.1509;
_local2.y = 2.5647;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 81.5816;
_local2.y = 2.3601;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 83.9767;
_local2.y = 2.932;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 85.6894;
_local2.y = 4.7461;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 87.7532;
_local2.y = 6.0388;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 90.0406;
_local2.y = 7.045;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 92.2983;
_local2.y = 8.1188;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 94.6416;
_local2.y = 8.9415;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 97.1353;
_local2.y = 9.0191;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 99.6328;
_local2.y = 8.9601;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 102.1254;
_local2.y = 9.147;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 104.6109;
_local2.y = 9.0379;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 107.0121;
_local2.y = 8.3642;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 109.4109;
_local2.y = 7.6714;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 111.8738;
_local2.y = 7.2926;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 114.186;
_local2.y = 6.3908;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 116.6179;
_local2.y = 5.9725;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 119.0405;
_local2.y = 5.3639;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 121.5176;
_local2.y = 5.0744;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 123.9792;
_local2.y = 5.4048;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 126.314;
_local2.y = 6.2984;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 128.5449;
_local2.y = 7.4001;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 130.6871;
_local2.y = 8.6836;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 133.0792;
_local2.y = 9.4073;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 135.5143;
_local2.y = 9.9489;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 138.0127;
_local2.y = 10.0362;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 140.4835;
_local2.y = 9.7773;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 142.9019;
_local2.y = 9.1509;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 145.3858;
_local2.y = 9.0317;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 147.8013;
_local2.y = 8.4161;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 150.1456;
_local2.y = 7.5695;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 152.6321;
_local2.y = 7.3261;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 155.0189;
_local2.y = 6.6081;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 157.3968;
_local2.y = 5.8829;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 159.8683;
_local2.y = 5.5432;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 162.3637;
_local2.y = 5.5976;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 164.6284;
_local2.y = 6.4069;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 166.8104;
_local2.y = 7.606;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 168.9074;
_local2.y = 8.8838;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 171.2616;
_local2.y = 9.7007;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 173.7528;
_local2.y = 9.8054;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 176.2515;
_local2.y = 9.768;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 178.723;
_local2.y = 9.4176;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 181.1851;
_local2.y = 8.9835;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 183.6515;
_local2.y = 8.7189;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 186.0934;
_local2.y = 8.2096;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 188.4304;
_local2.y = 7.4366;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 190.9053;
_local2.y = 7.4997;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 193.3755;
_local2.y = 7.1169;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 195.834;
_local2.y = 6.6756;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 198.2589;
_local2.y = 7.1628;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 200.0559;
_local2.y = 8.8037;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 202.2524;
_local2.y = 9.9196;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 204.7335;
_local2.y = 10.2233;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 207.2176;
_local2.y = 10.5047;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 209.7077;
_local2.y = 10.6609;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 212.2028;
_local2.y = 10.5051;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 214.6429;
_local2.y = 10.9421;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 217.0791;
_local2.y = 11.4702;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 219.5612;
_local2.y = 11.3873;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 220.9254;
_local2.y = 9.4936;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 222.5076;
_local2.y = 7.5855;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 224.4989;
_local2.y = 6.0844;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 226.7639;
_local2.y = 5.0623;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 229.2161;
_local2.y = 4.6948;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 231.6834;
_local2.y = 5.0144;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 234.0976;
_local2.y = 5.6341;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 236.2996;
_local2.y = 6.8178;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 238.2555;
_local2.y = 8.3431;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 240.4147;
_local2.y = 9.5259;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 242.8122;
_local2.y = 10.1144;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 245.31;
_local2.y = 10.1869;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 247.8099;
_local2.y = 10.1689;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 250.2111;
_local2.y = 9.577;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 252.3872;
_local2.y = 8.3628;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 254.7686;
_local2.y = 7.6129;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 257.2256;
_local2.y = 7.1762;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 259.7254;
_local2.y = 7.1635;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 262.1123;
_local2.y = 7.7886;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 264.4219;
_local2.y = 8.7453;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 266.8033;
_local2.y = 9.5021;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 269.0155;
_local2.y = 10.6614;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 271.4753;
_local2.y = 11.0764;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 273.9753;
_local2.y = 11.0934;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 276.4752;
_local2.y = 11.1103;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 278.9717;
_local2.y = 11.2251;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 281.4432;
_local2.y = 11.0864;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 283.5407;
_local2.y = 9.8203;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 284.9088;
_local2.y = 7.8077;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 286.3374;
_local2.y = 5.7971;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 288.5914;
_local2.y = 4.7402;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 291.0213;
_local2.y = 4.1653;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 293.4939;
_local2.y = 4.2864;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 295.7071;
_local2.y = 5.2142;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 296.8055;
_local2.y = 7.4524;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 298.5612;
_local2.y = 9.2187;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 300.8142;
_local2.y = 10.0965;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 303.2155;
_local2.y = 9.4282;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 305.6594;
_local2.y = 9.0547;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 308.1536;
_local2.y = 9.1975;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 310.6211;
_local2.y = 8.8745;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 313.008;
_local2.y = 8.1439;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 315.3261;
_local2.y = 7.2321;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 317.8235;
_local2.y = 7.1195;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 320.2805;
_local2.y = 6.6596;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 322.7492;
_local2.y = 6.2776;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 325.1738;
_local2.y = 6.708;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 327.3471;
_local2.y = 7.9302;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 329.5829;
_local2.y = 9.0445;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 332.0189;
_local2.y = 9.4504;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 334.5139;
_local2.y = 9.6095;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 337.0108;
_local2.y = 9.7185;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 339.5105;
_local2.y = 9.7573;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 342.0102;
_local2.y = 9.7961;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 344.4515;
_local2.y = 10.2881;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 346.8761;
_local2.y = 10.8975;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 349.3066;
_local2.y = 10.7841;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 350.5946;
_local2.y = 8.6879;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 351.9464;
_local2.y = 6.6149;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 354.0919;
_local2.y = 5.4791;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 356.5837;
_local2.y = 5.5909;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 358.797;
_local2.y = 6.5585;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 360.5479;
_local2.y = 8.3403;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 362.721;
_local2.y = 9.5629;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 365.1539;
_local2.y = 10.1099;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 367.5183;
_local2.y = 9.668;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 369.593;
_local2.y = 8.284;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 371.8922;
_local2.y = 7.3839;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 374.3872;
_local2.y = 7.4987;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 376.7222;
_local2.y = 8.3397;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 378.8622;
_local2.y = 9.5628;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 381.3216;
_local2.y = 9.9178;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 383.7881;
_local2.y = 9.7218;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 386.2756;
_local2.y = 9.7983;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 388.5655;
_local2.y = 9.0087;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 389.892;
_local2.y = 6.8961;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 390.9248;
_local2.y = 4.6206;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 392.307;
_local2.y = 2.6123;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 394.6548;
_local2.y = 2.2777;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 397.0588;
_local2.y = 2.8387;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 399.1253;
_local2.y = 4.2441;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 401.2886;
_local2.y = 5.4851;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 403.4733;
_local2.y = 6.3917;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 405.9733;
_local2.y = 6.3917;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 408.4733;
_local2.y = 6.3917;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 410.9733;
_local2.y = 6.3917;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 413.4733;
_local2.y = 6.3917;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 435;
_local2.y = 6.3917;
_local1.push(_local2);
warry.setingUp(_local2.x, _local2.y, super.getWorld());
_local2 = new Point();
_local2.x = 435;
_local2.y = -5;
_local1.push(_local2);
var _local3:int;
while (_local3 < (_local1.length - 1)) {
setCubePoints(_local1[_local3], _local1[(_local3 + 1)]);
_local3++;
};
}
}
}//package Levels
Section 161
//Level3 (Levels.Level3)
package Levels {
import Box2D.Dynamics.*;
import flash.geom.*;
import flash.display.*;
import Clases.*;
import Bonus.*;
public class Level3 extends Level {
const TIME_LEVEL:int = 2500;
private var warry:Warray;
private var terrainShape:ShapeLevel3;
public function Level3(_arg1:b2World){
terrainShape = new ShapeLevel3();
warry = new Warray();
super();
super.setWorld(_arg1);
generateLevel();
}
public function getTerrainShape():Sprite{
return (terrainShape);
}
public function getWarrayShape():Sprite{
return (warry);
}
private function putTheBonuses(){
var _local1:CuartoBonus = new CuartoBonus();
_local1.x = 450;
_local1.y = 30;
addChild(_local1);
super.addToBonusArray(_local1);
var _local2:SegundoBonus = new SegundoBonus();
_local2.x = 3250;
_local2.y = -120;
addChild(_local2);
super.addToBonusArray(_local2);
var _local3:TercerBonus = new TercerBonus();
_local3.x = 4550;
_local3.y = -85;
addChild(_local3);
super.addToBonusArray(_local3);
var _local4:PrimerBonus = new PrimerBonus();
_local4.x = 5900;
_local4.y = 150;
addChild(_local4);
super.addToBonusArray(_local4);
var _local5:SegundoBonus = new SegundoBonus();
_local5.x = 6865;
_local5.y = -320;
addChild(_local5);
super.addToBonusArray(_local5);
var _local6:PrimerBonus = new PrimerBonus();
_local6.x = 7950;
_local6.y = 100;
addChild(_local6);
super.addToBonusArray(_local6);
}
public function generateLevel(){
addChild(warry);
addChild(terrainShape);
drawTerrainOfLevel();
putTheBonuses();
}
public function removeCurrentLevel(){
warry.destroyWarray();
}
override public function setTIME():int{
return (TIME_LEVEL);
}
public function drawTerrainOfLevel(){
var _local2:Point;
var _local1:Array = new Array();
_local2 = new Point();
_local2.x = 0;
_local2.y = -5;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 0;
_local2.y = 8.8198;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 9.8413;
_local2.y = 8.9682;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 12.0008;
_local2.y = 9.6629;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 13.8577;
_local2.y = 11.2353;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 16.199;
_local2.y = 11.9952;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 18.6764;
_local2.y = 12.3309;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 21.1694;
_local2.y = 12.2022;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 23.2949;
_local2.y = 11.0397;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 24.1573;
_local2.y = 8.7122;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 26.2873;
_local2.y = 7.8101;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 28.77;
_local2.y = 7.5874;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 31.2632;
_local2.y = 7.7719;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 33.7564;
_local2.y = 7.9564;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 36.1005;
_local2.y = 8.7237;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 38.3829;
_local2.y = 9.7412;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 40.7291;
_local2.y = 10.5932;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 43.0066;
_local2.y = 11.6243;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 45.284;
_local2.y = 12.6555;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 47.3068;
_local2.y = 14.0691;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 49.1363;
_local2.y = 15.7729;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 51.4415;
_local2.y = 16.3726;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 53.9364;
_local2.y = 16.5321;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 56.4316;
_local2.y = 16.6873;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 58.9252;
_local2.y = 16.8576;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 61.4057;
_local2.y = 17.1694;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 63.8586;
_local2.y = 17.3103;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 66.1154;
_local2.y = 16.2348;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 68.4092;
_local2.y = 15.2606;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 70.808;
_local2.y = 15.1659;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 71.3604;
_local2.y = 17.3653;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 71.2797;
_local2.y = 19.864;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 71.1991;
_local2.y = 22.3627;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 71.1184;
_local2.y = 24.8614;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 71.5628;
_local2.y = 26.8468;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.0627;
_local2.y = 26.8231;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.5897;
_local2.y = 24.7688;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.6854;
_local2.y = 22.2706;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.781;
_local2.y = 19.7724;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.8767;
_local2.y = 17.2743;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.9724;
_local2.y = 14.7761;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 76.6508;
_local2.y = 13.9506;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 79.0755;
_local2.y = 14.485;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 81.1895;
_local2.y = 15.611;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 83.6544;
_local2.y = 15.4071;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 86.0607;
_local2.y = 14.729;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 87.8095;
_local2.y = 13.0664;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 89.5573;
_local2.y = 11.3281;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 91.6892;
_local2.y = 10.0224;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 93.6985;
_local2.y = 8.5538;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 95.543;
_local2.y = 6.8663;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 97.3875;
_local2.y = 5.1787;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 99.6205;
_local2.y = 4.0821;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 101.9584;
_local2.y = 3.2669;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 104.4206;
_local2.y = 2.834;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 106.9199;
_local2.y = 2.845;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 109.3805;
_local2.y = 3.0965;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 111.7474;
_local2.y = 3.9012;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 114.0614;
_local2.y = 4.8255;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 116.1063;
_local2.y = 6.2406;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 118.2359;
_local2.y = 7.52;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 120.3856;
_local2.y = 8.7894;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 122.845;
_local2.y = 9.2379;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 125.3044;
_local2.y = 9.6865;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 127.8001;
_local2.y = 9.7345;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 130.2744;
_local2.y = 9.4284;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 132.7695;
_local2.y = 9.4031;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 135.1472;
_local2.y = 10.1498;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 137.1564;
_local2.y = 11.6003;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 139.5314;
_local2.y = 12.3751;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 141.9851;
_local2.y = 12.794;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 144.4379;
_local2.y = 12.4894;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 146.8209;
_local2.y = 11.7334;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 149.2056;
_local2.y = 10.9829;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 151.0431;
_local2.y = 9.3554;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 152.2991;
_local2.y = 7.2206;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 153.3355;
_local2.y = 4.9467;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 154.6126;
_local2.y = 2.8306;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 156.3508;
_local2.y = 1.0594;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 158.4645;
_local2.y = -0.1786;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 160.9528;
_local2.y = -0.42;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 163.4496;
_local2.y = -0.3988;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 165.9188;
_local2.y = -0.0705;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 168.3052;
_local2.y = 0.6249;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 170.5784;
_local2.y = 1.6654;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 172.8497;
_local2.y = 2.7099;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 175.0904;
_local2.y = 3.8137;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 177.1376;
_local2.y = 5.2486;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 179.3245;
_local2.y = 6.4599;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 181.4066;
_local2.y = 7.8335;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 183.6087;
_local2.y = 8.9708;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 185.9381;
_local2.y = 9.8787;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 188.3807;
_local2.y = 10.3628;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 190.8523;
_local2.y = 10.7386;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 193.3087;
_local2.y = 10.4458;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 195.659;
_local2.y = 11.2977;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 197.9859;
_local2.y = 12.2106;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 200.299;
_local2.y = 13.1589;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 202.7395;
_local2.y = 13.6957;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 205.1841;
_local2.y = 14.2191;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 207.6661;
_local2.y = 14.4491;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 210.1638;
_local2.y = 14.5569;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 212.6451;
_local2.y = 14.2871;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 214.7957;
_local2.y = 13.1196;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 216.9565;
_local2.y = 12.1031;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 218.8002;
_local2.y = 10.6409;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 220.1676;
_local2.y = 8.5545;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 221.731;
_local2.y = 6.6164;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 223.8698;
_local2.y = 5.4895;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 226.3586;
_local2.y = 5.3391;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 228.4492;
_local2.y = 6.2323;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 229.9655;
_local2.y = 8.2041;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 231.276;
_local2.y = 10.3331;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 233.0654;
_local2.y = 11.9886;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 235.1839;
_local2.y = 13.3161;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 237.1424;
_local2.y = 14.8621;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 239.273;
_local2.y = 16.0864;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 241.6351;
_local2.y = 16.9053;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 243.9972;
_local2.y = 17.7242;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 246.4778;
_local2.y = 18.015;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 248.9633;
_local2.y = 18.2847;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 251.4477;
_local2.y = 18.1989;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 253.9317;
_local2.y = 17.916;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 256.4164;
_local2.y = 17.6421;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 258.9102;
_local2.y = 17.4653;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 261.3954;
_local2.y = 17.3354;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 263.409;
_local2.y = 18.701;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 264.0073;
_local2.y = 21.0464;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 263.997;
_local2.y = 23.5463;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 263.9868;
_local2.y = 26.0463;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 263.9765;
_local2.y = 28.5463;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 266.0138;
_local2.y = 28.9812;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 268.5136;
_local2.y = 28.9495;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 271.0134;
_local2.y = 28.9179;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 273.5132;
_local2.y = 28.8863;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 274.4432;
_local2.y = 27.2422;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 274.5419;
_local2.y = 24.7441;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 288.5392;
_local2.y = 14.5578;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 290.8164;
_local2.y = 15.4661;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 293.2623;
_local2.y = 15.9804;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 295.7236;
_local2.y = 16.2205;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 298.1795;
_local2.y = 15.7531;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 300.364;
_local2.y = 14.5938;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 302.4826;
_local2.y = 13.2666;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 304.1584;
_local2.y = 11.4336;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 305.8928;
_local2.y = 9.7856;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 308.3894;
_local2.y = 9.6544;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 310.8859;
_local2.y = 9.5231;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 313.3825;
_local2.y = 9.3919;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 315.88;
_local2.y = 9.2858;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 318.1494;
_local2.y = 10.2754;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 320.4829;
_local2.y = 11.1357;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 322.9381;
_local2.y = 11.3398;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 325.428;
_local2.y = 11.1147;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 327.9178;
_local2.y = 10.8896;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 330.3928;
_local2.y = 10.5452;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 332.8543;
_local2.y = 10.1262;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 335.1365;
_local2.y = 9.1377;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 336.6796;
_local2.y = 7.1708;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 338.2228;
_local2.y = 5.2039;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 339.436;
_local2.y = 3.0804;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 339.9842;
_local2.y = 0.6412;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 340.5324;
_local2.y = -1.7979;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 341.1355;
_local2.y = -4.2202;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 342.053;
_local2.y = -6.5457;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 343.9328;
_local2.y = -7.8955;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 346.3738;
_local2.y = -7.8579;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 348.5293;
_local2.y = -6.6716;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 350.6934;
_local2.y = -5.4676;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 353.0964;
_local2.y = -4.7781;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 355.5034;
_local2.y = -4.1027;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 357.8181;
_local2.y = -3.3881;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 359.8834;
_local2.y = -2.2372;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 361.622;
_local2.y = -0.4767;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 363.3513;
_local2.y = 1.328;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 365.4359;
_local2.y = 2.6261;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 367.6802;
_local2.y = 3.7111;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 370.1775;
_local2.y = 3.8277;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 372.6765;
_local2.y = 3.8721;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 375.1765;
_local2.y = 3.8721;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 377.6563;
_local2.y = 3.6104;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 379.7386;
_local2.y = 4.8791;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 381.8019;
_local2.y = 6.227;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 383.0861;
_local2.y = 8.3562;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 384.5613;
_local2.y = 10.3654;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 386.5533;
_local2.y = 11.8223;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 388.9095;
_local2.y = 12.5242;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 391.3901;
_local2.y = 12.7938;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 393.4254;
_local2.y = 14.0354;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 394.4007;
_local2.y = 16.2135;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 394.4776;
_local2.y = 18.7123;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 394.5544;
_local2.y = 21.2111;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 394.6312;
_local2.y = 23.71;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 395.9332;
_local2.y = 24.9454;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 397.8125;
_local2.y = 24.3094;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 397.8353;
_local2.y = 21.8108;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 397.6781;
_local2.y = 19.3158;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 397.62;
_local2.y = 16.8213;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 398.0665;
_local2.y = 14.4169;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 399.794;
_local2.y = 12.7922;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 401.9429;
_local2.y = 13.1441;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 403.8027;
_local2.y = 14.8145;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 405.6462;
_local2.y = 16.503;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 407.2352;
_local2.y = 18.4314;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 409.2062;
_local2.y = 19.9162;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 411.4655;
_local2.y = 20.9865;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 413.7952;
_local2.y = 21.8101;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 416.2791;
_local2.y = 22.0931;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 418.7751;
_local2.y = 22.0889;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 421.0738;
_local2.y = 21.3823;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 422.4782;
_local2.y = 19.4667;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 424.3028;
_local2.y = 17.9267;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 426.5427;
_local2.y = 16.8486;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 428.3965;
_local2.y = 15.1817;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 430.1928;
_local2.y = 13.4431;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 432.1209;
_local2.y = 11.8659;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 433.357;
_local2.y = 9.7331;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 435.5029;
_local2.y = 8.5887;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 437.931;
_local2.y = 7.9936;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 440.3807;
_local2.y = 7.5338;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 442.8696;
_local2.y = 7.3071;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 445.3032;
_local2.y = 7.7839;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 449.6735;
_local2.y = 8.0576;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 452.0882;
_local2.y = 7.9587;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 454.5631;
_local2.y = 7.7818;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 456.5256;
_local2.y = 6.4816;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 460.4024;
_local2.y = 1.3799;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 462.0989;
_local2.y = -0.2332;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 464.2764;
_local2.y = -0.8476;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 468.2593;
_local2.y = -0.8121;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 470.5122;
_local2.y = -0.0351;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 471.9382;
_local2.y = 1.8376;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 478.1955;
_local2.y = 0.0865;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 478.7645;
_local2.y = -2.2138;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 481.1152;
_local2.y = -2.2584;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 483.3794;
_local2.y = -1.202;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 485.8211;
_local2.y = -0.8803;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 488.2211;
_local2.y = -0.3959;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 489.403;
_local2.y = 1.6973;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 490.7578;
_local2.y = 3.7547;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 492.5509;
_local2.y = 5.463;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 494.849;
_local2.y = 6.237;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 496.7453;
_local2.y = 5.0549;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 502.8864;
_local2.y = 4.3175;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 504.8578;
_local2.y = 5.769;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 507.3267;
_local2.y = 5.9746;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 530.3267;
_local2.y = 5.9746;
_local1.push(_local2);
warry.setingUp(_local2.x, _local2.y, super.getWorld());
_local2 = new Point();
_local2.x = 530.3267;
_local2.y = -10;
_local1.push(_local2);
var _local3:int;
while (_local3 < (_local1.length - 1)) {
setCubePoints(_local1[_local3], _local1[(_local3 + 1)]);
_local3++;
};
}
}
}//package Levels
Section 162
//Level4 (Levels.Level4)
package Levels {
import Box2D.Dynamics.*;
import flash.geom.*;
import flash.display.*;
import Clases.*;
import Bonus.*;
public class Level4 extends Level {
const TIME_LEVEL:int = 3500;
private var warry:Warray;
private var terrainShape:ShapeLevel4;
public function Level4(_arg1:b2World){
terrainShape = new ShapeLevel4();
warry = new Warray();
super();
super.setWorld(_arg1);
generateLevel();
}
public function getTerrainShape():Sprite{
return (terrainShape);
}
public function getWarrayShape():Sprite{
return (warry);
}
private function putTheBonuses(){
var _local1:PrimerBonus = new PrimerBonus();
_local1.x = 2200;
_local1.y = -125;
addChild(_local1);
super.addToBonusArray(_local1);
var _local2:PrimerBonus = new PrimerBonus();
_local2.x = 5400;
_local2.y = -125;
addChild(_local2);
super.addToBonusArray(_local2);
var _local3:CuartoBonus = new CuartoBonus();
_local3.x = 10800;
_local3.y = -125;
addChild(_local3);
super.addToBonusArray(_local3);
}
public function generateLevel(){
addChild(warry);
addChild(terrainShape);
drawTerrainOfLevel();
putTheBonuses();
}
public function removeCurrentLevel(){
warry.destroyWarray();
}
override public function setTIME():int{
return (TIME_LEVEL);
}
public function drawTerrainOfLevel(){
var _local2:Point;
var _local1:Array = new Array();
_local2 = new Point();
_local2.x = 0;
_local2.y = 0;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 0;
_local2.y = 7.2786;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 14.2105;
_local2.y = 6.4707;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 17.4626;
_local2.y = 4.5086;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 21.4038;
_local2.y = 3.934;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 25.3037;
_local2.y = 3.1641;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 28.9896;
_local2.y = 4.5925;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 32.864;
_local2.y = 4.6573;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 35.3373;
_local2.y = 1.5976;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 38.2905;
_local2.y = -0.8638;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 42.1812;
_local2.y = -0.2882;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 46.1031;
_local2.y = -0.2145;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 49.8937;
_local2.y = -0.5113;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 53.4215;
_local2.y = 0.543;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 56.0641;
_local2.y = 3.5232;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 59.6298;
_local2.y = 5.0899;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 62.994;
_local2.y = 4.0903;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 66.7834;
_local2.y = 3.299;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 70.5465;
_local2.y = 3.7991;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.0792;
_local2.y = 5.2075;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 77.7488;
_local2.y = 6.2521;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 80.72;
_local2.y = 3.8588;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 84.1757;
_local2.y = 3.6022;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 87.7134;
_local2.y = 3.9168;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 91.1607;
_local2.y = 4.6936;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 94.9201;
_local2.y = 4.5797;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 98.3699;
_local2.y = 2.5777;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 101.2973;
_local2.y = -0.0683;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 104.9995;
_local2.y = 1.2062;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 108.7683;
_local2.y = 2.4719;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 112.3587;
_local2.y = 2.1962;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 115.5844;
_local2.y = 0.5952;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 119.0071;
_local2.y = -0.2384;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 121.8753;
_local2.y = 2.4594;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 125.4205;
_local2.y = 3.2227;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 129.305;
_local2.y = 2.2727;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 132.5122;
_local2.y = 4.0791;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 135.8254;
_local2.y = 6.1636;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 139.0364;
_local2.y = 6.7832;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 141.9846;
_local2.y = 4.6107;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 144.8421;
_local2.y = 7.0456;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 148.6767;
_local2.y = 7.9445;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 152.0949;
_local2.y = 6.2471;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 155.8506;
_local2.y = 7.1891;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 159.3858;
_local2.y = 6.9174;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 161.6111;
_local2.y = 4.4138;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 165.4065;
_local2.y = 5.51;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 169.3032;
_local2.y = 4.9186;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 173.1206;
_local2.y = 4.0392;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 176.5936;
_local2.y = 5.7892;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 180.4816;
_local2.y = 5.571;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 183.6515;
_local2.y = 3.621;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 186.724;
_local2.y = 1.9261;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 190.5859;
_local2.y = 2.936;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 194.48;
_local2.y = 3.5608;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 198.4641;
_local2.y = 3.7824;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 202.165;
_local2.y = 5.2184;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 205.8282;
_local2.y = 6.7883;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 209.4413;
_local2.y = 5.5365;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 213.2769;
_local2.y = 5.1502;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 217.0181;
_local2.y = 6.5133;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 220.963;
_local2.y = 7.0083;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 224.8828;
_local2.y = 6.5922;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 228.4019;
_local2.y = 8.4011;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 232.035;
_local2.y = 10.0121;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 235.7916;
_local2.y = 10.5904;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 238.4186;
_local2.y = 8.2535;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 241.5238;
_local2.y = 5.7726;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 244.9135;
_local2.y = 3.7667;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 248.6968;
_local2.y = 4.0011;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 252.4541;
_local2.y = 5.1438;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 256.3351;
_local2.y = 4.7476;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 257.9522;
_local2.y = 1.1177;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 261.2457;
_local2.y = -0.1395;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 264.9455;
_local2.y = -1.2313;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 268.3094;
_local2.y = -1.7697;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 270.9518;
_local2.y = 1.2321;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 274.0805;
_local2.y = 3.573;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 277.724;
_local2.y = 2.3183;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 281.5661;
_local2.y = 3.2899;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 285.3717;
_local2.y = 4.081;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 289.1735;
_local2.y = 3.5048;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 292.42;
_local2.y = 4.6415;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 295.6384;
_local2.y = 2.9574;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 299.3463;
_local2.y = 4.2639;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 302.7472;
_local2.y = 6.3523;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 306.192;
_local2.y = 5.5844;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 309.1068;
_local2.y = 4.6719;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 311.235;
_local2.y = 8.0496;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 314.1386;
_local2.y = 10.6852;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 317.9953;
_local2.y = 11.3556;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 321.632;
_local2.y = 10.1358;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 324.5232;
_local2.y = 7.578;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 327.8954;
_local2.y = 5.8626;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 331.577;
_local2.y = 4.6208;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 334.7374;
_local2.y = 2.2046;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 337.2705;
_local2.y = -0.362;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 339.4285;
_local2.y = -3.6022;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 343.0731;
_local2.y = -5;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 344.7949;
_local2.y = -8.5222;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 346.6444;
_local2.y = -11.9562;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 350.4087;
_local2.y = -11.2378;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 353.201;
_local2.y = -8.431;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 356.6727;
_local2.y = -6.5668;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 358.8554;
_local2.y = -3.3033;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 362.3493;
_local2.y = -1.9018;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 366.3491;
_local2.y = -1.8723;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 370.3474;
_local2.y = -1.9874;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 373.3414;
_local2.y = -0.4122;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 374.9274;
_local2.y = 3.1738;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 377.9652;
_local2.y = 5.756;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 381.8342;
_local2.y = 6.6578;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 385.166;
_local2.y = 4.9496;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 386.371;
_local2.y = 1.1497;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 390.0815;
_local2.y = 1.2947;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 393.129;
_local2.y = 3.8837;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 395.9128;
_local2.y = 6.6768;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 399.6345;
_local2.y = 8.085;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 402.6355;
_local2.y = 5.8948;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 406.4732;
_local2.y = 6.2935;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 410.387;
_local2.y = 6.0456;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 412.5637;
_local2.y = 2.9528;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 414.8886;
_local2.y = 0.0133;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 418.6765;
_local2.y = 0.4439;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 421.5846;
_local2.y = 3.154;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 425.4486;
_local2.y = 4.1518;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 429.3252;
_local2.y = 5.1191;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 433.2661;
_local2.y = 4.8203;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 436.9941;
_local2.y = 5.5332;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 440.5344;
_local2.y = 7.3951;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 444.302;
_local2.y = 8.362;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 447.2348;
_local2.y = 11.0636;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 450.9379;
_local2.y = 12.3749;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 454.5166;
_local2.y = 11.1149;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 458.2563;
_local2.y = 10.2154;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 462.1637;
_local2.y = 9.5284;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 464.4548;
_local2.y = 6.5821;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 467.1473;
_local2.y = 4.0519;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 470.414;
_local2.y = 2.1501;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 473.1652;
_local2.y = -0.5428;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 477.031;
_local2.y = -1.4222;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 480.0288;
_local2.y = -3.7562;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 483.8235;
_local2.y = -3.3562;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 487.6793;
_local2.y = -3.6049;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 491.4855;
_local2.y = -3.4387;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 494.4655;
_local2.y = -2.6224;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 496.5196;
_local2.y = 0.7984;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 498.6313;
_local2.y = 4.1432;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 501.5785;
_local2.y = 6.6011;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 505.3879;
_local2.y = 5.8115;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 507.8484;
_local2.y = 2.7284;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 511.3194;
_local2.y = 4.2803;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 515.1582;
_local2.y = 4.2028;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 519.141;
_local2.y = 3.9203;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 522.3168;
_local2.y = 1.8025;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 524.3733;
_local2.y = -1.4252;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 526.6227;
_local2.y = -3.0032;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 529.0827;
_local2.y = 0.049;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 531.8787;
_local2.y = 2.7174;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 535.0421;
_local2.y = 4.9133;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 538.702;
_local2.y = 6.3727;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 542.5841;
_local2.y = 6.5558;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 546.1229;
_local2.y = 4.7965;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 549.4282;
_local2.y = 3.0015;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 550.7221;
_local2.y = 6.5578;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 550.7934;
_local2.y = 10.5572;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 551.8033;
_local2.y = 13.6174;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 553.7243;
_local2.y = 11.5764;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 553.7154;
_local2.y = 7.5764;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 555.6383;
_local2.y = 4.6584;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 559.5065;
_local2.y = 5.5827;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 563.1659;
_local2.y = 4.8578;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 566.0856;
_local2.y = 4.4823;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 566.1071;
_local2.y = 8.4822;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 566.1286;
_local2.y = 12.4822;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 568.8094;
_local2.y = 13.3373;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 568.831;
_local2.y = 9.3377;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 569.4892;
_local2.y = 5.5575;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 572.6301;
_local2.y = 6.1168;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 576.4607;
_local2.y = 5.8351;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 580.3625;
_local2.y = 5.2724;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 583.2199;
_local2.y = 3.062;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 586.563;
_local2.y = 5.2049;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 589.1992;
_local2.y = 7.6635;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 593.1447;
_local2.y = 7.2614;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 596.6238;
_local2.y = 6.7669;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 599.3137;
_local2.y = 4.6603;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 602.1963;
_local2.y = 3.3185;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 605.5128;
_local2.y = 4.3595;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 608.0142;
_local2.y = 7.1884;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 611.8603;
_local2.y = 7.3435;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 613.598;
_local2.y = 3.8252;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 616.7347;
_local2.y = 2.1128;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 618.6035;
_local2.y = 5.4901;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 621.3255;
_local2.y = 8.1149;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 624.214;
_local2.y = 6.0309;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 627.5788;
_local2.y = 5.0906;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 650;
_local2.y = 5.0906;
_local1.push(_local2);
warry.setingUp(_local2.x, _local2.y, super.getWorld());
_local2 = new Point();
_local2.x = 650;
_local2.y = -5;
_local1.push(_local2);
var _local3:int;
while (_local3 < (_local1.length - 1)) {
setCubePoints(_local1[_local3], _local1[(_local3 + 1)]);
_local3++;
};
}
}
}//package Levels
Section 163
//Level5 (Levels.Level5)
package Levels {
import Box2D.Dynamics.*;
import flash.geom.*;
import flash.display.*;
import Clases.*;
import Bonus.*;
public class Level5 extends Level {
const TIME_LEVEL:int = 2500;
private var warry:Warray;
private var terrainShape:ShapeLevel5;
public function Level5(_arg1:b2World){
terrainShape = new ShapeLevel5();
warry = new Warray();
super();
super.setWorld(_arg1);
generateLevel();
}
public function getTerrainShape():Sprite{
return (terrainShape);
}
public function getWarrayShape():Sprite{
return (warry);
}
private function putTheBonuses(){
var _local1:PrimerBonus = new PrimerBonus();
_local1.x = 750;
_local1.y = -55;
addChild(_local1);
super.addToBonusArray(_local1);
var _local2:PrimerBonus = new PrimerBonus();
_local2.x = 1300;
_local2.y = -85;
addChild(_local2);
super.addToBonusArray(_local2);
var _local3:CuartoBonus = new CuartoBonus();
_local3.x = 2500;
_local3.y = -85;
addChild(_local3);
super.addToBonusArray(_local3);
var _local4:SegundoBonus = new SegundoBonus();
_local4.x = 3500;
_local4.y = 0;
addChild(_local4);
super.addToBonusArray(_local4);
var _local5:PrimerBonus = new PrimerBonus();
_local5.x = 5500;
_local5.y = 0;
addChild(_local5);
super.addToBonusArray(_local5);
}
public function generateLevel(){
addChild(warry);
addChild(terrainShape);
drawTerrainOfLevel();
putTheBonuses();
}
public function removeCurrentLevel(){
warry.destroyWarray();
}
override public function setTIME():int{
return (TIME_LEVEL);
}
public function drawTerrainOfLevel(){
var _local2:Point;
var _local1:Array = new Array();
_local2 = new Point();
_local2.x = 0;
_local2.y = 0;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 0;
_local2.y = 9.3609;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 11.6061;
_local2.y = 9.4712;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 14.2261;
_local2.y = 8.1548;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 17.097;
_local2.y = 7.4378;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 19.788;
_local2.y = 8.3179;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 22.1528;
_local2.y = 9.5576;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 25.1509;
_local2.y = 9.4496;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 26.9282;
_local2.y = 7.462;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 28.846;
_local2.y = 5.3367;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 31.5502;
_local2.y = 4.0519;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 34.0033;
_local2.y = 2.3431;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 36.9201;
_local2.y = 2.6789;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 38.6918;
_local2.y = 5.0123;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 41.3698;
_local2.y = 6.3576;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 44.1438;
_local2.y = 7.4973;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 46.7728;
_local2.y = 8.8782;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 49.7104;
_local2.y = 8.4507;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 52.1512;
_local2.y = 6.9179;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 54.0586;
_local2.y = 4.6031;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 56.1425;
_local2.y = 2.4974;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 59.0107;
_local2.y = 1.9066;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 61.8048;
_local2.y = 2.9942;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 64.5997;
_local2.y = 3.0071;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 67.2579;
_local2.y = 1.6538;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 70.1238;
_local2.y = 1.9521;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 72.5179;
_local2.y = 3.7598;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.9203;
_local2.y = 5.5566;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 77.3227;
_local2.y = 7.3534;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 79.5209;
_local2.y = 9.3927;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 82.0349;
_local2.y = 10.8938;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 84.9151;
_local2.y = 11.728;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 87.878;
_local2.y = 12.1835;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 90.7763;
_local2.y = 11.8696;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 93.5609;
_local2.y = 10.7774;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 95.8687;
_local2.y = 8.8684;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 98.0112;
_local2.y = 7.3935;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 101.0105;
_local2.y = 7.4605;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 103.9392;
_local2.y = 8.1101;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 106.8586;
_local2.y = 8.801;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 109.7444;
_local2.y = 9.6174;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 112.6191;
_local2.y = 10.4752;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 115.372;
_local2.y = 11.6649;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 118.1791;
_local2.y = 12.7229;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 121.0819;
_local2.y = 13.4468;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 124.0481;
_local2.y = 13.8269;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 127.0463;
_local2.y = 13.93;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 130.0449;
_local2.y = 13.9656;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 133.0437;
_local2.y = 13.8867;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 136.0381;
_local2.y = 13.7035;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 139.0334;
_local2.y = 13.5498;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 142.0334;
_local2.y = 13.5498;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 145.0121;
_local2.y = 13.2063;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 147.9889;
_local2.y = 12.8345;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 150.5067;
_local2.y = 11.2893;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 152.4755;
_local2.y = 9.1865;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 155.0446;
_local2.y = 8.0453;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 157.9391;
_local2.y = 7.2566;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 160.8336;
_local2.y = 6.468;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 163.741;
_local2.y = 6.7751;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 165.9941;
_local2.y = 8.7559;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 168.3719;
_local2.y = 10.5723;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 170.9498;
_local2.y = 12.1068;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 173.7924;
_local2.y = 12.8814;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 176.7881;
_local2.y = 12.988;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 179.7877;
_local2.y = 13.0358;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 182.7692;
_local2.y = 13.0358;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 185.4693;
_local2.y = 12.0179;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 187.0707;
_local2.y = 9.481;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 188.5993;
_local2.y = 6.9018;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 190.6989;
_local2.y = 4.9068;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 193.6732;
_local2.y = 4.6165;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 196.6723;
_local2.y = 4.6917;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 199.6576;
_local2.y = 4.4463;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 202.648;
_local2.y = 4.5013;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 205.3273;
_local2.y = 5.6892;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 208.2808;
_local2.y = 6.2155;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 211.2541;
_local2.y = 6.4667;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 213.877;
_local2.y = 7.8205;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 216.6222;
_local2.y = 8.5845;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 219.622;
_local2.y = 8.5498;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 222.6218;
_local2.y = 8.5151;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 225.6215;
_local2.y = 8.4977;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 228.6205;
_local2.y = 8.5742;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 231.587;
_local2.y = 8.9979;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 234.0694;
_local2.y = 10.605;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 236.9109;
_local2.y = 11.1782;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 239.9108;
_local2.y = 11.1542;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 242.5399;
_local2.y = 12.2446;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 245.3254;
_local2.y = 13.3168;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 248.2728;
_local2.y = 13.7927;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 251.1344;
_local2.y = 13.0565;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 252.573;
_local2.y = 10.613;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 255.3136;
_local2.y = 9.5137;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 258.2838;
_local2.y = 9.3956;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 261.1779;
_local2.y = 10.0925;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 263.9648;
_local2.y = 9.6014;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 265.5531;
_local2.y = 7.1819;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 267.0916;
_local2.y = 4.7063;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 270.0526;
_local2.y = 4.6125;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 272.8669;
_local2.y = 5.6417;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 275.8061;
_local2.y = 6.0509;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 278.7372;
_local2.y = 5.4399;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 281.7144;
_local2.y = 5.5172;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 284.2117;
_local2.y = 7.1541;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 286.9494;
_local2.y = 8.2589;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 289.8191;
_local2.y = 8.1463;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 292.5353;
_local2.y = 7.4473;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 295.2035;
_local2.y = 8.7911;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 298.2027;
_local2.y = 8.8597;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 301.0461;
_local2.y = 7.9406;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 303.8247;
_local2.y = 6.9904;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 306.7377;
_local2.y = 6.3815;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 308.3756;
_local2.y = 4.0628;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 311.2636;
_local2.y = 3.5411;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 313.3828;
_local2.y = 5.3005;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 316.2116;
_local2.y = 5.5941;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 319.1428;
_local2.y = 6.1503;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 322.0129;
_local2.y = 7.0153;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 324.9041;
_local2.y = 7.816;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 327.3282;
_local2.y = 9.3495;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 329.8583;
_local2.y = 10.7648;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 332.2778;
_local2.y = 9.6276;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 334.8387;
_local2.y = 8.6458;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 337.6851;
_local2.y = 8.1498;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 339.1654;
_local2.y = 6.0071;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 341.9265;
_local2.y = 6.0343;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 343.4223;
_local2.y = 4.0447;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 346.3144;
_local2.y = 4.2029;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 347.893;
_local2.y = 6.6897;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 350.4766;
_local2.y = 8.0595;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 353.3607;
_local2.y = 8.8589;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 356.2411;
_local2.y = 9.5535;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 359.2385;
_local2.y = 9.4706;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 362.2086;
_local2.y = 9.3379;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 364.8537;
_local2.y = 10.7508;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 367.4183;
_local2.y = 12.3073;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 369.8206;
_local2.y = 14.0986;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 372.6942;
_local2.y = 14.7427;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 375.694;
_local2.y = 14.775;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 378.6401;
_local2.y = 14.2578;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 381.5826;
_local2.y = 13.6736;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 384.5356;
_local2.y = 13.4721;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 387.5015;
_local2.y = 13.9234;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 390.4705;
_local2.y = 14.3489;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 393.4167;
_local2.y = 14.6113;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 395.87;
_local2.y = 16.3379;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 397.4654;
_local2.y = 18.8777;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 400.0138;
_local2.y = 20.3355;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 402.9819;
_local2.y = 20.6295;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 405.7876;
_local2.y = 19.8498;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 408.5053;
_local2.y = 18.805;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 411.4823;
_local2.y = 18.7036;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 414.3715;
_local2.y = 18.4344;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 417.1873;
_local2.y = 17.4065;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 419.845;
_local2.y = 16.0841;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 422.1271;
_local2.y = 14.1517;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 424.9422;
_local2.y = 13.3889;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 427.8726;
_local2.y = 12.7595;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 430.7451;
_local2.y = 12.1149;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 433.6558;
_local2.y = 11.6117;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 436.3642;
_local2.y = 10.3346;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 437.844;
_local2.y = 7.7387;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 439.0838;
_local2.y = 5.0087;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 440.2037;
_local2.y = 2.2281;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 441.7412;
_local2.y = -0.2919;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 444.5612;
_local2.y = -0.9076;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 446.9978;
_local2.y = 0.7545;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 449.0481;
_local2.y = 2.9383;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 450.0773;
_local2.y = 5.685;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 451.3186;
_local2.y = 8.409;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 453.0849;
_local2.y = 10.6945;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 456.0512;
_local2.y = 10.6361;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 457.4669;
_local2.y = 8.0762;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 460.4071;
_local2.y = 7.7219;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 488;
_local2.y = 7.7219;
_local1.push(_local2);
warry.setingUp(_local2.x, _local2.y, super.getWorld());
_local2 = new Point();
_local2.x = 488;
_local2.y = -10;
_local1.push(_local2);
var _local3:int;
while (_local3 < (_local1.length - 1)) {
setCubePoints(_local1[_local3], _local1[(_local3 + 1)]);
_local3++;
};
}
}
}//package Levels
Section 164
//Level6 (Levels.Level6)
package Levels {
import Box2D.Dynamics.*;
import flash.geom.*;
import flash.display.*;
import Clases.*;
import Bonus.*;
public class Level6 extends Level {
const TIME_LEVEL:int = 3000;
private var warry:Warray;
private var terrainShape:ShapeLevel6;
public function Level6(_arg1:b2World){
terrainShape = new ShapeLevel6();
warry = new Warray();
super();
super.setWorld(_arg1);
generateLevel();
}
public function getTerrainShape():Sprite{
return (terrainShape);
}
public function getWarrayShape():Sprite{
return (warry);
}
private function putTheBonuses(){
var _local1:PrimerBonus = new PrimerBonus();
_local1.x = 1000;
_local1.y = 50;
addChild(_local1);
super.addToBonusArray(_local1);
var _local2:PrimerBonus = new PrimerBonus();
_local2.x = 1400;
_local2.y = 50;
addChild(_local2);
super.addToBonusArray(_local2);
var _local3:TercerBonus = new TercerBonus();
_local3.x = 3200;
_local3.y = -50;
addChild(_local3);
super.addToBonusArray(_local3);
var _local4:PrimerBonus = new PrimerBonus();
_local4.x = 6900;
_local4.y = 80;
addChild(_local4);
super.addToBonusArray(_local4);
}
public function generateLevel(){
addChild(warry);
addChild(terrainShape);
drawTerrainOfLevel();
putTheBonuses();
}
public function removeCurrentLevel(){
warry.destroyWarray();
}
override public function setTIME():int{
return (TIME_LEVEL);
}
public function drawTerrainOfLevel(){
var _local2:Point;
var _local1:Array = new Array();
_local2 = new Point();
_local2.x = 0;
_local2.y = -5;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 0;
_local2.y = 7.5314;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 9.1972;
_local2.y = 7.5314;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 11.2965;
_local2.y = 8.6614;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 13.7158;
_local2.y = 9.2912;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 16.199;
_local2.y = 9.1176;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 18.6776;
_local2.y = 8.7916;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 20.5586;
_local2.y = 7.1918;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 23.0582;
_local2.y = 7.1521;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 25.4772;
_local2.y = 7.4863;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 27.6183;
_local2.y = 8.7759;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 29.7726;
_local2.y = 10.0047;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 32.2669;
_local2.y = 10.1737;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 34.7376;
_local2.y = 10.5049;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 36.8923;
_local2.y = 9.3501;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 39.1512;
_local2.y = 8.3151;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 41.5694;
_local2.y = 8.2455;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 43.7951;
_local2.y = 9.3842;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 45.7198;
_local2.y = 10.9138;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 48.1293;
_local2.y = 11.5803;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 50.5593;
_local2.y = 12.1635;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 53.0225;
_local2.y = 11.8275;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 55.5021;
_local2.y = 11.821;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 57.9423;
_local2.y = 12.1626;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 60.2314;
_local2.y = 13.1546;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 62.6933;
_local2.y = 13.5514;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 64.8581;
_local2.y = 12.8365;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 66.1398;
_local2.y = 10.6993;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 68.1553;
_local2.y = 9.3094;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 70.5161;
_local2.y = 8.5666;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 72.7599;
_local2.y = 7.4716;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.841;
_local2.y = 8.11;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 76.8161;
_local2.y = 9.6361;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 78.8026;
_local2.y = 11.0971;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 81.1758;
_local2.y = 11.8832;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 83.6003;
_local2.y = 12.421;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 85.9281;
_local2.y = 11.8313;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 87.9015;
_local2.y = 10.5664;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 90.3556;
_local2.y = 10.1144;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 92.6947;
_local2.y = 9.3833;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 94.2352;
_local2.y = 7.4698;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 96.5975;
_local2.y = 7.8202;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 98.5141;
_local2.y = 9.4148;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 100.7448;
_local2.y = 10.5373;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 103.1351;
_local2.y = 11.2693;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 105.5716;
_local2.y = 11.7506;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 108.0714;
_local2.y = 11.7807;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 110.5712;
_local2.y = 11.8109;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 113.0499;
_local2.y = 11.6323;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 115.1195;
_local2.y = 10.3597;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 116.489;
_local2.y = 8.2688;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 118.0707;
_local2.y = 6.3861;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 120.4111;
_local2.y = 5.6654;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 122.8531;
_local2.y = 6.0389;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 125.1925;
_local2.y = 6.9167;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 127.5737;
_local2.y = 7.6686;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 130.0259;
_local2.y = 8.1547;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 132.1858;
_local2.y = 9.3336;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 134.573;
_local2.y = 9.9357;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 135.6261;
_local2.y = 11.8811;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 135.8291;
_local2.y = 23.5548;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 138.3273;
_local2.y = 23.4612;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 138.9943;
_local2.y = 16.4031;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 139.201;
_local2.y = 13.9171;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 139.6314;
_local2.y = 11.4556;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 141.0369;
_local2.y = 9.5347;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 143.3434;
_local2.y = 9.0667;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 145.7912;
_local2.y = 9.4898;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 148.2433;
_local2.y = 9.9649;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 150.6555;
_local2.y = 10.3441;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 153.1068;
_local2.y = 9.9386;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 155.1041;
_local2.y = 8.7102;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 156.2882;
_local2.y = 6.7873;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 158.737;
_local2.y = 6.9869;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 161.0771;
_local2.y = 6.4962;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 163.1291;
_local2.y = 5.1055;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 165.5964;
_local2.y = 5.2391;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 167.7067;
_local2.y = 4.1739;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 170.1994;
_local2.y = 4.2379;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 172.667;
_local2.y = 4.6291;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 174.89;
_local2.y = 5.6833;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 176.1677;
_local2.y = 7.7196;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 177.7747;
_local2.y = 9.6213;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 179.4771;
_local2.y = 11.4478;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 181.2582;
_local2.y = 13.1303;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 183.6646;
_local2.y = 13.7995;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 186.0887;
_local2.y = 13.7351;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 188.0077;
_local2.y = 12.1528;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 190.3796;
_local2.y = 11.4576;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 192.8772;
_local2.y = 11.4515;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 195.2633;
_local2.y = 10.9737;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 197.192;
_local2.y = 9.3836;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 199.554;
_local2.y = 9.2789;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 201.8831;
_local2.y = 10.1869;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 204.3132;
_local2.y = 10.7112;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 206.7086;
_local2.y = 10.8813;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 209.0284;
_local2.y = 9.967;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 211.4729;
_local2.y = 9.7886;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 213.9503;
_local2.y = 10.121;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 215.955;
_local2.y = 11.4384;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 216.8708;
_local2.y = 13.7012;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 218.4979;
_local2.y = 15.1621;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 220.9775;
_local2.y = 15.2873;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 222.9378;
_local2.y = 13.9656;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 225.2106;
_local2.y = 13.0786;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 227.6736;
_local2.y = 12.9632;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 230.0017;
_local2.y = 12.0563;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 232.3277;
_local2.y = 11.2255;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 234.8207;
_local2.y = 11.4077;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 237.0867;
_local2.y = 12.2691;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 239.2476;
_local2.y = 13.502;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 241.723;
_local2.y = 13.7918;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 244.2219;
_local2.y = 13.8608;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 246.0269;
_local2.y = 12.2271;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 248.3356;
_local2.y = 11.5149;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 250.8083;
_local2.y = 11.2502;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 252.7502;
_local2.y = 9.8066;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 255.0643;
_local2.y = 9.1392;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 257.0798;
_local2.y = 7.7774;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 259.5232;
_local2.y = 7.2768;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 262.0123;
_local2.y = 7.1459;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 264.5074;
_local2.y = 7.2756;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 266.9798;
_local2.y = 7.5917;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 269.1611;
_local2.y = 8.2831;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 270.6749;
_local2.y = 10.2721;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 272.5638;
_local2.y = 11.766;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 274.922;
_local2.y = 12.5959;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 277.398;
_local2.y = 12.7242;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 279.8978;
_local2.y = 12.7262;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 282.3862;
_local2.y = 12.8503;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 284.4717;
_local2.y = 14.0458;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 284.4625;
_local2.y = 16.5458;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 284.4533;
_local2.y = 19.0458;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 285.6522;
_local2.y = 20.3606;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 288.1519;
_local2.y = 20.3995;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 289.0199;
_local2.y = 18.7162;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 289.1157;
_local2.y = 16.2181;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 289.2115;
_local2.y = 13.7199;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 291.3829;
_local2.y = 12.8139;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 292.6737;
_local2.y = 10.7358;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 293.6801;
_local2.y = 8.473;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 295.51;
_local2.y = 6.8277;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 297.812;
_local2.y = 5.8624;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 300.3119;
_local2.y = 5.8408;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 302.8119;
_local2.y = 5.8193;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 305.2819;
_local2.y = 6.1723;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 307.743;
_local2.y = 6.6115;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 309.5128;
_local2.y = 8.217;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 311.7087;
_local2.y = 9.3861;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 314.1054;
_local2.y = 10.0973;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 316.4771;
_local2.y = 10.8875;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 318.9697;
_local2.y = 10.8599;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 321.4679;
_local2.y = 10.9567;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 323.6704;
_local2.y = 12.0452;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 325.7861;
_local2.y = 13.357;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 328.112;
_local2.y = 14.2736;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 330.5615;
_local2.y = 14.7691;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 333.0462;
_local2.y = 14.9102;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 335.4274;
_local2.y = 14.2736;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 337.5963;
_local2.y = 13.1223;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 338.8298;
_local2.y = 11.0642;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 340.8738;
_local2.y = 9.6329;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 343.2611;
_local2.y = 9.1736;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 344.1518;
_local2.y = 11.009;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 344.0878;
_local2.y = 13.5082;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 344.0238;
_local2.y = 16.0073;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 343.9599;
_local2.y = 18.5065;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 345.2059;
_local2.y = 19.7368;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 347.6424;
_local2.y = 19.6874;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 347.8504;
_local2.y = 9.6896;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 350.1066;
_local2.y = 9.3792;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 352.2407;
_local2.y = 10.5396;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 354.0993;
_local2.y = 12.2113;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 356.1619;
_local2.y = 13.4567;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 358.5955;
_local2.y = 13.419;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 360.9346;
_local2.y = 12.7346;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 363.1925;
_local2.y = 12.2431;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 365.0802;
_local2.y = 10.6205;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 367.2083;
_local2.y = 9.3503;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 368.2484;
_local2.y = 7.0769;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 369.2218;
_local2.y = 4.7742;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 371.3733;
_local2.y = 4.0285;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 373.1453;
_local2.y = 5.2011;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 373.1586;
_local2.y = 7.7011;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 373.3109;
_local2.y = 22.6276;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 375.8109;
_local2.y = 22.6276;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 376.8372;
_local2.y = 21.15;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 376.8764;
_local2.y = 6.1501;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 377.665;
_local2.y = 4.0596;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 380.0648;
_local2.y = 4.1571;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 381.8933;
_local2.y = 5.8305;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 383.5844;
_local2.y = 7.6717;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 384.3067;
_local2.y = 10.0338;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 386.4497;
_local2.y = 11.2285;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 388.9122;
_local2.y = 11.2215;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 391.1508;
_local2.y = 10.1967;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 392.7381;
_local2.y = 8.3121;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 394.9866;
_local2.y = 7.7054;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 397.2956;
_local2.y = 8.619;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 399.4044;
_local2.y = 9.9617;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 401.2782;
_local2.y = 11.559;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 402.9743;
_local2.y = 13.344;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 405.1979;
_local2.y = 14.463;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 407.5722;
_local2.y = 15.2242;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 410.0549;
_local2.y = 15.4575;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 412.5521;
_local2.y = 15.5759;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 414.6177;
_local2.y = 14.6434;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 416.4128;
_local2.y = 12.9823;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 418.8262;
_local2.y = 12.8595;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 421.2839;
_local2.y = 13.2824;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 423.7597;
_local2.y = 13.0885;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 426.1544;
_local2.y = 12.3829;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 428.2458;
_local2.y = 11.0429;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 430.697;
_local2.y = 10.9046;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 432.9319;
_local2.y = 9.9594;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 434.5478;
_local2.y = 8.073;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 435.8782;
_local2.y = 5.9579;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 437.6453;
_local2.y = 4.3213;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 440.0639;
_local2.y = 4.011;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 442.3549;
_local2.y = 4.4843;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 443.7127;
_local2.y = 6.436;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 443.8903;
_local2.y = 23.9351;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 446.0102;
_local2.y = 24.319;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 446.9904;
_local2.y = 10.1921;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 447.0094;
_local2.y = 7.6922;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 447.2963;
_local2.y = 5.2459;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 449.0014;
_local2.y = 3.8987;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 451.3974;
_local2.y = 4.5921;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 453.6603;
_local2.y = 5.536;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 455.5902;
_local2.y = 7.0849;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 458.0433;
_local2.y = 7.3902;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 460.5411;
_local2.y = 7.4887;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 463.0399;
_local2.y = 7.5648;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 485;
_local2.y = 7.5648;
_local1.push(_local2);
warry.setingUp(_local2.x, _local2.y, super.getWorld());
_local2 = new Point();
_local2.x = 485;
_local2.y = -10;
_local1.push(_local2);
var _local3:int;
while (_local3 < (_local1.length - 1)) {
setCubePoints(_local1[_local3], _local1[(_local3 + 1)]);
_local3++;
};
}
}
}//package Levels
Section 165
//Level7 (Levels.Level7)
package Levels {
import Box2D.Dynamics.*;
import flash.geom.*;
import flash.display.*;
import Clases.*;
import Bonus.*;
public class Level7 extends Level {
const TIME_LEVEL:int = 3000;
private var warry:Warray;
private var terrainShape:ShapeLevel7;
public function Level7(_arg1:b2World){
terrainShape = new ShapeLevel7();
warry = new Warray();
super();
super.setWorld(_arg1);
generateLevel();
}
public function getTerrainShape():Sprite{
return (terrainShape);
}
public function getWarrayShape():Sprite{
return (warry);
}
private function putTheBonuses(){
var _local1:PrimerBonus = new PrimerBonus();
_local1.x = 350;
_local1.y = 50;
addChild(_local1);
super.addToBonusArray(_local1);
var _local2:PrimerBonus = new PrimerBonus();
_local2.x = 1550;
_local2.y = 50;
addChild(_local2);
super.addToBonusArray(_local2);
var _local3:TercerBonus = new TercerBonus();
_local3.x = 2100;
_local3.y = -70;
addChild(_local3);
super.addToBonusArray(_local3);
var _local4:CuartoBonus = new CuartoBonus();
_local4.x = 5650;
_local4.y = -25;
addChild(_local4);
super.addToBonusArray(_local4);
var _local5:TercerBonus = new TercerBonus();
_local5.x = 7200;
_local5.y = -25;
addChild(_local5);
super.addToBonusArray(_local5);
}
public function generateLevel(){
addChild(warry);
addChild(terrainShape);
drawTerrainOfLevel();
putTheBonuses();
}
public function removeCurrentLevel(){
warry.destroyWarray();
}
override public function setTIME():int{
return (TIME_LEVEL);
}
public function drawTerrainOfLevel(){
var _local2:Point;
var _local1:Array = new Array();
_local2 = new Point();
_local2.x = 0;
_local2.y = -5;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 0;
_local2.y = 7;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 8.6872;
_local2.y = 7;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 11.0985;
_local2.y = 5.1497;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 13.5172;
_local2.y = 5.7772;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 15.9871;
_local2.y = 6.1493;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 18.4292;
_local2.y = 6.6663;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 20.9044;
_local2.y = 6.7545;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 23.3793;
_local2.y = 6.4436;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 25.8269;
_local2.y = 6.0539;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 28.1136;
_local2.y = 5.0622;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 30.5768;
_local2.y = 5.3675;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 32.9479;
_local2.y = 6.1536;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 35.422;
_local2.y = 6.3482;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 37.8981;
_local2.y = 6.0376;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 40.3845;
_local2.y = 5.9586;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 42.8088;
_local2.y = 6.5277;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 45.0642;
_local2.y = 7.5721;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 47.4754;
_local2.y = 8.2319;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 49.8839;
_local2.y = 8.8964;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 52.3368;
_local2.y = 8.7317;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 54.5264;
_local2.y = 7.5329;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 56.7779;
_local2.y = 6.4548;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 59.22;
_local2.y = 6.2103;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 61.3807;
_local2.y = 7.3783;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 63.6846;
_local2.y = 8.2607;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 66.0926;
_local2.y = 8.9305;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 68.5788;
_local2.y = 8.7788;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 71.0635;
_local2.y = 8.5126;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 73.5479;
_local2.y = 8.247;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 75.9142;
_local2.y = 7.7225;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 78.3947;
_local2.y = 8.034;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 80.861;
_local2.y = 8.438;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 83.3196;
_local2.y = 8.8911;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 85.8072;
_local2.y = 8.9792;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 88.3029;
_local2.y = 8.8344;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 90.6604;
_local2.y = 8.2773;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 92.2767;
_local2.y = 6.4036;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 94.6917;
_local2.y = 6.1332;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 97.1854;
_local2.y = 6.3099;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 99.6812;
_local2.y = 6.4059;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 102.1807;
_local2.y = 6.357;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 104.2796;
_local2.y = 5.3557;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 106.5868;
_local2.y = 4.5817;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 109.068;
_local2.y = 4.3167;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 111.5669;
_local2.y = 4.382;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 114.0328;
_local2.y = 4.4881;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 116.1597;
_local2.y = 5.6025;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 118.2304;
_local2.y = 6.9965;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 120.4712;
_local2.y = 8.0705;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 122.9147;
_local2.y = 8.5991;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 125.3952;
_local2.y = 8.4409;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 127.8842;
_local2.y = 8.2061;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 130.3808;
_local2.y = 8.235;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 132.8479;
_local2.y = 8.1156;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 134.9676;
_local2.y = 6.7901;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 137.3073;
_local2.y = 6.201;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 139.5132;
_local2.y = 7.2651;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 140.8962;
_local2.y = 9.187;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 141.0212;
_local2.y = 11.6838;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 142.0633;
_local2.y = 26.3577;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 144.5633;
_local2.y = 26.3577;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 147.0633;
_local2.y = 26.3577;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 149.3217;
_local2.y = 26.1078;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 149.9058;
_local2.y = 8.6176;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 150.2021;
_local2.y = 6.1655;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 151.2076;
_local2.y = 3.898;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 153.5629;
_local2.y = 3.0887;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 156.0472;
_local2.y = 2.9514;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 158.5106;
_local2.y = 3.3437;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 160.9664;
_local2.y = 3.8119;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 162.8916;
_local2.y = 5.3018;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 164.1423;
_local2.y = 7.4636;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 165.6851;
_local2.y = 9.4276;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 167.5609;
_local2.y = 11.0707;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 169.6666;
_local2.y = 12.4095;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 172.0456;
_local2.y = 13.0354;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 174.5099;
_local2.y = 12.6512;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 176.543;
_local2.y = 11.2977;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 178.8875;
_local2.y = 10.4949;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 181.2845;
_local2.y = 10.1064;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 183.5868;
_local2.y = 9.1337;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 186.0218;
_local2.y = 8.9999;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 188.5134;
_local2.y = 9.1851;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 191.0132;
_local2.y = 9.2198;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 193.415;
_local2.y = 8.5534;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 195.0635;
_local2.y = 6.9945;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 197.2958;
_local2.y = 6.5401;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 199.7852;
_local2.y = 6.5911;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 202.2549;
_local2.y = 6.9791;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 203.851;
_local2.y = 8.7396;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 204.9973;
_local2.y = 10.9612;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 206.8913;
_local2.y = 12.4752;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 209.0463;
_local2.y = 13.6365;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 211.5228;
_local2.y = 13.9614;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 213.6094;
_local2.y = 13.4195;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 214.9203;
_local2.y = 11.3607;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 216.8684;
_local2.y = 10.0186;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 219.3638;
_local2.y = 9.8997;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 221.8637;
_local2.y = 9.8812;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 224.3637;
_local2.y = 9.8626;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 226.521;
_local2.y = 10.9956;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 227.7115;
_local2.y = 12.615;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 227.7744;
_local2.y = 15.1142;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 227.8373;
_local2.y = 17.6134;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 227.9003;
_local2.y = 20.1126;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 228.7131;
_local2.y = 21.7647;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 230.2205;
_local2.y = 20.4511;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 230.6824;
_local2.y = 17.9942;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 231.1443;
_local2.y = 15.5372;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 231.6062;
_local2.y = 13.0803;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 232.2088;
_local2.y = 10.7251;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 234.6269;
_local2.y = 10.2102;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 237.1213;
_local2.y = 10.1067;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 238.52;
_local2.y = 8.4334;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 240.2816;
_local2.y = 6.6595;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 241.7507;
_local2.y = 4.6931;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 243.5571;
_local2.y = 2.9986;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 245.9982;
_local2.y = 2.7632;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 248.4979;
_local2.y = 2.8018;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 250.9082;
_local2.y = 3.4155;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 252.1355;
_local2.y = 5.412;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 254.1375;
_local2.y = 6.8677;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 256.4339;
_local2.y = 7.853;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 258.9216;
_local2.y = 7.8236;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 261.3683;
_local2.y = 8.2462;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 263.6769;
_local2.y = 9.1091;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 266.1699;
_local2.y = 9.2167;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 268.6179;
_local2.y = 9.0893;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 270.2862;
_local2.y = 7.4317;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 272.6431;
_local2.y = 6.8044;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 274.0527;
_local2.y = 4.7626;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 275.9409;
_local2.y = 3.2301;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 278.1952;
_local2.y = 3.9887;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 279.9856;
_local2.y = 5.711;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 282.1507;
_local2.y = 6.9233;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 284.6256;
_local2.y = 6.9941;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 287.1034;
_local2.y = 6.7013;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 289.455;
_local2.y = 7.2957;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 291.7214;
_local2.y = 8.2432;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 293.9249;
_local2.y = 9.1273;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 294.9251;
_local2.y = 11.3303;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 295.1283;
_local2.y = 13.8221;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 295.3315;
_local2.y = 16.3138;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 295.5347;
_local2.y = 18.8055;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 295.7013;
_local2.y = 21.2999;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 296.8242;
_local2.y = 22.7639;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 298.2123;
_local2.y = 21.6428;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 298.2791;
_local2.y = 19.1486;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 298.8701;
_local2.y = 16.7194;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 299.4611;
_local2.y = 14.2903;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 300.0521;
_local2.y = 11.8612;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 300.7929;
_local2.y = 9.4951;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 302.892;
_local2.y = 8.511;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 305.2784;
_local2.y = 7.938;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 307.1718;
_local2.y = 6.3668;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 308.1275;
_local2.y = 4.1149;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 310.2928;
_local2.y = 3.1114;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 312.3852;
_local2.y = 1.9147;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 313.6351;
_local2.y = -0.24;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 315.2388;
_local2.y = -2.1459;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 317.0482;
_local2.y = -3.871;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 319.2775;
_local2.y = -4.9123;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 321.7642;
_local2.y = -5.0106;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 324.225;
_local2.y = -4.6761;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 326.4724;
_local2.y = -3.6327;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 328.8498;
_local2.y = -2.8596;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 331.2656;
_local2.y = -2.2286;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 333.6305;
_local2.y = -2.8271;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 335.8423;
_local2.y = -3.9804;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 338.1983;
_local2.y = -4.5256;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 340.6813;
_local2.y = -4.2683;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 343.0126;
_local2.y = -3.4328;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 345.0374;
_local2.y = -2.0862;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 346.0179;
_local2.y = 0.2135;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 347.4681;
_local2.y = 2.1074;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 349.8447;
_local2.y = 2.5881;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 352.3438;
_local2.y = 2.655;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 354.1445;
_local2.y = 4.1031;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 356.5578;
_local2.y = 4.7558;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 359.0013;
_local2.y = 4.5933;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 361.0743;
_local2.y = 5.9906;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 363.123;
_local2.y = 7.3821;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 365.3102;
_local2.y = 8.549;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 367.4639;
_local2.y = 9.8001;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 369.901;
_local2.y = 10.1819;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 372.3692;
_local2.y = 10.4756;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 374.5986;
_local2.y = 11.5998;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 376.0289;
_local2.y = 13.6308;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 377.3964;
_local2.y = 15.7236;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 379.6921;
_local2.y = 16.5537;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 382.1145;
_local2.y = 17.1416;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 384.5966;
_local2.y = 17.2211;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 387.0086;
_local2.y = 16.6824;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 388.2324;
_local2.y = 14.5026;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 390.3177;
_local2.y = 13.5336;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 392.8027;
_local2.y = 13.8073;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 395.2135;
_local2.y = 13.8672;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 397.1729;
_local2.y = 12.3152;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 399.3942;
_local2.y = 11.2944;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 401.8269;
_local2.y = 10.7614;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 404.2974;
_local2.y = 11.111;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 406.7446;
_local2.y = 11.6139;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 408.5521;
_local2.y = 13.2434;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 409.3844;
_local2.y = 15.4332;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 409.4938;
_local2.y = 17.9308;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 409.6032;
_local2.y = 20.4284;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 411.4696;
_local2.y = 21.0991;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 413.9696;
_local2.y = 21.1111;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 414.7289;
_local2.y = 19.2203;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 414.9389;
_local2.y = 16.7291;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 415.149;
_local2.y = 14.238;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 416.1425;
_local2.y = 11.9885;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 418.414;
_local2.y = 11.3763;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 419.9602;
_local2.y = 9.4876;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 422.1966;
_local2.y = 8.6699;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 423.7678;
_local2.y = 6.765;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 426.1355;
_local2.y = 6.244;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 428.3432;
_local2.y = 7.1096;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 430.2247;
_local2.y = 8.7521;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 432.445;
_local2.y = 9.8719;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 434.8455;
_local2.y = 10.4443;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 437.3451;
_local2.y = 10.3999;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 439.8389;
_local2.y = 10.2411;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 441.7323;
_local2.y = 8.8755;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 443.8604;
_local2.y = 7.6896;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 445.6108;
_local2.y = 8.976;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 447.0298;
_local2.y = 10.9293;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 447.5543;
_local2.y = 13.3319;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 447.804;
_local2.y = 15.8194;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 448.0536;
_local2.y = 18.3069;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 448.7805;
_local2.y = 20.6446;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 450.9424;
_local2.y = 21.2202;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 453.2795;
_local2.y = 20.9996;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 454.0146;
_local2.y = 18.6101;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 454.5566;
_local2.y = 16.1724;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 455.0318;
_local2.y = 13.7179;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 455.507;
_local2.y = 11.2635;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 456.8164;
_local2.y = 9.3756;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 459.1582;
_local2.y = 8.6244;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 461.616;
_local2.y = 8.1668;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 462.9593;
_local2.y = 6.1283;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 464.5945;
_local2.y = 4.2617;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 466.9375;
_local2.y = 3.7671;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 469.103;
_local2.y = 5.0163;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 471.0034;
_local2.y = 6.6383;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 473.4359;
_local2.y = 7.1144;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 495;
_local2.y = 7.1144;
_local1.push(_local2);
warry.setingUp(_local2.x, _local2.y, super.getWorld());
_local2 = new Point();
_local2.x = 495;
_local2.y = -5;
_local1.push(_local2);
var _local3:int;
while (_local3 < (_local1.length - 1)) {
setCubePoints(_local1[_local3], _local1[(_local3 + 1)]);
_local3++;
};
}
}
}//package Levels
Section 166
//Level8 (Levels.Level8)
package Levels {
import Box2D.Dynamics.*;
import flash.geom.*;
import flash.display.*;
import Clases.*;
import Bonus.*;
public class Level8 extends Level {
const TIME_LEVEL:int = 2000;
private var warry:Warray;
private var terrainShape:ShapeLevel8;
public function Level8(_arg1:b2World){
terrainShape = new ShapeLevel8();
warry = new Warray();
super();
super.setWorld(_arg1);
generateLevel();
}
public function getTerrainShape():Sprite{
return (terrainShape);
}
public function getWarrayShape():Sprite{
return (warry);
}
private function putTheBonuses(){
var _local1:CuartoBonus = new CuartoBonus();
_local1.x = 3500;
_local1.y = 250;
addChild(_local1);
super.addToBonusArray(_local1);
var _local2:SegundoBonus = new SegundoBonus();
_local2.x = 4200;
_local2.y = 250;
addChild(_local2);
super.addToBonusArray(_local2);
}
public function generateLevel(){
addChild(warry);
addChild(terrainShape);
drawTerrainOfLevel();
putTheBonuses();
}
public function removeCurrentLevel(){
warry.destroyWarray();
}
override public function setTIME():int{
return (TIME_LEVEL);
}
public function drawTerrainOfLevel(){
var _local2:Point;
var _local1:Array = new Array();
_local2 = new Point();
_local2.x = 0;
_local2.y = -5;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 0;
_local2.y = 6.8112;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 8.8569;
_local2.y = 6.8112;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 11.3398;
_local2.y = 6.9137;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 13.704;
_local2.y = 7.7265;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 16.0682;
_local2.y = 8.5393;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 18.4324;
_local2.y = 9.3521;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 20.7965;
_local2.y = 10.165;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 23.1607;
_local2.y = 10.9778;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 25.4915;
_local2.y = 11.8759;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 27.6641;
_local2.y = 13.0945;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 29.7484;
_local2.y = 14.4751;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 30.964;
_local2.y = 16.6099;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 31.8398;
_local2.y = 18.9377;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 32.4284;
_local2.y = 21.3674;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 33.1622;
_local2.y = 23.7381;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 34.5182;
_local2.y = 25.837;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 36.0171;
_local2.y = 27.8208;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 37.7476;
_local2.y = 29.6251;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 39.8701;
_local2.y = 30.9236;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 42.248;
_local2.y = 31.6202;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 44.7249;
_local2.y = 31.9592;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 47.2129;
_local2.y = 31.8957;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 49.7048;
_local2.y = 31.6945;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 52.1051;
_local2.y = 31.1299;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 54.3945;
_local2.y = 30.1256;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 56.752;
_local2.y = 29.3503;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 59.2348;
_local2.y = 29.2305;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 61.6877;
_local2.y = 29.1544;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 63.9013;
_local2.y = 27.9933;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 65.9019;
_local2.y = 26.4941;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 67.8544;
_local2.y = 24.9702;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 69.8386;
_local2.y = 23.6854;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 72.2226;
_local2.y = 22.945;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 74.6692;
_local2.y = 22.4387;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 76.9964;
_local2.y = 21.5251;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 79.4113;
_local2.y = 20.9241;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 81.8736;
_local2.y = 20.4911;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 84.3358;
_local2.y = 20.0581;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 86.7883;
_local2.y = 20.2969;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 89.0655;
_local2.y = 21.3152;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 91.3766;
_local2.y = 22.1908;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 93.8529;
_local2.y = 22.5072;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 96.34;
_local2.y = 22.7607;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 98.8307;
_local2.y = 22.9096;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 101.3297;
_local2.y = 22.894;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 103.8002;
_local2.y = 23.1992;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 106.2434;
_local2.y = 22.8359;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 108.094;
_local2.y = 21.2683;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 110.1354;
_local2.y = 19.8562;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 112.3229;
_local2.y = 18.6512;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 114.5532;
_local2.y = 17.5217;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 116.9534;
_local2.y = 16.916;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 119.4428;
_local2.y = 16.8791;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 121.8396;
_local2.y = 17.0558;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 124.2785;
_local2.y = 16.5066;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 126.5855;
_local2.y = 15.5986;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 128.8275;
_local2.y = 14.8155;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 131.3203;
_local2.y = 15.0047;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 133.7646;
_local2.y = 15.3833;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 135.7969;
_local2.y = 16.7455;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 137.0765;
_local2.y = 18.8878;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 138.3101;
_local2.y = 21.0622;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 139.5249;
_local2.y = 23.2472;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 140.6908;
_local2.y = 25.458;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 141.8095;
_local2.y = 27.6937;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 143.7705;
_local2.y = 29.2047;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 145.8842;
_local2.y = 30.4952;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 148.299;
_local2.y = 31.142;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 150.7694;
_local2.y = 31.4318;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 153.2685;
_local2.y = 31.4691;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 155.7631;
_local2.y = 31.3479;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 157.7996;
_local2.y = 30.2647;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 159.3918;
_local2.y = 28.3372;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 160.5265;
_local2.y = 26.148;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 161.8087;
_local2.y = 24.2797;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 164.2424;
_local2.y = 23.7076;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 166.689;
_local2.y = 23.3518;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 169.1734;
_local2.y = 23.6287;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 171.3592;
_local2.y = 24.8421;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 173.5673;
_local2.y = 26.0125;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 175.819;
_local2.y = 27.0987;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 178.247;
_local2.y = 27.6453;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 180.7057;
_local2.y = 28.0979;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 183.1808;
_local2.y = 28.3008;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 185.6767;
_local2.y = 28.1629;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 188.1598;
_local2.y = 27.8729;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 190.4731;
_local2.y = 27.203;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 192.3452;
_local2.y = 25.5461;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 194.1888;
_local2.y = 23.8611;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 195.8236;
_local2.y = 21.9697;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 197.6329;
_local2.y = 20.2494;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 199.834;
_local2.y = 19.3971;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 202.3282;
_local2.y = 19.3757;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 204.7084;
_local2.y = 19.8708;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 206.5123;
_local2.y = 21.5685;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 208.0131;
_local2.y = 23.568;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 209.5138;
_local2.y = 25.5674;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 211.5041;
_local2.y = 27.012;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 213.7857;
_local2.y = 28.0122;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 216.1798;
_local2.y = 28.7117;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 218.6244;
_local2.y = 29.2352;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 221.0923;
_local2.y = 29.5957;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 223.554;
_local2.y = 29.3788;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 225.9882;
_local2.y = 28.8093;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 228.4561;
_local2.y = 28.4104;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 230.9362;
_local2.y = 28.2408;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 233.418;
_local2.y = 28.4634;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 235.8733;
_local2.y = 28.8943;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 238.3676;
_local2.y = 28.9897;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 240.8492;
_local2.y = 28.7228;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 249.0367;
_local2.y = 20.4286;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 254.3629;
_local2.y = 16.6808;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 257.5814;
_local2.y = 13.5946;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 260.0766;
_local2.y = 13.5079;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 262.2486;
_local2.y = 12.5498;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 264.0793;
_local2.y = 10.8473;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 265.7018;
_local2.y = 8.9481;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 267.6271;
_local2.y = 7.3672;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 269.856;
_local2.y = 6.3095;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 272.2671;
_local2.y = 5.7707;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 274.695;
_local2.y = 6.1626;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 276.8059;
_local2.y = 7.4218;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 277.1011;
_local2.y = 9.8009;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 277.2047;
_local2.y = 34.8006;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 283.3052;
_local2.y = 34.7509;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 283.7884;
_local2.y = 12.2818;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 285.7743;
_local2.y = 10.7647;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 288.2351;
_local2.y = 10.5317;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 290.7247;
_local2.y = 10.6066;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 292.9101;
_local2.y = 11.4873;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 294.0869;
_local2.y = 13.6411;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 294.3745;
_local2.y = 16.1215;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 295.5983;
_local2.y = 18.2859;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 297.3829;
_local2.y = 19.9726;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 299.6456;
_local2.y = 21.0239;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 302.0503;
_local2.y = 21.6715;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 304.4683;
_local2.y = 21.3312;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 306.9441;
_local2.y = 21.5696;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 309.3882;
_local2.y = 22.0787;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 311.8599;
_local2.y = 22.4482;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 314.3394;
_local2.y = 22.6472;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 316.6524;
_local2.y = 21.9271;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 318.3539;
_local2.y = 20.0975;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 320.6787;
_local2.y = 19.4548;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 322.7888;
_local2.y = 18.2259;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 324.8734;
_local2.y = 16.8559;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 327.1805;
_local2.y = 15.9023;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 329.5327;
_local2.y = 15.4423;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 331.9997;
_local2.y = 15.7901;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 334.4873;
_local2.y = 15.8153;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 336.7972;
_local2.y = 14.9473;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 338.0998;
_local2.y = 12.8365;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 340.0526;
_local2.y = 11.2755;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 357.5386;
_local2.y = 8.6749;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 358.972;
_local2.y = 6.6294;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 361.056;
_local2.y = 5.2868;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 363.3978;
_local2.y = 4.4845;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 365.8973;
_local2.y = 4.5116;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 368.2576;
_local2.y = 5.1605;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 370.159;
_local2.y = 6.7704;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 372.3839;
_local2.y = 7.89;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 374.5896;
_local2.y = 9.047;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 377.0777;
_local2.y = 9.2907;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 379.5594;
_local2.y = 9.303;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 381.9616;
_local2.y = 9.9954;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 384.4494;
_local2.y = 10.025;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 386.4995;
_local2.y = 11.3793;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 388.3052;
_local2.y = 13.0991;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 389.4292;
_local2.y = 15.3086;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 390.8443;
_local2.y = 17.2516;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 393.2491;
_local2.y = 17.6059;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 395.626;
_local2.y = 16.9238;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 397.4519;
_local2.y = 15.3231;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 399.7761;
_local2.y = 14.491;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 401.808;
_local2.y = 13.072;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 403.8489;
_local2.y = 12.0126;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 406.2218;
_local2.y = 12.6949;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 408.6756;
_local2.y = 12.88;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 411.1161;
_local2.y = 12.4016;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 413.3573;
_local2.y = 13.1741;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 414.6523;
_local2.y = 15.3113;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 416.7157;
_local2.y = 16.6086;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 419.1697;
_local2.y = 16.9583;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 421.5083;
_local2.y = 16.7245;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 423.7409;
_local2.y = 15.6094;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 425.9225;
_local2.y = 14.3887;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 427.5146;
_local2.y = 12.5778;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 438.7138;
_local2.y = 8.1962;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 441.0217;
_local2.y = 7.2605;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 443.2763;
_local2.y = 7.7772;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 443.6812;
_local2.y = 10.2365;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 443.7589;
_local2.y = 22.7363;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 445.562;
_local2.y = 23.4561;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 448.0619;
_local2.y = 23.4821;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 450.5617;
_local2.y = 23.5082;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 451.9071;
_local2.y = 22.3128;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 452.0217;
_local2.y = 19.8155;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 452.5947;
_local2.y = 7.3286;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 454.7776;
_local2.y = 6.2387;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 456.4165;
_local2.y = 4.3988;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 458.4881;
_local2.y = 3.0869;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 460.0442;
_local2.y = 1.2165;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 461.9712;
_local2.y = -0.1221;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 464.4271;
_local2.y = 0.0662;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 466.2593;
_local2.y = 1.7161;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 467.9751;
_local2.y = 3.5153;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 470.0034;
_local2.y = 4.963;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 472.0942;
_local2.y = 6.3279;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 474.4821;
_local2.y = 6.9538;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 476.9818;
_local2.y = 6.9654;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 479.4818;
_local2.y = 6.9739;
_local1.push(_local2);
_local2 = new Point();
_local2.x = 500;
_local2.y = 6.9739;
_local1.push(_local2);
warry.setingUp(_local2.x, _local2.y, super.getWorld());
_local2 = new Point();
_local2.x = 500;
_local2.y = -5;
_local1.push(_local2);
var _local3:int;
while (_local3 < (_local1.length - 1)) {
setCubePoints(_local1[_local3], _local1[(_local3 + 1)]);
_local3++;
};
}
}
}//package Levels
Section 167
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const LOGGED_IN:String = "LoggedIn";
public static const STORE_ITEMS:String = "StoreItems";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const ITEM_NEW:String = "ItemNew";
public static const USER_INFO:String = "UserInfo";
public static const IO_ERROR:String = "IOError";
public static const ITEM_OWNED:String = "ItemOwned";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOW:String = "LoginShow";
public static const STORE_SHOW:String = "StoreShow";
public static const PROFILE_HIDE:String = "ProfileHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
}
}//package mochi.as3
Section 168
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 169
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 170
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function endGame():void{
var _local1:Number = (new Date().time - gameStart);
trigger("end_game", {time:_local1});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(_arg1:String, _arg2:Object=null):void{
if (_arg2 == null){
_arg2 = {};
} else {
if (_arg2["kind"] != undefined){
trace("WARNING: optional arguements package contains key 'id', it will be overwritten");
_arg2["kind"] = _arg1;
};
};
MochiServices.send("events_triggerEvent", {eventObject:_arg2}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var _local1:Number = (new Date().time - levelStart);
trigger("end_level", {time:_local1});
}
}
}//package mochi.as3
Section 171
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 172
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _clip._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.2 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
var _local3:String = _arg1.loaderInfo.parameters.mochiad_options;
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var clip = _arg1;
loader = new Loader();
var mochiLCURL:String = (_servURL + _mochiLC);
var req:URLRequest = new URLRequest(mochiLCURL);
var complete:Function = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String = ("_mochiservices_com_" + _arg1);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local4:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local4 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local4);
_clip = createEmptyMovieClip(_arg2, _local3, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local5:URLRequest = new URLRequest(_local4);
var _local6:URLVariables = new URLVariables();
_local6.listenLC = _listenChannelName;
_local6.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local6.api_version = getVersion();
if (widget){
_local6.widget = true;
};
_local5.data = _local6;
_loader.load(_local5);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
var mc:MovieClip = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 173
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
if (_syncContainer[_arg1] == _arg2){
return;
};
var _local3:String = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
}
}//package mochi.as3
Section 174
//ProgBar (net.creativedynamix.progbar.ProgBar)
package net.creativedynamix.progbar {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
public class ProgBar extends MovieClip {
protected var _pbTextField:TextField;
protected var _pbInitialX:Number;// = -1
protected var _pbInitialY:Number;// = -1
protected var _pbTextFieldColor:Number;// = 0
protected var _pbBorderColor:Number;// = 6513247
protected var _pb:Sprite;
protected var _pbColor:Number;// = 14015635
protected var _stage:Stage;
protected var _pbHeight:Number;// = 10
protected var _pbBorderShadow:uint;// = 0
protected var _pbMaxValue:Number;// = 300
protected var _pbBorder:Number;// = 6
protected var _pbWidth:Number;// = 200
protected var _pbRound:Number;// = 2
protected var _pbShowTextField:Boolean;// = false
public function ProgBar(_arg1:Object=null):void{
var _pbObj = _arg1;
_pb = new Sprite();
super();
try {
_pb = new Sprite();
if (_pbObj != null){
if (((!((_pbObj.width == null))) && (!((_pbObj.width == undefined))))){
_pbWidth = _pbObj.width;
};
if (((!((_pbObj.height == null))) && (!((_pbObj.height == undefined))))){
_pbHeight = _pbObj.height;
};
if (((!((_pbObj.x == null))) && (!((_pbObj.x == undefined))))){
_pbInitialX = _pbObj.x;
};
if (((!((_pbObj.y == null))) && (!((_pbObj.y == undefined))))){
_pbInitialY = _pbObj.y;
};
if (((!((_pbObj.borderWidth == null))) && (!((_pbObj.borderWidth == undefined))))){
_pbBorder = _pbObj.borderWidth;
};
if (((!((_pbObj.color == null))) && (!((_pbObj.color == undefined))))){
_pbColor = _pbObj.color;
};
if (((!((_pbObj.borderColor == null))) && (!((_pbObj.borderColor == undefined))))){
_pbBorderColor = _pbObj.borderColor;
};
if (((!((_pbObj.maxValue == null))) && (!((_pbObj.maxValue == undefined))))){
_pbMaxValue = _pbObj.maxValue;
};
if (((!((_pbObj.round == null))) && (!((_pbObj.round == undefined))))){
_pbRound = _pbObj.round;
};
if (((!((_pbObj.borderShadow == null))) && (!((_pbObj.borderShadow == undefined))))){
_pbBorderShadow = _pbObj.borderShadow;
};
if (((!((_pbObj.showTextField == null))) && (!((_pbObj.showTextField == undefined))))){
_pbShowTextField = _pbObj.showTextField;
};
if (((!((_pbObj.textColor == null))) && (!((_pbObj.textColor == undefined))))){
_pbTextFieldColor = _pbObj.textColor;
};
if (((!((_pbObj.stage == null))) && (!((_pbObj.stage == undefined))))){
_stage = _pbObj.stage;
};
};
drawBorder();
drawProgressBar();
if (_pbShowTextField){
drawTextField();
};
} catch(_err:Error) {
trace(("ERROR ON ProgBar Constructor: " + _err.toString()));
} finally {
addEventListener(Event.ADDED, create);
};
}
private function drawProgressBar():void{
var _pbBack:Sprite;
try {
_pbBack = new Sprite();
_pbBack.x = _pbBorder;
_pbBack.y = _pbBorder;
_pbBack.graphics.beginFill(0, 0.25);
_pbBack.graphics.lineStyle(1, 0, 0.5);
_pbBack.graphics.drawRect(0, 0, _pbWidth, _pbHeight);
_pbBack.graphics.endFill();
addChild(_pbBack).name = "progress_bar_back";
_pb.x = _pbBorder;
_pb.y = _pbBorder;
_pb.graphics.beginFill(_pbColor, 1);
_pb.graphics.lineStyle(1, _pbColor, 1);
_pb.graphics.drawRect(0, 0, _pbWidth, _pbHeight);
_pb.graphics.endFill();
addChild(_pb).name = "progress_bar";
} catch(_err:Error) {
trace(("ERROR ON ProgBar.drawProgressBar(): " + _err.toString()));
};
}
public function remove():void{
try {
if (_pbShowTextField){
_pbTextField.text = "";
};
this.parent.removeChild(this);
} catch(_err:Error) {
trace(("ERROR ON ProgBar.remove(): " + _err.toString()));
};
}
private function create(_arg1:Event):void{
var event = _arg1;
try {
if (_stage == null){
_stage = this.stage;
};
if (_pbInitialX == -1){
this.x = ((_stage.stageWidth * 0.5) - (_pbWidth * 0.5));
} else {
this.x = _pbInitialX;
};
if (_pbInitialY == -1){
this.y = ((_stage.stageHeight * 0.5) - (this.height * 0.5));
} else {
this.y = _pbInitialY;
};
} catch(_err:Error) {
trace(("ERROR ON ProgBar.create(): " + _err.toString()));
};
}
private function drawBorder():void{
var _Background:Sprite;
var myFilter:BitmapFilter;
var filterArray:Array;
try {
_Background = new Sprite();
_Background.x = 0;
_Background.y = 0;
_Background.graphics.beginFill(_pbBorderColor, 1);
_Background.graphics.lineStyle(1, _pbBorderColor, 1);
_Background.graphics.drawRect(0, 0, (_pbWidth + (_pbBorder * 2)), (_pbHeight + (_pbBorder * 2)));
_Background.graphics.endFill();
myFilter = InnerGlowFilter(_pbBorderShadow);
filterArray = new Array(myFilter);
_Background.filters = filterArray;
addChild(_Background).name = "progress_background";
} catch(_err:Error) {
trace(("ERROR ON ProgBar.drawBorder(): " + _err.toString()));
};
}
public function updatePercent(_arg1:Number):void{
var _percent = _arg1;
try {
if (_pb){
if (_percent < 100){
_pb.width = ((_percent * _pbWidth) / 100);
if (_pbShowTextField){
_pbTextField.text = (Math.floor(_percent) + "%");
};
} else {
_pb.width = _pbWidth;
if (_pbShowTextField){
_pbTextField.text = "";
};
};
} else {
trace("Progress Bar hasn't been created yet...");
};
} catch(_err:Error) {
trace(("ERROR ON ProgBar.updatePercent(): " + _err.toString()));
};
}
public function updateValue(_arg1:Number):void{
var myValue:*;
var _value = _arg1;
try {
if (_pb){
myValue = ((_pbWidth * _value) / _pbMaxValue);
if (_value <= _pbMaxValue){
_pb.width = myValue;
if (_pbShowTextField){
_pbTextField.text = (_value + "%");
};
} else {
_pb.width = _pbWidth;
if (_pbShowTextField){
_pbTextField.text = "100%";
};
};
} else {
trace("Progress Bar hasn't been created yet...");
};
} catch(_err:Error) {
trace(("ERROR ON ProgBar.updateValue(): " + _err.toString()));
};
}
private function drawTextField():void{
var textFormat:TextFormat;
var pbTextField:TextField;
try {
textFormat = new TextFormat();
textFormat.font = "Arial";
textFormat.color = _pbTextFieldColor;
textFormat.size = ((_pbHeight * 0.5) + 3);
textFormat.bold = true;
textFormat.align = TextFormatAlign.CENTER;
pbTextField = new TextField();
pbTextField.text = "0%";
pbTextField.x = _pb.x;
pbTextField.y = (_pb.y - 2);
pbTextField.width = _pb.width;
pbTextField.height = (_pb.height + 3);
pbTextField.wordWrap = true;
pbTextField.multiline = false;
pbTextField.selectable = false;
pbTextField.condenseWhite = true;
pbTextField.defaultTextFormat = textFormat;
pbTextField.antiAliasType = "advanced";
addChild(pbTextField).name = "progress_text";
_pbTextField = TextField(this.getChildByName("progress_text"));
} catch(_err:Error) {
trace(("ERROR ON ProgBar.drawTextField(): " + _err.toString()));
};
}
private function InnerGlowFilter(_arg1:uint):BitmapFilter{
var _local2:uint = _arg1;
var _local3:Number = 0.5;
var _local4:Number = 4;
var _local5:Number = 4;
var _local6:Number = 1;
var _local7:Boolean;
var _local8:Boolean;
var _local9:Number = BitmapFilterQuality.HIGH;
return (new GlowFilter(_local2, _local3, _local4, _local5, _local6, _local9, _local7, _local8));
}
}
}//package net.creativedynamix.progbar
Section 175
//Amortiguador (Amortiguador)
package {
import flash.display.*;
public dynamic class Amortiguador extends Sprite {
}
}//package
Section 176
//AmortiguadorTrasero (AmortiguadorTrasero)
package {
import flash.display.*;
public dynamic class AmortiguadorTrasero extends Sprite {
}
}//package
Section 177
//BackgroundAnimation (BackgroundAnimation)
package {
import flash.display.*;
public dynamic class BackgroundAnimation extends MovieClip {
}
}//package
Section 178
//BackSpin (BackSpin)
package {
import flash.display.*;
public dynamic class BackSpin extends Sprite {
}
}//package
Section 179
//BackToMainButton (BackToMainButton)
package {
import flash.display.*;
public dynamic class BackToMainButton extends SimpleButton {
}
}//package
Section 180
//BloodSplash (BloodSplash)
package {
import flash.media.*;
public dynamic class BloodSplash extends Sound {
}
}//package
Section 181
//BrazoDestroy (BrazoDestroy)
package {
import flash.display.*;
public dynamic class BrazoDestroy extends MovieClip {
}
}//package
Section 182
//Cabeza (Cabeza)
package {
import flash.display.*;
public dynamic class Cabeza extends MovieClip {
}
}//package
Section 183
//CabezaDestroy (CabezaDestroy)
package {
import flash.display.*;
public dynamic class CabezaDestroy extends MovieClip {
}
}//package
Section 184
//Carroceria (Carroceria)
package {
import flash.display.*;
public dynamic class Carroceria extends Sprite {
}
}//package
Section 185
//CarStart (CarStart)
package {
import flash.media.*;
public dynamic class CarStart extends Sound {
}
}//package
Section 186
//ClickMe (ClickMe)
package {
import flash.display.*;
public dynamic class ClickMe extends SimpleButton {
}
}//package
Section 187
//CreditsButton (CreditsButton)
package {
import flash.display.*;
public dynamic class CreditsButton extends SimpleButton {
}
}//package
Section 188
//EntreScreen (EntreScreen)
package {
import flash.display.*;
public dynamic class EntreScreen extends MovieClip {
}
}//package
Section 189
//FowardSpinBonus (FowardSpinBonus)
package {
import flash.display.*;
public dynamic class FowardSpinBonus extends Sprite {
}
}//package
Section 190
//GameLoop (GameLoop)
package {
import flash.display.*;
import flash.events.*;
import caurina.transitions.*;
import Display.*;
import mochi.as3.*;
import flash.text.*;
import flash.net.*;
public dynamic class GameLoop extends MovieClip {
private var titleStarted:Boolean;// = false
private var clik:ClickMe;
private var backPreloader:PreLoaderBackgreound;
private var textLoadCounter:TextField;
private var ctd:int;// = 800
private var font:PreloaderFont;
private var fTime:TimeUtil;
private var textLoadCounterFormat:TextFormat;
private var percentLoaded:int;
private var i6:I6introsmall;
private var loaderStarted:Boolean;// = false
private var loadingBox:LoadingBox;
private var i6small:I6introsmall;
private var gameState:int;// = 0
public static const STATE_SYSTEM_LOADER:int = 0;
public static const STATE_SYSTEM_TITLE:int = 1;
public static var mainGame:Main;
public function GameLoop():void{
loadingBox = new LoadingBox();
fTime = new TimeUtil();
font = new PreloaderFont();
textLoadCounter = new TextField();
textLoadCounterFormat = new TextFormat();
backPreloader = new PreLoaderBackgreound();
i6 = new I6introsmall();
i6small = new I6introsmall();
clik = new ClickMe();
super();
addFrameScript(0, frame1, 2, frame3);
MochiServices.connect("7ca4073f5672359c", root);
addChild(backPreloader);
i6.width = 200;
i6.height = 200;
i6.x = 0xFF;
i6.y = 35;
addChild(i6);
i6small.x = 590;
i6small.y = 350;
i6small.width = 70;
i6small.height = 70;
addChild(i6small);
backPreloader.x = 0;
backPreloader.y = 0;
addEventListener(Event.ENTER_FRAME, runGame);
textLoadCounterFormat.font = font.fontName;
textLoadCounterFormat.color = 0xD6D6D6;
textLoadCounterFormat.size = 45;
textLoadCounter.x = 230;
textLoadCounter.y = 240;
textLoadCounter.width = 160;
textLoadCounter.height = 150;
textLoadCounter.selectable = false;
textLoadCounter.text = "Wait: 10";
textLoadCounter.x = 1000;
textLoadCounter.setTextFormat(textLoadCounterFormat);
addChild(textLoadCounter);
addChild(loadingBox);
addChild(clik);
clik.addEventListener(MouseEvent.CLICK, gotoI6Page);
}
function frame3(){
stop();
}
public function loadingComplete(_arg1:Event){
trace("loadingComplete");
this.loaderInfo.removeEventListener(Event.INIT, loadingComplete);
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadingProgress);
finishPreload();
}
public function loadingProgress(_arg1:Event):void{
percentLoaded = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
trace(percentLoaded);
loadingBox.update(percentLoaded);
}
private function addGameAfterTheCounter(_arg1:Event){
ctd--;
if (ctd > 0){
textLoadCounter.text = ("Wait: " + fTime.formatTime(ctd));
textLoadCounter.setTextFormat(textLoadCounterFormat);
} else {
removeChild(backPreloader);
removeChild(i6);
removeChild(i6small);
removeChild(clik);
removeChild(loadingBox);
removeChild(textLoadCounter);
mainGame = new Main();
addChild(mainGame);
mainGame.init();
mainGame.playMusic();
this.removeEventListener(Event.ENTER_FRAME, addGameAfterTheCounter);
};
}
private function gotoI6Page(_arg1:MouseEvent){
var _local2:URLRequest = new URLRequest("http://www.i6.com/free-games/78/racing?utm_source=games&utm_medium=dr2pr");
navigateToURL(_local2, "_blank");
}
public function runGame(_arg1:Event):void{
switch (gameState){
case STATE_SYSTEM_LOADER:
doLoadScreen();
break;
case STATE_SYSTEM_TITLE:
doTitleScreen();
break;
};
}
public function doTitleScreen():void{
if (((!(titleStarted)) && ((currentFrame == 3)))){
this.addEventListener(Event.ENTER_FRAME, addGameAfterTheCounter);
Tweener.addTween(loadingBox, {x:800, time:2, transition:"easeInOutBack"});
titleStarted = true;
Tweener.addTween(textLoadCounter, {x:275, time:4, transition:"easeOutSine"});
};
}
function frame1(){
MochiBot.track(this, "8be8e39a");
MochiBot.track(this, "cbaaa86d");
}
public function doLoadScreen():void{
trace(((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100));
if (!loaderStarted){
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
finishPreload();
} else {
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadingProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, loadingComplete);
loaderStarted = true;
loadingBox.x = 0;
loadingBox.y = 0;
};
};
}
public function finishPreload():void{
this.play();
gameState = STATE_SYSTEM_TITLE;
}
}
}//package
Section 191
//I6Animacion (I6Animacion)
package {
import flash.display.*;
public dynamic class I6Animacion extends MovieClip {
}
}//package
Section 192
//I6introsmall (I6introsmall)
package {
import flash.display.*;
public dynamic class I6introsmall extends MovieClip {
}
}//package
Section 193
//IdleEngine (IdleEngine)
package {
import flash.media.*;
public dynamic class IdleEngine extends Sound {
}
}//package
Section 194
//LevelActivated (LevelActivated)
package {
import flash.display.*;
public dynamic class LevelActivated extends Sprite {
}
}//package
Section 195
//LevelSelectBackground (LevelSelectBackground)
package {
import flash.display.*;
public dynamic class LevelSelectBackground extends MovieClip {
}
}//package
Section 196
//LoadingBox (LoadingBox)
package {
import flash.display.*;
import net.creativedynamix.progbar.*;
public class LoadingBox extends MovieClip {
private var preLoadBar:ProgBar;
public function LoadingBox(){
preLoadBar = new ProgBar({width:653, height:35, x:0, y:280, borderWidth:3, borderColor:39167, borderShadow:0, round:10, color:0xFFFF00, maxValue:100, showTextField:false, textColor:0});
super();
addChild(preLoadBar);
preLoadBar.alpha = 0.3;
}
public function update(_arg1:int):void{
preLoadBar.updatePercent(_arg1);
}
}
}//package
Section 197
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
import gs.*;
import Clases.*;
import Display.*;
import gs.easing.*;
import flash.media.*;
import Clases.MoreGames.*;
import flash.ui.*;
import flash.net.*;
public class Main extends Sprite {
private var backG:MainBackgreound;
private var game:LevelSelection;
private var copyright:ContextMenuItem;
private var pB:DisplayButton;
private var fm_menu:ContextMenu;
private var pMoreGames:DisplayButton;
private var freeSiteContent:DisplayButton;
private var musicTheme:MusicTheme;
private var canalMusica:SoundChannel;
private var credit:ContextMenuItem;
public function Main(){
pB = new DisplayButton();
pMoreGames = new DisplayButton();
freeSiteContent = new DisplayButton();
backG = new MainBackgreound();
canalMusica = new SoundChannel();
musicTheme = new MusicTheme();
fm_menu = new ContextMenu();
copyright = new ContextMenuItem("Copyright © Puelo Games");
credit = new ContextMenuItem("www.puelogames.com.ar");
super();
}
private function startTheGame(_arg1:MouseEvent){
rmoveMainElements();
game = new LevelSelection();
addChild(game);
game.setingUp(stage);
game.addMain(this);
game.levelSelectionInitGame();
addChild(game);
}
private function rmoveMainElements(){
removeChild(pB);
removeChild(backG);
removeChild(pMoreGames);
removeChild(freeSiteContent);
canalMusica.stop();
}
public function init(){
addChild(backG);
copyright.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visit_flashmo);
credit.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visit_flashmo);
credit.separatorBefore = false;
fm_menu.hideBuiltInItems();
fm_menu.customItems.push(copyright, credit);
this.contextMenu = fm_menu;
pB.setingUp(new PlayButton(), "easeOutSine");
pB.setXY(730, 250);
addChild(pB);
pB.addEventListener(MouseEvent.CLICK, startTheGame);
pMoreGames.setingUp(new PlayMoreGames(), "easeOutSine");
pMoreGames.setXY(800, 300);
addChild(pMoreGames);
freeSiteContent.setingUp(new FreeGamesForYouSite(), "easeOutSine");
freeSiteContent.setXY(800, 350);
addChild(freeSiteContent);
TweenMax.to(pB, 1.5, {x:-230, ease:Back.easeOut});
TweenMax.to(pMoreGames, 1.5, {x:-295, delay:0.52, ease:Back.easeOut});
TweenMax.to(freeSiteContent, 1.5, {x:-295, delay:1.02, ease:Back.easeOut});
}
public function playMusic(){
canalMusica = musicTheme.play(0, 999);
}
private function visit_flashmo(_arg1:Event){
var _local2:URLRequest = new URLRequest("http://www.puelogames.com.ar");
navigateToURL(_local2, "_blank");
}
public function restartMain(){
removeChild(game);
init();
}
}
}//package
Section 198
//MainBackgreound (MainBackgreound)
package {
import flash.display.*;
public dynamic class MainBackgreound extends Sprite {
}
}//package
Section 199
//MainLevelButton (MainLevelButton)
package {
import flash.display.*;
public dynamic class MainLevelButton extends SimpleButton {
}
}//package
Section 200
//MainLevelLockedButton (MainLevelLockedButton)
package {
import flash.display.*;
public dynamic class MainLevelLockedButton extends SimpleButton {
}
}//package
Section 201
//ManoDestroy (ManoDestroy)
package {
import flash.display.*;
public dynamic class ManoDestroy extends MovieClip {
}
}//package
Section 202
//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{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 203
//MusicTheme (MusicTheme)
package {
import flash.media.*;
public dynamic class MusicTheme extends Sound {
}
}//package
Section 204
//MyFont (MyFont)
package {
import flash.text.*;
public dynamic class MyFont extends Font {
}
}//package
Section 205
//PiernaDestroy (PiernaDestroy)
package {
import flash.display.*;
public dynamic class PiernaDestroy extends MovieClip {
}
}//package
Section 206
//PiesDestroy (PiesDestroy)
package {
import flash.display.*;
public dynamic class PiesDestroy extends MovieClip {
}
}//package
Section 207
//PlayButton (PlayButton)
package {
import flash.display.*;
public dynamic class PlayButton extends SimpleButton {
}
}//package
Section 208
//PreLoaderBackgreound (PreLoaderBackgreound)
package {
import flash.display.*;
public dynamic class PreLoaderBackgreound extends Sprite {
}
}//package
Section 209
//PreloaderFont (PreloaderFont)
package {
import flash.text.*;
public dynamic class PreloaderFont extends Font {
}
}//package
Section 210
//RockSound (RockSound)
package {
import flash.media.*;
public dynamic class RockSound extends Sound {
}
}//package
Section 211
//RuedaDelantera (RuedaDelantera)
package {
import flash.display.*;
public dynamic class RuedaDelantera extends Sprite {
}
}//package
Section 212
//RuedaTrasera (RuedaTrasera)
package {
import flash.display.*;
public dynamic class RuedaTrasera extends Sprite {
}
}//package
Section 213
//ShapeLevel1 (ShapeLevel1)
package {
import flash.display.*;
public dynamic class ShapeLevel1 extends Sprite {
}
}//package
Section 214
//ShapeLevel2 (ShapeLevel2)
package {
import flash.display.*;
public dynamic class ShapeLevel2 extends Sprite {
}
}//package
Section 215
//ShapeLevel3 (ShapeLevel3)
package {
import flash.display.*;
public dynamic class ShapeLevel3 extends Sprite {
}
}//package
Section 216
//ShapeLevel4 (ShapeLevel4)
package {
import flash.display.*;
public dynamic class ShapeLevel4 extends Sprite {
}
}//package
Section 217
//ShapeLevel5 (ShapeLevel5)
package {
import flash.display.*;
public dynamic class ShapeLevel5 extends Sprite {
}
}//package
Section 218
//ShapeLevel6 (ShapeLevel6)
package {
import flash.display.*;
public dynamic class ShapeLevel6 extends Sprite {
}
}//package
Section 219
//ShapeLevel7 (ShapeLevel7)
package {
import flash.display.*;
public dynamic class ShapeLevel7 extends Sprite {
}
}//package
Section 220
//ShapeLevel8 (ShapeLevel8)
package {
import flash.display.*;
public dynamic class ShapeLevel8 extends Sprite {
}
}//package
Section 221
//TimeOver (TimeOver)
package {
import flash.display.*;
public dynamic class TimeOver extends Sprite {
}
}//package
Section 222
//TimeOverSpaceBar (TimeOverSpaceBar)
package {
import flash.display.*;
public dynamic class TimeOverSpaceBar extends MovieClip {
}
}//package
Section 223
//Torzo2 (Torzo2)
package {
import flash.display.*;
public dynamic class Torzo2 extends MovieClip {
}
}//package
Section 224
//Torzo3 (Torzo3)
package {
import flash.display.*;
public dynamic class Torzo3 extends MovieClip {
}
}//package
Section 225
//TorzoDestroy (TorzoDestroy)
package {
import flash.display.*;
public dynamic class TorzoDestroy extends MovieClip {
}
}//package
Section 226
//TryAgainShape (TryAgainShape)
package {
import flash.display.*;
public dynamic class TryAgainShape extends Sprite {
}
}//package
Section 227
//WarrayBack (WarrayBack)
package {
import flash.display.*;
public dynamic class WarrayBack extends Sprite {
}
}//package
Section 228
//WhellDoneShape (WhellDoneShape)
package {
import flash.display.*;
public dynamic class WhellDoneShape extends Sprite {
}
}//package