Section 1
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2CircleDef extends b2ShapeDef {
public var localPosition:b2Vec2;
public var radius:Number;
public function b2CircleDef(){
localPosition = new b2Vec2(0, 0);
super();
type = b2Shape.e_circleShape;
radius = 1;
}
}
}//package Box2D.Collision.Shapes
Section 2
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2CircleShape extends b2Shape {
public var m_radius:Number;
public var m_localPosition:b2Vec2;
public function b2CircleShape(_arg1:b2ShapeDef){
var _local2:b2CircleDef;
m_localPosition = new b2Vec2();
super(_arg1);
_local2 = (_arg1 as b2CircleDef);
m_type = e_circleShape;
m_localPosition.SetV(_local2.localPosition);
m_radius = _local2.radius;
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
_local3 = _arg1.R;
_local4 = (_arg1.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
_local5 = (_arg1.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_local4 = (_arg2.x - _local4);
_local5 = (_arg2.y - _local5);
return ((((_local4 * _local4) + (_local5 * _local5)) <= (m_radius * m_radius)));
}
public function GetLocalPosition():b2Vec2{
return (m_localPosition);
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):int{
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local6 = _arg1.R;
_local7 = (_arg1.position.x + ((_local6.col1.x * m_localPosition.x) + (_local6.col2.x * m_localPosition.y)));
_local8 = (_arg1.position.y + ((_local6.col1.y * m_localPosition.x) + (_local6.col2.y * m_localPosition.y)));
_local9 = (_arg4.p1.x - _local7);
_local10 = (_arg4.p1.y - _local8);
_local11 = (((_local9 * _local9) + (_local10 * _local10)) - (m_radius * m_radius));
if (_local11 < 0){
_arg2[0] = 0;
return (e_startsInsideCollide);
};
_local12 = (_arg4.p2.x - _arg4.p1.x);
_local13 = (_arg4.p2.y - _arg4.p1.y);
_local14 = ((_local9 * _local12) + (_local10 * _local13));
_local15 = ((_local12 * _local12) + (_local13 * _local13));
_local16 = ((_local14 * _local14) - (_local15 * _local11));
if ((((_local16 < 0)) || ((_local15 < Number.MIN_VALUE)))){
return (e_missCollide);
};
_local17 = -((_local14 + Math.sqrt(_local16)));
if ((((0 <= _local17)) && ((_local17 <= (_arg5 * _local15))))){
_local17 = (_local17 / _local15);
_arg2[0] = _local17;
_arg3.x = (_local9 + (_local17 * _local12));
_arg3.y = (_local10 + (_local17 * _local13));
_arg3.Normalize();
return (e_hitCollide);
};
return (e_missCollide);
}
override public function ComputeMass(_arg1:b2MassData):void{
_arg1.mass = (((m_density * b2Settings.b2_pi) * m_radius) * m_radius);
_arg1.center.SetV(m_localPosition);
_arg1.I = (_arg1.mass * (((0.5 * m_radius) * m_radius) + ((m_localPosition.x * m_localPosition.x) + (m_localPosition.y * m_localPosition.y))));
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = _arg2.R;
_local5 = (_arg2.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
_local6 = (_arg2.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_local4 = _arg3.R;
_local7 = (_arg3.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
_local8 = (_arg3.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((((_local5 < _local7)) ? _local5 : _local7 - m_radius), (((_local6 < _local8)) ? _local6 : _local8 - m_radius));
_arg1.upperBound.Set((((_local5 > _local7)) ? _local5 : _local7 + m_radius), (((_local6 > _local8)) ? _local6 : _local8 + m_radius));
}
public function GetRadius():Number{
return (m_radius);
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:Number;
var _local3:Number;
_local2 = (m_localPosition.x - _arg1.x);
_local3 = (m_localPosition.y - _arg1.y);
_local2 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
m_sweepRadius = ((_local2 + m_radius) - b2Settings.b2_toiSlop);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.R;
_local4 = (_arg2.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
_local5 = (_arg2.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((_local4 - m_radius), (_local5 - m_radius));
_arg1.upperBound.Set((_local4 + m_radius), (_local5 + m_radius));
}
}
}//package Box2D.Collision.Shapes
Section 3
//b2FilterData (Box2D.Collision.Shapes.b2FilterData)
package Box2D.Collision.Shapes {
public class b2FilterData {
public var maskBits:uint;// = 0xFFFF
public var groupIndex:int;// = 0
public var categoryBits:uint;// = 1
public function b2FilterData(){
categoryBits = 1;
maskBits = 0xFFFF;
groupIndex = 0;
super();
}
public function Copy():b2FilterData{
var _local1:b2FilterData;
_local1 = new b2FilterData();
_local1.categoryBits = categoryBits;
_local1.maskBits = maskBits;
_local1.groupIndex = groupIndex;
return (_local1);
}
}
}//package Box2D.Collision.Shapes
Section 4
//b2MassData (Box2D.Collision.Shapes.b2MassData)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2MassData {
public var mass:Number;// = 0
public var center:b2Vec2;
public var I:Number;// = 0
public function b2MassData(){
mass = 0;
center = new b2Vec2(0, 0);
I = 0;
super();
}
}
}//package Box2D.Collision.Shapes
Section 5
//b2PolygonDef (Box2D.Collision.Shapes.b2PolygonDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PolygonDef extends b2ShapeDef {
public var vertexCount:int;
public var vertices:Array;
private static var s_mat:b2Mat22 = new b2Mat22();
public function b2PolygonDef(){
var _local1:int;
vertices = new Array(b2Settings.b2_maxPolygonVertices);
super();
type = b2Shape.e_polygonShape;
vertexCount = 0;
_local1 = 0;
while (_local1 < b2Settings.b2_maxPolygonVertices) {
vertices[_local1] = new b2Vec2();
_local1++;
};
}
public function SetAsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):void{
var _local5:b2Vec2;
var _local6:b2Mat22;
var _local7:int;
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
if (_arg3){
_local5 = _arg3;
_local6 = s_mat;
_local6.Set(_arg4);
_local7 = 0;
while (_local7 < vertexCount) {
_arg3 = vertices[_local7];
_arg1 = (_local5.x + ((_local6.col1.x * _arg3.x) + (_local6.col2.x * _arg3.y)));
_arg3.y = (_local5.y + ((_local6.col1.y * _arg3.x) + (_local6.col2.y * _arg3.y)));
_arg3.x = _arg1;
_local7++;
};
};
}
public function SetAsBox(_arg1:Number, _arg2:Number):void{
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
}
}
}//package Box2D.Collision.Shapes
Section 6
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolygonShape extends b2Shape {
public var m_vertices:Array;
public var m_normals:Array;
private var s_supportVec:b2Vec2;
public var m_obb:b2OBB;
public var m_coreVertices:Array;
public var m_centroid:b2Vec2;
public var m_vertexCount:int;
private static var s_computeMat:b2Mat22 = new b2Mat22();
private static var s_sweptAABB1:b2AABB = new b2AABB();
private static var s_sweptAABB2:b2AABB = new b2AABB();
public function b2PolygonShape(_arg1:b2ShapeDef){
var _local2:b2PolygonDef;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
s_supportVec = new b2Vec2();
m_obb = new b2OBB();
m_vertices = new Array(b2Settings.b2_maxPolygonVertices);
m_normals = new Array(b2Settings.b2_maxPolygonVertices);
m_coreVertices = new Array(b2Settings.b2_maxPolygonVertices);
super(_arg1);
m_type = e_polygonShape;
_local2 = (_arg1 as b2PolygonDef);
m_vertexCount = _local2.vertexCount;
_local4 = _local3;
_local5 = _local3;
_local3 = 0;
while (_local3 < m_vertexCount) {
m_vertices[_local3] = _local2.vertices[_local3].Copy();
_local3++;
};
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = _local3;
_local5 = (((_local3 + 1) < m_vertexCount)) ? (_local3 + 1) : 0;
_local6 = (m_vertices[_local5].x - m_vertices[_local4].x);
_local7 = (m_vertices[_local5].y - m_vertices[_local4].y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
m_normals[_local3] = new b2Vec2((_local7 / _local8), (-(_local6) / _local8));
_local3++;
};
m_centroid = ComputeCentroid(_local2.vertices, _local2.vertexCount);
ComputeOBB(m_obb, m_vertices, m_vertexCount);
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = (((_local3 - 1) >= 0)) ? (_local3 - 1) : (m_vertexCount - 1);
_local5 = _local3;
_local9 = m_normals[_local4].x;
_local10 = m_normals[_local4].y;
_local11 = m_normals[_local5].x;
_local12 = m_normals[_local5].y;
_local13 = (m_vertices[_local3].x - m_centroid.x);
_local14 = (m_vertices[_local3].y - m_centroid.y);
_local15 = (((_local9 * _local13) + (_local10 * _local14)) - b2Settings.b2_toiSlop);
_local16 = (((_local11 * _local13) + (_local12 * _local14)) - b2Settings.b2_toiSlop);
_local17 = (1 / ((_local9 * _local12) - (_local10 * _local11)));
m_coreVertices[_local3] = new b2Vec2(((_local17 * ((_local12 * _local15) - (_local10 * _local16))) + m_centroid.x), ((_local17 * ((_local9 * _local16) - (_local11 * _local15))) + m_centroid.y));
_local3++;
};
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:Number;
_local4 = _arg1.R;
_local5 = (_arg2.x - _arg1.position.x);
_local6 = (_arg2.y - _arg1.position.y);
_local7 = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y));
_local8 = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y));
_local9 = 0;
while (_local9 < m_vertexCount) {
_local3 = m_vertices[_local9];
_local5 = (_local7 - _local3.x);
_local6 = (_local8 - _local3.y);
_local3 = m_normals[_local9];
_local10 = ((_local3.x * _local5) + (_local3.y * _local6));
if (_local10 > 0){
return (false);
};
_local9++;
};
return (true);
}
public function GetCoreVertices():Array{
return (m_coreVertices);
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):int{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:Number;
var _local21:Number;
_local6 = 0;
_local7 = _arg5;
_local8 = (_arg4.p1.x - _arg1.position.x);
_local9 = (_arg4.p1.y - _arg1.position.y);
_local10 = _arg1.R;
_local12 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
_local13 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local8 = (_arg4.p2.x - _arg1.position.x);
_local9 = (_arg4.p2.y - _arg1.position.y);
_local10 = _arg1.R;
_local14 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
_local15 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local16 = (_local14 - _local12);
_local17 = (_local15 - _local13);
_local18 = -1;
_local19 = 0;
while (_local19 < m_vertexCount) {
_local11 = m_vertices[_local19];
_local8 = (_local11.x - _local12);
_local9 = (_local11.y - _local13);
_local11 = m_normals[_local19];
_local20 = ((_local11.x * _local8) + (_local11.y * _local9));
_local21 = ((_local11.x * _local16) + (_local11.y * _local17));
if ((((_local21 < 0)) && ((_local20 < (_local6 * _local21))))){
_local6 = (_local20 / _local21);
_local18 = _local19;
} else {
if ((((_local21 > 0)) && ((_local20 < (_local7 * _local21))))){
_local7 = (_local20 / _local21);
};
};
if (_local7 < _local6){
return (e_missCollide);
};
_local19++;
};
if (_local18 >= 0){
_arg2[0] = _local6;
_local10 = _arg1.R;
_local11 = m_normals[_local18];
_arg3.x = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_arg3.y = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
return (e_hitCollide);
};
_arg2[0] = 0;
return (e_startsInsideCollide);
}
public function GetCentroid():b2Vec2{
return (m_centroid);
}
override public function ComputeMass(_arg1:b2MassData):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = (1 / 3);
_local9 = 0;
while (_local9 < m_vertexCount) {
_local10 = m_vertices[_local9];
_local11 = (((_local9 + 1) < m_vertexCount)) ? m_vertices[int((_local9 + 1))] : m_vertices[0];
_local12 = (_local10.x - _local6);
_local13 = (_local10.y - _local7);
_local14 = (_local11.x - _local6);
_local15 = (_local11.y - _local7);
_local16 = ((_local12 * _local15) - (_local13 * _local14));
_local17 = (0.5 * _local16);
_local4 = (_local4 + _local17);
_local2 = (_local2 + ((_local17 * _local8) * ((_local6 + _local10.x) + _local11.x)));
_local3 = (_local3 + ((_local17 * _local8) * ((_local7 + _local10.y) + _local11.y)));
_local18 = _local6;
_local19 = _local7;
_local20 = _local12;
_local21 = _local13;
_local22 = _local14;
_local23 = _local15;
_local24 = ((_local8 * ((0.25 * (((_local20 * _local20) + (_local22 * _local20)) + (_local22 * _local22))) + ((_local18 * _local20) + (_local18 * _local22)))) + ((0.5 * _local18) * _local18));
_local25 = ((_local8 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19));
_local5 = (_local5 + (_local16 * (_local24 + _local25)));
_local9++;
};
_arg1.mass = (m_density * _local4);
_local2 = (_local2 * (1 / _local4));
_local3 = (_local3 * (1 / _local4));
_arg1.center.Set(_local2, _local3);
_arg1.I = (m_density * _local5);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local10:int;
var _local11:Number;
_local5 = _arg1.R;
_local6 = ((_arg2 * _local5.col1.x) + (_arg3 * _local5.col1.y));
_local7 = ((_arg2 * _local5.col2.x) + (_arg3 * _local5.col2.y));
_local8 = 0;
_local4 = m_coreVertices[0];
_local9 = ((_local4.x * _local6) + (_local4.y * _local7));
_local10 = 1;
while (_local10 < m_vertexCount) {
_local4 = m_coreVertices[_local10];
_local11 = ((_local4.x * _local6) + (_local4.y * _local7));
if (_local11 > _local9){
_local8 = _local10;
_local9 = _local11;
};
_local10++;
};
_local5 = _arg1.R;
_local4 = m_coreVertices[_local8];
s_supportVec.x = (_arg1.position.x + ((_local5.col1.x * _local4.x) + (_local5.col2.x * _local4.y)));
s_supportVec.y = (_arg1.position.y + ((_local5.col1.y * _local4.x) + (_local5.col2.y * _local4.y)));
return (s_supportVec);
}
public function GetVertexCount():int{
return (m_vertexCount);
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2AABB;
var _local5:b2AABB;
_local4 = s_sweptAABB1;
_local5 = s_sweptAABB2;
ComputeAABB(_local4, _arg2);
ComputeAABB(_local5, _arg3);
_arg1.lowerBound.Set(((_local4.lowerBound.x < _local5.lowerBound.x)) ? _local4.lowerBound.x : _local5.lowerBound.x, ((_local4.lowerBound.y < _local5.lowerBound.y)) ? _local4.lowerBound.y : _local5.lowerBound.y);
_arg1.upperBound.Set(((_local4.upperBound.x > _local5.upperBound.x)) ? _local4.upperBound.x : _local5.upperBound.x, ((_local4.upperBound.y > _local5.upperBound.y)) ? _local4.upperBound.y : _local5.upperBound.y);
}
public function GetVertices():Array{
return (m_vertices);
}
public function GetNormals():Array{
return (m_normals);
}
public function GetOBB():b2OBB{
return (m_obb);
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_coreVertices[0]));
}
public function Centroid(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_centroid));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:b2Vec2;
var _local3:int;
var _local4:Number;
var _local5:Number;
m_sweepRadius = 0;
_local3 = 0;
while (_local3 < m_vertexCount) {
_local2 = m_coreVertices[_local3];
_local4 = (_local2.x - _arg1.x);
_local5 = (_local2.y - _arg1.y);
_local4 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local4 > m_sweepRadius){
m_sweepRadius = _local4;
};
_local3++;
};
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local5 = s_computeMat;
_local3 = _arg2.R;
_local4 = m_obb.R.col1;
_local5.col1.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col1.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local4 = m_obb.R.col2;
_local5.col2.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col2.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local5.Abs();
_local6 = _local5;
_local4 = m_obb.extents;
_local7 = ((_local6.col1.x * _local4.x) + (_local6.col2.x * _local4.y));
_local8 = ((_local6.col1.y * _local4.x) + (_local6.col2.y * _local4.y));
_local3 = _arg2.R;
_local4 = m_obb.center;
_local9 = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)));
_local10 = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)));
_arg1.lowerBound.Set((_local9 - _local7), (_local10 - _local8));
_arg1.upperBound.Set((_local9 + _local7), (_local10 + _local8));
}
public static function ComputeCentroid(_arg1:Array, _arg2:int):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local3 = new b2Vec2();
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = (1 / 3);
_local8 = 0;
while (_local8 < _arg2) {
_local9 = _arg1[_local8];
_local10 = (((_local8 + 1) < _arg2)) ? _arg1[int((_local8 + 1))] : _arg1[0];
_local11 = (_local9.x - _local5);
_local12 = (_local9.y - _local6);
_local13 = (_local10.x - _local5);
_local14 = (_local10.y - _local6);
_local15 = ((_local11 * _local14) - (_local12 * _local13));
_local16 = (0.5 * _local15);
_local4 = (_local4 + _local16);
_local3.x = (_local3.x + ((_local16 * _local7) * ((_local5 + _local9.x) + _local10.x)));
_local3.y = (_local3.y + ((_local16 * _local7) * ((_local6 + _local9.y) + _local10.y)));
_local8++;
};
_local3.x = (_local3.x * (1 / _local4));
_local3.y = (_local3.y * (1 / _local4));
return (_local3);
}
public static function ComputeOBB(_arg1:b2OBB, _arg2:Array, _arg3:int):void{
var _local4:int;
var _local5:Array;
var _local6:Number;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:b2Mat22;
_local5 = new Array((b2Settings.b2_maxPolygonVertices + 1));
_local4 = 0;
while (_local4 < _arg3) {
_local5[_local4] = _arg2[_local4];
_local4++;
};
_local5[_arg3] = _local5[0];
_local6 = Number.MAX_VALUE;
_local4 = 1;
while (_local4 <= _arg3) {
_local7 = _local5[int((_local4 - 1))];
_local8 = (_local5[_local4].x - _local7.x);
_local9 = (_local5[_local4].y - _local7.y);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
_local11 = -(_local9);
_local12 = _local8;
_local13 = Number.MAX_VALUE;
_local14 = Number.MAX_VALUE;
_local15 = -(Number.MAX_VALUE);
_local16 = -(Number.MAX_VALUE);
_local17 = 0;
while (_local17 < _arg3) {
_local19 = (_local5[_local17].x - _local7.x);
_local20 = (_local5[_local17].y - _local7.y);
_local21 = ((_local8 * _local19) + (_local9 * _local20));
_local22 = ((_local11 * _local19) + (_local12 * _local20));
if (_local21 < _local13){
_local13 = _local21;
};
if (_local22 < _local14){
_local14 = _local22;
};
if (_local21 > _local15){
_local15 = _local21;
};
if (_local22 > _local16){
_local16 = _local22;
};
_local17++;
};
_local18 = ((_local15 - _local13) * (_local16 - _local14));
if (_local18 < (0.95 * _local6)){
_local6 = _local18;
_arg1.R.col1.x = _local8;
_arg1.R.col1.y = _local9;
_arg1.R.col2.x = _local11;
_arg1.R.col2.y = _local12;
_local23 = (0.5 * (_local13 + _local15));
_local24 = (0.5 * (_local14 + _local16));
_local25 = _arg1.R;
_arg1.center.x = (_local7.x + ((_local25.col1.x * _local23) + (_local25.col2.x * _local24)));
_arg1.center.y = (_local7.y + ((_local25.col1.y * _local23) + (_local25.col2.y * _local24)));
_arg1.extents.x = (0.5 * (_local15 - _local13));
_arg1.extents.y = (0.5 * (_local16 - _local14));
};
_local4++;
};
}
}
}//package Box2D.Collision.Shapes
Section 7
//b2Shape (Box2D.Collision.Shapes.b2Shape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class b2Shape {
public var m_type:int;
public var m_sweepRadius:Number;
public var m_density:Number;
public var m_filter:b2FilterData;
public var m_friction:Number;
public var m_next:b2Shape;
public var m_restitution:Number;
public var m_userData;
public var m_isSensor:Boolean;
public var m_proxyId:uint;
public var m_body:b2Body;
public static const e_polygonShape:int = 1;
public static const e_hitCollide:int = 1;
public static const e_missCollide:int = 0;
public static const e_unknownShape:int = -1;
public static const e_circleShape:int = 0;
public static const e_shapeTypeCount:int = 2;
public static const e_startsInsideCollide:int = -1;
private static var s_resetAABB:b2AABB = new b2AABB();
private static var s_syncAABB:b2AABB = new b2AABB();
private static var s_proxyAABB:b2AABB = new b2AABB();
public function b2Shape(_arg1:b2ShapeDef){
m_userData = _arg1.userData;
m_friction = _arg1.friction;
m_restitution = _arg1.restitution;
m_density = _arg1.density;
m_body = null;
m_sweepRadius = 0;
m_next = null;
m_proxyId = b2Pair.b2_nullProxy;
m_filter = _arg1.filter.Copy();
m_isSensor = _arg1.isSensor;
}
public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
return (false);
}
public function GetSweepRadius():Number{
return (m_sweepRadius);
}
public function GetNext():b2Shape{
return (m_next);
}
public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
}
public function GetType():int{
return (m_type);
}
public function GetRestitution():Number{
return (m_restitution);
}
public function GetFriction():Number{
return (m_friction);
}
public function GetFilterData():b2FilterData{
return (m_filter.Copy());
}
public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):int{
return (e_missCollide);
}
public function RefilterProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB;
var _local4:Boolean;
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_arg1.DestroyProxy(m_proxyId);
_local3 = s_resetAABB;
ComputeAABB(_local3, _arg2);
_local4 = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetFilterData(_arg1:b2FilterData):void{
m_filter = _arg1.Copy();
}
public function GetUserData(){
return (m_userData);
}
public function Synchronize(_arg1:b2BroadPhase, _arg2:b2XForm, _arg3:b2XForm):Boolean{
var _local4:b2AABB;
if (m_proxyId == b2Pair.b2_nullProxy){
return (false);
};
_local4 = s_syncAABB;
ComputeSweptAABB(_local4, _arg2, _arg3);
if (_arg1.InRange(_local4)){
_arg1.MoveProxy(m_proxyId, _local4);
return (true);
};
return (false);
}
public function ComputeMass(_arg1:b2MassData):void{
}
public function IsSensor():Boolean{
return (m_isSensor);
}
public function DestroyProxy(_arg1:b2BroadPhase):void{
if (m_proxyId != b2Pair.b2_nullProxy){
_arg1.DestroyProxy(m_proxyId);
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function UpdateSweepRadius(_arg1:b2Vec2):void{
}
public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
}
public function GetBody():b2Body{
return (m_body);
}
public function CreateProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB;
var _local4:Boolean;
_local3 = s_proxyAABB;
ComputeAABB(_local3, _arg2);
_local4 = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public static function Destroy(_arg1:b2Shape, _arg2):void{
}
public static function Create(_arg1:b2ShapeDef, _arg2):b2Shape{
switch (_arg1.type){
case e_circleShape:
return (new b2CircleShape(_arg1));
case e_polygonShape:
return (new b2PolygonShape(_arg1));
default:
return (null);
};
}
}
}//package Box2D.Collision.Shapes
Section 8
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef)
package Box2D.Collision.Shapes {
public class b2ShapeDef {
public var isSensor:Boolean;// = false
public var density:Number;// = 0
public var type:int;// = -1
public var restitution:Number;// = 0
public var userData;// = null
public var filter:b2FilterData;
public var friction:Number;// = 0.2
public function b2ShapeDef(){
type = b2Shape.e_unknownShape;
userData = null;
friction = 0.2;
restitution = 0;
density = 0;
isSensor = false;
filter = new b2FilterData();
super();
}
}
}//package Box2D.Collision.Shapes
Section 9
//b2AABB (Box2D.Collision.b2AABB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2AABB {
public var upperBound:b2Vec2;
public var lowerBound:b2Vec2;
public function b2AABB(){
lowerBound = new b2Vec2();
upperBound = new b2Vec2();
super();
}
public function IsValid():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Boolean;
_local1 = (upperBound.x - lowerBound.x);
_local2 = (upperBound.y - lowerBound.y);
_local3 = (((_local1 >= 0)) && ((_local2 >= 0)));
_local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid()));
return (_local3);
}
}
}//package Box2D.Collision
Section 10
//b2Bound (Box2D.Collision.b2Bound)
package Box2D.Collision {
public class b2Bound {
public var proxyId:uint;
public var stabbingCount:uint;
public var value:uint;
public function Swap(_arg1:b2Bound):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
_local2 = value;
_local3 = proxyId;
_local4 = stabbingCount;
value = _arg1.value;
proxyId = _arg1.proxyId;
stabbingCount = _arg1.stabbingCount;
_arg1.value = _local2;
_arg1.proxyId = _local3;
_arg1.stabbingCount = _local4;
}
public function IsLower():Boolean{
return (((value & 1) == 0));
}
public function IsUpper():Boolean{
return (((value & 1) == 1));
}
}
}//package Box2D.Collision
Section 11
//b2BoundValues (Box2D.Collision.b2BoundValues)
package Box2D.Collision {
public class b2BoundValues {
public var lowerValues:Array;
public var upperValues:Array;
public function b2BoundValues(){
lowerValues = [0, 0];
upperValues = [0, 0];
super();
}
}
}//package Box2D.Collision
Section 12
//b2BroadPhase (Box2D.Collision.b2BroadPhase)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2BroadPhase {
public var m_worldAABB:b2AABB;
public var m_bounds:Array;
public var m_freeProxy:uint;
public var m_quantizationFactor:b2Vec2;
public var m_proxyCount:int;
public var m_proxyPool:Array;
public var m_querySortKeys:Array;
public var m_pairManager:b2PairManager;
public var m_queryResultCount:int;
public var m_timeStamp:uint;
public var m_queryResults:Array;
public static const b2_nullEdge:uint = b2Settings.USHRT_MAX;
public static const b2_invalid:uint = b2Settings.USHRT_MAX;
public static var s_validate:Boolean = false;
public function b2BroadPhase(_arg1:b2AABB, _arg2:b2PairCallback){
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:b2Proxy;
var _local7:int;
m_pairManager = new b2PairManager();
m_proxyPool = new Array(b2Settings.b2_maxPairs);
m_bounds = new Array((2 * b2Settings.b2_maxProxies));
m_querySortKeys = new Array(b2Settings.b2_maxProxies);
m_queryResults = new Array(b2Settings.b2_maxProxies);
m_quantizationFactor = new b2Vec2();
super();
m_pairManager.Initialize(this, _arg2);
m_worldAABB = _arg1;
m_proxyCount = 0;
_local3 = 0;
while (_local3 < b2Settings.b2_maxProxies) {
m_queryResults[_local3] = 0;
m_querySortKeys[_local3] = 0;
_local3++;
};
m_bounds = new Array(2);
_local3 = 0;
while (_local3 < 2) {
m_bounds[_local3] = new Array((2 * b2Settings.b2_maxProxies));
_local7 = 0;
while (_local7 < (2 * b2Settings.b2_maxProxies)) {
m_bounds[_local3][_local7] = new b2Bound();
_local7++;
};
_local3++;
};
_local4 = (_arg1.upperBound.x - _arg1.lowerBound.x);
_local5 = (_arg1.upperBound.y - _arg1.lowerBound.y);
m_quantizationFactor.x = (b2Settings.USHRT_MAX / _local4);
m_quantizationFactor.y = (b2Settings.USHRT_MAX / _local5);
_local3 = 0;
while (_local3 < (b2Settings.b2_maxProxies - 1)) {
_local6 = new b2Proxy();
m_proxyPool[_local3] = _local6;
_local6.SetNext((_local3 + 1));
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
_local3++;
};
_local6 = new b2Proxy();
m_proxyPool[int((b2Settings.b2_maxProxies - 1))] = _local6;
_local6.SetNext(b2Pair.b2_nullProxy);
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
m_freeProxy = 0;
m_timeStamp = 1;
m_queryResultCount = 0;
}
public function QueryAABB(_arg1:b2AABB, _arg2, _arg3:int):int{
var _local4:Array;
var _local5:Array;
var _local6:uint;
var _local7:uint;
var _local8:Array;
var _local9:Array;
var _local10:int;
var _local11:int;
var _local12:b2Proxy;
_local4 = new Array();
_local5 = new Array();
ComputeBounds(_local4, _local5, _arg1);
_local8 = [_local6];
_local9 = [_local7];
Query(_local8, _local9, _local4[0], _local5[0], m_bounds[0], (2 * m_proxyCount), 0);
Query(_local8, _local9, _local4[1], _local5[1], m_bounds[1], (2 * m_proxyCount), 1);
_local10 = 0;
_local11 = 0;
while ((((_local11 < m_queryResultCount)) && ((_local10 < _arg3)))) {
_local12 = m_proxyPool[m_queryResults[_local11]];
_arg2[_local11] = _local12.userData;
_local11++;
_local10++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local10);
}
public function Commit():void{
m_pairManager.Commit();
}
public function GetProxy(_arg1:int):b2Proxy{
var _local2:b2Proxy;
_local2 = m_proxyPool[_arg1];
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((_local2.IsValid() == false)))){
return (null);
};
return (_local2);
}
private function IncrementTimeStamp():void{
var _local1:uint;
if (m_timeStamp == b2Settings.USHRT_MAX){
_local1 = 0;
while (_local1 < b2Settings.b2_maxProxies) {
(m_proxyPool[_local1] as b2Proxy).timeStamp = 0;
_local1++;
};
m_timeStamp = 1;
} else {
m_timeStamp++;
};
}
private function Query(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:uint, _arg7:int):void{
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
var _local11:uint;
var _local12:int;
var _local13:int;
var _local14:b2Proxy;
_local8 = BinarySearch(_arg5, _arg6, _arg3);
_local9 = BinarySearch(_arg5, _arg6, _arg4);
_local11 = _local8;
while (_local11 < _local9) {
_local10 = _arg5[_local11];
if (_local10.IsLower()){
IncrementOverlapCount(_local10.proxyId);
};
_local11++;
};
if (_local8 > 0){
_local12 = (_local8 - 1);
_local10 = _arg5[_local12];
_local13 = _local10.stabbingCount;
while (_local13) {
_local10 = _arg5[_local12];
if (_local10.IsLower()){
_local14 = m_proxyPool[_local10.proxyId];
if (_local8 <= _local14.upperBounds[_arg7]){
IncrementOverlapCount(_local10.proxyId);
_local13--;
};
};
_local12--;
};
};
_arg1[0] = _local8;
_arg2[0] = _local9;
}
private function AddProxyResult(_arg1:uint, _arg2:b2Proxy, _arg3:Number, _arg4:Function):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:uint;
var _local9:Number;
var _local10:uint;
_local5 = _arg4(_arg2.userData);
if (_local5 < 0){
return;
};
_local6 = 0;
while ((((_local6 < m_queryResultCount)) && ((m_querySortKeys[_local6] < _local5)))) {
_local6++;
};
_local7 = _local5;
_local8 = _arg1;
m_queryResultCount = (m_queryResultCount + 1);
if (m_queryResultCount > _arg3){
m_queryResultCount = _arg3;
};
while (_local6 < m_queryResultCount) {
_local9 = m_querySortKeys[_local6];
_local10 = m_queryResults[_local6];
m_querySortKeys[_local6] = _local7;
m_queryResults[_local6] = _local8;
_local7 = _local9;
_local8 = _local10;
_local6++;
};
}
public function QuerySegment(_arg1:b2Segment, _arg2, _arg3:int, _arg4:Function):int{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:int;
var _local10:Number;
var _local11:Number;
var _local12:Array;
var _local13:Array;
var _local14:Array;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:b2Proxy;
var _local19:uint;
var _local20:uint;
var _local21:Array;
var _local22:Array;
var _local23:Boolean;
var _local24:Number;
var _local25:Number;
var _local26:int;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:uint;
_local5 = 1;
_local6 = ((_arg1.p2.x - _arg1.p1.x) * m_quantizationFactor.x);
_local7 = ((_arg1.p2.y - _arg1.p1.y) * m_quantizationFactor.y);
_local8 = ((_local6 < -(Number.MIN_VALUE))) ? -1 : ((_local6 > Number.MIN_VALUE)) ? 1 : 0;
_local9 = ((_local7 < -(Number.MIN_VALUE))) ? -1 : ((_local7 > Number.MIN_VALUE)) ? 1 : 0;
_local10 = (m_quantizationFactor.x * (_arg1.p1.x - m_worldAABB.lowerBound.x));
_local11 = (m_quantizationFactor.y * (_arg1.p1.y - m_worldAABB.lowerBound.y));
_local12 = new Array();
_local13 = new Array();
_local12[0] = (uint(_local10) & (b2Settings.USHRT_MAX - 1));
_local12[1] = (uint(_local11) & (b2Settings.USHRT_MAX - 1));
_local13[0] = (_local12[0] + 1);
_local13[1] = (_local12[1] + 1);
_local14 = new Array();
_local21 = [_local19];
_local22 = [_local20];
Query(_local21, _local22, _local12[0], _local13[0], m_bounds[0], (2 * m_proxyCount), 0);
if (_local8 >= 0){
_local15 = (_local22[0] - 1);
} else {
_local15 = _local21[0];
};
Query(_local21, _local22, _local12[1], _local13[1], m_bounds[1], (2 * m_proxyCount), 1);
if (_local9 >= 0){
_local16 = (_local22[0] - 1);
} else {
_local16 = _local21[0];
};
if (_arg4 != null){
_local27 = 0;
while (_local27 < m_queryResultCount) {
m_querySortKeys[_local27] = _arg4(m_proxyPool[m_queryResults[_local27]].userData);
_local27++;
};
_local27 = 0;
while (_local27 < (m_queryResultCount - 1)) {
_local28 = m_querySortKeys[_local27];
_local29 = m_querySortKeys[(_local27 + 1)];
if (((_local28)<0) ? (_local29 >= 0) : (((_local28 > _local29)) && ((_local29 >= 0)))){
m_querySortKeys[(_local27 + 1)] = _local28;
m_querySortKeys[_local27] = _local29;
_local30 = m_queryResults[(_local27 + 1)];
m_queryResults[(_local27 + 1)] = m_queryResults[_local27];
m_queryResults[_local27] = _local30;
--_local27;
if (_local27 == -1){
_local27 = 1;
};
} else {
_local27++;
};
};
while ((((m_queryResultCount > 0)) && ((m_querySortKeys[(m_queryResultCount - 1)] < 0)))) {
m_queryResultCount--;
};
};
_local23 = true;
if ((((_local15 < 0)) || ((_local15 >= (m_proxyCount * 2))))){
_local23 = false;
};
if ((((_local16 < 0)) || ((_local16 >= (m_proxyCount * 2))))){
_local23 = false;
};
if (_local23){
if (_local8 != 0){
if (_local8 > 0){
_local15++;
if (_local15 == (m_proxyCount * 2)){
_local23 = false;
};
} else {
--_local15;
if (_local15 < 0){
_local23 = false;
};
};
_local24 = ((m_bounds[0][_local15].value - _local10) / _local6);
};
if (_local9 != 0){
if (_local9 > 0){
_local16++;
if (_local16 == (m_proxyCount * 2)){
_local23 = false;
};
} else {
--_local16;
if (_local16 < 0){
_local23 = false;
};
};
_local25 = ((m_bounds[1][_local16].value - _local11) / _local7);
};
};
while (_local23) {
if ((((_local9 == 0)) || (((!((_local8 == 0))) && ((_local24 < _local25)))))){
if (_local24 > _local5){
break;
};
if (((_local8 > 0)) ? m_bounds[0][_local15].IsLower() : m_bounds[0][_local15].IsUpper()){
_local17 = m_bounds[0][_local15].proxyId;
_local18 = m_proxyPool[_local17];
if (_local9 >= 0){
if ((((_local18.lowerBounds[1] <= (_local16 - 1))) && ((_local18.upperBounds[1] >= _local16)))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
} else {
if ((((_local18.lowerBounds[1] <= _local16)) && ((_local18.upperBounds[1] >= (_local16 + 1))))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
};
};
if (((((((!((_arg4 == null))) && ((m_queryResultCount == _arg3)))) && ((m_queryResultCount > 0)))) && ((_local24 > m_querySortKeys[(m_queryResultCount - 1)])))){
break;
};
if (_local8 > 0){
_local15++;
if (_local15 == (m_proxyCount * 2)){
break;
};
} else {
--_local15;
if (_local15 < 0){
break;
};
};
_local24 = ((m_bounds[0][_local15].value - _local10) / _local6);
} else {
if (_local25 > _local5){
break;
};
if (((_local9 > 0)) ? m_bounds[1][_local16].IsLower() : m_bounds[1][_local16].IsUpper()){
_local17 = m_bounds[1][_local16].proxyId;
_local18 = m_proxyPool[_local17];
if (_local8 >= 0){
if ((((_local18.lowerBounds[0] <= (_local15 - 1))) && ((_local18.upperBounds[0] >= _local15)))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
} else {
if ((((_local18.lowerBounds[0] <= _local15)) && ((_local18.upperBounds[0] >= (_local15 + 1))))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
};
};
if (((((((!((_arg4 == null))) && ((m_queryResultCount == _arg3)))) && ((m_queryResultCount > 0)))) && ((_local25 > m_querySortKeys[(m_queryResultCount - 1)])))){
break;
};
if (_local9 > 0){
_local16++;
if (_local16 == (m_proxyCount * 2)){
break;
};
} else {
--_local16;
if (_local16 < 0){
break;
};
};
_local25 = ((m_bounds[1][_local16].value - _local11) / _local7);
};
};
_local26 = 0;
_local27 = 0;
while ((((_local27 < m_queryResultCount)) && ((_local26 < _arg3)))) {
_local18 = m_proxyPool[m_queryResults[_local27]];
_arg2[_local27] = _local18.userData;
_local27++;
_local26++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local26);
}
private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local4 = _arg3.lowerBound.x;
_local5 = _arg3.lowerBound.y;
_local4 = b2Math.b2Min(_local4, m_worldAABB.upperBound.x);
_local5 = b2Math.b2Min(_local5, m_worldAABB.upperBound.y);
_local4 = b2Math.b2Max(_local4, m_worldAABB.lowerBound.x);
_local5 = b2Math.b2Max(_local5, m_worldAABB.lowerBound.y);
_local6 = _arg3.upperBound.x;
_local7 = _arg3.upperBound.y;
_local6 = b2Math.b2Min(_local6, m_worldAABB.upperBound.x);
_local7 = b2Math.b2Min(_local7, m_worldAABB.upperBound.y);
_local6 = b2Math.b2Max(_local6, m_worldAABB.lowerBound.x);
_local7 = b2Math.b2Max(_local7, m_worldAABB.lowerBound.y);
_arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.lowerBound.x))) & (b2Settings.USHRT_MAX - 1));
_arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.lowerBound.x))) & 0xFFFF) | 1);
_arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.lowerBound.y))) & (b2Settings.USHRT_MAX - 1));
_arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.lowerBound.y))) & 0xFFFF) | 1);
}
public function CreateProxy(_arg1:b2AABB, _arg2):uint{
var _local3:uint;
var _local4:b2Proxy;
var _local5:uint;
var _local6:uint;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:int;
var _local11:Array;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:b2Bound;
var _local20:b2Bound;
var _local21:b2Bound;
var _local22:int;
var _local23:b2Proxy;
_local5 = m_freeProxy;
_local4 = m_proxyPool[_local5];
m_freeProxy = _local4.GetNext();
_local4.overlapCount = 0;
_local4.userData = _arg2;
_local6 = (2 * m_proxyCount);
_local7 = new Array();
_local8 = new Array();
ComputeBounds(_local7, _local8, _arg1);
_local9 = 0;
while (_local9 < 2) {
_local11 = m_bounds[_local9];
_local14 = [_local12];
_local15 = [_local13];
Query(_local14, _local15, _local7[_local9], _local8[_local9], _local11, _local6, _local9);
_local12 = _local14[0];
_local13 = _local15[0];
_local16 = new Array();
_local18 = (_local6 - _local13);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local13 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local13 + 2);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local16 = new Array();
_local18 = (_local13 - _local12);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local12 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local12 + 1);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local13++;
_local19 = _local11[_local12];
_local20 = _local11[_local13];
_local19.value = _local7[_local9];
_local19.proxyId = _local5;
_local20.value = _local8[_local9];
_local20.proxyId = _local5;
_local21 = _local11[int((_local12 - 1))];
_local19.stabbingCount = ((_local12 == 0)) ? 0 : _local21.stabbingCount;
_local21 = _local11[int((_local13 - 1))];
_local20.stabbingCount = _local21.stabbingCount;
_local3 = _local12;
while (_local3 < _local13) {
_local21 = _local11[_local3];
_local21.stabbingCount++;
_local3++;
};
_local3 = _local12;
while (_local3 < (_local6 + 2)) {
_local19 = _local11[_local3];
_local23 = m_proxyPool[_local19.proxyId];
if (_local19.IsLower()){
_local23.lowerBounds[_local9] = _local3;
} else {
_local23.upperBounds[_local9] = _local3;
};
_local3++;
};
_local9++;
};
m_proxyCount++;
_local10 = 0;
while (_local10 < m_queryResultCount) {
m_pairManager.AddBufferedPair(_local5, m_queryResults[_local10]);
_local10++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local5);
}
public function DestroyProxy(_arg1:uint):void{
var _local2:b2Bound;
var _local3:b2Bound;
var _local4:b2Proxy;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Array;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:int;
var _local19:b2Proxy;
_local4 = m_proxyPool[_arg1];
_local5 = (2 * m_proxyCount);
_local6 = 0;
while (_local6 < 2) {
_local8 = m_bounds[_local6];
_local9 = _local4.lowerBounds[_local6];
_local10 = _local4.upperBounds[_local6];
_local2 = _local8[_local9];
_local11 = _local2.value;
_local3 = _local8[_local10];
_local12 = _local3.value;
_local13 = new Array();
_local15 = ((_local10 - _local9) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local9 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = _local9;
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local13 = new Array();
_local15 = ((_local5 - _local10) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local10 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = (_local10 - 1);
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = (_local5 - 2);
_local17 = _local9;
while (_local17 < _local15) {
_local2 = _local8[_local17];
_local19 = m_proxyPool[_local2.proxyId];
if (_local2.IsLower()){
_local19.lowerBounds[_local6] = _local17;
} else {
_local19.upperBounds[_local6] = _local17;
};
_local17++;
};
_local15 = (_local10 - 1);
_local18 = _local9;
while (_local18 < _local15) {
_local2 = _local8[_local18];
_local2.stabbingCount--;
_local18++;
};
Query([0], [0], _local11, _local12, _local8, (_local5 - 2), _local6);
_local6++;
};
_local7 = 0;
while (_local7 < m_queryResultCount) {
m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local7]);
_local7++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
_local4.userData = null;
_local4.overlapCount = b2_invalid;
_local4.lowerBounds[0] = b2_invalid;
_local4.lowerBounds[1] = b2_invalid;
_local4.upperBounds[0] = b2_invalid;
_local4.upperBounds[1] = b2_invalid;
_local4.SetNext(m_freeProxy);
m_freeProxy = _arg1;
m_proxyCount--;
}
public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
var _local5:b2Bound;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg2.upperBounds[_local3]];
if (_arg1.lowerValues[_local3] > _local5.value){
return (false);
};
_local5 = _local4[_arg2.lowerBounds[_local3]];
if (_arg1.upperValues[_local3] < _local5.value){
return (false);
};
_local3++;
};
return (true);
}
public function Validate():void{
var _local1:b2Pair;
var _local2:b2Proxy;
var _local3:b2Proxy;
var _local4:Boolean;
var _local5:int;
var _local6:b2Bound;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
_local5 = 0;
while (_local5 < 2) {
_local6 = m_bounds[_local5];
_local7 = (2 * m_proxyCount);
_local8 = 0;
_local9 = 0;
while (_local9 < _local7) {
_local10 = _local6[_local9];
if (_local10.IsLower() == true){
_local8++;
} else {
_local8--;
};
_local9++;
};
_local5++;
};
}
private function IncrementOverlapCount(_arg1:uint):void{
var _local2:b2Proxy;
_local2 = m_proxyPool[_arg1];
if (_local2.timeStamp < m_timeStamp){
_local2.timeStamp = m_timeStamp;
_local2.overlapCount = 1;
} else {
_local2.overlapCount = 2;
m_queryResults[m_queryResultCount] = _arg1;
m_queryResultCount++;
};
}
public function InRange(_arg1:b2AABB):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.lowerBound.x;
_local3 = _arg1.lowerBound.y;
_local2 = (_local2 - m_worldAABB.upperBound.x);
_local3 = (_local3 - m_worldAABB.upperBound.y);
_local4 = m_worldAABB.lowerBound.x;
_local5 = m_worldAABB.lowerBound.y;
_local4 = (_local4 - _arg1.upperBound.x);
_local5 = (_local5 - _arg1.upperBound.y);
_local2 = b2Math.b2Max(_local2, _local4);
_local3 = b2Math.b2Max(_local3, _local5);
return ((b2Math.b2Max(_local2, _local3) < 0));
}
private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
var _local5:b2Bound;
var _local6:b2Bound;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg1.lowerBounds[_local3]];
_local6 = _local4[_arg2.upperBounds[_local3]];
if (_local5.value > _local6.value){
return (false);
};
_local5 = _local4[_arg1.upperBounds[_local3]];
_local6 = _local4[_arg2.lowerBounds[_local3]];
if (_local5.value < _local6.value){
return (false);
};
_local3++;
};
return (true);
}
public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{
var _local3:Array;
var _local4:int;
var _local5:uint;
var _local6:uint;
var _local7:b2Bound;
var _local8:b2Bound;
var _local9:b2Bound;
var _local10:uint;
var _local11:b2Proxy;
var _local12:uint;
var _local13:b2Proxy;
var _local14:b2BoundValues;
var _local15:b2BoundValues;
var _local16:Array;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:uint;
var _local21:int;
var _local22:int;
var _local23:uint;
var _local24:b2Proxy;
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){
return;
};
if (_arg2.IsValid() == false){
return;
};
_local12 = (2 * m_proxyCount);
_local13 = m_proxyPool[_arg1];
_local14 = new b2BoundValues();
ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2);
_local15 = new b2BoundValues();
_local5 = 0;
while (_local5 < 2) {
_local7 = m_bounds[_local5][_local13.lowerBounds[_local5]];
_local15.lowerValues[_local5] = _local7.value;
_local7 = m_bounds[_local5][_local13.upperBounds[_local5]];
_local15.upperValues[_local5] = _local7.value;
_local5++;
};
_local5 = 0;
while (_local5 < 2) {
_local16 = m_bounds[_local5];
_local17 = _local13.lowerBounds[_local5];
_local18 = _local13.upperBounds[_local5];
_local19 = _local14.lowerValues[_local5];
_local20 = _local14.upperValues[_local5];
_local7 = _local16[_local17];
_local21 = (_local19 - _local7.value);
_local7.value = _local19;
_local7 = _local16[_local18];
_local22 = (_local20 - _local7.value);
_local7.value = _local20;
if (_local21 < 0){
_local6 = _local17;
while ((((_local6 > 0)) && ((_local19 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local8.proxyId];
_local8.stabbingCount++;
if (_local8.IsUpper() == true){
if (TestOverlap(_local14, _local24)){
m_pairManager.AddBufferedPair(_arg1, _local23);
};
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
if (_local22 > 0){
_local6 = _local18;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local20)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount++;
if (_local9.IsLower() == true){
if (TestOverlap(_local14, _local11)){
m_pairManager.AddBufferedPair(_arg1, _local10);
};
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local21 > 0){
_local6 = _local17;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local19)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount--;
if (_local9.IsUpper()){
if (TestOverlap(_local15, _local11)){
m_pairManager.RemoveBufferedPair(_arg1, _local10);
};
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local22 < 0){
_local6 = _local18;
while ((((_local6 > 0)) && ((_local20 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local23];
_local8.stabbingCount--;
if (_local8.IsLower() == true){
if (TestOverlap(_local15, _local24)){
m_pairManager.RemoveBufferedPair(_arg1, _local23);
};
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
_local5++;
};
}
public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:b2Bound;
_local4 = 0;
_local5 = (_arg2 - 1);
while (_local4 <= _local5) {
_local6 = ((_local4 + _local5) / 2);
_local7 = _arg1[_local6];
if (_local7.value > _arg3){
_local5 = (_local6 - 1);
} else {
if (_local7.value < _arg3){
_local4 = (_local6 + 1);
} else {
return (uint(_local6));
};
};
};
return (uint(_local4));
}
}
}//package Box2D.Collision
Section 13
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
}
}//package Box2D.Collision
Section 14
//b2Collision (Box2D.Collision.b2Collision)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Collision {
public static const b2_nullFeature:uint = 0xFF;
private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2();
public static function EdgeSeparation(_arg1:b2PolygonShape, _arg2:b2XForm, _arg3:int, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:b2Mat22;
var _local12:b2Vec2;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local6 = _arg1.m_vertexCount;
_local7 = _arg1.m_vertices;
_local8 = _arg1.m_normals;
_local9 = _arg4.m_vertexCount;
_local10 = _arg4.m_vertices;
_local11 = _arg2.R;
_local12 = _local8[_arg3];
_local13 = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y));
_local14 = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y));
_local11 = _arg5.R;
_local15 = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14));
_local16 = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14));
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local12 = _local10[_local19];
_local25 = ((_local12.x * _local15) + (_local12.y * _local16));
if (_local25 < _local18){
_local18 = _local25;
_local17 = _local19;
};
_local19++;
};
_local12 = _local7[_arg3];
_local11 = _arg2.R;
_local20 = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local21 = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local12 = _local10[_local17];
_local11 = _arg5.R;
_local22 = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local23 = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local22 = (_local22 - _local20);
_local23 = (_local23 - _local21);
_local24 = ((_local22 * _local13) + (_local23 * _local14));
return (_local24);
}
public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = _arg2.lowerBound;
_local4 = _arg1.upperBound;
_local5 = (_local3.x - _local4.x);
_local6 = (_local3.y - _local4.y);
_local3 = _arg1.lowerBound;
_local4 = _arg2.upperBound;
_local7 = (_local3.x - _local4.x);
_local8 = (_local3.y - _local4.y);
if ((((_local5 > 0)) || ((_local6 > 0)))){
return (false);
};
if ((((_local7 > 0)) || ((_local8 > 0)))){
return (false);
};
return (true);
}
public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:int, _arg5:b2PolygonShape, _arg6:b2XForm):void{
var _local7:int;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:Array;
var _local12:b2Mat22;
var _local13:b2Vec2;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:ClipVertex;
var _local21:int;
var _local22:int;
var _local23:Number;
_local7 = _arg2.m_vertexCount;
_local8 = _arg2.m_normals;
_local9 = _arg5.m_vertexCount;
_local10 = _arg5.m_vertices;
_local11 = _arg5.m_normals;
_local12 = _arg3.R;
_local13 = _local8[_arg4];
_local14 = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y));
_local15 = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y));
_local12 = _arg6.R;
_local16 = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15));
_local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15));
_local14 = _local16;
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local13 = _local11[_local19];
_local23 = ((_local14 * _local13.x) + (_local15 * _local13.y));
if (_local23 < _local18){
_local18 = _local23;
_local17 = _local19;
};
_local19++;
};
_local21 = _local17;
_local22 = (((_local21 + 1) < _local9)) ? (_local21 + 1) : 0;
_local20 = _arg1[0];
_local13 = _local10[_local21];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local21;
_local20.id.features.incidentVertex = 0;
_local20 = _arg1[1];
_local13 = _local10[_local22];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local22;
_local20.id.features.incidentVertex = 1;
}
public static function b2CollidePolygons(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):void{
var _local6:ClipVertex;
var _local7:int;
var _local8:Array;
var _local9:Number;
var _local10:int;
var _local11:Array;
var _local12:Number;
var _local13:b2PolygonShape;
var _local14:b2PolygonShape;
var _local15:b2XForm;
var _local16:b2XForm;
var _local17:int;
var _local18:uint;
var _local19:Number;
var _local20:Number;
var _local21:Array;
var _local22:int;
var _local23:Array;
var _local24:b2Vec2;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:b2Vec2;
var _local28:b2Vec2;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Array;
var _local33:Array;
var _local34:int;
var _local35:int;
var _local36:int;
var _local37:b2Vec2;
var _local38:Number;
var _local39:b2ManifoldPoint;
_arg1.pointCount = 0;
_local7 = 0;
_local8 = [_local7];
_local9 = FindMaxSeparation(_local8, _arg2, _arg3, _arg4, _arg5);
_local7 = _local8[0];
if (_local9 > 0){
return;
};
_local10 = 0;
_local11 = [_local10];
_local12 = FindMaxSeparation(_local11, _arg4, _arg5, _arg2, _arg3);
_local10 = _local11[0];
if (_local12 > 0){
return;
};
_local15 = new b2XForm();
_local16 = new b2XForm();
_local19 = 0.98;
_local20 = 0.001;
if (_local12 > ((_local19 * _local9) + _local20)){
_local13 = _arg4;
_local14 = _arg2;
_local15.Set(_arg5);
_local16.Set(_arg3);
_local17 = _local10;
_local18 = 1;
} else {
_local13 = _arg2;
_local14 = _arg4;
_local15.Set(_arg3);
_local16.Set(_arg5);
_local17 = _local7;
_local18 = 0;
};
_local21 = [new ClipVertex(), new ClipVertex()];
FindIncidentEdge(_local21, _local13, _local15, _local17, _local14, _local16);
_local22 = _local13.m_vertexCount;
_local23 = _local13.m_vertices;
_local24 = _local23[_local17];
_local25 = _local24.Copy();
if ((_local17 + 1) < _local22){
_local24 = _local23[int((_local17 + 1))];
_local37 = _local24.Copy();
} else {
_local24 = _local23[0];
_local37 = _local24.Copy();
};
_local26 = b2Math.SubtractVV(_local37, _local25);
_local27 = b2Math.b2MulMV(_local15.R, b2Math.SubtractVV(_local37, _local25));
_local27.Normalize();
_local28 = b2Math.b2CrossVF(_local27, 1);
_local25 = b2Math.b2MulX(_local15, _local25);
_local37 = b2Math.b2MulX(_local15, _local37);
_local29 = b2Math.b2Dot(_local28, _local25);
_local30 = -(b2Math.b2Dot(_local27, _local25));
_local31 = b2Math.b2Dot(_local27, _local37);
_local32 = [new ClipVertex(), new ClipVertex()];
_local33 = [new ClipVertex(), new ClipVertex()];
_local34 = ClipSegmentToLine(_local32, _local21, _local27.Negative(), _local30);
if (_local34 < 2){
return;
};
_local34 = ClipSegmentToLine(_local33, _local32, _local27, _local31);
if (_local34 < 2){
return;
};
_arg1.normal = (_local18) ? _local28.Negative() : _local28.Copy();
_local35 = 0;
_local36 = 0;
while (_local36 < b2Settings.b2_maxManifoldPoints) {
_local6 = _local33[_local36];
_local38 = (b2Math.b2Dot(_local28, _local6.v) - _local29);
if (_local38 <= 0){
_local39 = _arg1.points[_local35];
_local39.separation = _local38;
_local39.localPoint1 = b2Math.b2MulXT(_arg3, _local6.v);
_local39.localPoint2 = b2Math.b2MulXT(_arg5, _local6.v);
_local39.id.key = _local6.id._key;
_local39.id.features.flip = _local18;
_local35++;
};
_local36++;
};
_arg1.pointCount = _local35;
}
public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:b2Vec2;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:Number;
var _local16:int;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:int;
var _local21:Number;
var _local22:int;
var _local23:Number;
var _local24:int;
var _local25:Number;
_local6 = _arg2.m_vertexCount;
_local7 = _arg2.m_normals;
_local9 = _arg5.R;
_local8 = _arg4.m_centroid;
_local10 = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)));
_local11 = (_arg5.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y)));
_local9 = _arg3.R;
_local8 = _arg2.m_centroid;
_local10 = (_local10 - (_arg3.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y))));
_local11 = (_local11 - (_arg3.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y))));
_local12 = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y));
_local13 = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y));
_local14 = 0;
_local15 = -(Number.MAX_VALUE);
_local16 = 0;
while (_local16 < _local6) {
_local8 = _local7[_local16];
_local25 = ((_local8.x * _local12) + (_local8.y * _local13));
if (_local25 > _local15){
_local15 = _local25;
_local14 = _local16;
};
_local16++;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
_local18 = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1);
_local19 = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5);
if (_local19 > 0){
return (_local19);
};
_local20 = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0;
_local21 = EdgeSeparation(_arg2, _arg3, _local20, _arg4, _arg5);
if (_local21 > 0){
return (_local21);
};
if ((((_local19 > _local17)) && ((_local19 > _local21)))){
_local24 = -1;
_local22 = _local18;
_local23 = _local19;
} else {
if (_local21 > _local17){
_local24 = 1;
_local22 = _local20;
_local23 = _local21;
} else {
_arg1[0] = _local14;
return (_local17);
};
};
while (true) {
if (_local24 == -1){
_local14 = (((_local22 - 1) >= 0)) ? (_local22 - 1) : (_local6 - 1);
} else {
_local14 = (((_local22 + 1) < _local6)) ? (_local22 + 1) : 0;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
if (_local17 > _local23){
_local22 = _local14;
_local23 = _local17;
} else {
break;
};
};
_arg1[0] = _local22;
return (_local23);
}
public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{
var _local5:ClipVertex;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:b2Vec2;
var _local13:ClipVertex;
_local6 = 0;
_local5 = _arg2[0];
_local7 = _local5.v;
_local5 = _arg2[1];
_local8 = _local5.v;
_local9 = (b2Math.b2Dot(_arg3, _local7) - _arg4);
_local10 = (b2Math.b2Dot(_arg3, _local8) - _arg4);
if (_local9 <= 0){
var _temp1 = _local6;
_local6 = (_local6 + 1);
var _local14 = _temp1;
_arg1[_local14] = _arg2[0];
};
if (_local10 <= 0){
var _temp2 = _local6;
_local6 = (_local6 + 1);
_local14 = _temp2;
_arg1[_local14] = _arg2[1];
};
if ((_local9 * _local10) < 0){
_local11 = (_local9 / (_local9 - _local10));
_local5 = _arg1[_local6];
_local12 = _local5.v;
_local12.x = (_local7.x + (_local11 * (_local8.x - _local7.x)));
_local12.y = (_local7.y + (_local11 * (_local8.y - _local7.y)));
_local5 = _arg1[_local6];
if (_local9 > 0){
_local13 = _arg2[0];
_local5.id = _local13.id;
} else {
_local13 = _arg2[1];
_local5.id = _local13.id;
};
_local6++;
};
return (_local6);
}
public static function b2CollideCircles(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2Mat22;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:b2ManifoldPoint;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_arg1.pointCount = 0;
_local6 = _arg3.R;
_local7 = _arg2.m_localPosition;
_local8 = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local9 = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local6 = _arg5.R;
_local7 = _arg4.m_localPosition;
_local10 = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local11 = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local12 = (_local10 - _local8);
_local13 = (_local11 - _local9);
_local14 = ((_local12 * _local12) + (_local13 * _local13));
_local15 = _arg2.m_radius;
_local16 = _arg4.m_radius;
_local17 = (_local15 + _local16);
if (_local14 > (_local17 * _local17)){
return;
};
if (_local14 < Number.MIN_VALUE){
_local18 = -(_local17);
_arg1.normal.Set(0, 1);
} else {
_local24 = Math.sqrt(_local14);
_local18 = (_local24 - _local17);
_local25 = (1 / _local24);
_arg1.normal.x = (_local25 * _local12);
_arg1.normal.y = (_local25 * _local13);
};
_arg1.pointCount = 1;
_local19 = _arg1.points[0];
_local19.id.key = 0;
_local19.separation = _local18;
_local8 = (_local8 + (_local15 * _arg1.normal.x));
_local9 = (_local9 + (_local15 * _arg1.normal.y));
_local10 = (_local10 - (_local16 * _arg1.normal.x));
_local11 = (_local11 - (_local16 * _arg1.normal.y));
_local20 = (0.5 * (_local8 + _local10));
_local21 = (0.5 * (_local9 + _local11));
_local22 = (_local20 - _arg3.position.x);
_local23 = (_local21 - _arg3.position.y);
_local19.localPoint1.x = ((_local22 * _arg3.R.col1.x) + (_local23 * _arg3.R.col1.y));
_local19.localPoint1.y = ((_local22 * _arg3.R.col2.x) + (_local23 * _arg3.R.col2.y));
_local22 = (_local20 - _arg5.position.x);
_local23 = (_local21 - _arg5.position.y);
_local19.localPoint2.x = ((_local22 * _arg5.R.col1.x) + (_local23 * _arg5.R.col1.y));
_local19.localPoint2.y = ((_local22 * _arg5.R.col2.x) + (_local23 * _arg5.R.col2.y));
}
public static function b2CollidePolygonAndCircle(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2ManifoldPoint;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2Vec2;
var _local12:b2Mat22;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:Number;
var _local21:int;
var _local22:Array;
var _local23:Array;
var _local24:int;
var _local25:int;
var _local26:int;
var _local27:b2Vec2;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_arg1.pointCount = 0;
_local12 = _arg5.R;
_local11 = _arg4.m_localPosition;
_local13 = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)));
_local14 = (_arg5.position.y + ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y)));
_local7 = (_local13 - _arg3.position.x);
_local8 = (_local14 - _arg3.position.y);
_local12 = _arg3.R;
_local15 = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local16 = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local18 = 0;
_local19 = -(Number.MAX_VALUE);
_local20 = _arg4.m_radius;
_local21 = _arg2.m_vertexCount;
_local22 = _arg2.m_vertices;
_local23 = _arg2.m_normals;
_local24 = 0;
while (_local24 < _local21) {
_local11 = _local22[_local24];
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local11 = _local23[_local24];
_local34 = ((_local11.x * _local7) + (_local11.y * _local8));
if (_local34 > _local20){
return;
};
if (_local34 > _local19){
_local19 = _local34;
_local18 = _local24;
};
_local24++;
};
if (_local19 < Number.MIN_VALUE){
_arg1.pointCount = 1;
_local11 = _local23[_local18];
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y));
_arg1.normal.y = ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y));
_local6 = _arg1.points[0];
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = b2_nullFeature;
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local19 - _local20);
return;
};
_local25 = _local18;
_local26 = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0;
_local11 = _local22[_local25];
_local27 = _local22[_local26];
_local28 = (_local27.x - _local11.x);
_local29 = (_local27.y - _local11.y);
_local30 = Math.sqrt(((_local28 * _local28) + (_local29 * _local29)));
_local28 = (_local28 / _local30);
_local29 = (_local29 / _local30);
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local31 = ((_local7 * _local28) + (_local8 * _local29));
_local6 = _arg1.points[0];
if (_local31 <= 0){
_local32 = _local11.x;
_local33 = _local11.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local25;
} else {
if (_local31 >= _local30){
_local32 = _local27.x;
_local33 = _local27.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local26;
} else {
_local32 = ((_local28 * _local31) + _local11.x);
_local33 = ((_local29 * _local31) + _local11.y);
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = 0;
};
};
_local7 = (_local15 - _local32);
_local8 = (_local16 - _local33);
_local17 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local7 = (_local7 / _local17);
_local8 = (_local8 / _local17);
if (_local17 > _local20){
return;
};
_arg1.pointCount = 1;
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local7) + (_local12.col2.x * _local8));
_arg1.normal.y = ((_local12.col1.y * _local7) + (_local12.col2.y * _local8));
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local17 - _local20);
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
}
}
}//package Box2D.Collision
Section 15
//b2ContactID (Box2D.Collision.b2ContactID)
package Box2D.Collision {
public class b2ContactID {
public var _key:uint;
public var features:Features;
public function b2ContactID(){
features = new Features();
super();
features._m_id = this;
}
public function Set(_arg1:b2ContactID):void{
key = _arg1._key;
}
public function Copy():b2ContactID{
var _local1:b2ContactID;
_local1 = new b2ContactID();
_local1.key = key;
return (_local1);
}
public function get key():uint{
return (_key);
}
public function set key(_arg1:uint):void{
_key = _arg1;
features._referenceEdge = (_key & 0xFF);
features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF);
features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF);
features._flip = (((_key & 4278190080) >> 24) & 0xFF);
}
}
}//package Box2D.Collision
Section 16
//b2ContactPoint (Box2D.Collision.b2ContactPoint)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class b2ContactPoint {
public var separation:Number;
public var normal:b2Vec2;
public var position:b2Vec2;
public var restitution:Number;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var id:b2ContactID;
public var friction:Number;
public var velocity:b2Vec2;
public function b2ContactPoint(){
position = new b2Vec2();
velocity = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 17
//b2Distance (Box2D.Collision.b2Distance)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Distance {
private static var s_p2s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_points:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var gPoint:b2Point = new b2Point();
public static var g_GJK_Iterations:int = 0;
public static function InPoints(_arg1:b2Vec2, _arg2:Array, _arg3:int):Boolean{
var _local4:Number;
var _local5:int;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local4 = (100 * Number.MIN_VALUE);
_local5 = 0;
while (_local5 < _arg3) {
_local6 = _arg2[_local5];
_local7 = Math.abs((_arg1.x - _local6.x));
_local8 = Math.abs((_arg1.y - _local6.y));
_local9 = Math.max(Math.abs(_arg1.x), Math.abs(_local6.x));
_local10 = Math.max(Math.abs(_arg1.y), Math.abs(_local6.y));
if ((((_local7 < (_local4 * (_local9 + 1)))) && ((_local8 < (_local4 * (_local10 + 1)))))){
return (true);
};
_local5++;
};
return (false);
}
public static function DistanceGeneric(_arg1:b2Vec2, _arg2:b2Vec2, _arg3, _arg4:b2XForm, _arg5, _arg6:b2XForm):Number{
var _local7:b2Vec2;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:int;
var _local12:Number;
var _local13:int;
var _local14:int;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:int;
_local8 = s_p1s;
_local9 = s_p2s;
_local10 = s_points;
_local11 = 0;
_arg1.SetV(_arg3.GetFirstVertex(_arg4));
_arg2.SetV(_arg5.GetFirstVertex(_arg6));
_local12 = 0;
_local13 = 20;
_local14 = 0;
while (_local14 < _local13) {
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local17 = _arg3.Support(_arg4, _local15, _local16);
_local18 = _arg5.Support(_arg6, -(_local15), -(_local16));
_local12 = ((_local15 * _local15) + (_local16 * _local16));
_local19 = (_local18.x - _local17.x);
_local20 = (_local18.y - _local17.y);
_local21 = ((_local15 * _local19) + (_local16 * _local20));
if ((_local12 - ((_local15 * _local19) + (_local16 * _local20))) <= (0.01 * _local12)){
if (_local11 == 0){
_arg1.SetV(_local17);
_arg2.SetV(_local18);
};
g_GJK_Iterations = _local14;
return (Math.sqrt(_local12));
};
switch (_local11){
case 0:
_local7 = _local8[0];
_local7.SetV(_local17);
_local7 = _local9[0];
_local7.SetV(_local18);
_local7 = _local10[0];
_local7.x = _local19;
_local7.y = _local20;
_arg1.SetV(_local8[0]);
_arg2.SetV(_local9[0]);
_local11++;
break;
case 1:
_local7 = _local8[1];
_local7.SetV(_local17);
_local7 = _local9[1];
_local7.SetV(_local18);
_local7 = _local10[1];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessTwo(_arg1, _arg2, _local8, _local9, _local10);
break;
case 2:
_local7 = _local8[2];
_local7.SetV(_local17);
_local7 = _local9[2];
_local7.SetV(_local18);
_local7 = _local10[2];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessThree(_arg1, _arg2, _local8, _local9, _local10);
break;
};
if (_local11 == 3){
g_GJK_Iterations = _local14;
return (0);
};
_local22 = -(Number.MAX_VALUE);
_local23 = 0;
while (_local23 < _local11) {
_local7 = _local10[_local23];
_local22 = b2Math.b2Max(_local22, ((_local7.x * _local7.x) + (_local7.y * _local7.y)));
_local23++;
};
if ((((_local11 == 3)) || ((_local12 <= ((100 * Number.MIN_VALUE) * _local22))))){
g_GJK_Iterations = _local14;
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local12 = ((_local15 * _local15) + (_local16 * _local16));
return (Math.sqrt(_local12));
};
_local14++;
};
g_GJK_Iterations = _local13;
return (Math.sqrt(_local12));
}
public static function DistanceCC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2CircleShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local7 = _arg4.R;
_local8 = _arg3.m_localPosition;
_local9 = (_arg4.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local10 = (_arg4.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local7 = _arg6.R;
_local8 = _arg5.m_localPosition;
_local11 = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local12 = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = ((_local13 * _local13) + (_local14 * _local14));
_local16 = (_arg3.m_radius - b2Settings.b2_toiSlop);
_local17 = (_arg5.m_radius - b2Settings.b2_toiSlop);
_local18 = (_local16 + _local17);
if (_local15 > (_local18 * _local18)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_local20 = (_local19 - _local18);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = (_local11 - (_local17 * _local13));
_arg2.y = (_local12 - (_local17 * _local14));
return (_local20);
};
if (_local15 > (Number.MIN_VALUE * Number.MIN_VALUE)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
};
_arg1.x = _local9;
_arg1.y = _local10;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
}
public static function ProcessThree(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local14:b2Vec2;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg5[2];
_local9 = _arg3[0];
_local10 = _arg3[1];
_local11 = _arg3[2];
_local12 = _arg4[0];
_local13 = _arg4[1];
_local14 = _arg4[2];
_local15 = _local6.x;
_local16 = _local6.y;
_local17 = _local7.x;
_local18 = _local7.y;
_local19 = _local8.x;
_local20 = _local8.y;
_local21 = (_local17 - _local15);
_local22 = (_local18 - _local16);
_local23 = (_local19 - _local15);
_local24 = (_local20 - _local16);
_local25 = (_local19 - _local17);
_local26 = (_local20 - _local18);
_local27 = -(((_local15 * _local21) + (_local16 * _local22)));
_local28 = ((_local17 * _local21) + (_local18 * _local22));
_local29 = -(((_local15 * _local23) + (_local16 * _local24)));
_local30 = ((_local19 * _local23) + (_local20 * _local24));
_local31 = -(((_local17 * _local25) + (_local18 * _local26)));
_local32 = ((_local19 * _local25) + (_local20 * _local26));
if ((((_local30 <= 0)) && ((_local32 <= 0)))){
_arg1.SetV(_local11);
_arg2.SetV(_local14);
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (1);
};
_local33 = ((_local21 * _local24) - (_local22 * _local23));
_local34 = (_local33 * ((_local15 * _local18) - (_local16 * _local17)));
_local36 = (_local33 * ((_local17 * _local20) - (_local18 * _local19)));
if ((((((((_local36 <= 0)) && ((_local31 >= 0)))) && ((_local32 >= 0)))) && (((_local31 + _local32) > 0)))){
_local35 = (_local31 / (_local31 + _local32));
_arg1.x = (_local10.x + (_local35 * (_local11.x - _local10.x)));
_arg1.y = (_local10.y + (_local35 * (_local11.y - _local10.y)));
_arg2.x = (_local13.x + (_local35 * (_local14.x - _local13.x)));
_arg2.y = (_local13.y + (_local35 * (_local14.y - _local13.y)));
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (2);
};
_local37 = (_local33 * ((_local19 * _local16) - (_local20 * _local15)));
if ((((((((_local37 <= 0)) && ((_local29 >= 0)))) && ((_local30 >= 0)))) && (((_local29 + _local30) > 0)))){
_local35 = (_local29 / (_local29 + _local30));
_arg1.x = (_local9.x + (_local35 * (_local11.x - _local9.x)));
_arg1.y = (_local9.y + (_local35 * (_local11.y - _local9.y)));
_arg2.x = (_local12.x + (_local35 * (_local14.x - _local12.x)));
_arg2.y = (_local12.y + (_local35 * (_local14.y - _local12.y)));
_local10.SetV(_local11);
_local13.SetV(_local14);
_local7.SetV(_local8);
return (2);
};
_local38 = ((_local36 + _local37) + _local34);
_local38 = (1 / _local38);
_local39 = (_local36 * _local38);
_local40 = (_local37 * _local38);
_local41 = ((1 - _local39) - _local40);
_arg1.x = (((_local39 * _local9.x) + (_local40 * _local10.x)) + (_local41 * _local11.x));
_arg1.y = (((_local39 * _local9.y) + (_local40 * _local10.y)) + (_local41 * _local11.y));
_arg2.x = (((_local39 * _local12.x) + (_local40 * _local13.x)) + (_local41 * _local14.x));
_arg2.y = (((_local39 * _local12.y) + (_local40 * _local13.y)) + (_local41 * _local14.y));
return (3);
}
public static function DistancePC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2PolygonShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:b2Point;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local9 = gPoint;
_local8 = _arg5.m_localPosition;
_local7 = _arg6.R;
_local9.p.x = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local9.p.y = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local10 = DistanceGeneric(_arg1, _arg2, _arg3, _arg4, _local9, b2Math.b2XForm_identity);
_local11 = (_arg5.m_radius - b2Settings.b2_toiSlop);
if (_local10 > _local11){
_local10 = (_local10 - _local11);
_local12 = (_arg2.x - _arg1.x);
_local13 = (_arg2.y - _arg1.y);
_local14 = Math.sqrt(((_local12 * _local12) + (_local13 * _local13)));
_local12 = (_local12 / _local14);
_local13 = (_local13 / _local14);
_arg2.x = (_arg2.x - (_local11 * _local12));
_arg2.y = (_arg2.y - (_local11 * _local13));
} else {
_local10 = 0;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
};
return (_local10);
}
public static function Distance(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Shape, _arg4:b2XForm, _arg5:b2Shape, _arg6:b2XForm):Number{
var _local7:int;
var _local8:int;
_local7 = _arg3.m_type;
_local8 = _arg5.m_type;
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistanceCC(_arg1, _arg2, (_arg3 as b2CircleShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistancePC(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistancePC(_arg2, _arg1, (_arg5 as b2PolygonShape), _arg6, (_arg3 as b2CircleShape), _arg4));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistanceGeneric(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2PolygonShape), _arg6));
};
return (0);
}
public static function ProcessTwo(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg3[0];
_local9 = _arg3[1];
_local10 = _arg4[0];
_local11 = _arg4[1];
_local12 = -(_local7.x);
_local13 = -(_local7.y);
_local14 = (_local6.x - _local7.x);
_local15 = (_local6.y - _local7.y);
_local16 = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
_local14 = (_local14 / _local16);
_local15 = (_local15 / _local16);
_local17 = ((_local12 * _local14) + (_local13 * _local15));
if ((((_local17 <= 0)) || ((_local16 < Number.MIN_VALUE)))){
_arg1.SetV(_local9);
_arg2.SetV(_local11);
_local8.SetV(_local9);
_local10.SetV(_local11);
_local6.SetV(_local7);
return (1);
};
_local17 = (_local17 / _local16);
_arg1.x = (_local9.x + (_local17 * (_local8.x - _local9.x)));
_arg1.y = (_local9.y + (_local17 * (_local8.y - _local9.y)));
_arg2.x = (_local11.x + (_local17 * (_local10.x - _local11.x)));
_arg2.y = (_local11.y + (_local17 * (_local10.y - _local11.y)));
return (2);
}
}
}//package Box2D.Collision
Section 18
//b2Manifold (Box2D.Collision.b2Manifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Manifold {
public var points:Array;
public var pointCount:int;// = 0
public var normal:b2Vec2;
public function b2Manifold(){
var _local1:int;
pointCount = 0;
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ManifoldPoint();
_local1++;
};
normal = new b2Vec2();
}
public function Set(_arg1:b2Manifold):void{
var _local2:int;
pointCount = _arg1.pointCount;
_local2 = 0;
while (_local2 < b2Settings.b2_maxManifoldPoints) {
(points[_local2] as b2ManifoldPoint).Set(_arg1.points[_local2]);
_local2++;
};
normal.SetV(_arg1.normal);
}
public function Reset():void{
var _local1:int;
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
(points[_local1] as b2ManifoldPoint).Reset();
_local1++;
};
normal.SetZero();
pointCount = 0;
}
}
}//package Box2D.Collision
Section 19
//b2ManifoldPoint (Box2D.Collision.b2ManifoldPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2ManifoldPoint {
public var separation:Number;
public var localPoint2:b2Vec2;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var localPoint1:b2Vec2;
public var id:b2ContactID;
public function b2ManifoldPoint(){
localPoint1 = new b2Vec2();
localPoint2 = new b2Vec2();
id = new b2ContactID();
super();
}
public function Set(_arg1:b2ManifoldPoint):void{
localPoint1.SetV(_arg1.localPoint1);
localPoint2.SetV(_arg1.localPoint2);
separation = _arg1.separation;
normalImpulse = _arg1.normalImpulse;
tangentImpulse = _arg1.tangentImpulse;
id.key = _arg1.id.key;
}
public function Reset():void{
localPoint1.SetZero();
localPoint2.SetZero();
separation = 0;
normalImpulse = 0;
tangentImpulse = 0;
id.key = 0;
}
}
}//package Box2D.Collision
Section 20
//b2OBB (Box2D.Collision.b2OBB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2OBB {
public var R:b2Mat22;
public var center:b2Vec2;
public var extents:b2Vec2;
public function b2OBB(){
R = new b2Mat22();
center = new b2Vec2();
extents = new b2Vec2();
super();
}
}
}//package Box2D.Collision
Section 21
//b2Pair (Box2D.Collision.b2Pair)
package Box2D.Collision {
import Box2D.Common.*;
public class b2Pair {
public var userData;// = null
public var proxyId1:uint;
public var proxyId2:uint;
public var status:uint;
public var next:uint;
public static var e_pairFinal:uint = 4;
public static var b2_tableMask:int = (b2_tableCapacity - 1);
public static var e_pairRemoved:uint = 2;
public static var b2_nullPair:uint = b2Settings.USHRT_MAX;
public static var e_pairBuffered:uint = 1;
public static var b2_nullProxy:uint = b2Settings.USHRT_MAX;
public static var b2_tableCapacity:int = b2Settings.b2_maxPairs;
public function b2Pair(){
userData = null;
super();
}
public function SetBuffered():void{
status = (status | e_pairBuffered);
}
public function IsBuffered():Boolean{
return (((status & e_pairBuffered) == e_pairBuffered));
}
public function IsFinal():Boolean{
return (((status & e_pairFinal) == e_pairFinal));
}
public function ClearRemoved():void{
status = (status & ~(e_pairRemoved));
}
public function SetFinal():void{
status = (status | e_pairFinal);
}
public function IsRemoved():Boolean{
return (((status & e_pairRemoved) == e_pairRemoved));
}
public function ClearBuffered():void{
status = (status & ~(e_pairBuffered));
}
public function SetRemoved():void{
status = (status | e_pairRemoved);
}
}
}//package Box2D.Collision
Section 22
//b2PairCallback (Box2D.Collision.b2PairCallback)
package Box2D.Collision {
public class b2PairCallback {
public function PairRemoved(_arg1, _arg2, _arg3):void{
}
public function PairAdded(_arg1, _arg2){
return (null);
}
}
}//package Box2D.Collision
Section 23
//b2PairManager (Box2D.Collision.b2PairManager)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PairManager {
public var m_pairCount:int;
public var m_pairBuffer:Array;
public var m_callback:b2PairCallback;
public var m_pairs:Array;
public var m_pairBufferCount:int;
public var m_hashTable:Array;
public var m_broadPhase:b2BroadPhase;
public var m_freePair:uint;
public function b2PairManager(){
var _local1:uint;
super();
m_hashTable = new Array(b2Pair.b2_tableCapacity);
_local1 = 0;
while (_local1 < b2Pair.b2_tableCapacity) {
m_hashTable[_local1] = b2Pair.b2_nullPair;
_local1++;
};
m_pairs = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1] = new b2Pair();
_local1++;
};
m_pairBuffer = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairBuffer[_local1] = new b2BufferedPair();
_local1++;
};
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy;
m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy;
m_pairs[_local1].userData = null;
m_pairs[_local1].status = 0;
m_pairs[_local1].next = (_local1 + 1);
_local1++;
};
m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair;
m_pairCount = 0;
m_pairBufferCount = 0;
}
private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{
var _local4:b2Pair;
var _local5:uint;
_local5 = m_hashTable[_arg3];
_local4 = m_pairs[_local5];
while (((!((_local5 == b2Pair.b2_nullPair))) && ((Equals(_local4, _arg1, _arg2) == false)))) {
_local5 = _local4.next;
_local4 = m_pairs[_local5];
};
if (_local5 == b2Pair.b2_nullPair){
return (null);
};
return (_local4);
}
private function Find(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:uint;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
return (FindHash(_arg1, _arg2, _local3));
}
private function ValidateBuffer():void{
}
public function Commit():void{
var _local1:b2BufferedPair;
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:b2Pair;
var _local6:b2Proxy;
var _local7:b2Proxy;
_local3 = 0;
_local4 = m_broadPhase.m_proxyPool;
_local2 = 0;
while (_local2 < m_pairBufferCount) {
_local1 = m_pairBuffer[_local2];
_local5 = Find(_local1.proxyId1, _local1.proxyId2);
_local5.ClearBuffered();
_local6 = _local4[_local5.proxyId1];
_local7 = _local4[_local5.proxyId2];
if (_local5.IsRemoved()){
if (_local5.IsFinal() == true){
m_callback.PairRemoved(_local6.userData, _local7.userData, _local5.userData);
};
_local1 = m_pairBuffer[_local3];
_local1.proxyId1 = _local5.proxyId1;
_local1.proxyId2 = _local5.proxyId2;
_local3++;
} else {
if (_local5.IsFinal() == false){
_local5.userData = m_callback.PairAdded(_local6.userData, _local7.userData);
_local5.SetFinal();
};
};
_local2++;
};
_local2 = 0;
while (_local2 < _local3) {
_local1 = m_pairBuffer[_local2];
RemovePair(_local1.proxyId1, _local1.proxyId2);
_local2++;
};
m_pairBufferCount = 0;
if (b2BroadPhase.s_validate){
ValidateTable();
};
}
public function RemoveBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = Find(_arg1, _arg2);
if (_local4 == null){
return;
};
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.SetRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function RemovePair(_arg1:uint, _arg2:uint){
var _local3:b2Pair;
var _local4:uint;
var _local5:uint;
var _local6:b2Pair;
var _local7:uint;
var _local8:uint;
var _local9:*;
if (_arg1 > _arg2){
_local7 = _arg1;
_arg1 = _arg2;
_arg2 = _local7;
};
_local4 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local5 = m_hashTable[_local4];
_local6 = null;
while (_local5 != b2Pair.b2_nullPair) {
if (Equals(m_pairs[_local5], _arg1, _arg2)){
_local8 = _local5;
_local3 = m_pairs[_local5];
if (_local6){
_local6.next = _local3.next;
} else {
m_hashTable[_local4] = _local3.next;
};
_local3 = m_pairs[_local8];
_local9 = _local3.userData;
_local3.next = m_freePair;
_local3.proxyId1 = b2Pair.b2_nullProxy;
_local3.proxyId2 = b2Pair.b2_nullProxy;
_local3.userData = null;
_local3.status = 0;
m_freePair = _local8;
m_pairCount--;
return (_local9);
} else {
_local6 = m_pairs[_local5];
_local5 = _local6.next;
};
};
return (null);
}
public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{
m_broadPhase = _arg1;
m_callback = _arg2;
}
public function AddBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = AddPair(_arg1, _arg2);
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.ClearRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function AddPair(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:b2Pair;
var _local5:uint;
var _local6:uint;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local4 = FindHash(_arg1, _arg2, _local3);
if (_local4 != null){
return (_local4);
};
_local5 = m_freePair;
_local4 = m_pairs[_local5];
m_freePair = _local4.next;
_local4.proxyId1 = _arg1;
_local4.proxyId2 = _arg2;
_local4.status = 0;
_local4.userData = null;
_local4.next = m_hashTable[_local3];
m_hashTable[_local3] = _local5;
m_pairCount++;
return (_local4);
}
private function ValidateTable():void{
}
public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{
return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2))));
}
public static function Hash(_arg1:uint, _arg2:uint):uint{
var _local3:uint;
_local3 = (((_arg2 << 16) & 4294901760) | _arg1);
_local3 = (~(_local3) + ((_local3 << 15) & 4294934528));
_local3 = (_local3 ^ ((_local3 >> 12) & 1048575));
_local3 = (_local3 + ((_local3 << 2) & 4294967292));
_local3 = (_local3 ^ ((_local3 >> 4) & 268435455));
_local3 = (_local3 * 2057);
_local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF));
return (_local3);
}
public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{
return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3))));
}
}
}//package Box2D.Collision
Section 24
//b2Point (Box2D.Collision.b2Point)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Point {
public var p:b2Vec2;
public function b2Point(){
p = new b2Vec2();
super();
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (p);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
return (p);
}
}
}//package Box2D.Collision
Section 25
//b2Proxy (Box2D.Collision.b2Proxy)
package Box2D.Collision {
public class b2Proxy {
public var overlapCount:uint;
public var lowerBounds:Array;
public var upperBounds:Array;
public var userData;// = null
public var timeStamp:uint;
public function b2Proxy(){
lowerBounds = [uint(0), uint(0)];
upperBounds = [uint(0), uint(0)];
userData = null;
super();
}
public function GetNext():uint{
return (lowerBounds[0]);
}
public function IsValid():Boolean{
return (!((overlapCount == b2BroadPhase.b2_invalid)));
}
public function SetNext(_arg1:uint):void{
lowerBounds[0] = (_arg1 & 0xFFFF);
}
}
}//package Box2D.Collision
Section 26
//b2Segment (Box2D.Collision.b2Segment)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Segment {
public var p1:b2Vec2;
public var p2:b2Vec2;
public function b2Segment(){
p1 = new b2Vec2();
p2 = new b2Vec2();
super();
}
public function TestSegment(_arg1:Array, _arg2:b2Vec2, _arg3:b2Segment, _arg4:Number):Boolean{
var _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local5 = _arg3.p1;
_local6 = (_arg3.p2.x - _local5.x);
_local7 = (_arg3.p2.y - _local5.y);
_local8 = (p2.x - p1.x);
_local9 = (p2.y - p1.y);
_local10 = _local9;
_local11 = -(_local8);
_local12 = (100 * Number.MIN_VALUE);
_local13 = -(((_local6 * _local10) + (_local7 * _local11)));
if (_local13 > _local12){
_local14 = (_local5.x - p1.x);
_local15 = (_local5.y - p1.y);
_local16 = ((_local14 * _local10) + (_local15 * _local11));
if ((((0 <= _local16)) && ((_local16 <= (_arg4 * _local13))))){
_local17 = ((-(_local7) * _local15) + (_local7 * _local14));
if (((((-(_local12) * _local13) <= _local17)) && ((_local17 <= (_local13 * (1 + _local12)))))){
_local16 = (_local16 / _local13);
_local18 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
_local10 = (_local10 / _local18);
_local11 = (_local11 / _local18);
_arg1[0] = _local16;
_arg2.Set(_local10, _local11);
return (true);
};
};
};
return (false);
}
public function ExtendForward(_arg1:b2AABB):void{
var dX:Number;
var dY:Number;
var greaterthan0:*;
var lambda:Number;
var aabb = _arg1;
dX = (p2.x - p1.x);
dY = (p2.y - p1.y);
greaterthan0 = function (_arg1){
return ((_arg1 > 0));
};
lambda = Math.min(((dX > 0)) ? ((aabb.upperBound.x - p1.x) / dX) : ((dX < 0)) ? ((aabb.lowerBound.x - p1.x) / dX) : Number.POSITIVE_INFINITY, ((dY > 0)) ? ((aabb.upperBound.y - p1.y) / dY) : ((dY < 0)) ? ((aabb.lowerBound.y - p1.y) / dY) : Number.POSITIVE_INFINITY);
p2.x = (p1.x + (dX * lambda));
p2.y = (p1.y + (dY * lambda));
}
public function Extend(_arg1:b2AABB):void{
ExtendForward(_arg1);
ExtendBackward(_arg1);
}
public function ExtendBackward(_arg1:b2AABB):void{
var dX:Number;
var dY:Number;
var greaterthan0:*;
var lambda:Number;
var aabb = _arg1;
dX = (-(p2.x) + p1.x);
dY = (-(p2.y) + p1.y);
greaterthan0 = function (_arg1){
return ((_arg1 > 0));
};
lambda = Math.min(((dX > 0)) ? ((aabb.upperBound.x - p2.x) / dX) : ((dX < 0)) ? ((aabb.lowerBound.x - p2.x) / dX) : Number.POSITIVE_INFINITY, ((dY > 0)) ? ((aabb.upperBound.y - p2.y) / dY) : ((dY < 0)) ? ((aabb.lowerBound.y - p2.y) / dY) : Number.POSITIVE_INFINITY);
p1.x = (p2.x + (dX * lambda));
p1.y = (p2.y + (dY * lambda));
}
}
}//package Box2D.Collision
Section 27
//b2TimeOfImpact (Box2D.Collision.b2TimeOfImpact)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2TimeOfImpact {
public static var s_xf1:b2XForm = new b2XForm();
public static var s_xf2:b2XForm = new b2XForm();
public static var s_p1:b2Vec2 = new b2Vec2();
public static var s_p2:b2Vec2 = new b2Vec2();
public static function TimeOfImpact(_arg1:b2Shape, _arg2:b2Sweep, _arg3:b2Shape, _arg4:b2Sweep):Number{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:int;
var _local20:int;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:b2XForm;
var _local27:b2XForm;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
_local7 = _arg1.m_sweepRadius;
_local8 = _arg3.m_sweepRadius;
_local9 = _arg2.t0;
_local10 = (_arg2.c.x - _arg2.c0.x);
_local11 = (_arg2.c.y - _arg2.c0.y);
_local12 = (_arg4.c.x - _arg4.c0.x);
_local13 = (_arg4.c.y - _arg4.c0.y);
_local14 = (_arg2.a - _arg2.a0);
_local15 = (_arg4.a - _arg4.a0);
_local16 = 0;
_local17 = s_p1;
_local18 = s_p2;
_local19 = 20;
_local20 = 0;
_local21 = 0;
_local22 = 0;
_local23 = 0;
_local24 = 0;
while (true) {
_local25 = (((1 - _local16) * _local9) + _local16);
_local26 = s_xf1;
_local27 = s_xf2;
_arg2.GetXForm(_local26, _local25);
_arg4.GetXForm(_local27, _local25);
_local23 = b2Distance.Distance(_local17, _local18, _arg1, _local26, _arg3, _local27);
if (_local20 == 0){
if (_local23 > (2 * b2Settings.b2_toiSlop)){
_local24 = (1.5 * b2Settings.b2_toiSlop);
} else {
_local5 = (0.05 * b2Settings.b2_toiSlop);
_local6 = (_local23 - (0.5 * b2Settings.b2_toiSlop));
_local24 = ((_local5 > _local6)) ? _local5 : _local6;
};
};
if (((((_local23 - _local24) < (0.05 * b2Settings.b2_toiSlop))) || ((_local20 == _local19)))){
break;
};
_local21 = (_local18.x - _local17.x);
_local22 = (_local18.y - _local17.y);
_local28 = Math.sqrt(((_local21 * _local21) + (_local22 * _local22)));
_local21 = (_local21 / _local28);
_local22 = (_local22 / _local28);
_local29 = ((((_local21 * (_local10 - _local12)) + (_local22 * (_local11 - _local13))) + (((_local14 < 0)) ? -(_local14) : _local14 * _local7)) + (((_local15 < 0)) ? -(_local15) : _local15 * _local8));
if (_local29 == 0){
_local16 = 1;
break;
};
_local30 = ((_local23 - _local24) / _local29);
_local31 = (_local16 + _local30);
if ((((_local31 < 0)) || ((1 < _local31)))){
_local16 = 1;
break;
};
if (_local31 < ((1 + (100 * Number.MIN_VALUE)) * _local16)){
break;
};
_local16 = _local31;
_local20++;
};
return (_local16);
}
}
}//package Box2D.Collision
Section 28
//ClipVertex (Box2D.Collision.ClipVertex)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class ClipVertex {
public var v:b2Vec2;
public var id:b2ContactID;
public function ClipVertex(){
v = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 29
//Features (Box2D.Collision.Features)
package Box2D.Collision {
public class Features {
public var _referenceEdge:int;
public var _incidentEdge:int;
public var _flip:int;
public var _incidentVertex:int;
public var _m_id:b2ContactID;
public function get referenceEdge():int{
return (_referenceEdge);
}
public function set incidentVertex(_arg1:int):void{
_incidentVertex = _arg1;
_m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000));
}
public function get flip():int{
return (_flip);
}
public function get incidentEdge():int{
return (_incidentEdge);
}
public function set referenceEdge(_arg1:int):void{
_referenceEdge = _arg1;
_m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF));
}
public function set flip(_arg1:int):void{
_flip = _arg1;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function get incidentVertex():int{
return (_incidentVertex);
}
public function set incidentEdge(_arg1:int):void{
_incidentEdge = _arg1;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 30
//b2Mat22 (Box2D.Common.Math.b2Mat22)
package Box2D.Common.Math {
public class b2Mat22 {
public var col1:b2Vec2;
public var col2:b2Vec2;
public function b2Mat22(_arg1:Number=0, _arg2:b2Vec2=null, _arg3:b2Vec2=null){
var _local4:Number;
var _local5:Number;
col1 = new b2Vec2();
col2 = new b2Vec2();
super();
if (((!((_arg2 == null))) && (!((_arg3 == null))))){
col1.SetV(_arg2);
col2.SetV(_arg3);
} else {
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
col1.x = _local4;
col2.x = -(_local5);
col1.y = _local5;
col2.y = _local4;
};
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col1.y = 0;
col2.y = 1;
}
public function Set(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
col1.x = _local2;
col2.x = -(_local3);
col1.y = _local3;
col2.y = _local2;
}
public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col1.y = 0;
col2.y = 0;
}
public function SetM(_arg1:b2Mat22):void{
col1.SetV(_arg1.col1);
col2.SetV(_arg1.col2);
}
public function AddM(_arg1:b2Mat22):void{
col1.x = (col1.x + _arg1.col1.x);
col1.y = (col1.y + _arg1.col1.y);
col2.x = (col2.x + _arg1.col2.x);
col2.y = (col2.y + _arg1.col2.y);
}
public function Abs():void{
col1.Abs();
col2.Abs();
}
public function Copy():b2Mat22{
return (new b2Mat22(0, col1, col2));
}
public function Invert(_arg1:b2Mat22):b2Mat22{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = col1.x;
_local3 = col2.x;
_local4 = col1.y;
_local5 = col2.y;
_local6 = ((_local2 * _local5) - (_local3 * _local4));
_local6 = (1 / _local6);
_arg1.col1.x = (_local6 * _local5);
_arg1.col2.x = (-(_local6) * _local3);
_arg1.col1.y = (-(_local6) * _local4);
_arg1.col2.y = (_local6 * _local2);
return (_arg1);
}
public function GetAngle():Number{
return (Math.atan2(col1.y, col1.x));
}
public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = col1.x;
_local5 = col2.x;
_local6 = col1.y;
_local7 = col2.y;
_local8 = ((_local4 * _local7) - (_local5 * _local6));
_local8 = (1 / _local8);
_arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3)));
_arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2)));
return (_arg1);
}
}
}//package Box2D.Common.Math
Section 31
//b2Math (Box2D.Common.Math.b2Math)
package Box2D.Common.Math {
public class b2Math {
public static const b2Mat22_identity:b2Mat22 = new b2Mat22(0, new b2Vec2(1, 0), new b2Vec2(0, 1));
public static const b2XForm_identity:b2XForm = new b2XForm(b2Vec2_zero, b2Mat22_identity);
public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0, 0);
public static function b2CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x));
return (_local3);
}
public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y));
return (_local3);
}
public static function b2IsValid(_arg1:Number):Boolean{
return (isFinite(_arg1));
}
public static function b2MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Min(_arg1.x, _arg2.x), b2Min(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2MulX(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = b2MulMV(_arg1.R, _arg2);
_local3.x = (_local3.x + _arg1.position.x);
_local3.y = (_local3.y + _arg1.position.y);
return (_local3);
}
public static function b2DistanceSquared(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (((_local3 * _local3) + (_local4 * _local4)));
}
public static function b2Swap(_arg1:Array, _arg2:Array):void{
var _local3:*;
_local3 = _arg1[0];
_arg1[0] = _arg2[0];
_arg2[0] = _local3;
}
public static function b2AbsM(_arg1:b2Mat22):b2Mat22{
var _local2:b2Mat22;
_local2 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2));
return (_local2);
}
public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
return (_local3);
}
public static function b2MulXT(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
_local3 = SubtractVV(_arg2, _arg1.position);
_local4 = ((_local3.x * _arg1.R.col1.x) + (_local3.y * _arg1.R.col1.y));
_local3.y = ((_local3.x * _arg1.R.col2.x) + (_local3.y * _arg1.R.col2.y));
_local3.x = _local4;
return (_local3);
}
public static function b2Abs(_arg1:Number):Number{
return (((_arg1 > 0)) ? _arg1 : -(_arg1));
}
public static function b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (b2Max(_arg2, b2Min(_arg1, _arg3)));
}
public static function b2AbsV(_arg1:b2Vec2):b2Vec2{
var _local2:b2Vec2;
_local2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y));
return (_local2);
}
public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y));
return (_local3);
}
public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x));
return (_local3);
}
public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2));
return (_local3);
}
public static function b2Distance(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2Mat22;
_local3 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1));
_local4 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2));
_local5 = new b2Mat22(0, _local3, _local4);
return (_local5);
}
public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2IsPowerOfTwo(_arg1:uint):Boolean{
var _local2:Boolean;
_local2 = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0)));
return (_local2);
}
public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{
return (b2MaxV(_arg2, b2MinV(_arg1, _arg3)));
}
public static function b2RandomRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = Math.random();
_local3 = (((_arg2 - _arg1) * _local3) + _arg1);
return (_local3);
}
public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Dot(_arg2, _arg1.col1), b2Dot(_arg2, _arg1.col2));
return (_local3);
}
public static function b2Min(_arg1:Number, _arg2:Number):Number{
return (((_arg1 < _arg2)) ? _arg1 : _arg2);
}
public static function b2Random():Number{
return (((Math.random() * 2) - 1));
}
public static function b2MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, b2MulMV(_arg1, _arg2.col1), b2MulMV(_arg1, _arg2.col2));
return (_local3);
}
public static function b2NextPowerOfTwo(_arg1:uint):uint{
_arg1 = (_arg1 | ((_arg1 >> 1) & 2147483647));
_arg1 = (_arg1 | ((_arg1 >> 2) & 1073741823));
_arg1 = (_arg1 | ((_arg1 >> 4) & 268435455));
_arg1 = (_arg1 | ((_arg1 >> 8) & 0xFFFFFF));
_arg1 = (_arg1 | ((_arg1 >> 16) & 0xFFFF));
return ((_arg1 + 1));
}
public static function b2Max(_arg1:Number, _arg2:Number):Number{
return (((_arg1 > _arg2)) ? _arg1 : _arg2);
}
public static function b2MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y)));
return (_local3);
}
}
}//package Box2D.Common.Math
Section 32
//b2Sweep (Box2D.Common.Math.b2Sweep)
package Box2D.Common.Math {
public class b2Sweep {
public var localCenter:b2Vec2;
public var c:b2Vec2;
public var a:Number;
public var c0:b2Vec2;
public var a0:Number;
public var t0:Number;
public function b2Sweep(){
localCenter = new b2Vec2();
c0 = new b2Vec2();
c = new b2Vec2();
super();
}
public function Advance(_arg1:Number):void{
var _local2:Number;
if ((((t0 < _arg1)) && (((1 - t0) > Number.MIN_VALUE)))){
_local2 = ((_arg1 - t0) / (1 - t0));
c0.x = (((1 - _local2) * c0.x) + (_local2 * c.x));
c0.y = (((1 - _local2) * c0.y) + (_local2 * c.y));
a0 = (((1 - _local2) * a0) + (_local2 * a));
t0 = _arg1;
};
}
public function GetXForm(_arg1:b2XForm, _arg2:Number):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
if ((1 - t0) > Number.MIN_VALUE){
_local4 = ((_arg2 - t0) / (1 - t0));
_arg1.position.x = (((1 - _local4) * c0.x) + (_local4 * c.x));
_arg1.position.y = (((1 - _local4) * c0.y) + (_local4 * c.y));
_local5 = (((1 - _local4) * a0) + (_local4 * a));
_arg1.R.Set(_local5);
} else {
_arg1.position.SetV(c);
_arg1.R.Set(a);
};
_local3 = _arg1.R;
_arg1.position.x = (_arg1.position.x - ((_local3.col1.x * localCenter.x) + (_local3.col2.x * localCenter.y)));
_arg1.position.y = (_arg1.position.y - ((_local3.col1.y * localCenter.x) + (_local3.col2.y * localCenter.y)));
}
}
}//package Box2D.Common.Math
Section 33
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
public class b2Vec2 {
public var x:Number;
public var y:Number;
public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Set(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function Length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function LengthSquared():Number{
return (((x * x) + (y * y)));
}
public function SetZero():void{
x = 0;
y = 0;
}
public function Add(_arg1:b2Vec2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function MaxV(_arg1:b2Vec2):void{
x = ((x > _arg1.x)) ? x : _arg1.x;
y = ((y > _arg1.y)) ? y : _arg1.y;
}
public function SetV(_arg1:b2Vec2):void{
x = _arg1.x;
y = _arg1.y;
}
public function Negative():b2Vec2{
return (new b2Vec2(-(x), -(y)));
}
public function CrossVF(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (_arg1 * y);
y = (-(_arg1) * _local2);
}
public function Abs():void{
if (x < 0){
x = -(x);
};
if (y < 0){
y = -(y);
};
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function MulTM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = b2Math.b2Dot(this, _arg1.col1);
y = b2Math.b2Dot(this, _arg1.col2);
x = _local2;
}
public function IsValid():Boolean{
return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y))));
}
public function MinV(_arg1:b2Vec2):void{
x = ((x < _arg1.x)) ? x : _arg1.x;
y = ((y < _arg1.y)) ? y : _arg1.y;
}
public function MulM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = x;
x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y));
y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y));
}
public function Normalize():Number{
var _local1:Number;
var _local2:Number;
_local1 = Math.sqrt(((x * x) + (y * y)));
if (_local1 < Number.MIN_VALUE){
return (0);
};
_local2 = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
return (_local1);
}
public function Subtract(_arg1:b2Vec2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function CrossFV(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (-(_arg1) * y);
y = (_arg1 * _local2);
}
public static function Make(_arg1:Number, _arg2:Number):b2Vec2{
return (new b2Vec2(_arg1, _arg2));
}
}
}//package Box2D.Common.Math
Section 34
//b2XForm (Box2D.Common.Math.b2XForm)
package Box2D.Common.Math {
public class b2XForm {
public var R:b2Mat22;
public var position:b2Vec2;
public function b2XForm(_arg1:b2Vec2=null, _arg2:b2Mat22=null):void{
position = new b2Vec2();
R = new b2Mat22();
super();
if (_arg1){
position.SetV(_arg1);
R.SetM(_arg2);
};
}
public function Initialize(_arg1:b2Vec2, _arg2:b2Mat22):void{
position.SetV(_arg1);
R.SetM(_arg2);
}
public function Set(_arg1:b2XForm):void{
position.SetV(_arg1.position);
R.SetM(_arg1.R);
}
public function SetIdentity():void{
position.SetZero();
R.SetIdentity();
}
}
}//package Box2D.Common.Math
Section 35
//b2Color (Box2D.Common.b2Color)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Color {
private var _g:uint;// = 0
private var _b:uint;// = 0
private var _r:uint;// = 0
public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){
_r = 0;
_g = 0;
_b = 0;
super();
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function get color():uint{
return (((_r | (_g << 8)) | (_b << 16)));
}
public function set r(_arg1:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set b(_arg1:Number):void{
_b = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set g(_arg1:Number):void{
_g = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
}
}//package Box2D.Common
Section 36
//b2Settings (Box2D.Common.b2Settings)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Settings {
public static const b2_angularSleepTolerance:Number = 0.0111111111111111;
public static const b2_linearSleepTolerance:Number = 0.01;
public static const b2_angularSlop:Number = 0.0349065850398866;
public static const b2_linearSlop:Number = 0.005;
public static const b2_pi:Number = 3.14159265358979;
public static const b2_maxProxies:int = 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 37
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class b2CircleContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){
var _local3:b2ManifoldPoint;
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
_local3 = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactPoint;
var _local8:b2ManifoldPoint;
_local5 = m_shape1.m_body;
_local6 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), _local5.m_xf, (m_shape2 as b2CircleShape), _local6.m_xf);
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
m_manifoldCount = 1;
_local8 = m_manifold.points[0];
if (m0.pointCount == 0){
_local8.normalImpulse = 0;
_local8.tangentImpulse = 0;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Add(_local7);
};
} else {
_local4 = m0.points[0];
_local8.normalImpulse = _local4.normalImpulse;
_local8.tangentImpulse = _local4.tangentImpulse;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Persist(_local7);
};
};
} else {
m_manifoldCount = 0;
if ((((m0.pointCount > 0)) && (_arg1))){
_local4 = m0.points[0];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2CircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 38
//b2Contact (Box2D.Dynamics.Contacts.b2Contact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Contact {
public var m_shape1:b2Shape;
public var m_shape2:b2Shape;
public var m_prev:b2Contact;
public var m_toi:Number;
public var m_next:b2Contact;
public var m_friction:Number;
public var m_manifoldCount:int;
public var m_node1:b2ContactEdge;
public var m_node2:b2ContactEdge;
public var m_restitution:Number;
public var m_flags:uint;
public static var e_toiFlag:uint = 8;
public static var e_nonSolidFlag:uint = 1;
public static var e_slowFlag:uint = 2;
public static var e_islandFlag:uint = 4;
public static var s_registers:Array;
public static var s_initialized:Boolean = false;
public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){
m_node1 = new b2ContactEdge();
m_node2 = new b2ContactEdge();
super();
m_flags = 0;
if (((!(_arg1)) || (!(_arg2)))){
m_shape1 = null;
m_shape2 = null;
return;
};
if (((_arg1.IsSensor()) || (_arg2.IsSensor()))){
m_flags = (m_flags | e_nonSolidFlag);
};
m_shape1 = _arg1;
m_shape2 = _arg2;
m_manifoldCount = 0;
m_friction = Math.sqrt((m_shape1.m_friction * m_shape2.m_friction));
m_restitution = b2Math.b2Max(m_shape1.m_restitution, m_shape2.m_restitution);
m_prev = null;
m_next = null;
m_node1.contact = null;
m_node1.prev = null;
m_node1.next = null;
m_node1.other = null;
m_node2.contact = null;
m_node2.prev = null;
m_node2.next = null;
m_node2.other = null;
}
public function GetShape1():b2Shape{
return (m_shape1);
}
public function IsSolid():Boolean{
return (((m_flags & e_nonSolidFlag) == 0));
}
public function GetNext():b2Contact{
return (m_next);
}
public function GetManifolds():Array{
return (null);
}
public function GetShape2():b2Shape{
return (m_shape2);
}
public function GetManifoldCount():int{
return (m_manifoldCount);
}
public function Update(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:int;
var _local4:b2Body;
var _local5:b2Body;
_local2 = m_manifoldCount;
Evaluate(_arg1);
_local3 = m_manifoldCount;
_local4 = m_shape1.m_body;
_local5 = m_shape2.m_body;
if ((((_local3 == 0)) && ((_local2 > 0)))){
_local4.WakeUp();
_local5.WakeUp();
};
if (((((((_local4.IsStatic()) || (_local4.IsBullet()))) || (_local5.IsStatic()))) || (_local5.IsBullet()))){
m_flags = (m_flags & ~(e_slowFlag));
} else {
m_flags = (m_flags | e_slowFlag);
};
}
public function Evaluate(_arg1:b2ContactListener):void{
}
public static function InitializeRegisters():void{
var _local1:int;
var _local2:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
_local1 = 0;
while (_local1 < b2Shape.e_shapeTypeCount) {
s_registers[_local1] = new Array(b2Shape.e_shapeTypeCount);
_local2 = 0;
while (_local2 < b2Shape.e_shapeTypeCount) {
s_registers[_local1][_local2] = new b2ContactRegister();
_local2++;
};
_local1++;
};
AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);
AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape);
AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
var _local3:int;
var _local4:int;
var _local5:b2ContactRegister;
var _local6:Function;
if (_arg1.m_manifoldCount > 0){
_arg1.m_shape1.m_body.WakeUp();
_arg1.m_shape2.m_body.WakeUp();
};
_local3 = _arg1.m_shape1.m_type;
_local4 = _arg1.m_shape2.m_type;
_local5 = s_registers[_local3][_local4];
_local6 = _local5.destroyFcn;
_local6(_arg1, _arg2);
}
public static function AddType(_arg1:Function, _arg2:Function, _arg3:int, _arg4:int):void{
s_registers[_arg3][_arg4].createFcn = _arg1;
s_registers[_arg3][_arg4].destroyFcn = _arg2;
s_registers[_arg3][_arg4].primary = true;
if (_arg3 != _arg4){
s_registers[_arg4][_arg3].createFcn = _arg1;
s_registers[_arg4][_arg3].destroyFcn = _arg2;
s_registers[_arg4][_arg3].primary = false;
};
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
var _local4:int;
var _local5:int;
var _local6:b2ContactRegister;
var _local7:Function;
var _local8:b2Contact;
var _local9:int;
var _local10:b2Manifold;
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
_local4 = _arg1.m_type;
_local5 = _arg2.m_type;
_local6 = s_registers[_local4][_local5];
_local7 = _local6.createFcn;
if (_local7 != null){
if (_local6.primary){
return (_local7(_arg1, _arg2, _arg3));
};
_local8 = _local7(_arg2, _arg1, _arg3);
_local9 = 0;
while (_local9 < _local8.m_manifoldCount) {
_local10 = _local8.GetManifolds()[_local9];
_local8.GetManifolds()[_local9].normal = _local10.normal.Negative();
_local9++;
};
return (_local8);
//unresolved jump
};
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 39
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var points:Array;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var normal:b2Vec2;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
var _local1:int;
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 40
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
public class b2ContactConstraintPoint {
public var r2:b2Vec2;
public var separation:Number;
public var positionImpulse:Number;
public var normalImpulse:Number;
public var equalizedMass:Number;
public var tangentMass:Number;
public var tangentImpulse:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var normalMass:Number;
public var velocityBias:Number;
public var r1:b2Vec2;
public function b2ContactConstraintPoint(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
r1 = new b2Vec2();
r2 = new b2Vec2();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 41
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var next:b2ContactEdge;
public var other:b2Body;
public var contact:b2Contact;
public var prev:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 42
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn:Function;
public var destroyFcn:Function;
}
}//package Box2D.Dynamics.Contacts
Section 43
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
public class b2ContactResult {
public var normal:b2Vec2;
public var position:b2Vec2;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var id:b2ContactID;
public function b2ContactResult(){
position = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 44
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactSolver {
public var m_constraintCount:int;
public var m_constraints:Array;
public var m_allocator;
public var m_step:b2TimeStep;
public function b2ContactSolver(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4){
var _local5:b2Contact;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Mat22;
var _local9:int;
var _local10:b2Body;
var _local11:b2Body;
var _local12:int;
var _local13:Array;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:b2Manifold;
var _local24:Number;
var _local25:Number;
var _local26:b2ContactConstraint;
var _local27:uint;
var _local28:b2ManifoldPoint;
var _local29:b2ContactConstraintPoint;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
m_step = new b2TimeStep();
m_constraints = new Array();
super();
m_step.dt = _arg1.dt;
m_step.inv_dt = _arg1.inv_dt;
m_step.maxIterations = _arg1.maxIterations;
m_allocator = _arg4;
m_constraintCount = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
m_constraintCount = (m_constraintCount + _local5.m_manifoldCount);
_local6++;
};
_local6 = 0;
while (_local6 < m_constraintCount) {
m_constraints[_local6] = new b2ContactConstraint();
_local6++;
};
_local9 = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
_local10 = _local5.m_shape1.m_body;
_local11 = _local5.m_shape2.m_body;
_local12 = _local5.m_manifoldCount;
_local13 = _local5.GetManifolds();
_local14 = _local5.m_friction;
_local15 = _local5.m_restitution;
_local16 = _local10.m_linearVelocity.x;
_local17 = _local10.m_linearVelocity.y;
_local18 = _local11.m_linearVelocity.x;
_local19 = _local11.m_linearVelocity.y;
_local20 = _local10.m_angularVelocity;
_local21 = _local11.m_angularVelocity;
_local22 = 0;
while (_local22 < _local12) {
_local23 = _local13[_local22];
_local24 = _local23.normal.x;
_local25 = _local23.normal.y;
_local26 = m_constraints[_local9];
_local26.body1 = _local10;
_local26.body2 = _local11;
_local26.manifold = _local23;
_local26.normal.x = _local24;
_local26.normal.y = _local25;
_local26.pointCount = _local23.pointCount;
_local26.friction = _local14;
_local26.restitution = _local15;
_local27 = 0;
while (_local27 < _local26.pointCount) {
_local28 = _local23.points[_local27];
_local29 = _local26.points[_local27];
_local29.normalImpulse = _local28.normalImpulse;
_local29.tangentImpulse = _local28.tangentImpulse;
_local29.separation = _local28.separation;
_local29.positionImpulse = 0;
_local29.localAnchor1.SetV(_local28.localPoint1);
_local29.localAnchor2.SetV(_local28.localPoint2);
_local8 = _local10.m_xf.R;
_local32 = (_local28.localPoint1.x - _local10.m_sweep.localCenter.x);
_local33 = (_local28.localPoint1.y - _local10.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local32) + (_local8.col2.x * _local33));
_local33 = ((_local8.col1.y * _local32) + (_local8.col2.y * _local33));
_local32 = _local30;
_local29.r1.Set(_local32, _local33);
_local8 = _local11.m_xf.R;
_local34 = (_local28.localPoint2.x - _local11.m_sweep.localCenter.x);
_local35 = (_local28.localPoint2.y - _local11.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local34) + (_local8.col2.x * _local35));
_local35 = ((_local8.col1.y * _local34) + (_local8.col2.y * _local35));
_local34 = _local30;
_local29.r2.Set(_local34, _local35);
_local36 = ((_local32 * _local32) + (_local33 * _local33));
_local37 = ((_local34 * _local34) + (_local35 * _local35));
_local38 = ((_local32 * _local24) + (_local33 * _local25));
_local39 = ((_local34 * _local24) + (_local35 * _local25));
_local40 = (_local10.m_invMass + _local11.m_invMass);
_local40 = (_local40 + ((_local10.m_invI * (_local36 - (_local38 * _local38))) + (_local11.m_invI * (_local37 - (_local39 * _local39)))));
_local29.normalMass = (1 / _local40);
_local41 = ((_local10.m_mass * _local10.m_invMass) + (_local11.m_mass * _local11.m_invMass));
_local41 = (_local41 + (((_local10.m_mass * _local10.m_invI) * (_local36 - (_local38 * _local38))) + ((_local11.m_mass * _local11.m_invI) * (_local37 - (_local39 * _local39)))));
_local29.equalizedMass = (1 / _local41);
_local42 = _local25;
_local43 = -(_local24);
_local44 = ((_local32 * _local42) + (_local33 * _local43));
_local45 = ((_local34 * _local42) + (_local35 * _local43));
_local46 = (_local10.m_invMass + _local11.m_invMass);
_local46 = (_local46 + ((_local10.m_invI * (_local36 - (_local44 * _local44))) + (_local11.m_invI * (_local37 - (_local45 * _local45)))));
_local29.tangentMass = (1 / _local46);
_local29.velocityBias = 0;
if (_local29.separation > 0){
_local29.velocityBias = (-60 * _local29.separation);
};
_local30 = (((_local18 + (-(_local21) * _local35)) - _local16) - (-(_local20) * _local33));
_local31 = (((_local19 + (_local21 * _local34)) - _local17) - (_local20 * _local32));
_local47 = ((_local26.normal.x * _local30) + (_local26.normal.y * _local31));
if (_local47 < -(b2Settings.b2_velocityThreshold)){
_local29.velocityBias = (_local29.velocityBias + (-(_local26.restitution) * _local47));
};
_local27++;
};
_local9++;
_local22++;
};
_local6++;
};
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local5:int;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:b2ContactConstraintPoint;
var _local21:Number;
var _local22:Number;
var _local23:b2ContactConstraintPoint;
_local5 = 0;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_invMass;
_local10 = _local7.m_invI;
_local11 = _local8.m_invMass;
_local12 = _local8.m_invI;
_local13 = _local6.normal.x;
_local14 = _local6.normal.y;
_local15 = _local14;
_local16 = -(_local13);
if (_arg1.warmStarting){
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local20 = _local6.points[_local18];
_local6.points[_local18].normalImpulse = (_local20.normalImpulse * _arg1.dtRatio);
_local20.tangentImpulse = (_local20.tangentImpulse * _arg1.dtRatio);
_local21 = ((_local20.normalImpulse * _local13) + (_local20.tangentImpulse * _local15));
_local22 = ((_local20.normalImpulse * _local14) + (_local20.tangentImpulse * _local16));
_local7.m_angularVelocity = (_local7.m_angularVelocity - (_local10 * ((_local20.r1.x * _local22) - (_local20.r1.y * _local21))));
_local7.m_linearVelocity.x = (_local7.m_linearVelocity.x - (_local9 * _local21));
_local7.m_linearVelocity.y = (_local7.m_linearVelocity.y - (_local9 * _local22));
_local8.m_angularVelocity = (_local8.m_angularVelocity + (_local12 * ((_local20.r2.x * _local22) - (_local20.r2.y * _local21))));
_local8.m_linearVelocity.x = (_local8.m_linearVelocity.x + (_local11 * _local21));
_local8.m_linearVelocity.y = (_local8.m_linearVelocity.y + (_local11 * _local22));
_local18++;
};
} else {
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local23 = _local6.points[_local18];
_local23.normalImpulse = 0;
_local23.tangentImpulse = 0;
_local18++;
};
};
_local5++;
};
}
public function SolvePositionConstraints(_arg1:Number):Boolean{
var _local2:Number;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:b2Vec2;
var _local10:Number;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:int;
var _local20:int;
var _local21:b2ContactConstraintPoint;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
_local2 = 0;
_local5 = 0;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_sweep.c;
_local10 = _local7.m_sweep.a;
_local11 = _local8.m_sweep.c;
_local12 = _local8.m_sweep.a;
_local13 = (_local7.m_mass * _local7.m_invMass);
_local14 = (_local7.m_mass * _local7.m_invI);
_local15 = (_local8.m_mass * _local8.m_invMass);
_local16 = (_local8.m_mass * _local8.m_invI);
_local17 = _local6.normal.x;
_local18 = _local6.normal.y;
_local19 = _local6.pointCount;
_local20 = 0;
while (_local20 < _local19) {
_local21 = _local6.points[_local20];
_local3 = _local7.m_xf.R;
_local4 = _local7.m_sweep.localCenter;
_local22 = (_local21.localAnchor1.x - _local4.x);
_local23 = (_local21.localAnchor1.y - _local4.y);
_local26 = ((_local3.col1.x * _local22) + (_local3.col2.x * _local23));
_local23 = ((_local3.col1.y * _local22) + (_local3.col2.y * _local23));
_local22 = _local26;
_local3 = _local8.m_xf.R;
_local4 = _local8.m_sweep.localCenter;
_local24 = (_local21.localAnchor2.x - _local4.x);
_local25 = (_local21.localAnchor2.y - _local4.y);
_local26 = ((_local3.col1.x * _local24) + (_local3.col2.x * _local25));
_local25 = ((_local3.col1.y * _local24) + (_local3.col2.y * _local25));
_local24 = _local26;
_local27 = (_local9.x + _local22);
_local28 = (_local9.y + _local23);
_local29 = (_local11.x + _local24);
_local30 = (_local11.y + _local25);
_local31 = (_local29 - _local27);
_local32 = (_local30 - _local28);
_local33 = (((_local31 * _local17) + (_local32 * _local18)) + _local21.separation);
_local2 = b2Math.b2Min(_local2, _local33);
_local34 = (_arg1 * b2Math.b2Clamp((_local33 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0));
_local35 = (-(_local21.equalizedMass) * _local34);
_local36 = _local21.positionImpulse;
_local21.positionImpulse = b2Math.b2Max((_local36 + _local35), 0);
_local35 = (_local21.positionImpulse - _local36);
_local37 = (_local35 * _local17);
_local38 = (_local35 * _local18);
_local9.x = (_local9.x - (_local13 * _local37));
_local9.y = (_local9.y - (_local13 * _local38));
_local10 = (_local10 - (_local14 * ((_local22 * _local38) - (_local23 * _local37))));
_local7.m_sweep.a = _local10;
_local7.SynchronizeTransform();
_local11.x = (_local11.x + (_local15 * _local37));
_local11.y = (_local11.y + (_local15 * _local38));
_local12 = (_local12 + (_local16 * ((_local24 * _local38) - (_local25 * _local37))));
_local8.m_sweep.a = _local12;
_local8.SynchronizeTransform();
_local20++;
};
_local5++;
};
return ((_local2 >= (-1.5 * b2Settings.b2_linearSlop)));
}
public function SolveVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraintPoint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Mat22;
var _local18:b2Vec2;
var _local19:int;
var _local20:b2ContactConstraint;
var _local21:b2Body;
var _local22:b2Body;
var _local23:Number;
var _local24:Number;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:int;
var _local38:Number;
_local19 = 0;
while (_local19 < m_constraintCount) {
_local20 = m_constraints[_local19];
_local21 = _local20.body1;
_local22 = _local20.body2;
_local23 = _local21.m_angularVelocity;
_local24 = _local22.m_angularVelocity;
_local25 = _local21.m_linearVelocity;
_local26 = _local22.m_linearVelocity;
_local27 = _local21.m_invMass;
_local28 = _local21.m_invI;
_local29 = _local22.m_invMass;
_local30 = _local22.m_invI;
_local31 = _local20.normal.x;
_local32 = _local20.normal.y;
_local33 = _local32;
_local34 = -(_local31);
_local35 = _local20.friction;
_local37 = _local20.pointCount;
_local1 = 0;
while (_local1 < _local37) {
_local2 = _local20.points[_local1];
_local7 = (((_local26.x + (-(_local24) * _local2.r2.y)) - _local25.x) - (-(_local23) * _local2.r1.y));
_local8 = (((_local26.y + (_local24 * _local2.r2.x)) - _local25.y) - (_local23 * _local2.r1.x));
_local9 = ((_local7 * _local31) + (_local8 * _local32));
_local11 = (-(_local2.normalMass) * (_local9 - _local2.velocityBias));
_local10 = ((_local7 * _local33) + (_local8 * _local34));
_local12 = (_local2.tangentMass * -(_local10));
_local13 = b2Math.b2Max((_local2.normalImpulse + _local11), 0);
_local11 = (_local13 - _local2.normalImpulse);
_local38 = (_local35 * _local2.normalImpulse);
_local14 = b2Math.b2Clamp((_local2.tangentImpulse + _local12), -(_local38), _local38);
_local12 = (_local14 - _local2.tangentImpulse);
_local15 = ((_local11 * _local31) + (_local12 * _local33));
_local16 = ((_local11 * _local32) + (_local12 * _local34));
_local25.x = (_local25.x - (_local27 * _local15));
_local25.y = (_local25.y - (_local27 * _local16));
_local23 = (_local23 - (_local28 * ((_local2.r1.x * _local16) - (_local2.r1.y * _local15))));
_local26.x = (_local26.x + (_local29 * _local15));
_local26.y = (_local26.y + (_local29 * _local16));
_local24 = (_local24 + (_local30 * ((_local2.r2.x * _local16) - (_local2.r2.y * _local15))));
_local2.normalImpulse = _local13;
_local2.tangentImpulse = _local14;
_local1++;
};
_local21.m_angularVelocity = _local23;
_local22.m_angularVelocity = _local24;
_local19++;
};
}
public function FinalizeVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraint;
var _local3:b2Manifold;
var _local4:int;
var _local5:b2ManifoldPoint;
var _local6:b2ContactConstraintPoint;
_local1 = 0;
while (_local1 < m_constraintCount) {
_local2 = m_constraints[_local1];
_local3 = _local2.manifold;
_local4 = 0;
while (_local4 < _local2.pointCount) {
_local5 = _local3.points[_local4];
_local6 = _local2.points[_local4];
_local5.normalImpulse = _local6.normalImpulse;
_local5.tangentImpulse = _local6.tangentImpulse;
_local4++;
};
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 45
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2NullContact extends b2Contact {
override public function GetManifolds():Array{
return (null);
}
override public function Evaluate(_arg1:b2ContactListener):void{
}
}
}//package Box2D.Dynamics.Contacts
Section 46
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyAndCircleContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){
var _local3:b2ManifoldPoint;
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polygonShape));
b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape));
m_manifold.pointCount = 0;
_local3 = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2ManifoldPoint;
var _local6:b2Body;
var _local7:b2Body;
var _local8:Array;
var _local9:b2ContactPoint;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
_local6 = m_shape1.m_body;
_local7 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), _local6.m_xf, (m_shape2 as b2CircleShape), _local7.m_xf);
_local8 = [false, false];
_local9 = s_evalCP;
_local9.shape1 = m_shape1;
_local9.shape2 = m_shape2;
_local9.friction = m_friction;
_local9.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local2 = 0;
while (_local2 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local2];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local8[_local13] == true){
} else {
_local5 = m0.points[_local13];
if (_local5.id._key == _local12){
_local8[_local13] = true;
_local10.normalImpulse = _local5.normalImpulse;
_local10.tangentImpulse = _local5.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Persist(_local9);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Add(_local9);
};
_local2++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local2 = 0;
while (_local2 < m0.pointCount) {
if (_local8[_local2]){
} else {
_local5 = m0.points[_local2];
_local9.position = _local6.GetWorldPoint(_local5.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local5.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local5.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m0.normal);
_local9.separation = _local5.separation;
_local9.id.key = _local5.id._key;
_arg1.Remove(_local9);
};
_local2++;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolyAndCircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 47
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class b2PolygonContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolygonContact(_arg1:b2Shape, _arg2:b2Shape):void{
m0 = new b2Manifold();
m_manifolds = [new b2Manifold()];
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactPoint;
var _local8:int;
var _local9:Array;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
_local5 = m_shape1.m_body;
_local6 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygons(m_manifold, (m_shape1 as b2PolygonShape), _local5.m_xf, (m_shape2 as b2PolygonShape), _local6.m_xf);
_local9 = [false, false];
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local8 = 0;
while (_local8 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local8];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local9[_local13] == true){
} else {
_local4 = m0.points[_local13];
if (_local4.id._key == _local12){
_local9[_local13] = true;
_local10.normalImpulse = _local4.normalImpulse;
_local10.tangentImpulse = _local4.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Persist(_local7);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Add(_local7);
};
_local8++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local8 = 0;
while (_local8 < m0.pointCount) {
if (_local9[_local8]){
} else {
_local4 = m0.points[_local8];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
_local8++;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolygonContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 48
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2DistanceJoint extends b2Joint {
public var m_mass:Number;
public var m_u:b2Vec2;
public var m_impulse:Number;
public var m_dampingRatio:Number;
public var m_frequencyHz:Number;
public var m_localAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_bias:Number;
public var m_gamma:Number;
public var m_length:Number;
public function b2DistanceJoint(_arg1:b2DistanceJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u = new b2Vec2();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_length = _arg1.length;
m_frequencyHz = _arg1.frequencyHz;
m_dampingRatio = _arg1.dampingRatio;
m_impulse = 0;
m_gamma = 0;
m_bias = 0;
m_inv_dt = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = new b2Vec2();
_local1.SetV(m_u);
_local1.Multiply((m_inv_dt * m_impulse));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Mat22;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
if (m_frequencyHz > 0){
return (true);
};
_local2 = m_body1;
_local3 = m_body2;
_local1 = _local2.m_xf.R;
_local4 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local4) + (_local1.col2.x * _local5));
_local5 = ((_local1.col1.y * _local4) + (_local1.col2.y * _local5));
_local4 = _local6;
_local1 = _local3.m_xf.R;
_local7 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local8 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local7) + (_local1.col2.x * _local8));
_local8 = ((_local1.col1.y * _local7) + (_local1.col2.y * _local8));
_local7 = _local6;
_local9 = (((_local3.m_sweep.c.x + _local7) - _local2.m_sweep.c.x) - _local4);
_local10 = (((_local3.m_sweep.c.y + _local8) - _local2.m_sweep.c.y) - _local5);
_local11 = Math.sqrt(((_local9 * _local9) + (_local10 * _local10)));
_local9 = (_local9 / _local11);
_local10 = (_local10 / _local11);
_local12 = (_local11 - m_length);
_local12 = b2Math.b2Clamp(_local12, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local13 = (-(m_mass) * _local12);
m_u.Set(_local9, _local10);
_local14 = (_local13 * m_u.x);
_local15 = (_local13 * m_u.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x - (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y - (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a - (_local2.m_invI * ((_local4 * _local15) - (_local5 * _local14))));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + (_local3.m_invMass * _local14));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + (_local3.m_invMass * _local15));
_local3.m_sweep.a = (_local3.m_sweep.a + (_local3.m_invI * ((_local7 * _local15) - (_local8 * _local14))));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((b2Math.b2Abs(_local12) < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
m_inv_dt = _arg1.inv_dt;
_local4 = m_body1;
_local5 = m_body2;
_local2 = _local4.m_xf.R;
_local6 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7));
_local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7));
_local6 = _local3;
_local2 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local3;
m_u.x = (((_local5.m_sweep.c.x + _local8) - _local4.m_sweep.c.x) - _local6);
m_u.y = (((_local5.m_sweep.c.y + _local9) - _local4.m_sweep.c.y) - _local7);
_local10 = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y)));
if (_local10 > b2Settings.b2_linearSlop){
m_u.Multiply((1 / _local10));
} else {
m_u.SetZero();
};
_local11 = ((_local6 * m_u.y) - (_local7 * m_u.x));
_local12 = ((_local8 * m_u.y) - (_local9 * m_u.x));
_local13 = (((_local4.m_invMass + ((_local4.m_invI * _local11) * _local11)) + _local5.m_invMass) + ((_local5.m_invI * _local12) * _local12));
m_mass = (1 / _local13);
if (m_frequencyHz > 0){
_local14 = (_local10 - m_length);
_local15 = ((2 * Math.PI) * m_frequencyHz);
_local16 = (((2 * m_mass) * m_dampingRatio) * _local15);
_local17 = ((m_mass * _local15) * _local15);
m_gamma = (1 / (_arg1.dt * (_local16 + (_arg1.dt * _local17))));
m_bias = (((_local14 * _arg1.dt) * _local17) * m_gamma);
m_mass = (1 / (_local13 + m_gamma));
};
if (_arg1.warmStarting){
m_impulse = (m_impulse * _arg1.dtRatio);
_local18 = (m_impulse * m_u.x);
_local19 = (m_impulse * m_u.y);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local4.m_invMass * _local18));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local4.m_invMass * _local19));
_local4.m_angularVelocity = (_local4.m_angularVelocity - (_local4.m_invI * ((_local6 * _local19) - (_local7 * _local18))));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local5.m_invMass * _local18));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local5.m_invMass * _local19));
_local5.m_angularVelocity = (_local5.m_angularVelocity + (_local5.m_invI * ((_local8 * _local19) - (_local9 * _local18))));
} else {
m_impulse = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local3 = m_body1;
_local4 = m_body2;
_local2 = _local3.m_xf.R;
_local5 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6));
_local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6));
_local5 = _local7;
_local2 = _local4.m_xf.R;
_local8 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local7;
_local10 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local6));
_local11 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local5));
_local12 = (_local4.m_linearVelocity.x + (-(_local4.m_angularVelocity) * _local9));
_local13 = (_local4.m_linearVelocity.y + (_local4.m_angularVelocity * _local8));
_local14 = ((m_u.x * (_local12 - _local10)) + (m_u.y * (_local13 - _local11)));
_local15 = (-(m_mass) * ((_local14 + m_bias) + (m_gamma * m_impulse)));
m_impulse = (m_impulse + _local15);
_local16 = (_local15 * m_u.x);
_local17 = (_local15 * m_u.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x - (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y - (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity - (_local3.m_invI * ((_local5 * _local17) - (_local6 * _local16))));
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + (_local4.m_invMass * _local16));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + (_local4.m_invMass * _local17));
_local4.m_angularVelocity = (_local4.m_angularVelocity + (_local4.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
}
}
}//package Box2D.Dynamics.Joints
Section 49
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2DistanceJointDef extends b2JointDef {
public var length:Number;
public var dampingRatio:Number;
public var frequencyHz:Number;
public var localAnchor2:b2Vec2;
public var localAnchor1:b2Vec2;
public function b2DistanceJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_distanceJoint;
length = 1;
frequencyHz = 0;
dampingRatio = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
var _local5:Number;
var _local6:Number;
body1 = _arg1;
body2 = _arg2;
localAnchor1.SetV(body1.GetLocalPoint(_arg3));
localAnchor2.SetV(body2.GetLocalPoint(_arg4));
_local5 = (_arg4.x - _arg3.x);
_local6 = (_arg4.y - _arg3.y);
length = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
frequencyHz = 0;
dampingRatio = 0;
}
}
}//package Box2D.Dynamics.Joints
Section 50
//b2GearJoint (Box2D.Dynamics.Joints.b2GearJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2GearJoint extends b2Joint {
public var m_force:Number;
public var m_mass:Number;
public var m_prismatic1:b2PrismaticJoint;
public var m_prismatic2:b2PrismaticJoint;
public var m_ground1:b2Body;
public var m_ground2:b2Body;
public var m_constant:Number;
public var m_revolute1:b2RevoluteJoint;
public var m_revolute2:b2RevoluteJoint;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_ratio:Number;
public var m_J:b2Jacobian;
public function b2GearJoint(_arg1:b2GearJointDef){
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_J = new b2Jacobian();
super(_arg1);
_local2 = _arg1.joint1.m_type;
_local3 = _arg1.joint2.m_type;
m_revolute1 = null;
m_prismatic1 = null;
m_revolute2 = null;
m_prismatic2 = null;
m_ground1 = _arg1.joint1.m_body1;
m_body1 = _arg1.joint1.m_body2;
if (_local2 == b2Joint.e_revoluteJoint){
m_revolute1 = (_arg1.joint1 as b2RevoluteJoint);
m_groundAnchor1.SetV(m_revolute1.m_localAnchor1);
m_localAnchor1.SetV(m_revolute1.m_localAnchor2);
_local4 = m_revolute1.GetJointAngle();
} else {
m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint);
m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1);
m_localAnchor1.SetV(m_prismatic1.m_localAnchor2);
_local4 = m_prismatic1.GetJointTranslation();
};
m_ground2 = _arg1.joint2.m_body1;
m_body2 = _arg1.joint2.m_body2;
if (_local3 == b2Joint.e_revoluteJoint){
m_revolute2 = (_arg1.joint2 as b2RevoluteJoint);
m_groundAnchor2.SetV(m_revolute2.m_localAnchor1);
m_localAnchor2.SetV(m_revolute2.m_localAnchor2);
_local5 = m_revolute2.GetJointAngle();
} else {
m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint);
m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1);
m_localAnchor2.SetV(m_prismatic2.m_localAnchor2);
_local5 = m_prismatic2.GetJointTranslation();
};
m_ratio = _arg1.ratio;
m_constant = (_local4 + (m_ratio * _local5));
m_force = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local1 = 0;
_local2 = m_body1;
_local3 = m_body2;
if (m_revolute1){
_local4 = m_revolute1.GetJointAngle();
} else {
_local4 = m_prismatic1.GetJointTranslation();
};
if (m_revolute2){
_local5 = m_revolute2.GetJointAngle();
} else {
_local5 = m_prismatic2.GetJointTranslation();
};
_local6 = (m_constant - (_local4 + (m_ratio * _local5)));
_local7 = (-(m_mass) * _local6);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + ((_local2.m_invMass * _local7) * m_J.linear1.x));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + ((_local2.m_invMass * _local7) * m_J.linear1.y));
_local2.m_sweep.a = (_local2.m_sweep.a + ((_local2.m_invI * _local7) * m_J.angular1));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local3.m_invMass * _local7) * m_J.linear2.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local3.m_invMass * _local7) * m_J.linear2.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local3.m_invI * _local7) * m_J.angular2));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((_local1 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local2 = m_ground1;
_local3 = m_ground2;
_local4 = m_body1;
_local5 = m_body2;
_local14 = 0;
m_J.SetZero();
if (m_revolute1){
m_J.angular1 = -1;
_local14 = (_local14 + _local4.m_invI);
} else {
_local10 = _local2.m_xf.R;
_local11 = m_prismatic1.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local4.m_xf.R;
_local8 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear1.Set(-(_local6), -(_local7));
m_J.angular1 = -(_local12);
_local14 = (_local14 + (_local4.m_invMass + ((_local4.m_invI * _local12) * _local12)));
};
if (m_revolute2){
m_J.angular2 = -(m_ratio);
_local14 = (_local14 + ((m_ratio * m_ratio) * _local5.m_invI));
} else {
_local10 = _local3.m_xf.R;
_local11 = m_prismatic2.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear2.Set((-(m_ratio) * _local6), (-(m_ratio) * _local7));
m_J.angular2 = (-(m_ratio) * _local12);
_local14 = (_local14 + ((m_ratio * m_ratio) * (_local5.m_invMass + ((_local5.m_invI * _local12) * _local12))));
};
m_mass = (1 / _local14);
if (_arg1.warmStarting){
_local15 = (_arg1.dt * m_force);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * _local15) * m_J.linear1.x));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * _local15) * m_J.linear1.y));
_local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * _local15) * m_J.angular1));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + ((_local5.m_invMass * _local15) * m_J.linear2.x));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + ((_local5.m_invMass * _local15) * m_J.linear2.y));
_local5.m_angularVelocity = (_local5.m_angularVelocity + ((_local5.m_invI * _local15) * m_J.angular2));
} else {
m_force = 0;
};
}
override public function GetReactionTorque():Number{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = m_body2.m_xf.R;
_local2 = (m_localAnchor1.x - m_body2.m_sweep.localCenter.x);
_local3 = (m_localAnchor1.y - m_body2.m_sweep.localCenter.y);
_local4 = ((_local1.col1.x * _local2) + (_local1.col2.x * _local3));
_local3 = ((_local1.col1.y * _local2) + (_local1.col2.y * _local3));
_local2 = _local4;
_local4 = ((m_force * m_J.angular2) - ((_local2 * (m_force * m_J.linear2.y)) - (_local3 * (m_force * m_J.linear2.x))));
return (_local4);
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local5 = ((-(_arg1.inv_dt) * m_mass) * _local4);
m_force = (m_force + _local5);
_local6 = (_arg1.dt * _local5);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local6) * m_J.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local6) * m_J.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local6) * m_J.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local6) * m_J.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local6) * m_J.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local6) * m_J.angular2));
}
}
}//package Box2D.Dynamics.Joints
Section 51
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef)
package Box2D.Dynamics.Joints {
public class b2GearJointDef extends b2JointDef {
public var joint2:b2Joint;
public var joint1:b2Joint;
public var ratio:Number;
public function b2GearJointDef(){
type = b2Joint.e_gearJoint;
joint1 = null;
joint2 = null;
ratio = 1;
}
}
}//package Box2D.Dynamics.Joints
Section 52
//b2Jacobian (Box2D.Dynamics.Joints.b2Jacobian)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2Jacobian {
public var linear1:b2Vec2;
public var linear2:b2Vec2;
public var angular2:Number;
public var angular1:Number;
public function b2Jacobian(){
linear1 = new b2Vec2();
linear2 = new b2Vec2();
super();
}
public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{
linear1.SetV(_arg1);
angular1 = _arg2;
linear2.SetV(_arg3);
angular2 = _arg4;
}
public function SetZero():void{
linear1.SetZero();
angular1 = 0;
linear2.SetZero();
angular2 = 0;
}
public function Compute(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):Number{
return ((((((linear1.x * _arg1.x) + (linear1.y * _arg1.y)) + (angular1 * _arg2)) + ((linear2.x * _arg3.x) + (linear2.y * _arg3.y))) + (angular2 * _arg4)));
}
}
}//package Box2D.Dynamics.Joints
Section 53
//b2Joint (Box2D.Dynamics.Joints.b2Joint)
package Box2D.Dynamics.Joints {
import Box2D.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 GetAnchor1():b2Vec2{
return (null);
}
public function GetAnchor2():b2Vec2{
return (null);
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
}
public function GetType():int{
return (m_type);
}
public function GetBody2():b2Body{
return (m_body2);
}
public function GetNext():b2Joint{
return (m_next);
}
public function GetReactionTorque():Number{
return (0);
}
public function GetUserData(){
return (m_userData);
}
public function GetReactionForce():b2Vec2{
return (null);
}
public function SolvePositionConstraints():Boolean{
return (false);
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetBody1():b2Body{
return (m_body1);
}
public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
}
public function InitPositionConstraints():void{
}
public static function Destroy(_arg1:b2Joint, _arg2):void{
}
public static function Create(_arg1:b2JointDef, _arg2):b2Joint{
var _local3:b2Joint;
_local3 = null;
switch (_arg1.type){
case e_distanceJoint:
_local3 = new b2DistanceJoint((_arg1 as b2DistanceJointDef));
break;
case e_mouseJoint:
_local3 = new b2MouseJoint((_arg1 as b2MouseJointDef));
break;
case e_prismaticJoint:
_local3 = new b2PrismaticJoint((_arg1 as b2PrismaticJointDef));
break;
case e_revoluteJoint:
_local3 = new b2RevoluteJoint((_arg1 as b2RevoluteJointDef));
break;
case e_pulleyJoint:
_local3 = new b2PulleyJoint((_arg1 as b2PulleyJointDef));
break;
case e_gearJoint:
_local3 = new b2GearJoint((_arg1 as b2GearJointDef));
break;
default:
break;
};
return (_local3);
}
}
}//package Box2D.Dynamics.Joints
Section 54
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointDef {
public var collideConnected:Boolean;
public var body1:b2Body;
public var body2:b2Body;
public var userData;
public var type:int;
public function b2JointDef(){
type = b2Joint.e_unknownJoint;
userData = null;
body1 = null;
body2 = null;
collideConnected = false;
}
}
}//package Box2D.Dynamics.Joints
Section 55
//b2JointEdge (Box2D.Dynamics.Joints.b2JointEdge)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointEdge {
public var joint:b2Joint;
public var other:b2Body;
public var next:b2JointEdge;
public var prev:b2JointEdge;
}
}//package Box2D.Dynamics.Joints
Section 56
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2MouseJoint extends b2Joint {
public var m_beta:Number;
public var m_mass:b2Mat22;
public var m_target:b2Vec2;
public var m_impulse:b2Vec2;
public var m_localAnchor:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K:b2Mat22;
public var m_gamma:Number;
public var m_C:b2Vec2;
public var m_maxForce:Number;
public function b2MouseJoint(_arg1:b2MouseJointDef){
var _local2:Number;
var _local3:Number;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
m_localAnchor = new b2Vec2();
m_target = new b2Vec2();
m_impulse = new b2Vec2();
m_mass = new b2Mat22();
m_C = new b2Vec2();
super(_arg1);
m_target.SetV(_arg1.target);
_local2 = (m_target.x - m_body2.m_xf.position.x);
_local3 = (m_target.y - m_body2.m_xf.position.y);
_local4 = m_body2.m_xf.R;
m_localAnchor.x = ((_local2 * _local4.col1.x) + (_local3 * _local4.col1.y));
m_localAnchor.y = ((_local2 * _local4.col2.x) + (_local3 * _local4.col2.y));
m_maxForce = _arg1.maxForce;
m_impulse.SetZero();
_local5 = m_body2.m_mass;
_local6 = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz);
_local7 = (((2 * _local5) * _arg1.dampingRatio) * _local6);
_local8 = ((_arg1.timeStep * _local5) * (_local6 * _local6));
m_gamma = (1 / (_local7 + _local8));
m_beta = (_local8 / (_local7 + _local8));
}
override public function GetAnchor1():b2Vec2{
return (m_target);
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor));
}
override public function GetReactionForce():b2Vec2{
return (m_impulse);
}
override public function SolvePositionConstraints():Boolean{
return (true);
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local4 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local7 = _local2.m_invMass;
_local8 = _local2.m_invI;
K1.col1.x = _local7;
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = _local7;
K2.col1.x = ((_local8 * _local5) * _local5);
K2.col2.x = ((-(_local8) * _local4) * _local5);
K2.col1.y = ((-(_local8) * _local4) * _local5);
K2.col2.y = ((_local8 * _local4) * _local4);
K.SetM(K1);
K.AddM(K2);
K.col1.x = (K.col1.x + m_gamma);
K.col2.y = (K.col2.y + m_gamma);
K.Invert(m_mass);
m_C.x = ((_local2.m_sweep.c.x + _local4) - m_target.x);
m_C.y = ((_local2.m_sweep.c.y + _local5) - m_target.y);
_local2.m_angularVelocity = (_local2.m_angularVelocity * 0.98);
_local9 = (_arg1.dt * m_impulse.x);
_local10 = (_arg1.dt * m_impulse.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local7 * _local9));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local7 * _local10));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local8 * ((_local4 * _local10) - (_local5 * _local9))));
}
override public function GetReactionTorque():Number{
return (0);
}
public function SetTarget(_arg1:b2Vec2):void{
if (m_body2.IsSleeping()){
m_body2.WakeUp();
};
m_target = _arg1;
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local6 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local4 = ((_local3.col1.x * _local6) + (_local3.col2.x * _local7));
_local7 = ((_local3.col1.y * _local6) + (_local3.col2.y * _local7));
_local6 = _local4;
_local8 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local7));
_local9 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local6));
_local3 = m_mass;
_local4 = ((_local8 + ((m_beta * _arg1.inv_dt) * m_C.x)) + ((m_gamma * _arg1.dt) * m_impulse.x));
_local5 = ((_local9 + ((m_beta * _arg1.inv_dt) * m_C.y)) + ((m_gamma * _arg1.dt) * m_impulse.y));
_local10 = (-(_arg1.inv_dt) * ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)));
_local11 = (-(_arg1.inv_dt) * ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)));
_local12 = m_impulse.x;
_local13 = m_impulse.y;
m_impulse.x = (m_impulse.x + _local10);
m_impulse.y = (m_impulse.y + _local11);
_local14 = m_impulse.Length();
if (_local14 > m_maxForce){
m_impulse.Multiply((m_maxForce / _local14));
};
_local10 = (m_impulse.x - _local12);
_local11 = (m_impulse.y - _local13);
_local15 = (_arg1.dt * _local10);
_local16 = (_arg1.dt * _local11);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
}
}
}//package Box2D.Dynamics.Joints
Section 57
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2MouseJointDef extends b2JointDef {
public var frequencyHz:Number;
public var dampingRatio:Number;
public var maxForce:Number;
public var target:b2Vec2;
public var timeStep:Number;
public function b2MouseJointDef(){
target = new b2Vec2();
super();
type = b2Joint.e_mouseJoint;
maxForce = 0;
frequencyHz = 5;
dampingRatio = 0.7;
timeStep = (1 / 60);
}
}
}//package Box2D.Dynamics.Joints
Section 58
//b2PrismaticJoint (Box2D.Dynamics.Joints.b2PrismaticJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PrismaticJoint extends b2Joint {
public var m_limitForce:Number;
public var m_refAngle:Number;
public var m_lowerTranslation:Number;
public var m_localXAxis1:b2Vec2;
public var m_torque:Number;
public var m_enableLimit:Boolean;
public var m_motorForce:Number;
public var m_force:Number;
public var m_localYAxis1:b2Vec2;
public var m_motorMass:Number;
public var m_maxMotorForce:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_angularMass:Number;
public var m_limitState:int;
public var m_linearMass:Number;
public var m_upperTranslation:Number;
public var m_motorJacobian:b2Jacobian;
public var m_limitPositionImpulse:Number;
public var m_motorSpeed:Number;
public var m_linearJacobian:b2Jacobian;
public var m_enableMotor:Boolean;
public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_localXAxis1 = new b2Vec2();
m_localYAxis1 = new b2Vec2();
m_linearJacobian = new b2Jacobian();
m_motorJacobian = new b2Jacobian();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_localXAxis1.SetV(_arg1.localAxis1);
m_localYAxis1.x = -(m_localXAxis1.y);
m_localYAxis1.y = m_localXAxis1.x;
m_refAngle = _arg1.referenceAngle;
m_linearJacobian.SetZero();
m_linearMass = 0;
m_force = 0;
m_angularMass = 0;
m_torque = 0;
m_motorJacobian.SetZero();
m_motorMass = 0;
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerTranslation = _arg1.lowerTranslation;
m_upperTranslation = _arg1.upperTranslation;
m_maxMotorForce = _arg1.maxMotorForce;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetUpperLimit():Number{
return (m_upperTranslation);
}
public function GetLowerLimit():Number{
return (m_lowerTranslation);
}
public function GetJointTranslation():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:b2Vec2;
var _local9:Number;
_local1 = m_body1;
_local2 = m_body2;
_local4 = _local1.GetWorldPoint(m_localAnchor1);
_local5 = _local2.GetWorldPoint(m_localAnchor2);
_local6 = (_local5.x - _local4.x);
_local7 = (_local5.y - _local4.y);
_local8 = _local1.GetWorldVector(m_localXAxis1);
_local9 = ((_local8.x * _local6) + (_local8.y * _local7));
return (_local9);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerTranslation = _arg1;
m_upperTranslation = _arg2;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body1.m_xf.R;
_local2 = (m_limitForce * ((_local1.col1.x * m_localXAxis1.x) + (_local1.col2.x * m_localXAxis1.y)));
_local3 = (m_limitForce * ((_local1.col1.y * m_localXAxis1.x) + (_local1.col2.y * m_localXAxis1.y)));
_local4 = (m_force * ((_local1.col1.x * m_localYAxis1.x) + (_local1.col2.x * m_localYAxis1.y)));
_local5 = (m_force * ((_local1.col1.y * m_localYAxis1.x) + (_local1.col2.y * m_localYAxis1.y)));
return (new b2Vec2(((m_limitForce * _local2) + (m_force * _local4)), ((m_limitForce * _local3) + (m_force * _local5))));
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = _local3.m_invMass;
_local6 = _local4.m_invMass;
_local7 = _local3.m_invI;
_local8 = _local4.m_invI;
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local21 = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y));
_local22 = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y));
_local23 = ((_local21 * _local19) + (_local22 * _local20));
_local23 = b2Math.b2Clamp(_local23, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local24 = (-(m_linearMass) * _local23);
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local24) * m_linearJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local24) * m_linearJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local24) * m_linearJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local24) * m_linearJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local24) * m_linearJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local24) * m_linearJacobian.angular2));
_local25 = b2Math.b2Abs(_local23);
_local26 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_refAngle);
_local26 = b2Math.b2Clamp(_local26, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local27 = (-(m_angularMass) * _local26);
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local27));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local27));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
_local28 = b2Math.b2Abs(_local26);
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local29 = ((_local9.col1.x * m_localXAxis1.x) + (_local9.col2.x * m_localXAxis1.y));
_local30 = ((_local9.col1.y * m_localXAxis1.x) + (_local9.col2.y * m_localXAxis1.y));
_local31 = ((_local29 * _local19) + (_local30 * _local20));
_local32 = 0;
if (m_limitState == e_equalLimits){
_local1 = b2Math.b2Clamp(_local31, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local25 = b2Math.b2Max(_local25, b2Math.b2Abs(_local26));
} else {
if (m_limitState == e_atLowerLimit){
_local1 = (_local31 - m_lowerTranslation);
_local25 = b2Math.b2Max(_local25, -(_local1));
_local1 = b2Math.b2Clamp((_local1 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
} else {
if (m_limitState == e_atUpperLimit){
_local1 = (_local31 - m_upperTranslation);
_local25 = b2Math.b2Max(_local25, _local1);
_local1 = b2Math.b2Clamp((_local1 - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
};
};
};
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local32) * m_motorJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local32) * m_motorJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local32) * m_motorJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local32) * m_motorJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local32) * m_motorJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local32) * m_motorJacobian.angular2));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local25 <= b2Settings.b2_linearSlop)) && ((_local28 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:b2Vec2;
var _local16:b2Vec2;
var _local17:b2Vec2;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local1 = m_body1;
_local2 = m_body2;
_local3 = _local1.m_xf.R;
_local4 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local5 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local3 = _local2.m_xf.R;
_local7 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local8 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local7) + (_local3.col2.x * _local8));
_local8 = ((_local3.col1.y * _local7) + (_local3.col2.y * _local8));
_local7 = _local6;
_local9 = (_local1.m_sweep.c.x + _local4);
_local10 = (_local1.m_sweep.c.y + _local5);
_local11 = (_local2.m_sweep.c.x + _local7);
_local12 = (_local2.m_sweep.c.y + _local8);
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = _local1.GetWorldVector(m_localXAxis1);
_local16 = _local1.m_linearVelocity;
_local17 = _local2.m_linearVelocity;
_local18 = _local1.m_angularVelocity;
_local19 = _local2.m_angularVelocity;
_local20 = (((_local13 * (-(_local18) * _local15.y)) + (_local14 * (_local18 * _local15.x))) + ((_local15.x * (((_local17.x + (-(_local19) * _local8)) - _local16.x) - (-(_local18) * _local5))) + (_local15.y * (((_local17.y + (_local19 * _local7)) - _local16.y) - (_local18 * _local4)))));
return (_local20);
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local10 = _local2.m_invMass;
_local11 = _local3.m_invMass;
_local12 = _local2.m_invI;
_local13 = _local3.m_invI;
_local4 = _local2.m_xf.R;
_local14 = ((_local4.col1.x * m_localYAxis1.x) + (_local4.col2.x * m_localYAxis1.y));
_local15 = ((_local4.col1.y * m_localYAxis1.x) + (_local4.col2.y * m_localYAxis1.y));
_local16 = ((_local3.m_sweep.c.x + _local8) - _local2.m_sweep.c.x);
_local17 = ((_local3.m_sweep.c.y + _local9) - _local2.m_sweep.c.y);
m_linearJacobian.linear1.x = -(_local14);
m_linearJacobian.linear1.y = -(_local15);
m_linearJacobian.linear2.x = _local14;
m_linearJacobian.linear2.y = _local15;
m_linearJacobian.angular1 = -(((_local16 * _local15) - (_local17 * _local14)));
m_linearJacobian.angular2 = ((_local8 * _local15) - (_local9 * _local14));
m_linearMass = (((_local10 + ((_local12 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + _local11) + ((_local13 * m_linearJacobian.angular2) * m_linearJacobian.angular2));
m_linearMass = (1 / m_linearMass);
m_angularMass = (_local12 + _local13);
if (m_angularMass > Number.MIN_VALUE){
m_angularMass = (1 / m_angularMass);
};
if (((m_enableLimit) || (m_enableMotor))){
_local4 = _local2.m_xf.R;
_local18 = ((_local4.col1.x * m_localXAxis1.x) + (_local4.col2.x * m_localXAxis1.y));
_local19 = ((_local4.col1.y * m_localXAxis1.x) + (_local4.col2.y * m_localXAxis1.y));
m_motorJacobian.linear1.x = -(_local18);
m_motorJacobian.linear1.y = -(_local19);
m_motorJacobian.linear2.x = _local18;
m_motorJacobian.linear2.y = _local19;
m_motorJacobian.angular1 = -(((_local16 * _local19) - (_local17 * _local18)));
m_motorJacobian.angular2 = ((_local8 * _local19) - (_local9 * _local18));
m_motorMass = (((_local10 + ((_local12 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + _local11) + ((_local13 * m_motorJacobian.angular2) * m_motorJacobian.angular2));
m_motorMass = (1 / m_motorMass);
if (m_enableLimit){
_local20 = (_local16 - _local6);
_local21 = (_local17 - _local7);
_local22 = ((_local18 * _local20) + (_local19 * _local21));
if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
m_limitState = e_equalLimits;
} else {
if (_local22 <= m_lowerTranslation){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local22 >= m_upperTranslation){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
};
};
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit == false){
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local23 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.x)));
_local24 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.y)));
_local25 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.x)));
_local26 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.y)));
_local27 = (_arg1.dt * (((m_force * m_linearJacobian.angular1) - m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular1)));
_local28 = (_arg1.dt * (((m_force * m_linearJacobian.angular2) + m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular2)));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local10 * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local10 * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local12 * _local27));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local11 * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local11 * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local13 * _local28));
} else {
m_force = 0;
m_torque = 0;
m_limitForce = 0;
m_motorForce = 0;
};
m_limitPositionImpulse = 0;
}
public function GetMotorForce():Number{
return (m_motorForce);
}
public function SetMaxMotorForce(_arg1:Number):void{
m_maxMotorForce = _arg1;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
override public function GetReactionTorque():Number{
return (m_torque);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_invMass;
_local5 = _local3.m_invMass;
_local6 = _local2.m_invI;
_local7 = _local3.m_invI;
_local9 = m_linearJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local10 = ((-(_arg1.inv_dt) * m_linearMass) * _local9);
m_force = (m_force + _local10);
_local11 = (_arg1.dt * _local10);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_linearJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_linearJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_linearJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_linearJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_linearJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_linearJacobian.angular2));
_local12 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local13 = ((-(_arg1.inv_dt) * m_angularMass) * _local12);
m_torque = (m_torque + _local13);
_local14 = (_arg1.dt * _local13);
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local6 * _local14));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local7 * _local14));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local15 = (m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity) - m_motorSpeed);
_local16 = ((-(_arg1.inv_dt) * m_motorMass) * _local15);
_local17 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local16), -(m_maxMotorForce), m_maxMotorForce);
_local16 = (m_motorForce - _local17);
_local11 = (_arg1.dt * _local16);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local18 = m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local19 = ((-(_arg1.inv_dt) * m_motorMass) * _local18);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local19);
} else {
if (m_limitState == e_atLowerLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
} else {
if (m_limitState == e_atUpperLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
};
};
};
_local11 = (_arg1.dt * _local19);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
}
}
}//package Box2D.Dynamics.Joints
Section 59
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PrismaticJointDef extends b2JointDef {
public var localAxis1:b2Vec2;
public var referenceAngle:Number;
public var maxMotorForce:Number;
public var motorSpeed:Number;
public var upperTranslation:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public var lowerTranslation:Number;
public function b2PrismaticJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
localAxis1 = new b2Vec2();
super();
type = b2Joint.e_prismaticJoint;
localAxis1.Set(1, 0);
referenceAngle = 0;
enableLimit = false;
lowerTranslation = 0;
upperTranslation = 0;
enableMotor = false;
maxMotorForce = 0;
motorSpeed = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
localAxis1 = body1.GetLocalVector(_arg4);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 60
//b2PulleyJoint (Box2D.Dynamics.Joints.b2PulleyJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PulleyJoint extends b2Joint {
public var m_ground:b2Body;
public var m_maxLength2:Number;
public var m_limitForce1:Number;
public var m_maxLength1:Number;
public var m_limitState1:int;
public var m_limitState2:int;
public var m_limitPositionImpulse2:Number;
public var m_force:Number;
public var m_limitPositionImpulse1:Number;
public var m_constant:Number;
public var m_state:int;
public var m_ratio:Number;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_positionImpulse:Number;
public var m_limitMass2:Number;
public var m_limitMass1:Number;
public var m_pulleyMass:Number;
public var m_u1:b2Vec2;
public var m_u2:b2Vec2;
public var m_limitForce2:Number;
public static const b2_minPulleyLength:Number = 2;
public function b2PulleyJoint(_arg1:b2PulleyJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u1 = new b2Vec2();
m_u2 = new b2Vec2();
super(_arg1);
m_ground = m_body1.m_world.m_groundBody;
m_groundAnchor1.x = (_arg1.groundAnchor1.x - m_ground.m_xf.position.x);
m_groundAnchor1.y = (_arg1.groundAnchor1.y - m_ground.m_xf.position.y);
m_groundAnchor2.x = (_arg1.groundAnchor2.x - m_ground.m_xf.position.x);
m_groundAnchor2.y = (_arg1.groundAnchor2.y - m_ground.m_xf.position.y);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_ratio = _arg1.ratio;
m_constant = (_arg1.length1 + (m_ratio * _arg1.length2));
m_maxLength1 = b2Math.b2Min(_arg1.maxLength1, (m_constant - (m_ratio * b2_minPulleyLength)));
m_maxLength2 = b2Math.b2Min(_arg1.maxLength2, ((m_constant - b2_minPulleyLength) / m_ratio));
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
}
public function GetGroundAnchor2():b2Vec2{
var _local1:b2Vec2;
_local1 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor2);
return (_local1);
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = m_u2.Copy();
_local1.Multiply(m_force);
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
_local1 = m_body1;
_local2 = m_body2;
_local4 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local5 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local6 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local7 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
_local23 = 0;
if (m_state == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local16 = m_u1.Length();
_local17 = m_u2.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local16));
} else {
m_u1.SetZero();
};
if (_local17 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = ((m_constant - _local16) - (m_ratio * _local17));
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_pulleyMass) * _local18);
_local20 = m_positionImpulse;
m_positionImpulse = b2Math.b2Max(0, (m_positionImpulse + _local19));
_local19 = (m_positionImpulse - _local20);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local14 = ((-(m_ratio) * _local19) * m_u2.x);
_local15 = ((-(m_ratio) * _local19) * m_u2.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local1.SynchronizeTransform();
_local2.SynchronizeTransform();
};
if (m_limitState1 == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
_local16 = m_u1.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.x = (m_u1.x * (1 / _local16));
m_u1.y = (m_u1.y * (1 / _local16));
} else {
m_u1.SetZero();
};
_local18 = (m_maxLength1 - _local16);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass1) * _local18);
_local21 = m_limitPositionImpulse1;
m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + _local19));
_local19 = (m_limitPositionImpulse1 - _local21);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local1.SynchronizeTransform();
};
if (m_limitState2 == e_atUpperLimit){
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local17 = m_u2.Length();
if (_local17 > b2Settings.b2_linearSlop){
m_u2.x = (m_u2.x * (1 / _local17));
m_u2.y = (m_u2.y * (1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = (m_maxLength2 - _local17);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass2) * _local18);
_local21 = m_limitPositionImpulse2;
m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + _local19));
_local19 = (m_limitPositionImpulse2 - _local21);
_local14 = (-(_local19) * m_u2.x);
_local15 = (-(_local19) * m_u2.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local2.SynchronizeTransform();
};
return ((_local23 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local5 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
_local10 = (_local2.m_sweep.c.x + _local5);
_local11 = (_local2.m_sweep.c.y + _local6);
_local12 = (_local3.m_sweep.c.x + _local8);
_local13 = (_local3.m_sweep.c.y + _local9);
_local14 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local15 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local16 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local17 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
m_u1.Set((_local10 - _local14), (_local11 - _local15));
m_u2.Set((_local12 - _local16), (_local13 - _local17));
_local18 = m_u1.Length();
_local19 = m_u2.Length();
if (_local18 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local18));
} else {
m_u1.SetZero();
};
if (_local19 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local19));
} else {
m_u2.SetZero();
};
_local20 = ((m_constant - _local18) - (m_ratio * _local19));
if (_local20 > 0){
m_state = e_inactiveLimit;
m_force = 0;
} else {
m_state = e_atUpperLimit;
m_positionImpulse = 0;
};
if (_local18 < m_maxLength1){
m_limitState1 = e_inactiveLimit;
m_limitForce1 = 0;
} else {
m_limitState1 = e_atUpperLimit;
m_limitPositionImpulse1 = 0;
};
if (_local19 < m_maxLength2){
m_limitState2 = e_inactiveLimit;
m_limitForce2 = 0;
} else {
m_limitState2 = e_atUpperLimit;
m_limitPositionImpulse2 = 0;
};
_local21 = ((_local5 * m_u1.y) - (_local6 * m_u1.x));
_local22 = ((_local8 * m_u2.y) - (_local9 * m_u2.x));
m_limitMass1 = (_local2.m_invMass + ((_local2.m_invI * _local21) * _local21));
m_limitMass2 = (_local3.m_invMass + ((_local3.m_invI * _local22) * _local22));
m_pulleyMass = (m_limitMass1 + ((m_ratio * m_ratio) * m_limitMass2));
m_limitMass1 = (1 / m_limitMass1);
m_limitMass2 = (1 / m_limitMass2);
m_pulleyMass = (1 / m_pulleyMass);
if (_arg1.warmStarting){
_local23 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.x);
_local24 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.y);
_local25 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.x);
_local26 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local24) - (_local6 * _local23))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local26) - (_local9 * _local25))));
} else {
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
public function GetRatio():Number{
return (m_ratio);
}
public function GetLength2():Number{
var _local1:b2Vec2;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body2.GetWorldPoint(m_localAnchor2);
_local2 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local3 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
_local4 = (_local1.x - _local2);
_local5 = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local5 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
if (m_state == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = (-(((m_u1.x * _local10) + (m_u1.y * _local11))) - (m_ratio * ((m_u2.x * _local12) + (m_u2.y * _local13))));
_local19 = ((-(_arg1.inv_dt) * m_pulleyMass) * _local18);
_local20 = m_force;
m_force = b2Math.b2Max(0, (m_force + _local19));
_local19 = (m_force - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local16 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.x);
_local17 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
if (m_limitState1 == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local18 = -(((m_u1.x * _local10) + (m_u1.y * _local11)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass1) * _local18);
_local20 = m_limitForce1;
m_limitForce1 = b2Math.b2Max(0, (m_limitForce1 + _local19));
_local19 = (m_limitForce1 - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
};
if (m_limitState2 == e_atUpperLimit){
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = -(((m_u2.x * _local12) + (m_u2.y * _local13)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass2) * _local18);
_local20 = m_limitForce2;
m_limitForce2 = b2Math.b2Max(0, (m_limitForce2 + _local19));
_local19 = (m_limitForce2 - _local20);
_local16 = ((-(_arg1.dt) * _local19) * m_u2.x);
_local17 = ((-(_arg1.dt) * _local19) * m_u2.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
}
public function GetLength1():Number{
var _local1:b2Vec2;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body1.GetWorldPoint(m_localAnchor1);
_local2 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local3 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local4 = (_local1.x - _local2);
_local5 = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
public function GetGroundAnchor1():b2Vec2{
var _local1:b2Vec2;
_local1 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor1);
return (_local1);
}
}
}//package Box2D.Dynamics.Joints
Section 61
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PulleyJointDef extends b2JointDef {
public var maxLength2:Number;
public var length1:Number;
public var length2:Number;
public var maxLength1:Number;
public var ratio:Number;
public var groundAnchor1:b2Vec2;
public var groundAnchor2:b2Vec2;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public function b2PulleyJointDef(){
groundAnchor1 = new b2Vec2();
groundAnchor2 = new b2Vec2();
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_pulleyJoint;
groundAnchor1.Set(-1, 1);
groundAnchor2.Set(1, 1);
localAnchor1.Set(-1, 0);
localAnchor2.Set(1, 0);
length1 = 0;
maxLength1 = 0;
length2 = 0;
maxLength2 = 0;
ratio = 1;
collideConnected = true;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2, _arg5:b2Vec2, _arg6:b2Vec2, _arg7:Number):void{
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
body1 = _arg1;
body2 = _arg2;
groundAnchor1.SetV(_arg3);
groundAnchor2.SetV(_arg4);
localAnchor1 = body1.GetLocalPoint(_arg5);
localAnchor2 = body2.GetLocalPoint(_arg6);
_local8 = (_arg5.x - _arg3.x);
_local9 = (_arg5.y - _arg3.y);
length1 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local10 = (_arg6.x - _arg4.x);
_local11 = (_arg6.y - _arg4.y);
length2 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
ratio = _arg7;
_local12 = (length1 + (ratio * length2));
maxLength1 = (_local12 - (ratio * b2PulleyJoint.b2_minPulleyLength));
maxLength2 = ((_local12 - b2PulleyJoint.b2_minPulleyLength) / ratio);
}
}
}//package Box2D.Dynamics.Joints
Section 62
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2RevoluteJoint extends b2Joint {
public var m_limitForce:Number;
public var m_motorForce:Number;
public var m_pivotMass:b2Mat22;
public var m_enableLimit:Boolean;
public var m_limitState:int;
public var m_motorMass:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K3:b2Mat22;
private var K:b2Mat22;
public var m_pivotForce:b2Vec2;
public var m_motorSpeed:Number;
public var m_enableMotor:Boolean;
public var m_limitPositionImpulse:Number;
public var m_maxMotorTorque:Number;
public var m_referenceAngle:Number;
public var m_lowerAngle:Number;
public var m_upperAngle:Number;
public static var tImpulse:b2Vec2 = new b2Vec2();
public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
K3 = new b2Mat22();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_pivotForce = new b2Vec2();
m_pivotMass = new b2Mat22();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_referenceAngle = _arg1.referenceAngle;
m_pivotForce.Set(0, 0);
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerAngle = _arg1.lowerAngle;
m_upperAngle = _arg1.upperAngle;
m_maxMotorTorque = _arg1.maxMotorTorque;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetUpperLimit():Number{
return (m_upperAngle);
}
public function GetLowerLimit():Number{
return (m_lowerAngle);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerAngle = _arg1;
m_upperAngle = _arg2;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
return (m_pivotForce);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = 0;
_local6 = _local3.m_xf.R;
_local7 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local8 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local7) + (_local6.col2.x * _local8));
_local8 = ((_local6.col1.y * _local7) + (_local6.col2.y * _local8));
_local7 = _local9;
_local6 = _local4.m_xf.R;
_local10 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local10) + (_local6.col2.x * _local11));
_local11 = ((_local6.col1.y * _local10) + (_local6.col2.y * _local11));
_local10 = _local9;
_local12 = (_local3.m_sweep.c.x + _local7);
_local13 = (_local3.m_sweep.c.y + _local8);
_local14 = (_local4.m_sweep.c.x + _local10);
_local15 = (_local4.m_sweep.c.y + _local11);
_local16 = (_local14 - _local12);
_local17 = (_local15 - _local13);
_local5 = Math.sqrt(((_local16 * _local16) + (_local17 * _local17)));
_local18 = _local3.m_invMass;
_local19 = _local4.m_invMass;
_local20 = _local3.m_invI;
_local21 = _local4.m_invI;
K1.col1.x = (_local18 + _local19);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local18 + _local19);
K2.col1.x = ((_local20 * _local8) * _local8);
K2.col2.x = ((-(_local20) * _local7) * _local8);
K2.col1.y = ((-(_local20) * _local7) * _local8);
K2.col2.y = ((_local20 * _local7) * _local7);
K3.col1.x = ((_local21 * _local11) * _local11);
K3.col2.x = ((-(_local21) * _local10) * _local11);
K3.col1.y = ((-(_local21) * _local10) * _local11);
K3.col2.y = ((_local21 * _local10) * _local10);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Solve(tImpulse, -(_local16), -(_local17));
_local22 = tImpulse.x;
_local23 = tImpulse.y;
_local3.m_sweep.c.x = (_local3.m_sweep.c.x - (_local3.m_invMass * _local22));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y - (_local3.m_invMass * _local23));
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * ((_local7 * _local23) - (_local8 * _local22))));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + (_local4.m_invMass * _local22));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + (_local4.m_invMass * _local23));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * ((_local10 * _local23) - (_local11 * _local22))));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
_local24 = 0;
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local25 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_referenceAngle);
_local26 = 0;
if (m_limitState == e_equalLimits){
_local2 = b2Math.b2Clamp(_local25, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local24 = b2Math.b2Abs(_local2);
} else {
if (m_limitState == e_atLowerLimit){
_local2 = (_local25 - m_lowerAngle);
_local24 = b2Math.b2Max(0, -(_local2));
_local2 = b2Math.b2Clamp((_local2 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
} else {
if (m_limitState == e_atUpperLimit){
_local2 = (_local25 - m_upperAngle);
_local24 = b2Math.b2Max(0, _local2);
_local2 = b2Math.b2Clamp((_local2 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
};
};
};
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local26));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local26));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local5 <= b2Settings.b2_linearSlop)) && ((_local24 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity));
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function SetMaxMotorTorque(_arg1:Number):void{
m_maxMotorTorque = _arg1;
}
public function GetJointAngle():Number{
return (((m_body2.m_sweep.a - m_body1.m_sweep.a) - m_referenceAngle));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local10 = _local2.m_invMass;
_local11 = _local3.m_invMass;
_local12 = _local2.m_invI;
_local13 = _local3.m_invI;
K1.col1.x = (_local10 + _local11);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local10 + _local11);
K2.col1.x = ((_local12 * _local7) * _local7);
K2.col2.x = ((-(_local12) * _local6) * _local7);
K2.col1.y = ((-(_local12) * _local6) * _local7);
K2.col2.y = ((_local12 * _local6) * _local6);
K3.col1.x = ((_local13 * _local9) * _local9);
K3.col2.x = ((-(_local13) * _local8) * _local9);
K3.col1.y = ((-(_local13) * _local8) * _local9);
K3.col2.y = ((_local13 * _local8) * _local8);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Invert(m_pivotMass);
m_motorMass = (1 / (_local12 + _local13));
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit){
_local14 = ((_local3.m_sweep.a - _local2.m_sweep.a) - m_referenceAngle);
if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){
m_limitState = e_equalLimits;
} else {
if (_local14 <= m_lowerAngle){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local14 >= m_upperAngle){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
} else {
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - ((_arg1.dt * _local10) * m_pivotForce.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - ((_arg1.dt * _local10) * m_pivotForce.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_arg1.dt * _local12) * ((((_local6 * m_pivotForce.y) - (_local7 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_arg1.dt * _local11) * m_pivotForce.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_arg1.dt * _local11) * m_pivotForce.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_arg1.dt * _local13) * ((((_local8 * m_pivotForce.y) - (_local9 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
} else {
m_pivotForce.SetZero();
m_motorForce = 0;
m_limitForce = 0;
};
m_limitPositionImpulse = 0;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
public function GetMotorTorque():Number{
return (m_motorForce);
}
override public function GetReactionTorque():Number{
return (m_limitForce);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local11 = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local7));
_local12 = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local6));
_local13 = (-(_arg1.inv_dt) * ((m_pivotMass.col1.x * _local11) + (m_pivotMass.col2.x * _local12)));
_local14 = (-(_arg1.inv_dt) * ((m_pivotMass.col1.y * _local11) + (m_pivotMass.col2.y * _local12)));
m_pivotForce.x = (m_pivotForce.x + _local13);
m_pivotForce.y = (m_pivotForce.y + _local14);
_local15 = (_arg1.dt * _local13);
_local16 = (_arg1.dt * _local14);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local15));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local16));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local16) - (_local9 * _local15))));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local17 = ((_local3.m_angularVelocity - _local2.m_angularVelocity) - m_motorSpeed);
_local18 = ((-(_arg1.inv_dt) * m_motorMass) * _local17);
_local19 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local18), -(m_maxMotorTorque), m_maxMotorTorque);
_local18 = (m_motorForce - _local19);
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local18));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local18));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local20 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local21 = ((-(_arg1.inv_dt) * m_motorMass) * _local20);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local21);
} else {
if (m_limitState == e_atLowerLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
} else {
if (m_limitState == e_atUpperLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
};
};
};
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local21));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local21));
};
}
}
}//package Box2D.Dynamics.Joints
Section 63
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2RevoluteJointDef extends b2JointDef {
public var referenceAngle:Number;
public var upperAngle:Number;
public var lowerAngle:Number;
public var motorSpeed:Number;
public var maxMotorTorque:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public function b2RevoluteJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_revoluteJoint;
localAnchor1.Set(0, 0);
localAnchor2.Set(0, 0);
referenceAngle = 0;
lowerAngle = 0;
upperAngle = 0;
maxMotorTorque = 0;
motorSpeed = 0;
enableLimit = false;
enableMotor = false;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 64
//b2Body (Box2D.Dynamics.b2Body)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.Contacts.*;
public class b2Body {
public var m_next:b2Body;
public var m_contactList:b2ContactEdge;
public var m_angularVelocity:Number;
public var m_shapeList:b2Shape;
public var m_force:b2Vec2;
public var m_mass:Number;
public var m_sweep:b2Sweep;
public var m_xf:b2XForm;
public var m_torque:Number;
public var m_userData;
public var m_flags:uint;
public var m_world:b2World;
public var m_prev:b2Body;
public var m_invMass:Number;
public var m_linearDamping:Number;
public var m_type:int;
public var m_angularDamping:Number;
public var m_invI:Number;
public var m_linearVelocity:b2Vec2;
public var m_sleepTime:Number;
public var m_shapeCount:int;
public var m_jointList:b2JointEdge;
public var m_I:Number;
public static var e_fixedRotationFlag:uint = 64;
public static var e_frozenFlag:uint = 2;
public static var e_maxTypes:uint = 3;
public static var e_sleepFlag:uint = 8;
private static var s_massData:b2MassData = new b2MassData();
public static var e_bulletFlag:uint = 32;
public static var e_staticType:uint = 1;
public static var e_islandFlag:uint = 4;
public static var e_allowSleepFlag:uint = 16;
private static var s_xf1:b2XForm = new b2XForm();
public static var e_antiGravityFlag:uint = 0x0100;
public static var e_dynamicType:uint = 2;
public function b2Body(_arg1:b2BodyDef, _arg2:b2World){
var _local3:b2Mat22;
var _local4:b2Vec2;
m_xf = new b2XForm();
m_sweep = new b2Sweep();
m_linearVelocity = new b2Vec2();
m_force = new b2Vec2();
super();
m_flags = 0;
if (_arg1.isBullet){
m_flags = (m_flags | e_bulletFlag);
};
if (_arg1.fixedRotation){
m_flags = (m_flags | e_fixedRotationFlag);
};
if (_arg1.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (_arg1.isSleeping){
m_flags = (m_flags | e_sleepFlag);
};
m_world = _arg2;
m_xf.position.SetV(_arg1.position);
m_xf.R.Set(_arg1.angle);
m_sweep.localCenter.SetV(_arg1.massData.center);
m_sweep.t0 = 1;
m_sweep.a0 = (m_sweep.a = _arg1.angle);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_jointList = null;
m_contactList = null;
m_prev = null;
m_next = null;
m_linearDamping = _arg1.linearDamping;
m_angularDamping = _arg1.angularDamping;
m_force.Set(0, 0);
m_torque = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_sleepTime = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.massData.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.massData.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
m_userData = _arg1.userData;
m_shapeList = null;
m_shapeCount = 0;
}
public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_arg1.x - m_sweep.c.x)))));
}
public function SetLinearVelocity(_arg1:b2Vec2):void{
m_linearVelocity.SetV(_arg1);
}
public function WakeUp():void{
m_flags = (m_flags & ~(e_sleepFlag));
m_sleepTime = 0;
}
public function GetLocalCenter():b2Vec2{
return (m_sweep.localCenter);
}
public function ApplyTorque(_arg1:Number):void{
if (IsSleeping()){
WakeUp();
};
m_torque = (m_torque + _arg1);
}
public function IsFrozen():Boolean{
return (((m_flags & e_frozenFlag) == e_frozenFlag));
}
public function IsDynamic():Boolean{
return ((m_type == e_dynamicType));
}
public function GetLinearVelocity():b2Vec2{
return (m_linearVelocity);
}
public function SynchronizeTransform():void{
var _local1:b2Mat22;
var _local2:b2Vec2;
m_xf.R.Set(m_sweep.a);
_local1 = m_xf.R;
_local2 = m_sweep.localCenter;
m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y)));
m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y)));
}
public function GetInertia():Number{
return (m_I);
}
public function IsSleeping():Boolean{
return (((m_flags & e_sleepFlag) == e_sleepFlag));
}
public function SetMassFromShapes():void{
var _local1:b2Shape;
var _local2:Number;
var _local3:Number;
var _local4:b2MassData;
var _local5:b2Mat22;
var _local6:b2Vec2;
var _local7:int;
if (m_world.m_lock == true){
return;
};
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
_local2 = 0;
_local3 = 0;
_local4 = s_massData;
_local1 = m_shapeList;
while (_local1) {
_local1.ComputeMass(_local4);
m_mass = (m_mass + _local4.mass);
_local2 = (_local2 + (_local4.mass * _local4.center.x));
_local3 = (_local3 + (_local4.mass * _local4.center.y));
m_I = (m_I + _local4.I);
_local1 = _local1.m_next;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
_local2 = (_local2 * m_invMass);
_local3 = (_local3 * m_invMass);
};
if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (m_I - (m_mass * ((_local2 * _local2) + (_local3 * _local3))));
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
m_sweep.localCenter.Set(_local2, _local3);
_local5 = m_xf.R;
_local6 = m_sweep.localCenter;
m_sweep.c.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y));
m_sweep.c.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local1 = m_shapeList;
while (_local1) {
_local1.UpdateSweepRadius(m_sweep.localCenter);
_local1 = _local1.m_next;
};
_local7 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local7 != m_type){
_local1 = m_shapeList;
while (_local1) {
_local1.RefilterProxy(m_world.m_broadPhase, m_xf);
_local1 = _local1.m_next;
};
};
}
public function PutToSleep():void{
m_flags = (m_flags | e_sleepFlag);
m_sleepTime = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_force.SetZero();
m_torque = 0;
}
public function GetJointList():b2JointEdge{
return (m_jointList);
}
public function SetXForm(_arg1:b2Vec2, _arg2:Number):Boolean{
var _local3:b2Shape;
var _local4:b2Mat22;
var _local5:b2Vec2;
var _local6:Boolean;
var _local7:Boolean;
if (m_world.m_lock == true){
return (true);
};
if (IsFrozen()){
return (false);
};
m_xf.R.Set(_arg2);
m_xf.position.SetV(_arg1);
_local4 = m_xf.R;
_local5 = m_sweep.localCenter;
m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y));
m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_sweep.a0 = (m_sweep.a = _arg2);
_local6 = false;
_local3 = m_shapeList;
while (_local3) {
_local7 = _local3.Synchronize(m_world.m_broadPhase, m_xf, m_xf);
if (_local7 == false){
_local6 = true;
break;
};
_local3 = _local3.m_next;
};
if (_local6 == true){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local3 = m_shapeList;
while (_local3) {
_local3.DestroyProxy(m_world.m_broadPhase);
_local3 = _local3.m_next;
};
return (false);
};
m_world.m_broadPhase.Commit();
return (true);
}
public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulXT(m_xf, _arg1));
}
public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_force.x = (m_force.x + _arg1.x);
m_force.y = (m_force.y + _arg1.y);
m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)));
}
public function SynchronizeShapes():Boolean{
var _local1:b2XForm;
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:b2Shape;
var _local5:Boolean;
_local1 = s_xf1;
_local1.R.Set(m_sweep.a0);
_local2 = _local1.R;
_local3 = m_sweep.localCenter;
_local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y)));
_local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y)));
_local5 = true;
_local4 = m_shapeList;
while (_local4) {
_local5 = _local4.Synchronize(m_world.m_broadPhase, _local1, m_xf);
if (_local5 == false){
break;
};
_local4 = _local4.m_next;
};
if (_local5 == false){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local4 = m_shapeList;
while (_local4) {
_local4.DestroyProxy(m_world.m_broadPhase);
_local4 = _local4.m_next;
};
return (false);
};
return (true);
}
public function GetAngle():Number{
return (m_sweep.a);
}
public function GetXForm():b2XForm{
return (m_xf);
}
public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x));
m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y));
m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))));
}
public function GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
public function SetAngularVelocity(_arg1:Number):void{
m_angularVelocity = _arg1;
}
public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_local3.x - m_sweep.c.x)))));
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function SetMass(_arg1:b2MassData):void{
var _local2:b2Shape;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
if (m_world.m_lock == true){
return;
};
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
m_sweep.localCenter.SetV(_arg1.center);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local2 = m_shapeList;
while (_local2) {
_local2.UpdateSweepRadius(m_sweep.localCenter);
_local2 = _local2.m_next;
};
_local5 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local5 != m_type){
_local2 = m_shapeList;
while (_local2) {
_local2.RefilterProxy(m_world.m_broadPhase, m_xf);
_local2 = _local2.m_next;
};
};
}
public function IsStatic():Boolean{
return ((m_type == e_staticType));
}
public function GetWorldVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulMV(m_xf.R, _arg1));
}
public function GetShapeList():b2Shape{
return (m_shapeList);
}
public function Advance(_arg1:Number):void{
m_sweep.Advance(_arg1);
m_sweep.c.SetV(m_sweep.c0);
m_sweep.a = m_sweep.a0;
SynchronizeTransform();
}
public function SetBullet(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_bulletFlag);
} else {
m_flags = (m_flags & ~(e_bulletFlag));
};
}
public function CreateShape(_arg1:b2ShapeDef):b2Shape{
var _local2:b2Shape;
if (m_world.m_lock == true){
return (null);
};
_local2 = b2Shape.Create(_arg1, m_world.m_blockAllocator);
_local2.m_next = m_shapeList;
m_shapeList = _local2;
m_shapeCount++;
_local2.m_body = this;
_local2.CreateProxy(m_world.m_broadPhase, m_xf);
_local2.UpdateSweepRadius(m_sweep.localCenter);
return (_local2);
}
public function IsConnected(_arg1:b2Body):Boolean{
var _local2:b2JointEdge;
_local2 = m_jointList;
while (_local2) {
if (_local2.other == _arg1){
return ((_local2.joint.m_collideConnected == false));
};
_local2 = _local2.next;
};
return (false);
}
public function DestroyShape(_arg1:b2Shape):void{
var _local2:b2Shape;
var _local3:Boolean;
if (m_world.m_lock == true){
return;
};
_arg1.DestroyProxy(m_world.m_broadPhase);
_local2 = m_shapeList;
_local3 = false;
while (_local2 != null) {
if (_local2 == _arg1){
_local2 = _arg1.m_next;
_local3 = true;
break;
};
_local2 = _local2.m_next;
};
_arg1.m_body = null;
_arg1.m_next = null;
m_shapeCount--;
b2Shape.Destroy(_arg1, m_world.m_blockAllocator);
}
public function IsAntiGravity():Boolean{
return (((m_flags & e_antiGravityFlag) == e_antiGravityFlag));
}
public function SetAntiGravity(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_antiGravityFlag);
} else {
m_flags = (m_flags & ~(e_antiGravityFlag));
};
}
public function GetUserData(){
return (m_userData);
}
public function IsBullet():Boolean{
return (((m_flags & e_bulletFlag) == e_bulletFlag));
}
public function GetWorldCenter():b2Vec2{
return (m_sweep.c);
}
public function AllowSleeping(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
WakeUp();
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetLocalVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_xf.R, _arg1));
}
public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (_local3);
}
public function GetWorld():b2World{
return (m_world);
}
public function GetPosition():b2Vec2{
return (m_xf.position);
}
}
}//package Box2D.Dynamics
Section 65
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class b2BodyDef {
public var isSleeping:Boolean;
public var position:b2Vec2;
public var isBullet:Boolean;
public var allowSleep:Boolean;
public var userData;
public var angularDamping:Number;
public var fixedRotation:Boolean;
public var angle:Number;
public var linearDamping:Number;
public var massData:b2MassData;
public function b2BodyDef(){
massData = new b2MassData();
position = new b2Vec2();
super();
massData.center.SetZero();
massData.mass = 0;
massData.I = 0;
userData = null;
position.Set(0, 0);
angle = 0;
linearDamping = 0;
angularDamping = 0;
allowSleep = true;
isSleeping = false;
fixedRotation = false;
isBullet = false;
}
}
}//package Box2D.Dynamics
Section 66
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener)
package Box2D.Dynamics {
public class b2BoundaryListener {
public function Violation(_arg1:b2Body):void{
}
}
}//package Box2D.Dynamics
Section 67
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
public class b2ContactFilter {
public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function RayCollide(_arg1, _arg2:b2Shape):Boolean{
if (!_arg1){
return (true);
};
return (ShouldCollide((_arg1 as b2Shape), _arg2));
}
public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{
var _local3:b2FilterData;
var _local4:b2FilterData;
var _local5:Boolean;
_local3 = _arg1.GetFilterData();
_local4 = _arg2.GetFilterData();
if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){
return ((_local3.groupIndex > 0));
};
_local5 = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0))));
return (_local5);
}
}
}//package Box2D.Dynamics
Section 68
//b2ContactListener (Box2D.Dynamics.b2ContactListener)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactListener {
public function Add(_arg1:b2ContactPoint):void{
}
public function Remove(_arg1:b2ContactPoint):void{
}
public function Persist(_arg1:b2ContactPoint):void{
}
public function Result(_arg1:b2ContactResult):void{
}
}
}//package Box2D.Dynamics
Section 69
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactManager extends b2PairCallback {
public var m_world:b2World;
public var m_destroyImmediate:Boolean;
public var m_nullContact:b2NullContact;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2ContactManager(){
m_nullContact = new b2NullContact();
super();
m_world = null;
m_destroyImmediate = false;
}
override public function PairAdded(_arg1, _arg2){
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2Contact;
_local3 = (_arg1 as b2Shape);
_local4 = (_arg2 as b2Shape);
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((_local5.IsStatic()) && (_local6.IsStatic()))){
return (m_nullContact);
};
if (_local3.m_body == _local4.m_body){
return (m_nullContact);
};
if (_local6.IsConnected(_local5)){
return (m_nullContact);
};
if (((!((m_world.m_contactFilter == null))) && ((m_world.m_contactFilter.ShouldCollide(_local3, _local4) == false)))){
return (m_nullContact);
};
_local7 = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator);
if (_local7 == null){
return (m_nullContact);
};
_local3 = _local7.m_shape1;
_local4 = _local7.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local7.m_prev = null;
_local7.m_next = m_world.m_contactList;
if (m_world.m_contactList != null){
m_world.m_contactList.m_prev = _local7;
};
m_world.m_contactList = _local7;
_local7.m_node1.contact = _local7;
_local7.m_node1.other = _local6;
_local7.m_node1.prev = null;
_local7.m_node1.next = _local5.m_contactList;
if (_local5.m_contactList != null){
_local5.m_contactList.prev = _local7.m_node1;
};
_local5.m_contactList = _local7.m_node1;
_local7.m_node2.contact = _local7;
_local7.m_node2.other = _local5;
_local7.m_node2.prev = null;
_local7.m_node2.next = _local6.m_contactList;
if (_local6.m_contactList != null){
_local6.m_contactList.prev = _local7.m_node2;
};
_local6.m_contactList = _local7.m_node2;
m_world.m_contactCount++;
return (_local7);
}
override public function PairRemoved(_arg1, _arg2, _arg3):void{
var _local4:b2Contact;
if (_arg3 == null){
return;
};
_local4 = (_arg3 as b2Contact);
if (_local4 == m_nullContact){
return;
};
Destroy(_local4);
}
public function Destroy(_arg1:b2Contact):void{
var _local2:b2Shape;
var _local3:b2Shape;
var _local4:int;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Array;
var _local10:b2ContactPoint;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2Vec2;
var _local16:b2Vec2;
_local2 = _arg1.m_shape1;
_local3 = _arg1.m_shape2;
_local4 = _arg1.m_manifoldCount;
if ((((_local4 > 0)) && (m_world.m_contactListener))){
_local7 = _local2.m_body;
_local8 = _local3.m_body;
_local9 = _arg1.GetManifolds();
_local10 = s_evalCP;
_local10.shape1 = _arg1.m_shape1;
_local10.shape2 = _arg1.m_shape1;
_local10.friction = _arg1.m_friction;
_local10.restitution = _arg1.m_restitution;
_local11 = 0;
while (_local11 < _local4) {
_local12 = _local9[_local11];
_local10.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local10.position = _local7.GetWorldPoint(_local14.localPoint1);
_local15 = _local7.GetLinearVelocityFromLocalPoint(_local14.localPoint1);
_local16 = _local8.GetLinearVelocityFromLocalPoint(_local14.localPoint2);
_local10.velocity.Set((_local16.x - _local15.x), (_local16.y - _local15.y));
_local10.separation = _local14.separation;
_local10.id.key = _local14.id._key;
m_world.m_contactListener.Remove(_local10);
_local13++;
};
_local11++;
};
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_world.m_contactList){
m_world.m_contactList = _arg1.m_next;
};
_local5 = _local2.m_body;
_local6 = _local3.m_body;
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local5.m_contactList){
_local5.m_contactList = _arg1.m_node1.next;
};
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local6.m_contactList){
_local6.m_contactList = _arg1.m_node2.next;
};
b2Contact.Destroy(_arg1, m_world.m_blockAllocator);
m_world.m_contactCount--;
}
public function Collide():void{
var _local1:b2Contact;
var _local2:b2Body;
var _local3:b2Body;
_local1 = m_world.m_contactList;
while (_local1) {
_local2 = _local1.m_shape1.m_body;
_local3 = _local1.m_shape2.m_body;
if (((_local2.IsSleeping()) && (_local3.IsSleeping()))){
} else {
_local1.Update(m_world.m_contactListener);
};
_local1 = _local1.m_next;
};
}
}
}//package Box2D.Dynamics
Section 70
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw)
package Box2D.Dynamics {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2DebugDraw {
public var m_xformScale:Number;// = 1
public var m_fillAlpha:Number;// = 1
public var m_alpha:Number;// = 1
public var m_lineThickness:Number;// = 1
public var m_drawFlags:uint;
public var m_sprite:Sprite;
public var m_drawScale:Number;// = 1
public static var e_coreShapeBit:uint = 4;
public static var e_shapeBit:uint = 1;
public static var e_centerOfMassBit:uint = 64;
public static var e_aabbBit:uint = 8;
public static var e_obbBit:uint = 16;
public static var e_pairBit:uint = 32;
public static var e_jointBit:uint = 2;
public function b2DebugDraw(){
m_drawScale = 1;
m_lineThickness = 1;
m_alpha = 1;
m_fillAlpha = 1;
m_xformScale = 1;
super();
m_drawFlags = 0;
}
public function DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
var _local4:int;
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.beginFill(_arg3.color, m_fillAlpha);
_local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.endFill();
}
public function DrawCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
}
public function DrawXForm(_arg1:b2XForm):void{
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col1.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col1.y)) * m_drawScale));
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col2.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col2.y)) * m_drawScale));
}
public function ClearFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags & ~(_arg1));
}
public function DrawSolidCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg4.color, m_alpha);
m_sprite.graphics.moveTo(0, 0);
m_sprite.graphics.beginFill(_arg4.color, m_fillAlpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
m_sprite.graphics.endFill();
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.x + (_arg3.x * _arg2)) * m_drawScale), ((_arg1.y + (_arg3.y * _arg2)) * m_drawScale));
}
public function SetFlags(_arg1:uint):void{
m_drawFlags = _arg1;
}
public function AppendFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags | _arg1);
}
public function DrawSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo((_arg2.x * m_drawScale), (_arg2.y * m_drawScale));
}
public function GetFlags():uint{
return (m_drawFlags);
}
public function DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
var _local4:int;
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
_local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
}
}
}//package Box2D.Dynamics
Section 71
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
public class b2DestructionListener {
public function SayGoodbyeJoint(_arg1:b2Joint):void{
}
public function SayGoodbyeShape(_arg1:b2Shape):void{
}
}
}//package Box2D.Dynamics
Section 72
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2Island {
public var m_joints:Array;
public var m_listener:b2ContactListener;
public var m_positionIterationCount:int;
public var m_bodyCapacity:int;
public var m_bodies:Array;
public var m_jointCapacity:int;
public var m_contactCount:int;
public var m_contacts:Array;
public var m_contactCapacity:int;
public var m_jointCount:int;
public var m_allocator;
public var m_bodyCount:int;
private static var s_reportCR:b2ContactResult = new b2ContactResult();
public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener){
var _local6:int;
super();
m_bodyCapacity = _arg1;
m_contactCapacity = _arg2;
m_jointCapacity = _arg3;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_allocator = _arg4;
m_listener = _arg5;
m_bodies = new Array(_arg1);
_local6 = 0;
while (_local6 < _arg1) {
m_bodies[_local6] = null;
_local6++;
};
m_contacts = new Array(_arg2);
_local6 = 0;
while (_local6 < _arg2) {
m_contacts[_local6] = null;
_local6++;
};
m_joints = new Array(_arg3);
_local6 = 0;
while (_local6 < _arg3) {
m_joints[_local6] = null;
_local6++;
};
m_positionIterationCount = 0;
}
public function AddBody(_arg1:b2Body):void{
var _local2 = m_bodyCount++;
m_bodies[_local2] = _arg1;
}
public function AddJoint(_arg1:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = _arg1;
}
public function Report(_arg1:Array):void{
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:int;
var _local5:b2Contact;
var _local6:b2ContactConstraint;
var _local7:b2ContactResult;
var _local8:b2Body;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2ContactConstraintPoint;
if (m_listener == null){
return;
};
_local4 = 0;
while (_local4 < m_contactCount) {
_local5 = m_contacts[_local4];
_local6 = _arg1[_local4];
_local7 = s_reportCR;
_local7.shape1 = _local5.m_shape1;
_local7.shape2 = _local5.m_shape2;
_local8 = _local7.shape1.m_body;
_local9 = _local5.m_manifoldCount;
_local10 = _local5.GetManifolds();
_local11 = 0;
while (_local11 < _local9) {
_local12 = _local10[_local11];
_local7.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local15 = _local6.points[_local13];
_local7.position = _local8.GetWorldPoint(_local14.localPoint1);
_local7.normalImpulse = _local15.normalImpulse;
_local7.tangentImpulse = _local15.tangentImpulse;
_local7.id.key = _local14.id.key;
m_listener.Result(_local7);
_local13++;
};
_local11++;
};
_local4++;
};
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{
var _local5:int;
var _local6:b2Body;
var _local7:b2Joint;
var _local8:b2ContactSolver;
var _local9:int;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
if (_local6.IsAntiGravity()){
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_local6.m_invMass * _local6.m_force.x)));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_local6.m_invMass * _local6.m_force.y)));
} else {
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x))));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y))));
};
_local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque));
_local6.m_force.SetZero();
_local6.m_torque = 0;
_local6.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1));
_local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1));
if (_local6.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){
_local6.m_linearVelocity.Normalize();
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity);
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity);
};
if ((_local6.m_angularVelocity * _local6.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){
if (_local6.m_angularVelocity < 0){
_local6.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity);
} else {
_local6.m_angularVelocity = b2Settings.b2_maxAngularVelocity;
};
};
};
_local5++;
};
_local8 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local8.InitVelocityConstraints(_arg1);
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitVelocityConstraints(_arg1);
_local5++;
};
_local5 = 0;
while (_local5 < _arg1.maxIterations) {
_local8.SolveVelocityConstraints();
_local9 = 0;
while (_local9 < m_jointCount) {
_local7 = m_joints[_local9];
_local7.SolveVelocityConstraints(_arg1);
_local9++;
};
_local5++;
};
_local8.FinalizeVelocityConstraints();
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_sweep.c0.SetV(_local6.m_sweep.c);
_local6.m_sweep.a0 = _local6.m_sweep.a;
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y));
_local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity));
_local6.SynchronizeTransform();
};
_local5++;
};
if (_arg3){
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitPositionConstraints();
_local5++;
};
m_positionIterationCount = 0;
while (m_positionIterationCount < _arg1.maxIterations) {
_local10 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local11 = true;
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local12 = _local7.SolvePositionConstraints();
_local11 = ((_local11) && (_local12));
_local5++;
};
if (((_local10) && (_local11))){
break;
};
m_positionIterationCount++;
};
};
Report(_local8.m_constraints);
if (_arg4){
_local13 = Number.MAX_VALUE;
_local14 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
_local15 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.m_invMass == 0){
} else {
if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){
_local6.m_sleepTime = 0;
_local13 = 0;
};
if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local15)))) || ((b2Math.b2Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local14)))){
_local6.m_sleepTime = 0;
_local13 = 0;
} else {
_local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt);
_local13 = b2Math.b2Min(_local13, _local6.m_sleepTime);
};
};
_local5++;
};
if (_local13 >= b2Settings.b2_timeToSleep){
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
m_bodies[_local5].m_flags = (_local6.m_flags | b2Body.e_sleepFlag);
_local6.m_linearVelocity.SetZero();
_local6.m_angularVelocity = 0;
_local5++;
};
};
};
}
public function AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:int;
var _local3:b2ContactSolver;
var _local4:Number;
var _local5:b2Body;
var _local6:Boolean;
_local3 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local3.SolveVelocityConstraints();
_local2++;
};
_local2 = 0;
while (_local2 < m_bodyCount) {
_local5 = m_bodies[_local2];
if (_local5.IsStatic()){
} else {
_local5.m_sweep.c0.SetV(_local5.m_sweep.c);
_local5.m_sweep.a0 = _local5.m_sweep.a;
_local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_arg1.dt * _local5.m_linearVelocity.x));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_arg1.dt * _local5.m_linearVelocity.y));
_local5.m_sweep.a = (_local5.m_sweep.a + (_arg1.dt * _local5.m_angularVelocity));
_local5.SynchronizeTransform();
};
_local2++;
};
_local4 = 0.75;
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local6 = _local3.SolvePositionConstraints(_local4);
if (_local6){
break;
};
_local2++;
};
Report(_local3.m_constraints);
}
}
}//package Box2D.Dynamics
Section 73
//b2TimeStep (Box2D.Dynamics.b2TimeStep)
package Box2D.Dynamics {
public class b2TimeStep {
public var warmStarting:Boolean;
public var positionCorrection:Boolean;
public var dt:Number;
public var maxIterations:int;
public var dtRatio:Number;
public var inv_dt:Number;
}
}//package Box2D.Dynamics
Section 74
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2World {
public var m_inv_dt0:Number;
public var m_boundaryListener:b2BoundaryListener;
public var m_contactList:b2Contact;
public var m_blockAllocator;
public var m_contactListener:b2ContactListener;
public var m_raycastSegment:b2Segment;
public var m_broadPhase:b2BroadPhase;
public var m_destructionListener:b2DestructionListener;
public var m_jointCount:int;
public var m_bodyCount:int;
public var m_lock:Boolean;
public var m_raycastUserData;
public var m_allowSleep:Boolean;
public var m_positionIterationCount:int;
public var m_groundBody:b2Body;
public var m_contactCount:int;
public var m_raycastNormal:b2Vec2;
public var m_contactFilter:b2ContactFilter;
public var m_bodyList:b2Body;
public var m_debugDraw:b2DebugDraw;
public var m_stackAllocator;
public var m_jointList:b2Joint;
public var m_gravity:b2Vec2;
public var m_contactManager:b2ContactManager;
private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8);
public static var m_continuousPhysics:Boolean;
public static var m_warmStarting:Boolean;
private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6);
public static var m_positionCorrection:Boolean;
private static var s_xf:b2XForm = new b2XForm();
public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){
var _local4:b2BodyDef;
m_raycastNormal = new b2Vec2();
m_contactManager = new b2ContactManager();
super();
m_destructionListener = null;
m_boundaryListener = null;
m_contactFilter = b2ContactFilter.b2_defaultFilter;
m_contactListener = null;
m_debugDraw = null;
m_bodyList = null;
m_contactList = null;
m_jointList = null;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_positionCorrection = true;
m_warmStarting = true;
m_continuousPhysics = true;
m_allowSleep = _arg3;
m_gravity = _arg2;
m_lock = false;
m_inv_dt0 = 0;
m_contactManager.m_world = this;
m_broadPhase = new b2BroadPhase(_arg1, m_contactManager);
_local4 = new b2BodyDef();
m_groundBody = CreateBody(_local4);
}
public function DrawJoint(_arg1:b2Joint):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2XForm;
var _local5:b2XForm;
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Color;
var _local11:b2PulleyJoint;
var _local12:b2Vec2;
var _local13:b2Vec2;
_local2 = _arg1.m_body1;
_local3 = _arg1.m_body2;
_local4 = _local2.m_xf;
_local5 = _local3.m_xf;
_local6 = _local4.position;
_local7 = _local5.position;
_local8 = _arg1.GetAnchor1();
_local9 = _arg1.GetAnchor2();
_local10 = s_jointColor;
switch (_arg1.m_type){
case b2Joint.e_distanceJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
case b2Joint.e_pulleyJoint:
_local11 = (_arg1 as b2PulleyJoint);
_local12 = _local11.GetGroundAnchor1();
_local13 = _local11.GetGroundAnchor2();
m_debugDraw.DrawSegment(_local12, _local8, _local10);
m_debugDraw.DrawSegment(_local13, _local9, _local10);
m_debugDraw.DrawSegment(_local12, _local13, _local10);
break;
case b2Joint.e_mouseJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
default:
if (_local2 != m_groundBody){
m_debugDraw.DrawSegment(_local6, _local8, _local10);
};
m_debugDraw.DrawSegment(_local8, _local9, _local10);
if (_local3 != m_groundBody){
m_debugDraw.DrawSegment(_local7, _local9, _local10);
};
};
}
public function Refilter(_arg1:b2Shape):void{
_arg1.RefilterProxy(m_broadPhase, _arg1.m_body.m_xf);
}
public function SetDebugDraw(_arg1:b2DebugDraw):void{
m_debugDraw = _arg1;
}
public function SetContinuousPhysics(_arg1:Boolean):void{
m_continuousPhysics = _arg1;
}
public function GetProxyCount():int{
return (m_broadPhase.m_proxyCount);
}
public function DrawDebugData():void{
var _local1:uint;
var _local2:int;
var _local3:b2Body;
var _local4:b2Shape;
var _local5:b2Joint;
var _local6:b2BroadPhase;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Color;
var _local11:b2XForm;
var _local12:b2AABB;
var _local13:b2AABB;
var _local14:Array;
var _local15:Boolean;
var _local16:uint;
var _local17:b2Pair;
var _local18:b2Proxy;
var _local19:b2Proxy;
var _local20:b2Vec2;
var _local21:b2Vec2;
var _local22:b2Proxy;
var _local23:b2PolygonShape;
var _local24:b2OBB;
var _local25:b2Vec2;
var _local26:b2Mat22;
var _local27:b2Vec2;
var _local28:Number;
if (m_debugDraw == null){
return;
};
m_debugDraw.m_sprite.graphics.clear();
_local1 = m_debugDraw.GetFlags();
_local7 = new b2Vec2();
_local8 = new b2Vec2();
_local9 = new b2Vec2();
_local10 = new b2Color(0, 0, 0);
_local12 = new b2AABB();
_local13 = new b2AABB();
_local14 = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];
if ((_local1 & b2DebugDraw.e_shapeBit)){
_local15 = ((_local1 & b2DebugDraw.e_coreShapeBit) == b2DebugDraw.e_coreShapeBit);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local3.IsStatic()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.9, 0.5), _local15);
} else {
if (_local3.IsSleeping()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.5, 0.9), _local15);
} else {
DrawShape(_local4, _local11, new b2Color(0.9, 0.9, 0.9), _local15);
};
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_jointBit)){
_local5 = m_jointList;
while (_local5) {
DrawJoint(_local5);
_local5 = _local5.m_next;
};
};
if ((_local1 & b2DebugDraw.e_pairBit)){
_local6 = m_broadPhase;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.9, 0.3);
_local2 = 0;
while (_local2 < b2Pair.b2_tableCapacity) {
_local16 = _local6.m_pairManager.m_hashTable[_local2];
while (_local16 != b2Pair.b2_nullPair) {
_local17 = _local6.m_pairManager.m_pairs[_local16];
_local18 = _local6.m_proxyPool[_local17.proxyId1];
_local19 = _local6.m_proxyPool[_local17.proxyId2];
_local12.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.lowerBounds[0]].value));
_local12.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.lowerBounds[1]].value));
_local12.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.upperBounds[0]].value));
_local12.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.upperBounds[1]].value));
_local13.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.lowerBounds[0]].value));
_local13.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.lowerBounds[1]].value));
_local13.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.upperBounds[0]].value));
_local13.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.upperBounds[1]].value));
_local8.x = (0.5 * (_local12.lowerBound.x + _local12.upperBound.x));
_local8.y = (0.5 * (_local12.lowerBound.y + _local12.upperBound.y));
_local9.x = (0.5 * (_local13.lowerBound.x + _local13.upperBound.x));
_local9.y = (0.5 * (_local13.lowerBound.y + _local13.upperBound.y));
m_debugDraw.DrawSegment(_local8, _local9, _local10);
_local16 = _local17.next;
};
_local2++;
};
};
if ((_local1 & b2DebugDraw.e_aabbBit)){
_local6 = m_broadPhase;
_local20 = _local6.m_worldAABB.lowerBound;
_local21 = _local6.m_worldAABB.upperBound;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.3, 0.9);
_local2 = 0;
while (_local2 < b2Settings.b2_maxProxies) {
_local22 = _local6.m_proxyPool[_local2];
if (_local22.IsValid() == false){
} else {
_local12.lowerBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.lowerBounds[0]].value));
_local12.lowerBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.lowerBounds[1]].value));
_local12.upperBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.upperBounds[0]].value));
_local12.upperBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.upperBounds[1]].value));
_local14[0].Set(_local12.lowerBound.x, _local12.lowerBound.y);
_local14[1].Set(_local12.upperBound.x, _local12.lowerBound.y);
_local14[2].Set(_local12.upperBound.x, _local12.upperBound.y);
_local14[3].Set(_local12.lowerBound.x, _local12.upperBound.y);
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local2++;
};
_local14[0].Set(_local20.x, _local20.y);
_local14[1].Set(_local21.x, _local20.y);
_local14[2].Set(_local21.x, _local21.y);
_local14[3].Set(_local20.x, _local21.y);
m_debugDraw.DrawPolygon(_local14, 4, new b2Color(0.3, 0.9, 0.9));
};
if ((_local1 & b2DebugDraw.e_obbBit)){
_local10.Set(0.5, 0.3, 0.5);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local4.m_type != b2Shape.e_polygonShape){
} else {
_local23 = (_local4 as b2PolygonShape);
_local24 = _local23.GetOBB();
_local25 = _local24.extents;
_local14[0].Set(-(_local25.x), -(_local25.y));
_local14[1].Set(_local25.x, -(_local25.y));
_local14[2].Set(_local25.x, _local25.y);
_local14[3].Set(-(_local25.x), _local25.y);
_local2 = 0;
while (_local2 < 4) {
_local26 = _local24.R;
_local27 = _local14[_local2];
_local28 = (_local24.center.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local24.center.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local26 = _local11.R;
_local28 = (_local11.position.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local11.position.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local2++;
};
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_centerOfMassBit)){
_local3 = m_bodyList;
while (_local3) {
_local11 = s_xf;
_local11.R = _local3.m_xf.R;
_local11.position = _local3.GetWorldCenter();
m_debugDraw.DrawXForm(_local11);
_local3 = _local3.m_next;
};
};
}
public function DestroyBody(_arg1:b2Body):void{
var _local2:b2JointEdge;
var _local3:b2Shape;
var _local4:b2JointEdge;
var _local5:b2Shape;
if (m_lock == true){
return;
};
_local2 = _arg1.m_jointList;
while (_local2) {
_local4 = _local2;
_local2 = _local2.next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeJoint(_local4.joint);
};
DestroyJoint(_local4.joint);
};
_local3 = _arg1.m_shapeList;
while (_local3) {
_local5 = _local3;
_local3 = _local3.m_next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeShape(_local5);
};
_local5.DestroyProxy(m_broadPhase);
b2Shape.Destroy(_local5, m_blockAllocator);
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_bodyList){
m_bodyList = _arg1.m_next;
};
m_bodyCount--;
}
public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{
var _local5:b2Color;
var _local6:b2CircleShape;
var _local7:b2Vec2;
var _local8:Number;
var _local9:b2Vec2;
var _local10:int;
var _local11:b2PolygonShape;
var _local12:int;
var _local13:Array;
var _local14:Array;
var _local15:Array;
_local5 = s_coreColor;
switch (_arg1.m_type){
case b2Shape.e_circleShape:
_local6 = (_arg1 as b2CircleShape);
_local7 = b2Math.b2MulX(_arg2, _local6.m_localPosition);
_local8 = _local6.m_radius;
_local9 = _arg2.R.col1;
m_debugDraw.DrawSolidCircle(_local7, _local8, _local9, _arg3);
if (_arg4){
m_debugDraw.DrawCircle(_local7, (_local8 - b2Settings.b2_toiSlop), _local5);
};
break;
case b2Shape.e_polygonShape:
_local11 = (_arg1 as b2PolygonShape);
_local12 = _local11.GetVertexCount();
_local13 = _local11.GetVertices();
_local14 = new Array(b2Settings.b2_maxPolygonVertices);
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local13[_local10]);
_local10++;
};
m_debugDraw.DrawSolidPolygon(_local14, _local12, _arg3);
if (_arg4){
_local15 = _local11.GetCoreVertices();
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local15[_local10]);
_local10++;
};
m_debugDraw.DrawPolygon(_local14, _local12, _local5);
};
break;
};
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function SetContactFilter(_arg1:b2ContactFilter):void{
m_contactFilter = _arg1;
}
public function Solve(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Island;
var _local4:b2Contact;
var _local5:b2Joint;
var _local6:int;
var _local7:Array;
var _local8:b2Body;
var _local9:int;
var _local10:int;
var _local11:b2Body;
var _local12:b2ContactEdge;
var _local13:b2JointEdge;
var _local14:Boolean;
m_positionIterationCount = 0;
_local3 = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator, m_contactListener);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2 = _local2.m_next;
};
_local4 = m_contactList;
while (_local4) {
_local4.m_flags = (_local4.m_flags & ~(b2Contact.e_islandFlag));
_local4 = _local4.m_next;
};
_local5 = m_jointList;
while (_local5) {
_local5.m_islandFlag = false;
_local5 = _local5.m_next;
};
_local6 = m_bodyCount;
_local7 = new Array(_local6);
_local8 = m_bodyList;
while (_local8) {
if ((_local8.m_flags & ((b2Body.e_islandFlag | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){
} else {
if (_local8.IsStatic()){
} else {
_local3.Clear();
_local9 = 0;
var _temp1 = _local9;
_local9 = (_local9 + 1);
var _local15 = _temp1;
_local7[_local15] = _local8;
_local8.m_flags = (_local8.m_flags | b2Body.e_islandFlag);
while (_local9 > 0) {
--_local9;
_local2 = _local7[_local9];
_local3.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local12 = _local2.m_contactList;
while (_local12) {
if ((_local12.contact.m_flags & (b2Contact.e_islandFlag | b2Contact.e_nonSolidFlag))){
} else {
if (_local12.contact.m_manifoldCount == 0){
} else {
_local3.AddContact(_local12.contact);
_local12.contact.m_flags = (_local12.contact.m_flags | b2Contact.e_islandFlag);
_local11 = _local12.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp2 = _local9;
_local9 = (_local9 + 1);
var _local16 = _temp2;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
};
_local12 = _local12.next;
};
_local13 = _local2.m_jointList;
while (_local13) {
if (_local13.joint.m_islandFlag == true){
} else {
_local3.AddJoint(_local13.joint);
_local13.joint.m_islandFlag = true;
_local11 = _local13.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp3 = _local9;
_local9 = (_local9 + 1);
_local16 = _temp3;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
_local13 = _local13.next;
};
};
};
_local3.Solve(_arg1, m_gravity, m_positionCorrection, m_allowSleep);
if (_local3.m_positionIterationCount > m_positionIterationCount){
m_positionIterationCount = _local3.m_positionIterationCount;
};
_local10 = 0;
while (_local10 < _local3.m_bodyCount) {
_local2 = _local3.m_bodies[_local10];
if (_local2.IsStatic()){
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
};
_local10++;
};
};
};
_local8 = _local8.m_next;
};
_local2 = m_bodyList;
while (_local2) {
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local14 = _local2.SynchronizeShapes();
if ((((_local14 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
};
};
_local2 = _local2.m_next;
};
m_broadPhase.Commit();
}
public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{
var _local4:Array;
var _local5:int;
var _local6:int;
_local4 = new Array(_arg3);
_local5 = m_broadPhase.QueryAABB(_arg1, _local4, _arg3);
_local6 = 0;
while (_local6 < _local5) {
_arg2[_local6] = _local4[_local6];
_local6++;
};
return (_local5);
}
public function GetContactCount():int{
return (m_contactCount);
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactEdge;
var _local8:b2Island;
var _local9:int;
var _local10:Array;
var _local11:b2Contact;
var _local12:b2Contact;
var _local13:Number;
var _local14:b2Body;
var _local15:int;
var _local16:b2TimeStep;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:b2Body;
var _local21:Boolean;
_local8 = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener);
_local9 = m_bodyCount;
_local10 = new Array(_local9);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2.m_sweep.t0 = 0;
_local2 = _local2.m_next;
};
_local11 = m_contactList;
while (_local11) {
_local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local11 = _local11.m_next;
};
while (true) {
_local12 = null;
_local13 = 1;
_local11 = m_contactList;
for (;_local11;(_local11 = _local11.m_next)) {
if ((_local11.m_flags & (b2Contact.e_slowFlag | b2Contact.e_nonSolidFlag))){
} else {
_local18 = 1;
if ((_local11.m_flags & b2Contact.e_toiFlag)){
_local18 = _local11.m_toi;
} else {
_local3 = _local11.m_shape1;
_local4 = _local11.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((((_local5.IsStatic()) || (_local5.IsSleeping()))) && (((_local6.IsStatic()) || (_local6.IsSleeping()))))){
continue;
};
_local19 = _local5.m_sweep.t0;
if (_local5.m_sweep.t0 < _local6.m_sweep.t0){
_local19 = _local6.m_sweep.t0;
_local5.m_sweep.Advance(_local19);
} else {
if (_local6.m_sweep.t0 < _local5.m_sweep.t0){
_local19 = _local5.m_sweep.t0;
_local6.m_sweep.Advance(_local19);
};
};
_local18 = b2TimeOfImpact.TimeOfImpact(_local11.m_shape1, _local5.m_sweep, _local11.m_shape2, _local6.m_sweep);
if ((((_local18 > 0)) && ((_local18 < 1)))){
_local18 = (((1 - _local18) * _local19) + _local18);
if (_local18 > 1){
_local18 = 1;
};
};
_local11.m_toi = _local18;
_local11.m_flags = (_local11.m_flags | b2Contact.e_toiFlag);
};
if ((((Number.MIN_VALUE < _local18)) && ((_local18 < _local13)))){
_local12 = _local11;
_local13 = _local18;
};
};
};
if ((((_local12 == null)) || (((1 - (100 * Number.MIN_VALUE)) < _local13)))){
break;
};
_local3 = _local12.m_shape1;
_local4 = _local12.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local5.Advance(_local13);
_local6.Advance(_local13);
_local12.Update(m_contactListener);
_local12.m_flags = (_local12.m_flags & ~(b2Contact.e_toiFlag));
if (_local12.m_manifoldCount == 0){
} else {
_local14 = _local5;
if (_local14.IsStatic()){
_local14 = _local6;
};
_local8.Clear();
_local15 = 0;
var _temp1 = _local15;
_local15 = (_local15 + 1);
var _local22 = _temp1;
_local10[_local22] = _local14;
_local14.m_flags = (_local14.m_flags | b2Body.e_islandFlag);
while (_local15 > 0) {
--_local15;
_local2 = _local10[_local15];
_local8.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local7 = _local2.m_contactList;
while (_local7) {
if (_local8.m_contactCount == _local8.m_contactCapacity){
} else {
if ((_local7.contact.m_flags & ((b2Contact.e_islandFlag | b2Contact.e_slowFlag) | b2Contact.e_nonSolidFlag))){
} else {
if (_local7.contact.m_manifoldCount == 0){
} else {
_local8.AddContact(_local7.contact);
_local7.contact.m_flags = (_local7.contact.m_flags | b2Contact.e_islandFlag);
_local20 = _local7.other;
if ((_local20.m_flags & b2Body.e_islandFlag)){
} else {
if (_local20.IsStatic() == false){
_local20.Advance(_local13);
_local20.WakeUp();
};
var _temp2 = _local15;
_local15 = (_local15 + 1);
var _local23 = _temp2;
_local10[_local23] = _local20;
_local20.m_flags = (_local20.m_flags | b2Body.e_islandFlag);
};
};
};
};
_local7 = _local7.next;
};
};
};
_local16 = new b2TimeStep();
_local16.dt = ((1 - _local13) * _arg1.dt);
_local16.inv_dt = (1 / _local16.dt);
_local16.maxIterations = _arg1.maxIterations;
_local8.SolveTOI(_local16);
_local17 = 0;
while (_local17 < _local8.m_bodyCount) {
_local2 = _local8.m_bodies[_local17];
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local21 = _local2.SynchronizeShapes();
if ((((_local21 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
_local7 = _local2.m_contactList;
while (_local7) {
_local7.contact.m_flags = (_local7.contact.m_flags & ~(b2Contact.e_toiFlag));
_local7 = _local7.next;
};
};
};
_local17++;
};
_local17 = 0;
while (_local17 < _local8.m_contactCount) {
_local11 = _local8.m_contacts[_local17];
_local8.m_contacts[_local17].m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local17++;
};
m_broadPhase.Commit();
};
};
}
public function GetJointList():b2Joint{
return (m_jointList);
}
public function SetGravity(_arg1:b2Vec2):void{
m_gravity = _arg1;
}
public function Validate():void{
m_broadPhase.Validate();
}
public function GetPairCount():int{
return (m_broadPhase.m_pairManager.m_pairCount);
}
public function GetBodyList():b2Body{
return (m_bodyList);
}
public function SetWarmStarting(_arg1:Boolean):void{
m_warmStarting = _arg1;
}
public function SetPositionCorrection(_arg1:Boolean):void{
m_positionCorrection = _arg1;
}
public function CreateJoint(_arg1:b2JointDef):b2Joint{
var _local2:b2Joint;
var _local3:b2Body;
var _local4:b2Shape;
_local2 = b2Joint.Create(_arg1, m_blockAllocator);
_local2.m_prev = null;
_local2.m_next = m_jointList;
if (m_jointList){
m_jointList.m_prev = _local2;
};
m_jointList = _local2;
m_jointCount++;
_local2.m_node1.joint = _local2;
_local2.m_node1.other = _local2.m_body2;
_local2.m_node1.prev = null;
_local2.m_node1.next = _local2.m_body1.m_jointList;
if (_local2.m_body1.m_jointList){
_local2.m_body1.m_jointList.prev = _local2.m_node1;
};
_local2.m_body1.m_jointList = _local2.m_node1;
_local2.m_node2.joint = _local2;
_local2.m_node2.other = _local2.m_body1;
_local2.m_node2.prev = null;
_local2.m_node2.next = _local2.m_body2.m_jointList;
if (_local2.m_body2.m_jointList){
_local2.m_body2.m_jointList.prev = _local2.m_node2;
};
_local2.m_body2.m_jointList = _local2.m_node2;
if (_arg1.collideConnected == false){
_local3 = ((_arg1.body1.m_shapeCount < _arg1.body2.m_shapeCount)) ? _arg1.body1 : _arg1.body2;
_local4 = _local3.m_shapeList;
while (_local4) {
_local4.RefilterProxy(m_broadPhase, _local3.m_xf);
_local4 = _local4.m_next;
};
};
return (_local2);
}
public function DestroyJoint(_arg1:b2Joint):void{
var _local2:Boolean;
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Body;
var _local6:b2Shape;
_local2 = _arg1.m_collideConnected;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_jointList){
m_jointList = _arg1.m_next;
};
_local3 = _arg1.m_body1;
_local4 = _arg1.m_body2;
_local3.WakeUp();
_local4.WakeUp();
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local3.m_jointList){
_local3.m_jointList = _arg1.m_node1.next;
};
_arg1.m_node1.prev = null;
_arg1.m_node1.next = null;
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local4.m_jointList){
_local4.m_jointList = _arg1.m_node2.next;
};
_arg1.m_node2.prev = null;
_arg1.m_node2.next = null;
b2Joint.Destroy(_arg1, m_blockAllocator);
m_jointCount--;
if (_local2 == false){
_local5 = ((_local3.m_shapeCount < _local4.m_shapeCount)) ? _local3 : _local4;
_local6 = _local5.m_shapeList;
while (_local6) {
_local6.RefilterProxy(m_broadPhase, _local5.m_xf);
_local6 = _local6.m_next;
};
};
}
public function SetContactListener(_arg1:b2ContactListener):void{
m_contactListener = _arg1;
}
public function Raycast(_arg1:b2Segment, _arg2:Array, _arg3:int, _arg4:Boolean, _arg5):int{
var _local6:Array;
var _local7:int;
var _local8:int;
_local6 = new Array(_arg3);
m_raycastSegment = _arg1;
m_raycastUserData = _arg5;
if (_arg4){
_local7 = m_broadPhase.QuerySegment(_arg1, _local6, _arg3, RaycastSortKey);
} else {
_local7 = m_broadPhase.QuerySegment(_arg1, _local6, _arg3, RaycastSortKey2);
};
_local8 = 0;
while (_local8 < _local7) {
_arg2[_local8] = _local6[_local8];
_local8++;
};
return (_local7);
}
public function RaycastSortKey2(_arg1:b2Shape){
var _local2:b2Body;
var _local3:b2XForm;
var _local4:Array;
if (((m_contactFilter) && (!(m_contactFilter.RayCollide(m_raycastUserData, _arg1))))){
return (-1);
};
_local2 = _arg1.GetBody();
_local3 = _local2.GetXForm();
_local4 = [0];
if (_arg1.TestSegment(_local3, _local4, m_raycastNormal, m_raycastSegment, 1) != b2Shape.e_hitCollide){
return (-1);
};
return (_local4[0]);
}
public function RaycastOne(_arg1:b2Segment, _arg2:Array, _arg3:b2Vec2, _arg4:Boolean, _arg5):b2Shape{
var _local6:Array;
var _local7:Number;
var _local8:b2Shape;
var _local9:b2XForm;
_local6 = new Array(1);
_local7 = Raycast(_arg1, _local6, 1, _arg4, _arg5);
if (_local7 == 0){
return (null);
};
if (_local7 > 1){
trace(_local7);
};
_local8 = _local6[0];
_local9 = _local8.GetBody().GetXForm();
_local8.TestSegment(_local9, _arg2, _arg3, _arg1, 1);
return (_local8);
}
public function CreateBody(_arg1:b2BodyDef):b2Body{
var _local2:b2Body;
if (m_lock == true){
return (null);
};
_local2 = new b2Body(_arg1, this);
_local2.m_prev = null;
_local2.m_next = m_bodyList;
if (m_bodyList){
m_bodyList.m_prev = _local2;
};
m_bodyList = _local2;
m_bodyCount++;
return (_local2);
}
public function RaycastSortKey(_arg1:b2Shape){
var _local2:b2Body;
var _local3:b2XForm;
var _local4:Array;
if (((m_contactFilter) && (!(m_contactFilter.RayCollide(m_raycastUserData, _arg1))))){
return (-1);
};
_local2 = _arg1.GetBody();
_local3 = _local2.GetXForm();
_local4 = [0];
if (_arg1.TestSegment(_local3, _local4, m_raycastNormal, m_raycastSegment, 1) == b2Shape.e_missCollide){
return (-1);
};
return (_local4[0]);
}
public function SetBoundaryListener(_arg1:b2BoundaryListener):void{
m_boundaryListener = _arg1;
}
public function SetDestructionListener(_arg1:b2DestructionListener):void{
m_destructionListener = _arg1;
}
public function Step(_arg1:Number, _arg2:int):void{
var _local3:b2TimeStep;
m_lock = true;
_local3 = new b2TimeStep();
_local3.dt = _arg1;
_local3.maxIterations = _arg2;
if (_arg1 > 0){
_local3.inv_dt = (1 / _arg1);
} else {
_local3.inv_dt = 0;
};
_local3.dtRatio = (m_inv_dt0 * _arg1);
_local3.positionCorrection = m_positionCorrection;
_local3.warmStarting = m_warmStarting;
m_contactManager.Collide();
if (_local3.dt > 0){
Solve(_local3);
};
if (((m_continuousPhysics) && ((_local3.dt > 0)))){
SolveTOI(_local3);
};
DrawDebugData();
m_inv_dt0 = _local3.inv_dt;
m_lock = false;
}
public function GetBodyCount():int{
return (m_bodyCount);
}
public function GetJointCount():int{
return (m_jointCount);
}
}
}//package Box2D.Dynamics
Section 75
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class AdLoader {
private static var cpmstarLoader:Loader;
public static function LoadAd(_arg1:int, _arg2:int):DisplayObject{
var _local3:String;
Security.allowDomain("server.cpmstar.com");
_local3 = "http://server.cpmstar.com/adviewas3.swf";
cpmstarLoader = new Loader();
cpmstarLoader.load(new URLRequest(((((_local3 + "?poolid=") + _arg1) + "&subpoolid=") + _arg2)));
return (cpmstarLoader);
}
}
}//package CPMStar
Section 76
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.events.*;
import flash.utils.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 77
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 78
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 79
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 80
//ScrollBar (fl.controls.ScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import fl.events.*;
public class ScrollBar extends UIComponent {
private var _direction:String;// = "vertical"
protected var inDrag:Boolean;// = false
protected var upArrow:BaseButton;
private var _pageScrollSize:Number;// = 0
protected var downArrow:BaseButton;
private var _pageSize:Number;// = 10
private var thumbScrollOffset:Number;
private var _maxScrollPosition:Number;// = 0
private var _scrollPosition:Number;// = 0
protected var track:BaseButton;
private var _minScrollPosition:Number;// = 0
private var _lineScrollSize:Number;// = 1
protected var thumb:LabelButton;
protected static const THUMB_STYLES:Object = {disabledSkin:"thumbDisabledSkin", downSkin:"thumbDownSkin", overSkin:"thumbOverSkin", upSkin:"thumbUpSkin", icon:"thumbIcon", textPadding:0};
public static const WIDTH:Number = 15;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TRACK_STYLES:Object = {disabledSkin:"trackDisabledSkin", downSkin:"trackDownSkin", overSkin:"trackOverSkin", upSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", downArrowDownSkin:"ScrollArrowDown_downSkin", downArrowOverSkin:"ScrollArrowDown_overSkin", downArrowUpSkin:"ScrollArrowDown_upSkin", thumbDisabledSkin:"ScrollThumb_upSkin", thumbDownSkin:"ScrollThumb_downSkin", thumbOverSkin:"ScrollThumb_overSkin", thumbUpSkin:"ScrollThumb_upSkin", trackDisabledSkin:"ScrollTrack_skin", trackDownSkin:"ScrollTrack_skin", trackOverSkin:"ScrollTrack_skin", trackUpSkin:"ScrollTrack_skin", upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", upArrowDownSkin:"ScrollArrowUp_downSkin", upArrowOverSkin:"ScrollArrowUp_overSkin", upArrowUpSkin:"ScrollArrowUp_upSkin", thumbIcon:"ScrollBar_thumbIcon", repeatDelay:500, repeatInterval:35};
public function ScrollBar(){
_pageSize = 10;
_pageScrollSize = 0;
_lineScrollSize = 1;
_minScrollPosition = 0;
_maxScrollPosition = 0;
_scrollPosition = 0;
_direction = ScrollBarDirection.VERTICAL;
inDrag = false;
super();
setStyles();
focusEnabled = false;
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
public function set minScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _arg1, _maxScrollPosition);
}
public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
var _local3:Number;
_local3 = scrollPosition;
_scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, _arg1));
if (_local3 == _scrollPosition){
return;
};
if (_arg2){
dispatchEvent(new ScrollEvent(_direction, (scrollPosition - _local3), scrollPosition));
};
updateThumb();
}
public function set scrollPosition(_arg1:Number):void{
setScrollPosition(_arg1, true);
}
public function get pageScrollSize():Number{
return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize);
}
public function set pageSize(_arg1:Number):void{
if (_arg1 > 0){
_pageSize = _arg1;
};
}
public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
this.pageSize = _arg1;
_minScrollPosition = _arg2;
_maxScrollPosition = _arg3;
if (_arg4 >= 0){
_pageScrollSize = _arg4;
};
enabled = (_maxScrollPosition > _minScrollPosition);
setScrollPosition(_scrollPosition, false);
updateThumb();
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition))))));
updateThumb();
}
protected function updateThumb():void{
var _local1:Number;
_local1 = ((_maxScrollPosition - _minScrollPosition) + _pageSize);
if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((_local1 == 0)) || (isNaN(_local1)))))){
thumb.height = 12;
thumb.visible = false;
} else {
thumb.height = Math.max(13, ((_pageSize / _local1) * track.height));
thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition))));
thumb.visible = enabled;
};
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
inDrag = true;
thumbScrollOffset = (mouseY - thumb.y);
thumb.mouseStateLocked = true;
mouseChildren = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
inDrag = false;
mouseChildren = true;
thumb.mouseStateLocked = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
}
public function set pageScrollSize(_arg1:Number):void{
if (_arg1 >= 0){
_pageScrollSize = _arg1;
};
}
protected function handleThumbDrag(_arg1:MouseEvent):void{
var _local2:Number;
_local2 = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset)));
setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition));
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
if (_direction == _arg1){
return;
};
_direction = _arg1;
if (isLivePreview){
return;
};
setScaleY(1);
_local2 = (_direction == ScrollBarDirection.HORIZONTAL);
if (((_local2) && (componentInspectorSetting))){
if (rotation == 90){
return;
};
setScaleX(-1);
rotation = -90;
};
if (!componentInspectorSetting){
if (((_local2) && ((rotation == 0)))){
rotation = -90;
setScaleX(-1);
} else {
if (((!(_local2)) && ((rotation == -90)))){
rotation = 0;
setScaleX(1);
};
};
};
invalidate(InvalidationType.SIZE);
}
public function set lineScrollSize(_arg1:Number):void{
if (_arg1 > 0){
_lineScrollSize = _arg1;
};
}
override public function get height():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height);
}
protected function scrollPressHandler(_arg1:ComponentEvent):void{
var _local2:Number;
var _local3:Number;
_arg1.stopImmediatePropagation();
if (_arg1.currentTarget == upArrow){
setScrollPosition((_scrollPosition - _lineScrollSize));
} else {
if (_arg1.currentTarget == downArrow){
setScrollPosition((_scrollPosition + _lineScrollSize));
} else {
_local2 = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition);
_local3 = ((pageScrollSize)==0) ? pageSize : pageScrollSize;
if (_scrollPosition < _local2){
setScrollPosition(Math.min(_local2, (_scrollPosition + _local3)));
} else {
if (_scrollPosition > _local2){
setScrollPosition(Math.max(_local2, (_scrollPosition - _local3)));
};
};
};
};
}
public function get pageSize():Number{
return (_pageSize);
}
public function set maxScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _minScrollPosition, _arg1);
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
var _local1:Number;
if (isInvalid(InvalidationType.SIZE)){
_local1 = super.height;
downArrow.move(0, Math.max(upArrow.height, (_local1 - downArrow.height)));
track.setSize(WIDTH, Math.max(0, (_local1 - (downArrow.height + upArrow.height))));
updateThumb();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
};
downArrow.drawNow();
upArrow.drawNow();
track.drawNow();
thumb.drawNow();
validate();
}
override protected function configUI():void{
super.configUI();
track = new BaseButton();
track.move(0, 14);
track.useHandCursor = false;
track.autoRepeat = true;
track.focusEnabled = false;
addChild(track);
thumb = new LabelButton();
thumb.label = "";
thumb.setSize(WIDTH, 15);
thumb.move(0, 15);
thumb.focusEnabled = false;
addChild(thumb);
downArrow = new BaseButton();
downArrow.setSize(WIDTH, 14);
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
addChild(downArrow);
upArrow = new BaseButton();
upArrow.setSize(WIDTH, 14);
upArrow.move(0, 0);
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
addChild(upArrow);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
enabled = false;
}
public function get direction():String{
return (_direction);
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if (_direction == ScrollBarDirection.HORIZONTAL){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
override public function get width():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width);
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 81
//ScrollBarDirection (fl.controls.ScrollBarDirection)
package fl.controls {
public class ScrollBarDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
}
}//package fl.controls
Section 82
//UIScrollBar (fl.controls.UIScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import fl.events.*;
import flash.text.*;
public class UIScrollBar extends ScrollBar {
protected var inScroll:Boolean;// = false
protected var _scrollTarget:TextField;
protected var inEdit:Boolean;// = false
private static var defaultStyles:Object = {};
public function UIScrollBar(){
inEdit = false;
inScroll = false;
super();
}
protected function handleTargetScroll(_arg1:Event):void{
if (inDrag){
return;
};
if (!enabled){
return;
};
inEdit = true;
updateScrollTargetProperties();
scrollPosition = ((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV;
inEdit = false;
}
override public function set minScrollPosition(_arg1:Number):void{
super.minScrollPosition = ((_arg1)<0) ? 0 : _arg1;
}
override public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
super.setScrollPosition(_arg1, _arg2);
if (!_scrollTarget){
inScroll = false;
return;
};
updateTargetScroll();
}
override public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
var _local5:Number;
var _local6:Number;
_local5 = _arg3;
_local6 = ((_arg2)<0) ? 0 : _arg2;
if (_scrollTarget != null){
if (direction == ScrollBarDirection.HORIZONTAL){
_local5 = ((_arg3)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local5;
} else {
_local5 = ((_arg3)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local5;
};
};
super.setScrollProperties(_arg1, _local6, _local5, _arg4);
}
public function get scrollTargetName():String{
return (_scrollTarget.name);
}
public function get scrollTarget():TextField{
return (_scrollTarget);
}
protected function updateScrollTargetProperties():void{
var _local1:Boolean;
var _local2:Number;
if (_scrollTarget == null){
setScrollProperties(pageSize, minScrollPosition, maxScrollPosition, pageScrollSize);
scrollPosition = 0;
} else {
_local1 = (direction == ScrollBarDirection.HORIZONTAL);
_local2 = (_local1) ? _scrollTarget.width : 10;
setScrollProperties(_local2, (_local1) ? 0 : 1, (_local1) ? _scrollTarget.maxScrollH : _scrollTarget.maxScrollV, pageScrollSize);
scrollPosition = (_local1) ? _scrollTarget.scrollH : _scrollTarget.scrollV;
};
}
public function update():void{
inEdit = true;
updateScrollTargetProperties();
inEdit = false;
}
public function set scrollTargetName(_arg1:String):void{
var target = _arg1;
try {
scrollTarget = (parent.getChildByName(target) as TextField);
} catch(error:Error) {
throw (new Error("ScrollTarget not found, or is not a TextField"));
};
}
override public function set direction(_arg1:String):void{
if (isLivePreview){
return;
};
super.direction = _arg1;
updateScrollTargetProperties();
}
protected function handleTargetChange(_arg1:Event):void{
inEdit = true;
setScrollPosition(((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV, true);
updateScrollTargetProperties();
inEdit = false;
}
override public function set maxScrollPosition(_arg1:Number):void{
var _local2:Number;
_local2 = _arg1;
if (_scrollTarget != null){
if (direction == ScrollBarDirection.HORIZONTAL){
_local2 = ((_local2)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local2;
} else {
_local2 = ((_local2)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local2;
};
};
super.maxScrollPosition = _local2;
}
protected function updateTargetScroll(_arg1:ScrollEvent=null):void{
if (inEdit){
return;
};
if (direction == ScrollBarDirection.HORIZONTAL){
_scrollTarget.scrollH = scrollPosition;
} else {
_scrollTarget.scrollV = scrollPosition;
};
}
override protected function draw():void{
if (isInvalid(InvalidationType.DATA)){
updateScrollTargetProperties();
};
super.draw();
}
public function set scrollTarget(_arg1:TextField):void{
if (_scrollTarget != null){
_scrollTarget.removeEventListener(Event.CHANGE, handleTargetChange, false);
_scrollTarget.removeEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false);
_scrollTarget.removeEventListener(Event.SCROLL, handleTargetScroll, false);
removeEventListener(ScrollEvent.SCROLL, updateTargetScroll, false);
};
_scrollTarget = _arg1;
if (_scrollTarget != null){
_scrollTarget.addEventListener(Event.CHANGE, handleTargetChange, false, 0, true);
_scrollTarget.addEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false, 0, true);
_scrollTarget.addEventListener(Event.SCROLL, handleTargetScroll, false, 0, true);
addEventListener(ScrollEvent.SCROLL, updateTargetScroll, false, 0, true);
};
invalidate(InvalidationType.DATA);
}
override public function get direction():String{
return (super.direction);
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.controls
Section 83
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 84
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 85
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 86
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 87
//ScrollEvent (fl.events.ScrollEvent)
package fl.events {
import flash.events.*;
public class ScrollEvent extends Event {
private var _position:Number;
private var _direction:String;
private var _delta:Number;
public static const SCROLL:String = "scroll";
public function ScrollEvent(_arg1:String, _arg2:Number, _arg3:Number){
super(ScrollEvent.SCROLL, false, false);
_direction = _arg1;
_delta = _arg2;
_position = _arg3;
}
override public function clone():Event{
return (new ScrollEvent(_direction, _delta, _position));
}
public function get position():Number{
return (_position);
}
override public function toString():String{
return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position"));
}
public function get delta():Number{
return (_delta);
}
public function get direction():String{
return (_direction);
}
}
}//package fl.events
Section 88
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 89
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 90
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 91
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 92
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.text.*;
import flash.utils.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 93
//Rijndael (security.Rijndael)
package security {
public class Rijndael {
public var keySize:Number;// = 128
protected var Nb:Number;
protected var SBoxInverse:Array;
protected var Nk:Number;
protected var shiftOffsets:Array;
protected var Nr:Number;
public var blockSize:Number;// = 128
protected var Rcon:Array;
protected var roundsArray:Array;
protected var SBox:Array;
public function Rijndael(_arg1:Number, _arg2:Number){
Rcon = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145];
SBox = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 0xFF, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22];
SBoxInverse = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 0xFF, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125];
blockSize = 128;
keySize = 128;
super();
if (_arg1 != undefined){
this.keySize = _arg1;
};
if (_arg2 != undefined){
this.blockSize = _arg2;
};
this.roundsArray = [0, 0, 0, 0, [0, 0, 0, 0, 10, 0, 12, 0, 14], 0, [0, 0, 0, 0, 12, 0, 12, 0, 14], 0, [0, 0, 0, 0, 14, 0, 14, 0, 14]];
this.shiftOffsets = [0, 0, 0, 0, [0, 1, 2, 3], 0, [0, 1, 2, 3], 0, [0, 1, 3, 4]];
this.Nb = (_arg2 / 32);
this.Nk = (_arg1 / 32);
this.Nr = this.roundsArray[this.Nk][this.Nb];
}
protected function encryption(_arg1:Array, _arg2:Array):Array{
var _local3:Number;
_arg1 = this.packBytes(_arg1);
this.addRoundKey(_arg1, _arg2);
_local3 = 1;
while (_local3 < Nr) {
this.Round(_arg1, _arg2.slice((this.Nb * _local3), (this.Nb * (_local3 + 1))));
_local3++;
};
this.FinalRound(_arg1, _arg2.slice((this.Nb * this.Nr)));
return (this.unpackBytes(_arg1));
}
protected function xtime(_arg1:Number):Number{
_arg1 = (_arg1 << 1);
return (((_arg1 & 0x0100)) ? (_arg1 ^ 283) : _arg1);
}
protected function charsToHex(_arg1:Array):String{
var _local2:String;
var _local3:Array;
var _local4:Number;
_local2 = new String("");
_local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
_local4 = 0;
while (_local4 < _arg1.length) {
_local2 = (_local2 + (_local3[(_arg1[_local4] >> 4)] + _local3[(_arg1[_local4] & 15)]));
_local4++;
};
return (_local2);
}
protected function InverseFinalRound(_arg1:Array, _arg2:Array):void{
this.addRoundKey(_arg1, _arg2);
this.shiftRow(_arg1, "decrypt");
this.byteSub(_arg1, "decrypt");
}
protected function mult_GF256(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
_local3 = 0;
_local4 = 1;
while (_local4 < 0x0100) {
if ((_arg1 & _local4)){
_local3 = (_local3 ^ _arg2);
};
_local4 = (_local4 * 2);
_arg2 = xtime(_arg2);
};
return (_local3);
}
public function decrypt(_arg1:String, _arg2:String, _arg3:String):String{
var _local4:Array;
var _local5:Array;
var _local6:Array;
var _local7:Number;
var _local8:Array;
var _local9:Number;
var _local10:Number;
_local4 = new Array();
_local5 = new Array();
_local6 = hexToChars(_arg1);
_local7 = (this.blockSize / 8);
_local8 = this.keyExpansion(strToChars(_arg2));
_local9 = ((_local6.length / _local7) - 1);
while (_local9 > 0) {
_local5 = decryption(_local6.slice((_local9 * _local7), ((_local9 + 1) * _local7)), _local8);
if (_arg3 == "CBC"){
_local10 = 0;
while (_local10 < _local7) {
_local4[(((_local9 - 1) * _local7) + _local10)] = (_local5[_local10] ^ _local6[(((_local9 - 1) * _local7) + _local10)]);
_local10++;
};
} else {
_local4 = _local5.concat(_local4);
};
_local9--;
};
if (_arg3 == "ECB"){
_local4 = this.decryption(_local6.slice(0, _local7), _local8).concat(_local4);
};
return (charsToStr(_local4));
}
protected function hexToChars(_arg1:String):Array{
var _local2:Array;
var _local3:Number;
_local2 = new Array();
_local3 = ((_arg1.substr(0, 2))=="0x") ? 2 : 0;
while (_local3 < _arg1.length) {
_local2.push(parseInt(_arg1.substr(_local3, 2), 16));
_local3 = (_local3 + 2);
};
return (_local2);
}
protected function shiftRow(_arg1:Array, _arg2:String):void{
var _local3:Number;
_local3 = 1;
while (_local3 < 4) {
if (_arg2 == "encrypt"){
_arg1[_local3] = this.cyclicShiftLeft(_arg1[_local3], this.shiftOffsets[Nb][_local3]);
} else {
_arg1[_local3] = this.cyclicShiftLeft(_arg1[_local3], (this.Nb - this.shiftOffsets[Nb][_local3]));
};
_local3++;
};
}
protected function FinalRound(_arg1:Array, _arg2:Array):void{
this.byteSub(_arg1, "encrypt");
this.shiftRow(_arg1, "encrypt");
this.addRoundKey(_arg1, _arg2);
}
protected function cyclicShiftLeft(_arg1:Array, _arg2:Number):Array{
var _local3:Array;
_local3 = _arg1.slice(0, _arg2);
_arg1 = _arg1.slice(_arg2).concat(_local3);
return (_arg1);
}
protected function strToChars(_arg1:String):Array{
var _local2:Array;
var _local3:Number;
_local2 = new Array();
_local3 = 0;
while (_local3 < _arg1.length) {
_local2.push(_arg1.charCodeAt(_local3));
_local3++;
};
return (_local2);
}
protected function mixColumn(_arg1:Array, _arg2:String):void{
var _local3:Array;
var _local4:Number;
var _local5:Number;
_local3 = new Array();
_local4 = 0;
while (_local4 < this.Nb) {
_local5 = 0;
while (_local5 < 4) {
if (_arg2 == "encrypt"){
_local3[_local5] = (((this.mult_GF256(_arg1[_local5][_local4], 2) ^ this.mult_GF256(_arg1[((_local5 + 1) % 4)][_local4], 3)) ^ _arg1[((_local5 + 2) % 4)][_local4]) ^ _arg1[((_local5 + 3) % 4)][_local4]);
} else {
_local3[_local5] = (((this.mult_GF256(_arg1[_local5][_local4], 14) ^ this.mult_GF256(_arg1[((_local5 + 1) % 4)][_local4], 11)) ^ this.mult_GF256(_arg1[((_local5 + 2) % 4)][_local4], 13)) ^ this.mult_GF256(_arg1[((_local5 + 3) % 4)][_local4], 9));
};
_local5++;
};
_local5 = 0;
while (_local5 < 4) {
_arg1[_local5][_local4] = _local3[_local5];
_local5++;
};
_local4++;
};
}
protected function decryption(_arg1:Array, _arg2:Array):Array{
var _local3:Number;
_arg1 = this.packBytes(_arg1);
this.InverseFinalRound(_arg1, _arg2.slice((this.Nb * this.Nr)));
_local3 = (Nr - 1);
while (_local3 > 0) {
this.InverseRound(_arg1, _arg2.slice((this.Nb * _local3), (this.Nb * (_local3 + 1))));
_local3--;
};
this.addRoundKey(_arg1, _arg2);
return (this.unpackBytes(_arg1));
}
protected function byteSub(_arg1:Array, _arg2:String):void{
var _local3:Array;
var _local4:Number;
var _local5:*;
if (_arg2 == "encrypt"){
_local3 = this.SBox;
} else {
_local3 = this.SBoxInverse;
};
_local4 = 0;
while (_local4 < 4) {
_local5 = 0;
while (_local5 < this.Nb) {
_arg1[_local4][_local5] = _local3[_arg1[_local4][_local5]];
_local5++;
};
_local4++;
};
}
protected function packBytes(_arg1:Array):Array{
var _local2:Array;
var _local3:Number;
_local2 = new Array();
_local2[0] = new Array();
_local2[1] = new Array();
_local2[2] = new Array();
_local2[3] = new Array();
_local3 = 0;
while (_local3 < _arg1.length) {
_local2[0][(_local3 / 4)] = _arg1[_local3];
_local2[1][(_local3 / 4)] = _arg1[(_local3 + 1)];
_local2[2][(_local3 / 4)] = _arg1[(_local3 + 2)];
_local2[3][(_local3 / 4)] = _arg1[(_local3 + 3)];
_local3 = (_local3 + 4);
};
return (_local2);
}
protected function formatPlaintext(_arg1:Array):Array{
var _local2:Number;
var _local3:Number;
_local2 = (blockSize / 8);
_local3 = (_local2 - (_arg1.length % _local2));
while ((((_local3 > 0)) && ((_local3 < _local2)))) {
_arg1[_arg1.length] = 0;
_local3--;
};
return (_arg1);
}
public function encrypt(_arg1:String, _arg2:String, _arg3:String):String{
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local8:Array;
var _local9:Number;
var _local10:Number;
_local4 = new Array();
_local5 = new Array();
_local6 = (this.blockSize / 8);
if (_arg3 == "CBC"){
_local4 = this.getRandomBytes(_local6);
};
_local7 = this.formatPlaintext(strToChars(_arg1));
_local8 = this.keyExpansion(strToChars(_arg2));
_local9 = 0;
while (_local9 < (_local7.length / _local6)) {
_local5 = _local7.slice((_local9 * _local6), ((_local9 + 1) * _local6));
if (_arg3 == "CBC"){
_local10 = 0;
while (_local10 < _local6) {
_local5[_local10] = (_local5[_local10] ^ _local4[((_local9 * _local6) + _local10)]);
_local10++;
};
};
_local4 = _local4.concat(this.encryption(_local5, _local8));
_local9++;
};
return (charsToHex(_local4));
}
protected function keyExpansion(_arg1:Array):Array{
var _local2:Number;
var _local3:Array;
var _local4:Number;
_local2 = 0;
this.Nk = (this.keySize / 32);
this.Nb = (this.blockSize / 32);
_local3 = new Array();
this.Nr = this.roundsArray[this.Nk][this.Nb];
_local4 = 0;
while (_local4 < this.Nk) {
_local3[_local4] = (((_arg1[(4 * _local4)] | (_arg1[((4 * _local4) + 1)] << 8)) | (_arg1[((4 * _local4) + 2)] << 16)) | (_arg1[((4 * _local4) + 3)] << 24));
_local4++;
};
_local4 = this.Nk;
while (_local4 < (this.Nb * (this.Nr + 1))) {
_local2 = _local3[(_local4 - 1)];
if ((_local4 % this.Nk) == 0){
_local2 = ((((this.SBox[((_local2 >> 8) & 0xFF)] | (this.SBox[((_local2 >> 16) & 0xFF)] << 8)) | (this.SBox[((_local2 >> 24) & 0xFF)] << 16)) | (this.SBox[(_local2 & 0xFF)] << 24)) ^ this.Rcon[(Math.floor((_local4 / this.Nk)) - 1)]);
} else {
if ((((this.Nk > 6)) && (((_local4 % this.Nk) == 4)))){
_local2 = ((((this.SBox[((_local2 >> 24) & 0xFF)] << 24) | (this.SBox[((_local2 >> 16) & 0xFF)] << 16)) | (this.SBox[((_local2 >> 8) & 0xFF)] << 8)) | this.SBox[(_local2 & 0xFF)]);
};
};
_local3[_local4] = (_local3[(_local4 - this.Nk)] ^ _local2);
_local4++;
};
return (_local3);
}
protected function InverseRound(_arg1:Array, _arg2:Array):void{
this.addRoundKey(_arg1, _arg2);
this.mixColumn(_arg1, "decrypt");
this.shiftRow(_arg1, "decrypt");
this.byteSub(_arg1, "decrypt");
}
protected function unpackBytes(_arg1:Array):Array{
var _local2:Array;
var _local3:Number;
_local2 = new Array();
_local3 = 0;
while (_local3 < _arg1[0].length) {
_local2[_local2.length] = _arg1[0][_local3];
_local2[_local2.length] = _arg1[1][_local3];
_local2[_local2.length] = _arg1[2][_local3];
_local2[_local2.length] = _arg1[3][_local3];
_local3++;
};
return (_local2);
}
protected function addRoundKey(_arg1:Array, _arg2:Array):void{
var _local3:Number;
_local3 = 0;
while (_local3 < this.Nb) {
_arg1[0][_local3] = (_arg1[0][_local3] ^ (_arg2[_local3] & 0xFF));
_arg1[1][_local3] = (_arg1[1][_local3] ^ ((_arg2[_local3] >> 8) & 0xFF));
_arg1[2][_local3] = (_arg1[2][_local3] ^ ((_arg2[_local3] >> 16) & 0xFF));
_arg1[3][_local3] = (_arg1[3][_local3] ^ ((_arg2[_local3] >> 24) & 0xFF));
_local3++;
};
}
protected function Round(_arg1:Array, _arg2:Array):void{
this.byteSub(_arg1, "encrypt");
this.shiftRow(_arg1, "encrypt");
this.mixColumn(_arg1, "encrypt");
this.addRoundKey(_arg1, _arg2);
}
protected function getRandomBytes(_arg1:Number):Array{
var _local2:Array;
var _local3:Number;
_local2 = new Array();
_local3 = 0;
while (_local3 < _arg1) {
_local2[_local3] = Math.round((Math.random() * 0xFF));
_local3++;
};
return (_local2);
}
protected function charsToStr(_arg1:Array):String{
var _local2:String;
var _local3:Number;
_local2 = new String("");
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(_arg1[_local3]));
_local3++;
};
return (_local2);
}
}
}//package security
Section 94
//1stcutscenceanimation_209 (TempusTerminus_fla.1stcutscenceanimation_209)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class 1stcutscenceanimation_209 extends MovieClip {
public var nextLevel:SimpleButton;
public function 1stcutscenceanimation_209(){
addFrameScript(0, frame1, 1, frame2, 431, frame432);
}
function frame432(){
if (this.parent.parent != null){
(this.parent.parent as MainClass).createLevel();
(this.parent as MovieClip).gotoAndStop(10);
};
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TempusTerminus_fla
Section 95
//2ndscencemov_219 (TempusTerminus_fla.2ndscencemov_219)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class 2ndscencemov_219 extends MovieClip {
public function 2ndscencemov_219(){
addFrameScript(419, frame420);
}
function frame420(){
stop();
if (this.parent.parent != null){
(this.parent.parent as MainClass).createLevel();
(this.parent as MovieClip).gotoAndStop(10);
};
}
}
}//package TempusTerminus_fla
Section 96
//3rdscencemov_225 (TempusTerminus_fla.3rdscencemov_225)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class 3rdscencemov_225 extends MovieClip {
public function 3rdscencemov_225(){
addFrameScript(594, frame595);
}
function frame595(){
stop();
if (this.parent.parent != null){
(this.parent.parent as MainClass).createLevel();
(this.parent as MovieClip).gotoAndStop(10);
};
}
}
}//package TempusTerminus_fla
Section 97
//4thcutscencemov_229 (TempusTerminus_fla.4thcutscencemov_229)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class 4thcutscencemov_229 extends MovieClip {
public function 4thcutscencemov_229(){
addFrameScript(1084, frame1085);
}
function frame1085(){
stop();
if (this.parent.parent != null){
(this.parent.parent as MainClass).createLevel();
(this.parent as MovieClip).gotoAndStop(10);
};
}
}
}//package TempusTerminus_fla
Section 98
//5thcutscenceanimtion1_240 (TempusTerminus_fla.5thcutscenceanimtion1_240)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class 5thcutscenceanimtion1_240 extends MovieClip {
public function 5thcutscenceanimtion1_240(){
addFrameScript(970, frame971);
}
function frame971(){
stop();
if (this.parent.parent != null){
(this.parent.parent as MainClass).createLevel();
(this.parent as MovieClip).gotoAndStop(10);
};
}
}
}//package TempusTerminus_fla
Section 99
//5thscencemov_233 (TempusTerminus_fla.5thscencemov_233)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class 5thscencemov_233 extends MovieClip {
public function 5thscencemov_233(){
addFrameScript(236, frame237);
}
function frame237(){
stop();
if (this.parent.parent != null){
(this.parent.parent as MainClass).createLevel();
(this.parent as MovieClip).gotoAndStop(10);
};
}
}
}//package TempusTerminus_fla
Section 100
//6thcutscenceanimation_236 (TempusTerminus_fla.6thcutscenceanimation_236)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class 6thcutscenceanimation_236 extends MovieClip {
public function 6thcutscenceanimation_236(){
addFrameScript(260, frame261);
}
function frame261(){
stop();
if (this.parent.parent != null){
(this.parent.parent as MainClass).createLevel();
(this.parent as MovieClip).gotoAndStop(10);
};
}
}
}//package TempusTerminus_fla
Section 101
//7thcutscence_243 (TempusTerminus_fla.7thcutscence_243)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class 7thcutscence_243 extends MovieClip {
public function 7thcutscence_243(){
addFrameScript(1823, frame1824);
}
function frame1824(){
stop();
if (this.parent.parent != null){
(this.parent.parent as MainClass).playCutScene(9);
};
}
}
}//package TempusTerminus_fla
Section 102
//9thscenceanimation_247 (TempusTerminus_fla.9thscenceanimation_247)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class 9thscenceanimation_247 extends MovieClip {
public function 9thscenceanimation_247(){
addFrameScript(278, frame279);
}
function frame279(){
stop();
if (this.parent.parent != null){
(this.parent.parent as MainClass).createYouWin();
(this.parent as MovieClip).gotoAndStop(10);
};
}
}
}//package TempusTerminus_fla
Section 103
//barouterbodyglow_33 (TempusTerminus_fla.barouterbodyglow_33)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class barouterbodyglow_33 extends MovieClip {
public function barouterbodyglow_33(){
addFrameScript(0, frame1, 19, frame20, 22, frame23, 66, frame67, 106, frame107);
}
function frame1(){
stop();
}
function frame23(){
gotoAndPlay(21);
}
function frame20(){
gotoAndPlay(2);
}
function frame107(){
gotoAndStop(1);
}
function frame67(){
gotoAndStop(1);
}
}
}//package TempusTerminus_fla
Section 104
//btbg1_188 (TempusTerminus_fla.btbg1_188)
package TempusTerminus_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btbg1_188 extends MovieClip {
public var currentKey:TextField;
}
}//package TempusTerminus_fla
Section 105
//butbg_189 (TempusTerminus_fla.butbg_189)
package TempusTerminus_fla {
import flash.display.*;
import flash.text.*;
public dynamic class butbg_189 extends MovieClip {
public var currentKey:TextField;
}
}//package TempusTerminus_fla
Section 106
//charggun_507 (TempusTerminus_fla.charggun_507)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class charggun_507 extends MovieClip {
public function charggun_507(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 107
//chariotfire_473 (TempusTerminus_fla.chariotfire_473)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class chariotfire_473 extends MovieClip {
public var gunPoint1:MovieClip;
public var missilefiring:MovieClip;
public var firing:MovieClip;
public function chariotfire_473(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TempusTerminus_fla
Section 108
//chariotfirecopy_513 (TempusTerminus_fla.chariotfirecopy_513)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class chariotfirecopy_513 extends MovieClip {
public var gunPoint1:MovieClip;
public var gunPoint:MovieClip;
public var firing:MovieClip;
public function chariotfirecopy_513(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TempusTerminus_fla
Section 109
//craditsscreen_284 (TempusTerminus_fla.craditsscreen_284)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class craditsscreen_284 extends MovieClip {
public var creditBack:SimpleButton;
public var twuneBn:SimpleButton;
public var playLogo:SimpleButton;
}
}//package TempusTerminus_fla
Section 110
//Enforcedeath_471 (TempusTerminus_fla.Enforcedeath_471)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class Enforcedeath_471 extends MovieClip {
public function Enforcedeath_471(){
addFrameScript(79, frame80);
}
function frame80(){
stop();
}
}
}//package TempusTerminus_fla
Section 111
//Enforcestillfire_456 (TempusTerminus_fla.Enforcestillfire_456)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class Enforcestillfire_456 extends MovieClip {
public var gun:MovieClip;
public var otherHand:MovieClip;
}
}//package TempusTerminus_fla
Section 112
//FO_phobonanddeoDEATH_63 (TempusTerminus_fla.FO_phobonanddeoDEATH_63)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class FO_phobonanddeoDEATH_63 extends MovieClip {
public function FO_phobonanddeoDEATH_63(){
addFrameScript(78, frame79);
}
function frame79(){
stop();
}
}
}//package TempusTerminus_fla
Section 113
//GLADIHAND_445 (TempusTerminus_fla.GLADIHAND_445)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class GLADIHAND_445 extends MovieClip {
public var firing:MovieClip;
public var still:MovieClip;
public function GLADIHAND_445(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 114
//graphics_12 (TempusTerminus_fla.graphics_12)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class graphics_12 extends MovieClip {
public function graphics_12(){
addFrameScript(1, frame2);
}
function frame2(){
while (this.numChildren > 0) {
if ((this.getChildAt(0) is MovieClip)){
(this.getChildAt(0) as MovieClip).gotoAndStop((this.getChildAt(0) as MovieClip).totalFrames);
};
this.removeChildAt(0);
};
}
}
}//package TempusTerminus_fla
Section 115
//hangingpostion_413 (TempusTerminus_fla.hangingpostion_413)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class hangingpostion_413 extends MovieClip {
public var arm:MovieClip;
public var fist:MovieClip;
}
}//package TempusTerminus_fla
Section 116
//heroholdinghand2_396 (TempusTerminus_fla.heroholdinghand2_396)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class heroholdinghand2_396 extends MovieClip {
public var swing:MovieClip;
public function heroholdinghand2_396(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 117
//heroholhandhurt_409 (TempusTerminus_fla.heroholhandhurt_409)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class heroholhandhurt_409 extends MovieClip {
public function heroholhandhurt_409(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 118
//heronormalhandjump_404 (TempusTerminus_fla.heronormalhandjump_404)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class heronormalhandjump_404 extends MovieClip {
public function heronormalhandjump_404(){
addFrameScript(8, frame9, 19, frame20, 24, frame25);
}
function frame20(){
stop();
}
function frame25(){
stop();
}
function frame9(){
stop();
}
}
}//package TempusTerminus_fla
Section 119
//hreohansrun_400 (TempusTerminus_fla.hreohansrun_400)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class hreohansrun_400 extends MovieClip {
public var swing:MovieClip;
public function hreohansrun_400(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 120
//hreojumphand_403 (TempusTerminus_fla.hreojumphand_403)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class hreojumphand_403 extends MovieClip {
public function hreojumphand_403(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 121
//landingdeath_417 (TempusTerminus_fla.landingdeath_417)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class landingdeath_417 extends MovieClip {
public function landingdeath_417(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
}
}
}//package TempusTerminus_fla
Section 122
//lasergan_506 (TempusTerminus_fla.lasergan_506)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class lasergan_506 extends MovieClip {
public var charge:MovieClip;
}
}//package TempusTerminus_fla
Section 123
//lodbar2copy_1 (TempusTerminus_fla.lodbar2copy_1)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class lodbar2copy_1 extends MovieClip {
public var percentbar:MovieClip;
}
}//package TempusTerminus_fla
Section 124
//marsattact_274 (TempusTerminus_fla.marsattact_274)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class marsattact_274 extends MovieClip {
public var gunPoint:MovieClip;
public function marsattact_274(){
addFrameScript(69, frame70);
}
function frame70(){
stop();
}
}
}//package TempusTerminus_fla
Section 125
//marshurt_276 (TempusTerminus_fla.marshurt_276)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class marshurt_276 extends MovieClip {
public var gunPoint:MovieClip;
}
}//package TempusTerminus_fla
Section 126
//marslose_278 (TempusTerminus_fla.marslose_278)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class marslose_278 extends MovieClip {
public function marslose_278(){
addFrameScript(34, frame35);
}
function frame35(){
stop();
}
}
}//package TempusTerminus_fla
Section 127
//marsloseleg_266 (TempusTerminus_fla.marsloseleg_266)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class marsloseleg_266 extends MovieClip {
public function marsloseleg_266(){
addFrameScript(34, frame35);
}
function frame35(){
stop();
}
}
}//package TempusTerminus_fla
Section 128
//marsmissilefire_268 (TempusTerminus_fla.marsmissilefire_268)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class marsmissilefire_268 extends MovieClip {
public var gunPoint:MovieClip;
public function marsmissilefire_268(){
addFrameScript(29, frame30);
}
function frame30(){
gotoAndPlay(1);
}
}
}//package TempusTerminus_fla
Section 129
//marsmissilefireleg_258 (TempusTerminus_fla.marsmissilefireleg_258)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class marsmissilefireleg_258 extends MovieClip {
public function marsmissilefireleg_258(){
addFrameScript(29, frame30);
}
function frame30(){
gotoAndPlay(1);
}
}
}//package TempusTerminus_fla
Section 130
//marsthum_277 (TempusTerminus_fla.marsthum_277)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class marsthum_277 extends MovieClip {
public var gunPoint:MovieClip;
public function marsthum_277(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package TempusTerminus_fla
Section 131
//marsthumleg_265 (TempusTerminus_fla.marsthumleg_265)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class marsthumleg_265 extends MovieClip {
public function marsthumleg_265(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package TempusTerminus_fla
Section 132
//marswalk_275 (TempusTerminus_fla.marswalk_275)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class marswalk_275 extends MovieClip {
public var gunPoint:MovieClip;
}
}//package TempusTerminus_fla
Section 133
//mcCHarriotDie_490 (TempusTerminus_fla.mcCHarriotDie_490)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCHarriotDie_490 extends MovieClip {
public function mcCHarriotDie_490(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package TempusTerminus_fla
Section 134
//mcCHarriotDiecopy_520 (TempusTerminus_fla.mcCHarriotDiecopy_520)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCHarriotDiecopy_520 extends MovieClip {
public function mcCHarriotDiecopy_520(){
addFrameScript(54, frame55);
}
function frame55(){
stop();
}
}
}//package TempusTerminus_fla
Section 135
//mcCHarriothurt_489 (TempusTerminus_fla.mcCHarriothurt_489)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCHarriothurt_489 extends MovieClip {
public function mcCHarriothurt_489(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package TempusTerminus_fla
Section 136
//mcCHarriothurtcopy_519 (TempusTerminus_fla.mcCHarriothurtcopy_519)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCHarriothurtcopy_519 extends MovieClip {
public function mcCHarriothurtcopy_519(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package TempusTerminus_fla
Section 137
//mcCharriotTorso_483 (TempusTerminus_fla.mcCharriotTorso_483)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCharriotTorso_483 extends MovieClip {
public function mcCharriotTorso_483(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 138
//mcCharriotTorsocopy_515 (TempusTerminus_fla.mcCharriotTorsocopy_515)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCharriotTorsocopy_515 extends MovieClip {
public function mcCharriotTorsocopy_515(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 139
//mcCmgfirechanguncopy_517 (TempusTerminus_fla.mcCmgfirechanguncopy_517)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCmgfirechanguncopy_517 extends MovieClip {
public var gunPoint:MovieClip;
public function mcCmgfirechanguncopy_517(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 140
//mcCmgfirechanguncopy2_487 (TempusTerminus_fla.mcCmgfirechanguncopy2_487)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCmgfirechanguncopy2_487 extends MovieClip {
public var gunPoint:MovieClip;
public function mcCmgfirechanguncopy2_487(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 141
//mcCstillchangun_476 (TempusTerminus_fla.mcCstillchangun_476)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCstillchangun_476 extends MovieClip {
public var missileFire:MovieClip;
}
}//package TempusTerminus_fla
Section 142
//mcCstillchanguncopy_514 (TempusTerminus_fla.mcCstillchanguncopy_514)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCstillchanguncopy_514 extends MovieClip {
public var missileFire:MovieClip;
}
}//package TempusTerminus_fla
Section 143
//mcCstilllaseguncopy_516 (TempusTerminus_fla.mcCstilllaseguncopy_516)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCstilllaseguncopy_516 extends MovieClip {
public var gunPoint0:MovieClip;
public var gunPoint:MovieClip;
public var missileFire:MovieClip;
public function mcCstilllaseguncopy_516(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 144
//mcCstilllaseguncopy2_484 (TempusTerminus_fla.mcCstilllaseguncopy2_484)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcCstilllaseguncopy2_484 extends MovieClip {
public var gunPoint0:MovieClip;
public var missileFire:MovieClip;
public function mcCstilllaseguncopy2_484(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 145
//mcEnforcerGun_466 (TempusTerminus_fla.mcEnforcerGun_466)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcEnforcerGun_466 extends MovieClip {
public var gunPoint1:MovieClip;
public var gunPoint5:MovieClip;
public var gunPoint4:MovieClip;
public var gunPoint3:MovieClip;
public var gunPoint2:MovieClip;
public var firing:MovieClip;
}
}//package TempusTerminus_fla
Section 146
//mcErrorReason_360 (TempusTerminus_fla.mcErrorReason_360)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcErrorReason_360 extends MovieClip {
public var er:MovieClip;
public function mcErrorReason_360(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 147
//mcfirephogun_48 (TempusTerminus_fla.mcfirephogun_48)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcfirephogun_48 extends MovieClip {
public var gunPoint:MovieClip;
public function mcfirephogun_48(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package TempusTerminus_fla
Section 148
//mcGameOVerAni_327 (TempusTerminus_fla.mcGameOVerAni_327)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcGameOVerAni_327 extends MovieClip {
public var levelEditor:SimpleButton;
public var playAgain:SimpleButton;
public var replay:SimpleButton;
public var playLogo:SimpleButton;
}
}//package TempusTerminus_fla
Section 149
//mcGladiatodie_454 (TempusTerminus_fla.mcGladiatodie_454)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcGladiatodie_454 extends MovieClip {
public function mcGladiatodie_454(){
addFrameScript(84, frame85);
}
function frame85(){
stop();
}
}
}//package TempusTerminus_fla
Section 150
//mcGladiatodiestillfire_439 (TempusTerminus_fla.mcGladiatodiestillfire_439)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcGladiatodiestillfire_439 extends MovieClip {
public var gunPoint:MovieClip;
public var gunHand:MovieClip;
}
}//package TempusTerminus_fla
Section 151
//mcGladiatodiestillONLYHAND_446 (TempusTerminus_fla.mcGladiatodiestillONLYHAND_446)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcGladiatodiestillONLYHAND_446 extends MovieClip {
public var gunPoint:MovieClip;
}
}//package TempusTerminus_fla
Section 152
//mcGladiatodiestillONLYHAND2_452 (TempusTerminus_fla.mcGladiatodiestillONLYHAND2_452)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcGladiatodiestillONLYHAND2_452 extends MovieClip {
public var gunPoint:MovieClip;
public function mcGladiatodiestillONLYHAND2_452(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 153
//mcHelpScreen_542 (TempusTerminus_fla.mcHelpScreen_542)
package TempusTerminus_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcHelpScreen_542 extends MovieClip {
public var closeHelp:SimpleButton;
public var details:TextField;
}
}//package TempusTerminus_fla
Section 154
//mcHerodeath2_412 (TempusTerminus_fla.mcHerodeath2_412)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcHerodeath2_412 extends MovieClip {
public function mcHerodeath2_412(){
addFrameScript(23, frame24);
}
function frame24(){
stop();
}
}
}//package TempusTerminus_fla
Section 155
//mcHerodeathnormal_411 (TempusTerminus_fla.mcHerodeathnormal_411)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcHerodeathnormal_411 extends MovieClip {
public function mcHerodeathnormal_411(){
addFrameScript(72, frame73);
}
function frame73(){
stop();
}
}
}//package TempusTerminus_fla
Section 156
//mcHeroDuck_406 (TempusTerminus_fla.mcHeroDuck_406)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcHeroDuck_406 extends MovieClip {
public function mcHeroDuck_406(){
addFrameScript(3, frame4, 73, frame74, 80, frame81);
}
function frame74(){
gotoAndPlay(6);
}
function frame81(){
gotoAndStop(4);
}
function frame4(){
stop();
}
}
}//package TempusTerminus_fla
Section 157
//mcHeroFly_402 (TempusTerminus_fla.mcHeroFly_402)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcHeroFly_402 extends MovieClip {
public var arm:MovieClip;
public function mcHeroFly_402(){
addFrameScript(8, frame9, 19, frame20, 24, frame25);
}
function frame20(){
stop();
}
function frame25(){
stop();
}
function frame9(){
stop();
}
}
}//package TempusTerminus_fla
Section 158
//mcHeroHurt1_408 (TempusTerminus_fla.mcHeroHurt1_408)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcHeroHurt1_408 extends MovieClip {
public var arm:MovieClip;
}
}//package TempusTerminus_fla
Section 159
//mcHeroRun_395 (TempusTerminus_fla.mcHeroRun_395)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcHeroRun_395 extends MovieClip {
public var arm2:MovieClip;
public var arm1:MovieClip;
}
}//package TempusTerminus_fla
Section 160
//mcHeroStand_380 (TempusTerminus_fla.mcHeroStand_380)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcHeroStand_380 extends MovieClip {
public var arm:MovieClip;
}
}//package TempusTerminus_fla
Section 161
//mckeyError_190 (TempusTerminus_fla.mckeyError_190)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mckeyError_190 extends MovieClip {
public function mckeyError_190(){
addFrameScript(0, frame1);
}
function frame1(){
this.x = 900;
this.visible = false;
stop();
}
}
}//package TempusTerminus_fla
Section 162
//mckeyError1_191 (TempusTerminus_fla.mckeyError1_191)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mckeyError1_191 extends MovieClip {
public function mckeyError1_191(){
addFrameScript(0, frame1);
}
function frame1(){
this.x = 900;
this.visible = false;
stop();
}
}
}//package TempusTerminus_fla
Section 163
//mcLevelcodeDyn_333 (TempusTerminus_fla.mcLevelcodeDyn_333)
package TempusTerminus_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevelcodeDyn_333 extends MovieClip {
public var Codes:TextField;
}
}//package TempusTerminus_fla
Section 164
//mcLeveldyn_332 (TempusTerminus_fla.mcLeveldyn_332)
package TempusTerminus_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcLeveldyn_332 extends MovieClip {
public var num:TextField;
}
}//package TempusTerminus_fla
Section 165
//mcLevelLoadError_361 (TempusTerminus_fla.mcLevelLoadError_361)
package TempusTerminus_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevelLoadError_361 extends MovieClip {
public var errorMsg:TextField;
}
}//package TempusTerminus_fla
Section 166
//mcLocationInfo_540 (TempusTerminus_fla.mcLocationInfo_540)
package TempusTerminus_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcLocationInfo_540 extends MovieClip {
public var yLoc:TextField;
public var xLoc:TextField;
}
}//package TempusTerminus_fla
Section 167
//mcmissileloncher_474 (TempusTerminus_fla.mcmissileloncher_474)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcmissileloncher_474 extends MovieClip {
public function mcmissileloncher_474(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 168
//mcNoLevelEditorAvailable_324 (TempusTerminus_fla.mcNoLevelEditorAvailable_324)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcNoLevelEditorAvailable_324 extends MovieClip {
public function mcNoLevelEditorAvailable_324(){
addFrameScript(0, frame1, 100, frame101);
}
function frame1(){
stop();
}
function frame101(){
this.gotoAndStop(1);
}
}
}//package TempusTerminus_fla
Section 169
//mcPeacekeeperGunHand_427 (TempusTerminus_fla.mcPeacekeeperGunHand_427)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcPeacekeeperGunHand_427 extends MovieClip {
public var gunPoint:MovieClip;
public function mcPeacekeeperGunHand_427(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 170
//mcPeaceMakeDie_433 (TempusTerminus_fla.mcPeaceMakeDie_433)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcPeaceMakeDie_433 extends MovieClip {
public function mcPeaceMakeDie_433(){
addFrameScript(69, frame70);
}
function frame70(){
stop();
}
}
}//package TempusTerminus_fla
Section 171
//mcSelect_295 (TempusTerminus_fla.mcSelect_295)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcSelect_295 extends MovieClip {
public function mcSelect_295(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 172
//mcTTInstructions_300 (TempusTerminus_fla.mcTTInstructions_300)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcTTInstructions_300 extends MovieClip {
public var nextPage:SimpleButton;
public var prevPage:SimpleButton;
public var playMore:SimpleButton;
public var back:SimpleButton;
public function mcTTInstructions_300(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 173
//mcTToptions_289 (TempusTerminus_fla.mcTToptions_289)
package TempusTerminus_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcTToptions_289 extends MovieClip {
public var easy:MovieClip;
public var hard:MovieClip;
public var playLevelBn:SimpleButton;
public var medium:MovieClip;
public var wrongCode:MovieClip;
public var playMore:SimpleButton;
public var newGame:SimpleButton;
public var back:SimpleButton;
public var playLevelText:TextField;
}
}//package TempusTerminus_fla
Section 174
//mcTTTitleAnimation_310 (TempusTerminus_fla.mcTTTitleAnimation_310)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcTTTitleAnimation_310 extends MovieClip {
public function mcTTTitleAnimation_310(){
addFrameScript(62, frame63);
}
function frame63(){
stop();
}
}
}//package TempusTerminus_fla
Section 175
//mcTTWelcomeScreen_307 (TempusTerminus_fla.mcTTWelcomeScreen_307)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcTTWelcomeScreen_307 extends MovieClip {
public var arcadeOnly:MovieClip;
public var creditBn:SimpleButton;
public var levelEditor:SimpleButton;
public var start:SimpleButton;
public var optionsBn:SimpleButton;
public var addMore:SimpleButton;
public var playMore:SimpleButton;
public var instructionsBn:SimpleButton;
public var playLogo:SimpleButton;
public function mcTTWelcomeScreen_307(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 176
//mcUrlScreen_17 (TempusTerminus_fla.mcUrlScreen_17)
package TempusTerminus_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcUrlScreen_17 extends MovieClip {
public var closeUrl:SimpleButton;
public var details:TextField;
}
}//package TempusTerminus_fla
Section 177
//mcwinAni_132 (TempusTerminus_fla.mcwinAni_132)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcwinAni_132 extends MovieClip {
public var playMore:SimpleButton;
public var playAgain:SimpleButton;
}
}//package TempusTerminus_fla
Section 178
//mcWrongCode_293 (TempusTerminus_fla.mcWrongCode_293)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class mcWrongCode_293 extends MovieClip {
public function mcWrongCode_293(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 179
//mcZoomInfo_539 (TempusTerminus_fla.mcZoomInfo_539)
package TempusTerminus_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcZoomInfo_539 extends MovieClip {
public var scaleValue:TextField;
}
}//package TempusTerminus_fla
Section 180
//normalhandholdingstill_390 (TempusTerminus_fla.normalhandholdingstill_390)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class normalhandholdingstill_390 extends MovieClip {
public function normalhandholdingstill_390(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 181
//peacekeeperduck_436 (TempusTerminus_fla.peacekeeperduck_436)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class peacekeeperduck_436 extends MovieClip {
public var gun:MovieClip;
public function peacekeeperduck_436(){
addFrameScript(21, frame22);
}
function frame22(){
stop();
}
}
}//package TempusTerminus_fla
Section 182
//peacekeeperduckdie_437 (TempusTerminus_fla.peacekeeperduckdie_437)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class peacekeeperduckdie_437 extends MovieClip {
public var gun:MovieClip;
public function peacekeeperduckdie_437(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package TempusTerminus_fla
Section 183
//peacekeeperstillfirecopy_420 (TempusTerminus_fla.peacekeeperstillfirecopy_420)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class peacekeeperstillfirecopy_420 extends MovieClip {
public var gun:MovieClip;
}
}//package TempusTerminus_fla
Section 184
//phoboleg_56 (TempusTerminus_fla.phoboleg_56)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class phoboleg_56 extends MovieClip {
public var phoboLeg2:MovieClip;
public var phoboLeg1:MovieClip;
}
}//package TempusTerminus_fla
Section 185
//phobonsgoofireanimation_47 (TempusTerminus_fla.phobonsgoofireanimation_47)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class phobonsgoofireanimation_47 extends MovieClip {
public var gun:MovieClip;
public function phobonsgoofireanimation_47(){
addFrameScript(9, frame10);
}
function frame10(){
gotoAndPlay(1);
}
}
}//package TempusTerminus_fla
Section 186
//phobwalkmain_55 (TempusTerminus_fla.phobwalkmain_55)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class phobwalkmain_55 extends MovieClip {
public var phoboLeg:MovieClip;
public var hand1:MovieClip;
}
}//package TempusTerminus_fla
Section 187
//TARENT1_20 (TempusTerminus_fla.TARENT1_20)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class TARENT1_20 extends MovieClip {
public var gunPoint:MovieClip;
}
}//package TempusTerminus_fla
Section 188
//tempeseff_36 (TempusTerminus_fla.tempeseff_36)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class tempeseff_36 extends MovieClip {
public function tempeseff_36(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 189
//Triariideath_510 (TempusTerminus_fla.Triariideath_510)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class Triariideath_510 extends MovieClip {
public function Triariideath_510(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package TempusTerminus_fla
Section 190
//Triariihart_509 (TempusTerminus_fla.Triariihart_509)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class Triariihart_509 extends MovieClip {
public function Triariihart_509(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package TempusTerminus_fla
Section 191
//Triariistllfire_492 (TempusTerminus_fla.Triariistllfire_492)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class Triariistllfire_492 extends MovieClip {
public var fire:MovieClip;
public function Triariistllfire_492(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 192
//tstfire_493 (TempusTerminus_fla.tstfire_493)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class tstfire_493 extends MovieClip {
public var gunPoint:MovieClip;
public function tstfire_493(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 193
//tupfireq_504 (TempusTerminus_fla.tupfireq_504)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class tupfireq_504 extends MovieClip {
public var gunPoint:MovieClip;
public function tupfireq_504(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TempusTerminus_fla
Section 194
//UMBRAATTACT_416 (TempusTerminus_fla.UMBRAATTACT_416)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class UMBRAATTACT_416 extends MovieClip {
public function UMBRAATTACT_416(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package TempusTerminus_fla
Section 195
//UMBRADEATH_418 (TempusTerminus_fla.UMBRADEATH_418)
package TempusTerminus_fla {
import flash.display.*;
public dynamic class UMBRADEATH_418 extends MovieClip {
public function UMBRADEATH_418(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package TempusTerminus_fla
Section 196
//ActorObject (ActorObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class ActorObject extends GameObject {
private var STATUS_STILL:uint;// = 0
private var hurt:int;
public var leftS:b2Shape;
public var currHealth:Number;
public var hanging:int;
private var STATUS_JUMP1:uint;// = 2
private var STATUS_JUMP2:uint;// = 3
public var hangJoint:b2Joint;
private var STATUS_HURT:uint;// = 5
public var onGround:Boolean;
private var STATUS_JUMP3:uint;// = 7
private var STATUS_DEATH1:uint;// = 11
private var STATUS_DEATH2:uint;// = 12
public var abd:b2Shape;
public var dead:int;
private var jointDef1:b2PrismaticJointDef;
private var STATUS_CRAWL:uint;// = 6
private var maxVel:b2Vec2;
private var actorWorld:b2World;
private var STATUS_HANG:uint;// = 8
public var vel:b2Vec2;
public var feet:b2Shape;
public var rightS:b2Shape;
private var tempMassData:b2MassData;
private var STATUS_DEATH:uint;// = 10
public var crouched:Boolean;
public var head:b2Shape;
private var STATUS_DUCK:uint;// = 4
private var charStatus:uint;
private var STATUS_DUCKHURT:uint;// = 13
private var STATUS_WALK:uint;// = 1
public function ActorObject(){
jointDef1 = new b2PrismaticJointDef();
vel = new b2Vec2();
maxVel = new b2Vec2();
tempMassData = new b2MassData();
STATUS_STILL = 0;
STATUS_WALK = 1;
STATUS_JUMP1 = 2;
STATUS_JUMP2 = 3;
STATUS_DUCK = 4;
STATUS_HURT = 5;
STATUS_DUCKHURT = 13;
STATUS_CRAWL = 6;
STATUS_DEATH = 10;
STATUS_DEATH1 = 11;
STATUS_DEATH2 = 12;
STATUS_JUMP3 = 7;
STATUS_HANG = 8;
super();
}
public function destroyAllShapes(){
var _local1:b2Shape;
var _local2:b2Shape;
var _local3:b2FilterData;
if (hangJoint != null){
leaveHang();
};
if (actorWorld == null){
actorWorld = (actorWorld = body.GetWorld());
};
_local1 = body.GetShapeList();
while (_local1) {
_local2 = _local1.GetNext();
_local3 = new b2FilterData();
_local3.categoryBits = 1;
_local3.maskBits = 8;
_local1.SetFilterData(_local3);
actorWorld.Refilter(_local1);
_local1 = _local2;
};
}
public function setFrame(){
if ((((Math.abs(vel.x) < 0.01)) && ((Math.abs(vel.y) < 1E-50)))){
if (crouched){
charStatus = STATUS_DUCK;
} else {
charStatus = STATUS_STILL;
};
} else {
if (!onGround){
if (vel.y < 1){
charStatus = STATUS_JUMP1;
} else {
if (vel.y > 1){
charStatus = STATUS_JUMP2;
} else {
charStatus = STATUS_JUMP3;
};
};
} else {
if (((((!(MainClass.leftKey)) && (!(MainClass.rightKey)))) && (!(crouched)))){
charStatus = STATUS_STILL;
} else {
if (crouched){
if (Math.abs(vel.x) > 2){
charStatus = STATUS_CRAWL;
};
} else {
if (Math.abs(vel.x) > 3){
charStatus = STATUS_WALK;
};
if ((((Math.abs(vel.x) > 1)) && ((Math.abs(vel.y) > 0)))){
charStatus = STATUS_WALK;
};
};
};
};
};
if (hanging == 1){
charStatus = STATUS_HANG;
};
if (hurt > 0){
if (crouched){
charStatus = STATUS_DUCKHURT;
} else {
charStatus = STATUS_HURT;
};
};
if ((((health <= 0)) && ((charStatus < STATUS_DEATH)))){
charStatus = STATUS_DEATH;
};
if (charStatus == STATUS_DEATH){
if (((((currHealth - health) < 10)) && (((currHealth - health) > 0)))){
charStatus = STATUS_DEATH1;
} else {
charStatus = STATUS_DEATH2;
};
};
if (charStatus == STATUS_HURT){
if ((graphic as MovieClip).currentFrame != 5){
(graphic as MovieClip).gotoAndStop(5);
};
if ((graphic as MovieClip).hurt != null){
if ((graphic as MovieClip).hurt.currentFrame == 6){
currHealth = health;
};
if ((graphic as MovieClip).hurt.arm.currentFrame != 1){
(graphic as MovieClip).hurt.arm.gotoAndStop(1);
};
};
} else {
if (charStatus == STATUS_DEATH1){
if ((graphic as MovieClip).currentFrame != 6){
(graphic as MovieClip).gotoAndStop(6);
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_DEATH);
};
};
};
} else {
if (charStatus == STATUS_DEATH2){
if ((graphic as MovieClip).currentFrame != 7){
(graphic as MovieClip).gotoAndStop(7);
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_DEATH);
};
};
};
} else {
if (charStatus == STATUS_WALK){
if ((graphic as MovieClip).currentFrame != 2){
(graphic as MovieClip).gotoAndStop(2);
};
if ((graphic as MovieClip).run != null){
if ((graphic as MovieClip).run.arm1.currentFrame != 1){
(graphic as MovieClip).run.arm1.gotoAndStop(1);
};
if ((graphic as MovieClip).run.arm2.currentFrame != 1){
(graphic as MovieClip).run.arm2.gotoAndStop(1);
};
};
} else {
if (charStatus == STATUS_STILL){
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.arm.currentFrame != 1){
(graphic as MovieClip).still.arm.gotoAndStop(1);
};
};
} else {
if ((((((charStatus == STATUS_DUCK)) || ((charStatus == STATUS_CRAWL)))) || ((charStatus == STATUS_DUCKHURT)))){
if ((graphic as MovieClip).currentFrame != 4){
(graphic as MovieClip).gotoAndStop(4);
};
if ((graphic as MovieClip).duck != null){
if (charStatus == STATUS_DUCK){
if ((graphic as MovieClip).duck.currentFrame > 4){
(graphic as MovieClip).duck.gotoAndStop(4);
};
} else {
if (charStatus == STATUS_CRAWL){
if (((((graphic as MovieClip).duck.currentFrame <= 4)) || (((graphic as MovieClip).duck.currentFrame > 75)))){
(graphic as MovieClip).duck.gotoAndPlay(5);
};
} else {
if ((graphic as MovieClip).duck.currentFrame < 76){
(graphic as MovieClip).duck.gotoAndPlay(76);
};
if ((graphic as MovieClip).duck.currentFrame == 81){
currHealth = health;
};
};
};
};
} else {
if (charStatus == STATUS_HANG){
if ((graphic as MovieClip).currentFrame != 8){
(graphic as MovieClip).gotoAndStop(8);
};
if ((graphic as MovieClip).hang != null){
if ((graphic as MovieClip).hang.arm.currentFrame != 1){
(graphic as MovieClip).hang.arm.gotoAndStop(1);
};
};
} else {
if ((((((charStatus == STATUS_JUMP1)) || ((charStatus == STATUS_JUMP2)))) || ((charStatus == STATUS_JUMP3)))){
if ((graphic as MovieClip).currentFrame != 3){
(graphic as MovieClip).gotoAndStop(3);
};
if ((graphic as MovieClip).jump != null){
if (charStatus == STATUS_JUMP1){
if ((graphic as MovieClip).jump.currentFrame > 9){
(graphic as MovieClip).jump.gotoAndPlay(1);
};
} else {
if (charStatus == STATUS_JUMP2){
if ((graphic as MovieClip).jump.currentFrame <= 9){
(graphic as MovieClip).jump.gotoAndPlay(10);
};
} else {
if (charStatus == STATUS_JUMP3){
if ((graphic as MovieClip).jump.currentFrame <= 20){
(graphic as MovieClip).jump.gotoAndPlay(21);
};
};
};
};
if ((graphic as MovieClip).jump.arm.currentFrame != 1){
(graphic as MovieClip).jump.arm.gotoAndStop(1);
};
if (charStatus == STATUS_JUMP1){
if ((graphic as MovieClip).jump.arm.currentFrame > 9){
(graphic as MovieClip).jump.arm.gotoAndPlay(1);
};
} else {
if (charStatus == STATUS_JUMP2){
if ((graphic as MovieClip).jump.arm.currentFrame <= 9){
(graphic as MovieClip).jump.arm.gotoAndPlay(10);
};
} else {
if (charStatus == STATUS_JUMP3){
if ((graphic as MovieClip).jump.arm.currentFrame <= 20){
(graphic as MovieClip).jump.arm.gotoAndPlay(21);
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public function setWorld(){
actorWorld = body.GetWorld();
health = GParams.heroHealth;
currHealth = health;
hurt = 0;
dead = 101;
hanging = 0;
crouched = MainClass.downKey;
}
public function initVelocities(){
vel.Set(0, 0);
maxVel.Set(7, 20);
}
public function resetInertia(){
tempMassData.mass = this.body.GetMass();
tempMassData.center = this.body.GetLocalCenter();
tempMassData.I = 0;
mass = tempMassData;
this.body.SetMass(tempMassData);
}
public function makeHeavy(){
tempMassData.mass = 1000000;
tempMassData.center = this.body.GetLocalCenter();
tempMassData.I = 0;
this.body.SetMass(tempMassData);
}
private function refilter(){
if (actorWorld != null){
if (head.m_body != null){
actorWorld.Refilter(head);
};
};
}
public function isHeavy():Boolean{
if (this.body.GetMass() >= 1000000){
return (true);
};
return (false);
}
public function makeLight(){
this.body.SetMass(mass);
}
override public function update(){
super.update();
if (crouched){
head.m_isSensor = true;
refilter();
} else {
head.m_isSensor = false;
refilter();
};
if (charStatus != STATUS_HANG){
if (((!((charStatus == STATUS_HURT))) && (!((charStatus == STATUS_DUCKHURT))))){
hanging = 0;
};
};
if ((((((charStatus == STATUS_JUMP1)) || ((charStatus == STATUS_JUMP2)))) || ((charStatus == STATUS_JUMP3)))){
hangable();
};
if (hurt > 0){
hurt--;
};
if (currHealth > health){
hurt = 6;
currHealth = health;
};
setFrame();
}
private function hangable():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2AABB;
var _local4:int;
var _local5:Array;
var _local6:int;
var _local7:b2Body;
var _local8:int;
var _local9:b2Shape;
if (actorWorld == null){
return (false);
};
if (hangJoint != null){
return (false);
};
_local1 = this.body.GetPosition().x;
_local2 = this.body.GetPosition().y;
_local3 = new b2AABB();
_local3.lowerBound.Set((_local1 + (4 / GParams.physScale)), (_local2 - (30 / GParams.physScale)));
_local3.upperBound.Set((_local1 - (4 / GParams.physScale)), (_local2 - (45 / GParams.physScale)));
_local4 = 10;
_local5 = new Array();
_local6 = actorWorld.Query(_local3, _local5, _local4);
_local7 = null;
_local8 = 0;
while (_local8 < _local6) {
_local9 = (_local5[_local8] as b2Shape);
if (_local9.IsSensor()){
_local7 = _local9.GetBody();
if ((_local7.GetUserData() is ChainObject)){
if (hanging == 0){
hanging = 1;
jointDef1 = new b2PrismaticJointDef();
jointDef1.body1 = this.body;
jointDef1.body2 = _local7;
jointDef1.localAnchor1 = new b2Vec2(0, (-42.5 / GParams.physScale));
jointDef1.localAnchor2 = new b2Vec2(0, 0);
jointDef1.localAxis1 = new b2Vec2(0, 1);
jointDef1.lowerTranslation = 0;
jointDef1.upperTranslation = 0;
jointDef1.enableLimit = true;
hangJoint = (actorWorld.CreateJoint(jointDef1) as b2PrismaticJoint);
};
return (true);
};
};
_local8++;
};
return (false);
}
public function move(){
if (health <= 0){
return;
};
if (hurt != 0){
return;
};
vel = this.body.GetLinearVelocity();
if (((MainClass.upKey) && (!(crouched)))){
if (onGround){
vel.Add(new b2Vec2(0, -(maxVel.y)));
};
if (hanging == 1){
vel.y = -(maxVel.y);
leaveHang();
};
};
if (MainClass.leftKey){
graphic.scaleX = -1;
if (hanging == 1){
this.body.ApplyForce(new b2Vec2(-10, 0), body.GetPosition());
} else {
vel.Add(new b2Vec2((-(maxVel.x) / 3), 0));
};
};
if (MainClass.rightKey){
graphic.scaleX = 1;
if (hanging == 1){
this.body.ApplyForce(new b2Vec2(10, 0), body.GetPosition());
} else {
vel.Add(new b2Vec2((maxVel.x / 3), 0));
};
};
if (crouched){
if ((((Math.abs(vel.x) > (maxVel.x / 3))) && (!((vel.x == 0))))){
vel.x = (((maxVel.x / 3) * Math.abs(vel.x)) / vel.x);
};
if (hanging == 1){
leaveHang();
};
} else {
if ((((Math.abs(vel.x) > maxVel.x)) && (!((vel.x == 0))))){
vel.x = ((maxVel.x * Math.abs(vel.x)) / vel.x);
};
};
if ((((Math.abs(vel.y) > maxVel.y)) && (!((vel.y == 0))))){
vel.y = ((maxVel.y * Math.abs(vel.y)) / vel.y);
};
this.body.SetLinearVelocity(vel);
setFrame();
}
public function leaveHang(){
if (hangJoint == null){
throw (new Error("cant leave as not hanging"));
};
actorWorld.DestroyJoint(hangJoint);
hangJoint = null;
hanging = 0;
}
}
}//package
Section 197
//Aether (Aether)
package {
import flash.display.*;
public dynamic class Aether extends MovieClip {
public function Aether(){
addFrameScript(35, frame36, 36, frame37);
}
function frame36(){
gotoAndPlay(1);
}
function frame37(){
stop();
}
}
}//package
Section 198
//AetherTalisman (AetherTalisman)
package {
import flash.display.*;
public dynamic class AetherTalisman extends MovieClip {
public function AetherTalisman(){
addFrameScript(67, frame68, 68, frame69);
}
function frame68(){
gotoAndPlay(1);
}
function frame69(){
stop();
}
}
}//package
Section 199
//Arrow (Arrow)
package {
import flash.display.*;
public dynamic class Arrow extends MovieClip {
}
}//package
Section 200
//Barrel (Barrel)
package {
import flash.display.*;
public dynamic class Barrel extends MovieClip {
}
}//package
Section 201
//BarrelExp (BarrelExp)
package {
import flash.display.*;
public dynamic class BarrelExp extends MovieClip {
}
}//package
Section 202
//Base1 (Base1)
package {
import flash.display.*;
public dynamic class Base1 extends BitmapData {
public function Base1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 203
//Base4 (Base4)
package {
import flash.display.*;
public dynamic class Base4 extends BitmapData {
public function Base4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 204
//Base5 (Base5)
package {
import flash.display.*;
public dynamic class Base5 extends BitmapData {
public function Base5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 205
//Base6 (Base6)
package {
import flash.display.*;
public dynamic class Base6 extends BitmapData {
public function Base6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 206
//BG1 (BG1)
package {
import flash.display.*;
public dynamic class BG1 extends BitmapData {
public function BG1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 207
//BG1E1 (BG1E1)
package {
import flash.display.*;
public dynamic class BG1E1 extends MovieClip {
}
}//package
Section 208
//BG1E1a (BG1E1a)
package {
import flash.display.*;
public dynamic class BG1E1a extends MovieClip {
}
}//package
Section 209
//BG1E2 (BG1E2)
package {
import flash.display.*;
public dynamic class BG1E2 extends MovieClip {
}
}//package
Section 210
//BG1E3 (BG1E3)
package {
import flash.display.*;
public dynamic class BG1E3 extends MovieClip {
}
}//package
Section 211
//BG3E1 (BG3E1)
package {
import flash.display.*;
public dynamic class BG3E1 extends MovieClip {
}
}//package
Section 212
//BG3E2 (BG3E2)
package {
import flash.display.*;
public dynamic class BG3E2 extends MovieClip {
}
}//package
Section 213
//BG3E3 (BG3E3)
package {
import flash.display.*;
public dynamic class BG3E3 extends MovieClip {
}
}//package
Section 214
//BG3E4 (BG3E4)
package {
import flash.display.*;
public dynamic class BG3E4 extends MovieClip {
}
}//package
Section 215
//BG3E5 (BG3E5)
package {
import flash.display.*;
public dynamic class BG3E5 extends MovieClip {
}
}//package
Section 216
//BG3E6 (BG3E6)
package {
import flash.display.*;
public dynamic class BG3E6 extends MovieClip {
}
}//package
Section 217
//BG3E7 (BG3E7)
package {
import flash.display.*;
public dynamic class BG3E7 extends MovieClip {
}
}//package
Section 218
//BG3E9 (BG3E9)
package {
import flash.display.*;
public dynamic class BG3E9 extends MovieClip {
}
}//package
Section 219
//BG4 (BG4)
package {
import flash.display.*;
public dynamic class BG4 extends BitmapData {
public function BG4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 220
//BG4E1 (BG4E1)
package {
import flash.display.*;
public dynamic class BG4E1 extends MovieClip {
}
}//package
Section 221
//BG4E2 (BG4E2)
package {
import flash.display.*;
public dynamic class BG4E2 extends MovieClip {
}
}//package
Section 222
//BG4E3 (BG4E3)
package {
import flash.display.*;
public dynamic class BG4E3 extends MovieClip {
public function BG4E3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 223
//BG4E4 (BG4E4)
package {
import flash.display.*;
public dynamic class BG4E4 extends MovieClip {
}
}//package
Section 224
//BG5 (BG5)
package {
import flash.display.*;
public dynamic class BG5 extends BitmapData {
public function BG5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 225
//BG5E1 (BG5E1)
package {
import flash.display.*;
public dynamic class BG5E1 extends MovieClip {
}
}//package
Section 226
//BG5E2 (BG5E2)
package {
import flash.display.*;
public dynamic class BG5E2 extends MovieClip {
}
}//package
Section 227
//BG5E3 (BG5E3)
package {
import flash.display.*;
public dynamic class BG5E3 extends MovieClip {
}
}//package
Section 228
//BG5E4 (BG5E4)
package {
import flash.display.*;
public dynamic class BG5E4 extends MovieClip {
}
}//package
Section 229
//BGbase2 (BGbase2)
package {
import flash.display.*;
public dynamic class BGbase2 extends BitmapData {
public function BGbase2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 230
//BGbase21 (BGbase21)
package {
import flash.display.*;
public dynamic class BGbase21 extends BitmapData {
public function BGbase21(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 231
//BGbase22 (BGbase22)
package {
import flash.display.*;
public dynamic class BGbase22 extends BitmapData {
public function BGbase22(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 232
//BGbase3 (BGbase3)
package {
import flash.display.*;
public dynamic class BGbase3 extends BitmapData {
public function BGbase3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 233
//BGbase32 (BGbase32)
package {
import flash.display.*;
public dynamic class BGbase32 extends BitmapData {
public function BGbase32(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 234
//BossObject (BossObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class BossObject extends GameObject {
protected var bulletB:b2Body;
protected var STATUS_WALK:uint;// = 1
protected var bulletBD:b2BodyDef;
private var currVel:int;// = 1
protected var charStatus:uint;
protected var healthBar:HealthBar;
protected var maxVel:b2Vec2;
protected var actorWorld:b2World;
protected var hurt:int;
public var rightEnemyS:b2Shape;
public var takeTurn:int;
public var vel:b2Vec2;
public var leftEnemyS:b2Shape;
public var alertness:int;// = 0
protected var currHealth:Number;
protected var STATUS_HURT:uint;// = 2
public var range:Number;// = 400
protected var STATUS_DEATH:uint;// = 3
protected var bulletSD:b2PolygonDef;
private var tempMassData:b2MassData;
public var standingPlatform:StaticObject;// = null
protected var bulletObject:GameObject;
protected var bulletSpeed:Number;
public var alertStatus:Boolean;// = false
protected var wait:int;
public var shootStatus:int;// = 0
protected var STATUS_STILL:uint;// = 0
public var turn:int;
public function BossObject(){
standingPlatform = null;
turn = GParams.LEFT;
takeTurn = GParams.LEFT;
alertStatus = false;
alertness = 0;
shootStatus = 0;
range = 400;
bulletSD = new b2PolygonDef();
bulletBD = new b2BodyDef();
vel = new b2Vec2();
maxVel = new b2Vec2();
currVel = 1;
tempMassData = new b2MassData();
STATUS_STILL = 0;
STATUS_WALK = 1;
STATUS_HURT = 2;
STATUS_DEATH = 3;
super();
}
public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
}
protected function shoot(){
}
override public function update(){
if (healthBar == null){
healthBar = new HealthBar();
};
if (health <= 0){
health = 0;
if ((graphic as MovieClip).contains(healthBar)){
(graphic as MovieClip).removeChild(healthBar);
};
};
health = int(health);
if (health > 0){
healthBar.hl.scaleX = (1 - (health / fullHealth));
} else {
healthBar.hl.scaleX = 0;
};
healthBar.y = -180;
if ((((health > 0)) && (!((graphic as MovieClip).contains(healthBar))))){
(graphic as MovieClip).addChild(healthBar);
};
if ((graphic as MovieClip).scaleX < 0){
if (healthBar.scaleX > 0){
healthBar.scaleX = -(healthBar.scaleX);
};
} else {
if (healthBar.scaleX < 0){
healthBar.scaleX = -(healthBar.scaleX);
};
};
if (this.body.GetAngle() != 0){
this.body.SetXForm(this.body.GetPosition(), 0);
};
super.update();
setFrame();
}
protected function setFrame(){
}
public function move(){
}
public function resetInertia(){
tempMassData.mass = this.body.GetMass();
tempMassData.center = this.body.GetLocalCenter();
tempMassData.I = 100000;
this.body.SetMass(tempMassData);
alertStatus = false;
alertness = 0;
shootStatus = 0;
standingPlatform = null;
turn = GParams.LEFT;
takeTurn = GParams.LEFT;
currHealth = health;
hurt = 0;
}
protected function think(){
}
}
}//package
Section 235
//BreakableObject (BreakableObject)
package {
import flash.display.*;
public class BreakableObject extends StaticObject {
public var breakTime:int;
override public function update(){
super.update();
if (breakTime >= 41){
if ((this.graphic as MovieClip).currentFrame > 1){
(this.graphic as MovieClip).gotoAndStop(1);
};
} else {
if (breakTime > 0){
if (((((this.graphic as MovieClip).currentFrame > 5)) || (((this.graphic as MovieClip).currentFrame < 2)))){
(this.graphic as MovieClip).gotoAndPlay(2);
};
} else {
if ((this.graphic as MovieClip).currentFrame < 6){
(this.graphic as MovieClip).gotoAndPlay(6);
};
};
};
}
}
}//package
Section 236
//BreakableWall (BreakableWall)
package {
import flash.display.*;
public dynamic class BreakableWall extends MovieClip {
public function BreakableWall(){
addFrameScript(0, frame1, 2, frame3, 65, frame66);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame66(){
stop();
}
}
}//package
Section 237
//BreakingPlatform (BreakingPlatform)
package {
import flash.display.*;
public dynamic class BreakingPlatform extends MovieClip {
public function BreakingPlatform(){
addFrameScript(0, frame1, 4, frame5, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame5(){
gotoAndPlay(2);
}
}
}//package
Section 238
//BreakSound (BreakSound)
package {
public dynamic class BreakSound extends CustomSound {
}
}//package
Section 239
//Bullet (Bullet)
package {
import flash.display.*;
public dynamic class Bullet extends MovieClip {
public function Bullet(){
addFrameScript(4, frame5, 5, frame6);
}
function frame6(){
stop();
}
function frame5(){
gotoAndPlay(1);
}
}
}//package
Section 240
//BulletObject (BulletObject)
package {
import Box2D.Common.Math.*;
public class BulletObject extends GameObject {
override public function update(){
var _local1:b2Vec2;
var _local2:Number;
_local1 = body.GetPosition();
_local2 = body.GetAngle();
graphic.x = (_local1.x * GParams.physScale);
graphic.y = (_local1.y * GParams.physScale);
if (((!((body.GetLinearVelocity().Length() == 0))) && (!(isStopped)))){
graphic.rotation = ((Math.atan2(body.GetLinearVelocity().y, body.GetLinearVelocity().x) * 180) / Math.PI);
} else {
if (velocity != null){
graphic.rotation = ((Math.atan2(velocity.y, velocity.x) * 180) / Math.PI);
};
};
}
}
}//package
Section 241
//Ceiling1 (Ceiling1)
package {
import flash.display.*;
public dynamic class Ceiling1 extends BitmapData {
public function Ceiling1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 242
//Ceiling4 (Ceiling4)
package {
import flash.display.*;
public dynamic class Ceiling4 extends BitmapData {
public function Ceiling4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 243
//Ceiling5 (Ceiling5)
package {
import flash.display.*;
public dynamic class Ceiling5 extends BitmapData {
public function Ceiling5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 244
//ChainHead (ChainHead)
package {
import flash.display.*;
public dynamic class ChainHead extends MovieClip {
}
}//package
Section 245
//ChainHeadObject (ChainHeadObject)
package {
public class ChainHeadObject extends GameObject {
}
}//package
Section 246
//ChainLink (ChainLink)
package {
import flash.display.*;
public dynamic class ChainLink extends MovieClip {
}
}//package
Section 247
//ChainObject (ChainObject)
package {
public class ChainObject extends GameObject {
}
}//package
Section 248
//Chariot (Chariot)
package {
import flash.display.*;
public dynamic class Chariot extends MovieClip {
public var hurt:MovieClip;
public var death:MovieClip;
public var still:MovieClip;
public var walk:MovieClip;
public function Chariot(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 249
//ChariotObject (ChariotObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import flash.geom.*;
public class ChariotObject extends EnemyObject {
private var tempNumber:Number;
private var laserSD:b2CircleDef;
private var tempInc:Number;
private var disX:Number;
private var disY:Number;
private var shootPoint:Point;
private var shootAngle:Number;
protected function shootLaser(){
var _local1:*;
if (actorWorld == null){
actorWorld = body.GetWorld();
tempNumber = 0;
tempInc = 1;
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.currentFrame != 2){
(graphic as MovieClip).still.gotoAndStop(2);
};
if ((graphic as MovieClip).still.firing != null){
if ((graphic as MovieClip).still.firing.gunPoint0 != null){
shootPoint = (graphic as MovieClip).still.firing.localToGlobal(new Point((graphic as MovieClip).still.firing.gunPoint0.x, (graphic as MovieClip).still.firing.gunPoint0.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
};
};
};
if (shootPoint == null){
return;
};
_local1 = 0;
while (_local1 < 5) {
bulletSpeed = 15;
laserSD = new b2CircleDef();
bulletBD = new b2BodyDef();
if (graphic.scaleX > 0){
bulletBD.position.Set(((shootPoint.x + (5 + (_local1 * 3))) / GParams.physScale), (shootPoint.y / GParams.physScale));
} else {
bulletBD.position.Set(((shootPoint.x - (5 + (_local1 * 3))) / GParams.physScale), (shootPoint.y / GParams.physScale));
};
bulletBD.isBullet = true;
laserSD.density = 1;
laserSD.filter.groupIndex = -1;
laserSD.restitution = 1;
bulletObject = (graphic.parent as Container).getBullet(2);
laserSD.radius = ((bulletObject.graphic.height / 2) / GParams.physScale);
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
laserSD.filter.categoryBits = (4 | 2);
laserSD.filter.maskBits = (4 | 2);
bulletB.CreateShape(laserSD);
bulletObject.init(bulletB);
bulletB.SetMassFromShapes();
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).generalArray.push(bulletObject);
if ((((_local1 == 1)) && ((shootStatus == 39)))){
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_GUN2);
};
};
};
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetAntiGravity(true);
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
laserSD = null;
bulletB = null;
bulletObject = null;
_local1++;
};
shootPoint = null;
}
protected function shootMissile(){
if (actorWorld == null){
actorWorld = body.GetWorld();
tempNumber = 0;
tempInc = 1;
};
if ((graphic as MovieClip).still != null){
shootPoint = (graphic as MovieClip).still.localToGlobal(new Point((graphic as MovieClip).still.gunPoint1.x, (graphic as MovieClip).still.gunPoint1.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
if ((graphic as MovieClip).still.missilefiring.currentFrame < 2){
(graphic as MovieClip).still.missilefiring.gotoAndPlay(2);
};
};
if (shootPoint == null){
return;
};
bulletSpeed = 5;
laserSD = new b2CircleDef();
bulletBD = new b2BodyDef();
if (graphic.scaleX > 0){
bulletBD.position.Set(((shootPoint.x + 5) / GParams.physScale), ((shootPoint.y - 5) / GParams.physScale));
} else {
bulletBD.position.Set(((shootPoint.x - 5) / GParams.physScale), ((shootPoint.y - 5) / GParams.physScale));
};
bulletBD.isBullet = true;
laserSD.density = 0.1;
bulletBD.linearDamping = 0;
bulletObject = (graphic.parent as Container).getBullet(3);
laserSD.radius = ((bulletObject.graphic.height / 2) / GParams.physScale);
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
laserSD.filter.categoryBits = (4 | 2);
laserSD.filter.maskBits = (4 | 2);
bulletB.CreateShape(laserSD);
bulletObject.init(bulletB);
bulletB.SetMassFromShapes();
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).worldArray.push(bulletObject);
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_LAUNCH);
};
};
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetAntiGravity(true);
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
laserSD = null;
bulletB = null;
bulletObject = null;
shootPoint = null;
}
override protected function setFrame(){
if (shootStatus < 450){
graphic.scaleX = turn;
};
if (maxVel.x != 0){
charStatus = STATUS_WALK;
} else {
charStatus = STATUS_STILL;
};
if (hurt > 0){
charStatus = STATUS_HURT;
};
if (health <= 0){
charStatus = STATUS_DEATH;
};
switch (charStatus){
case STATUS_WALK:
if ((graphic as MovieClip).currentFrame != 2){
(graphic as MovieClip).gotoAndStop(2);
};
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.stop();
};
} else {
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.play();
};
};
};
break;
case STATUS_STILL:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.firing != null){
if ((((shootStatus <= 100)) && ((shootStatus >= 98)))){
if ((graphic as MovieClip).still.currentFrame == 3){
if ((graphic as MovieClip).still.firing.currentFrame < 2){
(graphic as MovieClip).still.firing.gotoAndPlay(2);
};
};
};
if ((((shootStatus <= 40)) && ((shootStatus >= 38)))){
if ((graphic as MovieClip).still.currentFrame == 2){
if ((graphic as MovieClip).still.firing.currentFrame < 2){
(graphic as MovieClip).still.firing.gotoAndPlay(2);
};
};
};
};
};
break;
case STATUS_HURT:
if ((graphic as MovieClip).currentFrame != 3){
(graphic as MovieClip).gotoAndStop(3);
};
break;
case STATUS_DEATH:
if ((graphic as MovieClip).currentFrame != 4){
(graphic as MovieClip).gotoAndStop(4);
};
break;
};
}
override public function update(){
super.update();
if (hurt > 0){
hurt--;
};
if (currHealth > health){
hurt = 10;
currHealth = health;
};
setFrame();
}
override public function resetFrames(){
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.firing != null){
(graphic as MovieClip).still.firing.gotoAndStop(1);
(graphic as MovieClip).still.firing.rotation = 0;
};
};
}
override public function move(){
vel = this.body.GetLinearVelocity();
think();
if (body.IsSleeping()){
body.WakeUp();
};
vel.Set(maxVel.x, 0);
}
override public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
if (_arg1){
if ((((_arg2 < (graphic.x + (graphic.width / 2)))) && ((_arg2 > (graphic.x - (graphic.width / 2)))))){
alertStatus = true;
alertness = 90;
if (shootStatus < 60){
shootStatus = 100;
};
if (_arg2 > graphic.x){
graphic.scaleX = GParams.RIGHT;
} else {
graphic.scaleX = GParams.LEFT;
};
turn = graphic.scaleX;
takeTurn = turn;
shootAngle = 90;
};
if ((((_arg3 < (graphic.y + (graphic.height / 2)))) && ((_arg3 > (graphic.y - (graphic.height / 2)))))){
alertStatus = true;
alertness = 90;
if (shootStatus == 0){
shootStatus = 100;
};
if (_arg2 > graphic.x){
graphic.scaleX = GParams.RIGHT;
} else {
graphic.scaleX = GParams.LEFT;
};
turn = graphic.scaleX;
takeTurn = turn;
shootAngle = 0;
if ((((_arg2 < (graphic.x + graphic.width))) && ((_arg2 > (graphic.x - graphic.width))))){
shootAngle = -25;
};
};
} else {
if (alertness > 0){
alertness--;
};
if (alertness == 0){
alertStatus = false;
};
};
if ((((((shootStatus == 100)) || ((shootStatus == 80)))) || ((shootStatus == 50)))){
if (shootAngle == 0){
if (_arg3 < graphic.y){
shootAngle = (shootAngle * -1);
} else {
shootAngle = 0;
};
if ((graphic is Chariot)){
shootMissile();
};
};
};
if ((((shootStatus <= 100)) && ((shootStatus >= 80)))){
if (_arg3 < graphic.y){
if (shootAngle != -25){
if (shootAngle > 0){
shootAngle = (shootAngle * -1);
};
};
} else {
if (shootAngle != -25){
shootAngle = 0;
};
};
shootChain();
};
if ((((shootStatus <= 40)) && ((shootStatus >= 20)))){
if (shootAngle == 0){
if (_arg3 < graphic.y){
shootAngle = (shootAngle * -1);
};
shootLaser();
};
};
if (shootStatus > 0){
shootStatus--;
};
}
protected function shootChain(){
if (actorWorld == null){
actorWorld = body.GetWorld();
tempNumber = 0;
tempInc = 1;
};
shootAngle = (shootAngle + (((tempNumber - 3) * Math.PI) / 36));
tempNumber = (tempNumber + tempInc);
if (tempNumber >= 6){
tempInc = -1;
};
if (tempNumber <= 0){
tempInc = 1;
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.currentFrame != 3){
(graphic as MovieClip).still.gotoAndStop(3);
};
if ((graphic as MovieClip).still.firing != null){
(graphic as MovieClip).still.firing.rotation = ((-(shootAngle) * 180) / Math.PI);
shootPoint = (graphic as MovieClip).still.firing.localToGlobal(new Point((graphic as MovieClip).still.firing.gunPoint.x, (graphic as MovieClip).still.firing.gunPoint.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
};
};
if (shootPoint == null){
return;
};
bulletSpeed = 10;
bulletSD = new b2PolygonDef();
bulletBD = new b2BodyDef();
if (graphic.scaleX > 0){
bulletBD.position.Set(((shootPoint.x + 5) / GParams.physScale), (shootPoint.y / GParams.physScale));
} else {
bulletBD.position.Set(((shootPoint.x - 5) / GParams.physScale), (shootPoint.y / GParams.physScale));
};
bulletBD.isBullet = true;
bulletSD.density = 0.1;
bulletBD.linearDamping = 0;
bulletObject = (graphic.parent as Container).getBullet();
bulletSD.SetAsBox(((bulletObject.graphic.width / 2) / GParams.physScale), ((bulletObject.graphic.height / 2) / GParams.physScale));
bulletSD.filter.groupIndex = -2;
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
bulletSD.filter.categoryBits = (4 | 2);
bulletSD.filter.maskBits = (4 | 2);
bulletB.CreateShape(bulletSD);
bulletObject.init(bulletB);
bulletB.SetMassFromShapes();
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).worldArray.push(bulletObject);
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_GUN1);
};
};
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetAntiGravity(true);
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
bulletSD = null;
bulletB = null;
bulletObject = null;
shootPoint = null;
}
override protected function think(){
if (!alertStatus){
if (turn != takeTurn){
if (wait == 0){
wait = 60;
};
if (wait > 1){
wait--;
} else {
turn = takeTurn;
wait = 0;
};
maxVel.Set(0, 0);
} else {
maxVel.Set((turn * 2), 0);
wait = 0;
};
} else {
maxVel.Set(0, 0);
};
}
}
}//package
Section 250
//ChariotSimple (ChariotSimple)
package {
import flash.display.*;
public dynamic class ChariotSimple extends MovieClip {
public var hurt:MovieClip;
public var death:MovieClip;
public var still:MovieClip;
public var walk:MovieClip;
public function ChariotSimple(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 251
//ClayTalisman (ClayTalisman)
package {
import flash.display.*;
public dynamic class ClayTalisman extends MovieClip {
public function ClayTalisman(){
addFrameScript(29, frame30, 30, frame31);
}
function frame30(){
gotoAndPlay(1);
}
function frame31(){
stop();
}
}
}//package
Section 252
//Click1Sound (Click1Sound)
package {
public dynamic class Click1Sound extends CustomSound {
}
}//package
Section 253
//CodePage (CodePage)
package {
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class CodePage extends MovieClip {
public var codes:TextField;
public var __id1_:UIScrollBar;
private var heroCreated:Boolean;
public var editLevel:MovieClip;
public var errorScreen:MovieClip;
private var endCreated:Boolean;
public var playLevel:MovieClip;
public function CodePage(){
__setProp___id1__mcCodePage_elements_1();
}
private function verifyCode():int{
var _local1:uint;
heroCreated = false;
endCreated = false;
_local1 = 0;
while (_local1 < GParams.levelCode[0].length) {
if (GParams.levelCode[0][_local1][0] == "Hero"){
if (heroCreated){
return (1);
};
heroCreated = true;
};
if (GParams.levelCode[0][_local1][0] == "End"){
if (endCreated){
return (2);
};
endCreated = true;
};
_local1++;
};
if (!heroCreated){
return (3);
};
if (!endCreated){
return (4);
};
return (0);
}
private function showError(_arg1:int){
var _local2:String;
errorScreen.gotoAndPlay(2);
_local2 = new String("");
switch (_arg1){
case 1:
_local2 = "too many heroes";
break;
case 2:
_local2 = "too many end points";
break;
case 3:
_local2 = "no hero found";
break;
case 4:
_local2 = "no end point found";
break;
};
errorScreen.er.errorMsg.text = _local2;
}
public function init(){
playLevel.addEventListener(MouseEvent.CLICK, onPlayLevel);
editLevel.addEventListener(MouseEvent.CLICK, onEditLevel);
errorScreen.gotoAndStop(1);
}
public function removeListeners(){
playLevel.removeEventListener(MouseEvent.CLICK, onPlayLevel);
editLevel.removeEventListener(MouseEvent.CLICK, onEditLevel);
}
private function onEditLevel(_arg1:MouseEvent){
(this.parent as LevelEditor).generateLevel();
removeCodePage();
}
private function onPlayLevel(_arg1:MouseEvent){
var _local2:int;
_local2 = verifyCode();
if (_local2 == 0){
(this.parent as LevelEditor).beginLevel();
removeCodePage();
} else {
showError(_local2);
};
}
function __setProp___id1__mcCodePage_elements_1(){
try {
__id1_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id1_.direction = "vertical";
__id1_.scrollTargetName = "codes";
__id1_.visible = true;
try {
__id1_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
private function parse(){
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:uint;
GParams.levelCode[0].splice(0, GParams.levelCode[0].length);
_local1 = codes.text;
_local1 = (this.parent as LevelEditor).decode(_local1);
_local3 = "";
_local4 = -1;
_local5 = -1;
_local6 = 0;
while (_local6 < _local1.length) {
_local2 = _local1.charAt(_local6);
switch (_local2){
case "[":
_local4++;
GParams.levelCode[0][_local4] = new Array();
_local5 = 0;
_local3 = "";
_local2 = "";
break;
case ",":
case "]":
if (_local3 != ""){
var _temp1 = _local5;
_local5 = (_local5 + 1);
var _local7 = _temp1;
GParams.levelCode[0][_local4][_local7] = _local3;
};
_local3 = "";
_local2 = "";
break;
default:
_local3 = (_local3 + _local2);
break;
};
_local6++;
};
}
private function removeCodePage(){
removeListeners();
if (this.parent != null){
(this.parent as MovieClip).removeChild(this);
};
}
}
}//package
Section 254
//Container (Container)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
import flash.ui.*;
public class Container extends Sprite {
private var screenShake:Number;// = 0
var trailArray:Array;
private var bgContainer2:Sprite;
var tempusArray:Array;
private var bgContainer1:Sprite;
var PosX3:Number;
private var CListener:myContactListener;
private var scrollSpeedY:Number;
private var posX1:Number;
private var posX2:Number;
var PosY3:Number;
private var removing:Boolean;
private var scrollSpeedX:Number;
private var posY1:Number;
var generalArray:Array;
private var gravity:b2Vec2;
private var lightEffect:Array;
private var currB:b2Body;
private var i:uint;
private var j:uint;
private var k:uint;
private var n:b2Vec2;
private var posY2:Number;
var p:int;
private var bmpContainer:Bitmap;
public var picked:b2Body;
private var bg3Array:Array;
private var started:Boolean;
private var s:b2Shape;
private var currentLevelHeight:Number;
private var infiniteTempus:Number;
public var changeVelocity:b2Body;
public var mouseXWorldPhys:Number;
private var x1:int;
private var tempGameObject:GameObject;
private var y1:int;
private var scrollMargin:Number;// = 200
private var mouseJoint:b2MouseJoint;
var normal:b2Vec2;
private var tempB:b2Body;
private var bmpWall:BitmapData;
private var diffX:Number;
var staticWorldArray:Array;
var shapes:Array;
private var diffY:Number;
private var GOFactory:GameObjectFactory;
private var explosionEffect:Array;
private var doSleep:Boolean;
private var explosion:Array;
private var bg4Array:Array;
private var worldContainer:b2AABB;
private var tempBD:b2BodyDef;
private var tempSD:b2PolygonDef;
private var tempJoint:Array;
private var deferredMouseJointRemoval:Boolean;
var count:int;
private var currentLevelWidth:Number;
private var iterations:Number;
private var timeStep:Number;
private var bmpPlatform:BitmapData;
private var tempJointDef1:b2PrismaticJointDef;
private var tempusContainer:TempusContainer;
private var normalFilter:b2FilterData;
var segment:b2Segment;
private var bg1Array:Array;
private var tempJointDef:b2RevoluteJointDef;
private var tempBody1:b2Body;
private var tempusTime:Number;
private var tempBody2:b2Body;
var k_maxCount:int;
var particleArray:Array;
private var heroCollideFilter:b2FilterData;
private var n1:Number;
private var n2:Number;
private var bmp:Bitmap;
private var tempusFilter:b2FilterData;
private var infiniteHealth:Number;
public var world:b2World;
private var heroDead:DeathAnim;
private var DestroyList:Array;
public var Tempus:Boolean;
var tShape:b2Shape;
private var tempusFlash:TempusFlash;
var shape:Number;
var dist:Number;
var body:b2Body;
private var tempContact:myContactPoint;
private var damageFactor:Number;
var enemyArray:Array;
private var tempSD1:b2CircleDef;
private var Pointer1;
private var Pointer2;
private var myRect:Rectangle;
private var p1:b2Vec2;
private var p2:b2Vec2;
var lambda:Array;
private var bg2Array:Array;
public var mouseYWorldPhys:Number;
var aabb1:b2AABB;
private var temp:int;
private var mouseJoint1:b2MouseJoint;
private var crouching:int;
private var mousePointer:MousePointer;
private var bgContainer3:Sprite;
private var hero:ActorObject;
var inside:Boolean;
var worldArray:Array;
public function Container(){
scrollMargin = 200;
screenShake = 0;
super();
}
private function onMouse(_arg1:MouseEvent){
var _local2:GameObject;
if (hero.health <= 0){
return;
};
if (changeVelocity != null){
changeVelocity = null;
return;
};
if (picked != null){
deferredMouseJointRemoval = true;
return;
};
tempBody1 = GetBodyAtMouse(true);
tempBody2 = GetBodyAtMouse();
if (((!((tempBody1 == null))) || (!((tempBody2 == null))))){
if (tempBody1 != null){
if ((tempBody1.GetUserData() is PowerupObject)){
getPowerUp(tempBody1.GetUserData());
return;
};
};
if (tempBody2 != null){
_local2 = (tempBody2.GetUserData() as GameObject);
if (isPickable(_local2)){
_local2.makeDynamic();
picked = _local2.body;
createMouseJoint();
};
};
};
tempBody1 = null;
tempBody2 = null;
}
private function throwDebris(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:uint;
var _local5:uint;
_local4 = 10;
_local5 = 0;
while (_local5 < _local4) {
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set(((_arg1 + (12 * Math.cos((((2 * _local5) * Math.PI) / _local4)))) / GParams.physScale), ((_arg2 + (12 * Math.sin((((2 * _local5) * Math.PI) / _local4)))) / GParams.physScale));
tempSD.density = 0.1;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(_arg3);
worldArray.push(tempGameObject);
tempBD.isBullet = true;
tempB = world.CreateBody(tempBD);
tempSD.SetAsBox((3 / GParams.physScale), (3 / GParams.physScale));
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempB.CreateShape(tempSD);
tempGameObject.graphic.scaleX = 1;
tempGameObject.graphic.scaleY = 1;
tempGameObject.init(tempB);
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
tempGameObject.body.SetMassFromShapes();
tempGameObject.body.ApplyForce(new b2Vec2((1 * Math.cos((((2 * _local5) * Math.PI) / _local4))), (-1 * Math.sin((((2 * _local5) * Math.PI) / _local4)))), tempGameObject.body.GetWorldCenter());
tempGameObject.saveData();
tempGameObject.saveVelocity();
tempBD = null;
tempSD = null;
tempB = null;
tempGameObject = null;
_local5++;
};
}
private function onMouseOver(_arg1:MouseEvent){
Mouse.hide();
if (_arg1.buttonDown == false){
if (picked != null){
deferredMouseJointRemoval = true;
};
};
}
public function getBullet(_arg1:uint=0):GameObject{
return (GOFactory.getObject((_arg1 + 50)));
}
private function createGameObject(_arg1:Array){
var _local2:*;
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set((_arg1[1] / GParams.physScale), (_arg1[2] / GParams.physScale));
if ((_arg1[0] is String)){
_arg1[0] = getDefinitionByName(_arg1[0]);
};
switch (_arg1[0]){
case Platform:
tempSD.friction = 0.9;
tempGameObject = GOFactory.getObject(3);
staticWorldArray.push(tempGameObject);
tempSD.filter.categoryBits = ((4 | 2) | 8);
tempSD.filter.maskBits = ((4 | 2) | 1);
break;
case Wall:
tempGameObject = GOFactory.getObject(1);
staticWorldArray.push(tempGameObject);
tempSD.filter.categoryBits = ((4 | 2) | 8);
tempSD.filter.maskBits = ((4 | 2) | 1);
break;
case End:
tempGameObject = GOFactory.getObject(30);
staticWorldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.isSensor = true;
break;
case ReflectiveWall:
tempGameObject = GOFactory.getObject(9);
worldArray.push(tempGameObject);
tempSD.density = 20;
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
break;
case Hero:
tempBD.linearDamping = 0.9;
tempBD.angularDamping = 0.01;
tempBD.isBullet = true;
tempSD.density = 0.2;
tempSD.friction = 0.01;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(10);
hero = (tempGameObject as ActorObject);
tempSD.filter.categoryBits = ((4 | 2) | 32);
tempSD.filter.maskBits = ((4 | 2) | 0x0100);
_arg1[4] = 1;
_arg1[5] = 1;
break;
case Crate:
tempSD.friction = 0.9;
tempBD.linearDamping = 0.01;
tempBD.angularDamping = 0.01;
tempSD.density = 20;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(2);
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
break;
case Stone:
tempBD.linearDamping = 0.01;
tempBD.angularDamping = 0.01;
tempSD.density = 20;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(6);
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
break;
case Barrel:
tempBD.linearDamping = 0.01;
tempBD.angularDamping = 0.01;
tempSD.density = 20;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(4);
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
break;
case BarrelExp:
tempBD.linearDamping = 0.01;
tempBD.angularDamping = 0.01;
tempSD.density = 20;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(5);
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
break;
case Piston:
addPiston(_arg1[1], _arg1[2]);
return;
case Invisible:
addFallingObjects(_arg1[1], _arg1[2], _arg1[4], _arg1[5]);
return;
case BreakableWall:
addWallObjects(_arg1[1], _arg1[2], _arg1[5], _arg1[3]);
return;
case BreakingPlatform:
addBreakableObjects(_arg1[1], _arg1[2], _arg1[4], _arg1[3]);
return;
case SwingChain:
addSwingChains(_arg1[1], _arg1[2], _arg1[5]);
return;
case HangChain:
addChains(_arg1[1], _arg1[2], _arg1[4], _arg1[5]);
return;
case RollingBarrel:
addRollingBarrel(_arg1[1], _arg1[2], _arg1[4]);
return;
case RollingBarrelExp:
addRollingBarrelExp(_arg1[1], _arg1[2], _arg1[4]);
return;
case Peacekeeper:
tempSD.density = 10;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(11);
enemyArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
_arg1[4] = 0.3;
_arg1[5] = 1;
(this.parent as MainClass).enemyCount++;
break;
case Turret:
tempSD.density = 0;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempSD.isSensor = true;
tempGameObject = GOFactory.getObject(61);
enemyArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
_arg1[4] = 1;
_arg1[5] = 1;
break;
case Enforcer:
tempSD.density = 10;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(12);
enemyArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
_arg1[4] = 0.25;
_arg1[5] = 1;
(this.parent as MainClass).enemyCount++;
break;
case Gladiator:
tempSD.density = 10;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(13);
enemyArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
_arg1[4] = 0.3;
_arg1[5] = 1;
(this.parent as MainClass).enemyCount++;
break;
case Triarii:
tempSD.density = 10;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(14);
enemyArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
_arg1[4] = 0.15;
_arg1[5] = 0.95;
(this.parent as MainClass).enemyCount++;
break;
case PGuard:
tempSD.density = 1;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(15);
enemyArray.push(tempGameObject);
tempSD.filter.categoryBits = 2;
tempSD.filter.maskBits = 4;
_arg1[4] = 1;
_arg1[5] = 1;
(this.parent as MainClass).enemyCount++;
break;
case PUmbra:
tempSD.density = 1;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(16);
tempusArray.push(tempGameObject);
tempSD.filter.categoryBits = 2;
tempSD.filter.maskBits = 4;
_arg1[4] = 1;
_arg1[5] = 1;
(this.parent as MainClass).enemyCount++;
break;
case Chariot:
tempSD.density = 10;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(17);
enemyArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
_arg1[4] = 0.3;
_arg1[5] = 0.8;
(this.parent as MainClass).enemyCount++;
break;
case ChariotSimple:
tempSD.density = 10;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(29);
enemyArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
_arg1[4] = 0.3;
_arg1[5] = 0.6;
(this.parent as MainClass).enemyCount++;
break;
case Phobos:
tempSD.density = 10;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(18);
enemyArray.push(tempGameObject);
tempSD.filter.categoryBits = 2;
tempSD.filter.maskBits = 4;
tempSD.filter.groupIndex = -1;
_arg1[4] = 0.5;
_arg1[5] = 1;
break;
case Deimos:
tempSD.density = 10;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(19);
tempusArray.push(tempGameObject);
tempSD.filter.categoryBits = 4;
tempSD.filter.maskBits = 2;
tempSD.filter.groupIndex = -1;
_arg1[4] = 0.5;
_arg1[5] = 1;
break;
case Mars:
tempSD.density = 10;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(20);
generalArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.filter.groupIndex = -1;
_arg1[4] = 0.5;
_arg1[5] = 1;
break;
case ClayTalisman:
tempGameObject = GOFactory.getObject(40);
generalArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.isSensor = true;
break;
case StoneTalisman:
tempGameObject = GOFactory.getObject(41);
generalArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.isSensor = true;
break;
case Aether:
tempGameObject = GOFactory.getObject(42);
generalArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.isSensor = true;
break;
case RubyTalisman:
tempGameObject = GOFactory.getObject(43);
generalArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.isSensor = true;
break;
case AetherTalisman:
tempGameObject = GOFactory.getObject(44);
generalArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.isSensor = true;
break;
default:
_local2 = bgContainer2.addChild(new (_arg1[0]));
_local2.x = _arg1[1];
_local2.y = _arg1[2];
if ((_local2 is Pit)){
bgContainer1.addChild(_local2);
_local2.scaleX = _arg1[4];
};
if ((_local2 is BG1E1)){
_local2 = this.addChild(new BG1E1a());
_local2.x = (_arg1[1] - 19);
_local2.y = (_arg1[2] + 12.3);
lightEffect.push(_local2);
};
_local2 = null;
return;
};
tempB = world.CreateBody(tempBD);
if (((((!((tempGameObject is ReflectiveObject))) && (!((tempGameObject is PowerupObject))))) && (!((tempGameObject is EndObject))))){
(tempGameObject.graphic as MovieClip).gotoAndStop(1);
if ((tempGameObject is EnemyObject)){
(tempGameObject as EnemyObject).resetFrames();
};
if ((tempGameObject is MarsObject)){
(tempGameObject as MarsObject).resetFrames();
};
} else {
(tempGameObject.graphic as MovieClip).gotoAndPlay(1);
};
tempGameObject.graphic.rotation = 0;
tempGameObject.graphic.scaleX = 1;
tempGameObject.graphic.scaleY = 1;
if (hero == tempGameObject){
tempSD.SetAsOrientedBox((((tempGameObject.graphic.width * _arg1[4]) / 2) / GParams.physScale), ((((tempGameObject.graphic.height * _arg1[5]) / 4) - 1) / GParams.physScale), new b2Vec2(0, (-((((tempGameObject.graphic.height * _arg1[5]) / 4) - 1)) / GParams.physScale)), 0);
hero.head = tempB.CreateShape(tempSD);
tempSD.SetAsOrientedBox((((tempGameObject.graphic.width * _arg1[4]) / 2) / GParams.physScale), ((((tempGameObject.graphic.height * _arg1[5]) / 4) - 1) / GParams.physScale), new b2Vec2(0, ((((tempGameObject.graphic.height * _arg1[5]) / 4) - 1) / GParams.physScale)), 0);
hero.abd = tempB.CreateShape(tempSD);
tempSD.SetAsOrientedBox(((((tempGameObject.graphic.width * _arg1[4]) / 2) - 1) / GParams.physScale), (1 / GParams.physScale), new b2Vec2(0, ((((tempGameObject.graphic.height * _arg1[5]) / 2) - 1) / GParams.physScale)), 0);
tempSD.friction = 0.9;
hero.feet = tempB.CreateShape(tempSD);
} else {
if ((tempGameObject is PeacekeeperObject)){
tempSD.SetAsOrientedBox((((tempGameObject.graphic.width * _arg1[4]) / 2) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 8) / GParams.physScale), new b2Vec2(0, (-((((tempGameObject.graphic.height * _arg1[5]) * 3) / 8)) / GParams.physScale)), 0);
(tempGameObject as PeacekeeperObject).head = tempB.CreateShape(tempSD);
tempSD.SetAsOrientedBox((((tempGameObject.graphic.width * _arg1[4]) / 2) / GParams.physScale), ((((tempGameObject.graphic.height * 3) * _arg1[5]) / 8) / GParams.physScale), new b2Vec2(0, ((((tempGameObject.graphic.height * _arg1[5]) * 1) / 8) / GParams.physScale)), 0);
tempB.CreateShape(tempSD);
} else {
if (((((((!((tempGameObject is MarsObject))) && (!((tempGameObject is StaticObject))))) && (!((tempGameObject is PraetorianObject))))) && (!((tempGameObject is ReflectiveObject))))){
tempSD.SetAsBox((((tempGameObject.graphic.width * _arg1[4]) / 2) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 2) / GParams.physScale));
tempB.CreateShape(tempSD);
};
if ((tempGameObject is ReflectiveObject)){
tempSD.SetAsBox(((10 / 2) / GParams.physScale), ((65 / 2) / GParams.physScale));
tempB.CreateShape(tempSD);
};
if ((tempGameObject is StaticObject)){
tempSD.SetAsBox(((((tempGameObject.graphic.width * _arg1[4]) / 2) - 2) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 2) / GParams.physScale));
tempB.CreateShape(tempSD);
tempSD.SetAsOrientedBox((2 / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 2) / GParams.physScale), new b2Vec2(((-2 + ((tempGameObject.graphic.width * _arg1[4]) / 2)) / GParams.physScale), 0), 0);
(tempGameObject as StaticObject).rightS = tempB.CreateShape(tempSD);
tempSD.SetAsOrientedBox((2 / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 2) / GParams.physScale), new b2Vec2(((2 - ((tempGameObject.graphic.width * _arg1[4]) / 2)) / GParams.physScale), 0), 0);
(tempGameObject as StaticObject).leftS = tempB.CreateShape(tempSD);
if ((tempGameObject.graphic is Platform)){
paintPlatform(_arg1[1], _arg1[2], (tempGameObject.graphic.width * _arg1[4]), (tempGameObject.graphic.height * _arg1[5]), _arg1[3]);
};
if ((tempGameObject.graphic is Wall)){
paintWall(_arg1[1], _arg1[2], (tempGameObject.graphic.width * _arg1[4]), (tempGameObject.graphic.height * _arg1[5]), _arg1[3]);
};
};
};
};
if ((tempGameObject is PraetorianObject)){
tempSD.SetAsOrientedBox((((tempGameObject.graphic.width * _arg1[4]) / 4) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale), new b2Vec2(0, 0), 0);
tempB.CreateShape(tempSD);
tempB.SetAntiGravity(true);
(tempGameObject as PraetorianObject).startPoint = new Point(_arg1[1], _arg1[2]);
(tempGameObject as PraetorianObject).reSet();
};
if ((tempGameObject is PhobosObject)){
tempSD.filter.categoryBits = 2;
tempSD.filter.maskBits = 4;
tempSD.filter.groupIndex = -1;
tempSD.SetAsOrientedBox((((tempGameObject.graphic.width * _arg1[4]) / 4) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale), new b2Vec2(((3 * ((tempGameObject.graphic.width * _arg1[4]) / 4)) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale)), 0);
tempSD.isSensor = true;
tempSD.friction = 0.01;
tempSD.density = 0;
(tempGameObject as BossObject).rightEnemyS = tempB.CreateShape(tempSD);
tempSD.filter.categoryBits = 2;
tempSD.filter.maskBits = 4;
tempSD.filter.groupIndex = -1;
tempSD.SetAsOrientedBox((((tempGameObject.graphic.width * _arg1[4]) / 4) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale), new b2Vec2(((-3 * ((tempGameObject.graphic.width * _arg1[4]) / 4)) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale)), 0);
tempSD.isSensor = true;
tempSD.friction = 0.01;
tempSD.density = 0;
(tempGameObject as BossObject).leftEnemyS = tempB.CreateShape(tempSD);
};
if ((tempGameObject is DeimosObject)){
tempSD.filter.categoryBits = 4;
tempSD.filter.maskBits = 2;
tempSD.filter.groupIndex = -1;
tempSD.SetAsOrientedBox((((tempGameObject.graphic.width * _arg1[4]) / 4) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale), new b2Vec2(((3 * ((tempGameObject.graphic.width * _arg1[4]) / 4)) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale)), 0);
tempSD.isSensor = true;
tempSD.friction = 0.01;
tempSD.density = 0;
(tempGameObject as BossObject).rightEnemyS = tempB.CreateShape(tempSD);
tempSD.filter.categoryBits = 4;
tempSD.filter.maskBits = 2;
tempSD.filter.groupIndex = -1;
tempSD.SetAsOrientedBox((((tempGameObject.graphic.width * _arg1[4]) / 4) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale), new b2Vec2(((-3 * ((tempGameObject.graphic.width * _arg1[4]) / 4)) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale)), 0);
tempSD.isSensor = true;
tempSD.friction = 0.01;
tempSD.density = 0;
(tempGameObject as BossObject).leftEnemyS = tempB.CreateShape(tempSD);
};
if ((tempGameObject is MarsObject)){
tempSD.SetAsOrientedBox((((tempGameObject.graphic.width * _arg1[4]) / 2) / GParams.physScale), ((((3 * tempGameObject.graphic.height) * _arg1[5]) / 16) / GParams.physScale), new b2Vec2(0, ((-3 * ((tempGameObject.graphic.height * _arg1[5]) / 32)) / GParams.physScale)), 0);
tempB.CreateShape(tempSD);
tempSD.filter.categoryBits = 1;
tempSD.filter.maskBits = (4 | 2);
tempSD.filter.groupIndex = -1;
tempSD.SetAsOrientedBox((((tempGameObject.graphic.width * _arg1[4]) / 2) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale), new b2Vec2(0, (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale)), 0);
tempB.CreateShape(tempSD);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.filter.groupIndex = -1;
tempSD.SetAsOrientedBox(((3 * ((tempGameObject.graphic.width * _arg1[4]) / 8)) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale), new b2Vec2(((2 * ((tempGameObject.graphic.width * _arg1[4]) / 8)) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale)), 0);
tempSD.isSensor = true;
tempSD.friction = 0.01;
tempSD.density = 0;
(tempGameObject as BossObject).rightEnemyS = tempB.CreateShape(tempSD);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.filter.groupIndex = -1;
tempSD.SetAsOrientedBox(((3 * ((tempGameObject.graphic.width * _arg1[4]) / 8)) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale), new b2Vec2(((-2 * ((tempGameObject.graphic.width * _arg1[4]) / 8)) / GParams.physScale), (((tempGameObject.graphic.height * _arg1[5]) / 4) / GParams.physScale)), 0);
tempSD.isSensor = true;
tempSD.friction = 0.01;
tempSD.density = 0;
(tempGameObject as BossObject).leftEnemyS = tempB.CreateShape(tempSD);
};
tempGameObject.graphic.scaleX = _arg1[4];
tempGameObject.graphic.scaleY = _arg1[5];
if ((tempGameObject is EnemyObject)){
tempGameObject.graphic.scaleX = 1;
tempGameObject.graphic.scaleY = 1;
};
tempGameObject.init(tempB);
tempGameObject.body.SetXForm(tempGameObject.body.GetPosition(), (_arg1[3] * (Math.PI / 180)));
if (tempGameObject != hero){
tempGameObject.update();
};
addChild(tempGameObject.graphic);
if ((tempGameObject is MarsObject)){
addChild((tempGameObject as MarsObject).graphic2);
lightEffect.push((tempGameObject as MarsObject).graphic2);
};
if ((tempGameObject is PowerupObject)){
setChildIndex(tempGameObject.graphic, 1);
};
tempB.SetUserData(tempGameObject);
tempBD = null;
tempSD = null;
tempB = null;
tempGameObject = null;
tempSD1 = null;
}
private function initPaintBG(){
bmpContainer = new Bitmap(new BitmapData(currentLevelWidth, currentLevelHeight, true, 0));
if (!contains(bmpContainer)){
addChild(bmpContainer);
};
bmpContainer.x = 0;
bmpContainer.y = 0;
switch (getLevelType(MainClass.currentLevel)){
case 1:
bmpPlatform = new Platform1(1000, 30);
bmpWall = new Wall1(150, 1000);
break;
case 2:
case 3:
bmpPlatform = new Platform2(1000, 10);
bmpWall = new Wall2(56, 1000);
break;
case 4:
bmpPlatform = new Platform4(1000, 30);
bmpWall = new Wall4(150, 1000);
break;
case 5:
case 6:
bmpPlatform = new Platform5(1000, 30);
bmpWall = new Wall5(150, 1000);
break;
default:
bmpPlatform = new Platform2(1000, 30);
bmpWall = new Wall2(150, 1000);
break;
};
}
public function removeListeners(){
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, onEnter);
};
if (this.hasEventListener(MouseEvent.MOUSE_DOWN)){
this.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse);
};
if (this.hasEventListener(MouseEvent.MOUSE_UP)){
this.removeEventListener(MouseEvent.MOUSE_UP, onMouseLeave);
};
if (this.hasEventListener(MouseEvent.MOUSE_OVER)){
this.removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
};
if (this.hasEventListener(MouseEvent.MOUSE_OUT)){
this.removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
};
Mouse.show();
}
private function getLevelType(_arg1:uint):uint{
switch (_arg1){
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
return (1);
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
return (2);
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
return (3);
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
return (4);
case 29:
case 30:
case 31:
case 32:
case 33:
return (5);
case 34:
case 35:
return (6);
};
return (1);
}
public function ceilingFall(){
var _local1:Number;
var _local2:uint;
screenShake = 20;
if (generalArray == null){
return;
};
if (generalArray.length == 0){
return;
};
_local1 = generalArray[0].graphic.x;
_local2 = 0;
i = 50;
while (i < 1400) {
if ((((_local1 > (i + 150))) || ((_local1 < (i - 150))))){
dropStone(i);
};
i = (i + 100);
};
}
public function setListeners(){
if (!this.hasEventListener(Event.ENTER_FRAME)){
this.addEventListener(Event.ENTER_FRAME, onEnter, false, 0, true);
};
if (!this.hasEventListener(MouseEvent.MOUSE_DOWN)){
this.addEventListener(MouseEvent.MOUSE_DOWN, onMouse, false, 0, true);
};
if (!this.hasEventListener(MouseEvent.MOUSE_UP)){
this.addEventListener(MouseEvent.MOUSE_UP, onMouseLeave, false, 0, true);
};
if (!this.hasEventListener(MouseEvent.MOUSE_OVER)){
this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true);
};
if (!this.hasEventListener(MouseEvent.MOUSE_OUT)){
this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true);
};
}
private function loadLevel(){
createBG();
currentLevelWidth = GParams.levelWidth[MainClass.currentLevel];
currentLevelHeight = (GParams.levelHeight[MainClass.currentLevel] + 50);
initPaintBG();
Tempus = false;
tempusTime = 100;
j = 0;
while (j < GParams.levelCode[MainClass.currentLevel].length) {
if (GParams.levelCode[MainClass.currentLevel][j][0] != Platform){
createGameObject(GParams.levelCode[MainClass.currentLevel][j]);
};
j++;
};
j = 0;
while (j < GParams.levelCode[MainClass.currentLevel].length) {
if (GParams.levelCode[MainClass.currentLevel][j][0] == Platform){
createGameObject(GParams.levelCode[MainClass.currentLevel][j]);
};
j++;
};
resetPaintBG();
resetBG();
i = 0;
while (i < worldArray.length) {
worldArray[i].body.SetMassFromShapes();
setChildIndex(worldArray[i].graphic, (numChildren - 1));
i++;
};
i = 0;
while (i < enemyArray.length) {
enemyArray[i].body.SetMassFromShapes();
enemyArray[i].resetInertia();
enemyArray[i].standingPlatform = null;
setChildIndex(enemyArray[i].graphic, (numChildren - 1));
i++;
};
i = 0;
while (i < tempusArray.length) {
tempusArray[i].body.SetMassFromShapes();
tempusArray[i].resetInertia();
tempusArray[i].standingPlatform = null;
setChildIndex(tempusArray[i].graphic, (numChildren - 1));
i++;
};
i = 0;
while (i < generalArray.length) {
generalArray[i].body.SetMassFromShapes();
if (((!((generalArray[i] is PowerupObject))) && (!((generalArray[i] is InvisibleObject))))){
generalArray[i].resetInertia();
generalArray[i].standingPlatform = null;
};
setChildIndex(generalArray[i].graphic, (numChildren - 1));
i++;
};
initialiseHero();
if (lightEffect != null){
i = 0;
while (i < lightEffect.length) {
setChildIndex(lightEffect[i], (numChildren - 1));
i++;
};
};
i = 0;
while (i < worldArray.length) {
worldArray[i].saveData();
worldArray[i].saveVelocity();
i++;
};
i = 0;
while (i < enemyArray.length) {
enemyArray[i].saveData();
enemyArray[i].saveVelocity();
i++;
};
i = 0;
while (i < tempusArray.length) {
tempusArray[i].saveData();
tempusArray[i].saveVelocity();
i++;
};
this.scrollRect = new Rectangle(0, 0, GParams.screenWidth, GParams.screenHeight);
}
private function onEnter(_arg1:Event){
if (deferredMouseJointRemoval){
removeMouseJoint();
};
if (hero.health <= 0){
MainClass.spaceKey = Tempus;
};
mouseXWorldPhys = (mouseX / GParams.physScale);
mouseYWorldPhys = (mouseY / GParams.physScale);
if (mouseJoint){
p1.x = mouseXWorldPhys;
p1.y = mouseYWorldPhys;
p2.x = (mouseXWorldPhys + 1);
p2.y = mouseYWorldPhys;
mouseJoint.SetTarget(p1);
mouseJoint1.SetTarget(p2);
};
if (contains(heroDead)){
heroDead.x = myRect.x;
heroDead.y = myRect.y;
};
if (MainClass.currentLevel == 34){
if (enemyArray.length == 0){
i = 0;
while (i < staticWorldArray.length) {
if ((staticWorldArray[i] is EndObject)){
staticWorldArray[i].body.SetXForm(new b2Vec2((700 / GParams.physScale), (600 / GParams.physScale)), staticWorldArray[i].body.GetAngle());
staticWorldArray[i].update();
};
i++;
};
};
};
if (tempJoint != null){
i = 0;
while (i < tempJoint.length) {
tempJoint[i].SetMaxMotorForce(10000);
if (!Tempus){
if (tempJoint[i].GetJointTranslation() <= tempJoint[i].GetLowerLimit()){
tempJoint[(i + 1)] = true;
};
if (tempJoint[i].GetJointTranslation() >= tempJoint[i].GetUpperLimit()){
tempJoint[(i + 1)] = false;
};
if (tempJoint[(i + 1)]){
tempJoint[i].SetMotorSpeed((10 + (i / 3)));
} else {
tempJoint[i].SetMotorSpeed((-10 - (i / 3)));
};
} else {
tempJoint[i].SetMotorSpeed(0);
};
i = (i + 2);
};
};
if (lightEffect != null){
i = 0;
while (i < lightEffect.length) {
setChildIndex(lightEffect[i], (numChildren - 1));
i++;
};
};
if (!contains(mousePointer)){
addChild(mousePointer);
};
MouseUpdate();
if (MainClass.pauseFlag){
if (!(this.parent as MainClass).containsOptions()){
Mouse.show();
(this.parent as MainClass).createOptions();
};
return;
};
if (screenShake != 0){
this.x = screenShake;
if (screenShake < 0){
screenShake++;
};
screenShake = (screenShake * -1);
};
if (changeVelocity != null){
setAngle();
};
i = 0;
while (i < trailArray.length) {
diffX = (hero.graphic.x - trailArray[i].x);
diffY = (hero.graphic.y - trailArray[i].y);
if ((((Math.abs(diffX) > 25)) || ((Math.abs(diffY) > 25)))){
trailArray[i].x = (trailArray[i].x + (diffX / 10));
trailArray[i].y = (trailArray[i].y + (diffY / 10));
trailArray[i].scaleX = (trailArray[i].scaleX * 0.95);
trailArray[i].scaleY = trailArray[i].scaleX;
addParticle(trailArray[i].x, trailArray[i].y);
} else {
removeChild(trailArray[i]);
(trailArray[i] as MovieClip).gotoAndStop((trailArray[i] as MovieClip).totalFrames);
getPower(trailArray[i]);
trailArray.splice(i, 1);
i--;
};
i++;
};
i = 0;
while (i < particleArray.length) {
particleArray[i].alpha = (particleArray[i].alpha - 0.05);
if (particleArray[i].alpha <= 0){
removeChild(particleArray[i]);
(particleArray[i] as MovieClip).gotoAndStop((particleArray[i] as MovieClip).totalFrames);
particleArray.splice(i, 1);
i--;
};
i++;
};
if (!GParams.saveLevel){
if (stage.focus != null){
stage.focus = this;
} else {
MainClass.leftKey = false;
MainClass.upKey = false;
MainClass.rightKey = false;
MainClass.keyPressed = false;
MainClass.downKey = false;
MainClass.spaceKeyClickable = true;
stage.focus = this;
};
};
scrollScreen();
if (((MainClass.spaceKey) && (!(Tempus)))){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_ENTERTEMPUS);
(this.parent as MainClass).soundController.playMusic(SoundController.MUSIC_TEMPUS);
Tempus = true;
tempusFlash.x = hero.graphic.x;
tempusFlash.y = hero.graphic.y;
tempusFlash.gotoAndPlay(2);
if (changeVelocity){
changeVelocity = null;
};
i = 0;
while (i < worldArray.length) {
worldArray[i].saveVelocity();
if ((worldArray[i] is MarsMissileObject)){
(worldArray[i] as MarsMissileObject).stopMissile();
};
if ((worldArray[i] is GooBulletObject)){
s = worldArray[i].body.GetShapeList();
while (s) {
s.SetFilterData(heroCollideFilter);
world.Refilter(s);
s = s.GetNext();
};
s = null;
};
i++;
};
i = 0;
while (i < enemyArray.length) {
enemyArray[i].saveVelocity();
i++;
};
i = 0;
while (i < tempusArray.length) {
if ((tempusArray[i] is TempusMissileObject)){
(tempusArray[i] as TempusMissileObject).startMissile();
};
if ((tempusArray[i] is TempusBulletObject)){
s = tempusArray[i].body.GetShapeList();
while (s) {
s.SetFilterData(tempusFilter);
world.Refilter(s);
s = s.GetNext();
};
s = null;
};
i++;
};
if (infiniteTempus <= 0){
if (MainClass.difficulty != 0){
if (tempusTime > 0){
tempusTime = (tempusTime - 10);
} else {
if (hero.health > 0){
hero.health = (hero.health - 10);
hero.currHealth = (hero.currHealth - 10);
};
};
};
};
} else {
if (((!(MainClass.spaceKey)) && (Tempus))){
(this.parent as MainClass).soundController.playMusic(SoundController.MUSIC_INGAME);
Tempus = false;
tempusFlash.x = hero.graphic.x;
tempusFlash.y = hero.graphic.y;
tempusFlash.gotoAndPlay(12);
if (changeVelocity){
changeVelocity = null;
};
i = 0;
while (i < worldArray.length) {
if ((worldArray[i] is MarsMissileObject)){
(worldArray[i] as MarsMissileObject).startMissile();
};
if ((worldArray[i] is GooBulletObject)){
s = worldArray[i].body.GetShapeList();
while (s) {
s.SetFilterData(normalFilter);
world.Refilter(s);
s = s.GetNext();
};
s = null;
};
i++;
};
i = 0;
while (i < tempusArray.length) {
tempusArray[i].saveVelocity();
if ((tempusArray[i] is TempusMissileObject)){
(tempusArray[i] as TempusMissileObject).stopMissile();
};
if ((tempusArray[i] is TempusBulletObject)){
s = tempusArray[i].body.GetShapeList();
while (s) {
s.SetFilterData(heroCollideFilter);
world.Refilter(s);
s = s.GetNext();
};
s = null;
};
i++;
};
};
};
if (picked != null){
if (picked.GetUserData() == null){
picked = null;
} else {
(picked.GetUserData() as GameObject).showVelocity();
};
};
if (changeVelocity != null){
if (changeVelocity.GetUserData() != null){
(changeVelocity.GetUserData() as GameObject).showVelocity();
};
};
if (Tempus){
if (infiniteTempus <= 0){
if (MainClass.difficulty == 0){
if (tempusTime > 0){
tempusTime = (tempusTime - 0.01);
} else {
if (hero.health > 0){
hero.health = (hero.health - 0.01);
hero.currHealth = (hero.currHealth - 0.01);
};
};
} else {
if (tempusTime > 0){
tempusTime = (tempusTime - 0.1);
} else {
if (hero.health > 0){
hero.health = (hero.health - 0.1);
hero.currHealth = (hero.currHealth - 0.1);
};
};
};
};
regulateTempus();
i = 0;
while (i < worldArray.length) {
if (((!((picked == null))) && ((picked == worldArray[i].body)))){
if (picked.IsStatic()){
worldArray[i].makeDynamic(true);
};
} else {
if (worldArray[i].body.IsDynamic()){
worldArray[i].makeStatic();
};
if ((worldArray[i] is InvisibleObject)){
if (!BodyAbove(worldArray[i])){
AddForDestruction(worldArray[i]);
};
};
};
i++;
};
i = 0;
while (i < enemyArray.length) {
if (((!((picked == null))) && ((picked == enemyArray[i].body)))){
if (picked.IsStatic()){
enemyArray[i].makeDynamic(true);
};
} else {
if (enemyArray[i].body.IsDynamic()){
enemyArray[i].makeStatic();
};
};
i++;
};
i = 0;
while (i < tempusArray.length) {
if (((!((picked == null))) && ((picked == tempusArray[i].body)))){
removeMouseJoint();
tempusArray[i].makeDynamic();
};
if (tempusArray[i].body.IsStatic()){
tempusArray[i].makeDynamic();
};
i++;
};
} else {
if (MainClass.difficulty != 2){
if (tempusTime < 100){
tempusTime = (tempusTime + 0.5);
};
};
i = 0;
while (i < worldArray.length) {
if (((!((picked == null))) && ((picked == worldArray[i].body)))){
removeMouseJoint();
worldArray[i].makeDynamic();
};
if (worldArray[i].body.IsStatic()){
worldArray[i].makeDynamic();
};
if ((worldArray[i] is InvisibleObject)){
if (canSee(worldArray[i].body.GetWorldCenter())){
if (worldArray[i].graphic.y < hero.graphic.y){
if (((((worldArray[i].graphic.x + (worldArray[i] as InvisibleObject).range) > hero.graphic.x)) && (((worldArray[i].graphic.x - (worldArray[i] as InvisibleObject).range) < hero.graphic.x)))){
AddForDestruction(worldArray[i]);
};
};
};
if (!BodyAbove(worldArray[i])){
AddForDestruction(worldArray[i]);
};
};
if ((worldArray[i] is BreakableObject)){
if ((worldArray[i] as BreakableObject).breakTime >= 41){
if (IsHeroAbove(worldArray[i])){
(worldArray[i] as BreakableObject).breakTime = 40;
};
} else {
if ((worldArray[i] as BreakableObject).breakTime > 0){
(worldArray[i] as BreakableObject).breakTime--;
} else {
AddForDestruction(worldArray[i]);
};
};
};
i++;
};
i = 0;
while (i < enemyArray.length) {
if (((!((picked == null))) && ((picked == enemyArray[i].body)))){
removeMouseJoint();
enemyArray[i].makeDynamic();
};
if (enemyArray[i].body.IsStatic()){
enemyArray[i].makeDynamic();
};
i++;
};
i = 0;
while (i < tempusArray.length) {
if (((!((picked == null))) && ((picked == tempusArray[i].body)))){
if (picked.IsStatic()){
tempusArray[i].makeDynamic(true);
};
} else {
if (tempusArray[i].body.IsDynamic()){
tempusArray[i].makeStatic();
};
};
i++;
};
};
if (((hero.isHeavy()) && ((hero.hanging == 1)))){
hero.body.SetAntiGravity(true);
} else {
hero.body.SetAntiGravity(false);
};
world.Step(timeStep, iterations);
handleContact();
handleFrozen();
if (infiniteTempus > 0){
tempusTime = 100;
infiniteTempus--;
};
if (infiniteHealth > 0){
hero.health = 100;
infiniteHealth--;
};
if (this.parent != null){
(this.parent as MainClass).refreshHud(hero.health, tempusTime, Tempus, infiniteTempus, infiniteHealth);
};
hero.update();
if (MainClass.downKey){
crouching++;
} else {
crouching = 0;
};
i = 0;
while (i < worldArray.length) {
worldArray[i].update();
if ((worldArray[i] is ChainHeadObject)){
setChildIndex(worldArray[i].graphic, 15);
};
if ((worldArray[i] is MissileObject)){
worldArray[i].reAlign(hero.graphic.x, hero.graphic.y);
} else {
if ((((((worldArray[i] is PistonObject)) || ((worldArray[i].graphic is Stone)))) || ((worldArray[i] is PistonHeadObject)))){
if (worldArray[i].health < 1000){
worldArray[i].health = (worldArray[i].health + 1000);
};
};
};
i++;
};
i = 0;
while (i < staticWorldArray.length) {
staticWorldArray[i].update();
i++;
};
i = 0;
while (i < generalArray.length) {
generalArray[i].update();
if ((generalArray[i] is MarsObject)){
if (Point.distance(new Point(generalArray[i].graphic.x, generalArray[i].graphic.y), new Point(hero.graphic.x, hero.graphic.y)) > generalArray[i].range){
generalArray[i].trackHero(false, hero.graphic.x, hero.graphic.y);
} else {
generalArray[i].trackHero(canSee(generalArray[i].body.GetWorldCenter()), hero.graphic.x, hero.graphic.y);
};
generalArray[i].move();
} else {
if ((generalArray[i] is LaserObject)){
if (generalArray[i].body.GetLinearVelocity().Length() < 10){
AddForDestruction(generalArray[i]);
};
};
};
i++;
};
i = 0;
while (i < enemyArray.length) {
enemyArray[i].update();
if (!Tempus){
if ((enemyArray[i] is PhobosObject)){
if (tempusArray.length <= 0){
return;
};
if (Point.distance(new Point(enemyArray[i].graphic.x, enemyArray[i].graphic.y), new Point(hero.graphic.x, hero.graphic.y)) > enemyArray[i].range){
enemyArray[i].trackHero(false, hero.graphic.x, hero.graphic.y);
} else {
if ((hero.graphic.x - enemyArray[0].graphic.x) > 0){
if ((enemyArray[0].graphic.x - tempusArray[0].graphic.x) > 25){
enemyArray[i].trackHero(canSee(enemyArray[i].body.GetPosition()), hero.graphic.x, hero.graphic.y);
} else {
enemyArray[i].trackHero(false, hero.graphic.x, hero.graphic.y);
};
} else {
if ((hero.graphic.x - enemyArray[0].graphic.x) <= 0){
if ((enemyArray[0].graphic.x - tempusArray[0].graphic.x) < -25){
enemyArray[i].trackHero(canSee(enemyArray[i].body.GetPosition()), hero.graphic.x, hero.graphic.y);
} else {
enemyArray[i].trackHero(false, hero.graphic.x, hero.graphic.y);
};
};
};
};
} else {
if (Point.distance(new Point(enemyArray[i].graphic.x, enemyArray[i].graphic.y), new Point(hero.graphic.x, hero.graphic.y)) > enemyArray[i].range){
enemyArray[i].trackHero(false, hero.graphic.x, hero.graphic.y);
} else {
if ((enemyArray[i] is TurretObject)){
enemyArray[i].trackHero(true, hero.graphic.x, hero.graphic.y);
} else {
enemyArray[i].trackHero(canSee(enemyArray[i].body.GetWorldCenter()), hero.graphic.x, hero.graphic.y);
};
};
};
enemyArray[i].move();
};
i++;
};
i = 0;
while (i < tempusArray.length) {
tempusArray[i].update();
if ((((tempusArray[i] is BossObject)) || ((tempusArray[i] is PraetorianUmbraObject)))){
if (Tempus){
if ((tempusArray[i] is DeimosObject)){
if (enemyArray.length <= 0){
return;
};
if (Point.distance(new Point(tempusArray[i].graphic.x, tempusArray[i].graphic.y), new Point(hero.graphic.x, hero.graphic.y)) > tempusArray[i].range){
tempusArray[i].trackHero(false, hero.graphic.x, hero.graphic.y);
} else {
if ((hero.graphic.x - tempusArray[0].graphic.x) > 0){
if ((tempusArray[0].graphic.x - enemyArray[0].graphic.x) > 25){
tempusArray[i].trackHero(canSee(tempusArray[i].body.GetPosition()), hero.graphic.x, hero.graphic.y);
} else {
tempusArray[i].trackHero(false, hero.graphic.x, hero.graphic.y);
};
} else {
if ((hero.graphic.x - tempusArray[0].graphic.x) <= 0){
if ((tempusArray[0].graphic.x - enemyArray[0].graphic.x) < -25){
tempusArray[i].trackHero(canSee(tempusArray[i].body.GetPosition()), hero.graphic.x, hero.graphic.y);
} else {
tempusArray[i].trackHero(false, hero.graphic.x, hero.graphic.y);
};
};
};
};
} else {
if (Point.distance(new Point(tempusArray[i].graphic.x, tempusArray[i].graphic.y), new Point(hero.graphic.x, hero.graphic.y)) > tempusArray[i].range){
tempusArray[i].trackHero(false, hero.graphic.x, hero.graphic.y);
} else {
tempusArray[i].trackHero(canSee(tempusArray[i].body.GetWorldCenter()), hero.graphic.x, hero.graphic.y);
};
};
tempusArray[i].move();
};
};
if ((tempusArray[i] is MissileObject)){
tempusArray[i].reAlign(hero.graphic.x, hero.graphic.y);
};
i++;
};
if (hero.health > 0){
if (MainClass.keyPressed){
hero.makeLight();
hero.body.WakeUp();
hero.move();
if (picked){
removeMouseJoint();
changeVelocity = null;
};
};
} else {
deathCall();
};
if (hero.graphic.y > (currentLevelHeight + 50)){
hero.health = 0;
infiniteHealth = 0;
if (this.parent != null){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_DEATH);
};
deathCall();
};
if (started){
started = false;
resetScreen();
};
}
private function getPowerUp(_arg1:PowerupObject){
if (AddForDestruction(_arg1)){
addTrail((_arg1.graphic as MovieClip), _arg1.graphic.x, _arg1.graphic.y);
};
}
private function onMouseLeave(_arg1:MouseEvent){
deferredMouseJointRemoval = true;
}
private function isPickable(_arg1:GameObject):Boolean{
if (Tempus){
if ((_arg1 is ReflectiveObject)){
return (true);
};
if ((_arg1 is BulletObject)){
return (true);
};
if ((_arg1 is DebrisObject)){
return (true);
};
if ((_arg1 is ShrapnelObject)){
return (true);
};
if ((_arg1 is DynamicObject)){
return (true);
};
if ((_arg1 is GrenadeObject)){
return (true);
};
if ((_arg1 is MarsStoneObject)){
return (true);
};
if ((_arg1 is SimpleMissileObject)){
return (true);
};
if ((_arg1 is PraetorianGuardObject)){
return (true);
};
if ((_arg1 is GooBulletObject)){
return (true);
};
} else {
if ((_arg1 is PraetorianUmbraObject)){
return (true);
};
if ((_arg1 is TempusBulletObject)){
return (true);
};
};
return (false);
}
private function addParticle(_arg1:Number, _arg2:Number){
var _local3:Particle;
_local3 = new Particle();
this.addChild(_local3);
_local3.x = _arg1;
_local3.y = _arg2;
_local3.rotation = (360 * Math.random());
particleArray.push(_local3);
}
private function getExplosion():uint{
k = 0;
while (k < 5) {
if (explosion[k].currentFrame == explosion[k].totalFrames){
return (k);
};
k++;
};
return (null);
}
private function canSee(_arg1:b2Vec2):Boolean{
var _local2:uint;
if (hero.health <= 0){
return (false);
};
if (lambda.length > 0){
lambda.splice(0, lambda.length);
};
segment.p1 = _arg1;
segment.p2 = hero.body.GetPosition();
shape = world.Raycast(segment, lambda, 10, false, null);
if (shape != 0){
_local2 = 0;
while (_local2 < lambda.length) {
if (!(lambda[_local2] as b2Shape).IsSensor()){
if (lambda[_local2].GetBody().GetUserData() == hero){
return (true);
};
return (false);
};
_local2++;
};
};
return (false);
}
private function removeBody(_arg1:GameObject){
var _local2:int;
if (isWalkingEnemy(_arg1)){
if ((_arg1 is PeacekeeperObject)){
spawnAether(_arg1.graphic.x, _arg1.graphic.y, 0.6);
};
if ((_arg1 is EnforcerObject)){
spawnAether(_arg1.graphic.x, _arg1.graphic.y, 0.7);
};
if ((_arg1 is GladiatorObject)){
spawnAether(_arg1.graphic.x, _arg1.graphic.y, 0.8);
};
if ((_arg1 is TriariiObject)){
spawnAether(_arg1.graphic.x, _arg1.graphic.y, 0.9);
};
if ((_arg1 is ChariotObject)){
spawnAether(_arg1.graphic.x, _arg1.graphic.y, 1);
};
};
if ((_arg1 is MarsObject)){
setEndPoint();
};
if ((((_arg1 is ActorObject)) && ((infiniteHealth > 0)))){
return;
};
if (_arg1.body.GetUserData() != null){
_arg1.body.SetUserData(null);
if ((_arg1 is ActorObject)){
(_arg1 as ActorObject).dead = 2000;
(_arg1 as ActorObject).destroyAllShapes();
};
} else {
if ((_arg1 is ActorObject)){
(_arg1 as ActorObject).dead--;
} else {
if (((!((_arg1 is PowerupObject))) || (!((_arg1 is BulletObject))))){
trace(_arg1);
throw (new Error("body not initialised properly"));
};
};
};
if ((_arg1 is ActorObject)){
if ((_arg1 as ActorObject).dead == 0){
world.DestroyBody(_arg1.body);
};
} else {
world.DestroyBody(_arg1.body);
};
_arg1.update();
if (((((((((((((!((_arg1 is EnemyObject))) && (!((_arg1 is ActorObject))))) && (!((_arg1 is BossObject))))) && (!((_arg1 is PowerupObject))))) && (!((_arg1 is DamageableObject))))) && (!((_arg1 is BreakableObject))))) && (!((_arg1 is MarsStoneObject))))){
removeChild(_arg1.graphic);
if ((_arg1.graphic is MovieClip)){
(_arg1.graphic as MovieClip).gotoAndStop((_arg1.graphic as MovieClip).totalFrames);
};
};
if ((_arg1 is MarsStoneObject)){
if ((_arg1.graphic as MovieClip).currentFrame <= 1){
(_arg1.graphic as MovieClip).gotoAndPlay(2);
};
};
if ((_arg1 is EnemyObject)){
(_arg1 as EnemyObject).removeHealthBar();
if (!removing){
if ((_arg1 is ChariotObject)){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_DEATH4);
} else {
if ((_arg1 is TriariiObject)){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_DEATH3);
} else {
if (!(_arg1 is PraetorianObject)){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_DEATH2);
};
};
};
};
};
if ((_arg1 is MarsObject)){
if (hero != null){
if (hero.health > 0){
setChildIndex(_arg1.graphic, getChildIndex(hero.graphic));
};
};
};
(_arg1 as GameObject).hideVelocity1();
_local2 = staticWorldArray.indexOf(_arg1);
if (_local2 != -1){
staticWorldArray.splice(_local2, 1);
};
_local2 = worldArray.indexOf(_arg1);
if (_local2 != -1){
worldArray.splice(_local2, 1);
} else {
_local2 = generalArray.indexOf(_arg1);
if (_local2 != -1){
generalArray.splice(_local2, 1);
} else {
_local2 = tempusArray.indexOf(_arg1);
if (_local2 != -1){
tempusArray.splice(_local2, 1);
} else {
_local2 = enemyArray.indexOf(_arg1);
if (_local2 != -1){
enemyArray.splice(_local2, 1);
} else {
if (_arg1 != hero){
};
};
};
};
};
}
public function remove(){
var _local1:b2Body;
var _local2:b2Body;
Mouse.show();
removing = true;
while (worldArray.length > 0) {
removeBody(worldArray[0]);
};
while (staticWorldArray.length > 0) {
removeBody(staticWorldArray[0]);
};
while (enemyArray.length > 0) {
if (((isWalkingEnemy(enemyArray[0])) || ((enemyArray[0] is PraetorianObject)))){
(this.parent as MainClass).enemyAlive++;
};
removeBody(enemyArray[0]);
};
while (generalArray.length > 0) {
removeBody(generalArray[0]);
};
while (tempusArray.length > 0) {
if ((tempusArray[0] is PraetorianObject)){
(this.parent as MainClass).enemyAlive++;
};
removeBody(tempusArray[0]);
};
if (tempJoint != null){
tempJoint.splice(0, tempJoint.length);
tempJoint = null;
};
if (lightEffect != null){
lightEffect.splice(0, lightEffect.length);
lightEffect = null;
};
if (trailArray != null){
while (trailArray.length > 0) {
removeChild(trailArray[0]);
(trailArray[0] as MovieClip).gotoAndStop((trailArray[0] as MovieClip).totalFrames);
trailArray.shift();
};
};
if (particleArray != null){
while (particleArray.length > 0) {
removeChild(particleArray[0]);
(particleArray[0] as MovieClip).gotoAndStop((particleArray[0] as MovieClip).totalFrames);
particleArray.shift();
};
};
if (hero.health > 0){
removeBody(hero);
};
while (this.numChildren > 0) {
if ((this.getChildAt(0) is MovieClip)){
(this.getChildAt(0) as MovieClip).gotoAndStop((this.getChildAt(0) as MovieClip).totalFrames);
};
this.removeChildAt(0);
};
_local1 = world.GetBodyList();
while (_local1) {
_local2 = _local1;
_local1 = _local1.GetNext();
world.DestroyBody(_local2);
};
removeTempus();
tempusContainer = null;
world = null;
removeListeners();
}
public function applyTempus(){
if (this.parent != null){
if (!this.parent.contains(tempusContainer)){
this.parent.addChild(tempusContainer);
};
(this.parent as MainClass).setChildIndex(tempusContainer, (this.parent.getChildIndex(this) + 1));
tempusContainer.mouseEnabled = false;
tempusContainer.mouseChildren = false;
};
}
private function addRollingBarrelExp(_arg1:Number, _arg2:Number, _arg3:Number){
tempBD = new b2BodyDef();
tempBD.position.Set((_arg1 / GParams.physScale), (_arg2 / GParams.physScale));
tempGameObject = new DynamicObject();
tempGameObject.graphic = new RollingBarrelExp();
worldArray.push(tempGameObject);
tempSD1 = new b2CircleDef();
tempSD1.filter.categoryBits = (4 | 2);
tempSD1.filter.maskBits = (4 | 2);
tempSD1.radius = (((tempGameObject.graphic.width * _arg3) / 2) / GParams.physScale);
tempSD1.localPosition.Set(0, 0);
tempSD1.density = 20;
tempSD1.friction = 0.5;
tempBD.angularDamping = 0.5;
tempB = world.CreateBody(tempBD);
tempB.CreateShape(tempSD1);
tempB.SetMassFromShapes();
tempGameObject.init(tempB);
tempGameObject.initHealth(GParams.barrelExpDamage, GParams.barrelExpHealth);
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
tempGameObject.graphic.scaleX = _arg3;
tempGameObject.graphic.scaleY = _arg3;
}
private function resetScreen(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
myRect = this.scrollRect;
if (hero.graphic.scaleX > 0){
_local1 = hero.graphic.x;
_local2 = (hero.graphic.x + 250);
} else {
_local1 = (hero.graphic.x - 250);
_local2 = hero.graphic.x;
};
if ((_local1 - myRect.x) < scrollMargin){
scrollSpeedX = ((scrollMargin - _local1) + myRect.x);
myRect.x = (myRect.x - scrollSpeedX);
if (myRect.x < 0){
myRect.x = 0;
};
};
if ((_local2 - myRect.x) > (GParams.screenWidth - scrollMargin)){
scrollSpeedX = (((_local2 - myRect.x) - GParams.screenWidth) + scrollMargin);
myRect.x = (myRect.x + scrollSpeedX);
if (myRect.x > (currentLevelWidth - GParams.screenWidth)){
myRect.x = (currentLevelWidth - GParams.screenWidth);
};
};
if (crouching > 40){
_local3 = hero.graphic.y;
_local4 = (hero.graphic.y + 100);
} else {
_local3 = (hero.graphic.y - 100);
_local4 = hero.graphic.y;
};
if ((_local3 - myRect.y) < scrollMargin){
scrollSpeedY = ((scrollMargin - _local3) + myRect.y);
myRect.y = (myRect.y - scrollSpeedY);
if (myRect.y < 0){
myRect.y = 0;
};
};
if ((_local4 - myRect.y) > (GParams.screenHeight - scrollMargin)){
scrollSpeedY = (((_local4 - myRect.y) - GParams.screenHeight) + scrollMargin);
myRect.y = (myRect.y + scrollSpeedY);
if (myRect.y > (currentLevelHeight - GParams.screenHeight)){
myRect.y = (currentLevelHeight - GParams.screenHeight);
};
};
this.scrollRect = myRect;
scrollBG();
}
public function addWallObjects(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set((_arg1 / GParams.physScale), (_arg2 / GParams.physScale));
tempGameObject = new DamageableObject();
tempGameObject.graphic = new BreakableWall();
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.SetAsBox(((tempGameObject.graphic.width / 2) / GParams.physScale), (((tempGameObject.graphic.height * _arg3) / 2) / GParams.physScale));
tempB = world.CreateBody(tempBD);
tempB.CreateShape(tempSD);
tempGameObject.init(tempB);
tempGameObject.initHealth(0, 2);
tempGameObject.graphic.scaleY = _arg3;
tempGameObject.body.SetXForm(tempGameObject.body.GetPosition(), (_arg4 * (Math.PI / 180)));
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
}
private function createBG(){
if (bgContainer3 == null){
bgContainer3 = new Sprite();
} else {
while (bgContainer3.numChildren > 0) {
bgContainer3.removeChildAt(0);
};
};
if (!contains(bgContainer3)){
addChild(bgContainer3);
};
bgContainer3.x = 0;
bgContainer3.y = 0;
if (bgContainer2 == null){
bgContainer2 = new Sprite();
} else {
while (bgContainer2.numChildren > 0) {
bgContainer2.removeChildAt(0);
};
};
if (!contains(bgContainer2)){
addChild(bgContainer2);
};
bgContainer2.x = 0;
bgContainer2.y = 0;
if (bgContainer1 == null){
bgContainer1 = new Sprite();
} else {
while (bgContainer1.numChildren > 0) {
bgContainer1.removeChildAt(0);
};
};
if (!contains(bgContainer1)){
addChild(bgContainer1);
};
bgContainer1.x = 0;
bgContainer1.y = 0;
switch (getLevelType(MainClass.currentLevel)){
case 1:
bg1Array = new Array(new Bitmap(new BG1(400, 300)), new Bitmap(new BG1(400, 300)), new Bitmap(new BG1(400, 300)), new Bitmap(new BG1(400, 300)), new Bitmap(new BG1(400, 300)), new Bitmap(new BG1(400, 300)), new Bitmap(new BG1(400, 300)), new Bitmap(new BG1(400, 300)), new Bitmap(new BG1(400, 300)));
i = 0;
while (i < 9) {
bgContainer2.addChild(bg1Array[i]);
i++;
};
bg2Array = new Array(new Bitmap(new Base1(450, 156)), new Bitmap(new Base1(450, 156)), new Bitmap(new Base1(450, 156)));
i = 0;
while (i < 3) {
bgContainer1.addChild(bg2Array[i]);
i++;
};
bg3Array = new Array(new Bitmap(new Ceiling1(450, 156)), new Bitmap(new Ceiling1(450, 156)), new Bitmap(new Ceiling1(450, 156)));
i = 0;
while (i < 3) {
bgContainer1.addChild(bg3Array[i]);
i++;
};
break;
case 2:
bg1Array = new Array(new Bitmap(new BGbase2(800, 100)), new Bitmap(new BGbase2(800, 100)));
bg2Array = new Array(new Bitmap(new BGbase21(800, 238)), new Bitmap(new BGbase21(800, 238)));
bg3Array = new Array(new Bitmap(new BGbase22(800, 800)), new Bitmap(new BGbase22(800, 800)));
bgContainer1.addChild(bg1Array[0]);
bgContainer1.addChild(bg1Array[1]);
bgContainer2.addChild(bg2Array[0]);
bgContainer2.addChild(bg2Array[1]);
bgContainer3.addChild(bg3Array[0]);
bgContainer3.addChild(bg3Array[1]);
break;
case 3:
bg2Array = new Array(new Bitmap(new BGbase3(800, 475)), new Bitmap(new BGbase3(800, 475)));
bg3Array = new Array(new Bitmap(new BGbase32(800, 800)), new Bitmap(new BGbase32(800, 800)));
bgContainer2.addChild(bg2Array[0]);
bgContainer2.addChild(bg2Array[1]);
bgContainer3.addChild(bg3Array[0]);
bgContainer3.addChild(bg3Array[1]);
break;
case 4:
bg1Array = new Array(new Bitmap(new BG4(400, 300)), new Bitmap(new BG4(400, 300)), new Bitmap(new BG4(400, 300)), new Bitmap(new BG4(400, 300)), new Bitmap(new BG4(400, 300)), new Bitmap(new BG4(400, 300)), new Bitmap(new BG4(400, 300)), new Bitmap(new BG4(400, 300)), new Bitmap(new BG4(400, 300)));
i = 0;
while (i < 9) {
bgContainer2.addChild(bg1Array[i]);
i++;
};
bg2Array = new Array(new Bitmap(new Base4(450, 71)), new Bitmap(new Base4(450, 71)), new Bitmap(new Base4(450, 71)));
i = 0;
while (i < 3) {
bgContainer1.addChild(bg2Array[i]);
i++;
};
bg3Array = new Array(new Bitmap(new Ceiling4(450, 85)), new Bitmap(new Ceiling4(450, 85)), new Bitmap(new Ceiling4(450, 85)));
i = 0;
while (i < 3) {
bgContainer1.addChild(bg3Array[i]);
i++;
};
break;
case 5:
bg1Array = new Array(new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)));
i = 0;
while (i < 9) {
bgContainer2.addChild(bg1Array[i]);
i++;
};
bg2Array = new Array(new Bitmap(new Base5(800, 250)), new Bitmap(new Base5(800, 250)), new Bitmap(new Base5(800, 250)));
i = 0;
while (i < 3) {
bgContainer1.addChild(bg2Array[i]);
i++;
};
bg3Array = new Array(new Bitmap(new Ceiling5(450, 150)), new Bitmap(new Ceiling5(450, 150)), new Bitmap(new Ceiling5(450, 150)));
i = 0;
while (i < 3) {
bgContainer1.addChild(bg3Array[i]);
i++;
};
break;
case 6:
bg1Array = new Array(new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)), new Bitmap(new BG5(400, 300)));
i = 0;
while (i < 9) {
bgContainer2.addChild(bg1Array[i]);
i++;
};
bg2Array = new Array(new Bitmap(new Base6(800, 250)), new Bitmap(new Base6(800, 250)), new Bitmap(new Base6(800, 250)));
i = 0;
while (i < 3) {
bgContainer1.addChild(bg2Array[i]);
i++;
};
bg3Array = new Array(new Bitmap(new Ceiling5(450, 150)), new Bitmap(new Ceiling5(450, 150)), new Bitmap(new Ceiling5(450, 150)));
i = 0;
while (i < 3) {
bgContainer1.addChild(bg3Array[i]);
i++;
};
break;
};
}
public function killHero(){
infiniteHealth = 0;
hero.health = 0;
}
private function removeMouseJoint(){
hero.makeLight();
deferredMouseJointRemoval = false;
if (picked == null){
mouseJoint = null;
mouseJoint1 = null;
return;
};
if (mouseJoint){
world.DestroyJoint(mouseJoint);
mouseJoint = null;
world.DestroyJoint(mouseJoint1);
mouseJoint1 = null;
if (isPickable((picked.GetUserData() as GameObject))){
if ((picked.GetUserData() as GameObject).velocity != null){
picked.SetLinearVelocity(new b2Vec2());
if ((picked.GetUserData() as GameObject).velocity.Length() > 1){
changeVelocity = picked;
};
};
(picked.GetUserData() as GameObject).makeStatic();
};
picked = null;
};
}
private function hurtHero(){
}
public function addBreakableObjects(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set((_arg1 / GParams.physScale), (_arg2 / GParams.physScale));
tempGameObject = new BreakableObject();
tempGameObject.graphic = new BreakingPlatform();
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.SetAsBox((((tempGameObject.graphic.width * _arg3) / 2) / GParams.physScale), ((tempGameObject.graphic.height / 2) / GParams.physScale));
tempB = world.CreateBody(tempBD);
tempB.CreateShape(tempSD);
tempGameObject.init(tempB);
(tempGameObject as BreakableObject).breakTime = 41;
tempGameObject.graphic.scaleX = _arg3;
tempGameObject.body.SetXForm(tempGameObject.body.GetPosition(), (_arg4 * (Math.PI / 180)));
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
}
private function IsHeroAbove(_arg1:GameObject):Boolean{
PosX3 = _arg1.body.GetPosition().x;
PosY3 = _arg1.body.GetPosition().y;
aabb1 = new b2AABB();
aabb1.lowerBound.Set((PosX3 - 1), (PosY3 - 2));
aabb1.upperBound.Set((PosX3 + 1), PosY3);
k_maxCount = 10;
shapes = new Array();
count = world.Query(aabb1, shapes, k_maxCount);
body = null;
p = 0;
while (p < count) {
tShape = (shapes[p] as b2Shape);
if (!tShape.IsSensor()){
body = tShape.GetBody();
if (body.GetUserData() == hero){
return (true);
};
};
p++;
};
return (false);
}
private function dropStone(_arg1:Number){
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set((_arg1 / GParams.physScale), ((50 + (Math.random() * 200)) / GParams.physScale));
tempSD.friction = 0.9;
tempBD.linearDamping = 0.01;
tempBD.angularDamping = 0.01;
tempSD.density = 2;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(100);
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
(tempGameObject.graphic as MovieClip).gotoAndStop(1);
tempGameObject.graphic.rotation = 0;
tempGameObject.graphic.scaleX = (0.5 + (0.3 * Math.random()));
tempGameObject.graphic.scaleY = (0.5 + (0.3 * Math.random()));
tempB = world.CreateBody(tempBD);
tempSD.SetAsBox((((3 * tempGameObject.graphic.width) / 8) / GParams.physScale), (((3 * tempGameObject.graphic.height) / 8) / GParams.physScale));
tempB.CreateShape(tempSD);
tempB.SetMassFromShapes();
tempGameObject.init(tempB);
tempGameObject.body.SetXForm(tempGameObject.body.GetPosition(), ((5 + (10 * Math.random())) * (Math.PI / 180)));
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
tempBD = null;
tempSD = null;
tempB = null;
tempGameObject = null;
}
private function getExplosionEffect():uint{
k = 0;
while (k < 5) {
if (explosionEffect[k].currentFrame == explosionEffect[k].totalFrames){
return (k);
};
k++;
};
return (null);
}
private function regulateTempus(){
if (tempusTime < 10){
if (this.parent.contains(tempusContainer)){
if (tempusContainer.currentFrame == 1){
tempusContainer.gotoAndPlay(2);
};
};
};
}
private function explode(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:uint;
_local4 = getExplosion();
setChildIndex(explosion[_local4], (numChildren - 1));
explosion[_local4].x = _arg1;
explosion[_local4].y = _arg2;
explosion[_local4].gotoAndPlay(1);
throwShrapnel(_arg1, _arg2, _arg3);
}
private function handleFrozen(){
i = 0;
while (i < worldArray.length) {
if (worldArray[i].body.IsFrozen()){
removeBody(worldArray[i]);
i--;
};
i++;
};
i = 0;
while (i < staticWorldArray.length) {
if (staticWorldArray[i].body.IsFrozen()){
removeBody(staticWorldArray[i]);
i--;
};
i++;
};
i = 0;
while (i < enemyArray.length) {
if (enemyArray[i].body.IsFrozen()){
removeBody(enemyArray[i]);
i--;
};
i++;
};
i = 0;
while (i < generalArray.length) {
if (generalArray[i].body.IsFrozen()){
removeBody(generalArray[i]);
i--;
};
i++;
};
i = 0;
while (i < tempusArray.length) {
if (tempusArray[i].body.IsFrozen()){
removeBody(tempusArray[i]);
i--;
};
i++;
};
}
public function isHeroAlive():Boolean{
if (hero == null){
return (false);
};
if (hero.health > 0){
return (true);
};
return (false);
}
private function paintPlatform(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
bmp = new Bitmap(new BitmapData(_arg3, 30, true, 0));
bmp.bitmapData.copyPixels(bmpPlatform, new Rectangle(0, 0, _arg3, 30), new Point(0, 0));
bmp.rotation = _arg5;
bmp.x = ((_arg1 - ((_arg3 / 2) * Math.cos(((_arg5 * Math.PI) / 180)))) + ((_arg4 / 2) * Math.sin(((_arg5 * Math.PI) / 180))));
bmp.y = ((_arg2 - ((_arg3 / 2) * Math.sin(((_arg5 * Math.PI) / 180)))) - ((_arg4 / 2) * Math.cos(((_arg5 * Math.PI) / 180))));
bmpContainer.bitmapData.draw(bmp, bmp.transform.matrix, null, null, null, true);
}
private function resetPaintBG(){
setChildIndex(bmpContainer, (numChildren - 1));
}
private function handleContact(){
hero.onGround = false;
hero.crouched = MainClass.downKey;
while (CListener.contactList.length > 0) {
tempContact = CListener.contactList.shift();
if ((((tempContact.shape1.GetBody() == null)) || ((tempContact.shape2.GetBody() == null)))){
} else {
Pointer1 = tempContact.shape1.GetBody().GetUserData();
Pointer2 = tempContact.shape2.GetBody().GetUserData();
if ((((Pointer1 == null)) || ((Pointer2 == null)))){
if ((((Pointer1 == null)) && ((Pointer2 is LaserObject)))){
AddForDestruction(Pointer2);
};
if ((((Pointer2 == null)) && ((Pointer1 is LaserObject)))){
AddForDestruction(Pointer1);
};
} else {
if ((((Pointer1 is EndObject)) || ((Pointer2 is EndObject)))){
if ((((((((Pointer1 == hero)) && ((Pointer2 is EndObject)))) && (!(tempContact.shape1.IsSensor())))) || ((((((Pointer2 == hero)) && ((Pointer1 is EndObject)))) && (!(tempContact.shape2.IsSensor())))))){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_GATE);
(this.parent as MainClass).showResult(1);
CListener.contactList.splice(0, CListener.contactList.length);
return;
};
} else {
if ((((Pointer1 is PowerupObject)) || ((Pointer2 is PowerupObject)))){
if ((((Pointer1 == hero)) && ((Pointer2 is PowerupObject)))){
if (!tempContact.shape1.IsSensor()){
Pointer2.health--;
getPowerUp(Pointer2);
};
};
if ((((Pointer2 == hero)) && ((Pointer1 is PowerupObject)))){
if (!tempContact.shape2.IsSensor()){
Pointer1.health--;
getPowerUp(Pointer1);
};
};
} else {
if ((((((tempContact.shape1 == hero.head)) && (tempContact.shape1.IsSensor()))) && ((hero.hanging == 0)))){
if (((shouldCrouch(Pointer2)) && (!(Pointer2.body.IsAntiGravity())))){
hero.crouched = true;
};
};
if ((((((tempContact.shape2 == hero.head)) && (tempContact.shape2.IsSensor()))) && ((hero.hanging == 0)))){
if (((shouldCrouch(Pointer1)) && (!(Pointer1.body.IsAntiGravity())))){
hero.crouched = true;
};
};
if (isWalkingEnemy(Pointer1)){
if (Pointer1.standingPlatform == null){
if ((Pointer2 is StaticObject)){
Pointer1.standingPlatform = Pointer2;
};
};
if (Pointer1.standingPlatform != null){
if (tempContact.shape2 == Pointer1.standingPlatform.leftS){
Pointer1.takeTurn = GParams.RIGHT;
} else {
if (tempContact.shape2 == Pointer1.standingPlatform.rightS){
Pointer1.takeTurn = GParams.LEFT;
};
};
};
};
if (isWalkingEnemy(Pointer2)){
if (Pointer2.standingPlatform == null){
if ((Pointer1 is StaticObject)){
Pointer2.standingPlatform = Pointer1;
};
};
if (Pointer2.standingPlatform != null){
if (tempContact.shape1 == Pointer2.standingPlatform.leftS){
Pointer2.takeTurn = GParams.RIGHT;
} else {
if (tempContact.shape1 == Pointer2.standingPlatform.rightS){
Pointer2.takeTurn = GParams.LEFT;
};
};
};
};
if ((((Pointer1 is PraetorianGuardObject)) && (!(Tempus)))){
if (!tempContact.shape2.IsSensor()){
if (Math.abs((Pointer1 as PraetorianObject).maxVel.y) > 2){
Pointer1.health = (Pointer1.health - 1);
};
if (Pointer2 == hero){
hero.health = (hero.health - Pointer1.damage);
Pointer1.alertness = -50;
if (Pointer1.health <= 0){
Pointer1.health = (Pointer1.health + 1);
};
};
if (!(Pointer2 is PraetorianObject)){
Pointer1.diveStatus = 4;
};
};
};
if ((((Pointer2 is PraetorianGuardObject)) && (!(Tempus)))){
if (!tempContact.shape1.IsSensor()){
if (Math.abs((Pointer2 as PraetorianObject).maxVel.y) > 2){
Pointer2.health = (Pointer2.health - 1);
};
if (Pointer1 == hero){
hero.health = (hero.health - Pointer2.damage);
Pointer2.alertness = -50;
if (Pointer2.health <= 0){
Pointer2.health = (Pointer2.health + 1);
};
};
if (!(Pointer1 is PraetorianObject)){
Pointer2.diveStatus = 4;
};
};
};
if ((((Pointer1 is PraetorianUmbraObject)) && (Tempus))){
if (!tempContact.shape2.IsSensor()){
if (Math.abs((Pointer1 as PraetorianObject).maxVel.y) > 2){
Pointer1.health = (Pointer1.health - 1);
};
if (Pointer2 == hero){
hero.health = (hero.health - Pointer1.damage);
Pointer1.alertness = -50;
if (Pointer1.health <= 0){
Pointer1.health = (Pointer1.health + 1);
};
};
if (!(Pointer2 is PraetorianObject)){
Pointer1.diveStatus = 4;
};
};
};
if ((((Pointer2 is PraetorianUmbraObject)) && (Tempus))){
if (!tempContact.shape1.IsSensor()){
if (Math.abs((Pointer2 as PraetorianObject).maxVel.y) > 2){
Pointer2.health = (Pointer2.health - 1);
};
if (Pointer1 == hero){
hero.health = (hero.health - Pointer2.damage);
Pointer2.alertness = -50;
if (Pointer2.health <= 0){
Pointer2.health = (Pointer2.health + 1);
};
};
if (!(Pointer1 is PraetorianObject)){
Pointer2.diveStatus = 4;
};
};
};
if ((((Pointer1 is MarsObject)) && ((Pointer2 == hero)))){
if (tempContact.shape1.IsSensor()){
(Pointer1 as MarsObject).whippable = true;
if ((Pointer1 as MarsObject).whiping){
if ((Pointer1 as MarsObject).whipped()){
if (hero.hanging == 0){
if ((Pointer1 as MarsObject).graphic.scaleX > 0){
Pointer2.body.ApplyImpulse(new b2Vec2(-1250, 1000), Pointer2.body.GetWorldCenter());
} else {
Pointer2.body.ApplyImpulse(new b2Vec2(1250, 1000), Pointer2.body.GetWorldCenter());
};
};
Pointer2.health = (Pointer2.health - 0.2);
};
};
} else {
if ((((tempContact.normal.y == -1)) && ((hero.hanging == 0)))){
Pointer2.body.SetLinearVelocity(new b2Vec2((-10 * Pointer1.graphic.scaleX), 0));
};
};
};
if ((((Pointer2 is MarsObject)) && ((Pointer1 == hero)))){
if (tempContact.shape2.IsSensor()){
(Pointer2 as MarsObject).whippable = true;
if ((Pointer2 as MarsObject).whiping){
if ((Pointer2 as MarsObject).whipped()){
if (hero.hanging == 0){
if ((Pointer2 as MarsObject).graphic.scaleX > 0){
Pointer1.body.ApplyImpulse(new b2Vec2(-1250, 1000), Pointer1.body.GetWorldCenter());
} else {
Pointer1.body.ApplyImpulse(new b2Vec2(1250, 1000), Pointer1.body.GetWorldCenter());
};
};
Pointer1.health = (Pointer1.health - 0.2);
};
};
} else {
if ((((tempContact.normal.y == 1)) && ((hero.hanging == 0)))){
Pointer1.body.SetLinearVelocity(new b2Vec2((-10 * Pointer2.graphic.scaleX), 0));
};
};
};
if (!Tempus){
if ((((Pointer1 is SemiBossObject)) && ((Pointer2 == hero)))){
if (tempContact.shape1.IsSensor()){
(Pointer1 as SemiBossObject).whippable = true;
if ((Pointer1 as SemiBossObject).whiping){
if ((Pointer1 as SemiBossObject).whipped()){
if (hero.hanging == 0){
if ((Pointer1 as SemiBossObject).graphic.scaleX > 0){
Pointer2.body.ApplyImpulse(new b2Vec2(1250, 1000), Pointer2.body.GetWorldCenter());
} else {
Pointer2.body.ApplyImpulse(new b2Vec2(-1250, 1000), Pointer2.body.GetWorldCenter());
};
};
Pointer2.health = (Pointer2.health - 0.5);
};
};
};
};
if ((((Pointer2 is SemiBossObject)) && ((Pointer1 == hero)))){
if (tempContact.shape2.IsSensor()){
(Pointer2 as SemiBossObject).whippable = true;
if ((Pointer2 as SemiBossObject).whiping){
if ((Pointer2 as SemiBossObject).whipped()){
if (hero.hanging == 0){
if ((Pointer2 as SemiBossObject).graphic.scaleX > 0){
Pointer1.body.ApplyImpulse(new b2Vec2(1250, 1000), Pointer1.body.GetWorldCenter());
} else {
Pointer1.body.ApplyImpulse(new b2Vec2(-1250, 1000), Pointer1.body.GetWorldCenter());
};
};
Pointer1.health = (Pointer1.health - 0.5);
};
};
};
};
if ((((Pointer1 is GooBulletObject)) || ((Pointer2 is GooBulletObject)))){
if ((((Pointer1 is GooBulletObject)) && (!(tempContact.shape2.IsSensor())))){
AddForDestruction(Pointer1);
if (((!((Pointer2 is StaticObject))) && (!((Pointer2 is TempusBulletObject))))){
Pointer2.health = (Pointer2.health - Pointer1.damage);
};
};
if ((((Pointer2 is GooBulletObject)) && (!(tempContact.shape1.IsSensor())))){
AddForDestruction(Pointer2);
if (((!((Pointer1 is StaticObject))) && (!((Pointer1 is TempusBulletObject))))){
Pointer1.health = (Pointer1.health - Pointer2.damage);
};
};
};
} else {
if ((((Pointer1 is DeimosObject)) && ((Pointer2 == hero)))){
if (tempContact.shape1.IsSensor()){
(Pointer1 as DeimosObject).whippable = true;
if ((Pointer1 as DeimosObject).whiping){
if ((Pointer1 as DeimosObject).whipped()){
if (hero.hanging == 0){
if ((Pointer1 as DeimosObject).graphic.scaleX > 0){
Pointer2.body.ApplyImpulse(new b2Vec2(1250, 1000), Pointer2.body.GetWorldCenter());
} else {
Pointer2.body.ApplyImpulse(new b2Vec2(-1250, 1000), Pointer2.body.GetWorldCenter());
};
};
Pointer2.health = (Pointer2.health - 0.5);
};
};
};
};
if ((((Pointer2 is DeimosObject)) && ((Pointer1 == hero)))){
if (tempContact.shape2.IsSensor()){
(Pointer2 as DeimosObject).whippable = true;
if ((Pointer2 as DeimosObject).whiping){
if ((Pointer2 as DeimosObject).whipped()){
if (hero.hanging == 0){
if ((Pointer2 as DeimosObject).graphic.scaleX > 0){
Pointer1.body.ApplyImpulse(new b2Vec2(1250, 1000), Pointer1.body.GetWorldCenter());
} else {
Pointer1.body.ApplyImpulse(new b2Vec2(-1250, 1000), Pointer1.body.GetWorldCenter());
};
};
Pointer1.health = (Pointer1.health - 0.5);
};
};
};
};
if ((((Pointer1 is TempusBulletObject)) || ((Pointer2 is TempusBulletObject)))){
if ((((Pointer1 is TempusBulletObject)) && (!(tempContact.shape2.IsSensor())))){
AddForDestruction(Pointer1);
if (((!((Pointer2 is StaticObject))) && (!((Pointer2 is GooBulletObject))))){
if ((((Pointer2 is PhobosObject)) || ((Pointer2 is ActorObject)))){
Pointer2.health = (Pointer2.health - Pointer1.damage);
};
};
};
if ((((Pointer2 is TempusBulletObject)) && (!(tempContact.shape1.IsSensor())))){
AddForDestruction(Pointer2);
if (((!((Pointer1 is StaticObject))) && (!((Pointer1 is GooBulletObject))))){
if ((((Pointer1 is PhobosObject)) || ((Pointer1 is ActorObject)))){
Pointer1.health = (Pointer1.health - Pointer2.damage);
};
};
};
};
};
if (!hero.onGround){
if (Pointer1 == hero){
if ((((tempContact.normal.y > 0)) && ((Math.abs(tempContact.normal.y) > Math.abs(tempContact.normal.x))))){
if (((!(tempContact.shape1.IsSensor())) && (!(tempContact.shape2.IsSensor())))){
hero.onGround = true;
};
};
} else {
if (Pointer2 == hero){
if ((((tempContact.normal.y < 0)) && ((Math.abs(tempContact.normal.y) > Math.abs(tempContact.normal.x))))){
if (((!(tempContact.shape1.IsSensor())) && (!(tempContact.shape2.IsSensor())))){
hero.onGround = true;
};
};
};
};
};
if (((!(tempContact.shape1.IsSensor())) && (!(tempContact.shape2.IsSensor())))){
if ((((Pointer1 is LaserObject)) || ((Pointer2 is LaserObject)))){
if ((Pointer1 is LaserObject)){
if (!(Pointer2 is ReflectiveObject)){
AddForDestruction(Pointer1);
};
if (!(Pointer2 is StaticObject)){
Pointer2.health = (Pointer2.health - Pointer1.damage);
};
};
if ((Pointer2 is LaserObject)){
if (!(Pointer1 is ReflectiveObject)){
AddForDestruction(Pointer2);
};
if (!(Pointer1 is StaticObject)){
Pointer1.health = (Pointer1.health - Pointer2.damage);
};
};
};
if (!Tempus){
if ((Pointer1 is PistonObject)){
if (tempContact.normal.y > 0){
if ((Pointer2 is Hero)){
hero.health = 0;
} else {
if (!(Pointer2 is LaserObject)){
Pointer1.body.ApplyForce(new b2Vec2(0, -10050), Pointer1.body.GetPosition());
};
};
};
};
if ((Pointer2 is PistonObject)){
if (tempContact.normal.y < 0){
if (Pointer1 == hero){
hero.health = 0;
} else {
if (!(Pointer1 is LaserObject)){
Pointer2.body.ApplyForce(new b2Vec2(0, -10050), Pointer2.body.GetPosition());
};
};
};
};
if ((((Pointer1 is ShrapnelObject)) || ((Pointer1 is DebrisObject)))){
Pointer1.health--;
};
if ((((Pointer2 is ShrapnelObject)) || ((Pointer2 is DebrisObject)))){
Pointer2.health--;
};
if ((((((((((((Pointer1 is BulletObject)) || ((Pointer2 is BulletObject)))) || ((Pointer1 is MissileObject)))) || ((Pointer2 is MissileObject)))) || ((Pointer1 is MarsStoneObject)))) || ((Pointer2 is MarsStoneObject)))){
if ((((Pointer1 is SimpleMissileObject)) || ((Pointer1 is MarsMissileObject)))){
AddForDestruction(Pointer1);
if (!(Pointer2 is StaticObject)){
Pointer2.health = (Pointer2.health - Pointer1.damage);
};
};
if ((((Pointer2 is SimpleMissileObject)) || ((Pointer2 is MarsMissileObject)))){
AddForDestruction(Pointer2);
if (!(Pointer1 is StaticObject)){
Pointer1.health = (Pointer1.health - Pointer2.damage);
};
};
if ((Pointer1 is BulletObject)){
AddForDestruction(Pointer1);
if (!(Pointer2 is StaticObject)){
Pointer2.health = (Pointer2.health - Pointer1.damage);
};
};
if ((Pointer2 is BulletObject)){
AddForDestruction(Pointer2);
if (!(Pointer1 is StaticObject)){
Pointer1.health = (Pointer1.health - Pointer2.damage);
};
};
if ((Pointer1 is MarsStoneObject)){
AddForDestruction(Pointer1);
if (!(Pointer2 is StaticObject)){
Pointer2.health = (Pointer2.health - Pointer1.damage);
};
};
if ((Pointer2 is MarsStoneObject)){
AddForDestruction(Pointer2);
if (!(Pointer1 is StaticObject)){
Pointer1.health = (Pointer1.health - Pointer2.damage);
};
};
} else {
if ((((Pointer1 is DynamicObject)) || (isWalkingEnemy(Pointer1)))){
if ((((Math.abs(Pointer1.body.GetLinearVelocity().y) < 0.5)) && ((Math.abs(Pointer1.body.GetLinearVelocity().y) > 0)))){
Pointer1.body.SetLinearVelocity(new b2Vec2(Pointer1.body.GetLinearVelocity().x, -0.1));
};
};
if ((((Pointer2 is DynamicObject)) || (isWalkingEnemy(Pointer2)))){
if ((((Math.abs(Pointer2.body.GetLinearVelocity().y) < 0.5)) && ((Math.abs(Pointer2.body.GetLinearVelocity().y) > 0)))){
Pointer2.body.SetLinearVelocity(new b2Vec2(Pointer2.body.GetLinearVelocity().x, -0.1));
};
};
n = tempContact.normal.Copy();
if ((Pointer1 is DynamicObject)){
if (((!((Pointer1 is ShrapnelObject))) && (!((Pointer1 is DebrisObject))))){
if ((Pointer2 is EnemyObject)){
n.Multiply(-100);
if (n.y < -(Pointer1.body.GetMass())){
n.y = -(Pointer1.body.GetMass());
n.x = (Pointer1.body.GetMass() * 2);
} else {
if (Pointer1.body.GetMass() > 16){
if (n.x > 0){
n.x = 70;
} else {
n.x = -70;
};
} else {
if (n.x > 0){
n.x = 40;
} else {
n.x = -40;
};
};
};
Pointer1.body.ApplyImpulse(n, Pointer1.body.GetPosition());
if (!(Pointer2 is PraetorianObject)){
(Pointer2 as EnemyObject).checkStuck(n.x);
};
};
};
};
if ((Pointer2 is DynamicObject)){
if (((!((Pointer2 is ShrapnelObject))) && (!((Pointer2 is DebrisObject))))){
if ((Pointer1 is EnemyObject)){
n.Multiply(100);
if (n.y < -(Pointer2.body.GetMass())){
n.y = -(Pointer2.body.GetMass());
n.x = (Pointer2.body.GetMass() * 2);
} else {
if (Pointer2.body.GetMass() > 16){
if (n.x > 0){
n.x = 70;
} else {
n.x = -70;
};
} else {
if (n.x > 0){
n.x = 40;
} else {
n.x = -40;
};
};
};
Pointer2.body.ApplyImpulse(n, Pointer2.body.GetPosition());
if (!(Pointer1 is PraetorianObject)){
(Pointer1 as EnemyObject).checkStuck(n.x);
};
};
};
};
if (Pointer1 == hero){
if (isWalkingEnemy(Pointer2)){
if (n.x == 0){
n.x = 0.5;
};
if (n.y == 0){
n.y = 0.5;
};
n.Multiply(-0.5);
Pointer1.body.ApplyImpulse(n, Pointer1.body.GetPosition());
};
};
if (Pointer2 == hero){
if (isWalkingEnemy(Pointer1)){
if (n.x == 0){
n.x = 0.5;
};
if (n.y == 0){
n.y = 0.5;
};
n.Multiply(0.5);
Pointer2.body.ApplyImpulse(n, Pointer2.body.GetPosition());
};
};
n1 = 0;
n2 = 0;
if ((Pointer1 is DynamicObject)){
n1 = b2Math.b2Dot(Pointer1.body.GetLinearVelocity(), tempContact.normal);
if ((Pointer2 is EnemyObject)){
if (Pointer1.body.GetLinearVelocity().y > 0.15){
n1 = (n1 + 2);
};
};
};
if ((Pointer2 is DynamicObject)){
n2 = b2Math.b2Dot(Pointer2.body.GetLinearVelocity(), tempContact.normal);
if ((Pointer1 is EnemyObject)){
if (Pointer2.body.GetLinearVelocity().y > 0.15){
n2 = (n2 - 2);
};
};
};
if ((Pointer1 is ShrapnelObject)){
if (n1 != 0){
n1 = (n1 + 2);
};
} else {
if ((((Pointer1.graphic is RollingBarrelExp)) || ((Pointer1.graphic is RollingBarrel)))){
if (n1 != 0){
n1 = (n1 - 2);
};
} else {
if ((Pointer1.graphic is BarrelExp)){
n1 = (n1 * -1);
} else {
n1 = (n1 + 1);
};
};
};
if ((Pointer2 is ShrapnelObject)){
if (n2 != 0){
n2 = (n2 - 2);
};
} else {
if ((((Pointer2.graphic is RollingBarrelExp)) || ((Pointer2.graphic is RollingBarrel)))){
if (n2 != 0){
n2 = (n2 + 2);
};
} else {
if ((Pointer2.graphic is BarrelExp)){
n2 = (n2 * -1);
} else {
n2 = (n2 - 1);
};
};
};
if ((((n1 > 2)) || ((n2 < -2)))){
if ((((Pointer1 is StaticObject)) || ((Pointer2 is StaticObject)))){
if ((((Pointer1 is StaticObject)) && (!((Pointer2 is StaticObject))))){
Pointer2.health = (Pointer2.health - Math.abs((((10 * -(n2)) * (Math.abs(Pointer2.graphic.scaleX) + Math.abs(Pointer2.graphic.scaleY))) * damageFactor)));
};
if ((((Pointer2 is StaticObject)) && (!((Pointer1 is StaticObject))))){
Pointer1.health = (Pointer1.health - Math.abs((((10 * n1) * (Math.abs(Pointer1.graphic.scaleX) + Math.abs(Pointer1.graphic.scaleY))) * damageFactor)));
};
} else {
if (n2 == 0){
Pointer1.health = (Pointer1.health - Pointer2.damage);
} else {
Pointer1.health = (Pointer1.health - Math.abs((((Pointer2.damage * -(n2)) * (Math.abs(Pointer2.graphic.scaleX) + Math.abs(Pointer2.graphic.scaleY))) * damageFactor)));
};
if (n1 == 0){
Pointer2.health = (Pointer2.health - Pointer1.damage);
} else {
Pointer2.health = (Pointer2.health - Math.abs((((Pointer1.damage * n1) * (Math.abs(Pointer1.graphic.scaleX) + Math.abs(Pointer1.graphic.scaleY))) * damageFactor)));
};
};
};
};
} else {
if ((Pointer1 is TempusMissileObject)){
AddForDestruction(Pointer1);
if (!(Pointer2 is StaticObject)){
Pointer2.health = (Pointer2.health - Pointer1.damage);
};
};
if ((Pointer2 is TempusMissileObject)){
AddForDestruction(Pointer2);
if (!(Pointer1 is StaticObject)){
Pointer1.health = (Pointer1.health - Pointer2.damage);
};
};
if ((Pointer1 is ShrapnelTObject)){
Pointer1.health--;
};
if ((Pointer2 is ShrapnelTObject)){
Pointer2.health--;
};
if ((((Pointer1 is ShrapnelTObject)) || ((Pointer2 is ShrapnelTObject)))){
n1 = 0;
n2 = 0;
if ((Pointer1 is DynamicObject)){
n1 = b2Math.b2Dot(Pointer1.body.GetLinearVelocity(), tempContact.normal);
if ((Pointer2 is EnemyObject)){
if (Pointer1.body.GetLinearVelocity().y > 0.1){
n1 = (n1 + 2);
};
};
};
if ((Pointer2 is DynamicObject)){
n2 = b2Math.b2Dot(Pointer2.body.GetLinearVelocity(), tempContact.normal);
if ((Pointer1 is EnemyObject)){
if (Pointer2.body.GetLinearVelocity().y > 0.1){
n2 = (n2 - 2);
};
};
};
if ((Pointer1 is ShrapnelObject)){
if (n1 != 0){
n1 = (n1 + 2);
};
};
if ((Pointer2 is ShrapnelObject)){
if (n2 != 0){
n2 = (n2 - 2);
};
};
if ((((n1 > 2)) || ((n2 < -2)))){
if ((((Pointer1 is StaticObject)) || ((Pointer2 is StaticObject)))){
if ((((Pointer1 is StaticObject)) && (!((Pointer2 is StaticObject))))){
Pointer2.health = (Pointer2.health - (((10 * -(n2)) * (Math.abs(Pointer2.graphic.scaleX) + Math.abs(Pointer2.graphic.scaleY))) * damageFactor));
};
if ((((Pointer2 is StaticObject)) && (!((Pointer1 is StaticObject))))){
Pointer1.health = (Pointer1.health - (((10 * n1) * (Math.abs(Pointer1.graphic.scaleX) + Math.abs(Pointer1.graphic.scaleY))) * damageFactor));
};
} else {
if (n2 == 0){
Pointer1.health = (Pointer1.health - Pointer2.damage);
} else {
Pointer1.health = (Pointer1.health - (((Pointer2.damage * -(n2)) * (Math.abs(Pointer2.graphic.scaleX) + Math.abs(Pointer2.graphic.scaleY))) * damageFactor));
};
if (n1 == 0){
Pointer2.health = (Pointer2.health - Pointer1.damage);
} else {
Pointer2.health = (Pointer2.health - (((Pointer1.damage * n1) * (Math.abs(Pointer1.graphic.scaleX) + Math.abs(Pointer1.graphic.scaleY))) * damageFactor));
};
};
};
};
};
};
if (Pointer1.health <= 0){
AddForDestruction(Pointer1);
};
if (Pointer2.health <= 0){
AddForDestruction(Pointer2);
};
};
};
};
};
};
if (hero.health <= 0){
AddForDestruction(hero);
};
while (DestroyList.length > 0) {
if ((((((((DestroyList[0].graphic is BarrelExp)) || ((DestroyList[0].graphic is Grenade)))) || ((DestroyList[0].graphic is Missile)))) || ((DestroyList[0].graphic is RollingBarrelExp)))){
if ((DestroyList[0].graphic is BarrelExp)){
explode(DestroyList[0].graphic.x, DestroyList[0].graphic.y, 21);
} else {
if ((DestroyList[0].graphic is Grenade)){
explode(DestroyList[0].graphic.x, DestroyList[0].graphic.y, 22);
} else {
if ((DestroyList[0].graphic is Missile)){
explode(DestroyList[0].graphic.x, DestroyList[0].graphic.y, 23);
} else {
if ((DestroyList[0].graphic is RollingBarrelExp)){
explode(DestroyList[0].graphic.x, DestroyList[0].graphic.y, 24);
};
};
};
};
if (this.parent != null){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_EXPLOSION);
};
} else {
if ((((((DestroyList[0].graphic is Crate)) || ((DestroyList[0].graphic is Barrel)))) || ((DestroyList[0].graphic is RollingBarrel)))){
if ((DestroyList[0].graphic is Crate)){
throwDebris(DestroyList[0].graphic.x, DestroyList[0].graphic.y, 26);
} else {
if ((DestroyList[0].graphic is Barrel)){
throwDebris(DestroyList[0].graphic.x, DestroyList[0].graphic.y, 25);
} else {
if ((DestroyList[0].graphic is RollingBarrel)){
throwDebris(DestroyList[0].graphic.x, DestroyList[0].graphic.y, 31);
};
};
};
if (this.parent != null){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_BREAK);
};
} else {
if ((DestroyList[0].graphic is MarsMissile)){
if (worldArray.indexOf(DestroyList[0]) != -1){
explodeEffect(DestroyList[0].graphic.x, DestroyList[0].graphic.y, 27);
} else {
if (tempusArray.indexOf(DestroyList[0]) != -1){
explodeEffect(DestroyList[0].graphic.x, DestroyList[0].graphic.y, 28);
} else {
throw (new Error("missile not found"));
};
};
if (this.parent != null){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_EXPLOSION);
};
};
};
};
removeBody(DestroyList[0]);
DestroyList.shift();
};
}
private function deathCall(){
hero.health = 0;
if (!contains(heroDead)){
addChild(heroDead);
heroDead.x = myRect.x;
heroDead.y = myRect.y;
};
if (heroDead.currentFrame == 1){
heroDead.gotoAndPlay(2);
};
}
public function init(){
MainClass.pauseFlag = false;
timeStep = (1 / 30);
iterations = 10;
crouching = 0;
if (tempusFlash == null){
tempusFlash = new TempusFlash();
};
tempusFlash.gotoAndStop(1);
if (heroDead == null){
heroDead = new DeathAnim();
};
heroDead.gotoAndStop(1);
if (contains(heroDead)){
removeChild(heroDead);
};
if (mousePointer == null){
mousePointer = new MousePointer();
};
mousePointer.gotoAndStop(1);
mousePointer.mouseEnabled = false;
mousePointer.mouseChildren = false;
if (!contains(mousePointer)){
addChild(mousePointer);
};
p1 = new b2Vec2();
p2 = new b2Vec2();
lightEffect = new Array();
if (tempusContainer == null){
tempusContainer = new TempusContainer();
};
if (explosion == null){
explosion = new Array(new Explosion(), new Explosion(), new Explosion(), new Explosion(), new Explosion());
};
i = 0;
while (i < 5) {
if (!contains(explosion[i])){
addChild(explosion[i]);
};
explosion[i].x = -100;
explosion[i].y = -100;
i++;
};
if (explosionEffect == null){
explosionEffect = new Array(new Explosion(), new Explosion(), new Explosion(), new Explosion(), new Explosion());
};
i = 0;
while (i < 5) {
if (!contains(explosionEffect[i])){
addChild(explosionEffect[i]);
};
explosionEffect[i].x = -100;
explosionEffect[i].y = -100;
explosionEffect[i].scaleX = 0.5;
explosionEffect[i].scaleY = 0.5;
i++;
};
CListener = new myContactListener();
trailArray = new Array();
particleArray = new Array();
if (worldContainer == null){
worldContainer = new b2AABB();
};
worldContainer.lowerBound.Set(-10, -10);
worldContainer.upperBound.Set(100, 100);
gravity = new b2Vec2(0, 30);
doSleep = true;
world = new b2World(worldContainer, gravity, doSleep);
world.SetContactListener(CListener);
lambda = new Array();
normal = new b2Vec2();
segment = new b2Segment();
if (worldArray == null){
worldArray = new Array();
};
if (staticWorldArray == null){
staticWorldArray = new Array();
};
if (enemyArray == null){
enemyArray = new Array();
};
if (generalArray == null){
generalArray = new Array();
};
if (tempusArray == null){
tempusArray = new Array();
};
if (GOFactory == null){
GOFactory = new GameObjectFactory();
};
GOFactory.init();
if (DestroyList == null){
DestroyList = new Array();
};
(this.parent as MainClass).enemyCount = 0;
(this.parent as MainClass).enemyAlive = 0;
loadLevel();
setListeners();
MainClass.leftKey = false;
MainClass.upKey = false;
MainClass.rightKey = false;
MainClass.keyPressed = false;
MainClass.spaceKey = false;
MainClass.downKey = false;
MainClass.spaceKeyClickable = true;
removeTempus();
infiniteHealth = 0;
infiniteTempus = 0;
damageFactor = 0.1;
picked = null;
changeVelocity = null;
heroCollideFilter = new b2FilterData();
heroCollideFilter.categoryBits = 0x0100;
heroCollideFilter.maskBits = 32;
tempusFilter = new b2FilterData();
tempusFilter.categoryBits = 4;
tempusFilter.maskBits = 2;
normalFilter = new b2FilterData();
normalFilter.categoryBits = 2;
normalFilter.maskBits = 4;
started = true;
deferredMouseJointRemoval = false;
this.mouseChildren = false;
Mouse.hide();
removing = false;
}
private function AddForDestruction(_arg1:GameObject):Boolean{
var _local2:int;
_local2 = DestroyList.indexOf(_arg1);
if (_local2 == -1){
DestroyList.push(_arg1);
return (true);
};
return (false);
}
private function createMouseJoint(){
var _local1:b2MouseJointDef;
if (picked){
_local1 = new b2MouseJointDef();
_local1.body1 = world.GetGroundBody();
_local1.body2 = picked;
_local1.target.Set(mouseXWorldPhys, mouseYWorldPhys);
_local1.maxForce = (200 * picked.GetMass());
_local1.timeStep = timeStep;
mouseJoint = (world.CreateJoint(_local1) as b2MouseJoint);
_local1 = new b2MouseJointDef();
_local1.body1 = world.GetGroundBody();
_local1.body2 = picked;
_local1.target.Set((mouseXWorldPhys + 1), mouseYWorldPhys);
_local1.maxForce = (200 * picked.GetMass());
_local1.timeStep = timeStep;
mouseJoint1 = (world.CreateJoint(_local1) as b2MouseJoint);
picked.WakeUp();
hero.makeHeavy();
if (hero.hanging == 1){
hero.body.SetXForm(hero.body.GetPosition(), 0);
hero.body.SetLinearVelocity(new b2Vec2(0, 0));
};
};
}
public function GetBodyAtMouse(_arg1:Boolean=false):b2Body{
aabb1 = new b2AABB();
aabb1.lowerBound.Set((mouseXWorldPhys - 0.05), (mouseYWorldPhys - 0.05));
aabb1.upperBound.Set((mouseXWorldPhys + 0.05), (mouseYWorldPhys + 0.05));
k_maxCount = 10;
shapes = new Array();
count = world.Query(aabb1, shapes, k_maxCount);
body = null;
if (_arg1){
p = 0;
while (p < count) {
tShape = (shapes[p] as b2Shape);
if (tShape.IsSensor()){
inside = tShape.TestPoint(tShape.GetBody().GetXForm(), new b2Vec2(mouseXWorldPhys, mouseYWorldPhys));
if (inside){
body = tShape.GetBody();
break;
};
};
p++;
};
tShape = null;
} else {
p = 0;
while (p < count) {
tShape = (shapes[p] as b2Shape);
if (!tShape.IsSensor()){
inside = tShape.TestPoint(tShape.GetBody().GetXForm(), new b2Vec2(mouseXWorldPhys, mouseYWorldPhys));
if (inside){
body = tShape.GetBody();
break;
};
};
p++;
};
};
return (body);
}
private function addTempusEffect(){
if (!contains(tempusFlash)){
addChild(tempusFlash);
};
tempusFlash.x = hero.graphic.x;
tempusFlash.y = hero.graphic.y;
}
public function removeTempus(){
if (this.parent != null){
if (this.parent.contains(tempusContainer)){
this.parent.removeChild(tempusContainer);
};
};
}
private function BodyAbove(_arg1:GameObject):Boolean{
PosX3 = _arg1.body.GetPosition().x;
PosY3 = _arg1.body.GetPosition().y;
aabb1 = new b2AABB();
aabb1.lowerBound.Set((PosX3 - 1), (PosY3 - 2));
aabb1.upperBound.Set((PosX3 + 1), PosY3);
k_maxCount = 10;
shapes = new Array();
count = world.Query(aabb1, shapes, k_maxCount);
body = null;
p = 0;
while (p < count) {
tShape = (shapes[p] as b2Shape);
if (!tShape.IsSensor()){
body = tShape.GetBody();
if ((body.GetUserData() is DynamicObject)){
return (true);
};
};
p++;
};
return (false);
}
private function shouldCrouch(_arg1:GameObject):Boolean{
PosX3 = hero.body.GetPosition().x;
PosY3 = hero.body.GetPosition().y;
aabb1 = new b2AABB();
aabb1.lowerBound.Set((PosX3 - (1 / 6)), (PosY3 - 1));
aabb1.upperBound.Set((PosX3 + (1 / 6)), PosY3);
k_maxCount = 10;
shapes = new Array();
count = world.Query(aabb1, shapes, k_maxCount);
body = null;
p = 0;
while (p < count) {
tShape = (shapes[p] as b2Shape);
if (!tShape.IsSensor()){
body = tShape.GetBody();
if (body.GetUserData() == _arg1){
return (true);
};
};
p++;
};
return (false);
}
public function getPower(_arg1:MovieClip){
if (hero.health <= 0){
return;
};
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_POWERUP);
if ((_arg1 is Aether)){
tempusTime = (tempusTime + Math.abs(((_arg1.rotation - 0.5) * 70)));
if (tempusTime > 100){
tempusTime = 100;
};
} else {
if ((_arg1 is ClayTalisman)){
hero.health = (hero.health + 25);
if (hero.health > 100){
hero.health = 100;
};
} else {
if ((_arg1 is StoneTalisman)){
hero.health = 100;
} else {
if ((_arg1 is RubyTalisman)){
infiniteHealth = (40 * 30);
} else {
if ((_arg1 is AetherTalisman)){
infiniteTempus = (40 * 30);
};
};
};
};
};
}
private function addSwingChains(_arg1:Number, _arg2:Number, _arg3:uint){
var _local4:uint;
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set((_arg1 / GParams.physScale), (_arg2 / GParams.physScale));
tempGameObject = new ChainHeadObject();
tempGameObject.graphic = new ChainHead();
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.SetAsBox(((tempGameObject.graphic.width / 2) / GParams.physScale), ((tempGameObject.graphic.height / 2) / GParams.physScale));
tempSD.isSensor = true;
tempB = world.CreateBody(tempBD);
tempB.CreateShape(tempSD);
tempGameObject.init(tempB);
tempGameObject.initHealth();
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
currB = tempB;
_local4 = 0;
while (_local4 < _arg3) {
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set(currB.GetPosition().x, (currB.GetPosition().y + (2 / 3)));
tempSD.density = 0.5;
tempBD.angularDamping = 0.5;
tempBD.linearDamping = 0.5;
tempGameObject = new ChainObject();
tempGameObject.graphic = new ChainLink();
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.isSensor = true;
tempSD.SetAsBox(((tempGameObject.graphic.width / 2) / GParams.physScale), ((tempGameObject.graphic.height / 2) / GParams.physScale));
tempB = world.CreateBody(tempBD);
tempB.CreateShape(tempSD);
tempB.SetMassFromShapes();
tempGameObject.init(tempB);
tempGameObject.initHealth(5000, 10);
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
tempJointDef = new b2RevoluteJointDef();
tempJointDef.body1 = tempB;
tempJointDef.body2 = currB;
tempJointDef.localAnchor1 = new b2Vec2(0, (-1 / 3));
tempJointDef.localAnchor2 = new b2Vec2(0, (1 / 3));
world.CreateJoint(tempJointDef);
currB = tempB;
_local4++;
};
}
private function addRollingBarrel(_arg1:Number, _arg2:Number, _arg3:Number){
tempBD = new b2BodyDef();
tempBD.position.Set((_arg1 / GParams.physScale), (_arg2 / GParams.physScale));
tempGameObject = new DynamicObject();
tempGameObject.graphic = new RollingBarrel();
worldArray.push(tempGameObject);
tempSD1 = new b2CircleDef();
tempSD1.filter.categoryBits = (4 | 2);
tempSD1.filter.maskBits = (4 | 2);
tempSD1.radius = (((tempGameObject.graphic.width * _arg3) / 2) / GParams.physScale);
tempSD1.localPosition.Set(0, 0);
tempSD1.density = 20;
tempSD1.friction = 0.5;
tempBD.angularDamping = 0.5;
tempB = world.CreateBody(tempBD);
tempB.CreateShape(tempSD1);
tempB.SetMassFromShapes();
tempGameObject.init(tempB);
tempGameObject.initHealth(GParams.barrelDamage, GParams.barrelHealth);
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
tempGameObject.graphic.scaleX = _arg3;
tempGameObject.graphic.scaleY = _arg3;
}
private function paintWall(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
bmp = new Bitmap(new BitmapData(150, _arg4, true, 0));
bmp.bitmapData.copyPixels(bmpWall, new Rectangle(0, 0, 150, _arg4), new Point(0, 0));
bmp.rotation = _arg5;
bmp.x = ((_arg1 - ((_arg3 / 2) * Math.cos(((_arg5 * Math.PI) / 180)))) + ((_arg4 / 2) * Math.sin(((_arg5 * Math.PI) / 180))));
bmp.y = ((_arg2 - ((_arg3 / 2) * Math.sin(((_arg5 * Math.PI) / 180)))) - ((_arg4 / 2) * Math.cos(((_arg5 * Math.PI) / 180))));
bmpContainer.bitmapData.draw(bmp, bmp.transform.matrix, null, null, null, true);
}
private function throwShrapnel(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:uint;
var _local5:uint;
_local4 = 10;
_local5 = 0;
while (_local5 < _local4) {
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set(((_arg1 + (13 * Math.cos((((2 * _local5) * Math.PI) / _local4)))) / GParams.physScale), ((_arg2 + (13 * Math.sin((((2 * _local5) * Math.PI) / _local4)))) / GParams.physScale));
tempBD.isBullet = true;
tempSD.density = 100;
tempSD.friction = 0.9;
tempSD.restitution = 0.1;
tempGameObject = GOFactory.getObject(_arg3);
if (_arg3 == 28){
tempusArray.push(tempGameObject);
} else {
worldArray.push(tempGameObject);
};
tempBD.isBullet = true;
tempB = world.CreateBody(tempBD);
tempSD.SetAsBox((3 / GParams.physScale), (3 / GParams.physScale));
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempB.CreateShape(tempSD);
tempGameObject.graphic.scaleX = 1;
tempGameObject.graphic.scaleY = 1;
tempGameObject.init(tempB);
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
tempGameObject.body.SetMassFromShapes();
tempGameObject.body.ApplyForce(new b2Vec2((5000 * Math.cos((((2 * _local5) * Math.PI) / _local4))), (-5000 * Math.sin((((2 * _local5) * Math.PI) / _local4)))), tempGameObject.body.GetWorldCenter());
tempGameObject.saveData();
tempGameObject.saveVelocity();
tempBD = null;
tempSD = null;
tempB = null;
tempGameObject = null;
_local5++;
};
}
private function onMouseOut(_arg1:MouseEvent){
Mouse.show();
}
private function addPiston(_arg1:Number, _arg2:Number){
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set((_arg1 / GParams.physScale), (_arg2 / GParams.physScale));
tempGameObject = GOFactory.getObject(90);
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.SetAsOrientedBox((10 / GParams.physScale), (50 / GParams.physScale), new b2Vec2(0, (50 / GParams.physScale)), 0);
tempB = world.CreateBody(tempBD);
tempB.CreateShape(tempSD);
tempGameObject.init(tempB);
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
currB = tempB;
tempBD.position.Set((_arg1 / GParams.physScale), ((_arg2 + 100) / GParams.physScale));
tempB = world.CreateBody(tempBD);
tempSD.SetAsOrientedBox((10 / GParams.physScale), (50 / GParams.physScale), new b2Vec2(0, (50 / GParams.physScale)), 0);
tempSD.density = 5;
tempB.CreateShape(tempSD);
tempSD.SetAsOrientedBox((50 / GParams.physScale), (20 / GParams.physScale), new b2Vec2(0, (120 / GParams.physScale)), 0);
tempSD.density = 5;
tempB.CreateShape(tempSD);
tempB.SetMassFromShapes();
tempJointDef1 = new b2PrismaticJointDef();
tempJointDef1.body1 = currB;
tempJointDef1.body2 = tempB;
tempJointDef1.localAnchor1 = new b2Vec2(0, (100 / GParams.physScale));
tempJointDef1.localAnchor2 = new b2Vec2(0, 0);
tempJointDef1.localAxis1 = new b2Vec2(0, 1);
tempJointDef1.lowerTranslation = (-100 / GParams.physScale);
tempJointDef1.upperTranslation = 0;
tempJointDef1.enableLimit = true;
tempJointDef1.enableMotor = true;
if (tempJoint == null){
tempJoint = new Array();
};
tempJoint.push((world.CreateJoint(tempJointDef1) as b2PrismaticJoint));
tempJoint.push(true);
tempGameObject = GOFactory.getObject(8);
worldArray.push(tempGameObject);
tempGameObject.init(tempB);
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
tempBD = null;
tempSD = null;
tempB = null;
tempGameObject = null;
}
public function addFallingObjects(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set((_arg1 / GParams.physScale), (_arg2 / GParams.physScale));
tempGameObject = GOFactory.getObject(7);
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.SetAsBox((((_arg3 * 5) / 2) / GParams.physScale), ((5 / 2) / GParams.physScale));
tempB = world.CreateBody(tempBD);
tempB.CreateShape(tempSD);
tempGameObject.init(tempB);
(tempGameObject as InvisibleObject).range = ((_arg3 * 5) / 2);
tempGameObject.graphic.scaleY = _arg4;
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
}
private function initialiseHero(){
hero.body.SetMassFromShapes();
hero.setWorld();
hero.resetInertia();
hero.initVelocities();
hero.saveData();
addTempusEffect();
setChildIndex(hero.graphic, (numChildren - 1));
}
private function spawnAether(_arg1:Number, _arg2:Number, _arg3:Number){
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set((_arg1 / GParams.physScale), (_arg2 / GParams.physScale));
tempGameObject = GOFactory.getObject(42);
generalArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.isSensor = true;
tempB = world.CreateBody(tempBD);
(tempGameObject.graphic as MovieClip).gotoAndStop(1);
tempGameObject.graphic.rotation = 0;
tempGameObject.graphic.scaleX = _arg3;
tempGameObject.graphic.scaleY = _arg3;
tempSD.SetAsBox((((tempGameObject.graphic.width * _arg3) / 2) / GParams.physScale), (((tempGameObject.graphic.height * _arg3) / 2) / GParams.physScale));
tempB.CreateShape(tempSD);
tempGameObject.init(tempB);
tempGameObject.update();
tempGameObject.graphic.rotation = _arg3;
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
tempBD = null;
tempSD = null;
tempB = null;
tempGameObject = null;
}
private function scrollScreen(){
myRect = this.scrollRect;
if (hero.graphic.scaleX > 0){
posX1 = hero.graphic.x;
posX2 = (hero.graphic.x + 250);
} else {
posX1 = (hero.graphic.x - 250);
posX2 = hero.graphic.x;
};
if ((posX1 - myRect.x) < scrollMargin){
scrollSpeedX = (((scrollMargin - posX1) + myRect.x) / 4);
if (scrollSpeedX > 10){
scrollSpeedX = 10;
};
myRect.x = (myRect.x - scrollSpeedX);
if (myRect.x < 0){
myRect.x = 0;
};
};
if ((posX2 - myRect.x) > (GParams.screenWidth - scrollMargin)){
scrollSpeedX = ((((posX2 - myRect.x) - GParams.screenWidth) + scrollMargin) / 4);
if (scrollSpeedX > 10){
scrollSpeedX = 10;
};
myRect.x = (myRect.x + scrollSpeedX);
if (myRect.x > (currentLevelWidth - GParams.screenWidth)){
myRect.x = (currentLevelWidth - GParams.screenWidth);
};
};
if (crouching > 40){
posY1 = hero.graphic.y;
posY2 = (hero.graphic.y + 100);
} else {
posY1 = (hero.graphic.y - 100);
posY2 = hero.graphic.y;
};
if ((posY1 - myRect.y) < scrollMargin){
scrollSpeedY = ((scrollMargin - posY1) + myRect.y);
if (scrollSpeedY > 20){
scrollSpeedY = 10;
};
myRect.y = (myRect.y - scrollSpeedY);
if (myRect.y < 0){
myRect.y = 0;
};
};
if ((posY2 - myRect.y) > (GParams.screenHeight - scrollMargin)){
scrollSpeedY = (((posY2 - myRect.y) - GParams.screenHeight) + scrollMargin);
if (scrollSpeedY > 20){
scrollSpeedY = 10;
};
myRect.y = (myRect.y + scrollSpeedY);
if (myRect.y > (currentLevelHeight - GParams.screenHeight)){
myRect.y = (currentLevelHeight - GParams.screenHeight);
};
};
this.scrollRect = myRect;
scrollBG();
}
private function MouseUpdate(){
var _local1:GameObject;
if (hero.health <= 0){
return;
};
setChildIndex(mousePointer, (numChildren - 1));
mousePointer.x = mouseX;
mousePointer.y = mouseY;
if (picked != null){
mousePointer.gotoAndStop(2);
return;
};
tempBody1 = GetBodyAtMouse(true);
tempBody2 = GetBodyAtMouse();
if (((!((tempBody1 == null))) || (!((tempBody2 == null))))){
if (tempBody2 != null){
_local1 = (tempBody2.GetUserData() as GameObject);
if (isPickable(_local1)){
if (mousePointer.currentFrame != 3){
mousePointer.gotoAndStop(3);
};
} else {
mousePointer.gotoAndStop(1);
};
} else {
if ((tempBody1.GetUserData() is PowerupObject)){
if (mousePointer.currentFrame != 3){
mousePointer.gotoAndStop(3);
};
} else {
mousePointer.gotoAndStop(1);
};
};
} else {
mousePointer.gotoAndStop(1);
};
tempBody1 = null;
tempBody2 = null;
}
private function setAngle(){
if (Point.distance(new Point(mouseX, mouseY), new Point((changeVelocity.GetPosition().x * GParams.physScale), (changeVelocity.GetPosition().y * GParams.physScale))) < 25){
return;
};
if (changeVelocity != null){
if (isPickable(changeVelocity.GetUserData())){
changeVelocity.GetUserData().turnBy(((Math.atan2((mouseY - changeVelocity.GetUserData().graphic.y), (mouseX - changeVelocity.GetUserData().graphic.x)) * 180) / Math.PI));
} else {
changeVelocity = null;
};
};
}
private function explodeEffect(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:uint;
_local4 = getExplosionEffect();
setChildIndex(explosionEffect[_local4], (numChildren - 1));
explosionEffect[_local4].x = _arg1;
explosionEffect[_local4].y = _arg2;
explosionEffect[_local4].gotoAndPlay(1);
}
private function addChains(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:uint){
var _local5:uint;
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set((_arg1 / GParams.physScale), (_arg2 / GParams.physScale));
tempGameObject = new ChainHeadObject();
tempGameObject.graphic = new ChainHead();
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.SetAsBox(((tempGameObject.graphic.width / 2) / GParams.physScale), ((tempGameObject.graphic.height / 2) / GParams.physScale));
tempSD.isSensor = true;
tempB = world.CreateBody(tempBD);
tempB.CreateShape(tempSD);
tempGameObject.init(tempB);
tempGameObject.initHealth();
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
currB = tempB;
_local5 = 0;
while (_local5 < (_arg3 + _arg4)) {
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set(currB.GetPosition().x, (currB.GetPosition().y + (2 / 3)));
tempSD.density = 0.5;
tempBD.angularDamping = 0.5;
tempBD.linearDamping = 0.5;
tempGameObject = new ChainObject();
tempGameObject.graphic = new ChainLink();
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.isSensor = true;
tempSD.SetAsBox(((tempGameObject.graphic.width / 2) / GParams.physScale), ((tempGameObject.graphic.height / 2) / GParams.physScale));
tempB = world.CreateBody(tempBD);
tempB.CreateShape(tempSD);
tempB.SetMassFromShapes();
tempGameObject.init(tempB);
tempGameObject.initHealth(5000, 10);
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
tempJointDef = new b2RevoluteJointDef();
tempJointDef.body1 = tempB;
tempJointDef.body2 = currB;
tempJointDef.localAnchor1 = new b2Vec2(0, (-1 / 3));
tempJointDef.localAnchor2 = new b2Vec2(0, (1 / 3));
world.CreateJoint(tempJointDef);
currB = tempB;
_local5++;
};
tempBD = new b2BodyDef();
tempSD = new b2PolygonDef();
tempBD.position.Set(((_arg1 + (_arg3 * 20)) / GParams.physScale), (_arg2 / GParams.physScale));
tempGameObject = new ChainHeadObject();
tempGameObject.graphic = new ChainHead();
worldArray.push(tempGameObject);
tempSD.filter.categoryBits = (4 | 2);
tempSD.filter.maskBits = (4 | 2);
tempSD.SetAsBox(((tempGameObject.graphic.width / 2) / GParams.physScale), ((tempGameObject.graphic.height / 2) / GParams.physScale));
tempSD.isSensor = true;
tempB = world.CreateBody(tempBD);
tempB.CreateShape(tempSD);
tempGameObject.init(tempB);
tempGameObject.initHealth();
tempGameObject.update();
addChild(tempGameObject.graphic);
tempB.SetUserData(tempGameObject);
tempJointDef = new b2RevoluteJointDef();
tempJointDef.body1 = tempB;
tempJointDef.body2 = currB;
tempJointDef.localAnchor1 = new b2Vec2(0, (1 / 3));
tempJointDef.localAnchor2 = new b2Vec2(0, (1 / 3));
world.CreateJoint(tempJointDef);
}
private function isWalkingEnemy(_arg1:GameObject):Boolean{
if ((_arg1 is PeacekeeperObject)){
return (true);
};
if ((_arg1 is EnforcerObject)){
return (true);
};
if ((_arg1 is GladiatorObject)){
return (true);
};
if ((_arg1 is TriariiObject)){
return (true);
};
if ((_arg1 is ChariotObject)){
return (true);
};
return (false);
}
private function resetBG(){
setChildIndex(bgContainer1, (numChildren - 1));
}
private function scrollBG(){
var _local1:uint;
x1 = int((myRect.x / 400));
y1 = int((myRect.y / 300));
switch (getLevelType(MainClass.currentLevel)){
case 1:
i = 0;
while (i < 9) {
bg1Array[i].x = (400 * (x1 + int((i % 3))));
bg1Array[i].y = (300 * (y1 + int((i / 3))));
i++;
};
x1 = int((myRect.x / 450));
i = 0;
while (i < 3) {
bg2Array[i].x = (450 * (x1 + i));
bg2Array[i].y = (currentLevelHeight - 55);
i++;
};
i = 0;
while (i < 3) {
bg3Array[i].x = (450 * (x1 + i));
bg3Array[i].y = -30;
i++;
};
break;
case 2:
bg1Array[0].y = (currentLevelHeight - 65);
bg1Array[1].y = (currentLevelHeight - 65);
if ((myRect.x % 800) < 25){
bg1Array[0].x = (int(((myRect.x / 800) - 1)) * 800);
bg1Array[1].x = (int((myRect.x / 800)) * 800);
};
if ((myRect.x % 800) > 50){
bg1Array[0].x = (int(((myRect.x / 800) + 1)) * 800);
bg1Array[1].x = (int((myRect.x / 800)) * 800);
};
bg2Array[0].y = (currentLevelHeight - 250);
bg2Array[1].y = (currentLevelHeight - 250);
if (((myRect.x - bgContainer2.x) % 800) < 25){
bg2Array[0].x = (int((((myRect.x - bgContainer2.x) / 800) - 1)) * 800);
bg2Array[1].x = (int(((myRect.x - bgContainer2.x) / 800)) * 800);
};
if (((myRect.x - bgContainer2.x) % 800) > 50){
bg2Array[0].x = (int((((myRect.x - bgContainer2.x) / 800) + 1)) * 800);
bg2Array[1].x = (int(((myRect.x - bgContainer2.x) / 800)) * 800);
};
bgContainer2.x = (myRect.x / 2);
if (((myRect.x - bgContainer3.x) % 800) < 25){
bg3Array[0].x = (int((((myRect.x - bgContainer3.x) / 800) - 1)) * 800);
bg3Array[1].x = (int(((myRect.x - bgContainer3.x) / 800)) * 800);
};
if (((myRect.x - bgContainer3.x) % 800) > 50){
bg3Array[0].x = (int((((myRect.x - bgContainer3.x) / 800) + 1)) * 800);
bg3Array[1].x = (int(((myRect.x - bgContainer3.x) / 800)) * 800);
};
bgContainer3.x = ((7 * myRect.x) / 8);
bgContainer3.y = ((7 * myRect.y) / 8);
break;
case 3:
bg2Array[0].y = (currentLevelHeight - 475);
bg2Array[1].y = (currentLevelHeight - 475);
if (((myRect.x - bgContainer2.x) % 800) < 25){
bg2Array[0].x = (int((((myRect.x - bgContainer2.x) / 800) - 1)) * 800);
bg2Array[1].x = (int(((myRect.x - bgContainer2.x) / 800)) * 800);
};
if (((myRect.x - bgContainer2.x) % 800) > 50){
bg2Array[0].x = (int((((myRect.x - bgContainer2.x) / 800) + 1)) * 800);
bg2Array[1].x = (int(((myRect.x - bgContainer2.x) / 800)) * 800);
};
if (((myRect.x - bgContainer3.x) % 800) < 25){
bg3Array[0].x = (int((((myRect.x - bgContainer3.x) / 800) - 1)) * 800);
bg3Array[1].x = (int(((myRect.x - bgContainer3.x) / 800)) * 800);
};
if (((myRect.x - bgContainer3.x) % 800) > 50){
bg3Array[0].x = (int((((myRect.x - bgContainer3.x) / 800) + 1)) * 800);
bg3Array[1].x = (int(((myRect.x - bgContainer3.x) / 800)) * 800);
};
bgContainer3.x = ((7 * myRect.x) / 8);
bgContainer3.y = ((7 * myRect.y) / 8);
break;
case 4:
i = 0;
while (i < 9) {
bg1Array[i].x = (400 * (x1 + int((i % 3))));
bg1Array[i].y = (300 * (y1 + int((i / 3))));
i++;
};
x1 = int((myRect.x / 450));
i = 0;
while (i < 3) {
bg2Array[i].x = (450 * (x1 + i));
bg2Array[i].y = (currentLevelHeight - 100);
i++;
};
_local1 = 0;
while (_local1 < 3) {
bg3Array[_local1].x = (450 * (x1 + _local1));
bg3Array[_local1].y = -30;
_local1++;
};
break;
case 5:
case 6:
_local1 = 0;
while (_local1 < 9) {
bg1Array[_local1].x = (400 * (x1 + int((_local1 % 3))));
bg1Array[_local1].y = (300 * (y1 + int((_local1 / 3))));
_local1++;
};
x1 = int((myRect.x / 800));
_local1 = 0;
while (_local1 < 3) {
bg2Array[_local1].x = (800 * (x1 + _local1));
bg2Array[_local1].y = (currentLevelHeight - 65);
_local1++;
};
x1 = int((myRect.x / 450));
_local1 = 0;
while (_local1 < 3) {
bg3Array[_local1].x = (450 * (x1 + _local1));
bg3Array[_local1].y = -30;
_local1++;
};
break;
};
}
private function addTrail(_arg1:MovieClip, _arg2:Number, _arg3:Number){
this.addChild(_arg1);
_arg1.x = _arg2;
_arg1.y = _arg3;
trailArray.push(_arg1);
}
public function setEndPoint(){
i = 0;
while (i < staticWorldArray.length) {
if ((staticWorldArray[i] is EndObject)){
staticWorldArray[i].body.SetXForm(new b2Vec2((700 / GParams.physScale), (500 / GParams.physScale)), staticWorldArray[i].body.GetAngle());
staticWorldArray[i].update();
};
i++;
};
}
}
}//package
Section 255
//Crate (Crate)
package {
import flash.display.*;
public dynamic class Crate extends MovieClip {
}
}//package
Section 256
//CustomSound (CustomSound)
package {
import flash.events.*;
import flash.media.*;
public class CustomSound extends Sound {
public var _channel:SoundChannel;// = null
public var isLooping:Boolean;// = false
private var customVolumeMax:Number;// = 1
public var _transform:SoundTransform;// = null
public function CustomSound(){
_channel = null;
_transform = null;
isLooping = false;
customVolumeMax = 1;
super();
}
public function playSound(_arg1:SoundTransform, _arg2:Boolean=false){
if (_transform == null){
if (_channel != null){
_transform = new SoundTransform(customVolumeMax, _channel.position);
} else {
_transform = new SoundTransform(customVolumeMax, 0);
};
};
_transform.volume = (_arg1.volume * customVolumeMax);
if (((!((_channel == null))) && ((isLooping == false)))){
_channel.stop();
};
if ((((((isLooping == true)) && (!((_channel == null))))) && (!((_channel.position == 0))))){
return;
};
if (isLooping == true){
_channel = play(0, 9999, _transform);
} else {
_channel = play(0, 0, _transform);
};
_transform = _channel.soundTransform;
_channel.soundTransform = _transform;
}
public function setCustomVolume(_arg1:Number=1){
customVolumeMax = _arg1;
}
private function soundCompleteHandler(_arg1:Event):void{
_channel.removeEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
_channel.stop();
replayLoop();
}
public function setVolume(_arg1:Number){
if (((!((_channel == null))) && (!((_transform == null))))){
_transform.volume = ((_arg1 * customVolumeMax) / 100);
_channel.soundTransform = _transform;
};
}
public function stopSound(){
if (_channel == null){
return;
};
if (isLooping == true){
_channel.removeEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
};
_channel.stop();
}
public function replayLoop(){
_channel = play(0, 9999, _transform);
_transform = _channel.soundTransform;
_channel.soundTransform = _transform;
if (isLooping == true){
};
}
public function setLoop(_arg1:Boolean){
isLooping = _arg1;
}
}
}//package
Section 257
//CustomWelcome (CustomWelcome)
package {
import flash.display.*;
import flash.events.*;
import security.*;
import flash.net.*;
public class CustomWelcome extends MovieClip {
private var RJKey:String;
public var levelEditor:SimpleButton;
var urlPlayMore:String;// = "http://www.flasharcade.com/ref.php?button=more&game=ace048"
private var RJ:Rijndael;
var requestPlayMore:URLRequest;// = null
public var playMore:SimpleButton;
public var playCustomLevel:SimpleButton;
public function CustomWelcome():void{
urlPlayMore = "http://www.flasharcade.com/ref.php?button=more&game=ace048";
requestPlayMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
if (RJ == null){
RJ = new Rijndael(0x0100, 0x0100);
RJKey = "This game is awesome";
};
}
public function init(){
gotoAndStop(1);
addEventListener(MouseEvent.CLICK, handleClick);
}
private function decodeLevel(){
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:uint;
_local1 = GParams.customLevelString;
_local1 = decode(_local1);
GParams.levelCode[50] = new Array();
_local3 = "";
_local4 = -1;
_local5 = -1;
_local6 = 0;
while (_local6 < _local1.length) {
_local2 = _local1.charAt(_local6);
switch (_local2){
case "[":
_local4++;
GParams.levelCode[50][_local4] = new Array();
_local5 = 0;
_local3 = "";
_local2 = "";
break;
case ",":
case "]":
if (_local3 != ""){
var _temp1 = _local5;
_local5 = (_local5 + 1);
var _local7 = _temp1;
GParams.levelCode[50][_local4][_local7] = _local3;
};
_local3 = "";
_local2 = "";
break;
default:
_local3 = (_local3 + _local2);
break;
};
_local6++;
};
}
public function removeAllListener(){
removeEventListener(MouseEvent.CLICK, handleClick);
}
public function handleClick(_arg1:MouseEvent){
switch (_arg1.target.name){
case "playMore":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
navigateToURL(requestPlayMore, "_blank");
break;
case "playCustomLevel":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
MainClass.currentLevel = 50;
decodeLevel();
removeAllListener();
MainClass.difficulty = 0;
(this.parent as MainClass).nextLevel(MainClass.currentLevel);
break;
case "levelEditor":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
if (GParams.LevelEditor){
MainClass.currentLevel = 0;
removeAllListener();
(this.parent as MainClass).initLevelEditor();
};
break;
};
}
private function decode(_arg1:String):String{
return (RJ.decrypt(_arg1, RJKey, "CBC"));
}
}
}//package
Section 258
//CutsceneSound (CutsceneSound)
package {
public dynamic class CutsceneSound extends CustomSound {
}
}//package
Section 259
//DamageableObject (DamageableObject)
package {
import flash.display.*;
public class DamageableObject extends GameObject {
override public function update(){
super.update();
if (health > 1){
if ((this.graphic as MovieClip).currentFrame > 1){
(this.graphic as MovieClip).gotoAndStop(1);
};
} else {
if (health > 0){
if (((((this.graphic as MovieClip).currentFrame > 3)) || (((this.graphic as MovieClip).currentFrame < 2)))){
(this.graphic as MovieClip).gotoAndPlay(2);
};
} else {
if ((this.graphic as MovieClip).currentFrame < 4){
(this.graphic as MovieClip).gotoAndPlay(4);
};
};
};
}
}
}//package
Section 260
//DamageSound (DamageSound)
package {
public dynamic class DamageSound extends CustomSound {
}
}//package
Section 261
//Death2Sound (Death2Sound)
package {
public dynamic class Death2Sound extends CustomSound {
}
}//package
Section 262
//Death3Sound (Death3Sound)
package {
public dynamic class Death3Sound extends CustomSound {
}
}//package
Section 263
//Death4Sound (Death4Sound)
package {
public dynamic class Death4Sound extends CustomSound {
}
}//package
Section 264
//DeathAnim (DeathAnim)
package {
import flash.display.*;
public dynamic class DeathAnim extends MovieClip {
public function DeathAnim(){
addFrameScript(31, frame32, 143, frame144);
}
function frame144(){
stop();
}
function frame32(){
if (this.parent != null){
(this.parent as Container).removeListeners();
if (this.parent.parent != null){
(this.parent.parent as MainClass).showResult(0);
};
};
}
}
}//package
Section 265
//DeathSound (DeathSound)
package {
public dynamic class DeathSound extends CustomSound {
}
}//package
Section 266
//Debris (Debris)
package {
import flash.display.*;
public dynamic class Debris extends MovieClip {
}
}//package
Section 267
//Debris00 (Debris00)
package {
import flash.display.*;
public dynamic class Debris00 extends MovieClip {
}
}//package
Section 268
//Debris000 (Debris000)
package {
import flash.display.*;
public dynamic class Debris000 extends MovieClip {
}
}//package
Section 269
//Debris1 (Debris1)
package {
import flash.display.*;
public dynamic class Debris1 extends MovieClip {
}
}//package
Section 270
//Debris11 (Debris11)
package {
import flash.display.*;
public dynamic class Debris11 extends MovieClip {
}
}//package
Section 271
//Debris111 (Debris111)
package {
import flash.display.*;
public dynamic class Debris111 extends MovieClip {
}
}//package
Section 272
//Debris2 (Debris2)
package {
import flash.display.*;
public dynamic class Debris2 extends MovieClip {
}
}//package
Section 273
//Debris22 (Debris22)
package {
import flash.display.*;
public dynamic class Debris22 extends MovieClip {
}
}//package
Section 274
//Debris222 (Debris222)
package {
import flash.display.*;
public dynamic class Debris222 extends MovieClip {
}
}//package
Section 275
//Debris3 (Debris3)
package {
import flash.display.*;
public dynamic class Debris3 extends MovieClip {
}
}//package
Section 276
//Debris33 (Debris33)
package {
import flash.display.*;
public dynamic class Debris33 extends MovieClip {
}
}//package
Section 277
//Debris333 (Debris333)
package {
import flash.display.*;
public dynamic class Debris333 extends MovieClip {
}
}//package
Section 278
//Debris4 (Debris4)
package {
import flash.display.*;
public dynamic class Debris4 extends MovieClip {
}
}//package
Section 279
//Debris44 (Debris44)
package {
import flash.display.*;
public dynamic class Debris44 extends MovieClip {
}
}//package
Section 280
//Debris444 (Debris444)
package {
import flash.display.*;
public dynamic class Debris444 extends MovieClip {
}
}//package
Section 281
//DebrisObject (DebrisObject)
package {
public class DebrisObject extends DynamicObject {
}
}//package
Section 282
//Deimos (Deimos)
package {
import flash.display.*;
public dynamic class Deimos extends MovieClip {
public var hurt:MovieClip;
public var death:MovieClip;
public var still:MovieClip;
public var walk:MovieClip;
public var whip:MovieClip;
public function Deimos(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 283
//DeimosObject (DeimosObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.geom.*;
public class DeimosObject extends SemiBossObject {
private var shooting:Boolean;// = false
private var shootPoint:Point;
protected var STATUS_WHIP:uint;// = 4
private var shootAngle:Number;
public function DeimosObject(){
STATUS_WHIP = 4;
shooting = false;
super();
}
override protected function shoot(){
whiping = false;
shooting = true;
if (actorWorld == null){
actorWorld = body.GetWorld();
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.gun != null){
(graphic as MovieClip).still.gun.rotation = ((-(shootAngle) * 180) / Math.PI);
shootPoint = (graphic as MovieClip).still.gun.localToGlobal(new Point((graphic as MovieClip).still.gun.gunPoint.x, (graphic as MovieClip).still.gun.gunPoint.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
};
};
if (shootPoint == null){
return;
};
bulletSpeed = 5;
bulletSD = new b2PolygonDef();
bulletBD = new b2BodyDef();
if (graphic.scaleX > 0){
bulletBD.position.Set(((shootPoint.x + 10) / GParams.physScale), (shootPoint.y / GParams.physScale));
} else {
bulletBD.position.Set(((shootPoint.x - 10) / GParams.physScale), (shootPoint.y / GParams.physScale));
};
bulletBD.isBullet = true;
bulletSD.density = 0.1;
bulletBD.linearDamping = 0;
bulletObject = (graphic.parent as Container).getBullet(5);
bulletSD.SetAsBox((((3 * bulletObject.graphic.width) / 4) / GParams.physScale), (((3 * bulletObject.graphic.height) / 4) / GParams.physScale));
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
bulletSD.filter.categoryBits = 4;
bulletSD.filter.maskBits = 2;
bulletB.CreateShape(bulletSD);
bulletObject.init(bulletB);
bulletB.SetMassFromShapes();
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).tempusArray.push(bulletObject);
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetAntiGravity(true);
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
bulletSD = null;
bulletB = null;
bulletObject = null;
shootPoint = null;
}
override protected function setFrame(){
graphic.scaleX = turn;
if (maxVel.x != 0){
charStatus = STATUS_WALK;
} else {
charStatus = STATUS_STILL;
};
if (whiping){
charStatus = STATUS_WHIP;
};
if (hurt > 0){
charStatus = STATUS_HURT;
};
if (health <= 0){
charStatus = STATUS_DEATH;
};
switch (charStatus){
case STATUS_WALK:
if ((graphic as MovieClip).currentFrame != 3){
(graphic as MovieClip).gotoAndStop(3);
};
if (graphic.parent != null){
if (!(graphic.parent as Container).Tempus){
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.stop();
if ((graphic as MovieClip).walk.phoboLeg != null){
if ((graphic as MovieClip).walk.phoboLeg.phoboLeg1 != null){
(graphic as MovieClip).walk.phoboLeg.phoboLeg1.stop();
};
if ((graphic as MovieClip).walk.phoboLeg.phoboLeg2 != null){
(graphic as MovieClip).walk.phoboLeg.phoboLeg2.stop();
};
};
if ((graphic as MovieClip).walk.hand1 != null){
(graphic as MovieClip).walk.hand1.stop();
};
};
} else {
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.play();
if ((graphic as MovieClip).walk.phoboLeg != null){
if ((graphic as MovieClip).walk.phoboLeg.phoboLeg1 != null){
(graphic as MovieClip).walk.phoboLeg.phoboLeg1.play();
};
if ((graphic as MovieClip).walk.phoboLeg.phoboLeg2 != null){
(graphic as MovieClip).walk.phoboLeg.phoboLeg2.play();
};
};
if ((graphic as MovieClip).walk.hand1 != null){
(graphic as MovieClip).walk.hand1.play();
};
};
};
};
break;
case STATUS_STILL:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if (graphic.parent != null){
if (!(graphic.parent as Container).Tempus){
if ((graphic as MovieClip).still != null){
(graphic as MovieClip).still.stop();
};
} else {
if ((graphic as MovieClip).still != null){
(graphic as MovieClip).still.play();
if ((graphic as MovieClip).still.currentFrame == 27){
if (shootStatus >= 120){
(graphic as MovieClip).still.gotoAndPlay(29);
(graphic as MovieClip).still.gun.gotoAndPlay(1);
};
};
};
};
};
break;
case STATUS_WHIP:
if ((graphic as MovieClip).currentFrame != 2){
(graphic as MovieClip).gotoAndStop(2);
};
if ((graphic as MovieClip).whip != null){
if ((graphic as MovieClip).whip.currentFrame == (graphic as MovieClip).whip.totalFrames){
whiping = false;
(graphic as MovieClip).whip.gotoAndStop(1);
};
};
if (graphic.parent != null){
if (!(graphic.parent as Container).Tempus){
if ((graphic as MovieClip).whip != null){
(graphic as MovieClip).whip.stop();
};
} else {
if ((graphic as MovieClip).whip != null){
(graphic as MovieClip).whip.play();
};
};
};
break;
case STATUS_HURT:
if ((graphic as MovieClip).currentFrame != 4){
(graphic as MovieClip).gotoAndStop(4);
};
case STATUS_DEATH:
if ((graphic as MovieClip).currentFrame != 5){
(graphic as MovieClip).gotoAndStop(5);
};
break;
};
}
override public function whipped():Boolean{
if (((((graphic as MovieClip).currentFrame == 2)) && ((graphic.parent as Container).Tempus))){
if (((((graphic as MovieClip).whip.currentFrame <= 51)) && (((graphic as MovieClip).whip.currentFrame >= 47)))){
return (true);
};
};
return (false);
}
private function whip(){
whiping = true;
}
override public function update(){
super.update();
if (hurt > 0){
hurt--;
};
if (currHealth > health){
hurt = 10;
currHealth = health;
};
setFrame();
}
override public function move(){
vel = this.body.GetLinearVelocity();
think();
if (body.IsSleeping()){
body.WakeUp();
};
vel.Set(maxVel.x, 0);
}
override public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
if (_arg1){
shootAngle = Math.atan2(Math.abs((graphic.y - _arg3)), Math.abs((graphic.x - _arg2)));
if (_arg2 > graphic.x){
graphic.scaleX = GParams.RIGHT;
} else {
graphic.scaleX = GParams.LEFT;
};
turn = graphic.scaleX;
if (_arg3 < graphic.y){
shootAngle = (shootAngle * -1);
};
if (Math.abs((_arg2 - graphic.x)) > range){
alertStatus = false;
} else {
alertStatus = true;
};
if (whippable){
whip();
whippable = false;
} else {
if ((((((shootStatus > 10)) && ((charStatus == STATUS_STILL)))) && (!(((graphic as MovieClip).still == null))))){
if ((graphic as MovieClip).still.currentFrame == 10){
shoot();
shootStatus = 0;
};
};
};
shootStatus++;
} else {
if (whippable){
whip();
whippable = false;
alertStatus = true;
} else {
if (((((_arg2 - 50) > graphic.x)) && ((graphic.scaleX == GParams.LEFT)))){
graphic.scaleX = GParams.RIGHT;
} else {
if (((((_arg2 + 50) < graphic.x)) && ((graphic.scaleX == GParams.RIGHT)))){
graphic.scaleX = GParams.LEFT;
};
};
turn = graphic.scaleX;
alertStatus = false;
};
};
}
override protected function think(){
if (!alertStatus){
maxVel.Set((turn * 3), 0);
} else {
maxVel.Set(0, 0);
};
}
}
}//package
Section 284
//DynamicObject (DynamicObject)
package {
public class DynamicObject extends GameObject {
}
}//package
Section 285
//End (End)
package {
import flash.display.*;
public dynamic class End extends MovieClip {
public function End(){
addFrameScript(18, frame19, 19, frame20);
}
function frame20(){
stop();
}
function frame19(){
gotoAndPlay(1);
}
}
}//package
Section 286
//EndObject (EndObject)
package {
public class EndObject extends StaticObject {
}
}//package
Section 287
//EnemyObject (EnemyObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class EnemyObject extends GameObject {
protected var bulletB:b2Body;
public var prevX:Number;
private var currVel:int;// = 1
protected var STATUS_WALK:uint;// = 1
protected var charStatus:uint;
protected var healthBar:HealthBar;
protected var bulletBD:b2BodyDef;
public var maxVel:b2Vec2;
protected var actorWorld:b2World;
protected var hurt:int;
public var takeTurn:int;
public var vel:b2Vec2;
public var alertness:int;// = 0
protected var currHealth:Number;
private var tempMassData:b2MassData;
protected var STATUS_HURT:uint;// = 2
public var range:Number;// = 300
protected var STATUS_DEATH:uint;// = 3
protected var bulletSD:b2PolygonDef;
public var standingPlatform:StaticObject;// = null
protected var bulletObject:GameObject;
protected var bulletSpeed:Number;
public var alertStatus:Boolean;// = false
public var shootStatus:int;// = 0
protected var wait:int;
protected var STATUS_STILL:uint;// = 0
public var turn:int;
public function EnemyObject(){
standingPlatform = null;
turn = GParams.LEFT;
takeTurn = GParams.LEFT;
alertStatus = false;
alertness = 0;
shootStatus = 0;
range = 300;
bulletSD = new b2PolygonDef();
bulletBD = new b2BodyDef();
vel = new b2Vec2();
maxVel = new b2Vec2();
currVel = 1;
tempMassData = new b2MassData();
STATUS_STILL = 0;
STATUS_WALK = 1;
STATUS_HURT = 2;
STATUS_DEATH = 3;
super();
}
public function checkStuck(_arg1:Number){
if (Math.abs((prevX - graphic.x)) < 0.3){
if (_arg1 > 0){
takeTurn = GParams.LEFT;
} else {
if (_arg1 < 0){
takeTurn = GParams.RIGHT;
};
};
};
}
protected function shoot(){
}
public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
}
override public function update(){
prevX = this.graphic.x;
if (healthBar == null){
healthBar = new HealthBar();
};
if (health <= 0){
health = 0;
if ((graphic as MovieClip).contains(healthBar)){
(graphic as MovieClip).removeChild(healthBar);
};
};
health = int(health);
if (health > 0){
healthBar.hl.scaleX = (1 - (health / fullHealth));
} else {
healthBar.hl.scaleX = 0;
};
healthBar.y = -60;
if ((((health > 0)) && (!((graphic as MovieClip).contains(healthBar))))){
(graphic as MovieClip).addChild(healthBar);
};
if ((graphic as MovieClip).scaleX < 0){
if (healthBar.scaleX > 0){
healthBar.scaleX = -(healthBar.scaleX);
};
} else {
if (healthBar.scaleX < 0){
healthBar.scaleX = -(healthBar.scaleX);
};
};
if (this.body.GetAngle() != 0){
this.body.SetXForm(this.body.GetPosition(), 0);
};
super.update();
}
protected function setFrame(){
}
public function resetFrames(){
}
public function move(){
}
public function resetInertia(){
tempMassData.mass = this.body.GetMass();
tempMassData.center = this.body.GetLocalCenter();
tempMassData.I = 100000;
this.body.SetMass(tempMassData);
alertStatus = false;
alertness = 0;
shootStatus = 0;
standingPlatform = null;
turn = GParams.LEFT;
takeTurn = GParams.LEFT;
currHealth = health;
hurt = 0;
}
public function removeHealthBar(){
if (health <= 0){
health = 0;
if ((graphic as MovieClip).contains(healthBar)){
(graphic as MovieClip).removeChild(healthBar);
};
};
}
protected function think(){
}
}
}//package
Section 288
//Enforcer (Enforcer)
package {
import flash.display.*;
public dynamic class Enforcer extends MovieClip {
public var hurt:MovieClip;
public var die:MovieClip;
public var still:MovieClip;
public var walk:MovieClip;
public function Enforcer(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 289
//EnforcerObject (EnforcerObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import flash.geom.*;
public class EnforcerObject extends EnemyObject {
private var shootAngle:Number;
private var tempNumber:Number;
private var tempInc:Number;
private var shootPoint:Point;
override protected function shoot(){
if (actorWorld == null){
actorWorld = body.GetWorld();
tempNumber = 0;
tempInc = 1;
};
shootAngle = (shootAngle + (((tempNumber - 3) * Math.PI) / 36));
tempNumber = (tempNumber + tempInc);
if (tempNumber >= 6){
tempInc = -1;
};
if (tempNumber <= 0){
tempInc = 1;
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.gun != null){
(graphic as MovieClip).still.gun.rotation = ((-(shootAngle) * 180) / Math.PI);
(graphic as MovieClip).still.otherHand.rotation = ((-(shootAngle) * 180) / Math.PI);
shootPoint = (graphic as MovieClip).still.gun.localToGlobal(new Point((graphic as MovieClip).still.gun.gunPoint1.x, (graphic as MovieClip).still.gun.gunPoint1.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
};
};
bulletSpeed = 7;
if (shootPoint == null){
return;
};
bulletSD = new b2PolygonDef();
bulletBD = new b2BodyDef();
if (graphic.scaleX > 0){
bulletBD.position.Set((shootPoint.x / GParams.physScale), (shootPoint.y / GParams.physScale));
} else {
bulletBD.position.Set((shootPoint.x / GParams.physScale), (shootPoint.y / GParams.physScale));
};
bulletBD.isBullet = true;
bulletSD.density = 0.1;
bulletBD.linearDamping = 0;
bulletObject = (graphic.parent as Container).getBullet();
bulletSD.SetAsBox(((bulletObject.graphic.width / 2) / GParams.physScale), ((bulletObject.graphic.height / 2) / GParams.physScale));
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
bulletSD.filter.categoryBits = (4 | 2);
bulletSD.filter.maskBits = (4 | 2);
bulletB.CreateShape(bulletSD);
bulletObject.init(bulletB);
bulletB.SetMassFromShapes();
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).worldArray.push(bulletObject);
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_GUN1);
};
};
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetAntiGravity(true);
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
bulletSD = null;
bulletB = null;
bulletObject = null;
shootPoint = null;
}
override protected function setFrame(){
graphic.scaleX = turn;
if (maxVel.x != 0){
charStatus = STATUS_WALK;
} else {
charStatus = STATUS_STILL;
};
if (hurt > 0){
charStatus = STATUS_HURT;
};
if (health <= 0){
charStatus = STATUS_DEATH;
};
switch (charStatus){
case STATUS_WALK:
if ((graphic as MovieClip).currentFrame != 2){
(graphic as MovieClip).gotoAndStop(2);
};
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.stop();
};
} else {
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.play();
};
};
};
break;
case STATUS_STILL:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
(graphic as MovieClip).still.gun.firing.visible = false;
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
(graphic as MovieClip).still.gun.firing.visible = false;
} else {
if (((((shootStatus % 10) < 3)) && ((alertness == 90)))){
(graphic as MovieClip).still.gun.firing.visible = true;
} else {
(graphic as MovieClip).still.gun.firing.visible = false;
};
};
};
};
break;
case STATUS_HURT:
if ((graphic as MovieClip).currentFrame != 3){
(graphic as MovieClip).gotoAndStop(3);
};
case STATUS_DEATH:
if ((graphic as MovieClip).currentFrame != 4){
(graphic as MovieClip).gotoAndStop(4);
};
break;
};
}
override public function resetFrames(){
if ((graphic as MovieClip).still != null){
(graphic as MovieClip).still.gun.firing.visible = false;
};
}
override public function update(){
super.update();
if (hurt > 0){
hurt--;
};
if (currHealth > health){
hurt = 10;
currHealth = health;
};
setFrame();
}
override public function move(){
vel = this.body.GetLinearVelocity();
think();
if (body.IsSleeping()){
body.WakeUp();
};
vel.Set(maxVel.x, 0);
}
override public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
shootAngle = Math.atan2(Math.abs((graphic.y - _arg3)), Math.abs((graphic.x - _arg2)));
if (((_arg1) && ((((shootAngle < (Math.PI / 6))) || ((((shootAngle > (Math.PI / 2.5))) && ((_arg3 < graphic.y)))))))){
alertStatus = true;
alertness = 90;
if (shootStatus == 0){
shootStatus = 30;
};
if (_arg2 > graphic.x){
graphic.scaleX = GParams.RIGHT;
} else {
graphic.scaleX = GParams.LEFT;
};
turn = graphic.scaleX;
takeTurn = turn;
if ((shootStatus % 10) == 0){
if (Math.abs(shootAngle) < (Math.PI / 6)){
shootAngle = 0;
};
if (_arg3 < graphic.y){
shootAngle = (shootAngle * -1);
};
if (hurt <= 0){
shoot();
};
};
if (hurt <= 0){
shootStatus--;
};
} else {
shootStatus = 0;
if (alertness > 0){
alertness--;
};
if (alertness == 0){
alertStatus = false;
};
};
}
override protected function think(){
if (!alertStatus){
if (turn != takeTurn){
if (wait == 0){
wait = 60;
};
if (wait > 1){
wait--;
} else {
turn = takeTurn;
wait = 0;
};
maxVel.Set(0, 0);
} else {
maxVel.Set((turn * 2), 0);
wait = 0;
};
} else {
maxVel.Set(0, 0);
turn = graphic.scaleX;
takeTurn = turn;
};
}
}
}//package
Section 290
//EnterTempusSound (EnterTempusSound)
package {
public dynamic class EnterTempusSound extends CustomSound {
}
}//package
Section 291
//Explosion (Explosion)
package {
import flash.display.*;
public dynamic class Explosion extends MovieClip {
public function Explosion(){
addFrameScript(25, frame26);
}
function frame26(){
stop();
}
}
}//package
Section 292
//ExplosionSound (ExplosionSound)
package {
public dynamic class ExplosionSound extends CustomSound {
}
}//package
Section 293
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 294
//GameObject (GameObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class GameObject {
public var isStopped:Boolean;
private var littleMass:b2MassData;
public var fullHealth:Number;
public var health:Number;
private var velVect:Arrow;
public var body:b2Body;
public var graphic:DisplayObject;
public var velocity:b2Vec2;
public var damage:Number;
private var tempMassData:b2MassData;
public var mass:b2MassData;
public function GameObject(){
tempMassData = new b2MassData();
super();
}
public function initHealth(_arg1:Number=10, _arg2:Number=10){
graphic.rotation = 0;
graphic.scaleX = 1;
graphic.scaleY = 1;
damage = _arg1;
health = _arg2;
fullHealth = _arg2;
}
public function saveData(){
isStopped = false;
tempMassData.mass = this.body.GetMass();
tempMassData.center = this.body.GetLocalCenter();
tempMassData.I = this.body.GetInertia();
mass = tempMassData;
}
public function gameObject(){
body = null;
}
public function initDisplay(_arg1:DisplayObject){
graphic = _arg1;
}
public function resetVelocity(){
velocity = new b2Vec2(0, 0);
}
public function init(_arg1:b2Body){
body = _arg1;
littleMass = new b2MassData();
littleMass.mass = 0.01;
littleMass.center = this.body.GetLocalCenter();
littleMass.I = this.body.GetInertia();
}
public function update(){
var _local1:b2Vec2;
var _local2:Number;
_local1 = body.GetPosition();
_local2 = body.GetAngle();
graphic.x = (_local1.x * GParams.physScale);
graphic.y = (_local1.y * GParams.physScale);
graphic.rotation = ((_local2 * (180 / Math.PI)) % 360);
}
public function hideVelocity1(){
if (velVect == null){
return;
};
if (graphic.parent != null){
if ((graphic.parent as Sprite).contains(velVect)){
(graphic.parent as Sprite).removeChild(velVect);
};
};
}
public function saveVelocity(){
velocity = new b2Vec2(this.body.GetLinearVelocity().x, this.body.GetLinearVelocity().y);
}
public function makeDynamic(_arg1:Boolean=false){
this.body.SetLinearVelocity(this.velocity);
if (_arg1){
this.body.SetMass(littleMass);
} else {
this.body.SetMass(this.mass);
};
hideVelocity();
}
public function showVelocity(){
if (velVect == null){
velVect = new Arrow();
};
velVect.x = graphic.x;
velVect.y = graphic.y;
if (velocity == null){
saveVelocity();
saveData();
};
if (velocity.Length() > 1){
if (!(graphic.parent as Sprite).contains(velVect)){
(graphic.parent as Sprite).addChild(velVect);
};
velVect.rotation = ((180 * Math.atan2(velocity.y, velocity.x)) / Math.PI);
} else {
velVect.rotation = 0;
velocity.Set(0, 0);
if ((graphic.parent as Sprite).contains(velVect)){
(graphic.parent as Sprite).removeChild(velVect);
};
};
isStopped = true;
}
public function turnBy(_arg1:Number){
var _local2:Number;
var _local3:b2Vec2;
var _local4:Number;
var _local5:b2Vec2;
_local2 = (_arg1 - graphic.rotation);
if (velVect != null){
if (velVect.rotation != 0){
_local2 = (_arg1 - velVect.rotation);
};
};
if (_local2 > 0){
_local2 = (_local2 - 360);
};
_local2 = (_local2 * (-(Math.PI) / 180));
if (velocity != null){
_local5 = new b2Vec2(velocity.x, velocity.y);
velocity.x = ((_local5.x * Math.cos(_local2)) + (_local5.y * Math.sin(_local2)));
velocity.y = ((_local5.y * Math.cos(_local2)) - (_local5.x * Math.sin(_local2)));
};
_local3 = body.GetPosition();
_local4 = body.GetAngle();
_local4 = (_local4 - _local2);
_local4 = (_local4 % (2 * Math.PI));
body.SetXForm(_local3, _local4);
update();
}
public function makeStatic(){
this.saveData();
this.body.SetMass(new b2MassData());
this.body.SetLinearVelocity(new b2Vec2(0, 0));
showVelocity();
}
public function hideVelocity(){
if (velVect == null){
velVect = new Arrow();
};
if ((graphic.parent as Sprite).contains(velVect)){
(graphic.parent as Sprite).removeChild(velVect);
};
velVect.rotation = ((180 * Math.atan2(velocity.y, velocity.x)) / Math.PI);
isStopped = false;
}
}
}//package
Section 295
//GameObjectFactory (GameObjectFactory)
package {
public class GameObjectFactory {
private var hero:ActorObject;
private var maxShrapnelsT1:uint;
private var end:EndObject;
private var deimos:DeimosObject;
private var shrapnelTArray:Array;
private var debrisCArray:Array;
private var debrisCImage:int;
private var aetherArray:Array;
private var maxShrapnelsBr:uint;
private var currentMarsStone:int;
private var currentSimpleMissile:int;
private var currentAether:int;
private var shrapnelTImage:int;
private var maxTempusMissiles:uint;
private var debrisBrArray:Array;
private var currentTurretBullet:int;
private var currentTempusBullet:int;
private var maxDebrisB:uint;
private var maxDebrisC:uint;
private var shrapnelBrArray:Array;
private var shrapnelBrImage:int;
private var marsMissileArray:Array;
private var laserArray:Array;
private var marsCreated:Boolean;
private var currentMarsMissile:int;
private var currentTempusMissile:int;
private var maxSimpleMissiles:uint;
private var tempusMissileArray:Array;
private var turretBulletArray:Array;
private var maxGrenades:uint;
private var currentDebrisC:int;
private var gooBulletArray:Array;
private var debrisBArray:Array;
private var shrapnelT1Array:Array;
private var debrisBImage:int;
private var shrapnelT1Image:int;
private var maxMarsStones:uint;
private var bulletArray:Array;
private var currentDebrisB:int;
private var currentShrapnelB:int;
private var currentShrapnelG:int;
private var maxMarsMissiles:uint;
private var enemy;
private var currentShrapnelM:int;
private var maxLasers:uint;
private var endCreated:Boolean;
private var heroCreated:Boolean;
private var currentShrapnelT:int;
private var currentGrenade:int;
private var maxTurretBullets:uint;
private var tempusBulletArray:Array;
private var marsStoneArray:Array;
private var grenadeArray:Array;
private var simpleMissileArray:Array;
private var maxBullets:uint;
private var maxGooBullets:uint;
private var maxDebrisBr:uint;
private var shrapnelMArray:Array;
private var shrapnelMImage:int;
private var currentDebrisBr:int;
private var maxAethers:uint;
private var currentLaser:int;
private var currentBullet:int;
private var maxShrapnelsB:uint;
private var currentShrapnelT1:int;
private var shrapnelBArray:Array;
private var maxShrapnelsG:uint;
private var maxTempusBullets:uint;
private var shrapnelBImage:int;
private var mars:MarsObject;
private var maxShrapnelsT:uint;
private var currentGooBullet:int;
private var currentShrapnelBr:int;
private var debrisBrImage:int;
private var shrapnelGArray:Array;
private var element;
private var shrapnelGImage:int;
private var phobos:PhobosObject;
private var maxShrapnelsM:uint;
public function getObject(_arg1:uint):GameObject{
switch (_arg1){
case 100:
currentMarsStone = ((currentMarsStone + 1) % maxMarsStones);
if (marsStoneArray[currentMarsStone] == null){
marsStoneArray[currentMarsStone] = new MarsStone();
};
element = new MarsStoneObject();
marsStoneArray[currentMarsStone].gotoAndStop(1);
element.initDisplay(marsStoneArray[currentMarsStone]);
element.initHealth(GParams.marsStoneDamage, GParams.bulletHealth);
return (element);
case 50:
currentBullet = ((currentBullet + 1) % maxBullets);
if (bulletArray[currentBullet] == null){
bulletArray[currentBullet] = new Bullet();
};
element = new BulletObject();
bulletArray[currentBullet].gotoAndPlay(1);
element.initDisplay(bulletArray[currentBullet]);
element.initHealth(GParams.bulletDamage, GParams.bulletHealth);
return (element);
case 51:
currentGrenade = ((currentGrenade + 1) % maxGrenades);
if (grenadeArray[currentGrenade] == null){
grenadeArray[currentGrenade] = new Grenade();
};
element = new GrenadeObject();
element.initDisplay(grenadeArray[currentGrenade]);
element.initHealth(GParams.grenadeDamage, GParams.grenadeHealth);
return (element);
case 52:
currentLaser = ((currentLaser + 1) % maxLasers);
if (laserArray[currentLaser] == null){
laserArray[currentLaser] = new Laser();
};
element = new LaserObject();
element.initDisplay(laserArray[currentLaser]);
element.initHealth(GParams.laserDamage, GParams.laserHealth);
return (element);
case 53:
currentSimpleMissile = ((currentSimpleMissile + 1) % maxSimpleMissiles);
if (simpleMissileArray[currentSimpleMissile] == null){
simpleMissileArray[currentSimpleMissile] = new Missile();
};
element = new SimpleMissileObject();
element.initDisplay(simpleMissileArray[currentSimpleMissile]);
element.initHealth(GParams.missileDamage, GParams.missileHealth);
return (element);
case 54:
currentGooBullet = ((currentGooBullet + 1) % maxGooBullets);
if (gooBulletArray[currentGooBullet] == null){
gooBulletArray[currentGooBullet] = new GooBullet();
};
element = new GooBulletObject();
gooBulletArray[currentGooBullet].gotoAndPlay(1);
element.initDisplay(gooBulletArray[currentGooBullet]);
element.initHealth(GParams.gooBulletDamage, GParams.bulletHealth);
return (element);
case 55:
currentTempusBullet = ((currentTempusBullet + 1) % maxTempusBullets);
if (tempusBulletArray[currentTempusBullet] == null){
tempusBulletArray[currentTempusBullet] = new GooBullet();
};
element = new TempusBulletObject();
tempusBulletArray[currentTempusBullet].gotoAndPlay(1);
element.initDisplay(tempusBulletArray[currentTempusBullet]);
element.initHealth(GParams.gooBulletDamage, GParams.bulletHealth);
return (element);
case 62:
currentTurretBullet = ((currentTurretBullet + 1) % maxTurretBullets);
if (turretBulletArray[currentTurretBullet] == null){
turretBulletArray[currentTurretBullet] = new TurretBullet();
};
element = new BulletObject();
turretBulletArray[currentTurretBullet].gotoAndPlay(1);
element.initDisplay(turretBulletArray[currentTurretBullet]);
element.initHealth(GParams.turretBulletDamage, GParams.bulletHealth);
return (element);
case 56:
currentMarsMissile = ((currentMarsMissile + 1) % maxMarsMissiles);
if (marsMissileArray[currentMarsMissile] == null){
marsMissileArray[currentMarsMissile] = new MarsMissile();
};
element = new MarsMissileObject();
element.initDisplay(marsMissileArray[currentMarsMissile]);
element.initHealth(GParams.marsMissileDamage, GParams.missileHealth);
return (element);
case 57:
currentTempusMissile = ((currentTempusMissile + 1) % maxTempusMissiles);
if (tempusMissileArray[currentTempusMissile] == null){
tempusMissileArray[currentTempusMissile] = new MarsMissile();
};
element = new TempusMissileObject();
element.initDisplay(tempusMissileArray[currentTempusMissile]);
element.initHealth(GParams.marsMissileDamage, GParams.missileHealth);
return (element);
case 1:
element = new StaticObject();
element.initDisplay(new Wall());
element.initHealth();
return (element);
case 2:
element = new DynamicObject();
element.initDisplay(new Crate());
element.initHealth(GParams.crateDamage, GParams.crateHealth);
return (element);
case 3:
element = new StaticObject();
element.initDisplay(new Platform());
element.initHealth();
return (element);
case 4:
element = new DynamicObject();
element.initDisplay(new Barrel());
element.initHealth(GParams.barrelDamage, GParams.barrelHealth);
return (element);
case 5:
element = new DynamicObject();
element.initDisplay(new BarrelExp());
element.initHealth(GParams.barrelExpDamage, GParams.barrelExpHealth);
return (element);
case 6:
element = new DynamicObject();
element.initDisplay(new Stone());
element.initHealth(GParams.rockDamage, GParams.rockHealth);
return (element);
case 7:
element = new InvisibleObject();
element.initDisplay(new Light());
element.initHealth();
return (element);
case 8:
element = new PistonObject();
element.initDisplay(new Piston());
element.initHealth(0, 1000);
return (element);
case 90:
element = new PistonHeadObject();
element.initDisplay(new PistonHead());
element.initHealth(0, 1000);
return (element);
case 21:
currentShrapnelB = ((currentShrapnelB + 1) % maxShrapnelsB);
shrapnelBImage = ((shrapnelBImage + 1) % 5);
if (shrapnelBArray[currentShrapnelB] == null){
shrapnelBArray[currentShrapnelB] = new ShrapnelObject();
switch (shrapnelBImage){
case 1:
shrapnelBArray[currentShrapnelB].initDisplay(new Shrapnel1());
break;
case 2:
shrapnelBArray[currentShrapnelB].initDisplay(new Shrapnel2());
break;
case 3:
shrapnelBArray[currentShrapnelB].initDisplay(new Shrapnel3());
break;
case 4:
shrapnelBArray[currentShrapnelB].initDisplay(new Shrapnel4());
break;
default:
shrapnelBArray[currentShrapnelB].initDisplay(new Shrapnel());
};
};
shrapnelBArray[currentShrapnelB].initHealth(GParams.shrapnelDamage, GParams.shrapnelHealth);
return (shrapnelBArray[currentShrapnelB]);
case 22:
currentShrapnelG = ((currentShrapnelG + 1) % maxShrapnelsG);
shrapnelGImage = ((shrapnelGImage + 1) % 5);
if (shrapnelGArray[currentShrapnelG] == null){
shrapnelGArray[currentShrapnelG] = new ShrapnelObject();
switch (shrapnelGImage){
case 1:
shrapnelGArray[currentShrapnelG].initDisplay(new Shrapnel11());
break;
case 2:
shrapnelGArray[currentShrapnelG].initDisplay(new Shrapnel22());
break;
case 3:
shrapnelGArray[currentShrapnelG].initDisplay(new Shrapnel33());
break;
case 4:
shrapnelGArray[currentShrapnelG].initDisplay(new Shrapnel44());
break;
default:
shrapnelGArray[currentShrapnelG].initDisplay(new Shrapnel00());
};
};
shrapnelGArray[currentShrapnelG].initHealth(GParams.shrapnelDamage, GParams.shrapnelHealth);
return (shrapnelGArray[currentShrapnelG]);
case 23:
currentShrapnelM = ((currentShrapnelM + 1) % maxShrapnelsM);
shrapnelMImage = ((shrapnelMImage + 1) % 5);
if (shrapnelMArray[currentShrapnelM] == null){
shrapnelMArray[currentShrapnelM] = new ShrapnelObject();
switch (shrapnelMImage){
case 1:
shrapnelMArray[currentShrapnelM].initDisplay(new Shrapnel111());
break;
case 2:
shrapnelMArray[currentShrapnelM].initDisplay(new Shrapnel222());
break;
case 3:
shrapnelMArray[currentShrapnelM].initDisplay(new Shrapnel333());
break;
case 4:
shrapnelMArray[currentShrapnelM].initDisplay(new Shrapnel444());
break;
default:
shrapnelMArray[currentShrapnelM].initDisplay(new Shrapnel000());
};
};
shrapnelMArray[currentShrapnelM].initHealth(GParams.shrapnelDamage, GParams.shrapnelHealth);
return (shrapnelMArray[currentShrapnelM]);
case 24:
currentShrapnelBr = ((currentShrapnelBr + 1) % maxShrapnelsBr);
shrapnelBrImage = ((shrapnelBrImage + 1) % 5);
if (shrapnelBrArray[currentShrapnelBr] == null){
shrapnelBrArray[currentShrapnelBr] = new ShrapnelObject();
switch (shrapnelBrImage){
case 1:
shrapnelBrArray[currentShrapnelBr].initDisplay(new Shrapnel11111());
break;
case 2:
shrapnelBrArray[currentShrapnelBr].initDisplay(new Shrapnel22222());
break;
case 3:
shrapnelBrArray[currentShrapnelBr].initDisplay(new Shrapnel33333());
break;
case 4:
shrapnelBrArray[currentShrapnelBr].initDisplay(new Shrapnel44444());
break;
default:
shrapnelBrArray[currentShrapnelBr].initDisplay(new Shrapnel00000());
};
};
shrapnelBrArray[currentShrapnelBr].initHealth(GParams.shrapnelDamage, GParams.shrapnelHealth);
return (shrapnelBrArray[currentShrapnelBr]);
case 25:
currentDebrisB = ((currentDebrisB + 1) % maxDebrisB);
debrisBImage = ((debrisBImage + 1) % 5);
if (debrisBArray[currentDebrisB] == null){
debrisBArray[currentDebrisB] = new DebrisObject();
switch (debrisBImage){
case 1:
debrisBArray[currentDebrisB].initDisplay(new Debris11());
break;
case 2:
debrisBArray[currentDebrisB].initDisplay(new Debris22());
break;
case 3:
debrisBArray[currentDebrisB].initDisplay(new Debris33());
break;
case 4:
debrisBArray[currentDebrisB].initDisplay(new Debris44());
break;
default:
debrisBArray[currentDebrisB].initDisplay(new Debris00());
};
};
debrisBArray[currentDebrisB].initHealth(GParams.debrisDamage, GParams.debrisHealth);
return (debrisBArray[currentDebrisB]);
case 26:
currentDebrisC = ((currentDebrisC + 1) % maxDebrisC);
debrisCImage = ((debrisCImage + 1) % 3);
if (debrisCArray[currentDebrisC] == null){
debrisCArray[currentDebrisC] = new DebrisObject();
switch (debrisCImage){
case 1:
debrisCArray[currentDebrisC].initDisplay(new Debris1());
break;
case 2:
debrisCArray[currentDebrisC].initDisplay(new Debris2());
break;
case 3:
debrisCArray[currentDebrisC].initDisplay(new Debris3());
break;
case 4:
debrisCArray[currentDebrisC].initDisplay(new Debris4());
break;
default:
debrisCArray[currentDebrisC].initDisplay(new Debris());
};
};
debrisCArray[currentDebrisC].initHealth(GParams.debrisDamage, GParams.debrisHealth);
return (debrisCArray[currentDebrisC]);
case 27:
currentShrapnelT = ((currentShrapnelT + 1) % maxShrapnelsT);
shrapnelTImage = ((shrapnelTImage + 1) % 5);
if (shrapnelTArray[currentShrapnelT] == null){
shrapnelTArray[currentShrapnelT] = new ShrapnelObject();
switch (shrapnelTImage){
case 1:
shrapnelTArray[currentShrapnelT].initDisplay(new Shrapnel1111());
break;
case 2:
shrapnelTArray[currentShrapnelT].initDisplay(new Shrapnel2222());
break;
case 3:
shrapnelTArray[currentShrapnelT].initDisplay(new Shrapnel3333());
break;
case 4:
shrapnelTArray[currentShrapnelT].initDisplay(new Shrapnel4444());
break;
default:
shrapnelTArray[currentShrapnelT].initDisplay(new Shrapnel0000());
};
};
shrapnelTArray[currentShrapnelT].initHealth(GParams.shrapnelDamage, GParams.shrapnelHealth);
return (shrapnelTArray[currentShrapnelT]);
case 28:
currentShrapnelT1 = ((currentShrapnelT1 + 1) % maxShrapnelsT1);
shrapnelT1Image = ((shrapnelT1Image + 1) % 5);
if (shrapnelT1Array[currentShrapnelT1] == null){
shrapnelT1Array[currentShrapnelT1] = new ShrapnelTObject();
switch (shrapnelT1Image){
case 1:
shrapnelT1Array[currentShrapnelT1].initDisplay(new Shrapnel1111());
break;
case 2:
shrapnelT1Array[currentShrapnelT1].initDisplay(new Shrapnel2222());
break;
case 3:
shrapnelT1Array[currentShrapnelT1].initDisplay(new Shrapnel3333());
break;
case 4:
shrapnelT1Array[currentShrapnelT1].initDisplay(new Shrapnel4444());
break;
default:
shrapnelT1Array[currentShrapnelT1].initDisplay(new Shrapnel0000());
};
};
shrapnelT1Array[currentShrapnelT1].initHealth(GParams.shrapnelDamage, GParams.shrapnelHealth);
return (shrapnelT1Array[currentShrapnelT1]);
case 31:
currentDebrisBr = ((currentDebrisBr + 1) % maxDebrisBr);
debrisBrImage = ((debrisBrImage + 1) % 5);
if (debrisBrArray[currentDebrisBr] == null){
debrisBrArray[currentDebrisBr] = new DebrisObject();
switch (debrisBrImage){
case 1:
debrisBrArray[currentDebrisBr].initDisplay(new Debris111());
break;
case 2:
debrisBrArray[currentDebrisBr].initDisplay(new Debris222());
break;
case 3:
debrisBrArray[currentDebrisBr].initDisplay(new Debris333());
break;
case 4:
debrisBrArray[currentDebrisBr].initDisplay(new Debris444());
break;
default:
debrisBrArray[currentDebrisBr].initDisplay(new Debris000());
};
};
debrisBrArray[currentDebrisBr].initHealth(GParams.debrisDamage, GParams.debrisHealth);
return (debrisBrArray[currentDebrisBr]);
case 9:
element = new ReflectiveObject();
element.initDisplay(new ReflectiveWall());
element.initHealth(GParams.crateDamage, GParams.rockHealth);
return (element);
case 10:
if (!heroCreated){
heroCreated = true;
hero.initHealth(GParams.heroDamage, GParams.heroHealth);
return (hero);
};
throw (new Error(" multiple heroes created"));
case 61:
enemy = new TurretObject();
enemy.initDisplay(new Turret());
enemy.initHealth(GParams.turretDamage, GParams.turretHealth);
return (enemy);
case 11:
enemy = new PeacekeeperObject();
enemy.initDisplay(new Peacekeeper());
enemy.initHealth(GParams.peacekeeperDamage, GParams.peacekeeperHealth);
return (enemy);
case 12:
enemy = new EnforcerObject();
enemy.initDisplay(new Enforcer());
enemy.initHealth(GParams.enforcerDamage, GParams.enforcerHealth);
return (enemy);
case 13:
enemy = new GladiatorObject();
enemy.initDisplay(new Gladiator());
enemy.initHealth(GParams.gladiatorDamage, GParams.gladiatorHealth);
return (enemy);
case 14:
enemy = new TriariiObject();
enemy.initDisplay(new Triarii());
enemy.initHealth(GParams.triariiDamage, GParams.triariiHealth);
return (enemy);
case 15:
enemy = new PraetorianGuardObject();
enemy.initDisplay(new PGuard());
enemy.initHealth(GParams.pGuardDamage, GParams.pGuardHealth);
return (enemy);
case 16:
enemy = new PraetorianUmbraObject();
enemy.initDisplay(new PUmbra());
enemy.initHealth(GParams.pUmbraDamage, GParams.pUmbraHealth);
return (enemy);
case 17:
enemy = new ChariotObject();
enemy.initDisplay(new Chariot());
enemy.initHealth(GParams.chariotDamage, GParams.chariotHealth);
return (enemy);
case 29:
enemy = new ChariotObject();
enemy.initDisplay(new ChariotSimple());
enemy.initHealth(GParams.chariotDamage, GParams.chariotHealth);
return (enemy);
case 18:
phobos.initHealth(GParams.phobosDamage, GParams.phobosHealth);
return (phobos);
case 19:
deimos.initHealth(GParams.phobosDamage, GParams.phobosHealth);
return (deimos);
case 20:
if (!marsCreated){
marsCreated = true;
mars.initHealth(GParams.marsDamage, GParams.marsHealth);
return (mars);
};
throw (new Error(" multiple deimos created"));
case 30:
if (!endCreated){
endCreated = true;
end.initHealth();
return (end);
};
throw (new Error(" multiple end points"));
case 40:
element = new PowerupObject();
element.initDisplay(new ClayTalisman());
element.initHealth(GParams.powerupDamage, GParams.powerupHealth);
return (element);
case 41:
element = new PowerupObject();
element.initDisplay(new StoneTalisman());
element.initHealth(GParams.powerupDamage, GParams.powerupHealth);
return (element);
case 42:
currentAether = ((currentAether + 1) % maxAethers);
if (aetherArray[currentAether] == null){
aetherArray[currentAether] = new Aether();
};
element = new PowerupObject();
aetherArray[currentAether].gotoAndPlay(1);
element.initDisplay(aetherArray[currentAether]);
element.initHealth(GParams.powerupDamage, GParams.powerupHealth);
return (element);
case 43:
element = new PowerupObject();
element.initDisplay(new RubyTalisman());
element.initHealth(GParams.powerupDamage, GParams.powerupHealth);
return (element);
case 44:
element = new PowerupObject();
element.initDisplay(new AetherTalisman());
element.initHealth(GParams.powerupDamage, GParams.powerupHealth);
return (element);
default:
return (null);
};
}
public function init(){
maxBullets = 100;
currentBullet = -1;
if (bulletArray == null){
bulletArray = new Array();
};
maxMarsStones = 50;
currentMarsStone = -1;
if (marsStoneArray == null){
marsStoneArray = new Array();
};
maxGooBullets = 50;
currentGooBullet = -1;
if (gooBulletArray == null){
gooBulletArray = new Array();
};
maxTempusBullets = 50;
currentTempusBullet = -1;
if (tempusBulletArray == null){
tempusBulletArray = new Array();
};
maxTurretBullets = 200;
currentTurretBullet = -1;
if (turretBulletArray == null){
turretBulletArray = new Array();
};
maxSimpleMissiles = 20;
currentSimpleMissile = -1;
if (simpleMissileArray == null){
simpleMissileArray = new Array();
};
maxTempusMissiles = 20;
currentTempusMissile = -1;
if (tempusMissileArray == null){
tempusMissileArray = new Array();
};
maxMarsMissiles = 20;
currentMarsMissile = -1;
if (marsMissileArray == null){
marsMissileArray = new Array();
};
maxGrenades = 50;
currentGrenade = -1;
if (grenadeArray == null){
grenadeArray = new Array();
};
maxLasers = 500;
currentLaser = -1;
if (laserArray == null){
laserArray = new Array();
};
maxShrapnelsB = 100;
currentShrapnelB = -1;
shrapnelBImage = -1;
if (shrapnelBArray == null){
shrapnelBArray = new Array();
};
maxShrapnelsBr = 100;
currentShrapnelBr = -1;
shrapnelBrImage = -1;
if (shrapnelBrArray == null){
shrapnelBrArray = new Array();
};
maxShrapnelsG = 100;
currentShrapnelG = -1;
shrapnelGImage = -1;
if (shrapnelGArray == null){
shrapnelGArray = new Array();
};
maxShrapnelsM = 100;
currentShrapnelM = -1;
shrapnelMImage = -1;
if (shrapnelMArray == null){
shrapnelMArray = new Array();
};
maxShrapnelsT = 100;
currentShrapnelT = -1;
shrapnelTImage = -1;
if (shrapnelTArray == null){
shrapnelTArray = new Array();
};
maxShrapnelsT1 = 100;
currentShrapnelT1 = -1;
shrapnelT1Image = -1;
if (shrapnelT1Array == null){
shrapnelT1Array = new Array();
};
maxDebrisB = 100;
currentDebrisB = -1;
debrisBImage = -1;
if (debrisBArray == null){
debrisBArray = new Array();
};
maxDebrisBr = 100;
currentDebrisBr = -1;
debrisBrImage = -1;
if (debrisBrArray == null){
debrisBrArray = new Array();
};
maxDebrisC = 100;
currentDebrisC = -1;
debrisCImage = -1;
if (debrisCArray == null){
debrisCArray = new Array();
};
maxAethers = 50;
currentAether = -1;
if (aetherArray == null){
aetherArray = new Array();
};
heroCreated = false;
if (hero == null){
hero = new ActorObject();
hero.initDisplay(new Hero());
};
phobos = new PhobosObject();
phobos.initDisplay(new Phobos());
deimos = new DeimosObject();
deimos.initDisplay(new Deimos());
marsCreated = false;
if (mars == null){
mars = new MarsObject();
mars.initDisplay(new Mars());
mars.initDisplay2(new MarsLeg());
};
endCreated = false;
if (end == null){
end = new EndObject();
end.initDisplay(new End());
};
}
}
}//package
Section 296
//GameOver (GameOver)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class GameOver extends MovieClip {
var urlPlayMore:String;// = "http://www.flasharcade.com/ref.php?button=logo&game=ace048"
var requestPlayMore:URLRequest;// = null
public var endFrame:Boolean;// = false
public var GOver:MovieClip;
private static var gameOver:GameOver = null;
public function GameOver(){
urlPlayMore = "http://www.flasharcade.com/ref.php?button=logo&game=ace048";
requestPlayMore = null;
endFrame = false;
super();
addFrameScript(14, frame15);
if (!GParams.LevelEditor){
GOver.levelEditor.visible = false;
} else {
GOver.levelEditor.visible = true;
};
}
public function init(){
gotoAndPlay(1);
requestPlayMore = new URLRequest(urlPlayMore);
addEventListener(MouseEvent.CLICK, handleClick);
}
public function removeAllListener(){
removeEventListener(MouseEvent.CLICK, handleClick);
}
public function handleClick(_arg1:MouseEvent){
if (_arg1.target.name == "playLogo"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
navigateToURL(requestPlayMore, "_blank");
};
if (_arg1.target.name == "replay"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
(this.parent as MainClass).removeLevel();
removeAllListener();
(this.parent as MainClass).startLevel();
};
if (_arg1.target.name == "playAgain"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
(this.parent as MainClass).removeLevel();
removeAllListener();
if (this.parent != null){
removeAllListener();
(this.parent as MainClass).createWelcome();
};
};
if (_arg1.target.name == "levelEditor"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
(this.parent as MainClass).removeLevel();
MainClass.currentLevel = 0;
removeAllListener();
(this.parent as MainClass).initLevelEditor();
};
}
function frame15(){
stop();
}
}
}//package
Section 297
//GameOverSound (GameOverSound)
package {
public dynamic class GameOverSound extends CustomSound {
}
}//package
Section 298
//GateSound (GateSound)
package {
public dynamic class GateSound extends CustomSound {
}
}//package
Section 299
//Gladiator (Gladiator)
package {
import flash.display.*;
public dynamic class Gladiator extends MovieClip {
public var death:MovieClip;
public var still:MovieClip;
public var walk:MovieClip;
public function Gladiator(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 300
//GladiatorObject (GladiatorObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import flash.geom.*;
public class GladiatorObject extends EnemyObject {
private var grenadeSD:b2CircleDef;
private var disX:Number;
private var disY:Number;
private var shootPoint:Point;
private var shootAngle:Number;
override protected function shoot(){
if (actorWorld == null){
actorWorld = body.GetWorld();
};
if ((graphic as MovieClip).still != null){
shootPoint = (graphic as MovieClip).still.localToGlobal(new Point((graphic as MovieClip).still.gunPoint.x, (graphic as MovieClip).still.gunPoint.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
};
if (shootPoint == null){
return;
};
grenadeSD = new b2CircleDef();
bulletBD = new b2BodyDef();
if (graphic.scaleX > 0){
bulletBD.position.Set(((shootPoint.x + 5) / GParams.physScale), (shootPoint.y / GParams.physScale));
} else {
bulletBD.position.Set(((shootPoint.x - 5) / GParams.physScale), (shootPoint.y / GParams.physScale));
};
bulletBD.isBullet = true;
grenadeSD.density = 1;
grenadeSD.friction = 0;
bulletBD.linearDamping = 0.2;
bulletObject = (graphic.parent as Container).getBullet(1);
grenadeSD.radius = ((bulletObject.graphic.width / 2) / GParams.physScale);
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
grenadeSD.filter.categoryBits = (4 | 2);
grenadeSD.filter.maskBits = (4 | 2);
bulletB.CreateShape(grenadeSD);
bulletObject.init(bulletB);
bulletB.SetMassFromShapes();
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).worldArray.push(bulletObject);
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_LAUNCH);
};
};
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
grenadeSD = null;
bulletB = null;
bulletObject = null;
}
override protected function setFrame(){
graphic.scaleX = turn;
if (maxVel.x != 0){
charStatus = STATUS_WALK;
} else {
charStatus = STATUS_STILL;
};
if (health <= 0){
charStatus = STATUS_DEATH;
};
switch (charStatus){
case STATUS_WALK:
if ((graphic as MovieClip).currentFrame != 2){
(graphic as MovieClip).gotoAndStop(2);
};
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.stop();
};
} else {
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.play();
};
};
};
break;
case STATUS_STILL:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
if (alertStatus){
if ((graphic as MovieClip).still.gunHand.currentFrame != 2){
(graphic as MovieClip).still.gunHand.gotoAndStop(2);
};
if ((graphic as MovieClip).still.gunHand.firing != null){
if ((((shootStatus <= 10)) && ((shootStatus > 0)))){
(graphic as MovieClip).still.gunHand.firing.play();
} else {
(graphic as MovieClip).still.gunHand.firing.gotoAndStop(1);
};
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
(graphic as MovieClip).still.gunHand.firing.stop();
};
};
};
} else {
(graphic as MovieClip).still.gunHand.gotoAndStop(1);
};
};
break;
case STATUS_DEATH:
if ((graphic as MovieClip).currentFrame != 5){
(graphic as MovieClip).gotoAndStop(5);
};
break;
};
}
override public function update(){
super.update();
setFrame();
}
override public function resetFrames(){
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.gunHand != null){
if ((graphic as MovieClip).still.gunHand.firing != null){
(graphic as MovieClip).still.gunHand.firing.gotoAndStop(1);
};
};
};
}
override public function move(){
vel = this.body.GetLinearVelocity();
think();
if (body.IsSleeping()){
body.WakeUp();
};
vel.Set(maxVel.x, 0);
}
override public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
if (_arg1){
alertStatus = true;
alertness = 90;
if (shootStatus == 0){
shootStatus = 30;
};
if (_arg2 > graphic.x){
graphic.scaleX = GParams.RIGHT;
} else {
graphic.scaleX = GParams.LEFT;
};
turn = graphic.scaleX;
takeTurn = turn;
if (shootStatus == 10){
shootAngle = ((-60 * Math.PI) / 180);
disX = (Math.abs((_arg2 - this.graphic.x)) / GParams.physScale);
disY = ((_arg3 - this.graphic.y) / GParams.physScale);
bulletSpeed = Math.sqrt(Math.abs(((60 * Math.pow(disX, 2)) / (disY + (1.732 * disX)))));
shoot();
};
shootStatus--;
} else {
shootStatus = 0;
if (alertness > 0){
alertness--;
};
if (alertness == 0){
alertStatus = false;
};
};
}
override protected function think(){
if (!alertStatus){
if (turn != takeTurn){
if (wait == 0){
wait = 60;
};
if (wait > 1){
wait--;
} else {
turn = takeTurn;
wait = 0;
};
maxVel.Set(0, 0);
} else {
maxVel.Set((turn * 2), 0);
wait = 0;
};
} else {
maxVel.Set(0, 0);
};
}
}
}//package
Section 301
//GooBullet (GooBullet)
package {
import flash.display.*;
public dynamic class GooBullet extends MovieClip {
public function GooBullet(){
addFrameScript(9, frame10, 10, frame11);
}
function frame10(){
gotoAndPlay(1);
}
function frame11(){
stop();
}
}
}//package
Section 302
//GooBulletObject (GooBulletObject)
package {
import Box2D.Common.Math.*;
public class GooBulletObject extends GameObject {
override public function update(){
var _local1:b2Vec2;
var _local2:Number;
_local1 = body.GetPosition();
_local2 = body.GetAngle();
graphic.x = (_local1.x * GParams.physScale);
graphic.y = (_local1.y * GParams.physScale);
if (((!((body.GetLinearVelocity().Length() == 0))) && (!(isStopped)))){
graphic.rotation = ((Math.atan2(body.GetLinearVelocity().y, body.GetLinearVelocity().x) * 180) / Math.PI);
} else {
if (velocity != null){
graphic.rotation = ((Math.atan2(velocity.y, velocity.x) * 180) / Math.PI);
};
};
}
}
}//package
Section 303
//GParams (GParams)
package {
public class GParams {
public static var pauseCode:Number = 80;
public static var saveEnabled:Boolean = false;
public static var bulletHealth:Number = 1;
public static var saveLevel:Boolean = false;
public static var heroDamage:Number = 0;
public static var bulletDamage:Number = 2;
public static var spaceCode:Number = 32;
public static var LEFT:int = -1;
public static var crateDamage:Number = 1;
public static var laserDamage:Number = 1.5;
public static var marsStoneDamage:Number = 10;
public static var turretBulletDamage:Number = 1;
public static var shrapnelHealth:Number = 20;
public static var upCode:Number = 87;
public static var rightCode:Number = 68;
public static var phobosHealth:Number = 100;
public static var missileDamage:Number = 1;
public static var gooBulletDamage:Number = 5;
public static var rockHealth:Number = 10000;
public static var rockDamage:Number = 2;
public static var phobosDamage:Number = 0;
public static var laserHealth:Number = 1;
public static var shrapnelDamage:Number = 6;
public static var enforcerHealth:Number = 5;
public static var missileHealth:Number = 1;
public static var grenadeHealth:Number = 40;
public static var physScale:Number = 30;
public static var peacekeeperHealth:Number = 1;
public static var grenadeDamage:Number = 0;
public static var enforcerDamage:Number = 10;
public static var marsMissileDamage:Number = 5;
public static var turretHealth:Number = 10000;
public static var peacekeeperDamage:Number = 10;
public static var SIN1:Number = Math.sin(((1 * Math.PI) / 180));
public static var chariotHealth:Number = 50;
public static var customLevelString:String;
public static var turretDamage:Number = 0;
public static var chariotDamage:Number = 10;
public static var levelCode:Array = new Array();
public static var leftCode:Number = 65;
public static var restartCode:Number = 82;
public static var marsHealth:Number = 150;
public static var levelWidth:Array = new Array(2500, 776, 1530, 1530, 1530, 1530, 1015, 2184, 1026, 1369, 1317, 1474, 2666, 2112, 1966, 934, 1043, 942, 1200, 2750, 2715, 776, 1439, 1810, 968, 2156, 2105, 2797, 2000, 2582, 0x0700, 1000, 1273, 1988, 1393, 1393);
public static var marsDamage:Number = 0;
public static var pUmbraHealth:Number = 1;
public static var barrelHealth:Number = 20;
public static var COS1:Number = Math.cos(((1 * Math.PI) / 180));
public static var downCode:Number = 83;
public static var screenHeight:uint = 500;
public static var barrelDamage:Number = 1;
public static var gModeCode:Number = 71;
public static var screenWidth:uint = 700;
public static var playLevelCode:Array = new Array("Beginning", "Up", "Freeze", "Enemy", "Drop", "Bullet", "Fall", "Courtyard", "Utilize", "Uncover", "Stairway", "Break", "Trap", "Puzzle", "Mirror", "Smash", "Projectile", "Timing", "Roll", "Swarm", "Ladder", "Chariot", "Careful", "Umbra", "Grab", "Combo", "Chaos", "Simple", "Shrapnel", "Choose", "Tango", "Maze", "Circles", "Brothers", "Mars");
public static var pUmbraDamage:Number = 0.5;
public static var gladiatorHealth:Number = 1;
public static var gladiatorDamage:Number = 10;
public static var debrisDamage:Number = 0;
public static var levelHeight:Array = new Array(2500, 509, 503, 503, 503, 503, 587, 1205, 587, 789, 792, 900, 902, 1312, 695, 638, 860, 678, 740, 938, 752, 1204, 987, 1228, 1228, 1305, 1228, 810, 846, 789, 1252, 1000, 1275, 2019, 1000, 997);
public static var loadCustomLevel = false;
public static var debrisHealth:Number = 20;
public static var triariiHealth:Number = 25;
public static var pGuardHealth:Number = 1;
public static var triariiDamage:Number = 10;
public static var barrelExpHealth:Number = 1;
public static var quitCode:Number = 81;
public static var powerupHealth:Number = 1;
public static var pGuardDamage:Number = 0.5;
public static var barrelExpDamage:Number = 1;
public static var powerupDamage:Number = 0;
public static var LevelEditor = true;
public static var RAD:Number = 0.0174532925199433;
public static var heroHealth:Number = 100;
public static var RIGHT:int = 1;
public static var crateHealth:Number = 20;
levelWidth[50] = 2800;
levelHeight[50] = 2800;
levelCode[0] = new Array([Hero, 49, 449, 0, 1, 1], [Wall, 1, 250, 0, 1, 50], [Platform, 390, 503, 0, 80, 1], [Platform, 392.5, 6.25, 0, 75, 1], [Wall, 776.5, 252.25, 0, 1, 50], [End, 700, 432.5, 0, 1, 1]);
levelCode[1] = new Array([Hero, 42, 465, 0, 1, 1], [Wall, 1, 251, 0, 1, 50], [Platform, 390, 509, 0, 80, 1], [Platform, 392.5, 6.25, 0, 75, 1], [Wall, 776.5, 252.25, 0, 1, 50], [Ins1, 60, 200, 0, 1, 1], [End, 700, 432.5, 0, 1, 1], [BG1E2, 37, 127, 0, 1, 1], [BG1E2, 391, 15, 0, 1, 1]);
levelCode[2] = new Array([Hero, 39, 461, 0, 1, 1], [Wall, 1, 253, 0, 1, 55], [Platform, 391.75, 503.75, 0, 75, 1], [Platform, 392.5, 6.25, 0, 75, 1], [Wall, 1530.5, 254.25, 0, 1, 50], [End, 1404, 90.3, 0, 1, 1], [Platform, 1145, 503.75, 0, 75, 1], [Platform, 1143.75, 5, 0, 75, 1], [Platform, 272, 387, 0, 20, 1], [Platform, 916, 283.5, 0, 22, 1], [SwingChain, 683.65, 34.8, 0, 1, 10], [Platform, 1396.4, 254.6, 0, 23, 1], [Platform, 502.5, 294.5, 0, 15, 1], [InsAr1, 392, 325, 0, 1, 1], [InsAr2, 928, 65, 0, 1, 1], [Ins2, 1246, 127, 0, 1, 1], [BG1E1, 36, 307, 0, 1, 1], [BG1E1, 819, 82, 0, 1, 1], [BG1E2, 1097, 272, 0, 1, 1], [BG1E2, 249, 22, 0, 1, 1], [SwingChain, 1166.65, 34.8, 0, 1, 10]);
levelCode[3] = new Array([Hero, 189.3, 458.65, 0, 1, 1], [Wall, 7, 275, 0, 1, 55], [Platform, 320, 502.3, 0, 60, 1], [Platform, 392.5, 6.25, 0, 75, 1], [Wall, 1530.5, 254.25, 0, 1, 52], [End, 1452.25, 434.5, 0, 1, 1], [Platform, 1215, 503.75, 0, 60, 1], [Platform, 1143.75, 5, 0, 75, 1], [Platform, 818.45, 239.2, 0, 30, 1], [Crate, 56, 474, 0, 2, 2], [Crate, 111.65, 472.35, 0, 2, 2], [Crate, 111.85, 433, 0, 2, 2], [Crate, 56.3, 432.55, 0, 2, 2], [Ins4, 160, 200, 0, 1, 1], [BG1E2, 64, 40, 0, 1, 1], [BG1E1, 760, 42, 0, 1, 1], [BG1E1, 1061, 306, 0, 1, 1], [Pit, 767, 536, 0, 2, 1]);
levelCode[4] = new Array([Hero, 48, 461, 0, 1, 1], [Wall, 1, 275, 0, 1, 55], [Platform, 514.75, 503.75, 0, 100, 1], [Platform, 392.5, 6.25, 0, 75, 1], [Wall, 1530, 254, 0, 1, 52], [End, 1432.25, 434.5, 0, 1, 1], [Platform, 1142, 503.75, 0, 25, 1], [Platform, 1143.75, 5, 0, 75, 1], [Platform, 1394.25, 503.75, 0, 25, 1], [Peacekeeper, 1178.75, 460.5, 0, 1, 1], [ClayTalisman, 1173.75, 343.75, 0, 1, 1], [Ins5, 100, 200, 0, 1, 1], [BG1E1, 146, 306, 0, 1, 1], [BG1E1, 991, 306, 0, 1, 1], [BG1E2, 1241, 56, 0, 1, 1], [BG1E2, 317, 72, 0, 1, 1]);
levelCode[5] = new Array([Hero, 49, 458, 0, 1, 1], [Wall, 7, 275, 0, 1, 55], [Platform, 511.75, 500, 0, 98, 1], [Platform, 600, 0, 0, 120, 1], [Crate, 366.5, 477, 0, 2, 1.5], [Peacekeeper, 486, 443.5, 0, 1, 1], [Wall, 1015.5, 255.5, 0, 1, 53], [Platform, 574, 488, 0, 30, 1], [Crate, 372, 439.5, 0, 1.5, 1.5], [Crate, 301.5, 471, 0, 2, 2], [End, 953, 434.5, 0, 1, 1], [Crate, 781.5, 435.5, 0, 1.5, 1.5], [Crate, 781, 473, 0, 2, 2], [Crate, 838.75, 468.75, 0, 2, 2], [Wall, 882.5, 319, 0, 1, 35], [Platform, 796, 407.75, 0, 14, 1], [Wall, 741, 454, 0, 1, 8], [ClayTalisman, 65.75, 357.05, 0, 1, 1], [Platform, 281, 438, 0, 8, 1], [Wall, 338, 409, 0, 1, 7], [Platform, 373, 369, 0, 10, 1], [Ins7, 71, 200, 0, 1, 1], [BG1E1, 558, 291.5, 0, 1, 1], [BG1E2, 95, 44, 0, 1, 1], [Wall, 406, 434.75, 0, 1, 11.8]);
levelCode[6] = new Array([Hero, 145, 544, 0, 1, 1], [Wall, 1, 293, 0, 1, 60], [Platform, 511, 587, 0, 100, 1], [Platform, 600, 0, 0, 120, 1], [Peacekeeper, 474.75, 531.5, 0, 1, 1], [Platform, 597, 575, 0, 30, 1], [Crate, 971, 515, 0, 2, 2], [Crate, 971, 559, 0, 2, 2], [Crate, 911, 558, 0, 3, 2], [Platform, 167, 457, 0, 30, 1], [Peacekeeper, 138, 414, 0, 1, 1], [Wall, 426, 406, 0, 1, 35], [End, 929, 228, 0, 1, 1], [Wall, 1020, 301, 0, 1, 60], [Ins8, 151, 177, 0, 1, 1], [BG1E1, 84, 258, 0, 1, 1], [BG1E2, 450, 262, 0, 1, 1]);
levelCode[7] = new Array([Hero, 199.3, 164.75, 0, 1, 1], [Wall, 1, 250, 0, 1, 50], [Platform, 542.2, 1205.8, 0, 50, 1], [Platform, 392.5, 6.25, 0, 75, 1], [Wall, 776.5, 252.25, 0, 1, 50], [End, 2107.6, 1158.5, 0, 1, 1], [Wall, 776.5, 749.75, 0, 1, 50], [Wall, 776.5, 1048.15, 0, 1, 10], [Wall, 60.45, 1098.65, 0, 1, 20], [Wall, 60.45, 498.75, 0, 1, 100], [Platform, 186.6, 660.9, 0, 23, 1], [Platform, 647.7, 657.6, 0, 23, 1], [Turret, 588.75, 701.5, 0, 1, 1], [Turret, 653.6, 702.15, 0, 1, 1], [Platform, 687.3, 1051.85, 0, 15, 1], [Turret, 595.2, 316.95, 0, 1, 1], [Turret, 658.75, 319, 0, 1, 1], [Turret, 161, 335.5, 0, 1, 1], [Turret, 718.65, 155.3, 0, 1, 1], [Turret, 247.8, 333.1, 0, 1, 1], [Turret, 166.85, 711.4, 0, 1, 1], [Platform, 634.8, 285.3, 0, 28, 1], [Platform, 212.4, 217.6, 0, 27, 1], [Platform, 211.7, 290.05, 0, 28, 1], [Platform, 630.15, 217.15, 0, 27, 1], [Stone, 579.55, 194.6, 0, 2.5, 2.5], [Stone, 578.3, 158.8, 0, 2.5, 2.5], [Stone, 110, 192.8, 0, 2.5, 2.5], [BreakableWall, 422.7, 222.4, 90, 1, 1], [Turret, 629.3, 909.05, 0, 1, 1], [Turret, 105.65, 1049.7, 0, 1, 1], [Turret, 107.1, 995.65, 0, 1, 1], [Turret, 228.55, 705.7, 0, 1, 1], [Wall, 597.55, 1104.75, 0, 1, 11], [Platform, 464.25, 1154.2, 0, 30, 1], [Platform, 178.6, 1205.8, 0, 23, 1], [Platform, 1292.2, 1052.45, 0, 100, 1], [Turret, 668.6, 1174.2, 0, 1, 1], [Platform, 990.85, 1205.8, 0, 40, 1], [Turret, 842.85, 1090, 0, 1, 1], [Turret, 950, 1090, 0, 1, 1], [Turret, 1054.1, 1088.5, 0, 1, 1], [Turret, 1165.7, 1090, 0, 1, 1], [Turret, 1297.1, 1088.55, 0, 1, 1], [Turret, 1428.55, 1090, 0, 1, 1], [Turret, 1535.7, 1091.4, 0, 1, 1], [Platform, 1436.55, 1205.8, 0, 50, 1], [Platform, 1935.4, 1205.8, 0, 50, 1], [Platform, 1992.5, 1052.85, 0, 40, 1], [Wall, 2184.25, 1129.7, 0, 1, 15], [Stone, 1821, 1181.45, 0, 2.5, 2.5], [Stone, 1836.05, 1147.35, 0, 2.5, 2.5], [Stone, 1848.75, 1112.9, 0, 2.5, 2.5], [Turret, 1625.2, 1090, 0, 1, 1], [Turret, 1755.7, 1092.9, 0, 1, 1], [Turret, 1689.1, 1090, 0, 1, 1], [Turret, 2001.3, 1085.65, 0, 1, 1], [Turret, 2008.55, 1171.55, 0, 1, 1], [Turret, 2102.85, 1092.85, 0, 1, 1], [Stone, 1925.5, 1181.35, 0, 2.5, 2.5], [Stone, 1908, 1145.9, 0, 2.5, 2.5], [Stone, 1891.3, 1111.45, 0, 2.5, 2.5], [Stone, 1871.25, 1078.55, 0, 2.5, 2.5]);
levelCode[8] = new Array([Hero, 180, 416, 0, 1, 1], [Wall, 1, 300, 0, 1, 60], [Platform, 880, 572, 0, 26, 1], [Platform, 600, 0, 0, 120, 1], [Peacekeeper, 616, 530, 0, 0.5, 1], [Platform, 599, 572, 0, 30, 1], [Crate, 980, 504, 0, 2, 2], [Crate, 981, 546, 0, 2, 2], [Crate, 920, 544, 0, 3, 2], [Platform, 157, 457, 0, 27, 1], [Wall, 319, 341, 0, 1, 17], [End, 72, 520, 0, 1, 1], [Wall, 1026, 306, 0, 1, 60], [Platform, 453, 0x0100, 0, 30, 1], [BarrelExp, 578, 231, 0, 2, 2], [BarrelExp, 543, 232, 0, 2, 2], [Platform, 909, 345, 0, 20, 1], [Enforcer, 894, 304, 0, 0.5, 1], [Enforcer, 167, 533, 0, 0.5, 1], [Platform, 167, 572, 0, 30, 1], [Platform, 383, 572, 0, 13, 1]);
levelCode[9] = new Array([Hero, 439.25, 746.75, 0, 1, 1], [Wall, 0, 400, 0, 1, 80], [Platform, 517, 789, 0, 100, 1], [Platform, 674, 0, 0, 140, 1], [Peacekeeper, 230, 501, 0, 0.5, 1], [Platform, 1019.75, 624.25, 0, 12, 1], [Crate, 1077, 758, 0, 2, 2], [Crate, 1019.75, 713, 0, 2, 2], [Crate, 0x0400, 756, 0, 3, 2], [Platform, 218, 541, 0, 40, 1], [Wall, 627, 537.5, 0, 1, 49], [End, 702, 706, 0, 1, 1], [Platform, 442, 285, 0, 40, 1], [BarrelExp, 124, 765, 0, 2, 2], [BarrelExp, 90, 765, 0, 2, 2], [Platform, 917.9, 420, 0, 55, 1], [Enforcer, 869, 380, 0, 0.5, 1], [Enforcer, 1140, 283, 0, 0.5, 1], [Platform, 1201, 321, 0, 30, 1], [Crate, 207, 760, 0, 2, 2], [Crate, 271, 760, 0, 2, 2], [Peacekeeper, 388, 243, 0, 0.5, 1], [Wall, 1369, 438, 0, 1, 90], [Enforcer, 1005.75, 584.25, 0, 0.5, 1], [Wall, 976, 707.25, 0, 1, 15], [Platform, 1105, 532, 0, 30, 1], [Wall, 971, 476.5, 0, 1, 10], [Enforcer, 1229, 748, 0, 1, 1], [Platform, 1228, 789, 0, 25, 1], [Platform, 1061, 789, 0, 8, 1]);
levelCode[10] = new Array([Wall, 7, 400, 0, 1, 80], [Platform, 364, 774, 0, 20, 1], [Platform, 392.5, 3.75, 0, 75, 1], [Peacekeeper, 858, 539, 0, 0.5, 1], [Platform, 643, 662, 0, 12, 1], [Crate, 664.3, 704, 0, 2, 2], [Crate, 666, 758, 0, 3, 2], [Platform, 74, 604, 0, 10, 1], [Wall, 719, 536, 0, 1, 50], [End, 350, 728, 0, 1, 1], [BarrelExp, 358, 651, 0, 2, 2], [BarrelExp, 320, 651, 0, 2, 2], [Platform, 603, 464, 0, 20, 1], [Enforcer, 600, 427, 0, 0.5, 1], [Enforcer, 872, 251, 0, 0.5, 1], [Platform, 836, 291, 0, 20, 1], [Peacekeeper, 286.9, 375.4, 0, 0.5, 1], [Wall, 1317, 388, 0, 1, 80], [Enforcer, 634, 624, 0, 0.5, 1], [Wall, 602, 728, 0, 1, 12], [Enforcer, 56, 564, 0, 1, 1], [Platform, 867, 580, 0, 10, 1], [Platform, 1152, 568, 0, 10, 1], [Platform, 998, 457, 0, 10, 1], [Platform, 1117, 334, 0, 10, 1], [Peacekeeper, 993, 417, 0, 0.5, 1], [Crate, 1144, 542, 0, 2, 2], [BarrelExp, 407, 652, 0, 2, 2], [Hero, 1216.3, 748.65, 0, 1, 1], [Stone, 326, 686, 0, 2.5, 2.5], [Stone, 359, 719, 0, 2.5, 2.5], [Stone, 391, 719, 0, 2.5, 2.5], [Stone, 328, 750, 0, 2.5, 2.5], [Stone, 361, 750, 0, 2.5, 2.5], [SwingChain, 356.8, 424, 0, 1, 5], [Stone, 326, 719, 0, 2.5, 2.5], [Stone, 357, 686, 0, 2.5, 2.5], [Stone, 392, 686, 0, 2.5, 2.5], [Stone, 423, 750, 0, 2.5, 2.5], [Stone, 423, 719, 0, 2.5, 2.5], [Stone, 424, 686, 0, 2.5, 2.5], [Stone, 294, 750, 0, 2.5, 2.5], [Stone, 293, 719, 0, 2.5, 2.5], [Stone, 295, 688, 0, 2.5, 2.5], [Platform, 1045, 2.5, 0, 55, 1], [Platform, 950, 792, 0, 71, 1], [Pit, 295.9, 824, 0, 4, 1], [Stone, 392.75, 750, 0, 2.5, 2.5], [Platform, 294, 427, 0, 20, 1], [Platform, 294, 416, 0, 20, 1]);
levelCode[11] = new Array([Wall, 7, 495, 0, 1, 100], [Platform, 272, 899, 0, 50, 1], [Hero, 47, 858, 0, 1, 1], [Platform, 498, 798, 0, 20, 1], [Platform, 148, 398, 0, 20, 1], [Platform, 1057, 900, 0, 80, 1], [Platform, 791, 720, 0, 20, 1], [Platform, 431, 597, 0, 20, 1], [StoneTalisman, 80, 306, 0, 1, 1], [Peacekeeper, 359, 556, 0, 1, 1], [Crate, 141, 371, 0, 2, 2], [Crate, 188, 371, 0, 2, 2], [Crate, 165, 330, 0, 2, 2], [Peacekeeper, 530, 756, 0, 1, 1], [Peacekeeper, 846, 678, 0, 1, 1], [Platform, 1283, 489, 0, 15, 1], [End, 1253, 426, 0, 1, 1], [Wall, 1474, 408, 0, 1, 100], [Enforcer, 1200, 861, 0, 1, 1], [Pit, 590, 933, 0, 0.9, 1]);
levelCode[12] = new Array([Wall, 10, 506, 0, 1, 100], [Platform, 268, 900, 0, 50, 1], [Hero, 82.55, 855.25, 0, 1, 1], [Platform, 503, 798, 0, 20, 1], [Platform, 120.5, 398, 0, 19, 1], [Platform, 1018.05, 900, 0, 99.8, 1], [Platform, 791, 720, 0, 20, 1], [Platform, 504.75, 597, 0, 20, 1], [StoneTalisman, 1316.25, 588.5, 0, 1, 1], [Peacekeeper, 499.25, 555, 0, 1, 1], [Crate, 2450.25, 870, 0, 2, 2], [Crate, 2401, 871.75, 0, 2, 2], [Crate, 2350.75, 873.25, 0, 2, 2], [Peacekeeper, 561, 756, 0, 1, 1], [Peacekeeper, 857, 679, 0, 1, 1], [Platform, 1333, 636.5, 0, 15, 1], [End, 465.5, 364.75, 0, 1, 1], [Wall, 2100.5, 231.5, 0, 1, 100], [Enforcer, 1200, 861, 0, 1, 1], [Platform, 512.5, 413.75, 0, 20, 1], [Wall, 326.25, 588.75, 0, 1, 61], [Crate, 363.75, 871.25, 0, 2, 2], [Crate, 411.5, 871.75, 0, 2, 2], [BarrelExp, 265.75, 757.25, 0, 2, 2], [Platform, 812, 274, 0, 100, 1], [ClayTalisman, 61.25, 247.5, 0, 1, 1], [Wall, 1910, 638.75, 0, 1, 50], [Crate, 1105, 556.25, 0, 1.5, 1.5], [BarrelExp, 1551.5, 559, 0, 1.5, 1.5], [Invisible, 1552.5, 579.5, 0, 5, 1], [Invisible, 1613.5, 578, 0, 5, 1], [Invisible, 1164.5, 575, 0, 5, 1], [Invisible, 1104, 576.5, 0, 5, 1], [Invisible, 1678.5, 586, 0, 5, 1], [Crate, 1868, 819, 0, 2, 2], [Crate, 1867.5, 867.5, 0, 2.5, 2.5], [BarrelExp, 1686, 878.5, 0, 1.5, 1.5], [Enforcer, 1577, 234, 0, 1, 1], [Barrel, 1614, 562, 0, 1.5, 1.5], [Barrel, 1163, 560, 0, 1.5, 1.5], [ClayTalisman, 375, 756, 0, 1, 1], [ClayTalisman, 420, 750, 0, 1, 1], [ClayTalisman, 368, 692, 0, 1, 1], [Stone, 1678.85, 560.8, 0, 3, 3], [Stone, 459.05, 874.5, 0, 3, 3], [Pit, 2745, 935, 0, 3, 1], [Platform, 2019, 900, 0, 100, 1], [Platform, 1563, 274, 0, 50, 1], [Platform, 243, 781, 0, 13, 1], [Crate, 281, 868, 0, 2.5, 2.5], [Crate, 280, 815, 0, 2.5, 2.5], [Crate, 229, 870, 0, 2.5, 2.5], [BreakableWall, 189, 840, 0, 1, 0.7], [Platform, 519, 7, 0, 100, 1], [Platform, 1519, 7, 0, 100, 1], [Platform, 2052, 7, 0, 6, 1]);
levelCode[13] = new Array([Wall, 6.7, 375.75, 0, 1, 100], [Platform, 423.1, 1312.4, 0, 80, 1], [Hero, 503.85, 1261.45, 0, 1, 1], [Platform, 1665.4, 1096.5, 0, 20, 1], [Platform, 1235, 1312.4, 0, 82, 1], [StoneTalisman, 561.35, 1036, 0, 1, 1], [End, 1597.7, 911.3, 0, 1, 1], [Enforcer, 1719, 1273.4, 0, 1, 1], [Platform, 1641.65, 956, 0, 15, 1], [Wall, 443.55, 1065.5, 0, 1, 28], [Platform, 1744.4, 706.85, 0, 70, 1], [Wall, 1550.05, 1080.05, 0, 1, 45.5], [Crate, 607.4, 986.45, 0, 1.5, 1.5], [BarrelExp, 663.85, 1291.45, 0, 1.5, 1.5], [BarrelExp, 977.3, 991.75, 0, 1.5, 1.5], [BarrelExp, 1149.6, 995.9, 0, 1.5, 1.5], [Invisible, 978.35, 1014.1, 0, 5, 1], [Invisible, 1078.5, 995.5, 0, 5, 1], [Invisible, 671.2, 981.15, 0, 5, 1], [Invisible, 607.3, 1005.75, 0, 5, 1], [Invisible, 1151.85, 1019.5, 0, 5, 1], [Crate, 1081.5, 968.5, 0, 2, 2], [Crate, 1237.55, 990.25, 0, 2.5, 2.5], [BarrelExp, 1240.95, 1287.15, 0, 1.5, 1.5], [Gladiator, 1638.75, 1052.2, 0, 1, 1], [Wall, 2112.4, 804.05, 0, 1, 100], [Stone, 2029.7, 735.2, 0, 3, 3], [Stone, 1484.15, 739.2, 0, 3, 3], [Platform, 1836.65, 1312.4, 0, 38, 1], [Platform, 337, 918, 0, 40, 1], [Platform, 688, 918, 0, 29.8, 1], [Stone, 672, 960.5, 0, 2.5, 2.5], [Stone, 1586.2, 1289.75, 0, 2.5, 2.5], [Stone, 1586.7, 1256.95, 0, 2.5, 2.5], [Stone, 2074.7, 1285.65, 0, 3, 3], [Stone, 1336.15, 1003.6, 0, 3, 3], [BarrelExp, 2074.8, 1248.35, 0, 2, 2], [BarrelExp, 1625, 1287.15, 0, 2, 2], [Crate, 1587.25, 1225.45, 0, 1.5, 1.5], [Enforcer, 1668.2, 917.1, 0, 1, 1], [Invisible, 758.55, 1000, 0, 5, 1], [Invisible, 822.85, 998.6, 0, 5, 1], [Invisible, 908.55, 998.55, 0, 5, 1], [Crate, 750, 974.2, 0, 2, 2], [Crate, 829.95, 961.4, 0, 2, 2.5], [Barrel, 900, 975.7, 0, 2, 2], [ClayTalisman, 570.35, 950.05, 0, 1, 1], [ClayTalisman, 528.7, 988.05, 0, 1, 1], [ClayTalisman, 482.35, 954.2, 0, 1, 1], [ClayTalisman, 488.05, 1050.6, 0, 1, 1], [Platform, 1120, 918, 0, 56.4, 1], [Platform, 1480.1, 1062.35, 0, 10, 1], [Platform, 2089, 1312.4, 0, 12, 1], [Wall, 1418.8, 815.2, 0, 1, 21], [Invisible, 1236, 1026, 0, 5, 1], [Invisible, 1336, 1026, 0, 5, 1], [Invisible, 1484.85, 762.2, 0, 5, 1], [Invisible, 2029, 754.2, 0, 5, 1], [Wall, 2112.4, 153, 0, 1, 30], [Wall, 6.7, 1125, 0, 1, 50], [BreakableWall, 442.55, 1257.6, 0, 1, 0.7], [Platform, 1767, 857, 0, 40, 1]);
levelCode[14] = new Array([Hero, 930.25, 410.25, 0, 1, 1], [Wall, 2.25, 350, 0, 1, 70], [Platform, 518, 694.25, 0, 100, 1], [Platform, 518.75, 0, 0, 100, 1], [Wall, 1966, 351, 0, 1, 70], [End, 1061.25, 513.75, 0, 1, 1], [Platform, 957.25, 455, 0, 100, 1], [Wall, 862.25, 505.5, 0, 1, 8.5], [Wall, 1010, 503, 0, 1, 8.5], [Turret, 929.5, 565.25, 0, 1, 1], [Platform, 501.25, 554.75, 0, 75, 1], [Platform, 1370, 552.25, 0, 75, 1], [Wall, 1727, 367.75, 0, 1, 36], [Wall, 143.25, 369, 0, 1, 36], [BreakableWall, 237.5, 196.25, 90, 1, 1.05], [BarrelExp, 826, 524.25, 0, 2.5, 2.5], [BarrelExp, 791.75, 523.5, 0, 2.5, 2.5], [BarrelExp, 759, 522.75, 0, 2.5, 2.5], [Wall, 473.25, 399.75, 0, 1, 10], [Wall, 1440.25, 398, 0, 1, 10], [Platform, 1484.75, 694.25, 0, 93, 1], [Platform, 1484, 0.25, 0, 93, 1], [Platform, 1224.25, 355, 0, 40, 1], [Platform, 680.75, 355.25, 0, 38, 1], [BreakableWall, 1128.75, 505.25, 0, 1, 0.6], [BreakableWall, 720.75, 504.75, 0, 1, 0.6], [Platform, 814.5, 196, 0, 100, 1], [Platform, 1435, 196, 0, 24, 1], [BreakableWall, 1633.75, 195.25, 90, 1, 1.05], [Wall, 943.25, 99, 0, 1, 19], [Aether, 200, 400, 0, 1, 1], [Aether, 1679, 402, 0, 1, 1], [Aether, 523, 244, 0, 1, 1], [Aether, 1412, 239, 0, 1, 1], [Aether, 1417, 510, 0, 1, 1], [Aether, 531, 510, 0, 1, 1]);
levelCode[15] = new Array([Platform, 318, 638, 0, 60, 1], [Wall, 0, 513, 0, 1, 100], [Platform, 501, 14, 0, 100, 1], [Hero, 31.95, 595.6, 0, 0.5, 1], [Platform, 769.7, 518.95, 0, 30, 1], [Stone, 33.7, 283.85, 0, 2.5, 2.5], [Wall, 934, 441, 0, 1, 100], [End, 885.1, 589, 0, 1, 1], [Platform, 295, 305.4, 0, 35, 1], [Peacekeeper, 431.3, 264.1, 0, 1, 1], [Triarii, 742.75, 581.75, 0, 1, 1], [Ins17, 31.15, 239.8, 0, 1, 1], [ReflectiveWall, 31.15, 239.8, 0, 1, 1], [Platform, 720, 638, 0, 20, 1], [BG3E1, 158, 362, 0, 1, 1], [BG3E4, 614, 210, 0, 1, 1], [SwingChain, 727.7, 121.25, 0, 1, 9], [Platform, 872, 638, 0, 10, 1], [Stone, 899, 615, 0, 2.5, 2.5], [Stone, 899, 583, 0, 2.5, 2.5], [Stone, 868, 615, 0, 2.5, 2.5], [Stone, 868, 583, 0, 2.5, 2.5], [Stone, 899, 550, 0, 2.5, 2.5], [Stone, 868, 551, 0, 2.5, 2.5], [Wall, 487, 306, 0, 1, 22], [Platform, 728, 114, 0, 10, 1], [Wall, 694, 64, 0, 1, 9], [Wall, 761, 63, 0, 1, 9], [Wall, 728, 62, 0, 1, 9], [Platform, 68, 305.4, 0, 10, 1]);
levelCode[16] = new Array([Platform, 241, 860, 0, 45, 1], [Wall, 0, 513, 0, 1, 100], [Platform, 501, 7, 0, 100, 1], [Hero, 826.95, 99.2, 0, 0.5, 1], [Platform, 644, 437.6, 0, 25, 1], [Wall, 934, 441, 0, 1, 100], [End, 56.25, 549.8, 0, 1, 1], [Platform, 268, 437.6, 0, 50, 1], [Peacekeeper, 240.95, 817.65, 0, 1, 1], [Triarii, 345.75, 380.75, 0, 1, 1], [ReflectiveWall, 872.5, 105, 0, 1, 1], [Platform, 710.4, 860, 0, 41, 1], [Platform, 662, 140, 0, 50, 1], [Peacekeeper, 456.45, 535.9, 0, 1, 1], [Wall, 788.05, 343.2, 0, 1, 20], [Piston, 628.95, 183.45, 0, 1, 1], [BG3E7, 85.5, 581.2, 0, 1, 1], [BG3E3, 382.5, 552.65, 0, 1, 1], [BG3E2, 676.15, 544.05, 0, 1, 1], [BreakableWall, 541.35, 288.85, 0, 1, 1.9], [Wall, 484.65, 723.35, 0, 1, 28], [SwingChain, 708, 471.3, 0, 1, 6], [Platform, 483.1, 577.15, 0, 10, 1], [Wall, 629, 160, 0, 1, 3], [Wall, 659, 168, 0, 1, 5], [Wall, 598, 168, 0, 1, 5], [Platform, 708, 450, 0, 4, 1], [Platform, 708, 461, 0, 4, 1]);
levelCode[17] = new Array([Platform, 168.25, 678.4, 0, 30, 1], [Wall, 0, 513, 0, 1, 100], [Platform, 521, 14, 0, 100, 1], [Hero, 107.95, 638.25, 0, 0.5, 1], [Platform, 627.5, 437.6, 0, 21, 1], [Wall, 942.5, 526.1, 0, 1, 100], [End, 871, 129.05, 0, 1, 1], [Platform, 272.5, 437.6, 0, 50, 1], [Peacekeeper, 391.4, 635.2, 0, 1, 1], [Triarii, 612.9, 381, 0, 1, 1], [ReflectiveWall, 36.3, 644.95, 0, 1, 1], [Platform, 773.75, 678.5, 0, 30, 1], [Platform, 673.65, 168.35, 0, 50, 1], [Peacekeeper, 792.6, 635.65, 0, 1, 1], [Wall, 748, 438.9, 0, 1, 20], [PGuard, 156.6, 213.45, 0, 1, 1], [Stone, 70, 655.1, 0, 2.5, 2.5], [Platform, 470.25, 678.35, 0, 30, 1], [ClayTalisman, 890, 215, 0, 1, 1], [ClayTalisman, 832.5, 215, 0, 1, 1], [BG3E7, 130, 498, 0, 1, 1], [BG3E1, 496, 452, 0, 1, 1], [BreakableWall, 476, 91, 0, 1, 0.95]);
levelCode[18] = new Array([Platform, 298, 740, 0, 56.3, 1], [Wall, 0, 513, 0, 1, 100], [Platform, 519.35, 9.1, 0, 100, 1], [Hero, 44.8, 241, 0, 0.5, 1], [Wall, 1200.9, 504.45, 0, 1, 100], [End, 46, 335.8, 0, 1, 1], [Platform, 93.7, 391.3, 0, 15, 1], [Triarii, 534.75, 226, 0, 1, 1], [ReflectiveWall, 31.6, 88.85, 0, 1, 1], [Platform, 899, 740, 0, 57, 1], [Platform, 251, 283.35, 0, 47, 1], [Wall, 597, 364, 0, 1, 15], [Piston, 126.65, 16, 0, 1, 1], [Piston, 272.65, 17.1, 0, 1, 1], [Piston, 423.55, 16.2, 0, 1, 1], [Piston, 702.7, 17.65, 0, 1, 1], [Piston, 1031.6, 16.9, 0, 1, 1], [Piston, 876.6, 16.65, 0, 1, 1], [Triarii, 87.65, 681.35, 0, 1, 1], [Wall, 597, 624.5, 0, 1, 25], [Platform, 871, 283.35, 0, 46, 1], [Platform, 563, 283.35, 0, 15, 1], [PGuard, 836.9, 408.3, 0, 1, 1], [PGuard, 685.15, 421.6, 0, 1, 1], [PGuard, 776.75, 413.15, 0, 1, 1], [PGuard, 625, 426.65, 0, 1, 1], [Platform, 664.05, 504, 0, 10, 1], [Platform, 32.85, 126.35, 0, 3, 1], [StoneTalisman, 500, 332.5, 0, 1, 1], [BG3E4, 143, 456, 0, 1, 1], [BG3E3, 659, 463.25, 0, 1, 1], [Platform, 67, 589, 0, 10, 1], [Triarii, 57, 532, 0, 1, 1], [Platform, 575, 504, 0, 1, 1], [Platform, 1101.9, 9.1, 0, 16.5, 1]);
levelCode[19] = new Array([Platform, 368, 727, 0, 70, 1], [Wall, 0, 513, 0, 1, 100], [Platform, 521, 14, 0, 100, 1], [Platform, 802.25, 322, -15, 25, 1], [Hero, 2393.15, 228.55, 0, 0.5, 1], [Platform, 852, 518, 0, 20, 1], [Stone, 784.75, 495.75, 0, 2.5, 2.5], [Crate, 900, 451.75, 0, 1.5, 1.5], [Crate, 900.5, 490.25, 0, 2, 2], [BarrelExp, 859.5, 497, 0, 1.5, 1.5], [BarrelExp, 827, 497.5, 0, 1.5, 1.5], [Platform, 1798.3, 452.1, 0, 25, 1], [Platform, 1430.8, 818.3, 0, 15, 1], [Wall, 938, 726, 0, 1, 40], [Crate, 1904.1, 904.65, 0, 2, 2], [Platform, 1421, 938, 0, 100, 1], [PGuard, 1236.35, 713.2, 0, 1, 1], [PGuard, 1567.1, 559.6, 0, 1, 1], [Wall, 1944, 614, 0, 1, 66], [PGuard, 1688.65, 398.9, 0, 1, 1], [End, 1818.85, 356.5, 0, 1, 1], [Platform, 1300, 289, 0, 25, 1], [Platform, 1475, 16.25, 0, 90, 1], [Platform, 1677.5, 288.75, 0, 50, 1], [Peacekeeper, 1291.25, 248.75, 0, 1, 1], [Peacekeeper, 862.5, 259.25, 0, 1, 1], [Platform, 1047.5, 288.75, 0, 25, 1], [Peacekeeper, 1053.75, 246.75, 0, 1, 1], [Platform, 559.75, 387.75, -15, 25, 1], [Peacekeeper, 639, 321, 0, 1, 1], [Triarii, 828.05, 672.3, 0, 1, 1], [Platform, 364, 420.25, 0, 15, 1], [RollingBarrel, 1641.85, 255.7, 0, 2.5, 2.5], [RollingBarrelExp, 1699.95, 257.75, 0, 2.5, 2.5], [RubyTalisman, 112.5, 565, 0, 1, 1], [ClayTalisman, 1878.25, 387.8, 0, 1, 1], [ClayTalisman, 1744.2, 532.65, 0, 1, 1], [ClayTalisman, 1882.05, 531, 0, 1, 1], [BG3E9, 1074, 1284, 0, 1, 1], [BG3E2, 561, 752.3, 0, 1, 1], [BG3E7, 121, 751, 0, 1, 1], [Piston, 1872.45, 24.25, 0, 1, 1], [Platform, 2394.15, 267.95, 0, 10, 1], [PGuard, 2037.05, 109.4, 0, 1, 1], [PGuard, 2096.1, 64.65, 0, 1, 1], [Platform, 820, 727, 0, 20, 1], [PGuard, 1295.6, 767.5, 0, 1, 1], [PGuard, 1635.7, 338.65, 0, 1, 1], [PGuard, 1495.95, 658.45, 0, 1, 1], [Platform, 2420, 16.25, 0, 100, 1]);
levelCode[20] = new Array([Platform, 415, 752.5, 0, 80, 1], [Wall, 0, 375, 0, 1, 75], [Platform, 68, 501.5, 0, 10, 1], [Peacekeeper, 219.5, 462.5, 0, 1, 1], [Platform, 944, 649, 160, 30, 1], [Peacekeeper, 479.5, 552, 0, 1, 1], [Wall, 1101.5, 400, 0, 1, 40], [Platform, 220, 501.5, 0, 20, 1], [Platform, 142, 232.5, 0, 25, 1], [Peacekeeper, 199, 192, 0, 1, 1], [Platform, 846, 323.5, 0, 10, 1], [Platform, 868, 196, 0, 10, 1], [Platform, 0x0505, 193.5, 0, 40, 1], [Platform, 1440, 305, 0, 30, 1], [Platform, 1349.5, 495, 0, 30, 1], [Platform, 1515, 697.5, 0, 30, 1], [Wall, 1610.5, 316, 0, 1, 62], [Platform, 500, 1, 0, 100, 1], [Platform, 1500, 1, 0, 100, 1], [Platform, 1966.5, 697.5, 0, 60, 1], [Platform, 1894, 582, 0, 15, 1], [Platform, 1707, 472, 0, 15, 1], [Crate, 1657.5, 267.5, 0, 1, 1], [Crate, 1699.5, 259, 0, 2, 2], [Crate, 1746, 0x0100, 0, 2, 2], [Platform, 2648.5, 696, 0, 10, 1], [Wall, 2715.5, 350, 0, 1, 70], [End, 2646.5, 655.5, 0, 1, 1], [Hero, 48.8, 706.7, 0, 1, 1], [Platform, 480, 592.5, 0, 10, 1], [Triarii, 862, 140.5, 0, 0.5, 1], [Triarii, 1447, 249.5, 0, 0.5, 1], [Triarii, 1332.5, 439.5, 0, 0.5, 1], [PGuard, 1845, 208, 0, 1, 1], [PGuard, 1995, 343.5, 0, 1, 1], [PGuard, 1905, 370.5, 0, 1, 1], [PGuard, 2328.5, 489, 0, 1, 1], [PGuard, 2202, 384.5, 0, 1, 1], [PGuard, 2243.5, 471.5, 0, 1, 1], [PGuard, 2060.5, 427, 0, 1, 1], [PGuard, 1905, 170, 0, 1, 1], [PGuard, 2294, 426.5, 0, 1, 1], [ReflectiveWall, 28.5, 711.5, 0, 1, 1], [ReflectiveWall, 1222, 153.5, 0, 1, 1], [Platform, 1710, 285, 0, 15, 1], [Stone, 75, 470, 0, 2.5, 2.5], [AetherTalisman, 1670, 157.5, 0, 1, 1], [StoneTalisman, 1566, 76, 0, 1, 1], [BG3E9, 227, 43, 0, 1, 1], [BG3E4, 1624, 516, 0, 1, 1], [BG3E5, 2009, 623, 0, 1, 1], [Pit, 1941, 786, 0, 15, 1], [Peacekeeper, 844, 283, 0, 1, 1], [SwingChain, 556, 38, 0, 1, 6], [Wall, 801, 726, 0, 1, 4], [Platform, 2502, 0, 0, 100, 1]);
levelCode[21] = new Array([Hero, 113.6, 1157, 0, 1, 1], [Wall, 1, 250, 0, 1, 50], [Platform, 391.45, 1204.7, 0, 80, 1], [Platform, 392.5, 6.25, 0, 75, 1], [Wall, 776.5, 252.25, 0, 1, 50], [End, 115.45, 97.55, 0, 1, 1], [Turret, 171.3, 872.2, 0, 1, 1], [Wall, 776.5, 749.75, 0, 1, 50], [Wall, 776.5, 1098.65, 0, 1, 20], [Wall, 60.45, 1098.65, 0, 1, 20], [Wall, 60.45, 498.75, 0, 1, 100], [Platform, 126.6, 765.3, 0, 10, 1], [Platform, 685.55, 767.05, 0, 15, 1], [Turret, 131.15, 834.65, 0, 1, 1], [Turret, 98.65, 804.3, 0, 1, 1], [Platform, 225.1, 1093.2, 0, 30, 1], [Turret, 623.35, 565.9, 0, 1, 1], [Turret, 725.7, 452.85, 0, 1, 1], [Turret, 687.1, 492.85, 0, 1, 1], [Turret, 652.85, 531.4, 0, 1, 1], [Turret, 92.75, 166.75, 0, 1, 1], [Turret, 121.45, 201.1, 0, 1, 1], [Turret, 149.95, 235.8, 0, 1, 1], [Turret, 178.55, 271.45, 0, 1, 1], [Turret, 208.6, 904.5, 0, 1, 1], [Platform, 684.5, 404.5, 0, 15, 1], [Platform, 152.65, 142.85, 0, 15, 1], [Platform, 151.6, 364.25, 0, 15, 1]);
levelCode[22] = new Array([Platform, 452.5, 987, 0, 90, 1], [Wall, 7.5, 600, 0, 1, 75], [Platform, 453.5, 215.5, 0, 90, 1], [Wall, 1439, 582.5, 0, 1, 100], [Platform, 124.75, 413.8, 0, 20, 1], [Platform, 1159.5, 215, 0, 50, 1], [Hero, 112.35, 372.25, 0, 1, 1], [End, 120.1, 483.3, 0, 1, 1], [Platform, 357.85, 518, 0, 25, 1], [Platform, 1234, 986, 0, 20, 1], [Wall, 214, 474, 0, 1, 10], [ChariotSimple, 306, 472, 0, 1, 1], [Platform, 736, 603, 0, 50, 1], [Platform, 622, 330, -20, 30, 1], [BreakableWall, 464, 300, 0, 1, 1], [RollingBarrel, 541, 329.25, 0, 2, 2], [RollingBarrelExp, 507.5, 299.75, 0, 2, 2], [RollingBarrel, 496, 344.75, 0, 2, 2], [RollingBarrel, 581, 313, 0, 2, 2], [Wall, 468, 566, 0, 1, 8], [Wall, 1008, 482, 0, 1, 25], [ChariotSimple, 592, 557, 0, 1, 1], [BreakableWall, 1006, 288, 0, 1, 0.8], [Stone, 56, 390, 0, 2.5, 2.5], [Platform, 1130, 474, 0, 20, 1], [Piston, 1172, 228, 0, 1, 1], [Piston, 1100, 492, 0, 1, 1], [Platform, 1222, 742, 0, 40, 1], [StoneTalisman, 1348, 354, 0, 1, 1], [ClayTalisman, 352, 258, 0, 1, 1], [ClayTalisman, 420, 260, 0, 1, 1], [PGuard, 760, 682, 0, 1, 1], [PGuard, 590, 764, 0, 1, 1], [PGuard, 354, 682, 0, 1, 1], [PGuard, 142, 754, 0, 1, 1], [StoneTalisman, 362, 580, 0, 1, 1], [BG4E3, 228, 720, 0, 1, 1], [BG4E4, 1224, 250, 0, 1, 1], [BG4E3, 698, 332, 0, 1, 1], [Pit, 1019, 1019, 0, 1.55, 1], [Pit, 1380, 1018, 0, 0.6, 1], [Wall, 1172, 220, 0, 1, 1], [Wall, 1099, 485, 0, 1, 1]);
levelCode[23] = new Array([Wall, 7.5, 720.5, 0, 1, 100], [Platform, 476, 220.1, 0, 90, 1], [Wall, 946.5, 820, 0, 1, 80], [Platform, 416, 490.8, 0, 29, 1], [Platform, 150.1, 1100, 0, 25, 1], [Hero, 1520.2, 380.35, 0, 1, 1], [End, 583.6, 803.05, 0, 1, 1], [Platform, 352, 1228, 0, 70, 1], [Platform, 433.5, 753, 0, 50, 1], [ChariotSimple, 557, 587.5, 0, 1, 1], [Stone, 895.25, 1177.5, 0, 2.5, 2.5], [Platform, 579.5, 633.5, 0, 20, 1], [Platform, 505, 1100, 0, 25, 1], [ClayTalisman, 896.15, 271.8, 0, 1, 1], [ClayTalisman, 824.15, 264.7, 0, 1, 1], [StoneTalisman, 254.9, 588.1, 0, 1, 1], [Chariot, 163, 1046, 0, 1, 1], [Platform, 805.5, 505, 0, 25, 1], [Platform, 829, 1228, 0, 25, 1], [Chariot, 801.5, 449.5, 0, 1, 1], [ChariotSimple, 316.65, 706.65, 0, 1, 1], [BG4E2, 262, 659, 0, 1, 1], [BG4E4, 73, 239, 0, 1, 1], [BG4E4, 667, 232, 0, 1, 1], [Wall, 908.25, 62.75, 0, 1, 30], [Platform, 1518.25, 422.25, 0, 10, 1], [Wall, 1236, 194.25, 0, 1, 4], [Wall, 1266.75, 194.25, 0, 1, 4], [SwingChain, 1253, 202.5, 0, 1, 5], [PGuard, 1063.5, 264.75, 0, 1, 1], [Wall, 0xFF, 363.5, 0, 1, 27], [Wall, 698.5, 636, 0, 1, 25], [Wall, 647, 935, 0, 1, 35], [Platform, 328, 1100, 0, 10.2, 1], [Pit, 1482, 1260, 0, 7, 1], [BreakableWall, 488, 562.85, 0, 1, 0.9], [Platform, 557.8, 884.9, 0, 15, 1], [BreakableWall, 491, 819.2, 0, 1, 0.8]);
levelCode[24] = new Array([Wall, 7.5, 720.5, 0, 1, 100], [Platform, 476, 220.1, 0, 95, 1], [Wall, 964, 728.2, 0, 1, 100], [Platform, 81.75, 380.8, 0, 10, 1], [Platform, 485.2, 1121.05, 0, 25, 1], [Hero, 474.85, 1185.75, 0, 1, 1], [End, 72.1, 292.8, 0, 1, 1], [Platform, 352, 1228, 0, 70, 1], [Platform, 543.5, 793, 0, 80, 1], [Stone, 895.25, 1177.5, 0, 2.5, 2.5], [Platform, 821.5, 441.55, 0, 25, 1], [StoneTalisman, 538.9, 838.1, 0, 1, 1], [Platform, 821, 646.5, 0, 25, 1], [Chariot, 475, 1068, 0, 1, 1], [Platform, 829, 1228, 0, 25, 1], [Chariot, 722, 739, 0, 1, 1], [AetherTalisman, 110.1, 723.3, 0, 1, 1], [PUmbra, 325, 947.5, 0, 1, 1], [PUmbra, 182.5, 1017.5, 0, 1, 1], [PUmbra, 685, 970, 0, 1, 1], [PUmbra, 802.5, 1027.5, 0, 1, 1], [PUmbra, 497.5, 915, 0, 1, 1], [ClayTalisman, 862.5, 482.5, 0, 1, 1], [ClayTalisman, 807.5, 550, 0, 1, 1], [ClayTalisman, 892.5, 547.5, 0, 1, 1], [SwingChain, 512.5, 240, 0, 1, 10], [Chariot, 739, 592, 0, 1, 1], [SwingChain, 292.5, 240, 0, 1, 10], [BG4E2, 163, 241, 0, 1, 1], [BG4E3, 106, 877, 0, 1, 1], [BG4E3, 629, 882, 0, 1, 1]);
levelCode[25] = new Array([Wall, 6.05, 664.35, 0, 1, 100], [Platform, 474.55, 164.15, 0, 90, 1], [Wall, 952, 566.2, 0, 1, 80], [Platform, 101.75, 430.85, 0, 15, 1], [Platform, 101.2, 901.05, 0, 15, 1], [Hero, 123.05, 388.8, 0, 1, 1], [End, 1024.1, 696.8, 0, 1, 1], [Platform, 883, 589.5, 0, 10, 1], [AetherTalisman, 110.1, 723.3, 0, 1, 1], [PUmbra, 576.5, 313.5, 0, 1, 1], [PUmbra, 261.5, 683, 0, 1, 1], [SwingChain, 480.5, 633.5, 0, 1, 5], [SwingChain, 306.7, 171.1, 0, 1, 7], [BreakingPlatform, 470, 398, 0, 0.5, 1], [BreakingPlatform, 664, 478, 0, 0.5, 1], [BreakingPlatform, 666, 750, 0, 0.5, 1], [BreakingPlatform, 324, 804, 0, 0.5, 1], [PGuard, 648, 290, 0, 1, 1], [PGuard, 322, 642, 0, 1, 1], [BreakingPlatform, 318, 1030, 0, 0.5, 1], [BreakingPlatform, 556, 1156, 0, 0.5, 1], [HangChain, 836, 1156, 0, 15, 3], [Platform, 1566, 1178, 0, 60, 1], [BarrelExp, 1808, 1149, 0, 2.5, 2.5], [BarrelExp, 1761, 1150, 0, 2.5, 2.5], [Platform, 1526, 1020, 0, 20, 1], [Chariot, 1512, 966, 0, 1, 1], [Platform, 1048, 732, 0, 15, 1], [RubyTalisman, 1084, 858, 0, 1, 1], [BG4E3, 664, 233, 0, 1, 1], [BG4E3, 197, 416, 0, 1, 1], [BG4E4, 704, 630, 0, 1, 1], [BG4E1, 84.25, 1108.5, 0, 1, 1], [BG4E2, 1276, 454, 0, 1, 1], [Pit, 1110, 1327, 0, 15, 1], [Pit, 2608, 1326, 0, 5, 1]);
levelCode[26] = new Array([Wall, 7.5, 720.5, 0, 1, 100], [Platform, 476, 552.6, 0, 90, 1], [Wall, 916.5, 970.7, 0, 1, 50], [Platform, 1574.25, 733.3, 0, 25, 1], [Platform, 192.7, 1126.05, 0, 25, 1], [Hero, 94.85, 1175.95, 0, 1, 1], [End, 1489.6, 677.8, 0, 1, 1], [Platform, 352, 1228, 0, 70, 1], [Platform, 378.5, 928, 0, 70, 1], [Stone, 672.75, 1195, 0, 2.5, 2.5], [Platform, 797.5, 786.5, 0, 20, 1], [Platform, 662.5, 1093.55, 0, 25, 1], [ClayTalisman, 1335.85, 618.55, 0, 1, 1], [ClayTalisman, 1377.35, 598.1, 0, 1, 1], [StoneTalisman, 461.4, 733.1, 0, 1, 1], [Platform, 1059.5, 726, 0, 25, 1], [Platform, 1620, 1170, 0, 20, 1], [Platform, 829, 1228, 0, 25, 1], [Chariot, 207, 1072.5, 0, 1, 1], [ChariotSimple, 167.2, 881.5, 0, 1, 1], [AetherTalisman, 1120.1, 798.3, 0, 1, 1], [BreakableWall, 816.5, 929.5, 90, 1, 1.1], [BarrelExp, 834.5, 759, 0, 2.5, 2.5], [BreakableWall, 915, 640, 0, 1, 1.1], [Wall, 1430.5, 238, 0, 1, 100], [RubyTalisman, 1037.5, 802.5, 0, 1, 1], [Stone, 1010, 703, 0, 2.5, 2.5], [Stone, 1070.5, 702, 0, 2.5, 2.5], [Stone, 1150, 702.5, 0, 2.5, 2.5], [Wall, 905, 294, 0, 1, 50], [PUmbra, 1661.5, 880, 0, 1, 1], [PUmbra, 1585.5, 974, 0, 1, 1], [PUmbra, 1825, 822.5, 0, 1, 1], [PUmbra, 1865.5, 897.5, 0, 1, 1], [Platform, 1020, 980, 0, 15, 1], [BG4E4, 224, 495, 0, 1, 1], [BG4E3, 1053, 391, 0, 1, 1], [BG4E2, 1096, 688, 0, 1, 1], [Pit, 1301.25, 1261.25, 0, 5, 1], [PUmbra, 1200, 534, 0, 1, 1], [PUmbra, 1084, 536, 0, 1, 1], [PGuard, 1162, 470, 0, 1, 1], [PGuard, 1326, 552, 0, 1, 1], [PGuard, 1673, 976, 0, 1, 1], [PGuard, 1576, 871, 0, 1, 1], [PGuard, 1789, 896, 0, 1, 1], [Pit, 2040, 1261, 0, 5, 1], [Platform, 1169, 180, 0, 50, 1]);
levelCode[27] = new Array([Platform, 105, 810, 0, 20, 1], [Wall, -2, 395, 0, 1, 80], [Platform, 686, 338, 0, 36, 1], [Platform, 1092, 697, -20, 25, 1], [Wall, 883, 211, 0, 1, 40], [Platform, 406, 527, 0, 20, 1], [Crate, 448, 484, 0, 2, 2], [Crate, 350, 493, 0, 2, 2], [Crate, 398, 480, 0, 2, 2], [Platform, 266, 232, 0, 50, 1], [Platform, 757, 230, 0, 20, 1], [Platform, 1994, 154, 0, 20, 1], [Platform, 1563, 288, 0, 30, 1], [Platform, 1552, 706, 0, 30, 1], [Wall, 1878, 423, 0, 1, 55], [Platform, 500, 1, 0, 100, 1], [Platform, 1500, 1, 0, 100, 1], [Platform, 2103, 706, 0, 80, 1], [Platform, 2004, 588, 0, 20, 1], [Platform, 2420, 594, 0, 15, 1], [Platform, 2214, 480, 0, 20, 1], [Crate, 2150, 448, 0, 2, 2], [Crate, 2204, 448, 0, 2, 2], [Crate, 2253, 445, 0, 2, 2], [Platform, 2726, 705, 0, 10, 1], [Wall, 2797, 356, 0, 1, 70], [End, 2741, 252, 0, 1, 1], [Hero, 36, 188, 0, 1, 1], [Platform, 572, 698, 0, 10, 1], [ChariotSimple, 769, 182.4, 0, 1, 1], [BarrelExp, 376, 213, 0, 1.5, 1.5], [BarrelExp, 355, 213, 0, 1.5, 1.5], [BarrelExp, 365, 185, 0, 1.5, 1.5], [Chariot, 569, 646, 0, 1, 1], [Barrel, 104, 773, 0, 1.5, 1.5], [Barrel, 128, 773, 0, 1.5, 1.5], [Stone, 167, 767, 0, 3, 3], [ChariotSimple, 362.7, 289.5, 0, 1, 1], [Crate, 1561, 249, 0, 2, 2], [Crate, 1488, 254, 0, 2, 2], [Crate, 1624, 252, 0, 2, 2], [PGuard, 2439, 381, 0, 1, 1], [PUmbra, 2452, 480, 0, 1, 1], [PGuard, 1690, 521, 0, 1, 1], [PGuard, 1751, 413, 0, 1, 1], [PUmbra, 2061, 406, 0, 1, 1], [PGuard, 2029, 325, 0, 1, 1], [Platform, 2507, 1, 0, 120, 1], [ClayTalisman, 58, 368, 0, 1, 1], [ClayTalisman, 74, 284, 0, 1, 1], [ClayTalisman, 110, 350, 0, 1, 1], [Chariot, 570, 757, 0, 1, 1], [Platform, 482, 810, 0, 55, 1], [AetherTalisman, 1476, 386, 0, 1, 1], [PUmbra, 2398, 528, 0, 1, 1], [PUmbra, 1984, 436, 0, 1, 1], [PGuard, 2332, 274, 0, 1, 1], [PGuard, 2118, 282, 0, 1, 1], [PGuard, 2578, 398, 0, 1, 1], [PGuard, 1932, 370, 0, 1, 1], [StoneTalisman, 2198.4, 521.65, 0, 1, 1], [ClayTalisman, 2131.7, 518.35, 0, 1, 1], [ClayTalisman, 2273.4, 521.65, 0, 1, 1], [BG4E1, 32, 591, 0, 1, 1], [BG4E1, 262, 591, 0, 1, 1], [BG4E2, 1501, 383, 0, 1, 1], [BG4E3, 2125, 282, 0, 1, 1], [BG4E4, 2489, 258, 0, 1, 1], [Pit, 1131.75, 842, 0, 5, 1], [BG4E3, 97, 52, 0, 1, 1], [BG4E3, 685, 60, 0, 1, 1], [BG4E3, 315, 379, 0, 1, 1], [BG4E3, 2128, 506, 0, 1, 1], [BG4E1, 1459, 86, 0, 1, 1], [BG4E1, 388, 37, 0, 1, 1], [Platform, 378.7, 338, 0, 25, 1], [Pit, 2224, 842, 0, 10, 1], [Pit, 3308, 842, 0, 5, 1]);
levelCode[28] = new Array([Wall, 5, 416.5, 0, 1, 80], [Platform, 487.5, 4.25, 0, 100, 1], [Wall, 1402.5, 265.75, 0, 1, 25], [End, 65, 103.5, 0, 1, 1], [Platform, 1487.7, 4.15, 0, 100, 1], [Platform, 64, 175, 0, 15, 1], [Platform, 212, 287, 0, 20, 1], [BreakingPlatform, 390, 287, 0, 1, 1], [Wall, 124, 237, 0, 1, 11], [BreakingPlatform, 543, 287, 0, 1, 1], [BreakingPlatform, 695, 287, 0, 1, 1], [BreakingPlatform, 1308, 287, 0, 1, 1], [SwingChain, 996, 74, 0, 1, 6], [Wall, 983.5, 670, 0, 1, 20], [Crate, 1039, 749.5, 0, 2, 2], [BreakingPlatform, 980.5, 779, 0, 1.1, 1], [Wall, 1192, 647.5, 0, 1, 12], [Wall, 1344, 650, 0, 1, 12], [Crate, 593.5, 692, 0, 2, 2], [Crate, 642, 745.5, 0, 1.5, 2], [Hero, 243, 238, 0, 1, 1], [Pit, 738.5, 846, 0, 10, 1], [Pit, 1717.75, 844.55, 0, 3.9, 1], [Platform, 474, 781, 0, 10, 1], [Crate, 594.5, 744, 0, 2, 2], [Crate, 636.5, 692, 0, 1.5, 1.5], [Crate, 436, 754, 0, 1.5, 1.5], [Crate, 1039.5, 698.5, 0, 2, 2], [BreakingPlatform, 312, 543, 0, 1, 1], [Crate, 267, 500.5, 0, 2, 2], [Crate, 313.5, 505, 0, 1.5, 1.5], [Wall, 2000.1, 406.15, 0, 1, 80], [Turret, 1693.8, 518.15, 0, 1, 1], [Wall, 1570, 591.35, 0, 1, 10], [Wall, 1841.85, 455.2, 0, 1, 20], [Wall, 1569.45, 422, 0, 1, 10], [BreakingPlatform, 0x0600, 792, 0, 1, 1], [BreakingPlatform, 1905.35, 787.3, 0, 1, 1], [BreakingPlatform, 1660.05, 637.25, 0, 1, 1], [Platform, 1879.5, 336.55, 0, 10, 1], [BreakingPlatform, 1663.95, 372.75, 0, 1, 1], [Crate, 1648.3, 309.9, 0, 2.5, 2.5], [Crate, 1640.45, 257.1, 0, 2, 1.5], [AetherTalisman, 1638.5, 191.05, 0, 1, 1], [RubyTalisman, 1946.85, 655.95, 0, 1, 1], [BreakableWall, 129, 90, 0, 1, 1.1], [Wall, 1403, 46, 0, 1, 5], [Platform, 1870.2, 156.5, 0, 20, 1], [Crate, 1618.8, 590.4, 0, 2, 2], [Crate, 1947.05, 750.8, 0, 2.5, 2.5], [Crate, 1948.45, 698.45, 0, 2, 2], [Turret, 1913.45, 94.05, 0, 1, 1], [Crate, 0x0600, 755.5, 0, 2, 2], [Crate, 1536.5, 709.5, 0, 1.5, 1.5], [BreakingPlatform, 1266.5, 731.5, 0, 0.8, 1], [Stone, 1445, 116, 0, 2.5, 2.5], [BreakableWall, 1397, 102, 0, 1, 0.4], [Platform, 1443, 140, 0, 5, 1], [Stone, 1446, 83, 0, 2.5, 2.5], [BreakingPlatform, 607, 781, 0, 1, 1]);
levelCode[29] = new Array([Platform, 1077, 789, 0, 60, 1], [Platform, 512.65, 6.6, 0, 100, 1], [Wall, -6.3, 487.7, 0, 1, 100], [Platform, 962.85, 663.45, 0, 20, 1], [Platform, 211, 542, 0, 40, 1], [End, 655.15, 367.25, 0, 1, 1], [Platform, 421, 287, 0, 40, 1], [BarrelExp, 1135.6, 760.4, 0, 2, 2], [BarrelExp, 1182.75, 761.7, 0, 2, 2], [Platform, 920, 428, 0, 60, 1], [Platform, 1015.15, 287, 0, 78.2, 1], [Crate, 329.8, 511.3, 0, 2, 2], [Crate, 381.65, 510.7, 0, 2, 2], [Wall, 1393.75, 595, 0, 1, 60], [Wall, 1042.3, 727, 0, 1, 11.3], [Platform, 1185, 539, 0, 20, 1], [Wall, 603.15, 363, 0, 1, 14], [Platform, 1190, 5.05, 0, 35, 1], [Hero, 2329.5, 258.2, 0, 1, 1], [Gladiator, 960.1, 617.75, 0, 1, 1], [Gladiator, 1145.05, 492.2, 0, 1, 1], [Platform, 479.85, 789, 0, 30, 1], [Platform, 153.35, 525, 0, 25, 1], [Gladiator, 1060.2, 233.2, 0, 1, 1], [Platform, 795.15, 413.9, 0, 20, 1], [ClayTalisman, 1308.3, 144.15, 0, 1, 1], [ClayTalisman, 1202.3, 144.65, 0, 1, 1], [ClayTalisman, 1259, 89.05, 0, 1, 1], [Platform, 2339.75, 306.85, 0, 15, 1], [BreakableWall, 1071.65, 546.9, 0, 1, 1.5], [ChariotSimple, 480.15, 736.9, 0, 1, 1], [ChariotSimple, 445.35, 238.7, 0, 1, 1], [ChariotSimple, 136.65, 477.7, 0, 1, 1], [BreakingPlatform, 2091.55, 336.7, 0, 0.5, 1], [SwingChain, 1879.95, 63.55, 0, 1, 8], [SwingChain, 1687.8, 61.95, 0, 1, 8], [BreakingPlatform, 1528.5, 376.5, 0, 0.5, 1], [Triarii, 806, 356.2, 0, 1, 1], [StoneTalisman, 540, 334, 0, 1, 1], [Pit, 2294.3, 824.9, 0, 9, 1], [BG5E2, 2286, 309, 0, 1, 1], [BG5E3, 988, 98, 0, 1, 1], [BG5E3, 545, 96, 0, 1, 1], [BG5E1, 216, 297, 0, 1, 1], [BG5E2, 628, 429, 0, 1, 1], [BG5E2, 935, 429, 0, 1, 1], [BG5E1, 1086, 554, 0, 1, 1], [Pit, 706.8, 825.75, 0, 1, 1], [Platform, 1869, 3, 0, 100, 1], [Platform, 2621, 2, 0, 50, 1], [Pit, 154, 825.75, 0, 2.5, 1], [Pit, 1544.3, 824.3, 0, 2, 1]);
levelCode[30] = new Array([Platform, 675, 789, 0, 100, 1], [Platform, 512.65, 6.6, 0, 100, 1], [Wall, -6.3, 487.7, 0, 1, 100], [Platform, 922.45, 653.4, 0, 10, 1], [Crate, 1018.15, 679.3, 0, 2, 2], [Crate, 1018.65, 720.7, 0, 2, 2], [Crate, 1020, 761.3, 0, 3, 2], [Platform, 211, 538, 0, 40, 1], [Wall, 624, 477.15, 0, 1, 61], [End, 697.15, 744.65, 0, 1, 1], [Platform, 210.4, 287.35, 0, 40, 1], [BarrelExp, 1073.15, 762.35, 0, 2, 2], [BarrelExp, 892.3, 682.25, 0, 2, 2], [Platform, 1050, 428, 0, 20, 1], [Platform, 1148.25, 314.75, 0, 40, 1], [Crate, 895.8, 762.65, 0, 2, 2], [Crate, 895.65, 721.3, 0, 2, 2], [Wall, 1367, 338, 0, 1, 65], [Platform, 1205, 553, 0, 13, 1], [Platform, 1190, 5.05, 0, 35, 1], [Hero, 608.05, 1209.1, 0, 1, 1], [Triarii, 1061.85, 373.45, 0, 1, 1], [Platform, 548.05, 773.05, 0, 10, 1], [Triarii, 539.15, 718.5, 0, 1, 1], [Platform, 263.8, 525, 0, 15, 1], [Gladiator, 252.1, 476.6, 0, 1, 1], [Platform, 641.1, 164.4, 0, 35, 1], [ChariotSimple, 1037.3, 267.55, 0, 1, 1], [Stone, 956, 766, 0, 2.5, 2.5], [Stone, 956, 732, 0, 2.5, 2.5], [Stone, 956, 696, 0, 2.5, 2.5], [ClayTalisman, 913.45, 470, 0, 1, 1], [ClayTalisman, 978.35, 473.35, 0, 1, 1], [ClayTalisman, 1036.65, 468.3, 0, 1, 1], [ClayTalisman, 583.15, 56.8, 0, 1, 1], [ClayTalisman, 670.05, 55.05, 0, 1, 1], [BreakableWall, 860, 547.3, 0, 1, 1.5], [Platform, 664, 1252, 0, 15, 1], [BreakingPlatform, 222, 1018, 0, 0.5, 1], [Chariot, 914.35, 601.1, 0, 1, 1], [Platform, 48, 908, 0, 7, 1], [BreakingPlatform, 424, 1150, 0, 0.5, 1], [Stone, 667, 764, 0, 2.5, 2.5], [Stone, 700, 765, 0, 2.5, 2.5], [Stone, 734, 764, 0, 2.5, 2.5], [Stone, 700, 728, 0, 2.5, 2.5], [Stone, 667, 728, 0, 2.5, 2.5], [Stone, 734, 730, 0, 2.5, 2.5], [Stone, 667, 690, 0, 2.5, 2.5], [Stone, 700, 692, 0, 2.5, 2.5], [Stone, 734, 692, 0, 2.5, 2.5], [SwingChain, 1388, 750, 0, 1, 7], [SwingChain, 1140, 1070, 0, 1, 7], [BreakingPlatform, 930, 1228, 0, 0.5, 1], [BreakingPlatform, 1386, 1205.5, 0, 0.5, 1], [BreakingPlatform, 1575, 1072.5, 0, 0.5, 1], [Stone, 362.5, 512.5, 0, 2.5, 2.5], [Stone, 400, 515, 0, 2.5, 2.5], [ReflectiveWall, 32.5, 497.5, 0, 1, 1], [ReflectiveWall, 1196.65, 511.65, 0, 1, 1], [ChariotSimple, 251.35, 241.7, 0, 1, 1], [StoneTalisman, 563.25, 203.4, 0, 1, 1], [Pit, 437.5, 1284, 0, 2, 1], [Pit, 1412, 1284, 0, 5, 1], [BG5E2, 178, 789, 0, 1, 1], [BG5E2, 437, 790, 0, 1, 1], [BG5E2, 723, 790, 0, 1, 1], [BG5E2, 1027, 790, 0, 1, 1], [BG5E4, 0xFF, 579, 0, 1, 1], [BG5E1, 107.7, 298.55, 0, 1, 1], [BG5E2, 489, 170.85, 0, 1, 1], [BG5E2, 693, 171.95, 0, 1, 1], [BG5E1, 649, 498, 0, 1, 1], [BG5E2, 1157, 554, 0, 1, 1], [BG5E3, 1020.85, 105.05, 0, 1, 1], [Platform, 795, 428, 0, 30.5, 1], [Pit, 1848, 1283, 0, 5, 1], [Pit, 148, 1284, 0, 2, 1], [Pit, 893, 1284, 0, 2.1, 1]);
levelCode[31] = new Array([Wall, 0, 500, 0, 1, 100], [Wall, 1000, 500, 0, 1, 100], [Platform, 500, 1, 0, 100, 1], [Platform, 500, 1000, 0, 100, 1], [Hero, 186.4, 133.85, 0, 0.7, 1], [End, 929, 112.2, 0, 1, 1], [Platform, 215, 177, 0, 40, 1], [Wall, 574, 197.25, 0, 1, 39], [Platform, 222, 258, 0, 20, 1], [Platform, 167, 526, 0, 30, 1], [Platform, 581, 399.6, 0, 20, 1], [Platform, 0x0101, 673, 0, 10, 1], [Platform, 213, 835, 0, 12, 1], [Wall, 169, 918, 0, 1, 15], [Wall, 570.7, 756.15, 0, 1, 47], [Crate, 209, 972, 0, 2, 2], [Crate, 254, 971, 0, 2, 2], [Platform, 929.35, 946.2, 0, 10, 1], [Wall, 883, 885, 0, 1, 10], [Platform, 738.35, 719.3, 0, 10, 1], [Wall, 777, 779, 0, 1, 10], [Wall, 670, 669, 0, 1, 10], [Platform, 636.1, 611, 0, 9, 1], [Crate, 656, 969, 0, 2, 2], [Crate, 703, 969, 0, 2, 2], [Crate, 752, 969, 0, 2, 2], [Crate, 611, 970, 0, 2, 2], [Crate, 654, 920, 0, 2, 2], [Crate, 700, 922, 0, 2, 2], [Crate, 748, 922, 0, 2, 2], [Crate, 530.25, 971.85, 0, 2, 2], [Crate, 487.2, 972.2, 0, 2, 2], [Stone, 967, 971, 0, 2, 2], [Stone, 928, 973, 0, 2, 2], [Stone, 888, 976, 0, 2, 2], [Stone, 852, 977, 0, 2, 2], [Platform, 891, 412, 0, 20, 1], [Platform, 570.7, 514.1, 0, 5, 1], [Platform, 620, 290.15, 0, 5, 1], [Platform, 837, 156, 0, 30, 1], [AetherTalisman, 53, 484, 0, 1, 1], [ChariotSimple, 250, 479.1, 0, 1, 1], [Chariot, 758.8, 100.2, 0, 1, 1], [Gladiator, 215, 782.5, 0, 1, 1], [Gladiator, 609, 247.5, 0, 1, 1], [RubyTalisman, 525, 47.5, 0, 1, 1], [StoneTalisman, 942.5, 475, 0, 1, 1], [ChariotSimple, 724, 673.35, 0, 1, 1]);
levelCode[32] = new Array([Hero, 39, 1233, 0, 1, 1], [Platform, 506.85, 1275.3, 0, 100, 1], [Platform, 510, 0, 0, 100, 1], [Wall, -9.55, 508.9, 0, 1, 100], [End, 283, 1238, 0, 1, 1], [Wall, 189.15, 1163, 0, 1, 21], [Platform, 324, 1050, 0, 30, 1], [Wall, 481, 846, 0, 1, 40], [Crate, 95, 1249, 0, 2, 2], [Crate, 139, 1254, 0, 1.5, 1.5], [Crate, 851, 722, 0, 2, 2], [Crate, 949, 727, 0, 1.5, 1.5], [Platform, 159.5, 912.1, 0, 30, 1], [Platform, 412.05, 783.5, 0, 10, 1], [Platform, 627, 640, 0, 32, 1], [Wall, 640, 702, 0, 1, 11], [Wall, 641, 1064.3, 0, 1, 40.6], [Wall, 0x0303, 922, 0, 1, 55], [Platform, 641, 855, 0, 10, 1], [Wall, 1274, 0x0300, 0, 1, 100], [Platform, 160, 531, 0, 30, 1], [Platform, 965.95, 1219, 0, 35, 1], [Platform, 1042, 1116.4, 0, 20, 1], [Platform, 888.6, 986, 0, 20, 1], [Wall, 1163.8, 808, 0, 1, 81], [Platform, 265, 393, 0, 30, 1], [Platform, 1026, 395, 0, 30, 1], [Wall, 1274, 136, 0, 1, 26], [Platform, 887.5, 749, 0, 20, 1], [Platform, 1050.55, 883.35, 0, 10, 1], [Crate, 805, 726, 0, 1.5, 1.5], [AetherTalisman, 1102, 1146, 0, 1, 1], [Crate, 43.25, 503.35, 0, 1.5, 1.5], [Crate, 442.4, 756.75, 0, 1.5, 1.5], [Crate, 244, 365, 0, 1.5, 1.5], [Wall, 409, 309, 0, 1, 15.5], [Platform, 555, 223, 0, 32, 1], [Wall, 700, 304, 0, 1, 15], [Chariot, 618.3, 587.3, 0, 1, 1], [Chariot, 863.65, 933.35, 0, 1, 1], [Platform, 1150.2, 1275.15, 0, 28, 1], [Gladiator, 174.35, 866.35, 0, 1, 1], [Chariot, 1055, 341.7, 0, 1, 1], [StoneTalisman, 371.65, 521.65, 0, 1, 1], [StoneTalisman, 913.35, 455, 0, 1, 1], [Wall, -9.8, 1164.9, 0, 1, 30], [Crate, 901, 718, 0, 2.5, 2.5], [Platform, 1143, -1, 0, 25, 1], [Platform, 965.95, 1203, 0, 35, 1], [Chariot, 555, 170, 0, 1, 1]);
levelCode[33] = new Array([Platform, 501, 10, 0, 100, 1], [Wall, 15, 0x0202, 0, 1, 100], [Wall, 15, 1514, 0, 1, 100], [Platform, 499, 2019, 0, 100, 1], [Platform, 1502, 2019, 0, 100, 1], [Wall, 1988, 1514, 0, 1, 100], [Wall, 1987, 517, 0, 1, 100], [Platform, 1503, 10, 0, 100, 1], [Platform, 533, 221, 0, 100, 1], [Platform, 1409, 221, 0, 75, 1], [Hero, 755, 146, 0, 1, 1], [Wall, 1768, 676, 0, 1, 90], [Wall, 1768, 1580, 0, 1, 50], [Platform, 1284, 1826, 0, 100, 1], [Platform, 508, 1826, 0, 55, 1], [Wall, 248, 1529, 0, 1, 60], [Wall, 250, 718, 0, 1, 60], [Platform, 734, 421, 0, 100, 1], [Platform, 1383, 421, 0, 30, 1], [Wall, 1518, 925, 0, 1, 100], [Platform, 1032, 1622, 0, 100, 1], [Wall, 546, 1126, 0, 1, 100], [Platform, 907, 620, 0, 75, 1], [Wall, 1266, 1026, 0, 1, 80], [Platform, 1030, 1433, 0, 50, 1], [Wall, 795, 1138, 0, 1, 60], [Platform, 906, 833, 0, 25, 1], [Wall, 1014, 944, 0, 1, 23], [BreakableWall, 906, 1048, 90, 1, 1.3], [End, 904, 889, 0, 1, 1], [Crate, 834, 1016, 0, 2, 2], [Crate, 878, 1014, 0, 2, 2], [Crate, 932, 1015, 0, 2, 2], [Crate, 834, 971, 0, 2, 2], [BreakableWall, 1879, 730, 90, 1, 1.3], [Turret, 1891, 63, 180, 1, 1], [BreakableWall, 1772, 1228, 0, 1, 1.35], [Turret, 138, 1881, 0, 1, 1], [BreakableWall, 244, 1124, 0, 1, 1.4], [Turret, 1615, 314, 180, 1, 1], [BreakableWall, 1642, 726, 90, 1, 1.5], [BreakableWall, 1642, 1340, 90, 1, 1.5], [Turret, 476, 1721, 0, 1, 1], [Turret, 1391, 509, 180, 1, 1], [BreakableWall, 399, 967, 90, 1, 1.8], [Wall, 1518, 1525, 0, 1, 20], [Wall, 1046, 1725, 0, 1, 20], [Stone, 54, 198, 0, 2.5, 2.5], [Stone, 91, 200, 0, 2.5, 2.5], [Crate, 62, 154, 0, 2.5, 2.5], [RubyTalisman, 65, 66, 0, 1, 1], [Crate, 603, 150, 0, 2, 2], [Crate, 602, 192, 0, 2, 2], [Crate, 916, 149, 0, 2, 2], [Crate, 916, 191, 0, 2, 2], [Crate, 1259, 150, 0, 2, 2], [Crate, 1258, 194, 0, 2, 2], [Platform, 54, 1713, 0, 5, 1], [BreakableWall, 134, 886, 90, 1, 1.35], [Crate, 110, 808, 0, 1.5, 2], [Crate, 111, 854, 0, 2, 2], [Crate, 213, 801, 0, 2, 1.5], [Crate, 207, 849, 0, 2.5, 2.5], [Crate, 1713, 678, 0, 2, 2], [Crate, 1563, 682, 0, 2, 2], [Crate, 1563, 638, 0, 2.5, 2], [Crate, 471, 1944, 0, 2, 2], [Crate, 471, 1987, 0, 2, 2], [Crate, 517, 1988, 0, 2, 2], [Crate, 927, 1943, 0, 2, 2], [Crate, 864, 1986, 0, 2, 2], [Crate, 920, 1986, 0, 2.5, 2], [Platform, 56, 1152, 0, 5, 1], [Platform, 509, 1412, 0, 10, 1], [Platform, 287, 1414, 0, 10, 1], [Stone, 834, 1719, 0, 2.5, 2], [Crate, 837, 1756, 0, 2, 2], [Crate, 837, 1797, 0, 2, 2], [Crate, 1002, 1790, 0, 2.5, 2.5], [RubyTalisman, 998, 1715, 0, 1, 1], [Crate, 1169, 1753, 0, 2, 2], [Crate, 1170, 1798, 0, 2, 2], [RubyTalisman, 1103, 1767, 0, 1, 1], [Turret, 1199, 1376, 180, 1, 1], [Stone, 1119, 1409, 0, 2.5, 2.5], [BarrelExp, 879, 969, 0, 2, 2], [Crate, 803.45, 553.05, 0, 2, 2], [Crate, 804, 593, 0, 2, 2], [BarrelExp, 801, 515, 0, 2, 2], [BreakingPlatform, 1334, 867, 0, 0.7, 1], [BreakingPlatform, 1445, 1209, 0, 0.75, 1], [BreakingPlatform, 1445, 866, 0, 0.75, 1], [BreakingPlatform, 1333, 1209, 0, 0.75, 1], [Stone, 1120, 1377, 0, 2.5, 2.5], [Stone, 1150, 1343, 0, 2.5, 2.5], [Stone, 1153, 1409, 0, 2.5, 2.5], [Stone, 157, 855, 0, 2.5, 2.5], [Crate, 157, 807, 0, 2, 2], [BreakingPlatform, 1861, 383, 0, 1, 1], [BreakingPlatform, 1900, 1698, 0, 1, 1], [Stone, 59, 851, 0, 2.5, 2.5], [Crate, 61, 803, 0, 2.5, 2.5], [Platform, 754, 1289, 0, 5, 1], [BreakingPlatform, 175, 1415, 0, 0.8, 1], [Platform, 1833, 1335, 0, 10, 1], [BreakingPlatform, 1930, 1335, 0, 0.6, 1], [Stone, 1044, 562, 0, 2.5, 2.5], [Stone, 1043, 597, 0, 2.5, 2.5], [Stone, 1153, 1377, 0, 2.5, 2.5], [Aether, 962, 68, 0, 1, 1], [Aether, 954, 331, 0, 1, 1], [Aether, 950.85, 504.85, 0, 1, 1], [Aether, 945.1, 716.1, 0, 1, 1], [Aether, 963.05, 1206.7, 0, 1, 1], [Aether, 961.45, 1518.5, 0, 1, 1], [Aether, 951.6, 1714.25, 0, 1, 1], [Aether, 958.05, 1871.45, 0, 1, 1], [Aether, 64.3, 1111.5, 0, 1, 1], [Aether, 1934.5, 1069.85, 0, 1, 1], [Aether, 408.3, 1111, 0, 1, 1], [Aether, 1642.75, 1069.45, 0, 1, 1], [Aether, 664.6, 1108.55, 0, 1, 1], [Aether, 1391.65, 1070.85, 0, 1, 1]);
levelCode[34] = new Array([Phobos, 243, 896, 0, 0.5, 1], [Deimos, 943, 896, 0, 0.5, 1], [Platform, 510, 7, 0, 100, 1], [Platform, 356.4, 1000, 0, 70, 1], [Platform, 1055.75, 1000, 0, 70, 1], [Wall, 1393.05, 503.55, 0, 1, 100], [Platform, 1191.9, 8.35, 0, 35, 1], [Hero, 693.7, 911.4, 0, 1, 1], [End, 1500.35, 102, 0, 1, 1], [Wall, 2, 503, 0, 1, 100], [SwingChain, 597, 725, 0, 1, 8], [SwingChain, 795, 725, 0, 1, 8], [StoneTalisman, 682, 361, 0, 1, 1], [ClayTalisman, 482, 444, 0, 1, 1], [ClayTalisman, 894, 447, 0, 1, 1], [ClayTalisman, 331, 576, 0, 1, 1], [ClayTalisman, 1058, 592, 0, 1, 1], [HangChain, 594, 680, 0, 10, 1], [HangChain, 907, 680, 0, 15, 1], [HangChain, 180, 680, 0, 15, 1], [SwingChain, 1306, 725, 0, 1, 8], [SwingChain, 82, 725, 0, 1, 8]);
levelCode[35] = new Array([Mars, 343, 796, 0, 0.5, 1], [Wall, -3, 502, 0, 1, 100], [Platform, 510, 7, 0, 100, 1], [Platform, 317.4, 996.7, 0, 60, 1], [Platform, 1069.75, 997.05, 0, 60, 1], [Wall, 1393.05, 503.55, 0, 1, 100], [Platform, 1191.9, 8.35, 0, 35, 1], [Platform, 693.6, 996.6, 0, 15, 1], [Hero, 691.7, 474.4, 0, 1, 1], [End, 1678.35, 95, 0, 1, 1], [SwingChain, 123, 602.5, 0, 1, 15], [SwingChain, 239, 451.5, 0, 1, 15], [SwingChain, 1261.5, 602.5, 0, 1, 15], [SwingChain, 1155.5, 451.5, 0, 1, 15], [HangChain, 262.5, 485, 0, 16, 0.5], [HangChain, 842, 484, 0, 16, 0.5], [HangChain, 610, 528, 0, 10, 0.5], [Aether, 89, 405, 0, 1, 1], [Aether, 157, 352, 0, 1, 1], [Aether, 231, 329, 0, 1, 1], [Aether, 328, 305, 0, 1, 1], [Aether, 413, 392, 0, 1, 1], [Aether, 545, 334, 0, 1, 1], [Aether, 691, 387, 0, 1, 1], [Aether, 819, 315, 0, 1, 1], [Aether, 965, 376, 0, 1, 1], [Aether, 1183, 318, 0, 1, 1], [Aether, 1094, 300, 0, 1, 1], [Aether, 1260, 339, 0, 1, 1], [Aether, 1320, 394, 0, 1, 1]);
}
}//package
Section 304
//Grenade (Grenade)
package {
import flash.display.*;
public dynamic class Grenade extends MovieClip {
}
}//package
Section 305
//GrenadeObject (GrenadeObject)
package {
public class GrenadeObject extends GameObject {
override public function update(){
super.update();
if (graphic.parent != null){
if (!(graphic.parent as Container).Tempus){
this.health--;
};
};
}
}
}//package
Section 306
//Gun1Sound (Gun1Sound)
package {
public dynamic class Gun1Sound extends CustomSound {
}
}//package
Section 307
//Gun2Sound (Gun2Sound)
package {
public dynamic class Gun2Sound extends CustomSound {
}
}//package
Section 308
//HangChain (HangChain)
package {
import flash.display.*;
public dynamic class HangChain extends MovieClip {
}
}//package
Section 309
//HealthBar (HealthBar)
package {
import flash.display.*;
public dynamic class HealthBar extends MovieClip {
public var hl:MovieClip;
}
}//package
Section 310
//Hero (Hero)
package {
import flash.display.*;
public dynamic class Hero extends MovieClip {
public var hurt:MovieClip;
public var jump:MovieClip;
public var death:MovieClip;
public var run:MovieClip;
public var hang:MovieClip;
public var still:MovieClip;
public var duck:MovieClip;
public function Hero(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 311
//Hud (Hud)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
public class Hud extends MovieClip {
private var urlPlayLevel:String;// = "http://www.flasharcade.com/browselevels/ace048"
public var healthOrb:MovieClip;
public var tempusOrb:MovieClip;
public var restart:SimpleButton;
private var currTime:Number;
public var LevelNo:TextField;
private var avgCount:int;
public var quit:SimpleButton;
public var leveledit:SimpleButton;
private var fpsCount:int;
private var prevTime:Number;
public var healthRing:MovieClip;
public var playUserLevel:SimpleButton;
public var tempusRing:MovieClip;
private var requestPlayLevel:URLRequest;// = null
public var roller:MovieClip;
public var pause:SimpleButton;
public function Hud(){
urlPlayLevel = "http://www.flasharcade.com/browselevels/ace048";
requestPlayLevel = null;
super();
}
public function init(){
if (requestPlayLevel == null){
requestPlayLevel = new URLRequest(urlPlayLevel);
};
addEventListener(MouseEvent.CLICK, onClick);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
if (GParams.LevelEditor){
switch (MainClass.currentLevel){
case 0:
case 7:
case 12:
case 13:
case 15:
case 16:
case 20:
case 23:
case 24:
case 25:
case 28:
case 29:
case 30:
case 34:
case 35:
leveledit.visible = false;
break;
default:
leveledit.visible = true;
break;
};
} else {
leveledit.visible = false;
};
}
private function onMouseOver(_arg1:MouseEvent){
switch (_arg1.target.name){
case "quit":
case "pause":
case "restart":
case "leveledit":
case "playUserLevel":
Mouse.show();
break;
default:
Mouse.hide();
};
}
private function copyLevel(){
var _local1:int;
var _local2:*;
GParams.levelCode[0].splice(0, GParams.levelCode[0].length);
_local1 = 0;
while (_local1 < GParams.levelCode[MainClass.currentLevel].length) {
_local2 = GParams.levelCode[MainClass.currentLevel][_local1][0];
switch (_local2){
case Platform:
case Wall:
case End:
case ReflectiveWall:
case Hero:
case Crate:
case Stone:
case Barrel:
case BarrelExp:
case Piston:
case BreakableWall:
case BreakingPlatform:
case RollingBarrel:
case RollingBarrelExp:
case Peacekeeper:
case Turret:
case Enforcer:
case Gladiator:
case Triarii:
case PGuard:
case PUmbra:
case Chariot:
case ChariotSimple:
case ClayTalisman:
case StoneTalisman:
case Aether:
case RubyTalisman:
case AetherTalisman:
GParams.levelCode[0].push(GParams.levelCode[MainClass.currentLevel][_local1]);
break;
};
_local1++;
};
}
public function remove(){
removeEventListener(MouseEvent.CLICK, onClick);
removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
}
public function update(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number, _arg5:Number, _arg6:int){
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg2 < 0){
_arg2 = 0;
};
if (_arg6 < 10){
LevelNo.text = ("0" + _arg6.toString());
} else {
LevelNo.text = _arg6.toString();
};
if (_arg5 > (5 * 40)){
if ((((healthRing.currentFrame < 2)) || ((healthRing.currentFrame > 20)))){
healthRing.gotoAndPlay(2);
};
} else {
if (_arg5 > 40){
if ((((healthRing.currentFrame < 22)) || ((healthRing.currentFrame > 23)))){
healthRing.gotoAndPlay(22);
};
} else {
if (_arg5 > 0){
if ((((healthRing.currentFrame < 24)) || ((healthRing.currentFrame > 67)))){
healthRing.gotoAndPlay(24);
};
} else {
if (((!((healthRing.currentFrame == 1))) && ((healthRing.currentFrame < 68)))){
healthRing.gotoAndStop(1);
};
};
};
};
if (_arg4 > (5 * 40)){
if ((((tempusRing.currentFrame < 2)) || ((tempusRing.currentFrame > 20)))){
tempusRing.gotoAndPlay(2);
};
} else {
if (_arg4 > 40){
if ((((tempusRing.currentFrame < 21)) || ((tempusRing.currentFrame > 23)))){
tempusRing.gotoAndPlay(21);
};
} else {
if (_arg4 > 0){
if ((((tempusRing.currentFrame < 24)) || ((tempusRing.currentFrame > 67)))){
tempusRing.gotoAndPlay(24);
};
} else {
if (tempusRing.currentFrame != 1){
tempusRing.gotoAndStop(1);
};
};
};
};
if (_arg1 < healthOrb.currentFrame){
if (_arg1 > 0){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_DAMAGE);
};
if (healthRing.currentFrame < 68){
healthRing.gotoAndPlay(68);
};
};
if (_arg1 == 0){
healthOrb.gotoAndStop(1);
} else {
healthOrb.gotoAndStop(int(_arg1));
};
if (_arg2 == 0){
tempusOrb.gotoAndStop(1);
} else {
tempusOrb.gotoAndStop(int(_arg2));
};
if (_arg3){
if (_arg2 > 0){
if (roller.currentFrame != 3){
roller.gotoAndStop(3);
};
} else {
if (roller.currentFrame != 1){
roller.gotoAndStop(1);
};
};
} else {
if (MainClass.difficulty != 2){
if (_arg2 >= 100){
if (roller.currentFrame != 1){
roller.gotoAndStop(1);
};
} else {
if (roller.currentFrame != 2){
roller.gotoAndStop(2);
};
};
} else {
if (roller.currentFrame != 1){
roller.gotoAndStop(1);
};
};
};
}
private function onClick(_arg1:MouseEvent){
if (this.parent != null){
switch (_arg1.target.name){
case "quit":
(this.parent as MainClass).quitLevel();
break;
case "pause":
(this.parent as MainClass).pauseLevel();
break;
case "restart":
(this.parent as MainClass).restartLevel();
break;
case "leveledit":
copyLevel();
(this.parent as MainClass).editLevel();
break;
case "playUserLevel":
navigateToURL(requestPlayLevel, "_blank");
break;
};
};
}
}
}//package
Section 312
//InGameSound (InGameSound)
package {
public dynamic class InGameSound extends CustomSound {
}
}//package
Section 313
//Ins1 (Ins1)
package {
import flash.display.*;
public dynamic class Ins1 extends MovieClip {
}
}//package
Section 314
//Ins17 (Ins17)
package {
import flash.display.*;
public dynamic class Ins17 extends MovieClip {
}
}//package
Section 315
//Ins2 (Ins2)
package {
import flash.display.*;
public dynamic class Ins2 extends MovieClip {
}
}//package
Section 316
//Ins4 (Ins4)
package {
import flash.display.*;
public dynamic class Ins4 extends MovieClip {
}
}//package
Section 317
//Ins5 (Ins5)
package {
import flash.display.*;
public dynamic class Ins5 extends MovieClip {
}
}//package
Section 318
//Ins7 (Ins7)
package {
import flash.display.*;
public dynamic class Ins7 extends MovieClip {
}
}//package
Section 319
//Ins8 (Ins8)
package {
import flash.display.*;
public dynamic class Ins8 extends MovieClip {
}
}//package
Section 320
//InsAr1 (InsAr1)
package {
import flash.display.*;
public dynamic class InsAr1 extends MovieClip {
}
}//package
Section 321
//InsAr2 (InsAr2)
package {
import flash.display.*;
public dynamic class InsAr2 extends MovieClip {
}
}//package
Section 322
//Invisible (Invisible)
package {
import flash.display.*;
public dynamic class Invisible extends MovieClip {
}
}//package
Section 323
//InvisibleObject (InvisibleObject)
package {
public class InvisibleObject extends StaticObject {
public var range:Number;
}
}//package
Section 324
//Laser (Laser)
package {
import flash.display.*;
public dynamic class Laser extends MovieClip {
}
}//package
Section 325
//LaserObject (LaserObject)
package {
import Box2D.Common.Math.*;
public class LaserObject extends GameObject {
override public function update(){
var _local1:b2Vec2;
var _local2:Number;
_local1 = body.GetPosition();
_local2 = body.GetAngle();
graphic.x = (_local1.x * GParams.physScale);
graphic.y = (_local1.y * GParams.physScale);
if (((!((body.GetLinearVelocity().Length() == 0))) && (!(isStopped)))){
graphic.rotation = ((Math.atan2(body.GetLinearVelocity().y, body.GetLinearVelocity().x) * 180) / Math.PI);
} else {
if (velocity != null){
graphic.rotation = ((Math.atan2(velocity.y, velocity.x) * 180) / Math.PI);
};
};
}
}
}//package
Section 326
//LaunchSound (LaunchSound)
package {
public dynamic class LaunchSound extends CustomSound {
}
}//package
Section 327
//LevelContainer (LevelContainer)
package {
import flash.display.*;
import flash.events.*;
public class LevelContainer extends MovieClip {
private var selectedMC:MovieClip;
private var dragging:Sprite;
private var classType:String;
public function MouseUp(_arg1:MouseEvent){
if (_arg1 == null){
if (dragging != null){
dragging.stopDrag();
dragging = null;
};
} else {
_arg1.target.stopDrag();
dragging = null;
};
}
public function init(){
addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
addEventListener(MouseEvent.MOUSE_UP, MouseUp);
zoom(0.7);
}
public function getZoom():Number{
return (this.scaleX);
}
private function MouseDown(_arg1:MouseEvent){
LevelEditor.selectedMC = _arg1.target;
LevelEditor.selectedMC.startDrag();
(this.parent as LevelEditor).resetValues();
(this.parent as LevelEditor).showDetails();
dragging = (_arg1.target as Sprite);
}
public function zoom(_arg1:Number){
this.scaleX = _arg1;
this.scaleY = _arg1;
}
}
}//package
Section 328
//LevelEditor (LevelEditor)
package {
import flash.display.*;
import flash.events.*;
import security.*;
import flash.utils.*;
import flash.filters.*;
public class LevelEditor extends MovieClip {
public var scrolling:Number;
private var testHud:TestHud;
private var hud:LevelHud;
private var RJKey:String;
private var RJ:Rijndael;
private var container:LevelContainer;
private var heroCreated:Boolean;
private var totalTurrets:int;
private var endCreated:Boolean;
private var levelString:String;
private var glow:GlowFilter;
var filterArray:Array;
private var currentMC:Object;
public static var selectedMC:Object;
public function LevelEditor(){
glow = new GlowFilter(0xFF0000);
super();
addInitialiser();
}
private function showError(_arg1:int){
var _local2:String;
hud.errorScreen.gotoAndPlay(2);
_local2 = new String("");
switch (_arg1){
case 1:
_local2 = "too many heroes";
break;
case 2:
_local2 = "too many end points";
break;
case 3:
_local2 = "no hero found";
break;
case 4:
_local2 = "no end point found";
break;
case 5:
_local2 = "too many turrets added";
break;
};
hud.errorScreen.er.errorMsg.text = _local2;
}
private function verifyCode():int{
var _local1:uint;
heroCreated = false;
endCreated = false;
totalTurrets = 0;
_local1 = 0;
while (_local1 < GParams.levelCode[0].length) {
if (GParams.levelCode[0][_local1][0] == Hero){
if (heroCreated){
return (1);
};
heroCreated = true;
};
if (GParams.levelCode[0][_local1][0] == End){
if (endCreated){
return (2);
};
endCreated = true;
};
if (GParams.levelCode[0][_local1][0] == Turret){
totalTurrets++;
};
_local1++;
};
if (!heroCreated){
return (3);
};
if (!endCreated){
return (4);
};
if (totalTurrets > 15){
return (5);
};
return (0);
}
public function addElement(_arg1:Object):MovieClip{
var _local2:MovieClip;
_local2 = (new (_arg1) as MovieClip);
container.addChild(_local2);
_local2.mouseChildren = false;
return (_local2);
}
public function generateLevel(){
var _local1:uint;
var _local2:*;
while (container.numChildren > 0) {
container.removeChildAt(0);
};
_local1 = 0;
while (_local1 < GParams.levelCode[0].length) {
if ((GParams.levelCode[0][_local1][0] is String)){
_local2 = addElement(getDefinitionByName(GParams.levelCode[0][_local1][0]));
} else {
_local2 = addElement(GParams.levelCode[0][_local1][0]);
};
_local2.x = GParams.levelCode[0][_local1][1];
_local2.y = GParams.levelCode[0][_local1][2];
_local2.rotation = GParams.levelCode[0][_local1][3];
_local2.scaleX = GParams.levelCode[0][_local1][4];
_local2.scaleY = GParams.levelCode[0][_local1][5];
_local1++;
};
}
public function removeElement(){
if (selectedMC != null){
if (container.contains((selectedMC as MovieClip))){
container.removeChild((selectedMC as MovieClip));
};
selectedMC = null;
};
}
public function generateCode():Boolean{
var _local1:int;
var _local2:int;
var _local3:*;
GParams.saveEnabled = false;
GParams.levelCode[0].splice(0, GParams.levelCode[0].length);
levelString = new String();
_local1 = 0;
while (_local1 < container.numChildren) {
_local3 = container.getChildAt(_local1);
levelString = (((((((((((((levelString + "[") + getQualifiedClassName(_local3)) + ",") + _local3.x) + ",") + _local3.y) + ",") + _local3.rotation) + ",") + _local3.scaleX) + ",") + _local3.scaleY) + "]");
if (_local1 != (container.numChildren - 1)){
levelString = (levelString + ",");
};
GParams.levelCode[0].push([getDefinitionByName(getQualifiedClassName(_local3)), _local3.x, _local3.y, _local3.rotation, _local3.scaleX, _local3.scaleY]);
_local1++;
};
levelString = RJ.encrypt(levelString, RJKey, "CBC");
_local2 = verifyCode();
if (_local2 == 0){
beginLevel();
return (true);
};
showError(_local2);
return (false);
}
private function onEnter(_arg1:Event){
var _local2:int;
if (scrolling == 1){
container.x = (container.x + 5);
};
if (scrolling == 3){
container.x = (container.x - 5);
};
if (scrolling == 2){
container.y = (container.y + 5);
};
if (scrolling == 4){
container.y = (container.y - 5);
};
if (scrolling == 5){
container.x = (container.x + 25);
};
if (scrolling == 7){
container.x = (container.x - 25);
};
if (scrolling == 6){
container.y = (container.y + 25);
};
if (scrolling == 8){
container.y = (container.y - 25);
};
if (container.x < (GParams.screenWidth - (2000 * container.scaleX))){
container.x = (GParams.screenWidth - (2000 * container.scaleX));
scrolling = 0;
};
if (container.y < (GParams.screenHeight - (1600 * container.scaleY))){
container.y = (GParams.screenHeight - (1600 * container.scaleY));
scrolling = 0;
};
if (container.x > 15){
container.x = 15;
scrolling = 0;
};
if (container.y > 15){
container.y = 15;
scrolling = 0;
};
if (scrolling != 0){
container.MouseUp(null);
};
if (selectedMC != null){
hud.setValues();
if (currentMC != null){
if (currentMC != selectedMC){
filterArray = currentMC.filters;
_local2 = 0;
while (_local2 < filterArray.length) {
if ((filterArray[_local2] is GlowFilter)){
filterArray.splice(_local2, 1);
};
_local2++;
};
currentMC.filters = filterArray;
};
};
filterArray = selectedMC.filters;
_local2 = 0;
while (_local2 < filterArray.length) {
if ((filterArray[_local2] is GlowFilter)){
return;
};
_local2++;
};
filterArray.push(glow);
selectedMC.filters = filterArray;
currentMC = selectedMC;
};
}
public function getZoom():Number{
return (container.getZoom());
}
public function beginLevel(){
removeEventListener(Event.ENTER_FRAME, onEnter);
while (numChildren > 0) {
removeChildAt(0);
};
MainClass.currentLevel = 0;
(this.parent as MainClass).startLevel();
if (testHud == null){
testHud = new TestHud();
};
testHud.addListeners();
testHud.y = 0;
addChild(testHud);
}
public function resetValues(){
hud.onChange(null);
}
public function getLevelString():String{
return (levelString);
}
public function addInitialiser(){
addEventListener(Event.ENTER_FRAME, initialise);
}
public function showDetails(){
hud.resetDetails((LevelEditor.selectedMC as MovieClip));
}
public function initialise(_arg1:Event){
scrolling = 0;
if (stage != null){
stage.focus = this;
stage.stageFocusRect = false;
stage.scaleMode = StageScaleMode.NO_SCALE;
removeEventListener(Event.ENTER_FRAME, initialise);
addEventListener(Event.ENTER_FRAME, onEnter);
(this.parent as MainClass).soundController.playMusic(SoundController.MUSIC_GAMEOVER);
addContainer();
addHud();
if (RJ == null){
RJ = new Rijndael(0x0100, 0x0100);
RJKey = "This game is awesome";
};
};
}
private function addHud(){
if (hud == null){
hud = new LevelHud();
};
addChild(hud);
}
public function zoom(_arg1:Number){
container.zoom(_arg1);
}
private function addContainer(){
if (container == null){
container = new LevelContainer();
};
addChild(container);
if (testHud != null){
if (contains(testHud)){
removeChild(testHud);
};
};
container.init();
generateLevel();
}
public function putElement(_arg1:Object, _arg2:Number, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = addElement(_arg1);
_local4.x = ((-(container.x) + _arg2) / getZoom());
_local4.y = ((-(container.y) + _arg3) / getZoom());
return (_local4);
}
public function goBack(){
(this.parent as MainClass).removeLevel();
}
public function decode(_arg1:String):String{
return (RJ.decrypt(_arg1, RJKey, "CBC"));
}
}
}//package
Section 329
//LevelHud (LevelHud)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class LevelHud extends MovieClip {
public var rightScrollFast:SimpleButton;
public var rightScroll:SimpleButton;
public var helpText:MovieClip;
public var downScroll:SimpleButton;
public var editMask:MovieClip;
private var chngRot:Boolean;
public var scl:MovieClip;
public var leftScrollFast:SimpleButton;
private var className:Object;
public var normalView:SimpleButton;
public var details:TextField;
private var chngXscale:Boolean;
public var zoomIn:MovieClip;
public var getCode:SimpleButton;
public var zoomOut:MovieClip;
public var errorScreen:MovieClip;
public var Yscale:TextField;
public var Name:TextField;
private var classType:String;
private var chngXpos:Boolean;
public var back:SimpleButton;
private var chngYscale:Boolean;
public var Xpos:TextField;
public var downScrollFast:SimpleButton;
private var chngYpos:Boolean;
public var tab1:SimpleButton;
public var tab2:SimpleButton;
public var loc:MovieClip;
public var help:SimpleButton;
public var upScroll:SimpleButton;
public var deleteBn:SimpleButton;
public var Ypos:TextField;
private var newMc:MovieClip;
public var showAll:SimpleButton;
public var leftScroll:SimpleButton;
public var Rot:TextField;
public var upScrollFast:SimpleButton;
public var Xscale:TextField;
public function LevelHud(){
var _local1:int;
super();
addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
addEventListener(MouseEvent.CLICK, MouseClick);
addEventListener(MouseEvent.MOUSE_OVER, MouseOver);
addEventListener(MouseEvent.MOUSE_OUT, MouseOut);
_local1 = 0;
while (_local1 < this.numChildren) {
if ((this.getChildAt(_local1) is Sprite)){
if (this.getChildAt(_local1) == helpText){
helpText.mouseEnabled = false;
} else {
(this.getChildAt(_local1) as Sprite).mouseChildren = false;
(this.getChildAt(_local1) as Sprite).buttonMode = true;
};
};
_local1++;
};
editMask.x = 900;
}
public function MouseUp(_arg1:MouseEvent){
_arg1.target.stopDrag();
if (_arg1.target.hasEventListener(MouseEvent.MOUSE_UP)){
_arg1.target.removeEventListener(MouseEvent.MOUSE_UP, MouseUp);
};
this.removeChild((_arg1.target as MovieClip));
if (_arg1.target.dropTarget == null){
if (((!((className == TextField))) && (!((className == SimpleButton))))){
LevelEditor.selectedMC = (this.parent as LevelEditor).putElement(className, mouseX, mouseY);
};
};
onChange(null);
}
private function MouseClick(_arg1:MouseEvent){
switch (_arg1.target.name){
case "help":
if (helpText.x != 40){
helpText.x = 40;
} else {
helpText.x = 880;
};
break;
case "closeHelp":
helpText.x = 880;
break;
case "showAll":
(this.parent as LevelEditor).zoom(0.25);
editMask.x = 14;
break;
case "normalView":
(this.parent as LevelEditor).zoom(0.7);
editMask.x = 900;
break;
};
}
public function setValues(){
Xscale.restrict = "0-9.\\-";
Yscale.restrict = "0-9.\\-";
Xpos.restrict = "0-9.";
Ypos.restrict = "0-9.";
Rot.restrict = "0-9";
if (!Xscale.hasEventListener(Event.CHANGE)){
Xscale.addEventListener(Event.CHANGE, onChange);
};
if (!Yscale.hasEventListener(Event.CHANGE)){
Yscale.addEventListener(Event.CHANGE, onChange);
};
if (!Xpos.hasEventListener(Event.CHANGE)){
Xpos.addEventListener(Event.CHANGE, onChange);
};
if (!Ypos.hasEventListener(Event.CHANGE)){
Ypos.addEventListener(Event.CHANGE, onChange);
};
if (!Rot.hasEventListener(Event.CHANGE)){
Rot.addEventListener(Event.CHANGE, onChange);
};
if (!chngXscale){
Xscale.text = LevelEditor.selectedMC.scaleX;
};
if (!chngYscale){
Yscale.text = LevelEditor.selectedMC.scaleY;
};
if (!chngXpos){
Xpos.text = LevelEditor.selectedMC.x;
};
if (!chngYpos){
Ypos.text = LevelEditor.selectedMC.y;
};
if (!chngRot){
Rot.text = LevelEditor.selectedMC.rotation;
};
Name.text = getQualifiedClassName(LevelEditor.selectedMC);
}
public function onChange(_arg1:Event){
chngXscale = false;
chngYscale = false;
chngXpos = false;
chngYpos = false;
chngRot = false;
if (LevelEditor.selectedMC == null){
return;
};
if (_arg1 != null){
switch (_arg1.target.name){
case "Xscale":
chngXscale = true;
if ((((_arg1.target.text == "0")) || ((_arg1.target.text == "")))){
} else {
LevelEditor.selectedMC.scaleX = _arg1.target.text;
};
break;
case "Yscale":
chngYscale = true;
if ((((_arg1.target.text == "0")) || ((_arg1.target.text == "")))){
} else {
LevelEditor.selectedMC.scaleY = _arg1.target.text;
};
break;
case "Xpos":
chngXpos = true;
if ((((_arg1.target.text == "0")) || ((_arg1.target.text == "")))){
} else {
LevelEditor.selectedMC.x = _arg1.target.text;
};
break;
case "Ypos":
chngYpos = true;
if ((((_arg1.target.text == "0")) || ((_arg1.target.text == "")))){
} else {
LevelEditor.selectedMC.y = _arg1.target.text;
};
break;
case "Rot":
chngRot = true;
if ((((_arg1.target.text == "0")) || ((_arg1.target.text == "")))){
} else {
LevelEditor.selectedMC.rotation = (_arg1.target.text % 360);
};
break;
};
restrictElement((LevelEditor.selectedMC as MovieClip));
};
}
private function MouseOut(_arg1:MouseEvent){
if (this.parent == null){
return;
};
if ((this.parent as LevelEditor).scrolling > 0){
switch (_arg1.target.name){
case "leftScroll":
case "upScroll":
case "rightScroll":
case "downScroll":
case "leftScrollFast":
case "upScrollFast":
case "rightScrollFast":
case "downScrollFast":
(this.parent as LevelEditor).scrolling = 0;
break;
default:
break;
};
};
}
private function restrictElement(_arg1:MovieClip){
if ((_arg1 is Platform)){
if (_arg1.scaleX > 100){
_arg1.scaleX = 100;
};
if (_arg1.scaleY != 1){
_arg1.scaleY = 1;
};
} else {
if ((_arg1 is Wall)){
if (_arg1.scaleX != 1){
_arg1.scaleX = 1;
};
if (_arg1.scaleY > 100){
_arg1.scaleY = 100;
};
} else {
if ((((((((((((((((((((((((((((((((_arg1 is Peacekeeper)) || ((_arg1 is Enforcer)))) || ((_arg1 is Gladiator)))) || ((_arg1 is Triarii)))) || ((_arg1 is Chariot)))) || ((_arg1 is ChariotSimple)))) || ((_arg1 is PGuard)))) || ((_arg1 is PUmbra)))) || ((_arg1 is Hero)))) || ((_arg1 is End)))) || ((_arg1 is ReflectiveWall)))) || ((_arg1 is Piston)))) || ((_arg1 is AetherTalisman)))) || ((_arg1 is ClayTalisman)))) || ((_arg1 is RubyTalisman)))) || ((_arg1 is StoneTalisman)))){
if (_arg1.scaleX != 1){
_arg1.scaleX = 1;
};
if (_arg1.scaleY != 1){
_arg1.scaleY = 1;
};
} else {
if ((((((((_arg1 is Crate)) || ((_arg1 is Barrel)))) || ((_arg1 is BarrelExp)))) || ((_arg1 is Stone)))){
if (_arg1.scaleX > 2.5){
_arg1.scaleX = 2.5;
};
if (_arg1.scaleY > 2.5){
_arg1.scaleY = 2.5;
};
};
};
};
};
}
private function MouseDown(_arg1:MouseEvent){
var _local2:Number;
var _local3:MovieClip;
if ((((_arg1.target.name == "loc")) || ((_arg1.target.name == "scl")))){
return;
};
onChange(null);
_local2 = (this.parent as LevelEditor).getZoom();
if (_arg1.target.name == "back"){
(this.parent.parent as MainClass).removeLevelEditor();
return;
};
if (_arg1.target != this){
classType = getQualifiedClassName(_arg1.target);
className = getDefinitionByName(classType);
if (((!((className == TextField))) && (!((className == SimpleButton))))){
_local3 = (new className() as MovieClip);
this.addChild(_local3);
_local3.mouseChildren = false;
_local3.startDrag(true);
_local3.addEventListener(MouseEvent.MOUSE_UP, MouseUp);
newMc = _local3;
};
};
switch (_arg1.target.name){
case "getCode":
if ((this.parent as LevelEditor).generateCode()){
editMask.x = 900;
};
break;
case "deleteBn":
(this.parent as LevelEditor).removeElement();
break;
};
}
public function update(_arg1:Number, _arg2:Number, _arg3:Number){
loc.xLoc.text = (int((_arg1 * 100)).toString() + "%");
loc.yLoc.text = (int((_arg2 * 100)).toString() + "%");
scl.scaleValue.text = (int((_arg3 * 100)).toString() + "%");
}
private function MouseOver(_arg1:MouseEvent){
switch (_arg1.target.name){
case "leftScroll":
(this.parent as LevelEditor).scrolling = 1;
break;
case "upScroll":
(this.parent as LevelEditor).scrolling = 2;
break;
case "rightScroll":
(this.parent as LevelEditor).scrolling = 3;
break;
case "downScroll":
(this.parent as LevelEditor).scrolling = 4;
break;
case "leftScrollFast":
(this.parent as LevelEditor).scrolling = 5;
break;
case "upScrollFast":
(this.parent as LevelEditor).scrolling = 6;
break;
case "rightScrollFast":
(this.parent as LevelEditor).scrolling = 7;
break;
case "downScrollFast":
(this.parent as LevelEditor).scrolling = 8;
break;
default:
if ((((_arg1.target == null)) || ((_arg1.target == this)))){
if (LevelEditor.selectedMC != null){
resetDetails((LevelEditor.selectedMC as MovieClip));
};
} else {
resetDetails((_arg1.target as MovieClip));
};
break;
};
}
public function resetDetails(_arg1:MovieClip){
if (_arg1 == null){
details.text = "";
} else {
switch (getQualifiedClassName(_arg1)){
case "Platform":
details.text = (((("Platform" + "\n") + "Strong and sturdy.") + "\n") + "Can only be scaled in x direction upto 100.");
break;
case "Wall":
details.text = (((("Wall" + "\n") + "Strong and sturdy.") + "\n") + "Can only be scaled in y direction upto 100.");
break;
case "End":
details.text = (((("Level end point" + "\n") + "Reach here to complete each level.") + "\n") + "Scale values are not used.");
break;
case "ReflectiveWall":
details.text = (((("Mirror" + "\n") + "Useful to reflect lasers.") + "\n") + "only scalable in y direction.");
break;
case "Hero":
details.text = (((("Hero" + "\n") + "Indicates start location in level.") + "\n") + "Scale values are not used.");
break;
case "Crate":
details.text = (((("Crate" + "\n") + "Breakable and mass/damage depends on size.") + "\n") + "Max scale of 2.5 in any direction.");
break;
case "Stone":
details.text = (((("Stone" + "\n") + "Non-breakable and mass/damage depends on size.") + "\n") + "Max scale of 2.5 in any direction.");
break;
case "Barrel":
details.text = (((("Barrel" + "\n") + "Breakable and mass/damage depends on size.") + "\n") + "Max scale of 2.5 in any direction.");
break;
case "BarrelExp":
details.text = (((("Explosive Barrel" + "\n") + "Explodable and mass/damage depends on size.") + "\n") + "Max scale of 2.5 in any direction.");
break;
case "Piston":
details.text = (((("Piston" + "\n") + "A heavy machinery going up and down.") + "\n") + "Scale values are not used.");
break;
case "Turret":
details.text = (((("Turret" + "\n") + "An automated turret that targets hero continuously.") + "\n") + "Scale values are not used.");
break;
case "BreakableWall":
details.text = (((("Breakable wall" + "\n") + "Similar to normal wall only difference being that it is breakable by bullets or explosives.") + "\n") + "only scalable in y direction.");
break;
case "BreakingPlatform":
details.text = (((("Breaking platform" + "\n") + "Similar to normal platform only difference being that it breaks sometime after the user stands on it.") + "\n") + "only scalable in x direction.");
break;
case "RollingBarrel":
details.text = (((("Rolling Barrel" + "\n") + "Rolling version of barrel.Breakable and mass/damage depends on size.") + "\n") + "Max scale of 2.5 in any direction.");
break;
case "RollingBarrelExp":
details.text = (((("Rolling explosive Barrel" + "\n") + "Rolling version of barrel.Explodable and mass/damage depends on size.") + "\n") + "Max scale of 2.5 in any direction.");
break;
case "Peacekeeper":
details.text = (((("Peacekeeper" + "\n") + "Weakest enemy. Has little health. Carries a hand gun") + "\n") + "Scale values are not used.");
break;
case "Enforcer":
details.text = (((("Enforcer" + "\n") + "Has medium health. Carries a machine gun") + "\n") + "Scale values are not used.");
break;
case "Gladiator":
details.text = (((("Gladiator" + "\n") + "Has little health. Carries a lethal grenade launcher") + "\n") + "Scale values are not used.");
break;
case "Triarii":
details.text = (((("Triarii" + "\n") + "Has above medium health. Carries a laser gun which has to be charged before firing") + "\n") + "Scale values are not used.");
break;
case "PGuard":
details.text = (((("Praetorian Guard" + "\n") + "Flying spirit protecting Tempus. Its touch is damaging but its diving is more dangerous") + "\n") + "Scale values are not used.");
break;
case "PUmbra":
details.text = (((("Praetorian Umbra" + "\n") + "Flying spirit protecting Tempus. Similar to Praetorian guard but only move/attacks in Tempus") + "\n") + "Scale values are not used.");
break;
case "Chariot":
details.text = (((("Advanced Chariot" + "\n") + "Same as chariot but also has a homing missile launcher") + "\n") + "Scale values are not used.");
break;
case "ChariotSimple":
details.text = (((("Chariot" + "\n") + "High health enemy. Equipped with a laser and chain gun.") + "\n") + "Scale values are not used.");
break;
case "ClayTalisman":
details.text = (((("ClayTalisman" + "\n") + "Powerup. provides 25% health.") + "\n") + "Scale values are not used.");
break;
case "StoneTalisman":
details.text = (((("StoneTalisman" + "\n") + "Powerup. provides 100% health.") + "\n") + "Scale values are not used.");
break;
case "RubyTalisman":
details.text = (((("RubyTalisman" + "\n") + "Powerup. provides infinite health for a short time.") + "\n") + "Scale values are not used.");
break;
case "AetherTalisman":
details.text = (((("AetherTalisman" + "\n") + "Powerup. provides infinite Tempus energy for a short time.") + "\n") + "Scale values are not used.");
break;
default:
break;
};
};
}
}
}//package
Section 330
//LevelStart (LevelStart)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class LevelStart extends MovieClip {
public var CodesMC:MovieClip;
var urlPlayMore:String;// = "http://www.flasharcade.com/ref.php?button=logo&game=ace048"
var requestPlayMore:URLRequest;// = null
public var nextLevel:SimpleButton;
public var numMC:MovieClip;
public var blackOut:MovieClip;
public var playLogo:SimpleButton;
public function LevelStart(){
urlPlayMore = "http://www.flasharcade.com/ref.php?button=logo&game=ace048";
requestPlayMore = null;
super();
addFrameScript(57, frame58, 98, frame99, 145, frame146);
blackOut.mouseEnabled = false;
}
public function init(){
requestPlayMore = new URLRequest(urlPlayMore);
if (this.parent != null){
this.parent.setChildIndex(this, (this.parent.numChildren - 1));
};
addEventListener(MouseEvent.CLICK, handleClick);
addEventListener(Event.ENTER_FRAME, onEnter);
}
private function onEnter(_arg1:Event){
if (((!((this.numMC == null))) && (!((this.CodesMC == null))))){
this.numMC.num.text = MainClass.currentLevel.toString();
this.CodesMC.Codes.text = GParams.playLevelCode[(MainClass.currentLevel - 1)].toString();
removeEventListener(Event.ENTER_FRAME, onEnter);
};
}
private function handleClick(_arg1:MouseEvent){
if (_arg1.target.name == "nextLevel"){
if (currentFrame < 59){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
removeAllListener();
this.gotoAndPlay(59);
};
};
if (_arg1.target.name == "playLogo"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
navigateToURL(requestPlayMore, "_blank");
};
}
private function removeAllListener(){
removeEventListener(MouseEvent.CLICK, handleClick);
}
function frame99(){
if (this.parent != null){
(this.parent as MainClass).startLevel();
};
}
function frame58(){
stop();
}
function frame146(){
stop();
if (this.parent != null){
this.parent.removeChild(this);
};
}
}
}//package
Section 331
//LevelStat (LevelStat)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class LevelStat extends MovieClip {
public var killedEnemy:TextField;
public var nextLevel:SimpleButton;
public var totalEnemy:TextField;
public function init(){
if (this.parent != null){
this.parent.setChildIndex(this, (this.parent.numChildren - 1));
};
addEventListener(MouseEvent.CLICK, handleClick);
addEventListener(Event.ENTER_FRAME, onEnter);
}
private function onEnter(_arg1:Event){
if (((!((totalEnemy == null))) && (!((killedEnemy == null))))){
totalEnemy.text = (this.parent as MainClass).enemyCount.toString();
killedEnemy.text = ((this.parent as MainClass).enemyCount - (this.parent as MainClass).enemyAlive).toString();
removeEventListener(Event.ENTER_FRAME, onEnter);
};
}
private function handleClick(_arg1:MouseEvent){
trace(_arg1.target.name);
if (_arg1.target.name == "nextLevel"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
removeAllListener();
(this.parent as MainClass).nextLevel(MainClass.currentLevel);
};
}
private function removeAllListener(){
removeEventListener(MouseEvent.CLICK, handleClick);
}
}
}//package
Section 332
//levelUp (levelUp)
package {
import flash.display.*;
import flash.events.*;
public class levelUp extends MovieClip {
public var movie:MovieClip;
public var nextLevel:SimpleButton;
public function levelUp(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
}
public function init(_arg1:int){
if (this.parent != null){
this.parent.setChildIndex(this, (this.parent.numChildren - 1));
};
gotoAndStop(_arg1);
addEventListener(MouseEvent.CLICK, handleClick);
}
function frame10(){
stop();
}
function frame3(){
this.movie.gotoAndPlay(1);
}
function frame7(){
this.movie.gotoAndPlay(1);
}
function frame1(){
this.movie.gotoAndPlay(1);
}
private function handleClick(_arg1:MouseEvent){
if (_arg1.target.name == "nextLevel"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
if (currentFrame == 1){
if (movie != null){
if (movie.currentFrame == 1){
movie.gotoAndStop(2);
return;
};
if (movie.currentFrame == 2){
movie.gotoAndPlay(3);
return;
};
};
};
removeAllListener();
if (currentFrame <= 7){
init(10);
(this.parent as MainClass).createLevel();
} else {
if (currentFrame == 8){
init(9);
} else {
init(10);
(this.parent as MainClass).createYouWin();
};
};
};
}
function frame6(){
this.movie.gotoAndPlay(1);
}
function frame4(){
this.movie.gotoAndPlay(1);
}
function frame5(){
this.movie.gotoAndPlay(1);
}
function frame9(){
this.movie.gotoAndPlay(1);
}
function frame8(){
this.movie.gotoAndPlay(1);
}
function frame2(){
this.movie.gotoAndPlay(1);
}
private function removeAllListener(){
removeEventListener(MouseEvent.CLICK, handleClick);
}
}
}//package
Section 333
//Light (Light)
package {
import flash.display.*;
public dynamic class Light extends MovieClip {
}
}//package
Section 334
//MainClass (MainClass)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.ui.*;
public class MainClass extends MovieClip {
private var levelSt:LevelStat;
private var hud:Hud;
private var maxLevels:int;// = 35
public var soundController:SoundController;
public var enemyAlive:uint;
private var levelEd:LevelEditor;
private var youWin:YouWin;
private var welcome:Welcome;
public var enemyCount:uint;
private var container:Container;
private var levelUpScreen:levelUp;
public var profile:SharedObject;
private var options:Option;
private var customWelcome:CustomWelcome;
private var gameOver:GameOver;
private var newLevel:LevelStart;
public static var rightKey:Boolean;
public static var upKey:Boolean;
public static var spaceKeyClickable:Boolean = true;
public static var keyPressed:Boolean;
public static var currentLevel:uint;
public static var changeKey:Boolean;
public static var pauseFlag:Boolean = false;
public static var leftKey:Boolean;
public static var spaceKey:Boolean = false;
public static var difficulty:uint;
public static var byPassing:Boolean = false;
public static var downKey:Boolean;
public function MainClass(){
maxLevels = 35;
super();
soundController = new SoundController();
addEventListener(Event.ENTER_FRAME, initialise);
}
private function checkCompletion(){
var _local1:uint;
_local1 = 0;
while (_local1 < profile.data.Levels.length) {
if (profile.data.Levels[_local1] == 0){
return;
};
_local1++;
};
}
public function removeLevelEditor(){
if (contains(levelEd)){
removeChild(levelEd);
};
levelEd = null;
createWelcome();
}
public function refreshHud(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number, _arg5:Number){
hud.update(_arg1, _arg2, _arg3, _arg4, _arg5, currentLevel);
}
private function hasCutScene(_arg1:int){
if ((_arg1 % 7) == 1){
return (true);
};
return (false);
}
public function onDown(_arg1:KeyboardEvent){
if (((!((levelEd == null))) && (contains(levelEd)))){
if (byPassing){
return;
};
};
if (!changeKey){
switch (_arg1.keyCode){
case GParams.spaceCode:
if (!pauseFlag){
if (spaceKeyClickable){
spaceKey = !(spaceKey);
spaceKeyClickable = false;
};
};
break;
case GParams.leftCode:
case 37:
leftKey = true;
keyPressed = true;
break;
case GParams.upCode:
case 38:
upKey = true;
keyPressed = true;
break;
case GParams.rightCode:
case 39:
rightKey = true;
keyPressed = true;
break;
case GParams.downCode:
case 40:
downKey = true;
keyPressed = true;
break;
case GParams.pauseCode:
pauseLevel();
break;
case GParams.quitCode:
quitLevel();
break;
case GParams.restartCode:
restartLevel();
break;
};
} else {
if (options != null){
options.changeTheKey(_arg1);
} else {
throw (new Error("no options to change key"));
};
};
}
public function pauseLevel(){
if (container != null){
if (container.isHeroAlive()){
pauseFlag = !(pauseFlag);
if (options != null){
if (contains(options)){
removeOptions();
};
};
};
};
}
private function createGameOver(){
if (gameOver == null){
gameOver = new GameOver();
};
gameOver.init();
soundController.playMusic(SoundController.MUSIC_GAMEOVER);
addChild(gameOver);
}
public function createOptions(){
if (options == null){
options = new Option();
};
if (!contains(options)){
addChild(options);
};
options.init();
}
public function quitLevel(){
if (!pauseFlag){
if (container != null){
if (contains(container)){
container.killHero();
};
};
};
}
public function startLevel(){
if (gameOver != null){
if (contains(gameOver)){
removeChild(gameOver);
};
};
if (container == null){
container = new Container();
};
if (!contains(container)){
addChild(container);
};
container.init();
this.setChildIndex(container, 0);
if (hud == null){
hud = new Hud();
};
if (!contains(hud)){
addChild(hud);
};
hud.init();
this.setChildIndex(hud, 1);
soundController.playMusic(SoundController.MUSIC_INGAME);
}
public function containsOptions():Boolean{
if (options == null){
return (false);
};
return (contains(options));
}
public function nextLevel(_arg1:int){
if (levelSt != null){
if (contains(levelSt)){
removeChild(levelSt);
};
};
if (_arg1 == 50){
if (customWelcome != null){
if (contains(customWelcome)){
removeChild(customWelcome);
customWelcome = null;
};
};
startLevel();
} else {
if (_arg1 == 34){
playCutScene(6);
} else {
if (_arg1 == 35){
playCutScene(7);
} else {
if (_arg1 == 36){
playCutScene(8);
} else {
if (hasCutScene(_arg1)){
playCutScene(((_arg1 / 7) + 1));
} else {
createLevel();
};
};
};
};
};
}
public function removeLevel(){
container.remove();
hud.remove();
removeChild(container);
removeChild(hud);
container = null;
hud = null;
}
public function createYouWin(){
if (youWin == null){
youWin = new YouWin();
};
youWin.init();
addChild(youWin);
soundController.playMusic(SoundController.MUSIC_YOUWIN);
}
public function editLevel(){
container.remove();
hud.remove();
removeChild(container);
removeChild(hud);
container = null;
hud = null;
soundController.playSound(SoundController.SOUND_CLICK1);
initLevelEditor();
}
public function showResult(_arg1:uint){
Mouse.show();
if (currentLevel == 0){
if (_arg1 == 1){
GParams.saveEnabled = true;
};
removeLevel();
startLevel();
} else {
if (_arg1 == 0){
createGameOver();
} else {
if (currentLevel <= maxLevels){
removeLevel();
currentLevel++;
profile.data.Levels[(currentLevel - 2)] = 1;
checkCompletion();
showStats();
} else {
removeLevel();
createWelcome();
};
};
};
}
public function restartLevel(){
if (!pauseFlag){
if (container != null){
if (contains(container)){
removeLevel();
startLevel();
};
};
};
}
private function initialise(_arg1:Event){
if (stage != null){
if (!this.hasEventListener(KeyboardEvent.KEY_DOWN)){
this.addEventListener(KeyboardEvent.KEY_DOWN, onDown);
};
if (!this.hasEventListener(KeyboardEvent.KEY_UP)){
this.addEventListener(KeyboardEvent.KEY_UP, onUp);
};
stage.focus = this;
stage.stageFocusRect = false;
stage.scaleMode = StageScaleMode.NO_SCALE;
removeEventListener(Event.ENTER_FRAME, initialise);
profile = SharedObject.getLocal("TempusData");
if (GParams.loadCustomLevel){
createNewWelcome();
} else {
createWelcome();
};
changeKey = false;
};
}
private function showStats(){
if (enemyCount <= 0){
nextLevel(currentLevel);
} else {
if (levelSt == null){
levelSt = new LevelStat();
};
levelSt.init();
if (!contains(levelSt)){
addChild(levelSt);
};
};
}
private function createNewWelcome(){
soundController.playMusic(SoundController.MUSIC_WELCOME);
if (gameOver != null){
if (contains(gameOver)){
removeChild(gameOver);
};
};
if (youWin != null){
if (contains(youWin)){
removeChild(youWin);
};
};
if (customWelcome == null){
customWelcome = new CustomWelcome();
};
customWelcome.init();
addChild(customWelcome);
}
public function playCutScene(_arg1:int){
if (levelUpScreen == null){
levelUpScreen = new levelUp();
};
if (!contains(levelUpScreen)){
addChild(levelUpScreen);
};
levelUpScreen.init(_arg1);
soundController.playMusic(SoundController.MUSIC_CUTSCENE);
}
public function createWelcome(){
soundController.playMusic(SoundController.MUSIC_WELCOME);
if (gameOver != null){
if (contains(gameOver)){
removeChild(gameOver);
};
};
if (youWin != null){
if (contains(youWin)){
removeChild(youWin);
};
};
if (welcome == null){
welcome = new Welcome();
};
welcome.init();
addChild(welcome);
}
private function onUp(_arg1:KeyboardEvent){
switch (_arg1.keyCode){
case GParams.spaceCode:
spaceKeyClickable = true;
break;
case GParams.leftCode:
case 37:
leftKey = false;
break;
case GParams.upCode:
case 38:
upKey = false;
break;
case GParams.rightCode:
case 39:
rightKey = false;
break;
case GParams.downCode:
case 40:
downKey = false;
break;
};
if (((((((!(leftKey)) && (!(rightKey)))) && (!(upKey)))) && (!(downKey)))){
keyPressed = false;
};
}
public function removeOptions(){
if (options != null){
if (contains(options)){
removeChild(options);
};
};
if (welcome != null){
stage.focus = welcome;
};
}
public function initLevelEditor(){
if (welcome != null){
if (contains(welcome)){
removeChild(welcome);
welcome = null;
};
};
if (customWelcome != null){
if (contains(customWelcome)){
removeChild(customWelcome);
customWelcome = null;
};
};
if (gameOver != null){
if (contains(gameOver)){
removeChild(gameOver);
gameOver = null;
};
};
if (levelEd == null){
levelEd = new LevelEditor();
};
addChild(levelEd);
}
public function createLevel(){
if (welcome != null){
if (contains(welcome)){
removeChild(welcome);
welcome = null;
};
};
if (levelUpScreen != null){
if (contains(levelUpScreen)){
removeChild(levelUpScreen);
};
};
if (newLevel == null){
newLevel = new LevelStart();
};
addChild(newLevel);
newLevel.init();
newLevel.gotoAndPlay(1);
}
}
}//package
Section 335
//Mars (Mars)
package {
import flash.display.*;
public dynamic class Mars extends MovieClip {
public var thump:MovieClip;
public var hurt:MovieClip;
public var death:MovieClip;
public var still:MovieClip;
public var walk:MovieClip;
public var whip:MovieClip;
public function Mars(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 336
//MarsLeg (MarsLeg)
package {
import flash.display.*;
public dynamic class MarsLeg extends MovieClip {
public var thump:MovieClip;
public var hurt:MovieClip;
public var death:MovieClip;
public var still:MovieClip;
public var walk:MovieClip;
public var whip:MovieClip;
public function MarsLeg(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 337
//MarsMissile (MarsMissile)
package {
import flash.display.*;
public dynamic class MarsMissile extends MovieClip {
}
}//package
Section 338
//MarsMissileObject (MarsMissileObject)
package {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class MarsMissileObject extends MissileObject {
override public function reAlign(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:b2Vec2;
_local3 = ((Math.atan2((_arg2 - graphic.y), (_arg1 - graphic.x)) * 180) / Math.PI);
_local4 = ((Math.atan2(body.GetLinearVelocity().y, body.GetLinearVelocity().x) * 180) / Math.PI);
_local5 = new b2Vec2(body.GetLinearVelocity().x, body.GetLinearVelocity().y);
_local5.Normalize();
_local5.Multiply(50);
if (Math.abs((_local3 - _local4)) > 5){
if (Math.abs((_local3 - _local4)) > 180){
if (_local3 > _local4){
_local3 = (_local3 - 360);
} else {
_local4 = (_local4 - 360);
};
};
if (_local3 > _local4){
body.ApplyImpulse(new b2Vec2((-(_local5.y) / 500), (_local5.x / 500)), body.GetWorldPoint(new b2Vec2(0, 0)));
} else {
body.ApplyImpulse(new b2Vec2((_local5.y / 500), (-(_local5.x) / 500)), body.GetWorldPoint(new b2Vec2(0, 0)));
};
};
}
public function startMissile(){
var _local1:b2Shape;
var _local2:b2Shape;
var _local3:b2FilterData;
_local1 = body.GetShapeList();
while (_local1) {
_local2 = _local1.GetNext();
_local3 = new b2FilterData();
_local3.categoryBits = (4 | 2);
_local3.maskBits = (4 | 2);
_local1.SetFilterData(_local3);
body.GetWorld().Refilter(_local1);
_local1 = _local2;
};
}
public function stopMissile(){
var _local1:b2Shape;
var _local2:b2Shape;
var _local3:b2FilterData;
_local1 = body.GetShapeList();
while (_local1) {
_local2 = _local1.GetNext();
_local3 = new b2FilterData();
_local3.categoryBits = 0x0100;
_local3.maskBits = 32;
_local1.SetFilterData(_local3);
body.GetWorld().Refilter(_local1);
_local1 = _local2;
};
}
}
}//package
Section 339
//MarsObject (MarsObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.geom.*;
public class MarsObject extends BossObject {
private var alertCounter:Number;
protected var STATUS_WHIP:uint;// = 4
public var whippable:Boolean;// = false
private var bulletMass:b2MassData;
public var whiping:Boolean;// = false
private var walkTime:Number;// = 203
protected var STATUS_THUMP:uint;// = 40
public var graphic2:MovieClip;
private var shooting:Boolean;// = false
private var laserSD:b2CircleDef;
private var thumping:Boolean;// = false
private var thumped:Boolean;// = false
private var shootPoint:Point;
private var shotsFired:Number;// = 0
private var shootAngle:Number;
public function MarsObject(){
shotsFired = 0;
walkTime = 203;
STATUS_WHIP = 4;
STATUS_THUMP = 40;
whiping = false;
whippable = false;
shooting = false;
thumped = false;
thumping = false;
super();
}
override protected function shoot(){
whiping = false;
shooting = true;
if (actorWorld == null){
actorWorld = body.GetWorld();
laserSD = new b2CircleDef();
};
if ((graphic as MovieClip).still != null){
shootPoint = (graphic as MovieClip).still.localToGlobal(new Point((graphic as MovieClip).still.gunPoint.x, (graphic as MovieClip).still.gunPoint.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
};
if (shootPoint == null){
return;
};
bulletSpeed = 14;
laserSD = new b2CircleDef();
bulletBD = new b2BodyDef();
if (graphic.scaleX > 0){
bulletBD.position.Set(((shootPoint.x + 5) / GParams.physScale), ((shootPoint.y - 10) / GParams.physScale));
} else {
bulletBD.position.Set(((shootPoint.x - 5) / GParams.physScale), ((shootPoint.y - 10) / GParams.physScale));
};
bulletBD.isBullet = true;
laserSD.density = 0.1;
bulletBD.linearDamping = 0;
bulletObject = (graphic.parent as Container).getBullet(6);
laserSD.radius = (((3 * bulletObject.graphic.height) / 4) / GParams.physScale);
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
laserSD.filter.categoryBits = (4 | 2);
laserSD.filter.maskBits = (4 | 2);
bulletB.CreateShape(laserSD);
bulletObject.init(bulletB);
bulletMass.mass = 0.06128;
bulletMass.center = this.body.GetLocalCenter();
bulletMass.I = this.body.GetInertia();
bulletB.SetMass(bulletMass);
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).worldArray.push(bulletObject);
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_LAUNCH);
};
};
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetAntiGravity(true);
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
laserSD = null;
bulletB = null;
bulletObject = null;
shootPoint = null;
}
override protected function setFrame(){
graphic.scaleX = turn;
graphic2.scaleX = turn;
if (maxVel.x != 0){
charStatus = STATUS_WALK;
} else {
charStatus = STATUS_STILL;
};
if (thumping){
charStatus = STATUS_THUMP;
};
if (whiping){
charStatus = STATUS_WHIP;
};
if (hurt > 0){
charStatus = STATUS_HURT;
};
if (health <= 0){
charStatus = STATUS_DEATH;
};
switch (charStatus){
case STATUS_WALK:
if ((graphic as MovieClip).currentFrame != 3){
(graphic as MovieClip).gotoAndStop(3);
};
if ((graphic2 as MovieClip).currentFrame != 3){
(graphic2 as MovieClip).gotoAndStop(3);
};
if ((graphic as MovieClip).walk != null){
if (((((graphic as MovieClip).walk.currentFrame == 53)) || (((graphic as MovieClip).walk.currentFrame == 96)))){
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_WALK);
};
};
};
};
break;
case STATUS_STILL:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic2 as MovieClip).currentFrame != 1){
(graphic2 as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.currentFrame == 29){
if (shootStatus >= 0){
(graphic as MovieClip).still.gotoAndPlay(31);
(graphic2 as MovieClip).still.gotoAndPlay(31);
};
};
};
break;
case STATUS_WHIP:
if ((graphic as MovieClip).currentFrame != 2){
(graphic as MovieClip).gotoAndStop(2);
};
if ((graphic2 as MovieClip).currentFrame != 2){
(graphic2 as MovieClip).gotoAndStop(2);
};
if ((graphic as MovieClip).whip != null){
if ((graphic as MovieClip).whip.currentFrame == (graphic as MovieClip).whip.totalFrames){
whiping = false;
(graphic as MovieClip).whip.gotoAndStop(1);
};
if ((graphic as MovieClip).whip.currentFrame == 2){
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_ROAR);
};
};
};
};
break;
case STATUS_THUMP:
if ((graphic as MovieClip).currentFrame != 5){
(graphic as MovieClip).gotoAndStop(5);
};
if ((graphic2 as MovieClip).currentFrame != 5){
(graphic2 as MovieClip).gotoAndStop(5);
};
if ((graphic as MovieClip).thump != null){
if ((graphic as MovieClip).thump.currentFrame == ((graphic as MovieClip).thump.totalFrames - 10)){
thumping = false;
if (graphic.parent != null){
(graphic.parent as Container).ceilingFall();
};
(graphic as MovieClip).thump.gotoAndStop(1);
};
};
break;
case STATUS_HURT:
if ((graphic as MovieClip).currentFrame != 4){
(graphic as MovieClip).gotoAndStop(4);
};
if ((graphic2 as MovieClip).currentFrame != 4){
(graphic2 as MovieClip).gotoAndStop(4);
};
break;
case STATUS_DEATH:
if ((graphic as MovieClip).currentFrame != 6){
(graphic as MovieClip).gotoAndStop(6);
};
if ((graphic2 as MovieClip).currentFrame != 6){
(graphic2 as MovieClip).gotoAndStop(6);
};
break;
};
}
public function whipped():Boolean{
if ((graphic as MovieClip).currentFrame == 2){
if (((((graphic as MovieClip).whip.currentFrame <= 43)) && (((graphic as MovieClip).whip.currentFrame >= 38)))){
return (true);
};
};
return (false);
}
private function shootTempus(){
whiping = false;
shooting = true;
if (actorWorld == null){
actorWorld = body.GetWorld();
laserSD = new b2CircleDef();
};
if ((graphic as MovieClip).still != null){
shootPoint = (graphic as MovieClip).still.localToGlobal(new Point((graphic as MovieClip).still.gunPoint.x, (graphic as MovieClip).still.gunPoint.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
};
if (shootPoint == null){
return;
};
bulletSpeed = 14;
laserSD = new b2CircleDef();
bulletBD = new b2BodyDef();
if (graphic.scaleX > 0){
bulletBD.position.Set(((shootPoint.x + 5) / GParams.physScale), ((shootPoint.y - 10) / GParams.physScale));
} else {
bulletBD.position.Set(((shootPoint.x - 5) / GParams.physScale), ((shootPoint.y - 10) / GParams.physScale));
};
bulletBD.isBullet = true;
laserSD.density = 0.1;
bulletBD.linearDamping = 0;
bulletObject = (graphic.parent as Container).getBullet(7);
laserSD.radius = (((3 * bulletObject.graphic.height) / 4) / GParams.physScale);
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
laserSD.filter.categoryBits = (4 | 2);
laserSD.filter.maskBits = (4 | 2);
bulletB.CreateShape(laserSD);
bulletObject.init(bulletB);
bulletMass.mass = 0.06128;
bulletMass.center = this.body.GetLocalCenter();
bulletMass.I = this.body.GetInertia();
bulletB.SetMass(bulletMass);
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).tempusArray.push(bulletObject);
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_LAUNCH);
};
};
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetAntiGravity(true);
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
laserSD = null;
bulletB = null;
bulletObject = null;
shootPoint = null;
}
override public function update(){
super.update();
graphic2.x = graphic.x;
graphic2.y = graphic.y;
graphic2.rotation = graphic.rotation;
if (hurt > 0){
hurt--;
};
if (currHealth > health){
hurt = 10;
currHealth = health;
};
setFrame();
}
public function resetFrames(){
bulletMass = new b2MassData();
whiping = false;
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic2 as MovieClip).currentFrame != 1){
(graphic2 as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.currentFrame >= 29){
(graphic as MovieClip).still.gotoAndPlay(1);
(graphic2 as MovieClip).still.gotoAndPlay(1);
};
};
}
override public function move(){
vel = this.body.GetLinearVelocity();
think();
if (body.IsSleeping()){
body.WakeUp();
};
vel.Set(maxVel.x, 0);
}
private function whip(){
whiping = true;
}
public function initDisplay2(_arg1:MovieClip){
graphic2 = _arg1;
}
private function thump(){
thumping = true;
}
override public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
shootAngle = Math.atan2(Math.abs((graphic.y - _arg3)), Math.abs((graphic.x - _arg2)));
if ((graphic as MovieClip).currentFrame != 2){
if ((_arg2 - graphic.x) > 75){
graphic.scaleX = GParams.RIGHT;
graphic2.scaleX = GParams.RIGHT;
} else {
if ((_arg2 - graphic.x) < -75){
graphic.scaleX = GParams.LEFT;
graphic2.scaleX = GParams.LEFT;
};
};
turn = graphic.scaleX;
};
if (_arg3 < graphic.y){
shootAngle = (shootAngle * -1);
} else {
shootAngle = (shootAngle - (Math.PI / 5));
};
if (Math.abs((_arg2 - graphic.x)) > range){
alertCounter--;
if (alertCounter < 0){
alertStatus = false;
};
} else {
if ((((shotsFired >= 3)) && ((shotsFired < walkTime)))){
alertStatus = false;
shotsFired++;
if ((((shotsFired == int((walkTime / 2)))) && (!((graphic.parent as Container).Tempus)))){
alertStatus = true;
thump();
};
} else {
alertStatus = true;
alertCounter = 40;
if (shotsFired >= walkTime){
shotsFired = 0;
};
};
};
if (whippable){
whip();
alertStatus = true;
whippable = false;
} else {
if (shotsFired < 3){
if ((((((shootStatus > 0)) && ((charStatus == STATUS_STILL)))) && (!(((graphic as MovieClip).still == null))))){
if ((graphic as MovieClip).still.currentFrame == 51){
if ((graphic.parent as Container).Tempus){
shootTempus();
} else {
shoot();
};
shootStatus = 0;
shotsFired++;
};
};
};
};
if (shotsFired == 3){
thumped = false;
};
shootStatus++;
if (thumping){
alertStatus = true;
};
}
override protected function think(){
if (!alertStatus){
maxVel.Set((turn * 2), 0);
} else {
maxVel.Set(0, 0);
};
}
}
}//package
Section 340
//MarsStone (MarsStone)
package {
import flash.display.*;
public dynamic class MarsStone extends MovieClip {
public function MarsStone(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 341
//MarsStoneObject (MarsStoneObject)
package {
import Box2D.Common.Math.*;
public class MarsStoneObject extends GameObject {
override public function update(){
var _local1:b2Vec2;
var _local2:Number;
_local1 = body.GetPosition();
_local2 = body.GetAngle();
graphic.x = (_local1.x * GParams.physScale);
graphic.y = (_local1.y * GParams.physScale);
graphic.rotation = ((_local2 * (180 / Math.PI)) % 360);
}
}
}//package
Section 342
//Missile (Missile)
package {
import flash.display.*;
public dynamic class Missile extends MovieClip {
public function Missile(){
addFrameScript(1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame2(){
gotoAndPlay(1);
}
}
}//package
Section 343
//MissileObject (MissileObject)
package {
import Box2D.Common.Math.*;
public class MissileObject extends GameObject {
var angle2:Number;
var vel1:b2Vec2;
var angle1:Number;
override public function update(){
var _local1:b2Vec2;
var _local2:Number;
_local1 = body.GetPosition();
_local2 = body.GetAngle();
graphic.x = (_local1.x * GParams.physScale);
graphic.y = (_local1.y * GParams.physScale);
if (((!((body.GetLinearVelocity().Length() == 0))) && (!(isStopped)))){
graphic.rotation = ((Math.atan2(body.GetLinearVelocity().y, body.GetLinearVelocity().x) * 180) / Math.PI);
} else {
graphic.rotation = ((Math.atan2(velocity.y, velocity.x) * 180) / Math.PI);
};
if (health < 100){
health = 100;
};
}
public function reAlign(_arg1:Number, _arg2:Number){
angle1 = ((Math.atan2((_arg2 - graphic.y), (_arg1 - graphic.x)) * 180) / Math.PI);
angle2 = ((Math.atan2(body.GetLinearVelocity().y, body.GetLinearVelocity().x) * 180) / Math.PI);
vel1 = new b2Vec2(body.GetLinearVelocity().x, body.GetLinearVelocity().y);
vel1.Normalize();
if (Math.abs((angle1 - angle2)) > 5){
if (Math.abs((angle1 - angle2)) > 180){
if (angle1 > angle2){
angle1 = (angle1 - 360);
} else {
angle2 = (angle2 - 360);
};
};
if (angle1 > angle2){
body.ApplyImpulse(new b2Vec2((-(vel1.y) / 500), (vel1.x / 500)), body.GetWorldPoint(new b2Vec2(0, 0)));
} else {
body.ApplyImpulse(new b2Vec2((vel1.y / 500), (-(vel1.x) / 500)), body.GetWorldPoint(new b2Vec2(0, 0)));
};
};
}
}
}//package
Section 344
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 345
//MousePointer (MousePointer)
package {
import flash.display.*;
public dynamic class MousePointer extends MovieClip {
public function MousePointer(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 346
//myContactListener (myContactListener)
package {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class myContactListener extends b2ContactListener {
public var contactList:Array;
public function myContactListener(){
contactList = new Array();
super();
}
override public function Persist(_arg1:b2ContactPoint):void{
var _local2:b2Shape;
var _local3:b2Shape;
var _local4:Number;
var _local5:b2Vec2;
_local2 = _arg1.shape1;
_local3 = _arg1.shape2;
_local4 = _arg1.separation;
_local5 = _arg1.normal.Copy();
contactList.push(new myContactPoint(_local2, _local3, _local4, _local5));
}
override public function Add(_arg1:b2ContactPoint):void{
var _local2:b2Shape;
var _local3:b2Shape;
var _local4:Number;
var _local5:b2Vec2;
_local2 = _arg1.shape1;
_local3 = _arg1.shape2;
_local4 = _arg1.separation;
_local5 = _arg1.normal.Copy();
contactList.push(new myContactPoint(_local2, _local3, _local4, _local5));
}
}
}//package
Section 347
//myContactPoint (myContactPoint)
package {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
class myContactPoint {
public var separation:Number;
public var normal:b2Vec2;
public var shape1:b2Shape;
public var shape2:b2Shape;
function myContactPoint(_arg1:b2Shape, _arg2:b2Shape, _arg3:Number, _arg4:b2Vec2){
shape1 = _arg1;
shape2 = _arg2;
separation = -(_arg3);
normal = _arg4;
}
}
}//package
Section 348
//Option (Option)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class Option extends MovieClip {
public var errorMsg1:MovieClip;
var urlPlayMoreLogo:String;// = "http://www.flasharcade.com/ref.php?button=logo&game=ace048"
var requestPlayMoreLogo:URLRequest;// = null
public var quitControl:MovieClip;
private var tempString:String;
private var targetslider:String;
var urlPlayMore:String;// = "http://www.flasharcade.com/ref.php?button=more&game=ace048"
public var leftControl:MovieClip;
var requestPlayMore:URLRequest;// = null
public var restartControl:MovieClip;
private var ascii:Array;
public var duckControl:MovieClip;
public var errorMsg:MovieClip;
private var musicVol:Number;
public var jumpControl:MovieClip;
public var musicslider:SimpleButton;
public var pauseControl:MovieClip;
private var soundVol:Number;
public var tempusControl:MovieClip;
public var rightControl:MovieClip;
public var playMore:SimpleButton;
public var soundslider:SimpleButton;
public var sounditem:SimpleButton;
public var soundbar:MovieClip;
public var musicitem:SimpleButton;
private var changingKey:int;
public var musicbar:MovieClip;
public var back:SimpleButton;
public var playLogo:SimpleButton;
public function Option(){
urlPlayMore = "http://www.flasharcade.com/ref.php?button=more&game=ace048";
urlPlayMoreLogo = "http://www.flasharcade.com/ref.php?button=logo&game=ace048";
requestPlayMore = null;
requestPlayMoreLogo = null;
super();
ascii = new Array(222);
fillAscii();
requestPlayMore = new URLRequest(urlPlayMore);
requestPlayMoreLogo = new URLRequest(urlPlayMoreLogo);
}
public function changeTheKey(_arg1:KeyboardEvent){
switch (changingKey){
case 1:
tempString = getString(_arg1.keyCode);
if (tempString != null){
GParams.upCode = _arg1.keyCode;
changingKey = 0;
jumpControl.currentKey.text = tempString;
} else {
callError();
};
break;
case 2:
tempString = getString(_arg1.keyCode);
if (tempString != null){
GParams.downCode = _arg1.keyCode;
changingKey = 0;
duckControl.currentKey.text = tempString;
} else {
callError();
};
break;
case 3:
tempString = getString(_arg1.keyCode);
if (tempString != null){
GParams.leftCode = _arg1.keyCode;
changingKey = 0;
leftControl.currentKey.text = tempString;
} else {
callError();
};
break;
case 4:
tempString = getString(_arg1.keyCode);
if (tempString != null){
GParams.rightCode = _arg1.keyCode;
changingKey = 0;
rightControl.currentKey.text = tempString;
} else {
callError();
};
break;
case 5:
tempString = getString(_arg1.keyCode);
if (tempString != null){
GParams.spaceCode = _arg1.keyCode;
changingKey = 0;
tempusControl.currentKey.text = tempString;
} else {
callError();
};
break;
case 10:
tempString = getString(_arg1.keyCode);
if (tempString != null){
GParams.pauseCode = _arg1.keyCode;
changingKey = 0;
pauseControl.currentKey.text = tempString;
} else {
callError();
};
break;
case 11:
tempString = getString(_arg1.keyCode);
if (tempString != null){
GParams.quitCode = _arg1.keyCode;
changingKey = 0;
quitControl.currentKey.text = tempString;
} else {
callError();
};
break;
case 12:
tempString = getString(_arg1.keyCode);
if (tempString != null){
GParams.restartCode = _arg1.keyCode;
changingKey = 0;
restartControl.currentKey.text = tempString;
} else {
callError();
};
break;
};
MainClass.changeKey = false;
tempString = null;
}
public function init(){
gotoAndStop(1);
addEventListener(MouseEvent.CLICK, handleClick);
addEventListener(MouseEvent.ROLL_OUT, onMouseout);
musicslider.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownSlider);
soundslider.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownSlider);
musicVol = (this.parent as MainClass).soundController.musicVolume;
if ((this.parent as MainClass).soundController.isMusicOn == true){
moveSliderOnBar(musicslider, musicbar, (musicVol * musicbar.width));
} else {
moveSliderOnBar(musicslider, musicbar, 0);
};
soundVol = (this.parent as MainClass).soundController.soundVolume;
if ((this.parent as MainClass).soundController.isSoundOn == true){
moveSliderOnBar(soundslider, soundbar, (soundVol * soundbar.width));
} else {
moveSliderOnBar(soundslider, soundbar, 0);
};
this.errorMsg.gotoAndStop(1);
this.errorMsg1.gotoAndStop(1);
changingKey = 0;
jumpControl.mouseChildren = false;
duckControl.mouseChildren = false;
rightControl.mouseChildren = false;
leftControl.mouseChildren = false;
tempusControl.mouseChildren = false;
pauseControl.mouseChildren = false;
quitControl.mouseChildren = false;
restartControl.mouseChildren = false;
jumpControl.buttonMode = true;
duckControl.buttonMode = true;
rightControl.buttonMode = true;
leftControl.buttonMode = true;
tempusControl.buttonMode = true;
pauseControl.buttonMode = true;
quitControl.buttonMode = true;
restartControl.buttonMode = true;
showKeys();
}
public function getString(_arg1:uint):String{
return (ascii[_arg1]);
}
private function callError1(){
this.errorMsg1.x = -28.6;
this.errorMsg1.visible = true;
this.errorMsg1.gotoAndPlay(2);
showKeys();
}
public function removeAllListener(){
removeEventListener(MouseEvent.CLICK, handleClick);
removeEventListener(MouseEvent.ROLL_OUT, onMouseout);
}
public function handleClick(_arg1:MouseEvent){
var soundVol:Number;
var msx:int;
var musicVol:Number;
var event = _arg1;
if (event.target.name == "back"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
if (noProblems()){
(this.parent as MainClass).removeOptions();
MainClass.pauseFlag = !(MainClass.pauseFlag);
removeAllListener();
MainClass.changeKey = false;
} else {
callError1();
};
} else {
if (event.target.name == "playMore"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:SecurityError) {
};
} else {
if (event.target.name == "playLogo"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
try {
navigateToURL(requestPlayMoreLogo, "_blank");
} catch(e:SecurityError) {
};
} else {
if (event.target.name == "sounditem"){
(this.parent as MainClass).soundController.toggleSound();
if ((this.parent as MainClass).soundController.isSoundOn == true){
soundVol = (this.parent as MainClass).soundController.soundVolume;
msx = (soundVol * soundbar.width);
moveSliderOnBar(soundslider, soundbar, msx);
} else {
moveSliderOnBar(soundslider, soundbar, 0);
};
} else {
if (event.target.name == "musicitem"){
(this.parent as MainClass).soundController.toggleMusic();
if ((this.parent as MainClass).soundController.isMusicOn == true){
musicVol = (this.parent as MainClass).soundController.musicVolume;
msx = (musicVol * musicbar.width);
moveSliderOnBar(musicslider, musicbar, msx);
} else {
moveSliderOnBar(musicslider, musicbar, 0);
};
} else {
switch (event.target.name){
case "jumpControl":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
jumpControl.currentKey.text = "";
changingKey = 1;
MainClass.changeKey = true;
break;
case "duckControl":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
duckControl.currentKey.text = "";
changingKey = 2;
MainClass.changeKey = true;
break;
case "leftControl":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
leftControl.currentKey.text = "";
changingKey = 3;
MainClass.changeKey = true;
break;
case "rightControl":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
rightControl.currentKey.text = "";
changingKey = 4;
MainClass.changeKey = true;
break;
case "tempusControl":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
tempusControl.currentKey.text = "";
changingKey = 5;
MainClass.changeKey = true;
break;
case "pauseControl":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
pauseControl.currentKey.text = "";
changingKey = 10;
MainClass.changeKey = true;
break;
case "quitControl":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
quitControl.currentKey.text = "";
changingKey = 11;
MainClass.changeKey = true;
break;
case "restartControl":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
restartControl.currentKey.text = "";
changingKey = 12;
MainClass.changeKey = true;
break;
};
};
};
};
};
};
}
private function callError(){
this.errorMsg.x = -28.6;
this.errorMsg.visible = true;
this.errorMsg.gotoAndPlay(2);
showKeys();
}
private function fillAscii(){
ascii[65] = "A";
ascii[66] = "B";
ascii[67] = "C";
ascii[68] = "D";
ascii[69] = "E";
ascii[70] = "F";
ascii[71] = "G";
ascii[72] = "H";
ascii[73] = "I";
ascii[74] = "J";
ascii[75] = "K";
ascii[76] = "L";
ascii[77] = "M";
ascii[78] = "N";
ascii[79] = "O";
ascii[80] = "P";
ascii[81] = "Q";
ascii[82] = "R";
ascii[83] = "S";
ascii[84] = "T";
ascii[85] = "U";
ascii[86] = "V";
ascii[87] = "W";
ascii[88] = "X";
ascii[89] = "Y";
ascii[90] = "Z";
ascii[48] = "0";
ascii[49] = "1";
ascii[50] = "2";
ascii[51] = "3";
ascii[52] = "4";
ascii[53] = "5";
ascii[54] = "6";
ascii[55] = "7";
ascii[56] = "8";
ascii[57] = "9";
ascii[32] = "Spacebar";
ascii[17] = "Ctrl";
ascii[16] = "Shift";
ascii[192] = "~";
ascii[96] = "Numpad 0";
ascii[97] = "Numpad 1";
ascii[98] = "Numpad 2";
ascii[99] = "Numpad 3";
ascii[100] = "Numpad 4";
ascii[101] = "Numpad 5";
ascii[102] = "Numpad 6";
ascii[103] = "Numpad 7";
ascii[104] = "Numpad 8";
ascii[105] = "Numpad 9";
ascii[111] = "Numpad /";
ascii[106] = "Numpad *";
ascii[109] = "Numpad -";
ascii[107] = "Numpad +";
ascii[110] = "Numpad .";
ascii[45] = "Insert";
ascii[46] = "Delete";
ascii[33] = "Page Up";
ascii[34] = "Page Down";
ascii[35] = "End";
ascii[36] = "Home";
ascii[112] = "F1";
ascii[113] = "F2";
ascii[114] = "F3";
ascii[115] = "F4";
ascii[116] = "F5";
ascii[117] = "F6";
ascii[118] = "F7";
ascii[119] = "F8";
ascii[188] = ",";
ascii[190] = ".";
ascii[186] = ";";
ascii[222] = "'";
ascii[219] = "[";
ascii[221] = "]";
ascii[189] = "-";
ascii[187] = "+";
ascii[220] = "\\";
ascii[191] = "/";
ascii[9] = "TAB";
ascii[8] = "Backspace";
}
public function showKeys(){
jumpControl.currentKey.text = getString(GParams.upCode);
duckControl.currentKey.text = getString(GParams.downCode);
leftControl.currentKey.text = getString(GParams.leftCode);
rightControl.currentKey.text = getString(GParams.rightCode);
tempusControl.currentKey.text = getString(GParams.spaceCode);
pauseControl.currentKey.text = getString(GParams.pauseCode);
quitControl.currentKey.text = getString(GParams.quitCode);
restartControl.currentKey.text = getString(GParams.restartCode);
}
function onMouseUpSlider(_arg1:MouseEvent){
targetslider = null;
removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveSlider);
removeEventListener(MouseEvent.MOUSE_UP, onMouseUpSlider);
}
private function onMouseout(_arg1:MouseEvent){
onMouseUpSlider(_arg1);
}
private function noProblems():Boolean{
var _local1:Array;
var _local2:uint;
var _local3:uint;
_local1 = new Array(GParams.upCode, GParams.downCode, GParams.leftCode, GParams.rightCode, GParams.spaceCode, GParams.quitCode, GParams.pauseCode, GParams.restartCode);
_local2 = 0;
while (_local2 <= (_local1.length - 1)) {
_local3 = (_local2 + 1);
while (_local3 <= _local1.length) {
if (_local1[_local2] == _local1[_local3]){
return (false);
};
_local3++;
};
_local2++;
};
return (true);
}
function moveSliderOnBar(_arg1:SimpleButton, _arg2:MovieClip, _arg3:int){
if (_arg3 < 6){
_arg1.x = (_arg2.x + 6);
} else {
if (_arg3 > (_arg2.width - 6)){
_arg1.x = ((_arg2.x + _arg2.width) - 6);
} else {
_arg1.x = (_arg2.x + _arg3);
};
};
}
function onMouseMoveSlider(_arg1:MouseEvent){
if ((((this.parent == null)) || (((this.parent is MainClass) == false)))){
return;
};
if (targetslider == "musicslider"){
moveSliderOnBar(musicslider, musicbar, musicbar.mouseX);
(this.parent as MainClass).soundController.setMusicVolume(((musicbar.mouseX * 100) / musicbar.width));
} else {
moveSliderOnBar(soundslider, soundbar, soundbar.mouseX);
(this.parent as MainClass).soundController.setSoundVolume(((soundbar.mouseX * 100) / musicbar.width));
};
}
private function onMouseDownSlider(_arg1:MouseEvent){
var _local2:int;
targetslider = _arg1.target.name;
if (_arg1.target.name == "musicslider"){
musicslider.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseDownSlider);
_local2 = musicbar.mouseX;
musicslider.x = (musicbar.mouseX + musicbar.x);
addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveSlider);
addEventListener(MouseEvent.MOUSE_UP, onMouseUpSlider);
moveSliderOnBar(musicslider, musicbar, musicbar.mouseX);
} else {
soundslider.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseDownSlider);
_local2 = soundbar.mouseX;
soundslider.x = (soundbar.mouseX + soundbar.x);
addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveSlider);
addEventListener(MouseEvent.MOUSE_UP, onMouseUpSlider);
moveSliderOnBar(soundslider, soundbar, soundbar.mouseX);
};
}
}
}//package
Section 349
//Particle (Particle)
package {
import flash.display.*;
public dynamic class Particle extends MovieClip {
public function Particle(){
addFrameScript(19, frame20, 20, frame21);
}
function frame20(){
gotoAndPlay(1);
}
function frame21(){
stop();
}
}
}//package
Section 350
//Peacekeeper (Peacekeeper)
package {
import flash.display.*;
public dynamic class Peacekeeper extends MovieClip {
public var die:MovieClip;
public var still:MovieClip;
public var duck:MovieClip;
public var walk:MovieClip;
public function Peacekeeper(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 351
//PeacekeeperObject (PeacekeeperObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.geom.*;
public class PeacekeeperObject extends EnemyObject {
private var duckStatus:Number;// = 0
private var STATUS_DEATH2:uint;// = 6
private var shootPoint:Point;
public var head:b2Shape;
private var STATUS_DUCK:uint;// = 4
private var shootAngle:Number;
private var found1:Boolean;// = false
public function PeacekeeperObject(){
duckStatus = 0;
STATUS_DUCK = 4;
STATUS_DEATH2 = 6;
found1 = false;
super();
}
override protected function shoot(){
if (actorWorld == null){
actorWorld = body.GetWorld();
};
if ((graphic as MovieClip).currentFrame == 1){
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.gun != null){
(graphic as MovieClip).still.gun.rotation = ((-(shootAngle) * 180) / Math.PI);
shootPoint = (graphic as MovieClip).still.gun.localToGlobal(new Point((graphic as MovieClip).still.gun.gunPoint.x, (graphic as MovieClip).still.gun.gunPoint.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
if ((graphic as MovieClip).still.gun.currentFrame == 1){
(graphic as MovieClip).still.gun.gotoAndPlay(2);
};
};
};
};
if ((graphic as MovieClip).currentFrame == 4){
if ((graphic as MovieClip).duck != null){
if ((graphic as MovieClip).duck.gun != null){
(graphic as MovieClip).duck.gun.rotation = ((-(shootAngle) * 180) / Math.PI);
shootPoint = (graphic as MovieClip).duck.gun.localToGlobal(new Point((graphic as MovieClip).duck.gun.gunPoint.x, (graphic as MovieClip).duck.gun.gunPoint.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
if ((graphic as MovieClip).duck.gun.currentFrame == 1){
(graphic as MovieClip).duck.gun.gotoAndPlay(2);
};
};
};
};
if (shootPoint == null){
return;
};
bulletSpeed = 5;
bulletSD = new b2PolygonDef();
bulletBD = new b2BodyDef();
if (graphic.scaleX > 0){
bulletBD.position.Set(((shootPoint.x + 10) / GParams.physScale), (shootPoint.y / GParams.physScale));
} else {
bulletBD.position.Set(((shootPoint.x - 10) / GParams.physScale), (shootPoint.y / GParams.physScale));
};
bulletBD.isBullet = true;
bulletSD.density = 0.1;
bulletBD.linearDamping = 0;
bulletObject = (graphic.parent as Container).getBullet();
bulletObject.damage = (bulletObject.damage * 1.5);
bulletSD.SetAsBox(((bulletObject.graphic.width / 2) / GParams.physScale), ((bulletObject.graphic.height / 2) / GParams.physScale));
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
bulletSD.filter.categoryBits = (4 | 2);
bulletSD.filter.maskBits = (4 | 2);
bulletB.CreateShape(bulletSD);
bulletObject.init(bulletB);
bulletB.SetMassFromShapes();
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).worldArray.push(bulletObject);
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_GUN1);
};
};
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetAntiGravity(true);
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
bulletSD = null;
bulletB = null;
bulletObject = null;
shootPoint = null;
}
override protected function setFrame(){
graphic.scaleX = turn;
if (maxVel.x != 0){
charStatus = STATUS_WALK;
} else {
if ((((duckStatus <= 400)) && ((duckStatus >= 300)))){
charStatus = STATUS_DUCK;
} else {
charStatus = STATUS_STILL;
};
};
if (health <= 0){
if ((((charStatus == STATUS_DUCK)) || ((charStatus == STATUS_DEATH2)))){
charStatus = STATUS_DEATH2;
} else {
charStatus = STATUS_DEATH;
};
};
switch (charStatus){
case STATUS_WALK:
if ((graphic as MovieClip).currentFrame != 2){
(graphic as MovieClip).gotoAndStop(2);
};
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.stop();
};
} else {
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.play();
};
};
};
break;
case STATUS_STILL:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.gun != null){
};
};
break;
case STATUS_DUCK:
if ((graphic as MovieClip).currentFrame != 4){
(graphic as MovieClip).gotoAndStop(4);
};
if ((graphic as MovieClip).duck != null){
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
if ((graphic as MovieClip).duck != null){
(graphic as MovieClip).duck.stop();
};
} else {
if ((graphic as MovieClip).duck != null){
if ((graphic as MovieClip).duck.currentFrame != 22){
(graphic as MovieClip).duck.play();
};
};
};
};
};
break;
case STATUS_DEATH:
if ((graphic as MovieClip).currentFrame != 3){
(graphic as MovieClip).gotoAndStop(3);
};
case STATUS_DEATH2:
if ((graphic as MovieClip).currentFrame != 5){
(graphic as MovieClip).gotoAndStop(5);
};
break;
};
}
override public function update(){
super.update();
setFrame();
}
override public function resetFrames(){
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.gun != null){
(graphic as MovieClip).still.gun.gotoAndStop(1);
};
};
}
override public function move(){
vel = this.body.GetLinearVelocity();
think();
if (charStatus == STATUS_DUCK){
head.m_isSensor = true;
} else {
head.m_isSensor = false;
};
if (body.IsSleeping()){
body.WakeUp();
};
vel.Set(maxVel.x, 0);
}
override public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
shootAngle = Math.atan2(Math.abs((graphic.y - _arg3)), Math.abs((graphic.x - _arg2)));
if ((((((shootAngle > (Math.PI / 2.5))) && ((graphic.y > _arg3)))) && ((_arg3 > (graphic.y - 100))))){
found1 = true;
} else {
found1 = false;
};
if (((((_arg1) && ((shootAngle < (Math.PI / 5))))) || (found1))){
alertStatus = true;
alertness = 90;
if (shootStatus == 0){
shootStatus = 20;
};
if (_arg2 > graphic.x){
graphic.scaleX = GParams.RIGHT;
} else {
graphic.scaleX = GParams.LEFT;
};
turn = graphic.scaleX;
takeTurn = turn;
if (((!((charStatus == STATUS_DUCK))) && ((duckStatus <= 0)))){
if (Math.random() > 0.5){
duckStatus = 400;
};
};
if ((((((shootStatus == 20)) && (!((charStatus == STATUS_DUCK))))) || ((((duckStatus == 380)) && ((charStatus == STATUS_DUCK)))))){
if (_arg3 < (graphic.y - 15)){
shootAngle = (shootAngle * -1);
} else {
shootAngle = (shootAngle + 0.1);
};
shoot();
};
shootStatus--;
} else {
if (alertness > 0){
shootStatus = 5;
alertness--;
};
if (alertness == 0){
alertStatus = false;
shootStatus = 0;
};
};
duckStatus--;
}
override protected function think(){
if (!alertStatus){
if (turn != takeTurn){
if (wait == 0){
wait = 60;
};
if (wait > 1){
wait--;
} else {
turn = takeTurn;
wait = 0;
};
maxVel.Set(0, 0);
} else {
maxVel.Set((turn * 2.5), 0);
wait = 0;
};
} else {
maxVel.Set(0, 0);
};
}
}
}//package
Section 352
//PGuard (PGuard)
package {
import flash.display.*;
public dynamic class PGuard extends MovieClip {
public var still:MovieClip;
public function PGuard(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package
Section 353
//Phobos (Phobos)
package {
import flash.display.*;
public dynamic class Phobos extends MovieClip {
public var hurt:MovieClip;
public var death:MovieClip;
public var still:MovieClip;
public var walk:MovieClip;
public var whip:MovieClip;
public function Phobos(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 354
//PhobosObject (PhobosObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.geom.*;
public class PhobosObject extends SemiBossObject {
private var shooting:Boolean;// = false
private var shootPoint:Point;
protected var STATUS_WHIP:uint;// = 4
private var shootAngle:Number;
public function PhobosObject(){
STATUS_WHIP = 4;
shooting = false;
super();
}
override protected function shoot(){
whiping = false;
shooting = true;
if (actorWorld == null){
actorWorld = body.GetWorld();
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.gun != null){
(graphic as MovieClip).still.gun.rotation = ((-(shootAngle) * 180) / Math.PI);
shootPoint = (graphic as MovieClip).still.gun.localToGlobal(new Point((graphic as MovieClip).still.gun.gunPoint.x, (graphic as MovieClip).still.gun.gunPoint.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
};
};
if (shootPoint == null){
return;
};
bulletSpeed = 5;
bulletSD = new b2PolygonDef();
bulletBD = new b2BodyDef();
if (graphic.scaleX > 0){
bulletBD.position.Set(((shootPoint.x + 10) / GParams.physScale), (shootPoint.y / GParams.physScale));
} else {
bulletBD.position.Set(((shootPoint.x - 10) / GParams.physScale), (shootPoint.y / GParams.physScale));
};
bulletBD.isBullet = true;
bulletSD.density = 0.1;
bulletBD.linearDamping = 0;
bulletObject = (graphic.parent as Container).getBullet(4);
bulletSD.SetAsBox((((3 * bulletObject.graphic.width) / 4) / GParams.physScale), (((3 * bulletObject.graphic.height) / 4) / GParams.physScale));
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
bulletSD.filter.categoryBits = 2;
bulletSD.filter.maskBits = 4;
bulletB.CreateShape(bulletSD);
bulletObject.init(bulletB);
bulletB.SetMassFromShapes();
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).worldArray.push(bulletObject);
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetAntiGravity(true);
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
bulletSD = null;
bulletB = null;
bulletObject = null;
shootPoint = null;
}
override protected function setFrame(){
graphic.scaleX = turn;
if (maxVel.x != 0){
charStatus = STATUS_WALK;
} else {
charStatus = STATUS_STILL;
};
if (whiping){
charStatus = STATUS_WHIP;
};
if (hurt > 0){
charStatus = STATUS_HURT;
};
if (health <= 0){
charStatus = STATUS_DEATH;
};
switch (charStatus){
case STATUS_WALK:
if ((graphic as MovieClip).currentFrame != 3){
(graphic as MovieClip).gotoAndStop(3);
};
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.stop();
if ((graphic as MovieClip).walk.phoboLeg != null){
if ((graphic as MovieClip).walk.phoboLeg.phoboLeg1 != null){
(graphic as MovieClip).walk.phoboLeg.phoboLeg1.stop();
};
if ((graphic as MovieClip).walk.phoboLeg.phoboLeg2 != null){
(graphic as MovieClip).walk.phoboLeg.phoboLeg2.stop();
};
};
if ((graphic as MovieClip).walk.hand1 != null){
(graphic as MovieClip).walk.hand1.stop();
};
};
} else {
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.play();
if ((graphic as MovieClip).walk.phoboLeg != null){
if ((graphic as MovieClip).walk.phoboLeg.phoboLeg1 != null){
(graphic as MovieClip).walk.phoboLeg.phoboLeg1.play();
};
if ((graphic as MovieClip).walk.phoboLeg.phoboLeg2 != null){
(graphic as MovieClip).walk.phoboLeg.phoboLeg2.play();
};
};
if ((graphic as MovieClip).walk.hand1 != null){
(graphic as MovieClip).walk.hand1.play();
};
};
};
};
break;
case STATUS_STILL:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
if ((graphic as MovieClip).still != null){
(graphic as MovieClip).still.stop();
};
} else {
if ((graphic as MovieClip).still != null){
(graphic as MovieClip).still.play();
if ((graphic as MovieClip).still.currentFrame == 27){
if (shootStatus >= 120){
(graphic as MovieClip).still.gotoAndPlay(29);
(graphic as MovieClip).still.gun.gotoAndPlay(1);
};
};
};
};
};
break;
case STATUS_WHIP:
if ((graphic as MovieClip).currentFrame != 2){
(graphic as MovieClip).gotoAndStop(2);
};
if ((graphic as MovieClip).whip != null){
if ((graphic as MovieClip).whip.currentFrame == (graphic as MovieClip).whip.totalFrames){
whiping = false;
(graphic as MovieClip).whip.gotoAndStop(1);
};
};
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
if ((graphic as MovieClip).whip != null){
(graphic as MovieClip).whip.stop();
};
} else {
if ((graphic as MovieClip).whip != null){
(graphic as MovieClip).whip.play();
};
};
};
break;
case STATUS_HURT:
if ((graphic as MovieClip).currentFrame != 4){
(graphic as MovieClip).gotoAndStop(4);
};
case STATUS_DEATH:
if ((graphic as MovieClip).currentFrame != 5){
(graphic as MovieClip).gotoAndStop(5);
};
break;
};
}
override public function whipped():Boolean{
if (((((graphic as MovieClip).currentFrame == 2)) && (!((graphic.parent as Container).Tempus)))){
if (((((graphic as MovieClip).whip.currentFrame <= 51)) && (((graphic as MovieClip).whip.currentFrame >= 47)))){
return (true);
};
};
return (false);
}
private function whip(){
whiping = true;
}
override public function update(){
super.update();
if (hurt > 0){
hurt--;
};
if (currHealth > health){
hurt = 10;
currHealth = health;
};
setFrame();
}
override public function move(){
vel = this.body.GetLinearVelocity();
think();
if (body.IsSleeping()){
body.WakeUp();
};
vel.Set(maxVel.x, 0);
}
override public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
if (_arg1){
shootAngle = Math.atan2(Math.abs((graphic.y - _arg3)), Math.abs((graphic.x - _arg2)));
if (_arg2 > graphic.x){
graphic.scaleX = GParams.RIGHT;
} else {
graphic.scaleX = GParams.LEFT;
};
turn = graphic.scaleX;
if (_arg3 < graphic.y){
shootAngle = (shootAngle * -1);
};
if (Math.abs((_arg2 - graphic.x)) > range){
alertStatus = false;
} else {
alertStatus = true;
};
if (whippable){
whip();
whippable = false;
} else {
if ((((((shootStatus > 10)) && ((charStatus == STATUS_STILL)))) && (!(((graphic as MovieClip).still == null))))){
if ((graphic as MovieClip).still.currentFrame == 10){
shoot();
shootStatus = 0;
};
};
};
shootStatus++;
} else {
if (whippable){
whip();
whippable = false;
alertStatus = true;
} else {
if (((((_arg2 - 50) > graphic.x)) && ((graphic.scaleX == GParams.LEFT)))){
graphic.scaleX = GParams.RIGHT;
} else {
if (((((_arg2 + 50) < graphic.x)) && ((graphic.scaleX == GParams.RIGHT)))){
graphic.scaleX = GParams.LEFT;
};
};
turn = graphic.scaleX;
alertStatus = false;
};
};
}
override protected function think(){
if (!alertStatus){
maxVel.Set((turn * 3), 0);
} else {
maxVel.Set(0, 0);
};
}
}
}//package
Section 355
//Piston (Piston)
package {
import flash.display.*;
public dynamic class Piston extends MovieClip {
}
}//package
Section 356
//PistonHead (PistonHead)
package {
import flash.display.*;
public dynamic class PistonHead extends MovieClip {
}
}//package
Section 357
//PistonHeadObject (PistonHeadObject)
package {
public class PistonHeadObject extends GameObject {
}
}//package
Section 358
//PistonObject (PistonObject)
package {
public class PistonObject extends GameObject {
}
}//package
Section 359
//Pit (Pit)
package {
import flash.display.*;
public dynamic class Pit extends MovieClip {
}
}//package
Section 360
//Platform (Platform)
package {
import flash.display.*;
public dynamic class Platform extends MovieClip {
}
}//package
Section 361
//Platform1 (Platform1)
package {
import flash.display.*;
public dynamic class Platform1 extends BitmapData {
public function Platform1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 362
//Platform2 (Platform2)
package {
import flash.display.*;
public dynamic class Platform2 extends BitmapData {
public function Platform2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 363
//Platform4 (Platform4)
package {
import flash.display.*;
public dynamic class Platform4 extends BitmapData {
public function Platform4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 364
//Platform5 (Platform5)
package {
import flash.display.*;
public dynamic class Platform5 extends BitmapData {
public function Platform5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 365
//PowerupObject (PowerupObject)
package {
public class PowerupObject extends GameObject {
}
}//package
Section 366
//PowerupSound (PowerupSound)
package {
public dynamic class PowerupSound extends CustomSound {
}
}//package
Section 367
//PraetorianGuardObject (PraetorianGuardObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class PraetorianGuardObject extends PraetorianObject {
public var diveStatus:Number;// = 0
private var STATUS_DIVE:uint;// = 11
private var movingRight:Boolean;
private var movingLeft:Boolean;
private var heroPosX:Number;
private var heroPosY:Number;
private var shootAngle:Number;
public function PraetorianGuardObject(){
diveStatus = 0;
STATUS_DIVE = 11;
super();
}
override protected function setFrame(){
if (maxVel.x > 0){
graphic.scaleX = 1;
} else {
graphic.scaleX = -1;
};
if (maxVel.x != 0){
charStatus = STATUS_WALK;
} else {
charStatus = STATUS_STILL;
};
if (diveStatus == 2){
charStatus = STATUS_DIVE;
};
if (health <= 0){
charStatus = STATUS_DEATH;
};
switch (charStatus){
case STATUS_WALK:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
(graphic as MovieClip).still.stop();
} else {
(graphic as MovieClip).still.play();
};
};
};
break;
case STATUS_STILL:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
(graphic as MovieClip).still.stop();
} else {
(graphic as MovieClip).still.play();
};
};
};
break;
case STATUS_DIVE:
if ((graphic as MovieClip).currentFrame != 2){
(graphic as MovieClip).gotoAndStop(2);
};
break;
case STATUS_DEATH:
if ((graphic as MovieClip).currentFrame != 3){
(graphic as MovieClip).gotoAndStop(3);
};
};
}
override public function reSet(){
maxVel.Set(0, 0);
diveStatus = 0;
}
private function touchUser(){
if (maxVel.x <= 0){
if ((heroPosX - 20) > graphic.x){
maxVel.x = 1;
} else {
maxVel.x = -1;
};
} else {
if (maxVel.x > 0){
if ((heroPosX + 20) < graphic.x){
maxVel.x = -1;
} else {
maxVel.x = 1;
};
};
};
if (maxVel.y > 0){
if ((heroPosY + 10) > graphic.y){
if (maxVel.y < 1){
maxVel.Add(new b2Vec2(0, 1));
};
} else {
if (maxVel.y > -1){
maxVel.Add(new b2Vec2(0, -1));
};
};
} else {
if (maxVel.y <= 0){
if ((heroPosY - 20) < graphic.y){
if (maxVel.y > -1){
maxVel.Add(new b2Vec2(0, -1));
};
} else {
if (maxVel.y < 1){
maxVel.Add(new b2Vec2(0, 1));
};
};
};
};
}
override public function update(){
super.update();
setFrame();
}
override public function resetFrames(){
if ((graphic as MovieClip).still != null){
(graphic as MovieClip).still.gotoAndStop(1);
};
}
override public function move(){
vel = this.body.GetLinearVelocity();
think();
if (body.IsSleeping()){
body.WakeUp();
};
vel.Set(maxVel.x, maxVel.y);
}
override public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
heroPosX = _arg2;
heroPosY = _arg3;
if (_arg1){
if (diveStatus == 0){
alertStatus = true;
if (graphic.y < (_arg3 - 200)){
diveStatus = 1;
} else {
diveStatus = 3;
};
} else {
if ((((diveStatus == 1)) || ((diveStatus == 3)))){
if (((((_arg2 - 20) < graphic.x)) && (((_arg2 + 20) > graphic.x)))){
if ((((graphic.y > (_arg3 - 200))) && ((graphic.y < _arg3)))){
diveStatus = 2;
};
};
} else {
if (diveStatus == 2){
if (((((((((_arg2 - 20) < graphic.x)) && (((_arg2 + 20) > graphic.x)))) && ((graphic.y > (_arg3 - 200))))) && ((graphic.y < _arg3)))){
diveStatus = 2;
} else {
diveStatus = 5;
};
};
};
};
} else {
if (diveStatus == 2){
diveStatus = 5;
} else {
alertStatus = false;
};
};
}
private function gotoUser(){
if (maxVel.x == 0){
movingLeft = true;
movingRight = false;
};
if (movingLeft){
if ((heroPosX - 75) < graphic.x){
movingLeft = true;
movingRight = false;
} else {
movingLeft = false;
movingRight = true;
};
};
if (movingRight){
if ((heroPosX + 75) > graphic.x){
movingLeft = false;
movingRight = true;
} else {
movingLeft = true;
movingRight = false;
};
};
if (movingLeft){
maxVel.x = -2;
};
if (movingRight){
maxVel.x = 2;
};
maxVel.y = 1;
}
override protected function think(){
range = 600;
if (!alertStatus){
goBack();
} else {
if (diveStatus == 1){
gotoUser();
} else {
if (diveStatus == 2){
if (maxVel.y < 10){
maxVel.Add(new b2Vec2(0, 2));
};
return;
} else {
if (diveStatus == 3){
touchUser();
} else {
if (diveStatus == 4){
goBack();
} else {
if (diveStatus == 5){
if (maxVel.y > 1){
maxVel.Add(new b2Vec2(0, -1));
return;
};
diveStatus = 4;
};
};
};
};
};
};
}
private function goBack(){
if (startPoint.x > (graphic.x + 4)){
if (maxVel.x < 1){
maxVel.Add(new b2Vec2(1, 0));
};
} else {
if (startPoint.x < graphic.x){
if (maxVel.x > -1){
maxVel.Add(new b2Vec2(-1, 0));
};
} else {
maxVel.x = 0;
};
};
if (startPoint.y > graphic.y){
if (maxVel.y < 1){
maxVel.Add(new b2Vec2(0, 1));
};
} else {
if (startPoint.y < graphic.y){
if (maxVel.y > -1){
maxVel.Add(new b2Vec2(0, -1));
};
} else {
maxVel.y = 0;
};
};
if ((((Math.abs((startPoint.x - graphic.x)) < 5)) && ((Math.abs((startPoint.y - graphic.y)) < 5)))){
diveStatus = 0;
} else {
diveStatus = 4;
};
}
}
}//package
Section 368
//PraetorianObject (PraetorianObject)
package {
import flash.geom.*;
public class PraetorianObject extends EnemyObject {
public var hoverHeight:Number;
public var startPoint:Point;
public function reSet(){
}
}
}//package
Section 369
//PraetorianUmbraObject (PraetorianUmbraObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class PraetorianUmbraObject extends PraetorianObject {
public var diveStatus:Number;// = 0
private var STATUS_DIVE:uint;// = 11
private var movingRight:Boolean;
private var movingLeft:Boolean;
private var heroPosX:Number;
private var heroPosY:Number;
private var shootAngle:Number;
public function PraetorianUmbraObject(){
diveStatus = 0;
STATUS_DIVE = 11;
super();
}
override protected function setFrame(){
if (maxVel.x > 0){
graphic.scaleX = 1;
} else {
graphic.scaleX = -1;
};
if (maxVel.x != 0){
charStatus = STATUS_WALK;
} else {
charStatus = STATUS_STILL;
};
if (diveStatus == 2){
charStatus = STATUS_DIVE;
};
if (health <= 0){
charStatus = STATUS_DEATH;
};
switch (charStatus){
case STATUS_WALK:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
if (graphic.parent != null){
if (!(graphic.parent as Container).Tempus){
(graphic as MovieClip).still.stop();
} else {
(graphic as MovieClip).still.play();
};
};
};
break;
case STATUS_STILL:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
if (graphic.parent != null){
if (!(graphic.parent as Container).Tempus){
(graphic as MovieClip).still.stop();
} else {
(graphic as MovieClip).still.play();
};
};
};
break;
case STATUS_DIVE:
if ((graphic as MovieClip).currentFrame != 2){
(graphic as MovieClip).gotoAndStop(2);
};
break;
case STATUS_DEATH:
if ((graphic as MovieClip).currentFrame != 3){
(graphic as MovieClip).gotoAndStop(3);
};
};
}
override public function reSet(){
maxVel.Set(0, 0);
diveStatus = 0;
}
private function touchUser(){
if (maxVel.x <= 0){
if ((heroPosX - 20) > graphic.x){
maxVel.x = 1;
} else {
maxVel.x = -1;
};
} else {
if (maxVel.x > 0){
if ((heroPosX + 20) < graphic.x){
maxVel.x = -1;
} else {
maxVel.x = 1;
};
};
};
if (maxVel.y > 0){
if ((heroPosY + 10) > graphic.y){
if (maxVel.y < 1){
maxVel.Add(new b2Vec2(0, 1));
};
} else {
if (maxVel.y > -1){
maxVel.Add(new b2Vec2(0, -1));
};
};
} else {
if (maxVel.y <= 0){
if ((heroPosY - 20) < graphic.y){
if (maxVel.y > -1){
maxVel.Add(new b2Vec2(0, -1));
};
} else {
if (maxVel.y < 1){
maxVel.Add(new b2Vec2(0, 1));
};
};
};
};
}
override public function update(){
super.update();
setFrame();
}
override public function resetFrames(){
if ((graphic as MovieClip).still != null){
(graphic as MovieClip).still.gotoAndStop(1);
};
}
override public function move(){
vel = this.body.GetLinearVelocity();
think();
if (body.IsSleeping()){
body.WakeUp();
};
vel.Set(maxVel.x, maxVel.y);
}
override public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
heroPosX = _arg2;
heroPosY = _arg3;
if (_arg1){
if (diveStatus == 0){
alertStatus = true;
if (graphic.y < (_arg3 - 200)){
diveStatus = 1;
} else {
diveStatus = 3;
};
} else {
if ((((diveStatus == 1)) || ((diveStatus == 3)))){
if (((((_arg2 - 20) < graphic.x)) && (((_arg2 + 20) > graphic.x)))){
if ((((graphic.y > (_arg3 - 200))) && ((graphic.y < _arg3)))){
diveStatus = 2;
};
};
} else {
if (diveStatus == 2){
if (((((((((_arg2 - 20) < graphic.x)) && (((_arg2 + 20) > graphic.x)))) && ((graphic.y > (_arg3 - 200))))) && ((graphic.y < _arg3)))){
diveStatus = 2;
} else {
diveStatus = 5;
};
};
};
};
} else {
if (diveStatus == 2){
diveStatus = 5;
} else {
alertStatus = false;
};
};
}
private function gotoUser(){
if (maxVel.x == 0){
movingLeft = true;
movingRight = false;
};
if (movingLeft){
if ((heroPosX - 75) < graphic.x){
movingLeft = true;
movingRight = false;
} else {
movingLeft = false;
movingRight = true;
};
};
if (movingRight){
if ((heroPosX + 75) > graphic.x){
movingLeft = false;
movingRight = true;
} else {
movingLeft = true;
movingRight = false;
};
};
if (movingLeft){
maxVel.x = -2;
};
if (movingRight){
maxVel.x = 2;
};
maxVel.y = 1;
}
override protected function think(){
range = 600;
if (!alertStatus){
goBack();
} else {
if (diveStatus == 1){
gotoUser();
} else {
if (diveStatus == 2){
if (maxVel.y < 10){
maxVel.Add(new b2Vec2(0, 2));
};
return;
} else {
if (diveStatus == 3){
touchUser();
} else {
if (diveStatus == 4){
goBack();
} else {
if (diveStatus == 5){
if (maxVel.y > 1){
maxVel.Add(new b2Vec2(0, -1));
return;
};
diveStatus = 4;
};
};
};
};
};
};
}
private function goBack(){
if (startPoint.x > (graphic.x + 4)){
if (maxVel.x < 1){
maxVel.Add(new b2Vec2(1, 0));
};
} else {
if (startPoint.x < graphic.x){
if (maxVel.x > -1){
maxVel.Add(new b2Vec2(-1, 0));
};
} else {
maxVel.x = 0;
};
};
if (startPoint.y > graphic.y){
if (maxVel.y < 1){
maxVel.Add(new b2Vec2(0, 1));
};
} else {
if (startPoint.y < graphic.y){
if (maxVel.y > -1){
maxVel.Add(new b2Vec2(0, -1));
};
} else {
maxVel.y = 0;
};
};
if ((((Math.abs((startPoint.x - graphic.x)) < 5)) && ((Math.abs((startPoint.y - graphic.y)) < 5)))){
diveStatus = 0;
} else {
diveStatus = 4;
};
}
}
}//package
Section 370
//Preloader (Preloader)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import CPMStar.*;
import flash.net.*;
public class Preloader extends MovieClip {
public var mainLoader:MovieClip;
var button:StartButton;// = null
var urlPlayMore:String;// = "http://www.flasharcade.com/ref.php?button=logo&game=ace048"
var timer:Timer;
var requestPlayMore:URLRequest;// = null
var queryStrings;
public var adBox:MovieClip;
var customLevel:Boolean;// = false
public var logo:SimpleButton;
var CPMStarSubPoolID:int;// = 22
var CPMStarPoolID:int;// = 2299
public static const startFrame:Number = 4;
public static const mainClass:String = "MainClass";
public function Preloader(){
var ad:DisplayObject;
requestPlayMore = null;
urlPlayMore = "http://www.flasharcade.com/ref.php?button=logo&game=ace048";
customLevel = false;
CPMStarPoolID = 2299;
CPMStarSubPoolID = 22;
button = null;
addFrameScript(2, frame3, 3, frame4);
stop();
super();
try {
ad = AdLoader.LoadAd(CPMStarPoolID, CPMStarSubPoolID);
adBox.addChild(ad);
} catch(se:SecurityError) {
trace(" error");
};
requestPlayMore = new URLRequest(urlPlayMore);
mainLoader.percentbar.scaleX = 0;
timer = new Timer(100, 0);
timer.addEventListener(TimerEvent.TIMER, afterSecond);
timer.start();
logo.addEventListener(MouseEvent.CLICK, handleClick);
customLevel = isCustomLevel();
if (customLevel){
GParams.loadCustomLevel = false;
loadCustomLevel();
};
}
private function isCustomLevel():Boolean{
try {
queryStrings = this.loaderInfo.parameters;
} catch(e:Error) {
return (false);
};
if (queryStrings != null){
if (((!((queryStrings.gameid == undefined))) && (!((queryStrings.levelid == undefined))))){
return (true);
};
};
return (false);
}
private function enterFrameHandler(_arg1:Event):void{
trace(" loading complete", currentFrame, _slot1.startFrame);
if (currentFrame >= _slot1.startFrame){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
stop();
initApp();
};
}
function frame3(){
MochiBot.track(this, "114404b6");
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
function frame4(){
stop();
}
public function afterSecond(_arg1:TimerEvent){
var _local2:uint;
var _local3:uint;
var _local4:Number;
_local2 = loaderInfo.bytesLoaded;
_local3 = loaderInfo.bytesTotal;
_local4 = (_local2 / _local3);
mainLoader.percentbar.scaleX = _local4;
if ((((_local2 >= _local3)) && (((!(customLevel)) || (GParams.loadCustomLevel))))){
timer.stop();
startPlayButton();
mainLoader.visible = false;
};
}
public function startPlayButton(){
if (button == null){
button = new StartButton();
button.addEventListener(MouseEvent.MOUSE_DOWN, onClickStart, false, 0, true);
};
button.name = "start";
button.mouseChildren = false;
button.x = 307.6;
button.y = 427.6;
addChild(button);
}
private function securityErrorHandler(_arg1:SecurityErrorEvent){
customLevel = false;
}
private function levelLoadingCompleteHandler(_arg1:Event){
var _local2:URLLoader;
_local2 = URLLoader(_arg1.target);
GParams.customLevelString = _local2.data.result;
if (GParams.customLevelString == "Level or Game Invalid. Please check and try again."){
GParams.loadCustomLevel = false;
customLevel = false;
} else {
GParams.loadCustomLevel = true;
};
}
private function getLevelNumber():String{
return (queryStrings.levelid);
}
private function onIoError(_arg1:IOErrorEvent){
customLevel = false;
}
private function loadCustomLevel(){
var loadRequest:URLRequest;
var loader:URLLoader;
var variables:URLVariables;
try {
loadRequest = new URLRequest("http://www.flasharcade.com/getlevel");
loader = new URLLoader();
variables = new URLVariables();
loadRequest.method = URLRequestMethod.POST;
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
variables.gameid = "ace048";
variables.levelid = getLevelNumber();
loadRequest.data = variables;
if (!loader.hasEventListener(IOErrorEvent.IO_ERROR)){
loader.addEventListener(IOErrorEvent.IO_ERROR, onIoError);
};
if (!loader.hasEventListener(SecurityErrorEvent.SECURITY_ERROR)){
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
};
loader.load(loadRequest);
loader.addEventListener(Event.COMPLETE, levelLoadingCompleteHandler);
} catch(e:Error) {
customLevel = false;
};
}
private function initApp():void{
var _local1:Boolean;
var _local2:Class;
var _local3:Sprite;
_local1 = loaderInfo.applicationDomain.hasDefinition(_slot1.mainClass);
trace((" definition : " + _local1));
_local2 = (loaderInfo.applicationDomain.getDefinition(_slot1.mainClass) as Class);
_local3 = (new (_local2) as Sprite);
addChild(_local3);
}
public function onClickStart(_arg1:MouseEvent){
var event = _arg1;
button.removeEventListener(MouseEvent.MOUSE_DOWN, onClickStart);
button.visible = false;
button.mouseEnabled = false;
button.mouseChildren = false;
try {
if (adBox != null){
if (contains(adBox)){
removeChild(adBox);
};
};
} catch(e:Error) {
};
play();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}//package
Section 371
//PUmbra (PUmbra)
package {
import flash.display.*;
public dynamic class PUmbra extends MovieClip {
public var still:MovieClip;
public function PUmbra(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package
Section 372
//ReflectiveObject (ReflectiveObject)
package {
public class ReflectiveObject extends DynamicObject {
override public function update(){
if (this.body.GetAngle() != 0){
this.body.SetXForm(this.body.GetPosition(), 0);
};
this.health = 10000;
super.update();
}
}
}//package
Section 373
//ReflectiveWall (ReflectiveWall)
package {
import flash.display.*;
public dynamic class ReflectiveWall extends MovieClip {
public function ReflectiveWall(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 374
//RoarSound (RoarSound)
package {
public dynamic class RoarSound extends CustomSound {
}
}//package
Section 375
//RollingBarrel (RollingBarrel)
package {
import flash.display.*;
public dynamic class RollingBarrel extends MovieClip {
}
}//package
Section 376
//RollingBarrelExp (RollingBarrelExp)
package {
import flash.display.*;
public dynamic class RollingBarrelExp extends MovieClip {
}
}//package
Section 377
//RubyTalisman (RubyTalisman)
package {
import flash.display.*;
public dynamic class RubyTalisman extends MovieClip {
public function RubyTalisman(){
addFrameScript(57, frame58, 58, frame59);
}
function frame58(){
gotoAndPlay(1);
}
function frame59(){
stop();
}
}
}//package
Section 378
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 379
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 380
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 381
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 382
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 383
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 384
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 385
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 386
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 387
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 388
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 389
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 390
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 391
//SemiBossObject (SemiBossObject)
package {
import flash.display.*;
public class SemiBossObject extends BossObject {
public var whippable:Boolean;// = false
public var whiping:Boolean;// = false
public static var totalhealth:Number;
public function SemiBossObject(){
whiping = false;
whippable = false;
super();
}
override public function initHealth(_arg1:Number=10, _arg2:Number=10){
super.initHealth(_arg1, _arg2);
SemiBossObject.totalhealth = _arg2;
}
override public function update(){
super.update();
if (health < SemiBossObject.totalhealth){
SemiBossObject.totalhealth = health;
};
if (healthBar == null){
healthBar = new HealthBar();
};
if (SemiBossObject.totalhealth <= 0){
SemiBossObject.totalhealth = 0;
health = 0;
if ((graphic as MovieClip).contains(healthBar)){
(graphic as MovieClip).removeChild(healthBar);
};
};
SemiBossObject.totalhealth = int(SemiBossObject.totalhealth);
if (SemiBossObject.totalhealth > 0){
healthBar.hl.scaleX = (1 - (SemiBossObject.totalhealth / fullHealth));
} else {
healthBar.hl.scaleX = 0;
};
healthBar.y = -120;
if ((((SemiBossObject.totalhealth > 0)) && (!((graphic as MovieClip).contains(healthBar))))){
(graphic as MovieClip).addChild(healthBar);
};
if ((graphic as MovieClip).scaleX < 0){
if (healthBar.scaleX > 0){
healthBar.scaleX = -(healthBar.scaleX);
};
} else {
if (healthBar.scaleX < 0){
healthBar.scaleX = -(healthBar.scaleX);
};
};
}
public function whipped():Boolean{
return (false);
}
}
}//package
Section 392
//Shrapnel (Shrapnel)
package {
import flash.display.*;
public dynamic class Shrapnel extends MovieClip {
}
}//package
Section 393
//Shrapnel00 (Shrapnel00)
package {
import flash.display.*;
public dynamic class Shrapnel00 extends MovieClip {
}
}//package
Section 394
//Shrapnel000 (Shrapnel000)
package {
import flash.display.*;
public dynamic class Shrapnel000 extends MovieClip {
}
}//package
Section 395
//Shrapnel0000 (Shrapnel0000)
package {
import flash.display.*;
public dynamic class Shrapnel0000 extends MovieClip {
}
}//package
Section 396
//Shrapnel00000 (Shrapnel00000)
package {
import flash.display.*;
public dynamic class Shrapnel00000 extends MovieClip {
}
}//package
Section 397
//Shrapnel1 (Shrapnel1)
package {
import flash.display.*;
public dynamic class Shrapnel1 extends MovieClip {
}
}//package
Section 398
//Shrapnel11 (Shrapnel11)
package {
import flash.display.*;
public dynamic class Shrapnel11 extends MovieClip {
}
}//package
Section 399
//Shrapnel111 (Shrapnel111)
package {
import flash.display.*;
public dynamic class Shrapnel111 extends MovieClip {
}
}//package
Section 400
//Shrapnel1111 (Shrapnel1111)
package {
import flash.display.*;
public dynamic class Shrapnel1111 extends MovieClip {
}
}//package
Section 401
//Shrapnel11111 (Shrapnel11111)
package {
import flash.display.*;
public dynamic class Shrapnel11111 extends MovieClip {
}
}//package
Section 402
//Shrapnel2 (Shrapnel2)
package {
import flash.display.*;
public dynamic class Shrapnel2 extends MovieClip {
}
}//package
Section 403
//Shrapnel22 (Shrapnel22)
package {
import flash.display.*;
public dynamic class Shrapnel22 extends MovieClip {
}
}//package
Section 404
//Shrapnel222 (Shrapnel222)
package {
import flash.display.*;
public dynamic class Shrapnel222 extends MovieClip {
}
}//package
Section 405
//Shrapnel2222 (Shrapnel2222)
package {
import flash.display.*;
public dynamic class Shrapnel2222 extends MovieClip {
}
}//package
Section 406
//Shrapnel22222 (Shrapnel22222)
package {
import flash.display.*;
public dynamic class Shrapnel22222 extends MovieClip {
}
}//package
Section 407
//Shrapnel3 (Shrapnel3)
package {
import flash.display.*;
public dynamic class Shrapnel3 extends MovieClip {
}
}//package
Section 408
//Shrapnel33 (Shrapnel33)
package {
import flash.display.*;
public dynamic class Shrapnel33 extends MovieClip {
}
}//package
Section 409
//Shrapnel333 (Shrapnel333)
package {
import flash.display.*;
public dynamic class Shrapnel333 extends MovieClip {
}
}//package
Section 410
//Shrapnel3333 (Shrapnel3333)
package {
import flash.display.*;
public dynamic class Shrapnel3333 extends MovieClip {
}
}//package
Section 411
//Shrapnel33333 (Shrapnel33333)
package {
import flash.display.*;
public dynamic class Shrapnel33333 extends MovieClip {
}
}//package
Section 412
//Shrapnel4 (Shrapnel4)
package {
import flash.display.*;
public dynamic class Shrapnel4 extends MovieClip {
}
}//package
Section 413
//Shrapnel44 (Shrapnel44)
package {
import flash.display.*;
public dynamic class Shrapnel44 extends MovieClip {
}
}//package
Section 414
//Shrapnel444 (Shrapnel444)
package {
import flash.display.*;
public dynamic class Shrapnel444 extends MovieClip {
}
}//package
Section 415
//Shrapnel4444 (Shrapnel4444)
package {
import flash.display.*;
public dynamic class Shrapnel4444 extends MovieClip {
}
}//package
Section 416
//Shrapnel44444 (Shrapnel44444)
package {
import flash.display.*;
public dynamic class Shrapnel44444 extends MovieClip {
}
}//package
Section 417
//ShrapnelObject (ShrapnelObject)
package {
public class ShrapnelObject extends DynamicObject {
}
}//package
Section 418
//ShrapnelTObject (ShrapnelTObject)
package {
public class ShrapnelTObject extends DynamicObject {
}
}//package
Section 419
//SimpleMissileObject (SimpleMissileObject)
package {
public class SimpleMissileObject extends MissileObject {
}
}//package
Section 420
//SoundController (SoundController)
package {
import flash.media.*;
public class SoundController {
public var isSoundOn:Boolean;// = false
public var currentMusicIndex:int;// = -1
public var soundVolume:Number;// = 0
public var sounds:Array;// = null
private var soundclassname:Class;// = null
public var isMusicOn:Boolean;// = false
public var musicVolume:Number;// = 0
public var currentSoundIndex:int;// = -1
public var _musicTransform:SoundTransform;// = null
public var musics:Array;// = null
public var _soundTransform:SoundTransform;// = null
public static var SOUND_LAUNCH:int = 5;
public static var MUSIC_CUTSCENE:int = 6;
public static var MUSIC_GAMEOVER:int = 5;
public static var MUSIC_WELCOME:int = 1;
public static var SOUND_DEATH:int = 1;
public static var MUSIC_INGAME:int = 3;
public static var SOUND_BREAK:int = 7;
public static var SOUND_WALK:int = 8;
public static var SOUND_ENTERTEMPUS:int = 11;
public static var SOUND_GATE:int = 10;
public static var MUSIC_YOUWIN:int = 4;
public static var SOUND_CLICK1:int = 9;
public static var SOUND_GUN1:int = 3;
public static var SOUND_EXPLOSION:int = 2;
public static var MUSIC_TEMPUS:int = 2;
public static var SOUND_DEATH3:int = 15;
public static var SOUND_POWERUP:int = 13;
public static var SOUND_GUN2:int = 4;
public static var SOUND_DEATH2:int = 14;
public static var SOUND_DEATH4:int = 16;
public static var SOUND_ROAR:int = 6;
public static var SOUND_DAMAGE:int = 12;
public function SoundController(){
isSoundOn = false;
isMusicOn = false;
soundVolume = 0;
musicVolume = 0;
currentSoundIndex = -1;
currentMusicIndex = -1;
sounds = null;
musics = null;
soundclassname = null;
_soundTransform = null;
_musicTransform = null;
super();
sounds = new Array(7);
musics = new Array(7);
currentMusicIndex = -1;
isMusicOn = true;
isSoundOn = true;
soundVolume = 0.7;
musicVolume = 0.7;
_soundTransform = new SoundTransform(0.7, 0);
_musicTransform = new SoundTransform(0.7, 0);
createMusicObject(MUSIC_WELCOME);
createMusicObject(MUSIC_TEMPUS);
createMusicObject(MUSIC_INGAME);
createMusicObject(MUSIC_YOUWIN);
createMusicObject(MUSIC_GAMEOVER);
createMusicObject(MUSIC_CUTSCENE);
createSoundObject(SOUND_DEATH);
createSoundObject(SOUND_EXPLOSION);
createSoundObject(SOUND_GUN1);
createSoundObject(SOUND_GUN2);
createSoundObject(SOUND_LAUNCH);
createSoundObject(SOUND_ROAR);
createSoundObject(SOUND_BREAK);
createSoundObject(SOUND_WALK);
createSoundObject(SOUND_CLICK1);
createSoundObject(SOUND_GATE);
createSoundObject(SOUND_ENTERTEMPUS);
createSoundObject(SOUND_DAMAGE);
createSoundObject(SOUND_POWERUP);
createSoundObject(SOUND_DEATH2);
createSoundObject(SOUND_DEATH3);
createSoundObject(SOUND_DEATH4);
}
public function stopMusic(_arg1:int=-1){
_arg1 = currentMusicIndex;
if (currentMusicIndex == -1){
return;
};
(musics[_arg1] as CustomSound).stopSound();
}
public function stopAllMusics(){
var _local1:*;
_local1 = 0;
while (_local1 < musics.length) {
(musics[_local1] as CustomSound).stopSound();
_local1++;
};
}
public function stopCurrentMusic(){
stopMusic(currentMusicIndex);
}
public function stopCurrentSound(){
stopSound(currentSoundIndex);
}
public function playMusic(_arg1:int){
if (isMusicOn == true){
if (((!((currentMusicIndex == -1))) && (!((currentMusicIndex == _arg1))))){
stopMusic(currentMusicIndex);
};
if (currentMusicIndex != _arg1){
(musics[_arg1] as CustomSound).playSound(_musicTransform);
};
if ((musics[_arg1] as CustomSound)._channel == null){
(musics[_arg1] as CustomSound).playSound(_musicTransform);
};
};
currentMusicIndex = _arg1;
}
public function setSoundVolume(_arg1:int){
if (_arg1 < 0){
_arg1 = 0;
};
soundVolume = (_soundTransform.volume = (_arg1 / 100));
isSoundOn = true;
if (currentSoundIndex != -1){
(sounds[currentSoundIndex] as CustomSound).setVolume(_arg1);
};
}
public function createSoundObject(_arg1:int){
switch (_arg1){
case 1:
sounds[_arg1] = new DeathSound();
break;
case 2:
sounds[_arg1] = new ExplosionSound();
break;
case 3:
sounds[_arg1] = new Gun1Sound();
break;
case 4:
sounds[_arg1] = new Gun2Sound();
break;
case 5:
sounds[_arg1] = new LaunchSound();
break;
case 6:
sounds[_arg1] = new RoarSound();
break;
case 7:
sounds[_arg1] = new BreakSound();
break;
case 8:
sounds[_arg1] = new WalkSound();
break;
case 9:
sounds[_arg1] = new Click1Sound();
sounds[_arg1].setCustomVolume(1.5);
break;
case 10:
sounds[_arg1] = new GateSound();
break;
case 11:
sounds[_arg1] = new EnterTempusSound();
break;
case 12:
sounds[_arg1] = new DamageSound();
break;
case 13:
sounds[_arg1] = new PowerupSound();
break;
case 14:
sounds[_arg1] = new Death2Sound();
break;
case 15:
sounds[_arg1] = new Death3Sound();
break;
case 16:
sounds[_arg1] = new Death4Sound();
break;
};
}
public function toggleSound(){
if (isSoundOn == true){
isSoundOn = false;
} else {
isSoundOn = true;
};
}
public function setMusicVolume(_arg1:int){
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 > 100){
_arg1 = 100;
};
musicVolume = (_musicTransform.volume = (_arg1 / 100));
if (currentMusicIndex != -1){
(musics[currentMusicIndex] as CustomSound).setVolume(_arg1);
};
if (isMusicOn == false){
isMusicOn = true;
startCurrentMusic();
};
}
public function stopAllSoundEffects(){
var _local1:*;
_local1 = 0;
while (_local1 < sounds.length) {
(sounds[_local1] as CustomSound).stopSound();
_local1++;
};
}
public function reduseMusicVolume(_arg1:int, _arg2:Number=0){
var _local3:Number;
_arg1 = 5;
trace("upto", _arg2);
_local3 = (100 * (musics[currentMusicIndex]._transform.volume - ((musics[currentMusicIndex]._transform.volume * _arg1) / 100)));
_arg2 = (_musicTransform.volume * _arg2);
trace("currentVol", _local3, _arg2, _musicTransform.volume);
if (_local3 >= _arg2){
(musics[currentMusicIndex] as CustomSound).setVolume(_local3);
};
}
public function stopSound(_arg1:int){
(sounds[_arg1] as CustomSound).stopSound();
}
public function createMusicObject(_arg1:int){
switch (_arg1){
case 1:
musics[_arg1] = new WelcomeSound();
musics[_arg1].setCustomVolume(1);
break;
case 2:
musics[_arg1] = new TempusSound();
break;
case 3:
musics[_arg1] = new InGameSound();
break;
case 4:
musics[_arg1] = new YouWinSound();
break;
case 5:
musics[_arg1] = new GameOverSound();
break;
case 6:
musics[_arg1] = new CutsceneSound();
break;
};
musics[_arg1].setLoop(true);
}
public function toggleMusic(){
if (isMusicOn == true){
isMusicOn = false;
stopCurrentMusic();
} else {
isMusicOn = true;
startCurrentMusic();
};
}
public function startCurrentMusic(){
if (currentMusicIndex != -1){
(musics[currentMusicIndex] as CustomSound).playSound(_musicTransform);
};
}
public function setNormalMusicVolume(){
trace(" setting to normal volumne");
(musics[currentMusicIndex] as CustomSound).setVolume((_musicTransform.volume * 100));
}
public function playSound(_arg1:int){
currentSoundIndex = _arg1;
if (isSoundOn == true){
currentSoundIndex = _arg1;
(sounds[_arg1] as CustomSound).playSound(_soundTransform);
};
}
}
}//package
Section 421
//StartButton (StartButton)
package {
import flash.display.*;
public dynamic class StartButton extends SimpleButton {
}
}//package
Section 422
//StaticObject (StaticObject)
package {
import Box2D.Collision.Shapes.*;
public class StaticObject extends GameObject {
public var leftS:b2Shape;
public var rightS:b2Shape;
}
}//package
Section 423
//Stone (Stone)
package {
import flash.display.*;
public dynamic class Stone extends MovieClip {
}
}//package
Section 424
//StoneTalisman (StoneTalisman)
package {
import flash.display.*;
public dynamic class StoneTalisman extends MovieClip {
public function StoneTalisman(){
addFrameScript(24, frame25, 25, frame26);
}
function frame25(){
gotoAndPlay(1);
}
function frame26(){
stop();
}
}
}//package
Section 425
//SwingChain (SwingChain)
package {
import flash.display.*;
public dynamic class SwingChain extends MovieClip {
}
}//package
Section 426
//TempusBulletObject (TempusBulletObject)
package {
import Box2D.Common.Math.*;
public class TempusBulletObject extends GameObject {
override public function update(){
var _local1:b2Vec2;
var _local2:Number;
_local1 = body.GetPosition();
_local2 = body.GetAngle();
graphic.x = (_local1.x * GParams.physScale);
graphic.y = (_local1.y * GParams.physScale);
if (((!((body.GetLinearVelocity().Length() == 0))) && (!(isStopped)))){
graphic.rotation = ((Math.atan2(body.GetLinearVelocity().y, body.GetLinearVelocity().x) * 180) / Math.PI);
} else {
if (velocity != null){
graphic.rotation = ((Math.atan2(velocity.y, velocity.x) * 180) / Math.PI);
};
};
}
}
}//package
Section 427
//TempusContainer (TempusContainer)
package {
import flash.display.*;
public dynamic class TempusContainer extends MovieClip {
public function TempusContainer(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 428
//TempusFlash (TempusFlash)
package {
import flash.display.*;
public dynamic class TempusFlash extends MovieClip {
public function TempusFlash(){
addFrameScript(0, frame1, 10, frame11, 11, frame12, 20, frame21);
}
function frame12(){
if (this.parent != null){
(this.parent as Container).removeTempus();
};
}
function frame1(){
stop();
}
function frame21(){
gotoAndStop(1);
}
function frame11(){
if (this.parent != null){
(this.parent as Container).applyTempus();
};
gotoAndStop(1);
}
}
}//package
Section 429
//TempusMissileObject (TempusMissileObject)
package {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class TempusMissileObject extends MissileObject {
override public function reAlign(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:b2Vec2;
_local3 = ((Math.atan2((_arg2 - graphic.y), (_arg1 - graphic.x)) * 180) / Math.PI);
_local4 = ((Math.atan2(body.GetLinearVelocity().y, body.GetLinearVelocity().x) * 180) / Math.PI);
_local5 = new b2Vec2(body.GetLinearVelocity().x, body.GetLinearVelocity().y);
_local5.Normalize();
_local5.Multiply(50);
if (Math.abs((_local3 - _local4)) > 5){
if (Math.abs((_local3 - _local4)) > 180){
if (_local3 > _local4){
_local3 = (_local3 - 360);
} else {
_local4 = (_local4 - 360);
};
};
if (_local3 > _local4){
body.ApplyImpulse(new b2Vec2((-(_local5.y) / 500), (_local5.x / 500)), body.GetWorldPoint(new b2Vec2(0, 0)));
} else {
body.ApplyImpulse(new b2Vec2((_local5.y / 500), (-(_local5.x) / 500)), body.GetWorldPoint(new b2Vec2(0, 0)));
};
};
}
public function startMissile(){
var _local1:b2Shape;
var _local2:b2Shape;
var _local3:b2FilterData;
_local1 = body.GetShapeList();
while (_local1) {
_local2 = _local1.GetNext();
_local3 = new b2FilterData();
_local3.categoryBits = (4 | 2);
_local3.maskBits = (4 | 2);
_local1.SetFilterData(_local3);
body.GetWorld().Refilter(_local1);
_local1 = _local2;
};
}
public function stopMissile(){
var _local1:b2Shape;
var _local2:b2Shape;
var _local3:b2FilterData;
_local1 = body.GetShapeList();
while (_local1) {
_local2 = _local1.GetNext();
_local3 = new b2FilterData();
_local3.categoryBits = 0x0100;
_local3.maskBits = 32;
_local1.SetFilterData(_local3);
body.GetWorld().Refilter(_local1);
_local1 = _local2;
};
}
}
}//package
Section 430
//TempusSound (TempusSound)
package {
public dynamic class TempusSound extends CustomSound {
}
}//package
Section 431
//TestHud (TestHud)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.ui.*;
public class TestHud extends MovieClip {
public var urlText:MovieClip;
public var save:SimpleButton;
public var back:SimpleButton;
private function onSave(_arg1:MouseEvent){
var _local2:URLRequest;
var _local3:URLLoader;
var _local4:URLVariables;
Mouse.show();
if (GParams.saveEnabled){
MainClass.byPassing = true;
GParams.saveLevel = true;
urlText.x = 100;
urlText.details.text = "Saving Level. Please wait...";
_local2 = new URLRequest("http://www.flasharcade.com/savelevel/");
_local2.method = URLRequestMethod.POST;
_local3 = new URLLoader();
_local3.dataFormat = URLLoaderDataFormat.VARIABLES;
_local4 = new URLVariables();
_local4.gameid = "ace048";
_local4.gamename = "Tempus Terminus";
_local4.sitefrom = "www.flasharcade.com";
_local4.levelcode = (this.parent as LevelEditor).getLevelString();
_local2.data = _local4;
_local3.load(_local2);
if (!_local3.hasEventListener(IOErrorEvent.IO_ERROR)){
_local3.addEventListener(IOErrorEvent.IO_ERROR, onIoError);
};
if (!_local3.hasEventListener(SecurityErrorEvent.SECURITY_ERROR)){
_local3.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
};
_local3.addEventListener(Event.COMPLETE, completeHandler);
} else {
urlText.x = 100;
urlText.details.text = "You need to complete the level atleast once, before you can save it.";
};
}
private function removeListeners(){
back.removeEventListener(MouseEvent.CLICK, onBack);
save.removeEventListener(MouseEvent.CLICK, onSave);
urlText.closeUrl.removeEventListener(MouseEvent.CLICK, handleClose);
if (urlText.details.hasEventListener(TextEvent.LINK)){
urlText.details.removeEventListener(TextEvent.LINK, linkHandler);
};
}
private function onBack(_arg1:MouseEvent){
removeListeners();
(this.parent as LevelEditor).goBack();
(this.parent as LevelEditor).addInitialiser();
}
private function securityErrorHandler(_arg1:SecurityErrorEvent){
MainClass.byPassing = false;
urlText.details.htmlText = "Unable to save level. Level can only be saved at <a href =\"event:http://www.flasharcade.com\"><font color = \"#0000FF\">flasharcade.com</font></a>";
}
public function addListeners(){
back.addEventListener(MouseEvent.CLICK, onBack);
save.addEventListener(MouseEvent.CLICK, onSave);
urlText.closeUrl.addEventListener(MouseEvent.CLICK, handleClose);
if (!urlText.details.hasEventListener(TextEvent.LINK)){
urlText.details.addEventListener(TextEvent.LINK, linkHandler);
};
}
private function handleClose(_arg1:MouseEvent){
if (!MainClass.byPassing){
urlText.x = 1000;
GParams.saveLevel = false;
Mouse.hide();
};
}
private function onIoError(_arg1:IOErrorEvent){
MainClass.byPassing = false;
urlText.details.text = "Unable to save level. Please check your internet connection";
}
private function completeHandler(_arg1:Event):void{
var _local2:URLLoader;
var _local3:String;
var _local4:String;
MainClass.byPassing = false;
_local2 = URLLoader(_arg1.target);
_local3 = _local2.data.result;
_local4 = (((("Click (or copy and paste into your browser) this URL to play and share your level: \n <font color = \"#0000FF\"> <a href =\"event:" + _local3) + "\">") + _local3) + "</font></a>");
urlText.details.htmlText = _local4;
}
private function linkHandler(_arg1:TextEvent){
var _local2:String;
var _local3:URLRequest;
_local2 = _arg1.text;
_local3 = new URLRequest(_local2);
navigateToURL(_local3);
}
}
}//package
Section 432
//Triarii (Triarii)
package {
import flash.display.*;
public dynamic class Triarii extends MovieClip {
public var hurt:MovieClip;
public var death:MovieClip;
public var still:MovieClip;
public var walk:MovieClip;
public function Triarii(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 433
//TriariiObject (TriariiObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import flash.geom.*;
public class TriariiObject extends EnemyObject {
private var laserSD:b2CircleDef;
private var disX:Number;
private var disY:Number;
private var shootPoint:Point;
private var shootAngle:Number;// = 0
public function TriariiObject(){
shootAngle = 0;
super();
}
override protected function shoot(){
var _local1:*;
if (actorWorld == null){
actorWorld = body.GetWorld();
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.fire != null){
shootPoint = (graphic as MovieClip).still.fire.localToGlobal(new Point((graphic as MovieClip).still.fire.gunPoint.x, (graphic as MovieClip).still.fire.gunPoint.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
};
};
if (shootPoint == null){
return;
};
_local1 = 0;
while (_local1 < 5) {
bulletSpeed = 15;
laserSD = new b2CircleDef();
bulletBD = new b2BodyDef();
if (shootAngle == 0){
if (graphic.scaleX > 0){
bulletBD.position.Set(((shootPoint.x + (_local1 * 3)) / GParams.physScale), (shootPoint.y / GParams.physScale));
} else {
bulletBD.position.Set(((shootPoint.x - (_local1 * 3)) / GParams.physScale), (shootPoint.y / GParams.physScale));
};
} else {
bulletBD.position.Set((shootPoint.x / GParams.physScale), ((shootPoint.y - (_local1 * 3)) / GParams.physScale));
};
bulletBD.isBullet = true;
laserSD.density = 1;
laserSD.filter.groupIndex = -1;
laserSD.restitution = 1;
bulletObject = (graphic.parent as Container).getBullet(2);
laserSD.radius = ((bulletObject.graphic.height / 2) / GParams.physScale);
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
laserSD.filter.categoryBits = (4 | 2);
laserSD.filter.maskBits = (4 | 2);
bulletB.CreateShape(laserSD);
bulletObject.init(bulletB);
bulletB.SetMassFromShapes();
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).generalArray.push(bulletObject);
if ((((_local1 == 1)) && ((shootStatus == 99)))){
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_GUN2);
};
};
};
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetAntiGravity(true);
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
laserSD = null;
bulletB = null;
bulletObject = null;
_local1++;
};
shootPoint = null;
}
override protected function setFrame(){
if (shootStatus < 450){
graphic.scaleX = turn;
};
if (maxVel.x != 0){
charStatus = STATUS_WALK;
} else {
charStatus = STATUS_STILL;
};
if (hurt > 0){
charStatus = STATUS_HURT;
};
if (health <= 0){
charStatus = STATUS_DEATH;
};
switch (charStatus){
case STATUS_WALK:
if ((graphic as MovieClip).currentFrame != 2){
(graphic as MovieClip).gotoAndStop(2);
};
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.stop();
};
} else {
if ((graphic as MovieClip).walk != null){
(graphic as MovieClip).walk.play();
};
};
};
break;
case STATUS_STILL:
if ((graphic as MovieClip).currentFrame != 1){
(graphic as MovieClip).gotoAndStop(1);
};
if ((graphic as MovieClip).still != null){
if ((graphic as MovieClip).still.fire != null){
if (shootStatus > 210){
if ((graphic as MovieClip).still.fire.currentFrame < 2){
(graphic as MovieClip).still.fire.gotoAndPlay(2);
};
};
if (graphic.parent != null){
if ((graphic.parent as Container).Tempus){
(graphic as MovieClip).still.fire.stop();
} else {
if ((graphic as MovieClip).still.fire.currentFrame != 1){
(graphic as MovieClip).still.fire.play();
};
};
};
};
};
break;
case STATUS_HURT:
if ((graphic as MovieClip).currentFrame != 3){
(graphic as MovieClip).gotoAndStop(3);
};
break;
case STATUS_DEATH:
if ((graphic as MovieClip).currentFrame != 4){
(graphic as MovieClip).gotoAndStop(4);
};
break;
};
}
override public function update(){
super.update();
if (hurt > 0){
hurt--;
};
if (currHealth > health){
hurt = 10;
currHealth = health;
};
setFrame();
}
override public function resetFrames(){
if ((graphic as MovieClip).still != null){
(graphic as MovieClip).still.gotoAndStop(1);
if ((graphic as MovieClip).still.fire != null){
(graphic as MovieClip).still.fire.gotoAndStop(1);
};
};
}
override public function move(){
vel = this.body.GetLinearVelocity();
think();
if (body.IsSleeping()){
body.WakeUp();
};
vel.Set(maxVel.x, 0);
}
override public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
var _local4:Number;
_local4 = Math.atan2(Math.abs((graphic.y - _arg3)), Math.abs((graphic.x - _arg2)));
if (((_arg1) && (((graphic.y + (graphic.height / 2)) > _arg3)))){
if ((((((_arg3 < (graphic.y + (graphic.height / 2)))) && ((_arg3 > (graphic.y - (graphic.height / 2)))))) || ((_local4 > (Math.PI / 2.5))))){
alertStatus = true;
alertness = 90;
if (shootStatus == 0){
shootStatus = 220;
};
if (_arg2 > graphic.x){
graphic.scaleX = GParams.RIGHT;
} else {
graphic.scaleX = GParams.LEFT;
};
turn = graphic.scaleX;
takeTurn = turn;
};
if (((!(((graphic as MovieClip).still == null))) && ((shootStatus > 210)))){
if (_local4 < (Math.PI / 2.5)){
shootAngle = 0;
if ((graphic as MovieClip).still.currentFrame != 1){
(graphic as MovieClip).still.gotoAndStop(1);
};
} else {
shootAngle = (Math.PI / 1.8);
if ((graphic as MovieClip).still.currentFrame != 2){
(graphic as MovieClip).still.gotoAndStop(2);
};
};
if (_arg3 < graphic.y){
shootAngle = (shootAngle * -1);
};
};
} else {
if (shootStatus < 80){
if (alertness > 0){
alertness--;
};
if (alertness == 0){
alertStatus = false;
};
};
};
if ((((shootStatus <= 100)) && ((shootStatus >= 80)))){
if ((graphic as MovieClip).still != null){
if (!isNaN(shootAngle)){
shoot();
};
};
};
if (shootStatus > 0){
shootStatus--;
};
}
override protected function think(){
if (!alertStatus){
if (turn != takeTurn){
if (wait == 0){
wait = 60;
};
if (wait > 1){
wait--;
} else {
turn = takeTurn;
wait = 0;
};
maxVel.Set(0, 0);
} else {
maxVel.Set((turn * 1.5), 0);
wait = 0;
};
} else {
maxVel.Set(0, 0);
};
}
}
}//package
Section 434
//Turret (Turret)
package {
import flash.display.*;
public dynamic class Turret extends MovieClip {
public var gun:MovieClip;
}
}//package
Section 435
//TurretBullet (TurretBullet)
package {
import flash.display.*;
public dynamic class TurretBullet extends MovieClip {
public function TurretBullet(){
addFrameScript(6, frame7, 7, frame8);
}
function frame7(){
gotoAndPlay(1);
}
function frame8(){
stop();
}
}
}//package
Section 436
//TurretObject (TurretObject)
package {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import flash.geom.*;
public class TurretObject extends EnemyObject {
public var loc:Point;
private var angleDiff:Number;
private var shootPoint:Point;
private var shootAngle:Number;
override protected function shoot(){
if (actorWorld == null){
actorWorld = body.GetWorld();
};
bulletSpeed = 10;
if ((graphic as MovieClip) != null){
if (angleDiff > 0){
(graphic as MovieClip).gun.rotation = ((graphic as MovieClip).gun.rotation + 1);
};
if (angleDiff < 0){
(graphic as MovieClip).gun.rotation = ((graphic as MovieClip).gun.rotation - 1);
};
shootPoint = (graphic as MovieClip).gun.localToGlobal(new Point(((graphic as MovieClip).gun.gunPoint.x + 30), (graphic as MovieClip).gun.gunPoint.y));
shootPoint = graphic.parent.globalToLocal(shootPoint);
shootAngle = (((graphic as MovieClip).gun.rotation * Math.PI) / 180);
};
if (shootPoint == null){
return;
};
bulletSD = new b2PolygonDef();
bulletBD = new b2BodyDef();
bulletBD.position.Set((shootPoint.x / GParams.physScale), (shootPoint.y / GParams.physScale));
bulletBD.isBullet = true;
bulletSD.density = 0.1;
bulletBD.linearDamping = 0;
bulletObject = (graphic.parent as Container).getBullet(12);
bulletSD.SetAsBox(((bulletObject.graphic.width / 2) / GParams.physScale), ((bulletObject.graphic.height / 2) / GParams.physScale));
bulletB = (graphic.parent as Container).world.CreateBody(bulletBD);
bulletSD.filter.categoryBits = (4 | 2);
bulletSD.filter.maskBits = (4 | 2);
bulletB.CreateShape(bulletSD);
bulletObject.init(bulletB);
bulletB.SetMassFromShapes();
(graphic.parent as Container).addChild(bulletObject.graphic);
(graphic.parent as Container).worldArray.push(bulletObject);
if (graphic.parent != null){
if (graphic.parent.parent != null){
(graphic.parent.parent as MainClass).soundController.playSound(SoundController.SOUND_GUN1);
};
};
bulletObject.body.SetLinearVelocity(new b2Vec2(((graphic.scaleX * bulletSpeed) * Math.cos(shootAngle)), (bulletSpeed * Math.sin(shootAngle))));
bulletB.SetAntiGravity(true);
bulletB.SetUserData(bulletObject);
bulletObject.update();
bulletBD = null;
bulletSD = null;
bulletB = null;
bulletObject = null;
shootPoint = null;
}
override protected function setFrame(){
}
override public function update(){
if (loc == null){
loc = new Point();
loc.x = this.body.GetPosition().x;
loc.y = this.body.GetPosition().y;
} else {
this.body.SetXForm(new b2Vec2(loc.x, loc.y), this.body.GetAngle());
};
range = 2800;
super.update();
setFrame();
if ((graphic as MovieClip).contains(healthBar)){
(graphic as MovieClip).removeChild(healthBar);
};
}
override public function resetFrames(){
}
override public function move(){
}
override public function trackHero(_arg1:Boolean, _arg2:Number, _arg3:Number){
shootAngle = Math.atan2((_arg3 - graphic.y), (_arg2 - graphic.x));
if (_arg1){
if (shootStatus == 0){
shootStatus = 20;
};
turn = graphic.scaleX;
takeTurn = turn;
if ((graphic as MovieClip).gun != null){
angleDiff = (((shootAngle * 180) / Math.PI) - (graphic as MovieClip).gun.rotation);
if (angleDiff > 180){
angleDiff = (angleDiff - 360);
};
if (angleDiff < -180){
angleDiff = (angleDiff + 360);
};
if (angleDiff > 0){
(graphic as MovieClip).gun.rotation = ((graphic as MovieClip).gun.rotation + 1);
};
if (angleDiff < 0){
(graphic as MovieClip).gun.rotation = ((graphic as MovieClip).gun.rotation - 1);
};
};
if (shootStatus == 10){
shoot();
};
shootStatus--;
} else {
shootStatus = 0;
keepRotating();
};
}
override protected function think(){
}
public function keepRotating(){
if ((graphic as MovieClip).gun != null){
angleDiff = (((shootAngle * 180) / Math.PI) - (graphic as MovieClip).gun.rotation);
if (angleDiff > 180){
angleDiff = (angleDiff - 360);
};
if (angleDiff < -180){
angleDiff = (angleDiff + 360);
};
if (angleDiff > 0){
(graphic as MovieClip).gun.rotation = ((graphic as MovieClip).gun.rotation + 1);
};
if (angleDiff < 0){
(graphic as MovieClip).gun.rotation = ((graphic as MovieClip).gun.rotation - 1);
};
};
}
}
}//package
Section 437
//WalkSound (WalkSound)
package {
public dynamic class WalkSound extends CustomSound {
}
}//package
Section 438
//Wall (Wall)
package {
import flash.display.*;
public dynamic class Wall extends MovieClip {
}
}//package
Section 439
//Wall1 (Wall1)
package {
import flash.display.*;
public dynamic class Wall1 extends BitmapData {
public function Wall1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 440
//Wall2 (Wall2)
package {
import flash.display.*;
public dynamic class Wall2 extends BitmapData {
public function Wall2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 441
//Wall4 (Wall4)
package {
import flash.display.*;
public dynamic class Wall4 extends BitmapData {
public function Wall4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 442
//Wall5 (Wall5)
package {
import flash.display.*;
public dynamic class Wall5 extends BitmapData {
public function Wall5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 443
//Welcome (Welcome)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class Welcome extends MovieClip {
var requestAddMore:URLRequest;// = null
var urlPlayMoreLogo:String;// = "http://www.flasharcade.com/ref.php?button=logo&game=ace048"
var requestPlayMoreLogo:URLRequest;// = null
var urlPlayMore:String;// = "http://www.flasharcade.com/ref.php?button=more&game=ace048"
var requestPlayMore:URLRequest;// = null
public var welcome:MovieClip;
var urlTwune:String;// = "http://www.twune.com"
public var gameSelect:MovieClip;
var requestTwune:URLRequest;// = null
public var instructions:MovieClip;
public var creditScreen:MovieClip;
var urlAddMoreGames:String;// = "http://www.flasharcade.com/flash-games/"
public function Welcome():void{
urlPlayMore = "http://www.flasharcade.com/ref.php?button=more&game=ace048";
urlPlayMoreLogo = "http://www.flasharcade.com/ref.php?button=logo&game=ace048";
urlTwune = "http://www.twune.com";
requestPlayMore = null;
requestPlayMoreLogo = null;
requestTwune = null;
urlAddMoreGames = "http://www.flasharcade.com/flash-games/";
requestAddMore = null;
super();
addFrameScript(0, frame1);
requestPlayMore = new URLRequest(urlPlayMore);
requestPlayMoreLogo = new URLRequest(urlPlayMoreLogo);
requestAddMore = new URLRequest(urlAddMoreGames);
requestTwune = new URLRequest(urlTwune);
this.gameSelect.easy.buttonMode = true;
this.gameSelect.medium.buttonMode = true;
this.gameSelect.hard.buttonMode = true;
}
public function init(){
gotoAndStop(1);
addEventListener(MouseEvent.CLICK, handleClick);
if ((((((this.gameSelect.easy.currentFrame == 1)) && ((this.gameSelect.medium.currentFrame == 1)))) && ((this.gameSelect.hard.currentFrame == 1)))){
this.gameSelect.medium.gotoAndStop(2);
};
}
function frame1(){
stop();
}
public function handleClick(_arg1:MouseEvent){
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:int;
switch (_arg1.target.name){
case "playMore":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
navigateToURL(requestPlayMore, "_blank");
break;
case "playLogo":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
navigateToURL(requestPlayMoreLogo, "_blank");
break;
case "addMore":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
navigateToURL(requestAddMore, "_blank");
break;
case "start":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
setChildIndex(gameSelect, (numChildren - 1));
break;
case "newGame":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
if ((this.parent as MainClass).profile.data.Levels == undefined){
(this.parent as MainClass).profile.data.Levels = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
};
MainClass.currentLevel = 1;
removeAllListener();
setDifficulty();
(this.parent as MainClass).nextLevel(MainClass.currentLevel);
break;
case "prevPage":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
instructions.prevFrame();
break;
case "nextPage":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
instructions.nextFrame();
break;
case "instructionsBn":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
setChildIndex(instructions, (numChildren - 1));
instructions.gotoAndStop(1);
break;
case "back":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
stage.focus = welcome;
setChildIndex(welcome, (numChildren - 1));
break;
case "creditBn":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
stage.focus = creditScreen;
setChildIndex(creditScreen, (numChildren - 1));
break;
case "creditBack":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
stage.focus = welcome;
setChildIndex(welcome, (numChildren - 1));
break;
case "optionsBn":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
(this.parent as MainClass).createOptions();
break;
case "twuneBn":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
navigateToURL(requestTwune, "_blank");
break;
case "levelEditor":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
if (GParams.LevelEditor){
MainClass.currentLevel = 0;
removeAllListener();
(this.parent as MainClass).initLevelEditor();
} else {
welcome.arcadeOnly.gotoAndPlay(2);
};
break;
case "playLevelBn":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
if ((this.parent as MainClass).profile.data.Levels == undefined){
(this.parent as MainClass).profile.data.Levels = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
};
if (gameSelect.playLevelText.text == ""){
gameSelect.wrongCode.gotoAndPlay(2);
} else {
_local2 = gameSelect.playLevelText.text.toUpperCase();
_local3 = _local2.toLowerCase();
_local4 = _local2.charAt(0);
_local4 = _local4.concat(_local3.substr(1));
_local5 = (GParams.playLevelCode.indexOf(_local4) + 1);
if (_local5 <= 0){
gameSelect.wrongCode.gotoAndPlay(2);
} else {
MainClass.currentLevel = _local5;
removeAllListener();
setDifficulty();
(this.parent as MainClass).nextLevel(MainClass.currentLevel);
};
};
break;
case "easy":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
this.gameSelect.easy.gotoAndStop(2);
this.gameSelect.medium.gotoAndStop(1);
this.gameSelect.hard.gotoAndStop(1);
break;
case "medium":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
this.gameSelect.easy.gotoAndStop(1);
this.gameSelect.medium.gotoAndStop(2);
this.gameSelect.hard.gotoAndStop(1);
break;
case "hard":
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
this.gameSelect.easy.gotoAndStop(1);
this.gameSelect.medium.gotoAndStop(1);
this.gameSelect.hard.gotoAndStop(2);
break;
};
}
public function removeAllListener(){
removeEventListener(MouseEvent.CLICK, handleClick);
}
private function setDifficulty(){
if (this.gameSelect.easy.currentFrame == 2){
MainClass.difficulty = 0;
} else {
if (this.gameSelect.medium.currentFrame == 2){
MainClass.difficulty = 1;
} else {
if (this.gameSelect.hard.currentFrame == 2){
MainClass.difficulty = 2;
} else {
throw (new Error("no difficulty selected"));
};
};
};
}
}
}//package
Section 444
//WelcomeSound (WelcomeSound)
package {
public dynamic class WelcomeSound extends CustomSound {
}
}//package
Section 445
//YouWin (YouWin)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class YouWin extends MovieClip {
var urlPlayMore:String;// = "http://www.flasharcade.com/ref.php?button=more&game=ace048"
var requestPlayMore:URLRequest;// = null
public function YouWin(){
urlPlayMore = "http://www.flasharcade.com/ref.php?button=more&game=ace048";
requestPlayMore = null;
super();
addFrameScript(11, frame12);
}
public function init(){
gotoAndPlay(1);
requestPlayMore = new URLRequest(urlPlayMore);
addEventListener(MouseEvent.CLICK, handleClick);
}
function frame12(){
stop();
}
public function removeAllListener(){
removeEventListener(MouseEvent.CLICK, handleClick);
}
public function handleClick(_arg1:MouseEvent){
if (_arg1.target.name == "playMore"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
navigateToURL(requestPlayMore, "_blank");
};
if (_arg1.target.name == "playAgain"){
(this.parent as MainClass).soundController.playSound(SoundController.SOUND_CLICK1);
removeAllListener();
gotoAndStop(1);
if (this.parent != null){
(this.parent as MainClass).createWelcome();
};
};
}
}
}//package
Section 446
//YouWinSound (YouWinSound)
package {
public dynamic class YouWinSound extends CustomSound {
}
}//package