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):Boolean{
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.x + ((_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){
return (false);
};
_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 (false);
};
_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 (true);
};
return (false);
}
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.Collision.*;
import Box2D.Dynamics.*;
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):Boolean{
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 (false);
};
_local19++;
};
if (_local18 >= 0){
_arg2[0] = _local6;
_local10 = _arg1.R;
_local11 = m_normals[_local18];
_arg3.x = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_arg3.y = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
return (true);
};
return (false);
}
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.Collision.*;
import Box2D.Dynamics.*;
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_unknownShape:int = -1;
public static const e_circleShape:int = 0;
public static const e_shapeTypeCount:int = 2;
private static var s_resetAABB:b2AABB = new b2AABB();
private static var s_syncAABB:b2AABB = new b2AABB();
private static var s_proxyAABB:b2AABB = new b2AABB();
public function b2Shape(_arg1:b2ShapeDef){
m_userData = _arg1.userData;
m_friction = _arg1.friction;
m_restitution = _arg1.restitution;
m_density = _arg1.density;
m_body = null;
m_sweepRadius = 0;
m_next = null;
m_proxyId = b2Pair.b2_nullProxy;
m_filter = _arg1.filter.Copy();
m_isSensor = _arg1.isSensor;
}
public function 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):Boolean{
return (false);
}
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_quantizationFactor:b2Vec2;
public var m_worldAABB:b2AABB;
public var m_bounds:Array;
public var m_freeProxy:uint;
public var m_proxyCount:int;
public var m_proxyPool:Array;
public var m_queryResultCount:int;
public var m_pairManager:b2PairManager;
public var m_timeStamp:uint;
public var m_queryResults:Array;
public static const b2_nullEdge:uint = b2Settings.USHRT_MAX;
public static const b2_invalid:uint = b2Settings.USHRT_MAX;
public static var s_validate:Boolean = false;
public function b2BroadPhase(_arg1:b2AABB, _arg2:b2PairCallback){
var _local3:int;
var _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_queryResults = new Array(b2Settings.b2_maxProxies);
m_quantizationFactor = new b2Vec2();
super();
m_pairManager.Initialize(this, _arg2);
m_worldAABB = _arg1;
m_proxyCount = 0;
_local3 = 0;
while (_local3 < b2Settings.b2_maxProxies) {
m_queryResults[_local3] = 0;
_local3++;
};
m_bounds = new Array(2);
_local3 = 0;
while (_local3 < 2) {
m_bounds[_local3] = new Array((2 * b2Settings.b2_maxProxies));
_local7 = 0;
while (_local7 < (2 * b2Settings.b2_maxProxies)) {
m_bounds[_local3][_local7] = new b2Bound();
_local7++;
};
_local3++;
};
_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 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);
}
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));
}
public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{
var _local3:Array;
var _local4:int;
var _local5:uint;
var _local6:uint;
var _local7:b2Bound;
var _local8:b2Bound;
var _local9:b2Bound;
var _local10:uint;
var _local11:b2Proxy;
var _local12:uint;
var _local13:b2Proxy;
var _local14:b2BoundValues;
var _local15:b2BoundValues;
var _local16:Array;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:uint;
var _local21:int;
var _local22:int;
var _local23:uint;
var _local24:b2Proxy;
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){
return;
};
if (_arg2.IsValid() == false){
return;
};
_local12 = (2 * m_proxyCount);
_local13 = m_proxyPool[_arg1];
_local14 = new b2BoundValues();
ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2);
_local15 = new b2BoundValues();
_local5 = 0;
while (_local5 < 2) {
_local7 = m_bounds[_local5][_local13.lowerBounds[_local5]];
_local15.lowerValues[_local5] = _local7.value;
_local7 = m_bounds[_local5][_local13.upperBounds[_local5]];
_local15.upperValues[_local5] = _local7.value;
_local5++;
};
_local5 = 0;
while (_local5 < 2) {
_local16 = m_bounds[_local5];
_local17 = _local13.lowerBounds[_local5];
_local18 = _local13.upperBounds[_local5];
_local19 = _local14.lowerValues[_local5];
_local20 = _local14.upperValues[_local5];
_local7 = _local16[_local17];
_local21 = (_local19 - _local7.value);
_local7.value = _local19;
_local7 = _local16[_local18];
_local22 = (_local20 - _local7.value);
_local7.value = _local20;
if (_local21 < 0){
_local6 = _local17;
while ((((_local6 > 0)) && ((_local19 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local8.proxyId];
_local8.stabbingCount++;
if (_local8.IsUpper() == true){
if (TestOverlap(_local14, _local24)){
m_pairManager.AddBufferedPair(_arg1, _local23);
};
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
if (_local22 > 0){
_local6 = _local18;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local20)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount++;
if (_local9.IsLower() == true){
if (TestOverlap(_local14, _local11)){
m_pairManager.AddBufferedPair(_arg1, _local10);
};
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local21 > 0){
_local6 = _local17;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local19)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount--;
if (_local9.IsUpper()){
if (TestOverlap(_local15, _local11)){
m_pairManager.RemoveBufferedPair(_arg1, _local10);
};
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local22 < 0){
_local6 = _local18;
while ((((_local6 > 0)) && ((_local20 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local23];
_local8.stabbingCount--;
if (_local8.IsLower() == true){
if (TestOverlap(_local15, _local24)){
m_pairManager.RemoveBufferedPair(_arg1, _local23);
};
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
_local5++;
};
}
public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:b2Bound;
_local4 = 0;
_local5 = (_arg2 - 1);
while (_local4 <= _local5) {
_local6 = ((_local4 + _local5) / 2);
_local7 = _arg1[_local6];
if (_local7.value > _arg3){
_local5 = (_local6 - 1);
} else {
if (_local7.value < _arg3){
_local4 = (_local6 + 1);
} else {
return (uint(_local6));
};
};
};
return (uint(_local4));
}
}
}//package Box2D.Collision
Section 13
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
}
}//package Box2D.Collision
Section 14
//b2Collision (Box2D.Collision.b2Collision)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2Collision {
public static const b2_nullFeature:uint = 0xFF;
private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2();
public static function EdgeSeparation(_arg1:b2PolygonShape, _arg2:b2XForm, _arg3:int, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:b2Mat22;
var _local12:b2Vec2;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local6 = _arg1.m_vertexCount;
_local7 = _arg1.m_vertices;
_local8 = _arg1.m_normals;
_local9 = _arg4.m_vertexCount;
_local10 = _arg4.m_vertices;
_local11 = _arg2.R;
_local12 = _local8[_arg3];
_local13 = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y));
_local14 = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y));
_local11 = _arg5.R;
_local15 = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14));
_local16 = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14));
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local12 = _local10[_local19];
_local25 = ((_local12.x * _local15) + (_local12.y * _local16));
if (_local25 < _local18){
_local18 = _local25;
_local17 = _local19;
};
_local19++;
};
_local12 = _local7[_arg3];
_local11 = _arg2.R;
_local20 = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local21 = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local12 = _local10[_local17];
_local11 = _arg5.R;
_local22 = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local23 = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local22 = (_local22 - _local20);
_local23 = (_local23 - _local21);
_local24 = ((_local22 * _local13) + (_local23 * _local14));
return (_local24);
}
public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = _arg2.lowerBound;
_local4 = _arg1.upperBound;
_local5 = (_local3.x - _local4.x);
_local6 = (_local3.y - _local4.y);
_local3 = _arg1.lowerBound;
_local4 = _arg2.upperBound;
_local7 = (_local3.x - _local4.x);
_local8 = (_local3.y - _local4.y);
if ((((_local5 > 0)) || ((_local6 > 0)))){
return (false);
};
if ((((_local7 > 0)) || ((_local8 > 0)))){
return (false);
};
return (true);
}
public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:int, _arg5:b2PolygonShape, _arg6:b2XForm):void{
var _local7:int;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:Array;
var _local12:b2Mat22;
var _local13:b2Vec2;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:ClipVertex;
var _local21:int;
var _local22:int;
var _local23:Number;
_local7 = _arg2.m_vertexCount;
_local8 = _arg2.m_normals;
_local9 = _arg5.m_vertexCount;
_local10 = _arg5.m_vertices;
_local11 = _arg5.m_normals;
_local12 = _arg3.R;
_local13 = _local8[_arg4];
_local14 = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y));
_local15 = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y));
_local12 = _arg6.R;
_local16 = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15));
_local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15));
_local14 = _local16;
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local13 = _local11[_local19];
_local23 = ((_local14 * _local13.x) + (_local15 * _local13.y));
if (_local23 < _local18){
_local18 = _local23;
_local17 = _local19;
};
_local19++;
};
_local21 = _local17;
_local22 = (((_local21 + 1) < _local9)) ? (_local21 + 1) : 0;
_local20 = _arg1[0];
_local13 = _local10[_local21];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local21;
_local20.id.features.incidentVertex = 0;
_local20 = _arg1[1];
_local13 = _local10[_local22];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local22;
_local20.id.features.incidentVertex = 1;
}
public static function b2CollidePolygons(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):void{
var _local6:ClipVertex;
var _local7:int;
var _local8:Array;
var _local9:Number;
var _local10:int;
var _local11:Array;
var _local12:Number;
var _local13:b2PolygonShape;
var _local14:b2PolygonShape;
var _local15:b2XForm;
var _local16:b2XForm;
var _local17:int;
var _local18:uint;
var _local19:Number;
var _local20:Number;
var _local21:Array;
var _local22:int;
var _local23:Array;
var _local24:b2Vec2;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:b2Vec2;
var _local28:b2Vec2;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Array;
var _local33:Array;
var _local34:int;
var _local35:int;
var _local36:int;
var _local37:b2Vec2;
var _local38:Number;
var _local39:b2ManifoldPoint;
_arg1.pointCount = 0;
_local7 = 0;
_local8 = [_local7];
_local9 = FindMaxSeparation(_local8, _arg2, _arg3, _arg4, _arg5);
_local7 = _local8[0];
if (_local9 > 0){
return;
};
_local10 = 0;
_local11 = [_local10];
_local12 = FindMaxSeparation(_local11, _arg4, _arg5, _arg2, _arg3);
_local10 = _local11[0];
if (_local12 > 0){
return;
};
_local15 = new b2XForm();
_local16 = new b2XForm();
_local19 = 0.98;
_local20 = 0.001;
if (_local12 > ((_local19 * _local9) + _local20)){
_local13 = _arg4;
_local14 = _arg2;
_local15.Set(_arg5);
_local16.Set(_arg3);
_local17 = _local10;
_local18 = 1;
} else {
_local13 = _arg2;
_local14 = _arg4;
_local15.Set(_arg3);
_local16.Set(_arg5);
_local17 = _local7;
_local18 = 0;
};
_local21 = [new ClipVertex(), new ClipVertex()];
FindIncidentEdge(_local21, _local13, _local15, _local17, _local14, _local16);
_local22 = _local13.m_vertexCount;
_local23 = _local13.m_vertices;
_local24 = _local23[_local17];
_local25 = _local24.Copy();
if ((_local17 + 1) < _local22){
_local24 = _local23[int((_local17 + 1))];
_local37 = _local24.Copy();
} else {
_local24 = _local23[0];
_local37 = _local24.Copy();
};
_local26 = b2Math.SubtractVV(_local37, _local25);
_local27 = b2Math.b2MulMV(_local15.R, b2Math.SubtractVV(_local37, _local25));
_local27.Normalize();
_local28 = b2Math.b2CrossVF(_local27, 1);
_local25 = b2Math.b2MulX(_local15, _local25);
_local37 = b2Math.b2MulX(_local15, _local37);
_local29 = b2Math.b2Dot(_local28, _local25);
_local30 = -(b2Math.b2Dot(_local27, _local25));
_local31 = b2Math.b2Dot(_local27, _local37);
_local32 = [new ClipVertex(), new ClipVertex()];
_local33 = [new ClipVertex(), new ClipVertex()];
_local34 = ClipSegmentToLine(_local32, _local21, _local27.Negative(), _local30);
if (_local34 < 2){
return;
};
_local34 = ClipSegmentToLine(_local33, _local32, _local27, _local31);
if (_local34 < 2){
return;
};
_arg1.normal = (_local18) ? _local28.Negative() : _local28.Copy();
_local35 = 0;
_local36 = 0;
while (_local36 < b2Settings.b2_maxManifoldPoints) {
_local6 = _local33[_local36];
_local38 = (b2Math.b2Dot(_local28, _local6.v) - _local29);
if (_local38 <= 0){
_local39 = _arg1.points[_local35];
_local39.separation = _local38;
_local39.localPoint1 = b2Math.b2MulXT(_arg3, _local6.v);
_local39.localPoint2 = b2Math.b2MulXT(_arg5, _local6.v);
_local39.id.key = _local6.id._key;
_local39.id.features.flip = _local18;
_local35++;
};
_local36++;
};
_arg1.pointCount = _local35;
}
public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:b2Vec2;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:Number;
var _local16:int;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:int;
var _local21:Number;
var _local22:int;
var _local23:Number;
var _local24:int;
var _local25:Number;
_local6 = _arg2.m_vertexCount;
_local7 = _arg2.m_normals;
_local9 = _arg5.R;
_local8 = _arg4.m_centroid;
_local10 = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)));
_local11 = (_arg5.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y)));
_local9 = _arg3.R;
_local8 = _arg2.m_centroid;
_local10 = (_local10 - (_arg3.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y))));
_local11 = (_local11 - (_arg3.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y))));
_local12 = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y));
_local13 = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y));
_local14 = 0;
_local15 = -(Number.MAX_VALUE);
_local16 = 0;
while (_local16 < _local6) {
_local8 = _local7[_local16];
_local25 = ((_local8.x * _local12) + (_local8.y * _local13));
if (_local25 > _local15){
_local15 = _local25;
_local14 = _local16;
};
_local16++;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
_local18 = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1);
_local19 = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5);
if (_local19 > 0){
return (_local19);
};
_local20 = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0;
_local21 = EdgeSeparation(_arg2, _arg3, _local20, _arg4, _arg5);
if (_local21 > 0){
return (_local21);
};
if ((((_local19 > _local17)) && ((_local19 > _local21)))){
_local24 = -1;
_local22 = _local18;
_local23 = _local19;
} else {
if (_local21 > _local17){
_local24 = 1;
_local22 = _local20;
_local23 = _local21;
} else {
_arg1[0] = _local14;
return (_local17);
};
};
while (true) {
if (_local24 == -1){
_local14 = (((_local22 - 1) >= 0)) ? (_local22 - 1) : (_local6 - 1);
} else {
_local14 = (((_local22 + 1) < _local6)) ? (_local22 + 1) : 0;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
if (_local17 > _local23){
_local22 = _local14;
_local23 = _local17;
} else {
break;
};
};
_arg1[0] = _local22;
return (_local23);
}
public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{
var _local5:ClipVertex;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:b2Vec2;
var _local13:ClipVertex;
_local6 = 0;
_local5 = _arg2[0];
_local7 = _local5.v;
_local5 = _arg2[1];
_local8 = _local5.v;
_local9 = (b2Math.b2Dot(_arg3, _local7) - _arg4);
_local10 = (b2Math.b2Dot(_arg3, _local8) - _arg4);
if (_local9 <= 0){
var _temp1 = _local6;
_local6 = (_local6 + 1);
var _local14 = _temp1;
_arg1[_local14] = _arg2[0];
};
if (_local10 <= 0){
var _temp2 = _local6;
_local6 = (_local6 + 1);
_local14 = _temp2;
_arg1[_local14] = _arg2[1];
};
if ((_local9 * _local10) < 0){
_local11 = (_local9 / (_local9 - _local10));
_local5 = _arg1[_local6];
_local12 = _local5.v;
_local12.x = (_local7.x + (_local11 * (_local8.x - _local7.x)));
_local12.y = (_local7.y + (_local11 * (_local8.y - _local7.y)));
_local5 = _arg1[_local6];
if (_local9 > 0){
_local13 = _arg2[0];
_local5.id = _local13.id;
} else {
_local13 = _arg2[1];
_local5.id = _local13.id;
};
_local6++;
};
return (_local6);
}
public static function b2CollideCircles(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2Mat22;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:b2ManifoldPoint;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_arg1.pointCount = 0;
_local6 = _arg3.R;
_local7 = _arg2.m_localPosition;
_local8 = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local9 = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local6 = _arg5.R;
_local7 = _arg4.m_localPosition;
_local10 = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local11 = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local12 = (_local10 - _local8);
_local13 = (_local11 - _local9);
_local14 = ((_local12 * _local12) + (_local13 * _local13));
_local15 = _arg2.m_radius;
_local16 = _arg4.m_radius;
_local17 = (_local15 + _local16);
if (_local14 > (_local17 * _local17)){
return;
};
if (_local14 < Number.MIN_VALUE){
_local18 = -(_local17);
_arg1.normal.Set(0, 1);
} else {
_local24 = Math.sqrt(_local14);
_local18 = (_local24 - _local17);
_local25 = (1 / _local24);
_arg1.normal.x = (_local25 * _local12);
_arg1.normal.y = (_local25 * _local13);
};
_arg1.pointCount = 1;
_local19 = _arg1.points[0];
_local19.id.key = 0;
_local19.separation = _local18;
_local8 = (_local8 + (_local15 * _arg1.normal.x));
_local9 = (_local9 + (_local15 * _arg1.normal.y));
_local10 = (_local10 - (_local16 * _arg1.normal.x));
_local11 = (_local11 - (_local16 * _arg1.normal.y));
_local20 = (0.5 * (_local8 + _local10));
_local21 = (0.5 * (_local9 + _local11));
_local22 = (_local20 - _arg3.position.x);
_local23 = (_local21 - _arg3.position.y);
_local19.localPoint1.x = ((_local22 * _arg3.R.col1.x) + (_local23 * _arg3.R.col1.y));
_local19.localPoint1.y = ((_local22 * _arg3.R.col2.x) + (_local23 * _arg3.R.col2.y));
_local22 = (_local20 - _arg5.position.x);
_local23 = (_local21 - _arg5.position.y);
_local19.localPoint2.x = ((_local22 * _arg5.R.col1.x) + (_local23 * _arg5.R.col1.y));
_local19.localPoint2.y = ((_local22 * _arg5.R.col2.x) + (_local23 * _arg5.R.col2.y));
}
public static function b2CollidePolygonAndCircle(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2ManifoldPoint;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2Vec2;
var _local12:b2Mat22;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:Number;
var _local21:int;
var _local22:Array;
var _local23:Array;
var _local24:int;
var _local25:int;
var _local26:int;
var _local27:b2Vec2;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_arg1.pointCount = 0;
_local12 = _arg5.R;
_local11 = _arg4.m_localPosition;
_local13 = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)));
_local14 = (_arg5.position.y + ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y)));
_local7 = (_local13 - _arg3.position.x);
_local8 = (_local14 - _arg3.position.y);
_local12 = _arg3.R;
_local15 = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local16 = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local18 = 0;
_local19 = -(Number.MAX_VALUE);
_local20 = _arg4.m_radius;
_local21 = _arg2.m_vertexCount;
_local22 = _arg2.m_vertices;
_local23 = _arg2.m_normals;
_local24 = 0;
while (_local24 < _local21) {
_local11 = _local22[_local24];
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local11 = _local23[_local24];
_local34 = ((_local11.x * _local7) + (_local11.y * _local8));
if (_local34 > _local20){
return;
};
if (_local34 > _local19){
_local19 = _local34;
_local18 = _local24;
};
_local24++;
};
if (_local19 < Number.MIN_VALUE){
_arg1.pointCount = 1;
_local11 = _local23[_local18];
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y));
_arg1.normal.y = ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y));
_local6 = _arg1.points[0];
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = b2_nullFeature;
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local19 - _local20);
return;
};
_local25 = _local18;
_local26 = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0;
_local11 = _local22[_local25];
_local27 = _local22[_local26];
_local28 = (_local27.x - _local11.x);
_local29 = (_local27.y - _local11.y);
_local30 = Math.sqrt(((_local28 * _local28) + (_local29 * _local29)));
_local28 = (_local28 / _local30);
_local29 = (_local29 / _local30);
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local31 = ((_local7 * _local28) + (_local8 * _local29));
_local6 = _arg1.points[0];
if (_local31 <= 0){
_local32 = _local11.x;
_local33 = _local11.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local25;
} else {
if (_local31 >= _local30){
_local32 = _local27.x;
_local33 = _local27.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local26;
} else {
_local32 = ((_local28 * _local31) + _local11.x);
_local33 = ((_local29 * _local31) + _local11.y);
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = 0;
};
};
_local7 = (_local15 - _local32);
_local8 = (_local16 - _local33);
_local17 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local7 = (_local7 / _local17);
_local8 = (_local8 / _local17);
if (_local17 > _local20){
return;
};
_arg1.pointCount = 1;
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local7) + (_local12.col2.x * _local8));
_arg1.normal.y = ((_local12.col1.y * _local7) + (_local12.col2.y * _local8));
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local17 - _local20);
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
}
}
}//package Box2D.Collision
Section 15
//b2ContactID (Box2D.Collision.b2ContactID)
package Box2D.Collision {
public class b2ContactID {
public var _key:uint;
public var features:Features;
public function b2ContactID(){
features = new Features();
super();
features._m_id = this;
}
public function Set(_arg1:b2ContactID):void{
key = _arg1._key;
}
public function Copy():b2ContactID{
var _local1:b2ContactID;
_local1 = new b2ContactID();
_local1.key = key;
return (_local1);
}
public function get key():uint{
return (_key);
}
public function set key(_arg1:uint):void{
_key = _arg1;
features._referenceEdge = (_key & 0xFF);
features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF);
features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF);
features._flip = (((_key & 4278190080) >> 24) & 0xFF);
}
}
}//package Box2D.Collision
Section 16
//b2ContactPoint (Box2D.Collision.b2ContactPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2ContactPoint {
public var separation:Number;
public var normal:b2Vec2;
public var position:b2Vec2;
public var restitution:Number;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var id:b2ContactID;
public var friction:Number;
public var velocity:b2Vec2;
public function b2ContactPoint(){
position = new b2Vec2();
velocity = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 17
//b2Distance (Box2D.Collision.b2Distance)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2Distance {
private static var s_p2s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_points:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var gPoint:b2Point = new b2Point();
public static var g_GJK_Iterations:int = 0;
public static function InPoints(_arg1:b2Vec2, _arg2:Array, _arg3:int):Boolean{
var _local4:Number;
var _local5:int;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local4 = (100 * Number.MIN_VALUE);
_local5 = 0;
while (_local5 < _arg3) {
_local6 = _arg2[_local5];
_local7 = Math.abs((_arg1.x - _local6.x));
_local8 = Math.abs((_arg1.y - _local6.y));
_local9 = Math.max(Math.abs(_arg1.x), Math.abs(_local6.x));
_local10 = Math.max(Math.abs(_arg1.y), Math.abs(_local6.y));
if ((((_local7 < (_local4 * (_local9 + 1)))) && ((_local8 < (_local4 * (_local10 + 1)))))){
return (true);
};
_local5++;
};
return (false);
}
public static function DistanceGeneric(_arg1:b2Vec2, _arg2:b2Vec2, _arg3, _arg4:b2XForm, _arg5, _arg6:b2XForm):Number{
var _local7:b2Vec2;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:int;
var _local12:Number;
var _local13:int;
var _local14:int;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:int;
_local8 = s_p1s;
_local9 = s_p2s;
_local10 = s_points;
_local11 = 0;
_arg1.SetV(_arg3.GetFirstVertex(_arg4));
_arg2.SetV(_arg5.GetFirstVertex(_arg6));
_local12 = 0;
_local13 = 20;
_local14 = 0;
while (_local14 < _local13) {
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local17 = _arg3.Support(_arg4, _local15, _local16);
_local18 = _arg5.Support(_arg6, -(_local15), -(_local16));
_local12 = ((_local15 * _local15) + (_local16 * _local16));
_local19 = (_local18.x - _local17.x);
_local20 = (_local18.y - _local17.y);
_local21 = ((_local15 * _local19) + (_local16 * _local20));
if ((_local12 - ((_local15 * _local19) + (_local16 * _local20))) <= (0.01 * _local12)){
if (_local11 == 0){
_arg1.SetV(_local17);
_arg2.SetV(_local18);
};
g_GJK_Iterations = _local14;
return (Math.sqrt(_local12));
};
switch (_local11){
case 0:
_local7 = _local8[0];
_local7.SetV(_local17);
_local7 = _local9[0];
_local7.SetV(_local18);
_local7 = _local10[0];
_local7.x = _local19;
_local7.y = _local20;
_arg1.SetV(_local8[0]);
_arg2.SetV(_local9[0]);
_local11++;
break;
case 1:
_local7 = _local8[1];
_local7.SetV(_local17);
_local7 = _local9[1];
_local7.SetV(_local18);
_local7 = _local10[1];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessTwo(_arg1, _arg2, _local8, _local9, _local10);
break;
case 2:
_local7 = _local8[2];
_local7.SetV(_local17);
_local7 = _local9[2];
_local7.SetV(_local18);
_local7 = _local10[2];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessThree(_arg1, _arg2, _local8, _local9, _local10);
break;
};
if (_local11 == 3){
g_GJK_Iterations = _local14;
return (0);
};
_local22 = -(Number.MAX_VALUE);
_local23 = 0;
while (_local23 < _local11) {
_local7 = _local10[_local23];
_local22 = b2Math.b2Max(_local22, ((_local7.x * _local7.x) + (_local7.y * _local7.y)));
_local23++;
};
if ((((_local11 == 3)) || ((_local12 <= ((100 * Number.MIN_VALUE) * _local22))))){
g_GJK_Iterations = _local14;
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local12 = ((_local15 * _local15) + (_local16 * _local16));
return (Math.sqrt(_local12));
};
_local14++;
};
g_GJK_Iterations = _local13;
return (Math.sqrt(_local12));
}
public static function DistanceCC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2CircleShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local7 = _arg4.R;
_local8 = _arg3.m_localPosition;
_local9 = (_arg4.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local10 = (_arg4.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local7 = _arg6.R;
_local8 = _arg5.m_localPosition;
_local11 = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local12 = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = ((_local13 * _local13) + (_local14 * _local14));
_local16 = (_arg3.m_radius - b2Settings.b2_toiSlop);
_local17 = (_arg5.m_radius - b2Settings.b2_toiSlop);
_local18 = (_local16 + _local17);
if (_local15 > (_local18 * _local18)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_local20 = (_local19 - _local18);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = (_local11 - (_local17 * _local13));
_arg2.y = (_local12 - (_local17 * _local14));
return (_local20);
};
if (_local15 > (Number.MIN_VALUE * Number.MIN_VALUE)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
};
_arg1.x = _local9;
_arg1.y = _local10;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
}
public static function ProcessThree(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local14:b2Vec2;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg5[2];
_local9 = _arg3[0];
_local10 = _arg3[1];
_local11 = _arg3[2];
_local12 = _arg4[0];
_local13 = _arg4[1];
_local14 = _arg4[2];
_local15 = _local6.x;
_local16 = _local6.y;
_local17 = _local7.x;
_local18 = _local7.y;
_local19 = _local8.x;
_local20 = _local8.y;
_local21 = (_local17 - _local15);
_local22 = (_local18 - _local16);
_local23 = (_local19 - _local15);
_local24 = (_local20 - _local16);
_local25 = (_local19 - _local17);
_local26 = (_local20 - _local18);
_local27 = -(((_local15 * _local21) + (_local16 * _local22)));
_local28 = ((_local17 * _local21) + (_local18 * _local22));
_local29 = -(((_local15 * _local23) + (_local16 * _local24)));
_local30 = ((_local19 * _local23) + (_local20 * _local24));
_local31 = -(((_local17 * _local25) + (_local18 * _local26)));
_local32 = ((_local19 * _local25) + (_local20 * _local26));
if ((((_local30 <= 0)) && ((_local32 <= 0)))){
_arg1.SetV(_local11);
_arg2.SetV(_local14);
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (1);
};
_local33 = ((_local21 * _local24) - (_local22 * _local23));
_local34 = (_local33 * ((_local15 * _local18) - (_local16 * _local17)));
_local36 = (_local33 * ((_local17 * _local20) - (_local18 * _local19)));
if ((((((((_local36 <= 0)) && ((_local31 >= 0)))) && ((_local32 >= 0)))) && (((_local31 + _local32) > 0)))){
_local35 = (_local31 / (_local31 + _local32));
_arg1.x = (_local10.x + (_local35 * (_local11.x - _local10.x)));
_arg1.y = (_local10.y + (_local35 * (_local11.y - _local10.y)));
_arg2.x = (_local13.x + (_local35 * (_local14.x - _local13.x)));
_arg2.y = (_local13.y + (_local35 * (_local14.y - _local13.y)));
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (2);
};
_local37 = (_local33 * ((_local19 * _local16) - (_local20 * _local15)));
if ((((((((_local37 <= 0)) && ((_local29 >= 0)))) && ((_local30 >= 0)))) && (((_local29 + _local30) > 0)))){
_local35 = (_local29 / (_local29 + _local30));
_arg1.x = (_local9.x + (_local35 * (_local11.x - _local9.x)));
_arg1.y = (_local9.y + (_local35 * (_local11.y - _local9.y)));
_arg2.x = (_local12.x + (_local35 * (_local14.x - _local12.x)));
_arg2.y = (_local12.y + (_local35 * (_local14.y - _local12.y)));
_local10.SetV(_local11);
_local13.SetV(_local14);
_local7.SetV(_local8);
return (2);
};
_local38 = ((_local36 + _local37) + _local34);
_local38 = (1 / _local38);
_local39 = (_local36 * _local38);
_local40 = (_local37 * _local38);
_local41 = ((1 - _local39) - _local40);
_arg1.x = (((_local39 * _local9.x) + (_local40 * _local10.x)) + (_local41 * _local11.x));
_arg1.y = (((_local39 * _local9.y) + (_local40 * _local10.y)) + (_local41 * _local11.y));
_arg2.x = (((_local39 * _local12.x) + (_local40 * _local13.x)) + (_local41 * _local14.x));
_arg2.y = (((_local39 * _local12.y) + (_local40 * _local13.y)) + (_local41 * _local14.y));
return (3);
}
public static function DistancePC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2PolygonShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:b2Point;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local9 = gPoint;
_local8 = _arg5.m_localPosition;
_local7 = _arg6.R;
_local9.p.x = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local9.p.y = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local10 = DistanceGeneric(_arg1, _arg2, _arg3, _arg4, _local9, b2Math.b2XForm_identity);
_local11 = (_arg5.m_radius - b2Settings.b2_toiSlop);
if (_local10 > _local11){
_local10 = (_local10 - _local11);
_local12 = (_arg2.x - _arg1.x);
_local13 = (_arg2.y - _arg1.y);
_local14 = Math.sqrt(((_local12 * _local12) + (_local13 * _local13)));
_local12 = (_local12 / _local14);
_local13 = (_local13 / _local14);
_arg2.x = (_arg2.x - (_local11 * _local12));
_arg2.y = (_arg2.y - (_local11 * _local13));
} else {
_local10 = 0;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
};
return (_local10);
}
public static function Distance(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Shape, _arg4:b2XForm, _arg5:b2Shape, _arg6:b2XForm):Number{
var _local7:int;
var _local8:int;
_local7 = _arg3.m_type;
_local8 = _arg5.m_type;
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistanceCC(_arg1, _arg2, (_arg3 as b2CircleShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistancePC(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistancePC(_arg2, _arg1, (_arg5 as b2PolygonShape), _arg6, (_arg3 as b2CircleShape), _arg4));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistanceGeneric(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2PolygonShape), _arg6));
};
return (0);
}
public static function ProcessTwo(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg3[0];
_local9 = _arg3[1];
_local10 = _arg4[0];
_local11 = _arg4[1];
_local12 = -(_local7.x);
_local13 = -(_local7.y);
_local14 = (_local6.x - _local7.x);
_local15 = (_local6.y - _local7.y);
_local16 = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
_local14 = (_local14 / _local16);
_local15 = (_local15 / _local16);
_local17 = ((_local12 * _local14) + (_local13 * _local15));
if ((((_local17 <= 0)) || ((_local16 < Number.MIN_VALUE)))){
_arg1.SetV(_local9);
_arg2.SetV(_local11);
_local8.SetV(_local9);
_local10.SetV(_local11);
_local6.SetV(_local7);
return (1);
};
_local17 = (_local17 / _local16);
_arg1.x = (_local9.x + (_local17 * (_local8.x - _local9.x)));
_arg1.y = (_local9.y + (_local17 * (_local8.y - _local9.y)));
_arg2.x = (_local11.x + (_local17 * (_local10.x - _local11.x)));
_arg2.y = (_local11.y + (_local17 * (_local10.y - _local11.y)));
return (2);
}
}
}//package Box2D.Collision
Section 18
//b2Manifold (Box2D.Collision.b2Manifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Manifold {
public var points:Array;
public var pointCount:int;// = 0
public var normal:b2Vec2;
public function b2Manifold(){
var _local1:int;
pointCount = 0;
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ManifoldPoint();
_local1++;
};
normal = new b2Vec2();
}
public function Set(_arg1:b2Manifold):void{
var _local2:int;
pointCount = _arg1.pointCount;
_local2 = 0;
while (_local2 < b2Settings.b2_maxManifoldPoints) {
(points[_local2] as b2ManifoldPoint).Set(_arg1.points[_local2]);
_local2++;
};
normal.SetV(_arg1.normal);
}
public function Reset():void{
var _local1:int;
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
(points[_local1] as b2ManifoldPoint).Reset();
_local1++;
};
normal.SetZero();
pointCount = 0;
}
}
}//package Box2D.Collision
Section 19
//b2ManifoldPoint (Box2D.Collision.b2ManifoldPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2ManifoldPoint {
public var separation:Number;
public var localPoint2:b2Vec2;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var localPoint1:b2Vec2;
public var id:b2ContactID;
public function b2ManifoldPoint(){
localPoint1 = new b2Vec2();
localPoint2 = new b2Vec2();
id = new b2ContactID();
super();
}
public function Set(_arg1:b2ManifoldPoint):void{
localPoint1.SetV(_arg1.localPoint1);
localPoint2.SetV(_arg1.localPoint2);
separation = _arg1.separation;
normalImpulse = _arg1.normalImpulse;
tangentImpulse = _arg1.tangentImpulse;
id.key = _arg1.id.key;
}
public function Reset():void{
localPoint1.SetZero();
localPoint2.SetZero();
separation = 0;
normalImpulse = 0;
tangentImpulse = 0;
id.key = 0;
}
}
}//package Box2D.Collision
Section 20
//b2OBB (Box2D.Collision.b2OBB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2OBB {
public var R:b2Mat22;
public var center:b2Vec2;
public var extents:b2Vec2;
public function b2OBB(){
R = new b2Mat22();
center = new b2Vec2();
extents = new b2Vec2();
super();
}
}
}//package Box2D.Collision
Section 21
//b2Pair (Box2D.Collision.b2Pair)
package Box2D.Collision {
import Box2D.Common.*;
public class b2Pair {
public var userData;// = null
public var proxyId1:uint;
public var proxyId2:uint;
public var status:uint;
public var next:uint;
public static var e_pairFinal:uint = 4;
public static var b2_tableMask:int = (b2_tableCapacity - 1);
public static var e_pairRemoved:uint = 2;
public static var b2_nullPair:uint = b2Settings.USHRT_MAX;
public static var e_pairBuffered:uint = 1;
public static var b2_nullProxy:uint = b2Settings.USHRT_MAX;
public static var b2_tableCapacity:int = b2Settings.b2_maxPairs;
public function b2Pair(){
userData = null;
super();
}
public function SetBuffered():void{
status = (status | e_pairBuffered);
}
public function IsBuffered():Boolean{
return (((status & e_pairBuffered) == e_pairBuffered));
}
public function IsFinal():Boolean{
return (((status & e_pairFinal) == e_pairFinal));
}
public function ClearRemoved():void{
status = (status & ~(e_pairRemoved));
}
public function SetFinal():void{
status = (status | e_pairFinal);
}
public function IsRemoved():Boolean{
return (((status & e_pairRemoved) == e_pairRemoved));
}
public function ClearBuffered():void{
status = (status & ~(e_pairBuffered));
}
public function SetRemoved():void{
status = (status | e_pairRemoved);
}
}
}//package Box2D.Collision
Section 22
//b2PairCallback (Box2D.Collision.b2PairCallback)
package Box2D.Collision {
public class b2PairCallback {
public function PairRemoved(_arg1, _arg2, _arg3):void{
}
public function PairAdded(_arg1, _arg2){
return (null);
}
}
}//package Box2D.Collision
Section 23
//b2PairManager (Box2D.Collision.b2PairManager)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PairManager {
public var m_pairCount:int;
public var m_pairBuffer:Array;
public var m_callback:b2PairCallback;
public var m_pairs:Array;
public var m_pairBufferCount:int;
public var m_hashTable:Array;
public var m_broadPhase:b2BroadPhase;
public var m_freePair:uint;
public function b2PairManager(){
var _local1:uint;
super();
m_hashTable = new Array(b2Pair.b2_tableCapacity);
_local1 = 0;
while (_local1 < b2Pair.b2_tableCapacity) {
m_hashTable[_local1] = b2Pair.b2_nullPair;
_local1++;
};
m_pairs = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1] = new b2Pair();
_local1++;
};
m_pairBuffer = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairBuffer[_local1] = new b2BufferedPair();
_local1++;
};
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy;
m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy;
m_pairs[_local1].userData = null;
m_pairs[_local1].status = 0;
m_pairs[_local1].next = (_local1 + 1);
_local1++;
};
m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair;
m_pairCount = 0;
m_pairBufferCount = 0;
}
private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{
var _local4:b2Pair;
var _local5:uint;
_local5 = m_hashTable[_arg3];
_local4 = m_pairs[_local5];
while (((!((_local5 == b2Pair.b2_nullPair))) && ((Equals(_local4, _arg1, _arg2) == false)))) {
_local5 = _local4.next;
_local4 = m_pairs[_local5];
};
if (_local5 == b2Pair.b2_nullPair){
return (null);
};
return (_local4);
}
private function Find(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:uint;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
return (FindHash(_arg1, _arg2, _local3));
}
private function ValidateBuffer():void{
}
public function Commit():void{
var _local1:b2BufferedPair;
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:b2Pair;
var _local6:b2Proxy;
var _local7:b2Proxy;
_local3 = 0;
_local4 = m_broadPhase.m_proxyPool;
_local2 = 0;
while (_local2 < m_pairBufferCount) {
_local1 = m_pairBuffer[_local2];
_local5 = Find(_local1.proxyId1, _local1.proxyId2);
_local5.ClearBuffered();
_local6 = _local4[_local5.proxyId1];
_local7 = _local4[_local5.proxyId2];
if (_local5.IsRemoved()){
if (_local5.IsFinal() == true){
m_callback.PairRemoved(_local6.userData, _local7.userData, _local5.userData);
};
_local1 = m_pairBuffer[_local3];
_local1.proxyId1 = _local5.proxyId1;
_local1.proxyId2 = _local5.proxyId2;
_local3++;
} else {
if (_local5.IsFinal() == false){
_local5.userData = m_callback.PairAdded(_local6.userData, _local7.userData);
_local5.SetFinal();
};
};
_local2++;
};
_local2 = 0;
while (_local2 < _local3) {
_local1 = m_pairBuffer[_local2];
RemovePair(_local1.proxyId1, _local1.proxyId2);
_local2++;
};
m_pairBufferCount = 0;
if (b2BroadPhase.s_validate){
ValidateTable();
};
}
public function RemoveBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = Find(_arg1, _arg2);
if (_local4 == null){
return;
};
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.SetRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function RemovePair(_arg1:uint, _arg2:uint){
var _local3:b2Pair;
var _local4:uint;
var _local5:uint;
var _local6:b2Pair;
var _local7:uint;
var _local8:uint;
var _local9:*;
if (_arg1 > _arg2){
_local7 = _arg1;
_arg1 = _arg2;
_arg2 = _local7;
};
_local4 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local5 = m_hashTable[_local4];
_local6 = null;
while (_local5 != b2Pair.b2_nullPair) {
if (Equals(m_pairs[_local5], _arg1, _arg2)){
_local8 = _local5;
_local3 = m_pairs[_local5];
if (_local6){
_local6.next = _local3.next;
} else {
m_hashTable[_local4] = _local3.next;
};
_local3 = m_pairs[_local8];
_local9 = _local3.userData;
_local3.next = m_freePair;
_local3.proxyId1 = b2Pair.b2_nullProxy;
_local3.proxyId2 = b2Pair.b2_nullProxy;
_local3.userData = null;
_local3.status = 0;
m_freePair = _local8;
m_pairCount--;
return (_local9);
} else {
_local6 = m_pairs[_local5];
_local5 = _local6.next;
};
};
return (null);
}
public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{
m_broadPhase = _arg1;
m_callback = _arg2;
}
public function AddBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = AddPair(_arg1, _arg2);
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.ClearRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function AddPair(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:b2Pair;
var _local5:uint;
var _local6:uint;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local4 = FindHash(_arg1, _arg2, _local3);
if (_local4 != null){
return (_local4);
};
_local5 = m_freePair;
_local4 = m_pairs[_local5];
m_freePair = _local4.next;
_local4.proxyId1 = _arg1;
_local4.proxyId2 = _arg2;
_local4.status = 0;
_local4.userData = null;
_local4.next = m_hashTable[_local3];
m_hashTable[_local3] = _local5;
m_pairCount++;
return (_local4);
}
private function ValidateTable():void{
}
public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{
return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2))));
}
public static function Hash(_arg1:uint, _arg2:uint):uint{
var _local3:uint;
_local3 = (((_arg2 << 16) & 4294901760) | _arg1);
_local3 = (~(_local3) + ((_local3 << 15) & 4294934528));
_local3 = (_local3 ^ ((_local3 >> 12) & 1048575));
_local3 = (_local3 + ((_local3 << 2) & 4294967292));
_local3 = (_local3 ^ ((_local3 >> 4) & 268435455));
_local3 = (_local3 * 2057);
_local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF));
return (_local3);
}
public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{
return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3))));
}
}
}//package Box2D.Collision
Section 24
//b2Point (Box2D.Collision.b2Point)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Point {
public var p:b2Vec2;
public function b2Point(){
p = new b2Vec2();
super();
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (p);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
return (p);
}
}
}//package Box2D.Collision
Section 25
//b2Proxy (Box2D.Collision.b2Proxy)
package Box2D.Collision {
public class b2Proxy {
public var overlapCount:uint;
public var lowerBounds:Array;
public var upperBounds:Array;
public var userData;// = null
public var timeStamp:uint;
public function b2Proxy(){
lowerBounds = [uint(0), uint(0)];
upperBounds = [uint(0), uint(0)];
userData = null;
super();
}
public function GetNext():uint{
return (lowerBounds[0]);
}
public function IsValid():Boolean{
return (!((overlapCount == b2BroadPhase.b2_invalid)));
}
public function SetNext(_arg1:uint):void{
lowerBounds[0] = (_arg1 & 0xFFFF);
}
}
}//package Box2D.Collision
Section 26
//b2Segment (Box2D.Collision.b2Segment)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Segment {
public var p1:b2Vec2;
public var p2:b2Vec2;
public function b2Segment(){
p1 = new b2Vec2();
p2 = new b2Vec2();
super();
}
public function TestSegment(_arg1:Array, _arg2:b2Vec2, _arg3:b2Segment, _arg4:Number):Boolean{
var _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local5 = _arg3.p1;
_local6 = (_arg3.p2.x - _local5.x);
_local7 = (_arg3.p2.y - _local5.y);
_local8 = (p2.x - p1.x);
_local9 = (p2.y - p1.y);
_local10 = _local9;
_local11 = -(_local8);
_local12 = (100 * Number.MIN_VALUE);
_local13 = -(((_local6 * _local10) + (_local7 * _local11)));
if (_local13 > _local12){
_local14 = (_local5.x - p1.x);
_local15 = (_local5.y - p1.y);
_local16 = ((_local14 * _local10) + (_local15 * _local11));
if ((((0 <= _local16)) && ((_local16 <= (_arg4 * _local13))))){
_local17 = ((-(_local7) * _local15) + (_local7 * _local14));
if (((((-(_local12) * _local13) <= _local17)) && ((_local17 <= (_local13 * (1 + _local12)))))){
_local16 = (_local16 / _local13);
_local18 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
_local10 = (_local10 / _local18);
_local11 = (_local11 / _local18);
_arg1[0] = _local16;
_arg2.Set(_local10, _local11);
return (true);
};
};
};
return (false);
}
}
}//package Box2D.Collision
Section 27
//b2TimeOfImpact (Box2D.Collision.b2TimeOfImpact)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2TimeOfImpact {
public static var s_xf1:b2XForm = new b2XForm();
public static var s_xf2:b2XForm = new b2XForm();
public static var s_p1:b2Vec2 = new b2Vec2();
public static var s_p2:b2Vec2 = new b2Vec2();
public static function TimeOfImpact(_arg1:b2Shape, _arg2:b2Sweep, _arg3:b2Shape, _arg4:b2Sweep):Number{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:int;
var _local20:int;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:b2XForm;
var _local27:b2XForm;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
_local7 = _arg1.m_sweepRadius;
_local8 = _arg3.m_sweepRadius;
_local9 = _arg2.t0;
_local10 = (_arg2.c.x - _arg2.c0.x);
_local11 = (_arg2.c.y - _arg2.c0.y);
_local12 = (_arg4.c.x - _arg4.c0.x);
_local13 = (_arg4.c.y - _arg4.c0.y);
_local14 = (_arg2.a - _arg2.a0);
_local15 = (_arg4.a - _arg4.a0);
_local16 = 0;
_local17 = s_p1;
_local18 = s_p2;
_local19 = 20;
_local20 = 0;
_local21 = 0;
_local22 = 0;
_local23 = 0;
_local24 = 0;
while (true) {
_local25 = (((1 - _local16) * _local9) + _local16);
_local26 = s_xf1;
_local27 = s_xf2;
_arg2.GetXForm(_local26, _local25);
_arg4.GetXForm(_local27, _local25);
_local23 = b2Distance.Distance(_local17, _local18, _arg1, _local26, _arg3, _local27);
if (_local20 == 0){
if (_local23 > (2 * b2Settings.b2_toiSlop)){
_local24 = (1.5 * b2Settings.b2_toiSlop);
} else {
_local5 = (0.05 * b2Settings.b2_toiSlop);
_local6 = (_local23 - (0.5 * b2Settings.b2_toiSlop));
_local24 = ((_local5 > _local6)) ? _local5 : _local6;
};
};
if (((((_local23 - _local24) < (0.05 * b2Settings.b2_toiSlop))) || ((_local20 == _local19)))){
break;
};
_local21 = (_local18.x - _local17.x);
_local22 = (_local18.y - _local17.y);
_local28 = Math.sqrt(((_local21 * _local21) + (_local22 * _local22)));
_local21 = (_local21 / _local28);
_local22 = (_local22 / _local28);
_local29 = ((((_local21 * (_local10 - _local12)) + (_local22 * (_local11 - _local13))) + (((_local14 < 0)) ? -(_local14) : _local14 * _local7)) + (((_local15 < 0)) ? -(_local15) : _local15 * _local8));
if (_local29 == 0){
_local16 = 1;
break;
};
_local30 = ((_local23 - _local24) / _local29);
_local31 = (_local16 + _local30);
if ((((_local31 < 0)) || ((1 < _local31)))){
_local16 = 1;
break;
};
if (_local31 < ((1 + (100 * Number.MIN_VALUE)) * _local16)){
break;
};
_local16 = _local31;
_local20++;
};
return (_local16);
}
}
}//package Box2D.Collision
Section 28
//ClipVertex (Box2D.Collision.ClipVertex)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class ClipVertex {
public var v:b2Vec2;
public var id:b2ContactID;
public function ClipVertex(){
v = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 29
//Features (Box2D.Collision.Features)
package Box2D.Collision {
public class Features {
public var _referenceEdge:int;
public var _incidentEdge:int;
public var _flip:int;
public var _incidentVertex:int;
public var _m_id:b2ContactID;
public function get referenceEdge():int{
return (_referenceEdge);
}
public function set incidentVertex(_arg1:int):void{
_incidentVertex = _arg1;
_m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000));
}
public function get flip():int{
return (_flip);
}
public function get incidentEdge():int{
return (_incidentEdge);
}
public function set referenceEdge(_arg1:int):void{
_referenceEdge = _arg1;
_m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF));
}
public function set flip(_arg1:int):void{
_flip = _arg1;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function get incidentVertex():int{
return (_incidentVertex);
}
public function set incidentEdge(_arg1:int):void{
_incidentEdge = _arg1;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 30
//b2Mat22 (Box2D.Common.Math.b2Mat22)
package Box2D.Common.Math {
public class b2Mat22 {
public var col1:b2Vec2;
public var col2:b2Vec2;
public function b2Mat22(_arg1:Number=0, _arg2:b2Vec2=null, _arg3:b2Vec2=null){
var _local4:Number;
var _local5:Number;
col1 = new b2Vec2();
col2 = new b2Vec2();
super();
if (((!((_arg2 == null))) && (!((_arg3 == null))))){
col1.SetV(_arg2);
col2.SetV(_arg3);
} else {
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
col1.x = _local4;
col2.x = -(_local5);
col1.y = _local5;
col2.y = _local4;
};
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col1.y = 0;
col2.y = 1;
}
public function Set(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
col1.x = _local2;
col2.x = -(_local3);
col1.y = _local3;
col2.y = _local2;
}
public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col1.y = 0;
col2.y = 0;
}
public function SetM(_arg1:b2Mat22):void{
col1.SetV(_arg1.col1);
col2.SetV(_arg1.col2);
}
public function AddM(_arg1:b2Mat22):void{
col1.x = (col1.x + _arg1.col1.x);
col1.y = (col1.y + _arg1.col1.y);
col2.x = (col2.x + _arg1.col2.x);
col2.y = (col2.y + _arg1.col2.y);
}
public function Abs():void{
col1.Abs();
col2.Abs();
}
public function Copy():b2Mat22{
return (new b2Mat22(0, col1, col2));
}
public function Invert(_arg1:b2Mat22):b2Mat22{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = col1.x;
_local3 = col2.x;
_local4 = col1.y;
_local5 = col2.y;
_local6 = ((_local2 * _local5) - (_local3 * _local4));
_local6 = (1 / _local6);
_arg1.col1.x = (_local6 * _local5);
_arg1.col2.x = (-(_local6) * _local3);
_arg1.col1.y = (-(_local6) * _local4);
_arg1.col2.y = (_local6 * _local2);
return (_arg1);
}
public function GetAngle():Number{
return (Math.atan2(col1.y, col1.x));
}
public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = col1.x;
_local5 = col2.x;
_local6 = col1.y;
_local7 = col2.y;
_local8 = ((_local4 * _local7) - (_local5 * _local6));
_local8 = (1 / _local8);
_arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3)));
_arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2)));
return (_arg1);
}
}
}//package Box2D.Common.Math
Section 31
//b2Math (Box2D.Common.Math.b2Math)
package Box2D.Common.Math {
public class b2Math {
public static const b2Mat22_identity:b2Mat22 = new b2Mat22(0, new b2Vec2(1, 0), new b2Vec2(0, 1));
public static const b2XForm_identity:b2XForm = new b2XForm(b2Vec2_zero, b2Mat22_identity);
public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0, 0);
public static function b2CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x));
return (_local3);
}
public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y));
return (_local3);
}
public static function b2IsValid(_arg1:Number):Boolean{
return (isFinite(_arg1));
}
public static function b2MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Min(_arg1.x, _arg2.x), b2Min(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2MulX(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = b2MulMV(_arg1.R, _arg2);
_local3.x = (_local3.x + _arg1.position.x);
_local3.y = (_local3.y + _arg1.position.y);
return (_local3);
}
public static function b2DistanceSquared(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (((_local3 * _local3) + (_local4 * _local4)));
}
public static function b2Swap(_arg1:Array, _arg2:Array):void{
var _local3:*;
_local3 = _arg1[0];
_arg1[0] = _arg2[0];
_arg2[0] = _local3;
}
public static function b2AbsM(_arg1:b2Mat22):b2Mat22{
var _local2:b2Mat22;
_local2 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2));
return (_local2);
}
public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
return (_local3);
}
public static function b2MulXT(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
_local3 = SubtractVV(_arg2, _arg1.position);
_local4 = ((_local3.x * _arg1.R.col1.x) + (_local3.y * _arg1.R.col1.y));
_local3.y = ((_local3.x * _arg1.R.col2.x) + (_local3.y * _arg1.R.col2.y));
_local3.x = _local4;
return (_local3);
}
public static function b2Abs(_arg1:Number):Number{
return (((_arg1 > 0)) ? _arg1 : -(_arg1));
}
public static function b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (b2Max(_arg2, b2Min(_arg1, _arg3)));
}
public static function b2AbsV(_arg1:b2Vec2):b2Vec2{
var _local2:b2Vec2;
_local2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y));
return (_local2);
}
public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y));
return (_local3);
}
public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x));
return (_local3);
}
public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2));
return (_local3);
}
public static function b2Distance(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2Mat22;
_local3 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1));
_local4 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2));
_local5 = new b2Mat22(0, _local3, _local4);
return (_local5);
}
public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2IsPowerOfTwo(_arg1:uint):Boolean{
var _local2:Boolean;
_local2 = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0)));
return (_local2);
}
public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{
return (b2MaxV(_arg2, b2MinV(_arg1, _arg3)));
}
public static function b2RandomRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = Math.random();
_local3 = (((_arg2 - _arg1) * _local3) + _arg1);
return (_local3);
}
public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Dot(_arg2, _arg1.col1), b2Dot(_arg2, _arg1.col2));
return (_local3);
}
public static function b2Min(_arg1:Number, _arg2:Number):Number{
return (((_arg1 < _arg2)) ? _arg1 : _arg2);
}
public static function b2Random():Number{
return (((Math.random() * 2) - 1));
}
public static function b2MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, b2MulMV(_arg1, _arg2.col1), b2MulMV(_arg1, _arg2.col2));
return (_local3);
}
public static function b2NextPowerOfTwo(_arg1:uint):uint{
_arg1 = (_arg1 | ((_arg1 >> 1) & 2147483647));
_arg1 = (_arg1 | ((_arg1 >> 2) & 1073741823));
_arg1 = (_arg1 | ((_arg1 >> 4) & 268435455));
_arg1 = (_arg1 | ((_arg1 >> 8) & 0xFFFFFF));
_arg1 = (_arg1 | ((_arg1 >> 16) & 0xFFFF));
return ((_arg1 + 1));
}
public static function b2Max(_arg1:Number, _arg2:Number):Number{
return (((_arg1 > _arg2)) ? _arg1 : _arg2);
}
public static function b2MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y)));
return (_local3);
}
}
}//package Box2D.Common.Math
Section 32
//b2Sweep (Box2D.Common.Math.b2Sweep)
package Box2D.Common.Math {
public class b2Sweep {
public var localCenter:b2Vec2;
public var c:b2Vec2;
public var a:Number;
public var c0:b2Vec2;
public var a0:Number;
public var t0:Number;
public function b2Sweep(){
localCenter = new b2Vec2();
c0 = new b2Vec2();
c = new b2Vec2();
super();
}
public function Advance(_arg1:Number):void{
var _local2:Number;
if ((((t0 < _arg1)) && (((1 - t0) > Number.MIN_VALUE)))){
_local2 = ((_arg1 - t0) / (1 - t0));
c0.x = (((1 - _local2) * c0.x) + (_local2 * c.x));
c0.y = (((1 - _local2) * c0.y) + (_local2 * c.y));
a0 = (((1 - _local2) * a0) + (_local2 * a));
t0 = _arg1;
};
}
public function GetXForm(_arg1:b2XForm, _arg2:Number):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
if ((1 - t0) > Number.MIN_VALUE){
_local4 = ((_arg2 - t0) / (1 - t0));
_arg1.position.x = (((1 - _local4) * c0.x) + (_local4 * c.x));
_arg1.position.y = (((1 - _local4) * c0.y) + (_local4 * c.y));
_local5 = (((1 - _local4) * a0) + (_local4 * a));
_arg1.R.Set(_local5);
} else {
_arg1.position.SetV(c);
_arg1.R.Set(a);
};
_local3 = _arg1.R;
_arg1.position.x = (_arg1.position.x - ((_local3.col1.x * localCenter.x) + (_local3.col2.x * localCenter.y)));
_arg1.position.y = (_arg1.position.y - ((_local3.col1.y * localCenter.x) + (_local3.col2.y * localCenter.y)));
}
}
}//package Box2D.Common.Math
Section 33
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
public class b2Vec2 {
public var x:Number;
public var y:Number;
public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Set(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function Length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function LengthSquared():Number{
return (((x * x) + (y * y)));
}
public function SetZero():void{
x = 0;
y = 0;
}
public function Add(_arg1:b2Vec2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function MaxV(_arg1:b2Vec2):void{
x = ((x > _arg1.x)) ? x : _arg1.x;
y = ((y > _arg1.y)) ? y : _arg1.y;
}
public function SetV(_arg1:b2Vec2):void{
x = _arg1.x;
y = _arg1.y;
}
public function Negative():b2Vec2{
return (new b2Vec2(-(x), -(y)));
}
public function CrossVF(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (_arg1 * y);
y = (-(_arg1) * _local2);
}
public function Abs():void{
if (x < 0){
x = -(x);
};
if (y < 0){
y = -(y);
};
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function MulTM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = b2Math.b2Dot(this, _arg1.col1);
y = b2Math.b2Dot(this, _arg1.col2);
x = _local2;
}
public function IsValid():Boolean{
return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y))));
}
public function MinV(_arg1:b2Vec2):void{
x = ((x < _arg1.x)) ? x : _arg1.x;
y = ((y < _arg1.y)) ? y : _arg1.y;
}
public function MulM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = x;
x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y));
y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y));
}
public function Normalize():Number{
var _local1:Number;
var _local2:Number;
_local1 = Math.sqrt(((x * x) + (y * y)));
if (_local1 < Number.MIN_VALUE){
return (0);
};
_local2 = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
return (_local1);
}
public function Subtract(_arg1:b2Vec2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function CrossFV(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (-(_arg1) * y);
y = (_arg1 * _local2);
}
public static function Make(_arg1:Number, _arg2:Number):b2Vec2{
return (new b2Vec2(_arg1, _arg2));
}
}
}//package Box2D.Common.Math
Section 34
//b2XForm (Box2D.Common.Math.b2XForm)
package Box2D.Common.Math {
public class b2XForm {
public var R:b2Mat22;
public var position:b2Vec2;
public function b2XForm(_arg1:b2Vec2=null, _arg2:b2Mat22=null):void{
position = new b2Vec2();
R = new b2Mat22();
super();
if (_arg1){
position.SetV(_arg1);
R.SetM(_arg2);
};
}
public function Initialize(_arg1:b2Vec2, _arg2:b2Mat22):void{
position.SetV(_arg1);
R.SetM(_arg2);
}
public function Set(_arg1:b2XForm):void{
position.SetV(_arg1.position);
R.SetM(_arg1.R);
}
public function SetIdentity():void{
position.SetZero();
R.SetIdentity();
}
}
}//package Box2D.Common.Math
Section 35
//b2Color (Box2D.Common.b2Color)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Color {
private var _g:uint;// = 0
private var _b:uint;// = 0
private var _r:uint;// = 0
public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){
_r = 0;
_g = 0;
_b = 0;
super();
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function get color():uint{
return (((_r | (_g << 8)) | (_b << 16)));
}
public function set r(_arg1:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set b(_arg1:Number):void{
_b = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set g(_arg1:Number):void{
_g = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
}
}//package Box2D.Common
Section 36
//b2Settings (Box2D.Common.b2Settings)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Settings {
public static const b2_angularSleepTolerance:Number = 0.0111111111111111;
public static const b2_linearSleepTolerance:Number = 0.01;
public static const b2_angularSlop:Number = 0.0349065850398866;
public static const b2_linearSlop:Number = 0.005;
public static const b2_pi:Number = 3.14159265358979;
public static const b2_maxProxies:int = 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.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
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.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
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.Collision.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var points:Array;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var normal:b2Vec2;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
var _local1:int;
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 40
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
public class b2ContactConstraintPoint {
public var r2:b2Vec2;
public var separation:Number;
public var positionImpulse:Number;
public var normalImpulse:Number;
public var equalizedMass:Number;
public var tangentMass:Number;
public var tangentImpulse:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var normalMass:Number;
public var velocityBias:Number;
public var r1:b2Vec2;
public function b2ContactConstraintPoint(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
r1 = new b2Vec2();
r2 = new b2Vec2();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 41
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var next:b2ContactEdge;
public var other:b2Body;
public var contact:b2Contact;
public var prev:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 42
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn:Function;
public var destroyFcn:Function;
}
}//package Box2D.Dynamics.Contacts
Section 43
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
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.Collision.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2ContactSolver {
public var m_constraintCount:int;
public var m_constraints:Array;
public var m_allocator;
public var m_step:b2TimeStep;
public function b2ContactSolver(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4){
var _local5:b2Contact;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Mat22;
var _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.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
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.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
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.Common.Math.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
public class b2Body {
public var m_next:b2Body;
public var m_contactList:b2ContactEdge;
public var m_angularVelocity:Number;
public var m_shapeList:b2Shape;
public var m_force:b2Vec2;
public var m_mass:Number;
public var m_sweep:b2Sweep;
public var m_xf:b2XForm;
public var m_torque:Number;
public var m_userData;
public var m_flags:uint;
public var m_world:b2World;
public var m_prev:b2Body;
public var m_invMass:Number;
public var m_type:int;
public var m_linearDamping:Number;
public var m_angularDamping:Number;
public var m_invI:Number;
public var m_linearVelocity:b2Vec2;
public var m_sleepTime:Number;
public var m_shapeCount:int;
public var m_jointList:b2JointEdge;
public var m_I:Number;
public static var e_fixedRotationFlag:uint = 64;
public static var e_frozenFlag:uint = 2;
public static var e_maxTypes:uint = 3;
public static var e_sleepFlag:uint = 8;
private static var s_massData:b2MassData = new b2MassData();
public static var e_bulletFlag:uint = 32;
public static var e_staticType:uint = 1;
public static var e_islandFlag:uint = 4;
public static var e_allowSleepFlag:uint = 16;
private static var s_xf1:b2XForm = new b2XForm();
public static var e_dynamicType:uint = 2;
public function b2Body(_arg1:b2BodyDef, _arg2:b2World){
var _local3:b2Mat22;
var _local4:b2Vec2;
m_xf = new b2XForm();
m_sweep = new b2Sweep();
m_linearVelocity = new b2Vec2();
m_force = new b2Vec2();
super();
m_flags = 0;
if (_arg1.isBullet){
m_flags = (m_flags | e_bulletFlag);
};
if (_arg1.fixedRotation){
m_flags = (m_flags | e_fixedRotationFlag);
};
if (_arg1.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (_arg1.isSleeping){
m_flags = (m_flags | e_sleepFlag);
};
m_world = _arg2;
m_xf.position.SetV(_arg1.position);
m_xf.R.Set(_arg1.angle);
m_sweep.localCenter.SetV(_arg1.massData.center);
m_sweep.t0 = 1;
m_sweep.a0 = (m_sweep.a = _arg1.angle);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_jointList = null;
m_contactList = null;
m_prev = null;
m_next = null;
m_linearDamping = _arg1.linearDamping;
m_angularDamping = _arg1.angularDamping;
m_force.Set(0, 0);
m_torque = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_sleepTime = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.massData.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.massData.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
m_userData = _arg1.userData;
m_shapeList = null;
m_shapeCount = 0;
}
public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_arg1.x - m_sweep.c.x)))));
}
public function SetLinearVelocity(_arg1:b2Vec2):void{
m_linearVelocity.SetV(_arg1);
}
public function WakeUp():void{
m_flags = (m_flags & ~(e_sleepFlag));
m_sleepTime = 0;
}
public function GetLocalCenter():b2Vec2{
return (m_sweep.localCenter);
}
public function ApplyTorque(_arg1:Number):void{
if (IsSleeping()){
WakeUp();
};
m_torque = (m_torque + _arg1);
}
public function IsFrozen():Boolean{
return (((m_flags & e_frozenFlag) == e_frozenFlag));
}
public function IsDynamic():Boolean{
return ((m_type == e_dynamicType));
}
public function GetLinearVelocity():b2Vec2{
return (m_linearVelocity);
}
public function SynchronizeTransform():void{
var _local1:b2Mat22;
var _local2:b2Vec2;
m_xf.R.Set(m_sweep.a);
_local1 = m_xf.R;
_local2 = m_sweep.localCenter;
m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y)));
m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y)));
}
public function GetInertia():Number{
return (m_I);
}
public function IsSleeping():Boolean{
return (((m_flags & e_sleepFlag) == e_sleepFlag));
}
public function SetMassFromShapes():void{
var _local1:b2Shape;
var _local2:Number;
var _local3:Number;
var _local4:b2MassData;
var _local5:b2Mat22;
var _local6:b2Vec2;
var _local7:int;
if (m_world.m_lock == true){
return;
};
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
_local2 = 0;
_local3 = 0;
_local4 = s_massData;
_local1 = m_shapeList;
while (_local1) {
_local1.ComputeMass(_local4);
m_mass = (m_mass + _local4.mass);
_local2 = (_local2 + (_local4.mass * _local4.center.x));
_local3 = (_local3 + (_local4.mass * _local4.center.y));
m_I = (m_I + _local4.I);
_local1 = _local1.m_next;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
_local2 = (_local2 * m_invMass);
_local3 = (_local3 * m_invMass);
};
if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (m_I - (m_mass * ((_local2 * _local2) + (_local3 * _local3))));
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
m_sweep.localCenter.Set(_local2, _local3);
_local5 = m_xf.R;
_local6 = m_sweep.localCenter;
m_sweep.c.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y));
m_sweep.c.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local1 = m_shapeList;
while (_local1) {
_local1.UpdateSweepRadius(m_sweep.localCenter);
_local1 = _local1.m_next;
};
_local7 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local7 != m_type){
_local1 = m_shapeList;
while (_local1) {
_local1.RefilterProxy(m_world.m_broadPhase, m_xf);
_local1 = _local1.m_next;
};
};
}
public function PutToSleep():void{
m_flags = (m_flags | e_sleepFlag);
m_sleepTime = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_force.SetZero();
m_torque = 0;
}
public function GetJointList():b2JointEdge{
return (m_jointList);
}
public function SetXForm(_arg1:b2Vec2, _arg2:Number):Boolean{
var _local3:b2Shape;
var _local4:b2Mat22;
var _local5:b2Vec2;
var _local6:Boolean;
var _local7:Boolean;
if (m_world.m_lock == true){
return (true);
};
if (IsFrozen()){
return (false);
};
m_xf.R.Set(_arg2);
m_xf.position.SetV(_arg1);
_local4 = m_xf.R;
_local5 = m_sweep.localCenter;
m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y));
m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_sweep.a0 = (m_sweep.a = _arg2);
_local6 = false;
_local3 = m_shapeList;
while (_local3) {
_local7 = _local3.Synchronize(m_world.m_broadPhase, m_xf, m_xf);
if (_local7 == false){
_local6 = true;
break;
};
_local3 = _local3.m_next;
};
if (_local6 == true){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local3 = m_shapeList;
while (_local3) {
_local3.DestroyProxy(m_world.m_broadPhase);
_local3 = _local3.m_next;
};
return (false);
};
m_world.m_broadPhase.Commit();
return (true);
}
public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulXT(m_xf, _arg1));
}
public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_force.x = (m_force.x + _arg1.x);
m_force.y = (m_force.y + _arg1.y);
m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)));
}
public function SynchronizeShapes():Boolean{
var _local1:b2XForm;
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:b2Shape;
var _local5:Boolean;
_local1 = s_xf1;
_local1.R.Set(m_sweep.a0);
_local2 = _local1.R;
_local3 = m_sweep.localCenter;
_local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y)));
_local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y)));
_local5 = true;
_local4 = m_shapeList;
while (_local4) {
_local5 = _local4.Synchronize(m_world.m_broadPhase, _local1, m_xf);
if (_local5 == false){
break;
};
_local4 = _local4.m_next;
};
if (_local5 == false){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local4 = m_shapeList;
while (_local4) {
_local4.DestroyProxy(m_world.m_broadPhase);
_local4 = _local4.m_next;
};
return (false);
};
return (true);
}
public function GetAngle():Number{
return (m_sweep.a);
}
public function GetXForm():b2XForm{
return (m_xf);
}
public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x));
m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y));
m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))));
}
public function GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_local3.x - m_sweep.c.x)))));
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function SetAngularVelocity(_arg1:Number):void{
m_angularVelocity = _arg1;
}
public function SetMass(_arg1:b2MassData):void{
var _local2:b2Shape;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
if (m_world.m_lock == true){
return;
};
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
m_sweep.localCenter.SetV(_arg1.center);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local2 = m_shapeList;
while (_local2) {
_local2.UpdateSweepRadius(m_sweep.localCenter);
_local2 = _local2.m_next;
};
_local5 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local5 != m_type){
_local2 = m_shapeList;
while (_local2) {
_local2.RefilterProxy(m_world.m_broadPhase, m_xf);
_local2 = _local2.m_next;
};
};
}
public function IsStatic():Boolean{
return ((m_type == e_staticType));
}
public function GetWorldVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulMV(m_xf.R, _arg1));
}
public function GetShapeList():b2Shape{
return (m_shapeList);
}
public function Advance(_arg1:Number):void{
m_sweep.Advance(_arg1);
m_sweep.c.SetV(m_sweep.c0);
m_sweep.a = m_sweep.a0;
SynchronizeTransform();
}
public function SetBullet(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_bulletFlag);
} else {
m_flags = (m_flags & ~(e_bulletFlag));
};
}
public function CreateShape(_arg1:b2ShapeDef):b2Shape{
var _local2:b2Shape;
if (m_world.m_lock == true){
return (null);
};
_local2 = b2Shape.Create(_arg1, m_world.m_blockAllocator);
_local2.m_next = m_shapeList;
m_shapeList = _local2;
m_shapeCount++;
_local2.m_body = this;
_local2.CreateProxy(m_world.m_broadPhase, m_xf);
_local2.UpdateSweepRadius(m_sweep.localCenter);
return (_local2);
}
public function IsConnected(_arg1:b2Body):Boolean{
var _local2:b2JointEdge;
_local2 = m_jointList;
while (_local2) {
if (_local2.other == _arg1){
return ((_local2.joint.m_collideConnected == false));
};
_local2 = _local2.next;
};
return (false);
}
public function DestroyShape(_arg1:b2Shape):void{
var _local2:b2Shape;
var _local3:b2Shape;
var _local4:Boolean;
if (m_world.m_lock == true){
return;
};
_arg1.DestroyProxy(m_world.m_broadPhase);
_local2 = m_shapeList;
_local3 = null;
_local4 = false;
while (_local2 != null) {
if (_local2 == _arg1){
if (_local3){
_local3.m_next = _arg1.m_next;
} else {
m_shapeList = _arg1.m_next;
};
_local4 = true;
break;
};
_local3 = _local2;
_local2 = _local2.m_next;
};
_arg1.m_body = null;
_arg1.m_next = null;
m_shapeCount--;
b2Shape.Destroy(_arg1, m_world.m_blockAllocator);
}
public function GetUserData(){
return (m_userData);
}
public function IsBullet():Boolean{
return (((m_flags & e_bulletFlag) == e_bulletFlag));
}
public function GetWorldCenter():b2Vec2{
return (m_sweep.c);
}
public function AllowSleeping(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
WakeUp();
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetLocalVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_xf.R, _arg1));
}
public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (_local3);
}
public function GetWorld():b2World{
return (m_world);
}
public function GetPosition():b2Vec2{
return (m_xf.position);
}
}
}//package Box2D.Dynamics
Section 65
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2BodyDef {
public var isSleeping:Boolean;
public var position:b2Vec2;
public var isBullet:Boolean;
public var allowSleep:Boolean;
public var userData;
public var angularDamping:Number;
public var fixedRotation:Boolean;
public var angle:Number;
public var linearDamping:Number;
public var massData:b2MassData;
public function b2BodyDef(){
massData = new b2MassData();
position = new b2Vec2();
super();
massData.center.SetZero();
massData.mass = 0;
massData.I = 0;
userData = null;
position.Set(0, 0);
angle = 0;
linearDamping = 0;
angularDamping = 0;
allowSleep = true;
isSleeping = false;
fixedRotation = false;
isBullet = false;
}
}
}//package Box2D.Dynamics
Section 66
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener)
package Box2D.Dynamics {
public class b2BoundaryListener {
public function Violation(_arg1:b2Body):void{
}
}
}//package Box2D.Dynamics
Section 67
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
public class b2ContactFilter {
public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function 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.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import com.actionsnippet.qbox.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2ContactListener {
public function Add(_arg1:b2ContactPoint):void{
var _local2:Array;
if (((((_arg1.shape1.GetBody().GetUserData().name as String) == "Player")) || (((_arg1.shape2.GetBody().GetUserData().name as String) == "Player")))){
if (global.GravityDirection == "Down"){
if ((((_arg1.normal.y >= -1)) && ((_arg1.normal.y < 0)))){
global.grounded = true;
};
} else {
if (global.GravityDirection == "Up"){
if ((((_arg1.normal.y <= 1)) && ((_arg1.normal.y > 0)))){
global.grounded = true;
};
} else {
if (global.GravityDirection == "Left"){
if ((((_arg1.normal.x <= 1)) && ((_arg1.normal.x > 0)))){
global.grounded = true;
};
} else {
if (global.GravityDirection == "Right"){
if ((((_arg1.normal.x >= -1)) && ((_arg1.normal.x < 0)))){
global.grounded = true;
};
};
};
};
};
};
_local2 = new Array();
if (global.currentLevel < 15){
_local2 = _arg1.shape2.GetBody().GetUserData().name.split("&");
if (((((_arg1.shape1.GetBody().GetUserData().name as String) == "Shell")) && ((_local2[0] == "Target")))){
global.EnemyHP[_local2[1]] = (global.EnemyHP[_local2[1]] - global.WeaponDamage);
global.TargetHit = true;
global.Shape1Body = _arg1.shape1.GetBody();
global.Shape2Body = _arg1.shape2.GetBody();
global.Shape1Sprite = _arg1.shape1.GetBody().GetUserData();
global.Shape2Sprite = _arg1.shape2.GetBody().GetUserData();
};
} else {
_local2 = _arg1.shape1.GetBody().GetUserData().name.split("&");
if (((((_arg1.shape2.GetBody().GetUserData().name as String) == "Shell")) && ((_local2[0] == "Target")))){
global.EnemyHP[_local2[1]] = (global.EnemyHP[_local2[1]] - global.WeaponDamage);
global.TargetHit = true;
global.Shape1Body = _arg1.shape1.GetBody();
global.Shape2Body = _arg1.shape2.GetBody();
global.Shape1Sprite = _arg1.shape1.GetBody().GetUserData();
global.Shape2Sprite = _arg1.shape2.GetBody().GetUserData();
};
if (((((_arg1.shape1.GetBody().GetUserData().name as String) == "PlayerHitBox")) && (((_arg1.shape2.GetBody().GetUserData().name as String) == "EnemyShell")))){
global.PlayerHit = true;
global.Shape1Body = _arg1.shape1.GetBody();
global.Shape2Body = _arg1.shape2.GetBody();
global.Shape1Sprite = _arg1.shape1.GetBody().GetUserData();
global.Shape2Sprite = _arg1.shape2.GetBody().GetUserData();
};
};
if (((((((_arg1.shape1.GetBody().GetUserData().name as String) == "GoalPlatform")) || (((_arg1.shape1.GetBody().GetUserData().name as String) == "GoalCrate")))) && (((((_arg1.shape2.GetBody().GetUserData().name as String) == "GoalPlatform")) || (((_arg1.shape2.GetBody().GetUserData().name as String) == "GoalCrate")))))){
global.CrateOnGoal = true;
};
}
public function Remove(_arg1:b2ContactPoint):void{
if (((((_arg1.shape1.GetBody().GetUserData().name as String) == "Player")) || (((_arg1.shape2.GetBody().GetUserData().name as String) == "Player")))){
global.grounded = false;
};
if (((((_arg1.shape2.GetBody().GetUserData().name as String) == "Shell")) && (((_arg1.shape1.GetBody().GetUserData().name as String) == "BottomWall")))){
global.ShellGroundBounce = true;
};
if (((((_arg1.shape2.GetBody().GetUserData().name as String) == "Crate")) && (((_arg1.shape1.GetBody().GetUserData().name as String) == "BottomWall")))){
global.CrateGroundBounce = true;
};
if (((((_arg1.shape2.GetBody().GetUserData().name as String) == "GoalCrate")) && (((_arg1.shape1.GetBody().GetUserData().name as String) == "BottomWall")))){
global.CrateGroundBounce = true;
};
if (((((_arg1.shape2.GetBody().GetUserData().name as String) == "Crate")) && (((_arg1.shape1.GetBody().GetUserData().name as String) == "LeftWall")))){
global.CrateGroundBounce = true;
};
if (((((_arg1.shape2.GetBody().GetUserData().name as String) == "GoalCrate")) && (((_arg1.shape1.GetBody().GetUserData().name as String) == "LeftWall")))){
global.CrateGroundBounce = true;
};
if (((((_arg1.shape2.GetBody().GetUserData().name as String) == "Crate")) && (((_arg1.shape1.GetBody().GetUserData().name as String) == "RightWall")))){
global.CrateGroundBounce = true;
};
if (((((_arg1.shape2.GetBody().GetUserData().name as String) == "GoalCrate")) && (((_arg1.shape1.GetBody().GetUserData().name as String) == "RightWall")))){
global.CrateGroundBounce = true;
};
if (((((_arg1.shape2.GetBody().GetUserData().name as String) == "GoalPlatform")) && (((_arg1.shape1.GetBody().GetUserData().name as String) == "Crate")))){
global.CrateGroundBounce = true;
};
if (((((_arg1.shape2.GetBody().GetUserData().name as String) == "GoalPlatform")) && (((_arg1.shape1.GetBody().GetUserData().name as String) == "GoalCrate")))){
global.CrateGroundBounce = true;
};
if (((((((_arg1.shape1.GetBody().GetUserData().name as String) == "GoalPlatform")) || (((_arg1.shape1.GetBody().GetUserData().name as String) == "GoalCrate")))) && (((((_arg1.shape2.GetBody().GetUserData().name as String) == "GoalPlatform")) || (((_arg1.shape2.GetBody().GetUserData().name as String) == "GoalCrate")))))){
global.CrateOnGoal = false;
};
}
public function Persist(_arg1:b2ContactPoint):void{
if (((((_arg1.shape1.GetBody().GetUserData().name as String) == "Player")) || (((_arg1.shape2.GetBody().GetUserData().name as String) == "Player")))){
if (global.GravityDirection == "Down"){
if ((((_arg1.normal.y >= -1)) && ((_arg1.normal.y < 0)))){
global.grounded = true;
};
} else {
if (global.GravityDirection == "Up"){
if ((((_arg1.normal.y <= 1)) && ((_arg1.normal.y > 0)))){
global.grounded = true;
};
} else {
if (global.GravityDirection == "Left"){
if ((((_arg1.normal.x <= 1)) && ((_arg1.normal.x > 0)))){
global.grounded = true;
};
} else {
if (global.GravityDirection == "Right"){
if ((((_arg1.normal.x >= -1)) && ((_arg1.normal.x < 0)))){
global.grounded = true;
};
};
};
};
};
};
if (((((((_arg1.shape1.GetBody().GetUserData().name as String) == "GoalPlatform")) || (((_arg1.shape1.GetBody().GetUserData().name as String) == "GoalCrate")))) && (((((_arg1.shape2.GetBody().GetUserData().name as String) == "GoalPlatform")) || (((_arg1.shape2.GetBody().GetUserData().name as String) == "GoalCrate")))))){
global.CrateOnGoal = true;
};
}
public function Result(_arg1:b2ContactResult):void{
}
}
}//package Box2D.Dynamics
Section 69
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.Shapes.*;
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 Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import flash.display.*;
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.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Common.*;
public class b2Island {
public var m_joints:Array;
public var m_listener:b2ContactListener;
public var m_positionIterationCount:int;
public var m_bodyCapacity:int;
public var m_bodies:Array;
public var m_jointCapacity:int;
public var m_contactCount:int;
public var m_contacts:Array;
public var m_contactCapacity:int;
public var m_jointCount:int;
public var m_allocator;
public var m_bodyCount:int;
private static var s_reportCR:b2ContactResult = new b2ContactResult();
public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener){
var _local6:int;
super();
m_bodyCapacity = _arg1;
m_contactCapacity = _arg2;
m_jointCapacity = _arg3;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_allocator = _arg4;
m_listener = _arg5;
m_bodies = new Array(_arg1);
_local6 = 0;
while (_local6 < _arg1) {
m_bodies[_local6] = null;
_local6++;
};
m_contacts = new Array(_arg2);
_local6 = 0;
while (_local6 < _arg2) {
m_contacts[_local6] = null;
_local6++;
};
m_joints = new Array(_arg3);
_local6 = 0;
while (_local6 < _arg3) {
m_joints[_local6] = null;
_local6++;
};
m_positionIterationCount = 0;
}
public function AddBody(_arg1:b2Body):void{
var _local2 = m_bodyCount++;
m_bodies[_local2] = _arg1;
}
public function AddJoint(_arg1:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = _arg1;
}
public function Report(_arg1:Array):void{
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:int;
var _local5:b2Contact;
var _local6:b2ContactConstraint;
var _local7:b2ContactResult;
var _local8:b2Body;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2ContactConstraintPoint;
if (m_listener == null){
return;
};
_local4 = 0;
while (_local4 < m_contactCount) {
_local5 = m_contacts[_local4];
_local6 = _arg1[_local4];
_local7 = s_reportCR;
_local7.shape1 = _local5.m_shape1;
_local7.shape2 = _local5.m_shape2;
_local8 = _local7.shape1.m_body;
_local9 = _local5.m_manifoldCount;
_local10 = _local5.GetManifolds();
_local11 = 0;
while (_local11 < _local9) {
_local12 = _local10[_local11];
_local7.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local15 = _local6.points[_local13];
_local7.position = _local8.GetWorldPoint(_local14.localPoint1);
_local7.normalImpulse = _local15.normalImpulse;
_local7.tangentImpulse = _local15.tangentImpulse;
_local7.id.key = _local14.id.key;
m_listener.Result(_local7);
_local13++;
};
_local11++;
};
_local4++;
};
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{
var _local5:int;
var _local6:b2Body;
var _local7:b2Joint;
var _local8:b2ContactSolver;
var _local9:int;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x))));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y))));
_local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque));
_local6.m_force.SetZero();
_local6.m_torque = 0;
_local6.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1));
_local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1));
if (_local6.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){
_local6.m_linearVelocity.Normalize();
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity);
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity);
};
if ((_local6.m_angularVelocity * _local6.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){
if (_local6.m_angularVelocity < 0){
_local6.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity);
} else {
_local6.m_angularVelocity = b2Settings.b2_maxAngularVelocity;
};
};
};
_local5++;
};
_local8 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local8.InitVelocityConstraints(_arg1);
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitVelocityConstraints(_arg1);
_local5++;
};
_local5 = 0;
while (_local5 < _arg1.maxIterations) {
_local8.SolveVelocityConstraints();
_local9 = 0;
while (_local9 < m_jointCount) {
_local7 = m_joints[_local9];
_local7.SolveVelocityConstraints(_arg1);
_local9++;
};
_local5++;
};
_local8.FinalizeVelocityConstraints();
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_sweep.c0.SetV(_local6.m_sweep.c);
_local6.m_sweep.a0 = _local6.m_sweep.a;
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y));
_local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity));
_local6.SynchronizeTransform();
};
_local5++;
};
if (_arg3){
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitPositionConstraints();
_local5++;
};
m_positionIterationCount = 0;
while (m_positionIterationCount < _arg1.maxIterations) {
_local10 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local11 = true;
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local12 = _local7.SolvePositionConstraints();
_local11 = ((_local11) && (_local12));
_local5++;
};
if (((_local10) && (_local11))){
break;
};
m_positionIterationCount++;
};
};
Report(_local8.m_constraints);
if (_arg4){
_local13 = Number.MAX_VALUE;
_local14 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
_local15 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.m_invMass == 0){
} else {
if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){
_local6.m_sleepTime = 0;
_local13 = 0;
};
if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local15)))) || ((b2Math.b2Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local14)))){
_local6.m_sleepTime = 0;
_local13 = 0;
} else {
_local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt);
_local13 = b2Math.b2Min(_local13, _local6.m_sleepTime);
};
};
_local5++;
};
if (_local13 >= b2Settings.b2_timeToSleep){
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
m_bodies[_local5].m_flags = (_local6.m_flags | b2Body.e_sleepFlag);
_local6.m_linearVelocity.SetZero();
_local6.m_angularVelocity = 0;
_local5++;
};
};
};
}
public function AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:int;
var _local3:b2ContactSolver;
var _local4:Number;
var _local5:b2Body;
var _local6:Boolean;
_local3 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local3.SolveVelocityConstraints();
_local2++;
};
_local2 = 0;
while (_local2 < m_bodyCount) {
_local5 = m_bodies[_local2];
if (_local5.IsStatic()){
} else {
_local5.m_sweep.c0.SetV(_local5.m_sweep.c);
_local5.m_sweep.a0 = _local5.m_sweep.a;
_local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_arg1.dt * _local5.m_linearVelocity.x));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_arg1.dt * _local5.m_linearVelocity.y));
_local5.m_sweep.a = (_local5.m_sweep.a + (_arg1.dt * _local5.m_angularVelocity));
_local5.SynchronizeTransform();
};
_local2++;
};
_local4 = 0.75;
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local6 = _local3.SolvePositionConstraints(_local4);
if (_local6){
break;
};
_local2++;
};
Report(_local3.m_constraints);
}
}
}//package Box2D.Dynamics
Section 73
//b2TimeStep (Box2D.Dynamics.b2TimeStep)
package Box2D.Dynamics {
public class b2TimeStep {
public var warmStarting:Boolean;
public var positionCorrection:Boolean;
public var dt:Number;
public var maxIterations:int;
public var dtRatio:Number;
public var inv_dt:Number;
}
}//package Box2D.Dynamics
Section 74
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Common.*;
public class b2World {
public var m_inv_dt0:Number;
public var m_boundaryListener:b2BoundaryListener;
public var m_contactList:b2Contact;
public var m_blockAllocator;
public var m_contactListener:b2ContactListener;
public var m_allowSleep:Boolean;
public var m_broadPhase:b2BroadPhase;
public var m_destructionListener:b2DestructionListener;
public var m_jointCount:int;
public var m_bodyCount:int;
public var m_lock:Boolean;
public var m_positionIterationCount:int;
public var m_groundBody:b2Body;
public var m_contactCount:int;
public var m_debugDraw:b2DebugDraw;
public var m_contactFilter:b2ContactFilter;
public var m_bodyList:b2Body;
public var m_stackAllocator;
public var m_jointList:b2Joint;
public var m_gravity:b2Vec2;
public var m_contactManager:b2ContactManager;
private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8);
public static var m_continuousPhysics:Boolean;
public static var m_warmStarting:Boolean;
private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6);
public static var m_positionCorrection:Boolean;
private static var s_xf:b2XForm = new b2XForm();
public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){
var _local4:b2BodyDef;
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 SetContactFilter(_arg1:b2ContactFilter):void{
m_contactFilter = _arg1;
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{
var _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 GetContactCount():int{
return (m_contactCount);
}
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 SetGravity(_arg1:b2Vec2):void{
m_gravity = _arg1;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactEdge;
var _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 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 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 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
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function concatObjects(... _args):Object{
var _local2:Object;
var _local3:Object;
var _local4:int;
var _local5:String;
_local2 = {};
_local4 = 0;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function isInArray(_arg1:String, _arg2:Array):Boolean{
var _local3:uint;
var _local4:uint;
_local3 = _arg2.length;
_local4 = 0;
while (_local4 < _local3) {
if (_arg2[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
public static function getObjectLength(_arg1:Object):uint{
var _local2:uint;
var _local3:String;
_local2 = 0;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
}
}//package caurina.transitions
Section 76
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5, _arg6));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5, _arg6));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4));
}
}
}//package caurina.transitions
Section 77
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var valueComplete:Number;
public var modifierFunction:Function;
public var hasModifier:Boolean;
public var valueStart:Number;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Function, _arg4:Array){
valueStart = _arg1;
valueComplete = _arg2;
hasModifier = Boolean(_arg3);
modifierFunction = _arg3;
modifierParameters = _arg4;
}
public function toString():String{
var _local1:String;
_local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj;
_local1 = new PropertyInfoObj(valueStart, valueComplete, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 78
//SpecialPropertiesDefault (caurina.transitions.SpecialPropertiesDefault)
package caurina.transitions {
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
public class SpecialPropertiesDefault {
public function SpecialPropertiesDefault(){
trace("SpecialProperties is a static class and should not be instantiated.");
}
public static function _sound_volume_get(_arg1:Object):Number{
return (_arg1.soundTransform.volume);
}
public static function _color_splitter(_arg1, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
if (_arg1 == null){
_local3.push({name:"_color_ra", value:1});
_local3.push({name:"_color_rb", value:0});
_local3.push({name:"_color_ga", value:1});
_local3.push({name:"_color_gb", value:0});
_local3.push({name:"_color_ba", value:1});
_local3.push({name:"_color_bb", value:0});
} else {
_local3.push({name:"_color_ra", value:0});
_local3.push({name:"_color_rb", value:AuxFunctions.numberToR(_arg1)});
_local3.push({name:"_color_ga", value:0});
_local3.push({name:"_color_gb", value:AuxFunctions.numberToG(_arg1)});
_local3.push({name:"_color_ba", value:0});
_local3.push({name:"_color_bb", value:AuxFunctions.numberToB(_arg1)});
};
return (_local3);
}
public static function frame_get(_arg1:Object):Number{
return (_arg1.currentFrame);
}
public static function _sound_pan_get(_arg1:Object):Number{
return (_arg1.soundTransform.pan);
}
public static function _color_property_get(_arg1:Object, _arg2:Array):Number{
return (_arg1.transform.colorTransform[_arg2[0]]);
}
public static function _sound_volume_set(_arg1:Object, _arg2:Number):void{
var _local3:SoundTransform;
_local3 = _arg1.soundTransform;
_local3.volume = _arg2;
_arg1.soundTransform = _local3;
}
public static function _autoAlpha_get(_arg1:Object):Number{
return (_arg1.alpha);
}
public static function _filter_splitter(_arg1:BitmapFilter, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
if ((_arg1 is BlurFilter)){
_local3.push({name:"_blur_blurX", value:BlurFilter(_arg1).blurX});
_local3.push({name:"_blur_blurY", value:BlurFilter(_arg1).blurY});
_local3.push({name:"_blur_quality", value:BlurFilter(_arg1).quality});
} else {
trace("??");
};
return (_local3);
}
public static function init():void{
Tweener.registerSpecialProperty("_frame", frame_get, frame_set);
Tweener.registerSpecialProperty("_sound_volume", _sound_volume_get, _sound_volume_set);
Tweener.registerSpecialProperty("_sound_pan", _sound_pan_get, _sound_pan_set);
Tweener.registerSpecialProperty("_color_ra", _color_property_get, _color_property_set, ["redMultiplier"]);
Tweener.registerSpecialProperty("_color_rb", _color_property_get, _color_property_set, ["redOffset"]);
Tweener.registerSpecialProperty("_color_ga", _color_property_get, _color_property_set, ["greenMultiplier"]);
Tweener.registerSpecialProperty("_color_gb", _color_property_get, _color_property_set, ["greenOffset"]);
Tweener.registerSpecialProperty("_color_ba", _color_property_get, _color_property_set, ["blueMultiplier"]);
Tweener.registerSpecialProperty("_color_bb", _color_property_get, _color_property_set, ["blueOffset"]);
Tweener.registerSpecialProperty("_color_aa", _color_property_get, _color_property_set, ["alphaMultiplier"]);
Tweener.registerSpecialProperty("_color_ab", _color_property_get, _color_property_set, ["alphaOffset"]);
Tweener.registerSpecialProperty("_autoAlpha", _autoAlpha_get, _autoAlpha_set);
Tweener.registerSpecialPropertySplitter("_color", _color_splitter);
Tweener.registerSpecialPropertySplitter("_colorTransform", _colorTransform_splitter);
Tweener.registerSpecialPropertySplitter("_scale", _scale_splitter);
Tweener.registerSpecialProperty("_blur_blurX", _filter_property_get, _filter_property_set, [BlurFilter, "blurX"]);
Tweener.registerSpecialProperty("_blur_blurY", _filter_property_get, _filter_property_set, [BlurFilter, "blurY"]);
Tweener.registerSpecialProperty("_blur_quality", _filter_property_get, _filter_property_set, [BlurFilter, "quality"]);
Tweener.registerSpecialPropertySplitter("_filter", _filter_splitter);
Tweener.registerSpecialPropertyModifier("_bezier", _bezier_modifier, _bezier_get);
}
public static function _sound_pan_set(_arg1:Object, _arg2:Number):void{
var _local3:SoundTransform;
_local3 = _arg1.soundTransform;
_local3.pan = _arg2;
_arg1.soundTransform = _local3;
}
public static function _color_property_set(_arg1:Object, _arg2:Number, _arg3:Array):void{
var _local4:ColorTransform;
_local4 = _arg1.transform.colorTransform;
_local4[_arg3[0]] = _arg2;
_arg1.transform.colorTransform = _local4;
}
public static function _filter_property_get(_arg1:Object, _arg2:Array):Number{
var _local3:Array;
var _local4:uint;
var _local5:Object;
var _local6:String;
var _local7:Object;
_local3 = _arg1.filters;
_local5 = _arg2[0];
_local6 = _arg2[1];
_local4 = 0;
while (_local4 < _local3.length) {
if ((((_local3[_local4] is BlurFilter)) && ((_local5 == BlurFilter)))){
return (_local3[_local4][_local6]);
};
_local4++;
};
switch (_local5){
case BlurFilter:
_local7 = {blurX:0, blurY:0, quality:NaN};
break;
};
return (_local7[_local6]);
}
public static function _bezier_get(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Array):Number{
var _local5:uint;
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg4.length == 1){
return ((_arg1 + (_arg3 * (((2 * (1 - _arg3)) * (_arg4[0] - _arg1)) + (_arg3 * (_arg2 - _arg1))))));
};
_local5 = Math.floor((_arg3 * _arg4.length));
_local6 = ((_arg3 - (_local5 * (1 / _arg4.length))) * _arg4.length);
if (_local5 == 0){
_local7 = _arg1;
_local8 = ((_arg4[0] + _arg4[1]) / 2);
} else {
if (_local5 == (_arg4.length - 1)){
_local7 = ((_arg4[(_local5 - 1)] + _arg4[_local5]) / 2);
_local8 = _arg2;
} else {
_local7 = ((_arg4[(_local5 - 1)] + _arg4[_local5]) / 2);
_local8 = ((_arg4[_local5] + _arg4[(_local5 + 1)]) / 2);
};
};
return ((_local7 + (_local6 * (((2 * (1 - _local6)) * (_arg4[_local5] - _local7)) + (_local6 * (_local8 - _local7))))));
}
public static function frame_set(_arg1:Object, _arg2:Number):void{
_arg1.gotoAndStop(Math.round(_arg2));
}
public static function _filter_property_set(_arg1:Object, _arg2:Number, _arg3:Array):void{
var _local4:Array;
var _local5:uint;
var _local6:Object;
var _local7:String;
var _local8:BitmapFilter;
_local4 = _arg1.filters;
_local6 = _arg3[0];
_local7 = _arg3[1];
_local5 = 0;
while (_local5 < _local4.length) {
if ((((_local4[_local5] is BlurFilter)) && ((_local6 == BlurFilter)))){
_local4[_local5][_local7] = _arg2;
_arg1.filters = _local4;
return;
};
_local5++;
};
if (_local4 == null){
_local4 = new Array();
};
switch (_local6){
case BlurFilter:
_local8 = new BlurFilter(0, 0);
break;
};
_local8[_local7] = _arg2;
_local4.push(_local8);
_arg1.filters = _local4;
}
public static function _autoAlpha_set(_arg1:Object, _arg2:Number):void{
_arg1.alpha = _arg2;
_arg1.visible = (_arg2 > 0);
}
public static function _scale_splitter(_arg1:Number, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
_local3.push({name:"scaleX", value:_arg1});
_local3.push({name:"scaleY", value:_arg1});
return (_local3);
}
public static function _colorTransform_splitter(_arg1, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
if (_arg1 == null){
_local3.push({name:"_color_ra", value:1});
_local3.push({name:"_color_rb", value:0});
_local3.push({name:"_color_ga", value:1});
_local3.push({name:"_color_gb", value:0});
_local3.push({name:"_color_ba", value:1});
_local3.push({name:"_color_bb", value:0});
} else {
if (_arg1.ra != undefined){
_local3.push({name:"_color_ra", value:_arg1.ra});
};
if (_arg1.rb != undefined){
_local3.push({name:"_color_rb", value:_arg1.rb});
};
if (_arg1.ga != undefined){
_local3.push({name:"_color_ba", value:_arg1.ba});
};
if (_arg1.gb != undefined){
_local3.push({name:"_color_bb", value:_arg1.bb});
};
if (_arg1.ba != undefined){
_local3.push({name:"_color_ga", value:_arg1.ga});
};
if (_arg1.bb != undefined){
_local3.push({name:"_color_gb", value:_arg1.gb});
};
if (_arg1.aa != undefined){
_local3.push({name:"_color_aa", value:_arg1.aa});
};
if (_arg1.ab != undefined){
_local3.push({name:"_color_ab", value:_arg1.ab});
};
};
return (_local3);
}
public static function _bezier_modifier(_arg1):Array{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:String;
var _local6:Object;
_local2 = [];
if ((_arg1 is Array)){
_local3 = _arg1;
} else {
_local3 = [_arg1];
};
_local6 = {};
_local4 = 0;
while (_local4 < _local3.length) {
for (_local5 in _local3[_local4]) {
if (_local6[_local5] == undefined){
_local6[_local5] = [];
};
_local6[_local5].push(_local3[_local4][_local5]);
};
_local4++;
};
for (_local5 in _local6) {
_local2.push({name:_local5, parameters:_local6[_local5]});
};
return (_local2);
}
}
}//package caurina.transitions
Section 79
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var setValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 80
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 81
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 82
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
var _local4:SpecialPropertyModifier;
if (!_inited){
init();
};
_local4 = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null):void{
var _local5:SpecialProperty;
if (!_inited){
init();
};
_local5 = new SpecialProperty(_arg2, _arg3, _arg4);
_specialPropertyList[_arg1] = _local5;
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:Function;
var _local11:TweenListObj;
var _local12:Number;
var _local13:String;
if ((((arguments.length < 2)) || ((arguments[0] == undefined)))){
return (false);
};
_local4 = new Array();
if ((arguments[0] is Array)){
_local5 = 0;
while (_local5 < arguments[0].length) {
_local4.push(arguments[0][_local5]);
_local5++;
};
} else {
_local5 = 0;
while (_local5 < (arguments.length - 1)) {
_local4.push(arguments[_local5]);
_local5++;
};
};
_local7 = arguments[(arguments.length - 1)];
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local8 = (isNaN(_local7.time)) ? 0 : _local7.time;
_local9 = (isNaN(_local7.delay)) ? 0 : _local7.delay;
if (typeof(_local7.transition) == "string"){
_local13 = _local7.transition.toLowerCase();
_local10 = _transitionList[_local13];
} else {
_local10 = _local7.transition;
};
if (!Boolean(_local10)){
_local10 = _transitionList["easeoutexpo"];
};
_local5 = 0;
while (_local5 < _local4.length) {
_local11 = new TweenListObj(_local4[_local5], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), (_local7.useFrames == true), _local10);
_local11.properties = null;
_local11.onStart = _local7.onStart;
_local11.onUpdate = _local7.onUpdate;
_local11.onComplete = _local7.onComplete;
_local11.onOverwrite = _local7.onOverwrite;
_local11.onStartParams = _local7.onStartParams;
_local11.onUpdateParams = _local7.onUpdateParams;
_local11.onCompleteParams = _local7.onCompleteParams;
_local11.onOverwriteParams = _local7.onOverwriteParams;
_local11.isCaller = true;
_local11.count = _local7.count;
_local11.waitFrames = _local7.waitFrames;
_tweenList.push(_local11);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local12 = (_tweenList.length - 1);
updateTweenByIndex(_local12);
removeTweenByIndex(_local12);
};
_local5++;
};
return (true);
}
public static function init(_arg1=null):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
SpecialPropertiesDefault.init();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function pauseAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local3:TweenListObj;
var _local4:TweenListObj;
var _local5:uint;
var _local6:String;
var _local7:Boolean;
_local3 = _tweenList[_arg1];
_local4 = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
_local2.timeStart = (_local2.timeStart + (_currentTime - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_currentTime - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function debug_getList():String{
var _local1:String;
var _local2:uint;
var _local3:uint;
_local1 = "";
_local2 = 0;
while (_local2 < _tweenList.length) {
_local1 = (_local1 + (("[" + _local2) + "] ::\n"));
_local3 = 0;
while (_local3 < _tweenList[_local2].properties.length) {
_local1 = (_local1 + ((((" " + _tweenList[_local2].properties[_local3].name) + " -> ") + _tweenList[_local2].properties[_local3].valueComplete) + "\n"));
_local3++;
};
_local2++;
};
return (_local1);
}
public static function getVersion():String{
return ("AS3 1.26.62");
}
public static function onEnterFrame(_arg1:Event):void{
var _local2:Boolean;
updateTime();
_local2 = false;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var isOver:Boolean;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
isOver = false;
if (_currentTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(_currentTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (_currentTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
try {
tTweening.onStart.apply(tScope, tTweening.onStartParams);
} catch(e:Error) {
handleError(tTweening, e, "onStart");
};
};
for (pName in tTweening.properties) {
pv = getPropertyValue(tScope, pName);
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (_currentTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (_currentTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
setPropertyValue(tScope, pName, nv);
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
try {
tTweening.onUpdate.apply(tScope, tTweening.onUpdateParams);
} catch(e:Error) {
handleError(tTweening, e, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
try {
tTweening.onComplete.apply(tScope, tTweening.onCompleteParams);
} catch(e:Error) {
handleError(tTweening, e, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_tweenList[_local2].timeStart = (_currentTime - (((_currentTime - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_currentTime - (((_currentTime - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_currentTime - (((_currentTime - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
try {
pTweening.onError.apply(pTweening.scope, [pTweening.scope, pError]);
} catch(metaError:Error) {
trace("## [Tweener] Error:", pTweening.scope, "raised an error while executing the 'onError' handler. Original error:\n", pError.getStackTrace(), "\nonError error:", metaError.getStackTrace());
};
} else {
if (!Boolean(pTweening.onError)){
trace("## [Tweener] Error: :", pTweening.scope, (("raised an error while executing the'" + pCallBackName) + "'handler. \n"), pError.getStackTrace());
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
updateTime();
}
public static function removeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:String;
var _local8:String;
var _local9:Object;
var _local10:Number;
var _local11:Number;
var _local12:Array;
var _local13:Object;
var _local14:Object;
var _local15:Function;
var _local16:Object;
var _local17:TweenListObj;
var _local18:Number;
var _local19:Array;
var _local20:Array;
var _local21:String;
if ((((arguments.length < 2)) || ((arguments[0] == undefined)))){
return (false);
};
_local4 = new Array();
if ((arguments[0] is Array)){
_local5 = 0;
while (_local5 < arguments[0].length) {
_local4.push(arguments[0][_local5]);
_local5++;
};
} else {
_local5 = 0;
while (_local5 < (arguments.length - 1)) {
_local4.push(arguments[_local5]);
_local5++;
};
};
_local9 = TweenListObj.makePropertiesChain(arguments[(arguments.length - 1)]);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local10 = (isNaN(_local9.time)) ? 0 : _local9.time;
_local11 = (isNaN(_local9.delay)) ? 0 : _local9.delay;
_local12 = new Array();
_local13 = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true};
_local14 = new Object();
for (_local7 in _local9) {
if (!_local13[_local7]){
if (_specialPropertySplitterList[_local7]){
_local19 = _specialPropertySplitterList[_local7].splitValues(_local9[_local7], _specialPropertySplitterList[_local7].parameters);
_local5 = 0;
while (_local5 < _local19.length) {
_local12[_local19[_local5].name] = {valueStart:undefined, valueComplete:_local19[_local5].value};
_local5++;
};
} else {
if (_specialPropertyModifierList[_local7] != undefined){
_local20 = _specialPropertyModifierList[_local7].modifyValues(_local9[_local7]);
_local5 = 0;
while (_local5 < _local20.length) {
_local14[_local20[_local5].name] = {modifierParameters:_local20[_local5].parameters, modifierFunction:_specialPropertyModifierList[_local7].getValue};
_local5++;
};
} else {
_local12[_local7] = {valueStart:undefined, valueComplete:_local9[_local7]};
};
};
};
};
for (_local7 in _local14) {
if (_local12[_local7] != undefined){
_local12[_local7].modifierParameters = _local14[_local7].modifierParameters;
_local12[_local7].modifierFunction = _local14[_local7].modifierFunction;
};
};
if (typeof(_local9.transition) == "string"){
_local21 = _local9.transition.toLowerCase();
_local15 = _transitionList[_local21];
} else {
_local15 = _local9.transition;
};
if (!Boolean(_local15)){
_local15 = _transitionList["easeoutexpo"];
};
_local5 = 0;
while (_local5 < _local4.length) {
_local16 = new Object();
for (_local7 in _local12) {
_local16[_local7] = new PropertyInfoObj(_local12[_local7].valueStart, _local12[_local7].valueComplete, _local12[_local7].modifierFunction, _local12[_local7].modifierParameters);
};
_local17 = new TweenListObj(_local4[_local5], (_currentTime + ((_local11 * 1000) / _timeScale)), (_currentTime + (((_local11 * 1000) + (_local10 * 1000)) / _timeScale)), (_local9.useFrames == true), _local15);
_local17.properties = _local16;
_local17.onStart = _local9.onStart;
_local17.onUpdate = _local9.onUpdate;
_local17.onComplete = _local9.onComplete;
_local17.onOverwrite = _local9.onOverwrite;
_local17.onError = _local9.onError;
_local17.onStartParams = _local9.onStartParams;
_local17.onUpdateParams = _local9.onUpdateParams;
_local17.onCompleteParams = _local9.onCompleteParams;
_local17.onOverwriteParams = _local9.onOverwriteParams;
_local17.rounded = _local9.rounded;
_local17.skipUpdates = _local9.skipUpdates;
removeTweensByTime(_local17.scope, _local17.properties, _local17.timeStart, _local17.timeComplete);
_tweenList.push(_local17);
if ((((_local10 == 0)) && ((_local11 == 0)))){
_local18 = (_tweenList.length - 1);
updateTweenByIndex(_local18);
removeTweenByIndex(_local18);
};
_local5++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local4:Boolean;
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
_local4 = false;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
var _local4:Array;
if (!Boolean(_tweenList)){
return ([]);
};
_local4 = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == _arg1){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
private static function setPropertyValue(_arg1:Object, _arg2:String, _arg3:Number):void{
if (_specialPropertyList[_arg2] != undefined){
if (Boolean(_specialPropertyList[_arg2].parameters)){
_specialPropertyList[_arg2].setValue(_arg1, _arg3, _specialPropertyList[_arg2].parameters);
} else {
_specialPropertyList[_arg2].setValue(_arg1, _arg3);
};
} else {
_arg1[_arg2] = _arg3;
};
}
private static function getPropertyValue(_arg1:Object, _arg2:String):Number{
if (_specialPropertyList[_arg2] != undefined){
if (Boolean(_specialPropertyList[_arg2].parameters)){
return (_specialPropertyList[_arg2].getValue(_arg1, _specialPropertyList[_arg2].parameters));
};
return (_specialPropertyList[_arg2].getValue(_arg1));
} else {
};
return (!NULL!);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == _arg1){
return (true);
};
_local2++;
};
return (false);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
var _local3:Number;
if (!Boolean(_tweenList)){
return (0);
};
_local3 = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (_tweenList[_local2].scope == _arg1){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
global.ScrollerMoving = false;
_engineExists = false;
_tweenList = null;
_currentTime = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = _currentTime;
_local2.isPaused = true;
return (true);
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removed:Boolean;
var removedLocally:Boolean;
var i:uint;
var tl:uint;
var pName:String;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
removed = false;
tl = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
try {
_tweenList[i].onOverwrite.apply(_tweenList[i].scope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
var _local4:SpecialPropertySplitter;
if (!_inited){
init();
};
_local4 = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 83
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var onUpdate:Function;
public var useFrames:Boolean;
public var hasStarted:Boolean;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var count:Number;
public var auxProperties:Object;
public var timeComplete:Number;
public var onStartParams:Array;
public var rounded:Boolean;
public var properties:Object;
public var onUpdateParams:Array;
public var onComplete:Function;
public var updatesSkipped:Number;
public var onStart:Function;
public var skipUpdates:Number;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
auxProperties = new Object();
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local2:TweenListObj;
var _local3:String;
_local2 = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local1:String;
var _local2:uint;
_local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
_local2 = 0;
while (_local2 < properties.length) {
if (_local2 > 0){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local2].name));
_local1 = (_local1 + (",valueStart:" + properties[_local2].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local2].valueComplete));
_local1 = (_local1 + "]");
_local2++;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local2:Object;
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 84
//Pnt (com.actionsnippet.geom.Pnt)
package com.actionsnippet.geom {
public class Pnt {
public var x:Number;
public var y:Number;
public function Pnt(_arg1:Number, _arg2:Number){
this.x = _arg1;
this.y = _arg2;
}
}
}//package com.actionsnippet.geom
Section 85
//Triangulate (com.actionsnippet.geom.Triangulate)
package com.actionsnippet.geom {
public class Triangulate {
private const EPSILON:Number = 1E-10;
private function snip(_arg1:Array, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:Array):Boolean{
var _local7:int;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local8 = _arg1[_arg6[_arg2]].x;
_local9 = _arg1[_arg6[_arg2]].y;
_local10 = _arg1[_arg6[_arg3]].x;
_local11 = _arg1[_arg6[_arg3]].y;
_local12 = _arg1[_arg6[_arg4]].x;
_local13 = _arg1[_arg6[_arg4]].y;
if (EPSILON > (((_local10 - _local8) * (_local13 - _local9)) - ((_local11 - _local9) * (_local12 - _local8)))){
return (false);
};
_local7 = 0;
while (_local7 < _arg5) {
if ((((((_local7 == _arg2)) || ((_local7 == _arg3)))) || ((_local7 == _arg4)))){
} else {
_local14 = _arg1[_arg6[_local7]].x;
_local15 = _arg1[_arg6[_local7]].y;
if (insideTriangle(_local8, _local9, _local10, _local11, _local12, _local13, _local14, _local15)){
return (false);
};
};
_local7++;
};
return (true);
}
public function process(_arg1:Array):Array{
var _local2:Array;
var _local3:int;
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
_local2 = [];
_local3 = _arg1.length;
if (_local3 < 3){
return (null);
};
_local4 = [];
if (0 < area(_arg1)){
_local5 = 0;
while (_local5 < _local3) {
_local4[_local5] = _local5;
_local5++;
};
} else {
_local5 = 0;
while (_local5 < _local3) {
_local4[_local5] = ((_local3 - 1) - _local5);
_local5++;
};
};
_local6 = _local3;
_local7 = (2 * _local6);
_local8 = 0;
_local5 = (_local6 - 1);
while (_local6 > 2) {
var _temp1 = _local7;
_local7 = (_local7 - 1);
if (0 >= _temp1){
return (null);
};
_local9 = _local5;
if (_local6 <= _local9){
_local9 = 0;
};
_local5 = (_local9 + 1);
if (_local6 <= _local5){
_local5 = 0;
};
_local10 = (_local5 + 1);
if (_local6 <= _local10){
_local10 = 0;
};
if (snip(_arg1, _local9, _local5, _local10, _local6, _local4)){
_local11 = _local4[_local9];
_local12 = _local4[_local5];
_local13 = _local4[_local10];
_local2.push(_arg1[_local11]);
_local2.push(_arg1[_local12]);
_local2.push(_arg1[_local13]);
_local8++;
_local14 = _local5;
_local15 = (_local5 + 1);
while (_local15 < _local6) {
_local4[_local14] = _local4[_local15];
_local14++;
_local15++;
};
_local6--;
_local7 = (2 * _local6);
};
};
return (_local2);
}
public function insideTriangle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):Boolean{
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;
_local9 = (_arg5 - _arg3);
_local10 = (_arg6 - _arg4);
_local11 = (_arg1 - _arg5);
_local12 = (_arg2 - _arg6);
_local13 = (_arg3 - _arg1);
_local14 = (_arg4 - _arg2);
_local15 = (_arg7 - _arg1);
_local16 = (_arg8 - _arg2);
_local17 = (_arg7 - _arg3);
_local18 = (_arg8 - _arg4);
_local19 = (_arg7 - _arg5);
_local20 = (_arg8 - _arg6);
_local23 = ((_local9 * _local18) - (_local10 * _local17));
_local21 = ((_local13 * _local16) - (_local14 * _local15));
_local22 = ((_local11 * _local20) - (_local12 * _local19));
return ((((((_local23 >= 0)) && ((_local22 >= 0)))) && ((_local21 >= 0))));
}
public function area(_arg1:Array):Number{
var _local2:int;
var _local3:Number;
var _local4:int;
var _local5:int;
_local2 = _arg1.length;
_local3 = 0;
_local4 = (_local2 - 1);
_local5 = 0;
while (_local5 < _local2) {
_local3 = (_local3 + ((_arg1[_local4].x * _arg1[_local5].y) - (_arg1[_local5].x * _arg1[_local4].y)));
var _temp1 = _local5;
_local5 = (_local5 + 1);
_local4 = _temp1;
};
return ((_local3 * 0.5));
}
}
}//package com.actionsnippet.geom
Section 86
//BoxObject (com.actionsnippet.qbox.objects.BoxObject)
package com.actionsnippet.qbox.objects {
import flash.events.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import com.actionsnippet.qbox.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import flash.display.*;
public class BoxObject extends QuickObject {
public function BoxObject(_arg1:QuickBox2D, _arg2:Object){
super(_arg1, _arg2);
}
override protected function defaultParams(_arg1:Object):void{
_arg1.width = 1;
_arg1.height = 1;
}
override protected function build():void{
var p:Object;
var boxDef:b2PolygonDef;
var hw:Number;
var hh:Number;
p = params;
boxDef = new b2PolygonDef();
shapeDef = boxDef;
hw = (p.width / 2);
hh = (p.height / 2);
boxDef.SetAsBox(hw, hh);
boxDef.density = p.density;
boxDef.friction = p.friction;
boxDef.restitution = p.restitution;
boxDef.filter.maskBits = p.maskBits;
boxDef.filter.categoryBits = p.categoryBits;
boxDef.filter.groupIndex = p.groupIndex;
if ((p.skin is Class)){
bodyDef.userData = new p.skin();
bodyDef.userData.width = (p.width * 30);
bodyDef.userData.height = (p.height * 30);
} else {
if (p.skin != "none"){
bodyDef.userData = new Sprite();
var _local2 = bodyDef.userData.graphics;
with (_local2) {
lineStyle(p.lineThickness, p.lineColor, p.lineAlpha);
beginFill(p.fillColor, p.fillAlpha);
hw = (hw * 30);
hh = (hh * 30);
drawRect(-(hw), -(hh), (p.width * 30), (p.height * 30));
};
};
};
body = w.CreateBody(bodyDef);
shape = body.CreateShape(boxDef);
}
}
}//package com.actionsnippet.qbox.objects
Section 87
//CircleObject (com.actionsnippet.qbox.objects.CircleObject)
package com.actionsnippet.qbox.objects {
import flash.events.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import com.actionsnippet.qbox.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import flash.display.*;
public class CircleObject extends QuickObject {
public function CircleObject(_arg1:QuickBox2D, _arg2:Object){
super(_arg1, _arg2);
}
override protected function defaultParams(_arg1:Object):void{
_arg1.radius = 0.5;
}
override protected function build():void{
var p:Object;
var circDef:b2CircleDef;
p = params;
circDef = new b2CircleDef();
shapeDef = circDef;
circDef.radius = p.radius;
circDef.density = p.density;
circDef.friction = p.friction;
circDef.restitution = p.restitution;
circDef.filter.maskBits = p.maskBits;
circDef.filter.categoryBits = p.categoryBits;
circDef.filter.groupIndex = p.groupIndex;
if ((p.skin is Class)){
bodyDef.userData = new p.skin();
bodyDef.userData.width = (p.radius * 60);
bodyDef.userData.height = (p.radius * 60);
} else {
if (p.skin != "none"){
bodyDef.userData = new Sprite();
var _local2 = bodyDef.userData.graphics;
with (_local2) {
lineStyle(p.lineThickness, p.lineColor, p.lineAlpha);
beginFill(p.fillColor, p.fillAlpha);
drawCircle(0, 0, 10);
};
bodyDef.userData.width = (p.radius * 60);
bodyDef.userData.height = (p.radius * 60);
};
};
body = w.CreateBody(bodyDef);
shape = body.CreateShape(circDef);
}
}
}//package com.actionsnippet.qbox.objects
Section 88
//GroupObject (com.actionsnippet.qbox.objects.GroupObject)
package com.actionsnippet.qbox.objects {
import flash.events.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import com.actionsnippet.qbox.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import flash.display.*;
public class GroupObject extends QuickObject {
public function GroupObject(_arg1:QuickBox2D, _arg2:Object){
super(_arg1, _arg2);
}
override protected function defaultParams(_arg1:Object):void{
_arg1.objects = [];
}
override protected function build():void{
var _local1:Object;
var _local2:int;
var _local3:QuickObject;
var _local4:*;
var _local5:int;
var _local6:b2PolygonDef;
var _local7:Number;
var _local8:int;
var _local9:*;
_local1 = params;
body = qbox.w.CreateBody(bodyDef);
if ((_local1.skin is Class)){
bodyDef.userData = new _local1.skin();
bodyDef.userData.width = (_local1.width * 30);
bodyDef.userData.height = (_local1.height * 30);
} else {
if (_local1.skin != "none"){
bodyDef.userData = new Sprite();
};
};
body.m_userData = bodyDef.userData;
_local2 = 0;
while (_local2 < _local1.objects.length) {
_local3 = _local1.objects[_local2];
_local4 = _local3.shapeDef;
if ((_local4 is b2ShapeDef)){
if ((_local4 is b2CircleDef)){
_local4.localPosition.Set(_local3.x, _local3.y);
} else {
if ((_local4 is b2PolygonDef)){
_local4.SetAsOrientedBox((_local3.params.width / 2), (_local3.params.height / 2), new b2Vec2(_local3.x, _local3.y), _local3.angle);
};
};
body.CreateShape(_local4);
} else {
if ((_local4 is Array)){
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5];
_local7 = (_local3.params.verts[_local5].length / 2);
_local8 = 0;
while (_local8 < _local7) {
trace(_local6.vertices[_local8].x, _local6.vertices[_local8].y);
_local6.vertices[_local8].Add(new b2Vec2(_local3.x, _local3.y));
_local8++;
};
body.CreateShape(_local6);
_local5++;
};
};
};
if ((((_local3.userData is DisplayObject)) && (!(_local1.skin)))){
_local9 = _local3.userData;
_local9.x = (_local3.x * 30);
_local9.y = (_local3.y * 30);
_local9.rotation = ((_local3.angle / Math.PI) * 180);
_local3.destroy();
body.m_userData.addChild(_local9);
} else {
_local3.destroy();
};
_local2++;
};
body.SetMassFromShapes();
}
}
}//package com.actionsnippet.qbox.objects
Section 89
//JointObject (com.actionsnippet.qbox.objects.JointObject)
package com.actionsnippet.qbox.objects {
import flash.events.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import com.actionsnippet.qbox.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import flash.display.*;
public class JointObject extends QuickObject {
private var jointDef:b2DistanceJointDef;
public function JointObject(_arg1:QuickBox2D, _arg2:Object){
super(_arg1, _arg2);
}
override public function get userData(){
return (jointDef.userData);
}
override protected function defaultParams(_arg1:Object):void{
_arg1.a = null;
_arg1.b = null;
_arg1.frequencyHz = 0;
_arg1.dampingRatio = 0;
_arg1.length = null;
_arg1.collideConnected = true;
}
override public function set userData(_arg1){
jointDef.userData = _arg1;
}
override protected function build():void{
var _local1:Object;
var _local2:b2Vec2;
_local1 = params;
if ((((_local1.a == null)) || ((_local1.b == null)))){
throw (new Error("your jointDef must have b2Body instances for its a and b properties"));
};
if (((!(_local1.x1)) && (!(_local1.y1)))){
_local2 = _local1.a.GetWorldCenter();
_local1.x1 = _local2.x;
_local1.y1 = _local2.y;
};
if (((!(_local1.x2)) && (!(_local1.y2)))){
_local2 = _local1.b.GetWorldCenter();
_local1.x2 = _local2.x;
_local1.y2 = _local2.y;
};
if (_local1.vecA == null){
_local1.vecA = new b2Vec2(_local1.x1, _local1.y1);
};
if (_local1.vecB == null){
_local1.vecB = new b2Vec2(_local1.x2, _local1.y2);
};
jointDef = new b2DistanceJointDef();
if (_local1.skin){
userData = new _local1.skin();
if (!(userData is MovieClip)){
throw (new Error("Sorry, joint skins must be dynamic. If your using a Sprite, just use a MovieClip instead."));
};
userData.startWidth = userData.width;
userData.startHeight = userData.height;
userData.p = params;
} else {
userData = params;
};
jointDef.Initialize(_local1.a, _local1.b, _local1.vecA, _local1.vecB);
jointDef.frequencyHz = _local1.frequencyHz;
jointDef.dampingRatio = _local1.dampingRatio;
if (_local1.length){
jointDef.length = _local1.length;
};
jointDef.collideConnected = _local1.collideConnected;
joint = w.CreateJoint(jointDef);
}
}
}//package com.actionsnippet.qbox.objects
Section 90
//PolyObject (com.actionsnippet.qbox.objects.PolyObject)
package com.actionsnippet.qbox.objects {
import flash.events.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import com.actionsnippet.qbox.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import flash.display.*;
import com.actionsnippet.geom.*;
public class PolyObject extends QuickObject {
public static var tri:Triangulate = new Triangulate();
public function PolyObject(_arg1:QuickBox2D, _arg2:Object){
super(_arg1, _arg2);
}
override protected function defaultParams(_arg1:Object):void{
_arg1.verts = [[-0.5, -1, 1, -1, 1, 1, -1, 1]];
_arg1.wireframe = true;
}
override protected function build():void{
var p:Object;
var i:int;
var inc:int;
var leng:int;
var autoSkin:Boolean;
var j:int;
var poly:Array;
var pnts:Array;
var p1:Pnt;
var p2:Pnt;
var p3:Pnt;
var polyDef:b2PolygonDef;
p = params;
if (p.points){
poly = p.points;
pnts = [];
inc = 0;
leng = (poly.length - 2);
i = 0;
while (i < leng) {
pnts[inc] = new Pnt(poly[i], poly[(i + 1)]);
inc = (inc + 1);
i = (i + 2);
};
poly = PolyObject.tri.process(pnts);
inc = 0;
p.verts = [];
leng = poly.length;
i = 0;
while (i < leng) {
p1 = poly[i];
p2 = poly[(i + 1)];
p3 = poly[(i + 2)];
p.verts[inc] = [p1.x, p1.y, p2.x, p2.y, p3.x, p3.y];
inc = (inc + 1);
i = (i + 3);
};
pnts = p.points;
};
autoSkin = false;
if ((p.skin is Class)){
bodyDef.userData = new p.skin();
} else {
if (p.skin != "none"){
bodyDef.userData = new Sprite();
autoSkin = true;
if (p.points){
var _local2 = bodyDef.userData.graphics;
with (_local2) {
lineStyle(p.lineThickness, p.lineColor, p.lineAlpha);
beginFill(p.fillColor, p.fillAlpha);
moveTo((pnts[0] * 30), (pnts[1] * 30));
i = 2;
while (i < (pnts.length - 2)) {
lineTo((pnts[i] * 30), (pnts[(i + 1)] * 30));
i = (i + 2);
};
endFill();
};
};
};
};
body = w.CreateBody(bodyDef);
shapeDef = [];
j = 0;
while (j < p.verts.length) {
polyDef = new b2PolygonDef();
shapeDef.push(polyDef);
polyDef.vertexCount = int((p.verts[j].length / 2));
if ((p.verts[j][i] is b2Vec2)){
polyDef.vertices = p.verts[j];
} else {
inc = 0;
i = 0;
while (i < p.verts[j].length) {
polyDef.vertices[inc].Set(p.verts[j][i], p.verts[j][(i + 1)]);
inc = (inc + 1);
i = (i + 2);
};
};
polyDef.density = p.density;
polyDef.friction = p.friction;
polyDef.restitution = p.restitution;
polyDef.filter.maskBits = p.maskBits;
polyDef.filter.categoryBits = p.categoryBits;
polyDef.filter.groupIndex = p.groupIndex;
if (((autoSkin) && (p.wireframe))){
_local2 = bodyDef.userData.graphics;
with (_local2) {
lineStyle(p.lineThickness, p.lineColor, p.lineAlpha);
beginFill(p.fillColor, p.fillAlpha);
};
i = 0;
while (i < polyDef.vertexCount) {
_local2 = bodyDef.userData.graphics;
with (_local2) {
if (i == 0){
moveTo((polyDef.vertices[i].x * 30), (polyDef.vertices[i].y * 30));
} else {
lineTo((polyDef.vertices[i].x * 30), (polyDef.vertices[i].y * 30));
};
};
i = (i + 1);
};
bodyDef.userData.graphics.endFill();
};
shape = body.CreateShape(polyDef);
j = (j + 1);
};
}
}
}//package com.actionsnippet.qbox.objects
Section 91
//QuickBox2D (com.actionsnippet.qbox.QuickBox2D)
package com.actionsnippet.qbox {
import flash.events.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import flash.display.*;
import com.actionsnippet.qbox.objects.*;
import flash.utils.*;
public class QuickBox2D extends EventDispatcher {
private var _mouseJoint:b2MouseJoint;
private var _currTime:Number;
public var worldAABB:b2AABB;
private var _elapsedTime:Number;
private var _defaults:Object;
public var iterations:int;// = 20
public var timeStep:Number;// = 0.0166666666666667
private var _renderJoints:Boolean;// = true
private var _quickObjects:Dictionary;
public var main:MovieClip;
private var _simpleRender:Boolean;// = true
var dragging:Boolean;// = false
var debug:Boolean;
public var gravity:b2Vec2;
private var _accumulator:Number;// = 0
private var _mousePVec:b2Vec2;
public var frim:Boolean;
public var w:b2World;
private var _prevTime:Number;// = 0
public function QuickBox2D(_arg1:MovieClip, _arg2:Object=null){
iterations = 20;
timeStep = (1 / 60);
_simpleRender = true;
_renderJoints = true;
_defaults = new Object();
_mousePVec = new b2Vec2();
_quickObjects = new Dictionary(true);
dragging = false;
_prevTime = 0;
_accumulator = 0;
super();
this.main = _arg1;
init(_arg2);
}
public function mouseDrag():void{
var _local1:*;
dragging = true;
for each (_local1 in _quickObjects) {
_local1.handCursor();
};
main.stage.addEventListener(MouseEvent.MOUSE_DOWN, createMouse);
main.stage.addEventListener(MouseEvent.MOUSE_UP, destroyMouse);
}
public function stop():void{
main.removeEventListener(Event.ENTER_FRAME, onRender);
}
private function createMouse(_arg1:MouseEvent):void{
var _local2:b2Body;
var _local3:b2MouseJointDef;
_local2 = GetBodyAtMouse();
if (_quickObjects[_local2]){
if (((_local2) && ((_quickObjects[_local2].params.draggable == true)))){
_local3 = new b2MouseJointDef();
_local3.body1 = w.GetGroundBody();
_local3.body2 = _local2;
_local3.target.Set((main.mouseX / 30), (main.mouseY / 30));
_local3.maxForce = 3000;
_local3.timeStep = timeStep;
_mouseJoint = (w.CreateJoint(_local3) as b2MouseJoint);
};
} else {
if (_local2){
_local3 = new b2MouseJointDef();
_local3.body1 = w.GetGroundBody();
_local3.body2 = _local2;
_local3.target.Set((main.mouseX / 30), (main.mouseY / 30));
_local3.maxForce = 3000;
_local3.timeStep = timeStep;
_mouseJoint = (w.CreateJoint(_local3) as b2MouseJoint);
};
};
}
public function addJoint(_arg1:Object):QuickObject{
return (create("joint", _arg1));
}
private function init(_arg1:Object=null):void{
var _local2:Object;
var _local3:String;
var _local4:Sprite;
var _local5:b2DebugDraw;
var _local6:Sprite;
_local2 = {gravityX:0, gravityY:20, iterations:iterations, timeStep:timeStep, bounds:[-100, -100, 100, 100], debug:false, simpleRender:_simpleRender, renderJoints:true, frim:true};
if (_arg1 == null){
_arg1 = new Object();
};
for (_local3 in _local2) {
if (_arg1[_local3] == null){
_arg1[_local3] = _local2[_local3];
};
};
frim = _arg1.frim;
_simpleRender = _arg1.simpleRender;
_renderJoints = _arg1.renderJoints;
iterations = _arg1.iterations;
timeStep = _arg1.timeStep;
debug = _arg1.debug;
_local4 = new Sprite();
main.addChild(_local4);
if (debug){
_local4.graphics.beginFill(0x333333);
_local4.graphics.drawRect(0, 0, main.stage.stageWidth, main.stage.stageHeight);
};
worldAABB = new b2AABB();
worldAABB.lowerBound.Set(_arg1.bounds[0], _arg1.bounds[1]);
worldAABB.upperBound.Set(_arg1.bounds[2], _arg1.bounds[3]);
gravity = new b2Vec2(_arg1.gravityX, _arg1.gravityY);
w = new b2World(worldAABB, gravity, true);
if (debug){
_local5 = new b2DebugDraw();
_local6 = new Sprite();
main.addChild(_local6);
_local5.m_sprite = _local6;
_local5.m_drawScale = 30;
_local5.m_fillAlpha = 0.5;
_local5.m_alpha = 0.5;
_local5.m_lineThickness = 1;
_local5.m_drawFlags = (b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit);
w.SetDebugDraw(_local5);
};
}
public function setDefault(_arg1:Object=null):void{
_defaults = _arg1;
}
private function GetBodyAtMouse(_arg1:Boolean=false):b2Body{
var _local2:*;
var _local3:*;
var _local4:b2AABB;
var _local5:int;
var _local6:Array;
var _local7:int;
var _local8:b2Body;
var _local9:int;
var _local10:b2Shape;
var _local11:Boolean;
_local2 = (main.mouseX / 30);
_local3 = (main.mouseY / 30);
_mousePVec.Set(_local2, _local3);
_local4 = new b2AABB();
_local4.lowerBound.Set((_local2 - 0.001), (_local3 - 0.001));
_local4.upperBound.Set((_local2 + 0.001), (_local3 + 0.001));
_local5 = 10;
_local6 = new Array();
_local7 = w.Query(_local4, _local6, _local5);
_local8 = null;
_local9 = 0;
while (_local9 < _local7) {
if ((((_local6[_local9].GetBody().IsStatic() == false)) || (_arg1))){
_local10 = (_local6[_local9] as b2Shape);
_local11 = (_local6[_local9] as b2Shape).TestPoint(_local10.GetBody().GetXForm(), _mousePVec);
if (_local11){
_local8 = _local10.GetBody();
break;
};
};
_local9++;
};
return (_local8);
}
private function onTraceMouse(_arg1:Event):void{
trace("Mouse: ", (main.mouseX / 30).toFixed(2), (main.mouseY / 30).toFixed(2));
}
private function onDown(_arg1:MouseEvent):void{
main.addEventListener(Event.ENTER_FRAME, onTraceMouse);
}
public function addPoly(_arg1:Object):QuickObject{
return (create("poly", _arg1));
}
public function createStageWalls(_arg1:Object=null):void{
var _local2:Object;
var _local3:String;
var _local4:Number;
var _local5:Number;
_local2 = _arg1;
if (_local2 == null){
_local2 = new Object();
};
for (_local3 in _defaults) {
if (_local2[_local3] == null){
_local2[_local3] = _defaults[_local3];
};
};
_local4 = (main.stage.stageWidth / 30);
_local5 = (main.stage.stageHeight / 30);
addBox({x:(_local4 / 2), y:_local5, width:(_local4 - 1), height:1, density:0, lineThickness:_local2.lineThickness, lineColor:_local2.lineColor, lineAlpha:_local2.lineAlpha, fillColor:_local2.fillColor, fillAlpha:_local2.fillAllpha});
addBox({x:(_local4 / 2), y:0, width:(_local4 - 1), height:1, density:0, lineThickness:_local2.lineThickness, lineColor:_local2.lineColor, lineAlpha:_local2.lineAlpha, fillColor:_local2.fillColor, fillAlpha:_local2.fillAllpha});
addBox({x:0, y:(_local5 / 2), width:1, height:_local5, density:0, lineThickness:_local2.lineThickness, lineColor:_local2.lineColor, lineAlpha:_local2.lineAlpha, fillColor:_local2.fillColor, fillAlpha:_local2.fillAllpha});
addBox({x:_local4, y:(_local5 / 2), width:1, height:_local5, density:0, lineThickness:_local2.lineThickness, lineColor:_local2.lineColor, lineAlpha:_local2.lineAlpha, fillColor:_local2.fillColor, fillAlpha:_local2.fillAllpha});
}
public function create(_arg1:String, _arg2:Object):QuickObject{
var _local3:QuickObject;
if (_arg1 == "box"){
_local3 = new BoxObject(this, _arg2);
_quickObjects[_local3.body] = _local3;
} else {
if (_arg1 == "circle"){
_local3 = new CircleObject(this, _arg2);
_quickObjects[_local3.body] = _local3;
} else {
if (_arg1 == "poly"){
_local3 = new PolyObject(this, _arg2);
_quickObjects[_local3.body] = _local3;
} else {
if (_arg1 == "joint"){
_local3 = new JointObject(this, _arg2);
_quickObjects[_local3.joint] = _local3;
} else {
if (_arg1 == "group"){
_local3 = new GroupObject(this, _arg2);
_quickObjects[_local3.body] = _local3;
} else {
throw (new Error((("QuickBox2D: Sorry, there is no QuickObject subclass for " + _arg1) + " types.")));
};
};
};
};
};
return (_local3);
}
function defaultParams(_arg1:Object):void{
var _local2:String;
if (_arg1 == null){
_arg1 = new Object();
};
for (_local2 in _defaults) {
if (_arg1[_local2] == null){
_arg1[_local2] = _defaults[_local2];
};
};
}
private function destroyMouse(_arg1:MouseEvent):void{
if (_mouseJoint){
w.DestroyJoint(_mouseJoint);
_mouseJoint = null;
};
}
public function addCircle(_arg1:Object):QuickObject{
return (create("circle", _arg1));
}
private function onUp(_arg1:MouseEvent):void{
main.removeEventListener(Event.ENTER_FRAME, onTraceMouse);
}
protected function onRender(_arg1:Event):void{
if (frim == true){
_currTime = getTimer();
_elapsedTime = ((_currTime - _prevTime) * 0.001);
_prevTime = _currTime;
if (_elapsedTime > 0.25){
_elapsedTime = 0.25;
};
_accumulator = (_accumulator + _elapsedTime);
while (_accumulator >= timeStep) {
w.Step(timeStep, iterations);
_accumulator = (_accumulator - timeStep);
};
} else {
w.Step(timeStep, iterations);
};
updateMouse();
if (_simpleRender){
updateBodies();
};
dispatchEvent(new Event("render"));
}
public function grid(_arg1:int=30, _arg2:uint=0xFFFF00, _arg3:Number=1):void{
var _local4:Sprite;
var _local5:int;
_local4 = new Sprite();
main.addChild(_local4);
_local4.graphics.lineStyle(0, _arg2, _arg3);
_local5 = 0;
while (_local5 < main.stage.stageWidth) {
_local4.graphics.moveTo(_local5, 0);
_local4.graphics.lineTo(_local5, main.stage.stageHeight);
_local5 = (_local5 + _arg1);
};
_local5 = 0;
while (_local5 < main.stage.stageHeight) {
_local4.graphics.moveTo(0, _local5);
_local4.graphics.lineTo(main.stage.stageWidth, _local5);
_local5 = (_local5 + _arg1);
};
}
private function updateMouse():void{
var _local1:b2Vec2;
if (_mouseJoint){
_local1 = new b2Vec2((main.mouseX / 30), (main.mouseY / 30));
_mouseJoint.SetTarget(_local1);
};
}
public function addGroup(_arg1:Object):QuickObject{
return (create("group", _arg1));
}
public function traceMouse():void{
main.stage.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
main.stage.addEventListener(MouseEvent.MOUSE_UP, onUp);
}
public function start():void{
_prevTime = getTimer();
main.addEventListener(Event.ENTER_FRAME, onRender);
}
public function addBox(_arg1:Object):QuickObject{
return (create("box", _arg1));
}
protected function updateBodies():void{
var _local1:b2Body;
var _local2:b2Joint;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:*;
_local1 = w.m_bodyList;
while (_local1) {
if ((_local1.m_userData is Sprite)){
_local1.m_userData.x = (_local1.GetPosition().x * 30);
_local1.m_userData.y = (_local1.GetPosition().y * 30);
_local1.m_userData.rotation = (_local1.GetAngle() * (180 / Math.PI));
};
_local1 = _local1.m_next;
};
if (_renderJoints){
main.graphics.clear();
_local2 = w.m_jointList;
while (_local2) {
if ((_local2 is b2DistanceJoint)){
_local3 = _local2.GetAnchor1();
_local4 = _local2.GetAnchor2();
_local5 = _local2.GetUserData();
if ((_local5 is MovieClip)){
_local5.x = (_local3.x * 30);
_local5.y = (_local3.y * 30);
_local5.scaleX = (((_local4.x * 30) - _local5.x) / _local5.startWidth);
_local5.scaleY = (((_local4.y * 30) - _local5.y) / _local5.startHeight);
} else {
main.graphics.lineStyle(_local5.lineThickness, _local5.lineColor, _local5.lineAlpha);
main.graphics.moveTo((_local3.x * 30), (_local3.y * 30));
main.graphics.lineTo((_local4.x * 30), (_local4.y * 30));
};
};
_local2 = _local2.m_next;
};
};
}
public function destroy():void{
main.stage.removeEventListener(MouseEvent.MOUSE_DOWN, createMouse);
main.stage.removeEventListener(MouseEvent.MOUSE_UP, destroyMouse);
main.addEventListener(Event.ENTER_FRAME, onRender);
main.stage.removeEventListener(MouseEvent.MOUSE_DOWN, onDown);
main.stage.removeEventListener(MouseEvent.MOUSE_UP, onUp);
}
}
}//package com.actionsnippet.qbox
Section 92
//QuickObject (com.actionsnippet.qbox.QuickObject)
package com.actionsnippet.qbox {
import flash.events.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import flash.display.*;
public class QuickObject {
private var loc:b2Vec2;
public var bodyDef:b2BodyDef;
protected var qbox:QuickBox2D;
public var joint:b2Joint;
public var params:Object;
protected var defaults:Object;
public var shape:b2Shape;
public var body:b2Body;
public var shapeDef;
protected var w:b2World;
protected var type:String;
public function QuickObject(_arg1:QuickBox2D, _arg2:Object=null){
init(_arg1, _arg2);
}
final private function init(_arg1:QuickBox2D, _arg2:Object=null):void{
var _local3:b2MassData;
this.qbox = _arg1;
this.params = _arg2;
defineDefaults();
setDefaults();
if (_arg2.vecA == null){
setupBodyDef(_arg2);
};
this.w = _arg1.w;
build();
if (!_arg1.debug){
if ((userData is DisplayObject)){
userData.x = (_arg2.x * 30);
userData.y = (_arg2.y * 30);
userData.rotation = ((_arg2.angle / Math.PI) * 180);
_arg1.main.addChild(userData);
};
};
if (body != null){
if (_arg2.mass != null){
body.SetMassFromShapes();
_local3 = new b2MassData();
_local3.mass = _arg2.mass;
_local3.center = body.GetLocalCenter();
_local3.I = body.m_I;
body.SetMass(_local3);
} else {
body.SetMassFromShapes();
};
};
}
public function get angle():Number{
return (body.GetAngle());
}
public function get userData(){
return (body.m_userData);
}
private function setDefaults():void{
var _local1:String;
if (params == null){
params = new Object();
};
for (_local1 in defaults) {
if (params[_local1] == null){
params[_local1] = defaults[_local1];
};
};
}
final public function destroy():void{
if (shape){
body.DestroyShape(shape);
w.DestroyBody(body);
};
if (joint){
w.DestroyJoint((joint as b2Joint));
};
if ((userData is DisplayObject)){
if (userData.parent){
userData.parent.removeChild(userData);
};
};
}
private function setupBodyDef(_arg1:Object):void{
bodyDef = new b2BodyDef();
bodyDef.position.x = _arg1.x;
bodyDef.position.y = _arg1.y;
loc = new b2Vec2(_arg1.x, _arg1.y);
bodyDef.angle = _arg1.angle;
bodyDef.linearDamping = _arg1.linearDamping;
bodyDef.angularDamping = _arg1.angularDamping;
bodyDef.fixedRotation = _arg1.fixedRotation;
bodyDef.isBullet = _arg1.isBullet;
bodyDef.isSleeping = _arg1.isSleeping;
bodyDef.allowSleep = _arg1.allowSleep;
}
function handCursor():void{
if (!qbox.debug){
if ((userData is DisplayObject)){
if ((((params.draggable == true)) && (!((params.density == 0))))){
userData.buttonMode = true;
};
};
};
}
public function set angle(_arg1:Number):void{
loc = body.GetPosition();
body.SetXForm(loc, _arg1);
}
protected function defaultParams(_arg1:Object):void{
}
public function set userData(_arg1){
body.m_userData = _arg1;
}
private function defineDefaults():void{
defaults = {x:3, y:3, linearDamping:0, angularDamping:0, isBullet:false, fixedRotation:false, allowSleep:true, isSleeping:false, density:1, friction:0.5, restitution:0.2, angle:0, maskBits:0xFFFF, categoryBits:1, groupIndex:0, draggable:true, lineColor:0, lineAlpha:1, lineThickness:0, fillColor:0xCCCCCC, fillAlpha:1};
defaultParams(defaults);
qbox.defaultParams(params);
}
public function set x(_arg1:Number):void{
loc = body.GetPosition();
loc.x = _arg1;
body.SetXForm(loc, body.GetAngle());
}
public function set y(_arg1:Number):void{
loc = body.GetPosition();
loc.y = _arg1;
body.SetXForm(loc, body.GetAngle());
}
protected function build():void{
trace("You must override the build() method of QuickObject");
}
public function get x():Number{
return (body.GetPosition().x);
}
public function get y():Number{
return (body.GetPosition().y);
}
public function setLoc(_arg1:Number, _arg2:Number):void{
loc.x = _arg1;
loc.y = _arg2;
body.SetXForm(loc, body.GetAngle());
}
}
}//package com.actionsnippet.qbox
Section 93
//Color (fl.motion.Color)
package fl.motion {
import flash.geom.*;
import flash.display.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 94
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 95
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 96
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 97
//AccuracyHolder_200 (TheGunGame_Final_Bored_fla.AccuracyHolder_200)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class AccuracyHolder_200 extends MovieClip {
public var AccuracyPlate:MovieClip;
public function AccuracyHolder_200(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 98
//AccuracyMedal_122 (TheGunGame_Final_Bored_fla.AccuracyMedal_122)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class AccuracyMedal_122 extends MovieClip {
public function AccuracyMedal_122(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 99
//AccuracyPlate_201 (TheGunGame_Final_Bored_fla.AccuracyPlate_201)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
import flash.text.*;
public dynamic class AccuracyPlate_201 extends MovieClip {
public var MedalInfo:TextField;
public var AccuracyMedal:MovieClip;
public var TargetMissInfo:TextField;
public var PlateBG:MovieClip;
public var TargetHitInfo:TextField;
}
}//package TheGunGame_Final_Bored_fla
Section 100
//AchieveList_24 (TheGunGame_Final_Bored_fla.AchieveList_24)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
import flash.text.*;
public dynamic class AchieveList_24 extends MovieClip {
public var WaltherWaltzProgress:MovieClip;
public var BerettaBeastProgress:MovieClip;
public var DoNotPressUnlock:TextField;
public var ExpertMedalProgress:MovieClip;
public var P90PowerProgress:MovieClip;
public var NoviceMedalProgress:MovieClip;
public var NoviceMedalAchieve:MovieClip;
public var RiotPoliceAchieve:MovieClip;
public var BerettaBeastUnlock:TextField;
public var DudeDeagleAchieve:MovieClip;
public var GunAddictUnlock:TextField;
public var DoNotPressProgress:MovieClip;
public var M1AMartyrProgress:MovieClip;
public var GlockCrewAchieve:MovieClip;
public var WaltherWaltzUnlock:TextField;
public var LugerLoveProgress:MovieClip;
public var ExpertMedalUnlock:TextField;
public var ReloaderProgress:MovieClip;
public var LugerLoveAchieve:MovieClip;
public var M1AMartyrUnlock:TextField;
public var GunAddictAchieve:MovieClip;
public var PiecemakerProgress:MovieClip;
public var SpasOfSpadesAchieve:MovieClip;
public var USPNinjaProgress:MovieClip;
public var CampaignUnlock:TextField;
public var MP5JockeyUnlock:TextField;
public var P90PowerAchieve:MovieClip;
public var TargetHaterProgress:MovieClip;
public var RiotPoliceUnlock:TextField;
public var M1AMartyrAchieve:MovieClip;
public var UziDaddyAchieve:MovieClip;
public var P90PowerUnlock:TextField;
public var ExpertMedalAchieve:MovieClip;
public var UziDaddyProgress:MovieClip;
public var MP5JockeyProgress:MovieClip;
public var LugerLoveUnlock:TextField;
public var DoNotPressAchieve:MovieClip;
public var MagnumMasterAchieve:MovieClip;
public var PK2PlayerUnlock:TextField;
public var GunNewbieProgress:MovieClip;
public var GunAddictProgress:MovieClip;
public var USPNinjaAchieve:MovieClip;
public var CampaignAchieve:MovieClip;
public var VeteranMedalUnlock:TextField;
public var FamousFamasUnlock:TextField;
public var RiotPoliceProgress:MovieClip;
public var JugglerProgress:MovieClip;
public var ReloaderUnlock:TextField;
public var PiecemakerUnlock:TextField;
public var CarbineCrazyProgress:MovieClip;
public var TargetHaterAchieve:MovieClip;
public var SkorpionKillerProgress:MovieClip;
public var PiecemakerAchieve:MovieClip;
public var GunNutAchieve:MovieClip;
public var ReloaderAchieve:MovieClip;
public var MP5JockeyAchieve:MovieClip;
public var Kar98kRunAchieve:MovieClip;
public var MagnumMasterUnlock:TextField;
public var MagnumMasterProgress:MovieClip;
public var TargetHaterUnlock:TextField;
public var CampaignProgress:MovieClip;
public var SpasOfSpadesProgress:MovieClip;
public var NoviceMedalUnlock:TextField;
public var GunNewbieUnlock:TextField;
public var CarbineCrazyAchieve:MovieClip;
public var SkorpionKillerAchieve:MovieClip;
public var GlockCrewUnlock:TextField;
public var SpasOfSpadesUnlock:TextField;
public var JugglerUnlock:TextField;
public var GunNutProgress:MovieClip;
public var USPNinjaUnlock:TextField;
public var DudeDeagleUnlock:TextField;
public var Kar98kRunUnlock:TextField;
public var VeteranMedalAchieve:MovieClip;
public var FamousFamasAchieve:MovieClip;
public var PK2PlayerProgress:MovieClip;
public var FamousFamasProgress:MovieClip;
public var GlockCrewProgress:MovieClip;
public var SkorpionKillerUnlock:TextField;
public var JugglerAchieve:MovieClip;
public var Kar98kRunProgress:MovieClip;
public var WaltherWaltzAchieve:MovieClip;
public var PK2PlayerAchieve:MovieClip;
public var UziDaddyUnlock:TextField;
public var BerettaBeastAchieve:MovieClip;
public var VeteranMedalProgress:MovieClip;
public var GunNewbieAchieve:MovieClip;
public var GunNutUnlock:TextField;
public var CarbineCrazyUnlock:TextField;
public var DudeDeagleProgress:MovieClip;
}
}//package TheGunGame_Final_Bored_fla
Section 101
//AchievementBox_27 (TheGunGame_Final_Bored_fla.AchievementBox_27)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class AchievementBox_27 extends MovieClip {
public function AchievementBox_27(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 102
//AchievementPlate_162 (TheGunGame_Final_Bored_fla.AchievementPlate_162)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
import flash.text.*;
public dynamic class AchievementPlate_162 extends MovieClip {
public var AchievementInfo:TextField;
}
}//package TheGunGame_Final_Bored_fla
Section 103
//AchievePlate_16 (TheGunGame_Final_Bored_fla.AchievePlate_16)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class AchievePlate_16 extends MovieClip {
public var SponsorLink:MovieClip;
public var sb:Scrollbar;
public var AchieveList:MovieClip;
public var PlateBG:MovieClip;
public function AchievePlate_16(){
addFrameScript(0, frame1);
}
function frame1(){
sb.init(AchieveList, "easeOutBack", 1, true, 1.5);
}
}
}//package TheGunGame_Final_Bored_fla
Section 104
//BackgroundColor_14 (TheGunGame_Final_Bored_fla.BackgroundColor_14)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class BackgroundColor_14 extends MovieClip {
public function BackgroundColor_14(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 105
//BackHand_74 (TheGunGame_Final_Bored_fla.BackHand_74)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class BackHand_74 extends MovieClip {
public function BackHand_74(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 106
//BigFrontHand_33 (TheGunGame_Final_Bored_fla.BigFrontHand_33)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class BigFrontHand_33 extends MovieClip {
public function BigFrontHand_33(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 107
//bulleta_4 (TheGunGame_Final_Bored_fla.bulleta_4)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class bulleta_4 extends MovieClip {
public function bulleta_4(){
addFrameScript(99, frame100, 159, frame160);
}
function frame160(){
stop();
}
function frame100(){
gotoAndPlay(101);
}
}
}//package TheGunGame_Final_Bored_fla
Section 108
//CampaignHolder_208 (TheGunGame_Final_Bored_fla.CampaignHolder_208)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class CampaignHolder_208 extends MovieClip {
public var CampaignPlate:MovieClip;
public function CampaignHolder_208(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 109
//CampaignPlate_124 (TheGunGame_Final_Bored_fla.CampaignPlate_124)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class CampaignPlate_124 extends MovieClip {
public var EfficiencyCheck1:MovieClip;
public var EfficiencyCheck2:MovieClip;
public var EfficiencyCheck5:MovieClip;
public var EfficiencyCheck6:MovieClip;
public var EfficiencyCheck7:MovieClip;
public var EfficiencyCheck3:MovieClip;
public var EfficiencyCheck4:MovieClip;
public var SponsorLink:MovieClip;
public var OffenseLevel1:SimpleButton;
public var OffenseLevel2:SimpleButton;
public var OffenseLevel3:SimpleButton;
public var OffenseLevel5:SimpleButton;
public var OffenseLevel6:SimpleButton;
public var OffenseLevel7:SimpleButton;
public var OffenseLevel4:SimpleButton;
public var DefenseCheck1:MovieClip;
public var DefenseCheck2:MovieClip;
public var DefenseCheck3:MovieClip;
public var DefenseCheck5:MovieClip;
public var DefenseCheck6:MovieClip;
public var DefenseCheck7:MovieClip;
public var DefenseCheck4:MovieClip;
public var EfficiencyLevel2:SimpleButton;
public var EfficiencyLevel4:SimpleButton;
public var EfficiencyLevel5:SimpleButton;
public var EfficiencyLevel6:SimpleButton;
public var EfficiencyLevel7:SimpleButton;
public var EfficiencyLevel1:SimpleButton;
public var EfficiencyLevel3:SimpleButton;
public var OffenseCheck1:MovieClip;
public var OffenseCheck2:MovieClip;
public var OffenseCheck3:MovieClip;
public var OffenseCheck4:MovieClip;
public var OffenseCheck5:MovieClip;
public var OffenseCheck6:MovieClip;
public var DefenseLevel1:SimpleButton;
public var DefenseLevel2:SimpleButton;
public var DefenseLevel3:SimpleButton;
public var DefenseLevel4:SimpleButton;
public var DefenseLevel5:SimpleButton;
public var DefenseLevel6:SimpleButton;
public var DefenseLevel7:SimpleButton;
public var OffenseCheck7:MovieClip;
public var PlateBG:MovieClip;
}
}//package TheGunGame_Final_Bored_fla
Section 110
//CampaignPlateInfo_209 (TheGunGame_Final_Bored_fla.CampaignPlateInfo_209)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
import flash.text.*;
public dynamic class CampaignPlateInfo_209 extends MovieClip {
public var LevelInfo:TextField;
public var LevelUnlockInfo:TextField;
public var PlateBG:MovieClip;
public var LifeInfo:TextField;
}
}//package TheGunGame_Final_Bored_fla
Section 111
//CampaignTimerGraphic_213 (TheGunGame_Final_Bored_fla.CampaignTimerGraphic_213)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class CampaignTimerGraphic_213 extends MovieClip {
public function CampaignTimerGraphic_213(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 112
//ChallengePlate_115 (TheGunGame_Final_Bored_fla.ChallengePlate_115)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
import flash.text.*;
public dynamic class ChallengePlate_115 extends MovieClip {
public var SkillChallengeButton:SimpleButton;
public var SpeedMedal:MovieClip;
public var SponsorLink:MovieClip;
public var AccuracyChallengeButton:SimpleButton;
public var SpeedChallengeButton:SimpleButton;
public var AccuracyMedal:MovieClip;
public var SpeedInfo:TextField;
public var AccuracyInfo:TextField;
public var SkillMedal:MovieClip;
public var SkillInfo:TextField;
public var PlateBG:MovieClip;
}
}//package TheGunGame_Final_Bored_fla
Section 113
//EnemyLoader_191 (TheGunGame_Final_Bored_fla.EnemyLoader_191)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class EnemyLoader_191 extends MovieClip {
public function EnemyLoader_191(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 114
//FrontHand_93 (TheGunGame_Final_Bored_fla.FrontHand_93)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class FrontHand_93 extends MovieClip {
public function FrontHand_93(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 115
//GripHand_52 (TheGunGame_Final_Bored_fla.GripHand_52)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class GripHand_52 extends MovieClip {
public function GripHand_52(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 116
//HoldHand_90 (TheGunGame_Final_Bored_fla.HoldHand_90)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class HoldHand_90 extends MovieClip {
public function HoldHand_90(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 117
//MainTimeline (TheGunGame_Final_Bored_fla.MainTimeline)
package TheGunGame_Final_Bored_fla {
import flash.events.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import com.actionsnippet.qbox.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
import flash.filters.*;
import fl.motion.*;
import flash.geom.*;
import flash.display.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var ActiveWeaponCategory;
public var SkillBoxes:Array;
public var RiotPoliceCurr:Number;
public var P90PowerTotal:Number;
public var Crunch2Sound:Sound;
public var PlateX:Number;
public var Slot3Info:TextField;
public var AccuracyHolder:MovieClip;
public var CrateGround3Sound:Sound;
public var Reloaded;
public var TargetHaterCurr:Number;
public var GoalPlatform1;
public var GoalPlatform2;
public var TargetHaterTotal:Number;
public var TargetNumAccuracy;
public var SkorpionKillerCurr:Number;
public var WorldDestroy;
public var PlateHolder:MovieClip;
public var shells:Array;
public var MP5JockeyCurr:Number;
public var GunAddictUpgradeUnlocked;
public var GoalCrate;
public var Slot3Weapon:MovieClip;
public var SaveMedals:Array;
public var EfficiencyLevelsUnlocked;
public var SaveVariables;
public var FamousFamasTotal:Number;
public var PreloaderTip:MovieClip;
public var FireSound:Sound;
public var LifeDrainTimer:Timer;
public var RandomEnemy:Number;
public var StackSkillBox;
public var i;
public var GoalTimerStarted;
public var RecoilRecoveryTimer:Timer;
public var ExpertMedalTotal:Number;
public var VeteranUpgradeUnlocked;
public var CampaignButton:SimpleButton;
public var CeaseFire;
public var PlatinumColorUnlocked;
public var WeaponButton:SimpleButton;
public var GunBreakSound:Sound;
public var GlockCrewTotal:Number;
public var LugerUpgradeUnlocked;
public var ChazLink:MovieClip;
public var CampaignStartCounter;
public var MaxShellNum;
public var M1AMartyrTotal:Number;
public var SkillChallengeComplete;
public var PlateTweener:Tween;
public var GunNewbieUpgradeUnlocked;
public var TopWall;
public var Crunch3Sound:Sound;
public var PreloaderPlay:SimpleButton;
public var SpeedHolder:MovieClip;
public var RiotPoliceTotal:Number;
public var Slot2Info:TextField;
public var AmmoInfo:TextField;
public var CarbineCrazyCurr:Number;
public var DeagleUpgradeUnlocked;
public var SaveFile:SharedObject;
public var EnemyBulletHeight;
public var CarbineCrazyTotal:Number;
public var DefaultRotation;
public var EnemyTotal:Number;
public var TutorialHelper:MovieClip;
public var GlockUpgradeUnlocked;
public var UziDaddyCurr:Number;
public var LevelsUnlockedTotal;
public var TrainingButton:SimpleButton;
public var Spas12Unlocked;
public var sim:QuickBox2D;
public var Damage3Sound:Sound;
public var SpeedChallengeTimer:Timer;
public var TintTimer:Timer;
public var Kar98kUnlocked;
public var Lives:Number;
public var EnemyBulletSound:Sound;
public var SaveAchieves;
public var WallSpeed;
public var SkorpionKillerTotal:Number;
public var OffenseCurrLevel;
public var DoNotPressTotal:Number;
public var DudeDeagleCurr:Number;
public var LugerUnlocked;
public var Kar98kUpgradeUnlocked;
public var Slot2Weapon:MovieClip;
public var Slot1Info:TextField;
public var RecoilReduction;
public var TargetNumSpeed;
public var CampaignTimerGraphic:MovieClip;
public var JugglerTotal:Number;
public var MuteTransform:SoundTransform;
public var CurrentPlate:String;
public var P90PowerCurr:Number;
public var GreenColorUnlocked;
public var TrainingText:TextField;
public var CampaignStarted;
public var MoveSpeedTargets;
public var USPUpgradeUnlocked;
public var Spas12UpgradeUnlocked;
public var SaveUnlocks;
public var shellReset;
public var ChallengeButton:SimpleButton;
public var LoadingBar:MovieClip;
public var CampaignStartTimer:Timer;
public var GoalTime;
public var BerettaUpgradeUnlocked;
public var HalfVolume:SoundTransform;
public var RangeLimitZone:MovieClip;
public var EnemyBulletWidth;
public var ExpertUpgradeUnlocked;
public var MagnumUnlocked;
public var SkeletonHandUnlocked;
public var m_contactListener;
public var MagnumMasterCurr:Number;
public var PiecemakerCurr:Number;
public var Kar98kRunTotal:Number;
public var SpasOfSpadesCurr:Number;
public var Damage2Sound:Sound;
public var StackSpeedTargets;
public var EnemyZigZag:Array;
public var AccuracyTargets:Array;
public var PK2PlayerCurr:Number;
public var FamasUnlocked;
public var SkillChallengeTimer:Timer;
public var AccuracyStarted;
public var boxNum;
public var Slot1Weapon:MovieClip;
public var BerettaBeastTotal:Number;
public var CampaignEnd;
public var Slot1;
public var Slot2;
public var Slot3;
public var fm_menu:ContextMenu;
public var FamasUpgradeUnlocked;
public var VeteranMedalCurr:Number;
public var RightWall;
public var USPNinjaTotal:Number;
public var JugglerCurr:Number;
public var BerettaSMGUnlocked;
public var SponsorLink:MovieClip;
public var AccuracyChallengeTimer:Timer;
public var PreloaderInfo:TextField;
public var BerettaBeastCurr:Number;
public var LugerLoveTotal:Number;
public var SkorpionUpgradeUnlocked;
public var DefenseCurrLevel;
public var TargetsMissed;
public var FamousFamasCurr:Number;
public var StackBox;
public var ActiveSlot;
public var UziUpgradeUnlocked;
public var TotalTimePlayed;
public var MuteSound:ContextMenuItem;
public var DelayFire;
public var SMGPK2Unlocked;
public var M1AMartyrCurr:Number;
public var PlateBGColor;
public var PlayerNormalTint:Color;
public var sw:Number;
public var EnemyHP:TextField;
public var GameType:String;
public var RedColorUnlocked;
public var SkorpionUnlocked;
public var SpasOfSpadesTotal:Number;
public var WeaponTimer:Timer;
public var VeteranMedalTotal:Number;
public var MagnumMasterTotal:Number;
public var NoviceUpgradeUnlocked;
public var USPNinjaCurr:Number;
public var WaltherWaltzCurr:Number;
public var LeftWall;
public var OffenseLevelsUnlocked;
public var Plumpman:ContextMenuItem;
public var ExpertMedalCurr:Number;
public var WaltherPPKUnlocked;
public var ChallengeComplete:Boolean;
public var HandSkin;
public var EnemyTint:Color;
public var DudeDeagleTotal:Number;
public var NoviceMedalCurr:Number;
public var BackgroundColor:MovieClip;
public var PiecemakerTotal:Number;
public var ReloaderTotal:Number;
public var P90UpgradeUnlocked;
public var PK2UpgradeUnlocked;
public var WaltherUpgradeUnlocked;
public var BottomWall;
public var WeaponSelectOutline:GlowFilter;
public var PK2PlayerTotal:Number;
public var ReloadSound:Sound;
public var SpeedTargets:Array;
public var EnemyTintTimer:Timer;
public var CrateGround1Sound:Sound;
public var NoviceMedalTotal:Number;
public var sh:Number;
public var PlayerHitTint:Color;
public var LugerLoveCurr:Number;
public var DamageIncrease;
public var CampaignHolder:MovieClip;
public var Sponsor:ContextMenuItem;
public var Player:MovieClip;
public var AchievementButton:SimpleButton;
public var shellNum:Number;
public var UnmuteTransform:SoundTransform;
public var TargetHitAccuracy;
public var SkillHolder:MovieClip;
public var GunNutUpgradeUnlocked;
public var StackCampaignBox;
public var DeagleUnlocked;
public var EnemyNum:Number;
public var GlockCrewCurr:Number;
public var Kar98kRunCurr:Number;
public var OptionsButton:SimpleButton;
public var keyArray:Array;
public var WallSpeedVert;
public var AmmoIncrease;
public var SpeedTimer:Number;
public var EnemyMove:Array;
public var BGLoadingBar:MovieClip;
public var TotalTimePlayedTimer:Timer;
public var P90Unlocked;
public var Crunch1Sound:Sound;
public var Cursor:cursor;
public var Enemy:Array;
public var ReloaderCurr:Number;
public var SpeedTimerStarted;
public var WaltherWaltzTotal:Number;
public var Chaz:ContextMenuItem;
public var PeacemakerUpgradeUnlocked;
public var CrateGround2Sound:Sound;
public var ChallengeInfo:TextField;
public var MP5JockeyTotal:Number;
public var PlayerHitBox;
public var WeaponType;
public var ShellGroundSound:Sound;
public var UziDaddyTotal:Number;
public var WeaponNum;
public var DefenseLevelsUnlocked;
public var ClipSize;
public var PeacemakerUnlocked;
public var Damage1Sound:Sound;
public var PlumpmanLink:MovieClip;
public var TheGunGame:ContextMenuItem;
public var boxes:Array;
public var DoNotPressCurr:Number;
public var MovieQuality;
public var WallSpawn:Number;
public var UnmuteSound:ContextMenuItem;
public var TargetBreakSound:Sound;
public var EnemyBulletSpeed;
public var ClipAmount;
public var EfficiencyCurrLevel;
public var Walls:Array;
public var EnemyDeath;
public var EnemyKillTotal:Number;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
public function SpeedChallenge(_arg1:TimerEvent):void{
SpeedTimer = (SpeedTimer + 1);
}
public function visit_Sponsor(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.bored.com/");
navigateToURL(_local2, "_blank");
if (MovieClip(root).currentFrame >= 4){
Mouse.hide();
};
}
public function EfficiencyLevel6Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
EfficiencyCurrLevel = 6;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function DefenseLevel6Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
DefenseCurrLevel = 6;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function TotalTime(_arg1:TimerEvent):void{
TotalTimePlayed++;
}
public function WhiteHand(_arg1:MouseEvent){
HandSkin = 1;
}
public function addedToStage(_arg1:Event=null):void{
this.removeEventListener(Event.ADDED_TO_STAGE, addedToStage);
launchApp();
}
public function OffenseLevel4Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
OffenseCurrLevel = 4;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function TargetHaterRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function LifeDrain(_arg1:TimerEvent):void{
Lives--;
}
public function CampaignRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Campaigner</B> \n Beat all 21 levels of the Campaign";
}
public function ChallengeMenu(_arg1:MouseEvent){
if (((((!(global.PlateMoving)) && (!(global.ScrollerMoving)))) && (!((CurrentPlate == "Challenges"))))){
global.PlateMoving = true;
PlateX = 825;
PlateTween();
CurrentPlate = "Challenges";
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function SpasOfSpadesRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Spas Of Spades</B> \n Deal out " + SpasOfSpadesTotal) + " Spas-12 Shells");
}
public function HideMouse(_arg1:MouseEvent):void{
Mouse.hide();
}
function frame3(){
stop();
global.currMovieFrame = 3;
SponsorLink.addEventListener(MouseEvent.CLICK, SponsorLinkVisit);
PlumpmanLink.addEventListener(MouseEvent.CLICK, PlumpmanLinkVisit);
ChazLink.addEventListener(MouseEvent.CLICK, ChazLinkVisit);
PlumpmanLink.addEventListener(MouseEvent.ROLL_OVER, PlumpmanLinkRollOver);
ChazLink.addEventListener(MouseEvent.ROLL_OVER, ChazLinkRollOver);
PlumpmanLink.addEventListener(MouseEvent.ROLL_OUT, PlumpmanLinkRollOut);
ChazLink.addEventListener(MouseEvent.ROLL_OUT, ChazLinkRollOut);
PreloaderPlay.alpha = 0;
PreloaderPlay.enabled = false;
PreloaderTip.gotoAndStop(Math.floor(((Math.random() * 7) + 1)));
this.addEventListener(Event.ENTER_FRAME, Preloading);
}
public function ChazLinkRollOutBig(_arg1:MouseEvent){
PlateHolder.OptionsPlate.ChazLinkBig.alpha = 0.75;
}
function frame7(){
stop();
global.currMovieFrame = 7;
Mouse.hide();
Player = new (WeaponType[WeaponNum][1]);
addChild(Player);
Player.mouseEnabled = false;
Player.mouseChildren = false;
FireSound = new (WeaponType[WeaponNum][24]);
ReloadSound = new (WeaponType[WeaponNum][25]);
TargetBreakSound = new TargetBreak();
GunBreakSound = new GunBreak();
ShellGroundSound = new ShellGround();
CrateGround1Sound = new CrateGround1();
CrateGround2Sound = new CrateGround2();
CrateGround3Sound = new CrateGround3();
Damage1Sound = new damage1();
Damage2Sound = new damage2();
Damage3Sound = new damage3();
Crunch1Sound = new kevlar1();
Crunch2Sound = new kevlar2();
Crunch3Sound = new kevlar3();
HalfVolume = new SoundTransform(0.25);
BackgroundColor.gotoAndStop(PlateBGColor);
AccuracyHolder.AccuracyPlate.PlateBG.gotoAndStop(PlateBGColor);
SpeedHolder.SpeedPlate.PlateBG.gotoAndStop(PlateBGColor);
SkillHolder.SkillPlate.PlateBG.gotoAndStop(PlateBGColor);
CampaignHolder.CampaignPlate.PlateBG.gotoAndStop(PlateBGColor);
sim = new QuickBox2D(this);
sim.setDefault({lineAlpha:0, fillColor:0x996600});
sim.gravity.x = 0;
sim.gravity.y = 10;
sim.worldAABB.lowerBound.Set(-100, -100);
sim.worldAABB.upperBound.Set(100, 100);
sw = (stage.stageWidth / 30);
sh = (stage.stageHeight / 30);
BottomWall = sim.addBox({skin:BottomWallBG, x:(sw / 2), y:sh, width:sw, height:1, density:0});
BottomWall.userData.name = "BottomWall";
TopWall = sim.addBox({skin:TopWallBG, x:(sw / 2), y:0, width:sw, height:1, density:0});
TopWall.userData.name = "TopWall";
LeftWall = sim.addBox({skin:LeftWallBG, x:0, y:(sh / 2), width:1, height:(sh + 1), density:0});
LeftWall.userData.name = "LeftWall";
RightWall = sim.addBox({skin:RightWallBG, x:sw, y:(sh / 2), width:1, height:(sh + 1), density:0});
RightWall.userData.name = "RightWall";
PlayerHitBox = sim.addBox({fillAlpha:0, x:(Player.x / 30), y:(Player.y / 30), width:((Player.width / 30) - 0.5), height:(Player.height / 30), density:0});
PlayerHitBox.userData.name = "PlayerHitBox";
m_contactListener = new b2ContactListener();
sim.w.SetContactListener(m_contactListener);
sim.start();
stage.addEventListener(Event.ENTER_FRAME, loop);
stage.addEventListener(KeyboardEvent.KEY_UP, checkKeysUp);
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkKeysDown);
stage.addEventListener(MouseEvent.MOUSE_DOWN, shoot);
stage.addEventListener(MouseEvent.MOUSE_UP, stopshoot);
ChallengeComplete = false;
keyArray = new Array();
shells = new Array();
shellNum = 0;
shellReset = false;
CeaseFire = false;
Reloaded = true;
DelayFire = false;
ClipSize = (WeaponType[WeaponNum][7] + Math.floor((WeaponType[WeaponNum][7] * AmmoIncrease)));
ClipAmount = 0;
DefaultRotation = Player.rotation;
CampaignStarted = false;
CampaignStartCounter = 3;
TintTimer = new Timer(100);
TintTimer.addEventListener(TimerEvent.TIMER, TintTime);
EnemyTintTimer = new Timer(100);
EnemyTintTimer.addEventListener(TimerEvent.TIMER, EnemyTintTime);
LifeDrainTimer = new Timer(2000);
LifeDrainTimer.addEventListener(TimerEvent.TIMER, LifeDrain);
CampaignStartTimer = new Timer(1000);
CampaignStartTimer.addEventListener(TimerEvent.TIMER, CampaignStart);
if (GameType == "Training"){
TrainingText.htmlText = "<B>Press 'R' to Reset Warmup.</B>";
StackBox = 365;
boxNum = 10;
boxes = new Array();
ClipAmount = 99;
CreateTrainingCrates();
} else {
if (GameType == "Accuracy"){
TrainingText.htmlText = "<B>Press 'R' to Start Challenge.</B>";
AccuracyStarted = false;
TargetHitAccuracy = false;
TargetNumAccuracy = 0;
TargetsMissed = 0;
global.TargetsHit = 0;
AccuracyTargets = new Array();
ClipAmount = 0;
} else {
if (GameType == "Speed"){
TrainingText.htmlText = "<B>Shoot a target to start.</B>";
SpeedTimerStarted = false;
SpeedTimer = 0;
TargetNumSpeed = 0;
SpeedTargets = new Array();
ClipAmount = 99;
} else {
if (GameType == "Skill"){
TrainingText.htmlText = "<B>Press 'R' to Reset Challenge.</B>";
SkillBoxes = new Array();
StackSkillBox = 0;
GoalPlatform1 = "";
GoalPlatform2 = "";
GoalCrate = "";
GoalTimerStarted = false;
SkillChallengeComplete = false;
GoalTime = 3;
WorldDestroy = false;
ClipAmount = 99;
StartSkillGame();
} else {
if (GameType == "Campaign"){
if (DefenseCurrLevel >= 1){
TrainingText.htmlText = (("<B>Level " + DefenseCurrLevel) + ", Defend the zone!</B>");
} else {
if (EfficiencyCurrLevel >= 1){
TrainingText.htmlText = (("<B>Level " + EfficiencyCurrLevel) + ", Hit the target!</B>");
} else {
if (OffenseCurrLevel >= 1){
TrainingText.htmlText = (("<B>Level " + OffenseCurrLevel) + ", Destroy the enemy!</B>");
};
};
};
Enemy = new Array();
EnemyZigZag = new Array();
global.EnemyHP = [];
global.TargetsHit = 0;
global.WeaponDamage = (WeaponType[WeaponNum][28] + Math.floor((WeaponType[WeaponNum][28] * DamageIncrease)));
CampaignEnd = false;
EnemyMove = new Array();
EnemyNum = 0;
EnemyTotal = 0;
EnemyKillTotal = 0;
RandomEnemy = 0;
Lives = 5;
WallSpawn = 0;
Walls = new Array();
WallSpeed = 0;
WallSpeedVert = 0;
StackCampaignBox = 0;
EnemyDeath = 0;
EnemyBulletSpeed = 0;
EnemyBulletWidth = 0;
EnemyBulletHeight = 0;
EnemyBulletSound = new BlankSound();
EnemyTint = new Color();
EnemyTint.setTint(0, 0.5);
PlayerHitTint = new Color();
PlayerHitTint.setTint(0x990000, 0.5);
PlayerNormalTint = new Color();
PlayerNormalTint.setTint(0x990000, 0);
ClipAmount = 99;
CampaignTimerGraphic.alpha = 1;
CampaignTimerGraphic.gotoAndStop((CampaignStartCounter + 1));
CampaignStartTimer.start();
if (DefenseCurrLevel == 1){
global.currentLevel = 1;
EnemyTotal = 15;
EnemyKillTotal = 15;
};
if (DefenseCurrLevel == 2){
global.currentLevel = 2;
EnemyTotal = 20;
EnemyKillTotal = 20;
};
if (DefenseCurrLevel == 3){
global.currentLevel = 3;
EnemyTotal = 25;
EnemyKillTotal = 25;
};
if (DefenseCurrLevel == 4){
global.currentLevel = 4;
EnemyTotal = 30;
EnemyKillTotal = 30;
};
if (DefenseCurrLevel == 5){
global.currentLevel = 5;
EnemyTotal = 35;
EnemyKillTotal = 35;
};
if (DefenseCurrLevel == 6){
global.currentLevel = 6;
EnemyTotal = 30;
EnemyKillTotal = 30;
};
if (DefenseCurrLevel == 7){
global.currentLevel = 7;
EnemyTotal = 40;
EnemyKillTotal = 40;
};
if (EfficiencyCurrLevel == 1){
global.currentLevel = 8;
EnemyTotal = 1;
EnemyKillTotal = 1;
WallSpawn = 0;
WallSpeed = 0.05;
WallSpeedVert = 0.025;
};
if (EfficiencyCurrLevel == 2){
global.currentLevel = 9;
EnemyTotal = 1;
EnemyKillTotal = 1;
WallSpawn = 0;
WallSpeed = 0.065;
WallSpeedVert = 0.03;
};
if (EfficiencyCurrLevel == 3){
global.currentLevel = 10;
EnemyTotal = 1;
EnemyKillTotal = 1;
WallSpawn = 0;
WallSpeed = 0.07;
WallSpeedVert = 0.035;
Lives = 6;
};
if (EfficiencyCurrLevel == 4){
global.currentLevel = 11;
EnemyTotal = 1;
EnemyKillTotal = 1;
WallSpawn = 0;
WallSpeed = 0.08;
WallSpeedVert = 0.045;
Lives = 6;
};
if (EfficiencyCurrLevel == 5){
global.currentLevel = 12;
EnemyTotal = 1;
EnemyKillTotal = 1;
WallSpawn = 0;
WallSpeed = 0.1;
WallSpeedVert = 0.06;
Lives = 8;
};
if (EfficiencyCurrLevel == 6){
global.currentLevel = 13;
EnemyTotal = 1;
EnemyKillTotal = 1;
WallSpawn = 0;
WallSpeed = 0.15;
WallSpeedVert = 0.065;
Lives = 6;
};
if (EfficiencyCurrLevel == 7){
global.currentLevel = 14;
EnemyTotal = 1;
EnemyKillTotal = 1;
WallSpawn = 0;
WallSpeed = 0.2;
WallSpeedVert = 0.075;
Lives = 6;
};
if (OffenseCurrLevel == 1){
global.currentLevel = 15;
EnemyTotal = 1;
EnemyKillTotal = 1;
EnemyDeath = 17;
EnemyBulletWidth = 0.4;
EnemyBulletHeight = 0.1;
EnemyBulletSpeed = 1.2;
EnemyBulletSound = new GlockFire();
Lives = 10;
};
if (OffenseCurrLevel == 2){
global.currentLevel = 16;
EnemyTotal = 1;
EnemyKillTotal = 1;
EnemyDeath = 5;
EnemyBulletWidth = 0.4;
EnemyBulletHeight = 0.09;
EnemyBulletSpeed = 1.2;
EnemyBulletSound = new USPFire();
Lives = 10;
};
if (OffenseCurrLevel == 3){
global.currentLevel = 17;
EnemyTotal = 1;
EnemyKillTotal = 1;
EnemyDeath = 7;
EnemyBulletWidth = 0.3;
EnemyBulletHeight = 0.1;
EnemyBulletSpeed = 0.8;
EnemyBulletSound = new MP5Fire();
Lives = 10;
};
if (OffenseCurrLevel == 4){
global.currentLevel = 18;
EnemyTotal = 1;
EnemyKillTotal = 1;
EnemyDeath = 5;
EnemyBulletWidth = 0.3;
EnemyBulletHeight = 0.09;
EnemyBulletSpeed = 0.85;
EnemyBulletSound = new BerettaSMGFire();
Lives = 10;
};
if (OffenseCurrLevel == 5){
global.currentLevel = 19;
EnemyTotal = 1;
EnemyKillTotal = 1;
EnemyDeath = 11;
EnemyBulletWidth = 0.45;
EnemyBulletHeight = 0.1;
EnemyBulletSpeed = 1.4;
EnemyBulletSound = new M1AFire();
Lives = 10;
};
if (OffenseCurrLevel == 6){
global.currentLevel = 20;
EnemyTotal = 1;
EnemyKillTotal = 1;
EnemyDeath = 15;
EnemyBulletWidth = 0.45;
EnemyBulletHeight = 0.1;
EnemyBulletSpeed = 1.8;
EnemyBulletSound = new MagnumFire();
Lives = 10;
};
if (OffenseCurrLevel == 7){
global.currentLevel = 21;
EnemyTotal = 1;
EnemyKillTotal = 1;
EnemyDeath = 4;
EnemyBulletWidth = 0.3;
EnemyBulletHeight = 0.09;
EnemyBulletSpeed = 1.3;
EnemyBulletSound = new P90Fire();
Lives = 10;
};
};
};
};
};
};
i = 0;
while (i < 222) {
keyArray.push(false);
i++;
};
WeaponTimer = new Timer(WeaponType[WeaponNum][6]);
WeaponTimer.addEventListener(TimerEvent.TIMER, WeaponAutoFire);
SkillChallengeTimer = new Timer(1000);
SkillChallengeTimer.addEventListener(TimerEvent.TIMER, SkillChallenge);
if (GameType == "Speed"){
StackSpeedTargets = 355;
MoveSpeedTargets = 50;
i = 0;
while (i < WeaponType[WeaponNum][12]) {
SpeedTargets[i] = sim.addCircle({skin:Target, lineAlpha:1, fillColor:0xCCCCCC, density:0, radius:0.5, x:(MoveSpeedTargets / 30), y:(StackSpeedTargets / 30), restitution:0, isSleeping:true, allowSleep:true, fixedRotation:false, draggable:false});
SpeedTargets[i].userData.name = (("Target" + "&") + i);
StackSpeedTargets = (StackSpeedTargets - 35);
if (i == 9){
StackSpeedTargets = 355;
MoveSpeedTargets = (MoveSpeedTargets + 40);
};
if (i == 19){
StackSpeedTargets = 355;
MoveSpeedTargets = (MoveSpeedTargets + 40);
};
if (i == 29){
StackSpeedTargets = 355;
MoveSpeedTargets = (MoveSpeedTargets + 40);
};
if (i == 39){
StackSpeedTargets = 355;
MoveSpeedTargets = (MoveSpeedTargets + 40);
};
i++;
};
};
SpeedChallengeTimer = new Timer(1000);
SpeedChallengeTimer.addEventListener(TimerEvent.TIMER, SpeedChallenge);
if (GameType == "Accuracy"){
AccuracyChallengeTimer = new Timer(WeaponType[WeaponNum][8]);
AccuracyChallengeTimer.addEventListener(TimerEvent.TIMER, AccuracyChallenge);
};
RecoilRecoveryTimer = new Timer(100);
RecoilRecoveryTimer.addEventListener(TimerEvent.TIMER, RecoilRecovery);
this.setChildIndex(TutorialHelper, (this.numChildren - 1));
TutorialHelper.alpha = 0.25;
}
function frame1(){
if (this.stage){
this.addedToStage();
} else {
stop();
this.addEventListener(Event.ADDED_TO_STAGE, addedToStage);
return;
};
}
public function ChazLinkVisitBig(_arg1:MouseEvent){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.flashchaz.com/");
navigateToURL(_local2, "_blank");
}
public function RedColorUnlockRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Red Color</B> \n Complete the 'Reloader' Achievement.";
}
public function PlumpmanLinkVisit(_arg1:MouseEvent){
var _local2:URLRequest;
_local2 = new URLRequest("http://plumpman.newgrounds.com/");
navigateToURL(_local2, "_blank");
}
function frame2(){
MuteTransform = new SoundTransform(1, 0);
MuteTransform.volume = 0;
UnmuteTransform = new SoundTransform(1, 0);
UnmuteTransform.volume = 1;
fm_menu = new ContextMenu();
TheGunGame = new ContextMenuItem("The Gun Game");
Plumpman = new ContextMenuItem("Programmed By Nicolas 'Plumpman'");
Chaz = new ContextMenuItem("Artwork By Chaz");
Sponsor = new ContextMenuItem("Sponsored by Bored.com");
UnmuteSound = new ContextMenuItem("Unmute Sounds");
MuteSound = new ContextMenuItem("Mute Sounds");
TheGunGame.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visit_TheGunGame);
Plumpman.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visit_Plumpman);
Chaz.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visit_Chaz);
Sponsor.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visit_Sponsor);
UnmuteSound.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Unmute_Sound);
MuteSound.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, Mute_Sound);
Plumpman.separatorBefore = true;
Chaz.separatorBefore = false;
Sponsor.separatorBefore = true;
UnmuteSound.separatorBefore = true;
fm_menu.hideBuiltInItems();
fm_menu.customItems.push(TheGunGame, Plumpman, Chaz, Sponsor, UnmuteSound, MuteSound);
this.contextMenu = fm_menu;
CurrentPlate = "Campaign";
PlateX = 0;
GameType = "None";
Slot1 = 1;
Slot2 = 2;
Slot3 = 3;
ActiveSlot = 1;
ActiveWeaponCategory = 1;
DefenseLevelsUnlocked = 1;
EfficiencyLevelsUnlocked = 1;
OffenseLevelsUnlocked = 1;
LevelsUnlockedTotal = 0;
DefenseCurrLevel = 0;
EfficiencyCurrLevel = 0;
OffenseCurrLevel = 0;
TotalTimePlayed = 0;
MaxShellNum = 20;
MovieQuality = "high";
PlateBGColor = "Blue";
HandSkin = 1;
AmmoIncrease = 0;
RecoilReduction = 0;
DamageIncrease = 0;
global.currMovieFrame = 2;
stage.quality = MovieQuality;
TotalTimePlayedTimer = new Timer(1000);
TotalTimePlayedTimer.addEventListener(TimerEvent.TIMER, TotalTime);
TotalTimePlayedTimer.start();
ReloaderCurr = 0;
ReloaderTotal = 150;
JugglerCurr = 0;
JugglerTotal = 250;
GlockCrewCurr = 0;
GlockCrewTotal = 200;
UziDaddyCurr = 0;
UziDaddyTotal = 750;
MP5JockeyCurr = 0;
MP5JockeyTotal = 1500;
SkorpionKillerCurr = 0;
SkorpionKillerTotal = 800;
MagnumMasterCurr = 0;
MagnumMasterTotal = 600;
USPNinjaCurr = 0;
USPNinjaTotal = 1000;
RiotPoliceCurr = 0;
RiotPoliceTotal = 300;
BerettaBeastCurr = 0;
BerettaBeastTotal = 1750;
CarbineCrazyCurr = 0;
CarbineCrazyTotal = 1500;
PK2PlayerCurr = 0;
PK2PlayerTotal = 2000;
P90PowerCurr = 0;
P90PowerTotal = 5000;
M1AMartyrCurr = 0;
M1AMartyrTotal = 800;
DudeDeagleCurr = 0;
DudeDeagleTotal = 700;
WaltherWaltzCurr = 0;
WaltherWaltzTotal = 900;
LugerLoveCurr = 0;
LugerLoveTotal = 800;
TargetHaterCurr = 0;
TargetHaterTotal = 500;
DoNotPressCurr = 0;
DoNotPressTotal = 200;
NoviceMedalCurr = 0;
NoviceMedalTotal = 57;
VeteranMedalCurr = 0;
VeteranMedalTotal = 57;
ExpertMedalCurr = 0;
ExpertMedalTotal = 57;
SpasOfSpadesCurr = 0;
SpasOfSpadesTotal = 800;
FamousFamasCurr = 0;
FamousFamasTotal = 3000;
Kar98kRunCurr = 0;
Kar98kRunTotal = 98000;
PiecemakerCurr = 0;
PiecemakerTotal = 1200;
DeagleUnlocked = false;
WaltherPPKUnlocked = false;
LugerUnlocked = false;
MagnumUnlocked = false;
SkorpionUnlocked = false;
BerettaSMGUnlocked = false;
SMGPK2Unlocked = false;
P90Unlocked = false;
GreenColorUnlocked = false;
RedColorUnlocked = false;
SkeletonHandUnlocked = false;
Spas12Unlocked = false;
FamasUnlocked = false;
Kar98kUnlocked = false;
GlockUpgradeUnlocked = false;
USPUpgradeUnlocked = false;
DeagleUpgradeUnlocked = false;
WaltherUpgradeUnlocked = false;
LugerUpgradeUnlocked = false;
UziUpgradeUnlocked = false;
SkorpionUpgradeUnlocked = false;
BerettaUpgradeUnlocked = false;
PK2UpgradeUnlocked = false;
P90UpgradeUnlocked = false;
Spas12UpgradeUnlocked = false;
FamasUpgradeUnlocked = false;
Kar98kUpgradeUnlocked = false;
PeacemakerUnlocked = false;
PeacemakerUpgradeUnlocked = false;
NoviceUpgradeUnlocked = false;
VeteranUpgradeUnlocked = false;
ExpertUpgradeUnlocked = false;
GunNewbieUpgradeUnlocked = false;
GunNutUpgradeUnlocked = false;
GunAddictUpgradeUnlocked = false;
PlatinumColorUnlocked = false;
WeaponNum = Slot1;
WeaponType = [["Blank", Blank, 0, 0, 16763955, 0, 0, 0, 1000, 0.75, 0, "None", 0, 0, 99, "None", 0, 99, "None", 0, 0, 0, 0, 0, Blank, BlankSound, 0, 0, 0, 0], ["Glock", Glock, 0.4, 0.1, 16763955, 1.2, 0, 12, 2500, 0.45, 0, "None", 20, 16, 99, "None", 2, 99, "None", 17, 0.01, 2.5, 1, 9, GlockFire, GlockReload, 700, 0, 2, 1], ["Micro Uzi", MicroUzi, 0.3, 0.1, 16763955, 1, 125, 20, 2000, 0.65, 0, "None", 30, 16, 99, "None", 2, 99, "None", 5, 0.05, 1.2, 0.7, 7, UziFire, GlockReload, 600, 0, 0.8, 1], ["MP5", MP5, 0.3, 0.1, 16763955, 1, 100, 30, 2000, 0.75, 0, "None", 25, 15, 99, "None", 4, 99, "None", 7, 0.075, 1.35, 0.85, 9, MP5Fire, MP5Reload, 450, 0, 0.75, 1], ["Skorpion", Skorpion, 0.3, 0.09, 16763955, 1, 110, 20, 2000, 0.65, 0, "None", 18, 10, 99, "None", 2, 99, "None", 6, 0.045, 1.1, 0.6, 9, SkorpionFire, GlockReload, 900, 0, 0.85, 1], [".357 Magnum", Magnum, 0.45, 0.1, 16763955, 2, 0, 6, 1800, 0.2, 0, "None", 10, 14, 99, "None", 1, 99, "None", 15, 0.01, 10, 1.5, 20, MagnumFire, BlankSound, 0, 0, 5, 1], ["USP", USP, 0.4, 0.09, 16763955, 1.3, 0, 12, 2200, 0.3, 0, "None", 16, 12, 99, "None", 3, 99, "None", 5, 0.01, 2.3, 1, 8, USPFire, GlockReload, 800, 0, 2, 1], ["Riot Shotgun", RiotShotgun, 0.12, 0.12, 0xCCCCCC, 0.6, 0, 6, 1500, 0.3, 0, "None", 35, 16, 99, "None", 6, 99, "None", 32, 0.25, 15, 2, 30, RiotShotgunFire, BlankSound, 0, 0, 0.9, 6], ["Beretta PM-12", BerettaSMG, 0.3, 0.09, 16763955, 1.1, 90, 32, 1800, 0.3, 0, "None", 20, 10, 99, "None", 3, 99, "None", 5, 0.03, 1.2, 0.75, 8, BerettaSMGFire, MP5Reload, 350, 0, 0.7, 1], ["M4 Carbine", M4Carbine, 0.4, 0.1, 16763955, 1.6, 100, 30, 1800, 0.25, 0, "None", 25, 12, 99, "None", 2, 99, "None", 4, 0.04, 2.4, 1.5, 12, M4CarbineFire, BlankSound, 0, 0, 0.9, 1], ["SMG-PK2", SMGPK2, 0.3, 0.09, 16763955, 1.2, 100, 15, 2000, 0.4, 0, "None", 18, 12, 99, "None", 5, 99, "None", 5, 0.025, 1.1, 0.5, 7, MP5Fire, MP5Reload, 500, 0, 0.85, 1], ["M1A Rifle", M1A, 0.5, 0.1, 16763955, 2, 0, 5, 1800, 0.2, 0, "None", 8, 8, 99, "None", 2, 99, "None", 11, 0.005, 8, 1.75, 16, M1AFire, BlankSound, 0, 0, 5.5, 1], ["Desert Eagle", Deagle, 0.5, 0.15, 16763955, 2.4, 0, 7, 2000, 0.3, 0, "None", 10, 15, 99, "None", 2, 99, "None", 7, 0.04, 7, 1.25, 14, DeagleFire, BlankSound, 0, 0, 4, 1], ["Walther PPK", WaltherPPK, 0.35, 0.09, 16763955, 1.4, 0, 9, 2000, 0.25, 0, "None", 9, 8, 99, "None", 3, 99, "None", 4, 0.005, 2, 1, 10, WaltherPPKFire, GlockReload, 200, 0, 2, 1], ["Luger", Luger, 0.3, 0.08, 16763955, 1.4, 0, 8, 2500, 0.15, 0, "None", 12, 12, 99, "None", 1, 99, "None", 7, 0, 1.8, 1, 9, LugerFire, BlankSound, 0, 0, 2, 1], ["P90", P90, 0.3, 0.09, 16763955, 1.2, 80, 50, 1600, 0.4, 0, "None", 40, 16, 99, "None", 3, 99, "None", 4, 0.03, 1.1, 0.75, 9, P90Fire, BlankSound, 0, 0, 0.75, 1], ["Spas-12", Spas12, 0.12, 0.12, 0xCCCCCC, 0.75, 0, 8, 1750, 0.25, 0, "None", 20, 7, 99, "None", 8, 99, "None", 28, 0.2, 12, 1.75, 24, Spas12Fire, BlankSound, 0, 0, 1, 8], ["Famas", Famas, 0.4, 0.1, 16763955, 1.5, 90, 30, 1750, 0.25, 0, "None", 15, 7, 99, "None", 2, 99, "None", 5, 0.03, 2, 1.4, 10, FamasFire, BlankSound, 0, 0, 0.95, 1], ["Kar 98k", Kar98k, 0.5, 0.09, 16763955, 2.1, 0, 5, 1600, 0.2, 0, "None", 10, 10, 99, "None", 1, 99, "None", 54, 0, 6, 1.6, 12, Kar98kFire, BlankSound, 0, 0, 6, 1], ["Peacemaker", Peacemaker, 0.5, 0.1, 16763955, 2.5, 0, 6, 1200, 0.3, 0, "None", 8, 15, 99, "None", 1, 99, "None", 11, 0, 15, 2, 20, PeacemakerFire, BlankSound, 0, 0, 8, 1]];
SaveVariables = [[WeaponNum, Slot1, Slot2, Slot3, ActiveSlot, ActiveWeaponCategory, DefenseLevelsUnlocked, EfficiencyLevelsUnlocked, OffenseLevelsUnlocked, LevelsUnlockedTotal, TotalTimePlayed, MaxShellNum, MovieQuality, PlateBGColor, HandSkin, AmmoIncrease, RecoilReduction, DamageIncrease]];
SaveUnlocks = [[DeagleUnlocked, WaltherPPKUnlocked, LugerUnlocked, MagnumUnlocked, SkorpionUnlocked, BerettaSMGUnlocked, SMGPK2Unlocked, P90Unlocked, GreenColorUnlocked, RedColorUnlocked, SkeletonHandUnlocked, Spas12Unlocked, FamasUnlocked, Kar98kUnlocked, GlockUpgradeUnlocked, USPUpgradeUnlocked, DeagleUpgradeUnlocked, WaltherUpgradeUnlocked, LugerUpgradeUnlocked, UziUpgradeUnlocked, SkorpionUpgradeUnlocked, BerettaUpgradeUnlocked, PK2UpgradeUnlocked, P90UpgradeUnlocked, Spas12UpgradeUnlocked, FamasUpgradeUnlocked, Kar98kUpgradeUnlocked, PeacemakerUnlocked, PeacemakerUpgradeUnlocked, NoviceUpgradeUnlocked, VeteranUpgradeUnlocked, ExpertUpgradeUnlocked, GunNewbieUpgradeUnlocked, GunNutUpgradeUnlocked, GunAddictUpgradeUnlocked, PlatinumColorUnlocked]];
SaveAchieves = [[ReloaderCurr, JugglerCurr, GlockCrewCurr, UziDaddyCurr, MP5JockeyCurr, SkorpionKillerCurr, MagnumMasterCurr, USPNinjaCurr, RiotPoliceCurr, BerettaBeastCurr, CarbineCrazyCurr, PK2PlayerCurr, P90PowerCurr, M1AMartyrCurr, DudeDeagleCurr, WaltherWaltzCurr, LugerLoveCurr, TargetHaterCurr, DoNotPressCurr, NoviceMedalCurr, VeteranMedalCurr, ExpertMedalCurr, SpasOfSpadesCurr, FamousFamasCurr, Kar98kRunCurr, PiecemakerCurr]];
SaveMedals = new Array();
i = 0;
while (i < WeaponType.length) {
SaveMedals[i] = [[WeaponType[i][10], WeaponType[i][11], WeaponType[i][14], WeaponType[i][15], WeaponType[i][17], WeaponType[i][18], WeaponType[i][2], WeaponType[i][3], WeaponType[i][4], WeaponType[i][5], WeaponType[i][6], WeaponType[i][7], WeaponType[i][20], WeaponType[i][21], WeaponType[i][22], WeaponType[i][23], WeaponType[i][28]]];
i++;
};
SaveFile = SharedObject.getLocal("thegungame");
if (SaveFile.data.VariableArray == undefined){
SaveFile.data.VariableArray = SaveVariables;
} else {
WeaponNum = SaveFile.data.VariableArray[0][0];
Slot1 = SaveFile.data.VariableArray[0][1];
Slot2 = SaveFile.data.VariableArray[0][2];
Slot3 = SaveFile.data.VariableArray[0][3];
ActiveSlot = SaveFile.data.VariableArray[0][4];
ActiveWeaponCategory = SaveFile.data.VariableArray[0][5];
DefenseLevelsUnlocked = SaveFile.data.VariableArray[0][6];
EfficiencyLevelsUnlocked = SaveFile.data.VariableArray[0][7];
OffenseLevelsUnlocked = SaveFile.data.VariableArray[0][8];
LevelsUnlockedTotal = SaveFile.data.VariableArray[0][9];
TotalTimePlayed = SaveFile.data.VariableArray[0][10];
MaxShellNum = SaveFile.data.VariableArray[0][11];
MovieQuality = SaveFile.data.VariableArray[0][12];
PlateBGColor = SaveFile.data.VariableArray[0][13];
HandSkin = SaveFile.data.VariableArray[0][14];
AmmoIncrease = SaveFile.data.VariableArray[0][15];
RecoilReduction = SaveFile.data.VariableArray[0][16];
DamageIncrease = SaveFile.data.VariableArray[0][17];
stage.quality = MovieQuality;
};
if (SaveFile.data.UnlockArray == undefined){
SaveFile.data.UnlockArray = SaveUnlocks;
} else {
DeagleUnlocked = SaveFile.data.UnlockArray[0][0];
WaltherPPKUnlocked = SaveFile.data.UnlockArray[0][1];
LugerUnlocked = SaveFile.data.UnlockArray[0][2];
MagnumUnlocked = SaveFile.data.UnlockArray[0][3];
SkorpionUnlocked = SaveFile.data.UnlockArray[0][4];
BerettaSMGUnlocked = SaveFile.data.UnlockArray[0][5];
SMGPK2Unlocked = SaveFile.data.UnlockArray[0][6];
P90Unlocked = SaveFile.data.UnlockArray[0][7];
GreenColorUnlocked = SaveFile.data.UnlockArray[0][8];
RedColorUnlocked = SaveFile.data.UnlockArray[0][9];
SkeletonHandUnlocked = SaveFile.data.UnlockArray[0][10];
Spas12Unlocked = SaveFile.data.UnlockArray[0][11];
FamasUnlocked = SaveFile.data.UnlockArray[0][12];
Kar98kUnlocked = SaveFile.data.UnlockArray[0][13];
GlockUpgradeUnlocked = SaveFile.data.UnlockArray[0][14];
USPUpgradeUnlocked = SaveFile.data.UnlockArray[0][15];
DeagleUpgradeUnlocked = SaveFile.data.UnlockArray[0][16];
WaltherUpgradeUnlocked = SaveFile.data.UnlockArray[0][17];
LugerUpgradeUnlocked = SaveFile.data.UnlockArray[0][18];
UziUpgradeUnlocked = SaveFile.data.UnlockArray[0][19];
SkorpionUpgradeUnlocked = SaveFile.data.UnlockArray[0][20];
BerettaUpgradeUnlocked = SaveFile.data.UnlockArray[0][21];
PK2UpgradeUnlocked = SaveFile.data.UnlockArray[0][22];
P90UpgradeUnlocked = SaveFile.data.UnlockArray[0][23];
Spas12UpgradeUnlocked = SaveFile.data.UnlockArray[0][24];
FamasUpgradeUnlocked = SaveFile.data.UnlockArray[0][25];
Kar98kUpgradeUnlocked = SaveFile.data.UnlockArray[0][26];
PeacemakerUnlocked = SaveFile.data.UnlockArray[0][27];
PeacemakerUpgradeUnlocked = SaveFile.data.UnlockArray[0][28];
NoviceUpgradeUnlocked = SaveFile.data.UnlockArray[0][29];
VeteranUpgradeUnlocked = SaveFile.data.UnlockArray[0][30];
ExpertUpgradeUnlocked = SaveFile.data.UnlockArray[0][31];
GunNewbieUpgradeUnlocked = SaveFile.data.UnlockArray[0][32];
GunNutUpgradeUnlocked = SaveFile.data.UnlockArray[0][33];
GunAddictUpgradeUnlocked = SaveFile.data.UnlockArray[0][34];
PlatinumColorUnlocked = SaveFile.data.UnlockArray[0][35];
};
if (SaveFile.data.AchieveArray == undefined){
SaveFile.data.AchieveArray = SaveAchieves;
} else {
ReloaderCurr = SaveFile.data.AchieveArray[0][0];
JugglerCurr = SaveFile.data.AchieveArray[0][1];
GlockCrewCurr = SaveFile.data.AchieveArray[0][2];
UziDaddyCurr = SaveFile.data.AchieveArray[0][3];
MP5JockeyCurr = SaveFile.data.AchieveArray[0][4];
SkorpionKillerCurr = SaveFile.data.AchieveArray[0][5];
MagnumMasterCurr = SaveFile.data.AchieveArray[0][6];
USPNinjaCurr = SaveFile.data.AchieveArray[0][7];
RiotPoliceCurr = SaveFile.data.AchieveArray[0][8];
BerettaBeastCurr = SaveFile.data.AchieveArray[0][9];
CarbineCrazyCurr = SaveFile.data.AchieveArray[0][10];
PK2PlayerCurr = SaveFile.data.AchieveArray[0][11];
P90PowerCurr = SaveFile.data.AchieveArray[0][12];
M1AMartyrCurr = SaveFile.data.AchieveArray[0][13];
DudeDeagleCurr = SaveFile.data.AchieveArray[0][14];
WaltherWaltzCurr = SaveFile.data.AchieveArray[0][15];
LugerLoveCurr = SaveFile.data.AchieveArray[0][16];
TargetHaterCurr = SaveFile.data.AchieveArray[0][17];
DoNotPressCurr = SaveFile.data.AchieveArray[0][18];
NoviceMedalCurr = SaveFile.data.AchieveArray[0][19];
VeteranMedalCurr = SaveFile.data.AchieveArray[0][20];
ExpertMedalCurr = SaveFile.data.AchieveArray[0][21];
SpasOfSpadesCurr = SaveFile.data.AchieveArray[0][22];
FamousFamasCurr = SaveFile.data.AchieveArray[0][23];
Kar98kRunCurr = SaveFile.data.AchieveArray[0][24];
PiecemakerCurr = SaveFile.data.AchieveArray[0][25];
};
if (SaveFile.data.MedalArray == undefined){
SaveFile.data.MedalArray = SaveMedals;
} else {
i = 0;
while (i < WeaponType.length) {
WeaponType[i][10] = SaveFile.data.MedalArray[i][0][0];
WeaponType[i][11] = SaveFile.data.MedalArray[i][0][1];
WeaponType[i][14] = SaveFile.data.MedalArray[i][0][2];
WeaponType[i][15] = SaveFile.data.MedalArray[i][0][3];
WeaponType[i][17] = SaveFile.data.MedalArray[i][0][4];
WeaponType[i][18] = SaveFile.data.MedalArray[i][0][5];
WeaponType[i][2] = SaveFile.data.MedalArray[i][0][6];
WeaponType[i][3] = SaveFile.data.MedalArray[i][0][7];
WeaponType[i][4] = SaveFile.data.MedalArray[i][0][8];
WeaponType[i][5] = SaveFile.data.MedalArray[i][0][9];
WeaponType[i][6] = SaveFile.data.MedalArray[i][0][10];
WeaponType[i][7] = SaveFile.data.MedalArray[i][0][11];
WeaponType[i][20] = SaveFile.data.MedalArray[i][0][12];
WeaponType[i][21] = SaveFile.data.MedalArray[i][0][13];
WeaponType[i][22] = SaveFile.data.MedalArray[i][0][14];
WeaponType[i][23] = SaveFile.data.MedalArray[i][0][15];
WeaponType[i][28] = SaveFile.data.MedalArray[i][0][16];
i++;
};
};
SaveFile.flush();
}
public function PlatinumColor(_arg1:MouseEvent){
PlateBGColor = "Platinum";
BackgroundColor.gotoAndStop(PlateBGColor);
PlateHolder.CampaignPlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.ChallengePlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.AchievePlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.WeaponPlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.OptionsPlate.PlateBG.gotoAndStop(PlateBGColor);
}
function frame4(){
global.currMovieFrame = 4;
}
public function GunNutRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Gun Nut</B> \n Played for 2 Hours";
}
public function MenuSystem(_arg1:Event):void{
Cursor.x = mouseX;
Cursor.y = mouseY;
this.setChildIndex(Cursor, (this.numChildren - 1));
PlateHolder.ChallengePlate.SkillInfo.htmlText = ((((((((((("<B>Your Best: </B>" + WeaponType[WeaponNum][17]) + " Shots") + "\n\n<B>Novice: </B>") + Math.round((WeaponType[WeaponNum][16] * 4))) + " Shots or less") + "\n<B>Veteran: </B>") + Math.round((WeaponType[WeaponNum][16] * 2))) + " Shots or less") + "\n<B>Expert: </B>") + Math.round(WeaponType[WeaponNum][16])) + " Shots or less");
PlateHolder.ChallengePlate.SkillMedal.gotoAndStop(WeaponType[WeaponNum][18]);
PlateHolder.ChallengePlate.SpeedInfo.htmlText = ((((((((((("<B>Your Best: </B>" + WeaponType[WeaponNum][14]) + " Sec") + "\n\n<B>Novice: </B>") + Math.round(WeaponType[WeaponNum][13])) + " Sec or less") + "\n<B>Veteran: </B>") + Math.round((WeaponType[WeaponNum][13] / 2.5))) + " Sec or less") + "\n<B>Expert: </B>") + Math.round((WeaponType[WeaponNum][13] / 3.5))) + " Sec or less");
PlateHolder.ChallengePlate.SpeedMedal.gotoAndStop(WeaponType[WeaponNum][15]);
PlateHolder.ChallengePlate.AccuracyInfo.htmlText = ((((((((((((((("<B>Your Best: </B>" + WeaponType[WeaponNum][10]) + "/") + WeaponType[WeaponNum][7]) + "\n\n<B>Novice: </B>") + Math.round((WeaponType[WeaponNum][7] * 0.35))) + "/") + WeaponType[WeaponNum][7]) + "\n<B>Veteran: </B>") + Math.round((WeaponType[WeaponNum][7] * 0.7))) + "/") + WeaponType[WeaponNum][7]) + "\n<B>Expert: </B>") + Math.round((WeaponType[WeaponNum][7] * 0.9))) + "/") + WeaponType[WeaponNum][7]);
PlateHolder.ChallengePlate.AccuracyMedal.gotoAndStop(WeaponType[WeaponNum][11]);
Slot1Weapon.gotoAndStop(Slot1);
Slot2Weapon.gotoAndStop(Slot2);
Slot3Weapon.gotoAndStop(Slot3);
Slot1Info.htmlText = WeaponType[Slot1][0];
Slot2Info.htmlText = WeaponType[Slot2][0];
Slot3Info.htmlText = WeaponType[Slot3][0];
i = 1;
while (i <= 3) {
if (this[(("Slot" + i) + "Weapon")].FrontHand){
this[(("Slot" + i) + "Weapon")].FrontHand.gotoAndStop(HandSkin);
};
if (this[(("Slot" + i) + "Weapon")].BackHand){
this[(("Slot" + i) + "Weapon")].BackHand.gotoAndStop(HandSkin);
};
if (this[(("Slot" + i) + "Weapon")].PreciseReloadHand){
this[(("Slot" + i) + "Weapon")].PreciseReloadHand.gotoAndStop(HandSkin);
};
if (this[(("Slot" + i) + "Weapon")].ReloadHand){
this[(("Slot" + i) + "Weapon")].ReloadHand.gotoAndStop(HandSkin);
};
if (this[(("Slot" + i) + "Weapon")].HoldHand){
this[(("Slot" + i) + "Weapon")].HoldHand.gotoAndStop(HandSkin);
};
if (this[(("Slot" + i) + "Weapon")].GripHand){
this[(("Slot" + i) + "Weapon")].GripHand.gotoAndStop(HandSkin);
};
if (this[(("Slot" + i) + "Weapon")].PumpHand){
this[(("Slot" + i) + "Weapon")].PumpHand.gotoAndStop(HandSkin);
};
if (this[(("Slot" + i) + "Weapon")].ThumbHand){
this[(("Slot" + i) + "Weapon")].ThumbHand.gotoAndStop(HandSkin);
};
if (ActiveSlot == i){
this[(("Slot" + i) + "Weapon")].alpha = 1;
this[(("Slot" + i) + "Weapon")].filters = [WeaponSelectOutline];
} else {
this[(("Slot" + i) + "Weapon")].alpha = 0.4;
this[(("Slot" + i) + "Weapon")].filters = [];
};
i++;
};
if (MovieQuality == "low"){
PlateHolder.OptionsPlate.LowQualityButton.alpha = 1;
PlateHolder.OptionsPlate.MediumQualityButton.alpha = 0.5;
PlateHolder.OptionsPlate.HighQualityButton.alpha = 0.5;
} else {
if (MovieQuality == "medium"){
PlateHolder.OptionsPlate.LowQualityButton.alpha = 0.5;
PlateHolder.OptionsPlate.MediumQualityButton.alpha = 1;
PlateHolder.OptionsPlate.HighQualityButton.alpha = 0.5;
} else {
if (MovieQuality == "high"){
PlateHolder.OptionsPlate.LowQualityButton.alpha = 0.5;
PlateHolder.OptionsPlate.MediumQualityButton.alpha = 0.5;
PlateHolder.OptionsPlate.HighQualityButton.alpha = 1;
};
};
};
if (MaxShellNum == 10){
PlateHolder.OptionsPlate.LowBulletsButton.alpha = 1;
PlateHolder.OptionsPlate.MediumBulletsButton.alpha = 0.5;
PlateHolder.OptionsPlate.HighBulletsButton.alpha = 0.5;
} else {
if (MaxShellNum == 20){
PlateHolder.OptionsPlate.LowBulletsButton.alpha = 0.5;
PlateHolder.OptionsPlate.MediumBulletsButton.alpha = 1;
PlateHolder.OptionsPlate.HighBulletsButton.alpha = 0.5;
} else {
if (MaxShellNum == 30){
PlateHolder.OptionsPlate.LowBulletsButton.alpha = 0.5;
PlateHolder.OptionsPlate.MediumBulletsButton.alpha = 0.5;
PlateHolder.OptionsPlate.HighBulletsButton.alpha = 1;
};
};
};
if (PlateBGColor == "Blue"){
PlateHolder.OptionsPlate.BlueColorButton.alpha = 1;
PlateHolder.OptionsPlate.GreenColorButton.alpha = 0.5;
PlateHolder.OptionsPlate.RedColorButton.alpha = 0.5;
PlateHolder.OptionsPlate.PlatinumColorButton.alpha = 0.5;
} else {
if (PlateBGColor == "Green"){
PlateHolder.OptionsPlate.BlueColorButton.alpha = 0.5;
PlateHolder.OptionsPlate.GreenColorButton.alpha = 1;
PlateHolder.OptionsPlate.RedColorButton.alpha = 0.5;
PlateHolder.OptionsPlate.PlatinumColorButton.alpha = 0.5;
} else {
if (PlateBGColor == "Red"){
PlateHolder.OptionsPlate.BlueColorButton.alpha = 0.5;
PlateHolder.OptionsPlate.GreenColorButton.alpha = 0.5;
PlateHolder.OptionsPlate.RedColorButton.alpha = 1;
PlateHolder.OptionsPlate.PlatinumColorButton.alpha = 0.5;
} else {
if (PlateBGColor == "Platinum"){
PlateHolder.OptionsPlate.BlueColorButton.alpha = 0.5;
PlateHolder.OptionsPlate.GreenColorButton.alpha = 0.5;
PlateHolder.OptionsPlate.RedColorButton.alpha = 0.5;
PlateHolder.OptionsPlate.PlatinumColorButton.alpha = 1;
};
};
};
};
if (HandSkin == 1){
PlateHolder.OptionsPlate.WhiteHandButton.alpha = 1;
PlateHolder.OptionsPlate.BlackHandButton.alpha = 0.5;
PlateHolder.OptionsPlate.SkeletonHandButton.alpha = 0.5;
} else {
if (HandSkin == 2){
PlateHolder.OptionsPlate.WhiteHandButton.alpha = 0.5;
PlateHolder.OptionsPlate.BlackHandButton.alpha = 1;
PlateHolder.OptionsPlate.SkeletonHandButton.alpha = 0.5;
} else {
if (HandSkin == 3){
PlateHolder.OptionsPlate.WhiteHandButton.alpha = 0.5;
PlateHolder.OptionsPlate.BlackHandButton.alpha = 0.5;
PlateHolder.OptionsPlate.SkeletonHandButton.alpha = 1;
};
};
};
}
function frame6(){
global.currMovieFrame = 6;
PlateHolder.CampaignPlate.SponsorLink.addEventListener(MouseEvent.CLICK, SponsorLinkVisit);
PlateHolder.ChallengePlate.SponsorLink.addEventListener(MouseEvent.CLICK, SponsorLinkVisit);
PlateHolder.WeaponPlate.SponsorLink.addEventListener(MouseEvent.CLICK, SponsorLinkVisit);
PlateHolder.AchievePlate.SponsorLink.addEventListener(MouseEvent.CLICK, SponsorLinkVisit);
PlateHolder.OptionsPlate.SponsorLink.addEventListener(MouseEvent.CLICK, SponsorLinkVisit);
PlateHolder.OptionsPlate.PlumpmanLinkBig.addEventListener(MouseEvent.CLICK, PlumpmanLinkVisitBig);
PlateHolder.OptionsPlate.ChazLinkBig.addEventListener(MouseEvent.CLICK, ChazLinkVisitBig);
PlateHolder.OptionsPlate.PlumpmanLinkBig.addEventListener(MouseEvent.ROLL_OVER, PlumpmanLinkRollOverBig);
PlateHolder.OptionsPlate.ChazLinkBig.addEventListener(MouseEvent.ROLL_OVER, ChazLinkRollOverBig);
PlateHolder.OptionsPlate.PlumpmanLinkBig.addEventListener(MouseEvent.ROLL_OUT, PlumpmanLinkRollOutBig);
PlateHolder.OptionsPlate.ChazLinkBig.addEventListener(MouseEvent.ROLL_OUT, ChazLinkRollOutBig);
if ((((((((WeaponType[12][11] == "Expert")) && ((WeaponType[12][15] == "Expert")))) && ((WeaponType[12][18] == "Expert")))) && ((LugerUnlocked == false)))){
LugerUnlocked = true;
};
if ((((((((WeaponType[6][11] == "Expert")) && ((WeaponType[6][15] == "Expert")))) && ((WeaponType[6][18] == "Expert")))) && ((WaltherPPKUnlocked == false)))){
WaltherPPKUnlocked = true;
};
if ((((((((WeaponType[4][11] == "Expert")) && ((WeaponType[4][15] == "Expert")))) && ((WeaponType[4][18] == "Expert")))) && ((SMGPK2Unlocked == false)))){
SMGPK2Unlocked = true;
};
if ((((((((((((((((((((((((((((((((WeaponType[10][11] == "Expert")) && ((WeaponType[10][15] == "Expert")))) && ((WeaponType[10][18] == "Expert")))) && ((WeaponType[8][11] == "Expert")))) && ((WeaponType[8][15] == "Expert")))) && ((WeaponType[8][18] == "Expert")))) && ((WeaponType[3][11] == "Expert")))) && ((WeaponType[3][15] == "Expert")))) && ((WeaponType[3][18] == "Expert")))) && ((WeaponType[2][11] == "Expert")))) && ((WeaponType[2][15] == "Expert")))) && ((WeaponType[2][18] == "Expert")))) && ((WeaponType[4][11] == "Expert")))) && ((WeaponType[4][15] == "Expert")))) && ((WeaponType[4][18] == "Expert")))) && ((P90Unlocked == false)))){
P90Unlocked = true;
};
if (CurrentPlate == "Achievements"){
PlateX = 275;
PlateHolder.x = PlateX;
} else {
if (CurrentPlate == "Weapons"){
PlateX = -275;
PlateHolder.x = PlateX;
} else {
if (CurrentPlate == "Challenges"){
PlateX = 825;
PlateHolder.x = PlateX;
} else {
if (CurrentPlate == "Campaign"){
PlateX = 1385;
PlateHolder.x = PlateX;
} else {
if (CurrentPlate == "Options"){
PlateX = -825;
PlateHolder.x = PlateX;
};
};
};
};
};
BackgroundColor.gotoAndStop(PlateBGColor);
PlateHolder.CampaignPlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.ChallengePlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.AchievePlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.WeaponPlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.OptionsPlate.PlateBG.gotoAndStop(PlateBGColor);
stop();
Mouse.hide();
Cursor.mouseEnabled = false;
Cursor.mouseChildren = false;
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
WeaponSelectOutline = new GlowFilter();
WeaponSelectOutline.color = 0xFFFFFF;
WeaponSelectOutline.blurX = 4;
WeaponSelectOutline.blurY = 4;
stage.addEventListener(Event.ENTER_FRAME, MenuSystem);
stage.addEventListener(MouseEvent.MOUSE_DOWN, HideMouse);
Slot1Weapon.addEventListener(MouseEvent.CLICK, PickSlot1);
Slot2Weapon.addEventListener(MouseEvent.CLICK, PickSlot2);
Slot3Weapon.addEventListener(MouseEvent.CLICK, PickSlot3);
TrainingButton.addEventListener(MouseEvent.CLICK, StartTraining);
PlateHolder.ChallengePlate.AccuracyChallengeButton.addEventListener(MouseEvent.CLICK, StartAccuracy);
PlateHolder.ChallengePlate.SpeedChallengeButton.addEventListener(MouseEvent.CLICK, StartSpeed);
PlateHolder.ChallengePlate.SkillChallengeButton.addEventListener(MouseEvent.CLICK, StartSkill);
i = 1;
while (i <= DefenseLevelsUnlocked) {
if (i < 8){
PlateHolder.CampaignPlate.getChildByName(("DefenseLevel" + i)).alpha = 1;
};
i++;
};
i = 1;
while (i <= DefenseLevelsUnlocked) {
if (i < 8){
PlateHolder.CampaignPlate.getChildByName(("DefenseLevel" + i)).addEventListener(MouseEvent.CLICK, root[(("DefenseLevel" + i) + "Start")]);
};
i++;
};
i = 1;
while (i <= EfficiencyLevelsUnlocked) {
if (i < 8){
PlateHolder.CampaignPlate.getChildByName(("EfficiencyLevel" + i)).alpha = 1;
};
i++;
};
i = 1;
while (i <= EfficiencyLevelsUnlocked) {
if (i < 8){
PlateHolder.CampaignPlate.getChildByName(("EfficiencyLevel" + i)).addEventListener(MouseEvent.CLICK, root[(("EfficiencyLevel" + i) + "Start")]);
};
i++;
};
i = 1;
while (i <= OffenseLevelsUnlocked) {
if (i < 8){
PlateHolder.CampaignPlate.getChildByName(("OffenseLevel" + i)).alpha = 1;
};
i++;
};
i = 1;
while (i <= OffenseLevelsUnlocked) {
if (i < 8){
PlateHolder.CampaignPlate.getChildByName(("OffenseLevel" + i)).addEventListener(MouseEvent.CLICK, root[(("OffenseLevel" + i) + "Start")]);
};
i++;
};
i = 1;
while (i <= (DefenseLevelsUnlocked - 1)) {
PlateHolder.CampaignPlate.getChildByName(("DefenseCheck" + i)).alpha = 1;
PlateHolder.CampaignPlate.getChildByName(("DefenseCheck" + i)).mouseEnabled = false;
i++;
};
i = 1;
while (i <= (EfficiencyLevelsUnlocked - 1)) {
PlateHolder.CampaignPlate.getChildByName(("EfficiencyCheck" + i)).alpha = 1;
PlateHolder.CampaignPlate.getChildByName(("EfficiencyCheck" + i)).mouseEnabled = false;
i++;
};
i = 1;
while (i <= (OffenseLevelsUnlocked - 1)) {
PlateHolder.CampaignPlate.getChildByName(("OffenseCheck" + i)).alpha = 1;
PlateHolder.CampaignPlate.getChildByName(("OffenseCheck" + i)).mouseEnabled = false;
i++;
};
CampaignButton.addEventListener(MouseEvent.CLICK, CampaignMenu);
ChallengeButton.addEventListener(MouseEvent.CLICK, ChallengeMenu);
WeaponButton.addEventListener(MouseEvent.CLICK, WeaponMenu);
OptionsButton.addEventListener(MouseEvent.CLICK, OptionsMenu);
PlateHolder.OptionsPlate.ResetSaveButton.addEventListener(MouseEvent.CLICK, ResetSave);
PlateHolder.OptionsPlate.LowQualityButton.addEventListener(MouseEvent.CLICK, LowQuality);
PlateHolder.OptionsPlate.MediumQualityButton.addEventListener(MouseEvent.CLICK, MediumQuality);
PlateHolder.OptionsPlate.HighQualityButton.addEventListener(MouseEvent.CLICK, HighQuality);
PlateHolder.OptionsPlate.LowBulletsButton.addEventListener(MouseEvent.CLICK, LowBullets);
PlateHolder.OptionsPlate.MediumBulletsButton.addEventListener(MouseEvent.CLICK, MediumBullets);
PlateHolder.OptionsPlate.HighBulletsButton.addEventListener(MouseEvent.CLICK, HighBullets);
AchievementButton.addEventListener(MouseEvent.CLICK, AchieveMenu);
PlateHolder.AchievePlate.AchieveList.ReloaderAchieve.addEventListener(MouseEvent.ROLL_OVER, ReloaderRollOver);
PlateHolder.AchievePlate.AchieveList.ReloaderAchieve.addEventListener(MouseEvent.ROLL_OUT, ReloaderRollOut);
PlateHolder.AchievePlate.AchieveList.JugglerAchieve.addEventListener(MouseEvent.ROLL_OVER, JugglerRollOver);
PlateHolder.AchievePlate.AchieveList.JugglerAchieve.addEventListener(MouseEvent.ROLL_OUT, JugglerRollOut);
PlateHolder.AchievePlate.AchieveList.GlockCrewAchieve.addEventListener(MouseEvent.ROLL_OVER, GlockCrewRollOver);
PlateHolder.AchievePlate.AchieveList.GlockCrewAchieve.addEventListener(MouseEvent.ROLL_OUT, GlockCrewRollOut);
PlateHolder.AchievePlate.AchieveList.USPNinjaAchieve.addEventListener(MouseEvent.ROLL_OVER, USPNinjaRollOver);
PlateHolder.AchievePlate.AchieveList.USPNinjaAchieve.addEventListener(MouseEvent.ROLL_OUT, USPNinjaRollOut);
PlateHolder.AchievePlate.AchieveList.DudeDeagleAchieve.addEventListener(MouseEvent.ROLL_OVER, DudeDeagleRollOver);
PlateHolder.AchievePlate.AchieveList.DudeDeagleAchieve.addEventListener(MouseEvent.ROLL_OUT, DudeDeagleRollOut);
PlateHolder.AchievePlate.AchieveList.WaltherWaltzAchieve.addEventListener(MouseEvent.ROLL_OVER, WaltherWaltzRollOver);
PlateHolder.AchievePlate.AchieveList.WaltherWaltzAchieve.addEventListener(MouseEvent.ROLL_OUT, WaltherWaltzRollOut);
PlateHolder.AchievePlate.AchieveList.LugerLoveAchieve.addEventListener(MouseEvent.ROLL_OVER, LugerLoveRollOver);
PlateHolder.AchievePlate.AchieveList.LugerLoveAchieve.addEventListener(MouseEvent.ROLL_OUT, LugerLoveRollOut);
PlateHolder.AchievePlate.AchieveList.UziDaddyAchieve.addEventListener(MouseEvent.ROLL_OVER, UziDaddyRollOver);
PlateHolder.AchievePlate.AchieveList.UziDaddyAchieve.addEventListener(MouseEvent.ROLL_OUT, UziDaddyRollOut);
PlateHolder.AchievePlate.AchieveList.MP5JockeyAchieve.addEventListener(MouseEvent.ROLL_OVER, MP5JockeyRollOver);
PlateHolder.AchievePlate.AchieveList.MP5JockeyAchieve.addEventListener(MouseEvent.ROLL_OUT, MP5JockeyRollOut);
PlateHolder.AchievePlate.AchieveList.SkorpionKillerAchieve.addEventListener(MouseEvent.ROLL_OVER, SkorpionKillerRollOver);
PlateHolder.AchievePlate.AchieveList.SkorpionKillerAchieve.addEventListener(MouseEvent.ROLL_OUT, SkorpionKillerRollOut);
PlateHolder.AchievePlate.AchieveList.MagnumMasterAchieve.addEventListener(MouseEvent.ROLL_OVER, MagnumMasterRollOver);
PlateHolder.AchievePlate.AchieveList.MagnumMasterAchieve.addEventListener(MouseEvent.ROLL_OUT, MagnumMasterRollOut);
PlateHolder.AchievePlate.AchieveList.RiotPoliceAchieve.addEventListener(MouseEvent.ROLL_OVER, RiotPoliceRollOver);
PlateHolder.AchievePlate.AchieveList.RiotPoliceAchieve.addEventListener(MouseEvent.ROLL_OUT, RiotPoliceRollOut);
PlateHolder.AchievePlate.AchieveList.BerettaBeastAchieve.addEventListener(MouseEvent.ROLL_OVER, BerettaBeastRollOver);
PlateHolder.AchievePlate.AchieveList.BerettaBeastAchieve.addEventListener(MouseEvent.ROLL_OUT, BerettaBeastRollOut);
PlateHolder.AchievePlate.AchieveList.CarbineCrazyAchieve.addEventListener(MouseEvent.ROLL_OVER, CarbineCrazyRollOver);
PlateHolder.AchievePlate.AchieveList.CarbineCrazyAchieve.addEventListener(MouseEvent.ROLL_OUT, CarbineCrazyRollOut);
PlateHolder.AchievePlate.AchieveList.PK2PlayerAchieve.addEventListener(MouseEvent.ROLL_OVER, PK2PlayerRollOver);
PlateHolder.AchievePlate.AchieveList.PK2PlayerAchieve.addEventListener(MouseEvent.ROLL_OUT, PK2PlayerRollOut);
PlateHolder.AchievePlate.AchieveList.P90PowerAchieve.addEventListener(MouseEvent.ROLL_OVER, P90PowerRollOver);
PlateHolder.AchievePlate.AchieveList.P90PowerAchieve.addEventListener(MouseEvent.ROLL_OUT, P90PowerRollOut);
PlateHolder.AchievePlate.AchieveList.M1AMartyrAchieve.addEventListener(MouseEvent.ROLL_OVER, M1AMartyrRollOver);
PlateHolder.AchievePlate.AchieveList.M1AMartyrAchieve.addEventListener(MouseEvent.ROLL_OUT, M1AMartyrRollOut);
PlateHolder.AchievePlate.AchieveList.TargetHaterAchieve.addEventListener(MouseEvent.ROLL_OVER, TargetHaterRollOver);
PlateHolder.AchievePlate.AchieveList.TargetHaterAchieve.addEventListener(MouseEvent.ROLL_OUT, TargetHaterRollOut);
PlateHolder.AchievePlate.AchieveList.DoNotPressAchieve.addEventListener(MouseEvent.ROLL_OVER, DoNotPressRollOver);
PlateHolder.AchievePlate.AchieveList.DoNotPressAchieve.addEventListener(MouseEvent.ROLL_OUT, DoNotPressRollOut);
PlateHolder.AchievePlate.AchieveList.GunNewbieAchieve.addEventListener(MouseEvent.ROLL_OVER, GunNewbieRollOver);
PlateHolder.AchievePlate.AchieveList.GunNewbieAchieve.addEventListener(MouseEvent.ROLL_OUT, GunNewbieRollOut);
PlateHolder.AchievePlate.AchieveList.GunNutAchieve.addEventListener(MouseEvent.ROLL_OVER, GunNutRollOver);
PlateHolder.AchievePlate.AchieveList.GunNutAchieve.addEventListener(MouseEvent.ROLL_OUT, GunNutRollOut);
PlateHolder.AchievePlate.AchieveList.GunAddictAchieve.addEventListener(MouseEvent.ROLL_OVER, GunAddictRollOver);
PlateHolder.AchievePlate.AchieveList.GunAddictAchieve.addEventListener(MouseEvent.ROLL_OUT, GunAddictRollOut);
PlateHolder.AchievePlate.AchieveList.CampaignAchieve.addEventListener(MouseEvent.ROLL_OVER, CampaignRollOver);
PlateHolder.AchievePlate.AchieveList.CampaignAchieve.addEventListener(MouseEvent.ROLL_OUT, CampaignRollOut);
PlateHolder.AchievePlate.AchieveList.NoviceMedalAchieve.addEventListener(MouseEvent.ROLL_OVER, NoviceMedalRollOver);
PlateHolder.AchievePlate.AchieveList.NoviceMedalAchieve.addEventListener(MouseEvent.ROLL_OUT, NoviceMedalRollOut);
PlateHolder.AchievePlate.AchieveList.VeteranMedalAchieve.addEventListener(MouseEvent.ROLL_OVER, VeteranMedalRollOver);
PlateHolder.AchievePlate.AchieveList.VeteranMedalAchieve.addEventListener(MouseEvent.ROLL_OUT, VeteranMedalRollOut);
PlateHolder.AchievePlate.AchieveList.ExpertMedalAchieve.addEventListener(MouseEvent.ROLL_OVER, ExpertMedalRollOver);
PlateHolder.AchievePlate.AchieveList.ExpertMedalAchieve.addEventListener(MouseEvent.ROLL_OUT, ExpertMedalRollOut);
PlateHolder.AchievePlate.AchieveList.SpasOfSpadesAchieve.addEventListener(MouseEvent.ROLL_OVER, SpasOfSpadesRollOver);
PlateHolder.AchievePlate.AchieveList.SpasOfSpadesAchieve.addEventListener(MouseEvent.ROLL_OUT, SpasOfSpadesRollOut);
PlateHolder.AchievePlate.AchieveList.FamousFamasAchieve.addEventListener(MouseEvent.ROLL_OVER, FamousFamasRollOver);
PlateHolder.AchievePlate.AchieveList.FamousFamasAchieve.addEventListener(MouseEvent.ROLL_OUT, FamousFamasRollOut);
PlateHolder.AchievePlate.AchieveList.Kar98kRunAchieve.addEventListener(MouseEvent.ROLL_OVER, Kar98kRunRollOver);
PlateHolder.AchievePlate.AchieveList.Kar98kRunAchieve.addEventListener(MouseEvent.ROLL_OUT, Kar98kRunRollOut);
PlateHolder.AchievePlate.AchieveList.PiecemakerAchieve.addEventListener(MouseEvent.ROLL_OVER, PiecemakerRollOver);
PlateHolder.AchievePlate.AchieveList.PiecemakerAchieve.addEventListener(MouseEvent.ROLL_OUT, PiecemakerRollOut);
PlateHolder.AchievePlate.AchieveList.ReloaderProgress.gotoAndStop(Math.round(((ReloaderCurr / ReloaderTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.ReloaderProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + ReloaderCurr) + "/") + ReloaderTotal);
if (ReloaderCurr == ReloaderTotal){
if (RedColorUnlocked == false){
RedColorUnlocked = true;
};
PlateHolder.AchievePlate.AchieveList.ReloaderAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.ReloaderProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + ReloaderCurr) + "/") + ReloaderTotal);
PlateHolder.AchievePlate.AchieveList.ReloaderUnlock.htmlText = "<B>Red Menu Color</B>";
};
PlateHolder.AchievePlate.AchieveList.JugglerProgress.gotoAndStop(Math.round(((JugglerCurr / JugglerTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.JugglerProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + JugglerCurr) + "/") + JugglerTotal);
if (JugglerCurr == JugglerTotal){
if (PlatinumColorUnlocked == false){
PlatinumColorUnlocked = true;
};
PlateHolder.AchievePlate.AchieveList.JugglerAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.JugglerProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + JugglerCurr) + "/") + JugglerTotal);
PlateHolder.AchievePlate.AchieveList.JugglerUnlock.htmlText = "<B>Platinum Menu Color</B>";
};
PlateHolder.AchievePlate.AchieveList.GlockCrewProgress.gotoAndStop(Math.round(((GlockCrewCurr / GlockCrewTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.GlockCrewProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + GlockCrewCurr) + "/") + GlockCrewTotal);
if (GlockCrewCurr == GlockCrewTotal){
if (GlockUpgradeUnlocked == false){
GlockUpgradeUnlocked = true;
WeaponType[1][4] = 0xCCCCCC;
WeaponType[1][2] = 0.42;
WeaponType[1][5] = 1.3;
WeaponType[1][28] = 2.5;
};
PlateHolder.AchievePlate.AchieveList.GlockCrewAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.GlockCrewProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + GlockCrewCurr) + "/") + GlockCrewTotal);
PlateHolder.AchievePlate.AchieveList.GlockCrewUnlock.htmlText = "<B>Silver Glock Bullets</B>";
};
PlateHolder.AchievePlate.AchieveList.USPNinjaProgress.gotoAndStop(Math.round(((USPNinjaCurr / USPNinjaTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.USPNinjaProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + USPNinjaCurr) + "/") + USPNinjaTotal);
if (USPNinjaCurr == USPNinjaTotal){
if (USPUpgradeUnlocked == false){
USPUpgradeUnlocked = true;
WeaponType[6][7] = 15;
};
PlateHolder.AchievePlate.AchieveList.USPNinjaAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.USPNinjaProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + USPNinjaCurr) + "/") + USPNinjaTotal);
PlateHolder.AchievePlate.AchieveList.USPNinjaUnlock.htmlText = "<B>Bigger USP Clip</B>";
};
PlateHolder.AchievePlate.AchieveList.DudeDeagleProgress.gotoAndStop(Math.round(((DudeDeagleCurr / DudeDeagleTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.DudeDeagleProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + DudeDeagleCurr) + "/") + DudeDeagleTotal);
if (DudeDeagleCurr == DudeDeagleTotal){
if (DeagleUpgradeUnlocked == false){
DeagleUpgradeUnlocked = true;
WeaponType[12][28] = 5;
WeaponType[12][5] = 2.75;
};
PlateHolder.AchievePlate.AchieveList.DudeDeagleAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.DudeDeagleProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + DudeDeagleCurr) + "/") + DudeDeagleTotal);
PlateHolder.AchievePlate.AchieveList.DudeDeagleUnlock.htmlText = "<B>More Deagle Power</B>";
};
PlateHolder.AchievePlate.AchieveList.WaltherWaltzProgress.gotoAndStop(Math.round(((WaltherWaltzCurr / WaltherWaltzTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.WaltherWaltzProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + WaltherWaltzCurr) + "/") + WaltherWaltzTotal);
if (WaltherWaltzCurr == WaltherWaltzTotal){
if (WaltherUpgradeUnlocked == false){
WaltherUpgradeUnlocked = true;
WeaponType[13][7] = 12;
};
PlateHolder.AchievePlate.AchieveList.WaltherWaltzAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.WaltherWaltzProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + WaltherWaltzCurr) + "/") + WaltherWaltzTotal);
PlateHolder.AchievePlate.AchieveList.WaltherWaltzUnlock.htmlText = "<B>Bigger Walther Clip</B>";
};
PlateHolder.AchievePlate.AchieveList.LugerLoveProgress.gotoAndStop(Math.round(((LugerLoveCurr / LugerLoveTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.LugerLoveProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + LugerLoveCurr) + "/") + LugerLoveTotal);
if (LugerLoveCurr == LugerLoveTotal){
if (LugerUpgradeUnlocked == false){
LugerUpgradeUnlocked = true;
WeaponType[13][21] = 0;
};
PlateHolder.AchievePlate.AchieveList.LugerLoveAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.LugerLoveProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + LugerLoveCurr) + "/") + LugerLoveTotal);
PlateHolder.AchievePlate.AchieveList.LugerLoveUnlock.htmlText = "<B>No Luger Recoil</B>";
};
PlateHolder.AchievePlate.AchieveList.UziDaddyProgress.gotoAndStop(Math.round(((UziDaddyCurr / UziDaddyTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.UziDaddyProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + UziDaddyCurr) + "/") + UziDaddyTotal);
if (UziDaddyCurr == UziDaddyTotal){
if (UziUpgradeUnlocked == false){
UziUpgradeUnlocked = true;
WeaponType[2][20] = 0;
};
PlateHolder.AchievePlate.AchieveList.UziDaddyAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.UziDaddyProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + UziDaddyCurr) + "/") + UziDaddyTotal);
PlateHolder.AchievePlate.AchieveList.UziDaddyUnlock.htmlText = "<B>No Uzi Bullet Spread</B>";
};
PlateHolder.AchievePlate.AchieveList.MP5JockeyProgress.gotoAndStop(Math.round(((MP5JockeyCurr / MP5JockeyTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.MP5JockeyProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + MP5JockeyCurr) + "/") + MP5JockeyTotal);
if (MP5JockeyCurr == MP5JockeyTotal){
if (BerettaSMGUnlocked == false){
BerettaSMGUnlocked = true;
};
PlateHolder.AchievePlate.AchieveList.MP5JockeyAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.MP5JockeyProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + MP5JockeyCurr) + "/") + MP5JockeyTotal);
PlateHolder.AchievePlate.AchieveList.MP5JockeyUnlock.htmlText = "<B>Beretta PM-12 Unlocked</B>";
};
PlateHolder.AchievePlate.AchieveList.SkorpionKillerProgress.gotoAndStop(Math.round(((SkorpionKillerCurr / SkorpionKillerTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.SkorpionKillerProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + SkorpionKillerCurr) + "/") + SkorpionKillerTotal);
if (SkorpionKillerCurr == SkorpionKillerTotal){
if (SkorpionUpgradeUnlocked == false){
SkorpionUpgradeUnlocked = true;
WeaponType[4][6] = 90;
};
PlateHolder.AchievePlate.AchieveList.SkorpionKillerAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.SkorpionKillerProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + SkorpionKillerCurr) + "/") + SkorpionKillerTotal);
PlateHolder.AchievePlate.AchieveList.SkorpionKillerUnlock.htmlText = "<B>Faster Skorpion Fire Rate</B>";
};
PlateHolder.AchievePlate.AchieveList.MagnumMasterProgress.gotoAndStop(Math.round(((MagnumMasterCurr / MagnumMasterTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.MagnumMasterProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + MagnumMasterCurr) + "/") + MagnumMasterTotal);
if (MagnumMasterCurr == MagnumMasterTotal){
if (PeacemakerUnlocked == false){
PeacemakerUnlocked = true;
};
PlateHolder.AchievePlate.AchieveList.MagnumMasterAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.MagnumMasterProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + MagnumMasterCurr) + "/") + MagnumMasterTotal);
PlateHolder.AchievePlate.AchieveList.MagnumMasterUnlock.htmlText = "<B>Peacemaker Unlocked</B>";
};
PlateHolder.AchievePlate.AchieveList.RiotPoliceProgress.gotoAndStop(Math.round(((RiotPoliceCurr / RiotPoliceTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.RiotPoliceProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + RiotPoliceCurr) + "/") + RiotPoliceTotal);
if (RiotPoliceCurr == RiotPoliceTotal){
if (Spas12Unlocked == false){
Spas12Unlocked = true;
};
PlateHolder.AchievePlate.AchieveList.RiotPoliceAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.RiotPoliceProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + RiotPoliceCurr) + "/") + RiotPoliceTotal);
PlateHolder.AchievePlate.AchieveList.RiotPoliceUnlock.htmlText = "<B>Spas-12 Unlocked</B>";
};
PlateHolder.AchievePlate.AchieveList.BerettaBeastProgress.gotoAndStop(Math.round(((BerettaBeastCurr / BerettaBeastTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.BerettaBeastProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + BerettaBeastCurr) + "/") + BerettaBeastTotal);
if (BerettaBeastCurr == BerettaBeastTotal){
if (BerettaUpgradeUnlocked == false){
BerettaUpgradeUnlocked = true;
WeaponType[8][21] = 1;
WeaponType[8][23] = 6;
};
PlateHolder.AchievePlate.AchieveList.BerettaBeastAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.BerettaBeastProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + BerettaBeastCurr) + "/") + BerettaBeastTotal);
PlateHolder.AchievePlate.AchieveList.BerettaBeastUnlock.htmlText = "<B>Less Beretta Recoil</B>";
};
PlateHolder.AchievePlate.AchieveList.CarbineCrazyProgress.gotoAndStop(Math.round(((CarbineCrazyCurr / CarbineCrazyTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.CarbineCrazyProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + CarbineCrazyCurr) + "/") + CarbineCrazyTotal);
if (CarbineCrazyCurr == CarbineCrazyTotal){
if (FamasUnlocked == false){
FamasUnlocked = true;
};
PlateHolder.AchievePlate.AchieveList.CarbineCrazyAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.CarbineCrazyProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + CarbineCrazyCurr) + "/") + CarbineCrazyTotal);
PlateHolder.AchievePlate.AchieveList.CarbineCrazyUnlock.htmlText = "<B>Famas Unlocked</B>";
};
PlateHolder.AchievePlate.AchieveList.PK2PlayerProgress.gotoAndStop(Math.round(((PK2PlayerCurr / PK2PlayerTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.PK2PlayerProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + PK2PlayerCurr) + "/") + PK2PlayerTotal);
if (PK2PlayerCurr == PK2PlayerTotal){
if (PK2UpgradeUnlocked == false){
PK2UpgradeUnlocked = true;
WeaponType[10][7] = 20;
};
PlateHolder.AchievePlate.AchieveList.PK2PlayerAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.PK2PlayerProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + PK2PlayerCurr) + "/") + PK2PlayerTotal);
PlateHolder.AchievePlate.AchieveList.PK2PlayerUnlock.htmlText = "<B>Bigger PK2 Clip</B>";
};
PlateHolder.AchievePlate.AchieveList.P90PowerProgress.gotoAndStop(Math.round(((P90PowerCurr / P90PowerTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.P90PowerProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + P90PowerCurr) + "/") + P90PowerTotal);
if (P90PowerCurr == P90PowerTotal){
if (P90UpgradeUnlocked == false){
P90UpgradeUnlocked = true;
WeaponType[15][3] = 0.1;
WeaponType[15][5] = 1.3;
WeaponType[15][28] = 0.9;
};
PlateHolder.AchievePlate.AchieveList.P90PowerAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.P90PowerProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + P90PowerCurr) + "/") + P90PowerTotal);
PlateHolder.AchievePlate.AchieveList.P90PowerUnlock.htmlText = "<B>More P90 Power</B>";
};
PlateHolder.AchievePlate.AchieveList.M1AMartyrProgress.gotoAndStop(Math.round(((M1AMartyrCurr / M1AMartyrTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.M1AMartyrProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + M1AMartyrCurr) + "/") + M1AMartyrTotal);
if (M1AMartyrCurr == M1AMartyrTotal){
if (Kar98kUnlocked == false){
Kar98kUnlocked = true;
};
PlateHolder.AchievePlate.AchieveList.M1AMartyrAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.M1AMartyrProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + M1AMartyrCurr) + "/") + M1AMartyrTotal);
PlateHolder.AchievePlate.AchieveList.M1AMartyrUnlock.htmlText = "<B>Kar 98k Unlocked</B>";
};
PlateHolder.AchievePlate.AchieveList.TargetHaterProgress.gotoAndStop(Math.round(((TargetHaterCurr / TargetHaterTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.TargetHaterProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + TargetHaterCurr) + "/") + TargetHaterTotal);
if (TargetHaterCurr == TargetHaterTotal){
if (SkeletonHandUnlocked == false){
SkeletonHandUnlocked = true;
};
PlateHolder.AchievePlate.AchieveList.TargetHaterAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.TargetHaterProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + TargetHaterCurr) + "/") + TargetHaterTotal);
PlateHolder.AchievePlate.AchieveList.TargetHaterUnlock.htmlText = "<B>Skeleton Hand</B>";
};
PlateHolder.AchievePlate.AchieveList.CampaignProgress.gotoAndStop(Math.round(((LevelsUnlockedTotal / 21) * 100)));
PlateHolder.AchievePlate.AchieveList.CampaignProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + LevelsUnlockedTotal) + "/") + 21);
if (LevelsUnlockedTotal == 21){
if (MagnumUnlocked == false){
MagnumUnlocked = true;
};
PlateHolder.AchievePlate.AchieveList.CampaignAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.CampaignProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + LevelsUnlockedTotal) + "/") + 21);
PlateHolder.AchievePlate.AchieveList.CampaignUnlock.htmlText = "<B>357 Magnum Unlocked</B>";
};
PlateHolder.AchievePlate.AchieveList.NoviceMedalProgress.gotoAndStop(Math.round(((NoviceMedalCurr / NoviceMedalTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.NoviceMedalProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + NoviceMedalCurr) + "/") + NoviceMedalTotal);
if (NoviceMedalCurr == NoviceMedalTotal){
if (NoviceUpgradeUnlocked == false){
NoviceUpgradeUnlocked = true;
AmmoIncrease = (AmmoIncrease + 0.2);
};
PlateHolder.AchievePlate.AchieveList.NoviceMedalAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.NoviceMedalProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + NoviceMedalCurr) + "/") + NoviceMedalTotal);
PlateHolder.AchievePlate.AchieveList.NoviceMedalUnlock.htmlText = "<B>+20% Bigger Clips</B>";
};
PlateHolder.AchievePlate.AchieveList.VeteranMedalProgress.gotoAndStop(Math.round(((VeteranMedalCurr / VeteranMedalTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.VeteranMedalProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + VeteranMedalCurr) + "/") + VeteranMedalTotal);
if (VeteranMedalCurr == VeteranMedalTotal){
if (VeteranUpgradeUnlocked == false){
VeteranUpgradeUnlocked = true;
RecoilReduction = (RecoilReduction + 0.2);
};
PlateHolder.AchievePlate.AchieveList.VeteranMedalAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.VeteranMedalProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + VeteranMedalCurr) + "/") + VeteranMedalTotal);
PlateHolder.AchievePlate.AchieveList.VeteranMedalUnlock.htmlText = "<B>-20% Recoil Reduction</B>";
};
PlateHolder.AchievePlate.AchieveList.ExpertMedalProgress.gotoAndStop(Math.round(((ExpertMedalCurr / ExpertMedalTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.ExpertMedalProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + ExpertMedalCurr) + "/") + ExpertMedalTotal);
if (ExpertMedalCurr == ExpertMedalTotal){
if (ExpertUpgradeUnlocked == false){
ExpertUpgradeUnlocked = true;
DamageIncrease = (DamageIncrease + 0.25);
};
PlateHolder.AchievePlate.AchieveList.ExpertMedalAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.ExpertMedalProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + ExpertMedalCurr) + "/") + ExpertMedalTotal);
PlateHolder.AchievePlate.AchieveList.ExpertMedalUnlock.htmlText = "<B>+25% Weapon Damage</B>";
};
PlateHolder.AchievePlate.AchieveList.SpasOfSpadesProgress.gotoAndStop(Math.round(((SpasOfSpadesCurr / SpasOfSpadesTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.SpasOfSpadesProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + SpasOfSpadesCurr) + "/") + SpasOfSpadesTotal);
if (SpasOfSpadesCurr == SpasOfSpadesTotal){
if (Spas12UpgradeUnlocked == false){
Spas12UpgradeUnlocked = true;
WeaponType[16][21] = 8;
WeaponType[16][23] = 16;
};
PlateHolder.AchievePlate.AchieveList.SpasOfSpadesAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.SpasOfSpadesProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + SpasOfSpadesCurr) + "/") + SpasOfSpadesTotal);
PlateHolder.AchievePlate.AchieveList.SpasOfSpadesUnlock.htmlText = "<B>Less Spas-12 Recoil</B>";
};
PlateHolder.AchievePlate.AchieveList.FamousFamasProgress.gotoAndStop(Math.round(((FamousFamasCurr / FamousFamasTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.FamousFamasProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + FamousFamasCurr) + "/") + FamousFamasTotal);
if (FamousFamasCurr == FamousFamasTotal){
if (FamasUpgradeUnlocked == false){
FamasUpgradeUnlocked = true;
WeaponType[17][20] = 0;
};
PlateHolder.AchievePlate.AchieveList.FamousFamasAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.FamousFamasProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + FamousFamasCurr) + "/") + FamousFamasTotal);
PlateHolder.AchievePlate.AchieveList.FamousFamasUnlock.htmlText = "<B>No Famas Bullet Spread</B>";
};
PlateHolder.AchievePlate.AchieveList.Kar98kRunProgress.gotoAndStop(Math.round(((Kar98kRunCurr / Kar98kRunTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.Kar98kRunProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + Kar98kRunCurr) + "/") + Kar98kRunTotal);
if (Kar98kRunCurr == Kar98kRunTotal){
if (Kar98kUpgradeUnlocked == false){
Kar98kUpgradeUnlocked = true;
WeaponType[18][5] = 2.5;
WeaponType[18][28] = 1000;
};
PlateHolder.AchievePlate.AchieveList.Kar98kRunAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.Kar98kRunProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + Kar98kRunCurr) + "/") + Kar98kRunTotal);
PlateHolder.AchievePlate.AchieveList.Kar98kRunUnlock.htmlText = "<B>Kar 98k Beast Mode</B>";
};
PlateHolder.AchievePlate.AchieveList.PiecemakerProgress.gotoAndStop(Math.round(((PiecemakerCurr / PiecemakerTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.PiecemakerProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + PiecemakerCurr) + "/") + PiecemakerTotal);
if (PiecemakerCurr == PiecemakerTotal){
if (PeacemakerUpgradeUnlocked == false){
PeacemakerUpgradeUnlocked = true;
WeaponType[19][5] = 2.75;
WeaponType[19][28] = 10;
};
PlateHolder.AchievePlate.AchieveList.PiecemakerAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.PiecemakerProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + PiecemakerCurr) + "/") + PiecemakerTotal);
PlateHolder.AchievePlate.AchieveList.PiecemakerUnlock.htmlText = "<B>More Peacemaker Power</B>";
};
PlateHolder.AchievePlate.AchieveList.DoNotPressProgress.gotoAndStop(Math.round(((DoNotPressCurr / DoNotPressTotal) * 100)));
PlateHolder.AchievePlate.AchieveList.DoNotPressProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + DoNotPressCurr) + "/") + DoNotPressTotal);
if (DoNotPressCurr == DoNotPressTotal){
if (GreenColorUnlocked == false){
GreenColorUnlocked = true;
};
PlateHolder.AchievePlate.AchieveList.DoNotPressAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.DoNotPressProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + DoNotPressCurr) + "/") + DoNotPressTotal);
PlateHolder.AchievePlate.AchieveList.DoNotPressUnlock.htmlText = "<B>Green Menu Color</B>";
};
PlateHolder.AchievePlate.AchieveList.GunNewbieProgress.gotoAndStop(Math.round((((TotalTimePlayed / 60) / 30) * 100)));
PlateHolder.AchievePlate.AchieveList.GunNewbieProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + Math.round((TotalTimePlayed / 60))) + "/") + 30);
if ((TotalTimePlayed / 60) >= 30){
if (GunNewbieUpgradeUnlocked == false){
GunNewbieUpgradeUnlocked = true;
AmmoIncrease = (AmmoIncrease + 0.1);
};
PlateHolder.AchievePlate.AchieveList.GunNewbieAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.GunNewbieProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + Math.round((TotalTimePlayed / 60))) + "/") + 30);
PlateHolder.AchievePlate.AchieveList.GunNewbieUnlock.htmlText = "<B>+10% Bigger Clips</B>";
};
PlateHolder.AchievePlate.AchieveList.GunNutProgress.gotoAndStop(Math.round((((TotalTimePlayed / 60) / 120) * 100)));
PlateHolder.AchievePlate.AchieveList.GunNutProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + Math.round((TotalTimePlayed / 60))) + "/") + 120);
if ((TotalTimePlayed / 60) >= 120){
if (GunNutUpgradeUnlocked == false){
GunNutUpgradeUnlocked = true;
RecoilReduction = (RecoilReduction + 0.1);
};
PlateHolder.AchievePlate.AchieveList.GunNutAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.GunNutProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + Math.round((TotalTimePlayed / 60))) + "/") + 120);
PlateHolder.AchievePlate.AchieveList.GunNutUnlock.htmlText = "<B>-10% Recoil Reduction</B>";
};
PlateHolder.AchievePlate.AchieveList.GunAddictProgress.gotoAndStop(Math.round((((TotalTimePlayed / 60) / 240) * 100)));
PlateHolder.AchievePlate.AchieveList.GunAddictProgress.ProgressBarInfo.htmlText = ((("<B>Progress: </B>" + Math.round((TotalTimePlayed / 60))) + "/") + 240);
if ((TotalTimePlayed / 60) >= 240){
if (GunAddictUpgradeUnlocked == false){
GunAddictUpgradeUnlocked = true;
DamageIncrease = (DamageIncrease + 0.1);
};
PlateHolder.AchievePlate.AchieveList.GunAddictAchieve.gotoAndStop(2);
PlateHolder.AchievePlate.AchieveList.GunAddictProgress.ProgressBarInfo.htmlText = ((("<B>Completed: </B>" + Math.round((TotalTimePlayed / 60))) + "/") + 240);
PlateHolder.AchievePlate.AchieveList.GunAddictUnlock.htmlText = "<B>+10% Weapon Damage</B>";
};
PlateHolder.OptionsPlate.BlueColorButton.addEventListener(MouseEvent.CLICK, BlueColor);
if (GreenColorUnlocked == false){
PlateHolder.OptionsPlate.GreenColorLock.alpha = 1;
PlateHolder.OptionsPlate.GreenColorButton.enabled = false;
} else {
PlateHolder.OptionsPlate.GreenColorLock.alpha = 0;
PlateHolder.OptionsPlate.GreenColorLock.mouseEnabled = false;
PlateHolder.OptionsPlate.GreenColorButton.enabled = true;
PlateHolder.OptionsPlate.GreenColorButton.addEventListener(MouseEvent.CLICK, GreenColor);
};
if (RedColorUnlocked == false){
PlateHolder.OptionsPlate.RedColorLock.alpha = 1;
PlateHolder.OptionsPlate.RedColorButton.enabled = false;
} else {
PlateHolder.OptionsPlate.RedColorLock.alpha = 0;
PlateHolder.OptionsPlate.RedColorLock.mouseEnabled = false;
PlateHolder.OptionsPlate.RedColorButton.enabled = true;
PlateHolder.OptionsPlate.RedColorButton.addEventListener(MouseEvent.CLICK, RedColor);
};
if (PlatinumColorUnlocked == false){
PlateHolder.OptionsPlate.PlatinumColorLock.alpha = 1;
PlateHolder.OptionsPlate.PlatinumColorButton.enabled = false;
} else {
PlateHolder.OptionsPlate.PlatinumColorLock.alpha = 0;
PlateHolder.OptionsPlate.PlatinumColorLock.mouseEnabled = false;
PlateHolder.OptionsPlate.PlatinumColorButton.enabled = true;
PlateHolder.OptionsPlate.PlatinumColorButton.addEventListener(MouseEvent.CLICK, PlatinumColor);
};
PlateHolder.OptionsPlate.WhiteHandButton.addEventListener(MouseEvent.CLICK, WhiteHand);
PlateHolder.OptionsPlate.BlackHandButton.addEventListener(MouseEvent.CLICK, BlackHand);
if (SkeletonHandUnlocked == false){
PlateHolder.OptionsPlate.SkeletonHandLock.alpha = 1;
PlateHolder.OptionsPlate.SkeletonHandButton.enabled = false;
} else {
PlateHolder.OptionsPlate.SkeletonHandLock.alpha = 0;
PlateHolder.OptionsPlate.SkeletonHandLock.mouseEnabled = false;
PlateHolder.OptionsPlate.SkeletonHandButton.enabled = true;
PlateHolder.OptionsPlate.SkeletonHandButton.addEventListener(MouseEvent.CLICK, SkeletonHand);
};
PlateHolder.OptionsPlate.GreenColorLock.addEventListener(MouseEvent.ROLL_OVER, GreenColorUnlockRollOver);
PlateHolder.OptionsPlate.GreenColorLock.addEventListener(MouseEvent.ROLL_OUT, GreenColorUnlockRollOut);
PlateHolder.OptionsPlate.RedColorLock.addEventListener(MouseEvent.ROLL_OVER, RedColorUnlockRollOver);
PlateHolder.OptionsPlate.RedColorLock.addEventListener(MouseEvent.ROLL_OUT, RedColorUnlockRollOut);
PlateHolder.OptionsPlate.PlatinumColorLock.addEventListener(MouseEvent.ROLL_OVER, PlatinumColorUnlockRollOver);
PlateHolder.OptionsPlate.PlatinumColorLock.addEventListener(MouseEvent.ROLL_OUT, PlatinumColorUnlockRollOut);
PlateHolder.OptionsPlate.SkeletonHandLock.addEventListener(MouseEvent.ROLL_OVER, SkeletonHandUnlockRollOver);
PlateHolder.OptionsPlate.SkeletonHandLock.addEventListener(MouseEvent.ROLL_OUT, SkeletonHandUnlockRollOut);
SaveVariables = [[WeaponNum, Slot1, Slot2, Slot3, ActiveSlot, ActiveWeaponCategory, DefenseLevelsUnlocked, EfficiencyLevelsUnlocked, OffenseLevelsUnlocked, LevelsUnlockedTotal, TotalTimePlayed, MaxShellNum, MovieQuality, PlateBGColor, HandSkin, AmmoIncrease, RecoilReduction, DamageIncrease]];
SaveUnlocks = [[DeagleUnlocked, WaltherPPKUnlocked, LugerUnlocked, MagnumUnlocked, SkorpionUnlocked, BerettaSMGUnlocked, SMGPK2Unlocked, P90Unlocked, GreenColorUnlocked, RedColorUnlocked, SkeletonHandUnlocked, Spas12Unlocked, FamasUnlocked, Kar98kUnlocked, GlockUpgradeUnlocked, USPUpgradeUnlocked, DeagleUpgradeUnlocked, WaltherUpgradeUnlocked, LugerUpgradeUnlocked, UziUpgradeUnlocked, SkorpionUpgradeUnlocked, BerettaUpgradeUnlocked, PK2UpgradeUnlocked, P90UpgradeUnlocked, Spas12UpgradeUnlocked, FamasUpgradeUnlocked, Kar98kUpgradeUnlocked, PeacemakerUnlocked, PeacemakerUpgradeUnlocked, NoviceUpgradeUnlocked, VeteranUpgradeUnlocked, ExpertUpgradeUnlocked, GunNewbieUpgradeUnlocked, GunNutUpgradeUnlocked, GunAddictUpgradeUnlocked, PlatinumColorUnlocked]];
SaveAchieves = [[ReloaderCurr, JugglerCurr, GlockCrewCurr, UziDaddyCurr, MP5JockeyCurr, SkorpionKillerCurr, MagnumMasterCurr, USPNinjaCurr, RiotPoliceCurr, BerettaBeastCurr, CarbineCrazyCurr, PK2PlayerCurr, P90PowerCurr, M1AMartyrCurr, DudeDeagleCurr, WaltherWaltzCurr, LugerLoveCurr, TargetHaterCurr, DoNotPressCurr, NoviceMedalCurr, VeteranMedalCurr, ExpertMedalCurr, SpasOfSpadesCurr, FamousFamasCurr, Kar98kRunCurr, PiecemakerCurr]];
i = 0;
while (i < WeaponType.length) {
SaveMedals[i] = [[WeaponType[i][10], WeaponType[i][11], WeaponType[i][14], WeaponType[i][15], WeaponType[i][17], WeaponType[i][18], WeaponType[i][2], WeaponType[i][3], WeaponType[i][4], WeaponType[i][5], WeaponType[i][6], WeaponType[i][7], WeaponType[i][20], WeaponType[i][21], WeaponType[i][22], WeaponType[i][23], WeaponType[i][28]]];
i++;
};
SaveFile.data.VariableArray = SaveVariables;
SaveFile.data.UnlockArray = SaveUnlocks;
SaveFile.data.AchieveArray = SaveAchieves;
SaveFile.data.MedalArray = SaveMedals;
SaveFile.flush();
}
public function ChazLinkRollOverBig(_arg1:MouseEvent){
PlateHolder.OptionsPlate.ChazLinkBig.alpha = 1;
}
public function EfficiencyLevel7Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
EfficiencyCurrLevel = 7;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function DefenseLevel7Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
DefenseCurrLevel = 7;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function GreenColorUnlockRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Green Color</B> \n Complete the 'Do Not Press' Achievement.";
}
public function OffenseLevel5Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
OffenseCurrLevel = 5;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function WaltherWaltzRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Walther Waltz</B> \n Dance to " + WaltherWaltzTotal) + " Walther PPK Rounds");
}
public function SkeletonHandUnlockRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function DudeDeagleRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Dude, Deagle</B> \n Dude, " + DudeDeagleTotal) + " Desert Eagle Bullets...");
}
public function TintTime(_arg1:TimerEvent):void{
Player.transform.colorTransform = PlayerNormalTint;
TintTimer.reset();
}
public function HighQuality(_arg1:MouseEvent){
stage.quality = "high";
MovieQuality = "high";
}
public function ExpertMedalRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Expert</B> \n Earn " + ExpertMedalTotal) + " Expert Medals");
}
public function BerettaBeastRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Beretta Beast</B> \n Jettison " + BerettaBeastTotal) + " Beretta PM-12 Rounds");
}
public function FamousFamasRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function DefenseLevel1Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
DefenseCurrLevel = 1;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function OptionsMenu(_arg1:MouseEvent){
if (((((!(global.PlateMoving)) && (!(global.ScrollerMoving)))) && (!((CurrentPlate == "Options"))))){
global.PlateMoving = true;
PlateX = -825;
PlateTween();
CurrentPlate = "Options";
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
function frame5(){
global.currMovieFrame = 5;
}
public function shoot(_arg1:Event){
if ((((((((CeaseFire == true)) || ((Reloaded == false)))) || ((ClipSize <= 0)))) || ((DelayFire == true)))){
} else {
Fire();
};
}
public function PlateTween():void{
var blurOn:Function;
var blurOff:Function;
blurOn = function (_arg1:TweenEvent):void{
var _local2:BlurFilter;
_local2 = new BlurFilter();
_local2.blurX = 4;
_local2.blurY = 0;
_local2.quality = BitmapFilterQuality.MEDIUM;
PlateHolder.filters = [_local2];
};
blurOff = function (_arg1:TweenEvent):void{
var _local2:BlurFilter;
_local2 = new BlurFilter();
_local2.blurX = 0;
_local2.blurY = 0;
_local2.quality = BitmapFilterQuality.MEDIUM;
PlateHolder.filters = [_local2];
global.PlateMoving = false;
};
PlateTweener = new Tween(PlateHolder, "x", Regular.easeOut, PlateHolder.x, PlateX, 1, true);
PlateTweener.addEventListener(TweenEvent.MOTION_CHANGE, blurOn);
PlateTweener.addEventListener(TweenEvent.MOTION_FINISH, blurOff);
}
public function EfficiencyLevel1Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
EfficiencyCurrLevel = 1;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function BlackHand(_arg1:MouseEvent){
HandSkin = 2;
}
public function BerettaBeastRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function CampaignStart(_arg1:TimerEvent):void{
if (CampaignStartCounter > 0){
CampaignStartCounter--;
CampaignTimerGraphic.gotoAndStop((CampaignStartCounter + 1));
} else {
if (EfficiencyCurrLevel >= 1){
LifeDrainTimer.start();
};
CampaignStartTimer.reset();
CampaignTimerGraphic.alpha = 0;
CampaignStarted = true;
};
}
public function StartSpeed(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Speed";
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function LugerLoveRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Luger Love</B> \n Send off " + LugerLoveTotal) + " Luger Bullets with love");
}
public function SkillChallenge(_arg1:TimerEvent):void{
GoalTime--;
if (GoalTime <= 0){
SkillChallengeComplete = true;
SkillChallengeTimer.reset();
};
}
public function ReloaderRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Reloader</B> \n Reload " + ReloaderTotal) + " Times");
}
public function M1AMartyrRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>M1A Martyr</B> \n Serve " + M1AMartyrTotal) + " M1A Rifle Rounds of Justice");
}
public function RedColorUnlockRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function launchApp():void{
play();
}
public function TargetHaterRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Target Hater</B> \n Break " + TargetHaterTotal) + " Targets");
}
public function PlumpmanLinkRollOverBig(_arg1:MouseEvent){
PlateHolder.OptionsPlate.PlumpmanLinkBig.alpha = 1;
}
public function RedColor(_arg1:MouseEvent){
PlateBGColor = "Red";
BackgroundColor.gotoAndStop(PlateBGColor);
PlateHolder.CampaignPlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.ChallengePlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.AchievePlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.WeaponPlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.OptionsPlate.PlateBG.gotoAndStop(PlateBGColor);
}
public function RecoilRecovery(_arg1:TimerEvent):void{
if (Player.rotation > DefaultRotation){
Player.rotation = (Player.rotation - WeaponType[WeaponNum][22]);
} else {
RecoilRecoveryTimer.reset();
};
}
public function Preloading(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = this.stage.loaderInfo.bytesTotal;
_local3 = this.stage.loaderInfo.bytesLoaded;
LoadingBar.gotoAndStop(Math.floor(((_local3 / _local2) * 100)));
BGLoadingBar.gotoAndStop(Math.floor(((_local3 / _local2) * 100)));
PreloaderInfo.htmlText = (Math.floor(((_local3 / _local2) * 100)) + "%");
if (_local2 == _local3){
this.removeEventListener(Event.ENTER_FRAME, Preloading);
PreloaderInfo.htmlText = "";
PreloaderPlay.alpha = 1;
PreloaderPlay.enabled = true;
PreloaderPlay.addEventListener(MouseEvent.CLICK, StartGame);
};
}
public function EfficiencyLevel2Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
EfficiencyCurrLevel = 2;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function DudeDeagleRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function RiotPoliceRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function NoviceMedalRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function OffenseLevel6Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
OffenseCurrLevel = 6;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function UziDaddyRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Uzi Daddy</B> \n Unload " + UziDaddyTotal) + " Uzi Bullets");
}
public function GunNewbieRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Gun Newbie</B> \n Played for 30 minutes";
}
public function GunAddictRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Gun Addict</B> \n Played for 4 Hours";
}
public function DefenseLevel2Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
DefenseCurrLevel = 2;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function WeaponMenu(_arg1:MouseEvent){
if (((((!(global.PlateMoving)) && (!(global.ScrollerMoving)))) && (!((CurrentPlate == "Weapons"))))){
global.PlateMoving = true;
PlateX = -275;
PlateTween();
CurrentPlate = "Weapons";
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function SpasOfSpadesRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function stopshoot(_arg1:Event){
WeaponTimer.reset();
}
public function ChazLinkRollOut(_arg1:MouseEvent){
ChazLink.alpha = 0.75;
}
public function P90PowerRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function LowBullets(_arg1:MouseEvent){
MaxShellNum = 10;
}
public function CarbineCrazyRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Carbine Crazy</B> \n Throw " + CarbineCrazyTotal) + " Bullets out of the M4 Carbine");
}
public function EnemyFire(_arg1){
var _local2:Point;
_local2 = Enemy[_arg1].userData.localToGlobal(new Point(Enemy[_arg1].userData.Launcher.x, Enemy[_arg1].userData.Launcher.y));
Enemy[_arg1].userData.gotoAndPlay(2);
EnemyBulletSound.play();
shells[shellNum] = sim.addBox({x:(_local2.x / 30), y:(_local2.y / 30), width:EnemyBulletWidth, height:EnemyBulletHeight, restitution:0, lineAlpha:1, fillColor:16763955, allowSleep:true, draggable:false, isBullet:true});
shells[shellNum].userData.name = "EnemyShell";
shells[shellNum].body.ApplyImpulse(new b2Vec2(EnemyBulletSpeed, 0), shells[shellNum].body.GetWorldCenter());
if (shellNum > MaxShellNum){
if (shells[(shellNum - (MaxShellNum + 1))].body.m_world != null){
shells[(shellNum - (MaxShellNum + 1))].destroy();
};
};
shellNum++;
}
public function M1AMartyrRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function SkorpionKillerRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Skorpion Killer</B> \n Unleash " + SkorpionKillerTotal) + " Skorpion Bullets");
}
public function visit_Chaz(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.flashchaz.com/");
navigateToURL(_local2, "_blank");
if (MovieClip(root).currentFrame >= 4){
Mouse.hide();
};
}
public function checkKeysDown(_arg1:KeyboardEvent):void{
keyArray[_arg1.keyCode] = true;
}
public function ExpertMedalRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function DoNotPressRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function OffenseLevel7Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
OffenseCurrLevel = 7;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function MagnumMasterRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function EfficiencyLevel3Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
EfficiencyCurrLevel = 3;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function PickSlot2(_arg1:MouseEvent){
ActiveSlot = 2;
WeaponNum = Slot2;
}
public function PickSlot3(_arg1:MouseEvent){
ActiveSlot = 3;
WeaponNum = Slot3;
}
public function USPNinjaRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function GreenColor(_arg1:MouseEvent){
PlateBGColor = "Green";
BackgroundColor.gotoAndStop(PlateBGColor);
PlateHolder.CampaignPlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.ChallengePlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.AchievePlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.WeaponPlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.OptionsPlate.PlateBG.gotoAndStop(PlateBGColor);
}
public function CampaignRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function OffenseLevel1Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
OffenseCurrLevel = 1;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function DefenseLevel3Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
DefenseCurrLevel = 3;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function Fire(){
var _local1:Point;
_local1 = Player.localToGlobal(new Point(Player.Launcher.x, Player.Launcher.y));
if (WeaponType[WeaponNum][6] > 0){
WeaponTimer.start();
};
Player.gotoAndPlay(2);
FireSound.play();
i = 0;
while (i < WeaponType[WeaponNum][29]) {
shells[shellNum] = sim.addBox({x:(_local1.x / 30), y:(_local1.y / 30), width:WeaponType[WeaponNum][2], angle:Math.sin((Player.rotation * (Math.PI / 180))), height:WeaponType[WeaponNum][3], restitution:0, lineAlpha:1, fillColor:WeaponType[WeaponNum][4], allowSleep:true, draggable:false, isBullet:true});
shells[shellNum].userData.name = "Shell";
shells[shellNum].body.ApplyImpulse(new b2Vec2(-(WeaponType[WeaponNum][5]), (((Math.random() * WeaponType[WeaponNum][20]) - (Math.random() * WeaponType[WeaponNum][20])) - Math.sin((Player.rotation * (Math.PI / 180))))), shells[shellNum].body.GetWorldCenter());
if (shellNum > MaxShellNum){
if (shells[(shellNum - (MaxShellNum + 1))].body.m_world != null){
shells[(shellNum - (MaxShellNum + 1))].destroy();
};
};
shellNum++;
i++;
};
if (Player.rotation < WeaponType[WeaponNum][23]){
Player.rotation = (Player.rotation + (WeaponType[WeaponNum][21] - Math.floor((WeaponType[WeaponNum][21] * RecoilReduction))));
if (RecoilRecoveryTimer.running == false){
RecoilRecoveryTimer.start();
};
};
if ((((((WeaponType[WeaponNum][0] == "Riot Shotgun")) || ((WeaponType[WeaponNum][0] == "Spas-12")))) || ((WeaponType[WeaponNum][0] == "Kar 98k")))){
DelayFire = true;
};
if (ClipSize > 0){
ClipSize--;
};
if (ClipSize <= 0){
if (ReloaderCurr < ReloaderTotal){
ReloaderCurr++;
};
if ((((JugglerCurr < JugglerTotal)) && ((((WeaponType[WeaponNum][0] == "USP")) || ((WeaponType[WeaponNum][0] == "Walther PPK")))))){
JugglerCurr++;
};
if (ClipAmount > 0){
ClipAmount--;
};
Reloaded = false;
Player.gotoAndPlay(WeaponType[WeaponNum][19]);
ReloadSound.play(WeaponType[WeaponNum][26], WeaponType[WeaponNum][27]);
};
AchievementCheck();
}
public function PickSlot1(_arg1:MouseEvent){
ActiveSlot = 1;
WeaponNum = Slot1;
}
public function MediumBullets(_arg1:MouseEvent){
MaxShellNum = 20;
}
public function PK2PlayerRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>PK2 Player</B> \n Blast " + PK2PlayerTotal) + " SMG-PK2 Rounds");
}
public function SkeletonHand(_arg1:MouseEvent){
HandSkin = 3;
}
public function GlockCrewRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Glock Crew</B> \n Fire " + GlockCrewTotal) + " Glock Rounds");
}
public function PlatinumColorUnlockRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function Kar98kRunRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function Kar98kRunRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Kar98k Run</B> \n Marathon " + Kar98kRunTotal) + " Kar98k Rounds");
}
public function PiecemakerRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function MP5JockeyRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function GunNutRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function VeteranMedalRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Veteran</B> \n Earn " + VeteranMedalTotal) + " Veteran Medals");
}
public function ReloaderRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function CampaignMenu(_arg1:MouseEvent){
if (((((!(global.PlateMoving)) && (!(global.ScrollerMoving)))) && (!((CurrentPlate == "Campaign"))))){
global.PlateMoving = true;
PlateX = 1385;
PlateTween();
CurrentPlate = "Campaign";
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function PlumpmanLinkRollOut(_arg1:MouseEvent){
PlumpmanLink.alpha = 0.75;
}
public function PlatinumColorUnlockRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Midnight Color</B> \n Complete the 'Juggler' Achievement.";
}
public function Unmute_Sound(_arg1:Event){
SoundMixer.soundTransform = UnmuteTransform;
if (MovieClip(root).currentFrame >= 4){
Mouse.hide();
};
}
public function loop(_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:*;
if (keyisdown(32)){
sim.stop();
stage.removeEventListener(Event.ENTER_FRAME, loop);
stage.removeEventListener(KeyboardEvent.KEY_UP, checkKeysUp);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, checkKeysDown);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, shoot);
stage.removeEventListener(MouseEvent.MOUSE_UP, stopshoot);
WeaponTimer.reset();
RecoilRecoveryTimer.reset();
CampaignStartTimer.reset();
LifeDrainTimer.reset();
if (GameType == "Campaign"){
DefenseCurrLevel = 0;
EfficiencyCurrLevel = 0;
OffenseCurrLevel = 0;
TintTimer.reset();
EnemyTintTimer.reset();
i = 0;
while (i < Enemy.length) {
if (Enemy[i].body.m_world != null){
Enemy[i].destroy();
Enemy[i].body.m_world = null;
};
i++;
};
i = 0;
while (i < Walls.length) {
if (Walls[i].body.m_world != null){
Walls[i].destroy();
Walls[i].body.m_world = null;
};
i++;
};
};
if (GameType == "Accuracy"){
AccuracyChallengeTimer.reset();
i = 0;
while (i < AccuracyTargets.length) {
if (AccuracyTargets[i].body.m_world != null){
AccuracyTargets[i].destroy();
};
i++;
};
};
if (GameType == "Speed"){
SpeedChallengeTimer.reset();
i = 0;
while (i < SpeedTargets.length) {
if (SpeedTargets[i].body.m_world != null){
SpeedTargets[i].destroy();
};
i++;
};
};
if (GameType == "Skill"){
global.CrateOnGoal = false;
SkillChallengeTimer.reset();
if (GoalPlatform1 != ""){
GoalPlatform1.destroy();
};
if (GoalPlatform2 != ""){
GoalPlatform2.destroy();
};
GoalCrate.destroy();
i = 0;
while (i < SkillBoxes.length) {
if (SkillBoxes[i].body.m_world != null){
SkillBoxes[i].destroy();
};
i++;
};
};
if (GameType == "Training"){
i = 0;
while (i < boxes.length) {
boxes[i].destroy();
i++;
};
};
if (PlayerHitBox.body.m_world != null){
PlayerHitBox.destroy();
PlayerHitBox.body.m_world = null;
};
Player.gotoAndStop(2);
removeChild(Player);
removeChild(TutorialHelper);
TopWall.destroy();
BottomWall.destroy();
RightWall.destroy();
LeftWall.destroy();
global.TargetHit = false;
global.PlayerHit = false;
global.currentLevel = 0;
i = 0;
while (i < shells.length) {
if (shells[i].body.m_world != null){
shells[i].destroy();
};
i++;
};
gotoAndPlay("Start");
};
if (stage.hasEventListener(Event.ENTER_FRAME)){
if (Player.FrontHand){
Player.FrontHand.gotoAndStop(HandSkin);
};
if (Player.BackHand){
Player.BackHand.gotoAndStop(HandSkin);
};
if (Player.PreciseReloadHand){
Player.PreciseReloadHand.gotoAndStop(HandSkin);
};
if (Player.ReloadHand){
Player.ReloadHand.gotoAndStop(HandSkin);
};
if (Player.HoldHand){
Player.HoldHand.gotoAndStop(HandSkin);
};
if (Player.GripHand){
Player.GripHand.gotoAndStop(HandSkin);
};
if (Player.PumpHand){
Player.PumpHand.gotoAndStop(HandSkin);
};
if (Player.ThumbHand){
Player.ThumbHand.gotoAndStop(HandSkin);
};
if (((((!(ChallengeComplete)) && ((GameType == "Campaign")))) && ((OffenseCurrLevel >= 1)))){
PlayerHitBox.x = ((Player.x / 30) + 0.5);
PlayerHitBox.y = (Player.y / 30);
} else {
if (PlayerHitBox.body.m_world != null){
PlayerHitBox.destroy();
PlayerHitBox.body.m_world = null;
};
};
if (keyisdown(84)){
TutorialHelper.alpha = 1;
if (GameType == "Training"){
TutorialHelper.TutorialPlate.alpha = 1;
TutorialHelper.TutorialPlate.TutorialInfo.htmlText = "<B>Warm-Up</B> \n Test out the gun's recoil, accuracy, and speed in this freeform room.";
this.setChildIndex(TutorialHelper, (this.numChildren - 1));
};
if (GameType == "Skill"){
TutorialHelper.TutorialPlate.alpha = 1;
TutorialHelper.TutorialPlate.TutorialInfo.htmlText = "<B>Skill</B> \n Your goal is to get the green crate onto the green platform. Use any means necessary!";
this.setChildIndex(TutorialHelper, (this.numChildren - 1));
};
if (GameType == "Speed"){
TutorialHelper.TutorialPlate.alpha = 1;
TutorialHelper.TutorialPlate.TutorialInfo.htmlText = "<B>Speed</B> \n Your goal is to destroy all the targets within a set time limit. The faster the better!";
this.setChildIndex(TutorialHelper, (this.numChildren - 1));
};
if (GameType == "Accuracy"){
TutorialHelper.TutorialPlate.alpha = 1;
TutorialHelper.TutorialPlate.TutorialInfo.htmlText = "<B>Accuracy</B> \n Your goal is to destroy all the targets while being as accurate as possible. You only have 1 clip!";
this.setChildIndex(TutorialHelper, (this.numChildren - 1));
};
if (GameType == "Campaign"){
TutorialHelper.TutorialPlate.alpha = 1;
TutorialHelper.TutorialPlate.TutorialInfo.htmlText = "<B>Campaign</B> \n Campaign goals differ depending on which zone your in (Defense, Efficiency, Offense). Read the center tooltip!";
this.setChildIndex(TutorialHelper, (this.numChildren - 1));
};
} else {
TutorialHelper.alpha = 0.25;
TutorialHelper.TutorialPlate.alpha = 0;
TutorialHelper.TutorialPlate.TutorialInfo.htmlText = "";
};
if (global.ShellGroundBounce == true){
global.ShellGroundBounce = false;
ShellGroundSound.play(250);
};
if (global.CrateGroundBounce == true){
global.CrateGroundBounce = false;
_local2 = Math.floor(((Math.random() * 2) + 1));
root[(("CrateGround" + _local2) + "Sound")].play(0, 0, HalfVolume);
};
if (ChallengeComplete == false){
AmmoInfo.htmlText = ((("<B>Ammo: </B>" + ClipSize) + "\n<B>Clips: </B>") + ClipAmount);
} else {
AmmoInfo.htmlText = "";
};
if (Player.x < 400){
CeaseFire = true;
Player.alpha = 0.25;
} else {
if (GameType == "Accuracy"){
if (AccuracyStarted == false){
CeaseFire = true;
Player.alpha = 0.25;
} else {
CeaseFire = false;
Player.alpha = 1;
};
} else {
CeaseFire = false;
Player.alpha = 1;
};
};
if (!ChallengeComplete){
Player.x = mouseX;
Player.y = mouseY;
} else {
Mouse.show();
Player.x = -200;
Player.y = -200;
};
if (GameType == "Training"){
if (((keyisdown(82)) && ((ChallengeComplete == false)))){
i = 0;
while (i <= boxNum) {
boxes[i].destroy();
i++;
};
i = 0;
while (i < shells.length) {
if ((((shells.length > MaxShellNum)) && ((shellReset == false)))){
shellReset = true;
i = (shells.length - (MaxShellNum + 1));
};
if (shells[i].body.m_world != null){
shells[i].destroy();
};
i++;
};
shells.length = 0;
shells = [];
shellNum = 0;
shellReset = false;
CreateTrainingCrates();
};
};
if (GameType == "Skill"){
if (((keyisdown(82)) && ((ChallengeComplete == false)))){
global.CrateOnGoal = false;
GoalTime = 3;
GoalTimerStarted = false;
SkillChallengeTimer.reset();
if (GoalPlatform1 != ""){
GoalPlatform1.destroy();
};
if (GoalPlatform2 != ""){
GoalPlatform2.destroy();
};
GoalCrate.destroy();
i = 0;
while (i < SkillBoxes.length) {
if (SkillBoxes[i].body.m_world != null){
SkillBoxes[i].destroy();
};
i++;
};
i = 0;
while (i < shells.length) {
if ((((shells.length > MaxShellNum)) && ((shellReset == false)))){
shellReset = true;
i = (shells.length - (MaxShellNum + 1));
};
if (shells[i].body.m_world != null){
shells[i].destroy();
};
i++;
};
shells.length = 0;
shells = [];
shellNum = 0;
shellReset = false;
StartSkillGame();
};
};
if (GameType == "Accuracy"){
if (((keyisdown(82)) && ((ChallengeComplete == false)))){
if (AccuracyStarted == false){
AccuracyStarted = true;
AccuracyChallengeTimer.start();
};
};
};
if (GameType == "Accuracy"){
if (ChallengeComplete == false){
ChallengeInfo.htmlText = ((((("<B>Total Targets: </B>" + WeaponType[WeaponNum][7]) + "\n<B>Targets Hit: </B>") + global.TargetsHit) + "/") + (WeaponType[WeaponNum][7] - TargetsMissed));
} else {
ChallengeInfo.htmlText = "";
};
if (global.TargetHit){
global.TargetHit = false;
TargetHitAccuracy = true;
global.TargetsHit++;
TargetBreakSound.play();
if (TargetHaterCurr < TargetHaterTotal){
TargetHaterCurr++;
};
sim.w.DestroyBody(global.Shape1Body);
sim.w.DestroyBody(global.Shape2Body);
global.Shape1Body.m_world = null;
global.Shape2Body.m_world = null;
removeChild(global.Shape1Sprite);
global.Shape2Sprite.TargetGraphic.gotoAndPlay(2);
};
};
if (GameType == "Speed"){
if (ChallengeComplete == false){
ChallengeInfo.htmlText = (((("<B>Expert Time: </B>" + Math.round((WeaponType[WeaponNum][13] / 3.5))) + " or less") + "\n<B>Time Elapsed: </B>") + SpeedTimer);
} else {
ChallengeInfo.htmlText = "";
};
if (global.TargetHit){
global.TargetHit = false;
TargetBreakSound.play();
if ((TargetNumSpeed + 1) < WeaponType[WeaponNum][12]){
TargetNumSpeed++;
if (SpeedTimerStarted == false){
SpeedTimerStarted = true;
SpeedChallengeTimer.start();
};
if (TargetHaterCurr < TargetHaterTotal){
TargetHaterCurr++;
};
sim.w.DestroyBody(global.Shape1Body);
sim.w.DestroyBody(global.Shape2Body);
global.Shape1Body.m_world = null;
global.Shape2Body.m_world = null;
removeChild(global.Shape1Sprite);
global.Shape2Sprite.TargetGraphic.gotoAndPlay(2);
} else {
WeaponTimer.reset();
RecoilRecoveryTimer.reset();
TrainingText.htmlText = "";
RangeLimitZone.alpha = 0;
if (TargetHaterCurr < TargetHaterTotal){
TargetHaterCurr++;
};
sim.w.DestroyBody(global.Shape1Body);
sim.w.DestroyBody(global.Shape2Body);
global.Shape1Body.m_world = null;
global.Shape2Body.m_world = null;
removeChild(global.Shape1Sprite);
global.Shape2Sprite.TargetGraphic.gotoAndPlay(2);
SpeedChallengeTimer.reset();
ChallengeComplete = true;
SpeedHolder.gotoAndPlay(2);
if (SpeedTimer < WeaponType[WeaponNum][14]){
WeaponType[WeaponNum][14] = SpeedTimer;
if (WeaponType[WeaponNum][14] <= Math.round((WeaponType[WeaponNum][13] / 3.5))){
if (WeaponType[WeaponNum][15] == "Veteran"){
WeaponType[WeaponNum][15] = "Expert";
ExpertMedalCurr++;
} else {
if (WeaponType[WeaponNum][15] == "Novice"){
WeaponType[WeaponNum][15] = "Expert";
ExpertMedalCurr++;
VeteranMedalCurr++;
} else {
if (WeaponType[WeaponNum][15] == "None"){
WeaponType[WeaponNum][15] = "Expert";
ExpertMedalCurr++;
VeteranMedalCurr++;
NoviceMedalCurr++;
};
};
};
} else {
if (WeaponType[WeaponNum][14] <= Math.round((WeaponType[WeaponNum][13] / 2.5))){
if (WeaponType[WeaponNum][15] == "Novice"){
WeaponType[WeaponNum][15] = "Veteran";
VeteranMedalCurr++;
} else {
if (WeaponType[WeaponNum][15] == "None"){
WeaponType[WeaponNum][15] = "Veteran";
VeteranMedalCurr++;
NoviceMedalCurr++;
};
};
} else {
if (WeaponType[WeaponNum][14] <= Math.round(WeaponType[WeaponNum][13])){
if (WeaponType[WeaponNum][15] == "None"){
WeaponType[WeaponNum][15] = "Novice";
NoviceMedalCurr++;
};
} else {
WeaponType[WeaponNum][15] = "None";
};
};
};
};
SpeedHolder.SpeedPlate.TimeHitInfo.htmlText = (("<B>Scored Time: </B>" + SpeedTimer) + " Sec");
SpeedHolder.SpeedPlate.TimeMissInfo.htmlText = (("<B>Best Time: </B>" + WeaponType[WeaponNum][14]) + " Sec");
SpeedHolder.SpeedPlate.MedalInfo.htmlText = ("<B>Best Medal: </B>" + WeaponType[WeaponNum][15]);
SpeedHolder.SpeedPlate.SpeedMedal.gotoAndStop(WeaponType[WeaponNum][15]);
};
};
};
if (GameType == "Skill"){
GoalCrate.userData.GoalTimerInfo.htmlText = GoalTime;
if (SkillChallengeComplete == false){
ChallengeInfo.htmlText = (((("<B>Expert Shots: </B>" + WeaponType[WeaponNum][16]) + " or less") + "\n<B>Shots Taken: </B>") + shellNum);
if ((((global.CrateOnGoal == true)) && ((GoalTimerStarted == false)))){
GoalTimerStarted = true;
SkillChallengeTimer.start();
};
if ((((global.CrateOnGoal == false)) && ((GoalTimerStarted == true)))){
GoalTimerStarted = false;
GoalTime = 3;
SkillChallengeTimer.reset();
};
};
if (SkillChallengeComplete == true){
if (WorldDestroy == false){
WorldDestroy = true;
RangeLimitZone.alpha = 0;
WeaponTimer.reset();
RecoilRecoveryTimer.reset();
TrainingText.htmlText = "";
ChallengeInfo.htmlText = "";
if (GoalPlatform1 != ""){
GoalPlatform1.destroy();
};
if (GoalPlatform2 != ""){
GoalPlatform2.destroy();
};
GoalCrate.destroy();
i = 0;
while (i < SkillBoxes.length) {
if (SkillBoxes[i].body.m_world != null){
SkillBoxes[i].destroy();
};
i++;
};
global.CrateOnGoal = false;
SkillChallengeTimer.reset();
ChallengeComplete = true;
SkillHolder.gotoAndPlay(2);
if (shellNum < WeaponType[WeaponNum][17]){
WeaponType[WeaponNum][17] = shellNum;
if (WeaponType[WeaponNum][17] <= Math.round(WeaponType[WeaponNum][16])){
if (WeaponType[WeaponNum][18] == "Veteran"){
WeaponType[WeaponNum][18] = "Expert";
ExpertMedalCurr++;
} else {
if (WeaponType[WeaponNum][18] == "Novice"){
WeaponType[WeaponNum][18] = "Expert";
ExpertMedalCurr++;
VeteranMedalCurr++;
} else {
if (WeaponType[WeaponNum][18] == "None"){
WeaponType[WeaponNum][18] = "Expert";
ExpertMedalCurr++;
VeteranMedalCurr++;
NoviceMedalCurr++;
};
};
};
} else {
if (WeaponType[WeaponNum][17] <= Math.round((WeaponType[WeaponNum][16] * 2))){
if (WeaponType[WeaponNum][18] == "Novice"){
WeaponType[WeaponNum][18] = "Veteran";
VeteranMedalCurr++;
} else {
if (WeaponType[WeaponNum][18] == "None"){
WeaponType[WeaponNum][18] = "Veteran";
VeteranMedalCurr++;
NoviceMedalCurr++;
};
};
} else {
if (WeaponType[WeaponNum][17] <= Math.round((WeaponType[WeaponNum][16] * 4))){
if (WeaponType[WeaponNum][18] == "None"){
WeaponType[WeaponNum][18] = "Novice";
NoviceMedalCurr++;
};
} else {
WeaponType[WeaponNum][18] = "None";
};
};
};
};
SkillHolder.SkillPlate.SkillHitInfo.htmlText = ("<B>Shots Taken: </B>" + shellNum);
SkillHolder.SkillPlate.SkillMissInfo.htmlText = ("<B>Least Shots: </B>" + WeaponType[WeaponNum][17]);
SkillHolder.SkillPlate.MedalInfo.htmlText = ("<B>Best Medal: </B>" + WeaponType[WeaponNum][18]);
SkillHolder.SkillPlate.SkillMedal.gotoAndStop(WeaponType[WeaponNum][18]);
};
};
};
if ((((GameType == "Campaign")) && ((CampaignStarted == true)))){
if ((((global.TargetsHit >= EnemyKillTotal)) && ((CampaignEnd == false)))){
CampaignEnd = true;
ChallengeComplete = true;
i = 0;
while (i < Enemy.length) {
if (Enemy[i].body.m_world != null){
Enemy[i].destroy();
Enemy[i].body.m_world = null;
};
i++;
};
i = 0;
while (i < Walls.length) {
if (Walls[i].body.m_world != null){
Walls[i].destroy();
Walls[i].body.m_world = null;
};
i++;
};
WeaponTimer.reset();
RecoilRecoveryTimer.reset();
LifeDrainTimer.reset();
TintTimer.reset();
if (OffenseCurrLevel >= 1){
EnemyTintTimer.reset();
};
TrainingText.htmlText = "";
EnemyHP.htmlText = "";
RangeLimitZone.alpha = 0;
CampaignHolder.gotoAndPlay(2);
CampaignHolder.CampaignPlate.LifeInfo.htmlText = ("<B>Lives Remaining: </B>" + Lives);
if (DefenseCurrLevel >= 1){
CampaignHolder.CampaignPlate.LevelInfo.htmlText = (("<B>Defense Level: " + DefenseCurrLevel) + "</B>");
} else {
if (EfficiencyCurrLevel >= 1){
CampaignHolder.CampaignPlate.LevelInfo.htmlText = (("<B>Efficiency Level: " + EfficiencyCurrLevel) + "</B>");
} else {
if (OffenseCurrLevel >= 1){
CampaignHolder.CampaignPlate.LevelInfo.htmlText = (("<B>Offense Level: " + OffenseCurrLevel) + "</B>");
};
};
};
if ((((DefenseCurrLevel == DefenseLevelsUnlocked)) && (!((DefenseCurrLevel == 7))))){
CampaignHolder.CampaignPlate.LevelUnlockInfo.htmlText = (("<B>Success!\nUnlocked Defense Level " + (DefenseCurrLevel + 1)) + "</B>");
DefenseLevelsUnlocked++;
LevelsUnlockedTotal++;
if ((((DefenseLevelsUnlocked > 4)) && ((SkorpionUnlocked == false)))){
SkorpionUnlocked = true;
};
} else {
if (DefenseCurrLevel > 0){
if (DefenseCurrLevel < 7){
CampaignHolder.CampaignPlate.LevelUnlockInfo.htmlText = "<B>Success!\nLevel Already Completed</B>";
} else {
if (DefenseLevelsUnlocked == 7){
DefenseLevelsUnlocked = 8;
LevelsUnlockedTotal++;
};
CampaignHolder.CampaignPlate.LevelUnlockInfo.htmlText = "<B>Success!\nYou've beaten the last level!</B>";
};
};
};
if ((((EfficiencyCurrLevel == EfficiencyLevelsUnlocked)) && (!((EfficiencyCurrLevel == 7))))){
CampaignHolder.CampaignPlate.LevelUnlockInfo.htmlText = (("<B>Success!\nUnlocked Efficiency Level " + (EfficiencyCurrLevel + 1)) + "</B>");
EfficiencyLevelsUnlocked++;
LevelsUnlockedTotal++;
} else {
if (EfficiencyCurrLevel > 0){
if (EfficiencyCurrLevel < 7){
CampaignHolder.CampaignPlate.LevelUnlockInfo.htmlText = "<B>Success!\nLevel Already Completed</B>";
} else {
if (EfficiencyLevelsUnlocked == 7){
EfficiencyLevelsUnlocked = 8;
LevelsUnlockedTotal++;
};
CampaignHolder.CampaignPlate.LevelUnlockInfo.htmlText = "<B>Success!\nYou've beaten the last level!</B>";
};
};
};
if ((((OffenseCurrLevel == OffenseLevelsUnlocked)) && (!((OffenseCurrLevel == 7))))){
CampaignHolder.CampaignPlate.LevelUnlockInfo.htmlText = (("<B>Success!\nUnlocked Offense Level " + (OffenseCurrLevel + 1)) + "</B>");
OffenseLevelsUnlocked++;
LevelsUnlockedTotal++;
if ((((OffenseLevelsUnlocked > 5)) && ((DeagleUnlocked == false)))){
DeagleUnlocked = true;
};
} else {
if (OffenseCurrLevel > 0){
if (OffenseCurrLevel < 7){
CampaignHolder.CampaignPlate.LevelUnlockInfo.htmlText = "<B>Success!\nLevel Already Completed</B>";
} else {
if (OffenseLevelsUnlocked == 7){
OffenseLevelsUnlocked = 8;
LevelsUnlockedTotal++;
};
CampaignHolder.CampaignPlate.LevelUnlockInfo.htmlText = "<B>Success!\nYou've beaten the last level!</B>";
};
};
};
};
if ((((Lives <= 0)) && ((CampaignEnd == false)))){
CampaignEnd = true;
ChallengeComplete = true;
i = 0;
while (i < Enemy.length) {
if (Enemy[i].body.m_world != null){
Enemy[i].destroy();
Enemy[i].body.m_world = null;
};
i++;
};
i = 0;
while (i < Walls.length) {
if (Walls[i].body.m_world != null){
Walls[i].destroy();
Walls[i].body.m_world = null;
};
i++;
};
WeaponTimer.reset();
RecoilRecoveryTimer.reset();
LifeDrainTimer.reset();
TintTimer.reset();
if (OffenseCurrLevel >= 1){
EnemyTintTimer.reset();
};
TrainingText.htmlText = "";
EnemyHP.htmlText = "";
RangeLimitZone.alpha = 0;
CampaignHolder.gotoAndPlay(2);
CampaignHolder.CampaignPlate.LifeInfo.htmlText = ("<B>Lives Remaining: </B>" + Lives);
if (DefenseCurrLevel >= 1){
CampaignHolder.CampaignPlate.LevelInfo.htmlText = (("<B>Defense Level: " + DefenseCurrLevel) + "</B>");
} else {
if (EfficiencyCurrLevel >= 1){
CampaignHolder.CampaignPlate.LevelInfo.htmlText = (("<B>Efficiency Level: " + EfficiencyCurrLevel) + "</B>");
} else {
if (OffenseCurrLevel >= 1){
CampaignHolder.CampaignPlate.LevelInfo.htmlText = (("<B>Offense Level: " + OffenseCurrLevel) + "</B>");
};
};
};
CampaignHolder.CampaignPlate.LevelUnlockInfo.htmlText = "<B>Failed!\nTry harder next time.</B>";
};
if (ChallengeComplete == false){
ChallengeInfo.htmlText = ((((("<B>Lives: </B>" + Lives) + "\n<B>Targets Left: </B>") + (EnemyKillTotal - global.TargetsHit)) + "/") + EnemyKillTotal);
} else {
ChallengeInfo.htmlText = "";
};
if (global.TargetHit){
global.TargetHit = false;
if ((((DefenseCurrLevel >= 1)) || ((EfficiencyCurrLevel >= 1)))){
sim.w.DestroyBody(global.Shape1Body);
global.Shape1Body.m_world = null;
removeChild(global.Shape1Sprite);
} else {
_local3 = Math.floor(((Math.random() * 2) + 1));
root[(("Crunch" + _local3) + "Sound")].play(0, 0);
if (EnemyTintTimer.running == false){
global.Shape1Sprite.transform.colorTransform = PlayerHitTint;
EnemyTintTimer.start();
};
sim.w.DestroyBody(global.Shape2Body);
global.Shape2Body.m_world = null;
removeChild(global.Shape2Sprite);
};
};
if (global.PlayerHit){
global.PlayerHit = false;
Lives--;
_local4 = Math.floor(((Math.random() * 2) + 1));
root[(("Damage" + _local4) + "Sound")].play(0, 0);
if (TintTimer.running == false){
Player.transform.colorTransform = PlayerHitTint;
TintTimer.start();
};
sim.w.DestroyBody(global.Shape2Body);
global.Shape2Body.m_world = null;
removeChild(global.Shape2Sprite);
};
i = 0;
while (i < Enemy.length) {
if ((((global.EnemyHP[i] <= 0)) || ((Enemy[i].userData.x > 400)))){
if (((!((Enemy[i].body.m_world == null))) && ((((DefenseCurrLevel >= 1)) || ((EfficiencyCurrLevel >= 1)))))){
global.TargetsHit++;
TargetBreakSound.play();
if (global.EnemyHP[i] <= 0){
if (TargetHaterCurr < TargetHaterTotal){
TargetHaterCurr++;
};
} else {
if (Enemy[i].userData.x > 400){
Lives--;
};
};
sim.w.DestroyBody(Enemy[i].body);
Enemy[i].userData.TargetGraphic.gotoAndPlay(2);
Enemy[i].body.m_world = null;
} else {
if (Enemy[i].body.m_world != null){
global.TargetsHit++;
GunBreakSound.play();
if (global.EnemyHP[i] <= 0){
} else {
if (Enemy[i].userData.x > 400){
Lives--;
};
};
sim.w.DestroyBody(Enemy[i].body);
Enemy[i].userData.gotoAndPlay(EnemyDeath);
Enemy[i].body.m_world = null;
};
};
} else {
if ((((DefenseCurrLevel >= 1)) || ((EfficiencyCurrLevel >= 1)))){
Enemy[i].userData.TargetGraphic.TargetHP.htmlText = (("<B>" + Math.ceil(global.EnemyHP[i])) + "</B>");
} else {
if (Enemy[i].body.m_world != null){
EnemyHP.htmlText = (("<B> Enemy HP: " + Math.ceil(global.EnemyHP[i])) + "</B>");
};
};
};
if (EnemyMove[i] == "Normal"){
Enemy[i].body.GetLinearVelocity().y = -0.15;
if (Enemy[i].body.GetLinearVelocity().x < 1){
Enemy[i].body.GetLinearVelocity().x = (Enemy[i].body.GetLinearVelocity().x + 0.25);
};
if (Enemy[i].body.GetLinearVelocity().x >= 1){
Enemy[i].body.GetLinearVelocity().x = 1;
};
};
if (EnemyMove[i] == "Up"){
Enemy[i].body.GetLinearVelocity().y = -0.4;
if (Enemy[i].body.GetLinearVelocity().x < 1){
Enemy[i].body.GetLinearVelocity().x = (Enemy[i].body.GetLinearVelocity().x + 0.25);
};
if (Enemy[i].body.GetLinearVelocity().x >= 1){
Enemy[i].body.GetLinearVelocity().x = 1;
};
};
if (EnemyMove[i] == "Fast"){
Enemy[i].body.GetLinearVelocity().y = -0.15;
if (Enemy[i].body.GetLinearVelocity().x < 3){
Enemy[i].body.GetLinearVelocity().x = (Enemy[i].body.GetLinearVelocity().x + 0.35);
};
if (Enemy[i].body.GetLinearVelocity().x >= 3){
Enemy[i].body.GetLinearVelocity().x = 3;
};
};
if (EnemyMove[i] == "Heavy"){
Enemy[i].body.GetLinearVelocity().y = -0.15;
if (Enemy[i].body.GetLinearVelocity().x < 0.75){
Enemy[i].body.GetLinearVelocity().x = (Enemy[i].body.GetLinearVelocity().x + 0.25);
};
if (Enemy[i].body.GetLinearVelocity().x >= 0.75){
Enemy[i].body.GetLinearVelocity().x = 0.75;
};
};
if (EnemyMove[i] == "ZigZag"){
if (EnemyZigZag[i] == "Up"){
Enemy[i].body.GetLinearVelocity().y = (Enemy[i].body.GetLinearVelocity().y + 0.25);
};
if (EnemyZigZag[i] == "Down"){
Enemy[i].body.GetLinearVelocity().y = (Enemy[i].body.GetLinearVelocity().y - 0.25);
};
if (Enemy[i].body.GetLinearVelocity().y >= 3){
EnemyZigZag[i] = "Down";
};
if (Enemy[i].body.GetLinearVelocity().y <= -3.5){
EnemyZigZag[i] = "Up";
};
if (Enemy[i].body.GetLinearVelocity().x < 1){
Enemy[i].body.GetLinearVelocity().x = (Enemy[i].body.GetLinearVelocity().x + 0.25);
};
if (Enemy[i].body.GetLinearVelocity().x >= 1){
Enemy[i].body.GetLinearVelocity().x = 1;
};
};
if (EnemyMove[i] == "ZigZagHigh"){
if (EnemyZigZag[i] == "Up"){
Enemy[i].body.GetLinearVelocity().y = (Enemy[i].body.GetLinearVelocity().y + 0.35);
};
if (EnemyZigZag[i] == "Down"){
Enemy[i].body.GetLinearVelocity().y = (Enemy[i].body.GetLinearVelocity().y - 0.35);
};
if (Enemy[i].body.GetLinearVelocity().y >= 6){
EnemyZigZag[i] = "Down";
};
if (Enemy[i].body.GetLinearVelocity().y <= -6.5){
EnemyZigZag[i] = "Up";
};
if (Enemy[i].body.GetLinearVelocity().x < 1){
Enemy[i].body.GetLinearVelocity().x = (Enemy[i].body.GetLinearVelocity().x + 0.25);
};
if (Enemy[i].body.GetLinearVelocity().x >= 1){
Enemy[i].body.GetLinearVelocity().x = 1;
};
};
if (EnemyMove[i] == "Walls"){
if (Enemy[i].body.m_world != null){
Enemy[i].x = (Walls[0].x - (30 / 30));
Enemy[i].y = (Walls[0].y + (230 / 30));
};
};
if (EnemyMove[i] == "Enemy1"){
if (Enemy[i].body.m_world != null){
if (Math.floor((Math.random() * 75)) == 0){
EnemyFire(i);
};
if (Enemy[i].y > (Player.y / 30)){
Enemy[i].y = (Enemy[i].y - (1 / 30));
} else {
if (Enemy[i].y < (Player.y / 30)){
Enemy[i].y = (Enemy[i].y + (1 / 30));
} else {
Enemy[i].y = (Player.y / 30);
};
};
};
};
if (EnemyMove[i] == "Enemy2"){
if (Enemy[i].body.m_world != null){
if (Math.floor((Math.random() * 60)) == 0){
EnemyFire(i);
};
if (Enemy[i].y > (Player.y / 30)){
Enemy[i].y = (Enemy[i].y - (1.5 / 30));
} else {
if (Enemy[i].y < (Player.y / 30)){
Enemy[i].y = (Enemy[i].y + (1.5 / 30));
} else {
Enemy[i].y = (Player.y / 30);
};
};
};
};
if (EnemyMove[i] == "Enemy3"){
if (Enemy[i].body.m_world != null){
if (Math.floor((Math.random() * 40)) == 0){
EnemyFire(i);
};
if (Enemy[i].y > (Player.y / 30)){
Enemy[i].y = (Enemy[i].y - (1.75 / 30));
} else {
if (Enemy[i].y < (Player.y / 30)){
Enemy[i].y = (Enemy[i].y + (1.75 / 30));
} else {
Enemy[i].y = (Player.y / 30);
};
};
};
};
if (EnemyMove[i] == "Enemy4"){
if (Enemy[i].body.m_world != null){
if (Math.floor((Math.random() * 30)) == 0){
EnemyFire(i);
};
if (Enemy[i].y > (Player.y / 30)){
Enemy[i].y = (Enemy[i].y - (1.75 / 30));
} else {
if (Enemy[i].y < (Player.y / 30)){
Enemy[i].y = (Enemy[i].y + (1.75 / 30));
} else {
Enemy[i].y = (Player.y / 30);
};
};
};
};
if (EnemyMove[i] == "Enemy5"){
if (Enemy[i].body.m_world != null){
if (Math.floor((Math.random() * 100)) == 0){
EnemyFire(i);
};
if (Enemy[i].y > (Player.y / 30)){
Enemy[i].y = (Enemy[i].y - (2 / 30));
} else {
if (Enemy[i].y < (Player.y / 30)){
Enemy[i].y = (Enemy[i].y + (2 / 30));
} else {
Enemy[i].y = (Player.y / 30);
};
};
};
};
if (EnemyMove[i] == "Enemy6"){
if (Enemy[i].body.m_world != null){
if (Math.floor((Math.random() * 60)) == 0){
EnemyFire(i);
};
if (Enemy[i].y > (Player.y / 30)){
Enemy[i].y = (Enemy[i].y - (1.5 / 30));
} else {
if (Enemy[i].y < (Player.y / 30)){
Enemy[i].y = (Enemy[i].y + (1.5 / 30));
} else {
Enemy[i].y = (Player.y / 30);
};
};
};
};
if (EnemyMove[i] == "Enemy7"){
if (Enemy[i].body.m_world != null){
if (Math.floor((Math.random() * 35)) == 0){
EnemyFire(i);
};
if (Enemy[i].y > (Player.y / 30)){
Enemy[i].y = (Enemy[i].y - (0.75 / 30));
} else {
if (Enemy[i].y < (Player.y / 30)){
Enemy[i].y = (Enemy[i].y + (0.75 / 30));
} else {
Enemy[i].y = (Player.y / 30);
};
};
};
};
i++;
};
i = 0;
while (i < Walls.length) {
if (Walls[i].userData.name == "Wall1"){
if (((!((Walls[i].body.m_world == null))) && ((i == 0)))){
Walls[i].x = (Walls[i].x + WallSpeed);
Walls[i].y = (Walls[i].y + WallSpeedVert);
if (Walls[i].userData.x >= 200){
WallSpeed = -0.05;
} else {
if (Walls[i].userData.x <= 60){
WallSpeed = 0.05;
};
};
if (Walls[i].userData.y >= 60){
WallSpeedVert = -0.025;
} else {
if (Walls[i].userData.y <= -90){
WallSpeedVert = 0.025;
};
};
} else {
if (Walls[i].body.m_world != null){
Walls[i].x = Walls[0].x;
Walls[i].y = (Walls[0].y + (460 / 30));
};
};
};
if (Walls[i].userData.name == "Wall2"){
if (((!((Walls[i].body.m_world == null))) && ((i == 0)))){
Walls[i].x = (Walls[i].x + WallSpeed);
Walls[i].y = (Walls[i].y + WallSpeedVert);
if (Walls[i].userData.x >= 240){
WallSpeed = -0.065;
} else {
if (Walls[i].userData.x <= 60){
WallSpeed = 0.065;
};
};
if (Walls[i].userData.y >= 70){
WallSpeedVert = -0.03;
} else {
if (Walls[i].userData.y <= -100){
WallSpeedVert = 0.03;
};
};
} else {
if (Walls[i].body.m_world != null){
Walls[i].x = Walls[0].x;
Walls[i].y = (Walls[0].y + (460 / 30));
};
};
};
if (Walls[i].userData.name == "Wall3"){
if (((!((Walls[i].body.m_world == null))) && ((i == 0)))){
Walls[i].x = (Walls[i].x + WallSpeed);
Walls[i].y = (Walls[i].y + WallSpeedVert);
if (Walls[i].userData.x >= 280){
WallSpeed = -0.07;
} else {
if (Walls[i].userData.x <= 60){
WallSpeed = 0.07;
};
};
if (Walls[i].userData.y >= 80){
WallSpeedVert = -0.035;
} else {
if (Walls[i].userData.y <= -110){
WallSpeedVert = 0.035;
};
};
} else {
if (Walls[i].body.m_world != null){
Walls[i].x = Walls[0].x;
Walls[i].y = (Walls[0].y + (460 / 30));
};
};
};
if (Walls[i].userData.name == "Wall4"){
if (((!((Walls[i].body.m_world == null))) && ((i == 0)))){
Walls[i].x = (Walls[i].x + WallSpeed);
Walls[i].y = (Walls[i].y + WallSpeedVert);
if (Walls[i].userData.x >= 300){
WallSpeed = -0.08;
} else {
if (Walls[i].userData.x <= 60){
WallSpeed = 0.08;
};
};
if (Walls[i].userData.y >= 100){
WallSpeedVert = -0.045;
} else {
if (Walls[i].userData.y <= -130){
WallSpeedVert = 0.045;
};
};
} else {
if (Walls[i].body.m_world != null){
Walls[i].x = Walls[0].x;
Walls[i].y = (Walls[0].y + (460 / 30));
};
};
};
if (Walls[i].userData.name == "Wall5"){
if (((!((Walls[i].body.m_world == null))) && ((i == 0)))){
Walls[i].x = (Walls[i].x + WallSpeed);
Walls[i].y = (Walls[i].y + WallSpeedVert);
if (Walls[i].userData.x >= 280){
WallSpeed = -0.1;
} else {
if (Walls[i].userData.x <= 60){
WallSpeed = 0.1;
};
};
if (Walls[i].userData.y >= 120){
WallSpeedVert = -0.06;
} else {
if (Walls[i].userData.y <= -150){
WallSpeedVert = 0.06;
};
};
} else {
if (Walls[i].body.m_world != null){
Walls[i].x = Walls[0].x;
Walls[i].y = (Walls[0].y + (460 / 30));
};
};
};
if (Walls[i].userData.name == "Wall6"){
if (((!((Walls[i].body.m_world == null))) && ((i == 0)))){
Walls[i].x = (Walls[i].x + WallSpeed);
Walls[i].y = (Walls[i].y + WallSpeedVert);
if (Walls[i].userData.x >= 280){
WallSpeed = -0.15;
} else {
if (Walls[i].userData.x <= 60){
WallSpeed = 0.15;
};
};
if (Walls[i].userData.y >= 100){
WallSpeedVert = -0.065;
} else {
if (Walls[i].userData.y <= -130){
WallSpeedVert = 0.065;
};
};
} else {
if (Walls[i].body.m_world != null){
Walls[i].x = Walls[0].x;
Walls[i].y = (Walls[0].y + (460 / 30));
};
};
};
if (Walls[i].userData.name == "Wall7"){
if (((!((Walls[i].body.m_world == null))) && ((i == 0)))){
Walls[i].x = (Walls[i].x + WallSpeed);
Walls[i].y = (Walls[i].y + WallSpeedVert);
if (Walls[i].userData.x >= 300){
WallSpeed = -0.2;
} else {
if (Walls[i].userData.x <= 60){
WallSpeed = 0.2;
};
};
if (Walls[i].userData.y >= 100){
WallSpeedVert = -0.075;
} else {
if (Walls[i].userData.y <= -130){
WallSpeedVert = 0.075;
};
};
} else {
if (Walls[i].body.m_world != null){
Walls[i].x = Walls[0].x;
Walls[i].y = (Walls[0].y + (460 / 30));
};
};
};
i++;
};
if ((((DefenseCurrLevel == 1)) && ((ChallengeComplete == false)))){
if ((((Math.floor((Math.random() * 75)) == 0)) && ((EnemyTotal > 0)))){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:1, mass:0.4, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 50;
EnemyMove[EnemyNum] = "Heavy";
EnemyNum++;
EnemyTotal--;
} else {
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.5, mass:0.2, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 5;
EnemyMove[EnemyNum] = "Normal";
EnemyNum++;
EnemyTotal--;
};
};
};
if ((((DefenseCurrLevel == 2)) && ((ChallengeComplete == false)))){
if ((((Math.floor((Math.random() * 65)) == 0)) && ((EnemyTotal > 0)))){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:1, mass:0.6, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 75;
EnemyMove[EnemyNum] = "Heavy";
EnemyNum++;
EnemyTotal--;
} else {
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.5, mass:0.2, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 5;
RandomEnemy = Math.floor((Math.random() * 2));
if (RandomEnemy == 0){
EnemyMove[EnemyNum] = "Normal";
} else {
EnemyMove[EnemyNum] = "Up";
};
EnemyNum++;
EnemyTotal--;
};
};
};
if ((((DefenseCurrLevel == 3)) && ((ChallengeComplete == false)))){
if ((((Math.floor((Math.random() * 80)) == 0)) && ((EnemyTotal > 0)))){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:1.1, mass:0.8, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 100;
EnemyMove[EnemyNum] = "Heavy";
EnemyNum++;
EnemyTotal--;
} else {
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.5, mass:0.2, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 5;
RandomEnemy = Math.floor((Math.random() * 3));
if (RandomEnemy == 0){
EnemyMove[EnemyNum] = "Normal";
} else {
if (RandomEnemy == 1){
EnemyMove[EnemyNum] = "Up";
} else {
EnemyMove[EnemyNum] = "Fast";
};
};
EnemyNum++;
EnemyTotal--;
};
};
};
if ((((DefenseCurrLevel == 4)) && ((ChallengeComplete == false)))){
if ((((Math.floor((Math.random() * 100)) == 0)) && ((EnemyTotal > 0)))){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:1.1, mass:0.8, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 50;
EnemyZigZag[EnemyNum] = "Up";
EnemyMove[EnemyNum] = "ZigZag";
EnemyNum++;
EnemyTotal--;
} else {
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.5, mass:0.2, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 7;
RandomEnemy = Math.floor((Math.random() * 3));
if (RandomEnemy == 0){
EnemyMove[EnemyNum] = "Normal";
} else {
if (RandomEnemy == 1){
EnemyZigZag[EnemyNum] = "Up";
EnemyMove[EnemyNum] = "ZigZag";
} else {
EnemyMove[EnemyNum] = "Fast";
};
};
EnemyNum++;
EnemyTotal--;
};
};
};
if ((((DefenseCurrLevel == 5)) && ((ChallengeComplete == false)))){
if ((((Math.floor((Math.random() * 90)) == 0)) && ((EnemyTotal > 0)))){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:1.1, mass:0.8, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 75;
EnemyZigZag[EnemyNum] = "Up";
EnemyMove[EnemyNum] = "ZigZag";
EnemyNum++;
EnemyTotal--;
} else {
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.65, mass:0.2, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 7;
RandomEnemy = Math.floor((Math.random() * 3));
if (RandomEnemy == 0){
EnemyMove[EnemyNum] = "Normal";
} else {
if (RandomEnemy == 1){
EnemyZigZag[EnemyNum] = "Up";
EnemyMove[EnemyNum] = "ZigZag";
} else {
EnemyMove[EnemyNum] = "Fast";
};
};
EnemyNum++;
EnemyTotal--;
};
};
};
if ((((DefenseCurrLevel == 6)) && ((ChallengeComplete == false)))){
if ((((Math.floor((Math.random() * 100)) == 0)) && ((EnemyTotal > 0)))){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:1.1, mass:0.8, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 100;
EnemyMove[EnemyNum] = "ZigZagHigh";
EnemyNum++;
EnemyTotal--;
} else {
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.65, mass:0.2, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 10;
RandomEnemy = Math.floor((Math.random() * 4));
if (RandomEnemy == 0){
EnemyMove[EnemyNum] = "Normal";
} else {
if (RandomEnemy == 1){
EnemyZigZag[EnemyNum] = "Up";
EnemyMove[EnemyNum] = "ZigZag";
} else {
EnemyZigZag[EnemyNum] = "Up";
EnemyMove[EnemyNum] = "ZigZagHigh";
};
};
EnemyNum++;
EnemyTotal--;
};
};
};
if ((((DefenseCurrLevel == 7)) && ((ChallengeComplete == false)))){
if ((((Math.floor((Math.random() * 125)) == 0)) && ((EnemyTotal > 0)))){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:1.1, mass:1, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 75;
EnemyMove[EnemyNum] = "ZigZagHigh";
EnemyNum++;
EnemyTotal--;
} else {
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.65, mass:0.2, x:(50 / 30), y:(((Math.random() * 300) + 50) / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 12;
RandomEnemy = Math.floor((Math.random() * 5));
if (RandomEnemy == 0){
EnemyMove[EnemyNum] = "Normal";
} else {
if (RandomEnemy == 1){
EnemyZigZag[EnemyNum] = "Up";
EnemyMove[EnemyNum] = "ZigZag";
} else {
EnemyZigZag[EnemyNum] = "Up";
EnemyMove[EnemyNum] = "ZigZagHigh";
};
};
EnemyNum++;
EnemyTotal--;
};
};
};
if ((((EfficiencyCurrLevel == 1)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.5, density:0, x:(70 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 20;
EnemyMove[EnemyNum] = "Walls";
EnemyNum++;
EnemyTotal--;
};
if (WallSpawn == 0){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(-30 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall1";
WallSpawn++;
};
if (WallSpawn == 1){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(430 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall1";
WallSpawn++;
};
};
};
if ((((EfficiencyCurrLevel == 2)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.5, density:0, x:(70 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 30;
EnemyMove[EnemyNum] = "Walls";
EnemyNum++;
EnemyTotal--;
};
if (WallSpawn == 0){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(-30 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall2";
WallSpawn++;
};
if (WallSpawn == 1){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(430 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall2";
WallSpawn++;
};
};
};
if ((((EfficiencyCurrLevel == 3)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.5, density:0, x:(70 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 50;
EnemyMove[EnemyNum] = "Walls";
EnemyNum++;
EnemyTotal--;
};
if (WallSpawn == 0){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(-30 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall3";
WallSpawn++;
};
if (WallSpawn == 1){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(430 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall3";
WallSpawn++;
};
};
};
if ((((EfficiencyCurrLevel == 4)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.45, density:0, x:(70 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 40;
EnemyMove[EnemyNum] = "Walls";
EnemyNum++;
EnemyTotal--;
};
if (WallSpawn == 0){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(-30 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall4";
WallSpawn++;
};
if (WallSpawn == 1){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(430 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall4";
WallSpawn++;
};
};
};
if ((((EfficiencyCurrLevel == 5)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.45, density:0, x:(70 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 40;
EnemyMove[EnemyNum] = "Walls";
EnemyNum++;
EnemyTotal--;
};
if (WallSpawn == 0){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(-30 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall5";
WallSpawn++;
};
if (WallSpawn == 1){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(430 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall5";
WallSpawn++;
};
};
};
if ((((EfficiencyCurrLevel == 6)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.4, density:0, x:(70 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 35;
EnemyMove[EnemyNum] = "Walls";
EnemyNum++;
EnemyTotal--;
};
if (WallSpawn == 0){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(-30 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall6";
WallSpawn++;
};
if (WallSpawn == 1){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(430 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall6";
WallSpawn++;
};
};
};
if ((((EfficiencyCurrLevel == 7)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
if (EnemyTotal == 1){
Enemy[EnemyNum] = sim.addCircle({skin:Target, radius:0.4, density:0, x:(70 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
global.EnemyHP[EnemyNum] = 40;
EnemyMove[EnemyNum] = "Walls";
EnemyNum++;
EnemyTotal--;
};
if (WallSpawn == 0){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(-30 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall7";
WallSpawn++;
};
if (WallSpawn == 1){
Walls[WallSpawn] = sim.addBox({skin:GoalPlatform400Vert, height:(400 / 30), width:(10 / 30), density:0, x:(70 / 30), y:(430 / 30), allowSleep:true, fixedRotation:true, draggable:false});
Walls[WallSpawn].userData.name = "Wall7";
WallSpawn++;
};
};
};
if ((((OffenseCurrLevel == 1)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
Enemy[EnemyNum] = sim.addBox({skin:EnemyGlock, width:(66 / 30), height:(31.9 / 30), density:0, x:(60 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
Enemy[EnemyNum].userData.scaleX = (Enemy[EnemyNum].userData.scaleX * -1);
Enemy[EnemyNum].userData.transform.colorTransform = EnemyTint;
global.EnemyHP[EnemyNum] = 75;
EnemyMove[EnemyNum] = "Enemy1";
EnemyNum++;
EnemyTotal--;
};
};
if ((((OffenseCurrLevel == 2)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
Enemy[EnemyNum] = sim.addBox({skin:EnemyUSP, width:(57.8 / 30), height:(35 / 30), density:0, x:(50 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
Enemy[EnemyNum].userData.scaleX = (Enemy[EnemyNum].userData.scaleX * -1);
Enemy[EnemyNum].userData.transform.colorTransform = EnemyTint;
global.EnemyHP[EnemyNum] = 100;
EnemyMove[EnemyNum] = "Enemy2";
EnemyNum++;
EnemyTotal--;
};
};
if ((((OffenseCurrLevel == 3)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
Enemy[EnemyNum] = sim.addBox({skin:EnemyMP5, width:(88.3 / 30), height:(43.2 / 30), density:0, x:(70 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
Enemy[EnemyNum].userData.scaleX = (Enemy[EnemyNum].userData.scaleX * -1);
Enemy[EnemyNum].userData.transform.colorTransform = EnemyTint;
global.EnemyHP[EnemyNum] = 125;
EnemyMove[EnemyNum] = "Enemy3";
EnemyNum++;
EnemyTotal--;
};
};
if ((((OffenseCurrLevel == 4)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
Enemy[EnemyNum] = sim.addBox({skin:EnemyBerettaSMG, width:(86.6 / 30), height:(37.8 / 30), density:0, x:(50 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
Enemy[EnemyNum].userData.scaleX = (Enemy[EnemyNum].userData.scaleX * -1);
Enemy[EnemyNum].userData.transform.colorTransform = EnemyTint;
global.EnemyHP[EnemyNum] = 150;
EnemyMove[EnemyNum] = "Enemy4";
EnemyNum++;
EnemyTotal--;
};
};
if ((((OffenseCurrLevel == 5)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
Enemy[EnemyNum] = sim.addBox({skin:EnemyM1A, width:(164.3 / 30), height:(35.5 / 30), density:0, x:(90 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
Enemy[EnemyNum].userData.scaleX = (Enemy[EnemyNum].userData.scaleX * -1);
Enemy[EnemyNum].userData.transform.colorTransform = EnemyTint;
global.EnemyHP[EnemyNum] = 175;
EnemyMove[EnemyNum] = "Enemy5";
EnemyNum++;
EnemyTotal--;
};
};
if ((((OffenseCurrLevel == 6)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
Enemy[EnemyNum] = sim.addBox({skin:Enemy357Magnum, width:(80 / 30), height:(36 / 30), density:0, x:(60 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
Enemy[EnemyNum].userData.scaleX = (Enemy[EnemyNum].userData.scaleX * -1);
Enemy[EnemyNum].userData.transform.colorTransform = EnemyTint;
global.EnemyHP[EnemyNum] = 225;
EnemyMove[EnemyNum] = "Enemy6";
EnemyNum++;
EnemyTotal--;
};
};
if ((((OffenseCurrLevel == 7)) && ((ChallengeComplete == false)))){
if (EnemyTotal > 0){
Enemy[EnemyNum] = sim.addBox({skin:EnemyP90, width:(78.4 / 30), height:(40.6 / 30), density:0, x:(60 / 30), y:(200 / 30), restitution:0, allowSleep:true, fixedRotation:true, draggable:false});
Enemy[EnemyNum].userData.name = (("Target" + "&") + EnemyNum);
Enemy[EnemyNum].userData.scaleX = (Enemy[EnemyNum].userData.scaleX * -1);
Enemy[EnemyNum].userData.transform.colorTransform = EnemyTint;
global.EnemyHP[EnemyNum] = 250;
EnemyMove[EnemyNum] = "Enemy7";
EnemyNum++;
EnemyTotal--;
};
};
};
};
}
public function CreateTrainingCrates():void{
StackBox = 365;
boxNum = 10;
i = 0;
while (i <= boxNum) {
boxes[i] = sim.addBox({skin:Crate, lineAlpha:1, fillColor:0xCCCCCC, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
boxes[i].userData.name = "Crate";
StackBox = (StackBox - 30);
i++;
};
}
public function FamousFamasRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Famous Famas</B> \n Punt out " + FamousFamasTotal) + " Famas Rounds");
}
public function PlumpmanLinkRollOver(_arg1:MouseEvent){
PlumpmanLink.alpha = 1;
}
public function DefenseLevel4Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
DefenseCurrLevel = 4;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function SkorpionKillerRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function CarbineCrazyRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function checkKeysUp(_arg1:KeyboardEvent):void{
keyArray[_arg1.keyCode] = false;
}
public function VeteranMedalRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function EfficiencyLevel4Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
EfficiencyCurrLevel = 4;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function NoviceMedalRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Novice</B> \n Earn " + NoviceMedalTotal) + " Novice Medals");
}
public function P90PowerRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>P90 Power</B> \n Unleash " + P90PowerTotal) + " P90 Rounds");
}
public function OffenseLevel2Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
OffenseCurrLevel = 2;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function BlueColor(_arg1:MouseEvent){
PlateBGColor = "Blue";
BackgroundColor.gotoAndStop(PlateBGColor);
PlateHolder.CampaignPlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.ChallengePlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.AchievePlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.WeaponPlate.PlateBG.gotoAndStop(PlateBGColor);
PlateHolder.OptionsPlate.PlateBG.gotoAndStop(PlateBGColor);
}
public function visit_Plumpman(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://plumpman.newgrounds.com/");
navigateToURL(_local2, "_blank");
if (MovieClip(root).currentFrame >= 4){
Mouse.hide();
};
}
public function WaltherWaltzRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function GunNewbieRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function JugglerRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function PK2PlayerRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function DoNotPressRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Do not Press</B> \n Please don't press " + DoNotPressTotal) + " buttons...");
}
public function WeaponAutoFire(_arg1:TimerEvent):void{
var _local2:Point;
if ((((((((CeaseFire == true)) || ((Reloaded == false)))) || ((ClipSize <= 0)))) || ((DelayFire == true)))){
} else {
_local2 = Player.localToGlobal(new Point(Player.Launcher.x, Player.Launcher.y));
Player.gotoAndPlay(2);
FireSound.play();
i = 0;
while (i < WeaponType[WeaponNum][29]) {
shells[shellNum] = sim.addBox({x:(_local2.x / 30), y:(_local2.y / 30), width:WeaponType[WeaponNum][2], angle:Math.sin((Player.rotation * (Math.PI / 180))), height:WeaponType[WeaponNum][3], restitution:0, lineAlpha:1, fillColor:WeaponType[WeaponNum][4], allowSleep:true, draggable:false, isBullet:true});
shells[shellNum].userData.name = "Shell";
shells[shellNum].body.ApplyImpulse(new b2Vec2(-(WeaponType[WeaponNum][5]), (((Math.random() * WeaponType[WeaponNum][20]) - (Math.random() * WeaponType[WeaponNum][20])) - Math.sin((Player.rotation * (Math.PI / 180))))), shells[shellNum].body.GetWorldCenter());
if (shellNum > MaxShellNum){
if (shells[(shellNum - (MaxShellNum + 1))].body.m_world != null){
shells[(shellNum - (MaxShellNum + 1))].destroy();
};
};
shellNum++;
i++;
};
if (Player.rotation < WeaponType[WeaponNum][23]){
Player.rotation = (Player.rotation + (WeaponType[WeaponNum][21] - Math.floor((WeaponType[WeaponNum][21] * RecoilReduction))));
if (RecoilRecoveryTimer.running == false){
RecoilRecoveryTimer.start();
};
};
if ((((((WeaponType[WeaponNum][0] == "Riot Shotgun")) || ((WeaponType[WeaponNum][0] == "Spas-12")))) || ((WeaponType[WeaponNum][0] == "Kar 98k")))){
DelayFire = true;
};
if (ClipSize > 0){
ClipSize--;
};
if (ClipSize <= 0){
if (ReloaderCurr < ReloaderTotal){
ReloaderCurr++;
};
if ((((JugglerCurr < JugglerTotal)) && ((((WeaponType[WeaponNum][0] == "USP")) || ((WeaponType[WeaponNum][0] == "Walther PPK")))))){
JugglerCurr++;
};
if (ClipAmount > 0){
ClipAmount--;
};
Reloaded = false;
Player.gotoAndPlay(WeaponType[WeaponNum][19]);
ReloadSound.play(WeaponType[WeaponNum][26], WeaponType[WeaponNum][27]);
};
AchievementCheck();
};
}
public function LowQuality(_arg1:MouseEvent){
stage.quality = "low";
MovieQuality = "low";
}
public function StartSkill(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Skill";
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function AchieveMenu(_arg1:MouseEvent){
if (((((!(global.PlateMoving)) && (!(global.ScrollerMoving)))) && (!((CurrentPlate == "Achievements"))))){
global.PlateMoving = true;
PlateX = 275;
PlateTween();
CurrentPlate = "Achievements";
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function visit_TheGunGame(_arg1:Event){
if (MovieClip(root).currentFrame >= 4){
Mouse.hide();
};
}
public function AchievementCheck():void{
if (WeaponType[WeaponNum][0] == "Glock"){
if (GlockCrewCurr < GlockCrewTotal){
GlockCrewCurr++;
};
};
if (WeaponType[WeaponNum][0] == "Micro Uzi"){
if (UziDaddyCurr < UziDaddyTotal){
UziDaddyCurr++;
};
};
if (WeaponType[WeaponNum][0] == "MP5"){
if (MP5JockeyCurr < MP5JockeyTotal){
MP5JockeyCurr++;
};
};
if (WeaponType[WeaponNum][0] == "Skorpion"){
if (SkorpionKillerCurr < SkorpionKillerTotal){
SkorpionKillerCurr++;
};
};
if (WeaponType[WeaponNum][0] == ".357 Magnum"){
if (MagnumMasterCurr < MagnumMasterTotal){
MagnumMasterCurr++;
};
};
if (WeaponType[WeaponNum][0] == "USP"){
if (USPNinjaCurr < USPNinjaTotal){
USPNinjaCurr++;
};
};
if (WeaponType[WeaponNum][0] == "Riot Shotgun"){
if (RiotPoliceCurr < RiotPoliceTotal){
RiotPoliceCurr++;
};
};
if (WeaponType[WeaponNum][0] == "Beretta PM-12"){
if (BerettaBeastCurr < BerettaBeastTotal){
BerettaBeastCurr++;
};
};
if (WeaponType[WeaponNum][0] == "M4 Carbine"){
if (CarbineCrazyCurr < CarbineCrazyTotal){
CarbineCrazyCurr++;
};
};
if (WeaponType[WeaponNum][0] == "SMG-PK2"){
if (PK2PlayerCurr < PK2PlayerTotal){
PK2PlayerCurr++;
};
};
if (WeaponType[WeaponNum][0] == "M1A Rifle"){
if (M1AMartyrCurr < M1AMartyrTotal){
M1AMartyrCurr++;
};
};
if (WeaponType[WeaponNum][0] == "Desert Eagle"){
if (DudeDeagleCurr < DudeDeagleTotal){
DudeDeagleCurr++;
};
};
if (WeaponType[WeaponNum][0] == "Walther PPK"){
if (WaltherWaltzCurr < WaltherWaltzTotal){
WaltherWaltzCurr++;
};
};
if (WeaponType[WeaponNum][0] == "Luger"){
if (LugerLoveCurr < LugerLoveTotal){
LugerLoveCurr++;
};
};
if (WeaponType[WeaponNum][0] == "P90"){
if (P90PowerCurr < P90PowerTotal){
P90PowerCurr++;
};
};
if (WeaponType[WeaponNum][0] == "Spas-12"){
if (SpasOfSpadesCurr < SpasOfSpadesTotal){
SpasOfSpadesCurr++;
};
};
if (WeaponType[WeaponNum][0] == "Famas"){
if (FamousFamasCurr < FamousFamasTotal){
FamousFamasCurr++;
};
};
if (WeaponType[WeaponNum][0] == "Kar 98k"){
if (Kar98kRunCurr < Kar98kRunTotal){
Kar98kRunCurr++;
};
};
if (WeaponType[WeaponNum][0] == "Peacemaker"){
if (PiecemakerCurr < PiecemakerTotal){
PiecemakerCurr++;
};
};
}
public function StartTraining(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Training";
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function PiecemakerRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Piecemaker</B> \n Send " + PiecemakerTotal) + " Peacemaker Rounds to the Grave");
}
public function USPNinjaRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>USP Ninja</B> \n Sling " + USPNinjaTotal) + " USP Rounds");
}
public function ResetSave(_arg1:MouseEvent){
SaveFile.clear();
removeChild(Cursor);
Mouse.show();
stage.removeEventListener(MouseEvent.MOUSE_DOWN, HideMouse);
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
gotoAndPlay(2);
}
public function StartAccuracy(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Accuracy";
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function GreenColorUnlockRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function Mute_Sound(_arg1:Event){
SoundMixer.soundTransform = MuteTransform;
if (MovieClip(root).currentFrame >= 4){
Mouse.hide();
};
}
public function EfficiencyLevel5Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
EfficiencyCurrLevel = 5;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function DefenseLevel5Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
DefenseCurrLevel = 5;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function StartGame(_arg1:MouseEvent){
gotoAndPlay("Sponsor");
}
public function AccuracyChallenge(_arg1:TimerEvent):void{
if (TargetNumAccuracy < WeaponType[WeaponNum][7]){
AccuracyTargets[TargetNumAccuracy] = sim.addCircle({skin:Target, lineAlpha:1, fillColor:0xCCCCCC, mass:1, radius:WeaponType[WeaponNum][9], x:(50 / 30), y:(((Math.random() * 250) + 50) / 30), restitution:0, isSleeping:true, allowSleep:true, fixedRotation:false, draggable:false});
AccuracyTargets[TargetNumAccuracy].userData.name = (("Target" + "&") + TargetNumAccuracy);
if ((((TargetNumAccuracy >= 1)) && ((TargetHitAccuracy == false)))){
AccuracyTargets[(TargetNumAccuracy - 1)].destroy();
TargetsMissed++;
};
TargetHitAccuracy = false;
TargetNumAccuracy++;
} else {
if (TargetHitAccuracy == false){
AccuracyTargets[(TargetNumAccuracy - 1)].destroy();
TargetsMissed++;
};
WeaponTimer.reset();
RecoilRecoveryTimer.reset();
RangeLimitZone.alpha = 0;
TrainingText.htmlText = "";
AccuracyChallengeTimer.reset();
ChallengeComplete = true;
AccuracyHolder.gotoAndPlay(2);
if (global.TargetsHit > WeaponType[WeaponNum][10]){
WeaponType[WeaponNum][10] = global.TargetsHit;
if (WeaponType[WeaponNum][10] >= (WeaponType[WeaponNum][7] * 0.9)){
if (WeaponType[WeaponNum][11] == "Veteran"){
WeaponType[WeaponNum][11] = "Expert";
ExpertMedalCurr++;
} else {
if (WeaponType[WeaponNum][11] == "Novice"){
WeaponType[WeaponNum][11] = "Expert";
ExpertMedalCurr++;
VeteranMedalCurr++;
} else {
if (WeaponType[WeaponNum][11] == "None"){
WeaponType[WeaponNum][11] = "Expert";
ExpertMedalCurr++;
VeteranMedalCurr++;
NoviceMedalCurr++;
};
};
};
} else {
if (WeaponType[WeaponNum][10] >= Math.round((WeaponType[WeaponNum][7] * 0.7))){
if (WeaponType[WeaponNum][11] == "Novice"){
WeaponType[WeaponNum][11] = "Veteran";
VeteranMedalCurr++;
} else {
if (WeaponType[WeaponNum][11] == "None"){
WeaponType[WeaponNum][11] = "Veteran";
VeteranMedalCurr++;
NoviceMedalCurr++;
};
};
} else {
if (WeaponType[WeaponNum][10] >= Math.round((WeaponType[WeaponNum][7] * 0.35))){
if (WeaponType[WeaponNum][11] == "None"){
WeaponType[WeaponNum][11] = "Novice";
NoviceMedalCurr++;
};
} else {
WeaponType[WeaponNum][11] = "None";
};
};
};
};
AccuracyHolder.AccuracyPlate.TargetHitInfo.htmlText = ("<B>Targets Hit: </B>" + global.TargetsHit);
AccuracyHolder.AccuracyPlate.TargetMissInfo.htmlText = ("<B>Targets Missed: </B>" + (WeaponType[WeaponNum][7] - global.TargetsHit));
AccuracyHolder.AccuracyPlate.MedalInfo.htmlText = ("<B>Best Medal: </B>" + WeaponType[WeaponNum][11]);
AccuracyHolder.AccuracyPlate.AccuracyMedal.gotoAndStop(WeaponType[WeaponNum][11]);
};
}
public function MP5JockeyRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>MP5 Jockey</B> \n Shoot " + MP5JockeyTotal) + " MP5 Bullets");
}
public function PlumpmanLinkRollOutBig(_arg1:MouseEvent){
PlateHolder.OptionsPlate.PlumpmanLinkBig.alpha = 0.75;
}
public function PlumpmanLinkVisitBig(_arg1:MouseEvent){
var _local2:URLRequest;
_local2 = new URLRequest("http://plumpman.newgrounds.com/");
navigateToURL(_local2, "_blank");
}
public function HighBullets(_arg1:MouseEvent){
MaxShellNum = 30;
}
public function OffenseLevel3Start(_arg1:MouseEvent){
if (global.PlateMoving == false){
stage.removeEventListener(Event.ENTER_FRAME, MenuSystem);
PlateHolder.AchievePlate.sb.scrollbarOff();
removeChild(Cursor);
removeChild(Slot1Weapon);
removeChild(Slot2Weapon);
removeChild(Slot3Weapon);
GameType = "Campaign";
OffenseCurrLevel = 3;
gotoAndStop("Game");
if (DoNotPressCurr < DoNotPressTotal){
DoNotPressCurr++;
};
};
}
public function ChazLinkVisit(_arg1:MouseEvent){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.flashchaz.com/");
navigateToURL(_local2, "_blank");
}
public function SponsorLinkVisit(_arg1:MouseEvent){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.bored.com/");
navigateToURL(_local2, "_blank");
}
public function ChazLinkRollOver(_arg1:MouseEvent){
ChazLink.alpha = 1;
}
public function LugerLoveRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function GlockCrewRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function MediumQuality(_arg1:MouseEvent){
stage.quality = "medium";
MovieQuality = "medium";
}
public function JugglerRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Juggler</B> \n Flip a Gun " + JugglerTotal) + " Times");
}
public function GunAddictRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function RiotPoliceRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Riot Police</B> \n Expend " + RiotPoliceTotal) + " Riot Shotgun Shells");
}
public function MagnumMasterRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = (("<B>Magnum Master</B> \n Let Fly " + MagnumMasterTotal) + " .357 Magnum Shells");
}
public function StartSkillGame():void{
if (WeaponNum == 1){
StackSkillBox = 270;
GoalPlatform1 = sim.addBox({skin:GoalPlatform250, x:(230 / 30), y:(300 / 30), width:(250 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 4) {
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(125 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
StackSkillBox = (StackSkillBox - 30);
i++;
};
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(125 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
};
if (WeaponNum == 2){
StackSkillBox = 375;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100, x:(120 / 30), y:(300 / 30), width:(80 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 9) {
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(200 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
StackSkillBox = (StackSkillBox - 30);
i++;
};
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(200 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
};
if (WeaponNum == 3){
StackSkillBox = 375;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100, x:(270 / 30), y:(300 / 30), width:(80 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
GoalPlatform2 = sim.addBox({skin:GoalPlatform100Vert, x:(305 / 30), y:(265 / 30), width:(10 / 30), height:(60 / 30), density:0});
GoalPlatform2.userData.name = "GoalPlatform";
i = 0;
while (i < 11) {
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
StackSkillBox = (StackSkillBox - 30);
i++;
};
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
};
if (WeaponNum == 4){
StackSkillBox = 375;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100, x:(180 / 30), y:(380 / 30), width:(80 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
GoalPlatform2 = sim.addBox({skin:GoalPlatform100Vert, x:(215 / 30), y:(315 / 30), width:(10 / 30), height:(140 / 30), density:0});
GoalPlatform2.userData.name = "GoalPlatform";
i = 0;
while (i < 10) {
if (i == 7){
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(600 / 30), y:(600 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
};
if (WeaponNum == 5){
StackSkillBox = 375;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100Vert, x:(20 / 30), y:(345 / 30), width:(10 / 30), height:(80 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 6) {
if (i < 4){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(150 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
StackSkillBox = (StackSkillBox + 50);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
};
if (WeaponNum == 6){
StackSkillBox = 360;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100, x:(80 / 30), y:(380 / 30), width:(60 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 9) {
if (i < 6){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(150 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
StackSkillBox = (StackSkillBox + 55);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
};
if (WeaponNum == 7){
StackSkillBox = 360;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100Vert, x:(70 / 30), y:(365 / 30), width:(10 / 30), height:(40 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 12) {
if (i == 10){
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(150 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(600 / 30), y:(600 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 6){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(200 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
StackSkillBox = (StackSkillBox + 55);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(150 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
};
if (WeaponNum == 8){
StackSkillBox = 360;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100, x:(180 / 30), y:(380 / 30), width:(100 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 7) {
if (i == 4){
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(600 / 30), y:(600 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 3){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(60 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
StackSkillBox = (StackSkillBox + 55);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
};
if (WeaponNum == 9){
StackSkillBox = 360;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100, x:(70 / 30), y:(200 / 30), width:(100 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 10) {
if (i == 8){
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(250 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(600 / 30), y:(600 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(250 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
};
if (WeaponNum == 10){
StackSkillBox = 375;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100, x:(180 / 30), y:(150 / 30), width:(80 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
GoalPlatform2 = sim.addBox({skin:GoalPlatform100Vert, x:(215 / 30), y:(85 / 30), width:(10 / 30), height:(140 / 30), density:0});
GoalPlatform2.userData.name = "GoalPlatform";
i = 0;
while (i < 10) {
if (i == 9){
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(600 / 30), y:(600 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
};
if (WeaponNum == 11){
StackSkillBox = 375;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100, x:(250 / 30), y:(325 / 30), width:(80 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 12) {
if (i == 5){
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(600 / 30), y:(600 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 4){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 8){
StackSkillBox = (StackSkillBox + 55);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(140 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
StackSkillBox = (StackSkillBox + 55);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(180 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
};
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
};
if (WeaponNum == 12){
StackSkillBox = 330;
GoalPlatform1 = sim.addBox({skin:GoalPlatform250, x:(150 / 30), y:(350 / 30), width:(250 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 15) {
if (i == 3){
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(600 / 30), y:(600 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 3){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(40 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 6){
StackSkillBox = (StackSkillBox + 55);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(100 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 9){
StackSkillBox = (StackSkillBox + 45);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(160 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 12){
StackSkillBox = (StackSkillBox + 25);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(200 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
StackSkillBox = (StackSkillBox + 25);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(240 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
};
};
};
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
};
if (WeaponNum == 13){
StackSkillBox = 270;
GoalPlatform1 = sim.addBox({skin:GoalPlatform250, x:(150 / 30), y:(300 / 30), width:(150 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 6) {
if (i == 2){
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(150 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(600 / 30), y:(600 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 3){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(150 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 4){
StackSkillBox = (StackSkillBox + 55);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(115 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 5){
StackSkillBox = (StackSkillBox + 45);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(185 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
};
};
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
};
if (WeaponNum == 14){
StackSkillBox = 270;
GoalPlatform1 = sim.addBox({skin:GoalPlatform250, x:(170 / 30), y:(300 / 30), width:(200 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 8) {
if (i == 2){
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(165 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(600 / 30), y:(600 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 3){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(165 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 4){
StackSkillBox = (StackSkillBox + 55);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(133 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
StackSkillBox = (StackSkillBox + 45);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(240 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
};
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
};
if (WeaponNum == 15){
StackSkillBox = 370;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100Vert, x:(55 / 30), y:(330 / 30), width:(10 / 30), height:(100 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 9) {
if (i < 8){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(165 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 9){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(55 / 30), y:(260 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(55 / 30), y:(230 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
};
if (WeaponNum == 16){
StackSkillBox = 370;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100Vert, x:(50 / 30), y:(330 / 30), width:(10 / 30), height:(100 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 9) {
if (i < 4){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(180 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 8){
StackSkillBox = (StackSkillBox + 45);
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(140 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
} else {
if (i < 9){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(100 / 30), y:(360 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
};
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(100 / 30), y:(330 / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
};
if (WeaponNum == 17){
StackSkillBox = 325;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100, x:(120 / 30), y:(350 / 30), width:(80 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 8) {
if (i < 8){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(140 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(140 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
};
if (WeaponNum == 18){
StackSkillBox = 355;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100, x:(120 / 30), y:(350 / 30), width:(40 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 8) {
if (i < 8){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(180 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(180 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
};
if (WeaponNum == 19){
StackSkillBox = 355;
GoalPlatform1 = sim.addBox({skin:GoalPlatform100, x:(180 / 30), y:(350 / 30), width:(60 / 30), height:(10 / 30), density:0});
GoalPlatform1.userData.name = "GoalPlatform";
i = 0;
while (i < 6) {
if (i < 6){
SkillBoxes[i] = sim.addBox({skin:Crate, mass:0.2, width:1, height:1, x:(120 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
SkillBoxes[i].userData.name = "Crate";
};
StackSkillBox = (StackSkillBox - 30);
i++;
};
GoalCrate = sim.addBox({skin:GreenCrate, mass:0.2, width:1, height:1, x:(120 / 30), y:(StackSkillBox / 30), restitution:0, isSleeping:false, allowSleep:true, fixedRotation:false, draggable:false});
GoalCrate.userData.name = "GoalCrate";
};
}
public function EnemyTintTime(_arg1:TimerEvent):void{
global.Shape1Sprite.transform.colorTransform = EnemyTint;
EnemyTintTimer.reset();
}
public function SkeletonHandUnlockRollOver(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 100;
Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Skeleton</B> \n Complete the 'Target Hater' Achievement.";
}
public function keyisdown(_arg1:Number):Boolean{
return (keyArray[_arg1]);
}
public function UziDaddyRollOut(_arg1:MouseEvent){
Cursor.AchievementPlate.alpha = 0;
Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
}
}//package TheGunGame_Final_Bored_fla
Section 118
//OptionsPlate_135 (TheGunGame_Final_Bored_fla.OptionsPlate_135)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class OptionsPlate_135 extends MovieClip {
public var SponsorLink:MovieClip;
public var LowQualityButton:SimpleButton;
public var ChazLinkBig:MovieClip;
public var RedColorButton:SimpleButton;
public var WhiteHandButton:SimpleButton;
public var LowBulletsButton:SimpleButton;
public var MediumQualityButton:SimpleButton;
public var HighQualityButton:SimpleButton;
public var PlatinumColorButton:SimpleButton;
public var GreenColorButton:SimpleButton;
public var GreenColorLock:SimpleButton;
public var HighBulletsButton:SimpleButton;
public var PlumpmanLinkBig:MovieClip;
public var ResetSaveButton:SimpleButton;
public var BlueColorButton:SimpleButton;
public var PlatinumColorLock:SimpleButton;
public var PlateBG:MovieClip;
public var RedColorLock:SimpleButton;
public var SkeletonHandLock:SimpleButton;
public var BlackHandButton:SimpleButton;
public var MediumBulletsButton:SimpleButton;
public var SkeletonHandButton:SimpleButton;
public function OptionsPlate_135(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 119
//PlateBG_17 (TheGunGame_Final_Bored_fla.PlateBG_17)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class PlateBG_17 extends MovieClip {
public function PlateBG_17(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 120
//PlateHolder_15 (TheGunGame_Final_Bored_fla.PlateHolder_15)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class PlateHolder_15 extends MovieClip {
public var OptionsPlate:MovieClip;
public var AchievePlate:MovieClip;
public var ChallengePlate:MovieClip;
public var WeaponPlate:MovieClip;
public var CampaignPlate:MovieClip;
public function PlateHolder_15(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 121
//PreciseReloadHand_62 (TheGunGame_Final_Bored_fla.PreciseReloadHand_62)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class PreciseReloadHand_62 extends MovieClip {
public function PreciseReloadHand_62(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 122
//PreloaderTip_6 (TheGunGame_Final_Bored_fla.PreloaderTip_6)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class PreloaderTip_6 extends MovieClip {
public function PreloaderTip_6(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 123
//ProgressBar_25 (TheGunGame_Final_Bored_fla.ProgressBar_25)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
import flash.text.*;
public dynamic class ProgressBar_25 extends MovieClip {
public var ProgressBarInfo:TextField;
public function ProgressBar_25(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 124
//PumpHand_104 (TheGunGame_Final_Bored_fla.PumpHand_104)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class PumpHand_104 extends MovieClip {
public function PumpHand_104(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 125
//ReloadHand_37 (TheGunGame_Final_Bored_fla.ReloadHand_37)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class ReloadHand_37 extends MovieClip {
public function ReloadHand_37(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 126
//SkillHolder_202 (TheGunGame_Final_Bored_fla.SkillHolder_202)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class SkillHolder_202 extends MovieClip {
public var SkillPlate:MovieClip;
public function SkillHolder_202(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 127
//SkillPlate_203 (TheGunGame_Final_Bored_fla.SkillPlate_203)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SkillPlate_203 extends MovieClip {
public var SkillMissInfo:TextField;
public var MedalInfo:TextField;
public var SkillHitInfo:TextField;
public var SkillMedal:MovieClip;
public var PlateBG:MovieClip;
}
}//package TheGunGame_Final_Bored_fla
Section 128
//SmallFrontHand_43 (TheGunGame_Final_Bored_fla.SmallFrontHand_43)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class SmallFrontHand_43 extends MovieClip {
public function SmallFrontHand_43(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 129
//SoundPreloader_175 (TheGunGame_Final_Bored_fla.SoundPreloader_175)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class SoundPreloader_175 extends MovieClip {
public function SoundPreloader_175(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 130
//SpeedHolder_205 (TheGunGame_Final_Bored_fla.SpeedHolder_205)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class SpeedHolder_205 extends MovieClip {
public var SpeedPlate:MovieClip;
public function SpeedHolder_205(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 131
//SpeedPlate_206 (TheGunGame_Final_Bored_fla.SpeedPlate_206)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SpeedPlate_206 extends MovieClip {
public var SpeedMedal:MovieClip;
public var MedalInfo:TextField;
public var TimeHitInfo:TextField;
public var PlateBG:MovieClip;
public var TimeMissInfo:TextField;
}
}//package TheGunGame_Final_Bored_fla
Section 132
//TargetGraphic_166 (TheGunGame_Final_Bored_fla.TargetGraphic_166)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
import flash.text.*;
public dynamic class TargetGraphic_166 extends MovieClip {
public var TargetHP:TextField;
public function TargetGraphic_166(){
addFrameScript(0, frame1, 45, frame46);
}
function frame1(){
stop();
}
function frame46(){
this.parent.removeChild(this);
}
}
}//package TheGunGame_Final_Bored_fla
Section 133
//ThumbHand_94 (TheGunGame_Final_Bored_fla.ThumbHand_94)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class ThumbHand_94 extends MovieClip {
public function ThumbHand_94(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 134
//TutorialHelper_211 (TheGunGame_Final_Bored_fla.TutorialHelper_211)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class TutorialHelper_211 extends MovieClip {
public var TutorialPlate:MovieClip;
}
}//package TheGunGame_Final_Bored_fla
Section 135
//TutorialPlate_212 (TheGunGame_Final_Bored_fla.TutorialPlate_212)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
import flash.text.*;
public dynamic class TutorialPlate_212 extends MovieClip {
public var TutorialInfo:TextField;
}
}//package TheGunGame_Final_Bored_fla
Section 136
//WeaponCategory_30 (TheGunGame_Final_Bored_fla.WeaponCategory_30)
package TheGunGame_Final_Bored_fla {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class WeaponCategory_30 extends MovieClip {
public var Slot1StarRiotShotgun:SimpleButton;
public var Slot2StarDeagle:SimpleButton;
public var Slot1StarWaltherPPK:SimpleButton;
public var Slot3StarBerettaSMG:SimpleButton;
public var Slot1StarMP5:SimpleButton;
public var Slot2StarFamas:SimpleButton;
public var Slot1StarSkorpion:SimpleButton;
public var Slot2StarUzi:SimpleButton;
public var MP5Graphic:MP5;
public var SMGPK2Graphic:SMGPK2;
public var Slot3StarUSP:SimpleButton;
public var Slot3StarSpas12:SimpleButton;
public var WaltherPPKGraphic:WaltherPPK;
public var Slot3StarM1ARifle:SimpleButton;
public var Slot2StarWaltherPPK:SimpleButton;
public var SkorpionLock:SimpleButton;
public var Slot3StarP90:SimpleButton;
public var Slot1StarGlock:SimpleButton;
public var Slot1StarSMGPK2:SimpleButton;
public var Slot2StarSpas12:SimpleButton;
public var Slot2Star357Magnum:SimpleButton;
public var Slot3StarKar98k:SimpleButton;
public var Slot2StarLuger:SimpleButton;
public var DeagleGraphic:Deagle;
public var Slot1StarP90:SimpleButton;
public var GlockGraphic:Glock;
public var Slot1Star357Magnum:SimpleButton;
public var Slot3StarGlock:SimpleButton;
public var Slot1StarUSP:SimpleButton;
public var Slot3StarWaltherPPK:SimpleButton;
public var Slot2StarSkorpion:SimpleButton;
public var Slot3StarM4Carbine:SimpleButton;
public var Slot3StarDeagle:SimpleButton;
public var WaltherPPKLock:SimpleButton;
public var Slot1StarSpas12:SimpleButton;
public var LugerLock:SimpleButton;
public var Kar98kGraphic:Kar98k;
public var M1ARifleGraphic:M1A;
public var Slot2StarMP5:SimpleButton;
public var Slot1StarKar98k:SimpleButton;
public var Spas12Graphic:Spas12;
public var PeacemakerLock:SimpleButton;
public var Slot2StarM4Carbine:SimpleButton;
public var Slot1StarFamas:SimpleButton;
public var SkorpionGraphic:Skorpion;
public var Slot2StarSMGPK2:SimpleButton;
public var Spas12Lock:SimpleButton;
public var Slot3StarUzi:SimpleButton;
public var USPGraphic:USP;
public var P90Lock:SimpleButton;
public var Slot3StarSkorpion:SimpleButton;
public var Kar98kLock:SimpleButton;
public var Slot3StarFamas:SimpleButton;
public var MagnumLock:SimpleButton;
public var Slot1StarPeacemaker:SimpleButton;
public var Slot1StarDeagle:SimpleButton;
public var BerettaSMGLock:SimpleButton;
public var Slot1StarM1ARifle:SimpleButton;
public var PeacemakerGraphic:Peacemaker;
public var LugerGraphic:Luger;
public var Slot1StarUzi:SimpleButton;
public var Slot1StarM4Carbine:SimpleButton;
public var Slot1StarLuger:SimpleButton;
public var Slot2StarP90:SimpleButton;
public var Slot2StarUSP:SimpleButton;
public var Slot2StarPeacemaker:SimpleButton;
public var P90Graphic:P90;
public var Slot2StarGlock:SimpleButton;
public var Slot1StarBerettaSMG:SimpleButton;
public var DeagleLock:SimpleButton;
public var BerettaSMGGraphic:BerettaSMG;
public var SMGPK2Lock:SimpleButton;
public var FamasGraphic:Famas;
public var MicroUziGraphic:MicroUzi;
public var RiotShotgunGraphic:RiotShotgun;
public var Slot3StarLuger:SimpleButton;
public var Slot2StarKar98k:SimpleButton;
public var Slot3StarPeacemaker:SimpleButton;
public var Slot3StarRiotShotgun:SimpleButton;
public var Slot2StarBerettaSMG:SimpleButton;
public var Slot3StarSMGPK2:SimpleButton;
public var Slot3StarMP5:SimpleButton;
public var M4CarbineGraphic:M4Carbine;
public var Slot2StarM1ARifle:SimpleButton;
public var Slot3Star357Magnum:SimpleButton;
public var Slot2StarRiotShotgun:SimpleButton;
public var FamasLock:SimpleButton;
public var MagnumGraphic:Magnum;
public function WeaponCategory_30(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
public function Spas12Slot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 16))) && (!((MovieClip(root).Slot2 == 16))))) && (!((MovieClip(root).Slot3 == 16))))){
MovieClip(root).Slot1 = 16;
MovieClip(root).WeaponNum = 16;
MovieClip(root).ActiveSlot = 1;
StarRefreshShotgun();
};
}
public function Spas12Slot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 16))) && (!((MovieClip(root).Slot2 == 16))))) && (!((MovieClip(root).Slot3 == 16))))){
MovieClip(root).Slot2 = 16;
MovieClip(root).WeaponNum = 16;
MovieClip(root).ActiveSlot = 2;
StarRefreshShotgun();
};
}
public function UziSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 2))) && (!((MovieClip(root).Slot2 == 2))))) && (!((MovieClip(root).Slot3 == 2))))){
MovieClip(root).Slot1 = 2;
MovieClip(root).WeaponNum = 2;
MovieClip(root).ActiveSlot = 1;
StarRefreshSMG();
};
}
public function BerettaSMGSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 8))) && (!((MovieClip(root).Slot2 == 8))))) && (!((MovieClip(root).Slot3 == 8))))){
MovieClip(root).Slot3 = 8;
MovieClip(root).WeaponNum = 8;
MovieClip(root).ActiveSlot = 3;
StarRefreshSMG();
};
}
public function UziSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 2))) && (!((MovieClip(root).Slot2 == 2))))) && (!((MovieClip(root).Slot3 == 2))))){
MovieClip(root).Slot3 = 2;
MovieClip(root).WeaponNum = 2;
MovieClip(root).ActiveSlot = 3;
StarRefreshSMG();
};
}
public function Spas12Slot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 16))) && (!((MovieClip(root).Slot2 == 16))))) && (!((MovieClip(root).Slot3 == 16))))){
MovieClip(root).Slot3 = 16;
MovieClip(root).WeaponNum = 16;
MovieClip(root).ActiveSlot = 3;
StarRefreshShotgun();
};
}
public function MP5Slot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 3))) && (!((MovieClip(root).Slot2 == 3))))) && (!((MovieClip(root).Slot3 == 3))))){
MovieClip(root).Slot3 = 3;
MovieClip(root).WeaponNum = 3;
MovieClip(root).ActiveSlot = 3;
StarRefreshSMG();
};
}
public function UziSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 2))) && (!((MovieClip(root).Slot2 == 2))))) && (!((MovieClip(root).Slot3 == 2))))){
MovieClip(root).Slot2 = 2;
MovieClip(root).WeaponNum = 2;
MovieClip(root).ActiveSlot = 2;
StarRefreshSMG();
};
}
public function MP5Slot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 3))) && (!((MovieClip(root).Slot2 == 3))))) && (!((MovieClip(root).Slot3 == 3))))){
MovieClip(root).Slot2 = 3;
MovieClip(root).WeaponNum = 3;
MovieClip(root).ActiveSlot = 2;
StarRefreshSMG();
};
}
public function RiotShotgunSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 7))) && (!((MovieClip(root).Slot2 == 7))))) && (!((MovieClip(root).Slot3 == 7))))){
MovieClip(root).Slot3 = 7;
MovieClip(root).WeaponNum = 7;
MovieClip(root).ActiveSlot = 3;
StarRefreshShotgun();
};
}
public function MP5Slot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 3))) && (!((MovieClip(root).Slot2 == 3))))) && (!((MovieClip(root).Slot3 == 3))))){
MovieClip(root).Slot1 = 3;
MovieClip(root).WeaponNum = 3;
MovieClip(root).ActiveSlot = 1;
StarRefreshSMG();
};
}
public function M4CarbineSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 9))) && (!((MovieClip(root).Slot2 == 9))))) && (!((MovieClip(root).Slot3 == 9))))){
MovieClip(root).Slot3 = 9;
MovieClip(root).WeaponNum = 9;
MovieClip(root).ActiveSlot = 3;
StarRefreshAssaultRifle();
};
}
public function BerettaSMGSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 8))) && (!((MovieClip(root).Slot2 == 8))))) && (!((MovieClip(root).Slot3 == 8))))){
MovieClip(root).Slot1 = 8;
MovieClip(root).WeaponNum = 8;
MovieClip(root).ActiveSlot = 1;
StarRefreshSMG();
};
}
public function BerettaSMGSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 8))) && (!((MovieClip(root).Slot2 == 8))))) && (!((MovieClip(root).Slot3 == 8))))){
MovieClip(root).Slot2 = 8;
MovieClip(root).WeaponNum = 8;
MovieClip(root).ActiveSlot = 2;
StarRefreshSMG();
};
}
public function M4CarbineSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 9))) && (!((MovieClip(root).Slot2 == 9))))) && (!((MovieClip(root).Slot3 == 9))))){
MovieClip(root).Slot1 = 9;
MovieClip(root).WeaponNum = 9;
MovieClip(root).ActiveSlot = 1;
StarRefreshAssaultRifle();
};
}
public function FamasUnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Famas</B> \n Complete the 'Carbine Crazy' Achievement.";
}
public function SMGPK2UnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>SMG-PK2</B> \n Get Expert on all Skorpion Challenges.";
}
public function MagnumSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 5))) && (!((MovieClip(root).Slot2 == 5))))) && (!((MovieClip(root).Slot3 == 5))))){
MovieClip(root).Slot2 = 5;
MovieClip(root).WeaponNum = 5;
MovieClip(root).ActiveSlot = 2;
StarRefreshRevolver();
};
}
public function RiotShotgunSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 7))) && (!((MovieClip(root).Slot2 == 7))))) && (!((MovieClip(root).Slot3 == 7))))){
MovieClip(root).Slot2 = 7;
MovieClip(root).WeaponNum = 7;
MovieClip(root).ActiveSlot = 2;
StarRefreshShotgun();
};
}
public function StarRefreshRifle():void{
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 11){
getChildByName((("Slot" + MovieClip(root).i) + "StarM1ARifle")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarM1ARifle")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 18){
getChildByName((("Slot" + MovieClip(root).i) + "StarKar98k")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarKar98k")).alpha = 0.5;
};
MovieClip(root).i++;
};
}
public function Spas12UnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function LugerUnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function LugerUnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Luger</B> \n Get Expert on all Deagle Challenges.";
}
function frame4(){
stop();
StarRefreshRifle();
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarM1ARifle")).addEventListener(MouseEvent.CLICK, this[("M1ARifleSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
if (MovieClip(root).Kar98kUnlocked == false){
Kar98kGraphic.alpha = 0.25;
Kar98kLock.alpha = 1;
Slot1StarKar98k.enabled = false;
Slot2StarKar98k.enabled = false;
Slot3StarKar98k.enabled = false;
} else {
Kar98kGraphic.alpha = 1;
Kar98kLock.alpha = 0;
Kar98kLock.mouseEnabled = false;
Slot1StarKar98k.enabled = true;
Slot2StarKar98k.enabled = true;
Slot3StarKar98k.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarKar98k")).addEventListener(MouseEvent.CLICK, this[("Kar98kSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
Kar98kLock.addEventListener(MouseEvent.ROLL_OVER, Kar98kUnlockRollOver);
Kar98kLock.addEventListener(MouseEvent.ROLL_OUT, Kar98kUnlockRollOut);
}
function frame1(){
stop();
StarRefreshPistol();
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarGlock")).addEventListener(MouseEvent.CLICK, this[("GlockSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarUSP")).addEventListener(MouseEvent.CLICK, this[("USPSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
if (MovieClip(root).DeagleUnlocked == false){
DeagleGraphic.alpha = 0.25;
DeagleLock.alpha = 1;
Slot1StarDeagle.enabled = false;
Slot2StarDeagle.enabled = false;
Slot3StarDeagle.enabled = false;
} else {
DeagleGraphic.alpha = 1;
DeagleLock.alpha = 0;
DeagleLock.mouseEnabled = false;
Slot1StarDeagle.enabled = true;
Slot2StarDeagle.enabled = true;
Slot3StarDeagle.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarDeagle")).addEventListener(MouseEvent.CLICK, this[("DeagleSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
if (MovieClip(root).WaltherPPKUnlocked == false){
WaltherPPKGraphic.alpha = 0.25;
WaltherPPKLock.alpha = 1;
Slot1StarWaltherPPK.enabled = false;
Slot2StarWaltherPPK.enabled = false;
Slot3StarWaltherPPK.enabled = false;
} else {
WaltherPPKGraphic.alpha = 1;
WaltherPPKLock.alpha = 0;
WaltherPPKLock.mouseEnabled = false;
Slot1StarWaltherPPK.enabled = true;
Slot2StarWaltherPPK.enabled = true;
Slot3StarWaltherPPK.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarWaltherPPK")).addEventListener(MouseEvent.CLICK, this[("WaltherPPKSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
if (MovieClip(root).LugerUnlocked == false){
LugerGraphic.alpha = 0.25;
LugerLock.alpha = 1;
Slot1StarLuger.enabled = false;
Slot2StarLuger.enabled = false;
Slot3StarLuger.enabled = false;
} else {
LugerGraphic.alpha = 1;
LugerLock.alpha = 0;
LugerLock.mouseEnabled = false;
Slot1StarLuger.enabled = true;
Slot2StarLuger.enabled = true;
Slot3StarLuger.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarLuger")).addEventListener(MouseEvent.CLICK, this[("LugerSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
DeagleLock.addEventListener(MouseEvent.ROLL_OVER, DeagleUnlockRollOver);
DeagleLock.addEventListener(MouseEvent.ROLL_OUT, DeagleUnlockRollOut);
WaltherPPKLock.addEventListener(MouseEvent.ROLL_OVER, WaltherPPKUnlockRollOver);
WaltherPPKLock.addEventListener(MouseEvent.ROLL_OUT, WaltherPPKUnlockRollOut);
LugerLock.addEventListener(MouseEvent.ROLL_OVER, LugerUnlockRollOver);
LugerLock.addEventListener(MouseEvent.ROLL_OUT, LugerUnlockRollOut);
}
function frame3(){
stop();
StarRefreshSMG();
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarUzi")).addEventListener(MouseEvent.CLICK, this[("UziSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarMP5")).addEventListener(MouseEvent.CLICK, this[("MP5Slot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
if (MovieClip(root).SkorpionUnlocked == false){
SkorpionGraphic.alpha = 0.25;
SkorpionLock.alpha = 1;
Slot1StarSkorpion.enabled = false;
Slot2StarSkorpion.enabled = false;
Slot3StarSkorpion.enabled = false;
} else {
SkorpionGraphic.alpha = 1;
SkorpionLock.alpha = 0;
SkorpionLock.mouseEnabled = false;
Slot1StarSkorpion.enabled = true;
Slot2StarSkorpion.enabled = true;
Slot3StarSkorpion.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarSkorpion")).addEventListener(MouseEvent.CLICK, this[("SkorpionSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
if (MovieClip(root).BerettaSMGUnlocked == false){
BerettaSMGGraphic.alpha = 0.25;
BerettaSMGLock.alpha = 1;
Slot1StarBerettaSMG.enabled = false;
Slot2StarBerettaSMG.enabled = false;
Slot3StarBerettaSMG.enabled = false;
} else {
BerettaSMGGraphic.alpha = 1;
BerettaSMGLock.alpha = 0;
BerettaSMGLock.mouseEnabled = false;
Slot1StarBerettaSMG.enabled = true;
Slot2StarBerettaSMG.enabled = true;
Slot3StarBerettaSMG.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarBerettaSMG")).addEventListener(MouseEvent.CLICK, this[("BerettaSMGSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
if (MovieClip(root).SMGPK2Unlocked == false){
SMGPK2Graphic.alpha = 0.25;
SMGPK2Lock.alpha = 1;
Slot1StarSMGPK2.enabled = false;
Slot2StarSMGPK2.enabled = false;
Slot3StarSMGPK2.enabled = false;
} else {
SMGPK2Graphic.alpha = 1;
SMGPK2Lock.alpha = 0;
SMGPK2Lock.mouseEnabled = false;
Slot1StarSMGPK2.enabled = true;
Slot2StarSMGPK2.enabled = true;
Slot3StarSMGPK2.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarSMGPK2")).addEventListener(MouseEvent.CLICK, this[("SMGPK2Slot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
if (MovieClip(root).P90Unlocked == false){
P90Graphic.alpha = 0.25;
P90Lock.alpha = 1;
Slot1StarP90.enabled = false;
Slot2StarP90.enabled = false;
Slot3StarP90.enabled = false;
} else {
P90Graphic.alpha = 1;
P90Lock.alpha = 0;
P90Lock.mouseEnabled = false;
Slot1StarP90.enabled = true;
Slot2StarP90.enabled = true;
Slot3StarP90.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarP90")).addEventListener(MouseEvent.CLICK, this[("P90Slot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
SkorpionLock.addEventListener(MouseEvent.ROLL_OVER, SkorpionUnlockRollOver);
SkorpionLock.addEventListener(MouseEvent.ROLL_OUT, SkorpionUnlockRollOut);
BerettaSMGLock.addEventListener(MouseEvent.ROLL_OVER, BerettaSMGUnlockRollOver);
BerettaSMGLock.addEventListener(MouseEvent.ROLL_OUT, BerettaSMGUnlockRollOut);
SMGPK2Lock.addEventListener(MouseEvent.ROLL_OVER, SMGPK2UnlockRollOver);
SMGPK2Lock.addEventListener(MouseEvent.ROLL_OUT, SMGPK2UnlockRollOut);
P90Lock.addEventListener(MouseEvent.ROLL_OVER, P90UnlockRollOver);
P90Lock.addEventListener(MouseEvent.ROLL_OUT, P90UnlockRollOut);
}
public function MagnumSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 5))) && (!((MovieClip(root).Slot2 == 5))))) && (!((MovieClip(root).Slot3 == 5))))){
MovieClip(root).Slot3 = 5;
MovieClip(root).WeaponNum = 5;
MovieClip(root).ActiveSlot = 3;
StarRefreshRevolver();
};
}
public function Spas12UnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Spas-12</B> \n Complete the 'Riot Police' Achievement.";
}
public function MagnumSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 5))) && (!((MovieClip(root).Slot2 == 5))))) && (!((MovieClip(root).Slot3 == 5))))){
MovieClip(root).Slot1 = 5;
MovieClip(root).WeaponNum = 5;
MovieClip(root).ActiveSlot = 1;
StarRefreshRevolver();
};
}
function frame5(){
stop();
StarRefreshAssaultRifle();
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarM4Carbine")).addEventListener(MouseEvent.CLICK, this[("M4CarbineSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
if (MovieClip(root).FamasUnlocked == false){
FamasGraphic.alpha = 0.25;
FamasLock.alpha = 1;
Slot1StarFamas.enabled = false;
Slot2StarFamas.enabled = false;
Slot3StarFamas.enabled = false;
} else {
FamasGraphic.alpha = 1;
FamasLock.alpha = 0;
FamasLock.mouseEnabled = false;
Slot1StarFamas.enabled = true;
Slot2StarFamas.enabled = true;
Slot3StarFamas.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarFamas")).addEventListener(MouseEvent.CLICK, this[("FamasSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
FamasLock.addEventListener(MouseEvent.ROLL_OVER, FamasUnlockRollOver);
FamasLock.addEventListener(MouseEvent.ROLL_OUT, FamasUnlockRollOut);
}
public function PeacemakerUnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function SMGPK2UnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function StarRefreshSMG():void{
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 2){
getChildByName((("Slot" + MovieClip(root).i) + "StarUzi")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarUzi")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 3){
getChildByName((("Slot" + MovieClip(root).i) + "StarMP5")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarMP5")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 4){
getChildByName((("Slot" + MovieClip(root).i) + "StarSkorpion")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarSkorpion")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 8){
getChildByName((("Slot" + MovieClip(root).i) + "StarBerettaSMG")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarBerettaSMG")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 10){
getChildByName((("Slot" + MovieClip(root).i) + "StarSMGPK2")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarSMGPK2")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 15){
getChildByName((("Slot" + MovieClip(root).i) + "StarP90")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarP90")).alpha = 0.5;
};
MovieClip(root).i++;
};
}
public function MagnumUnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Magnum</B> \n Complete the 'Campaigner' Achievement.";
}
public function DeagleUnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Deagle</B> \n Beat Offense Campaign Level 5.";
}
public function StarRefreshAssaultRifle():void{
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 9){
getChildByName((("Slot" + MovieClip(root).i) + "StarM4Carbine")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarM4Carbine")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 17){
getChildByName((("Slot" + MovieClip(root).i) + "StarFamas")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarFamas")).alpha = 0.5;
};
MovieClip(root).i++;
};
}
function frame6(){
stop();
StarRefreshShotgun();
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarRiotShotgun")).addEventListener(MouseEvent.CLICK, this[("RiotShotgunSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
if (MovieClip(root).Spas12Unlocked == false){
Spas12Graphic.alpha = 0.25;
Spas12Lock.alpha = 1;
Slot1StarSpas12.enabled = false;
Slot2StarSpas12.enabled = false;
Slot3StarSpas12.enabled = false;
} else {
Spas12Graphic.alpha = 1;
Spas12Lock.alpha = 0;
Spas12Lock.mouseEnabled = false;
Slot1StarSpas12.enabled = true;
Slot2StarSpas12.enabled = true;
Slot3StarSpas12.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarSpas12")).addEventListener(MouseEvent.CLICK, this[("Spas12Slot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
Spas12Lock.addEventListener(MouseEvent.ROLL_OVER, Spas12UnlockRollOver);
Spas12Lock.addEventListener(MouseEvent.ROLL_OUT, Spas12UnlockRollOut);
}
public function M4CarbineSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 9))) && (!((MovieClip(root).Slot2 == 9))))) && (!((MovieClip(root).Slot3 == 9))))){
MovieClip(root).Slot2 = 9;
MovieClip(root).WeaponNum = 9;
MovieClip(root).ActiveSlot = 2;
StarRefreshAssaultRifle();
};
}
public function PeacemakerUnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Peacemaker</B> \n Complete the 'Magnum Master' Achievement.";
}
public function SMGPK2Slot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 10))) && (!((MovieClip(root).Slot2 == 10))))) && (!((MovieClip(root).Slot3 == 10))))){
MovieClip(root).Slot1 = 10;
MovieClip(root).WeaponNum = 10;
MovieClip(root).ActiveSlot = 1;
StarRefreshSMG();
};
}
public function SMGPK2Slot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 10))) && (!((MovieClip(root).Slot2 == 10))))) && (!((MovieClip(root).Slot3 == 10))))){
MovieClip(root).Slot2 = 10;
MovieClip(root).WeaponNum = 10;
MovieClip(root).ActiveSlot = 2;
StarRefreshSMG();
};
}
public function SMGPK2Slot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 10))) && (!((MovieClip(root).Slot2 == 10))))) && (!((MovieClip(root).Slot3 == 10))))){
MovieClip(root).Slot3 = 10;
MovieClip(root).WeaponNum = 10;
MovieClip(root).ActiveSlot = 3;
StarRefreshSMG();
};
}
public function P90Slot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 15))) && (!((MovieClip(root).Slot2 == 15))))) && (!((MovieClip(root).Slot3 == 15))))){
MovieClip(root).Slot2 = 15;
MovieClip(root).WeaponNum = 15;
MovieClip(root).ActiveSlot = 2;
StarRefreshSMG();
};
}
public function RiotShotgunSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 7))) && (!((MovieClip(root).Slot2 == 7))))) && (!((MovieClip(root).Slot3 == 7))))){
MovieClip(root).Slot1 = 7;
MovieClip(root).WeaponNum = 7;
MovieClip(root).ActiveSlot = 1;
StarRefreshShotgun();
};
}
public function PeacemakerSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 19))) && (!((MovieClip(root).Slot2 == 19))))) && (!((MovieClip(root).Slot3 == 19))))){
MovieClip(root).Slot2 = 19;
MovieClip(root).WeaponNum = 19;
MovieClip(root).ActiveSlot = 2;
StarRefreshRevolver();
};
}
public function StarRefreshPistol():void{
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 1){
getChildByName((("Slot" + MovieClip(root).i) + "StarGlock")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarGlock")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 6){
getChildByName((("Slot" + MovieClip(root).i) + "StarUSP")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarUSP")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 12){
getChildByName((("Slot" + MovieClip(root).i) + "StarDeagle")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarDeagle")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 13){
getChildByName((("Slot" + MovieClip(root).i) + "StarWaltherPPK")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarWaltherPPK")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 14){
getChildByName((("Slot" + MovieClip(root).i) + "StarLuger")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarLuger")).alpha = 0.5;
};
MovieClip(root).i++;
};
}
public function PeacemakerSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 19))) && (!((MovieClip(root).Slot2 == 19))))) && (!((MovieClip(root).Slot3 == 19))))){
MovieClip(root).Slot3 = 19;
MovieClip(root).WeaponNum = 19;
MovieClip(root).ActiveSlot = 3;
StarRefreshRevolver();
};
}
public function Kar98kUnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Kar 98k</B> \n Complete the 'M1A Martyr' Achievement.";
}
public function P90Slot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 15))) && (!((MovieClip(root).Slot2 == 15))))) && (!((MovieClip(root).Slot3 == 15))))){
MovieClip(root).Slot1 = 15;
MovieClip(root).WeaponNum = 15;
MovieClip(root).ActiveSlot = 1;
StarRefreshSMG();
};
}
public function MagnumUnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function WaltherPPKUnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function GlockSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 1))) && (!((MovieClip(root).Slot2 == 1))))) && (!((MovieClip(root).Slot3 == 1))))){
MovieClip(root).Slot2 = 1;
MovieClip(root).WeaponNum = 1;
MovieClip(root).ActiveSlot = 2;
StarRefreshPistol();
};
}
public function GlockSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 1))) && (!((MovieClip(root).Slot2 == 1))))) && (!((MovieClip(root).Slot3 == 1))))){
MovieClip(root).Slot3 = 1;
MovieClip(root).WeaponNum = 1;
MovieClip(root).ActiveSlot = 3;
StarRefreshPistol();
};
}
public function M1ARifleSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 11))) && (!((MovieClip(root).Slot2 == 11))))) && (!((MovieClip(root).Slot3 == 11))))){
MovieClip(root).Slot1 = 11;
MovieClip(root).WeaponNum = 11;
MovieClip(root).ActiveSlot = 1;
StarRefreshRifle();
};
}
public function GlockSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 1))) && (!((MovieClip(root).Slot2 == 1))))) && (!((MovieClip(root).Slot3 == 1))))){
MovieClip(root).Slot1 = 1;
MovieClip(root).WeaponNum = 1;
MovieClip(root).ActiveSlot = 1;
StarRefreshPistol();
};
}
public function PeacemakerSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 19))) && (!((MovieClip(root).Slot2 == 19))))) && (!((MovieClip(root).Slot3 == 19))))){
MovieClip(root).Slot1 = 19;
MovieClip(root).WeaponNum = 19;
MovieClip(root).ActiveSlot = 1;
StarRefreshRevolver();
};
}
public function StarRefreshRevolver():void{
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 5){
getChildByName((("Slot" + MovieClip(root).i) + "Star357Magnum")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "Star357Magnum")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 19){
getChildByName((("Slot" + MovieClip(root).i) + "StarPeacemaker")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarPeacemaker")).alpha = 0.5;
};
MovieClip(root).i++;
};
}
public function SkorpionSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 4))) && (!((MovieClip(root).Slot2 == 4))))) && (!((MovieClip(root).Slot3 == 4))))){
MovieClip(root).Slot1 = 4;
MovieClip(root).WeaponNum = 4;
MovieClip(root).ActiveSlot = 1;
StarRefreshSMG();
};
}
public function SkorpionSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 4))) && (!((MovieClip(root).Slot2 == 4))))) && (!((MovieClip(root).Slot3 == 4))))){
MovieClip(root).Slot3 = 4;
MovieClip(root).WeaponNum = 4;
MovieClip(root).ActiveSlot = 3;
StarRefreshSMG();
};
}
public function WaltherPPKSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 13))) && (!((MovieClip(root).Slot2 == 13))))) && (!((MovieClip(root).Slot3 == 13))))){
MovieClip(root).Slot2 = 13;
MovieClip(root).WeaponNum = 13;
MovieClip(root).ActiveSlot = 2;
StarRefreshPistol();
};
}
public function WaltherPPKSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 13))) && (!((MovieClip(root).Slot2 == 13))))) && (!((MovieClip(root).Slot3 == 13))))){
MovieClip(root).Slot3 = 13;
MovieClip(root).WeaponNum = 13;
MovieClip(root).ActiveSlot = 3;
StarRefreshPistol();
};
}
public function M1ARifleSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 11))) && (!((MovieClip(root).Slot2 == 11))))) && (!((MovieClip(root).Slot3 == 11))))){
MovieClip(root).Slot2 = 11;
MovieClip(root).WeaponNum = 11;
MovieClip(root).ActiveSlot = 2;
StarRefreshRifle();
};
}
public function WaltherPPKSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 13))) && (!((MovieClip(root).Slot2 == 13))))) && (!((MovieClip(root).Slot3 == 13))))){
MovieClip(root).Slot1 = 13;
MovieClip(root).WeaponNum = 13;
MovieClip(root).ActiveSlot = 1;
StarRefreshPistol();
};
}
public function SkorpionSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 4))) && (!((MovieClip(root).Slot2 == 4))))) && (!((MovieClip(root).Slot3 == 4))))){
MovieClip(root).Slot2 = 4;
MovieClip(root).WeaponNum = 4;
MovieClip(root).ActiveSlot = 2;
StarRefreshSMG();
};
}
public function P90Slot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 15))) && (!((MovieClip(root).Slot2 == 15))))) && (!((MovieClip(root).Slot3 == 15))))){
MovieClip(root).Slot3 = 15;
MovieClip(root).WeaponNum = 15;
MovieClip(root).ActiveSlot = 3;
StarRefreshSMG();
};
}
public function DeagleUnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function FamasUnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function DeagleSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 12))) && (!((MovieClip(root).Slot2 == 12))))) && (!((MovieClip(root).Slot3 == 12))))){
MovieClip(root).Slot1 = 12;
MovieClip(root).WeaponNum = 12;
MovieClip(root).ActiveSlot = 1;
StarRefreshPistol();
};
}
public function DeagleSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 12))) && (!((MovieClip(root).Slot2 == 12))))) && (!((MovieClip(root).Slot3 == 12))))){
MovieClip(root).Slot2 = 12;
MovieClip(root).WeaponNum = 12;
MovieClip(root).ActiveSlot = 2;
StarRefreshPistol();
};
}
public function USPSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 6))) && (!((MovieClip(root).Slot2 == 6))))) && (!((MovieClip(root).Slot3 == 6))))){
MovieClip(root).Slot1 = 6;
MovieClip(root).WeaponNum = 6;
MovieClip(root).ActiveSlot = 1;
StarRefreshPistol();
};
}
public function LugerSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 14))) && (!((MovieClip(root).Slot2 == 14))))) && (!((MovieClip(root).Slot3 == 14))))){
MovieClip(root).Slot1 = 14;
MovieClip(root).WeaponNum = 14;
MovieClip(root).ActiveSlot = 1;
StarRefreshPistol();
};
}
public function USPSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 6))) && (!((MovieClip(root).Slot2 == 6))))) && (!((MovieClip(root).Slot3 == 6))))){
MovieClip(root).Slot2 = 6;
MovieClip(root).WeaponNum = 6;
MovieClip(root).ActiveSlot = 2;
StarRefreshPistol();
};
}
public function USPSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 6))) && (!((MovieClip(root).Slot2 == 6))))) && (!((MovieClip(root).Slot3 == 6))))){
MovieClip(root).Slot3 = 6;
MovieClip(root).WeaponNum = 6;
MovieClip(root).ActiveSlot = 3;
StarRefreshPistol();
};
}
public function P90UnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>P90</B> \n Get Expert on all other SMG Challenges.";
}
public function Kar98kUnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function DeagleSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 12))) && (!((MovieClip(root).Slot2 == 12))))) && (!((MovieClip(root).Slot3 == 12))))){
MovieClip(root).Slot3 = 12;
MovieClip(root).WeaponNum = 12;
MovieClip(root).ActiveSlot = 3;
StarRefreshPistol();
};
}
public function LugerSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 14))) && (!((MovieClip(root).Slot2 == 14))))) && (!((MovieClip(root).Slot3 == 14))))){
MovieClip(root).Slot3 = 14;
MovieClip(root).WeaponNum = 14;
MovieClip(root).ActiveSlot = 3;
StarRefreshPistol();
};
}
public function FamasSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 17))) && (!((MovieClip(root).Slot2 == 17))))) && (!((MovieClip(root).Slot3 == 17))))){
MovieClip(root).Slot1 = 17;
MovieClip(root).WeaponNum = 17;
MovieClip(root).ActiveSlot = 1;
StarRefreshAssaultRifle();
};
}
public function FamasSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 17))) && (!((MovieClip(root).Slot2 == 17))))) && (!((MovieClip(root).Slot3 == 17))))){
MovieClip(root).Slot3 = 17;
MovieClip(root).WeaponNum = 17;
MovieClip(root).ActiveSlot = 3;
StarRefreshAssaultRifle();
};
}
public function SkorpionUnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Skorpion</B> \n Beat Defense Campaign level 4.";
}
public function P90UnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function M1ARifleSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 11))) && (!((MovieClip(root).Slot2 == 11))))) && (!((MovieClip(root).Slot3 == 11))))){
MovieClip(root).Slot3 = 11;
MovieClip(root).WeaponNum = 11;
MovieClip(root).ActiveSlot = 3;
StarRefreshRifle();
};
}
public function StarRefreshShotgun():void{
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 7){
getChildByName((("Slot" + MovieClip(root).i) + "StarRiotShotgun")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarRiotShotgun")).alpha = 0.5;
};
MovieClip(root).i++;
};
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
if (root[("Slot" + MovieClip(root).i)] == 16){
getChildByName((("Slot" + MovieClip(root).i) + "StarSpas12")).alpha = 1;
} else {
getChildByName((("Slot" + MovieClip(root).i) + "StarSpas12")).alpha = 0.5;
};
MovieClip(root).i++;
};
}
public function LugerSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 14))) && (!((MovieClip(root).Slot2 == 14))))) && (!((MovieClip(root).Slot3 == 14))))){
MovieClip(root).Slot2 = 14;
MovieClip(root).WeaponNum = 14;
MovieClip(root).ActiveSlot = 2;
StarRefreshPistol();
};
}
public function BerettaSMGUnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function Kar98kSlot1(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 18))) && (!((MovieClip(root).Slot2 == 18))))) && (!((MovieClip(root).Slot3 == 18))))){
MovieClip(root).Slot1 = 18;
MovieClip(root).WeaponNum = 18;
MovieClip(root).ActiveSlot = 1;
StarRefreshRifle();
};
}
public function Kar98kSlot3(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 18))) && (!((MovieClip(root).Slot2 == 18))))) && (!((MovieClip(root).Slot3 == 18))))){
MovieClip(root).Slot3 = 18;
MovieClip(root).WeaponNum = 18;
MovieClip(root).ActiveSlot = 3;
StarRefreshRifle();
};
}
function frame2(){
stop();
StarRefreshRevolver();
if (MovieClip(root).MagnumUnlocked == false){
MagnumGraphic.alpha = 0.25;
MagnumLock.alpha = 1;
Slot1Star357Magnum.enabled = false;
Slot2Star357Magnum.enabled = false;
Slot3Star357Magnum.enabled = false;
} else {
MagnumGraphic.alpha = 1;
MagnumLock.alpha = 0;
MagnumLock.mouseEnabled = false;
Slot1Star357Magnum.enabled = true;
Slot2Star357Magnum.enabled = true;
Slot3Star357Magnum.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "Star357Magnum")).addEventListener(MouseEvent.CLICK, this[("MagnumSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
if (MovieClip(root).PeacemakerUnlocked == false){
PeacemakerGraphic.alpha = 0.25;
PeacemakerLock.alpha = 1;
Slot1StarPeacemaker.enabled = false;
Slot2StarPeacemaker.enabled = false;
Slot3StarPeacemaker.enabled = false;
} else {
PeacemakerGraphic.alpha = 1;
PeacemakerLock.alpha = 0;
PeacemakerLock.mouseEnabled = false;
Slot1StarPeacemaker.enabled = true;
Slot2StarPeacemaker.enabled = true;
Slot3StarPeacemaker.enabled = true;
MovieClip(root).i = 1;
while (MovieClip(root).i <= 3) {
getChildByName((("Slot" + MovieClip(root).i) + "StarPeacemaker")).addEventListener(MouseEvent.CLICK, this[("PeacemakerSlot" + MovieClip(root).i)]);
MovieClip(root).i++;
};
};
MagnumLock.addEventListener(MouseEvent.ROLL_OVER, MagnumUnlockRollOver);
MagnumLock.addEventListener(MouseEvent.ROLL_OUT, MagnumUnlockRollOut);
PeacemakerLock.addEventListener(MouseEvent.ROLL_OVER, PeacemakerUnlockRollOver);
PeacemakerLock.addEventListener(MouseEvent.ROLL_OUT, PeacemakerUnlockRollOut);
}
public function FamasSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 17))) && (!((MovieClip(root).Slot2 == 17))))) && (!((MovieClip(root).Slot3 == 17))))){
MovieClip(root).Slot2 = 17;
MovieClip(root).WeaponNum = 17;
MovieClip(root).ActiveSlot = 2;
StarRefreshAssaultRifle();
};
}
public function Kar98kSlot2(_arg1:MouseEvent){
if (((((!((MovieClip(root).Slot1 == 18))) && (!((MovieClip(root).Slot2 == 18))))) && (!((MovieClip(root).Slot3 == 18))))){
MovieClip(root).Slot2 = 18;
MovieClip(root).WeaponNum = 18;
MovieClip(root).ActiveSlot = 2;
StarRefreshRifle();
};
}
public function BerettaSMGUnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Beretta PM-12</B> \n Complete the 'MP5 Jockey' Achievement.";
}
public function SkorpionUnlockRollOut(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 0;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "";
}
public function WaltherPPKUnlockRollOver(_arg1:MouseEvent){
MovieClip(root).Cursor.AchievementPlate.alpha = 100;
MovieClip(root).Cursor.AchievementPlate.AchievementInfo.htmlText = "<B>Walther PPK</B> \n Get Expert on all USP Challenges.";
}
}
}//package TheGunGame_Final_Bored_fla
Section 137
//WeaponPlate_28 (TheGunGame_Final_Bored_fla.WeaponPlate_28)
package TheGunGame_Final_Bored_fla {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class WeaponPlate_28 extends MovieClip {
public var Category6:SimpleButton;
public var SponsorLink:MovieClip;
public var WeaponCategory:MovieClip;
public var PlateBG:MovieClip;
public var Category1:SimpleButton;
public var Category2:SimpleButton;
public var Category3:SimpleButton;
public var Category4:SimpleButton;
public var Category5:SimpleButton;
public function WeaponPlate_28(){
addFrameScript(0, frame1);
}
public function GoRevolver(_arg1:MouseEvent){
WeaponCategory.gotoAndStop("Revolver");
MovieClip(root).ActiveWeaponCategory = 2;
ActiveCategory();
}
public function GoSMG(_arg1:MouseEvent){
WeaponCategory.gotoAndStop("SMG");
MovieClip(root).ActiveWeaponCategory = 3;
ActiveCategory();
}
public function GoAssaultRifle(_arg1:MouseEvent){
WeaponCategory.gotoAndStop("AssaultRifle");
MovieClip(root).ActiveWeaponCategory = 5;
ActiveCategory();
}
public function ActiveCategory():void{
MovieClip(root).i = 1;
while (MovieClip(root).i <= 6) {
if (MovieClip(root).ActiveWeaponCategory == MovieClip(root).i){
this[("Category" + MovieClip(root).i)].alpha = 1;
WeaponCategory.gotoAndStop(MovieClip(root).i);
} else {
this[("Category" + MovieClip(root).i)].alpha = 0.5;
};
MovieClip(root).i++;
};
}
function frame1(){
stop();
ActiveCategory();
Category1.addEventListener(MouseEvent.CLICK, GoPistol);
Category2.addEventListener(MouseEvent.CLICK, GoRevolver);
Category3.addEventListener(MouseEvent.CLICK, GoSMG);
Category4.addEventListener(MouseEvent.CLICK, GoRifle);
Category5.addEventListener(MouseEvent.CLICK, GoAssaultRifle);
Category6.addEventListener(MouseEvent.CLICK, GoShotgun);
}
public function GoPistol(_arg1:MouseEvent){
WeaponCategory.gotoAndStop("Pistol");
MovieClip(root).ActiveWeaponCategory = 1;
ActiveCategory();
}
public function GoRifle(_arg1:MouseEvent){
WeaponCategory.gotoAndStop("Rifle");
MovieClip(root).ActiveWeaponCategory = 4;
ActiveCategory();
}
public function GoShotgun(_arg1:MouseEvent){
WeaponCategory.gotoAndStop("Shotgun");
MovieClip(root).ActiveWeaponCategory = 6;
ActiveCategory();
}
}
}//package TheGunGame_Final_Bored_fla
Section 138
//WeaponSelector_157 (TheGunGame_Final_Bored_fla.WeaponSelector_157)
package TheGunGame_Final_Bored_fla {
import flash.display.*;
public dynamic class WeaponSelector_157 extends MovieClip {
public var GripHand:MovieClip;
public var PumpHand:MovieClip;
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public var HoldHand:MovieClip;
public function WeaponSelector_157(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19);
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame18(){
stop();
}
function frame12(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame19(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame16(){
stop();
}
function frame8(){
stop();
}
function frame15(){
stop();
}
function frame11(){
stop();
}
function frame2(){
stop();
}
}
}//package TheGunGame_Final_Bored_fla
Section 139
//BerettaSMG (BerettaSMG)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class BerettaSMG extends MovieClip {
public var BackHand:MovieClip;
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function BerettaSMG(){
addFrameScript(0, frame1, 3, frame4);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
function frame4(){
gotoAndStop(1);
}
}
}//package
Section 140
//BerettaSMGFire (BerettaSMGFire)
package {
import flash.media.*;
public dynamic class BerettaSMGFire extends Sound {
}
}//package
Section 141
//Blank (Blank)
package {
import flash.display.*;
public dynamic class Blank extends MovieClip {
}
}//package
Section 142
//BlankSound (BlankSound)
package {
import flash.media.*;
public dynamic class BlankSound extends Sound {
}
}//package
Section 143
//BottomWallBG (BottomWallBG)
package {
import flash.display.*;
public dynamic class BottomWallBG extends MovieClip {
}
}//package
Section 144
//Crate (Crate)
package {
import flash.display.*;
public dynamic class Crate extends MovieClip {
public var CrateGraphic:MovieClip;
}
}//package
Section 145
//CrateGround1 (CrateGround1)
package {
import flash.media.*;
public dynamic class CrateGround1 extends Sound {
}
}//package
Section 146
//CrateGround2 (CrateGround2)
package {
import flash.media.*;
public dynamic class CrateGround2 extends Sound {
}
}//package
Section 147
//CrateGround3 (CrateGround3)
package {
import flash.media.*;
public dynamic class CrateGround3 extends Sound {
}
}//package
Section 148
//cursor (cursor)
package {
import flash.display.*;
public dynamic class cursor extends MovieClip {
public var AchievementPlate:MovieClip;
public var CursorPoint:MovieClip;
}
}//package
Section 149
//damage1 (damage1)
package {
import flash.media.*;
public dynamic class damage1 extends Sound {
}
}//package
Section 150
//damage2 (damage2)
package {
import flash.media.*;
public dynamic class damage2 extends Sound {
}
}//package
Section 151
//damage3 (damage3)
package {
import flash.media.*;
public dynamic class damage3 extends Sound {
}
}//package
Section 152
//Deagle (Deagle)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class Deagle extends MovieClip {
public var FrontHand:MovieClip;
public var ReloadHand:MovieClip;
public var Launcher:MovieClip;
public function Deagle(){
addFrameScript(0, frame1, 5, frame6);
}
function frame6(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
}
}//package
Section 153
//DeagleFire (DeagleFire)
package {
import flash.media.*;
public dynamic class DeagleFire extends Sound {
}
}//package
Section 154
//Enemy357Magnum (Enemy357Magnum)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class Enemy357Magnum extends MovieClip {
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function Enemy357Magnum(){
addFrameScript(0, frame1, 13, frame14, 49, frame50);
}
function frame14(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7];
};
};
}
function frame50(){
this.parent.removeChild(this);
stop();
}
}
}//package
Section 155
//EnemyBerettaSMG (EnemyBerettaSMG)
package {
import flash.display.*;
public dynamic class EnemyBerettaSMG extends MovieClip {
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function EnemyBerettaSMG(){
addFrameScript(0, frame1, 3, frame4, 39, frame40);
}
function frame1(){
stop();
}
function frame4(){
gotoAndStop(1);
}
function frame40(){
this.parent.removeChild(this);
stop();
}
}
}//package
Section 156
//EnemyGlock (EnemyGlock)
package {
import flash.display.*;
public dynamic class EnemyGlock extends MovieClip {
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function EnemyGlock(){
addFrameScript(0, frame1, 15, frame16, 49, frame50);
}
function frame16(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame50(){
this.parent.removeChild(this);
stop();
}
}
}//package
Section 157
//EnemyM1A (EnemyM1A)
package {
import flash.display.*;
public dynamic class EnemyM1A extends MovieClip {
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public var HoldHand:MovieClip;
public function EnemyM1A(){
addFrameScript(0, frame1, 9, frame10, 39, frame40);
}
function frame10(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame40(){
this.parent.removeChild(this);
stop();
}
}
}//package
Section 158
//EnemyMP5 (EnemyMP5)
package {
import flash.display.*;
public dynamic class EnemyMP5 extends MovieClip {
public var GripHand:MovieClip;
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function EnemyMP5(){
addFrameScript(0, frame1, 5, frame6, 39, frame40);
}
function frame6(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame40(){
this.parent.removeChild(this);
stop();
}
}
}//package
Section 159
//EnemyP90 (EnemyP90)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class EnemyP90 extends MovieClip {
public var GripHand:MovieClip;
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function EnemyP90(){
addFrameScript(0, frame1, 2, frame3, 34, frame35);
}
function frame3(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7];
};
};
}
function frame35(){
this.parent.removeChild(this);
stop();
}
}
}//package
Section 160
//EnemyUSP (EnemyUSP)
package {
import flash.display.*;
public dynamic class EnemyUSP extends MovieClip {
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function EnemyUSP(){
addFrameScript(0, frame1, 3, frame4, 29, frame30);
}
function frame1(){
stop();
}
function frame4(){
gotoAndStop(1);
}
function frame30(){
this.parent.removeChild(this);
stop();
}
}
}//package
Section 161
//Famas (Famas)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class Famas extends MovieClip {
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public var HoldHand:MovieClip;
public function Famas(){
addFrameScript(0, frame1, 3, frame4);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
function frame4(){
gotoAndStop(1);
}
}
}//package
Section 162
//FamasFire (FamasFire)
package {
import flash.media.*;
public dynamic class FamasFire extends Sound {
}
}//package
Section 163
//global (global)
package {
public class global {
public static var WeaponDamage = 0;
public static var ScrollerMoving:Boolean = false;
public static var TargetsHit:Number = 0;
public static var Shape1Body = "";
public static var Shape2Body = "";
public static var CrateOnGoal = false;
public static var PlayerHit = false;
public static var currentLevel = 0;
public static var ShellGroundBounce = false;
public static var PlateMoving:Boolean = false;
public static var scrollbarOn = false;
public static var grounded:Boolean = false;
public static var currMovieFrame = 1;
public static var EnemyHP:Array = new Array();
public static var GravityDirection:String = "Down";
public static var CrateGroundBounce = false;
public static var Shape1Sprite = "";
public static var Shape2Sprite = "";
public static var TargetHit:Boolean = false;
public function global():void{
}
}
}//package
Section 164
//Glock (Glock)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class Glock extends MovieClip {
public var FrontHand:MovieClip;
public var Clip:MovieClip;
public var ReloadHand:MovieClip;
public var Launcher:MovieClip;
public function Glock(){
addFrameScript(0, frame1, 15, frame16);
}
function frame16(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
}
}//package
Section 165
//GlockFire (GlockFire)
package {
import flash.media.*;
public dynamic class GlockFire extends Sound {
}
}//package
Section 166
//GlockReload (GlockReload)
package {
import flash.media.*;
public dynamic class GlockReload extends Sound {
}
}//package
Section 167
//GoalPlatform100 (GoalPlatform100)
package {
import flash.display.*;
public dynamic class GoalPlatform100 extends MovieClip {
}
}//package
Section 168
//GoalPlatform100Vert (GoalPlatform100Vert)
package {
import flash.display.*;
public dynamic class GoalPlatform100Vert extends MovieClip {
}
}//package
Section 169
//GoalPlatform250 (GoalPlatform250)
package {
import flash.display.*;
public dynamic class GoalPlatform250 extends MovieClip {
}
}//package
Section 170
//GoalPlatform400 (GoalPlatform400)
package {
import flash.display.*;
public dynamic class GoalPlatform400 extends MovieClip {
}
}//package
Section 171
//GoalPlatform400Vert (GoalPlatform400Vert)
package {
import flash.display.*;
public dynamic class GoalPlatform400Vert extends MovieClip {
}
}//package
Section 172
//GoalPlatform500 (GoalPlatform500)
package {
import flash.display.*;
public dynamic class GoalPlatform500 extends MovieClip {
}
}//package
Section 173
//GreenCrate (GreenCrate)
package {
import flash.display.*;
import flash.text.*;
public dynamic class GreenCrate extends MovieClip {
public var GoalTimerInfo:TextField;
}
}//package
Section 174
//GunBreak (GunBreak)
package {
import flash.media.*;
public dynamic class GunBreak extends Sound {
}
}//package
Section 175
//Kar98k (Kar98k)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class Kar98k extends MovieClip {
public var BackHand:MovieClip;
public var FrontHand:MovieClip;
public var ThumbHand:MovieClip;
public var Launcher:MovieClip;
public var HoldHand:MovieClip;
public function Kar98k(){
addFrameScript(0, frame1, 52, frame53);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
if (MovieClip(parent).DelayFire == true){
MovieClip(parent).DelayFire = false;
};
}
function frame53(){
gotoAndStop(1);
}
}
}//package
Section 176
//Kar98kFire (Kar98kFire)
package {
import flash.media.*;
public dynamic class Kar98kFire extends Sound {
}
}//package
Section 177
//kevlar1 (kevlar1)
package {
import flash.media.*;
public dynamic class kevlar1 extends Sound {
}
}//package
Section 178
//kevlar2 (kevlar2)
package {
import flash.media.*;
public dynamic class kevlar2 extends Sound {
}
}//package
Section 179
//kevlar3 (kevlar3)
package {
import flash.media.*;
public dynamic class kevlar3 extends Sound {
}
}//package
Section 180
//LeftWallBG (LeftWallBG)
package {
import flash.display.*;
public dynamic class LeftWallBG extends MovieClip {
}
}//package
Section 181
//Luger (Luger)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class Luger extends MovieClip {
public var FrontHand:MovieClip;
public var ReloadHand:MovieClip;
public var Launcher:MovieClip;
public function Luger(){
addFrameScript(0, frame1, 5, frame6);
}
function frame6(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
}
}//package
Section 182
//LugerFire (LugerFire)
package {
import flash.media.*;
public dynamic class LugerFire extends Sound {
}
}//package
Section 183
//M1A (M1A)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class M1A extends MovieClip {
public var FrontHand:MovieClip;
public var ReloadHand:MovieClip;
public var Launcher:MovieClip;
public var HoldHand:MovieClip;
public function M1A(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
}
}//package
Section 184
//M1AFire (M1AFire)
package {
import flash.media.*;
public dynamic class M1AFire extends Sound {
}
}//package
Section 185
//M4Carbine (M4Carbine)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class M4Carbine extends MovieClip {
public var FrontHand:MovieClip;
public var ReloadHand:MovieClip;
public var Launcher:MovieClip;
public var HoldHand:MovieClip;
public function M4Carbine(){
addFrameScript(0, frame1, 2, frame3);
}
function frame3(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
}
}//package
Section 186
//M4CarbineFire (M4CarbineFire)
package {
import flash.media.*;
public dynamic class M4CarbineFire extends Sound {
}
}//package
Section 187
//Magnum (Magnum)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class Magnum extends MovieClip {
public var FrontHand:MovieClip;
public var PreciseReloadHand:MovieClip;
public var ReloadHand:MovieClip;
public var Launcher:MovieClip;
public function Magnum(){
addFrameScript(0, frame1, 13, frame14);
}
function frame14(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
}
}//package
Section 188
//MagnumFire (MagnumFire)
package {
import flash.media.*;
public dynamic class MagnumFire extends Sound {
}
}//package
Section 189
//MicroUzi (MicroUzi)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class MicroUzi extends MovieClip {
public var FrontHand:MovieClip;
public var ReloadHand:MovieClip;
public var Launcher:MovieClip;
public function MicroUzi(){
addFrameScript(0, frame1, 3, frame4);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
function frame4(){
gotoAndStop(1);
}
}
}//package
Section 190
//MP5 (MP5)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class MP5 extends MovieClip {
public var GripHand:MovieClip;
public var BackHand:MovieClip;
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function MP5(){
addFrameScript(0, frame1, 5, frame6);
}
function frame6(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
}
}//package
Section 191
//MP5Fire (MP5Fire)
package {
import flash.media.*;
public dynamic class MP5Fire extends Sound {
}
}//package
Section 192
//MP5Reload (MP5Reload)
package {
import flash.media.*;
public dynamic class MP5Reload extends Sound {
}
}//package
Section 193
//P90 (P90)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class P90 extends MovieClip {
public var GripHand:MovieClip;
public var BackHand:MovieClip;
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function P90(){
addFrameScript(0, frame1, 2, frame3);
}
function frame3(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
}
}//package
Section 194
//P90Fire (P90Fire)
package {
import flash.media.*;
public dynamic class P90Fire extends Sound {
}
}//package
Section 195
//Peacemaker (Peacemaker)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class Peacemaker extends MovieClip {
public var ReloadHand:MovieClip;
public var Launcher:MovieClip;
public function Peacemaker(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
}
}//package
Section 196
//PeacemakerFire (PeacemakerFire)
package {
import flash.media.*;
public dynamic class PeacemakerFire extends Sound {
}
}//package
Section 197
//RightWallBG (RightWallBG)
package {
import flash.display.*;
public dynamic class RightWallBG extends MovieClip {
}
}//package
Section 198
//RiotShotgun (RiotShotgun)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class RiotShotgun extends MovieClip {
public var PumpHand:MovieClip;
public var FrontHand:MovieClip;
public var ThumbHand:MovieClip;
public var ReloadHand:MovieClip;
public var Launcher:MovieClip;
public function RiotShotgun(){
addFrameScript(0, frame1, 30, frame31);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
if (MovieClip(parent).DelayFire == true){
MovieClip(parent).DelayFire = false;
};
}
function frame31(){
gotoAndStop(1);
}
}
}//package
Section 199
//RiotShotgunFire (RiotShotgunFire)
package {
import flash.media.*;
public dynamic class RiotShotgunFire extends Sound {
}
}//package
Section 200
//Scrollbar (Scrollbar)
package {
import flash.events.*;
import caurina.transitions.*;
import flash.geom.*;
import flash.display.*;
public class Scrollbar extends MovieClip {
private var isDown:Boolean;
private var sRect:Rectangle;
private var dragBot:Number;
private var ratio:Number;
private var bottom:Number;
private var downArrowHt:Number;
public var upArrow:MovieClip;
private var range:Number;
public var track:MovieClip;
private var top:Number;
private var timing:Number;
private var ctrl:Number;
public var downArrow:MovieClip;
private var target:MovieClip;
private var sBuffer:Number;
private var trans:String;
public var scroller:MovieClip;
private var arrowMove:Number;
private var isUp:Boolean;
private var upArrowHt:Number;
private var sPos:Number;
private var isArrow:Boolean;
public function Scrollbar():void{
scroller.addEventListener(MouseEvent.MOUSE_DOWN, dragScroll);
stage.addEventListener(MouseEvent.MOUSE_UP, stopScroll);
stage.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
}
public function init(_arg1:MovieClip, _arg2:String, _arg3:Number, _arg4:Boolean, _arg5:Number):void{
var _local6:Sprite;
target = _arg1;
trans = _arg2;
timing = _arg3;
isArrow = _arg4;
sBuffer = _arg5;
if (target.height <= track.height){
this.visible = false;
};
upArrowHt = upArrow.height;
downArrowHt = downArrow.height;
if (isArrow){
top = scroller.y;
dragBot = ((scroller.y + track.height) - scroller.height);
bottom = (track.height - (scroller.height / sBuffer));
} else {
top = scroller.y;
dragBot = ((scroller.y + track.height) - scroller.height);
bottom = (track.height - (scroller.height / sBuffer));
upArrowHt = 0;
downArrowHt = 0;
removeChild(upArrow);
removeChild(downArrow);
};
range = (bottom - top);
sRect = new Rectangle(0, top, 0, dragBot);
ctrl = target.y;
isUp = false;
isDown = false;
arrowMove = 10;
if (isArrow){
upArrow.addEventListener(Event.ENTER_FRAME, upArrowHandler);
upArrow.addEventListener(MouseEvent.MOUSE_DOWN, upScroll);
upArrow.addEventListener(MouseEvent.MOUSE_UP, stopScroll);
downArrow.addEventListener(Event.ENTER_FRAME, downArrowHandler);
downArrow.addEventListener(MouseEvent.MOUSE_DOWN, downScroll);
downArrow.addEventListener(MouseEvent.MOUSE_UP, stopScroll);
};
_local6 = new Sprite();
_local6.graphics.beginFill(0xFF0000);
_local6.graphics.drawRect(target.x, target.y, (target.width + 5), ((track.height + upArrowHt) + downArrowHt));
parent.addChild(_local6);
target.mask = _local6;
}
public function downScroll(_arg1:MouseEvent):void{
isDown = true;
}
public function dragScroll(_arg1:MouseEvent):void{
if (global.PlateMoving == false){
scroller.startDrag(false, sRect);
stage.addEventListener(MouseEvent.MOUSE_MOVE, moveScroll);
};
}
public function upArrowHandler(_arg1:Event):void{
if (global.PlateMoving == false){
if (isUp){
if (scroller.y > top){
scroller.y = (scroller.y - arrowMove);
if (scroller.y < top){
scroller.y = top;
};
startScroll();
};
};
};
}
public function upScroll(_arg1:MouseEvent):void{
isUp = true;
}
public function scrollbarOff():void{
scroller.removeEventListener(MouseEvent.MOUSE_DOWN, dragScroll);
stage.removeEventListener(MouseEvent.MOUSE_UP, stopScroll);
stage.removeEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
}
public function moveScroll(_arg1:MouseEvent):void{
startScroll();
}
public function stopScroll(_arg1:MouseEvent):void{
if (global.currMovieFrame == 6){
isUp = false;
isDown = false;
if (scroller){
scroller.stopDrag();
};
if (stage.hasEventListener(MouseEvent.MOUSE_MOVE)){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, moveScroll);
};
};
}
public function downArrowHandler(_arg1:Event):void{
if (global.PlateMoving == false){
if (isDown){
if (scroller.y < dragBot){
scroller.y = (scroller.y + arrowMove);
if (scroller.y > dragBot){
scroller.y = dragBot;
};
startScroll();
};
};
};
}
public function mouseWheelHandler(_arg1:MouseEvent):void{
if (global.PlateMoving == false){
if (_arg1.delta < 0){
if (scroller.y < dragBot){
scroller.y = (scroller.y - (_arg1.delta * 2));
if (scroller.y > dragBot){
scroller.y = dragBot;
};
startScroll();
};
} else {
if (scroller.y > top){
scroller.y = (scroller.y - (_arg1.delta * 2));
if (scroller.y < top){
scroller.y = top;
};
startScroll();
};
};
};
}
public function startScroll():void{
ratio = ((target.height - range) / range);
sPos = ((scroller.y * ratio) - ctrl);
global.ScrollerMoving = true;
Tweener.addTween(target, {y:-(sPos), time:timing, transition:trans});
}
}
}//package
Section 201
//ShellGround (ShellGround)
package {
import flash.media.*;
public dynamic class ShellGround extends Sound {
}
}//package
Section 202
//Skorpion (Skorpion)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class Skorpion extends MovieClip {
public var BackHand:MovieClip;
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function Skorpion(){
addFrameScript(0, frame1, 4, frame5);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
function frame5(){
gotoAndStop(1);
}
}
}//package
Section 203
//SkorpionFire (SkorpionFire)
package {
import flash.media.*;
public dynamic class SkorpionFire extends Sound {
}
}//package
Section 204
//SMGPK2 (SMGPK2)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class SMGPK2 extends MovieClip {
public var BackHand:MovieClip;
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function SMGPK2(){
addFrameScript(0, frame1, 3, frame4);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
function frame4(){
gotoAndStop(1);
}
}
}//package
Section 205
//Spas12 (Spas12)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class Spas12 extends MovieClip {
public var FrontHand:MovieClip;
public var ThumbHand:MovieClip;
public var Launcher:MovieClip;
public var HoldHand:MovieClip;
public function Spas12(){
addFrameScript(0, frame1, 26, frame27);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
if (MovieClip(parent).DelayFire == true){
MovieClip(parent).DelayFire = false;
};
}
function frame27(){
gotoAndStop(1);
}
}
}//package
Section 206
//Spas12Fire (Spas12Fire)
package {
import flash.media.*;
public dynamic class Spas12Fire extends Sound {
}
}//package
Section 207
//Target (Target)
package {
import flash.display.*;
public dynamic class Target extends MovieClip {
public var TargetGraphic:MovieClip;
}
}//package
Section 208
//TargetBreak (TargetBreak)
package {
import flash.media.*;
public dynamic class TargetBreak extends Sound {
}
}//package
Section 209
//TopWallBG (TopWallBG)
package {
import flash.display.*;
public dynamic class TopWallBG extends MovieClip {
}
}//package
Section 210
//USP (USP)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class USP extends MovieClip {
public var FrontHand:MovieClip;
public var ReloadHand:MovieClip;
public var Launcher:MovieClip;
public function USP(){
addFrameScript(0, frame1, 3, frame4);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
function frame4(){
gotoAndStop(1);
}
}
}//package
Section 211
//USPFire (USPFire)
package {
import flash.media.*;
public dynamic class USPFire extends Sound {
}
}//package
Section 212
//UziFire (UziFire)
package {
import flash.media.*;
public dynamic class UziFire extends Sound {
}
}//package
Section 213
//WaltherPPK (WaltherPPK)
package {
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class WaltherPPK extends MovieClip {
public var GripHand:MovieClip;
public var FrontHand:MovieClip;
public var Launcher:MovieClip;
public function WaltherPPK(){
addFrameScript(0, frame1, 2, frame3);
}
function frame3(){
gotoAndStop(1);
}
function frame1(){
stop();
if (MovieClip(parent).Reloaded == false){
MovieClip(parent).Reloaded = true;
if (MovieClip(parent).ClipAmount > 0){
MovieClip(parent).ClipSize = (MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] + Math.floor((MovieClip(parent).WeaponType[MovieClip(parent).WeaponNum][7] * MovieClip(parent).AmmoIncrease)));
};
};
}
}
}//package
Section 214
//WaltherPPKFire (WaltherPPKFire)
package {
import flash.media.*;
public dynamic class WaltherPPKFire extends Sound {
}
}//package