STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229593
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2595 · P5190

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/77310121?noj=FRM77310121-21DC" width="1" height="1"></div>

Magic Pen.swf

This is the info page for
Flash #30069

(Click the ID number above for more basic data on this flash file.)


Text
<-

Your goal

Collect the flags
with the little red
ball to complete a
level.

Playing the game

Move the red ball
by drawing objects
and pushing it
around.

Drawing shapes

Hold down the left
mouse button to
draw.

You cannot draw
inside other
objects.

Drawing circles

To draw a circle,
hold the left mouse
button where you
want the center to
be.

Pins and hinges

Pins and hinges connect
objects. A pin fixes the
two objects, and a
hinge allows rotation.
You can put them on
the ball too.

Drawing pins

Hold "S", left click
to place the pin.
Then draw a figure
on top.

Drawing hinges

Hold "D", left click
to place the hinge.
Then draw a figure
on top.

Erasing

Hold "A", and click
inside a shape, pin
or hinge to erase
it.

BORRAR ESTO LUEGO
DE IMPORTAR

One moment, please...

Play on www.miniclip.com

Pins and hinges can be placed
in level objects marked with an X

Press`n hold left mouse
button until circle
is big enough

Thanks for playing!

LEVEL SELECT

SPACE: restart level

A: eraser

S: pin

D: hinge

?

select
level

select
level

Shapes Used:

1

Next Level

Level select

Play

Credits

OK, lets go!

If you get stuck on a level you can always select another.
But try not to give up too easily.

Level Select

Programming:
Alejandro guillen
Graphics:
Luis Brenes
Music:
PitbullJones
Testers
Sergio Andrea Laura Fullva

Back

Thanks to:
Erin catto and Mathew Bush for an
excellent physics engine
Petri Purho for making the original
crayon physics

This version is sitelocked to:
www.miniclip.com

ActionScript [AS3]

Section 1
//b2BoxDef (Box2D.Collision.Shapes.b2BoxDef) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; public class b2BoxDef extends b2ShapeDef { public var extents:b2Vec2; public function b2BoxDef(){ type = b2Shape.e_boxShape; extents = new b2Vec2(1, 1); } } }//package Box2D.Collision.Shapes
Section 2
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef) package Box2D.Collision.Shapes { public class b2CircleDef extends b2ShapeDef { public var radius:Number; public function b2CircleDef(){ type = b2Shape.e_circleShape; radius = 1; } } }//package Box2D.Collision.Shapes
Section 3
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; public class b2CircleShape extends b2Shape { public var m_localPosition:b2Vec2; public var m_radius:Number; public function b2CircleShape(_arg1:b2ShapeDef, _arg2:b2Body, _arg3:b2Vec2){ var _local4:b2CircleDef; var _local5:Number; var _local6:Number; var _local7:b2AABB; var _local8:b2BroadPhase; m_localPosition = new b2Vec2(); super(_arg1, _arg2); _local4 = (_arg1 as b2CircleDef); m_localPosition.Set((_arg1.localPosition.x - _arg3.x), (_arg1.localPosition.y - _arg3.y)); m_type = b2Shape.e_circleShape; m_radius = _local4.radius; m_R.SetM(m_body.m_R); _local5 = ((m_R.col1.x * m_localPosition.x) + (m_R.col2.x * m_localPosition.y)); _local6 = ((m_R.col1.y * m_localPosition.x) + (m_R.col2.y * m_localPosition.y)); m_position.x = (m_body.m_position.x + _local5); m_position.y = (m_body.m_position.y + _local6); m_maxRadius = (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))) + m_radius); _local7 = new b2AABB(); _local7.minVertex.Set((m_position.x - m_radius), (m_position.y - m_radius)); _local7.maxVertex.Set((m_position.x + m_radius), (m_position.y + m_radius)); _local8 = m_body.m_world.m_broadPhase; if (_local8.InRange(_local7)){ m_proxyId = _local8.CreateProxy(_local7, this); } else { m_proxyId = b2Pair.b2_nullProxy; }; if (m_proxyId == b2Pair.b2_nullProxy){ m_body.Freeze(); }; } override public function ResetProxy(_arg1:b2BroadPhase):void{ var _local2:b2Proxy; var _local3:b2AABB; if (m_proxyId == b2Pair.b2_nullProxy){ return; }; _local2 = _arg1.GetProxy(m_proxyId); _arg1.DestroyProxy(m_proxyId); _local2 = null; _local3 = new b2AABB(); _local3.minVertex.Set((m_position.x - m_radius), (m_position.y - m_radius)); _local3.maxVertex.Set((m_position.x + m_radius), (m_position.y + m_radius)); if (_arg1.InRange(_local3)){ m_proxyId = _arg1.CreateProxy(_local3, this); } else { m_proxyId = b2Pair.b2_nullProxy; }; if (m_proxyId == b2Pair.b2_nullProxy){ m_body.Freeze(); }; } override public function QuickSync(_arg1:b2Vec2, _arg2:b2Mat22):void{ m_R.SetM(_arg2); m_position.x = (((_arg2.col1.x * m_localPosition.x) + (_arg2.col2.x * m_localPosition.y)) + _arg1.x); m_position.y = (((_arg2.col1.y * m_localPosition.x) + (_arg2.col2.y * m_localPosition.y)) + _arg1.y); } override public function Support(_arg1:Number, _arg2:Number, _arg3:b2Vec2):void{ var _local4:Number; _local4 = Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))); _arg1 = (_arg1 / _local4); _arg2 = (_arg2 / _local4); _arg3.Set((m_position.x + (m_radius * _arg1)), (m_position.y + (m_radius * _arg2))); } override public function Synchronize(_arg1:b2Vec2, _arg2:b2Mat22, _arg3:b2Vec2, _arg4:b2Mat22):void{ var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:b2AABB; var _local12:b2BroadPhase; m_R.SetM(_arg4); m_position.x = (((_arg4.col1.x * m_localPosition.x) + (_arg4.col2.x * m_localPosition.y)) + _arg3.x); m_position.y = (((_arg4.col1.y * m_localPosition.x) + (_arg4.col2.y * m_localPosition.y)) + _arg3.y); if (m_proxyId == b2Pair.b2_nullProxy){ return; }; _local5 = (_arg1.x + ((_arg2.col1.x * m_localPosition.x) + (_arg2.col2.x * m_localPosition.y))); _local6 = (_arg1.y + ((_arg2.col1.y * m_localPosition.x) + (_arg2.col2.y * m_localPosition.y))); _local7 = Math.min(_local5, m_position.x); _local8 = Math.min(_local6, m_position.y); _local9 = Math.max(_local5, m_position.x); _local10 = Math.max(_local6, m_position.y); _local11 = new b2AABB(); _local11.minVertex.Set((_local7 - m_radius), (_local8 - m_radius)); _local11.maxVertex.Set((_local9 + m_radius), (_local10 + m_radius)); _local12 = m_body.m_world.m_broadPhase; if (_local12.InRange(_local11)){ _local12.MoveProxy(m_proxyId, _local11); } else { m_body.Freeze(); }; } override public function TestPoint(_arg1:b2Vec2):Boolean{ var _local2:b2Vec2; _local2 = new b2Vec2(); _local2.SetV(_arg1); _local2.Subtract(m_position); return ((b2Math.b2Dot(_local2, _local2) <= (m_radius * m_radius))); } } }//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
//b2PolyDef (Box2D.Collision.Shapes.b2PolyDef) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Common.*; public class b2PolyDef extends b2ShapeDef { public var vertexCount:int; public var vertices:Array; public function b2PolyDef(){ var _local1:int; vertices = new Array(b2Settings.b2_maxPolyVertices); super(); type = b2Shape.e_polyShape; vertexCount = 0; _local1 = 0; while (_local1 < b2Settings.b2_maxPolyVertices) { vertices[_local1] = new b2Vec2(); _local1++; }; } } }//package Box2D.Collision.Shapes
Section 6
//b2PolyShape (Box2D.Collision.Shapes.b2PolyShape) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2PolyShape extends b2Shape { public var m_vertices:Array; public var m_localOBB:b2OBB; public var m_normals:Array; public var m_vertexCount:int; private var syncMat:b2Mat22; public var m_coreVertices:Array; public var m_localCentroid:b2Vec2; private var syncAABB:b2AABB; private static var tempVec:b2Vec2 = new b2Vec2(); private static var tAbsR:b2Mat22 = new b2Mat22(); public function b2PolyShape(_arg1:b2ShapeDef, _arg2:b2Body, _arg3:b2Vec2){ var _local4:int; var _local5:Number; var _local6:Number; var _local7:b2Vec2; var _local8:b2AABB; var _local9:b2Mat22; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:int; var _local15:int; var _local16:Number; var _local17:Number; var _local18:b2BroadPhase; var _local19:b2BoxDef; var _local20:Number; var _local21:Number; var _local22:b2PolyDef; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local27:Number; var _local28:b2Vec2; syncAABB = new b2AABB(); syncMat = new b2Mat22(); m_localCentroid = new b2Vec2(); m_localOBB = new b2OBB(); super(_arg1, _arg2); _local8 = new b2AABB(); m_vertices = new Array(b2Settings.b2_maxPolyVertices); m_coreVertices = new Array(b2Settings.b2_maxPolyVertices); m_normals = new Array(b2Settings.b2_maxPolyVertices); m_type = b2Shape.e_polyShape; _local9 = new b2Mat22(_arg1.localRotation); if (_arg1.type == b2Shape.e_boxShape){ m_localCentroid.x = (_arg1.localPosition.x - _arg3.x); m_localCentroid.y = (_arg1.localPosition.y - _arg3.y); _local19 = (_arg1 as b2BoxDef); m_vertexCount = 4; _local5 = _local19.extents.x; _local6 = _local19.extents.y; _local20 = Math.max(0, (_local5 - (2 * b2Settings.b2_linearSlop))); _local21 = Math.max(0, (_local6 - (2 * b2Settings.b2_linearSlop))); _local7 = (m_vertices[0] = new b2Vec2()); _local7.x = ((_local9.col1.x * _local5) + (_local9.col2.x * _local6)); _local7.y = ((_local9.col1.y * _local5) + (_local9.col2.y * _local6)); _local7 = (m_vertices[1] = new b2Vec2()); _local7.x = ((_local9.col1.x * -(_local5)) + (_local9.col2.x * _local6)); _local7.y = ((_local9.col1.y * -(_local5)) + (_local9.col2.y * _local6)); _local7 = (m_vertices[2] = new b2Vec2()); _local7.x = ((_local9.col1.x * -(_local5)) + (_local9.col2.x * -(_local6))); _local7.y = ((_local9.col1.y * -(_local5)) + (_local9.col2.y * -(_local6))); _local7 = (m_vertices[3] = new b2Vec2()); _local7.x = ((_local9.col1.x * _local5) + (_local9.col2.x * -(_local6))); _local7.y = ((_local9.col1.y * _local5) + (_local9.col2.y * -(_local6))); _local7 = (m_coreVertices[0] = new b2Vec2()); _local7.x = ((_local9.col1.x * _local20) + (_local9.col2.x * _local21)); _local7.y = ((_local9.col1.y * _local20) + (_local9.col2.y * _local21)); _local7 = (m_coreVertices[1] = new b2Vec2()); _local7.x = ((_local9.col1.x * -(_local20)) + (_local9.col2.x * _local21)); _local7.y = ((_local9.col1.y * -(_local20)) + (_local9.col2.y * _local21)); _local7 = (m_coreVertices[2] = new b2Vec2()); _local7.x = ((_local9.col1.x * -(_local20)) + (_local9.col2.x * -(_local21))); _local7.y = ((_local9.col1.y * -(_local20)) + (_local9.col2.y * -(_local21))); _local7 = (m_coreVertices[3] = new b2Vec2()); _local7.x = ((_local9.col1.x * _local20) + (_local9.col2.x * -(_local21))); _local7.y = ((_local9.col1.y * _local20) + (_local9.col2.y * -(_local21))); } else { _local22 = (_arg1 as b2PolyDef); m_vertexCount = _local22.vertexCount; PolyCentroid(_local22.vertices, _local22.vertexCount, tempVec); _local23 = tempVec.x; _local24 = tempVec.y; m_localCentroid.x = ((_arg1.localPosition.x + ((_local9.col1.x * _local23) + (_local9.col2.x * _local24))) - _arg3.x); m_localCentroid.y = ((_arg1.localPosition.y + ((_local9.col1.y * _local23) + (_local9.col2.y * _local24))) - _arg3.y); _local4 = 0; while (_local4 < m_vertexCount) { m_vertices[_local4] = new b2Vec2(); m_coreVertices[_local4] = new b2Vec2(); _local5 = (_local22.vertices[_local4].x - _local23); _local6 = (_local22.vertices[_local4].y - _local24); m_vertices[_local4].x = ((_local9.col1.x * _local5) + (_local9.col2.x * _local6)); m_vertices[_local4].y = ((_local9.col1.y * _local5) + (_local9.col2.y * _local6)); _local25 = m_vertices[_local4].x; _local26 = m_vertices[_local4].y; _local27 = Math.sqrt(((_local25 * _local25) + (_local26 * _local26))); if (_local27 > Number.MIN_VALUE){ _local25 = (_local25 * (1 / _local27)); _local26 = (_local26 * (1 / _local27)); }; m_coreVertices[_local4].x = (m_vertices[_local4].x - ((2 * b2Settings.b2_linearSlop) * _local25)); m_coreVertices[_local4].y = (m_vertices[_local4].y - ((2 * b2Settings.b2_linearSlop) * _local26)); _local4++; }; }; _local10 = Number.MAX_VALUE; _local11 = Number.MAX_VALUE; _local12 = -(Number.MAX_VALUE); _local13 = -(Number.MAX_VALUE); m_maxRadius = 0; _local4 = 0; while (_local4 < m_vertexCount) { _local28 = m_vertices[_local4]; _local10 = Math.min(_local10, _local28.x); _local11 = Math.min(_local11, _local28.y); _local12 = Math.max(_local12, _local28.x); _local13 = Math.max(_local13, _local28.y); m_maxRadius = Math.max(m_maxRadius, _local28.Length()); _local4++; }; m_localOBB.R.SetIdentity(); m_localOBB.center.Set(((_local10 + _local12) * 0.5), ((_local11 + _local13) * 0.5)); m_localOBB.extents.Set(((_local12 - _local10) * 0.5), ((_local13 - _local11) * 0.5)); _local4 = 0; while (_local4 < m_vertexCount) { m_normals[_local4] = new b2Vec2(); _local14 = _local4; _local15 = (((_local4 + 1) < m_vertexCount)) ? (_local4 + 1) : 0; m_normals[_local4].x = (m_vertices[_local15].y - m_vertices[_local14].y); m_normals[_local4].y = -((m_vertices[_local15].x - m_vertices[_local14].x)); m_normals[_local4].Normalize(); _local4++; }; _local4 = 0; while (_local4 < m_vertexCount) { _local14 = _local4; _local15 = (((_local4 + 1) < m_vertexCount)) ? (_local4 + 1) : 0; _local4++; }; m_R.SetM(m_body.m_R); m_position.x = (m_body.m_position.x + ((m_R.col1.x * m_localCentroid.x) + (m_R.col2.x * m_localCentroid.y))); m_position.y = (m_body.m_position.y + ((m_R.col1.y * m_localCentroid.x) + (m_R.col2.y * m_localCentroid.y))); tAbsR.col1.x = ((m_R.col1.x * m_localOBB.R.col1.x) + (m_R.col2.x * m_localOBB.R.col1.y)); tAbsR.col1.y = ((m_R.col1.y * m_localOBB.R.col1.x) + (m_R.col2.y * m_localOBB.R.col1.y)); tAbsR.col2.x = ((m_R.col1.x * m_localOBB.R.col2.x) + (m_R.col2.x * m_localOBB.R.col2.y)); tAbsR.col2.y = ((m_R.col1.y * m_localOBB.R.col2.x) + (m_R.col2.y * m_localOBB.R.col2.y)); tAbsR.Abs(); _local5 = ((tAbsR.col1.x * m_localOBB.extents.x) + (tAbsR.col2.x * m_localOBB.extents.y)); _local6 = ((tAbsR.col1.y * m_localOBB.extents.x) + (tAbsR.col2.y * m_localOBB.extents.y)); _local16 = (m_position.x + ((m_R.col1.x * m_localOBB.center.x) + (m_R.col2.x * m_localOBB.center.y))); _local17 = (m_position.y + ((m_R.col1.y * m_localOBB.center.x) + (m_R.col2.y * m_localOBB.center.y))); _local8.minVertex.x = (_local16 - _local5); _local8.minVertex.y = (_local17 - _local6); _local8.maxVertex.x = (_local16 + _local5); _local8.maxVertex.y = (_local17 + _local6); _local18 = m_body.m_world.m_broadPhase; if (_local18.InRange(_local8)){ m_proxyId = _local18.CreateProxy(_local8, this); } else { m_proxyId = b2Pair.b2_nullProxy; }; if (m_proxyId == b2Pair.b2_nullProxy){ m_body.Freeze(); }; } override public function QuickSync(_arg1:b2Vec2, _arg2:b2Mat22):void{ m_R.SetM(_arg2); m_position.x = (_arg1.x + ((_arg2.col1.x * m_localCentroid.x) + (_arg2.col2.x * m_localCentroid.y))); m_position.y = (_arg1.y + ((_arg2.col1.y * m_localCentroid.x) + (_arg2.col2.y * m_localCentroid.y))); } override public function Support(_arg1:Number, _arg2:Number, _arg3:b2Vec2):void{ var _local4:Number; var _local5:Number; var _local6:int; var _local7:Number; var _local8:int; var _local9:Number; _local4 = ((_arg1 * m_R.col1.x) + (_arg2 * m_R.col1.y)); _local5 = ((_arg1 * m_R.col2.x) + (_arg2 * m_R.col2.y)); _local6 = 0; _local7 = ((m_coreVertices[0].x * _local4) + (m_coreVertices[0].y * _local5)); _local8 = 1; while (_local8 < m_vertexCount) { _local9 = ((m_coreVertices[_local8].x * _local4) + (m_coreVertices[_local8].y * _local5)); if (_local9 > _local7){ _local6 = _local8; _local7 = _local9; }; _local8++; }; _arg3.Set((m_position.x + ((m_R.col1.x * m_coreVertices[_local6].x) + (m_R.col2.x * m_coreVertices[_local6].y))), (m_position.y + ((m_R.col1.y * m_coreVertices[_local6].x) + (m_R.col2.y * m_coreVertices[_local6].y)))); } override public function Synchronize(_arg1:b2Vec2, _arg2:b2Mat22, _arg3:b2Vec2, _arg4:b2Mat22):void{ var _local5:Number; var _local6:Number; var _local7:b2Vec2; var _local8:b2Vec2; var _local9:b2Vec2; var _local10:b2Vec2; var _local11:Number; var _local12:Number; var _local13:b2BroadPhase; m_R.SetM(_arg4); m_position.x = (m_body.m_position.x + ((_arg4.col1.x * m_localCentroid.x) + (_arg4.col2.x * m_localCentroid.y))); m_position.y = (m_body.m_position.y + ((_arg4.col1.y * m_localCentroid.x) + (_arg4.col2.y * m_localCentroid.y))); if (m_proxyId == b2Pair.b2_nullProxy){ return; }; _local7 = _arg2.col1; _local8 = _arg2.col2; _local9 = m_localOBB.R.col1; _local10 = m_localOBB.R.col2; syncMat.col1.x = ((_local7.x * _local9.x) + (_local8.x * _local9.y)); syncMat.col1.y = ((_local7.y * _local9.x) + (_local8.y * _local9.y)); syncMat.col2.x = ((_local7.x * _local10.x) + (_local8.x * _local10.y)); syncMat.col2.y = ((_local7.y * _local10.x) + (_local8.y * _local10.y)); syncMat.Abs(); _local5 = (m_localCentroid.x + m_localOBB.center.x); _local6 = (m_localCentroid.y + m_localOBB.center.y); _local11 = (_arg1.x + ((_arg2.col1.x * _local5) + (_arg2.col2.x * _local6))); _local12 = (_arg1.y + ((_arg2.col1.y * _local5) + (_arg2.col2.y * _local6))); _local5 = ((syncMat.col1.x * m_localOBB.extents.x) + (syncMat.col2.x * m_localOBB.extents.y)); _local6 = ((syncMat.col1.y * m_localOBB.extents.x) + (syncMat.col2.y * m_localOBB.extents.y)); syncAABB.minVertex.x = (_local11 - _local5); syncAABB.minVertex.y = (_local12 - _local6); syncAABB.maxVertex.x = (_local11 + _local5); syncAABB.maxVertex.y = (_local12 + _local6); _local7 = _arg4.col1; _local8 = _arg4.col2; _local9 = m_localOBB.R.col1; _local10 = m_localOBB.R.col2; syncMat.col1.x = ((_local7.x * _local9.x) + (_local8.x * _local9.y)); syncMat.col1.y = ((_local7.y * _local9.x) + (_local8.y * _local9.y)); syncMat.col2.x = ((_local7.x * _local10.x) + (_local8.x * _local10.y)); syncMat.col2.y = ((_local7.y * _local10.x) + (_local8.y * _local10.y)); syncMat.Abs(); _local5 = (m_localCentroid.x + m_localOBB.center.x); _local6 = (m_localCentroid.y + m_localOBB.center.y); _local11 = (_arg3.x + ((_arg4.col1.x * _local5) + (_arg4.col2.x * _local6))); _local12 = (_arg3.y + ((_arg4.col1.y * _local5) + (_arg4.col2.y * _local6))); _local5 = ((syncMat.col1.x * m_localOBB.extents.x) + (syncMat.col2.x * m_localOBB.extents.y)); _local6 = ((syncMat.col1.y * m_localOBB.extents.x) + (syncMat.col2.y * m_localOBB.extents.y)); syncAABB.minVertex.x = Math.min(syncAABB.minVertex.x, (_local11 - _local5)); syncAABB.minVertex.y = Math.min(syncAABB.minVertex.y, (_local12 - _local6)); syncAABB.maxVertex.x = Math.max(syncAABB.maxVertex.x, (_local11 + _local5)); syncAABB.maxVertex.y = Math.max(syncAABB.maxVertex.y, (_local12 + _local6)); _local13 = m_body.m_world.m_broadPhase; if (_local13.InRange(syncAABB)){ _local13.MoveProxy(m_proxyId, syncAABB); } else { m_body.Freeze(); }; } override public function TestPoint(_arg1:b2Vec2):Boolean{ var _local2:b2Vec2; var _local3:int; var _local4:b2Vec2; var _local5:Number; _local2 = new b2Vec2(); _local2.SetV(_arg1); _local2.Subtract(m_position); _local2.MulTM(m_R); _local3 = 0; while (_local3 < m_vertexCount) { _local4 = new b2Vec2(); _local4.SetV(_local2); _local4.Subtract(m_vertices[_local3]); _local5 = b2Math.b2Dot(m_normals[_local3], _local4); if (_local5 > 0){ return (false); }; _local3++; }; return (true); } override public function ResetProxy(_arg1:b2BroadPhase):void{ var _local2:b2Proxy; var _local3:b2Mat22; var _local4:b2Mat22; var _local5:b2Vec2; var _local6:b2Vec2; var _local7:b2AABB; if (m_proxyId == b2Pair.b2_nullProxy){ return; }; _local2 = _arg1.GetProxy(m_proxyId); _arg1.DestroyProxy(m_proxyId); _local2 = null; _local3 = b2Math.b2MulMM(m_R, m_localOBB.R); _local4 = b2Math.b2AbsM(_local3); _local5 = b2Math.b2MulMV(_local4, m_localOBB.extents); _local6 = b2Math.b2MulMV(m_R, m_localOBB.center); _local6.Add(m_position); _local7 = new b2AABB(); _local7.minVertex.SetV(_local6); _local7.minVertex.Subtract(_local5); _local7.maxVertex.SetV(_local6); _local7.maxVertex.Add(_local5); if (_arg1.InRange(_local7)){ m_proxyId = _arg1.CreateProxy(_local7, this); } else { m_proxyId = b2Pair.b2_nullProxy; }; if (m_proxyId == b2Pair.b2_nullProxy){ m_body.Freeze(); }; } } }//package Box2D.Collision.Shapes
Section 7
//b2Shape (Box2D.Collision.Shapes.b2Shape) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2Shape { public var m_body:b2Body; public var m_maxRadius:Number; public var m_next:b2Shape; public var m_R:b2Mat22; public var m_type:int; public var m_friction:Number; public var m_proxyId:uint; public var m_maskBits:uint; public var m_groupIndex:int; public var m_userData;// = null public var m_restitution:Number; public var m_position:b2Vec2; public var m_categoryBits:uint; public static const e_boxShape:int = 1; public static const e_unknownShape:int = -1; public static const e_shapeTypeCount:int = 4; public static const e_circleShape:int = 0; public static const e_meshShape:int = 3; public static const e_polyShape:int = 2; public function b2Shape(_arg1:b2ShapeDef, _arg2:b2Body){ m_R = new b2Mat22(); m_position = new b2Vec2(); m_userData = null; super(); m_userData = _arg1.userData; m_friction = _arg1.friction; m_restitution = _arg1.restitution; m_body = _arg2; m_proxyId = b2Pair.b2_nullProxy; m_maxRadius = 0; m_categoryBits = _arg1.categoryBits; m_maskBits = _arg1.maskBits; m_groupIndex = _arg1.groupIndex; } public function GetMaxRadius():Number{ return (m_maxRadius); } public function GetPosition():b2Vec2{ return (m_position); } public function QuickSync(_arg1:b2Vec2, _arg2:b2Mat22):void{ } public function GetNext():b2Shape{ return (m_next); } public function GetType():int{ return (m_type); } public function GetUserData(){ return (m_userData); } public function Support(_arg1:Number, _arg2:Number, _arg3:b2Vec2):void{ } public function Synchronize(_arg1:b2Vec2, _arg2:b2Mat22, _arg3:b2Vec2, _arg4:b2Mat22):void{ } public function DestroyProxy():void{ if (m_proxyId != b2Pair.b2_nullProxy){ m_body.m_world.m_broadPhase.DestroyProxy(m_proxyId); m_proxyId = b2Pair.b2_nullProxy; }; } public function GetRotationMatrix():b2Mat22{ return (m_R); } public function GetBody():b2Body{ return (m_body); } public function TestPoint(_arg1:b2Vec2):Boolean{ return (false); } public function ResetProxy(_arg1:b2BroadPhase):void{ } public static function Destroy(_arg1:b2Shape):void{ if (_arg1.m_proxyId != b2Pair.b2_nullProxy){ _arg1.m_body.m_world.m_broadPhase.DestroyProxy(_arg1.m_proxyId); }; } public static function PolyMass(_arg1:b2MassData, _arg2:Array, _arg3:int, _arg4:Number):void{ var _local5:b2Vec2; var _local6:Number; var _local7:Number; var _local8:b2Vec2; var _local9:Number; var _local10:int; var _local11:b2Vec2; var _local12:b2Vec2; var _local13:b2Vec2; var _local14:b2Vec2; var _local15:b2Vec2; var _local16:Number; var _local17:Number; var _local18:b2Vec2; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; _local5 = new b2Vec2(); _local5.SetZero(); _local6 = 0; _local7 = 0; _local8 = new b2Vec2(0, 0); _local9 = (1 / 3); _local10 = 0; while (_local10 < _arg3) { _local11 = _local8; _local12 = _arg2[_local10]; _local13 = (((_local10 + 1) < _arg3)) ? _arg2[(_local10 + 1)] : _arg2[0]; _local14 = b2Math.SubtractVV(_local12, _local11); _local15 = b2Math.SubtractVV(_local13, _local11); _local16 = b2Math.b2CrossVV(_local14, _local15); _local17 = (0.5 * _local16); _local6 = (_local6 + _local17); _local18 = new b2Vec2(); _local18.SetV(_local11); _local18.Add(_local12); _local18.Add(_local13); _local18.Multiply((_local9 * _local17)); _local5.Add(_local18); _local19 = _local11.x; _local20 = _local11.y; _local21 = _local14.x; _local22 = _local14.y; _local23 = _local15.x; _local24 = _local15.y; _local25 = ((_local9 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19)); _local26 = ((_local9 * ((0.25 * (((_local22 * _local22) + (_local24 * _local22)) + (_local24 * _local24))) + ((_local20 * _local22) + (_local20 * _local24)))) + ((0.5 * _local20) * _local20)); _local7 = (_local7 + (_local16 * (_local25 + _local26))); _local10++; }; _arg1.mass = (_arg4 * _local6); _local5.Multiply((1 / _local6)); _arg1.center = _local5; _local7 = (_arg4 * (_local7 - (_local6 * b2Math.b2Dot(_local5, _local5)))); _arg1.I = _local7; } public static function PolyCentroid(_arg1:Array, _arg2:int, _arg3:b2Vec2):void{ var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:int; 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; _local4 = 0; _local5 = 0; _local6 = 0; _local7 = 0; _local8 = 0; _local9 = (1 / 3); _local10 = 0; while (_local10 < _arg2) { _local11 = _local7; _local12 = _local8; _local13 = _arg1[_local10].x; _local14 = _arg1[_local10].y; _local15 = (((_local10 + 1) < _arg2)) ? _arg1[(_local10 + 1)].x : _arg1[0].x; _local16 = (((_local10 + 1) < _arg2)) ? _arg1[(_local10 + 1)].y : _arg1[0].y; _local17 = (_local13 - _local11); _local18 = (_local14 - _local12); _local19 = (_local15 - _local11); _local20 = (_local16 - _local12); _local21 = ((_local17 * _local20) - (_local18 * _local19)); _local22 = (0.5 * _local21); _local6 = (_local6 + _local22); _local4 = (_local4 + ((_local22 * _local9) * ((_local11 + _local13) + _local15))); _local5 = (_local5 + ((_local22 * _local9) * ((_local12 + _local14) + _local16))); _local10++; }; _local4 = (_local4 * (1 / _local6)); _local5 = (_local5 * (1 / _local6)); _arg3.Set(_local4, _local5); } public static function Create(_arg1:b2ShapeDef, _arg2:b2Body, _arg3:b2Vec2):b2Shape{ switch (_arg1.type){ case e_circleShape: return (new b2CircleShape(_arg1, _arg2, _arg3)); case e_boxShape: case e_polyShape: return (new b2PolyShape(_arg1, _arg2, _arg3)); }; return (null); } } }//package Box2D.Collision.Shapes
Section 8
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Common.*; public class b2ShapeDef { public var groupIndex:int; public var categoryBits:int; public var localRotation:Number; public var restitution:Number; public var userData;// = null public var density:Number; public var maskBits:int; public var type:int; public var localPosition:b2Vec2; public var friction:Number; public function b2ShapeDef(){ userData = null; super(); type = b2Shape.e_unknownShape; userData = null; localPosition = new b2Vec2(0, 0); localRotation = 0; friction = 0.2; restitution = 0; density = 0; categoryBits = 1; maskBits = 0xFFFF; groupIndex = 0; } public function ComputeMass(_arg1:b2MassData):void{ var _local2:b2CircleDef; var _local3:b2BoxDef; var _local4:b2PolyDef; _arg1.center = new b2Vec2(0, 0); if (density == 0){ _arg1.mass = 0; _arg1.center.Set(0, 0); _arg1.I = 0; }; switch (type){ case b2Shape.e_circleShape: _local2 = (this as b2CircleDef); _arg1.mass = (((density * b2Settings.b2_pi) * _local2.radius) * _local2.radius); _arg1.center.Set(0, 0); _arg1.I = (((0.5 * _arg1.mass) * _local2.radius) * _local2.radius); break; case b2Shape.e_boxShape: _local3 = (this as b2BoxDef); _arg1.mass = (((4 * density) * _local3.extents.x) * _local3.extents.y); _arg1.center.Set(0, 0); _arg1.I = ((_arg1.mass / 3) * b2Math.b2Dot(_local3.extents, _local3.extents)); break; case b2Shape.e_polyShape: _local4 = (this as b2PolyDef); b2Shape.PolyMass(_arg1, _local4.vertices, _local4.vertexCount, density); break; default: _arg1.mass = 0; _arg1.center.Set(0, 0); _arg1.I = 0; break; }; } } }//package Box2D.Collision.Shapes
Section 9
//b2AABB (Box2D.Collision.b2AABB) package Box2D.Collision { import Box2D.Common.Math.*; public class b2AABB { public var minVertex:b2Vec2; public var maxVertex:b2Vec2; public function b2AABB(){ minVertex = new b2Vec2(); maxVertex = new b2Vec2(); super(); } public function IsValid():Boolean{ var _local1:Number; var _local2:Number; var _local3:Boolean; _local1 = maxVertex.x; _local2 = maxVertex.y; _local1 = maxVertex.x; _local2 = maxVertex.y; _local1 = (_local1 - minVertex.x); _local2 = (_local2 - minVertex.y); _local3 = (((_local1 >= 0)) && ((_local2 >= 0))); _local3 = ((((_local3) && (minVertex.IsValid()))) && (maxVertex.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 = 0xFFFF; public static const b2_invalid:uint = 0xFFFF; 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.maxVertex.x; _local5 = _arg1.maxVertex.y; _local4 = (_local4 - _arg1.minVertex.x); _local5 = (_local5 - _arg1.minVertex.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[(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{ if ((((_arg1 == b2Pair.b2_nullProxy)) || ((m_proxyPool[_arg1].IsValid() == false)))){ return (null); }; return (m_proxyPool[_arg1]); } private function IncrementTimeStamp():void{ var _local1:uint; if (m_timeStamp == b2Settings.USHRT_MAX){ _local1 = 0; while (_local1 < b2Settings.b2_maxProxies) { m_proxyPool[_local1].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:uint; var _local11:int; var _local12:int; var _local13:b2Proxy; _local8 = BinarySearch(_arg5, _arg6, _arg3); _local9 = BinarySearch(_arg5, _arg6, _arg4); _local10 = _local8; while (_local10 < _local9) { if (_arg5[_local10].IsLower()){ IncrementOverlapCount(_arg5[_local10].proxyId); }; _local10++; }; if (_local8 > 0){ _local11 = (_local8 - 1); _local12 = _arg5[_local11].stabbingCount; while (_local12) { if (_arg5[_local11].IsLower()){ _local13 = m_proxyPool[_arg5[_local11].proxyId]; if (_local8 <= _local13.upperBounds[_arg7]){ IncrementOverlapCount(_arg5[_local11].proxyId); _local12--; }; }; _local11--; }; }; _arg1[0] = _local8; _arg2[0] = _local9; } private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{ var _local3:int; var _local4:Array; _local3 = 0; while (_local3 < 2) { _local4 = m_bounds[_local3]; if (_local4[_arg1.lowerBounds[_local3]].value > _local4[_arg2.upperBounds[_local3]].value){ return (false); }; if (_local4[_arg1.upperBounds[_local3]].value < _local4[_arg2.lowerBounds[_local3]].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.minVertex.x; _local5 = _arg3.minVertex.y; _local4 = b2Math.b2Min(_local4, m_worldAABB.maxVertex.x); _local5 = b2Math.b2Min(_local5, m_worldAABB.maxVertex.y); _local4 = b2Math.b2Max(_local4, m_worldAABB.minVertex.x); _local5 = b2Math.b2Max(_local5, m_worldAABB.minVertex.y); _local6 = _arg3.maxVertex.x; _local7 = _arg3.maxVertex.y; _local6 = b2Math.b2Min(_local6, m_worldAABB.maxVertex.x); _local7 = b2Math.b2Min(_local7, m_worldAABB.maxVertex.y); _local6 = b2Math.b2Max(_local6, m_worldAABB.minVertex.x); _local7 = b2Math.b2Max(_local7, m_worldAABB.minVertex.y); _arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.minVertex.x))) & (b2Settings.USHRT_MAX - 1)); _arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.minVertex.x))) & 0xFFFF) | 1); _arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.minVertex.y))) & (b2Settings.USHRT_MAX - 1)); _arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.minVertex.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:int; var _local22: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[(_local13 + _local17)]; _local19.value = _local20.value; _local19.proxyId = _local20.proxyId; _local19.stabbingCount = _local20.stabbingCount; _local17++; }; _local18 = _local16.length; _local21 = (_local13 + 2); _local17 = 0; while (_local17 < _local18) { _local20 = _local16[_local17]; _local19 = _local11[(_local21 + _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[(_local12 + _local17)]; _local19.value = _local20.value; _local19.proxyId = _local20.proxyId; _local19.stabbingCount = _local20.stabbingCount; _local17++; }; _local18 = _local16.length; _local21 = (_local12 + 1); _local17 = 0; while (_local17 < _local18) { _local20 = _local16[_local17]; _local19 = _local11[(_local21 + _local17)]; _local19.value = _local20.value; _local19.proxyId = _local20.proxyId; _local19.stabbingCount = _local20.stabbingCount; _local17++; }; _local13++; _local11[_local12].value = _local7[_local9]; _local11[_local12].proxyId = _local5; _local11[_local13].value = _local8[_local9]; _local11[_local13].proxyId = _local5; _local11[_local12].stabbingCount = ((_local12 == 0)) ? 0 : _local11[(_local12 - 1)].stabbingCount; _local11[_local13].stabbingCount = _local11[(_local13 - 1)].stabbingCount; _local3 = _local12; while (_local3 < _local13) { _local11[_local3].stabbingCount++; _local3++; }; _local3 = _local12; while (_local3 < (_local6 + 2)) { _local22 = m_proxyPool[_local11[_local3].proxyId]; if (_local11[_local3].IsLower()){ _local22.lowerBounds[_local9] = _local3; } else { _local22.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:b2Proxy; var _local3:int; var _local4:int; var _local5:int; var _local6:Array; var _local7:uint; var _local8:uint; var _local9:uint; var _local10:uint; var _local11:Array; var _local12:int; var _local13:int; var _local14:b2Bound; var _local15:b2Bound; var _local16:int; var _local17:uint; var _local18:int; var _local19:b2Proxy; _local2 = m_proxyPool[_arg1]; _local3 = (2 * m_proxyCount); _local4 = 0; while (_local4 < 2) { _local6 = m_bounds[_local4]; _local7 = _local2.lowerBounds[_local4]; _local8 = _local2.upperBounds[_local4]; _local9 = _local6[_local7].value; _local10 = _local6[_local8].value; _local11 = new Array(); _local13 = ((_local8 - _local7) - 1); _local12 = 0; while (_local12 < _local13) { _local11[_local12] = new b2Bound(); _local14 = _local11[_local12]; _local15 = _local6[((_local7 + 1) + _local12)]; _local14.value = _local15.value; _local14.proxyId = _local15.proxyId; _local14.stabbingCount = _local15.stabbingCount; _local12++; }; _local13 = _local11.length; _local16 = _local7; _local12 = 0; while (_local12 < _local13) { _local15 = _local11[_local12]; _local14 = _local6[(_local16 + _local12)]; _local14.value = _local15.value; _local14.proxyId = _local15.proxyId; _local14.stabbingCount = _local15.stabbingCount; _local12++; }; _local11 = new Array(); _local13 = ((_local3 - _local8) - 1); _local12 = 0; while (_local12 < _local13) { _local11[_local12] = new b2Bound(); _local14 = _local11[_local12]; _local15 = _local6[((_local8 + 1) + _local12)]; _local14.value = _local15.value; _local14.proxyId = _local15.proxyId; _local14.stabbingCount = _local15.stabbingCount; _local12++; }; _local13 = _local11.length; _local16 = (_local8 - 1); _local12 = 0; while (_local12 < _local13) { _local15 = _local11[_local12]; _local14 = _local6[(_local16 + _local12)]; _local14.value = _local15.value; _local14.proxyId = _local15.proxyId; _local14.stabbingCount = _local15.stabbingCount; _local12++; }; _local13 = (_local3 - 2); _local17 = _local7; while (_local17 < _local13) { _local19 = m_proxyPool[_local6[_local17].proxyId]; if (_local6[_local17].IsLower()){ _local19.lowerBounds[_local4] = _local17; } else { _local19.upperBounds[_local4] = _local17; }; _local17++; }; _local13 = (_local8 - 1); _local18 = _local7; while (_local18 < _local13) { _local6[_local18].stabbingCount--; _local18++; }; Query([0], [0], _local9, _local10, _local6, (_local3 - 2), _local4); _local4++; }; _local5 = 0; while (_local5 < m_queryResultCount) { m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local5]); _local5++; }; m_pairManager.Commit(); m_queryResultCount = 0; IncrementTimeStamp(); _local2.userData = null; _local2.overlapCount = b2_invalid; _local2.lowerBounds[0] = b2_invalid; _local2.lowerBounds[1] = b2_invalid; _local2.upperBounds[0] = b2_invalid; _local2.upperBounds[1] = b2_invalid; _local2.SetNext(m_freeProxy); m_freeProxy = _arg1; m_proxyCount--; } public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{ var _local3:int; var _local4:Array; _local3 = 0; while (_local3 < 2) { _local4 = m_bounds[_local3]; if (_arg1.lowerValues[_local3] > _local4[_arg2.upperBounds[_local3]].value){ return (false); }; if (_arg1.upperValues[_local3] < _local4[_arg2.lowerBounds[_local3]].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.minVertex.x; _local3 = _arg1.minVertex.y; _local2 = (_local2 - m_worldAABB.maxVertex.x); _local3 = (_local3 - m_worldAABB.maxVertex.y); _local4 = m_worldAABB.minVertex.x; _local5 = m_worldAABB.minVertex.y; _local4 = (_local4 - _arg1.maxVertex.x); _local5 = (_local5 - _arg1.maxVertex.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:uint; var _local4:uint; var _local5:b2Bound; var _local6:b2Bound; var _local7:b2Bound; var _local8:uint; var _local9:b2Proxy; var _local10:uint; var _local11:b2Proxy; var _local12:b2BoundValues; var _local13:b2BoundValues; var _local14:Array; var _local15:uint; var _local16:uint; var _local17:uint; var _local18:uint; var _local19:int; var _local20:int; var _local21:uint; var _local22:b2Proxy; if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){ return; }; if (_arg2.IsValid() == false){ return; }; _local10 = (2 * m_proxyCount); _local11 = m_proxyPool[_arg1]; _local12 = new b2BoundValues(); ComputeBounds(_local12.lowerValues, _local12.upperValues, _arg2); _local13 = new b2BoundValues(); _local3 = 0; while (_local3 < 2) { _local13.lowerValues[_local3] = m_bounds[_local3][_local11.lowerBounds[_local3]].value; _local13.upperValues[_local3] = m_bounds[_local3][_local11.upperBounds[_local3]].value; _local3++; }; _local3 = 0; while (_local3 < 2) { _local14 = m_bounds[_local3]; _local15 = _local11.lowerBounds[_local3]; _local16 = _local11.upperBounds[_local3]; _local17 = _local12.lowerValues[_local3]; _local18 = _local12.upperValues[_local3]; _local19 = (_local17 - _local14[_local15].value); _local20 = (_local18 - _local14[_local16].value); _local14[_local15].value = _local17; _local14[_local16].value = _local18; if (_local19 < 0){ _local4 = _local15; while ((((_local4 > 0)) && ((_local17 < _local14[(_local4 - 1)].value)))) { _local5 = _local14[_local4]; _local6 = _local14[(_local4 - 1)]; _local21 = _local6.proxyId; _local22 = m_proxyPool[_local6.proxyId]; _local6.stabbingCount++; if (_local6.IsUpper() == true){ if (TestOverlap(_local12, _local22)){ m_pairManager.AddBufferedPair(_arg1, _local21); }; var _local23 = _local22.upperBounds; var _local24 = _local3; var _local25 = (_local23[_local24] + 1); _local23[_local24] = _local25; _local5.stabbingCount++; } else { _local23 = _local22.lowerBounds; _local24 = _local3; _local25 = (_local23[_local24] + 1); _local23[_local24] = _local25; _local5.stabbingCount--; }; _local23 = _local11.lowerBounds; _local24 = _local3; _local25 = (_local23[_local24] - 1); _local23[_local24] = _local25; _local5.Swap(_local6); _local4--; }; }; if (_local20 > 0){ _local4 = _local16; while ((((_local4 < (_local10 - 1))) && ((_local14[(_local4 + 1)].value <= _local18)))) { _local5 = _local14[_local4]; _local7 = _local14[(_local4 + 1)]; _local8 = _local7.proxyId; _local9 = m_proxyPool[_local8]; _local7.stabbingCount++; if (_local7.IsLower() == true){ if (TestOverlap(_local12, _local9)){ m_pairManager.AddBufferedPair(_arg1, _local8); }; _local23 = _local9.lowerBounds; _local24 = _local3; _local25 = (_local23[_local24] - 1); _local23[_local24] = _local25; _local5.stabbingCount++; } else { _local23 = _local9.upperBounds; _local24 = _local3; _local25 = (_local23[_local24] - 1); _local23[_local24] = _local25; _local5.stabbingCount--; }; _local23 = _local11.upperBounds; _local24 = _local3; _local25 = (_local23[_local24] + 1); _local23[_local24] = _local25; _local5.Swap(_local7); _local4++; }; }; if (_local19 > 0){ _local4 = _local15; while ((((_local4 < (_local10 - 1))) && ((_local14[(_local4 + 1)].value <= _local17)))) { _local5 = _local14[_local4]; _local7 = _local14[(_local4 + 1)]; _local8 = _local7.proxyId; _local9 = m_proxyPool[_local8]; _local7.stabbingCount--; if (_local7.IsUpper()){ if (TestOverlap(_local13, _local9)){ m_pairManager.RemoveBufferedPair(_arg1, _local8); }; _local23 = _local9.upperBounds; _local24 = _local3; _local25 = (_local23[_local24] - 1); _local23[_local24] = _local25; _local5.stabbingCount--; } else { _local23 = _local9.lowerBounds; _local24 = _local3; _local25 = (_local23[_local24] - 1); _local23[_local24] = _local25; _local5.stabbingCount++; }; _local23 = _local11.lowerBounds; _local24 = _local3; _local25 = (_local23[_local24] + 1); _local23[_local24] = _local25; _local5.Swap(_local7); _local4++; }; }; if (_local20 < 0){ _local4 = _local16; while ((((_local4 > 0)) && ((_local18 < _local14[(_local4 - 1)].value)))) { _local5 = _local14[_local4]; _local6 = _local14[(_local4 - 1)]; _local21 = _local6.proxyId; _local22 = m_proxyPool[_local21]; _local6.stabbingCount--; if (_local6.IsLower() == true){ if (TestOverlap(_local13, _local22)){ m_pairManager.RemoveBufferedPair(_arg1, _local21); }; _local23 = _local22.lowerBounds; _local24 = _local3; _local25 = (_local23[_local24] + 1); _local23[_local24] = _local25; _local5.stabbingCount--; } else { _local23 = _local22.upperBounds; _local24 = _local3; _local25 = (_local23[_local24] + 1); _local23[_local24] = _local25; _local5.stabbingCount++; }; _local23 = _local11.upperBounds; _local24 = _local3; _local25 = (_local23[_local24] - 1); _local23[_local24] = _local25; _local5.Swap(_local6); _local4--; }; }; _local3++; }; } public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{ var _local4:int; var _local5:int; var _local6:int; _local4 = 0; _local5 = (_arg2 - 1); while (_local4 <= _local5) { _local6 = ((_local4 + _local5) / 2); if (_arg1[_local6].value > _arg3){ _local5 = (_local6 - 1); } else { if (_arg1[_local6].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:b2PolyShape, _arg2:int, _arg3:b2PolyShape):Number{ var _local4:Array; var _local5:int; var _local6:Array; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:b2Mat22; var _local11:Number; var _local12:Number; var _local13:int; var _local14:Number; var _local15:int; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:b2Vec2; var _local22:Number; _local4 = _arg1.m_vertices; _local5 = _arg3.m_vertexCount; _local6 = _arg3.m_vertices; _local7 = _arg1.m_normals[_arg2].x; _local8 = _arg1.m_normals[_arg2].y; _local9 = _local7; _local10 = _arg1.m_R; _local7 = ((_local10.col1.x * _local9) + (_local10.col2.x * _local8)); _local8 = ((_local10.col1.y * _local9) + (_local10.col2.y * _local8)); _local11 = _local7; _local12 = _local8; _local10 = _arg3.m_R; _local9 = ((_local11 * _local10.col1.x) + (_local12 * _local10.col1.y)); _local12 = ((_local11 * _local10.col2.x) + (_local12 * _local10.col2.y)); _local11 = _local9; _local13 = 0; _local14 = Number.MAX_VALUE; _local15 = 0; while (_local15 < _local5) { _local21 = _local6[_local15]; _local22 = ((_local21.x * _local11) + (_local21.y * _local12)); if (_local22 < _local14){ _local14 = _local22; _local13 = _local15; }; _local15++; }; _local10 = _arg1.m_R; _local16 = (_arg1.m_position.x + ((_local10.col1.x * _local4[_arg2].x) + (_local10.col2.x * _local4[_arg2].y))); _local17 = (_arg1.m_position.y + ((_local10.col1.y * _local4[_arg2].x) + (_local10.col2.y * _local4[_arg2].y))); _local10 = _arg3.m_R; _local18 = (_arg3.m_position.x + ((_local10.col1.x * _local6[_local13].x) + (_local10.col2.x * _local6[_local13].y))); _local19 = (_arg3.m_position.y + ((_local10.col1.y * _local6[_local13].x) + (_local10.col2.y * _local6[_local13].y))); _local18 = (_local18 - _local16); _local19 = (_local19 - _local17); _local20 = ((_local18 * _local7) + (_local19 * _local8)); return (_local20); } 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.minVertex; _local4 = _arg1.maxVertex; _local5 = (_local3.x - _local4.x); _local6 = (_local3.y - _local4.y); _local3 = _arg1.minVertex; _local4 = _arg2.maxVertex; _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:b2PolyShape, _arg3:int, _arg4:b2PolyShape):void{ var _local5:int; var _local6:Array; var _local7:int; var _local8:Array; var _local9:int; var _local10:int; var _local11:b2Vec2; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:b2Mat22; var _local19:Number; var _local20:Number; var _local21:int; var _local22:int; var _local23:Number; var _local24:int; var _local25:ClipVertex; var _local26:int; var _local27:int; var _local28:Number; var _local29:Number; var _local30:Number; _local5 = _arg2.m_vertexCount; _local6 = _arg2.m_vertices; _local7 = _arg4.m_vertexCount; _local8 = _arg4.m_vertices; _local9 = _arg3; _local10 = (((_arg3 + 1) == _local5)) ? 0 : (_arg3 + 1); _local11 = _local6[_local10]; _local12 = _local11.x; _local13 = _local11.y; _local11 = _local6[_local9]; _local12 = (_local12 - _local11.x); _local13 = (_local13 - _local11.y); _local14 = _local12; _local12 = _local13; _local13 = -(_local14); _local15 = (1 / Math.sqrt(((_local12 * _local12) + (_local13 * _local13)))); _local12 = (_local12 * _local15); _local13 = (_local13 * _local15); _local16 = _local12; _local17 = _local13; _local14 = _local16; _local18 = _arg2.m_R; _local16 = ((_local18.col1.x * _local14) + (_local18.col2.x * _local17)); _local17 = ((_local18.col1.y * _local14) + (_local18.col2.y * _local17)); _local19 = _local16; _local20 = _local17; _local18 = _arg4.m_R; _local14 = ((_local19 * _local18.col1.x) + (_local20 * _local18.col1.y)); _local20 = ((_local19 * _local18.col2.x) + (_local20 * _local18.col2.y)); _local19 = _local14; _local23 = Number.MAX_VALUE; _local24 = 0; while (_local24 < _local7) { _local26 = _local24; _local27 = (((_local24 + 1) < _local7)) ? (_local24 + 1) : 0; _local11 = _local8[_local27]; _local28 = _local11.x; _local29 = _local11.y; _local11 = _local8[_local26]; _local28 = (_local28 - _local11.x); _local29 = (_local29 - _local11.y); _local14 = _local28; _local28 = _local29; _local29 = -(_local14); _local15 = (1 / Math.sqrt(((_local28 * _local28) + (_local29 * _local29)))); _local28 = (_local28 * _local15); _local29 = (_local29 * _local15); _local30 = ((_local28 * _local19) + (_local29 * _local20)); if (_local30 < _local23){ _local23 = _local30; _local21 = _local26; _local22 = _local27; }; _local24++; }; _local25 = _arg1[0]; _local11 = _local25.v; _local11.SetV(_local8[_local21]); _local11.MulM(_arg4.m_R); _local11.Add(_arg4.m_position); _local25.id.features.referenceFace = _arg3; _local25.id.features.incidentEdge = _local21; _local25.id.features.incidentVertex = _local21; _local25 = _arg1[1]; _local11 = _local25.v; _local11.SetV(_local8[_local22]); _local11.MulM(_arg4.m_R); _local11.Add(_arg4.m_position); _local25.id.features.referenceFace = _arg3; _local25.id.features.incidentEdge = _local21; _local25.id.features.incidentVertex = _local22; } public static function b2CollidePolyAndCircle(_arg1:b2Manifold, _arg2:b2PolyShape, _arg3:b2CircleShape, _arg4:Boolean):void{ var _local5:b2ContactPoint; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:b2Mat22; var _local11:Number; var _local12:Number; var _local13:int; var _local14:Number; var _local15:Number; var _local16:int; var _local17:int; var _local18:int; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:b2Vec2; _arg1.pointCount = 0; _local8 = (_arg3.m_position.x - _arg2.m_position.x); _local9 = (_arg3.m_position.y - _arg2.m_position.y); _local10 = _arg2.m_R; _local11 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y)); _local9 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y)); _local8 = _local11; _local13 = 0; _local14 = -(Number.MAX_VALUE); _local15 = _arg3.m_radius; _local16 = 0; while (_local16 < _arg2.m_vertexCount) { _local25 = ((_arg2.m_normals[_local16].x * (_local8 - _arg2.m_vertices[_local16].x)) + (_arg2.m_normals[_local16].y * (_local9 - _arg2.m_vertices[_local16].y))); if (_local25 > _local15){ return; }; if (_local25 > _local14){ _local14 = _local25; _local13 = _local16; }; _local16++; }; if (_local14 < Number.MIN_VALUE){ _arg1.pointCount = 1; _local26 = _arg2.m_normals[_local13]; _arg1.normal.x = ((_local10.col1.x * _local26.x) + (_local10.col2.x * _local26.y)); _arg1.normal.y = ((_local10.col1.y * _local26.x) + (_local10.col2.y * _local26.y)); _local5 = _arg1.points[0]; _local5.id.features.incidentEdge = _local13; _local5.id.features.incidentVertex = b2_nullFeature; _local5.id.features.referenceFace = b2_nullFeature; _local5.id.features.flip = 0; _local5.position.x = (_arg3.m_position.x - (_local15 * _arg1.normal.x)); _local5.position.y = (_arg3.m_position.y - (_local15 * _arg1.normal.y)); _local5.separation = (_local14 - _local15); return; }; _local17 = _local13; _local18 = (((_local17 + 1) < _arg2.m_vertexCount)) ? (_local17 + 1) : 0; _local19 = (_arg2.m_vertices[_local18].x - _arg2.m_vertices[_local17].x); _local20 = (_arg2.m_vertices[_local18].y - _arg2.m_vertices[_local17].y); _local21 = Math.sqrt(((_local19 * _local19) + (_local20 * _local20))); _local19 = (_local19 / _local21); _local20 = (_local20 / _local21); if (_local21 < Number.MIN_VALUE){ _local6 = (_local8 - _arg2.m_vertices[_local17].x); _local7 = (_local9 - _arg2.m_vertices[_local17].y); _local12 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7))); _local6 = (_local6 / _local12); _local7 = (_local7 / _local12); if (_local12 > _local15){ return; }; _arg1.pointCount = 1; _arg1.normal.Set(((_local10.col1.x * _local6) + (_local10.col2.x * _local7)), ((_local10.col1.y * _local6) + (_local10.col2.y * _local7))); _local5 = _arg1.points[0]; _local5.id.features.incidentEdge = b2_nullFeature; _local5.id.features.incidentVertex = _local17; _local5.id.features.referenceFace = b2_nullFeature; _local5.id.features.flip = 0; _local5.position.x = (_arg3.m_position.x - (_local15 * _arg1.normal.x)); _local5.position.y = (_arg3.m_position.y - (_local15 * _arg1.normal.y)); _local5.separation = (_local12 - _local15); return; }; _local22 = (((_local8 - _arg2.m_vertices[_local17].x) * _local19) + ((_local9 - _arg2.m_vertices[_local17].y) * _local20)); _local5 = _arg1.points[0]; _local5.id.features.incidentEdge = b2_nullFeature; _local5.id.features.incidentVertex = b2_nullFeature; _local5.id.features.referenceFace = b2_nullFeature; _local5.id.features.flip = 0; if (_local22 <= 0){ _local23 = _arg2.m_vertices[_local17].x; _local24 = _arg2.m_vertices[_local17].y; _local5.id.features.incidentVertex = _local17; } else { if (_local22 >= _local21){ _local23 = _arg2.m_vertices[_local18].x; _local24 = _arg2.m_vertices[_local18].y; _local5.id.features.incidentVertex = _local18; } else { _local23 = ((_local19 * _local22) + _arg2.m_vertices[_local17].x); _local24 = ((_local20 * _local22) + _arg2.m_vertices[_local17].y); _local5.id.features.incidentEdge = _local17; }; }; _local6 = (_local8 - _local23); _local7 = (_local9 - _local24); _local12 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7))); _local6 = (_local6 / _local12); _local7 = (_local7 / _local12); if (_local12 > _local15){ return; }; _arg1.pointCount = 1; _arg1.normal.Set(((_local10.col1.x * _local6) + (_local10.col2.x * _local7)), ((_local10.col1.y * _local6) + (_local10.col2.y * _local7))); _local5.position.x = (_arg3.m_position.x - (_local15 * _arg1.normal.x)); _local5.position.y = (_arg3.m_position.y - (_local15 * _arg1.normal.y)); _local5.separation = (_local12 - _local15); } public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolyShape, _arg3:b2PolyShape, _arg4:Boolean):Number{ var _local5:int; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:int; var _local11:Number; var _local12:int; 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; _local5 = _arg2.m_vertexCount; _local6 = (_arg3.m_position.x - _arg2.m_position.x); _local7 = (_arg3.m_position.y - _arg2.m_position.y); _local8 = ((_local6 * _arg2.m_R.col1.x) + (_local7 * _arg2.m_R.col1.y)); _local9 = ((_local6 * _arg2.m_R.col2.x) + (_local7 * _arg2.m_R.col2.y)); _local10 = 0; _local11 = -(Number.MAX_VALUE); _local12 = 0; while (_local12 < _local5) { _local21 = ((_arg2.m_normals[_local12].x * _local8) + (_arg2.m_normals[_local12].y * _local9)); if (_local21 > _local11){ _local11 = _local21; _local10 = _local12; }; _local12++; }; _local13 = EdgeSeparation(_arg2, _local10, _arg3); if ((((_local13 > 0)) && ((_arg4 == false)))){ return (_local13); }; _local14 = (((_local10 - 1) >= 0)) ? (_local10 - 1) : (_local5 - 1); _local15 = EdgeSeparation(_arg2, _local14, _arg3); if ((((_local15 > 0)) && ((_arg4 == false)))){ return (_local15); }; _local16 = (((_local10 + 1) < _local5)) ? (_local10 + 1) : 0; _local17 = EdgeSeparation(_arg2, _local16, _arg3); if ((((_local17 > 0)) && ((_arg4 == false)))){ return (_local17); }; if ((((_local15 > _local13)) && ((_local15 > _local17)))){ _local20 = -1; _local18 = _local14; _local19 = _local15; } else { if (_local17 > _local13){ _local20 = 1; _local18 = _local16; _local19 = _local17; } else { _arg1[0] = _local10; return (_local13); }; }; while (true) { if (_local20 == -1){ _local10 = (((_local18 - 1) >= 0)) ? (_local18 - 1) : (_local5 - 1); } else { _local10 = (((_local18 + 1) < _local5)) ? (_local18 + 1) : 0; }; _local13 = EdgeSeparation(_arg2, _local10, _arg3); if ((((_local13 > 0)) && ((_arg4 == false)))){ return (_local13); }; if (_local13 > _local19){ _local18 = _local10; _local19 = _local13; } else { break; }; }; _arg1[0] = _local18; return (_local19); } public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{ var _local5:int; var _local6:b2Vec2; var _local7:b2Vec2; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:b2Vec2; _local5 = 0; _local6 = _arg2[0].v; _local7 = _arg2[1].v; _local8 = (b2Math.b2Dot(_arg3, _arg2[0].v) - _arg4); _local9 = (b2Math.b2Dot(_arg3, _arg2[1].v) - _arg4); if (_local8 <= 0){ var _temp1 = _local5; _local5 = (_local5 + 1); var _local12 = _temp1; _arg1[_local12] = _arg2[0]; }; if (_local9 <= 0){ var _temp2 = _local5; _local5 = (_local5 + 1); _local12 = _temp2; _arg1[_local12] = _arg2[1]; }; if ((_local8 * _local9) < 0){ _local10 = (_local8 / (_local8 - _local9)); _local11 = _arg1[_local5].v; _local11.x = (_local6.x + (_local10 * (_local7.x - _local6.x))); _local11.y = (_local6.y + (_local10 * (_local7.y - _local6.y))); if (_local8 > 0){ _arg1[_local5].id = _arg2[0].id; } else { _arg1[_local5].id = _arg2[1].id; }; _local5++; }; return (_local5); } public static function b2CollidePoly(_arg1:b2Manifold, _arg2:b2PolyShape, _arg3:b2PolyShape, _arg4:Boolean):void{ var _local5:int; var _local6:Array; var _local7:Number; var _local8:int; var _local9:Array; var _local10:Number; var _local11:b2PolyShape; var _local12:b2PolyShape; var _local13:int; var _local14:int; var _local15:Number; var _local16:Number; var _local17:Array; var _local18:int; var _local19:Array; var _local20:b2Vec2; var _local21:b2Vec2; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local27:b2Mat22; 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:Array; var _local39:Array; var _local40:int; var _local41:int; var _local42:int; var _local43:b2Vec2; var _local44:Number; var _local45:b2ContactPoint; _arg1.pointCount = 0; _local5 = 0; _local6 = [_local5]; _local7 = FindMaxSeparation(_local6, _arg2, _arg3, _arg4); _local5 = _local6[0]; if ((((_local7 > 0)) && ((_arg4 == false)))){ return; }; _local8 = 0; _local9 = [_local8]; _local10 = FindMaxSeparation(_local9, _arg3, _arg2, _arg4); _local8 = _local9[0]; if ((((_local10 > 0)) && ((_arg4 == false)))){ return; }; _local15 = 0.98; _local16 = 0.001; if (_local10 > ((_local15 * _local7) + _local16)){ _local11 = _arg3; _local12 = _arg2; _local13 = _local8; _local14 = 1; } else { _local11 = _arg2; _local12 = _arg3; _local13 = _local5; _local14 = 0; }; _local17 = [new ClipVertex(), new ClipVertex()]; FindIncidentEdge(_local17, _local11, _local13, _local12); _local18 = _local11.m_vertexCount; _local19 = _local11.m_vertices; _local20 = _local19[_local13]; _local21 = (((_local13 + 1) < _local18)) ? _local19[(_local13 + 1)] : _local19[0]; _local22 = (_local21.x - _local20.x); _local23 = (_local21.y - _local20.y); _local24 = (_local21.x - _local20.x); _local25 = (_local21.y - _local20.y); _local26 = _local24; _local27 = _local11.m_R; _local24 = ((_local27.col1.x * _local26) + (_local27.col2.x * _local25)); _local25 = ((_local27.col1.y * _local26) + (_local27.col2.y * _local25)); _local28 = (1 / Math.sqrt(((_local24 * _local24) + (_local25 * _local25)))); _local24 = (_local24 * _local28); _local25 = (_local25 * _local28); _local29 = _local24; _local30 = _local25; _local26 = _local29; _local29 = _local30; _local30 = -(_local26); _local31 = _local20.x; _local32 = _local20.y; _local26 = _local31; _local27 = _local11.m_R; _local31 = ((_local27.col1.x * _local26) + (_local27.col2.x * _local32)); _local32 = ((_local27.col1.y * _local26) + (_local27.col2.y * _local32)); _local31 = (_local31 + _local11.m_position.x); _local32 = (_local32 + _local11.m_position.y); _local33 = _local21.x; _local34 = _local21.y; _local26 = _local33; _local27 = _local11.m_R; _local33 = ((_local27.col1.x * _local26) + (_local27.col2.x * _local34)); _local34 = ((_local27.col1.y * _local26) + (_local27.col2.y * _local34)); _local33 = (_local33 + _local11.m_position.x); _local34 = (_local34 + _local11.m_position.y); _local35 = ((_local29 * _local31) + (_local30 * _local32)); _local36 = -(((_local24 * _local31) + (_local25 * _local32))); _local37 = ((_local24 * _local33) + (_local25 * _local34)); _local38 = [new ClipVertex(), new ClipVertex()]; _local39 = [new ClipVertex(), new ClipVertex()]; b2CollidePolyTempVec.Set(-(_local24), -(_local25)); _local40 = ClipSegmentToLine(_local38, _local17, b2CollidePolyTempVec, _local36); if (_local40 < 2){ return; }; b2CollidePolyTempVec.Set(_local24, _local25); _local40 = ClipSegmentToLine(_local39, _local38, b2CollidePolyTempVec, _local37); if (_local40 < 2){ return; }; if (_local14){ _arg1.normal.Set(-(_local29), -(_local30)); } else { _arg1.normal.Set(_local29, _local30); }; _local41 = 0; _local42 = 0; while (_local42 < b2Settings.b2_maxManifoldPoints) { _local43 = _local39[_local42].v; _local44 = (((_local29 * _local43.x) + (_local30 * _local43.y)) - _local35); if ((((_local44 <= 0)) || ((_arg4 == true)))){ _local45 = _arg1.points[_local41]; _local45.separation = _local44; _local45.position.SetV(_local39[_local42].v); _local45.id.Set(_local39[_local42].id); _local45.id.features.flip = _local14; _local41++; }; _local42++; }; _arg1.pointCount = _local41; } public static function b2CollideCircle(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2CircleShape, _arg4:Boolean):void{ var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:b2ContactPoint; var _local11:Number; var _local12:Number; _arg1.pointCount = 0; _local5 = (_arg3.m_position.x - _arg2.m_position.x); _local6 = (_arg3.m_position.y - _arg2.m_position.y); _local7 = ((_local5 * _local5) + (_local6 * _local6)); _local8 = (_arg2.m_radius + _arg3.m_radius); if ((((_local7 > (_local8 * _local8))) && ((_arg4 == false)))){ return; }; if (_local7 < Number.MIN_VALUE){ _local9 = -(_local8); _arg1.normal.Set(0, 1); } else { _local11 = Math.sqrt(_local7); _local9 = (_local11 - _local8); _local12 = (1 / _local11); _arg1.normal.x = (_local12 * _local5); _arg1.normal.y = (_local12 * _local6); }; _arg1.pointCount = 1; _local10 = _arg1.points[0]; _local10.id.key = 0; _local10.separation = _local9; _local10.position.x = (_arg3.m_position.x - (_arg3.m_radius * _arg1.normal.x)); _local10.position.y = (_arg3.m_position.y - (_arg3.m_radius * _arg1.normal.y)); } } }//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._referenceFace = (_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.*; public class b2ContactPoint { public var separation:Number; public var position:b2Vec2; public var normalImpulse:Number; public var tangentImpulse:Number; public var id:b2ContactID; public function b2ContactPoint(){ position = new b2Vec2(); id = new b2ContactID(); super(); } } }//package Box2D.Collision
Section 17
//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; public var normal:b2Vec2; public function b2Manifold(){ var _local1:int; super(); points = new Array(b2Settings.b2_maxManifoldPoints); _local1 = 0; while (_local1 < b2Settings.b2_maxManifoldPoints) { points[_local1] = new b2ContactPoint(); _local1++; }; normal = new b2Vec2(); } } }//package Box2D.Collision
Section 18
//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 19
//b2Pair (Box2D.Collision.b2Pair) package Box2D.Collision { 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 = 0xFFFF; public static var e_pairBuffered:uint = 1; public static var b2_nullProxy:uint = 0xFFFF; public static var b2_tableCapacity:int = 8192; 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 20
//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 21
//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[(b2Settings.b2_maxPairs - 1)].next = b2Pair.b2_nullPair; m_pairCount = 0; } private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{ var _local4:uint; _local4 = m_hashTable[_arg3]; while (((!((_local4 == b2Pair.b2_nullPair))) && ((Equals(m_pairs[_local4], _arg1, _arg2) == false)))) { _local4 = m_pairs[_local4].next; }; if (_local4 == b2Pair.b2_nullPair){ return (null); }; return (m_pairs[_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:int; var _local2:int; var _local3:Array; var _local4:b2Pair; var _local5:b2Proxy; var _local6:b2Proxy; _local2 = 0; _local3 = m_broadPhase.m_proxyPool; _local1 = 0; while (_local1 < m_pairBufferCount) { _local4 = Find(m_pairBuffer[_local1].proxyId1, m_pairBuffer[_local1].proxyId2); _local4.ClearBuffered(); _local5 = _local3[_local4.proxyId1]; _local6 = _local3[_local4.proxyId2]; if (_local4.IsRemoved()){ if (_local4.IsFinal() == true){ m_callback.PairRemoved(_local5.userData, _local6.userData, _local4.userData); }; m_pairBuffer[_local2].proxyId1 = _local4.proxyId1; m_pairBuffer[_local2].proxyId2 = _local4.proxyId2; _local2++; } else { if (_local4.IsFinal() == false){ _local4.userData = m_callback.PairAdded(_local5.userData, _local6.userData); _local4.SetFinal(); }; }; _local1++; }; _local1 = 0; while (_local1 < _local2) { RemovePair(m_pairBuffer[_local1].proxyId1, m_pairBuffer[_local1].proxyId2); _local1++; }; m_pairBufferCount = 0; if (b2BroadPhase.s_validate){ ValidateTable(); }; } public function RemoveBufferedPair(_arg1:int, _arg2:int):void{ var _local3:b2Pair; _local3 = Find(_arg1, _arg2); if (_local3 == null){ return; }; if (_local3.IsBuffered() == false){ _local3.SetBuffered(); m_pairBuffer[m_pairBufferCount].proxyId1 = _local3.proxyId1; m_pairBuffer[m_pairBufferCount].proxyId2 = _local3.proxyId2; m_pairBufferCount++; }; _local3.SetRemoved(); if (b2BroadPhase.s_validate){ ValidateBuffer(); }; } private function RemovePair(_arg1:uint, _arg2:uint){ var _local3:uint; var _local4:uint; var _local5:b2Pair; var _local6:uint; var _local7:uint; var _local8:b2Pair; var _local9:*; if (_arg1 > _arg2){ _local6 = _arg1; _arg1 = _arg2; _arg2 = _local6; }; _local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask); _local4 = m_hashTable[_local3]; _local5 = null; while (_local4 != b2Pair.b2_nullPair) { if (Equals(m_pairs[_local4], _arg1, _arg2)){ _local7 = _local4; if (_local5){ _local5.next = m_pairs[_local4].next; } else { m_hashTable[_local3] = m_pairs[_local4].next; }; _local8 = m_pairs[_local7]; _local9 = _local8.userData; _local8.next = m_freePair; _local8.proxyId1 = b2Pair.b2_nullProxy; _local8.proxyId2 = b2Pair.b2_nullProxy; _local8.userData = null; _local8.status = 0; m_freePair = _local7; m_pairCount--; return (_local9); } else { _local5 = m_pairs[_local4]; _local4 = _local5.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:b2Pair; _local3 = AddPair(_arg1, _arg2); if (_local3.IsBuffered() == false){ _local3.SetBuffered(); m_pairBuffer[m_pairBufferCount].proxyId1 = _local3.proxyId1; m_pairBuffer[m_pairBufferCount].proxyId2 = _local3.proxyId2; m_pairBufferCount++; }; _local3.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 22
//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 23
//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 24
//Features (Box2D.Collision.Features) package Box2D.Collision { public class Features { public var _referenceFace:int; public var _incidentEdge:int; public var _flip:int; public var _incidentVertex:int; public var _m_id:b2ContactID; public function get referenceFace():int{ return (_referenceFace); } 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 referenceFace(_arg1:int):void{ _referenceFace = _arg1; _m_id._key = ((_m_id._key & 4294967040) | (_referenceFace & 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 25
//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 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 26
//b2Math (Box2D.Common.Math.b2Math) package Box2D.Common.Math { public class b2Math { 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 b2Swap(_arg1:Array, _arg2:Array):void{ var _local3:*; _local3 = _arg1[0]; _arg1[0] = _arg2[0]; _arg2[0] = _local3; } public static function b2Abs(_arg1:Number):Number{ return (((_arg1 > 0)) ? _arg1 : -(_arg1)); } 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 b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{ return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x))); } 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 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 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 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 MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2; _local3 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y)); 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 27
//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 Add(_arg1:b2Vec2):void{ x = (x + _arg1.x); y = (y + _arg1.y); } public function SetZero():void{ x = 0; y = 0; } public function CrossVF(_arg1:Number):void{ var _local2:Number; _local2 = x; x = (_arg1 * y); y = (-(_arg1) * _local2); } public function MaxV(_arg1:b2Vec2):void{ x = ((x > _arg1.x)) ? x : _arg1.x; y = ((y > _arg1.y)) ? y : _arg1.y; } public function SetV(_arg1:b2Vec2):void{ x = _arg1.x; y = _arg1.y; } public function Negative():b2Vec2{ return (new b2Vec2(-(x), -(y))); } public function Abs():void{ x = Math.abs(x); y = Math.abs(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 = Length(); 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 28
//b2Settings (Box2D.Common.b2Settings) package Box2D.Common { import Box2D.Common.Math.*; public class b2Settings { public static const b2_lengthUnitsPerMeter:Number = 30; public static const b2_angularSleepTolerance:Number = 0.0111111111111111; public static const b2_linearSleepTolerance:Number = 0.3; public static const b2_angularSlop:Number = ((2 / 180) * b2_pi); public static const b2_linearSlop:Number = 0.15; public static const b2_pi:Number = Math.PI; public static const b2_maxShapesPerBody:int = 8; public static const b2_maxProxies:int = 0x0400; public static const b2_velocityThreshold:Number = 30; public static const b2_timeToSleep:Number = 0.5; public static const b2_contactBaumgarte:Number = 0.2; public static const b2_maxPairs:int = 8192; public static const b2_maxManifoldPoints:int = 2; public static const b2_massUnitsPerKilogram:Number = 1; public static const b2_maxAngularCorrection:Number = ((8 / 180) * b2_pi); public static const USHRT_MAX:int = 0xFFFF; public static const b2_maxLinearCorrection:Number = 6; public static const b2_maxPolyVertices:int = 64; public static const b2_timeUnitsPerSecond:Number = 1; public static function b2Assert(_arg1:Boolean):void{ var _local2:b2Vec2; if (!_arg1){ _local2.x++; }; } } }//package Box2D.Common
Section 29
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2CircleContact extends b2Contact { public var m_manifold:Array; public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){ m_manifold = [new b2Manifold()]; super(_arg1, _arg2); m_manifold[0].pointCount = 0; m_manifold[0].points[0].normalImpulse = 0; m_manifold[0].points[0].tangentImpulse = 0; } override public function GetManifolds():Array{ return (m_manifold); } override public function Evaluate():void{ b2Collision.b2CollideCircle(m_manifold[0], (m_shape1 as b2CircleShape), (m_shape2 as b2CircleShape), false); if (m_manifold[0].pointCount > 0){ m_manifoldCount = 1; } else { m_manifoldCount = 0; }; } 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 30
//b2Contact (Box2D.Dynamics.Contacts.b2Contact) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2Contact { public var m_shape1:b2Shape; public var m_shape2:b2Shape; public var m_prev:b2Contact; public var m_next:b2Contact; public var m_friction:Number; public var m_manifoldCount:int; public var m_node1:b2ContactNode; public var m_node2:b2ContactNode; public var m_restitution:Number; public var m_flags:uint; public static var s_registers:Array; public static var s_initialized:Boolean = false; public static var e_islandFlag:uint = 1; public static var e_destroyFlag:uint = 2; public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){ m_node1 = new b2ContactNode(); m_node2 = new b2ContactNode(); super(); m_flags = 0; if (((!(_arg1)) || (!(_arg2)))){ m_shape1 = null; m_shape2 = null; return; }; 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 GetNext():b2Contact{ return (m_next); } public function GetShape2():b2Shape{ return (m_shape2); } public function GetManifoldCount():int{ return (m_manifoldCount); } public function GetManifolds():Array{ return (null); } public function Evaluate():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_polyShape, b2Shape.e_circleShape); AddType(b2PolyContact.Create, b2PolyContact.Destroy, b2Shape.e_polyShape, b2Shape.e_polyShape); } public static function Destroy(_arg1:b2Contact, _arg2):void{ var _local3:int; var _local4:int; var _local5:*; if (_arg1.GetManifoldCount() > 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].destroyFcn; _local5(_arg1, _arg2); } public static function AddType(_arg1, _arg2, _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:*; var _local7:b2Contact; var _local8:int; var _local9:b2Manifold; if (s_initialized == false){ InitializeRegisters(); s_initialized = true; }; _local4 = _arg1.m_type; _local5 = _arg2.m_type; _local6 = s_registers[_local4][_local5].createFcn; if (_local6){ if (s_registers[_local4][_local5].primary){ return (_local6(_arg1, _arg2, _arg3)); }; _local7 = _local6(_arg2, _arg1, _arg3); _local8 = 0; while (_local8 < _local7.GetManifoldCount()) { _local9 = _local7.GetManifolds()[_local8]; _local7.GetManifolds()[_local8].normal = _local9.normal.Negative(); _local8++; }; return (_local7); //unresolved jump }; return (null); } } }//package Box2D.Dynamics.Contacts
Section 31
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2ContactConstraint { public var points:Array; public var restitution:Number; public var body1:b2Body; public var manifold:b2Manifold; public var normal:b2Vec2; public var body2:b2Body; public var friction:Number; public var pointCount:int; public function b2ContactConstraint(){ var _local1:int; normal = new b2Vec2(); super(); points = new Array(b2Settings.b2_maxManifoldPoints); _local1 = 0; while (_local1 < b2Settings.b2_maxManifoldPoints) { points[_local1] = new b2ContactConstraintPoint(); _local1++; }; } } }//package Box2D.Dynamics.Contacts
Section 32
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; public class b2ContactConstraintPoint { public var separation:Number; public var positionImpulse:Number; public var normalImpulse:Number; public var tangentImpulse:Number; public var localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var tangentMass:Number; public var normalMass:Number; public var velocityBias:Number; public function b2ContactConstraintPoint(){ localAnchor1 = new b2Vec2(); localAnchor2 = new b2Vec2(); super(); } } }//package Box2D.Dynamics.Contacts
Section 33
//b2ContactNode (Box2D.Dynamics.Contacts.b2ContactNode) package Box2D.Dynamics.Contacts { import Box2D.Dynamics.*; public class b2ContactNode { public var next:b2ContactNode; public var other:b2Body; public var contact:b2Contact; public var prev:b2ContactNode; } }//package Box2D.Dynamics.Contacts
Section 34
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister) package Box2D.Dynamics.Contacts { public class b2ContactRegister { public var primary:Boolean; public var createFcn; public var destroyFcn; } }//package Box2D.Dynamics.Contacts
Section 35
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2ContactSolver { public var m_constraintCount:int; public var m_constraints:Array; public var m_allocator; public function b2ContactSolver(_arg1:Array, _arg2:int, _arg3){ var _local4:int; var _local5:b2Vec2; var _local6:b2Mat22; var _local7:int; var _local8:b2Contact; var _local9:b2Body; var _local10:b2Body; var _local11:int; var _local12:Array; 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:int; var _local22:b2Manifold; var _local23:Number; var _local24:Number; var _local25:b2ContactConstraint; var _local26:uint; var _local27:b2ContactPoint; var _local28:b2ContactConstraintPoint; 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; var _local42:Number; var _local43:Number; var _local44:Number; var _local45:Number; m_constraints = new Array(); super(); m_allocator = _arg3; m_constraintCount = 0; _local4 = 0; while (_local4 < _arg2) { m_constraintCount = (m_constraintCount + _arg1[_local4].GetManifoldCount()); _local4++; }; _local4 = 0; while (_local4 < m_constraintCount) { m_constraints[_local4] = new b2ContactConstraint(); _local4++; }; _local7 = 0; _local4 = 0; while (_local4 < _arg2) { _local8 = _arg1[_local4]; _local9 = _local8.m_shape1.m_body; _local10 = _local8.m_shape2.m_body; _local11 = _local8.GetManifoldCount(); _local12 = _local8.GetManifolds(); _local13 = _local8.m_friction; _local14 = _local8.m_restitution; _local15 = _local9.m_linearVelocity.x; _local16 = _local9.m_linearVelocity.y; _local17 = _local10.m_linearVelocity.x; _local18 = _local10.m_linearVelocity.y; _local19 = _local9.m_angularVelocity; _local20 = _local10.m_angularVelocity; _local21 = 0; while (_local21 < _local11) { _local22 = _local12[_local21]; _local23 = _local22.normal.x; _local24 = _local22.normal.y; _local25 = m_constraints[_local7]; _local25.body1 = _local9; _local25.body2 = _local10; _local25.manifold = _local22; _local25.normal.x = _local23; _local25.normal.y = _local24; _local25.pointCount = _local22.pointCount; _local25.friction = _local13; _local25.restitution = _local14; _local26 = 0; while (_local26 < _local25.pointCount) { _local27 = _local22.points[_local26]; _local28 = _local25.points[_local26]; _local28.normalImpulse = _local27.normalImpulse; _local28.tangentImpulse = _local27.tangentImpulse; _local28.separation = _local27.separation; _local29 = (_local27.position.x - _local9.m_position.x); _local30 = (_local27.position.y - _local9.m_position.y); _local31 = (_local27.position.x - _local10.m_position.x); _local32 = (_local27.position.y - _local10.m_position.y); _local5 = _local28.localAnchor1; _local6 = _local9.m_R; _local5.x = ((_local29 * _local6.col1.x) + (_local30 * _local6.col1.y)); _local5.y = ((_local29 * _local6.col2.x) + (_local30 * _local6.col2.y)); _local5 = _local28.localAnchor2; _local6 = _local10.m_R; _local5.x = ((_local31 * _local6.col1.x) + (_local32 * _local6.col1.y)); _local5.y = ((_local31 * _local6.col2.x) + (_local32 * _local6.col2.y)); _local33 = ((_local29 * _local29) + (_local30 * _local30)); _local34 = ((_local31 * _local31) + (_local32 * _local32)); _local35 = ((_local29 * _local23) + (_local30 * _local24)); _local36 = ((_local31 * _local23) + (_local32 * _local24)); _local37 = (_local9.m_invMass + _local10.m_invMass); _local37 = (_local37 + ((_local9.m_invI * (_local33 - (_local35 * _local35))) + (_local10.m_invI * (_local34 - (_local36 * _local36))))); _local28.normalMass = (1 / _local37); _local38 = _local24; _local39 = -(_local23); _local40 = ((_local29 * _local38) + (_local30 * _local39)); _local41 = ((_local31 * _local38) + (_local32 * _local39)); _local42 = (_local9.m_invMass + _local10.m_invMass); _local42 = (_local42 + ((_local9.m_invI * (_local33 - (_local40 * _local40))) + (_local10.m_invI * (_local34 - (_local41 * _local41))))); _local28.tangentMass = (1 / _local42); _local28.velocityBias = 0; if (_local28.separation > 0){ _local28.velocityBias = (-60 * _local28.separation); }; _local43 = (((_local17 + (-(_local20) * _local32)) - _local15) - (-(_local19) * _local30)); _local44 = (((_local18 + (_local20 * _local31)) - _local16) - (_local19 * _local29)); _local45 = ((_local25.normal.x * _local43) + (_local25.normal.y * _local44)); if (_local45 < -(b2Settings.b2_velocityThreshold)){ _local28.velocityBias = (_local28.velocityBias + (-(_local25.restitution) * _local45)); }; _local26++; }; _local7++; _local21++; }; _local4++; }; } 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:Number; var _local20:Number; var _local21:int; var _local22:int; var _local23:b2ContactConstraintPoint; 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; _local2 = 0; _local5 = 0; while (_local5 < m_constraintCount) { _local6 = m_constraints[_local5]; _local7 = _local6.body1; _local8 = _local6.body2; _local9 = _local7.m_position; _local10 = _local7.m_rotation; _local11 = _local8.m_position; _local12 = _local8.m_rotation; _local13 = _local7.m_invMass; _local14 = _local7.m_invI; _local15 = _local8.m_invMass; _local16 = _local8.m_invI; _local17 = _local6.normal.x; _local18 = _local6.normal.y; _local19 = _local18; _local20 = -(_local17); _local21 = _local6.pointCount; _local22 = 0; while (_local22 < _local21) { _local23 = _local6.points[_local22]; _local3 = _local7.m_R; _local4 = _local23.localAnchor1; _local24 = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)); _local25 = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)); _local3 = _local8.m_R; _local4 = _local23.localAnchor2; _local26 = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)); _local27 = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)); _local28 = (_local9.x + _local24); _local29 = (_local9.y + _local25); _local30 = (_local11.x + _local26); _local31 = (_local11.y + _local27); _local32 = (_local30 - _local28); _local33 = (_local31 - _local29); _local34 = (((_local32 * _local17) + (_local33 * _local18)) + _local23.separation); _local2 = b2Math.b2Min(_local2, _local34); _local35 = (_arg1 * b2Math.b2Clamp((_local34 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0)); _local36 = (-(_local23.normalMass) * _local35); _local37 = _local23.positionImpulse; _local23.positionImpulse = b2Math.b2Max((_local37 + _local36), 0); _local36 = (_local23.positionImpulse - _local37); _local38 = (_local36 * _local17); _local39 = (_local36 * _local18); _local9.x = (_local9.x - (_local13 * _local38)); _local9.y = (_local9.y - (_local13 * _local39)); _local10 = (_local10 - (_local14 * ((_local24 * _local39) - (_local25 * _local38)))); _local7.m_R.Set(_local10); _local11.x = (_local11.x + (_local15 * _local38)); _local11.y = (_local11.y + (_local15 * _local39)); _local12 = (_local12 + (_local16 * ((_local26 * _local39) - (_local27 * _local38)))); _local8.m_R.Set(_local12); _local22++; }; _local7.m_rotation = _local10; _local8.m_rotation = _local12; _local5++; }; return ((_local2 >= -(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:b2Mat22; var _local14:b2Vec2; var _local15:int; var _local16:b2ContactConstraint; var _local17:b2Body; var _local18:b2Body; var _local19:Number; var _local20:b2Vec2; var _local21:Number; var _local22:b2Vec2; 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:int; var _local32:Number; var _local33:Number; var _local34:Number; _local15 = 0; while (_local15 < m_constraintCount) { _local16 = m_constraints[_local15]; _local17 = _local16.body1; _local18 = _local16.body2; _local19 = _local17.m_angularVelocity; _local20 = _local17.m_linearVelocity; _local21 = _local18.m_angularVelocity; _local22 = _local18.m_linearVelocity; _local23 = _local17.m_invMass; _local24 = _local17.m_invI; _local25 = _local18.m_invMass; _local26 = _local18.m_invI; _local27 = _local16.normal.x; _local28 = _local16.normal.y; _local29 = _local28; _local30 = -(_local27); _local31 = _local16.pointCount; _local1 = 0; while (_local1 < _local31) { _local2 = _local16.points[_local1]; _local13 = _local17.m_R; _local14 = _local2.localAnchor1; _local3 = ((_local13.col1.x * _local14.x) + (_local13.col2.x * _local14.y)); _local4 = ((_local13.col1.y * _local14.x) + (_local13.col2.y * _local14.y)); _local13 = _local18.m_R; _local14 = _local2.localAnchor2; _local5 = ((_local13.col1.x * _local14.x) + (_local13.col2.x * _local14.y)); _local6 = ((_local13.col1.y * _local14.x) + (_local13.col2.y * _local14.y)); _local7 = (((_local22.x + (-(_local21) * _local6)) - _local20.x) - (-(_local19) * _local4)); _local8 = (((_local22.y + (_local21 * _local5)) - _local20.y) - (_local19 * _local3)); _local32 = ((_local7 * _local27) + (_local8 * _local28)); _local9 = (-(_local2.normalMass) * (_local32 - _local2.velocityBias)); _local10 = b2Math.b2Max((_local2.normalImpulse + _local9), 0); _local9 = (_local10 - _local2.normalImpulse); _local11 = (_local9 * _local27); _local12 = (_local9 * _local28); _local20.x = (_local20.x - (_local23 * _local11)); _local20.y = (_local20.y - (_local23 * _local12)); _local19 = (_local19 - (_local24 * ((_local3 * _local12) - (_local4 * _local11)))); _local22.x = (_local22.x + (_local25 * _local11)); _local22.y = (_local22.y + (_local25 * _local12)); _local21 = (_local21 + (_local26 * ((_local5 * _local12) - (_local6 * _local11)))); _local2.normalImpulse = _local10; _local7 = (((_local22.x + (-(_local21) * _local6)) - _local20.x) - (-(_local19) * _local4)); _local8 = (((_local22.y + (_local21 * _local5)) - _local20.y) - (_local19 * _local3)); _local33 = ((_local7 * _local29) + (_local8 * _local30)); _local9 = (_local2.tangentMass * -(_local33)); _local34 = (_local16.friction * _local2.normalImpulse); _local10 = b2Math.b2Clamp((_local2.tangentImpulse + _local9), -(_local34), _local34); _local9 = (_local10 - _local2.tangentImpulse); _local11 = (_local9 * _local29); _local12 = (_local9 * _local30); _local20.x = (_local20.x - (_local23 * _local11)); _local20.y = (_local20.y - (_local23 * _local12)); _local19 = (_local19 - (_local24 * ((_local3 * _local12) - (_local4 * _local11)))); _local22.x = (_local22.x + (_local25 * _local11)); _local22.y = (_local22.y + (_local25 * _local12)); _local21 = (_local21 + (_local26 * ((_local5 * _local12) - (_local6 * _local11)))); _local2.tangentImpulse = _local10; _local1++; }; _local17.m_angularVelocity = _local19; _local18.m_angularVelocity = _local21; _local15++; }; } public function PreSolve():void{ var _local1:b2Vec2; var _local2:b2Vec2; var _local3:b2Mat22; var _local4:int; var _local5:b2ContactConstraint; var _local6:b2Body; var _local7:b2Body; 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:int; var _local17:int; var _local18:b2ContactConstraintPoint; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:b2ContactConstraintPoint; _local4 = 0; while (_local4 < m_constraintCount) { _local5 = m_constraints[_local4]; _local6 = _local5.body1; _local7 = _local5.body2; _local8 = _local6.m_invMass; _local9 = _local6.m_invI; _local10 = _local7.m_invMass; _local11 = _local7.m_invI; _local12 = _local5.normal.x; _local13 = _local5.normal.y; _local14 = _local13; _local15 = -(_local12); if (b2World.s_enableWarmStarting){ _local17 = _local5.pointCount; _local16 = 0; while (_local16 < _local17) { _local18 = _local5.points[_local16]; _local19 = ((_local18.normalImpulse * _local12) + (_local18.tangentImpulse * _local14)); _local20 = ((_local18.normalImpulse * _local13) + (_local18.tangentImpulse * _local15)); _local3 = _local6.m_R; _local1 = _local18.localAnchor1; _local21 = ((_local3.col1.x * _local1.x) + (_local3.col2.x * _local1.y)); _local22 = ((_local3.col1.y * _local1.x) + (_local3.col2.y * _local1.y)); _local3 = _local7.m_R; _local1 = _local18.localAnchor2; _local23 = ((_local3.col1.x * _local1.x) + (_local3.col2.x * _local1.y)); _local24 = ((_local3.col1.y * _local1.x) + (_local3.col2.y * _local1.y)); _local6.m_angularVelocity = (_local6.m_angularVelocity - (_local9 * ((_local21 * _local20) - (_local22 * _local19)))); _local6.m_linearVelocity.x = (_local6.m_linearVelocity.x - (_local8 * _local19)); _local6.m_linearVelocity.y = (_local6.m_linearVelocity.y - (_local8 * _local20)); _local7.m_angularVelocity = (_local7.m_angularVelocity + (_local11 * ((_local23 * _local20) - (_local24 * _local19)))); _local7.m_linearVelocity.x = (_local7.m_linearVelocity.x + (_local10 * _local19)); _local7.m_linearVelocity.y = (_local7.m_linearVelocity.y + (_local10 * _local20)); _local18.positionImpulse = 0; _local16++; }; } else { _local17 = _local5.pointCount; _local16 = 0; while (_local16 < _local17) { _local25 = _local5.points[_local16]; _local25.normalImpulse = 0; _local25.tangentImpulse = 0; _local25.positionImpulse = 0; _local16++; }; }; _local4++; }; } public function PostSolve():void{ var _local1:int; var _local2:b2ContactConstraint; var _local3:b2Manifold; var _local4:int; var _local5:b2ContactPoint; 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 36
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact) package Box2D.Dynamics.Contacts { public class b2NullContact extends b2Contact { public function b2NullContact():void{ } override public function GetManifolds():Array{ return (null); } override public function Evaluate():void{ } } }//package Box2D.Dynamics.Contacts
Section 37
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2PolyAndCircleContact extends b2Contact { public var m_manifold:Array; public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){ m_manifold = [new b2Manifold()]; super(_arg1, _arg2); b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polyShape)); b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape)); m_manifold[0].pointCount = 0; m_manifold[0].points[0].normalImpulse = 0; m_manifold[0].points[0].tangentImpulse = 0; } override public function GetManifolds():Array{ return (m_manifold); } override public function Evaluate():void{ b2Collision.b2CollidePolyAndCircle(m_manifold[0], (m_shape1 as b2PolyShape), (m_shape2 as b2CircleShape), false); if (m_manifold[0].pointCount > 0){ m_manifoldCount = 1; } else { m_manifoldCount = 0; }; } 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 38
//b2PolyContact (Box2D.Dynamics.Contacts.b2PolyContact) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2PolyContact extends b2Contact { public var m_manifold:Array; private var m0:b2Manifold; public function b2PolyContact(_arg1:b2Shape, _arg2:b2Shape):void{ m0 = new b2Manifold(); m_manifold = [new b2Manifold()]; super(_arg1, _arg2); m_manifold[0].pointCount = 0; } override public function GetManifolds():Array{ return (m_manifold); } override public function Evaluate():void{ var _local1:b2Manifold; var _local2:Array; var _local3:int; var _local4:b2ContactPoint; var _local5:b2ContactPoint; var _local6:Array; var _local7:int; var _local8:b2ContactPoint; var _local9:uint; var _local10:int; var _local11:b2ContactPoint; var _local12:b2ContactID; _local1 = m_manifold[0]; _local2 = m0.points; _local3 = 0; while (_local3 < _local1.pointCount) { _local4 = _local2[_local3]; _local5 = _local1.points[_local3]; _local4.normalImpulse = _local5.normalImpulse; _local4.tangentImpulse = _local5.tangentImpulse; _local4.id = _local5.id.Copy(); _local3++; }; m0.pointCount = _local1.pointCount; b2Collision.b2CollidePoly(_local1, (m_shape1 as b2PolyShape), (m_shape2 as b2PolyShape), false); if (_local1.pointCount > 0){ _local6 = [false, false]; _local7 = 0; while (_local7 < _local1.pointCount) { _local8 = _local1.points[_local7]; _local8.normalImpulse = 0; _local8.tangentImpulse = 0; _local9 = _local8.id.key; _local10 = 0; while (_local10 < m0.pointCount) { if (_local6[_local10] == true){ } else { _local11 = m0.points[_local10]; _local12 = _local11.id; if (_local12.key == _local9){ _local6[_local10] = true; _local8.normalImpulse = _local11.normalImpulse; _local8.tangentImpulse = _local11.tangentImpulse; break; }; }; _local10++; }; _local7++; }; m_manifoldCount = 1; } else { m_manifoldCount = 0; }; } public static function Destroy(_arg1:b2Contact, _arg2):void{ } public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ return (new b2PolyContact(_arg1, _arg2)); } } }//package Box2D.Dynamics.Contacts
Section 39
//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_localAnchor2:b2Vec2; public var m_mass:Number; public var m_localAnchor1:b2Vec2; public var m_u:b2Vec2; public var m_impulse: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); _local2 = m_body1.m_R; _local3 = (_arg1.anchorPoint1.x - m_body1.m_position.x); _local4 = (_arg1.anchorPoint1.y - m_body1.m_position.y); m_localAnchor1.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)); m_localAnchor1.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y)); _local2 = m_body2.m_R; _local3 = (_arg1.anchorPoint2.x - m_body2.m_position.x); _local4 = (_arg1.anchorPoint2.y - m_body2.m_position.y); m_localAnchor2.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)); m_localAnchor2.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y)); _local3 = (_arg1.anchorPoint2.x - _arg1.anchorPoint1.x); _local4 = (_arg1.anchorPoint2.y - _arg1.anchorPoint1.y); m_length = Math.sqrt(((_local3 * _local3) + (_local4 * _local4))); m_impulse = 0; } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Mat22; 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; _local2 = m_body1.m_R; _local3 = ((_local2.col1.x * m_localAnchor1.x) + (_local2.col2.x * m_localAnchor1.y)); _local4 = ((_local2.col1.y * m_localAnchor1.x) + (_local2.col2.y * m_localAnchor1.y)); _local2 = m_body2.m_R; _local5 = ((_local2.col1.x * m_localAnchor2.x) + (_local2.col2.x * m_localAnchor2.y)); _local6 = ((_local2.col1.y * m_localAnchor2.x) + (_local2.col2.y * m_localAnchor2.y)); _local7 = (m_body1.m_linearVelocity.x + (-(m_body1.m_angularVelocity) * _local4)); _local8 = (m_body1.m_linearVelocity.y + (m_body1.m_angularVelocity * _local3)); _local9 = (m_body2.m_linearVelocity.x + (-(m_body2.m_angularVelocity) * _local6)); _local10 = (m_body2.m_linearVelocity.y + (m_body2.m_angularVelocity * _local5)); _local11 = ((m_u.x * (_local9 - _local7)) + (m_u.y * (_local10 - _local8))); _local12 = (-(m_mass) * _local11); m_impulse = (m_impulse + _local12); _local13 = (_local12 * m_u.x); _local14 = (_local12 * m_u.y); m_body1.m_linearVelocity.x = (m_body1.m_linearVelocity.x - (m_body1.m_invMass * _local13)); m_body1.m_linearVelocity.y = (m_body1.m_linearVelocity.y - (m_body1.m_invMass * _local14)); m_body1.m_angularVelocity = (m_body1.m_angularVelocity - (m_body1.m_invI * ((_local3 * _local14) - (_local4 * _local13)))); m_body2.m_linearVelocity.x = (m_body2.m_linearVelocity.x + (m_body2.m_invMass * _local13)); m_body2.m_linearVelocity.y = (m_body2.m_linearVelocity.y + (m_body2.m_invMass * _local14)); m_body2.m_angularVelocity = (m_body2.m_angularVelocity + (m_body2.m_invI * ((_local5 * _local14) - (_local6 * _local13)))); } override public function GetAnchor1():b2Vec2{ return (b2Math.AddVV(m_body1.m_position, b2Math.b2MulMV(m_body1.m_R, m_localAnchor1))); } override public function GetAnchor2():b2Vec2{ return (b2Math.AddVV(m_body2.m_position, b2Math.b2MulMV(m_body2.m_R, m_localAnchor2))); } override public function PrepareVelocitySolver():void{ var _local1:b2Mat22; var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; _local1 = m_body1.m_R; _local2 = ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y)); _local3 = ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y)); _local1 = m_body2.m_R; _local4 = ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y)); _local5 = ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y)); m_u.x = (((m_body2.m_position.x + _local4) - m_body1.m_position.x) - _local2); m_u.y = (((m_body2.m_position.y + _local5) - m_body1.m_position.y) - _local3); _local6 = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y))); if (_local6 > b2Settings.b2_linearSlop){ m_u.Multiply((1 / _local6)); } else { m_u.SetZero(); }; _local7 = ((_local2 * m_u.y) - (_local3 * m_u.x)); _local8 = ((_local4 * m_u.y) - (_local5 * m_u.x)); m_mass = (((m_body1.m_invMass + ((m_body1.m_invI * _local7) * _local7)) + m_body2.m_invMass) + ((m_body2.m_invI * _local8) * _local8)); m_mass = (1 / m_mass); if (b2World.s_enableWarmStarting){ _local9 = (m_impulse * m_u.x); _local10 = (m_impulse * m_u.y); m_body1.m_linearVelocity.x = (m_body1.m_linearVelocity.x - (m_body1.m_invMass * _local9)); m_body1.m_linearVelocity.y = (m_body1.m_linearVelocity.y - (m_body1.m_invMass * _local10)); m_body1.m_angularVelocity = (m_body1.m_angularVelocity - (m_body1.m_invI * ((_local2 * _local10) - (_local3 * _local9)))); m_body2.m_linearVelocity.x = (m_body2.m_linearVelocity.x + (m_body2.m_invMass * _local9)); m_body2.m_linearVelocity.y = (m_body2.m_linearVelocity.y + (m_body2.m_invMass * _local10)); m_body2.m_angularVelocity = (m_body2.m_angularVelocity + (m_body2.m_invI * ((_local4 * _local10) - (_local5 * _local9)))); } else { m_impulse = 0; }; } override public function GetReactionTorque(_arg1:Number):Number{ return (0); } override public function GetReactionForce(_arg1:Number):b2Vec2{ var _local2:b2Vec2; _local2 = new b2Vec2(); _local2.SetV(m_u); _local2.Multiply((m_impulse * _arg1)); return (_local2); } override public function SolvePositionConstraints():Boolean{ var _local1:b2Mat22; var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; _local1 = m_body1.m_R; _local2 = ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y)); _local3 = ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y)); _local1 = m_body2.m_R; _local4 = ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y)); _local5 = ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y)); _local6 = (((m_body2.m_position.x + _local4) - m_body1.m_position.x) - _local2); _local7 = (((m_body2.m_position.y + _local5) - m_body1.m_position.y) - _local3); _local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7))); _local6 = (_local6 / _local8); _local7 = (_local7 / _local8); _local9 = (_local8 - m_length); _local9 = b2Math.b2Clamp(_local9, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection); _local10 = (-(m_mass) * _local9); m_u.Set(_local6, _local7); _local11 = (_local10 * m_u.x); _local12 = (_local10 * m_u.y); m_body1.m_position.x = (m_body1.m_position.x - (m_body1.m_invMass * _local11)); m_body1.m_position.y = (m_body1.m_position.y - (m_body1.m_invMass * _local12)); m_body1.m_rotation = (m_body1.m_rotation - (m_body1.m_invI * ((_local2 * _local12) - (_local3 * _local11)))); m_body2.m_position.x = (m_body2.m_position.x + (m_body2.m_invMass * _local11)); m_body2.m_position.y = (m_body2.m_position.y + (m_body2.m_invMass * _local12)); m_body2.m_rotation = (m_body2.m_rotation + (m_body2.m_invI * ((_local4 * _local12) - (_local5 * _local11)))); m_body1.m_R.Set(m_body1.m_rotation); m_body2.m_R.Set(m_body2.m_rotation); return ((b2Math.b2Abs(_local9) < b2Settings.b2_linearSlop)); } } }//package Box2D.Dynamics.Joints
Section 40
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; public class b2DistanceJointDef extends b2JointDef { public var anchorPoint2:b2Vec2; public var anchorPoint1:b2Vec2; public function b2DistanceJointDef(){ anchorPoint1 = new b2Vec2(); anchorPoint2 = new b2Vec2(); super(); type = b2Joint.e_distanceJoint; } } }//package Box2D.Dynamics.Joints
Section 41
//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_impulse: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:Number; var _local3:Number; m_groundAnchor1 = new b2Vec2(); m_groundAnchor2 = new b2Vec2(); m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_J = new b2Jacobian(); super(_arg1); 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 (_arg1.joint1.m_type == b2Joint.e_revoluteJoint){ m_revolute1 = (_arg1.joint1 as b2RevoluteJoint); m_groundAnchor1.SetV(m_revolute1.m_localAnchor1); m_localAnchor1.SetV(m_revolute1.m_localAnchor2); _local2 = m_revolute1.GetJointAngle(); } else { m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint); m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1); m_localAnchor1.SetV(m_prismatic1.m_localAnchor2); _local2 = m_prismatic1.GetJointTranslation(); }; m_ground2 = _arg1.joint2.m_body1; m_body2 = _arg1.joint2.m_body2; if (_arg1.joint2.m_type == b2Joint.e_revoluteJoint){ m_revolute2 = (_arg1.joint2 as b2RevoluteJoint); m_groundAnchor2.SetV(m_revolute2.m_localAnchor1); m_localAnchor2.SetV(m_revolute2.m_localAnchor2); _local3 = m_revolute2.GetJointAngle(); } else { m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint); m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1); m_localAnchor2.SetV(m_prismatic2.m_localAnchor2); _local3 = m_prismatic2.GetJointTranslation(); }; m_ratio = _arg1.ratio; m_constant = (_local2 + (m_ratio * _local3)); m_impulse = 0; } override public function GetAnchor1():b2Vec2{ var _local1:b2Mat22; _local1 = m_body1.m_R; return (new b2Vec2((m_body1.m_position.x + ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y))), (m_body1.m_position.y + ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y))))); } override public function GetAnchor2():b2Vec2{ var _local1:b2Mat22; _local1 = m_body2.m_R; return (new b2Vec2((m_body2.m_position.x + ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y))), (m_body2.m_position.y + ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y))))); } override public function PrepareVelocitySolver():void{ var _local1:b2Body; var _local2:b2Body; var _local3:b2Body; var _local4:b2Body; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:b2Mat22; var _local10:b2Vec2; var _local11:Number; var _local12:Number; _local1 = m_ground1; _local2 = m_ground2; _local3 = m_body1; _local4 = m_body2; _local12 = 0; m_J.SetZero(); if (m_revolute1){ m_J.angular1 = -1; _local12 = (_local12 + _local3.m_invI); } else { _local9 = _local1.m_R; _local10 = m_prismatic1.m_localXAxis1; _local5 = ((_local9.col1.x * _local10.x) + (_local9.col2.x * _local10.y)); _local6 = ((_local9.col1.y * _local10.x) + (_local9.col2.y * _local10.y)); _local9 = _local3.m_R; _local7 = ((_local9.col1.x * m_localAnchor1.x) + (_local9.col2.x * m_localAnchor1.y)); _local8 = ((_local9.col1.y * m_localAnchor1.x) + (_local9.col2.y * m_localAnchor1.y)); _local11 = ((_local7 * _local6) - (_local8 * _local5)); m_J.linear1.Set(-(_local5), -(_local6)); m_J.angular1 = -(_local11); _local12 = (_local12 + (_local3.m_invMass + ((_local3.m_invI * _local11) * _local11))); }; if (m_revolute2){ m_J.angular2 = -(m_ratio); _local12 = (_local12 + ((m_ratio * m_ratio) * _local4.m_invI)); } else { _local9 = _local2.m_R; _local10 = m_prismatic2.m_localXAxis1; _local5 = ((_local9.col1.x * _local10.x) + (_local9.col2.x * _local10.y)); _local6 = ((_local9.col1.y * _local10.x) + (_local9.col2.y * _local10.y)); _local9 = _local4.m_R; _local7 = ((_local9.col1.x * m_localAnchor2.x) + (_local9.col2.x * m_localAnchor2.y)); _local8 = ((_local9.col1.y * m_localAnchor2.x) + (_local9.col2.y * m_localAnchor2.y)); _local11 = ((_local7 * _local6) - (_local8 * _local5)); m_J.linear2.Set((-(m_ratio) * _local5), (-(m_ratio) * _local6)); m_J.angular2 = (-(m_ratio) * _local11); _local12 = (_local12 + ((m_ratio * m_ratio) * (_local4.m_invMass + ((_local4.m_invI * _local11) * _local11)))); }; m_mass = (1 / _local12); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * m_impulse) * m_J.linear1.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * m_impulse) * m_J.linear1.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * m_impulse) * m_J.angular1)); _local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * m_impulse) * m_J.linear2.x)); _local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * m_impulse) * m_J.linear2.y)); _local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * m_impulse) * m_J.angular2)); } override public function GetReactionForce(_arg1:Number):b2Vec2{ return (new b2Vec2()); } 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_position.x = (_local2.m_position.x + ((_local2.m_invMass * _local7) * m_J.linear1.x)); _local2.m_position.y = (_local2.m_position.y + ((_local2.m_invMass * _local7) * m_J.linear1.y)); _local2.m_rotation = (_local2.m_rotation + ((_local2.m_invI * _local7) * m_J.angular1)); _local3.m_position.x = (_local3.m_position.x + ((_local3.m_invMass * _local7) * m_J.linear2.x)); _local3.m_position.y = (_local3.m_position.y + ((_local3.m_invMass * _local7) * m_J.linear2.y)); _local3.m_rotation = (_local3.m_rotation + ((_local3.m_invI * _local7) * m_J.angular2)); _local2.m_R.Set(_local2.m_rotation); _local3.m_R.Set(_local3.m_rotation); return ((_local1 < b2Settings.b2_linearSlop)); } override public function GetReactionTorque(_arg1:Number):Number{ return (0); } 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; _local2 = m_body1; _local3 = m_body2; _local4 = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity); _local5 = (-(m_mass) * _local4); m_impulse = (m_impulse + _local5); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local5) * m_J.linear1.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local5) * m_J.linear1.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local5) * m_J.angular1)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local5) * m_J.linear2.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local5) * m_J.linear2.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local5) * m_J.angular2)); } } }//package Box2D.Dynamics.Joints
Section 42
//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 43
//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 44
//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_collideConnected:Boolean; public var m_prev:b2Joint; public var m_next:b2Joint; public var m_type:int; public var m_node1:b2JointNode; public var m_node2:b2JointNode; public var m_userData; public var m_body1:b2Body; 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 b2JointNode(); m_node2 = new b2JointNode(); 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 GetNext():b2Joint{ return (m_next); } public function GetType():int{ return (m_type); } public function GetBody2():b2Body{ return (m_body2); } public function PrepareVelocitySolver():void{ } public function PreparePositionSolver():void{ } public function GetReactionTorque(_arg1:Number):Number{ return (0); } public function GetUserData(){ return (m_userData); } public function GetReactionForce(_arg1:Number):b2Vec2{ return (null); } public function SolvePositionConstraints():Boolean{ return (false); } public function GetBody1():b2Body{ return (m_body1); } public function SolveVelocityConstraints(_arg1:b2TimeStep):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 45
//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 46
//b2JointNode (Box2D.Dynamics.Joints.b2JointNode) package Box2D.Dynamics.Joints { import Box2D.Dynamics.*; public class b2JointNode { public var joint:b2Joint; public var other:b2Body; public var next:b2JointNode; public var prev:b2JointNode; } }//package Box2D.Dynamics.Joints
Section 47
//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_target:b2Vec2; public var m_impulse:b2Vec2; public var m_ptpMass:b2Mat22; 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:Number; var _local5:Number; var _local6:Number; var _local7:Number; K = new b2Mat22(); K1 = new b2Mat22(); K2 = new b2Mat22(); m_localAnchor = new b2Vec2(); m_target = new b2Vec2(); m_impulse = new b2Vec2(); m_ptpMass = new b2Mat22(); m_C = new b2Vec2(); super(_arg1); m_target.SetV(_arg1.target); _local2 = (m_target.x - m_body2.m_position.x); _local3 = (m_target.y - m_body2.m_position.y); m_localAnchor.x = ((_local2 * m_body2.m_R.col1.x) + (_local3 * m_body2.m_R.col1.y)); m_localAnchor.y = ((_local2 * m_body2.m_R.col2.x) + (_local3 * m_body2.m_R.col2.y)); m_maxForce = _arg1.maxForce; m_impulse.SetZero(); _local4 = m_body2.m_mass; _local5 = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz); _local6 = (((2 * _local4) * _arg1.dampingRatio) * _local5); _local7 = ((_local4 * _local5) * _local5); m_gamma = (1 / (_local6 + (_arg1.timeStep * _local7))); m_beta = ((_arg1.timeStep * _local7) / (_local6 + (_arg1.timeStep * _local7))); } override public function GetAnchor1():b2Vec2{ return (m_target); } override public function GetAnchor2():b2Vec2{ var _local1:b2Vec2; _local1 = b2Math.b2MulMV(m_body2.m_R, m_localAnchor); _local1.Add(m_body2.m_position); return (_local1); } override public function PrepareVelocitySolver():void{ var _local1:b2Body; var _local2:b2Mat22; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; _local1 = m_body2; _local2 = _local1.m_R; _local3 = ((_local2.col1.x * m_localAnchor.x) + (_local2.col2.x * m_localAnchor.y)); _local4 = ((_local2.col1.y * m_localAnchor.x) + (_local2.col2.y * m_localAnchor.y)); _local5 = _local1.m_invMass; _local6 = _local1.m_invI; K1.col1.x = _local5; K1.col2.x = 0; K1.col1.y = 0; K1.col2.y = _local5; K2.col1.x = ((_local6 * _local4) * _local4); K2.col2.x = ((-(_local6) * _local3) * _local4); K2.col1.y = ((-(_local6) * _local3) * _local4); K2.col2.y = ((_local6 * _local3) * _local3); 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_ptpMass); m_C.x = ((_local1.m_position.x + _local3) - m_target.x); m_C.y = ((_local1.m_position.y + _local4) - m_target.y); _local1.m_angularVelocity = (_local1.m_angularVelocity * 0.98); _local7 = m_impulse.x; _local8 = m_impulse.y; _local1.m_linearVelocity.x = (_local1.m_linearVelocity.x + (_local5 * _local7)); _local1.m_linearVelocity.y = (_local1.m_linearVelocity.y + (_local5 * _local8)); _local1.m_angularVelocity = (_local1.m_angularVelocity + (_local6 * ((_local3 * _local8) - (_local4 * _local7)))); } override public function GetReactionForce(_arg1:Number):b2Vec2{ var _local2:b2Vec2; _local2 = new b2Vec2(); _local2.SetV(m_impulse); _local2.Multiply(_arg1); return (_local2); } override public function SolvePositionConstraints():Boolean{ return (true); } override public function GetReactionTorque(_arg1:Number):Number{ return (0); } public function SetTarget(_arg1:b2Vec2):void{ 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; _local2 = m_body2; _local3 = _local2.m_R; _local4 = ((_local3.col1.x * m_localAnchor.x) + (_local3.col2.x * m_localAnchor.y)); _local5 = ((_local3.col1.y * m_localAnchor.x) + (_local3.col2.y * m_localAnchor.y)); _local6 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local5)); _local7 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local4)); _local3 = m_ptpMass; _local8 = ((_local6 + ((m_beta * _arg1.inv_dt) * m_C.x)) + (m_gamma * m_impulse.x)); _local9 = ((_local7 + ((m_beta * _arg1.inv_dt) * m_C.y)) + (m_gamma * m_impulse.y)); _local10 = -(((_local3.col1.x * _local8) + (_local3.col2.x * _local9))); _local11 = -(((_local3.col1.y * _local8) + (_local3.col2.y * _local9))); _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 > (_arg1.dt * m_maxForce)){ m_impulse.Multiply(((_arg1.dt * m_maxForce) / _local14)); }; _local10 = (m_impulse.x - _local12); _local11 = (m_impulse.y - _local13); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local10)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local11)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local4 * _local11) - (_local5 * _local10)))); } } }//package Box2D.Dynamics.Joints
Section 48
//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 49
//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_initialAngle:Number; public var m_lowerTranslation:Number; public var m_localXAxis1:b2Vec2; public var m_enableLimit:Boolean; public var m_maxMotorForce:Number; public var m_angularMass:Number; public var m_localYAxis1:b2Vec2; public var m_linearImpulse:Number; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_motorMass:Number; public var m_limitState:int; public var m_linearMass:Number; public var m_upperTranslation:Number; public var m_angularImpulse:Number; public var m_motorImpulse:Number; public var m_motorJacobian:b2Jacobian; public var m_limitImpulse:Number; public var m_motorSpeed:Number; public var m_enableMotor:Boolean; public var m_limitPositionImpulse:Number; public var m_linearJacobian:b2Jacobian; public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){ var _local2:b2Mat22; var _local3:Number; var _local4:Number; m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_localXAxis1 = new b2Vec2(); m_localYAxis1 = new b2Vec2(); m_linearJacobian = new b2Jacobian(); m_motorJacobian = new b2Jacobian(); super(_arg1); _local2 = m_body1.m_R; _local3 = (_arg1.anchorPoint.x - m_body1.m_position.x); _local4 = (_arg1.anchorPoint.y - m_body1.m_position.y); m_localAnchor1.Set(((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)), ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y))); _local2 = m_body2.m_R; _local3 = (_arg1.anchorPoint.x - m_body2.m_position.x); _local4 = (_arg1.anchorPoint.y - m_body2.m_position.y); m_localAnchor2.Set(((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)), ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y))); _local2 = m_body1.m_R; _local3 = _arg1.axis.x; _local4 = _arg1.axis.y; m_localXAxis1.Set(((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)), ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y))); m_localYAxis1.x = -(m_localXAxis1.y); m_localYAxis1.y = m_localXAxis1.x; m_initialAngle = (m_body2.m_rotation - m_body1.m_rotation); m_linearJacobian.SetZero(); m_linearMass = 0; m_linearImpulse = 0; m_angularMass = 0; m_angularImpulse = 0; m_motorJacobian.SetZero(); m_motorMass = 0; m_motorImpulse = 0; m_limitImpulse = 0; m_limitPositionImpulse = 0; m_lowerTranslation = _arg1.lowerTranslation; m_upperTranslation = _arg1.upperTranslation; m_maxMotorForce = _arg1.motorForce; m_motorSpeed = _arg1.motorSpeed; m_enableLimit = _arg1.enableLimit; m_enableMotor = _arg1.enableMotor; } override public function GetAnchor1():b2Vec2{ var _local1:b2Body; var _local2:b2Vec2; _local1 = m_body1; _local2 = new b2Vec2(); _local2.SetV(m_localAnchor1); _local2.MulM(_local1.m_R); _local2.Add(_local1.m_position); return (_local2); } override public function GetAnchor2():b2Vec2{ var _local1:b2Body; var _local2:b2Vec2; _local1 = m_body2; _local2 = new b2Vec2(); _local2.SetV(m_localAnchor2); _local2.MulM(_local1.m_R); _local2.Add(_local1.m_position); return (_local2); } override public function PrepareVelocitySolver():void{ 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; var _local24:Number; var _local25:Number; var _local26:Number; _local1 = m_body1; _local2 = m_body2; _local3 = _local1.m_R; _local4 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y)); _local5 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y)); _local3 = _local2.m_R; _local6 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y)); _local7 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y)); _local8 = _local1.m_invMass; _local9 = _local2.m_invMass; _local10 = _local1.m_invI; _local11 = _local2.m_invI; _local3 = _local1.m_R; _local12 = ((_local3.col1.x * m_localYAxis1.x) + (_local3.col2.x * m_localYAxis1.y)); _local13 = ((_local3.col1.y * m_localYAxis1.x) + (_local3.col2.y * m_localYAxis1.y)); _local14 = ((_local2.m_position.x + _local6) - _local1.m_position.x); _local15 = ((_local2.m_position.y + _local7) - _local1.m_position.y); m_linearJacobian.linear1.x = -(_local12); m_linearJacobian.linear1.y = -(_local13); m_linearJacobian.linear2.x = _local12; m_linearJacobian.linear2.y = _local13; m_linearJacobian.angular1 = -(((_local14 * _local13) - (_local15 * _local12))); m_linearJacobian.angular2 = ((_local6 * _local13) - (_local7 * _local12)); m_linearMass = (((_local8 + ((_local10 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + _local9) + ((_local11 * m_linearJacobian.angular2) * m_linearJacobian.angular2)); m_linearMass = (1 / m_linearMass); m_angularMass = (1 / (_local10 + _local11)); if (((m_enableLimit) || (m_enableMotor))){ _local3 = _local1.m_R; _local16 = ((_local3.col1.x * m_localXAxis1.x) + (_local3.col2.x * m_localXAxis1.y)); _local17 = ((_local3.col1.y * m_localXAxis1.x) + (_local3.col2.y * m_localXAxis1.y)); m_motorJacobian.linear1.x = -(_local16); m_motorJacobian.linear1.y = -(_local17); m_motorJacobian.linear2.x = _local16; m_motorJacobian.linear2.y = _local17; m_motorJacobian.angular1 = -(((_local14 * _local17) - (_local15 * _local16))); m_motorJacobian.angular2 = ((_local6 * _local17) - (_local7 * _local16)); m_motorMass = (((_local8 + ((_local10 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + _local9) + ((_local11 * m_motorJacobian.angular2) * m_motorJacobian.angular2)); m_motorMass = (1 / m_motorMass); if (m_enableLimit){ _local18 = (_local14 - _local4); _local19 = (_local15 - _local5); _local20 = ((_local16 * _local18) + (_local17 * _local19)); if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){ m_limitState = e_equalLimits; } else { if (_local20 <= m_lowerTranslation){ if (m_limitState != e_atLowerLimit){ m_limitImpulse = 0; }; m_limitState = e_atLowerLimit; } else { if (_local20 >= m_upperTranslation){ if (m_limitState != e_atUpperLimit){ m_limitImpulse = 0; }; m_limitState = e_atUpperLimit; } else { m_limitState = e_inactiveLimit; m_limitImpulse = 0; }; }; }; }; }; if (m_enableMotor == false){ m_motorImpulse = 0; }; if (m_enableLimit == false){ m_limitImpulse = 0; }; if (b2World.s_enableWarmStarting){ _local21 = ((m_linearImpulse * m_linearJacobian.linear1.x) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.linear1.x)); _local22 = ((m_linearImpulse * m_linearJacobian.linear1.y) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.linear1.y)); _local23 = ((m_linearImpulse * m_linearJacobian.linear2.x) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.linear2.x)); _local24 = ((m_linearImpulse * m_linearJacobian.linear2.y) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.linear2.y)); _local25 = (((m_linearImpulse * m_linearJacobian.angular1) - m_angularImpulse) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.angular1)); _local26 = (((m_linearImpulse * m_linearJacobian.angular2) + m_angularImpulse) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.angular2)); _local1.m_linearVelocity.x = (_local1.m_linearVelocity.x + (_local8 * _local21)); _local1.m_linearVelocity.y = (_local1.m_linearVelocity.y + (_local8 * _local22)); _local1.m_angularVelocity = (_local1.m_angularVelocity + (_local10 * _local25)); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local9 * _local23)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local9 * _local24)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local11 * _local26)); } else { m_linearImpulse = 0; m_angularImpulse = 0; m_limitImpulse = 0; m_motorImpulse = 0; }; m_limitPositionImpulse = 0; } public function GetJointTranslation():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:Number; var _local16:Number; _local1 = m_body1; _local2 = m_body2; _local3 = _local1.m_R; _local4 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y)); _local5 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y)); _local3 = _local2.m_R; _local6 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y)); _local7 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y)); _local8 = (_local1.m_position.x + _local4); _local9 = (_local1.m_position.y + _local5); _local10 = (_local2.m_position.x + _local6); _local11 = (_local2.m_position.y + _local7); _local12 = (_local10 - _local8); _local13 = (_local11 - _local9); _local3 = _local1.m_R; _local14 = ((_local3.col1.x * m_localXAxis1.x) + (_local3.col2.x * m_localXAxis1.y)); _local15 = ((_local3.col1.y * m_localXAxis1.x) + (_local3.col2.y * m_localXAxis1.y)); _local16 = ((_local14 * _local12) + (_local15 * _local13)); return (_local16); } override public function GetReactionForce(_arg1:Number):b2Vec2{ var _local2:Number; var _local3:b2Mat22; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; _local2 = (_arg1 * m_limitImpulse); _local3 = m_body1.m_R; _local4 = (_local2 * ((_local3.col1.x * m_localXAxis1.x) + (_local3.col2.x * m_localXAxis1.y))); _local5 = (_local2 * ((_local3.col1.y * m_localXAxis1.x) + (_local3.col2.y * m_localXAxis1.y))); _local6 = (_local2 * ((_local3.col1.x * m_localYAxis1.x) + (_local3.col2.x * m_localYAxis1.y))); _local7 = (_local2 * ((_local3.col1.y * m_localYAxis1.x) + (_local3.col2.y * m_localYAxis1.y))); return (new b2Vec2((_local4 + _local6), (_local5 + _local7))); } 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; _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_R; _local10 = ((_local9.col1.x * m_localAnchor1.x) + (_local9.col2.x * m_localAnchor1.y)); _local11 = ((_local9.col1.y * m_localAnchor1.x) + (_local9.col2.y * m_localAnchor1.y)); _local9 = _local4.m_R; _local12 = ((_local9.col1.x * m_localAnchor2.x) + (_local9.col2.x * m_localAnchor2.y)); _local13 = ((_local9.col1.y * m_localAnchor2.x) + (_local9.col2.y * m_localAnchor2.y)); _local14 = (_local3.m_position.x + _local10); _local15 = (_local3.m_position.y + _local11); _local16 = (_local4.m_position.x + _local12); _local17 = (_local4.m_position.y + _local13); _local18 = (_local16 - _local14); _local19 = (_local17 - _local15); _local9 = _local3.m_R; _local20 = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y)); _local21 = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y)); _local22 = ((_local20 * _local18) + (_local21 * _local19)); _local22 = b2Math.b2Clamp(_local22, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection); _local23 = (-(m_linearMass) * _local22); _local3.m_position.x = (_local3.m_position.x + ((_local5 * _local23) * m_linearJacobian.linear1.x)); _local3.m_position.y = (_local3.m_position.y + ((_local5 * _local23) * m_linearJacobian.linear1.y)); _local3.m_rotation = (_local3.m_rotation + ((_local7 * _local23) * m_linearJacobian.angular1)); _local4.m_position.x = (_local4.m_position.x + ((_local6 * _local23) * m_linearJacobian.linear2.x)); _local4.m_position.y = (_local4.m_position.y + ((_local6 * _local23) * m_linearJacobian.linear2.y)); _local4.m_rotation = (_local4.m_rotation + ((_local8 * _local23) * m_linearJacobian.angular2)); _local24 = b2Math.b2Abs(_local22); _local25 = ((_local4.m_rotation - _local3.m_rotation) - m_initialAngle); _local25 = b2Math.b2Clamp(_local25, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection); _local26 = (-(m_angularMass) * _local25); _local3.m_rotation = (_local3.m_rotation - (_local3.m_invI * _local26)); _local3.m_R.Set(_local3.m_rotation); _local4.m_rotation = (_local4.m_rotation + (_local4.m_invI * _local26)); _local4.m_R.Set(_local4.m_rotation); _local27 = b2Math.b2Abs(_local25); if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local9 = _local3.m_R; _local10 = ((_local9.col1.x * m_localAnchor1.x) + (_local9.col2.x * m_localAnchor1.y)); _local11 = ((_local9.col1.y * m_localAnchor1.x) + (_local9.col2.y * m_localAnchor1.y)); _local9 = _local4.m_R; _local12 = ((_local9.col1.x * m_localAnchor2.x) + (_local9.col2.x * m_localAnchor2.y)); _local13 = ((_local9.col1.y * m_localAnchor2.x) + (_local9.col2.y * m_localAnchor2.y)); _local14 = (_local3.m_position.x + _local10); _local15 = (_local3.m_position.y + _local11); _local16 = (_local4.m_position.x + _local12); _local17 = (_local4.m_position.y + _local13); _local18 = (_local16 - _local14); _local19 = (_local17 - _local15); _local9 = _local3.m_R; _local28 = ((_local9.col1.x * m_localXAxis1.x) + (_local9.col2.x * m_localXAxis1.y)); _local29 = ((_local9.col1.y * m_localXAxis1.x) + (_local9.col2.y * m_localXAxis1.y)); _local30 = ((_local28 * _local18) + (_local29 * _local19)); _local31 = 0; if (m_limitState == e_equalLimits){ _local1 = b2Math.b2Clamp(_local30, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection); _local31 = (-(m_motorMass) * _local1); _local24 = b2Math.b2Max(_local24, b2Math.b2Abs(_local25)); } else { if (m_limitState == e_atLowerLimit){ _local1 = (_local30 - m_lowerTranslation); _local24 = b2Math.b2Max(_local24, -(_local1)); _local1 = b2Math.b2Clamp((_local1 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0); _local31 = (-(m_motorMass) * _local1); _local2 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local31), 0); _local31 = (m_limitPositionImpulse - _local2); } else { if (m_limitState == e_atUpperLimit){ _local1 = (_local30 - m_upperTranslation); _local24 = b2Math.b2Max(_local24, _local1); _local1 = b2Math.b2Clamp((_local1 - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection); _local31 = (-(m_motorMass) * _local1); _local2 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local31), 0); _local31 = (m_limitPositionImpulse - _local2); }; }; }; _local3.m_position.x = (_local3.m_position.x + ((_local5 * _local31) * m_motorJacobian.linear1.x)); _local3.m_position.y = (_local3.m_position.y + ((_local5 * _local31) * m_motorJacobian.linear1.y)); _local3.m_rotation = (_local3.m_rotation + ((_local7 * _local31) * m_motorJacobian.angular1)); _local3.m_R.Set(_local3.m_rotation); _local4.m_position.x = (_local4.m_position.x + ((_local6 * _local31) * m_motorJacobian.linear2.x)); _local4.m_position.y = (_local4.m_position.y + ((_local6 * _local31) * m_motorJacobian.linear2.y)); _local4.m_rotation = (_local4.m_rotation + ((_local8 * _local31) * m_motorJacobian.angular2)); _local4.m_R.Set(_local4.m_rotation); }; return ((((_local24 <= b2Settings.b2_linearSlop)) && ((_local27 <= 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:Number; var _local16:b2Vec2; var _local17:b2Vec2; var _local18:Number; var _local19:Number; var _local20:Number; _local1 = m_body1; _local2 = m_body2; _local3 = _local1.m_R; _local4 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y)); _local5 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y)); _local3 = _local2.m_R; _local6 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y)); _local7 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y)); _local8 = (_local1.m_position.x + _local4); _local9 = (_local1.m_position.y + _local5); _local10 = (_local2.m_position.x + _local6); _local11 = (_local2.m_position.y + _local7); _local12 = (_local10 - _local8); _local13 = (_local11 - _local9); _local3 = _local1.m_R; _local14 = ((_local3.col1.x * m_localXAxis1.x) + (_local3.col2.x * m_localXAxis1.y)); _local15 = ((_local3.col1.y * m_localXAxis1.x) + (_local3.col2.y * m_localXAxis1.y)); _local16 = _local1.m_linearVelocity; _local17 = _local2.m_linearVelocity; _local18 = _local1.m_angularVelocity; _local19 = _local2.m_angularVelocity; _local20 = (((_local12 * (-(_local18) * _local15)) + (_local13 * (_local18 * _local14))) + ((_local14 * (((_local17.x + (-(_local19) * _local7)) - _local16.x) - (-(_local18) * _local5))) + (_local15 * (((_local17.y + (_local19 * _local6)) - _local16.y) - (_local18 * _local4))))); return (_local20); } public function SetMotorSpeed(_arg1:Number):void{ m_motorSpeed = _arg1; } public function GetMotorForce(_arg1:Number):Number{ return ((_arg1 * m_motorImpulse)); } public function SetMotorForce(_arg1:Number):void{ m_maxMotorForce = _arg1; } override public function GetReactionTorque(_arg1:Number):Number{ return ((_arg1 * m_angularImpulse)); } 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; _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 = (-(m_linearMass) * _local9); m_linearImpulse = (m_linearImpulse + _local10); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local10) * m_linearJacobian.linear1.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local10) * m_linearJacobian.linear1.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local10) * m_linearJacobian.angular1)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local10) * m_linearJacobian.linear2.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local10) * m_linearJacobian.linear2.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local10) * m_linearJacobian.angular2)); _local11 = (_local3.m_angularVelocity - _local2.m_angularVelocity); _local12 = (-(m_angularMass) * _local11); m_angularImpulse = (m_angularImpulse + _local12); _local2.m_angularVelocity = (_local2.m_angularVelocity - (_local6 * _local12)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local7 * _local12)); if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){ _local13 = (m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity) - m_motorSpeed); _local14 = (-(m_motorMass) * _local13); _local15 = m_motorImpulse; m_motorImpulse = b2Math.b2Clamp((m_motorImpulse + _local14), (-(_arg1.dt) * m_maxMotorForce), (_arg1.dt * m_maxMotorForce)); _local14 = (m_motorImpulse - _local15); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local14) * m_motorJacobian.linear1.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local14) * m_motorJacobian.linear1.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local14) * m_motorJacobian.angular1)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local14) * m_motorJacobian.linear2.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local14) * m_motorJacobian.linear2.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local14) * m_motorJacobian.angular2)); }; if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local16 = m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity); _local17 = (-(m_motorMass) * _local16); if (m_limitState == e_equalLimits){ m_limitImpulse = (m_limitImpulse + _local17); } else { if (m_limitState == e_atLowerLimit){ _local8 = m_limitImpulse; m_limitImpulse = b2Math.b2Max((m_limitImpulse + _local17), 0); _local17 = (m_limitImpulse - _local8); } else { if (m_limitState == e_atUpperLimit){ _local8 = m_limitImpulse; m_limitImpulse = b2Math.b2Min((m_limitImpulse + _local17), 0); _local17 = (m_limitImpulse - _local8); }; }; }; _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local17) * m_motorJacobian.linear1.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local17) * m_motorJacobian.linear1.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local17) * m_motorJacobian.angular1)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local17) * m_motorJacobian.linear2.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local17) * m_motorJacobian.linear2.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local17) * m_motorJacobian.angular2)); }; } } }//package Box2D.Dynamics.Joints
Section 50
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; public class b2PrismaticJointDef extends b2JointDef { public var motorSpeed:Number; public var anchorPoint:b2Vec2; public var axis:b2Vec2; public var upperTranslation:Number; public var lowerTranslation:Number; public var enableMotor:Boolean; public var motorForce:Number; public var enableLimit:Boolean; public function b2PrismaticJointDef(){ type = b2Joint.e_prismaticJoint; anchorPoint = new b2Vec2(0, 0); axis = new b2Vec2(0, 0); lowerTranslation = 0; upperTranslation = 0; motorForce = 0; motorSpeed = 0; enableLimit = false; enableMotor = false; } } }//package Box2D.Dynamics.Joints
Section 51
//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_limitState1:int; public var m_maxLength1:Number; public var m_pulleyImpulse:Number; public var m_limitPositionImpulse1:Number; public var m_constant:Number; public var m_ratio:Number; public var m_groundAnchor1:b2Vec2; public var m_groundAnchor2:b2Vec2; public var m_limitPositionImpulse2:Number; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_limitState2:int; public var m_limitMass2:Number; public var m_limitMass1:Number; public var m_limitImpulse2:Number; public var m_u1:b2Vec2; public var m_u2:b2Vec2; public var m_limitImpulse1:Number; public var m_pulleyMass:Number; public static var b2_minPulleyLength:Number = 30; public function b2PulleyJoint(_arg1:b2PulleyJointDef){ var _local2:b2Mat22; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8: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.groundPoint1.x - m_ground.m_position.x); m_groundAnchor1.y = (_arg1.groundPoint1.y - m_ground.m_position.y); m_groundAnchor2.x = (_arg1.groundPoint2.x - m_ground.m_position.x); m_groundAnchor2.y = (_arg1.groundPoint2.y - m_ground.m_position.y); _local2 = m_body1.m_R; _local3 = (_arg1.anchorPoint1.x - m_body1.m_position.x); _local4 = (_arg1.anchorPoint1.y - m_body1.m_position.y); m_localAnchor1.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)); m_localAnchor1.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y)); _local2 = m_body2.m_R; _local3 = (_arg1.anchorPoint2.x - m_body2.m_position.x); _local4 = (_arg1.anchorPoint2.y - m_body2.m_position.y); m_localAnchor2.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)); m_localAnchor2.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y)); m_ratio = _arg1.ratio; _local3 = (_arg1.groundPoint1.x - _arg1.anchorPoint1.x); _local4 = (_arg1.groundPoint1.y - _arg1.anchorPoint1.y); _local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4))); _local3 = (_arg1.groundPoint2.x - _arg1.anchorPoint2.x); _local4 = (_arg1.groundPoint2.y - _arg1.anchorPoint2.y); _local6 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4))); _local7 = b2Math.b2Max((0.5 * b2_minPulleyLength), _local5); _local8 = b2Math.b2Max((0.5 * b2_minPulleyLength), _local6); m_constant = (_local7 + (m_ratio * _local8)); m_maxLength1 = b2Math.b2Clamp(_arg1.maxLength1, _local7, (m_constant - (m_ratio * b2_minPulleyLength))); m_maxLength2 = b2Math.b2Clamp(_arg1.maxLength2, _local8, ((m_constant - b2_minPulleyLength) / m_ratio)); m_pulleyImpulse = 0; m_limitImpulse1 = 0; m_limitImpulse2 = 0; } public function GetLength1():Number{ var _local1:b2Mat22; var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local1 = m_body1.m_R; _local2 = (m_body1.m_position.x + ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y))); _local3 = (m_body1.m_position.y + ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y))); _local4 = (_local2 - (m_ground.m_position.x + m_groundAnchor1.x)); _local5 = (_local3 - (m_ground.m_position.y + m_groundAnchor1.y)); return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5)))); } override public function GetAnchor1():b2Vec2{ var _local1:b2Mat22; _local1 = m_body1.m_R; return (new b2Vec2((m_body1.m_position.x + ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y))), (m_body1.m_position.y + ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y))))); } override public function GetAnchor2():b2Vec2{ var _local1:b2Mat22; _local1 = m_body2.m_R; return (new b2Vec2((m_body2.m_position.x + ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y))), (m_body2.m_position.y + ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y))))); } override public function PrepareVelocitySolver():void{ 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; _local3 = _local1.m_R; _local4 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y)); _local5 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y)); _local3 = _local2.m_R; _local6 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y)); _local7 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y)); _local8 = (_local1.m_position.x + _local4); _local9 = (_local1.m_position.y + _local5); _local10 = (_local2.m_position.x + _local6); _local11 = (_local2.m_position.y + _local7); _local12 = (m_ground.m_position.x + m_groundAnchor1.x); _local13 = (m_ground.m_position.y + m_groundAnchor1.y); _local14 = (m_ground.m_position.x + m_groundAnchor2.x); _local15 = (m_ground.m_position.y + m_groundAnchor2.y); m_u1.Set((_local8 - _local12), (_local9 - _local13)); m_u2.Set((_local10 - _local14), (_local11 - _local15)); _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(); }; if (_local16 < m_maxLength1){ m_limitState1 = e_inactiveLimit; m_limitImpulse1 = 0; } else { m_limitState1 = e_atUpperLimit; m_limitPositionImpulse1 = 0; }; if (_local17 < m_maxLength2){ m_limitState2 = e_inactiveLimit; m_limitImpulse2 = 0; } else { m_limitState2 = e_atUpperLimit; m_limitPositionImpulse2 = 0; }; _local18 = ((_local4 * m_u1.y) - (_local5 * m_u1.x)); _local19 = ((_local6 * m_u2.y) - (_local7 * m_u2.x)); m_limitMass1 = (_local1.m_invMass + ((_local1.m_invI * _local18) * _local18)); m_limitMass2 = (_local2.m_invMass + ((_local2.m_invI * _local19) * _local19)); 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); _local20 = ((-(m_pulleyImpulse) - m_limitImpulse1) * m_u1.x); _local21 = ((-(m_pulleyImpulse) - m_limitImpulse1) * m_u1.y); _local22 = (((-(m_ratio) * m_pulleyImpulse) - m_limitImpulse2) * m_u2.x); _local23 = (((-(m_ratio) * m_pulleyImpulse) - m_limitImpulse2) * m_u2.y); _local1.m_linearVelocity.x = (_local1.m_linearVelocity.x + (_local1.m_invMass * _local20)); _local1.m_linearVelocity.y = (_local1.m_linearVelocity.y + (_local1.m_invMass * _local21)); _local1.m_angularVelocity = (_local1.m_angularVelocity + (_local1.m_invI * ((_local4 * _local21) - (_local5 * _local20)))); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local22)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local23)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local23) - (_local7 * _local22)))); } override public function GetReactionForce(_arg1:Number):b2Vec2{ return (new b2Vec2()); } 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; _local1 = m_body1; _local2 = m_body2; _local4 = (m_ground.m_position.x + m_groundAnchor1.x); _local5 = (m_ground.m_position.y + m_groundAnchor1.y); _local6 = (m_ground.m_position.x + m_groundAnchor2.x); _local7 = (m_ground.m_position.y + m_groundAnchor2.y); _local21 = 0; _local3 = _local1.m_R; _local8 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y)); _local9 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y)); _local3 = _local2.m_R; _local10 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y)); _local11 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y)); _local12 = (_local1.m_position.x + _local8); _local13 = (_local1.m_position.y + _local9); _local14 = (_local2.m_position.x + _local10); _local15 = (_local2.m_position.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)); _local21 = b2Math.b2Max(_local21, Math.abs(_local18)); _local18 = b2Math.b2Clamp(_local18, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection); _local19 = (-(m_pulleyMass) * _local18); _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_position.x = (_local1.m_position.x + (_local1.m_invMass * _local12)); _local1.m_position.y = (_local1.m_position.y + (_local1.m_invMass * _local13)); _local1.m_rotation = (_local1.m_rotation + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12)))); _local2.m_position.x = (_local2.m_position.x + (_local2.m_invMass * _local14)); _local2.m_position.y = (_local2.m_position.y + (_local2.m_invMass * _local15)); _local2.m_rotation = (_local2.m_rotation + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14)))); _local1.m_R.Set(_local1.m_rotation); _local2.m_R.Set(_local2.m_rotation); if (m_limitState1 == e_atUpperLimit){ _local3 = _local1.m_R; _local8 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y)); _local9 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y)); _local12 = (_local1.m_position.x + _local8); _local13 = (_local1.m_position.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); _local21 = b2Math.b2Max(_local21, -(_local18)); _local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0); _local19 = (-(m_limitMass1) * _local18); _local20 = m_limitPositionImpulse1; m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + _local19)); _local19 = (m_limitPositionImpulse1 - _local20); _local12 = (-(_local19) * m_u1.x); _local13 = (-(_local19) * m_u1.y); _local1.m_position.x = (_local1.m_position.x + (_local1.m_invMass * _local12)); _local1.m_position.y = (_local1.m_position.y + (_local1.m_invMass * _local13)); _local1.m_rotation = (_local1.m_rotation + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12)))); _local1.m_R.Set(_local1.m_rotation); }; if (m_limitState2 == e_atUpperLimit){ _local3 = _local2.m_R; _local10 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y)); _local11 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y)); _local14 = (_local2.m_position.x + _local10); _local15 = (_local2.m_position.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); _local21 = b2Math.b2Max(_local21, -(_local18)); _local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0); _local19 = (-(m_limitMass2) * _local18); _local20 = m_limitPositionImpulse2; m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + _local19)); _local19 = (m_limitPositionImpulse2 - _local20); _local14 = (-(_local19) * m_u2.x); _local15 = (-(_local19) * m_u2.y); _local2.m_position.x = (_local2.m_position.x + (_local2.m_invMass * _local14)); _local2.m_position.y = (_local2.m_position.y + (_local2.m_invMass * _local15)); _local2.m_rotation = (_local2.m_rotation + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14)))); _local2.m_R.Set(_local2.m_rotation); }; return ((_local21 < b2Settings.b2_linearSlop)); } public function GetGroundPoint1():b2Vec2{ return (new b2Vec2((m_ground.m_position.x + m_groundAnchor1.x), (m_ground.m_position.y + m_groundAnchor1.y))); } public function GetGroundPoint2():b2Vec2{ return (new b2Vec2((m_ground.m_position.x + m_groundAnchor2.x), (m_ground.m_position.y + m_groundAnchor2.y))); } override public function GetReactionTorque(_arg1:Number):Number{ return (0); } public function GetRatio():Number{ return (m_ratio); } public function GetLength2():Number{ var _local1:b2Mat22; var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local1 = m_body2.m_R; _local2 = (m_body2.m_position.x + ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y))); _local3 = (m_body2.m_position.y + ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y))); _local4 = (_local2 - (m_ground.m_position.x + m_groundAnchor2.x)); _local5 = (_local3 - (m_ground.m_position.y + m_groundAnchor2.y)); 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; _local2 = m_body1; _local3 = m_body2; _local4 = _local2.m_R; _local5 = ((_local4.col1.x * m_localAnchor1.x) + (_local4.col2.x * m_localAnchor1.y)); _local6 = ((_local4.col1.y * m_localAnchor1.x) + (_local4.col2.y * m_localAnchor1.y)); _local4 = _local3.m_R; _local7 = ((_local4.col1.x * m_localAnchor2.x) + (_local4.col2.x * m_localAnchor2.y)); _local8 = ((_local4.col1.y * m_localAnchor2.x) + (_local4.col2.y * m_localAnchor2.y)); _local9 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6)); _local10 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5)); _local11 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local8)); _local12 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local7)); _local17 = (-(((m_u1.x * _local9) + (m_u1.y * _local10))) - (m_ratio * ((m_u2.x * _local11) + (m_u2.y * _local12)))); _local18 = (-(m_pulleyMass) * _local17); m_pulleyImpulse = (m_pulleyImpulse + _local18); _local13 = (-(_local18) * m_u1.x); _local14 = (-(_local18) * m_u1.y); _local15 = ((-(m_ratio) * _local18) * m_u2.x); _local16 = ((-(m_ratio) * _local18) * m_u2.y); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local13)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local14)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local14) - (_local6 * _local13)))); _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 * ((_local7 * _local16) - (_local8 * _local15)))); if (m_limitState1 == e_atUpperLimit){ _local9 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6)); _local10 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5)); _local17 = -(((m_u1.x * _local9) + (m_u1.y * _local10))); _local18 = (-(m_limitMass1) * _local17); _local19 = m_limitImpulse1; m_limitImpulse1 = b2Math.b2Max(0, (m_limitImpulse1 + _local18)); _local18 = (m_limitImpulse1 - _local19); _local13 = (-(_local18) * m_u1.x); _local14 = (-(_local18) * m_u1.y); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local13)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local14)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local14) - (_local6 * _local13)))); }; if (m_limitState2 == e_atUpperLimit){ _local11 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local8)); _local12 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local7)); _local17 = -(((m_u2.x * _local11) + (m_u2.y * _local12))); _local18 = (-(m_limitMass2) * _local17); _local19 = m_limitImpulse2; m_limitImpulse2 = b2Math.b2Max(0, (m_limitImpulse2 + _local18)); _local18 = (m_limitImpulse2 - _local19); _local15 = (-(_local18) * m_u2.x); _local16 = (-(_local18) * m_u2.y); _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 * ((_local7 * _local16) - (_local8 * _local15)))); }; } } }//package Box2D.Dynamics.Joints
Section 52
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; public class b2PulleyJointDef extends b2JointDef { public var groundPoint1:b2Vec2; public var groundPoint2:b2Vec2; public var ratio:Number; public var maxLength1:Number; public var maxLength2:Number; public var anchorPoint1:b2Vec2; public var anchorPoint2:b2Vec2; public function b2PulleyJointDef(){ groundPoint1 = new b2Vec2(); groundPoint2 = new b2Vec2(); anchorPoint1 = new b2Vec2(); anchorPoint2 = new b2Vec2(); super(); type = b2Joint.e_pulleyJoint; groundPoint1.Set(-1, 1); groundPoint2.Set(1, 1); anchorPoint1.Set(-1, 0); anchorPoint2.Set(1, 0); maxLength1 = (0.5 * b2PulleyJoint.b2_minPulleyLength); maxLength2 = (0.5 * b2PulleyJoint.b2_minPulleyLength); ratio = 1; collideConnected = true; } } }//package Box2D.Dynamics.Joints
Section 53
//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_intialAngle:Number; public var m_enableLimit:Boolean; public var m_limitState:int; public var m_ptpMass:b2Mat22; 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_limitImpulse:Number; public var m_motorImpulse:Number; public var m_enableMotor:Boolean; public var m_lowerAngle:Number; public var m_limitPositionImpulse:Number; public var m_maxMotorTorque:Number; public var m_upperAngle:Number; public var m_motorSpeed:Number; public var m_ptpImpulse:b2Vec2; public static var tImpulse:b2Vec2 = new b2Vec2(); public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){ var _local2:b2Mat22; var _local3:Number; var _local4:Number; K = new b2Mat22(); K1 = new b2Mat22(); K2 = new b2Mat22(); K3 = new b2Mat22(); m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_ptpImpulse = new b2Vec2(); m_ptpMass = new b2Mat22(); super(_arg1); _local2 = m_body1.m_R; _local3 = (_arg1.anchorPoint.x - m_body1.m_position.x); _local4 = (_arg1.anchorPoint.y - m_body1.m_position.y); m_localAnchor1.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)); m_localAnchor1.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y)); _local2 = m_body2.m_R; _local3 = (_arg1.anchorPoint.x - m_body2.m_position.x); _local4 = (_arg1.anchorPoint.y - m_body2.m_position.y); m_localAnchor2.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)); m_localAnchor2.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y)); m_intialAngle = (m_body2.m_rotation - m_body1.m_rotation); m_ptpImpulse.Set(0, 0); m_motorImpulse = 0; m_limitImpulse = 0; m_limitPositionImpulse = 0; m_lowerAngle = _arg1.lowerAngle; m_upperAngle = _arg1.upperAngle; m_maxMotorTorque = _arg1.motorTorque; m_motorSpeed = _arg1.motorSpeed; m_enableLimit = _arg1.enableLimit; m_enableMotor = _arg1.enableMotor; } override public function GetAnchor1():b2Vec2{ var _local1:b2Mat22; _local1 = m_body1.m_R; return (new b2Vec2((m_body1.m_position.x + ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y))), (m_body1.m_position.y + ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y))))); } override public function GetAnchor2():b2Vec2{ var _local1:b2Mat22; _local1 = m_body2.m_R; return (new b2Vec2((m_body2.m_position.x + ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y))), (m_body2.m_position.y + ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y))))); } override public function PrepareVelocitySolver():void{ 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; _local1 = m_body1; _local2 = m_body2; _local3 = _local1.m_R; _local4 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y)); _local5 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y)); _local3 = _local2.m_R; _local6 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y)); _local7 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y)); _local8 = _local1.m_invMass; _local9 = _local2.m_invMass; _local10 = _local1.m_invI; _local11 = _local2.m_invI; K1.col1.x = (_local8 + _local9); K1.col2.x = 0; K1.col1.y = 0; K1.col2.y = (_local8 + _local9); K2.col1.x = ((_local10 * _local5) * _local5); K2.col2.x = ((-(_local10) * _local4) * _local5); K2.col1.y = ((-(_local10) * _local4) * _local5); K2.col2.y = ((_local10 * _local4) * _local4); K3.col1.x = ((_local11 * _local7) * _local7); K3.col2.x = ((-(_local11) * _local6) * _local7); K3.col1.y = ((-(_local11) * _local6) * _local7); K3.col2.y = ((_local11 * _local6) * _local6); K.SetM(K1); K.AddM(K2); K.AddM(K3); K.Invert(m_ptpMass); m_motorMass = (1 / (_local10 + _local11)); if (m_enableMotor == false){ m_motorImpulse = 0; }; if (m_enableLimit){ _local12 = ((_local2.m_rotation - _local1.m_rotation) - m_intialAngle); if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){ m_limitState = e_equalLimits; } else { if (_local12 <= m_lowerAngle){ if (m_limitState != e_atLowerLimit){ m_limitImpulse = 0; }; m_limitState = e_atLowerLimit; } else { if (_local12 >= m_upperAngle){ if (m_limitState != e_atUpperLimit){ m_limitImpulse = 0; }; m_limitState = e_atUpperLimit; } else { m_limitState = e_inactiveLimit; m_limitImpulse = 0; }; }; }; } else { m_limitImpulse = 0; }; if (b2World.s_enableWarmStarting){ _local1.m_linearVelocity.x = (_local1.m_linearVelocity.x - (_local8 * m_ptpImpulse.x)); _local1.m_linearVelocity.y = (_local1.m_linearVelocity.y - (_local8 * m_ptpImpulse.y)); _local1.m_angularVelocity = (_local1.m_angularVelocity - (_local10 * ((((_local4 * m_ptpImpulse.y) - (_local5 * m_ptpImpulse.x)) + m_motorImpulse) + m_limitImpulse))); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local9 * m_ptpImpulse.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local9 * m_ptpImpulse.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local11 * ((((_local6 * m_ptpImpulse.y) - (_local7 * m_ptpImpulse.x)) + m_motorImpulse) + m_limitImpulse))); } else { m_ptpImpulse.SetZero(); m_motorImpulse = 0; m_limitImpulse = 0; }; m_limitPositionImpulse = 0; } override public function GetReactionForce(_arg1:Number):b2Vec2{ var _local2:b2Vec2; _local2 = m_ptpImpulse.Copy(); _local2.Multiply(_arg1); return (_local2); } 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; _local3 = m_body1; _local4 = m_body2; _local5 = 0; _local6 = _local3.m_R; _local7 = ((_local6.col1.x * m_localAnchor1.x) + (_local6.col2.x * m_localAnchor1.y)); _local8 = ((_local6.col1.y * m_localAnchor1.x) + (_local6.col2.y * m_localAnchor1.y)); _local6 = _local4.m_R; _local9 = ((_local6.col1.x * m_localAnchor2.x) + (_local6.col2.x * m_localAnchor2.y)); _local10 = ((_local6.col1.y * m_localAnchor2.x) + (_local6.col2.y * m_localAnchor2.y)); _local11 = (_local3.m_position.x + _local7); _local12 = (_local3.m_position.y + _local8); _local13 = (_local4.m_position.x + _local9); _local14 = (_local4.m_position.y + _local10); _local15 = (_local13 - _local11); _local16 = (_local14 - _local12); _local5 = Math.sqrt(((_local15 * _local15) + (_local16 * _local16))); _local17 = _local3.m_invMass; _local18 = _local4.m_invMass; _local19 = _local3.m_invI; _local20 = _local4.m_invI; K1.col1.x = (_local17 + _local18); K1.col2.x = 0; K1.col1.y = 0; K1.col2.y = (_local17 + _local18); K2.col1.x = ((_local19 * _local8) * _local8); K2.col2.x = ((-(_local19) * _local7) * _local8); K2.col1.y = ((-(_local19) * _local7) * _local8); K2.col2.y = ((_local19 * _local7) * _local7); K3.col1.x = ((_local20 * _local10) * _local10); K3.col2.x = ((-(_local20) * _local9) * _local10); K3.col1.y = ((-(_local20) * _local9) * _local10); K3.col2.y = ((_local20 * _local9) * _local9); K.SetM(K1); K.AddM(K2); K.AddM(K3); K.Solve(tImpulse, -(_local15), -(_local16)); _local21 = tImpulse.x; _local22 = tImpulse.y; _local3.m_position.x = (_local3.m_position.x - (_local3.m_invMass * _local21)); _local3.m_position.y = (_local3.m_position.y - (_local3.m_invMass * _local22)); _local3.m_rotation = (_local3.m_rotation - (_local3.m_invI * ((_local7 * _local22) - (_local8 * _local21)))); _local3.m_R.Set(_local3.m_rotation); _local4.m_position.x = (_local4.m_position.x + (_local4.m_invMass * _local21)); _local4.m_position.y = (_local4.m_position.y + (_local4.m_invMass * _local22)); _local4.m_rotation = (_local4.m_rotation + (_local4.m_invI * ((_local9 * _local22) - (_local10 * _local21)))); _local4.m_R.Set(_local4.m_rotation); _local23 = 0; if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local24 = ((_local4.m_rotation - _local3.m_rotation) - m_intialAngle); _local25 = 0; if (m_limitState == e_equalLimits){ _local2 = b2Math.b2Clamp(_local24, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection); _local25 = (-(m_motorMass) * _local2); _local23 = b2Math.b2Abs(_local2); } else { if (m_limitState == e_atLowerLimit){ _local2 = (_local24 - m_lowerAngle); _local23 = b2Math.b2Max(0, -(_local2)); _local2 = b2Math.b2Clamp((_local2 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0); _local25 = (-(m_motorMass) * _local2); _local1 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local25), 0); _local25 = (m_limitPositionImpulse - _local1); } else { if (m_limitState == e_atUpperLimit){ _local2 = (_local24 - m_upperAngle); _local23 = b2Math.b2Max(0, _local2); _local2 = b2Math.b2Clamp((_local2 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection); _local25 = (-(m_motorMass) * _local2); _local1 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local25), 0); _local25 = (m_limitPositionImpulse - _local1); }; }; }; _local3.m_rotation = (_local3.m_rotation - (_local3.m_invI * _local25)); _local3.m_R.Set(_local3.m_rotation); _local4.m_rotation = (_local4.m_rotation + (_local4.m_invI * _local25)); _local4.m_R.Set(_local4.m_rotation); }; return ((((_local5 <= b2Settings.b2_linearSlop)) && ((_local23 <= 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 SetMotorTorque(_arg1:Number):void{ m_maxMotorTorque = _arg1; } public function GetJointAngle():Number{ return ((m_body2.m_rotation - m_body1.m_rotation)); } public function GetMotorTorque(_arg1:Number):Number{ return ((_arg1 * m_motorImpulse)); } override public function GetReactionTorque(_arg1:Number):Number{ return ((_arg1 * m_limitImpulse)); } 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; _local2 = m_body1; _local3 = m_body2; _local4 = _local2.m_R; _local5 = ((_local4.col1.x * m_localAnchor1.x) + (_local4.col2.x * m_localAnchor1.y)); _local6 = ((_local4.col1.y * m_localAnchor1.x) + (_local4.col2.y * m_localAnchor1.y)); _local4 = _local3.m_R; _local7 = ((_local4.col1.x * m_localAnchor2.x) + (_local4.col2.x * m_localAnchor2.y)); _local8 = ((_local4.col1.y * m_localAnchor2.x) + (_local4.col2.y * m_localAnchor2.y)); _local10 = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local8)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local6)); _local11 = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local7)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local5)); _local12 = -(((m_ptpMass.col1.x * _local10) + (m_ptpMass.col2.x * _local11))); _local13 = -(((m_ptpMass.col1.y * _local10) + (m_ptpMass.col2.y * _local11))); m_ptpImpulse.x = (m_ptpImpulse.x + _local12); m_ptpImpulse.y = (m_ptpImpulse.y + _local13); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local2.m_invMass * _local12)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local2.m_invMass * _local13)); _local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * ((_local5 * _local13) - (_local6 * _local12)))); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local12)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local13)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local7 * _local13) - (_local8 * _local12)))); if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){ _local14 = ((_local3.m_angularVelocity - _local2.m_angularVelocity) - m_motorSpeed); _local15 = (-(m_motorMass) * _local14); _local16 = m_motorImpulse; m_motorImpulse = b2Math.b2Clamp((m_motorImpulse + _local15), (-(_arg1.dt) * m_maxMotorTorque), (_arg1.dt * m_maxMotorTorque)); _local15 = (m_motorImpulse - _local16); _local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * _local15)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * _local15)); }; if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local17 = (_local3.m_angularVelocity - _local2.m_angularVelocity); _local18 = (-(m_motorMass) * _local17); if (m_limitState == e_equalLimits){ m_limitImpulse = (m_limitImpulse + _local18); } else { if (m_limitState == e_atLowerLimit){ _local9 = m_limitImpulse; m_limitImpulse = b2Math.b2Max((m_limitImpulse + _local18), 0); _local18 = (m_limitImpulse - _local9); } else { if (m_limitState == e_atUpperLimit){ _local9 = m_limitImpulse; m_limitImpulse = b2Math.b2Min((m_limitImpulse + _local18), 0); _local18 = (m_limitImpulse - _local9); }; }; }; _local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * _local18)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * _local18)); }; } } }//package Box2D.Dynamics.Joints
Section 54
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; public class b2RevoluteJointDef extends b2JointDef { public var upperAngle:Number; public var lowerAngle:Number; public var motorSpeed:Number; public var anchorPoint:b2Vec2; public var motorTorque:Number; public var enableMotor:Boolean; public var enableLimit:Boolean; public function b2RevoluteJointDef(){ type = b2Joint.e_revoluteJoint; anchorPoint = new b2Vec2(0, 0); lowerAngle = 0; upperAngle = 0; motorTorque = 0; motorSpeed = 0; enableLimit = false; enableMotor = false; } } }//package Box2D.Dynamics.Joints
Section 55
//b2Body (Box2D.Dynamics.b2Body) package Box2D.Dynamics { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; import Box2D.Dynamics.Joints.*; import Box2D.Common.*; public class b2Body { public var m_next:b2Body; public var m_mass:Number; public var m_contactList:b2ContactNode; public var m_angularVelocity:Number; public var m_rotation:Number; public var m_shapeList:b2Shape; public var m_R:b2Mat22; public var m_force:b2Vec2; public var m_torque:Number; public var m_rotation0:Number; public var m_userData; public var m_linearVelocity:b2Vec2; public var m_position:b2Vec2; public var m_flags:uint; public var m_invI:Number; public var m_invMass:Number; public var m_prev:b2Body; public var m_world:b2World; public var m_linearDamping:Number; public var m_position0:b2Vec2; public var m_angularDamping:Number; private var sMat0:b2Mat22; public var m_center:b2Vec2; public var m_sleepTime:Number; public var m_shapeCount:int; public var m_I:Number; public var m_jointList:b2JointNode; public static var e_frozenFlag:uint = 2; public static var e_sleepFlag:uint = 8; public static var e_islandFlag:uint = 4; public static var e_destroyFlag:uint = 32; public static var e_allowSleepFlag:uint = 16; public static var e_staticFlag:uint = 1; public function b2Body(_arg1:b2BodyDef, _arg2:b2World){ var _local3:int; var _local4:b2ShapeDef; var _local5:b2MassData; var _local6:Array; var _local7:b2Vec2; var _local8:b2Shape; sMat0 = new b2Mat22(); m_position = new b2Vec2(); m_R = new b2Mat22(0); m_position0 = new b2Vec2(); super(); m_flags = 0; m_position.SetV(_arg1.position); m_rotation = _arg1.rotation; m_R.Set(m_rotation); m_position0.SetV(m_position); m_rotation0 = m_rotation; m_world = _arg2; m_linearDamping = b2Math.b2Clamp((1 - _arg1.linearDamping), 0, 1); m_angularDamping = b2Math.b2Clamp((1 - _arg1.angularDamping), 0, 1); m_force = new b2Vec2(0, 0); m_torque = 0; m_mass = 0; _local6 = new Array(b2Settings.b2_maxShapesPerBody); _local3 = 0; while (_local3 < b2Settings.b2_maxShapesPerBody) { _local6[_local3] = new b2MassData(); _local3++; }; m_shapeCount = 0; m_center = new b2Vec2(0, 0); _local3 = 0; while (_local3 < b2Settings.b2_maxShapesPerBody) { _local4 = _arg1.shapes[_local3]; if (_local4 == null){ break; }; _local5 = _local6[_local3]; _local4.ComputeMass(_local5); m_mass = (m_mass + _local5.mass); m_center.x = (m_center.x + (_local5.mass * (_local4.localPosition.x + _local5.center.x))); m_center.y = (m_center.y + (_local5.mass * (_local4.localPosition.y + _local5.center.y))); m_shapeCount++; _local3++; }; if (m_mass > 0){ m_center.Multiply((1 / m_mass)); m_position.Add(b2Math.b2MulMV(m_R, m_center)); } else { m_flags = (m_flags | e_staticFlag); }; m_I = 0; _local3 = 0; while (_local3 < m_shapeCount) { _local4 = _arg1.shapes[_local3]; _local5 = _local6[_local3]; m_I = (m_I + _local5.I); _local7 = b2Math.SubtractVV(b2Math.AddVV(_local4.localPosition, _local5.center), m_center); m_I = (m_I + (_local5.mass * b2Math.b2Dot(_local7, _local7))); _local3++; }; if (m_mass > 0){ m_invMass = (1 / m_mass); } else { m_invMass = 0; }; if ((((m_I > 0)) && ((_arg1.preventRotation == false)))){ m_invI = (1 / m_I); } else { m_I = 0; m_invI = 0; }; m_linearVelocity = b2Math.AddVV(_arg1.linearVelocity, b2Math.b2CrossFV(_arg1.angularVelocity, m_center)); m_angularVelocity = _arg1.angularVelocity; m_jointList = null; m_contactList = null; m_prev = null; m_next = null; m_shapeList = null; _local3 = 0; while (_local3 < m_shapeCount) { _local4 = _arg1.shapes[_local3]; _local8 = b2Shape.Create(_local4, this, m_center); _local8.m_next = m_shapeList; m_shapeList = _local8; _local3++; }; m_sleepTime = 0; if (_arg1.allowSleep){ m_flags = (m_flags | e_allowSleepFlag); }; if (_arg1.isSleeping){ m_flags = (m_flags | e_sleepFlag); }; if ((((m_flags & e_sleepFlag)) || ((m_invMass == 0)))){ m_linearVelocity.Set(0, 0); m_angularVelocity = 0; }; m_userData = _arg1.userData; } public function SetCenterPosition(_arg1:b2Vec2, _arg2:Number):void{ var _local3:b2Shape; if (IsFrozen()){ return; }; m_rotation = _arg2; m_R.Set(m_rotation); m_position.SetV(_arg1); m_position0.SetV(m_position); m_rotation0 = m_rotation; _local3 = m_shapeList; while (_local3 != null) { _local3.Synchronize(m_position, m_R, m_position, m_R); _local3 = _local3.m_next; }; m_world.m_broadPhase.Commit(); } public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{ return (b2Math.AddVV(m_position, b2Math.b2MulMV(m_R, _arg1))); } public function SetLinearVelocity(_arg1:b2Vec2):void{ m_linearVelocity.SetV(_arg1); } public function IsFrozen():Boolean{ return (((m_flags & e_frozenFlag) == e_frozenFlag)); } public function IsSleeping():Boolean{ return (((m_flags & e_sleepFlag) == e_sleepFlag)); } public function QuickSyncShapes():void{ var _local1:b2Shape; _local1 = m_shapeList; while (_local1 != null) { _local1.QuickSync(m_position, m_R); _local1 = _local1.m_next; }; } public function GetInertia():Number{ return (m_I); } public function GetLocalVector(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulTMV(m_R, _arg1)); } public function GetLinearVelocity():b2Vec2{ return (m_linearVelocity); } public function GetJointList():b2JointNode{ return (m_jointList); } public function IsConnected2(_arg1:b2Body, _arg2:Array){ var _local3:b2JointNode; _arg2.push(this); if (IsStatic()){ return (false); }; _local3 = m_jointList; while (_local3 != null) { if (_arg2.indexOf(_local3.other) == -1){ if (_local3.other == _arg1){ return ((_local3.joint.m_collideConnected == false)); }; if (_local3.other.IsConnected2(_arg1, _arg2)){ return (true); }; }; _local3 = _local3.next; }; return (false); } public function GetRotationMatrix():b2Mat22{ return (m_R); } public function Freeze():void{ var _local1:b2Shape; m_flags = (m_flags | e_frozenFlag); m_linearVelocity.SetZero(); m_angularVelocity = 0; _local1 = m_shapeList; while (_local1 != null) { _local1.DestroyProxy(); _local1 = _local1.m_next; }; } public function SetAngularVelocity(_arg1:Number):void{ m_angularVelocity = _arg1; } public function SynchronizeShapes():void{ var _local1:b2Shape; sMat0.Set(m_rotation0); _local1 = m_shapeList; while (_local1 != null) { _local1.Synchronize(m_position0, sMat0, m_position, m_R); _local1 = _local1.m_next; }; } public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{ if (IsSleeping() == false){ m_force.Add(_arg1); m_torque = (m_torque + b2Math.b2CrossVV(b2Math.SubtractVV(_arg2, m_position), _arg1)); }; } public function GetOriginPosition():b2Vec2{ return (b2Math.SubtractVV(m_position, b2Math.b2MulMV(m_R, m_center))); } public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{ if (IsSleeping() == false){ m_linearVelocity.Add(b2Math.MulFV(m_invMass, _arg1)); m_angularVelocity = (m_angularVelocity + (m_invI * b2Math.b2CrossVV(b2Math.SubtractVV(_arg2, m_position), _arg1))); }; } public function GetContactList():b2ContactNode{ return (m_contactList); } public function GetAngularVelocity():Number{ return (m_angularVelocity); } public function GetMass():Number{ return (m_mass); } public function GetShapeList():b2Shape{ return (m_shapeList); } public function SetOriginPosition(_arg1:b2Vec2, _arg2:Number):void{ var _local3:b2Shape; if (IsFrozen()){ return; }; m_rotation = _arg2; m_R.Set(m_rotation); m_position = b2Math.AddVV(_arg1, b2Math.b2MulMV(m_R, m_center)); m_position0.SetV(m_position); m_rotation0 = m_rotation; _local3 = m_shapeList; while (_local3 != null) { _local3.Synchronize(m_position, m_R, m_position, m_R); _local3 = _local3.m_next; }; m_world.m_broadPhase.Commit(); } public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulTMV(m_R, b2Math.SubtractVV(_arg1, m_position))); } public function GetRotation():Number{ return (m_rotation); } public function IsStatic():Boolean{ return (((m_flags & e_staticFlag) == e_staticFlag)); } public function Destroy():void{ var _local1:b2Shape; var _local2:b2Shape; _local1 = m_shapeList; while (_local1) { _local2 = _local1; _local1 = _local1.m_next; b2Shape.Destroy(_local2); }; } public function GetWorldVector(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulMV(m_R, _arg1)); } public function GetNext():b2Body{ return (m_next); } public function IsConnected(_arg1:b2Body):Boolean{ var _local2:Array; var _local3:b2JointNode; _local2 = new Array(); _local2.push(this); _local3 = m_jointList; while (_local3 != null) { if (_local3.other == _arg1){ return ((_local3.joint.m_collideConnected == false)); }; if (((!(IsStatic())) && (_local3.other.IsConnected2(_arg1, _local2)))){ return (true); }; _local3 = _local3.next; }; return (false); } public function GetUserData(){ return (m_userData); } public function GetCenterPosition():b2Vec2{ return (m_position); } public function ApplyTorque(_arg1:Number):void{ if (IsSleeping() == false){ m_torque = (m_torque + _arg1); }; } public function AllowSleeping(_arg1:Boolean):void{ if (_arg1){ m_flags = (m_flags | e_allowSleepFlag); } else { m_flags = (m_flags & ~(e_allowSleepFlag)); WakeUp(); }; } public function WakeUp():void{ m_flags = (m_flags & ~(e_sleepFlag)); m_sleepTime = 0; } } }//package Box2D.Dynamics
Section 56
//b2BodyDef (Box2D.Dynamics.b2BodyDef) package Box2D.Dynamics { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Common.*; public class b2BodyDef { public var angularDamping:Number; public var rotation:Number; public var allowSleep:Boolean; public var userData; public var linearDamping:Number; public var angularVelocity:Number; public var linearVelocity:b2Vec2; public var position:b2Vec2; public var shapes:Array; public var isSleeping:Boolean; public var preventRotation:Boolean; public function b2BodyDef(){ var _local1:int; shapes = new Array(); super(); userData = null; _local1 = 0; while (_local1 < b2Settings.b2_maxShapesPerBody) { shapes[_local1] = null; _local1++; }; position = new b2Vec2(0, 0); rotation = 0; linearVelocity = new b2Vec2(0, 0); angularVelocity = 0; linearDamping = 0; angularDamping = 0; allowSleep = true; isSleeping = false; preventRotation = false; } public function AddShape(_arg1:b2ShapeDef):void{ var _local2:int; _local2 = 0; while (_local2 < b2Settings.b2_maxShapesPerBody) { if (shapes[_local2] == null){ shapes[_local2] = _arg1; break; }; _local2++; }; } } }//package Box2D.Dynamics
Section 57
//b2CollisionFilter (Box2D.Dynamics.b2CollisionFilter) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; public class b2CollisionFilter { public static var b2_defaultFilter:b2CollisionFilter = new (b2CollisionFilter); ; public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{ var _local3:Boolean; if ((((_arg1.m_groupIndex == _arg2.m_groupIndex)) && (!((_arg1.m_groupIndex == 0))))){ return ((_arg1.m_groupIndex > 0)); }; _local3 = ((!(((_arg1.m_maskBits & _arg2.m_categoryBits) == 0))) && (!(((_arg1.m_categoryBits & _arg2.m_maskBits) == 0)))); return (_local3); } } }//package Box2D.Dynamics
Section 58
//b2ContactManager (Box2D.Dynamics.b2ContactManager) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; import Box2D.Collision.*; public class b2ContactManager extends b2PairCallback { public var m_world:b2World; public var m_destroyImmediate:Boolean; public var m_nullContact:b2NullContact; public function b2ContactManager(){ m_nullContact = new b2NullContact(); super(); m_world = null; m_destroyImmediate = false; } public function Collide():void{ var _local1:b2Body; var _local2:b2Body; var _local3:b2ContactNode; var _local4:b2ContactNode; var _local5:b2Contact; var _local6:int; var _local7:int; _local5 = m_world.m_contactList; while (_local5 != null) { if (((_local5.m_shape1.m_body.IsSleeping()) && (_local5.m_shape2.m_body.IsSleeping()))){ } else { _local6 = _local5.GetManifoldCount(); _local5.Evaluate(); _local7 = _local5.GetManifoldCount(); if ((((_local6 == 0)) && ((_local7 > 0)))){ _local1 = _local5.m_shape1.m_body; _local2 = _local5.m_shape2.m_body; _local3 = _local5.m_node1; _local4 = _local5.m_node2; _local3.contact = _local5; _local3.other = _local2; _local3.prev = null; _local3.next = _local1.m_contactList; if (_local3.next != null){ _local3.next.prev = _local5.m_node1; }; _local1.m_contactList = _local5.m_node1; _local4.contact = _local5; _local4.other = _local1; _local4.prev = null; _local4.next = _local2.m_contactList; if (_local4.next != null){ _local4.next.prev = _local4; }; _local2.m_contactList = _local4; } else { if ((((_local6 > 0)) && ((_local7 == 0)))){ _local1 = _local5.m_shape1.m_body; _local2 = _local5.m_shape2.m_body; _local3 = _local5.m_node1; _local4 = _local5.m_node2; if (_local3.prev){ _local3.prev.next = _local3.next; }; if (_local3.next){ _local3.next.prev = _local3.prev; }; if (_local3 == _local1.m_contactList){ _local1.m_contactList = _local3.next; }; _local3.prev = null; _local3.next = null; if (_local4.prev){ _local4.prev.next = _local4.next; }; if (_local4.next){ _local4.next.prev = _local4.prev; }; if (_local4 == _local2.m_contactList){ _local2.m_contactList = _local4.next; }; _local4.prev = null; _local4.next = null; }; }; }; _local5 = _local5.m_next; }; } public function DestroyContact(_arg1:b2Contact):void{ var _local2:b2Body; var _local3:b2Body; var _local4:b2ContactNode; var _local5:b2ContactNode; 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; }; if (_arg1.GetManifoldCount() > 0){ _local2 = _arg1.m_shape1.m_body; _local3 = _arg1.m_shape2.m_body; _local4 = _arg1.m_node1; _local5 = _arg1.m_node2; _local2.WakeUp(); _local3.WakeUp(); if (_local4.prev){ _local4.prev.next = _local4.next; }; if (_local4.next){ _local4.next.prev = _local4.prev; }; if (_local4 == _local2.m_contactList){ _local2.m_contactList = _local4.next; }; _local4.prev = null; _local4.next = null; if (_local5.prev){ _local5.prev.next = _local5.next; }; if (_local5.next){ _local5.next.prev = _local5.prev; }; if (_local5 == _local3.m_contactList){ _local3.m_contactList = _local5.next; }; _local5.prev = null; _local5.next = null; }; b2Contact.Destroy(_arg1, m_world.m_blockAllocator); m_world.m_contactCount--; } override public function PairAdded(_arg1, _arg2){ var _local3:b2Shape; var _local4:b2Shape; var _local5:b2Body; var _local6:b2Body; var _local7:b2Contact; var _local8:b2Shape; var _local9:b2Body; _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_filter == null))) && ((m_world.m_filter.ShouldCollide(_local3, _local4) == false)))){ return (m_nullContact); }; if (_local6.m_invMass == 0){ _local8 = _local3; _local3 = _local4; _local4 = _local8; _local9 = _local5; _local5 = _local6; _local6 = _local9; }; _local7 = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator); if (_local7 == null){ return (m_nullContact); }; _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; m_world.m_contactCount++; return (_local7); } public function CleanContactList():void{ var _local1:b2Contact; var _local2:b2Contact; _local1 = m_world.m_contactList; while (_local1 != null) { _local2 = _local1; _local1 = _local1.m_next; if ((_local2.m_flags & b2Contact.e_destroyFlag)){ DestroyContact(_local2); _local2 = null; }; }; } override public function PairRemoved(_arg1, _arg2, _arg3):void{ var _local4:b2Contact; if (_arg3 == null){ return; }; _local4 = (_arg3 as b2Contact); if (_local4 != m_nullContact){ if (m_destroyImmediate == true){ DestroyContact(_local4); _local4 = null; } else { _local4.m_flags = (_local4.m_flags | b2Contact.e_destroyFlag); }; }; } } }//package Box2D.Dynamics
Section 59
//b2Island (Box2D.Dynamics.b2Island) package Box2D.Dynamics { import Box2D.Common.Math.*; import Box2D.Dynamics.Contacts.*; import Box2D.Dynamics.Joints.*; import Box2D.Common.*; public class b2Island { public var m_positionError:Number; public var m_bodyCapacity:int; public var m_bodies:Array; public var m_joints:Array; public var m_jointCapacity:int; public var m_contactCount:int; public var m_contacts:Array; public var m_contactCapacity:int; public var m_jointCount:int; public var m_allocator; public var m_bodyCount:int; public static var m_positionIterationCount:uint; public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4):void{ var _local5:int; super(); m_bodyCapacity = _arg1; m_contactCapacity = _arg2; m_jointCapacity = _arg3; m_bodyCount = 0; m_contactCount = 0; m_jointCount = 0; m_bodies = new Array(_arg1); _local5 = 0; while (_local5 < _arg1) { m_bodies[_local5] = null; _local5++; }; m_contacts = new Array(_arg2); _local5 = 0; while (_local5 < _arg2) { m_contacts[_local5] = null; _local5++; }; m_joints = new Array(_arg3); _local5 = 0; while (_local5 < _arg3) { m_joints[_local5] = null; _local5++; }; m_allocator = _arg4; } 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 Solve(_arg1:b2TimeStep, _arg2:b2Vec2):void{ var _local3:int; var _local4:b2Body; var _local5:b2ContactSolver; var _local6:int; var _local7:Boolean; var _local8:Boolean; var _local9:Boolean; _local3 = 0; while (_local3 < m_bodyCount) { _local4 = m_bodies[_local3]; if (_local4.m_invMass == 0){ } else { _local4.m_linearVelocity.Add(b2Math.MulFV(_arg1.dt, b2Math.AddVV(_arg2, b2Math.MulFV(_local4.m_invMass, _local4.m_force)))); _local4.m_angularVelocity = (_local4.m_angularVelocity + ((_arg1.dt * _local4.m_invI) * _local4.m_torque)); _local4.m_linearVelocity.Multiply(_local4.m_linearDamping); _local4.m_angularVelocity = (_local4.m_angularVelocity * _local4.m_angularDamping); _local4.m_position0.SetV(_local4.m_position); _local4.m_rotation0 = _local4.m_rotation; }; _local3++; }; _local5 = new b2ContactSolver(m_contacts, m_contactCount, m_allocator); _local5.PreSolve(); _local3 = 0; while (_local3 < m_jointCount) { m_joints[_local3].PrepareVelocitySolver(); _local3++; }; _local3 = 0; while (_local3 < _arg1.iterations) { _local5.SolveVelocityConstraints(); _local6 = 0; while (_local6 < m_jointCount) { m_joints[_local6].SolveVelocityConstraints(_arg1); _local6++; }; _local3++; }; _local3 = 0; while (_local3 < m_bodyCount) { _local4 = m_bodies[_local3]; if (_local4.m_invMass == 0){ } else { _local4.m_position.x = (_local4.m_position.x + (_arg1.dt * _local4.m_linearVelocity.x)); _local4.m_position.y = (_local4.m_position.y + (_arg1.dt * _local4.m_linearVelocity.y)); _local4.m_rotation = (_local4.m_rotation + (_arg1.dt * _local4.m_angularVelocity)); _local4.m_R.Set(_local4.m_rotation); }; _local3++; }; _local3 = 0; while (_local3 < m_jointCount) { m_joints[_local3].PreparePositionSolver(); _local3++; }; if (b2World.s_enablePositionCorrection){ m_positionIterationCount = 0; while (m_positionIterationCount < _arg1.iterations) { _local7 = _local5.SolvePositionConstraints(b2Settings.b2_contactBaumgarte); _local8 = true; _local3 = 0; while (_local3 < m_jointCount) { _local9 = m_joints[_local3].SolvePositionConstraints(); _local8 = ((_local8) && (_local9)); _local3++; }; if (((_local7) && (_local8))){ break; }; m_positionIterationCount++; }; }; _local5.PostSolve(); _local3 = 0; while (_local3 < m_bodyCount) { _local4 = m_bodies[_local3]; if (_local4.m_invMass == 0){ } else { _local4.m_R.Set(_local4.m_rotation); _local4.SynchronizeShapes(); _local4.m_force.Set(0, 0); _local4.m_torque = 0; }; _local3++; }; } 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 UpdateSleep(_arg1:Number):void{ var _local2:int; var _local3:b2Body; var _local4:Number; var _local5:Number; var _local6:Number; _local4 = Number.MAX_VALUE; _local5 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance); _local6 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance); _local2 = 0; while (_local2 < m_bodyCount) { _local3 = m_bodies[_local2]; if (_local3.m_invMass == 0){ } else { if ((_local3.m_flags & b2Body.e_allowSleepFlag) == 0){ _local3.m_sleepTime = 0; _local4 = 0; }; if (((((((_local3.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local3.m_angularVelocity * _local3.m_angularVelocity) > _local6)))) || ((b2Math.b2Dot(_local3.m_linearVelocity, _local3.m_linearVelocity) > _local5)))){ _local3.m_sleepTime = 0; _local4 = 0; } else { _local3.m_sleepTime = (_local3.m_sleepTime + _arg1); _local4 = b2Math.b2Min(_local4, _local3.m_sleepTime); }; }; _local2++; }; if (_local4 >= b2Settings.b2_timeToSleep){ _local2 = 0; while (_local2 < m_bodyCount) { _local3 = m_bodies[_local2]; _local3.m_flags = (_local3.m_flags | b2Body.e_sleepFlag); _local2++; }; }; } } }//package Box2D.Dynamics
Section 60
//b2TimeStep (Box2D.Dynamics.b2TimeStep) package Box2D.Dynamics { public class b2TimeStep { public var dt:Number; public var iterations:int; public var inv_dt:Number; } }//package Box2D.Dynamics
Section 61
//b2World (Box2D.Dynamics.b2World) package Box2D.Dynamics { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; import Box2D.Dynamics.Joints.*; import Box2D.Collision.*; public class b2World { public var m_filter:b2CollisionFilter; public var m_blockAllocator; public var m_contactList:b2Contact; public var m_broadPhase:b2BroadPhase; public var m_allowSleep:Boolean; public var m_jointCount:int; public var m_bodyCount:int; public var m_listener:b2WorldListener; private var step:b2TimeStep; public var m_positionIterationCount:int; public var m_groundBody:b2Body; public var m_contactCount:int; public var m_bodyDestroyList:b2Body; public var m_bodyList:b2Body; public var m_stackAllocator; public var m_gravity:b2Vec2; public var m_jointList:b2Joint; public var m_contactManager:b2ContactManager; public static var s_enableWarmStarting:int = 1; public static var s_enablePositionCorrection:int = 1; public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){ var _local4:b2BodyDef; step = new b2TimeStep(); m_contactManager = new b2ContactManager(); super(); m_listener = null; m_filter = b2CollisionFilter.b2_defaultFilter; m_bodyList = null; m_contactList = null; m_jointList = null; m_bodyCount = 0; m_contactCount = 0; m_jointCount = 0; m_bodyDestroyList = null; m_allowSleep = _arg3; m_gravity = _arg2; m_contactManager.m_world = this; m_broadPhase = new b2BroadPhase(_arg1, m_contactManager); _local4 = new b2BodyDef(); m_groundBody = CreateBody(_local4); } public function SetListener(_arg1:b2WorldListener):void{ m_listener = _arg1; } public function DestroyBody(_arg1:b2Body):void{ if ((_arg1.m_flags & b2Body.e_destroyFlag)){ return; }; 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; }; _arg1.m_flags = (_arg1.m_flags | b2Body.e_destroyFlag); m_bodyCount--; _arg1.m_prev = null; _arg1.m_next = m_bodyDestroyList; m_bodyDestroyList = _arg1; } public function GetGroundBody():b2Body{ return (m_groundBody); } public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{ var _local4:Array; var _local5:int; var _local6:int; _local4 = new Array(); _local5 = m_broadPhase.QueryAABB(_arg1, _local4, _arg3); _local6 = 0; while (_local6 < _local5) { _arg2[_local6] = (_local4[_local6] as b2Shape); _local6++; }; return (_local5); } public function CleanBodyList():void{ var _local1:b2Body; var _local2:b2Body; var _local3:b2JointNode; var _local4:b2JointNode; m_contactManager.m_destroyImmediate = true; _local1 = m_bodyDestroyList; while (_local1) { _local2 = _local1; _local1 = _local1.m_next; _local3 = _local2.m_jointList; while (_local3) { _local4 = _local3; _local3 = _local3.next; if (m_listener){ m_listener.NotifyJointDestroyed(_local4.joint); }; DestroyJoint(_local4.joint); }; _local2.Destroy(); }; m_bodyDestroyList = null; m_contactManager.m_destroyImmediate = false; } public function GetJointList():b2Joint{ return (m_jointList); } public function GetBodyList():b2Body{ return (m_bodyList); } public function GetContactList():b2Contact{ return (m_contactList); } 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.ResetProxy(m_broadPhase); _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.ResetProxy(m_broadPhase); _local6 = _local6.m_next; }; }; } public function SetFilter(_arg1:b2CollisionFilter):void{ m_filter = _arg1; } public function CreateBody(_arg1:b2BodyDef):b2Body{ var _local2:b2Body; _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 Step(_arg1:Number, _arg2:int):void{ var _local3:b2Body; var _local4:b2Body; var _local5:b2Island; var _local6:b2Contact; var _local7:b2Joint; var _local8:int; var _local9:Array; var _local10:int; var _local11:b2Body; var _local12:int; var _local13:int; var _local14:b2ContactNode; var _local15:b2JointNode; var _local16:uint; step.dt = _arg1; step.iterations = _arg2; if (_arg1 > 0){ step.inv_dt = (1 / _arg1); } else { step.inv_dt = 0; }; m_positionIterationCount = 0; m_contactManager.CleanContactList(); CleanBodyList(); m_contactManager.Collide(); _local5 = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator); _local3 = m_bodyList; while (_local3 != null) { _local3.m_flags = (_local3.m_flags & ~(b2Body.e_islandFlag)); _local3 = _local3.m_next; }; _local6 = m_contactList; while (_local6 != null) { _local6.m_flags = (_local6.m_flags & ~(b2Contact.e_islandFlag)); _local6 = _local6.m_next; }; _local7 = m_jointList; while (_local7 != null) { _local7.m_islandFlag = false; _local7 = _local7.m_next; }; _local8 = m_bodyCount; _local9 = new Array(m_bodyCount); _local10 = 0; while (_local10 < m_bodyCount) { _local9[_local10] = null; _local10++; }; _local11 = m_bodyList; while (_local11 != null) { if ((_local11.m_flags & (((b2Body.e_staticFlag | b2Body.e_islandFlag) | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){ } else { _local5.Clear(); _local12 = 0; var _temp1 = _local12; _local12 = (_local12 + 1); var _local17 = _temp1; _local9[_local17] = _local11; _local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag); while (_local12 > 0) { --_local12; _local3 = _local9[_local12]; _local5.AddBody(_local3); _local3.m_flags = (_local3.m_flags & ~(b2Body.e_sleepFlag)); if ((_local3.m_flags & b2Body.e_staticFlag)){ } else { _local14 = _local3.m_contactList; while (_local14 != null) { if ((_local14.contact.m_flags & b2Contact.e_islandFlag)){ } else { _local5.AddContact(_local14.contact); _local14.contact.m_flags = (_local14.contact.m_flags | b2Contact.e_islandFlag); _local4 = _local14.other; if ((_local4.m_flags & b2Body.e_islandFlag)){ } else { var _temp2 = _local12; _local12 = (_local12 + 1); var _local18 = _temp2; _local9[_local18] = _local4; _local4.m_flags = (_local4.m_flags | b2Body.e_islandFlag); }; }; _local14 = _local14.next; }; _local15 = _local3.m_jointList; while (_local15 != null) { if (_local15.joint.m_islandFlag == true){ } else { _local5.AddJoint(_local15.joint); _local15.joint.m_islandFlag = true; _local4 = _local15.other; if ((_local4.m_flags & b2Body.e_islandFlag)){ } else { var _temp3 = _local12; _local12 = (_local12 + 1); _local18 = _temp3; _local9[_local18] = _local4; _local4.m_flags = (_local4.m_flags | b2Body.e_islandFlag); }; }; _local15 = _local15.next; }; }; }; _local5.Solve(step, m_gravity); m_positionIterationCount = b2Math.b2Max(m_positionIterationCount, b2Island.m_positionIterationCount); if (m_allowSleep){ _local5.UpdateSleep(_arg1); }; _local13 = 0; while (_local13 < _local5.m_bodyCount) { _local3 = _local5.m_bodies[_local13]; if ((_local3.m_flags & b2Body.e_staticFlag)){ _local3.m_flags = (_local3.m_flags & ~(b2Body.e_islandFlag)); }; if (((_local3.IsFrozen()) && (m_listener))){ _local16 = m_listener.NotifyBoundaryViolated(_local3); if (_local16 == b2WorldListener.b2_destroyBody){ DestroyBody(_local3); _local3 = null; _local5.m_bodies[_local13] = null; }; }; _local13++; }; }; _local11 = _local11.m_next; }; m_broadPhase.Commit(); } } }//package Box2D.Dynamics
Section 62
//b2WorldListener (Box2D.Dynamics.b2WorldListener) package Box2D.Dynamics { import Box2D.Dynamics.Joints.*; public class b2WorldListener { public static var b2_freezeBody:uint = 0; public static var b2_destroyBody:uint = 1; public function NotifyBoundaryViolated(_arg1:b2Body):uint{ return (b2_freezeBody); } public function NotifyJointDestroyed(_arg1:b2Joint):void{ } } }//package Box2D.Dynamics
Section 63
//b2iBody (Box2DIntegration.b2iBody) package Box2DIntegration { import Box2D.Collision.Shapes.*; import Box2D.Dynamics.*; public class b2iBody extends b2iGameObject { override public function createBody(){ var _local1:b2iLevel; var _local2:b2BodyDef; var _local3:b2ShapeDef; var _local4:b2iShape; var _local5:int; _local1 = b2iLevel(parent); _local2 = new b2BodyDef(); _local5 = 0; while (_local5 < this.numChildren) { if ((this.getChildAt(_local5) is b2iShape)){ _local4 = b2iShape(this.getChildAt(_local5)); _local3 = _local4.createShape(_local1, this); _local3.localPosition.Set((_local1.physCoord(_local4.x) * this.scaleX), (_local1.physCoord(_local4.y) * this.scaleY)); _local3.localRotation = (_local4.rotation * 0.017453293); _local2.AddShape(_local3); }; _local5++; }; _local2.position.Set(_local1.physCoord(this.x), _local1.physCoord(this.y)); _local2.rotation = (this.rotation * 0.017453293); m_body = _local1.m_world.CreateBody(_local2); m_body.m_userData = this; } } }//package Box2DIntegration
Section 64
//b2iBoxShape (Box2DIntegration.b2iBoxShape) package Box2DIntegration { import Box2D.Collision.Shapes.*; import flash.geom.*; public class b2iBoxShape extends b2iShape { override public function createShape(_arg1:b2iLevel, _arg2:b2iGameObject):b2ShapeDef{ var _local3:b2BoxDef; var _local4:Rectangle; _local3 = new b2BoxDef(); _local4 = this.getRect(this); trace(("scaleX " + scaleX)); _local3.extents.Set(((_arg1.physCoord((_local4.width / 2)) * this.scaleX) * _arg2.scaleX), ((_arg1.physCoord((_local4.height / 2)) * this.scaleY) * _arg2.scaleY)); _local3.density = density; _local3.friction = friction; _local3.restitution = restitution; return (_local3); } } }//package Box2DIntegration
Section 65
//b2iCircleShape (Box2DIntegration.b2iCircleShape) package Box2DIntegration { import Box2D.Collision.Shapes.*; public class b2iCircleShape extends b2iShape { override public function createShape(_arg1:b2iLevel, _arg2:b2iGameObject):b2ShapeDef{ var _local3:b2CircleDef; _local3 = new b2CircleDef(); _local3.radius = (_arg1.physCoord((this.width / 2)) * _arg2.scaleX); _local3.restitution = restitution; _local3.density = density; _local3.friction = friction; return (_local3); } } }//package Box2DIntegration
Section 66
//b2iGameObject (Box2DIntegration.b2iGameObject) package Box2DIntegration { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import flash.display.*; public class b2iGameObject extends MovieClip { public var m_body:b2Body; public function createBody(){ trace("GameObject: create body"); } public function Update(){ var _local1:b2iLevel; var _local2:b2Vec2; _local1 = b2iLevel(parent); _local2 = this.m_body.GetOriginPosition(); this.x = (_local2.x * _local1.m_physScale); this.y = (_local2.y * _local1.m_physScale); this.rotation = (this.m_body.GetRotation() * 57.29577951); } } }//package Box2DIntegration
Section 67
//b2iLevel (Box2DIntegration.b2iLevel) package Box2DIntegration { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; import Box2D.Dynamics.Joints.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import flash.display.*; import Box2D.Common.*; public class b2iLevel extends b2iObjectGroup { public var m_physScale:Number; public var draw_geometry:Boolean; public var m_iterations:int; private var mousePVec:b2Vec2; public var m_world:b2World; public var mouseXWorldPhys:Number; public var mouseYWorldPhys:Number; public var m_timeStep:Number; public function b2iLevel(){ mousePVec = new b2Vec2(); super(); draw_geometry = false; } public function destroy(){ trace("base level destroyed"); this.parent.removeChild(this); m_world = null; } public function physCoord(_arg1:Number){ return ((_arg1 / m_physScale)); } public function restart(){ } public function GetBodyAtMouse(_arg1:Boolean=false):b2Body{ var _local2:b2AABB; var _local3:int; var _local4:Array; var _local5:int; var _local6:b2Body; var _local7:int; var _local8:Boolean; mousePVec.Set(mouseXWorldPhys, mouseYWorldPhys); _local2 = new b2AABB(); _local2.minVertex.Set((mouseXWorldPhys - 0.001), (mouseYWorldPhys - 0.001)); _local2.maxVertex.Set((mouseXWorldPhys + 0.001), (mouseYWorldPhys + 0.001)); _local3 = 10; _local4 = new Array(); _local5 = m_world.Query(_local2, _local4, _local3); _local6 = null; _local7 = 0; while (_local7 < _local5) { if ((((_local4[_local7].m_body.IsStatic() == false)) || (_arg1))){ _local8 = _local4[_local7].TestPoint(mousePVec); if (_local8){ _local6 = _local4[_local7].m_body; break; }; }; _local7++; }; return (_local6); } public function start(){ } public function DrawShape(_arg1:b2Shape){ var _local2:b2CircleShape; 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:b2Vec2; var _local12:b2Vec2; var _local13:b2PolyShape; var _local14:b2Vec2; switch (_arg1.m_type){ case b2Shape.e_circleShape: _local2 = (_arg1 as b2CircleShape); _local3 = _local2.m_position; _local4 = _local2.m_radius; _local5 = 16; _local6 = ((2 * Math.PI) / _local5); this.graphics.lineStyle(1, 0xFFFFFF, 1); this.graphics.moveTo(((_local3.x + _local4) * m_physScale), (_local3.y * m_physScale)); _local7 = 0; _local8 = 0; while (_local8 < _local5) { _local11 = new b2Vec2((_local4 * Math.cos(_local7)), (_local4 * Math.sin(_local7))); _local12 = b2Math.AddVV(_local3, _local11); this.graphics.lineTo((_local12.x * m_physScale), (_local12.y * m_physScale)); _local7 = (_local7 + _local6); _local8++; }; this.graphics.lineTo(((_local3.x + _local4) * m_physScale), (_local3.y * m_physScale)); this.graphics.moveTo((_local3.x * m_physScale), (_local3.y * m_physScale)); _local9 = _local2.m_R.col1; _local10 = new b2Vec2((_local3.x + (_local4 * _local9.x)), (_local3.y + (_local4 * _local9.y))); this.graphics.lineTo((_local10.x * m_physScale), (_local10.y * m_physScale)); break; case b2Shape.e_polyShape: _local13 = (_arg1 as b2PolyShape); _local14 = b2Math.AddVV(_local13.m_position, b2Math.b2MulMV(_local13.m_R, _local13.m_vertices[_local8])); this.graphics.lineStyle(1, 0xFFFFFF, 1); this.graphics.moveTo((_local14.x * m_physScale), (_local14.y * m_physScale)); _local8 = 0; while (_local8 < _local13.m_vertexCount) { _local12 = b2Math.AddVV(_local13.m_position, b2Math.b2MulMV(_local13.m_R, _local13.m_vertices[_local8])); this.graphics.lineTo((_local12.x * m_physScale), (_local12.y * m_physScale)); _local8++; }; this.graphics.lineTo((_local14.x * m_physScale), (_local14.y * m_physScale)); break; }; } public function UpdateMouseWorld(){ mouseXWorldPhys = (mouseX / m_physScale); mouseYWorldPhys = (mouseY / m_physScale); } override public function adoptChildren(_arg1:DisplayObject){ trace("child adopted"); this.addChild(_arg1); } function drawGeometry(){ var _local1:b2Body; var _local2:b2Shape; this.graphics.clear(); _local1 = m_world.m_bodyList; while (_local1) { _local2 = _local1.GetShapeList(); while (_local2 != null) { DrawShape(_local2); _local2 = _local2.GetNext(); }; _local1 = _local1.m_next; }; } public function createLevel(_arg1:int=1000, _arg2:int=-1000, _arg3:int=1000, _arg4:int=-1000, _arg5:b2Vec2=null, _arg6:Boolean=true, _arg7:int=1, _arg8:int=10, _arg9:Number=0.0166666666666667){ var _local10:b2AABB; var _local11:b2Vec2; _local10 = new b2AABB(); _local10.minVertex.Set(_arg2, _arg4); _local10.maxVertex.Set(_arg1, _arg3); m_physScale = _arg7; m_iterations = _arg8; m_timeStep = _arg9; if (_arg5){ _local11 = new b2Vec2(_local11.x, _local11.y); } else { _local11 = new b2Vec2(0, 300); }; m_world = new b2World(_local10, _local11, _arg6); } override public function Update(){ m_world.Step(m_timeStep, m_iterations); UpdateChildren(); UpdateMouseWorld(); if (draw_geometry){ drawGeometry(); }; } } }//package Box2DIntegration
Section 68
//b2iObjectGroup (Box2DIntegration.b2iObjectGroup) package Box2DIntegration { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; import Box2D.Dynamics.Joints.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import flash.display.*; import Box2D.Common.*; public class b2iObjectGroup extends MovieClip { public function UpdateChildren(){ var _local1:*; var _local2:b2iGameObject; var _local3:b2Vec2; var _local4:int; var _local5:b2Vec2; _local3 = new b2Vec2(); _local4 = 0; while (_local4 < this.numChildren) { _local1 = this.getChildAt(_local4); if ((_local1 is b2iGameObject)){ _local2 = b2iGameObject(_local1); _local2.Update(); } else { if ((_local1 is b2iRevoluteJoint)){ _local5 = _local1.m_joint.GetAnchor1(); _local1.x = _local5.x; _local1.y = _local5.y; }; }; _local4++; }; } public function adoptChildren(_arg1:DisplayObject){ } public function Update(){ } } }//package Box2DIntegration
Section 69
//b2iRevoluteJoint (Box2DIntegration.b2iRevoluteJoint) package Box2DIntegration { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; import Box2D.Dynamics.Joints.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import flash.geom.*; import flash.display.*; import Box2D.Common.*; public class b2iRevoluteJoint extends MovieClip { public var m_joint:b2RevoluteJoint; private var torque_:Number; public var jd:b2RevoluteJointDef; public var useStatic:Boolean;// = true public var useGround:Boolean;// = true private var speed_:Number; public function b2iRevoluteJoint(){ jd = new b2RevoluteJointDef(); useGround = true; useStatic = true; super(); } public function set torque(_arg1:Number){ torque_ = _arg1; } public function get torque():Number{ return (this.torque_); } public function get speed():Number{ return (this.speed_); } public function set speed(_arg1:Number){ speed_ = _arg1; } public function createJoint(){ var _local1:b2iLevel; var _local2:b2World; var _local3:b2AABB; var _local4:Array; var _local5:int; var _local6:Array; var _local7:int; var _local8:b2Body; var _local9:int; var _local10:Boolean; _local1 = b2iLevel(parent); _local2 = _local1.m_world; _local3 = new b2AABB(); _local3.minVertex.Set((this.x - 0.001), (this.y - 0.001)); _local3.maxVertex.Set((this.x + 0.001), (this.y + 0.001)); _local4 = new Array(); _local5 = 10; _local6 = new Array(); _local7 = _local2.Query(_local3, _local6, _local5); _local8 = null; _local9 = 0; while (_local9 < _local7) { if ((((_local6[_local9].m_body.IsStatic() == false)) || (useStatic))){ _local10 = _local6[_local9].TestPoint(new b2Vec2(this.x, this.y)); if (_local10){ _local4.push(_local6[_local9].m_body); }; }; _local9++; }; if (_local4.length > 0){ if (_local4.length >= 2){ jd.body1 = _local4[0]; jd.body2 = _local4[1]; jd.anchorPoint.Set(_local1.physCoord(this.x), _local1.physCoord(this.y)); m_joint = b2RevoluteJoint(_local2.CreateJoint(jd)); } else { if (useGround){ jd.body1 = _local2.m_groundBody; jd.body2 = _local4[0]; jd.anchorPoint.Set(_local1.physCoord(this.x), _local1.physCoord(this.y)); m_joint = b2RevoluteJoint(_local2.CreateJoint(jd)); } else { m_joint = null; }; }; } else { m_joint = null; }; } } }//package Box2DIntegration
Section 70
//b2iShape (Box2DIntegration.b2iShape) package Box2DIntegration { import Box2D.Collision.Shapes.*; import flash.display.*; public class b2iShape extends MovieClip { private var restitution_:Number; private var density_:Number; private var friction_:Number; public function get friction():Number{ return (this.friction_); } public function createShape(_arg1:b2iLevel, _arg2:b2iGameObject):b2ShapeDef{ return (null); } public function set friction(_arg1:Number){ friction_ = _arg1; } public function get restitution():Number{ return (this.restitution_); } public function set density(_arg1:Number){ density_ = _arg1; } public function set restitution(_arg1:Number){ restitution_ = _arg1; } public function get density():Number{ return (this.density_); } } }//package Box2DIntegration
Section 71
//ConvexHull (com.FlashDynamix.geom.ConvexHull) package com.FlashDynamix.geom { import flash.geom.*; import com.FlashDynamix.types.*; public class ConvexHull { public static function bottomRight(_arg1:Array):int{ var _local2:int; var _local3:int; var _local4:*; _local2 = 0; _local3 = 0; while (_local3 < _arg1.length) { _local4 = _arg1[_local3]; if ((((_local4.y > _arg1[_local2].y)) || ((((_local4.y >= _arg1[_local2].y)) && ((_local4.x > _arg1[_local2].x)))))){ _local2 = _local3; }; _local3++; }; return (_local2); } public static function sortC(_arg1:Function, _arg2:Array):Array{ sortCC(_arg1, _arg2).reverse(); _arg2.unshift(_arg2.pop()); return (_arg2); } public static function isLeft(_arg1, _arg2, _arg3):int{ return ((((_arg2.x - _arg1.x) * (_arg3.y - _arg1.y)) - ((_arg3.x - _arg1.x) * (_arg2.y - _arg1.y)))); } public static function bottomLeft(_arg1:Array):int{ var _local2:int; var _local3:int; var _local4:Point; _local2 = 0; _local3 = 0; while (_local3 < _arg1.length) { _local4 = _arg1[_local3]; if ((((_local4.y > _arg1[_local2].y)) || ((((_local4.y >= _arg1[_local2].y)) && ((_local4.x < _arg1[_local2].x)))))){ _local2 = _local3; }; _local3++; }; return (_local2); } public static function findAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ var _local5:Number; var _local6:Number; var _local7:Number; _local5 = (_arg3 - _arg1); _local6 = (_arg4 - _arg2); if ((((_local5 == 0)) && ((_local6 == 0)))){ return (0); }; _local7 = (Math.atan((_local6 / _local5)) * (180 / Math.PI)); if ((((_local5 >= 0)) && ((_local6 >= 0)))){ _local7 = (90 + _local7); } else { if ((((_local5 >= 0)) && ((_local6 < 0)))){ _local7 = (90 + _local7); } else { if ((((_local5 < 0)) && ((_local6 > 0)))){ _local7 = (270 + _local7); } else { if ((((_local5 < 0)) && ((_local6 <= 0)))){ _local7 = (270 + _local7); }; }; }; }; return (_local7); } public static function bfpHullD(_arg1:Array, _arg2:int):Array{ var _local3:Array; var _local4:int; var _local5:int; var _local6:int; var _local7:int; var _local8:int; var _local9:int; var _local10:int; var _local11:Point; var _local12:int; var _local13:int; var _local14:int; var _local15:Array; var _local16:int; _local3 = new Array(); _local4 = _arg1.length; _local5 = 0; _local6 = 0; _local7 = 0; _local8 = 0; _local9 = _arg1[0].x; _local10 = _arg1[0].x; _local12 = 0; _local13 = -1; _local14 = 0; _local14 = 1; while (_local14 < _local4) { _local11 = _arg1[_local14]; if (_local11.x <= _local9){ if (_local11.x < _local9){ _local9 = _local11.x; _local6 = _local14; _local5 = _local6; } else { if (_local11.y < _arg1[_local5].y){ _local5 = _local14; } else { if (_local11.y > _arg1[_local6].y){ _local6 = _local14; }; }; }; }; if (_local11.x >= _local10){ if (_local11.x > _local10){ _local10 = _local11.x; _local8 = _local14; _local7 = _local8; } else { if (_local11.y < _arg1[_local7].y){ _local7 = _local14; } else { if (_local11.y > _arg1[_local8].y){ _local8 = _local14; }; }; }; }; _local14++; }; if (_local9 == _local10){ ++_local13; var _local17 = _local13; _local3[_local17] = _arg1[_local5]; if (_local6 != _local5){ ++_local13; var _local18 = _local13; _local3[_local18] = _arg1[_local6]; }; return (_local3); }; _local15 = new Array((_arg2 + 2)); _local15[0] = new Object(); _local15[0].min = _local5; _local15[0].max = _local6; _local15[(_arg2 + 1)] = new Object(); _local15[(_arg2 + 1)].min = _local7; _local15[(_arg2 + 1)].max = _local8; _local16 = 0; _local16 = 1; while (_local16 <= _arg2) { _local15[_local16] = new Object(); _local15[_local16].min = (_local15[_local16].max = -1); _local16++; }; _local16 = 0; _local14 = 0; for (;_local14 < _local4;_local14++) { _local11 = _arg1[_local14]; if ((((_local11.x == _local9)) || ((_local11.x == _local10)))){ } else { if (ConvexHull.isLeft(_arg1[_local5], _arg1[_local7], _local11) < 0){ _local16 = int((((_arg2 * (_local11.x - _local9)) / (_local10 - _local9)) + 1)); if (_local15[_local16].min == -1){ _local15[_local16].min = _local14; } else { if (_local11.y < _arg1[_local15[_local16].min].y){ _local15[_local16].min = _local14; }; }; } else { if (ConvexHull.isLeft(_arg1[_local6], _arg1[_local8], _local11) > 0){ _local16 = int((((_arg2 * (_local11.x - _local9)) / (_local10 - _local9)) + 1)); if (_local15[_local16].max == -1){ _local15[_local16].max = _local14; } else { if (_local11.y > _arg1[_local15[_local16].max].y){ _local15[_local16].max = _local14; }; }; continue; }; }; }; }; _local14 = 0; while (_local14 <= (_arg2 + 1)) { if (_local15[_local14].min == -1){ } else { _local11 = _arg1[_local15[_local14].min]; while (_local13 > 0) { if (ConvexHull.isLeft(_local3[(_local13 - 1)], _local3[_local13], _local11) > 0){ break; } else { _local13--; }; }; ++_local13; _local17 = _local13; _local3[_local17] = _local11; }; _local14++; }; if (_local8 != _local7){ ++_local13; _local17 = _local13; _local3[_local17] = _arg1[_local8]; }; _local12 = _local13; _local14 = _arg2; while (_local14 >= 0) { if (_local15[_local14].max == -1){ } else { _local11 = _arg1[_local15[_local14].max]; while (_local13 > _local12) { if (ConvexHull.isLeft(_local3[(_local13 - 1)], _local3[_local13], _local11) > 0){ break; } else { _local13--; }; }; ++_local13; _local17 = _local13; _local3[_local17] = _local11; }; _local14--; }; if (_local6 != _local5){ ++_local13; _local17 = _local13; _local3[_local17] = _arg1[_local5]; }; _local3.pop(); return (_local3); } public static function grahamScan2D(_arg1:Array):Array{ var _local2:Array; var _local3:int; ConvexHull.sortC(ConvexHull.bottomRight, _arg1); _local2 = new Array(_arg1[1], _arg1[0]); _local3 = 2; while (_local3 < _arg1.length) { if (_local2.length > 1){ if (ConvexHull.isLeft(_local2[0], _local2[1], _arg1[_local3]) < 0){ _local2.unshift(_arg1[_local3]); _local3++; } else { _local2.splice(0, 1); }; } else { _local2.unshift(_arg1[_local3]); _local3++; }; }; return (_local2); } public static function sortCC(_arg1:Function, _arg2:Array):Array{ var idx:Number; var pt:Point; var same:Array; var start = _arg1; var p = _arg2; idx = start(p); pt = p[idx]; same = new Array(); p.sort(function (_arg1, _arg2){ var _local3:Number; var _local4:Number; _local3 = Line.angle(pt, _arg1); _local4 = Line.angle(pt, _arg2); if (_local3 > _local4){ return (-1); }; if (_local3 < _local4){ return (1); }; same.push(_arg1); return (0); }); Array2.removeItems(p, same); return (p); } public static function startBottomRight(_arg1:Array):Array{ var _local2:Number; var _local3:Array; _local2 = ConvexHull.bottomRight(_arg1); _local3 = _arg1.slice(_local2, _arg1.length); _local3 = _local3.concat(_arg1.slice(0, _local2)); return (_local3); } } }//package com.FlashDynamix.geom
Section 72
//Line (com.FlashDynamix.geom.Line) package com.FlashDynamix.geom { public class Line { public static function isParallel(_arg1, _arg2, _arg3, _arg4):Boolean{ return ((Line.angle(_arg1, _arg2) == Line.angle(_arg3, _arg4))); } public static function angle(_arg1, _arg2):Number{ return (Math.atan2((_arg2.y - _arg1.y), (_arg2.x - _arg1.x))); } public static function projectOnLine(_arg1, _arg2, _arg3){ var _local4:*; _local4 = Line.angle(_arg1, _arg2); return ({x:(_arg1.x + (Math.cos(_local4) * _arg3)), y:(_arg1.y + (Math.sin(_local4) * _arg3))}); } public static function length(_arg1, _arg2):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 isPointOnLine(_arg1, _arg2, _arg3):Boolean{ return ((((Math.abs((Line.degree(_arg1, _arg2) - Line.degree(_arg1, _arg3))) < 0.25)) && ((Line.length(_arg1, _arg3) <= Line.length(_arg1, _arg2))))); } public static function scalar(_arg1, _arg2, _arg3):Number{ var _local4:Number; var _local5:Number; _local4 = Line.length(_arg1, _arg2); _local5 = Line.length(_arg1, _arg3); return ((_local5 / _local4)); } public static function degree(_arg1, _arg2):Number{ return (((angle(_arg1, _arg2) * 180) / Math.PI)); } } }//package com.FlashDynamix.geom
Section 73
//Array2 (com.FlashDynamix.types.Array2) package com.FlashDynamix.types { public class Array2 { public static function insertAt(_arg1:Number, _arg2:Array, _arg3:Array):Array{ var _local4:Array; _local4 = _arg2.splice(_arg1); _arg2 = _arg2.concat(_arg3); return (_arg2.concat(_local4)); } public static function remove(_arg1:Array, _arg2):Array{ var _local3:*; _local3 = 0; while (_local3 < _arg1.length) { if (_arg1[_local3] == _arg2){ _arg1.splice(_local3, 1); _local3--; }; _local3++; }; return (_arg1); } public static function addBetween(_arg1:Array, _arg2){ var _local3:*; _local3 = 1; while (_local3 < _arg1.length) { _arg1.splice(_local3, 0, _arg2); _local3++; _local3++; }; return (_arg1); } public static function removeEmpty(_arg1:Array, _arg2):Array{ var _local3:*; _local3 = 0; while (_local3 < _arg1.length) { if (_arg1[_local3] == _arg2){ _arg1.splice(_local3, 1); _local3--; }; _local3++; }; return (_arg1); } public static function setEmpty(_arg1:Array, _arg2, _arg3):Array{ var _local4:*; _local4 = 0; while (_local4 < _arg1.length) { if (_arg1[_local4] == _arg2){ _arg1[_local4] = _arg3; }; _local4++; }; return (_arg1); } public static function removeItems(_arg1:Array, _arg2:Array):Array{ var _local3:*; _local3 = 0; while (_local3 < _arg2.length) { remove(_arg1, _arg2[_local3]); _local3++; }; return (_arg1); } public static function contains(_arg1:Array, _arg2):Boolean{ var _local3:*; _local3 = 0; while (_local3 < _arg1.length) { if (_arg1[_local3].valueOf() == _arg2.valueOf()){ return (true); }; _local3++; }; return (false); } } }//package com.FlashDynamix.types
Section 74
//GameIntroComponent (com.miniclip.components.GameIntroComponent) package com.miniclip.components { import flash.events.*; import flash.display.*; import flash.text.*; import flash.net.*; import flash.system.*; public class GameIntroComponent extends UIComponentTiny { private var tfDebug:TextField; private var mcExternalAnimation:MovieClip;// = null public var animationUrl:String;// = "http://www.miniclip.com/swfcontent/as3/intro.swf" public var mcInternalAnimation:MovieClip; public var mcBackgroundBlock:MovieClip; private var externalLoader:Loader;// = null private var isOnMiniclip:Boolean;// = false private static var DEFAULT_WIDTH:uint = 328; private static var DEFAULT_HEIGHT:uint = 204; public function GameIntroComponent():void{ externalLoader = null; mcExternalAnimation = null; isOnMiniclip = false; animationUrl = "http://www.miniclip.com/swfcontent/as3/intro.swf"; super(); } override protected function init():void{ if (!isLivePreview){ Security.allowInsecureDomain("*"); mcInternalAnimation.mcOffsite.addEventListener(MouseEvent.CLICK, onMiniclipClick, false, 0, false); isOnMiniclip = detectOnMiniclip(); x = 0; y = 0; width = DEFAULT_WIDTH; height = DEFAULT_HEIGHT; mcInternalAnimation.x = ((stage.stageWidth / 2) - (DEFAULT_WIDTH / 2)); mcInternalAnimation.y = ((stage.stageHeight / 2) - (DEFAULT_HEIGHT / 2)); mcInternalAnimation.visible = true; mcBackgroundBlock.width = stage.stageWidth; mcBackgroundBlock.height = stage.stageHeight; loadExternalAnimation(); if (isOnMiniclip){ addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true); }; }; } private function onMiniclipClick(_arg1:MouseEvent):void{ navigateToURL(new URLRequest("http://www.miniclip.com/")); } private function removeInternalAnimation():void{ if (mcInternalAnimation){ removeChild(mcInternalAnimation); mcInternalAnimation = null; }; } private function detectOnMiniclip():Boolean{ var _local1:RegExp; _local1 = /^http:\/\/[\w]+.miniclip.com/; return (_local1.test(loaderInfo.url)); } private function updateProgress():void{ if (mcExternalAnimation){ mcExternalAnimation.updateProgress((loaderInfo.bytesLoaded / loaderInfo.bytesTotal)); }; } private function externalAnimationLoaded(_arg1:Event):void{ removeInternalAnimation(); addChild(externalLoader); externalLoader.visible = true; mcExternalAnimation = MovieClip(externalLoader.content); mcExternalAnimation.addEventListener("finished", onExternalAnimationFinished, false, 0, true); mcExternalAnimation.begin(isOnMiniclip); } private function onExternalAnimationFinished(_arg1:Event):void{ removeExternalAnimation(); removeEventListener(Event.ENTER_FRAME, onEnterFrame); removeComponent(); dispatchEvent(new Event(Event.COMPLETE)); } private function externalAnimationProgress(_arg1:ProgressEvent):void{ var _local2:uint; _local2 = Math.round(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100)); mcInternalAnimation.mcProgress.gotoAndStop(_local2); } private function externalAnimationError():void{ removeEventListener(Event.ENTER_FRAME, onEnterFrame); mcInternalAnimation.mcOffsite.alpha = 1; } private function loadExternalAnimation():void{ var _local1:String; var _local2:URLRequest; externalLoader = new Loader(); externalLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, externalAnimationLoaded); externalLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, externalAnimationProgress); externalLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, externalAnimationIoErrorHandler); externalLoader.visible = false; _local1 = ((animationUrl + "?") + Math.round((Math.random() * 10000))); _local2 = new URLRequest(_local1); externalLoader.load(_local2); } private function onEnterFrame(_arg1:Event):void{ updateProgress(); } private function externalAnimationIoErrorHandler(_arg1:IOErrorEvent):void{ externalAnimationError(); } private function removeExternalAnimation():void{ if (mcExternalAnimation != null){ removeChild(externalLoader); mcExternalAnimation = null; externalLoader.unload(); }; } private function removeComponent():void{ removeChild(mcBackgroundBlock); if (externalLoader){ externalLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, externalAnimationLoaded); externalLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, externalAnimationIoErrorHandler); externalLoader = null; }; } } }//package com.miniclip.components
Section 75
//UIComponentTiny (com.miniclip.components.UIComponentTiny) package com.miniclip.components { import flash.events.*; import flash.display.*; import flash.utils.*; public class UIComponentTiny extends MovieClip { protected var callLaterMethods:Dictionary; public static var inCallLaterPhase:Boolean = false; public function UIComponentTiny():void{ callLaterMethods = new Dictionary(); callLater(init); } protected function init():void{ } private function callLaterDispatcher(_arg1:Event):void{ var _local2:Dictionary; var _local3:Object; if (_arg1.type == Event.ADDED_TO_STAGE){ removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher); stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true); stage.invalidate(); return; }; _arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher); if (stage == null){ addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true); return; }; inCallLaterPhase = true; _local2 = callLaterMethods; for (_local3 in _local2) { _local3(); delete _local2[_local3]; }; inCallLaterPhase = false; } protected function get isLivePreview():Boolean{ var className:String; if (parent == null){ return (false); }; try { className = getQualifiedClassName(parent); } catch(e:Error) { }; return ((className == "fl.livepreview::LivePreviewParent")); } protected function callLater(_arg1:Function):void{ if (inCallLaterPhase){ return; }; callLaterMethods[_arg1] = true; if (stage != null){ stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true); stage.invalidate(); } else { addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true); }; } } }//package com.miniclip.components
Section 76
//Contenedor_1 (Drawing_fla.Contenedor_1) package Drawing_fla { import flash.display.*; public dynamic class Contenedor_1 extends MovieClip { public function Contenedor_1(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package Drawing_fla
Section 77
//Figura5_116 (Drawing_fla.Figura5_116) package Drawing_fla { import flash.display.*; public dynamic class Figura5_116 extends MovieClip { public function Figura5_116(){ addFrameScript(133, frame134); } function frame134(){ } } }//package Drawing_fla
Section 78
//Fondos_120 (Drawing_fla.Fondos_120) package Drawing_fla { import flash.display.*; public dynamic class Fondos_120 extends MovieClip { public function Fondos_120(){ addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4); } function frame3(){ stop(); } function frame1(){ stop(); } function frame4(){ stop(); } function frame2(){ stop(); } } }//package Drawing_fla
Section 79
//LevelNum_87 (Drawing_fla.LevelNum_87) package Drawing_fla { import flash.display.*; import flash.text.*; public dynamic class LevelNum_87 extends MovieClip { public var textfield:TextField; public function LevelNum_87(){ addFrameScript(0, frame1); } function frame1(){ textfield.mouseEnabled = false; } } }//package Drawing_fla
Section 80
//MainTimeline (Drawing_fla.MainTimeline) package Drawing_fla { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; import Box2D.Dynamics.Joints.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import flash.events.*; import fl.motion.*; import flash.geom.*; import Game.*; import flash.display.*; import Box2DIntegration.*; import com.FlashDynamix.geom.*; import flash.media.*; import flash.text.*; import com.miniclip.components.*; import flash.utils.*; import flash.net.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.printing.*; import flash.system.*; import flash.ui.*; import flash.xml.*; public dynamic class MainTimeline extends MovieClip { public const SCREEN_WIDTH:int = 640; public const MIN_PERIMETER:int = 40; public const SCROLL_SPEED:int = 10; public const SCREEN_HEIGHT:int = 480; public const MIN_ANGLE:Number = 7; public const CLOSE_DISTANCE:int = 21; public const MIN_DIST_TO_LINE:int = 10; public const LIFE_SPAN:int = 3600; public const MAX_PERIMETER:int = 1500; public const MAX_CIRCLE_RADIUS:int = 100; public const MIN_DISTANCE:int = 5; public const TORQUE_BOLA:Number = 60000000; public const MIN_CIRCLE_RADIUS:int = 10; public const CIRCLE_PRECISION:int = 8; public const BOX_THICKNESS:int = 3; public var estrellasOrigen:Array; public var pinnedObjects:Array; public var perimeter:int; public var drawing:Boolean; public var connectedPinned:Array; public var noTint:Color; public var i:int; public var intro:GameIntroComponent; public var circleTimer:Timer; public var cosTable:Array; public var aspasmenu:MovieClip; public var softBlurFilter:Array; public var drawingCircle:Boolean; public var contenedor:MovieClip; public var lastPoint:Point; public var bola:b2iGameObject; public var shadowFilter:Array; public var i_fondo:MovieClip; public var blurFilter:Array; public var whiteTint:Color; public var i_tuto:MovieClip; public var letsplay:SimpleButton; public var b_play:SimpleButton; public var colorProperties:Array; public var cProperties2:Array; public var cProperties3:Array; public var cProperties4:Array; public var bolaStart:Point; public var cProperties1:Array; public var menu_ad:MovieClip; public var endTimer:Timer; public var cursor:MovieClip; public var currentColorProperty:int; public var timerBackToMenu:Timer; public var newBody:MovieClip; public var estrellas:Array; public var puntosFigura:Array; public var circleRadius:Number; public var level:MWLevel; public var inGameUI:InGameUI; public var linksXRow:int; public var links:MovieClip; public var b_credits:SimpleButton; public var shapesUsed:int; public var sinTable:Array; public var b_back_credits:SimpleButton; public function MainTimeline(){ addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8); } public function initSinCosTables(){ var _local1:int; sinTable = new Array(CIRCLE_PRECISION); cosTable = new Array(CIRCLE_PRECISION); _local1 = 1; while (_local1 <= CIRCLE_PRECISION) { sinTable[(_local1 - 1)] = Math.sin(((_local1 * 360) / CIRCLE_PRECISION)); cosTable[(_local1 - 1)] = Math.cos(((_local1 * 360) / CIRCLE_PRECISION)); _local1++; }; } public function handleKeyUp(_arg1:KeyboardEvent){ var _local2:String; _local2 = String.fromCharCode(_arg1.charCode); if (_arg1.keyCode == Keyboard.SPACE){ if (Globals.gameState == Globals.GAME_PLAY){ if (Globals.currentLevel != (Globals.numLevels + 1)){ Globals.gameState = Globals.GAME_RESTART; }; }; } else { if ((((_local2 == "a")) || ((_local2 == "A")))){ if (Globals.pointerMode == Globals.ERASER_MODE){ Globals.pointerMode = Globals.CRAYON_MODE; }; } else { if ((((_local2 == "d")) || ((_local2 == "D")))){ if (Globals.pointerMode == Globals.HINGE_MODE){ Globals.pointerMode = Globals.CRAYON_MODE; }; } else { if ((((_local2 == "s")) || ((_local2 == "S")))){ if (Globals.pointerMode == Globals.PIN_MODE){ Globals.pointerMode = Globals.CRAYON_MODE; }; } else { if ((((_local2 == "b")) || ((_local2 == "B")))){ if (Globals.gameState == Globals.GAME_PLAY){ Globals.useFilter = !(Globals.useFilter); if (Globals.currentLevel != (Globals.numLevels + 1)){ Globals.gameState = Globals.GAME_RESTART; }; }; }; }; }; }; }; } public function handleWheel(_arg1:MouseEvent){ if (_arg1.delta > 0){ currentColorProperty--; if (currentColorProperty < 0){ currentColorProperty = (colorProperties.length - 1); }; } else { if (_arg1.delta < 0){ currentColorProperty++; if (currentColorProperty >= colorProperties.length){ currentColorProperty = 0; }; }; }; } public function removeListeners(){ stage.removeEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown); stage.removeEventListener(MouseEvent.MOUSE_UP, handleMouseUp); stage.removeEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown); stage.removeEventListener(KeyboardEvent.KEY_UP, handleKeyUp); removeEventListener(Event.ENTER_FRAME, update); } public function fTimerBackToMenu(_arg1:Event){ timerBackToMenu = null; customCursorOff(); if (level){ removeListeners(); stage.removeChild(level); level = null; }; gotoAndStop("menu"); } public function findStars(){ var _local1:int; _local1 = 0; while (_local1 < level.numChildren) { if ((((level.getChildAt(_local1) is Estrellita)) || ((level.getChildAt(_local1) is EstrellitaBlanca)))){ estrellas.push(level.getChildAt(_local1)); estrellasOrigen.push(level.getChildAt(_local1)); if (Globals.useFilter){ level.getChildAt(_local1).filters = softBlurFilter; }; }; _local1++; }; } public function lastValidPoint(_arg1:Point, _arg2:Point):Point{ var _local3:Point; var _local4:Point; var _local5:Point; var _local6:Number; var _local7:Number; var _local8:Point; var _local9:b2Body; _local3 = new Point((_arg1.x + newBody.x), (_arg1.y + newBody.y)); _local4 = new Point((_arg2.x + newBody.x), (_arg2.y + newBody.y)); _local5 = null; _local6 = Math.min((1 / (Point.distance(_arg1, _arg2) / 5)), 1); _local7 = _local6; while (_local7 <= 1) { _local8 = Point.interpolate(_local4, _local3, _local7); _local9 = getBodyAtPoint(_local8); if (((!((_local9 == null))) && (!(connectedToPinned(_local9))))){ return (_local5); }; if (_local9){ checkNearToPin(_local9); }; _local5 = _local8; _local7 = (_local7 + _local6); }; return (_local4); } public function backToMenu(_arg1:Event){ gotoAndStop("menu"); } public function handleKeyDown(_arg1:KeyboardEvent){ var _local2:String; _local2 = String.fromCharCode(_arg1.charCode); if ((((((_local2 == "a")) || ((_local2 == "A")))) && (!(drawing)))){ Globals.pointerMode = Globals.ERASER_MODE; } else { if ((((((_local2 == "d")) || ((_local2 == "D")))) && (!(drawing)))){ Globals.pointerMode = Globals.HINGE_MODE; } else { if ((((((_local2 == "s")) || ((_local2 == "S")))) && (!(drawing)))){ Globals.pointerMode = Globals.PIN_MODE; }; }; }; } function frame2(){ removeChild(this.contenedor); Globals.music2 = new Chapter1(); Globals.soundChannel = Globals.music2.play(); Globals.soundChannel.addEventListener(Event.SOUND_COMPLETE, Globals.loopMusic, false, 0, true); stage.frameRate = 30; gotoAndStop("menu"); stop(); } function frame4(){ letsplay.visible = false; menu_ad.mouseEnabled = false; letsplay.addEventListener(MouseEvent.CLICK, startGame, false, 0, true); i_tuto.addEventListener(Event.ENTER_FRAME, isLastFrame, false, 0, true); stop(); } function frame5(){ linksXRow = 6; refreshLinks(); stop(); } public function connectedToPinned(_arg1:b2Body):Boolean{ var _local2:Array; var _local3:b2JointNode; _local2 = new Array(); _local2.push(_arg1); if (_arg1.m_userData.pin){ return (true); }; if (_arg1.m_userData.canPin){ _local3 = _arg1.m_jointList; while (_local3 != null) { if (_local3.other.m_userData.pin){ return (true); }; if (connectedToPinned2(_local3.other, _local2)){ return (true); }; _local3 = _local3.next; }; }; return (false); } public function isLastFrame(_arg1:Event){ if (i_tuto.currentFrame == i_tuto.totalFrames){ letsplay.visible = true; menu_ad.visible = false; i_tuto.removeEventListener(Event.ENTER_FRAME, isLastFrame); }; } public function getLastBodyAtPoint(_arg1:Point):b2Body{ var _local2:b2AABB; var _local3:b2Vec2; var _local4:int; var _local5:Array; var _local6:int; var _local7:b2Body; var _local8:uint; var _local9:int; var _local10:Boolean; _local2 = new b2AABB(); _local2.minVertex.Set((_arg1.x - 0.001), (_arg1.y - 0.001)); _local2.maxVertex.Set((_arg1.x + 0.001), (_arg1.y + 0.001)); _local3 = new b2Vec2(_arg1.x, _arg1.y); _local4 = 10; _local5 = new Array(); _local6 = level.m_world.Query(_local2, _local5, _local4); _local7 = null; _local8 = 0; _local9 = 0; while (_local9 < _local6) { _local10 = _local5[_local9].TestPoint(_local3); if (_local10){ if (_local5[_local9].m_body.m_userData.id > _local8){ _local8 = _local5[_local9].m_body.m_userData.id; _local7 = _local5[_local9].m_body; }; }; _local9++; }; return (_local7); } function frame6(){ b_back_credits.addEventListener(MouseEvent.CLICK, backToMenu, false, 0, true); stop(); } public function resetBola(){ var _local1:int; if (Globals.gameState == Globals.GAME_PLAY){ destroyJoints(bola.m_body); level.m_world.DestroyBody(bola.m_body); bola.m_body = null; level.removeChild(bola); if ((bola is Bolita)){ bola = new Bolita(); } else { bola = new Cajita(); }; level.addChild(bola); bola.createBody(); if (Globals.useFilter){ bola.filters = softBlurFilter; }; bola.m_body.m_position.Set(bolaStart.x, bolaStart.y); bola.m_body.m_angularVelocity = 0; bola.m_body.m_linearVelocity.Set(0, 0); bola.m_body.m_torque = 0; bola.m_body.m_force.Set(0, 0); _local1 = 0; _local1 = 0; while (_local1 < estrellasOrigen.length) { if (estrellas.indexOf(estrellasOrigen[_local1]) == -1){ level.addChild(estrellasOrigen[_local1]); }; _local1++; }; estrellas = new Array(); _local1 = 0; while (_local1 < estrellasOrigen.length) { estrellas.push(estrellasOrigen[_local1]); _local1++; }; }; } public function customCursorOn(){ stage.addChild(inGameUI); stage.addChild(cursor); Mouse.hide(); } function frame3(){ aspasmenu.addEventListener(Event.ENTER_FRAME, rotaraspas, false, 0, true); Globals.savedData = SharedObject.getLocal("magicPen"); if (!Globals.savedData.data.levelScores){ Globals.savedData.data.levelScores = new Array(Globals.numLevels); i = 0; while (i < Globals.numLevels) { Globals.savedData.data.levelScores[i] = -1; i++; }; }; if (!Globals.savedData.data.bestScore){ Globals.savedData.data.bestScore = 99999999; }; b_play.addEventListener(MouseEvent.CLICK, fplay, false, 0, true); b_credits.addEventListener(MouseEvent.CLICK, fcredits, false, 0, true); stop(); } function frame8(){ stop(); } function frame1(){ stop(); intro.addEventListener(Event.COMPLETE, introComplete); } function frame7(){ cProperties1 = new Array(16416705, 2.5, 0.5, 0, "normal"); cProperties2 = new Array(16094470, 2.5, 0.5, 0, "bounce"); cProperties3 = new Array(8701998, 2.5, 0.5, 0, "friction"); cProperties4 = new Array(7943053, 2.5, 0.5, 0, "heavy"); colorProperties = new Array(cProperties1, cProperties2, cProperties3, cProperties4); initSinCosTables(); shapesUsed = 0; blurFilter = new Array(new BlurFilter(5, 5, 1)); softBlurFilter = new Array(new BlurFilter(3, 3, 1)); shadowFilter = new Array(new DropShadowFilter(10, 115, 0, 0.5, 3, 3)); whiteTint = new Color(); whiteTint.setTint(0xFFFFFF, 1); noTint = new Color(); cursor = new Cursor(); cursor.mouseEnabled = false; inGameUI = new InGameUI(); initInGameUI(); initializeLevel(pickLevel(Globals.currentLevel)); stop(); } public function fplay(_arg1:Event){ aspasmenu.removeEventListener(Event.ENTER_FRAME, rotaraspas); Globals.currentLevel = 1; if (!Globals.savedData.data.playedBefore){ Globals.savedData.data.playedBefore = true; gotoAndStop("instructions"); } else { gotoAndStop("selectLevel"); }; } public function scrollLevel(){ if (mouseX > 590){ level.x = (level.x - SCROLL_SPEED); } else { if (mouseX < 50){ level.x = (level.x + SCROLL_SPEED); }; }; if (level.x > 0){ level.x = 0; } else { if (level.x < ((-(level.getRect(level).right) + 640) + 80)){ level.x = ((-(level.getRect(level).right) + 640) + 80); }; }; } public function endDrawing(_arg1:Boolean=true){ var _local2:b2CircleDef; var _local3:b2BodyDef; var _local4:MWBody; var _local5:Array; var _local6:Array; var _local7:b2BodyDef; var _local8:b2PolyDef; var _local9:int; var _local10:MWBody; drawing = false; inGameUI.ui_barra.visible = false; circleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, startCircle); circleTimer = null; if (level.m_world.m_bodyCount < 200){ if (drawingCircle){ _local2 = new b2CircleDef(); _local3 = new b2BodyDef(); _local2.radius = circleRadius; _local2.density = colorProperties[currentColorProperty][1]; _local2.friction = colorProperties[currentColorProperty][2]; _local2.restitution = colorProperties[currentColorProperty][3]; _local3.AddShape(_local2); _local3.position = new b2Vec2(newBody.x, newBody.y); _local4 = new MWBody(); _local4.m_body = level.m_world.CreateBody(_local3); _local4.m_body.m_userData = _local4; _local4.x = newBody.x; _local4.y = newBody.y; _local4.graphics.lineStyle(5, colorProperties[currentColorProperty][0], 1); if (Globals.useFilter){ _local4.filters = blurFilter; }; _local4.graphics.drawCircle(0, 0, circleRadius); level.addChild(_local4); level.m_world.Step(0, 1); checkPinnedObjects(_local4); shapesUsed++; } else { if ((((puntosFigura.length > 1)) && (_arg1))){ if (puntosFigura.length == 2){ _local5 = makeLine(puntosFigura[0], puntosFigura[1]); } else { _local5 = convexHull(puntosFigura); _local6 = revisarLinea(_local5); if (_local6){ _local5 = _local6; }; }; if (_local5){ _local7 = new b2BodyDef(); _local8 = new b2PolyDef(); _local8.vertexCount = _local5.length; _local9 = 0; while (_local9 < _local5.length) { _local8.vertices[_local9].Set(_local5[_local9].x, _local5[_local9].y); _local9++; }; _local8.density = colorProperties[currentColorProperty][1]; _local8.friction = colorProperties[currentColorProperty][2]; _local8.restitution = colorProperties[currentColorProperty][3]; _local7.AddShape(_local8); _local7.position = new b2Vec2(newBody.x, newBody.y); _local10 = new MWBody(); _local10.graphics.lineStyle(5, colorProperties[currentColorProperty][0], 1); if (Globals.useFilter){ _local10.filters = blurFilter; }; drawPolygon(_local10.graphics, _local5); _local10.m_body = level.m_world.CreateBody(_local7); _local10.m_body.m_userData = _local10; _local10.x = newBody.x; _local10.y = newBody.y; level.addChild(_local10); level.m_world.Step(0, 1); checkPinnedObjects(_local10); shapesUsed++; }; }; }; }; } public function update(_arg1:Event){ switch (Globals.gameState){ case Globals.GAME_PLAY: updatePhysics(); if (drawing){ drawLine(); } else { if (newBody){ level.removeChild(newBody); newBody = null; }; }; updateCursor(); checkEstrellas(); deleteFiguras(); break; case Globals.GAME_PAUSED: break; case Globals.GAME_RESUME: customCursorOn(); Globals.gameState = Globals.lastGameState; stage.focus = level; break; case Globals.GAME_RESTART: initializeLevel(pickLevel(Globals.currentLevel)); break; case Globals.GAME_LEVELCOMPLETE: updatePhysics(); if (drawing){ drawLine(); } else { if (newBody){ level.removeChild(newBody); newBody = null; }; }; updateCursor(); deleteFiguras(); break; }; } public function initInGameUI(){ inGameUI.help_button.addEventListener(MouseEvent.CLICK, fhelp_button, false, 0, true); inGameUI.music_button.addEventListener(MouseEvent.CLICK, ftoggleMusic, false, 0, true); inGameUI.music_button.addEventListener(MouseEvent.ROLL_OVER, fmusicOver, false, 0, true); inGameUI.music_button.addEventListener(MouseEvent.ROLL_OUT, fmusicOut, false, 0, true); inGameUI.selectLevel_button.addEventListener(MouseEvent.CLICK, fingame_levelSelect, false, 0, true); } public function checkCircleBounds(_arg1:int, _arg2:int, _arg3:Number):Boolean{ var _local4:b2AABB; var _local5:int; var _local6:Array; var _local7:int; var _local8:b2Vec2; var _local9:int; var _local10:int; _local4 = new b2AABB(); _local4.minVertex.Set((_arg1 - _arg3), (_arg2 - _arg3)); _local4.maxVertex.Set((_arg1 + _arg3), (_arg2 + _arg3)); _local5 = 10; _local6 = new Array(); _local7 = level.m_world.Query(_local4, _local6, _local5); _local8 = new b2Vec2(); _local9 = 0; while (_local9 < _local7) { if (!connectedToPinned(_local6[_local9].m_body)){ _local10 = 0; while (_local10 < CIRCLE_PRECISION) { _local8.x = (_arg1 + (_arg3 * sinTable[_local10])); _local8.y = (_arg2 - (_arg3 * cosTable[_local10])); if (_local6[_local9].TestPoint(_local8)){ return (true); }; _local10++; }; }; _local9++; }; return (false); } public function testCollision(_arg1:b2iGameObject):Boolean{ var _local2:b2ContactNode; _local2 = _arg1.m_body.GetContactList(); while (_local2) { if (_local2.contact){ if (_local2.contact.GetManifoldCount() > 0){ return (true); }; }; _local2 = _local2.next; }; return (false); } public function convexHull(_arg1:Array){ var _local2:Array; _local2 = ConvexHull.grahamScan2D(_arg1).reverse(); while (_local2.length > 64) { _local2.pop(); }; return (_local2); } public function fingame_levelSelect(_arg1:Event){ var _local2:InGameLevelSelect; Globals.lastGameState = Globals.gameState; Globals.gameState = Globals.GAME_PAUSED; _local2 = new InGameLevelSelect(); _local2.filters = shadowFilter; stage.addChild(_local2); customCursorOff(); } public function makeLine(_arg1:Point, _arg2:Point):Array{ var _local3:Array; if ((((_arg1.x < _arg2.x)) || ((((_arg1.x == _arg2.x)) && ((_arg1.y < _arg2.y)))))){ _local3 = makeLine2(_arg1, _arg2); } else { _local3 = makeLine2(_arg2, _arg1); }; return (_local3); } public function fmusicOver(_arg1:Event){ inGameUI.music_button.scaleX = 1.1; inGameUI.music_button.scaleY = 1.1; } public function ftoggleMusic(_arg1:Event){ if (Globals.soundChannel){ Globals.soundChannel.removeEventListener(Event.SOUND_COMPLETE, Globals.loopMusic); Globals.soundChannel.stop(); Globals.soundChannel = null; inGameUI.music_button.gotoAndStop("off"); } else { Globals.soundChannel = Globals.music2.play(); Globals.soundChannel.addEventListener(Event.SOUND_COMPLETE, Globals.loopMusic, false, 0, true); inGameUI.music_button.gotoAndStop("on"); }; } public function handleMouseUp(_arg1:MouseEvent){ if (drawing){ endDrawing(); }; } public function updatePhysics(){ level.Update(); } public function checkEstrellas(){ colisionEstrella(); if (estrellas.length == 0){ Globals.gameState = Globals.GAME_LEVELCOMPLETE; endTimer = new Timer(1000, 1); endTimer.addEventListener(TimerEvent.TIMER_COMPLETE, endLevel, false, 0, true); endTimer.start(); }; } public function colisionEstrella(){ var _local1:MovieClip; var _local2:int; var _local3:int; _local2 = -1; _local3 = 0; while (_local3 < estrellas.length) { _local1 = estrellas[_local3]; if (_local1.hitTestObject(bola)){ level.removeChild(_local1); _local2 = _local3; break; }; _local3++; }; if (_local2 >= 0){ estrellas.splice(_local2, 1); }; } public function fmusicOut(_arg1:Event){ inGameUI.music_button.scaleX = 1; inGameUI.music_button.scaleY = 1; } public function drawLine(){ var _local1:Point; var _local2:int; var _local3:int; if (drawingCircle){ if (circleRadius < MAX_CIRCLE_RADIUS){ circleRadius = (circleRadius + 1); newBody.graphics.clear(); newBody.graphics.lineStyle(5, colorProperties[currentColorProperty][0], 1); newBody.graphics.drawCircle(0, 0, circleRadius); inGameUI.ui_maskbarra.scaleX = (1 - (circleRadius / MAX_CIRCLE_RADIUS)); if (checkCircleBounds(newBody.x, newBody.y, circleRadius)){ endDrawing(); }; } else { endDrawing(); }; } else { _local1 = new Point((cursor.x - newBody.x), (cursor.y - newBody.y)); _local1 = lastValidPoint(lastPoint, _local1); if (_local1 != null){ _local1.x = (_local1.x - newBody.x); _local1.y = (_local1.y - newBody.y); _local2 = Point.distance(lastPoint, _local1); _local3 = Point.distance(_local1, new Point(0, 0)); if ((((_local3 < CLOSE_DISTANCE)) && ((perimeter > MIN_PERIMETER)))){ newBody.graphics.lineTo(0, 0); endDrawing(); } else { if (_local2 > MIN_DISTANCE){ newBody.graphics.lineTo(_local1.x, _local1.y); perimeter = (perimeter + _local2); puntosFigura.push(_local1); lastPoint.x = _local1.x; lastPoint.y = _local1.y; }; }; inGameUI.ui_maskbarra.scaleX = (1 - (perimeter / MAX_PERIMETER)); if (perimeter > MAX_PERIMETER){ endDrawing(false); }; }; }; } public function connectedToPinned2(_arg1:b2Body, _arg2:Array){ var _local3:b2JointNode; _arg2.push(_arg1); if (_arg1.m_userData.canPin){ _local3 = _arg1.m_jointList; while (_local3 != null) { if (_arg2.indexOf(_local3.other) == -1){ if (_local3.other.m_userData.pin){ return (true); }; if (connectedToPinned2(_local3.other, _arg2)){ return (true); }; }; _local3 = _local3.next; }; }; return (false); } public function checkPin(_arg1:MWBody, _arg2:MWBody):Boolean{ var _local3:Pin; var _local4:Point; _local3 = _arg1.pin; _local4 = _local3.localToGlobal(new Point(0, 0)); if (pointInsideBody(_local4, _arg2.m_body)){ level.addChild(_local3); if (Globals.useFilter){ _local3.filters = blurFilter; }; _local3.x = _local4.x; _local3.y = _local4.y; _local3.jd.body1 = _arg1.m_body; _local3.jd.body2 = _arg2.m_body; _local3.jd.anchorPoint.Set(_local3.x, _local3.y); _local3.m_joint = b2RevoluteJoint(level.m_world.CreateJoint(_local3.jd)); if (!_local3.m_joint){ level.removeChild(_local3); } else { _local3.m_joint.m_userData = _local3; _local3.nextFrame(); }; return (true); }; return (false); } public function pointInsideBody(_arg1:Point, _arg2:b2Body){ var _local3:b2Vec2; var _local4:b2Shape; _local3 = new b2Vec2(_arg1.x, _arg1.y); _local4 = _arg2.GetShapeList(); while (_local4 != null) { if (_local4.TestPoint(_local3)){ return (true); }; _local4 = _local4.m_next; }; return (false); } public function deleteFiguras(){ var _local1:MWBody; var _local2:int; _local2 = 0; while (_local2 < Globals.destroyList.length) { _local1 = MWBody(Globals.destroyList[_local2]); if (_local1 == bola){ resetBola(); } else { destroyJoints(_local1.m_body); level.m_world.DestroyBody(_local1.m_body); _local1.m_body = null; level.removeChild(_local1); }; _local2++; }; Globals.destroyList = new Array(); } public function endLevel(_arg1:Event){ var _local2:Array; var _local3:ScoreScreen; _local2 = Globals.savedData.data.levelScores; if ((((_local2[(Globals.currentLevel - 1)] == -1)) || ((shapesUsed < _local2[(Globals.currentLevel - 1)])))){ _local2[(Globals.currentLevel - 1)] = shapesUsed; }; _local3 = new ScoreScreen(); Globals.lastGameState = Globals.gameState; Globals.gameState = Globals.GAME_PAUSED; _local3.filters = shadowFilter; stage.addChild(_local3); customCursorOff(); } public function updateCursor(){ cursor.x = mouseX; cursor.y = mouseY; if (cursor.x < 0){ cursor.x = 0; } else { if (cursor.x > 790){ cursor.x = 790; }; }; if (cursor.y < 0){ cursor.y = 0; } else { if (cursor.y > 520){ cursor.y = 520; }; }; switch (Globals.pointerMode){ case Globals.CRAYON_MODE: cursor.gotoAndStop("crayon"); cursor.rotation = -((((1320 - cursor.x) - (520 - cursor.y)) / 12)); break; case Globals.ERASER_MODE: cursor.gotoAndStop("borrador"); cursor.rotation = -((((1320 - cursor.x) - (520 - cursor.y)) / 12)); break; case Globals.HINGE_MODE: cursor.gotoAndStop("hinge"); cursor.rotation = 0; break; case Globals.PIN_MODE: cursor.gotoAndStop("pin"); cursor.rotation = 0; break; }; } public function startGame(_arg1:Event){ gotoAndStop("startGame"); } public function eraseBody(_arg1:int, _arg2:int):Boolean{ var _local3:b2Body; var _local4:*; _local4 = new Point(_arg1, _arg2); _local3 = getLastBodyAtPoint(_local4); if (_local3){ if (_local3.m_userData.canDestroy){ if (!(_local3.m_flags & b2Body.e_destroyFlag)){ destroyJoints(_local3); level.m_world.DestroyBody(_local3); _local3.m_userData.m_body = null; level.removeChild(_local3.m_userData); return (true); }; }; }; return (false); } public function angleDiff(_arg1:Number, _arg2:Number){ var _local3:Number; _local3 = (_arg1 - _arg2); if (_local3 > 180){ _local3 = (_local3 - 360); } else { if (_local3 < -180){ _local3 = (_local3 + 360); }; }; return (_local3); } public function drawPolygon(_arg1:Graphics, _arg2:Array){ var _local3:int; _arg1.moveTo(_arg2[0].x, _arg2[0].y); _local3 = 1; while (_local3 < _arg2.length) { _arg1.lineTo(_arg2[_local3].x, _arg2[_local3].y); _local3++; }; _arg1.lineTo(_arg2[0].x, _arg2[0].y); } public function makeLine2(_arg1:Point, _arg2:Point):Array{ var _local3:Array; var _local4:Point; _local3 = new Array(); _local3.push(_arg1); _local3.push(_arg2); _local4 = new Point(-((_arg2.y - _arg1.y)), (_arg2.x - _arg1.x)); _local4.normalize(10); _local3.push(new Point((_arg2.x + _local4.x), (_arg2.y + _local4.y))); _local3.push(new Point((_arg1.x + _local4.x), (_arg1.y + _local4.y))); return (_local3); } public function refreshLinks(){ var _local1:LevelLink; var _local2:int; if (links){ removeChild(links); }; links = new MovieClip(); _local2 = 0; while (_local2 < Globals.numLevels) { _local1 = new LevelLink(); _local1.levelname.text = ("" + (_local2 + 1)); _local1.y = (Math.floor((_local2 / linksXRow)) * 60); _local1.x = ((_local2 % linksXRow) * 80); _local1.addEventListener(MouseEvent.CLICK, selectLevel, false, 0, true); links.addChild(_local1); if (Globals.savedData.data.levelScores[_local2] >= 0){ _local1.gotoAndStop("check"); }; _local2++; }; links.y = 200; links.x = 184; addChild(links); } public function handleMouseDown(_arg1:MouseEvent){ var _local2:Point; var _local3:Boolean; var _local4:Array; var _local5:b2Body; var _local6:MWBody; var _local7:b2Body; var _local8:int; var _local9:Pin; var _local10:b2Body; var _local11:Boolean; var _local12:int; var _local13:Pin; if (drawing){ endDrawing(); if (newBody){ level.removeChild(newBody); newBody = null; }; }; switch (Globals.pointerMode){ case Globals.ERASER_MODE: _local2 = new Point(cursor.x, cursor.y); _local3 = false; _local4 = level.getObjectsUnderPoint(_local2); _local8 = 0; while (_local8 < _local4.length) { if ((_local4[_local8].parent is Pin)){ _local9 = Pin(_local4[_local8].parent); if (_local9.m_joint){ level.m_world.DestroyJoint(_local9.m_joint); level.removeChild(_local9); } else { MWBody(_local9.parent).pin = null; _local9.parent.removeChild(_local9); }; _local3 = true; break; }; _local8++; }; if (!_local3){ _local11 = false; if (!eraseBody(_local2.x, _local2.y)){ _local12 = 1; while (_local12 < 5) { if (eraseBody((_local2.x + _local12), (_local2.y + _local12))){ break; }; if (eraseBody((_local2.x + _local12), (_local2.y - _local12))){ break; }; if (eraseBody((_local2.x - _local12), (_local2.y - _local12))){ break; }; if (eraseBody((_local2.x - _local12), (_local2.y + _local12))){ break; }; _local12++; }; }; }; break; case Globals.CRAYON_MODE: _local5 = getBodyAtPoint(new Point(cursor.x, cursor.y)); if ((((_local5 == null)) || (connectedToPinned(_local5)))){ drawing = true; drawingCircle = false; circleRadius = MIN_CIRCLE_RADIUS; newBody = new MovieClip(); puntosFigura = new Array(); connectedPinned = new Array(); perimeter = 0; level.addChild(newBody); newBody.graphics.moveTo(0, 0); lastPoint.x = 0; lastPoint.y = 0; newBody.x = cursor.x; newBody.y = cursor.y; puntosFigura.push(lastPoint.clone()); currentColorProperty++; if (currentColorProperty == colorProperties.length){ currentColorProperty = 0; }; newBody.graphics.lineStyle(5, colorProperties[currentColorProperty][0], 1); if (Globals.useFilter){ newBody.filters = blurFilter; }; inGameUI.ui_barra.visible = true; inGameUI.ui_maskbarra.scaleX = 1; circleTimer = new Timer(500, 1); circleTimer.addEventListener(TimerEvent.TIMER_COMPLETE, startCircle, false, 0, true); circleTimer.start(); }; break; case Globals.HINGE_MODE: case Globals.PIN_MODE: _local7 = getLastBodyAtPoint(new Point(cursor.x, cursor.y)); if (_local7){ if (_local7.m_userData.canPin){ if (!_local7.m_userData.pin){ _local6 = _local7.m_userData; _local13 = new Pin(); _local13.useStatic = true; _local13.useGround = false; if (Globals.pointerMode == Globals.PIN_MODE){ _local13.jd.enableLimit = true; _local13.jd.lowerAngle = 0; _local13.jd.upperAngle = 0; _local13.gotoAndStop("pin"); } else { _local13.gotoAndStop("hinge"); }; _local6.addChild(_local13); _local13.x = _local6.mouseX; _local13.y = _local6.mouseY; _local6.pin = _local13; pinnedObjects.push(_local6); } else { _local6 = _local7.m_userData; _local13 = _local6.pin; _local13.useStatic = true; _local13.useGround = false; if (Globals.pointerMode == Globals.PIN_MODE){ _local13.jd.enableLimit = true; _local13.jd.lowerAngle = 0; _local13.jd.upperAngle = 0; _local13.gotoAndStop("pin"); } else { _local13.gotoAndStop("hinge"); }; _local13.x = _local6.mouseX; _local13.y = _local6.mouseY; }; }; }; break; }; } public function fcredits(_arg1:Event){ aspasmenu.removeEventListener(Event.ENTER_FRAME, rotaraspas); gotoAndStop("credits"); } public function revisarLinea(_arg1:Array):Array{ var _local2:Boolean; var _local3:int; var _local4:Point; var _local5:Point; var _local6:Point; var _local7:Point; var _local8:Point; var _local9:Point; var _local10:Point; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Array; if (connectedPinned.length > 0){ return (null); }; _local2 = true; _local3 = 0; _local4 = new Point(0, 0); _local5 = _local4; _local6 = _local4; _local7 = _local4; _local8 = _local4; _local3 = 0; while (_local3 < _arg1.length) { _local4 = _arg1[_local3]; if (_local4.x < _local5.x){ _local5 = _local4; } else { if (_local4.x > _local6.x){ _local6 = _local4; }; }; if (_local4.y < _local7.y){ _local7 = _local4; } else { if (_local4.y > _local8.y){ _local8 = _local4; }; }; _local3++; }; if (Point.distance(_local5, _local6) > Point.distance(_local7, _local8)){ _local9 = _local5; _local10 = _local6; } else { if (_local7.x <= _local8.x){ _local9 = _local7; _local10 = _local8; } else { _local9 = _local8; _local10 = _local7; }; }; _local11 = calcularAngulo(_local9, _local10); _local3 = 0; while (_local3 < _arg1.length) { _local4 = _arg1[_local3]; _local12 = angleDiff(_local11, calcularAngulo(_local9, _local4)); _local13 = Point.distance(_local9, _local4); _local14 = Math.abs((Math.sin(_local12) * _local13)); if (_local14 > MIN_DIST_TO_LINE){ _local2 = false; break; }; _local3++; }; _local15 = null; if (_local2){ _local15 = makeLine2(_local9, _local10); }; return (_local15); } public function checkNearToPin(_arg1:b2Body){ var _local2:Point; var _local3:Point; var _local4:Point; var _local5:Point; var _local6:Point; if ((((((puntosFigura.length > 1)) && (_arg1.m_userData.pin))) && ((connectedPinned.indexOf(_arg1) == -1)))){ _local2 = _arg1.m_userData.pin.localToGlobal(new Point(0, 0)); _local2.x = (_local2.x - newBody.x); _local2.y = (_local2.y - newBody.y); _local3 = new Point((_local2.x + 5), (_local2.y + 5)); _local4 = new Point((_local2.x + 5), (_local2.y - 5)); _local5 = new Point((_local2.x - 5), (_local2.y - 5)); _local6 = new Point((_local2.x - 5), (_local2.y + 5)); puntosFigura.push(_local3); puntosFigura.push(_local4); puntosFigura.push(_local5); puntosFigura.push(_local6); connectedPinned.push(_arg1); }; } public function destroyJoints(_arg1:b2Body){ var _local2:b2Joint; var _local3:b2JointNode; _local3 = _arg1.GetJointList(); while (_local3) { _local2 = _local3.joint; _local3 = _local3.next; level.m_world.DestroyJoint(_local2); level.removeChild(_local2.m_userData); }; } public function introComplete(_arg1:Event):void{ gotoAndStop("contenedor"); } public function customCursorOff(){ stage.removeChild(inGameUI); stage.removeChild(cursor); Mouse.show(); } public function fhelp_button(_arg1:Event){ var _local2:MovieClip; Globals.lastGameState = Globals.gameState; Globals.gameState = Globals.GAME_PAUSED; _local2 = new inGameHelp(); _local2.filters = shadowFilter; stage.addChild(_local2); customCursorOff(); } public function startCircle(_arg1:Event){ if (((drawing) && ((puntosFigura.length == 1)))){ if (!checkCircleBounds(newBody.x, newBody.y, circleRadius)){ drawingCircle = true; }; }; } public function initializeLevel(_arg1:MWLevel){ var _local2:*; var _local3:MovieClip; var _local4:int; if (level){ removeListeners(); stage.removeChild(level); level = null; }; Globals.gamePaused = false; Globals.pointerMode = Globals.CRAYON_MODE; currentColorProperty = 0; newBody = null; level = _arg1; if (level.i_bolita){ bola = level.i_bolita; } else { if (level.i_cajita){ bola = level.i_cajita; }; }; if (Globals.useFilter){ bola.filters = softBlurFilter; }; bolaStart = new Point(bola.x, bola.y); drawing = false; drawingCircle = false; pinnedObjects = new Array(); stage.addChild(level); _local2 = level.getRect(level); level.createLevel(1200, -400, 920, -400, null, true, 1, 10, (1 / 30)); if (level.fondo == "negro"){ inGameUI.levelnum.textfield.textColor = 0xFFFFFF; inGameUI.help_button.transform.colorTransform = whiteTint; inGameUI.music_button.transform.colorTransform = whiteTint; inGameUI.selectLevel_button.transform.colorTransform = whiteTint; } else { inGameUI.levelnum.textfield.textColor = 0; inGameUI.help_button.transform.colorTransform = noTint; inGameUI.music_button.transform.colorTransform = noTint; inGameUI.selectLevel_button.transform.colorTransform = noTint; }; inGameUI.levelnum.textfield.text = ("Level " + Globals.currentLevel); inGameUI.visible = true; if (Globals.currentLevel == 27){ inGameUI.visible = false; timerBackToMenu = new Timer(10000, 1); timerBackToMenu.addEventListener(TimerEvent.TIMER_COMPLETE, fTimerBackToMenu); timerBackToMenu.start(); } else { if (Globals.currentLevel == 28){ inGameUI.levelnum.textfield.text = "Free Play"; }; }; _local4 = 0; while (_local4 < level.numChildren) { if ((level.getChildAt(_local4) is b2iGameObject)){ _local3 = MovieClip(level.getChildAt(_local4)); _local3.createBody(); }; _local4++; }; bola.m_body.AllowSleeping(false); estrellas = new Array(); estrellasOrigen = new Array(); puntosFigura = new Array(); perimeter = 0; shapesUsed = 0; lastPoint = new Point(0, 0); findStars(); stage.addEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown, false, 0, true); stage.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp, false, 0, true); stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true); stage.addEventListener(KeyboardEvent.KEY_UP, handleKeyUp, false, 0, true); addEventListener(Event.ENTER_FRAME, update, false, 0, true); customCursorOn(); Globals.gameState = Globals.GAME_PLAY; level.focusRect = false; stage.focus = level; i_fondo.gotoAndStop(level.fondo); level.m_world.SetListener(new BoundaryListener()); Globals.destroyList = new Array(); } public function calcularAngulo(_arg1:Point, _arg2:Point):Number{ return (Math.atan2((_arg2.y - _arg1.y), (_arg2.x - _arg1.x))); } public function pickLevel(_arg1:int):MWLevel{ var _local2:MWLevel; switch (_arg1){ case 1: _local2 = new Nivel1(); _local2.fondo = "blanco"; break; case 2: _local2 = new Nivel27(); _local2.fondo = "blanco"; break; case 3: _local2 = new Nivel2(); _local2.fondo = "azul"; break; case 4: _local2 = new Nivel3(); _local2.fondo = "azul"; break; case 5: _local2 = new Nivel4(); _local2.fondo = "amarillo"; break; case 6: _local2 = new Nivel5(); _local2.fondo = "amarillo"; break; case 7: _local2 = new Nivel6(); _local2.fondo = "negro"; break; case 8: _local2 = new Nivel7(); _local2.fondo = "negro"; break; case 9: _local2 = new Nivel8(); _local2.fondo = "blanco"; break; case 10: _local2 = new Nivel9(); _local2.fondo = "blanco"; break; case 11: _local2 = new Nivel10(); _local2.fondo = "azul"; break; case 12: _local2 = new Nivel12(); _local2.fondo = "azul"; break; case 13: _local2 = new Nivel13(); _local2.fondo = "amarillo"; break; case 14: _local2 = new Nivel14(); _local2.fondo = "amarillo"; break; case 15: _local2 = new Nivel15(); _local2.fondo = "negro"; break; case 16: _local2 = new Nivel16(); _local2.fondo = "negro"; break; case 17: _local2 = new Nivel17(); _local2.fondo = "blanco"; break; case 18: _local2 = new Nivel18(); _local2.fondo = "blanco"; break; case 19: _local2 = new Nivel19(); _local2.fondo = "azul"; break; case 20: _local2 = new Nivel20(); _local2.fondo = "azul"; break; case 21: _local2 = new Nivel21(); _local2.fondo = "amarillo"; break; case 22: _local2 = new Nivel22(); _local2.fondo = "amarillo"; break; case 23: _local2 = new Nivel23(); _local2.fondo = "negro"; break; case 24: _local2 = new Nivel24(); _local2.fondo = "negro"; break; case 25: _local2 = new Nivel25(); _local2.fondo = "blanco"; break; case 26: _local2 = new Nivel26(); _local2.fondo = "blanco"; break; case 27: _local2 = new Nivel28(); _local2.fondo = "azul"; break; case 28: _local2 = new Nivel29(); _local2.fondo = "azul"; break; }; return (_local2); } public function getBodyAtPoint(_arg1:Point):b2Body{ var _local2:b2AABB; var _local3:b2Vec2; var _local4:int; var _local5:Array; var _local6:int; var _local7:b2Body; var _local8:int; var _local9:Boolean; _local2 = new b2AABB(); _local2.minVertex.Set((_arg1.x - 0.001), (_arg1.y - 0.001)); _local2.maxVertex.Set((_arg1.x + 0.001), (_arg1.y + 0.001)); _local3 = new b2Vec2(_arg1.x, _arg1.y); _local4 = 10; _local5 = new Array(); _local6 = level.m_world.Query(_local2, _local5, _local4); _local7 = null; _local8 = 0; while (_local8 < _local6) { _local9 = _local5[_local8].TestPoint(_local3); if (_local9){ _local7 = _local5[_local8].m_body; break; }; _local8++; }; return (_local7); } public function rotaraspas(_arg1:Event){ aspasmenu.rotation = (aspasmenu.rotation + 1); } public function selectLevel(_arg1:MouseEvent){ var _local2:int; _local2 = int(_arg1.target.levelname.text); Globals.currentLevel = _local2; removeChild(links); links = null; gotoAndStop("startGame"); } public function checkPinnedObjects(_arg1:MWBody){ var _local2:Array; var _local3:Array; var _local4:int; _local3 = new Array(); _local4 = 0; while (_local4 < pinnedObjects.length) { if (((pinnedObjects[_local4].m_body) && (pinnedObjects[_local4].pin))){ if (checkPin(pinnedObjects[_local4], _arg1)){ pinnedObjects[_local4].pin = null; } else { _local3.push(pinnedObjects[_local4]); }; }; _local4++; }; pinnedObjects = _local3; } } }//package Drawing_fla
Section 81
//MusicButton_89 (Drawing_fla.MusicButton_89) package Drawing_fla { import flash.display.*; public dynamic class MusicButton_89 extends MovieClip { public function MusicButton_89(){ addFrameScript(0, frame1, 1, frame2); } function frame1(){ stop(); } function frame2(){ stop(); } } }//package Drawing_fla
Section 82
//Subrayar_100 (Drawing_fla.Subrayar_100) package Drawing_fla { import flash.display.*; public dynamic class Subrayar_100 extends MovieClip { public function Subrayar_100(){ addFrameScript(6, frame7); } function frame7(){ stop(); } } }//package Drawing_fla
Section 83
//Tutorial_107 (Drawing_fla.Tutorial_107) package Drawing_fla { import flash.events.*; import flash.display.*; public dynamic class Tutorial_107 extends MovieClip { public var frame:int; public var tutnext:SimpleButton; public var tutback:SimpleButton; public function Tutorial_107(){ addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10); } function frame10(){ stop(); } function frame3(){ stop(); } function frame6(){ stop(); } function frame7(){ stop(); } function frame1(){ frame = 2; tutnext.addEventListener(MouseEvent.CLICK, gonext, false, 0, true); tutback.addEventListener(MouseEvent.CLICK, goback, false, 0, true); checkNextBack(); } function frame4(){ stop(); } function frame5(){ stop(); } function frame9(){ stop(); } function frame8(){ stop(); } function frame2(){ stop(); } public function checkNextBack(){ if (frame == 2){ tutback.visible = false; } else { tutback.visible = true; }; if (frame == totalFrames){ tutnext.visible = false; } else { tutnext.visible = true; }; } public function goback(_arg1:Event){ if (frame > 2){ prevFrame(); }; frame--; checkNextBack(); } public function gonext(_arg1:Event){ if (frame < totalFrames){ nextFrame(); }; frame++; checkNextBack(); } } }//package Drawing_fla
Section 84
//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 85
//BoundaryListener (Game.BoundaryListener) package Game { import Box2D.Dynamics.*; public class BoundaryListener extends b2WorldListener { override public function NotifyBoundaryViolated(_arg1:b2Body):uint{ Globals.destroyList.push(_arg1.m_userData); return (b2_freezeBody); } } }//package Game
Section 86
//Globals (Game.Globals) package Game { import flash.events.*; import flash.media.*; import flash.net.*; public class Globals { public static const GAME_LEVELCOMPLETE:int = 3; public static const numLevels:int = 26; public static const HINGE_MODE:int = 3; public static const GAME_PAUSED:int = 1; public static const GAME_PLAY:int = 0; public static const GAME_RESTART:int = 2; public static const PIN_MODE:int = 2; public static const GAME_RESUME:int = 4; public static const CRAYON_MODE:int = 0; public static const ERASER_MODE:int = 1; public static var pointerMode:int; public static var music2:Sound; public static var gamePaused:Boolean; public static var lastGameState:int; public static var currentLevel:int; public static var savedData:SharedObject; public static var destroyList:Array; public static var useFilter:Boolean = true; public static var music1:Sound; public static var soundChannel:SoundChannel; public static var gameState:int; public static function loopMusic(_arg1:Event){ Globals.soundChannel.removeEventListener(Event.SOUND_COMPLETE, Globals.loopMusic); Globals.soundChannel = Globals.music2.play(); Globals.soundChannel.addEventListener(Event.SOUND_COMPLETE, Globals.loopMusic, false, 0, true); } } }//package Game
Section 87
//MWBody (Game.MWBody) package Game { import Box2DIntegration.*; public class MWBody extends b2iBody { public var canDestroy:Boolean;// = true public var id:uint;// = 0 public var pin:Pin;// = null public var canPin:Boolean;// = true private static var idCount = 0; public function MWBody(){ canPin = true; canDestroy = true; pin = null; id = 0; super(); idCount++; id = idCount; } } }//package Game
Section 88
//MWLevel (Game.MWLevel) package Game { import flash.display.*; import Box2DIntegration.*; public dynamic class MWLevel extends b2iLevel { public var fondo:String; public var i_bolita:Bolita; public var numPins:int;// = 0 public var i_joint:RevJoint; public var banderin:Estrellita; public var bolita:b2iGameObject; public var endingCredits:MovieClip; public var i_cajita:Cajita; public function MWLevel(){ numPins = 0; super(); } } }//package Game
Section 89
//mcInternalAnimation_3 (MiniclipIntroAS3_fla.mcInternalAnimation_3) package MiniclipIntroAS3_fla { import flash.display.*; import flash.text.*; public dynamic class mcInternalAnimation_3 extends MovieClip { public var mcProgress:MovieClip; public var mcTimer:MovieClip; public var textStatus:TextField; public var mcOffsite:SimpleButton; } }//package MiniclipIntroAS3_fla
Section 90
//mcProgressBar_4 (MiniclipIntroAS3_fla.mcProgressBar_4) package MiniclipIntroAS3_fla { import flash.display.*; public dynamic class mcProgressBar_4 extends MovieClip { public function mcProgressBar_4(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package MiniclipIntroAS3_fla
Section 91
//Arbol (Arbol) package { import Game.*; public dynamic class Arbol extends MWBody { public var __id10_:RectShape; public var __id11_:RectShape; public var __id12_:RectShape; public var __id9_:RectShape; public function Arbol(){ addFrameScript(0, frame1); __setProp___id12__Arbol_Layer1_1(); __setProp___id9__Arbol_Layer1_1(); __setProp___id11__Arbol_Layer1_1(); __setProp___id10__Arbol_Layer1_1(); } function __setProp___id11__Arbol_Layer1_1(){ try { __id11_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id11_.density = 0; __id11_.friction = 1; __id11_.restitution = 0.1; try { __id11_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function frame1(){ this.canDestroy = false; this.canPin = false; } function __setProp___id10__Arbol_Layer1_1(){ try { __id10_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id10_.density = 0; __id10_.friction = 1; __id10_.restitution = 0.1; try { __id10_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id12__Arbol_Layer1_1(){ try { __id12_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id12_.density = 0; __id12_.friction = 1; __id12_.restitution = 0.1; try { __id12_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id9__Arbol_Layer1_1(){ try { __id9_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id9_.density = 0; __id9_.friction = 1; __id9_.restitution = 0.1; try { __id9_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 92
//Basura (Basura) package { import Game.*; public dynamic class Basura extends MWBody { public var __id16_:RectShape; public function Basura(){ addFrameScript(0, frame1); __setProp___id16__Basura_Layer1_1(); } function frame1(){ this.canPin = false; this.canDestroy = false; } function __setProp___id16__Basura_Layer1_1(){ try { __id16_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id16_.density = 3; __id16_.friction = 0.3; __id16_.restitution = 0.2; try { __id16_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 93
//Bloque (Bloque) package { import Game.*; public dynamic class Bloque extends MWBody { public var __id14_:RectShape; public function Bloque(){ addFrameScript(0, frame1); __setProp___id14__Bloque_Layer1_1(); } function frame1(){ this.canPin = false; this.canDestroy = false; } function __setProp___id14__Bloque_Layer1_1(){ try { __id14_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id14_.density = 3; __id14_.friction = 0.3; __id14_.restitution = 0.2; try { __id14_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 94
//BloqueNivel11 (BloqueNivel11) package { import Game.*; public dynamic class BloqueNivel11 extends MWBody { public var __id15_:RectShape; public function BloqueNivel11(){ addFrameScript(0, frame1); __setProp___id15__BloqueNivel11_Layer2_1(); } function frame1(){ this.canDestroy = false; this.canPin = false; } function __setProp___id15__BloqueNivel11_Layer2_1(){ try { __id15_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id15_.density = 3; __id15_.friction = 0.1; __id15_.restitution = 0.1; try { __id15_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 95
//BloqueNivel12 (BloqueNivel12) package { import Game.*; public dynamic class BloqueNivel12 extends MWBody { public var __id13_:RectShape; public function BloqueNivel12(){ addFrameScript(0, frame1); __setProp___id13__BloqueNivel12_Layer2_1(); } function frame1(){ this.canDestroy = false; this.canPin = true; } function __setProp___id13__BloqueNivel12_Layer2_1(){ try { __id13_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id13_.density = 0; __id13_.friction = 0.1; __id13_.restitution = 0; try { __id13_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 96
//BloqueNivel13 (BloqueNivel13) package { import Game.*; public dynamic class BloqueNivel13 extends MWBody { public var __id4_:RectShape; public function BloqueNivel13(){ addFrameScript(0, frame1); __setProp___id4__BloqueNivel13_Layer2_1(); } function __setProp___id4__BloqueNivel13_Layer2_1(){ try { __id4_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id4_.density = 0; __id4_.friction = 0.1; __id4_.restitution = 0; try { __id4_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function frame1(){ this.canDestroy = false; this.canPin = true; } } }//package
Section 97
//BloqueNivel14 (BloqueNivel14) package { import Game.*; public dynamic class BloqueNivel14 extends MWBody { public var __id1_:RectShape; public function BloqueNivel14(){ addFrameScript(0, frame1); __setProp___id1__BloqueNivel14_Layer2_1(); } function __setProp___id1__BloqueNivel14_Layer2_1(){ try { __id1_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id1_.density = 3; __id1_.friction = 0.3; __id1_.restitution = 0.2; try { __id1_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function frame1(){ this.canDestroy = false; this.canPin = false; } } }//package
Section 98
//BloqueNivel17 (BloqueNivel17) package { import Game.*; public dynamic class BloqueNivel17 extends MWBody { public var __id17_:RectShape; public function BloqueNivel17(){ addFrameScript(0, frame1); __setProp___id17__BloqueNivel17_Layer2_1(); } function frame1(){ this.canDestroy = false; this.canPin = false; } function __setProp___id17__BloqueNivel17_Layer2_1(){ try { __id17_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id17_.density = 3; __id17_.friction = 0.1; __id17_.restitution = 0.2; try { __id17_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 99
//BloqueNivel18 (BloqueNivel18) package { import Game.*; public dynamic class BloqueNivel18 extends MWBody { public var __id8_:RectShape; public function BloqueNivel18(){ addFrameScript(0, frame1); __setProp___id8__BloqueNivel18_Layer2_1(); } function frame1(){ this.canDestroy = false; this.canPin = false; } function __setProp___id8__BloqueNivel18_Layer2_1(){ try { __id8_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id8_.density = 3; __id8_.friction = 0.1; __id8_.restitution = 0.2; try { __id8_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 100
//BloqueNivel24 (BloqueNivel24) package { import Game.*; public dynamic class BloqueNivel24 extends MWBody { public var __id2_:RectShape; public function BloqueNivel24(){ addFrameScript(0, frame1); __setProp___id2__BloqueNivel22_Layer2_1(); } function frame1(){ this.canDestroy = false; this.canPin = true; } function __setProp___id2__BloqueNivel22_Layer2_1(){ try { __id2_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id2_.density = 4; __id2_.friction = 0.1; __id2_.restitution = 0.2; try { __id2_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 101
//BloqueNivel25 (BloqueNivel25) package { import Game.*; public dynamic class BloqueNivel25 extends MWBody { public var __id0_:RectShape; public function BloqueNivel25(){ addFrameScript(0, frame1); __setProp___id0__BloqueNivel25_Layer1_1(); } function __setProp___id0__BloqueNivel25_Layer1_1(){ try { __id0_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id0_.density = 3; __id0_.friction = 0.1; __id0_.restitution = 0.2; try { __id0_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function frame1(){ this.canDestroy = false; this.canPin = true; } } }//package
Section 102
//Bolita (Bolita) package { import Game.*; public dynamic class Bolita extends MWBody { public var __id6_:CircleShape; public function Bolita(){ addFrameScript(0, frame1); __setProp___id6__Bolita_shape_1(); } function __setProp___id6__Bolita_shape_1(){ try { __id6_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id6_.density = 1; __id6_.friction = 0.1; __id6_.restitution = 0.3; try { __id6_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function frame1(){ this.canPin = true; this.canDestroy = false; } } }//package
Section 103
//Cajita (Cajita) package { import Game.*; public dynamic class Cajita extends MWBody { public var __id7_:RectShape; public function Cajita(){ addFrameScript(0, frame1); __setProp___id7__Cajita_Layer1_1(); } function frame1(){ this.canPin = true; this.canDestroy = false; } function __setProp___id7__Cajita_Layer1_1(){ try { __id7_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id7_.density = 1; __id7_.friction = 0.5; __id7_.restitution = 0.3; try { __id7_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 104
//Chapter1 (Chapter1) package { import flash.media.*; public dynamic class Chapter1 extends Sound { } }//package
Section 105
//CircleShape (CircleShape) package { import Box2DIntegration.*; public dynamic class CircleShape extends b2iCircleShape { public function CircleShape(){ addFrameScript(0, frame1); } function frame1(){ this.visible = false; stop(); } } }//package
Section 106
//Cursor (Cursor) package { import flash.display.*; public dynamic class Cursor extends MovieClip { public function Cursor(){ addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4); } function frame3(){ stop(); } function frame1(){ stop(); } function frame4(){ stop(); } function frame2(){ stop(); } } }//package
Section 107
//Empacador (Empacador) package { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; import Box2D.Dynamics.Joints.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import flash.display.*; import Box2DIntegration.*; import Box2D.Common.*; class Empacador extends MovieClip { private var _b2iLevel:b2iLevel; private var _b2Bound:b2Bound; private var _b2ContactNode:b2ContactNode; private var _b2GearJointDef:b2GearJointDef; private var _b2PulleyJoint:b2PulleyJointDef; private var _b2World:b2World; private var _b2iShape:b2iShape; private var _b2BroadPhase:b2BroadPhase; private var _b2Pair:b2Pair; private var _b2Mat22:b2Mat22; private var _b2Shape:b2Shape; private var _b2ContactRegister:b2ContactRegister; private var _b2Math:b2Math; private var _b2iEevoluteJoint:b2iRevoluteJoint; private var _b2iBody:b2iBody; private var _b2NullContact:b2NullContact; private var _b2Vec2:b2Vec2; private var _b2GearJoint:b2GearJoint; private var _b2Contact:b2Contact; private var _b2ShapeDef:b2ShapeDef; private var _b2MouseJointDef:b2MouseJointDef; private var _b2PrismaticJoint:b2PrismaticJoint; private var _b2CircleShape:b2CircleShape; private var _b2MassData:b2MassData; private var _b2iObjectGroup:b2iObjectGroup; private var _b2iBoxShape:b2iBoxShape; private var _b2CollisionFilter:b2CollisionFilter; private var _b2PolyContact:b2PolyContact; private var _b2Manifold:b2Manifold; private var _b2BufferedPair:b2BufferedPair; private var _clipVertex:ClipVertex; private var _b2iCircleShape:b2iCircleShape; private var _b2CircleContact:b2CircleContact; private var _b2PolyDef:b2PolyDef; private var _b2Jacobian:b2Jacobian; private var _b2Body:b2Body; private var _b2JointDef:b2JointDef; private var _b2Proxy; private var _b2ContactConstraintPoint:b2ContactConstraintPoint; private var _b2DistanceJointDef:b2DistanceJointDef; private var _b2TimeStep:b2TimeStep; private var _b2iGameObject:b2iGameObject; private var _b2Joint:b2Joint; private var _b2CircleDef:b2CircleDef; private var _b2DistanceJoint:b2DistanceJoint; private var _b2ContactConstraint:b2ContactConstraint; private var _b2MouseJoint:b2MouseJoint; private var _b2Collision:b2Collision; private var _b2PairManager:b2PairManager; private var _b2PolyShape:b2PolyShape; private var _b2BodyDef:b2BodyDef; private var _b2ContactId:b2ContactID; private var _b2PairCallback:b2PairCallback; private var _b2AABB:b2AABB; private var _b2PrismaticJointDef:b2PrismaticJointDef; private var _features:Features; private var _b2ContactPoint:b2ContactPoint; private var _b2Island:b2Island; private var _b2JointNode:b2JointNode; private var _b2OBB:b2OBB; private var _b2BoxDef:b2BoxDef; private var _b2RevoluteJoint:b2RevoluteJoint; private var _b2PolyAndCircleContact:b2PolyAndCircleContact; private var _b2ContactSolver:b2ContactSolver; private var _b2RevoluteJointDef:b2RevoluteJointDef; private var _b2Settings:b2Settings; private var _b2WorldListener:b2WorldListener; private var _b2ContactManager:b2ContactManager; } }//package
Section 108
//EslabonNivel16 (EslabonNivel16) package { import Game.*; public dynamic class EslabonNivel16 extends MWBody { public var __id3_:RectShape; public function EslabonNivel16(){ addFrameScript(0, frame1); __setProp___id3__EslabonNivel16_Layer2_1(); } function __setProp___id3__EslabonNivel16_Layer2_1(){ try { __id3_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id3_.density = 3; __id3_.friction = 0.1; __id3_.restitution = 0.2; try { __id3_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function frame1(){ this.canDestroy = false; this.canPin = false; stop(); } } }//package
Section 109
//Estrellita (Estrellita) package { import flash.display.*; public dynamic class Estrellita extends MovieClip { } }//package
Section 110
//EstrellitaBlanca (EstrellitaBlanca) package { import flash.display.*; public dynamic class EstrellitaBlanca extends MovieClip { } }//package
Section 111
//inGameHelp (inGameHelp) package { import flash.events.*; import Game.*; import flash.display.*; public dynamic class inGameHelp extends MovieClip { public var resume_button:SimpleButton; public var i_tuto:MovieClip; public function inGameHelp(){ addFrameScript(1, frame2); } function frame2(){ resume_button.addEventListener(MouseEvent.CLICK, resumegame, false, 0, true); stop(); } public function resumegame(_arg1:Event){ Globals.gameState = Globals.GAME_RESUME; this.parent.removeChild(this); } } }//package
Section 112
//InGameLevelSelect (InGameLevelSelect) package { import flash.events.*; import flash.geom.*; import Game.*; import flash.display.*; import flash.media.*; import flash.text.*; import flash.utils.*; import flash.net.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.printing.*; import flash.system.*; import flash.ui.*; import flash.xml.*; public dynamic class InGameLevelSelect extends MovieClip { public var resume_button:SimpleButton; public var linksXRow:int; public var links:MovieClip; public function InGameLevelSelect(){ addFrameScript(0, frame1); } function frame1(){ resume_button.addEventListener(MouseEvent.CLICK, resumegame, false, 0, true); linksXRow = 6; refreshLinks(); stop(); } public function resumegame(_arg1:Event){ Globals.gameState = Globals.GAME_RESUME; this.parent.removeChild(this); links = null; } public function refreshLinks(){ var _local1:LevelLink; var _local2:int; if (links){ removeChild(links); }; links = new MovieClip(); _local2 = 0; while (_local2 < Globals.numLevels) { _local1 = new LevelLink(); _local1.levelname.text = ("" + (_local2 + 1)); _local1.y = (Math.floor((_local2 / linksXRow)) * 60); _local1.x = ((_local2 % linksXRow) * 50); if (Globals.savedData.data.levelScores[_local2] >= 0){ _local1.gotoAndStop("check"); }; _local1.addEventListener(MouseEvent.CLICK, selectLevel, false, 0, true); links.addChild(_local1); _local2++; }; links.y = 142; links.x = 244; addChild(links); } public function selectLevel(_arg1:MouseEvent){ var _local2:int; _local2 = int(_arg1.target.levelname.text); this.parent.removeChild(this); Globals.currentLevel = _local2; Globals.gameState = Globals.GAME_RESTART; removeChild(links); links = null; } } }//package
Section 113
//InGameUI (InGameUI) package { import flash.display.*; public dynamic class InGameUI extends MovieClip { public var ui_barra:MovieClip; public var ui_maskbarra:MovieClip; public var selectLevel_button:SimpleButton; public var levelnum:MovieClip; public var music_button:MovieClip; public var help_button:SimpleButton; public function InGameUI(){ addFrameScript(0, frame1); } function frame1(){ ui_barra.visible = false; levelnum.mouseEnabled = false; stop(); } } }//package
Section 114
//LevelLink (LevelLink) package { import flash.events.*; import flash.display.*; import flash.text.*; public dynamic class LevelLink extends MovieClip { public var levelname:TextField; public function LevelLink(){ addFrameScript(0, frame1, 1, frame2, 2, frame3); } function frame3(){ levelname.mouseEnabled = false; this.buttonMode = true; this.addEventListener(MouseEvent.ROLL_OVER, agrandar, false, 0, true); this.addEventListener(MouseEvent.ROLL_OUT, normalizar, false, 0, true); stop(); } function frame1(){ } function frame2(){ levelname.mouseEnabled = false; this.buttonMode = true; this.addEventListener(MouseEvent.ROLL_OVER, agrandar, false, 0, true); this.addEventListener(MouseEvent.ROLL_OUT, normalizar, false, 0, true); stop(); } public function normalizar(_arg1:Event){ this.scaleX = 1; this.scaleY = 1; } public function agrandar(_arg1:Event){ this.scaleX = 1.1; this.scaleY = 1.1; } } }//package
Section 115
//Nivel1 (Nivel1) package { import Game.*; public dynamic class Nivel1 extends MWLevel { } }//package
Section 116
//Nivel10 (Nivel10) package { import Game.*; public dynamic class Nivel10 extends MWLevel { } }//package
Section 117
//Nivel12 (Nivel12) package { import Game.*; public dynamic class Nivel12 extends MWLevel { } }//package
Section 118
//Nivel13 (Nivel13) package { import Game.*; public dynamic class Nivel13 extends MWLevel { } }//package
Section 119
//Nivel14 (Nivel14) package { import Game.*; public dynamic class Nivel14 extends MWLevel { } }//package
Section 120
//Nivel15 (Nivel15) package { import Game.*; public dynamic class Nivel15 extends MWLevel { } }//package
Section 121
//Nivel16 (Nivel16) package { import Game.*; public dynamic class Nivel16 extends MWLevel { } }//package
Section 122
//Nivel17 (Nivel17) package { import Game.*; public dynamic class Nivel17 extends MWLevel { } }//package
Section 123
//Nivel18 (Nivel18) package { import Game.*; public dynamic class Nivel18 extends MWLevel { } }//package
Section 124
//Nivel19 (Nivel19) package { import Game.*; public dynamic class Nivel19 extends MWLevel { } }//package
Section 125
//Nivel2 (Nivel2) package { import Game.*; public dynamic class Nivel2 extends MWLevel { } }//package
Section 126
//Nivel20 (Nivel20) package { import Game.*; public dynamic class Nivel20 extends MWLevel { } }//package
Section 127
//Nivel21 (Nivel21) package { import Game.*; public dynamic class Nivel21 extends MWLevel { } }//package
Section 128
//Nivel22 (Nivel22) package { import Game.*; public dynamic class Nivel22 extends MWLevel { } }//package
Section 129
//Nivel23 (Nivel23) package { import Game.*; public dynamic class Nivel23 extends MWLevel { } }//package
Section 130
//Nivel24 (Nivel24) package { import Game.*; public dynamic class Nivel24 extends MWLevel { } }//package
Section 131
//Nivel25 (Nivel25) package { import Game.*; public dynamic class Nivel25 extends MWLevel { } }//package
Section 132
//Nivel26 (Nivel26) package { import Game.*; public dynamic class Nivel26 extends MWLevel { } }//package
Section 133
//Nivel27 (Nivel27) package { import Game.*; public dynamic class Nivel27 extends MWLevel { } }//package
Section 134
//Nivel28 (Nivel28) package { import Game.*; public dynamic class Nivel28 extends MWLevel { public function Nivel28(){ addFrameScript(0, frame1); } function frame1(){ banderin.visible = false; } } }//package
Section 135
//Nivel29 (Nivel29) package { import Game.*; public dynamic class Nivel29 extends MWLevel { } }//package
Section 136
//Nivel3 (Nivel3) package { import Game.*; public dynamic class Nivel3 extends MWLevel { } }//package
Section 137
//Nivel4 (Nivel4) package { import Game.*; public dynamic class Nivel4 extends MWLevel { } }//package
Section 138
//Nivel5 (Nivel5) package { import Game.*; public dynamic class Nivel5 extends MWLevel { } }//package
Section 139
//Nivel6 (Nivel6) package { import Game.*; public dynamic class Nivel6 extends MWLevel { } }//package
Section 140
//Nivel7 (Nivel7) package { import Game.*; public dynamic class Nivel7 extends MWLevel { } }//package
Section 141
//Nivel8 (Nivel8) package { import Game.*; public dynamic class Nivel8 extends MWLevel { } }//package
Section 142
//Nivel9 (Nivel9) package { import Game.*; public dynamic class Nivel9 extends MWLevel { } }//package
Section 143
//Paquete (Paquete) package { public dynamic class Paquete extends Empacador { } }//package
Section 144
//Pin (Pin) package { import Box2DIntegration.*; public dynamic class Pin extends b2iRevoluteJoint { public function Pin(){ addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4); } function frame3(){ stop(); } function frame1(){ stop(); } function frame4(){ stop(); } function frame2(){ stop(); } } }//package
Section 145
//Pizo (Pizo) package { import Game.*; public dynamic class Pizo extends MWBody { public var __id5_:RectShape; public function Pizo(){ addFrameScript(0, frame1); __setProp___id5__Pizo_Layer1_1(); } function __setProp___id5__Pizo_Layer1_1(){ try { __id5_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id5_.density = 0; __id5_.friction = 0.5; __id5_.restitution = 0.2; try { __id5_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function frame1(){ this.canPin = false; this.canDestroy = false; this.visible = false; } } }//package
Section 146
//RectShape (RectShape) package { import Box2DIntegration.*; public dynamic class RectShape extends b2iBoxShape { public function RectShape(){ addFrameScript(0, frame1); } function frame1(){ this.visible = false; stop(); } } }//package
Section 147
//RevJoint (RevJoint) package { import Box2DIntegration.*; public dynamic class RevJoint extends b2iRevoluteJoint { public function RevJoint(){ addFrameScript(0, frame1); } function frame1(){ this.createJoint(); this.visible = false; } } }//package
Section 148
//ScoreScreen (ScoreScreen) package { import flash.events.*; import flash.geom.*; import Game.*; import flash.display.*; import flash.media.*; import flash.text.*; import flash.utils.*; import flash.net.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.printing.*; import flash.system.*; import flash.ui.*; import flash.xml.*; public dynamic class ScoreScreen extends MovieClip { public var bnext:SimpleButton; public var linksXRow:int; public var links:MovieClip; public var blevelselect:SimpleButton; public var numshapes:TextField; public function ScoreScreen(){ addFrameScript(0, frame1, 1, frame2); } public function nextLevel(_arg1:Event){ Globals.currentLevel++; if (Globals.currentLevel <= (Globals.numLevels + 1)){ Globals.gameState = Globals.GAME_RESTART; this.parent.removeChild(this); }; } function frame1(){ if (Globals.currentLevel == 26){ bnext.visible = false; }; bnext.addEventListener(MouseEvent.CLICK, nextLevel, false, 0, true); blevelselect.addEventListener(MouseEvent.CLICK, flevelSelect, false, 0, true); numshapes.mouseEnabled = false; numshapes.text = Globals.savedData.data.levelScores[(Globals.currentLevel - 1)]; stop(); } function frame2(){ linksXRow = 6; refreshLinks(); stop(); } public function flevelSelect(_arg1:Event){ this.gotoAndStop("levelSelect"); } public function refreshLinks(){ var _local1:LevelLink; var _local2:int; if (links){ removeChild(links); }; links = new MovieClip(); _local2 = 0; while (_local2 < Globals.numLevels) { _local1 = new LevelLink(); _local1.levelname.text = ("" + (_local2 + 1)); _local1.y = (Math.floor((_local2 / linksXRow)) * 60); _local1.x = ((_local2 % linksXRow) * 50); if (Globals.savedData.data.levelScores[_local2] >= 0){ _local1.gotoAndStop("check"); }; _local1.addEventListener(MouseEvent.CLICK, selectLevel, false, 0, true); links.addChild(_local1); _local2++; }; links.y = 142; links.x = 244; addChild(links); } public function selectLevel(_arg1:MouseEvent){ var _local2:int; _local2 = int(_arg1.target.levelname.text); this.parent.removeChild(this); Globals.currentLevel = _local2; Globals.gameState = Globals.GAME_RESTART; removeChild(links); links = null; } } }//package
Section 149
//Snowflake (Snowflake) package { import flash.display.*; public dynamic class Snowflake extends MovieClip { } }//package

Library Items

Symbol 1 GraphicUsed by:2
Symbol 2 MovieClip {Snowflake}Uses:1
Symbol 3 GraphicUsed by:500 699
Symbol 4 GraphicUsed by:8 496 499
Symbol 5 GraphicUsed by:496
Symbol 6 FontUsed by:7
Symbol 7 TextUses:6Used by:8
Symbol 8 ButtonUses:7 4Used by:496
Symbol 9 GraphicUsed by:16 41 318 552
Symbol 10 GraphicUsed by:15 599
Symbol 11 GraphicUsed by:15 599
Symbol 12 GraphicUsed by:15 599
Symbol 13 GraphicUsed by:15 599
Symbol 14 GraphicUsed by:15
Symbol 15 MovieClip {Estrellita}Uses:10 11 12 13 14Used by:16 553 560 566 571 578 584 591 610 621 630 638 645 648 663 672 677 680 684 687 693 694 741
Symbol 16 MovieClipUses:9 15Used by:496
Symbol 17 FontUsed by:18 42 89 175 319 382 480 494 708 709 710 711 777
Symbol 18 TextUses:17Used by:496
Symbol 19 FontUsed by:20 43 90 148 176 320 383 481 495 620 671 691 701 704 718 735 742 743 744 750 762 764 768 770 779 780 782 783
Symbol 20 TextUses:19Used by:496
Symbol 21 GraphicUsed by:41
Symbol 22 GraphicUsed by:41
Symbol 23 GraphicUsed by:41
Symbol 24 GraphicUsed by:41
Symbol 25 GraphicUsed by:41
Symbol 26 GraphicUsed by:41
Symbol 27 GraphicUsed by:41
Symbol 28 GraphicUsed by:41
Symbol 29 GraphicUsed by:41
Symbol 30 GraphicUsed by:41
Symbol 31 GraphicUsed by:41
Symbol 32 GraphicUsed by:41
Symbol 33 GraphicUsed by:41
Symbol 34 GraphicUsed by:41
Symbol 35 GraphicUsed by:41
Symbol 36 GraphicUsed by:41
Symbol 37 GraphicUsed by:41
Symbol 38 GraphicUsed by:41
Symbol 39 GraphicUsed by:41
Symbol 40 GraphicUsed by:41
Symbol 41 MovieClipUses:21 9 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40Used by:496
Symbol 42 TextUses:17Used by:496
Symbol 43 TextUses:19Used by:496
Symbol 44 GraphicUsed by:88 147 174 698
Symbol 45 GraphicUsed by:88
Symbol 46 GraphicUsed by:88
Symbol 47 GraphicUsed by:88
Symbol 48 GraphicUsed by:88
Symbol 49 GraphicUsed by:88
Symbol 50 GraphicUsed by:88
Symbol 51 GraphicUsed by:88
Symbol 52 GraphicUsed by:88
Symbol 53 GraphicUsed by:88
Symbol 54 GraphicUsed by:88
Symbol 55 GraphicUsed by:88
Symbol 56 GraphicUsed by:88
Symbol 57 GraphicUsed by:88
Symbol 58 GraphicUsed by:88
Symbol 59 GraphicUsed by:88
Symbol 60 GraphicUsed by:88
Symbol 61 GraphicUsed by:88
Symbol 62 GraphicUsed by:88
Symbol 63 GraphicUsed by:88
Symbol 64 GraphicUsed by:88
Symbol 65 GraphicUsed by:88
Symbol 66 GraphicUsed by:88
Symbol 67 GraphicUsed by:88
Symbol 68 GraphicUsed by:88
Symbol 69 GraphicUsed by:88
Symbol 70 GraphicUsed by:88
Symbol 71 GraphicUsed by:88
Symbol 72 GraphicUsed by:88
Symbol 73 GraphicUsed by:88
Symbol 74 GraphicUsed by:88
Symbol 75 GraphicUsed by:88
Symbol 76 GraphicUsed by:88
Symbol 77 GraphicUsed by:88
Symbol 78 GraphicUsed by:88
Symbol 79 GraphicUsed by:88
Symbol 80 GraphicUsed by:88
Symbol 81 GraphicUsed by:88
Symbol 82 GraphicUsed by:88
Symbol 83 GraphicUsed by:88
Symbol 84 GraphicUsed by:88
Symbol 85 GraphicUsed by:88
Symbol 86 GraphicUsed by:88
Symbol 87 GraphicUsed by:88
Symbol 88 MovieClipUses:44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87Used by:496
Symbol 89 TextUses:17Used by:496
Symbol 90 TextUses:19Used by:496
Symbol 91 GraphicUsed by:147
Symbol 92 GraphicUsed by:147
Symbol 93 GraphicUsed by:147
Symbol 94 GraphicUsed by:147
Symbol 95 GraphicUsed by:147
Symbol 96 GraphicUsed by:147
Symbol 97 GraphicUsed by:147
Symbol 98 GraphicUsed by:147
Symbol 99 GraphicUsed by:147
Symbol 100 GraphicUsed by:147
Symbol 101 GraphicUsed by:147
Symbol 102 GraphicUsed by:147
Symbol 103 GraphicUsed by:147
Symbol 104 GraphicUsed by:147
Symbol 105 GraphicUsed by:147
Symbol 106 GraphicUsed by:147
Symbol 107 GraphicUsed by:147
Symbol 108 GraphicUsed by:147
Symbol 109 GraphicUsed by:147
Symbol 110 GraphicUsed by:147
Symbol 111 GraphicUsed by:147
Symbol 112 GraphicUsed by:147
Symbol 113 GraphicUsed by:147
Symbol 114 GraphicUsed by:147
Symbol 115 GraphicUsed by:147
Symbol 116 GraphicUsed by:147
Symbol 117 GraphicUsed by:147
Symbol 118 GraphicUsed by:147
Symbol 119 GraphicUsed by:147
Symbol 120 GraphicUsed by:147
Symbol 121 GraphicUsed by:147
Symbol 122 GraphicUsed by:147
Symbol 123 GraphicUsed by:147
Symbol 124 GraphicUsed by:147
Symbol 125 GraphicUsed by:147
Symbol 126 GraphicUsed by:147
Symbol 127 GraphicUsed by:147
Symbol 128 GraphicUsed by:147
Symbol 129 GraphicUsed by:147
Symbol 130 GraphicUsed by:147
Symbol 131 GraphicUsed by:147
Symbol 132 GraphicUsed by:147
Symbol 133 GraphicUsed by:147
Symbol 134 GraphicUsed by:147
Symbol 135 GraphicUsed by:147
Symbol 136 GraphicUsed by:147
Symbol 137 GraphicUsed by:147
Symbol 138 GraphicUsed by:147
Symbol 139 GraphicUsed by:147
Symbol 140 GraphicUsed by:147
Symbol 141 GraphicUsed by:147
Symbol 142 GraphicUsed by:147
Symbol 143 GraphicUsed by:147
Symbol 144 GraphicUsed by:147
Symbol 145 GraphicUsed by:147
Symbol 146 GraphicUsed by:147
Symbol 147 MovieClipUses:91 44 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146Used by:496
Symbol 148 TextUses:19Used by:496
Symbol 149 GraphicUsed by:174
Symbol 150 GraphicUsed by:174
Symbol 151 GraphicUsed by:174
Symbol 152 GraphicUsed by:174
Symbol 153 GraphicUsed by:174
Symbol 154 GraphicUsed by:174
Symbol 155 GraphicUsed by:174
Symbol 156 GraphicUsed by:174
Symbol 157 GraphicUsed by:174
Symbol 158 GraphicUsed by:174
Symbol 159 GraphicUsed by:174
Symbol 160 GraphicUsed by:174
Symbol 161 GraphicUsed by:174
Symbol 162 GraphicUsed by:174
Symbol 163 GraphicUsed by:174
Symbol 164 GraphicUsed by:174
Symbol 165 GraphicUsed by:174
Symbol 166 GraphicUsed by:174
Symbol 167 GraphicUsed by:174
Symbol 168 GraphicUsed by:174
Symbol 169 GraphicUsed by:174
Symbol 170 GraphicUsed by:174
Symbol 171 GraphicUsed by:174
Symbol 172 GraphicUsed by:174
Symbol 173 GraphicUsed by:174
Symbol 174 MovieClipUses:44 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173Used by:496
Symbol 175 TextUses:17Used by:496
Symbol 176 TextUses:19Used by:496
Symbol 177 GraphicUsed by:318
Symbol 178 GraphicUsed by:318
Symbol 179 GraphicUsed by:318
Symbol 180 GraphicUsed by:318
Symbol 181 GraphicUsed by:318
Symbol 182 GraphicUsed by:318
Symbol 183 GraphicUsed by:318
Symbol 184 GraphicUsed by:318
Symbol 185 GraphicUsed by:318
Symbol 186 GraphicUsed by:318
Symbol 187 GraphicUsed by:318
Symbol 188 GraphicUsed by:318
Symbol 189 GraphicUsed by:318
Symbol 190 GraphicUsed by:318
Symbol 191 GraphicUsed by:318
Symbol 192 GraphicUsed by:318
Symbol 193 GraphicUsed by:318
Symbol 194 GraphicUsed by:318
Symbol 195 GraphicUsed by:318
Symbol 196 GraphicUsed by:318
Symbol 197 GraphicUsed by:318
Symbol 198 GraphicUsed by:318
Symbol 199 GraphicUsed by:318
Symbol 200 GraphicUsed by:318
Symbol 201 GraphicUsed by:318
Symbol 202 GraphicUsed by:318
Symbol 203 GraphicUsed by:318
Symbol 204 GraphicUsed by:318
Symbol 205 GraphicUsed by:318
Symbol 206 GraphicUsed by:318
Symbol 207 GraphicUsed by:318
Symbol 208 GraphicUsed by:318
Symbol 209 GraphicUsed by:318
Symbol 210 GraphicUsed by:318
Symbol 211 GraphicUsed by:318
Symbol 212 GraphicUsed by:318
Symbol 213 GraphicUsed by:318
Symbol 214 GraphicUsed by:318
Symbol 215 GraphicUsed by:318
Symbol 216 GraphicUsed by:318
Symbol 217 GraphicUsed by:318
Symbol 218 GraphicUsed by:318
Symbol 219 GraphicUsed by:318
Symbol 220 GraphicUsed by:318
Symbol 221 GraphicUsed by:318
Symbol 222 GraphicUsed by:318
Symbol 223 GraphicUsed by:318
Symbol 224 GraphicUsed by:318
Symbol 225 GraphicUsed by:318
Symbol 226 GraphicUsed by:318
Symbol 227 GraphicUsed by:318
Symbol 228 GraphicUsed by:318
Symbol 229 GraphicUsed by:318
Symbol 230 GraphicUsed by:318
Symbol 231 GraphicUsed by:318
Symbol 232 GraphicUsed by:318
Symbol 233 GraphicUsed by:318
Symbol 234 GraphicUsed by:318
Symbol 235 GraphicUsed by:318
Symbol 236 GraphicUsed by:318
Symbol 237 GraphicUsed by:318
Symbol 238 GraphicUsed by:318
Symbol 239 GraphicUsed by:318
Symbol 240 GraphicUsed by:318
Symbol 241 GraphicUsed by:318
Symbol 242 GraphicUsed by:318
Symbol 243 GraphicUsed by:318
Symbol 244 GraphicUsed by:318
Symbol 245 GraphicUsed by:318
Symbol 246 GraphicUsed by:318
Symbol 247 GraphicUsed by:318
Symbol 248 GraphicUsed by:318
Symbol 249 GraphicUsed by:318
Symbol 250 GraphicUsed by:318
Symbol 251 GraphicUsed by:318
Symbol 252 GraphicUsed by:318
Symbol 253 GraphicUsed by:318
Symbol 254 GraphicUsed by:318
Symbol 255 GraphicUsed by:318
Symbol 256 GraphicUsed by:318
Symbol 257 GraphicUsed by:318
Symbol 258 GraphicUsed by:318
Symbol 259 GraphicUsed by:318
Symbol 260 GraphicUsed by:318
Symbol 261 GraphicUsed by:318
Symbol 262 GraphicUsed by:318
Symbol 263 GraphicUsed by:318
Symbol 264 GraphicUsed by:318
Symbol 265 GraphicUsed by:318
Symbol 266 GraphicUsed by:318
Symbol 267 GraphicUsed by:318
Symbol 268 GraphicUsed by:318
Symbol 269 GraphicUsed by:318
Symbol 270 GraphicUsed by:318
Symbol 271 GraphicUsed by:318
Symbol 272 GraphicUsed by:318
Symbol 273 GraphicUsed by:318
Symbol 274 GraphicUsed by:318
Symbol 275 GraphicUsed by:318
Symbol 276 GraphicUsed by:318
Symbol 277 GraphicUsed by:318
Symbol 278 GraphicUsed by:318
Symbol 279 GraphicUsed by:318
Symbol 280 GraphicUsed by:318
Symbol 281 GraphicUsed by:318
Symbol 282 GraphicUsed by:318
Symbol 283 GraphicUsed by:318
Symbol 284 GraphicUsed by:318
Symbol 285 GraphicUsed by:318
Symbol 286 GraphicUsed by:318
Symbol 287 GraphicUsed by:318
Symbol 288 GraphicUsed by:318
Symbol 289 GraphicUsed by:318
Symbol 290 GraphicUsed by:318
Symbol 291 GraphicUsed by:318
Symbol 292 GraphicUsed by:318
Symbol 293 GraphicUsed by:318
Symbol 294 GraphicUsed by:318
Symbol 295 GraphicUsed by:318
Symbol 296 GraphicUsed by:318
Symbol 297 GraphicUsed by:318
Symbol 298 GraphicUsed by:318
Symbol 299 GraphicUsed by:318
Symbol 300 GraphicUsed by:318
Symbol 301 GraphicUsed by:318
Symbol 302 GraphicUsed by:318
Symbol 303 GraphicUsed by:318
Symbol 304 GraphicUsed by:318
Symbol 305 GraphicUsed by:318
Symbol 306 GraphicUsed by:318
Symbol 307 GraphicUsed by:318
Symbol 308 GraphicUsed by:318
Symbol 309 GraphicUsed by:318
Symbol 310 GraphicUsed by:318
Symbol 311 GraphicUsed by:318
Symbol 312 GraphicUsed by:318
Symbol 313 GraphicUsed by:318
Symbol 314 GraphicUsed by:318
Symbol 315 GraphicUsed by:318
Symbol 316 GraphicUsed by:318
Symbol 317 GraphicUsed by:318
Symbol 318 MovieClipUses:9 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317Used by:496
Symbol 319 TextUses:17Used by:496
Symbol 320 TextUses:19Used by:496
Symbol 321 GraphicUsed by:381
Symbol 322 GraphicUsed by:381 698
Symbol 323 GraphicUsed by:381 697
Symbol 324 GraphicUsed by:381
Symbol 325 GraphicUsed by:381
Symbol 326 GraphicUsed by:381
Symbol 327 GraphicUsed by:381
Symbol 328 GraphicUsed by:381
Symbol 329 GraphicUsed by:381
Symbol 330 GraphicUsed by:381
Symbol 331 GraphicUsed by:381
Symbol 332 GraphicUsed by:381
Symbol 333 GraphicUsed by:381
Symbol 334 GraphicUsed by:381
Symbol 335 GraphicUsed by:381
Symbol 336 GraphicUsed by:381
Symbol 337 GraphicUsed by:381
Symbol 338 GraphicUsed by:381
Symbol 339 GraphicUsed by:381
Symbol 340 GraphicUsed by:381
Symbol 341 GraphicUsed by:381
Symbol 342 GraphicUsed by:381
Symbol 343 GraphicUsed by:381
Symbol 344 GraphicUsed by:381
Symbol 345 GraphicUsed by:381
Symbol 346 GraphicUsed by:381
Symbol 347 GraphicUsed by:381
Symbol 348 GraphicUsed by:381
Symbol 349 GraphicUsed by:381
Symbol 350 GraphicUsed by:381
Symbol 351 GraphicUsed by:381
Symbol 352 GraphicUsed by:381
Symbol 353 GraphicUsed by:381
Symbol 354 GraphicUsed by:381
Symbol 355 GraphicUsed by:381
Symbol 356 GraphicUsed by:381
Symbol 357 GraphicUsed by:381
Symbol 358 GraphicUsed by:381
Symbol 359 GraphicUsed by:381
Symbol 360 GraphicUsed by:381
Symbol 361 GraphicUsed by:381
Symbol 362 GraphicUsed by:381
Symbol 363 GraphicUsed by:381
Symbol 364 GraphicUsed by:381
Symbol 365 GraphicUsed by:381
Symbol 366 GraphicUsed by:381
Symbol 367 GraphicUsed by:381
Symbol 368 GraphicUsed by:381
Symbol 369 GraphicUsed by:381
Symbol 370 GraphicUsed by:381
Symbol 371 GraphicUsed by:381
Symbol 372 GraphicUsed by:381
Symbol 373 GraphicUsed by:381
Symbol 374 GraphicUsed by:381
Symbol 375 GraphicUsed by:381
Symbol 376 GraphicUsed by:381
Symbol 377 GraphicUsed by:381
Symbol 378 GraphicUsed by:381
Symbol 379 GraphicUsed by:381
Symbol 380 GraphicUsed by:381
Symbol 381 MovieClipUses:321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380Used by:496
Symbol 382 TextUses:17Used by:496
Symbol 383 TextUses:19Used by:496
Symbol 384 GraphicUsed by:479
Symbol 385 GraphicUsed by:479 698
Symbol 386 GraphicUsed by:479 697
Symbol 387 GraphicUsed by:479
Symbol 388 GraphicUsed by:479
Symbol 389 GraphicUsed by:479
Symbol 390 GraphicUsed by:479
Symbol 391 GraphicUsed by:479
Symbol 392 GraphicUsed by:479
Symbol 393 GraphicUsed by:479
Symbol 394 GraphicUsed by:479
Symbol 395 GraphicUsed by:479
Symbol 396 GraphicUsed by:479
Symbol 397 GraphicUsed by:479
Symbol 398 GraphicUsed by:479
Symbol 399 GraphicUsed by:479
Symbol 400 GraphicUsed by:479
Symbol 401 GraphicUsed by:479
Symbol 402 GraphicUsed by:479
Symbol 403 GraphicUsed by:479
Symbol 404 GraphicUsed by:479
Symbol 405 GraphicUsed by:479
Symbol 406 GraphicUsed by:479
Symbol 407 GraphicUsed by:479
Symbol 408 GraphicUsed by:479
Symbol 409 GraphicUsed by:479
Symbol 410 GraphicUsed by:479
Symbol 411 GraphicUsed by:479
Symbol 412 GraphicUsed by:479
Symbol 413 GraphicUsed by:479
Symbol 414 GraphicUsed by:479
Symbol 415 GraphicUsed by:479
Symbol 416 GraphicUsed by:479
Symbol 417 GraphicUsed by:479
Symbol 418 GraphicUsed by:479
Symbol 419 GraphicUsed by:479
Symbol 420 GraphicUsed by:479 697
Symbol 421 GraphicUsed by:479
Symbol 422 GraphicUsed by:479
Symbol 423 GraphicUsed by:479
Symbol 424 GraphicUsed by:479
Symbol 425 GraphicUsed by:479
Symbol 426 GraphicUsed by:479
Symbol 427 GraphicUsed by:479
Symbol 428 GraphicUsed by:479
Symbol 429 GraphicUsed by:479
Symbol 430 GraphicUsed by:479
Symbol 431 GraphicUsed by:479
Symbol 432 GraphicUsed by:479
Symbol 433 GraphicUsed by:479
Symbol 434 GraphicUsed by:479
Symbol 435 GraphicUsed by:479
Symbol 436 GraphicUsed by:479
Symbol 437 GraphicUsed by:479
Symbol 438 GraphicUsed by:479
Symbol 439 GraphicUsed by:479
Symbol 440 GraphicUsed by:479
Symbol 441 GraphicUsed by:479
Symbol 442 GraphicUsed by:479
Symbol 443 GraphicUsed by:479
Symbol 444 GraphicUsed by:479
Symbol 445 GraphicUsed by:479
Symbol 446 GraphicUsed by:479
Symbol 447 GraphicUsed by:479
Symbol 448 GraphicUsed by:479
Symbol 449 GraphicUsed by:479
Symbol 450 GraphicUsed by:479
Symbol 451 GraphicUsed by:479
Symbol 452 GraphicUsed by:479
Symbol 453 GraphicUsed by:479
Symbol 454 GraphicUsed by:479
Symbol 455 GraphicUsed by:479
Symbol 456 GraphicUsed by:479
Symbol 457 GraphicUsed by:479
Symbol 458 GraphicUsed by:479
Symbol 459 GraphicUsed by:479
Symbol 460 GraphicUsed by:479
Symbol 461 GraphicUsed by:479
Symbol 462 GraphicUsed by:479
Symbol 463 GraphicUsed by:479
Symbol 464 GraphicUsed by:479
Symbol 465 GraphicUsed by:479
Symbol 466 GraphicUsed by:479
Symbol 467 GraphicUsed by:479
Symbol 468 GraphicUsed by:479
Symbol 469 GraphicUsed by:479
Symbol 470 GraphicUsed by:479
Symbol 471 GraphicUsed by:479
Symbol 472 GraphicUsed by:479
Symbol 473 GraphicUsed by:479
Symbol 474 GraphicUsed by:479
Symbol 475 GraphicUsed by:479
Symbol 476 GraphicUsed by:479
Symbol 477 GraphicUsed by:479
Symbol 478 GraphicUsed by:479
Symbol 479 MovieClip {Drawing_fla.Figura5_116}Uses:384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478Used by:496
Symbol 480 TextUses:17Used by:496
Symbol 481 TextUses:19Used by:496
Symbol 482 GraphicUsed by:493
Symbol 483 GraphicUsed by:493 698
Symbol 484 GraphicUsed by:493
Symbol 485 GraphicUsed by:493
Symbol 486 GraphicUsed by:493
Symbol 487 GraphicUsed by:493
Symbol 488 GraphicUsed by:493
Symbol 489 GraphicUsed by:493
Symbol 490 GraphicUsed by:493
Symbol 491 GraphicUsed by:493
Symbol 492 GraphicUsed by:493
Symbol 493 MovieClipUses:482 483 484 485 486 487 488 489 490 491 492Used by:496
Symbol 494 TextUses:17Used by:496
Symbol 495 TextUses:19Used by:496
Symbol 496 MovieClip {Drawing_fla.Tutorial_107}Uses:4 5 8 16 18 20 41 42 43 88 89 90 147 148 174 175 176 318 319 320 381 382 383 479 480 481 493 494 495Used by:500  Timeline
Symbol 497 GraphicUsed by:499
Symbol 498 GraphicUsed by:499
Symbol 499 ButtonUses:497 498 4Used by:500 702
Symbol 500 MovieClip {inGameHelp}Uses:3 496 499
Symbol 501 GraphicUsed by:505
Symbol 502 GraphicUsed by:503
Symbol 503 MovieClip {RectShape}Uses:502Used by:505 508 510 512 514 540 575 588 590 612 623 629 635 637
Symbol 504 GraphicUsed by:505
Symbol 505 MovieClip {BloqueNivel25}Uses:501 503 504Used by:741
Symbol 506 GraphicUsed by:508
Symbol 507 GraphicUsed by:508
Symbol 508 MovieClip {BloqueNivel14}Uses:506 503 507Used by:648
Symbol 509 GraphicUsed by:510
Symbol 510 MovieClip {BloqueNivel24}Uses:503 509Used by:645
Symbol 511 GraphicUsed by:512
Symbol 512 MovieClip {EslabonNivel16}Uses:511 503Used by:578
Symbol 513 GraphicUsed by:514
Symbol 514 MovieClip {BloqueNivel13}Uses:513 503Used by:560
Symbol 515 FontUsed by:516
Symbol 516 TextUses:515Used by:517
Symbol 517 MovieClip {Paquete}Uses:516
Symbol 518 GraphicUsed by:519
Symbol 519 MovieClipUses:518Used by:536
Symbol 520 GraphicUsed by:534 535
Symbol 521 FontUsed by:522 533
Symbol 522 EditableTextUses:521Used by:535
Symbol 523 GraphicUsed by:527
Symbol 524 ShapeTweeningUsed by:527
Symbol 525 GraphicUsed by:527
Symbol 526 GraphicUsed by:527
Symbol 527 MovieClip {MiniclipIntroAS3_fla.mcProgressBar_4}Uses:523 524 525 526Used by:535
Symbol 528 GraphicUsed by:530
Symbol 529 GraphicUsed by:530
Symbol 530 MovieClipUses:528 529Used by:535
Symbol 531 GraphicUsed by:532 534
Symbol 532 MovieClipUses:531Used by:534 535
Symbol 533 TextUses:521Used by:534
Symbol 534 ButtonUses:520 533 532 531Used by:535
Symbol 535 MovieClip {MiniclipIntroAS3_fla.mcInternalAnimation_3}Uses:520 522 527 530 532 534Used by:536
Symbol 536 MovieClip {com.miniclip.components.GameIntroComponent}Uses:519 535Used by:Timeline
Symbol 537 BitmapUsed by:538
Symbol 538 GraphicUses:537Used by:776  Timeline
Symbol 539 GraphicUsed by:553 560 566 571 578 584 591 600 610 615 621 630 638 641 645 648 651 654 663 666 672 677 680 684 687 693 694 741
Symbol 540 MovieClip {Pizo}Uses:503Used by:553 560 566 571 578 584 591 600 610 615 621 630 638 641 645 648 651 654 663 666 672 677 680 684 687 693 694 741
Symbol 541 GraphicUsed by:549
Symbol 542 GraphicUsed by:549 586 626 683 690 740 760
Symbol 543 GraphicUsed by:549 586 626 683 686 690 740 760
Symbol 544 GraphicUsed by:549 586 604 626 683 686 690 740 760
Symbol 545 GraphicUsed by:549 586 604 626 683 686 690 740 760
Symbol 546 GraphicUsed by:549 586 604 626 683 686 690 740 760
Symbol 547 GraphicUsed by:549 586 604 626 683 686 690 740 760
Symbol 548 GraphicUsed by:549 586 626 683 686 690 740 760
Symbol 549 MovieClipUses:541 542 543 544 545 546 547 548Used by:553
Symbol 550 GraphicUsed by:551
Symbol 551 MovieClip {CircleShape}Uses:550Used by:552
Symbol 552 MovieClip {Bolita}Uses:551 9Used by:553 560 566 571 584 591 600 610 615 621 630 638 645 648 651 663 672 677 687 693 694 741
Symbol 553 MovieClip {Nivel8}Uses:539 540 549 15 552Used by:755
Symbol 554 GraphicUsed by:559
Symbol 555 GraphicUsed by:559 570 573 644 647
Symbol 556 GraphicUsed by:559 570 573 644 647
Symbol 557 GraphicUsed by:559 573 619 644 647
Symbol 558 GraphicUsed by:559
Symbol 559 MovieClipUses:554 555 556 557 558Used by:560
Symbol 560 MovieClip {Nivel13}Uses:539 559 15 552 540 514Used by:755
Symbol 561 GraphicUsed by:565
Symbol 562 GraphicUsed by:565 583 679 760
Symbol 563 GraphicUsed by:564
Symbol 564 MovieClipUses:563Used by:565
Symbol 565 MovieClipUses:561 562 564Used by:566
Symbol 566 MovieClip {Nivel2}Uses:539 540 565 15 552Used by:755
Symbol 567 GraphicUsed by:570
Symbol 568 GraphicUsed by:570 573 619 644
Symbol 569 GraphicUsed by:570
Symbol 570 MovieClipUses:567 568 555 556 569Used by:571
Symbol 571 MovieClip {Nivel5}Uses:539 570 540 15 552Used by:755
Symbol 572 GraphicUsed by:573
Symbol 573 MovieClipUses:555 568 557 556 572Used by:578
Symbol 574 GraphicUsed by:575
Symbol 575 MovieClip {Cajita}Uses:574 503Used by:578 641 654 666 680 684
Symbol 576 GraphicUsed by:577
Symbol 577 MovieClip {RevJoint}Uses:576Used by:578 591 630 638 645 648 755
Symbol 578 MovieClip {Nivel21}Uses:539 573 540 512 575 577 15Used by:755
Symbol 579 GraphicUsed by:583 604 679
Symbol 580 GraphicUsed by:583 661
Symbol 581 GraphicUsed by:583 679
Symbol 582 GraphicUsed by:583
Symbol 583 MovieClipUses:579 580 562 581 582Used by:584
Symbol 584 MovieClip {Nivel10}Uses:539 540 583 15 552Used by:755
Symbol 585 GraphicUsed by:586
Symbol 586 MovieClipUses:585 542 543 544 545 546 547 548Used by:591
Symbol 587 GraphicUsed by:588
Symbol 588 MovieClip {BloqueNivel18}Uses:587 503Used by:591
Symbol 589 GraphicUsed by:590
Symbol 590 MovieClip {Arbol}Uses:503 589Used by:591 663 672
Symbol 591 MovieClip {Nivel18}Uses:539 586 540 588 590 577 15 552Used by:755
Symbol 592 GraphicUsed by:593
Symbol 593 MovieClipUses:592Used by:597 614 640 650 653 665
Symbol 594 GraphicUsed by:595
Symbol 595 MovieClipUses:594Used by:597 640 650 653 665
Symbol 596 GraphicUsed by:597
Symbol 597 MovieClipUses:593 595 596Used by:600
Symbol 598 GraphicUsed by:599
Symbol 599 MovieClip {EstrellitaBlanca}Uses:10 11 12 13 598Used by:600 615 641 651 654 666 755
Symbol 600 MovieClip {Nivel7}Uses:539 540 597 599 552Used by:755
Symbol 601 GraphicUsed by:604
Symbol 602 GraphicUsed by:604 661 674 760
Symbol 603 GraphicUsed by:604 760
Symbol 604 MovieClipUses:601 579 602 603 544 545 546 547Used by:610
Symbol 605 GraphicUsed by:609
Symbol 606 GraphicUsed by:609 662 676
Symbol 607 GraphicUsed by:609
Symbol 608 GraphicUsed by:609 662 676
Symbol 609 MovieClipUses:605 606 607 608Used by:610
Symbol 610 MovieClip {Nivel19}Uses:539 540 604 15 552 609Used by:755
Symbol 611 GraphicUsed by:612
Symbol 612 MovieClip {BloqueNivel12}Uses:611 503Used by:615 621 666 680
Symbol 613 GraphicUsed by:614
Symbol 614 MovieClipUses:593 613Used by:615
Symbol 615 MovieClip {Nivel16}Uses:539 540 612 614 599 552Used by:755
Symbol 616 GraphicUsed by:621
Symbol 617 GraphicUsed by:619
Symbol 618 GraphicUsed by:619
Symbol 619 MovieClipUses:617 557 568 618Used by:621
Symbol 620 TextUses:19Used by:621
Symbol 621 MovieClip {Nivel4}Uses:539 616 619 620 540 15 552 612Used by:755
Symbol 622 GraphicUsed by:623
Symbol 623 MovieClip {Bloque}Uses:622 503Used by:630
Symbol 624 GraphicUsed by:626
Symbol 625 GraphicUsed by:626
Symbol 626 MovieClipUses:624 543 544 545 546 547 548 542 625Used by:630
Symbol 627 GraphicUsed by:629
Symbol 628 GraphicUsed by:629
Symbol 629 MovieClip {BloqueNivel11}Uses:627 503 628Used by:630
Symbol 630 MovieClip {Nivel9}Uses:539 540 623 626 577 629 15 552Used by:755
Symbol 631 GraphicUsed by:633
Symbol 632 GraphicUsed by:633 670 690
Symbol 633 MovieClipUses:631 632Used by:638
Symbol 634 GraphicUsed by:635
Symbol 635 MovieClip {Basura}Uses:503 634Used by:638
Symbol 636 GraphicUsed by:637
Symbol 637 MovieClip {BloqueNivel17}Uses:636 503Used by:638
Symbol 638 MovieClip {Nivel17}Uses:633 539 540 635 637 577 15 552Used by:755
Symbol 639 GraphicUsed by:640
Symbol 640 MovieClipUses:639 593 595Used by:641
Symbol 641 MovieClip {Nivel23}Uses:539 540 640 599 575Used by:755
Symbol 642 GraphicUsed by:644
Symbol 643 GraphicUsed by:644
Symbol 644 MovieClipUses:642 556 555 568 557 643Used by:645
Symbol 645 MovieClip {Nivel22}Uses:539 644 540 510 15 577 552Used by:755
Symbol 646 GraphicUsed by:647
Symbol 647 MovieClipUses:555 556 557 646Used by:648
Symbol 648 MovieClip {Nivel14}Uses:539 647 540 508 577 15 552Used by:755
Symbol 649 GraphicUsed by:650
Symbol 650 MovieClipUses:649 593 595Used by:651
Symbol 651 MovieClip {Nivel6}Uses:539 540 650 599 552Used by:755
Symbol 652 GraphicUsed by:653
Symbol 653 MovieClipUses:652 593 595Used by:654
Symbol 654 MovieClip {Nivel24}Uses:539 540 653 599 575Used by:755
Symbol 655 GraphicUsed by:661 674
Symbol 656 GraphicUsed by:661 674
Symbol 657 GraphicUsed by:661 674
Symbol 658 GraphicUsed by:661 674
Symbol 659 GraphicUsed by:661 674
Symbol 660 GraphicUsed by:661 674
Symbol 661 MovieClipUses:602 655 656 657 658 659 660 580Used by:663 694
Symbol 662 MovieClipUses:606 608Used by:663 694
Symbol 663 MovieClip {Nivel20}Uses:539 540 661 15 552 590 662Used by:755
Symbol 664 GraphicUsed by:665
Symbol 665 MovieClipUses:664 593 595Used by:666
Symbol 666 MovieClip {Nivel15}Uses:539 540 612 665 599 575Used by:755
Symbol 667 GraphicUsed by:672
Symbol 668 GraphicUsed by:670
Symbol 669 GraphicUsed by:670
Symbol 670 MovieClipUses:668 632 669Used by:672
Symbol 671 TextUses:19Used by:672
Symbol 672 MovieClip {Nivel1}Uses:539 540 590 667 670 671 15 552Used by:755
Symbol 673 GraphicUsed by:674
Symbol 674 MovieClipUses:673 602 655 656 657 658 659 660Used by:677
Symbol 675 GraphicUsed by:676
Symbol 676 MovieClipUses:606 608 675Used by:677
Symbol 677 MovieClip {Nivel3}Uses:539 674 540 15 552 676Used by:755
Symbol 678 GraphicUsed by:679
Symbol 679 MovieClipUses:562 579 581 678Used by:680
Symbol 680 MovieClip {Nivel12}Uses:539 540 612 679 15 575Used by:755
Symbol 681 GraphicUsed by:683
Symbol 682 GraphicUsed by:683
Symbol 683 MovieClipUses:681 542 543 544 545 546 547 548 682Used by:684
Symbol 684 MovieClip {Nivel26}Uses:539 683 540 15 575Used by:755
Symbol 685 GraphicUsed by:686
Symbol 686 MovieClipUses:543 544 545 546 547 548 685Used by:687
Symbol 687 MovieClip {Nivel27}Uses:539 540 686 15 552Used by:755
Symbol 688 GraphicUsed by:690
Symbol 689 GraphicUsed by:690
Symbol 690 MovieClipUses:688 543 544 545 546 547 548 542 632 689Used by:693
Symbol 691 TextUses:19Used by:692
Symbol 692 MovieClipUses:691Used by:693
Symbol 693 MovieClip {Nivel28}Uses:539 540 690 15 552 692Used by:755
Symbol 694 MovieClip {Nivel29}Uses:539 540 661 15 552 662Used by:755
Symbol 695 GraphicUsed by:697
Symbol 696 GraphicUsed by:697
Symbol 697 MovieClip {Pin}Uses:695 386 420 323 696Used by:755
Symbol 698 MovieClip {Cursor}Uses:44 483 385 322Used by:755
Symbol 699 MovieClipUses:3Used by:702 753
Symbol 700 GraphicUsed by:702
Symbol 701 TextUses:19Used by:702 753
Symbol 702 MovieClip {InGameLevelSelect}Uses:699 700 701 499Used by:755
Symbol 703 GraphicUsed by:733
Symbol 704 EditableTextUses:19Used by:705
Symbol 705 MovieClip {Drawing_fla.LevelNum_87}Uses:704Used by:733
Symbol 706 GraphicUsed by:712
Symbol 707 FontUsed by:708 709 710 711
Symbol 708 TextUses:17 707Used by:712
Symbol 709 TextUses:17 707Used by:712
Symbol 710 TextUses:17 707Used by:712
Symbol 711 TextUses:17 707Used by:712
Symbol 712 MovieClipUses:706 708 709 710 711Used by:733
Symbol 713 GraphicUsed by:716
Symbol 714 GraphicUsed by:716
Symbol 715 GraphicUsed by:716
Symbol 716 MovieClip {Drawing_fla.MusicButton_89}Uses:713 714 715Used by:733
Symbol 717 GraphicUsed by:721
Symbol 718 TextUses:19Used by:721
Symbol 719 GraphicUsed by:721
Symbol 720 GraphicUsed by:721
Symbol 721 ButtonUses:717 718 719 720Used by:733
Symbol 722 GraphicUsed by:727
Symbol 723 FontUsed by:724 726
Symbol 724 TextUses:723Used by:727
Symbol 725 GraphicUsed by:727
Symbol 726 TextUses:723Used by:727
Symbol 727 ButtonUses:722 724 725 726Used by:733
Symbol 728 GraphicUsed by:733  Timeline
Symbol 729 GraphicUsed by:730
Symbol 730 MovieClipUses:729Used by:733
Symbol 731 GraphicUsed by:732
Symbol 732 MovieClipUses:731Used by:733
Symbol 733 MovieClip {InGameUI}Uses:703 705 712 716 721 727 728 730 732Used by:755
Symbol 734 GraphicUsed by:737
Symbol 735 EditableTextUses:19Used by:737
Symbol 736 GraphicUsed by:737
Symbol 737 MovieClip {LevelLink}Uses:734 735 736Used by:755
Symbol 738 GraphicUsed by:740
Symbol 739 GraphicUsed by:740
Symbol 740 MovieClipUses:738 543 544 545 546 547 548 542 739Used by:741
Symbol 741 MovieClip {Nivel25}Uses:539 740 540 15 505 552Used by:755
Symbol 742 TextUses:19Used by:753
Symbol 743 EditableTextUses:19Used by:753
Symbol 744 TextUses:19Used by:749
Symbol 745 ShapeTweeningUsed by:748 751
Symbol 746 GraphicUsed by:748 749 751 763 765 769 781
Symbol 747 GraphicUsed by:748
Symbol 748 MovieClip {Drawing_fla.Subrayar_100}Uses:745 746 747Used by:749 751 763 765 769 781
Symbol 749 ButtonUses:744 748 746Used by:753
Symbol 750 TextUses:19Used by:751
Symbol 751 ButtonUses:750 748 745 746Used by:753
Symbol 752 GraphicUsed by:753
Symbol 753 MovieClip {ScoreScreen}Uses:699 742 743 749 751 752 701Used by:755
Symbol 754 Sound {Chapter1}Used by:755
Symbol 755 MovieClip {Drawing_fla.Contenedor_1}Uses:553 560 566 571 578 584 591 600 610 615 621 630 638 641 645 648 651 654 663 666 672 677 680 684 687 693 694 697 577 698 702 733 737 741 753 599 754Used by:Timeline
Symbol 756 BitmapUsed by:757
Symbol 757 GraphicUses:756Used by:776  Timeline
Symbol 758 GraphicUsed by:759
Symbol 759 MovieClipUses:758Used by:760
Symbol 760 MovieClipUses:602 562 543 544 545 546 547 548 542 603 759Used by:Timeline
Symbol 761 GraphicUsed by:Timeline
Symbol 762 TextUses:19Used by:763
Symbol 763 ButtonUses:762 748 746Used by:Timeline
Symbol 764 TextUses:19Used by:765
Symbol 765 ButtonUses:764 748 746Used by:Timeline
Symbol 766 GraphicUsed by:767
Symbol 767 MovieClipUses:766Used by:Timeline
Symbol 768 TextUses:19Used by:769
Symbol 769 ButtonUses:768 748 746Used by:Timeline
Symbol 770 TextUses:19Used by:771
Symbol 771 MovieClipUses:770Used by:Timeline
Symbol 772 BitmapUsed by:773
Symbol 773 GraphicUses:772Used by:776
Symbol 774 BitmapUsed by:775
Symbol 775 GraphicUses:774Used by:776
Symbol 776 MovieClip {Drawing_fla.Fondos_120}Uses:773 757 538 775Used by:Timeline
Symbol 777 TextUses:17Used by:Timeline
Symbol 778 FontUsed by:779 782
Symbol 779 TextUses:19 778Used by:Timeline
Symbol 780 TextUses:19Used by:781
Symbol 781 ButtonUses:780 748 746Used by:Timeline
Symbol 782 TextUses:19 778Used by:Timeline
Symbol 783 TextUses:19Used by:Timeline

Instance Names

"intro"Frame 1Symbol 536 MovieClip {com.miniclip.components.GameIntroComponent}
"contenedor"Frame 2Symbol 755 MovieClip {Drawing_fla.Contenedor_1}
"b_play"Frame 3Symbol 763 Button
"b_credits"Frame 3Symbol 765 Button
"aspasmenu"Frame 3Symbol 767 MovieClip
"i_tuto"Frame 4Symbol 496 MovieClip {Drawing_fla.Tutorial_107}
"letsplay"Frame 4Symbol 769 Button
"menu_ad"Frame 4Symbol 771 MovieClip
"i_fondo"Frame 5Symbol 776 MovieClip {Drawing_fla.Fondos_120}
"b_back_credits"Frame 6Symbol 781 Button
"tutback"Symbol 496 MovieClip {Drawing_fla.Tutorial_107} Frame 1Symbol 8 Button
"tutnext"Symbol 496 MovieClip {Drawing_fla.Tutorial_107} Frame 1Symbol 8 Button
"i_tuto"Symbol 500 MovieClip {inGameHelp} Frame 2Symbol 496 MovieClip {Drawing_fla.Tutorial_107}
"resume_button"Symbol 500 MovieClip {inGameHelp} Frame 2Symbol 499 Button
"__id0_"Symbol 505 MovieClip {BloqueNivel25} Frame 1Symbol 503 MovieClip {RectShape}
"__id1_"Symbol 508 MovieClip {BloqueNivel14} Frame 1Symbol 503 MovieClip {RectShape}
"__id2_"Symbol 510 MovieClip {BloqueNivel24} Frame 1Symbol 503 MovieClip {RectShape}
"__id3_"Symbol 512 MovieClip {EslabonNivel16} Frame 1Symbol 503 MovieClip {RectShape}
"__id4_"Symbol 514 MovieClip {BloqueNivel13} Frame 1Symbol 503 MovieClip {RectShape}
"textStatus"Symbol 535 MovieClip {MiniclipIntroAS3_fla.mcInternalAnimation_3} Frame 1Symbol 522 EditableText
"mcProgress"Symbol 535 MovieClip {MiniclipIntroAS3_fla.mcInternalAnimation_3} Frame 1Symbol 527 MovieClip {MiniclipIntroAS3_fla.mcProgressBar_4}
"mcTimer"Symbol 535 MovieClip {MiniclipIntroAS3_fla.mcInternalAnimation_3} Frame 1Symbol 530 MovieClip
"mcOffsite"Symbol 535 MovieClip {MiniclipIntroAS3_fla.mcInternalAnimation_3} Frame 1Symbol 534 Button
"mcBackgroundBlock"Symbol 536 MovieClip {com.miniclip.components.GameIntroComponent} Frame 1Symbol 519 MovieClip
"mcInternalAnimation"Symbol 536 MovieClip {com.miniclip.components.GameIntroComponent} Frame 1Symbol 535 MovieClip {MiniclipIntroAS3_fla.mcInternalAnimation_3}
"__id5_"Symbol 540 MovieClip {Pizo} Frame 1Symbol 503 MovieClip {RectShape}
"__id6_"Symbol 552 MovieClip {Bolita} Frame 1Symbol 551 MovieClip {CircleShape}
"i_bolita"Symbol 553 MovieClip {Nivel8} Frame 1Symbol 552 MovieClip {Bolita}
"i_bolita"Symbol 560 MovieClip {Nivel13} Frame 1Symbol 552 MovieClip {Bolita}
"i_bolita"Symbol 566 MovieClip {Nivel2} Frame 1Symbol 552 MovieClip {Bolita}
"i_bolita"Symbol 571 MovieClip {Nivel5} Frame 1Symbol 552 MovieClip {Bolita}
"__id7_"Symbol 575 MovieClip {Cajita} Frame 1Symbol 503 MovieClip {RectShape}
"i_cajita"Symbol 578 MovieClip {Nivel21} Frame 1Symbol 575 MovieClip {Cajita}
"i_bolita"Symbol 584 MovieClip {Nivel10} Frame 1Symbol 552 MovieClip {Bolita}
"__id8_"Symbol 588 MovieClip {BloqueNivel18} Frame 1Symbol 503 MovieClip {RectShape}
"__id9_"Symbol 590 MovieClip {Arbol} Frame 1Symbol 503 MovieClip {RectShape}
"__id10_"Symbol 590 MovieClip {Arbol} Frame 1Symbol 503 MovieClip {RectShape}
"__id11_"Symbol 590 MovieClip {Arbol} Frame 1Symbol 503 MovieClip {RectShape}
"__id12_"Symbol 590 MovieClip {Arbol} Frame 1Symbol 503 MovieClip {RectShape}
"i_bolita"Symbol 591 MovieClip {Nivel18} Frame 1Symbol 552 MovieClip {Bolita}
"i_bolita"Symbol 600 MovieClip {Nivel7} Frame 1Symbol 552 MovieClip {Bolita}
"i_bolita"Symbol 610 MovieClip {Nivel19} Frame 1Symbol 552 MovieClip {Bolita}
"__id13_"Symbol 612 MovieClip {BloqueNivel12} Frame 1Symbol 503 MovieClip {RectShape}
"i_bolita"Symbol 615 MovieClip {Nivel16} Frame 1Symbol 552 MovieClip {Bolita}
"i_bolita"Symbol 621 MovieClip {Nivel4} Frame 1Symbol 552 MovieClip {Bolita}
"__id14_"Symbol 623 MovieClip {Bloque} Frame 1Symbol 503 MovieClip {RectShape}
"__id15_"Symbol 629 MovieClip {BloqueNivel11} Frame 1Symbol 503 MovieClip {RectShape}
"i_joint"Symbol 630 MovieClip {Nivel9} Frame 1Symbol 577 MovieClip {RevJoint}
"i_bolita"Symbol 630 MovieClip {Nivel9} Frame 1Symbol 552 MovieClip {Bolita}
"__id16_"Symbol 635 MovieClip {Basura} Frame 1Symbol 503 MovieClip {RectShape}
"__id17_"Symbol 637 MovieClip {BloqueNivel17} Frame 1Symbol 503 MovieClip {RectShape}
"i_bolita"Symbol 638 MovieClip {Nivel17} Frame 1Symbol 552 MovieClip {Bolita}
"i_cajita"Symbol 641 MovieClip {Nivel23} Frame 1Symbol 575 MovieClip {Cajita}
"i_bolita"Symbol 645 MovieClip {Nivel22} Frame 1Symbol 552 MovieClip {Bolita}
"i_bolita"Symbol 648 MovieClip {Nivel14} Frame 1Symbol 552 MovieClip {Bolita}
"i_bolita"Symbol 651 MovieClip {Nivel6} Frame 1Symbol 552 MovieClip {Bolita}
"i_cajita"Symbol 654 MovieClip {Nivel24} Frame 1Symbol 575 MovieClip {Cajita}
"i_bolita"Symbol 663 MovieClip {Nivel20} Frame 1Symbol 552 MovieClip {Bolita}
"i_cajita"Symbol 666 MovieClip {Nivel15} Frame 1Symbol 575 MovieClip {Cajita}
"i_bolita"Symbol 672 MovieClip {Nivel1} Frame 1Symbol 552 MovieClip {Bolita}
"i_bolita"Symbol 677 MovieClip {Nivel3} Frame 1Symbol 552 MovieClip {Bolita}
"i_cajita"Symbol 680 MovieClip {Nivel12} Frame 1Symbol 575 MovieClip {Cajita}
"i_cajita"Symbol 684 MovieClip {Nivel26} Frame 1Symbol 575 MovieClip {Cajita}
"i_bolita"Symbol 687 MovieClip {Nivel27} Frame 1Symbol 552 MovieClip {Bolita}
"banderin"Symbol 693 MovieClip {Nivel28} Frame 1Symbol 15 MovieClip {Estrellita}
"i_bolita"Symbol 693 MovieClip {Nivel28} Frame 1Symbol 552 MovieClip {Bolita}
"endingCredits"Symbol 693 MovieClip {Nivel28} Frame 1Symbol 692 MovieClip
"i_bolita"Symbol 694 MovieClip {Nivel29} Frame 1Symbol 552 MovieClip {Bolita}
"resume_button"Symbol 702 MovieClip {InGameLevelSelect} Frame 1Symbol 499 Button
"textfield"Symbol 705 MovieClip {Drawing_fla.LevelNum_87} Frame 1Symbol 704 EditableText
"levelnum"Symbol 733 MovieClip {InGameUI} Frame 1Symbol 705 MovieClip {Drawing_fla.LevelNum_87}
"music_button"Symbol 733 MovieClip {InGameUI} Frame 1Symbol 716 MovieClip {Drawing_fla.MusicButton_89}
"help_button"Symbol 733 MovieClip {InGameUI} Frame 1Symbol 721 Button
"selectLevel_button"Symbol 733 MovieClip {InGameUI} Frame 1Symbol 727 Button
"ui_maskbarra"Symbol 733 MovieClip {InGameUI} Frame 1Symbol 730 MovieClip
"ui_barra"Symbol 733 MovieClip {InGameUI} Frame 1Symbol 732 MovieClip
"levelname"Symbol 737 MovieClip {LevelLink} Frame 1Symbol 735 EditableText
"i_bolita"Symbol 741 MovieClip {Nivel25} Frame 1Symbol 552 MovieClip {Bolita}
"numshapes"Symbol 753 MovieClip {ScoreScreen} Frame 1Symbol 743 EditableText
"bnext"Symbol 753 MovieClip {ScoreScreen} Frame 1Symbol 749 Button
"blevelselect"Symbol 753 MovieClip {ScoreScreen} Frame 1Symbol 751 Button

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata not present, AS3.
Protect (24)Timeline Frame 131 bytes "..$1$SI$aRxj.8bXMZjZJmfeql2IJ1."
Tag 0x0FF (255)Timeline Frame 11 bytes " "

Labels

"teaser"Frame 1
"contenedor"Frame 2
"menu"Frame 3
"instructions"Frame 4
"selectLevel"Frame 5
"credits"Frame 6
"startGame"Frame 7
"locked"Frame 8
"hinge"Symbol 697 MovieClip {Pin} Frame 1
"placedHinge"Symbol 697 MovieClip {Pin} Frame 2
"pin"Symbol 697 MovieClip {Pin} Frame 3
"placedPin"Symbol 697 MovieClip {Pin} Frame 4
"crayon"Symbol 698 MovieClip {Cursor} Frame 1
"borrador"Symbol 698 MovieClip {Cursor} Frame 2
"hinge"Symbol 698 MovieClip {Cursor} Frame 3
"pin"Symbol 698 MovieClip {Cursor} Frame 4
"selectlevel"Symbol 702 MovieClip {InGameLevelSelect} Frame 1
"on"Symbol 716 MovieClip {Drawing_fla.MusicButton_89} Frame 1
"off"Symbol 716 MovieClip {Drawing_fla.MusicButton_89} Frame 2
"uncheck"Symbol 737 MovieClip {LevelLink} Frame 2
"check"Symbol 737 MovieClip {LevelLink} Frame 3
"levelSelect"Symbol 753 MovieClip {ScoreScreen} Frame 2
"amarillo"Symbol 776 MovieClip {Drawing_fla.Fondos_120} Frame 1
"azul"Symbol 776 MovieClip {Drawing_fla.Fondos_120} Frame 2
"blanco"Symbol 776 MovieClip {Drawing_fla.Fondos_120} Frame 3
"negro"Symbol 776 MovieClip {Drawing_fla.Fondos_120} Frame 4




http://swfchan.com/7/30069/info.shtml
Created: 19/5 -2019 13:54:42 Last modified: 19/5 -2019 13:54:42 Server time: 21/12 -2024 18:29:24